/* ==========================================================================
   Cal Dental USA — soft-UI restyle
   Direction: light airy ground, white cards on large radii, pastel category
   tints, one confident accent, and a floating pill tab bar where only the
   active tab carries its label.
   Type: Plus Jakarta Sans — heavy and tight for headings, medium for body.
   ========================================================================== */

:root {
  color-scheme: light;

  /* brand */
  --navy:        #101A3D;   /* deep brand ink */
  --accent:      #2F52E0;   /* brightened brand blue: CTAs, active states */
  --accent-deep: #1E3BB5;
  --accent-soft: #E6EBFD;

  --ink:         #0E1013;
  --ink-2:       #3A4050;
  --muted:       #6B7280;
  --muted-2:     #9AA1AE;

  --ground:      #EDEEF1;   /* the light grey the cards float on */
  --surface:     #FFFFFF;
  --surface-2:   #F7F8FA;
  --surface-sunk:#EFF1F4;
  --hairline:    #E9EBEF;
  --hairline-2:  #D9DDE4;

  --urgent:      #E8321A;   /* brand red — emergency + destructive only */
  --urgent-soft: #FDE7E3;
  --go:          #12A150;
  --go-soft:     #DFF5E8;

  --on-accent:     #FFFFFF;
  --on-accent-dim: #C7D2FA;

  --chrome:      rgba(237,238,241,.82);
  --chrome-line: rgba(14,16,19,.07);
  --scrim:       rgba(14,16,19,.38);
  --press:       rgba(14,16,19,.05);

  /* pastel category tints — soft fill, saturated foreground */
  --t-mint:   #DDF3E8;  --tf-mint:   #0C7A4E;
  --t-peach:  #FFE7DA;  --tf-peach:  #C05427;
  --t-lilac:  #EBE5FB;  --tf-lilac:  #6741C4;
  --t-sky:    #DCEAFB;  --tf-sky:    #1C61B8;
  --t-rose:   #FCE3EC;  --tf-rose:   #BC2A62;
  --t-butter: #FBF0D2;  --tf-butter: #8A6912;

  /* default chip tint; each item overrides these two */
  --t:  var(--accent-soft);
  --tf: var(--accent);

  --shadow-1: 0 1px 2px rgba(16,26,61,.04);
  --shadow-2: 0 6px 20px rgba(16,26,61,.07), 0 1px 3px rgba(16,26,61,.04);
  --shadow-3: 0 24px 60px rgba(16,26,61,.16), 0 6px 16px rgba(16,26,61,.07);
  --shadow-bar: 0 10px 30px rgba(16,26,61,.14), 0 2px 8px rgba(16,26,61,.07);

  /* soft-UI metrics: rounder than the iOS default */
  --r-card: 24px;
  --r-group: 22px;
  --r-chip: 16px;
  --r-pill: 999px;
  --tab-h: 62px;
  --nav-h: 46px;
  --gutter: 18px;

  --ease-ios: cubic-bezier(.32,.72,0,1);
  --ease-out: cubic-bezier(.16,1,.3,1);

  --ui: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: var(--ui);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --navy:        #E7EAF3;
    --accent:      #7D97FF;
    --accent-deep: #5F7BF0;
    --accent-soft: #1E2545;

    --ink:         #F2F4F8;
    --ink-2:       #C3C9D6;
    --muted:       #99A0B0;
    --muted-2:     #6E7686;

    --ground:      #101216;
    --surface:     #1A1D23;
    --surface-2:   #21252C;
    --surface-sunk:#23272F;
    --hairline:    #2A2E37;
    --hairline-2:  #3A404B;

    --urgent:      #FF6E56;
    --urgent-soft: #3A1710;
    --go:          #3ED285;
    --go-soft:     #0E2E1E;

    --on-accent:     #0E1013;
    --on-accent-dim: #2A3663;

    --chrome:      rgba(16,18,22,.82);
    --chrome-line: rgba(255,255,255,.08);
    --scrim:       rgba(0,0,0,.6);
    --press:       rgba(255,255,255,.06);

    --t-mint:   #16332A;  --tf-mint:   #4FD3A0;
    --t-peach:  #38221A;  --tf-peach:  #FF9E6E;
    --t-lilac:  #262047;  --tf-lilac:  #B49BFF;
    --t-sky:    #172B45;  --tf-sky:    #74B2F5;
    --t-rose:   #3A1E2B;  --tf-rose:   #FF87B0;
    --t-butter: #332C12;  --tf-butter: #E3C15E;

    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 6px 20px rgba(0,0,0,.45);
    --shadow-3: 0 24px 60px rgba(0,0,0,.6);
    --shadow-bar: 0 10px 30px rgba(0,0,0,.5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --navy:        #E7EAF3;
  --accent:      #7D97FF;
  --accent-deep: #5F7BF0;
  --accent-soft: #1E2545;

  --ink:         #F2F4F8;
  --ink-2:       #C3C9D6;
  --muted:       #99A0B0;
  --muted-2:     #6E7686;

  --ground:      #101216;
  --surface:     #1A1D23;
  --surface-2:   #21252C;
  --surface-sunk:#23272F;
  --hairline:    #2A2E37;
  --hairline-2:  #3A404B;

  --urgent:      #FF6E56;
  --urgent-soft: #3A1710;
  --go:          #3ED285;
  --go-soft:     #0E2E1E;

  --on-accent:     #0E1013;
  --on-accent-dim: #2A3663;

  --chrome:      rgba(16,18,22,.82);
  --chrome-line: rgba(255,255,255,.08);
  --scrim:       rgba(0,0,0,.6);
  --press:       rgba(255,255,255,.06);

  --t-mint:   #16332A;  --tf-mint:   #4FD3A0;
  --t-peach:  #38221A;  --tf-peach:  #FF9E6E;
  --t-lilac:  #262047;  --tf-lilac:  #B49BFF;
  --t-sky:    #172B45;  --tf-sky:    #74B2F5;
  --t-rose:   #3A1E2B;  --tf-rose:   #FF87B0;
  --t-butter: #332C12;  --tf-butter: #E3C15E;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 6px 20px rgba(0,0,0,.45);
  --shadow-3: 0 24px 60px rgba(0,0,0,.6);
  --shadow-bar: 0 10px 30px rgba(0,0,0,.5);
}

/* ---------- base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 10px; }

/* ==========================================================================
   Device frame
   ========================================================================== */
.stage { min-height: 100dvh; display: grid; place-items: center; background: var(--ground); }

.phone {
  position: relative;
  width: 100%;
  height: 100dvh;
  background: var(--ground);
  overflow: hidden;
  isolation: isolate;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 780px) {
  .stage {
    background: radial-gradient(120% 90% at 50% 0%, var(--accent-soft), transparent 70%), var(--ground);
    padding: 28px 16px;
  }
  .phone {
    width: 400px;
    height: min(860px, calc(100dvh - 56px));
    border-radius: 52px;
    box-shadow: 0 0 0 11px #14161B, 0 0 0 13px #303642, var(--shadow-3);
    --safe-top: 48px;
    --safe-bot: 22px;
  }
  .phone::after {
    content: "";
    position: absolute;
    top: 9px; left: 50%;
    transform: translateX(-50%);
    width: 106px; height: 30px;
    background: #14161B;
    border-radius: 999px;
    z-index: 90;
    pointer-events: none;
  }
  .phone::before {
    content: "";
    position: absolute;
    bottom: 8px; left: 50%;
    transform: translateX(-50%);
    width: 132px; height: 5px;
    border-radius: 999px;
    background: var(--ink);
    opacity: .22;
    z-index: 92;
    pointer-events: none;
  }
  .phone .status-bar { display: flex; }
}

.status-bar {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 48px;
  padding: 15px 30px 0;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  z-index: 91;
  pointer-events: none;
}
.status-bar .sb-right { display: flex; align-items: center; gap: 5px; }
.status-bar svg { display: block; }

/* ==========================================================================
   Nav bar
   ========================================================================== */
.navbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 40;
  padding-top: var(--safe-top);
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s linear, background .25s linear;
}
.navbar[data-collapsed="true"] { border-bottom-color: var(--chrome-line); }
.navbar[data-collapsed="false"] { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }

