/* Standing Watch Field App */
:root {
  --forest: #1e5541;
  --forest-d: #163d2f;
  --steel: #2d7896;
  --char: #121212;
  --cream: #f8f6f1;
  --paper: #ffffff;
  --muted: #6b7280;
  --line: #e5e7eb;
  --ok: #1e5541;
  --svc: #2d7896;
  --attn: #c47b1a;
  --imm: #b3261e;
  --na: #6b7280;
  --pending: #9aa0a6;
  --shadow: 0 8px 28px rgba(15, 20, 18, 0.08);
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  /* Bottom tab bar on every device; auto-hides when idle */
  --nav-w: 0px;
  --nav-h: 64px;
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Keep focused fields above bottom nav on iOS */
  scroll-padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px);
  scroll-padding-top: calc(var(--header-h, 108px) + 52px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--cream);
  color: var(--char);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}

body {
  /* Mobile-first: bottom nav (full width content) */
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}

button,
input,
select,
textarea {
  font: inherit;
  /* 16px minimum prevents iOS Safari zoom on focus */
  font-size: 16px;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

img {
  max-width: 100%;
  display: block;
}

/* Top bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, var(--forest-d), var(--forest));
  color: #fff;
  padding: calc(8px + var(--safe-t)) 12px 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.app-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-home {
  padding: 0;
  background: none;
  border-radius: 9px;
  flex-shrink: 0;
  line-height: 0;
}
.logo-home:active {
  opacity: 0.82;
}
.app-header img.logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #fff;
  object-fit: cover;
  display: block;
}

.app-header h1 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.app-header .sub {
  margin: 2px 0 0;
  font-size: 0.7rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 240px);
}

.app-header .sub a.header-maps {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.app-header-row > div:not(.header-actions) {
  min-width: 0;
  flex: 1;
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}

.icon-btn:active {
  background: rgba(255, 255, 255, 0.22);
}

.icon-btn.header-back {
  width: auto;
  min-width: 40px;
  padding: 0 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  font-weight: 700;
  letter-spacing: 0;
}
.icon-btn.header-back[hidden] {
  display: none !important;
}
.icon-btn.header-back .back-chevron {
  font-size: 1.7rem;
  line-height: 1;
  margin-top: -3px;
}
.icon-btn.header-back .back-label {
  display: none;
  font-size: 0.82rem;
}
@media (min-width: 768px) {
  .icon-btn.header-back .back-label {
    display: inline;
  }
}

/* Progress strip */
.progress-strip {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-strip > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7dcea0, #f4d03f, #f5b041);
  width: 0%;
  transition: width 0.25s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.72rem;
  opacity: 0.9;
}

/* Layout */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px;
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* Cards */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 14px;
  margin-bottom: 12px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--forest);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.field-grid {
  display: grid;
  gap: 10px;
}

@media (min-width: 640px) {
  .field-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

label.field input,
label.field select,
label.field textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 12px;
  font-size: 16px; /* avoid iOS zoom */
  font-weight: 500;
  color: var(--char);
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}

label.field textarea {
  min-height: 88px;
  resize: vertical;
}

label.field input:focus,
label.field select:focus,
label.field textarea:focus {
  outline: 2px solid rgba(45, 120, 150, 0.35);
  border-color: var(--steel);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 44px;
  transition: transform 0.08s ease, opacity 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--forest);
  color: #fff;
}

.btn-steel {
  background: var(--steel);
  color: #fff;
}

.btn-ghost {
  background: #eef2f0;
  color: var(--forest-d);
}

