/* Willowhayne Gardens Staff Hub — styles
   Palette and type follow willowhaynegardens.com: olive, ink, gold, stone paper, cream. */
:root {
  --olive: #5F604C;
  --olive-deep: #4A4B3B;
  --olive-soft: #E9EADF;
  --ink: #2F342F;
  --gold: #C4A24C;
  --gold-soft: #F6EED6;
  --paper: #F5F5F0;
  --cream: #F3ECDA;
  --card: #FFFFFF;
  --muted: #74766A;
  --line: #E2E0D5;
  --rust: #A4533F;
  --rust-soft: #F5E5E0;
  --slate: #7E858A;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --body: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
  --side: 248px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-weight: 300; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--olive); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; color: var(--olive); margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
p { margin: 0; }
.eyebrow { font-weight: 500; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--olive); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* ---------- shell ---------- */
.shell { min-height: 100%; }
header.top { position: sticky; top: 0; z-index: 30; background: var(--card); border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header.top img.logo { height: 30px; width: auto; display: block; }
.who { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; text-align: right; }
.who b { display: block; font-weight: 500; font-size: 13px; line-height: 1.2; }
.who span { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--olive); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 500; letter-spacing: 0.05em; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.gold { background: var(--gold); }
main { width: 100%; max-width: 860px; margin: 0 auto; padding: 22px max(16px, env(safe-area-inset-left)) calc(100px + env(safe-area-inset-bottom)); display: grid; gap: 20px; align-content: start; }
main.wide { max-width: 1320px; }
nav.side { display: none; }
nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
nav.bottom button { background: none; border: 0; padding: 9px 2px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); position: relative; }
nav.bottom svg, nav.side svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
nav.bottom button[aria-current="page"] { color: var(--olive); }
nav.bottom button[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--gold); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #fff; font-size: 10.5px; font-weight: 600; letter-spacing: 0; display: inline-grid; place-items: center; }
nav.bottom .badge { position: absolute; top: 4px; left: calc(50% + 5px); }
@media (min-width: 960px) {
  nav.bottom { display: none; }
  .shell { display: grid; grid-template-columns: var(--side) 1fr; grid-template-rows: auto 1fr; }
  header.top { grid-column: 1 / -1; padding-left: 24px; padding-right: 24px; }
  header.top img.logo { height: 36px; }
  nav.side { display: flex; flex-direction: column; gap: 2px; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--card);
    position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto; }
  nav.side .group { margin: 16px 10px 6px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
  nav.side button { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 9px 12px; border-radius: var(--radius); font-size: 14px; font-weight: 400; color: var(--ink); text-align: left; }
  nav.side button svg { width: 19px; height: 19px; color: var(--muted); }
  nav.side button:hover { background: var(--paper); }
  nav.side button[aria-current="page"] { background: var(--olive-soft); color: var(--olive-deep); font-weight: 500; }
  nav.side button[aria-current="page"] svg { color: var(--olive); }
  nav.side .badge { margin-left: auto; }
  main { padding: 28px 32px 56px; }
}

/* inline icons */
main svg, .sheet svg, .toast svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--olive); color: #fff; border: 1px solid var(--olive); border-radius: 2px;
  padding: 13px 20px; font-size: 11.5px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; transition: background .15s; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--olive-deep); }