.nav-row {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--gutter);
  position: relative;
}
.nav-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62%;
}
.navbar[data-collapsed="true"] .nav-title { opacity: 1; transform: none; }

/* pill-shaped nav buttons, per the reference */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.nav-btn.left  { left: 12px; padding-left: 11px; }
.nav-btn.right { right: 12px; }
.nav-btn:active { transform: translateY(-50%) scale(.94); }

/* ---------- screens ---------- */
.screens { position: absolute; inset: 0; }

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background: var(--ground);
  padding-top: calc(var(--safe-top) + var(--nav-h));
  padding-bottom: calc(var(--tab-h) + var(--safe-bot) + 30px);
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen[hidden] { display: none !important; }

.large-title {
  padding: 6px var(--gutter) 8px;
  font-size: 34px;
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.large-title .lt-sub {
  display: block;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--muted);
  margin-top: 7px;
  max-width: 34ch;
}

@keyframes push-in  { from { transform: translateX(100%); } to { transform: none; } }
@keyframes push-out { from { transform: none; } to { transform: translateX(-24%); filter: brightness(.96); } }
@keyframes pop-in   { from { transform: translateX(-24%); filter: brightness(.96); } to { transform: none; filter: none; } }
@keyframes pop-out  { from { transform: none; } to { transform: translateX(100%); } }

