/* Coach Moishy portal. Tokens match the Coach Moishy design system:
   navy and white carry everything, pink and mist are the accents that make
   the right thing pop. Figtree throughout. Phone first. */
:root {
  --navy: #192F5F;
  --white: #FFFFFF;
  --pink: #D68CA3;
  --mist: #F0F2F7;
  --ink-muted: rgba(25, 47, 95, 0.72);
  --line: rgba(25, 47, 95, 0.12);
  --line-strong: rgba(25, 47, 95, 0.28);
  --on-navy-muted: rgba(255, 255, 255, 0.75);
  --error: #D94F3D;
  --radius-sm: 6px; --radius-md: 12px; --radius-lg: 20px;
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--white); color: var(--navy); font: 400 16px/24px var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1 { font: 600 28px/34px var(--font); margin: 0; text-wrap: balance; }
h2 { font: 600 20px/26px var(--font); margin: 0; }
h3 { font: 600 17px/24px var(--font); margin: 0; }
p { margin: 0; }
.muted { color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.num { font-variant-numeric: tabular-nums; }
.hl { color: var(--pink); }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: var(--white);
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 17px/22px var(--font); color: var(--white); text-decoration: none; }
.brand img { height: 30px; width: auto; }
.me { position: relative; }
.initials { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--on-navy-muted); background: transparent; color: var(--white);
  font: 600 14px/1 var(--font); cursor: pointer; }
.initials:hover { border-color: var(--pink); }
.menu { position: absolute; right: 0; top: 44px; background: var(--white); color: var(--navy); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: 0 6px 20px rgba(25,47,95,.12); min-width: 200px; padding: 8px; }
.menu p { padding: 8px 10px; }
.menu button { width: 100%; text-align: left; }

.layout { display: flex; min-height: calc(100vh - 56px); }
.side { display: none; }
main { flex: 1; min-width: 0; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 110px max(16px, env(safe-area-inset-left, 0px)); }
.page { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--white); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
.tabs a { flex: 1; text-align: center; padding: 8px 4px; color: var(--ink-muted); text-decoration: none; font: 500 13px/18px var(--font); border-top: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--navy); font-weight: 600; border-top-color: var(--pink); }
@media (min-width: 900px) {
  .tabs { display: none; }
  .side { display: flex; flex-direction: column; gap: 2px; width: 220px; padding: 24px 12px; border-right: 1px solid var(--line); background: var(--white); }
  .side a { padding: 10px 14px; border-radius: var(--radius-sm); color: var(--ink-muted); text-decoration: none; font: 500 15px/20px var(--font); }
  .side a:hover { color: var(--pink); }
  .side a[aria-current="page"] { color: var(--navy); font-weight: 600; background: var(--mist); }
  main { padding-bottom: 48px; }
}

/* ---------- pieces from the design system ---------- */
.link { font: 500 15px/20px var(--font); color: var(--navy); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; text-underline-offset: 4px; }
.link:hover { color: var(--pink); text-decoration: underline; }
.btn { font: 500 15px/20px var(--font); height: 40px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--navy);
  background: var(--navy); color: var(--white); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { background: var(--white); color: var(--navy); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.quiet { font: 500 15px/20px var(--font); height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--white); color: var(--navy); cursor: pointer; }
.quiet:hover { border-color: var(--pink); }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font: 500 14px/20px var(--font); }
input, select, textarea { font: 400 16px/24px var(--font); color: var(--navy); background: var(--white); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--line); }
.help { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.error { color: var(--error); font-size: 14px; }

.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mist { background: var(--mist); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.highlight { background: var(--pink); color: var(--navy); border-radius: var(--radius-md); padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }

.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/18px var(--font); padding: 3px 8px; border-radius: var(--radius-sm);
  background: var(--mist); color: var(--navy); white-space: nowrap; }
.tag.done { background: var(--navy); color: var(--white); }
.tag.next { background: var(--pink); color: var(--navy); }
.tag.wait { background: var(--white); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tag.needs { background: var(--white); color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }

.list { list-style: none; margin: 0; padding: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.list li.click { cursor: pointer; }
.list li.click:hover .rowtitle { color: var(--pink); }
.list .rowtitle { font-weight: 500; }
.list .when { color: var(--ink-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.empty { color: var(--ink-muted); font-size: 15px; padding: 14px 16px; }

.journey { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; }
.journey li { flex: 1; display: flex; flex-direction: column; gap: 8px; font: 500 13px/18px var(--font); color: var(--ink-muted); min-width: 0; }
.journey .bar { height: 4px; background: var(--line); margin-right: 4px; border-radius: 2px; }
.journey li.done .bar { background: var(--navy); }
.journey li.done { color: var(--navy); }
.journey li.current .bar { background: var(--pink); }
.journey li.current { color: var(--navy); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--mist); border-radius: var(--radius-md); padding: 14px 16px; }
.stat b { display: block; font: 600 26px/32px var(--font); font-variant-numeric: tabular-nums; }

.lanes { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font: 500 15px/20px var(--font); }
.lanes button { background: none; border: 0; padding: 0 0 4px; color: var(--ink-muted); cursor: pointer; font: inherit; border-bottom: 2px solid transparent; }
.lanes button:hover { color: var(--pink); }
.lanes button[aria-pressed="true"] { color: var(--navy); font-weight: 600; border-bottom-color: var(--pink); }
.lanes .sep { color: var(--ink-muted); }

.sheet-back { position: fixed; inset: 0; background: rgba(25,47,95,.35); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--white); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 640px) { .sheet-back { align-items: center; } .sheet { border-radius: var(--radius-lg); } }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--navy); background: var(--mist); }
.choice input { width: auto; margin-top: 4px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.note { white-space: pre-wrap; background: var(--mist); border-radius: var(--radius-md); padding: 14px 16px; font-size: 15px; line-height: 22px; }

.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--mist); padding: 24px 16px; }
.signin .box { width: 100%; max-width: 420px; background: var(--white); border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(25,47,95,.06), 0 6px 20px rgba(25,47,95,.06);
  padding: 32px 28px; display: flex; flex-direction: column; gap: 18px; }
.signin img { height: 64px; width: auto; align-self: flex-start; }

.bottomlink { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 21;
  background: var(--white); border: 1px solid var(--error); color: var(--error); border-radius: var(--radius-sm); padding: 8px 12px; font: 500 14px/18px var(--font); cursor: pointer; }
