/* Marten & Oake Bookkeeping — concept / demo project by DDDD
   One stylesheet for the public page and the client portal demo. */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500..800&display=swap"); /* DDDD concept banner only */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --sunk: #efede7;
  --ink: #15202b;
  --ink-2: #3c4752;
  --muted: #5d6772;
  --line: #e1ded6;
  --line-strong: #cbc7bd;
  --teal: #0d6b6b;
  --teal-ink: #0a5555;
  --teal-wash: #e3efee;
  --ok: #1c6b40;
  --ok-wash: #e4f1e8;
  --wait: #7f5300;
  --wait-wash: #fbefd5;
  --late: #8f2f1f;
  --late-wash: #f8e5e0;
  --radius: 6px;
  --radius-sm: 4px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --bar-h: 46px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 24px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--teal-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.012em; line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 500;
}
.skip-link:focus { top: 8px; color: #fff; }

/* ---------- Concept / demo bar ---------- */
/* ---------- DDDD concept banner — v4 studio style (bar only) ----------
   Paper, ink, a 2px ink rule, a thin sun highlighter, terracotta link,
   Bricolage Grotesque. The four-cell wordmark is drawn with empty
   pseudo-elements (decorative, never announced); the sentence and href
   are untouched. Link tap target is 44px tall. */
.demo-bar {
  --dd-paper: #FBF6EC; --dd-ink: #1D1B16; --dd-terra: #B8442A; --dd-terra-ink: #9A3520;
  --dd-sun: #F5BF35; --dd-sky: #BFDDF5;
  position: sticky; top: 0; z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  column-gap: 10px; row-gap: 0;
  box-sizing: border-box; min-height: 46px;
  padding: 4px 16px;
  background: var(--dd-paper); color: var(--dd-ink);
  border-bottom: 2px solid var(--dd-ink);
  font: 500 13.5px/1.35 "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0; text-align: center;
}
.demo-bar strong {
  font-weight: 700; color: var(--dd-ink);
  padding: 0 .2em;
  background: linear-gradient(transparent 56%, var(--dd-sun) 56%, var(--dd-sun) 94%, transparent 94%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.demo-bar > span { white-space: nowrap; }
.demo-bar a {
  display: inline-flex; align-items: center; vertical-align: middle;
  min-height: 44px; margin: -4px 0; padding: 0 2px;
  color: var(--dd-terra); font-weight: 800; letter-spacing: .02em;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.demo-bar a:hover { color: var(--dd-terra-ink); text-decoration-thickness: 2px; }
.demo-bar a:focus-visible { outline: 2px solid var(--dd-ink); outline-offset: 0; border-radius: 4px; }
.demo-bar a::before, .demo-bar a::after {
  content: ""; flex: none; box-sizing: border-box;
  width: 12px; height: 12px; border-radius: 3px;
  border: 1.5px solid var(--dd-ink);
}
.demo-bar a::before {
  order: -2; margin: 0 30px 0 2px;
  background: var(--dd-paper);
  box-shadow: 14px 0 0 -1.5px var(--dd-sun), 14px 0 0 0 var(--dd-ink),
              28px 0 0 -1.5px var(--dd-sky), 28px 0 0 0 var(--dd-ink);
}
.demo-bar a::after {
  order: -1; margin-right: 6px;
  background: var(--dd-terra);
  transform: rotate(-10deg) translateY(-1px);
}
@media (max-width: 520px) { .demo-bar { font-size: 13px; padding: 5px 14px; } }
@media (forced-colors: active) { .demo-bar { border-bottom-color: CanvasText; } .demo-bar a::before, .demo-bar a::after { forced-color-adjust: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-weight: 500; font-size: 15px; line-height: 1;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-ink); color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink-2); padding: 0 10px; min-height: 36px; }
.btn-quiet:hover { color: var(--ink); background: var(--sunk); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Status chips (text + colour) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 8px; border-radius: 999px;
  font-size: 13px; font-weight: 500; line-height: 1.3; white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--ok-wash); color: var(--ok); }
.chip-wait { background: var(--wait-wash); color: var(--wait); }
.chip-late { background: var(--late-wash); color: var(--late); }
.chip-neutral { background: var(--sunk); color: var(--ink-2); }

/* =========================================================
   PUBLIC PAGE
   ========================================================= */
.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-name { font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.brand-name .amp { color: var(--teal); font-weight: 500; }
.brand-desc { font-size: 14px; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a.text-link { color: var(--ink-2); text-decoration: none; font-size: 15px; padding: 10px 12px; border-radius: var(--radius-sm); }
.site-nav a.text-link:hover { color: var(--ink); background: var(--sunk); }

.hero { padding: 88px 0 96px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 72px; align-items: center; }
.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal-ink); margin-bottom: 20px; }
.hero h1 { font-size: clamp(36px, 4.4vw, 56px); line-height: 1.06; letter-spacing: -0.03em; font-weight: 600; max-width: 15ch; text-wrap: balance; }
.hero .lede { margin-top: 24px; font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 34em; }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

/* Portal preview (static mock) */
.preview { position: relative; margin: 0; }
.preview-frame {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 1px 0 rgba(21,32,43,.03), 0 24px 48px -28px rgba(21,32,43,.22);
  overflow: hidden;
}
.preview-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.preview-top strong { color: var(--ink); font-weight: 600; font-size: 14px; }
.preview-body { padding: 22px 22px 10px; }
.preview-body h2 { font-size: 20px; }
.preview-body .sub { margin-top: 4px; color: var(--muted); font-size: 14px; }
.preview-meter { margin: 16px 0 6px; }
.preview-list { list-style: none; margin-top: 10px; }
.preview-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; }
.preview-tag { position: absolute; top: -12px; left: 18px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; letter-spacing: 0.02em; }

.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 48px; margin-bottom: 48px; align-items: end; }
.section-head h2 { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.022em; }
.section-head p { color: var(--ink-2); font-size: 17px; max-width: 38em; }