.screen.is-pushing-in  { animation: push-in .42s var(--ease-ios) both; z-index: 5; box-shadow: -8px 0 28px rgba(16,26,61,.12); }
.screen.is-pushing-out { animation: push-out .42s var(--ease-ios) both; }
.screen.is-popping-in  { animation: pop-in .38s var(--ease-ios) both; }
.screen.is-popping-out { animation: pop-out .38s var(--ease-ios) both; z-index: 5; box-shadow: -8px 0 28px rgba(16,26,61,.12); }

@keyframes tab-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.screen.is-tab-in { animation: tab-in .3s var(--ease-out) both; }

/* ==========================================================================
   Floating pill tab bar — only the active tab carries its label
   ========================================================================== */
.tabbar {
  position: absolute;
  left: 14px; right: 14px;
  bottom: calc(var(--safe-bot) + 12px);
  z-index: 50;
  height: var(--tab-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-bar);
}
.tab {
  flex: 0 0 auto;
  height: 46px;
  min-width: 46px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.015em;
  transition: background .26s var(--ease-out), color .2s linear, flex-grow .26s var(--ease-out);
}
.tab svg { width: 22px; height: 22px; display: block; flex: none; }
.tab span { display: none; white-space: nowrap; }
.tab[aria-selected="true"] {
  flex: 1 1 auto;
  background: var(--accent);
  color: var(--on-accent);
}
.tab[aria-selected="true"] span { display: inline; }
.tab:active { transform: scale(.94); }

/* ==========================================================================
   Building blocks
   ========================================================================== */
.pad { padding-inline: var(--gutter); }
.section { margin-top: 26px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 var(--gutter) 12px;
}
.section-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.section-head .more {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
}
.section-head .more:active { transform: scale(.94); }

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* grouped list, now a soft rounded card */
.group {
  margin: 0 var(--gutter);
  background: var(--surface);
  border-radius: var(--r-group);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.group + .group { margin-top: 18px; }
.group-label {
  padding: 22px var(--gutter) 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.group-note {
  padding: 9px calc(var(--gutter) + 6px) 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
}

.row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 56px;
  padding: 13px 15px;
  text-align: left;
  position: relative;
  background: var(--surface);
  transition: background .12s linear;
}
.row + .row::before {
  content: "";
  position: absolute;
  top: 0; left: 15px; right: 0;
  height: 1px;
  background: var(--hairline);
}
.row + .row.row--inset-full::before { left: 66px; }
.row.row--attached::before { display: none; }
button.row:active, a.row:active { background: var(--press); }

/* pastel tinted icon chip */
.row-ico {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--tf);
  background: var(--t);
}
.row-ico svg { width: 19px; height: 19px; }
.row-body { flex: 1; min-width: 0; }

/* spans inside flex items must be blocks to stack instead of running inline */
.row-title, .row-sub,
.or-name, .or-addr,
.pk-name, .pk-sub,
.mh-name, .mh-sub,
.ad-m, .ad-d,
.day .dw, .day .dn, .day .dm { display: block; }

.row-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-sub { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.row-trail { flex: none; display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 14px; }
.chev { width: 8px; height: 13px; flex: none; color: var(--hairline-2); }

.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-1); }