.btn-danger {
  background: #fdecea;
  color: var(--imm);
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn-row .btn {
  flex: 1 1 auto;
  min-width: min(100%, 140px);
}

/* System list */
.system-list {
  display: grid;
  gap: 10px;
}
.check-zone {
  margin-bottom: 16px;
}
.check-zone[data-zone="interior"] .check-zone-head {
  border-color: rgba(30, 85, 65, 0.28);
}
.check-zone[data-zone="exterior"] .check-zone-head {
  border-color: rgba(45, 120, 150, 0.32);
}
.check-zone-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 8px;
  border-bottom: 2px solid var(--forest);
  margin-bottom: 10px;
}
.check-zone-head h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--forest-d);
}
.check-zone-head .hint { margin: 4px 0 0; }
.check-zone-count {
  min-width: 40px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--forest);
  color: #fff;
}
.check-zone[data-zone="exterior"] .check-zone-count { background: var(--steel); }
.check-zone[data-zone="exterior"] .system-card { border-left: 4px solid var(--steel); }
.check-zone[data-zone="interior"] .system-card { border-left: 4px solid var(--forest); }
.visit-clock {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef5f1;
  border: 1px solid rgba(30, 85, 65, 0.18);
}
.visit-clock.ahead { background: #e8f5e9; }
.visit-clock.behind { background: #fff4e5; border-color: rgba(196, 123, 26, 0.35); }
.visit-clock-main {
  font-weight: 800;
  color: var(--forest-d);
  font-size: 1.05rem;
}
.visit-clock-main span { font-weight: 650; color: var(--muted); font-size: 0.9rem; }
.visit-clock-bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(0,0,0,0.08);
  margin: 8px 0 6px;
  overflow: hidden;
}
.visit-clock-bar span {
  display: block;
  height: 100%;
  background: var(--forest);
  border-radius: 99px;
}
.visit-clock.behind .visit-clock-bar span { background: var(--attn); }
.visit-clock-meta { font-size: 0.78rem; color: var(--muted); }

.system-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  padding: 14px;
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow);
  text-align: left;
  color: inherit;
  width: 100%;
  scroll-margin-top: calc(var(--header-h, 108px) + 56px);
  touch-action: manipulation;
}

.system-card:active {
  background: #f3f7f5;
}

.appt-card {
  cursor: pointer;
  grid-template-columns: 1fr auto;
}

.appt-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.system-card .name {
  font-weight: 700;
  font-size: 0.98rem;
}

.system-card .meta {
  font-size: 0.78rem;
  color: var(--muted);
  grid-column: 1;
}

.system-card .badge {
  grid-row: 1 / span 2;
  min-width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #eef5f1;
  color: var(--forest);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.system-card .badge.done {
  background: var(--forest);
  color: #fff;
}

.system-card .badge.warn {
  background: #fff4e5;
  color: var(--attn);
}

/* Job picker — select open job, then checklist */
.job-picker-card h2,
.job-switcher-card h2 {
  margin-bottom: 4px;
}

.job-select-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.job-select-card.is-active {
  border-color: var(--forest);
  box-shadow: 0 0 0 2px rgba(30, 85, 65, 0.18), var(--shadow);
  background: #f4faf6;
}

.job-select-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 12px 12px 10px 14px;
  text-align: left;
  color: inherit;
  width: 100%;
  background: transparent;
  min-width: 0;
}

.job-select-main .name {
  font-weight: 700;
  font-size: 0.95rem;
  grid-column: 1;
  line-height: 1.25;
}

.job-select-main .meta {
  font-size: 0.76rem;
  color: var(--muted);
  grid-column: 1;
  line-height: 1.3;
  word-break: break-word;
}

.job-select-main .badge {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  min-width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #eef5f1;
  color: var(--forest);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8rem;
}

.job-select-main .badge.done {
  background: var(--forest);
  color: #fff;
}

.job-select-main .badge.warn {
  background: #fff4e5;
  color: var(--attn);
}

.job-select-addr,
.appt-addr {
  padding: 0 12px 8px 14px;
}

.addr-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #eef5f1;
  color: var(--forest-d);
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.3;
}

.addr-nav .addr-text {
  font-weight: 650;
  word-break: break-word;
}

.addr-nav .addr-go {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--steel);
}

.addr-missing {
  color: var(--muted);
  font-size: 0.78rem;
}

.addr-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.addr-tools .hint.addr-warn {
  color: var(--attn);
  font-weight: 650;
}

.job-select-actions {
  display: flex;
  flex-direction: row;
  justify-content: stretch;
  padding: 0 10px 10px;
  gap: 8px;
}

.job-select-actions .btn {
  flex: 1;
}

.btn-sm {
  padding: 10px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
  white-space: nowrap;
  min-height: 42px;
}

.open-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--forest);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  vertical-align: middle;
  text-transform: uppercase;
}

.job-switcher-card select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--char);
  background: #fff;
  width: 100%;
}

/* Checklist items */
.item-list {
  display: grid;
  gap: 10px;
}