.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.cols-3 > * { padding: 24px 28px 8px 0; }
.cols-3 > * + * { padding-left: 28px; border-left: 1px solid var(--line); }
.cols-3 h3 { font-size: 18px; margin-bottom: 10px; }
.cols-3 p { color: var(--ink-2); }
.idx { display: block; font-family: var(--mono); font-size: 13px; color: var(--teal-ink); margin-bottom: 14px; }

.steps { list-style: none; counter-reset: step; display: grid; gap: 0; }
.steps li { display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; padding: 26px 0; border-top: 1px solid var(--line); align-items: baseline; }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps .when { font-size: 13px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.steps h3 { font-size: 18px; }
.steps p { color: var(--ink-2); }

.services { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.services li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.services h3 { font-size: 17px; margin-bottom: 8px; }
.services p { color: var(--ink-2); font-size: 15px; }

.contact-band { padding: 80px 0 96px; border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.contact-grid h2 { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.022em; max-width: 18ch; }
.contact-grid .lede { margin-top: 16px; color: var(--ink-2); font-size: 17px; max-width: 32em; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.contact-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 12px 20px; font-size: 15px; }
.contact-card dt { color: var(--muted); }
.contact-card dd { margin: 0; }
.placeholder { font-family: var(--mono); font-size: 14px; background: var(--sunk); padding: 1px 6px; border-radius: 3px; color: var(--ink-2); }

.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* =========================================================
   APP (client portal demo)
   ========================================================= */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - var(--bar-h)); }

.sidebar {
  position: sticky; top: var(--bar-h); align-self: start;
  height: calc(100vh - var(--bar-h));
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 22px 14px 18px;
}
.sidebar .brand { padding: 0 10px; flex-direction: column; gap: 2px; }
.sidebar .brand-name { font-size: 17px; }
.sidebar .brand-desc { font-size: 13px; }
.who { margin: 22px 10px 18px; padding: 12px; background: var(--sunk); border-radius: var(--radius); font-size: 13px; line-height: 1.4; }
.who .label { color: var(--muted); display: block; }
.who strong { font-weight: 600; font-size: 14px; }

.app-nav ul { list-style: none; display: grid; gap: 2px; }
.app-nav a {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500;
}
.app-nav a:hover { background: var(--sunk); color: var(--ink); }
.app-nav a[aria-current="page"] { background: var(--teal-wash); color: var(--teal-ink); }
.app-nav .ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; }
.app-nav .lbl { display: flex; align-items: center; gap: 10px; }
.count { font-family: var(--mono); font-size: 12px; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 999px; background: var(--wait-wash); color: var(--wait); }
.count[data-zero] { background: var(--ok-wash); color: var(--ok); }