/* ---------- buttons: pill shaped ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 54px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: transform .14s var(--ease-out), opacity .14s linear;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn svg { width: 19px; height: 19px; }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px rgba(47,82,224,.24); }
.btn--full { width: 100%; }
.btn--soft { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.btn--urgent { background: var(--urgent); color: #fff; }
.btn--ghost { color: var(--accent); }
.btn--sm { height: 44px; font-size: 14.5px; padding: 0 18px; }

:root[data-theme="dark"] .btn--primary,
:root:not([data-theme="light"]) .btn--primary { box-shadow: none; }

/* ---------- chips ---------- */
.chips {
  display: flex;
  gap: 8px;
  padding: 4px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: var(--shadow-1);
  transition: background .15s linear, color .15s linear, transform .15s var(--ease-out);
  scroll-snap-align: start;
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .9; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surface-sunk);
  color: var(--muted);
}
.badge--go { background: var(--go-soft); color: var(--go); }
.badge--closed { background: var(--surface-sunk); color: var(--muted); }
.badge--urgent { background: var(--urgent-soft); color: var(--urgent); }
.badge .pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2.4s var(--ease-out) infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70%  { box-shadow: 0 0 0 7px transparent; opacity: .85; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

/* ==========================================================================
   Home
   ========================================================================== */
.greet {
  padding: 2px var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.greet-when { font-size: 14px; font-weight: 600; color: var(--muted); }
.greet h1 {
  margin: 3px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: -0.038em;
  text-wrap: balance;
  max-width: 15ch;
}
/* circular avatar, per the reference */
.brandmark {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-1);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.03em;
}

.visit-card {
  margin: 18px var(--gutter) 0;
  border-radius: var(--r-card);
  padding: 20px;
  color: var(--on-accent);
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 14px 32px rgba(47,82,224,.22);
  position: relative;
  overflow: hidden;
}
:root[data-theme="dark"] .visit-card,
:root:not([data-theme="light"]) .visit-card { box-shadow: var(--shadow-2); }

.visit-card .vc-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--on-accent-dim);
}
.visit-card .vc-when {
  font-family: var(--display);
  font-weight: 800;
  font-size: 25px;
  line-height: 1.14;
  letter-spacing: -0.032em;
  margin-top: 8px;
}
.visit-card .vc-meta { font-size: 14px; font-weight: 500; color: var(--on-accent-dim); margin-top: 7px; }
.visit-card .vc-actions { display: flex; gap: 9px; margin-top: 18px; }
.visit-card .vc-btn {
  flex: 1;
  height: 44px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.18);
  color: var(--on-accent);
  font-size: 14.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform .14s var(--ease-out), background .14s linear;
}
.visit-card .vc-btn svg { width: 17px; height: 17px; }
.visit-card .vc-btn:active { transform: scale(.97); }
.visit-card .vc-btn--solid { background: var(--surface); color: var(--accent); }

/* quick actions */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  padding: 0 var(--gutter);
  margin-top: 18px;
}
.quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 15px 4px 13px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink-2);
  transition: transform .16s var(--ease-out);
}
.quick:active { transform: scale(.955); }
.quick .qi {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--t);
  color: var(--tf);
}
.quick .qi svg { width: 20px; height: 20px; }

/* horizontal office rail */
.rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2px var(--gutter) 8px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: none; }

.office-card {
  width: 246px;
  padding: 17px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: transform .16s var(--ease-out);
}
.office-card:active { transform: scale(.975); }
.office-card .oc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.office-card .oc-name { font-size: 16px; font-weight: 800; letter-spacing: -0.028em; line-height: 1.22; }
.office-card .oc-addr {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.office-card .oc-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }

.brand-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--bd, var(--accent)); }
.dist { font-size: 12.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* service tiles */
.svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; padding: 0 var(--gutter); }
.svc-tile {
  text-align: left;
  padding: 17px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
  transition: transform .16s var(--ease-out);
}
.svc-tile:active { transform: scale(.972); }
.svc-tile .si {
  width: 44px; height: 44px;
  border-radius: var(--r-chip);
  display: grid;
  place-items: center;
  background: var(--t);
  color: var(--tf);
}
.svc-tile .si svg { width: 22px; height: 22px; }
.svc-tile .sv-name { font-size: 15px; font-weight: 800; letter-spacing: -0.028em; line-height: 1.2; margin-top: auto; }
.svc-tile .sv-tag { font-size: 12.5px; font-weight: 500; color: var(--muted); line-height: 1.35; }