.btn.ghost { background: transparent; color: var(--olive); }
.btn.ghost:hover { background: var(--cream); }
.btn.danger { background: transparent; color: var(--rust); border-color: #D9B8AE; }
.btn.danger:hover { background: var(--rust-soft); }
.btn.gold { background: var(--gold); border-color: var(--gold); }
.btn.block { width: 100%; }
.btn.sm { padding: 9px 13px; font-size: 10.5px; letter-spacing: 0.16em; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--olive); font-weight: 500; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold); white-space: nowrap; }
.iconbtn { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--card); border-radius: 2px; display: inline-grid; place-items: center; color: var(--olive); flex: none; }
main .iconbtn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* ---------- cards, lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 16px; }
.pad-lg { padding: 22px 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.list { display: grid; gap: 10px; }
.item { padding: 14px 16px; display: grid; grid-template-columns: 6px 1fr auto; gap: 14px; align-items: center; text-align: left; width: 100%; }
button.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
button.item:hover { border-color: var(--olive); }
.item .stripe { align-self: stretch; border-radius: 3px; background: var(--line); }
.item .t { font-weight: 500; font-size: 15px; }
.item .m { font-size: 12.5px; color: var(--muted); display: flex; gap: 4px 10px; flex-wrap: wrap; margin-top: 2px; }
.item .side { display: grid; justify-items: end; gap: 6px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rows li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; background: var(--paper); color: var(--muted); }
.pill.wait { background: var(--gold-soft); color: #7E6420; }
.pill.good { background: var(--olive-soft); color: var(--olive-deep); }
.pill.bad { background: var(--rust-soft); color: var(--rust); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: var(--paper); font-size: 12.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.empty { padding: 26px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.note { background: var(--cream); padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; }
.callout { font-size: 13.5px; padding: 10px 12px; border-left: 3px solid var(--gold); background: #FBF7EC; border-radius: 0 var(--radius) var(--radius) 0; }
.callout.bad { border-left-color: var(--rust); background: #FAF0EC; }
.callout.ok { border-left-color: var(--olive); background: #F1F2EA; }
.example { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: left; display: grid; gap: 8px; position: relative; min-height: 104px; align-content: start; }
.tile:hover { border-color: var(--olive); }
main .tile svg, .sheet .tile svg { width: 24px; height: 24px; stroke: var(--olive); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tile b { font-weight: 500; font-size: 14px; }
.tile span { font-size: 12px; color: var(--muted); }
.tile .badge { position: absolute; top: 12px; right: 12px; }
.stat { padding: 16px; display: grid; gap: 4px; }
.stat b { font-family: var(--display); font-size: 34px; font-weight: 400; color: var(--olive); line-height: 1; }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.segtabs { display: inline-flex; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; background: var(--card); flex-wrap: wrap; }
.segtabs button { background: none; border: 0; border-right: 1px solid var(--line); padding: 8px 14px; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.segtabs button:last-child { border-right: 0; }
.segtabs button[aria-pressed="true"] { background: var(--olive); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 6px 12px; font-size: 12.5px; }
.chip[aria-pressed="true"] { background: var(--olive); border-color: var(--olive); color: #fff; }
.search { position: relative; }
.search input { padding-left: 38px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; stroke: var(--muted); fill: none; stroke-width: 1.8; }
.back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; }
.back svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }

/* tables */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.t { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card); position: sticky; top: 0; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--paper); }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .lbl { font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--olive); }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: -2px; }
.field .err { color: var(--rust); font-size: 12.5px; }
.req::after { content: " *"; color: var(--gold); }
.input { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 2px; padding: 11px 13px; font-size: 16px; font-weight: 400; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--olive); outline: none; box-shadow: 0 0 0 3px var(--olive-soft); }
.input.bad { border-color: var(--rust); }
.yn { display: inline-grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; max-width: 220px; }
.yn button { background: var(--card); border: 0; padding: 10px; font-size: 14px; }
.yn button + button { border-left: 1px solid var(--line); }
.yn button[aria-pressed="true"] { background: var(--olive); color: #fff; }
.rating { display: inline-grid; grid-template-columns: repeat(5, 40px); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.rating button { background: var(--card); border: 0; border-right: 1px solid var(--line); padding: 9px 0; font-size: 14px; }
.rating button:last-child { border-right: 0; }
.rating button[aria-pressed="true"] { background: var(--olive); color: #fff; }
.checks { display: grid; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--olive); flex: none; }
.daypick { display: inline-grid; grid-template-columns: repeat(7, 42px); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.daypick button { background: var(--card); border: 0; border-right: 1px solid var(--line); padding: 9px 0; font-size: 12.5px; }
.daypick button:last-child { border-right: 0; }
.daypick button[aria-pressed="true"] { background: var(--olive); color: #fff; }
.form-section { padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.form-section h3 { font-size: 17px; margin-top: 10px; }
.sigpad { border: 1px dashed var(--olive); border-radius: var(--radius); background: #FDFDFB; touch-action: none; width: 100%; height: 160px; display: block; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .two.collapse { grid-template-columns: 1fr; } }

/* ---------- sheet (bottom sheet on phones, dialog on desktop) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(47,52,47,.45); z-index: 50; display: none; }
.scrim.open { display: block; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--card); border-radius: 12px 12px 0 0; max-height: 94%; overflow-y: auto;
  padding: 8px 20px calc(22px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .22s ease-out; overscroll-behavior: contain; }
.sheet.open { transform: none; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 14px; }
.sheet .inner { display: grid; gap: 16px; max-width: 620px; margin: 0 auto; }
.sheet .acts { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; position: sticky; bottom: calc(-22px - env(safe-area-inset-bottom)); background: var(--card); padding: 12px 0 calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; width: 640px; bottom: auto; top: 50%; max-height: 88vh; border-radius: 8px; transform: translate(-50%, -47%); opacity: 0; pointer-events: none; transition: opacity .15s, transform .18s; padding-top: 22px; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
  .sheet .grab { display: none; }
  .sheet .acts { bottom: -22px; padding-bottom: 6px; }
}
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 4px; font-size: 13.5px; opacity: 0; transition: opacity .2s, transform .2s; z-index: 70; max-width: calc(100% - 32px); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--rust); }
@media (min-width: 960px) { .toast { bottom: 28px; } }
.status { font-size: 11.5px; color: var(--muted); text-align: center; display: flex; gap: 6px; justify-content: center; align-items: center; }
.status .dot { width: 7px; height: 7px; }

/* ---------- leave ---------- */
.big { font-family: var(--display); font-size: 56px; line-height: 0.9; color: var(--olive); }
.big small { font-family: var(--body); font-size: 14px; color: var(--muted); font-weight: 300; margin-left: 6px; }
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); }
.bar span { display: block; height: 100%; }
.keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.keys div { display: grid; gap: 2px; }
.keys b { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.1; }
.keys span { font-size: 11px; letter-spacing: 0.06em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
@media (max-width: 420px) { .keys { grid-template-columns: repeat(2, 1fr); row-gap: 12px; } }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--paper); border-radius: var(--radius); padding: 10px 12px; }
.facts div { display: grid; }
.facts b { font-weight: 500; font-size: 14px; }
.facts span { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* calendars */
table.cal { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
table.cal th, table.cal td { padding: 0; text-align: center; border-bottom: 1px solid var(--line); }
table.cal thead th { position: sticky; top: 0; background: var(--card); font-weight: 400; color: var(--muted); padding: 6px 0 5px; min-width: 30px; font-size: 11px; line-height: 1.25; z-index: 1; }
table.cal thead th b { display: block; font-weight: 500; color: var(--ink); font-size: 12.5px; }
table.cal .namecol { position: sticky; left: 0; z-index: 2; background: var(--card); text-align: left; padding: 0 12px; min-width: 128px; white-space: nowrap; font-size: 13px; border-right: 1px solid var(--line); }
table.cal thead .namecol { z-index: 3; }
table.cal td.namecol small { font-size: 10px; letter-spacing: 0.1em; color: var(--gold); margin-left: 6px; font-weight: 500; }
table.cal td { height: 34px; }
table.cal .wkend { background: #F4F3EE; }
table.cal .bh { background: #F6F0DE; }
table.cal th.today b { color: #fff; background: var(--olive); border-radius: 50%; width: 22px; height: 22px; line-height: 22px; margin: 0 auto; }
table.cal td.off { background-image: repeating-linear-gradient(135deg, transparent 0 4px, #E7E5DB 4px 5px); }
.cell { display: grid; place-items: center; width: 26px; height: 24px; margin: 0 auto; border-radius: 3px; color: #fff; font-size: 10.5px; font-weight: 500; }
.cell.pending { background: #fff !important; border: 1.5px dashed currentColor; }
table.cal tfoot td { font-size: 11.5px; height: 28px; color: var(--muted); background: var(--paper); }
table.cal tfoot td.namecol { background: var(--paper); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
table.cal tfoot td.warn { color: var(--rust); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

/* schedule week board */
.board { display: grid; grid-template-columns: 150px repeat(7, minmax(120px, 1fr)); min-width: 1000px; }
.board .h { position: sticky; top: 0; background: var(--card); padding: 8px 10px; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); z-index: 1; }
.board .h b { display: block; font-size: 13px; font-weight: 500; color: var(--ink); }
.board .h.today b { color: var(--olive); }
.board .who { position: sticky; left: 0; background: var(--card); padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; text-align: left; display: block; z-index: 1; }
.board .who small { display: block; font-size: 11px; color: var(--muted); }
.board .slot { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px; display: grid; gap: 5px; align-content: start; min-height: 64px; }
.board .slot.wkend { background: #F8F7F3; }
.board .slot.leave { background-image: repeating-linear-gradient(135deg, transparent 0 6px, #EFEBDD 6px 7px); }
.board .slot.leave::before { content: attr(data-leave); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.visit { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; overflow: hidden; background: var(--olive-soft); border-left: 3px solid var(--olive); border-radius: 3px; padding: 5px 7px; font-size: 12px; line-height: 1.35; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; width: 100%; }
.visit b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visit.done { background: #EEF0E4; border-left-color: #9C9D84; color: var(--muted); }
.visit.done b { text-decoration: line-through; text-decoration-color: #9C9D84; }
.visit.cancelled { opacity: .5; }
.visit.unassigned { background: var(--gold-soft); border-left-color: var(--gold); }
.daygroup { display: grid; gap: 8px; }
.daygroup > .eyebrow { margin-top: 8px; }
.visitcard { padding: 14px 16px; display: grid; gap: 8px; }
.visitcard .addr { font-weight: 500; font-size: 15px; }
.gate { font-family: ui-monospace, Menlo, monospace; font-size: 15px; letter-spacing: 0.08em; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; padding: 2px 8px; }

/* messages */
.thread { display: grid; gap: 10px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.msg small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.msg.them { background: var(--card); border: 1px solid var(--line); justify-self: start; border-bottom-left-radius: 3px; }
.msg.us { background: var(--olive); color: #fff; justify-self: end; border-bottom-right-radius: 3px; }
.msg.us small { color: #DADBCF; }
.msg.sys { justify-self: center; background: var(--paper); color: var(--muted); font-size: 12.5px; max-width: 100%; text-align: center; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }

/* sign in */
.signin { min-height: 100%; display: grid; place-items: start center; padding: calc(40px + env(safe-area-inset-top)) 16px 40px; }
.signin .panel { width: 100%; max-width: 440px; display: grid; gap: 22px; }
.signin .brand { text-align: center; display: grid; justify-items: center; gap: 10px; }
.signin .brand img { width: 270px; max-width: 80%; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); width: 100%; }
.person:hover { border-color: var(--olive); }
.person b { font-weight: 500; font-size: 14px; display: block; }
.person span { font-size: 12px; color: var(--muted); }

/* client portal */
.portal-hero { background: var(--cream); border-radius: var(--radius); padding: 24px 22px; display: grid; gap: 8px; }
.portal-hero h1 { font-size: 32px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { nav, header.top, .btn, .link { display: none !important; } main { padding: 0; } }
.visit .badge { align-self: flex-end; margin-bottom: -16px; }
.visit.task { background: var(--gold-soft); border-left-color: var(--gold); }

/* Month view: one person, whole month */
.board.month { grid-template-columns: repeat(7, minmax(110px, 1fr)); min-width: 780px; }
.board.month .slot { min-height: 92px; }
@media (max-width: 700px) {
  .board.month { grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 0; }
  .board.month .h { padding: 6px 3px; text-align: center; }
  .board.month .slot { min-height: 58px; padding: 3px; gap: 3px; }
  .board.month .slot.leave::before { font-size: 8px; letter-spacing: 0; }
  .board.month .visit { font-size: 0 !important; padding: 0 !important; min-height: 7px; height: 7px; border-radius: 4px; border-left-width: 0; background: var(--olive); }
  .board.month .visit.done { background: #B9B9A8; }
  .board.month .visit .badge, .board.month .visit b { display: none; }
}