.item-card {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h, 108px) + 56px);
}

.item-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  width: 100%;
  text-align: left;
  color: inherit;
  min-height: 52px;
  touch-action: manipulation;
}

.item-head:active {
  background: #eef5f1;
}

.item-id {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--steel);
  background: #eaf4f8;
  padding: 4px 8px;
  border-radius: 8px;
}

.item-name {
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.3;
}
.item-price {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--steel);
}

.status-chip {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--pending);
  white-space: nowrap;
  min-width: 3.6em;
  text-align: center;
  flex-shrink: 0;
}

.status-chip.ok { background: var(--ok); }
.status-chip.serviced { background: var(--svc); color: #fff; }
.status-chip.attention { background: var(--attn); }
.status-chip.immediate { background: var(--imm); }
.status-chip.na { background: var(--na); }
.status-chip.pending { background: var(--pending); }

.item-body {
  display: none;
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.item-card.open .item-body {
  display: block;
  padding-top: 12px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

@media (min-width: 520px) {
  .status-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.status-btn {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  background: #fafafa;
  min-height: 44px;
  touch-action: manipulation;
}

.status-btn:active {
  transform: scale(0.97);
  background: #eef2f0;
}

.status-btn.active {
  color: #fff;
  border-color: transparent;
}

.status-btn[data-set-status="ok"].active { background: var(--ok); }
.status-btn[data-set-status="serviced"].active {
  background: var(--svc);
  color: #fff;
  border-color: var(--svc);
}
.status-btn[data-set-status="attention"].active { background: var(--attn); }
.status-btn[data-set-status="immediate"].active { background: var(--imm); }
.status-btn[data-set-status="na"].active { background: var(--na); }
.status-btn[data-set-status="pending"].active { background: var(--pending); }

.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.price-row input {
  min-height: 44px;
  font-size: 16px;
}

.photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  min-height: 76px;
  align-items: flex-start;
}

.photo-thumb {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
}

.photo-add {
  width: 76px;
  height: 76px;
  min-width: 76px;
  min-height: 76px;
  border-radius: 10px;
  border: 2px dashed var(--steel);
  color: var(--steel);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  padding: 4px;
  background: #f3f9fb;
  flex-shrink: 0;
  touch-action: manipulation;
}

.photo-add:active {
  background: #e4f0f4;
}

/*
 * Bottom tab bar on phones and iPad. Slides away when idle;
 * scroll down or tap the peek strip to bring it back.
 */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  height: auto;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  border-right: none;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-around;
  gap: 0;
  padding: 10px 2px calc(4px + var(--safe-b));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  overflow: visible;
  transform: translateY(0);
  transition: transform 0.28s ease;
  pointer-events: auto;
  will-change: transform;
}
.bottom-nav::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 36px;
  height: 4px;
  margin-left: -18px;
  border-radius: 999px;
  background: rgba(30, 85, 65, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.bottom-nav.is-hidden {
  /* Leave a grab strip; ignore taps on the off-screen buttons */
  transform: translateY(calc(100% - 18px - var(--safe-b)));
  pointer-events: none;
  box-shadow: none;
}
.bottom-nav.is-hidden::before {
  opacity: 1;
}
.bottom-nav.is-hidden::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: calc(28px + var(--safe-b));
  pointer-events: auto;
}

.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 2px 8px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  border-radius: 10px;
  min-height: 52px;
  transition: background 0.15s ease, color 0.15s ease;
}

.bottom-nav button .nav-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 1px;
}

/* Short labels on phones; full words on iPad */
.bottom-nav .nav-long {
  display: none;
}
.bottom-nav .nav-short {
  display: inline;
}

@media (min-width: 768px) {
  .bottom-nav .nav-long {
    display: inline;
  }
  .bottom-nav .nav-short {
    display: none;
  }
}

.bottom-nav button .ico {
  font-size: 1.2rem;
  line-height: 1;
}

.bottom-nav button.active {
  color: var(--forest);
  background: #eef5f1;
  box-shadow: inset 0 3px 0 var(--forest);
}

.bottom-nav button:active {
  background: #e8f0eb;
}

.bottom-nav .nav-sync {
  flex: 0 0 auto;
  min-width: 52px;
  color: var(--steel);
  background: #eef6fa;
  margin: 4px 4px 4px 2px;
}
.bottom-nav .nav-sync.active {
  color: var(--steel);
  background: #eef6fa;
  box-shadow: none;
}