/* network stat band */
.stats { margin: 0 var(--gutter); padding: 22px 18px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1); }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { text-align: center; }
.stat .n {
  font-family: var(--display);
  font-weight: 800;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat .l { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-top: 7px; }
.stats .divider { height: 1px; background: var(--hairline); margin: 20px 0 16px; }
.stats h3 { margin: 0 0 7px; font-size: 17px; font-weight: 800; letter-spacing: -0.028em; }
.stats p { margin: 0; font-size: 13.5px; font-weight: 500; line-height: 1.5; color: var(--muted); }

/* financing banner — a tinted card rather than a bordered one */
.fin {
  margin: 0 var(--gutter);
  padding: 20px;
  border-radius: var(--r-card);
  background: var(--t-mint);
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  width: calc(100% - var(--gutter) * 2);
}
.fin h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.028em; color: var(--tf-mint); }
.fin p { margin: 0; font-size: 13.5px; font-weight: 500; line-height: 1.5; color: var(--tf-mint); opacity: .82; }
.fin .fin-cta { margin-top: 10px; font-size: 14px; font-weight: 800; color: var(--tf-mint); }

/* ==========================================================================
   Offices
   ========================================================================== */
.searchbar { padding: 4px var(--gutter) 12px; }
.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 50px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--muted);
}
.search-field svg { width: 18px; height: 18px; flex: none; }
.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}
.search-field input::placeholder { color: var(--muted-2); font-weight: 500; }
.search-clear { flex: none; width: 20px; height: 20px; display: grid; place-items: center; color: var(--muted-2); }

.office-row {
  display: flex;
  gap: 13px;
  width: 100%;
  padding: 15px;
  text-align: left;
  background: var(--surface);
  position: relative;
  align-items: flex-start;
}
.office-row + .office-row::before {
  content: "";
  position: absolute;
  top: 0; left: 15px; right: 0;
  height: 1px;
  background: var(--hairline);
}
.office-row:active { background: var(--press); }
.office-row .or-brand {
  flex: none;
  width: 46px; height: 46px;
  border-radius: var(--r-chip);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  background: var(--bd, var(--accent));
}
.office-row .or-body { flex: 1; min-width: 0; }
.office-row .or-name { font-size: 16px; font-weight: 800; letter-spacing: -0.028em; line-height: 1.22; }
.office-row .or-addr { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.office-row .or-tags { display: flex; align-items: center; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.office-row .or-trail { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 3px; }

.empty { padding: 50px 30px; text-align: center; color: var(--muted); font-size: 14.5px; font-weight: 500; line-height: 1.5; }
.empty svg { width: 36px; height: 36px; margin-bottom: 12px; color: var(--hairline-2); }

.loc-note {
  margin: 0 var(--gutter) 12px;
  padding: 13px 15px;
  border-radius: 16px;
  background: var(--surface-sunk);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
}

/* ==========================================================================
   Sheets
   ========================================================================== */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: var(--scrim);
  opacity: 0;
  transition: opacity .34s var(--ease-ios);
}
.scrim.is-open { opacity: 1; }
.scrim[hidden] { display: none; }

.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 61;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -10px 44px rgba(16,26,61,.2);
  transform: translateY(100%);
  transition: transform .42s var(--ease-ios);
  padding-bottom: var(--safe-bot);
}
.sheet.is-open { transform: none; }
.sheet[hidden] { display: none; }

.sheet-grab { flex: none; padding: 10px 0 6px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grab i { display: block; width: 40px; height: 5px; border-radius: 999px; background: var(--hairline-2); }
.sheet-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px 0 20px;
  scrollbar-width: none;
}
.sheet-scroll::-webkit-scrollbar { display: none; }

.sheet-head { padding: 8px var(--gutter) 2px; }
.sheet-head h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.038em; line-height: 1.12; text-wrap: balance; }
.sheet-head .sh-sub { margin-top: 7px; font-size: 14px; font-weight: 500; color: var(--muted); }
.sheet-body { padding: 16px var(--gutter) 0; }
.sheet-body p { margin: 0 0 12px; font-size: 15px; font-weight: 500; line-height: 1.55; color: var(--ink-2); max-width: 40ch; }
.sheet-actions { display: flex; gap: 9px; padding: 16px var(--gutter) 4px; }
.sheet-actions .btn { flex: 1; }