@media (min-width: 900px) { .bottomlink { bottom: 24px; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--ink-muted); border-top: 0; }
.scroll { overflow-x: auto; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.joshbtn { background: transparent; border: 1px solid var(--on-navy-muted); color: var(--white); border-radius: var(--radius-sm); height: 36px; padding: 0 12px; font: 500 14px/1 var(--font); cursor: pointer; }
.joshbtn:hover { border-color: var(--pink); color: var(--pink); }
.jlog { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; min-height: 160px; overflow-y: auto; }
.jlog div { white-space: pre-wrap; padding: 10px 14px; border-radius: var(--radius-md); max-width: 88%; font-size: 15px; line-height: 22px; }
.jlog .jjosh { background: var(--mist); align-self: flex-start; }
.jlog .jyou { background: var(--navy); color: var(--white); align-self: flex-end; }

/* Sign in with Google or Microsoft: quiet outline buttons under the code button. */
.signin .or { text-align: center; color: var(--ink-muted, rgba(25,47,95,.72)); font-size: 14px; margin: 4px 0; }
.btn-quiet { display: flex; align-items: center; justify-content: center; height: 40px; border: 1px solid rgba(25,47,95,.28); border-radius: 6px; color: var(--navy, #192F5F); font: 500 15px/1 var(--font); text-decoration: none; margin-top: 8px; background: #fff; }
.btn-quiet:hover { border-color: var(--pink, #D68CA3); color: var(--pink, #D68CA3); }

/* Intake forms: one calm step at a time. */
.formpage { min-height: 100vh; background: var(--mist); }
.formtop { display: flex; align-items: center; gap: 10px; padding: 16px; font: 600 17px/22px var(--font); max-width: 560px; margin: 0 auto; }
.formtop img { height: 32px; width: auto; }
.formmain { max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }
.formmain .form-step { background: var(--white); border-radius: var(--radius-lg); padding: 28px 24px; }
.form-step { display: flex; flex-direction: column; gap: 20px; }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: -12px; }
.progress span { display: block; height: 100%; background: var(--navy); }
.note.consent { max-height: 50vh; overflow-y: auto; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
/* ---------- calendar ---------- */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-nav { gap: 8px; }
.cal-arrow { width: 40px; padding: 0; font-size: 20px; }
.cal-title { font: 600 17px/22px var(--font); margin-left: 4px; }
.cal-filters select { max-width: 220px; }
.cal-day { display: flex; flex-direction: column; gap: 8px; }
.cal-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; text-align: left; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer; font: inherit; color: var(--navy); }
.cal-item:hover { border-color: var(--pink); }
.cal-item .cal-time { font: 600 15px/20px var(--font); }
.cal-item .cal-who { grid-column: 1; font-weight: 500; }
.cal-item .cal-meta { grid-column: 1; }
.cal-item .cal-tag { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.cal-item.due { border-color: var(--line-strong); background: var(--mist); }
.cal-item.off .cal-who, .cal-item.off .cal-time { text-decoration: line-through; color: var(--ink-muted); }
.cal-week { display: flex; flex-direction: column; gap: 16px; }
.cal-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-dayhead { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: 500 14px/20px var(--font); color: var(--ink-muted); }
.cal-dayhead b { color: var(--navy); }
.cal-col.today .cal-dayhead { color: var(--navy); }
.cal-col.today .cal-dayhead b { box-shadow: inset 0 -2px 0 var(--pink); }
.cal-none { color: var(--ink-muted); font-size: 13px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.cal-wd { font: 500 12px/16px var(--font); color: var(--ink-muted); padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--mist); }
.cal-cell { min-height: 92px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-cell.out { background: #FAFBFD; }
.cal-cell.out .cal-num { color: var(--ink-muted); }
.cal-num { background: none; border: 0; padding: 2px 4px; align-self: flex-start; cursor: pointer; font: 600 13px/18px var(--font); color: var(--navy); border-radius: var(--radius-sm); }
.cal-cell.today .cal-num { background: var(--navy); color: var(--white); }
.cal-chip { display: block; width: 100%; text-align: left; background: var(--mist); border: 0; border-radius: 4px; padding: 2px 4px; font: 500 11px/15px var(--font); color: var(--navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-chip:hover { box-shadow: inset 0 0 0 1px var(--pink); }
.cal-chip.done { background: var(--navy); color: var(--white); }
.cal-chip.off { text-decoration: line-through; color: var(--ink-muted); background: transparent; }
.cal-chip.due { background: var(--white); box-shadow: inset 0 0 0 1px var(--error); }
.cal-more { font-size: 12px; align-self: flex-start; padding: 0 4px; }
.cal-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cal-kids { max-height: 240px; overflow: auto; }
a.choice { text-decoration: none; color: var(--navy); }
a.choice:hover { border-color: var(--pink); }
@media (min-width: 900px) {
  .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .cal-week .cal-item { grid-template-columns: 1fr; padding: 8px 10px; }
  .cal-week .cal-item .cal-tag { grid-column: 1; grid-row: auto; }
  .cal-week .cal-item .cal-time { font-size: 13px; }
  .cal-week .cal-item .cal-time .muted { display: none; }
  .cal-week .cal-item .cal-who, .cal-week .cal-item .cal-meta { font-size: 13px; line-height: 18px; }
  .page:has(.cal-week), .page:has(.cal-month), .page:has(.tg) { max-width: 1200px; }
}

/* ---------- calendar: hour-by-hour grid ---------- */
.cal-switches { gap: 20px; }
.tg { border: 1px solid var(--line); border-radius: var(--radius-md); max-height: 70vh; overflow: auto; position: relative; background: var(--white); }
.tg-head { display: flex; position: sticky; top: 0; z-index: 3; background: var(--white); border-bottom: 1px solid var(--line); }
.tg-body { display: flex; }
.tg-gutter { flex: 0 0 56px; position: sticky; left: 0; z-index: 2; background: var(--white); }
.tg-hour { font: 500 12px/16px var(--font); color: var(--ink-muted); text-align: right; padding: 0 8px 0 0; transform: translateY(-8px); }
.tg-hour:first-child { transform: none; padding-top: 2px; }
.tg-day { flex: 1 0 120px; min-width: 120px; background: none; border: 0; border-left: 1px solid var(--line); padding: 8px; text-align: left; cursor: pointer; font: 500 13px/18px var(--font); color: var(--ink-muted); }
.tg-day b { color: var(--navy); }
.tg-day.today b { box-shadow: inset 0 -2px 0 var(--pink); }
.tg-col { flex: 1 0 120px; min-width: 120px; position: relative; border-left: 1px solid var(--line); cursor: copy; }
.tg-one .tg-day, .tg-one .tg-col { min-width: 0; }
.tg-slot { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); height: 0; pointer-events: none; }
.tg-col:hover { background: rgba(240, 242, 247, .45); }
.tg-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--pink); z-index: 1; pointer-events: none; }
.tg-ev { position: absolute; text-align: left; overflow: hidden; background: var(--mist); color: var(--navy); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 3px 6px; font: 500 12px/16px var(--font); cursor: pointer; z-index: 1; display: flex; flex-direction: column; gap: 1px; }
.tg-ev:hover { border-color: var(--pink); }
.tg-ev .tg-sub { color: var(--ink-muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-ev.done { background: var(--navy); color: var(--white); border-color: var(--navy); }
.tg-ev.done .tg-sub { color: rgba(255, 255, 255, .75); }
.tg-ev.due { background: var(--white); border-color: var(--error); }
.tg-ev.off { background: var(--white); color: var(--ink-muted); text-decoration: line-through; }
@media (min-width: 900px) { .tg-day, .tg-col { min-width: 0; } }
.tg-ev b, .tg-ev .tg-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-ev.tight { padding: 2px 4px; font-size: 11px; line-height: 14px; }

/* Hover details on a calendar session (mouse only). */
.hovercard { position: fixed; z-index: 60; width: 260px; background: var(--white); color: var(--navy); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(25,47,95,.16); padding: 12px 14px; font: 400 13px/19px var(--font); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.hovercard .hc-kids { font: 600 15px/21px var(--font); }
.hovercard .hc-hint { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); }

/* Tap a session on a computer: small details card next to it. */
.sesspop { position: fixed; z-index: 60; width: 290px; background: var(--white); color: var(--navy); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(25,47,95,.18); padding: 16px; font: 400 14px/20px var(--font); display: flex; flex-direction: column; gap: 5px; }
.sesspop .hc-kids { font: 600 16px/22px var(--font); padding-right: 24px; }
.sesspop .sp-x { position: absolute; top: 8px; right: 12px; font-size: 22px; line-height: 1; }
.sesspop .sp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.sesspop .sp-actions .btn, .sesspop .sp-actions .quiet { height: 34px; padding: 0 12px; font-size: 14px; }

/* Calendar polish: half-hour lines, layered cards, side month. */
.tg-slot.half { border-top: 1px dashed rgba(25, 47, 95, 0.08); }
.tg-ev { box-shadow: 0 0 0 1px var(--white); }
.tg-ev .tg-time { font: 600 11px/15px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-ev .tg-name { font: 500 12px/16px var(--font); white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-side { display: none; }
@media (min-width: 1200px) {
  .cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; align-items: start; }
  .cal-side { display: block; position: sticky; top: 76px; }
  .page:has(.cal-layout) { max-width: 1440px; }
}
.mini { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; }
.mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 15px; }
.mini-head .link { font-size: 18px; padding: 0 4px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini-wd { font: 500 11px/20px var(--font); color: var(--ink-muted); }
.mini-d { background: none; border: 0; height: 30px; border-radius: 50%; font: 500 13px/1 var(--font); color: var(--navy); cursor: pointer; font-variant-numeric: tabular-nums; }
.mini-d:hover { box-shadow: inset 0 0 0 1px var(--pink); }
.mini-d.out { color: var(--ink-muted); opacity: .6; }
.mini-d.in { background: var(--mist); border-radius: 6px; }
.mini-d.today { background: var(--navy); color: var(--white); border-radius: 50%; }

/* Calendar full screen: the calendar takes the whole window. */
.cal-full-btn { height: 34px; padding: 0 12px; font-size: 14px; }
@media (max-width: 899px) { .cal-full-btn { display: none; } }
body.cal-full .side { display: none; }
body.cal-full .page { max-width: none !important; }
body.cal-full main { padding-top: 12px; }
body.cal-full .tg { max-height: calc(100vh - 230px); }

/* "Where" picker: saved places, then Google Maps suggestions. */
.field.place { position: relative; }
.place-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin-top: 4px; background: var(--white); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(25,47,95,.14); max-height: 280px; overflow: auto; padding: 4px; }
.place-head { font: 500 12px/18px var(--font); color: var(--ink-muted); padding: 6px 8px 2px; }
.place-opt { display: flex; flex-direction: column; width: 100%; text-align: left; background: none; border: 0; border-radius: 4px; padding: 7px 8px; cursor: pointer; color: var(--navy); font: 400 14px/19px var(--font); }
.place-opt:hover { background: var(--mist); }
.place-opt .muted { font-size: 13px; }

/* Messages: channels, DMs and threads. List beside the conversation on
   wide screens; one at a time on a phone. */
.msglayout { display: flex; gap: 24px; align-items: flex-start; }
.msgside { width: 340px; flex: none; display: flex; flex-direction: column; gap: 20px; }
.msgmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.msgmain.empty-main { justify-content: center; align-items: center; min-height: 240px; }
.msgback { display: none; }
.msgrow.on { background: var(--mist); }
.rowtitle.strong { font-weight: 700; }
.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.badge { background: var(--navy); color: var(--white); border-radius: 10px; min-width: 22px; height: 22px; padding: 0 7px; font: 600 12px/22px var(--font); text-align: center; }
.msgs { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; }
.msg { padding: 10px 0 2px; display: flex; gap: 10px; align-items: flex-start; }
.msg.cont { padding-top: 0; padding-left: 46px; }
.msgcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.av { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--navy, #192F5F); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.av-fam { background: #D68CA3; }
.av-ch { background: #F0F2F7; color: #192F5F; font-size: 16px; }
.msgrow { gap: 12px; flex-wrap: nowrap; }
.msgnew { gap: 8px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.msgnew::-webkit-scrollbar { display: none; }
.msgnew .btn { white-space: nowrap; flex: 0 0 auto; }
.msgnew .btn { padding: 0 14px; }
.btn.ghost { background: #fff; color: #192F5F; border: 1px solid rgba(25,47,95,0.25); }
.famnote { margin: 0; }
.msg .body { white-space: pre-wrap; font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.msgacts { display: none; gap: 12px; }
.msgacts .link { font-size: 13px; }
.msg:hover .msgacts, .msg:focus-within .msgacts { display: flex; }
.composer { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { min-height: 44px; }
@media (max-width: 899px) {
  .msglayout { display: block; }
  .msgside { width: auto; }
  .msgside:not(.full) { display: none; }
  .msgmain.empty-main { display: none; }
  .msgback { display: inline; }
  .msgacts { display: flex; }
  .msgs { max-height: none; border: 0; padding: 0; }
}

/* search */
.searchres { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.joshbtn.iconbtn { width: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 640px) { .topbar > .row { flex-wrap: nowrap; gap: 8px; } .topbar .brand { white-space: nowrap; } }

/* view as: a small floating bubble on the screen edge (viewas.js places it) */
.vab { position: fixed; left: 0; top: 0; z-index: 35; width: 52px; height: 52px; will-change: transform; }
.vab.snap { transition: transform 250ms ease-out; }
.vab-dot { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--white); padding: 0; cursor: grab;
  background: var(--navy); color: var(--white); font: 600 16px/1 var(--font); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(25,47,95,0.28); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms ease-out; }
.vab-dot:active, .vab.open .vab-dot { box-shadow: 0 0 0 4px var(--line-strong), 0 6px 18px rgba(25,47,95,0.28); }
.vab.dragging .vab-dot { cursor: grabbing; }
.vab-eye { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--pink); color: var(--navy);
  border: 2px solid var(--white); display: flex; align-items: center; justify-content: center; }
.vab-eye svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.vab-card { position: absolute; right: 60px; width: max-content; max-width: min(320px, calc(100vw - 84px)); display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  background: var(--white); color: var(--navy); padding: 14px 16px 16px; border-radius: var(--radius-md); box-shadow: 0 10px 30px rgba(25,47,95,0.2); font: 400 15px/21px var(--font);
  animation: vab-in 200ms ease-out; }
.vab-card[hidden] { display: none; }
.vab.left .vab-card { right: auto; left: 60px; }
.vab-card .btn { white-space: nowrap; }
@keyframes vab-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .vab.snap { transition: none; } .vab-card { animation: none; } }

/* demo site */
.demobar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: #F0F2F7; color: #192F5F; font-size: 14px; border-bottom: 1px solid rgba(25,47,95,0.12); }
.demoroles { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.demoroles button { font: inherit; font-size: 14px; height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid rgba(25,47,95,0.25); background: #fff; color: #192F5F; cursor: pointer; }
.demoroles button.on { background: #192F5F; color: #fff; border-color: #192F5F; }
.demopick { display: none; align-items: center; gap: 8px; }
.demopick span { font-size: 14px; color: rgba(25,47,95,0.72); }
.demopick select { font: inherit; font-size: 16px; height: 44px; padding: 0 12px; border-radius: 6px; border: 1px solid rgba(25,47,95,0.25); background: #fff; color: #192F5F; }
.demonote { flex-basis: 100%; font-size: 14px; color: #192F5F; }
/* 9 seats do not fit as buttons on a phone or tablet: one picker instead, 44 px tall. */
@media (max-width: 1100px) { .demobar { padding: 8px 16px; gap: 8px; } .demoroles { display: none; } .demopick { display: inline-flex; } }

/* EOS screens inside the portal */
.eostabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 20px; }
.eostabs button { font: 500 14px/1 var(--font); height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid rgba(25,47,95,0.25); background: #fff; color: #192F5F; cursor: pointer; }
.eostabs button.on { background: #192F5F; color: #fff; border-color: #192F5F; }
.eospage .card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; margin: 0 0 16px; }
.eospage .card h2 { margin: 0 0 10px; }
.eospage .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.eospage .small { font-size: 13px; }
.eospage .big { font-size: 28px; font-weight: 600; }
.eospage .err { color: #B42318; }
.eospage .okmsg, .eospage .ok { color: #1E7B4A; }
.eospage ul.plain { list-style: none; margin: 0; padding: 0; }
.eospage ul.plain li { padding: 10px 0; border-top: 1px solid var(--line); }
.eospage ul.plain li:first-child { border-top: 0; }
.eospage .kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.eospage button:not(.link) { font: 500 15px/1 var(--font); height: 40px; padding: 0 18px; border-radius: 6px; border: 0; background: #192F5F; color: #fff; cursor: pointer; }
.eospage button.tiny { height: 30px; padding: 0 10px; font-size: 13px; }
.eospage button.line { background: #fff; color: #192F5F; border: 1px solid rgba(25,47,95,0.25); }
.eospage .field { margin: 0 0 12px; }
.eospage textarea { min-height: 80px; }
.eospage table { width: 100%; border-collapse: collapse; font-size: 14px; }
.eospage th, .eospage td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.eospage .eostabs button { height: 36px; font-size: 14px; background: #fff; color: #192F5F; border: 1px solid rgba(25,47,95,0.25); }
.eospage .eostabs button.on { background: #192F5F; color: #fff; }

/* scorecards */
.tag.sc-ok { background: #F0F2F7; color: #192F5F; }
.tag.sc-miss { background: #F6E3E9; color: #7A2E45; }
.tag.sc-na { background: #fff; color: rgba(25,47,95,0.6); border: 1px solid rgba(25,47,95,0.15); }
.sclist li { flex-wrap: nowrap; align-items: flex-start; }
.scval { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; flex: none; max-width: 45%; }
@media (max-width: 640px) { .sclist li { flex-wrap: wrap; } .scval { flex-direction: row; align-items: center; max-width: none; width: 100%; justify-content: space-between; } }

/* ================================================================ phones ==
   The phone look follows the Pensieve and Always & Forever apps, in Coach
   Moishy colors: a navy band behind the opening heading that fades into a
   soft page, white cards with a light shadow, and a floating tab bar. */
.hero { display: contents; }
.tabs svg { display: none; }
@media (max-width: 899px) {
  body { background: var(--mist); }
  .topbar { box-shadow: none; }
  .page { gap: 22px; }
  .hero { display: flex; flex-direction: column; gap: 14px; color: var(--white);
    margin: -24px calc(-1 * max(16px, env(safe-area-inset-right, 0px))) 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
    padding: 18px max(16px, env(safe-area-inset-right, 0px)) 52px max(16px, env(safe-area-inset-left, 0px));
    background:
      radial-gradient(110% 60% at 95% 30%, rgba(214,140,163,0.26), transparent 60%),
      linear-gradient(180deg, #192F5F 0%, #1D3769 calc(100% - 120px), rgba(29,55,105,0.55) calc(100% - 60px), rgba(240,242,247,0.7) calc(100% - 20px), var(--mist) 100%);
    padding-bottom: 96px; margin-bottom: -40px; }
  .hero .section { gap: 8px; }
  .hero h1 { color: var(--white); font-size: 30px; line-height: 36px; letter-spacing: -0.01em; }
  .hero h2 { color: var(--white); }
  .hero p, .hero .muted, .hero .help { color: rgba(255,255,255,0.78); }
  .hero b { color: var(--white); }
  .hero a.link, .hero .link, .hero button.link { color: var(--white); }
  .hero .btn { background: var(--white); color: var(--navy); }
  .hero .btn.ghost, .hero .quiet { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,0.5); }
  .hero .tag { background: rgba(255,255,255,0.14); color: var(--white); border-color: transparent; }

  .card, .list, .eospage .card { border: 0; border-radius: 18px; box-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); }
  .list li { border-top-color: rgba(25,47,95,0.07); padding: 15px 16px; }
  .list li.empty { color: var(--ink-muted); }
  .section > p.empty, .section > .empty, form.mist, .mist { background: var(--white); border: 0; border-radius: 18px; padding: 18px 16px;
    box-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); }
  .section > p.empty, .section > .empty { color: var(--ink-muted); margin: 0; }
  .btn, .btn.ghost { border-radius: 12px; min-height: 44px; }
  input, select, textarea { border-radius: 12px; }
  .msgs { background: var(--white); border-radius: 18px; padding: 12px 14px; }
  .composer textarea { background: var(--white); }

  /* Floating tab bar */
  .tabs { left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); max-width: 560px; margin: 0 auto;
    height: 64px; padding: 0 6px; border: 0; border-radius: 22px; background: var(--white);
    box-shadow: 0 10px 30px rgba(25,47,95,0.16), 0 1px 2px rgba(25,47,95,0.06); align-items: stretch; }
  .tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0 2px; border: 0;
    color: rgba(25,47,95,0.42); font: 600 11px/14px var(--font); min-width: 0; }
  .tabs a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabs svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabs a[aria-current="page"] { color: var(--navy); border: 0; }
  .tabs a[aria-current="page"] svg { stroke-width: 2.1; }
  .tabs a[aria-current="page"]::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--pink); margin-top: 1px; }
  main { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  .bottomlink { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); border-radius: 12px; }
  .sheet { border-radius: 22px 22px 0 0; }
}

/* Phone home: tall sky, glass doors, tiles with live counts (like the Pensieve) */
.m-only { display: none !important; }
@media (max-width: 899px) {
  .m-only { display: block !important; }
  .doors.m-only { display: flex !important; flex-direction: column; gap: 10px; margin-top: 10px; }
  .hero.today { padding-bottom: 150px; margin-bottom: -70px;
    background:
      radial-gradient(110% 45% at 95% 22%, rgba(214,140,163,0.30), transparent 60%),
      radial-gradient(90% 50% at 0% 45%, rgba(240,242,247,0.10), transparent 65%),
      linear-gradient(180deg, #192F5F 0%, #1D3769 calc(100% - 190px), rgba(29,55,105,0.6) calc(100% - 100px), rgba(240,242,247,0.75) calc(100% - 30px), var(--mist) 100%); }
  .hero-date { margin: 2px 0 -6px; font: 500 15px/20px var(--font); color: rgba(255,255,255,0.72) !important; }
  .hero.today h1 { font-size: 34px; line-height: 40px; letter-spacing: -0.02em; }
  .door { display: flex; align-items: center; gap: 16px; min-height: 84px; padding: 16px 18px; border-radius: 22px; color: var(--white); text-decoration: none;
    background: rgba(255,255,255,0.10); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .door:active { background: rgba(255,255,255,0.16); }
  .door-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
  .door-text b { font-size: 19px; font-weight: 600; color: var(--white); }
  .door-text span { font-size: 14px; color: rgba(255,255,255,0.74); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .door > i { font-style: normal; font-size: 26px; line-height: 1; color: rgba(255,255,255,0.5); }
  .glass-ic { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.12); color: #F2C4D2; }
  .glass-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .ring { width: 52px; height: 52px; flex: none; transform: rotate(-90deg); }
  .ring circle { fill: none; stroke-width: 4.5; }
  .ring-bg { stroke: rgba(255,255,255,0.18); }
  .ring-fg { stroke: var(--pink); stroke-linecap: round; transition: stroke-dasharray 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .home-glance { position: relative; z-index: 1; display: flex !important; flex-direction: column; gap: 12px; }
  .home-glance .section-head h2 { font-size: 20px; }
  .glance { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .g-tile { display: grid; grid-template-columns: auto 1fr; gap: 12px 0; align-items: center; padding: 16px; border-radius: 20px; background: var(--white); color: var(--navy); text-decoration: none;
    box-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); }
  .g-tile b { justify-self: end; font-size: 26px; font-weight: 600; line-height: 1; }
  .g-tile > span:last-child { grid-column: 1 / -1; font-size: 15px; font-weight: 600; color: var(--ink-muted); }
  .ic-tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--mist); color: var(--navy); }
  .ic-tile.pink { background: #F6E3E9; color: #8A3653; }
  .ic-tile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  body .page > #schome { display: none; }
  .bottomlink { display: none; }
  .quiet-line { display: flex !important; align-items: center; justify-content: space-between; width: 100%; min-height: 56px; padding: 0 18px; border: 0; border-radius: 20px;
    background: var(--white); color: var(--navy); font: 500 15px/20px var(--font); text-align: left; cursor: pointer;
    box-shadow: inset 4px 0 0 var(--pink), 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); }
  .quiet-line::after { content: "›"; font-size: 22px; color: rgba(25,47,95,0.4); }
}

a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* Phone tab bar: Josh in the middle, like the + in Always & Forever */
.tab-josh { display: none; }
@media (max-width: 899px) {
  .tabs { display: grid !important; grid-template-columns: repeat(5, 1fr); }
  .tab-josh { display: flex; align-items: center; justify-content: center; border: 0; background: none; padding: 0; cursor: pointer; }
  .josh-btn { width: 50px; height: 50px; border-radius: 50%; background: var(--navy); display: grid; place-items: center;
    box-shadow: 0 6px 16px rgba(25,47,95,0.32), inset 0 0 0 2px rgba(214,140,163,0.55); transition: transform 0.2s ease; }
  .tab-josh:active .josh-btn { transform: scale(0.94); }
  .josh-btn img { width: 30px; height: 30px; }
  #josh { display: none; }
  .d-only { display: none !important; }
  .mrows { list-style: none; margin: 0; padding: 0; background: var(--white); border-radius: 20px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); }
  .mrows li + li .mrow { box-shadow: inset 0 0.5px 0 rgba(25,47,95,0.12); }
  .mrow { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 16px; border: 0; background: none;
    color: var(--navy); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
  .mrow:active { background: var(--mist); }
  .mrow-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
  .mrow-t b { font-size: 16px; font-weight: 600; }
  .mrow-t span { font-size: 14px; color: var(--ink-muted); }
  .mrow > i { font-style: normal; font-size: 22px; color: rgba(25,47,95,0.35); }
}

/* Phone top bar: Messages icon with an unread badge */
.topmsg { position: relative; text-decoration: none; }
.topbadge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pink); color: var(--navy);
  font: 700 11px/18px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--navy); }
@media (max-width: 899px) { .topmsg.m-only { display: inline-flex !important; } }

@media (max-width: 899px) { .card .scroll { margin: 0 -16px; padding: 0 16px; } .scroll table { font-size: 13px; } }

/* ================================================== design pass 1 (DESIGN.md) ==
   The tap rule: no browser tap highlight, focus ring only from a keyboard,
   one press tint everywhere, content fades in, nothing jumps. */
html { -webkit-tap-highlight-color: transparent; }
a, button, [role="button"], label, summary { touch-action: manipulation; }
:focus:not(:focus-visible) { outline: none; }
.mrow, .door, .g-tile, .list li.click, .cal-item, .quiet-line, .choice, .place-opt, .tabs a, .btn, .quiet, .link {
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, opacity .15s ease, transform .15s ease; }
.mrow:active, .list li.click:active, .cal-item:active, .quiet-line:active, .choice:active, .place-opt:active, .g-tile:active { background: var(--mist); }
.g-tile:active, .door:active { transform: scale(.985); }
.btn:active { opacity: .85; }
.quiet:active, .link:active { background: var(--mist); }
@keyframes cm-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.page { animation: cm-in .15s ease; }
.skel { background: var(--mist); border-radius: 12px; min-height: 64px; animation: cm-pulse 1.2s ease-in-out infinite; }
.skel.row { min-height: 56px; }
.skel.text { min-height: 20px; max-width: 60%; }
@media (prefers-reduced-motion: reduce) { .page, .skel { animation: none !important; } }

/* Screen header, phone: round white action buttons on the right, no text buttons. */
@media (max-width: 899px) {
  .topbar .joshbtn.iconbtn, .topbar .initials { width: 40px; height: 40px; border-radius: 50%; background: var(--white); color: var(--navy); border: 0;
    box-shadow: 0 2px 8px rgba(25,47,95,.18); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
  .topbar .joshbtn.iconbtn:hover, .topbar .initials:hover { color: var(--pink); border: 0; }
  .topbar #josh { display: none; }
  .topbar > .row { gap: 10px !important; }
}

/* More: grouped rows, every row with a sub line, Account group last. */
.mgroup { display: flex; flex-direction: column; gap: 8px; }
h3.group { font: 600 13px/18px var(--font); color: var(--ink-muted); margin: 6px 4px 0; }
.page > h3.group { margin-bottom: -10px; }
.mgroups { display: flex; flex-direction: column; gap: 18px; }

/* Sign in: navy top with the mark, providers first, email behind one link. */
.signin { align-items: flex-start; justify-content: flex-start; min-height: 100vh; background: linear-gradient(180deg, var(--navy) 0, var(--navy) 200px, #1D3769 260px, var(--mist) 420px, var(--mist) 100%); padding-top: calc(28px + env(safe-area-inset-top, 0px)); flex-direction: column; gap: 20px; }
.signin-top { color: var(--white); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; width: 100%; max-width: 420px; margin: 0 auto; }
.signin-top img { height: 64px; width: auto; align-self: center; }
.signin-top h1 { color: var(--white); font-size: 26px; line-height: 32px; }
.signin-top p { color: rgba(255,255,255,0.78); font-size: 15px; max-width: 300px; }
.signin .box { margin: 0 auto; border-radius: 20px; box-shadow: 0 4px 16px rgba(25,47,95,0.06); }
.signin .box > img { display: none; }
.providers { display: flex; flex-direction: column; gap: 10px; }
.providers .btn-quiet { margin: 0; height: 44px; border-radius: 8px; }
.providers .skel.row { min-height: 44px; }
.center { text-align: center; align-self: center; }
.providers .link.center { margin-top: 4px; }

/* Toast: above the tab bar, 1 line, slides up, never stacks. */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); z-index: 70; max-width: 560px; margin: 0 auto;
  background: var(--white); color: var(--navy); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font: 500 15px/20px var(--font); box-shadow: 0 8px 24px rgba(25,47,95,0.12); opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.on { opacity: 1; transform: none; }
.toast .link { color: var(--pink); font-weight: 600; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* First-run walkthrough: 3 cards in a sheet. */
.walk { display: flex; flex-direction: column; gap: 20px; }
.walk-dots { display: flex; gap: 6px; justify-content: center; }
.walk-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background-color .15s ease; }
.walk-dots i.on { background: var(--pink); }
.walk-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 8px 0; min-height: 150px; }
.walk-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--mist); display: grid; place-items: center; }
.walk-ic svg { width: 26px; height: 26px; fill: none; stroke: var(--navy); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* People: name, 1 sub line, then the actions on their own row (DESIGN.md rows rule). */
.list li.person { flex-direction: column; align-items: stretch; gap: 10px; }
.person-top { min-width: 0; }
.person-top .muted.clip { display: block; }
.person-acts { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.person-acts > .row { flex-wrap: nowrap; gap: 14px !important; min-width: 0; }
.person-acts .link { font-size: 14px; white-space: nowrap; }
.person-acts select.status { width: auto; min-width: 0; height: 36px; padding: 4px 28px 4px 10px; font-size: 14px; flex: none; }
.mgroups { gap: 24px; }

/* Save to contacts: a round icon beside the name, like a trailing action on a Monday row. */
.person-top { display: flex; align-items: center; gap: 12px; }
.save-contact { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--mist); color: var(--navy); display: grid; place-items: center; text-decoration: none; }
.save-contact svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.save-contact:hover, .save-contact:active { color: var(--pink); }

/* Offline line under the header, and the notification settings. */
.offline-line { position: sticky; top: 56px; z-index: 19; text-align: center; font: 500 13px/18px var(--font); color: var(--ink-muted); background: var(--mist); padding: 5px 16px; }
.offline-line .link { font: 600 13px/18px var(--font); padding: 6px 4px; margin: -6px 0; }
/* Waiting to send: one row per saved change, what, which family, when, then Discard and Send. */
#waitlist { margin-top: 4px; }
#waitlist .waititem { flex-wrap: nowrap; align-items: flex-start; }
#waitlist .waitt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; overflow-wrap: anywhere; }
#waitlist .waitt .error { margin: 4px 0 0; }
#waitlist .waitacts { flex-wrap: nowrap; gap: 16px; flex-shrink: 0; }
#waitlist .waitacts .link { min-height: 44px; }
#waitlist .waitacts .link.strong { font-weight: 600; }
.settings-card { gap: 14px; }
.tgl-row { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.tgl-row .mrow-t { flex: 1; }
.tgl-row .mrow-t b { font-size: 16px; font-weight: 600; display: block; }
.tgl-row .mrow-t span { font-size: 14px; color: var(--ink-muted); }
.tgl-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tgl { flex: none; width: 48px; height: 28px; border-radius: 14px; background: var(--line-strong); position: relative; transition: background-color .15s ease; }
.tgl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(25,47,95,.25); transition: transform .15s ease; }
.tgl-row input:checked + .tgl { background: var(--navy); }
.tgl-row input:checked + .tgl::after { transform: translateX(20px); }
.tgl-row input:focus-visible + .tgl { outline: 2px solid var(--pink); outline-offset: 2px; }
select.hour { width: auto; min-width: 0; height: 40px; padding: 6px 28px 6px 10px; }
.mrow-t span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* Home widgets (DESIGN.md, Home widgets): the engine in widgets.js draws them with these tokens. */
:root { --mmw-card: var(--white); --mmw-ink: var(--navy); --mmw-muted: var(--ink-muted); --mmw-fill: var(--mist); --mmw-line: rgba(25,47,95,0.12);
  --mmw-accent: var(--pink); --mmw-accent-fill: #F6E3E9; --mmw-accent-ink: #8A3653; --mmw-radius: 20px; --mmw-font: var(--font); --mmw-page: #F7F8FB;
  --mmw-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); }
@media (max-width: 899px) {
  .home-sky.m-only { display: block !important; margin-top: 6px; }
  .home-widgets.m-only { display: block !important; position: relative; z-index: 1; margin-top: -78px; }
  .home-foot.m-only { display: block !important; }
  /* The first row of widgets sits inside the sky as glass; the page's widgets start in the fade below it. */
  .hero.today { padding-bottom: 92px; margin-bottom: 0;
    background:
      radial-gradient(110% 45% at 95% 22%, rgba(214,140,163,0.30), transparent 60%),
      radial-gradient(90% 50% at 0% 45%, rgba(240,242,247,0.10), transparent 65%),
      linear-gradient(180deg, #192F5F 0%, #1D3769 calc(100% - 86px), rgba(29,55,105,0.6) calc(100% - 56px), rgba(240,242,247,0.75) calc(100% - 18px), var(--mist) 100%); }
}
@media (max-width: 899px) { .page.has-widgets > :not(.hero):not(.home-widgets):not(.home-foot) { display: none; } }
/* People rows stay inside the screen: a long line clips to 1 row, the actions row never pushes the status box off. */
.list li.person { flex-wrap: nowrap; min-width: 0; max-width: 100%; overflow: hidden; }  /* column + wrap let rows grow to their content */
.person-top > div { min-width: 0; }
.person-top .rowtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-acts { min-width: 0; }
.person-acts > .row { flex: 1; overflow: hidden; }
.person-acts > .row { gap: 12px !important; }
.person-acts select.status { padding: 4px 24px 4px 8px; background-position: right 8px center; }

/* Install banner: a floating card above the tab bar, phones in the browser only. */
.installbar { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 96px); z-index: 45; display: flex; align-items: center; gap: 12px;
  padding: 12px 8px 12px 14px; background: var(--white); color: var(--navy); border-radius: 20px; box-shadow: 0 8px 28px rgba(25,47,95,0.22);
  opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.installbar.on { opacity: 1; transform: none; }
.installbar img { width: 36px; height: 36px; flex: none; }
.installbar .ib-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.installbar .ib-t b { font-size: 15px; font-weight: 600; }
.installbar .ib-t span { font-size: 13px; color: var(--ink-muted); }
.installbar .ib-go { height: 36px; padding: 0 14px; flex: none; }
.installbar .ib-x { width: 36px; height: 36px; flex: none; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; color: var(--ink-muted); cursor: pointer; }
.installbar .ib-x:active { background: var(--mist); }
.installbar .ib-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (min-width: 900px) { .installbar { display: none; } }

/* Sign in: "or" between the provider buttons and the email field. */
.signin-or { display: flex; align-items: center; gap: 12px; margin: 6px 0 2px; color: var(--ink-muted); font-size: 14px; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.signin .providers + .section[hidden] + .field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* People: group tabs as a chip row, name opens the person's sheet. */
.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin: 0 0 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chiprow::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--white); color: var(--navy);
  font: 500 14px/20px var(--font); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.chip .num { color: var(--ink-muted); font-weight: 400; }
.chip[aria-selected="true"] { border-color: var(--navy); background: var(--mist); font-weight: 600; }
.chip:hover { border-color: var(--pink); }
.person-name { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; }
.person-name .rowtitle { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-name .clip { max-width: 100%; white-space: normal; }
.person-name:hover .rowtitle { color: var(--pink); }
.person-top select.status { width: auto; min-width: 0; height: 36px; padding: 4px 24px 4px 8px; font-size: 14px; flex: none; background-position: right 8px center; }
.pick-contact { display: block; margin: 0 0 12px; padding: 0; text-align: left; }

/* ======================================================== To-dos (admin) ==
   The lists from Always & Forever in Coach Moishy colors: a white card per
   list, a round tick, a bold title, one gray line. Empty lists fold to their
   heading. Phone first; desktop is the same column, wider. */
.td-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.td-plus { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--navy); color: var(--white); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(25,47,95,.18); transition: opacity .15s ease; }
.td-plus:active { opacity: .85; }
.td-plus svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.td { display: flex; flex-direction: column; gap: 12px; min-height: 320px; }
.td.fade-in .td-list { animation: cm-in .15s ease; }
.td-list { display: flex; flex-direction: column; }
.td-head { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 12px 16px; border: 0; border-radius: 20px;
  background: var(--white); color: var(--navy); font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); transition: background-color .15s ease; }
.td-head:active { background: var(--mist); }
.td-list.open .td-head { border-radius: 20px 20px 0 0; box-shadow: 0 1px 2px rgba(25,47,95,0.04); }
.td-list.is-empty .td-head { cursor: default; min-height: 56px; padding-top: 8px; padding-bottom: 8px; background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.td-list.is-empty .td-head:active { background: transparent; }
.td-list.is-empty .ic-tile { opacity: .55; }
.td .ic-tile { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--mist); color: var(--navy); }
.td .ic-tile.navy { background: var(--navy); color: var(--white); }
.td .ic-tile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.td-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.td-name b { font-size: 17px; font-weight: 600; }
.td-name span { font-size: 14px; color: var(--ink-muted); }
.td-count { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 14px; background: var(--navy); color: var(--white); font: 600 14px/28px var(--font);
  text-align: center; font-variant-numeric: tabular-nums; }
.td-count.zero { background: transparent; color: var(--ink-muted); }
.td-head[aria-expanded]::after { content: "›"; font-size: 22px; line-height: 1; color: rgba(25,47,95,0.35); transition: transform .25s ease; }
.td-list.open .td-head[aria-expanded]::after { transform: rotate(90deg); }
.td-body { display: none; background: var(--white); border-radius: 0 0 20px 20px; padding: 0 0 6px;
  box-shadow: 0 8px 24px rgba(25,47,95,0.06); }
.td-list.open .td-body { display: block; }
.td-body > .recs { box-shadow: inset 0 0.5px 0 var(--line); }
.td-group h3.group { display: flex; align-items: center; gap: 8px; margin: 0; padding: 16px 18px 6px; font: 600 14px/20px var(--font); color: var(--ink-muted); box-shadow: inset 0 0.5px 0 var(--line); }
.td-group h3.group span { font-weight: 500; }
.td .recs { list-style: none; margin: 0; padding: 0; }
.td .rec { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px 8px 8px; transition: background-color .15s ease, opacity .2s ease; }
.td .rec + .rec { box-shadow: inset 0 0.5px 0 var(--line); }
.td .rec-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; padding: 6px 0; }
.td .rec .t { font-size: 16px; line-height: 22px; overflow-wrap: anywhere; }
.td .rec .m { font-size: 14px; line-height: 20px; color: var(--ink-muted); overflow-wrap: anywhere; }
.td .rec .m b { font-weight: 600; color: var(--navy); }
.td .rec .sep { padding: 0 4px; color: rgba(25,47,95,0.4); }
.td .rec .late { color: var(--error); }
.td .tick { width: 44px; min-height: 44px; align-self: stretch; flex: none; display: grid; place-items: center; background: none; border: 0; padding: 0; cursor: pointer; }
.td .tick .box { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(25,47,95,0.4); position: relative; transition: background-color .2s ease, border-color .2s ease; }
.td .tick:active .box { background: var(--mist); }
.td .rec.done .box { background: var(--navy); border-color: var(--navy); }
.td .rec.done .box::after { content: ""; position: absolute; left: 7.5px; top: 3.5px; width: 5px; height: 10px; border: solid var(--white); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.td .rec.done .t { color: rgba(25,47,95,0.4); text-decoration: line-through; }
.td .rec.leaving { opacity: 0; }
.sheet-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.sheet-bar h2 { font-size: 17px; line-height: 24px; text-align: center; }
.sheet-bar > :last-child { justify-self: end; }
.sheet-bar .link.strong { font-weight: 600; }

/* The middle button for the admin: To-dos, with the open count. */
@media (max-width: 899px) {
  .tabs a.tab-todo { position: relative; padding: 0; }
  .tabs a.tab-todo .josh-btn svg { width: 26px; height: 26px; fill: none; stroke: var(--white); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
  .tabs a.tab-todo[aria-current="page"]::after { display: none; }
  .tabs a.tab-todo[aria-current="page"] .josh-btn { box-shadow: 0 6px 16px rgba(25,47,95,0.32), inset 0 0 0 2px var(--pink); }
  .tabs a.tab-todo:active .josh-btn { transform: scale(0.94); }
  .td-badge { position: absolute; top: 2px; left: calc(50% + 12px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--white); color: var(--navy);
    font: 700 11px/20px var(--font); text-align: center; box-shadow: 0 0 0 1.5px var(--navy); font-variant-numeric: tabular-nums; }
  .hero .td-plus { background: var(--white); color: var(--navy); }
}
@media (prefers-reduced-motion: reduce) { .td .rec, .td .tick .box, .td-head::after { transition: none !important; } .td.fade-in .td-list { animation: none !important; } }

/* ============================================== rebuild: shared pieces ==
   Rows (.mrows) look the same on phone and desktop now, so More, People,
   Company and Josh read as one app everywhere. */
@media (min-width: 900px) {
  .mrows { list-style: none; margin: 0; padding: 0; background: var(--white); border-radius: 20px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
  .mrows li + li .mrow, .mrows li + li .agent-row, .mrows li + li .strip-row { box-shadow: inset 0 1px 0 var(--line); }
  .mrow { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 16px; border: 0; background: none;
    color: var(--navy); text-decoration: none; text-align: left; font: inherit; cursor: pointer; transition: background-color .15s ease; }
  .mrow:hover { background: var(--mist); }
  .mrow-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
  .mrow-t b { font-size: 16px; font-weight: 600; }
  .mrow-t span { font-size: 14px; color: var(--ink-muted); }
  .mrow > i { font-style: normal; font-size: 22px; color: rgba(25,47,95,0.35); }
  .ic-tile { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--mist); color: var(--navy); }
  .ic-tile.pink { background: #F6E3E9; color: #8A3653; }
  .ic-tile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .more-page, .company, .agents-body, .fams { max-width: 720px; }
}
.mgroups { display: flex; flex-direction: column; gap: 6px; }
.mgroup h3.group, .company h3.group { font: 600 14px/20px var(--font); color: var(--ink-muted); margin: 18px 4px 8px; }
.mgroup:first-child h3.group { margin-top: 0; }
.empty-line { color: var(--ink-muted); font-size: 15px; padding: 12px 4px; }
.empty-line.center { text-align: center; padding: 28px 16px; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--mist); color: var(--navy); display: grid; place-items: center; font: 600 14px/1 var(--font); }
.avatar.adv { background: #F6E3E9; color: #7A2E45; }
.avatar.agent { background: var(--navy); color: var(--white); }
.avatar.agent svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.avatar.open { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--ink-muted); font-size: 18px; font-weight: 500; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.td-title .hdr-btns { display: flex; gap: 10px; align-items: center; }
.tidy-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--white); color: var(--navy); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(25,47,95,.18); transition: opacity .15s ease; }
.tidy-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.tidy-btn:active { opacity: .8; }
.tidy-btn.busy svg { animation: cm-pulse 1s ease-in-out infinite; }
.tidy-sum { font: 500 16px/24px var(--font); }
.tidy-notes { background: var(--mist); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.tidy-list { list-style: none; margin: 0; padding: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.tidy-list li { padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.tidy-list li + li { box-shadow: inset 0 1px 0 var(--line); }
.tidy-list li b { font-weight: 500; }
.tidy-list li span { font-size: 13px; color: var(--ink-muted); }
.tidy-list li.moved { background: #FFF8E6; }
.sheet h3.group { font: 600 14px/20px var(--font); color: var(--ink-muted); margin: 4px 0 -8px; }
.link.danger { color: var(--error); }
/* On the navy band (phone) links turn white; a destructive one stays red, on a white soft rectangle so it reads. */
@media (max-width: 899px) {
  .hero button.link.danger, .hero a.link.danger { color: var(--error); background: var(--white); border-radius: var(--radius-sm); padding: 10px 14px; min-height: 44px; font-weight: 600; }
  .hero button.link.danger:hover, .hero a.link.danger:hover { color: var(--error); text-decoration: none; }
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 15px; }
.kv dt, .kv-row dt { color: var(--ink-muted); }
.kv dd, .kv-row dd { margin: 0; overflow-wrap: anywhere; }
.kv-row { display: contents; }
.profile-card { display: flex; flex-direction: row; gap: 16px; align-items: flex-start; border: 0; box-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); border-radius: 20px; }

/* To-dos: departments, then Urgent, Today, This week */
.td-dept { box-shadow: inset 0 0.5px 0 var(--line); }
.td-sub { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 10px 16px 10px 18px; border: 0; background: none; color: var(--navy);
  font: inherit; text-align: left; cursor: pointer; transition: background-color .15s ease; }
.td-sub:active { background: var(--mist); }
.td-sub b { font-size: 16px; font-weight: 600; flex: 1; }
.td-sub[data-fold]::after { content: "›"; font-size: 20px; color: rgba(25,47,95,0.35); transition: transform .25s ease; }
.td-dept.open .td-sub[data-fold]::after { transform: rotate(90deg); }
.td-dept.is-empty .td-sub { min-height: 40px; cursor: default; color: var(--ink-muted); }
.td-dept.is-empty .td-sub b { font-weight: 500; font-size: 14px; }
.td-n { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--mist); font: 600 13px/24px var(--font); text-align: center; font-variant-numeric: tabular-nums; }
.td-n.zero { background: transparent; color: var(--ink-muted); }
.td-chip { height: 24px; padding: 0 8px; border-radius: 6px; font: 500 12px/24px var(--font); }
.td-chip.red { background: #FDE8E8; color: #A12A2A; }
.td-sub-body { display: none; }
.td-dept.open .td-sub-body { display: block; }
.td-urg { margin: 0; padding: 6px 18px 2px; font: 600 12px/16px var(--font); color: var(--ink-muted); }
.td-urg[data-u="urgent"] { color: #A12A2A; }
.td-urg.none { display: none; }
.td .td-sub-body .recs { min-height: 0; }
body.cm-dragging .td-dept .td-sub-body { display: block; }
body.cm-dragging .td-urg.none { display: block; opacity: .6; }
body.cm-dragging .td-sub-body .recs { min-height: 12px; }
.td .rec.cm-lifted { background: var(--white); }

/* Families: folding groups, drag to your own order */
.fams { display: flex; flex-direction: column; gap: 12px; }
.fam-group { display: flex; flex-direction: column; }
.fam-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 16px; border: 0; border-radius: 20px; background: var(--white); color: var(--navy);
  font: inherit; text-align: left; cursor: pointer; box-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); transition: background-color .15s ease; }
.fam-head:active { background: var(--mist); }
.fam-head b { flex: 1; font-size: 17px; font-weight: 600; }
.fam-head::after { content: "›"; font-size: 22px; color: rgba(25,47,95,0.35); transition: transform .25s ease; }
.fam-group.open .fam-head { border-radius: 20px 20px 0 0; }
.fam-group.open .fam-head::after { transform: rotate(90deg); }
.fam-group .fam-list { display: none; margin: 0; border-radius: 0 0 20px 20px !important; }
.fam-group.open .fam-list { display: block; }
.fam-list li.fam { display: flex; align-items: center; gap: 12px; }
.fam-t { flex: 1; min-width: 0; }
@media (min-width: 900px) { .fam-head { box-shadow: inset 0 0 0 1px var(--line); } .fam-group.open .fam-list { border: 1px solid var(--line); border-top: 0; } }

/* People, like Contacts */
.search-bar { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--white);
  box-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); }
.search-bar svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink-muted); stroke-width: 2; stroke-linecap: round; }
.search-bar input { border: 0; background: none; height: 46px; padding: 0; font-size: 16px; flex: 1; min-width: 0; box-shadow: none; outline: none; }
.people h3.letter { font: 600 15px/20px var(--font); color: var(--pink); margin: 16px 6px 6px; }
.people h3.letter:first-child { margin-top: 4px; }
.contact-top { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.contact-acts { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.contact-acts .act { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 72px; padding: 10px 8px; border: 0; border-radius: 14px; background: var(--mist);
  color: var(--navy); font: 500 13px/16px var(--font); text-decoration: none; cursor: pointer; }
.contact-acts .act span svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Company: who does what */
.company { display: flex; flex-direction: column; }
.company .gov, .company .depts { display: flex; flex-direction: column; gap: 12px; }
.dept-card { background: var(--white); border-radius: 20px; padding: 6px 0 8px; box-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); }
.gov .dept-card { box-shadow: inset 0 0 0 1.5px var(--navy); }
.dept-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 16px 6px; flex-wrap: wrap; }
.dept-head h2 { font-size: 18px; line-height: 24px; }
.dept-head { align-items: center; }
.dept-head .door { display: inline-flex; align-items: center; min-height: 32px; padding: 0; font-size: 14px; color: var(--ink-muted); text-decoration: none; overflow-wrap: anywhere; }
.seats { list-style: none; margin: 0; padding: 0; min-height: 8px; }
.seat + .seat { box-shadow: inset 0 0.5px 0 var(--line); }
.seat-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 16px; border: 0; background: none; color: var(--navy); font: inherit; text-align: left; }
button.seat-row { cursor: pointer; transition: background-color .15s ease; }
button.seat-row:active { background: var(--mist); }
.seat-row > i { font-style: normal; font-size: 22px; color: rgba(25,47,95,0.35); }
.seat-row .mrow-t b { font-size: 16px; font-weight: 600; }
.seat-row .mrow-t span { font-size: 14px; color: var(--ink-muted); }
.sc-lines { list-style: none; margin: -4px 16px 10px 68px; padding: 8px 12px; background: var(--mist); border-radius: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.sc-lines li { display: flex; justify-content: space-between; gap: 10px; }
.sc-lines b { font-weight: 600; }
.sc-lines small { font-weight: 400; color: var(--ink-muted); }
.add-seat { margin: 2px 16px 4px; }
.sc-edit { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; margin-top: 8px; }
details summary { cursor: pointer; font: 500 14px/20px var(--font); padding: 6px 0; }
.dept-card.cm-lifted { background: var(--white); }

/* The company map: top to bottom, lines converging */
.map { display: flex; flex-direction: column; align-items: stretch; }
.map-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; position: relative; }
.map-box { background: var(--white); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; line-height: 18px; color: var(--ink-muted);
  box-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 6px 18px rgba(25,47,95,0.06); position: relative; }
.map-box b { font-size: 15px; color: var(--navy); margin-bottom: 2px; }
.map-box em { font-style: normal; color: var(--navy); font-weight: 500; }
.map-box em.is-agent { color: #7A2E45; }
.map-box em.is-open { color: var(--ink-muted); font-weight: 400; }
.map-box.gov { box-shadow: inset 0 0 0 1.5px var(--navy); }
.map-box.core { background: var(--navy); color: rgba(255,255,255,0.78); text-align: center; align-items: center; }
.map-box.core b { color: var(--white); }
/* 2 lines down from the governance boxes, meeting in the middle, then one into the core box */
.map-join { height: 28px; position: relative; }
.map-join::before { content: ""; position: absolute; left: 25%; right: 25%; top: 0; height: 14px; border: 2px solid var(--line-strong); border-top: 0; border-radius: 0 0 10px 10px; }
.map-join::after { content: ""; position: absolute; left: calc(50% - 1px); top: 14px; height: 14px; width: 2px; background: var(--line-strong); }
/* then one line down from the core box into a rail the departments hang off */
.map-spine { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding: 14px 0 0 22px; position: relative;
  background: linear-gradient(var(--line-strong), var(--line-strong)) no-repeat 6px 0 / calc(50% - 5px) 2px; }
.map-spine::before { content: ""; position: absolute; left: calc(50% - 1px); top: -14px; height: 14px; width: 2px; background: var(--line-strong); }
.map-spine::after { content: ""; position: absolute; left: 6px; top: 0; bottom: 22px; width: 2px; background: var(--line-strong); }
.map-spine > .map-box::before { content: ""; position: absolute; left: -16px; top: 20px; width: 16px; height: 2px; background: var(--line-strong); }


/* Josh: tabs, today, the 30-day strip */
.seg-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 3px; background: rgba(25,47,95,0.06); border-radius: 14px; }
.seg-tabs button { height: 38px; border: 0; background: none; border-radius: 11px; font: 500 15px/20px var(--font); color: var(--navy); cursor: pointer; transition: background-color .2s ease; }
.seg-tabs button[aria-selected="true"] { background: var(--white); font-weight: 600; box-shadow: 0 1px 3px rgba(25,47,95,0.12); }
.agents-body { display: flex; flex-direction: column; gap: 12px; min-height: 360px; animation: cm-in .15s ease; }
.agent-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: default; }
.agent-av { background: var(--navy); color: var(--white); }
.agent-row .mrow-t b small { font-size: 12px; font-weight: 500; color: var(--ink-muted); margin-left: 4px; }
.agent-row .flags { color: #7A5A00 !important; font-size: 13px !important; }
.chip-s { height: 24px; padding: 0 8px; border-radius: 6px; font: 500 12px/24px var(--font); white-space: nowrap; flex: none; }
.chip-s.green { background: #E6F4EA; color: #1E6B3A; } .chip-s.yellow { background: #FFF4D6; color: #7A5A00; }
.chip-s.red { background: #FDE8E8; color: #A12A2A; } .chip-s.mist { background: var(--mist); color: var(--navy); }
.notice { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--white); box-shadow: inset 4px 0 0 var(--pink), 0 1px 2px rgba(25,47,95,0.04); font-size: 14px; }
.notice b { font-size: 15px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.strip-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; }
.strip-name { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.strip-name b { font-size: 16px; }
.strip-name span { color: var(--ink-muted); }
.strip { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; }
.sq { display: block; height: 18px; border-radius: 3px; background: var(--mist); }
.legend .sq { width: 12px; height: 12px; }
.sq.s-ok { background: #3E9A5C; } .sq.s-flag { background: #E2B33B; } .sq.s-failed, .sq.s-missed { background: var(--error); } .sq.s-urgent { background: #8E2424; }
.sq.s-not_due { background: rgba(25,47,95,0.16); } .sq.s-unknown { background: repeating-linear-gradient(45deg, rgba(25,47,95,0.12) 0 3px, transparent 3px 6px); }
.sq.s-none { background: rgba(25,47,95,0.05); } .sq.s-waiting { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(25,47,95,0.3); }
.ask-card { border: 0; box-shadow: 0 1px 2px rgba(25,47,95,0.04), 0 8px 24px rgba(25,47,95,0.06); border-radius: 20px; }
@media (max-width: 899px) { .hero .seg-tabs { background: rgba(255,255,255,0.14); } }
@media (prefers-reduced-motion: reduce) { .agents-body, .tidy-btn.busy svg { animation: none !important; } .td-sub::after, .fam-head::after { transition: none !important; } }
/* Empty departments stay out of the way until you drag a line toward one. */
.td-dept.is-empty { display: none; }
body.cm-dragging .td-dept.is-empty { display: block; }
/* Long sheets scroll; nothing inside them gets squeezed. */
.sheet > * { flex-shrink: 0; }
/* A department's score: open now, and done in the last 7 days */
.dept-score { display: flex; gap: 6px; align-items: center; padding: 0 16px 8px; font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.dept-score .is-open { color: var(--navy); font-weight: 600; }
.dept-score .sep { color: rgba(25,47,95,0.35); }

/* Log sheet: why a child did not come sits under their name. */
.kid-why { display: block; margin-top: 8px; }
.kid-why[hidden] { display: none; }

/* Billing review lines on To-dos open a yes or no sheet. */
.rec-body.click { cursor: pointer; }