.sidebar-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.sidebar-foot a, .sidebar-foot button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer;
  color: var(--muted); font-size: 14px; text-decoration: none; text-align: left;
}
.sidebar-foot a:hover, .sidebar-foot button:hover { background: var(--sunk); color: var(--ink); }
.sidebar-foot a[aria-current="page"] { background: var(--teal-wash); color: var(--teal-ink); }

.main { padding: 40px 56px 96px; max-width: 1040px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.page-head h1 { font-size: 30px; letter-spacing: -0.024em; }
.page-head .sub { margin-top: 6px; color: var(--ink-2); font-size: 16px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel + .panel { margin-top: 20px; }
.side-stack > .panel + .panel { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; }
.panel-body { padding: 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Progress */
.summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: center; padding: 22px 20px; }
.summary .big { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.summary .big .num { font-size: 21px; }
.meter { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--teal); border-radius: 99px; transition: width .5s var(--ease); }
.meter-sm { height: 6px; }

/* Checklist */
.checklist { list-style: none; }
.checklist li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 14px; align-items: start;
  padding: 18px 20px; border-top: 1px solid var(--line);
}
.checklist li:first-child { border-top: 0; }
.tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.tick svg { width: 13px; height: 13px; }
.tick-ok { background: var(--ok); color: #fff; }
.tick-wait { border: 1.5px dashed var(--wait); }
.item-name { font-weight: 600; font-size: 16px; }
.item-desc { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.item-meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.checklist li.is-new { animation: settle .6s var(--ease); }
@keyframes settle { from { background: var(--teal-wash); } to { background: transparent; } }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--teal-wash); color: var(--teal-ink); font-size: 14px; }
.callout svg { flex: none; width: 18px; height: 18px; margin-top: 2px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.callout-plain { background: var(--sunk); color: var(--ink-2); }

.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.side-stack { display: grid; gap: 20px; }
.kv { list-style: none; display: grid; gap: 10px; font-size: 14px; }
.kv li { display: flex; justify-content: space-between; gap: 12px; }
.kv span:first-child { color: var(--muted); }

/* Upload */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--surface);
  padding: 48px 24px; text-align: center;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.dropzone.is-over { border-color: var(--teal); background: var(--teal-wash); }
.dropzone svg { width: 36px; height: 36px; margin: 0 auto 14px; stroke: var(--teal); fill: none; stroke-width: 1.5; }
.dropzone h2 { font-size: 18px; }
.dropzone p { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.dropzone .btn { margin-top: 18px; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.files { list-style: none; }
.files li { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(200px, 260px) auto; gap: 14px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); }
.files li:first-child { border-top: 0; }
.file-ico { width: 40px; height: 48px; border: 1px solid var(--line-strong); border-radius: 4px; display: grid; place-items: end center; padding-bottom: 6px; font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; background: var(--bg); }
.file-name { font-weight: 500; overflow-wrap: anywhere; }
.file-size { color: var(--muted); font-size: 13px; }
.field-inline label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
select, input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
}
select { appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d6772' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
select:hover, input:hover, textarea:hover { border-color: var(--muted); }
select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 15px; }
.done-note { display: flex; align-items: center; gap: 8px; color: var(--ok); font-size: 14px; font-weight: 500; }

/* Messages */
.threads { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 560px; }
.thread-list { border-right: 1px solid var(--line); list-style: none; }
.thread-list button {
  display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.thread-list button:hover { background: var(--bg); }
.thread-list button[aria-selected="true"] { background: var(--teal-wash); box-shadow: inset 3px 0 0 var(--teal); }
.thread-list .t-title { font-weight: 600; font-size: 15px; display: block; }
.thread-list .t-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.thread-head h2 { font-size: 17px; }
.msgs { list-style: none; padding: 22px; display: grid; gap: 20px; flex: 1; align-content: start; }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; max-width: 640px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; background: var(--ink); color: #fff; }
.msg.from-you .avatar { background: var(--teal-wash); color: var(--teal-ink); }
.msg-meta { font-size: 13px; color: var(--muted); }
.msg-meta strong { color: var(--ink); font-weight: 600; margin-right: 6px; }
.msg-body { margin-top: 4px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 2px 8px 8px 8px; font-size: 15px; }
.msg.from-you .msg-body { background: var(--surface); }
.attach { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.compose { border-top: 1px solid var(--line); padding: 16px 22px 20px; }
.compose label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.compose textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.compose-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.field-error { color: var(--late); font-size: 13px; margin-top: 6px; }

/* Past months */
.months { list-style: none; display: grid; gap: 12px; }
.month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.month summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.3fr) 180px 20px; gap: 20px; align-items: center; padding: 18px 20px; border-radius: var(--radius); }
.month summary::-webkit-details-marker { display: none; }
.month summary:hover { background: var(--bg); }
.month summary > .chip { justify-self: end; }
.month .m-name { font-weight: 600; font-size: 17px; }
.month .m-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.chev { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 1.8; transition: transform .2s var(--ease); }
.month[open] .chev { transform: rotate(180deg); }
.month-docs { list-style: none; border-top: 1px solid var(--line); padding: 4px 20px 12px; }
.month-docs li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.month-docs li:last-child { border-bottom: 0; }
.month-docs .when { color: var(--muted); font-size: 13px; }
.month-note { padding: 12px 20px 18px; font-size: 14px; color: var(--ink-2); }

/* Staff overview */
.staff-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--teal-ink); background: var(--teal-wash); padding: 4px 10px; border-radius: 999px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .s-label { font-size: 13px; color: var(--muted); }
.stat .s-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--bg); }
td { padding: 16px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.prog { display: grid; grid-template-columns: minmax(80px, 1fr) auto; gap: 10px; align-items: center; }
.client-name { font-weight: 600; display: block; }
.client-kind { display: block; font-size: 13px; color: var(--muted); }
td:first-child { min-width: 170px; }
.waiting-on { font-size: 14px; color: var(--ink-2); }

/* Login */
.login-wrap { min-height: calc(100vh - var(--bar-h)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-side { background: var(--surface); border-right: 1px solid var(--line); padding: 48px 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.login-side .brand { flex-direction: column; gap: 4px; }
.login-side h2 { font-size: 28px; letter-spacing: -0.024em; max-width: 22ch; line-height: 1.15; }
.login-side .lede { margin-top: 14px; color: var(--ink-2); max-width: 32em; }
.login-side ul { list-style: none; margin-top: 28px; display: grid; gap: 12px; }
.login-side li { display: flex; gap: 12px; align-items: baseline; color: var(--ink-2); }
.login-side li .num { color: var(--teal-ink); font-size: 13px; font-family: var(--mono); }
.login-main { display: grid; place-items: center; padding: 48px 24px; }
.login-card { width: min(400px, 100%); }
.login-card h1 { font-size: 26px; letter-spacing: -0.02em; }
.login-card .sub { margin-top: 6px; color: var(--ink-2); }
.demo-hint { margin-top: 24px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--teal) 7%, var(--surface)); font-size: 14px; }
.demo-hint strong { font-weight: 600; }
.demo-hint code { font-family: var(--mono); background: var(--sunk); padding: 1px 6px; border-radius: 3px; }
.form-field { margin-top: 18px; }
.form-field label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.form-field input { min-height: 44px; }
.form-field input[aria-invalid="true"] { border-color: var(--late); }
.or { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-block { width: 100%; }

/* Mobile tab bar (app) */
.mobile-top, .tabbar { display: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1080px) {
  .main { padding: 32px 32px 96px; }
  .two-col { grid-template-columns: 1fr; }
  .files li { grid-template-columns: 40px minmax(0, 1fr); }
  .files li .field-inline, .files li .file-act { grid-column: 2; }
}

@media (max-width: 900px) {
  .hero { padding: 56px 0 64px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .section { padding: 64px 0; }
  .section-head { grid-template-columns: 1fr; gap: 12px; margin-bottom: 32px; }
  .cols-3 { grid-template-columns: 1fr; border-top: 0; }
  .cols-3 > *, .cols-3 > * + * { padding: 22px 0; border-left: 0; border-top: 1px solid var(--line); }
  .cols-3 > *:first-child { border-top: 1px solid var(--ink); }
  .steps li { grid-template-columns: 1fr; gap: 6px; }
  .services { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }

  .app { grid-template-columns: 1fr; align-content: start; }
  .sidebar { display: none; }
  .mobile-top {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .mobile-top .brand { flex-direction: column; gap: 0; }
  .mobile-top .brand-name { font-size: 16px; }
  .mobile-top .brand-desc { font-size: 12px; }
  .mobile-top .who-sm { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.35; }
  .mobile-top .who-sm strong { display: block; color: var(--ink); font-weight: 600; font-size: 13px; }
  .tabbar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar ul { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 10px; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--teal-ink); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--teal); }
  .tabbar .ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; }
  .tabbar .count { position: absolute; top: 4px; left: calc(50% + 6px); font-size: 10px; min-width: 18px; padding: 0 5px; }
  .main { padding: 24px 20px 120px; }
  .page-head h1 { font-size: 26px; }
  .threads { grid-template-columns: 1fr; min-height: 0; }
  .thread-list { border-right: 0; display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); }
  .thread-list li { flex: 0 0 auto; }
  .thread-list button { border-bottom: 0; border-right: 1px solid var(--line); min-width: 220px; }
  .thread-list button[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--teal); }
  .login-wrap { grid-template-columns: 1fr; align-content: start; }
  .login-side { justify-content: flex-start; gap: 28px; }
  .login-side { order: 2; border-right: 0; border-top: 1px solid var(--line); padding: 36px 24px; }
  .login-main { padding: 40px 20px 48px; place-items: start center; }
  .stats { grid-template-columns: 1fr; }
  .mobile-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
}
@media (min-width: 901px) { .mobile-foot { display: none; } }