.bullets { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.bullets li { display: flex; gap: 11px; font-size: 14.5px; font-weight: 500; line-height: 1.45; color: var(--ink-2); }
.bullets svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--go); }

.hours-grid { display: grid; gap: 2px; margin-top: 4px; }
.hours-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 14.5px;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: 14px;
}
.hours-line .hl-day { color: var(--muted); }
.hours-line .hl-time { font-variant-numeric: tabular-nums; }
.hours-line.is-today { background: var(--accent-soft); }
.hours-line.is-today .hl-day,
.hours-line.is-today .hl-time { color: var(--accent); font-weight: 700; }

.minimap {
  position: relative;
  height: 140px;
  margin: 0 var(--gutter);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.minimap canvas { display: block; width: 100%; height: 100%; }
.minimap .mm-tag {
  position: absolute;
  left: 12px; bottom: 11px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface);
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: var(--shadow-1);
}

/* ==========================================================================
   Booking
   ========================================================================== */
.bk-progress { display: flex; gap: 6px; padding: 0 var(--gutter) 16px; }
.bk-progress i {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--hairline);
  overflow: hidden;
  position: relative;
}
.bk-progress i.done::after, .bk-progress i.now::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: 999px;
  transform-origin: left;
  animation: fill .45s var(--ease-out) both;
}
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.bk-step-label {
  padding: 0 var(--gutter) 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.pick-list { display: flex; flex-direction: column; gap: 10px; padding: 0 var(--gutter); }
.pick {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 15px;
  text-align: left;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-1);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
  position: relative;
}
.pick:active { transform: scale(.985); }
.pick[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent), var(--shadow-1); }
.pick .pk-ico {
  flex: none;
  width: 44px; height: 44px;
  border-radius: var(--r-chip);
  display: grid;
  place-items: center;
  background: var(--t);
  color: var(--tf);
}
.pick .pk-ico svg { width: 21px; height: 21px; }
.pick .pk-body { flex: 1; min-width: 0; }
.pick .pk-name { font-size: 16px; font-weight: 800; letter-spacing: -0.028em; line-height: 1.22; }
.pick .pk-sub { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.pick .pk-check {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-sunk);
  color: transparent;
  transition: background .18s var(--ease-out), color .18s var(--ease-out), transform .18s var(--ease-out);
}
.pick .pk-check svg { width: 13px; height: 13px; }
.pick[aria-pressed="true"] .pk-check { background: var(--accent); color: var(--on-accent); transform: scale(1.06); }

/* date strip — rounded day pills, the active one filled */
.date-strip {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px var(--gutter) 4px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.date-strip::-webkit-scrollbar { display: none; }
.day {
  flex: none;
  width: 60px;
  padding: 12px 0 13px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-align: center;
  scroll-snap-align: start;
  transition: transform .15s var(--ease-out), background .15s linear;
}
.day:active { transform: scale(.95); }
.day .dw { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-2); }
.day .dn { font-size: 20px; font-weight: 800; letter-spacing: -0.035em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.day .dm { font-size: 10px; font-weight: 600; color: var(--muted-2); margin-top: 2px; text-transform: uppercase; }
.day[aria-pressed="true"] { background: var(--accent); }
.day[aria-pressed="true"] .dw,
.day[aria-pressed="true"] .dn,
.day[aria-pressed="true"] .dm { color: var(--on-accent); }
.day[disabled] { opacity: .32; pointer-events: none; }

.slot-block { padding: 0 var(--gutter); }
.slot-block h4 {
  margin: 20px 0 11px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.slot {
  height: 48px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: transform .14s var(--ease-out), background .14s linear, color .14s linear;
}
.slot:active { transform: scale(.94); }
.slot[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.slot[disabled] { opacity: .3; pointer-events: none; text-decoration: line-through; }

/* form fields */
.fields { display: flex; flex-direction: column; gap: 16px; padding: 0 var(--gutter); }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 8px;
}
.field input, .field textarea {
  width: 100%;
  border: 0;
  background: var(--surface);
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 16px;   /* >=16px stops iOS zooming on focus */
  font-weight: 500;
  box-shadow: var(--shadow-1);
  outline: none;
  transition: box-shadow .16s var(--ease-out);
  resize: none;
}
.field input:focus, .field textarea:focus { box-shadow: 0 0 0 2px var(--accent); }
.field.has-error input, .field.has-error textarea { box-shadow: 0 0 0 2px var(--urgent); }
.field .err { display: none; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--urgent); }
.field.has-error .err { display: block; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-1);
  font-size: 15.5px;
  font-weight: 600;
  width: 100%;
  text-align: left;
}
.switch { flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--hairline-2); position: relative; transition: background .26s var(--ease-ios); }
.switch i {
  position: absolute;
  top: 3px; left: 3px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.2);
  transition: transform .26s var(--ease-ios);
}
[aria-pressed="true"] > .switch { background: var(--go); }
[aria-pressed="true"] > .switch i { transform: translateX(20px); }