.pull-refresh {
  position: fixed;
  left: 50%;
  top: calc(10px + var(--safe-t));
  z-index: 80;
  transform: translate(-50%, -120%);
  background: var(--forest);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(22, 61, 47, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.pull-refresh.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.pull-refresh.is-armed,
.pull-refresh.is-busy {
  background: var(--steel);
}
body:not([data-sw-view="start"]) .pull-refresh {
  top: calc(var(--header-h, 108px) + 6px);
}

/* Summary stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.stat .n {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--forest);
  line-height: 1;
}

.stat .l {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.stat.imm .n { color: var(--imm); }
.stat.attn .n { color: var(--attn); }
.stat.ok .n { color: var(--ok); }

.deficiency-list {
  display: grid;
  gap: 8px;
}

.def-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 0.88rem;
}

.def-row .price {
  font-weight: 700;
  color: var(--forest);
  white-space: nowrap;
  font-size: 0.8rem;
}

/* Toolbar on system detail — stays under the app header while scrolling */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 12px;
  padding: 8px 0 10px;
  position: sticky;
  top: var(--header-h, 108px);
  z-index: 28;
  background: var(--cream);
  border-bottom: 1px solid rgba(30, 85, 65, 0.1);
  box-shadow: 0 8px 10px -8px rgba(15, 20, 18, 0.16);
}

.toolbar h2 {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
  color: var(--forest);
}
.toolbar .system-head {
  flex: 1;
  min-width: 0;
}
.toolbar .system-head h2 { flex: none; }

.search-box {
  width: 100%;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  font-size: 1rem;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  transform: translateX(-50%) translateY(20px);
  background: var(--char);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 100;
  max-width: min(92vw, 360px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 18, 0.45);
  z-index: 80;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 18px 18px 12px 12px;
  width: min(520px, 100%);
  max-height: 85vh;
  overflow: auto;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.modal p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Empty / helper */
.hint {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.job-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef5f1;
  color: var(--forest-d);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 650;
  margin-bottom: 12px;
}

/* Tablets — keep bottom tabs, not a left rail */
@media (min-width: 768px) {
  .job-select-card {
    flex-direction: row;
    align-items: stretch;
  }

  .job-select-actions {
    flex-direction: column;
    justify-content: center;
    padding: 8px 10px 8px 0;
  }

  .app-header {
    padding: calc(10px + var(--safe-t)) 14px 12px;
  }

  .app-header img.logo {
    width: 42px;
    height: 42px;
  }

  .app-header h1 {
    font-size: 1.05rem;
  }

  .app-header .sub {
    max-width: none;
    font-size: 0.75rem;
  }

  .container {
    padding: 14px;
  }
}

@media (min-width: 900px) {
  .app-header {
    border-radius: 0 0 18px 18px;
  }
}

/* Print / export report styles used in generated HTML */
@media print {
  .bottom-nav,
  .app-header,
  .toast {
    display: none !important;
  }
}

/* Login overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 20, 18, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(16px + var(--safe-t)) 12px calc(16px + var(--safe-b));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.login-overlay[hidden] {
  display: none !important;
}

.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px 16px;
  width: min(420px, 100%);
  margin: auto 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  margin: 0 auto 8px;
}

.login-card h2 {
  text-align: center;
  margin: 0 0 16px;
  color: var(--forest);
}
.login-card .btn-block {
  margin-top: 10px;
}
.pass-wrap {
  position: relative;
  display: block;
}
.pass-wrap input {
  padding-right: 72px;
}
.pass-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #eef5f1;
  color: var(--forest-d);
  font-size: 0.78rem;
  font-weight: 800;
}
.pass-toggle[aria-pressed="true"] {
  background: var(--forest);
  color: #fff;
}

.error-text {
  color: var(--imm);
  font-size: 0.88rem;
  font-weight: 600;
  margin: 8px 0;
}

body[data-sw-view="start"] {
  padding-bottom: var(--safe-b);
}
body[data-sw-view="start"] .app-header {
  background: transparent;
  box-shadow: none;
  padding: var(--safe-t) 0 0;
}
body[data-sw-view="start"] .app-header-row,
body[data-sw-view="start"] .progress-strip,
body[data-sw-view="start"] .progress-meta {
  display: none !important;
}
body[data-sw-view="start"] .bottom-nav {
  display: none !important;
}
body[data-sw-view="start"] .container {
  max-width: 440px;
  min-height: calc(100dvh - var(--safe-t) - var(--safe-b));
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-sleep {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 8px 16px;
}
.start-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.start-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #fff;
  object-fit: cover;
  display: block;
  box-shadow: 0 6px 18px rgba(22, 61, 47, 0.16);
}
.start-word {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--forest-d);
}
.start-tag {
  margin: 6px 0 8px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.start-hello {
  margin: 0 0 16px;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--forest-d);
  min-height: 1.2em;
}
.start-legend {
  width: 100%;
  border: 1px solid rgba(30, 85, 65, 0.16);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow);
}
.start-legend button {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  min-height: 56px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--char);
  text-align: left;
  border-radius: 0;
}
.start-legend button:last-child {
  border-bottom: 0;
}
.start-legend button:active {
  background: #f4f8f6;
}
.start-swatch {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  background: #eef5f1;
}
.start-legend-name {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--forest-d);
  letter-spacing: -0.01em;
}
.start-legend-hint {
  display: block;
  margin-top: 1px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.start-foot {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
@media (min-width: 768px) {
  .start-logo { width: 84px; height: 84px; border-radius: 20px; }
  .start-word { font-size: 1.5rem; }
}

.account-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f1f6;
  color: var(--steel);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 650;
  margin: 0;
}

/* Signature pads */
.sig-block {
  margin-top: 10px;
}

.sig-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.sig-canvas {
  width: 100%;
  height: 160px;
  touch-action: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: block;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sig-preview img {
  max-height: 80px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.conn-bar {
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  padding: 5px 10px;
  background: #fff4e5;
  color: #5c3d0a;
}
.conn-bar[hidden] {
  display: none !important;
}
.conn-bar.bad {
  background: #fdecea;
  color: #b3261e;
}

/* GPS / geofence */
.gps-chip {
  display: inline-flex;
  align-items: center;
  max-width: 7.2rem;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.28rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.gps-chip.off {
  opacity: 0.75;
}
.gps-chip.on-site {
  background: rgba(125, 206, 160, 0.35);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}
.gps-chip.err {
  background: rgba(179, 38, 30, 0.55);
  opacity: 1;
}
.gps-help {
  background: #fff6e8;
  color: #5c3d0a;
  padding: 0.7rem 0.9rem 0.8rem;
  font-size: 0.86rem;
  line-height: 1.4;
  border-bottom: 1px solid #ead7b0;
}
.gps-help[hidden] {
  display: none !important;
}
.gps-help strong {
  display: block;
  margin-bottom: 0.2rem;
}
.gps-help a {
  color: var(--forest);
  font-weight: 700;
}

.geo-banner {
  background: linear-gradient(135deg, var(--forest), var(--steel));
  color: #fff;
  padding: 0.55rem 0.85rem 0.65rem;
  font-size: 0.86rem;
  line-height: 1.35;
}
.geo-banner[hidden] {
  display: none !important;
}
.geo-banner strong {
  display: block;
  font-weight: 800;
  margin-bottom: 0.15rem;
}
.geo-banner .hint {
  color: rgba(255, 255, 255, 0.88);
  margin: 0.1rem 0 0;
}
.geo-banner .addr-nav {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  margin-top: 6px;
}
.geo-banner .addr-nav .addr-go {
  color: #fff;
}

/* Very small phones */
@media (max-width: 380px) {
  .bottom-nav button {
    font-size: 0.55rem;
    min-height: 50px;
    padding: 4px 1px 6px;
  }

  .bottom-nav button .ico {
    font-size: 1.1rem;
  }

  .container {
    padding: 10px;
  }

  .card {
    padding: 12px;
  }

  .stat .n {
    font-size: 1.35rem;
  }

  .gps-chip {
    max-width: 4.2rem;
    font-size: 0.58rem;
  }

  .header-actions .icon-btn:nth-child(n + 3) {
    /* keep GPS + sync; slightly tighter */
  }
}

/* Short landscape phones */
@media (max-height: 420px) and (orientation: landscape) {
  .bottom-nav {
    padding-top: 2px;
    padding-bottom: calc(2px + var(--safe-b));
  }

  .bottom-nav button {
    min-height: 44px;
    padding: 4px 2px;
  }

  .bottom-nav button .nav-label {
    display: none;
  }

  :root {
    --nav-h: 48px;
  }
}

/* Ensure focused form controls scroll above bottom nav */
label.field input,
label.field select,
label.field textarea,
.search-box,
.sig-canvas {
  scroll-margin-bottom: calc(var(--nav-h) + var(--safe-b) + 28px);
}

/* Modal sheet above bottom nav on phones */
@media (max-width: 767px) {
  .modal-backdrop {
    padding-bottom: calc(8px + var(--safe-b));
    align-items: flex-end;
  }

  .modal {
    max-height: min(85vh, calc(100dvh - var(--nav-h) - var(--safe-b) - 24px));
    border-radius: 18px 18px 12px 12px;
  }

  .price-row {
    grid-template-columns: 1fr;
  }

  .status-btn {
    min-height: 44px;
    font-size: 0.78rem;
    padding: 12px 6px;
  }

  .item-head {
    min-height: 48px;
  }

  .system-card {
    padding: 12px;
    min-height: 56px;
  }

  .def-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .def-row .price {
    white-space: normal;
  }

  .job-chip,
  .account-chip {
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .toolbar h2 {
    font-size: 0.98rem;
    min-width: 0;
  }
}

/* In-app report preview (iPad PWA cannot open blob windows) */
.report-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #fff;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-t);
  padding-bottom: var(--safe-b);
}
.report-overlay[hidden] {
  display: none !important;
}
.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--forest);
  flex-shrink: 0;
}
.report-toolbar .btn {
  margin: 0;
}
.report-toolbar .btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.report-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.report-overlay iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

/* ── Today’s board ── */
.board-card h2 {
  margin: 0 0 4px;
}
.jobs-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.job-lane {
  border: 1px solid rgba(30, 85, 65, 0.12);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f7faf8);
}
.job-lane[data-lane="today"] {
  border-color: rgba(30, 85, 65, 0.35);
  box-shadow: 0 8px 24px rgba(30, 85, 65, 0.08);
}
.job-lane[data-lane="week"] { border-color: rgba(45, 120, 150, 0.28); }
.job-lane[data-lane="later"] { border-color: rgba(107, 114, 128, 0.2); }
.job-lane[data-lane="done"] { border-color: rgba(0, 0, 0, 0.06); background: #f4f4f2; }
.job-lane-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  text-align: left;
  background: transparent;
  color: var(--forest-d);
}
.job-lane-title {
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.job-lane-count {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--forest);
  color: #fff;
}
.job-lane[data-lane="week"] .job-lane-count { background: var(--steel); }
.job-lane[data-lane="later"] .job-lane-count { background: #8a8175; }
.job-lane[data-lane="done"] .job-lane-count { background: #9aa0a6; }
.job-lane-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 10px 12px;
}
.job-select-card.lane-today { border-left: 4px solid var(--forest); }
.job-select-card.lane-done { opacity: 0.78; border-left: 4px solid #c5c8cc; }
.job-select-card.client-card { border-left: 4px solid var(--steel); }
.job-lane[data-lane="clients"] {
  border-color: rgba(45, 120, 150, 0.35);
  margin-top: 14px;
}
.job-lane[data-lane="clients"] .job-lane-count { background: var(--steel); }
.client-toolbar {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 38%);
  gap: 8px;
  align-items: stretch;
}
.client-search-wrap,
.client-tech-wrap { display: block; min-width: 0; }
.client-toolbar input,
.client-toolbar select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 16px;
  background: #fff;
  color: var(--char);
}
.client-dropdown-wrap { position: relative; }
.client-dropdown {
  margin-top: 6px;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(45, 120, 150, 0.28);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(18, 32, 38, 0.12);
}
.client-option {
  width: 100%;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 11px 12px;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--char);
}
.client-option:last-child { border-bottom: 0; }
.client-option.is-active,
.client-option:active { background: #eef6f8; }
.client-option .name { font-weight: 800; color: var(--forest-d); }
.client-option .meta {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-profile {
  margin-top: 10px;
  border: 1px solid rgba(45, 120, 150, 0.22);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}
.client-profile h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: var(--forest-d);
}
.client-profile .client-kv {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  font-size: 0.86rem;
}
.client-profile .client-kv div { color: var(--char); }
.client-profile .client-kv span { color: var(--muted); margin-right: 6px; }
.client-visits { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.client-visit {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f4f7f6;
}
.client-visit .meta { font-size: 0.78rem; color: var(--muted); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 640px) {
  .client-toolbar { grid-template-columns: 1fr; }
}

/* ── In-app calendar ── */
.cal-card {
  padding: 16px 14px 18px;
  background:
    radial-gradient(1200px 240px at 10% -20%, rgba(45, 120, 150, 0.12), transparent 55%),
    radial-gradient(800px 200px at 110% 0%, rgba(30, 85, 65, 0.16), transparent 50%),
    #fff;
}
.cal-toolbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.cal-heading h2 {
  margin: 0;
  text-align: center;
  font-size: 1.2rem;
  color: var(--forest-d);
}
.cal-heading .hint {
  text-align: center;
  font-size: 0.78rem;
}
.cal-nav {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--forest);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
}
.cal-nav:active { transform: scale(0.96); }
.cal-today-btn {
  width: 100%;
  margin: 0 0 12px;
}
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.week-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px 6px;
  border-radius: 14px;
  background: #f3f6f4;
  color: var(--char);
  min-height: 64px;
}
.week-chip.is-today {
  background: linear-gradient(180deg, #c9a227, #e1c15a);
  color: #1a1408;
}
.week-chip.is-selected {
  outline: 2px solid var(--forest);
  outline-offset: 1px;
}
.week-dow { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
.week-num { font-size: 1.05rem; font-weight: 800; }
.week-dots { font-size: 0.7rem; color: var(--forest); height: 12px; }
.week-chip.is-today .week-dots { color: #1a1408; }
.appt-card.needs-cover {
  border-left: 4px solid #c47b1a;
  background: #fffaf2;
}
.week-agenda {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
}
.week-agenda-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest);
}
.week-next {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef5f1;
  color: var(--char);
  font-weight: 700;
}
.week-next span {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.cal-dow,
.cal-grid,
.cal-nav {
  display: none;
}
.cal-grid[hidden] {
  display: none !important;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  background: #f6f3ee;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 2px 4px;
  color: var(--char);
  min-height: 44px;
}
.cal-cell.is-pad { background: transparent; }
.cal-cell.has-jobs { background: #e7f1ec; }
.cal-cell.is-today {
  background: linear-gradient(180deg, #1e5541, #163d2f);
  color: #fff;
}
.cal-cell.is-selected:not(.is-today) {
  box-shadow: inset 0 0 0 2px var(--forest);
  background: #fff;
}
.cal-cell.is-today.is-selected {
  box-shadow: 0 0 0 2px #f4d03f;
}
.cal-num { font-size: 0.82rem; font-weight: 800; line-height: 1.2; }
.cal-dots { display: flex; gap: 3px; margin-top: 4px; min-height: 7px; }
.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--forest);
  display: block;
}
.cal-dot.later { background: #c9a227; }
.cal-dot.now { background: #2d7896; }
.cal-dot.done { background: #b0b6bc; }
.cal-dot.more { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.cal-cell.is-today .cal-dot { background: #f4d03f; }
.cal-cell.is-today .cal-dot.done { background: rgba(255,255,255,0.45); }
.cal-agenda {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(30, 85, 65, 0.12);
}
.cal-agenda h3 {
  margin: 0 0 10px;
  color: var(--forest);
  font-size: 1.02rem;
}
.appt-time {
  display: inline-block;
  min-width: 4.6rem;
  font-variant-numeric: tabular-nums;
  color: var(--steel);
  font-weight: 800;
  font-size: 0.82rem;
}
.appt-card.kind-later { border-left: 4px solid #c9a227; }
.appt-card.kind-open { border-left: 4px solid var(--forest); }
.appt-card.kind-now { border-left: 4px solid var(--steel); }
.appt-card.kind-done { border-left: 4px solid #c5c8cc; opacity: 0.85; }

@media (min-width: 720px) {
  .cal-cell { min-height: 58px; border-radius: 16px; }
  .cal-num { font-size: 0.95rem; }
  .week-chip { min-height: 72px; }
}