@media (max-width: 640px) {
  .wrap { width: calc(100% - 40px); }
  .site-header .wrap { min-height: 64px; }
  .brand-desc { display: none; }
  .site-nav a.text-link { display: none; }
  .hero .lede { font-size: 17px; }
  .preview-body { padding: 18px 16px 6px; }
  .preview-list li { font-size: 14px; flex-wrap: wrap; row-gap: 6px; }
  .checklist li { grid-template-columns: 26px minmax(0, 1fr); padding: 16px; }
  .item-side { grid-column: 2; grid-row: 1; flex-direction: row; align-items: center; }
  .checklist li > div:not(.item-side) { grid-column: 2; grid-row: 2; }
  .checklist .tick { grid-row: 1; }
  .summary { grid-template-columns: 1fr; padding: 18px 16px; }
  .month summary { grid-template-columns: minmax(0, 1fr) 20px; gap: 8px 12px; }
  .month summary .m-prog { grid-column: 1; grid-row: 2; }
  .month summary .chip { grid-column: 1; grid-row: 3; justify-self: start; }
  .month summary .chev { grid-column: 2; grid-row: 1; }
  .month-docs li { flex-direction: column; gap: 2px; }
  .panel-head { padding: 14px 16px; }
  .panel-body { padding: 16px; }
  .files li { padding: 14px 16px; }
  .msgs { padding: 18px 16px; }
  .compose { padding: 14px 16px 18px; }
  .thread-head { padding: 14px 16px; }
  /* staff table → cards */
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table-wrap tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { padding: 4px 0; border: 0; }
  .table-wrap td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; }
  .table-wrap td:first-child::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