.bk-summary {
  margin: 20px var(--gutter) 0;
  padding: 18px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bk-summary .bs-line { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 14px; }
.bk-summary .bs-k { color: var(--muted); font-weight: 500; flex: none; }
.bk-summary .bs-v { text-align: right; font-weight: 700; letter-spacing: -0.015em; }

/* The primary action rides at the end of the flow rather than sticking, so it
   never floats over list rows or collides with the floating tab bar. */
.screen-foot {
  margin-top: 26px;
  padding: 0 var(--gutter);
}

/* confirmation */
.done-wrap { padding: 30px var(--gutter) 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.done-ring { width: 96px; height: 96px; margin-bottom: 20px; }
.done-ring circle {
  fill: none;
  stroke: var(--go);
  stroke-width: 4;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  animation: draw-ring .6s var(--ease-out) forwards;
}
.done-ring path {
  fill: none;
  stroke: var(--go);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: draw-ring .38s var(--ease-out) .48s forwards;
}
@keyframes draw-ring { to { stroke-dashoffset: 0; } }

.done-wrap h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 29px; letter-spacing: -0.038em; }
.done-wrap .done-sub { margin-top: 9px; font-size: 14.5px; font-weight: 500; color: var(--muted); line-height: 1.5; }
.done-card { width: 100%; margin-top: 24px; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-1); overflow: hidden; text-align: left; }
.done-ref { margin-top: 16px; font-size: 12.5px; font-weight: 600; color: var(--muted-2); letter-spacing: .05em; font-variant-numeric: tabular-nums; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .42s var(--ease-out) both; }
.rise-1 { animation-delay: .06s; }
.rise-2 { animation-delay: .12s; }
.rise-3 { animation-delay: .18s; }

/* ==========================================================================
   Me
   ========================================================================== */
.me-head { display: flex; align-items: center; gap: 15px; padding: 4px var(--gutter) 20px; }
.me-avatar {
  width: 66px; height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  box-shadow: var(--shadow-1);
  flex: none;
}
.me-head .mh-name { font-size: 22px; font-weight: 800; letter-spacing: -0.035em; }
.me-head .mh-sub { font-size: 13.5px; font-weight: 500; color: var(--muted); margin-top: 3px; }

.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-sunk); border-radius: var(--r-pill); }
.seg button {
  flex: 1;
  height: 34px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink-2);
  transition: background .18s var(--ease-out), color .18s linear;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.appt-row { display: flex; gap: 13px; align-items: center; }
.appt-date {
  flex: none;
  width: 52px;
  padding: 9px 0 10px;
  border-radius: var(--r-chip);
  background: var(--accent-soft);
  text-align: center;
  color: var(--accent);
}
.appt-date .ad-m { font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.appt-date .ad-d { font-size: 19px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.appt-row.is-past .appt-date { background: var(--surface-sunk); color: var(--muted); }

/* team */
.team-row { display: flex; align-items: center; gap: 13px; }
.team-av {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-sunk);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.team-row.is-lead .team-av { background: var(--accent-soft); color: var(--accent); }

/* ==========================================================================
   Toast + demo note
   ========================================================================== */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-bot) + 26px);
  transform: translate(-50%, 16px);
  z-index: 70;
  max-width: calc(100% - 44px);
  padding: 14px 20px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--ground);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out);
  text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.demo-note {
  margin: 26px var(--gutter) 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-sunk);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .done-ring circle, .done-ring path { stroke-dashoffset: 0; }
}
