/* ==========================================================================
   OVERYARD CLIENT PORTAL: stylesheet ("From the ground up" drawing set)
   Same tokens, fonts and drawing details as overyarddesign.com.

   COLOR MEANING (fixed, same as the website)
   fern  = action and growth (buttons, links, current stage)
   stone = Seed
   gold  = Orchard and value highlights (credits, amounts due)
   clay  = urgency only (overdue, rounds used up, errors); never decorative
   ========================================================================== */

/* ---- Fonts (self-hosted Google Fonts, SIL Open Font License: assets/fonts/OFL-*.txt) ---- */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url("../assets/fonts/bricolage-grotesque.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../assets/fonts/manrope.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../assets/fonts/jetbrains-mono.woff2") format("woff2"); }

/* ---- DARK theme (default) ---- */
:root,
[data-theme="dark"] {
  --bg: #121512;
  --paper: #1A1E1A;
  --ink: #ECEFE8;
  --muted: #A3AB9F;
  --line: #2F352E;
  --field-line: #4A5249;
  --fern: #7FA886;
  --fern-hover: #93B899;
  --fern-soft: #223026;
  --sage: #6E8A69;
  --stone: #A8957A;
  --stone-soft: #2A251D;
  --gold: #E2B754;
  --gold-soft: #352C16;
  --clay: #E08B5E;
  --clay-soft: #3A251B;
  --on-fern: #121512;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---- LIGHT theme (stone, gold, clay darkened for WCAG AA, as on the website) ---- */
[data-theme="light"] {
  --bg: #F5F6F2;
  --paper: #FFFFFF;
  --ink: #141613;
  --muted: #5B6158;
  --line: #D9DDD3;
  --field-line: #858D81;
  --fern: #3D5A45;
  --fern-hover: #2E4636;
  --fern-soft: #E3EBE3;
  --sage: #8FA889;
  --stone: #725F41;
  --stone-soft: #EFE7DA;
  --gold: #7D5D14;
  --gold-soft: #F6EDD6;
  --clay: #97502B;
  --clay-soft: #F5E6DC;
  --on-fern: #F5F6F2;
  --shadow: 0 10px 30px rgba(20, 22, 19, .08);
  color-scheme: light;
}

:root {
  --font-display: "Bricolage Grotesque", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", ui-monospace, Menlo, Consolas, monospace;
  --container: 1200px;
  --gutter: 16px;
  --radius: 6px;
  --header-h: 64px;
}
@media (min-width: 760px) { :root { --gutter: 28px; } }
@media (min-width: 1000px) { :root { --gutter: 40px; --header-h: 72px; } }

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font-body); font-size: 1rem; line-height: 1.6;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
h3 { font-size: 1.08rem; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; }
a { color: var(--fern); }
a:hover { color: var(--fern-hover); }
:focus-visible { outline: 2px solid var(--fern); outline-offset: 3px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(720px + var(--gutter) * 2); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius); }
.skip-link:focus { top: 12px; color: var(--bg); }
.muted { color: var(--muted); }
.stack > * + * { margin-top: 12px; }

/* Mono labels and plan-symbol eyebrows */
.label { font: 400 .74rem/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sheet-label {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font: 600 .76rem/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fern);
}
.eyebrow-glyph { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow-glyph .fill { fill: currentColor; stroke: none; }
.north { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.2; }
.north path { fill: currentColor; stroke: none; }

/* ==========================================================================
   Buttons and form controls
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 46px; padding: 0 20px;
  border: 1.5px solid transparent; border-radius: var(--radius);
  font: 600 .98rem/1.2 var(--font-body); text-align: center; text-decoration: none;
  cursor: pointer; transition: background-color .2s, border-color .2s, color .2s;
}
.btn-primary { background: var(--fern); color: var(--on-fern); }
.btn-primary:hover { background: var(--fern-hover); color: var(--on-fern); }
.btn-outline { border-color: var(--field-line); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-clay { border-color: var(--clay); color: var(--clay); background: transparent; }
.btn-clay:hover { background: var(--clay-soft); color: var(--clay); }
.btn-small { min-height: 38px; padding: 0 14px; font-size: .88rem; }
.btn-link { min-height: 0; padding: 0; border: 0; background: none; color: var(--fern); text-decoration: underline; font-weight: 600; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: wait; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.field { display: grid; gap: 6px; }
.field + .field, .field + .field-row, .field-row + .field, .field-row + .field-row { margin-top: 14px; }
.field-row { display: grid; gap: 14px; }
.field-row > .field { margin-top: 0; }
@media (min-width: 640px) { .field-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.field label, .field .field-label { font-weight: 600; font-size: .92rem; }
.field .hint { font-size: .84rem; color: var(--muted); }
.req { color: var(--clay); }
input[type="text"], input[type="email"], input[type="url"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--field-line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink);
  font: 400 1rem/1.4 var(--font-body);
}
textarea { min-height: 96px; resize: vertical; }
input[type="file"] { width: 100%; padding: 10px; border: 1px dashed var(--field-line); border-radius: var(--radius); background: var(--bg); color: var(--ink); font: inherit; font-size: .92rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--fern); outline-offset: 1px; border-color: var(--fern); }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--fern); }

.form-msg { margin-top: 12px; font-size: .92rem; }
.form-msg.is-error { color: var(--clay); }
.form-msg.is-ok { color: var(--fern); font-weight: 600; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { position: relative; display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.logo { color: var(--ink); display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo:hover { color: var(--ink); }
.logo-svg { width: 118px; height: auto; }
.logo-o { stroke: var(--fern); }
.logo-dot { fill: var(--fern); }
.logo-tag { padding-left: 10px; border-left: 1px solid var(--line); }
@media (max-width: 420px) { .logo-tag { display: none; } }
.header-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.theme-toggle, .nav-toggle {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--ink);
}
.theme-toggle:hover { background: var(--paper); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-moon { display: none !important; }
[data-theme="light"] .icon-sun { display: none !important; }
[data-theme="light"] .icon-moon { display: block !important; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { display: block; width: 22px; height: 1.5px; background: var(--ink); transition: transform .25s, background-color .25s; }
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  padding: 4px var(--gutter) 20px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a, .site-nav button.nav-signout {
  display: block; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--ink); font: 500 1rem/1.3 var(--font-body); text-align: left; text-decoration: none; cursor: pointer;
}
.site-nav a[aria-current="page"] { color: var(--fern); font-weight: 600; }
.nav-who { padding-top: 14px; }
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .header-actions { order: 3; margin-left: 0; }
  .site-nav { display: flex; align-items: center; gap: 22px; position: static; padding: 0; background: none; border: 0; margin-left: auto; }
  .site-nav ul { display: flex; gap: 22px; }
  .site-nav a, .site-nav button.nav-signout { padding: 6px 0; border: 0; font-size: .95rem; width: auto; }
  .site-nav a:hover, .site-nav button.nav-signout:hover { color: var(--fern); }
  .site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--fern); }
  .nav-who { padding: 0 0 0 18px; border-left: 1px solid var(--line); }
}

/* ==========================================================================
   Page layout
   ========================================================================== */
.page { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(48px, 7vw, 88px); }
.page-head { margin-bottom: clamp(24px, 4vw, 36px); }
.page-head .lede { margin-top: 10px; color: var(--muted); max-width: 60ch; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; font-size: .92rem; text-decoration: none; }
.section { margin-top: clamp(32px, 5vw, 48px); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: clamp(16px, 3vw, 24px); }
.panel + .panel { margin-top: 16px; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 960px) {
  .grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: start; }
}
.empty { padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: .95rem; }
.loading { color: var(--muted); }
.notice { padding: 12px 14px; border-left: 3px solid var(--fern); background: var(--fern-soft); border-radius: 0 var(--radius) var(--radius) 0; font-size: .95rem; }
.notice-clay { border-left-color: var(--clay); background: var(--clay-soft); }
.notice-clay strong { color: var(--clay); }
.demo-bar { background: var(--gold-soft); color: var(--ink); border-bottom: 1px solid var(--line); font-size: .86rem; padding: 6px 0; }
.demo-bar strong { color: var(--gold); font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }

/* Crop-mark frame (thin L corners), as on the website's project cards */
.cropped { position: relative; }
.cm { position: absolute; z-index: 1; width: 14px; height: 14px; border: 0 solid var(--field-line); pointer-events: none; transition: border-color .2s; }
.cm-tl { top: -1px; left: -1px; border-top-width: 1.5px; border-left-width: 1.5px; }
.cm-tr { top: -1px; right: -1px; border-top-width: 1.5px; border-right-width: 1.5px; }
.cm-bl { bottom: -1px; left: -1px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.cm-br { bottom: -1px; right: -1px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

/* Tags */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 3px; font: 600 .7rem/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tag-seed { color: var(--stone); border-color: color-mix(in srgb, var(--stone) 45%, transparent); background: var(--stone-soft); }
.tag-fern { color: var(--fern); border-color: color-mix(in srgb, var(--fern) 45%, transparent); background: var(--fern-soft); }
.tag-gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: var(--gold-soft); }
.tag-clay { color: var(--clay); border-color: color-mix(in srgb, var(--clay) 45%, transparent); background: var(--clay-soft); }
.overdue, .card-meta strong.overdue, .project-meta strong.overdue { color: var(--clay); font-weight: 600; }

/* ==========================================================================
   Stage tracker: six stepping stones on a dashed path (like How it works)
   ========================================================================== */
.stages { --done: var(--fern); list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: relative; }
.stages::before { /* the drawn path */
  content: ""; position: absolute; left: calc(100% / 12); right: calc(100% / 12); top: 8px;
  border-top: 1.5px dashed var(--field-line);
}
.stage { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; min-width: 0; }
.stage-dot { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--field-line); background: var(--bg); }
.stage-name { font: 500 .68rem/1.25 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.stage.is-done .stage-dot { background: var(--done); border-color: var(--done); }
.stage.is-done::after { /* solid line over the dashes for finished legs */
  content: ""; position: absolute; top: 8px; left: 50%; width: 100%; border-top: 1.5px solid var(--done);
}
.stage.is-current .stage-dot { border: 2px solid var(--fern); background: var(--fern-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--fern) 25%, transparent); }
.stage.is-current .stage-dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--fern); }
.stage.is-current .stage-name { color: var(--fern); font-weight: 600; }
.stages-compact .stage-name { display: none; }
.stages-compact .stage-dot { width: 14px; height: 14px; }
.stages-compact::before, .stages-compact .stage.is-done::after { top: 6px; }
.stages-compact .stage.is-current .stage-dot::after { inset: 3px; }
.stage-now { margin-top: 10px; font-size: .9rem; }
.stage-now strong { color: var(--fern); }
.paper .stages .stage-dot { background: var(--paper); }
@media (max-width: 559px) { .stages-full .stage-name { display: none; } }
@media (min-width: 560px) { .stages-full + .stage-now { display: none; } }

/* ==========================================================================
   Project cards
   ========================================================================== */
.cards { display: grid; gap: 18px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); background: var(--paper); border-radius: 2px; color: var(--ink); text-decoration: none; transition: border-color .2s; }
.card:hover { color: var(--ink); border-color: var(--field-line); }
.card:hover .cm, .card:focus-visible .cm { border-color: var(--fern); }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.card h3 { font-size: 1.12rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; color: var(--muted); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.card-meta strong { color: var(--ink); font-weight: 600; }
.card-stage { font-size: .9rem; }
.card-stage strong { color: var(--fern); }

/* Credits panel */
.credits { display: grid; gap: 16px; align-items: center; }
@media (min-width: 700px) { .credits { grid-template-columns: auto 1fr auto; } }
.credit-count { display: flex; align-items: baseline; gap: 10px; }
.credit-count .num { font: 800 2.6rem/1 var(--font-display); color: var(--gold); letter-spacing: -0.03em; }
.credit-glyph { width: 36px; height: 36px; flex: none; color: var(--gold); fill: none; stroke: currentColor; stroke-width: 1.5; }
.credit-glyph.is-fern { color: var(--fern); }
.credit-glyph.is-clay { color: var(--clay); }
.ledger { list-style: none; margin: 10px 0 0; padding: 0; font-size: .9rem; }
.ledger li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ledger .plus { color: var(--fern); font-weight: 600; }
.ledger .minus { color: var(--muted); font-weight: 600; }
details > summary { cursor: pointer; font-weight: 600; color: var(--fern); list-style-position: inside; }
details[open] > summary { margin-bottom: 6px; }

/* ==========================================================================
   Transmittal strip (on the markup form and the login card)
   ========================================================================== */
.transmittal {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line); border-bottom: 0; background: var(--paper);
  font: 500 .68rem/1.35 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
}
.tr-cell { padding: 9px 12px; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.tr-cell:nth-child(odd) { border-right: 1px solid var(--line); }
.tr-title { font-weight: 600; color: var(--fern); }
.tr-key { color: var(--muted); }
.transmittal + .panel { border-top-left-radius: 0; border-top-right-radius: 0; }

/* ==========================================================================
   Project page: deliverables, markups, notes, invoices
   ========================================================================== */
.project-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; font-size: .95rem; color: var(--muted); }
.project-meta strong { color: var(--ink); font-weight: 600; }
.deliv-group + .deliv-group { margin-top: 18px; }
.deliv-group h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 1rem; }
.deliv-list, .plain-list { list-style: none; margin: 0; padding: 0; }
.deliv-list li, .plain-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.deliv-list li:last-child, .plain-list > li:last-child { border-bottom: 0; }
.deliv-name { min-width: 0; overflow-wrap: anywhere; }
.deliv-name .label { display: block; margin-top: 2px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.thread { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; max-height: 520px; overflow-y: auto; }
.note { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.note.is-team { border-left: 3px solid var(--fern); }
.note-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 4px; }
.note-head strong { font-size: .92rem; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .96rem; }

/* Invoices */
.inv-list { list-style: none; margin: 0; padding: 0; }
.inv { display: grid; gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.inv:last-child { border-bottom: 0; }
.inv-desc strong { display: block; overflow-wrap: anywhere; }
.inv-amount { font: 700 1.15rem/1.2 var(--font-display); }
.inv.is-due .inv-amount { color: var(--gold); }
@media (min-width: 700px) { .inv { grid-template-columns: minmax(0, 1fr) auto auto auto; } }

/* ==========================================================================
   Team dashboard: board by stage
   ========================================================================== */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin-bottom: 20px; }
.filters .field { min-width: 180px; flex: 1 1 180px; }
.filters .field + .field { margin-top: 0; }
.board { display: grid; gap: 14px; }
@media (min-width: 700px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .board { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.column { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 12px; min-width: 0; }
.column-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.column-head .label { color: var(--fern); font-weight: 600; }
.column .empty { padding: 10px; font-size: .86rem; }
.tile { display: block; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); text-decoration: none; }
.tile + .tile { margin-top: 10px; }
.tile:hover { border-color: var(--fern); color: var(--ink); }
.tile.is-overdue { border-left: 3px solid var(--clay); }
.tile h3 { font-size: .98rem; margin-bottom: 4px; overflow-wrap: anywhere; }
.tile-meta { display: grid; gap: 2px; font-size: .84rem; color: var(--muted); }

/* Clients page */
.company { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.company + .company { margin-top: 14px; }
.company > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 16px 18px; color: var(--ink); list-style: none; }
.company > summary::-webkit-details-marker { display: none; }
.company > summary::before { content: "+"; font: 600 1.1rem/1 var(--font-mono); color: var(--fern); width: 14px; }
.company[open] > summary::before { content: "\2212"; }
.company > summary h3 { font-size: 1.05rem; }
.company-body { padding: 0 18px 18px; display: grid; gap: 18px; }
@media (min-width: 960px) { .company-body { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.company-body .panel { background: var(--bg); }
.company-body .panel + .panel { margin-top: 0; }

/* Login */
.login { display: grid; gap: 28px; align-items: center; padding-top: clamp(32px, 7vw, 88px); padding-bottom: clamp(32px, 7vw, 88px); }
@media (min-width: 900px) { .login { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 64px; } }
.login h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); max-width: 12ch; }
.login .lede { margin-top: 14px; color: var(--muted); max-width: 46ch; }
.login-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.login-points li { display: flex; gap: 10px; align-items: flex-start; }
.login-points svg { margin-top: 4px; color: var(--fern); }
.login-card .panel { padding: clamp(18px, 4vw, 28px); }
.small { font-size: .88rem; color: var(--muted); }
.demo-panel { margin-top: 16px; }
.demo-panel .btn-row { margin-top: 10px; }

/* ==========================================================================
   Footer: the drawing title block
   ========================================================================== */
.site-footer { padding: 32px 0 calc(28px + env(safe-area-inset-bottom)); }
.title-block { display: grid; border: 1px solid var(--line); border-radius: var(--radius); }
.tb-cell { padding: 16px 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.tb-cell:last-child { border-bottom: 0; }
.tb-logo .logo-svg { width: 116px; margin-bottom: 10px; }
.tb-tagline { margin-bottom: 8px; font: 700 1rem/1.3 var(--font-display); max-width: 26ch; }
.tb-key { margin-bottom: 6px; color: var(--fern); }
.tb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .92rem; }
.tb-list a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.tb-list a:hover { color: var(--fern); }
.tb-drawing { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.tb-drawing .north { color: var(--fern); width: 28px; height: 28px; }
.scale-bar { width: 120px; height: 12px; }
.scale-bar rect { fill: none; stroke: var(--muted); stroke-width: 1; }
.scale-bar rect.fill { fill: var(--muted); }
.tb-drawing .label { flex-basis: 100%; }
@media (min-width: 760px) {
  .title-block { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; }
  .tb-cell { border-bottom: 0; border-right: 1px solid var(--line); }
  .tb-cell:last-child { border-right: 0; }
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 80;
  transform: translate(-50%, 140%); max-width: calc(100% - 32px);
  padding: 12px 16px; border-radius: var(--radius); background: var(--ink); color: var(--bg);
  font-weight: 600; font-size: .94rem; box-shadow: var(--shadow); transition: transform .25s ease;
}
.toast.is-visible { transform: translate(-50%, 0); }
.toast.is-error { background: var(--clay); color: #fff; }
[data-theme="light"] .toast.is-error { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Spacing utilities (no inline styles: the CSP allows stylesheets only) */
.mt-xs { margin-top: 6px; }
.mt-s { margin-top: 12px; }
.mt-m { margin-top: 18px; }
.mt-l { margin-top: 28px; }
.w-full { width: 100%; }

/* Account and clients details */
h4 { margin: 0; }
dl { margin: 0; }
dd { margin: 0; }
.logo-preview { min-height: 48px; display: flex; align-items: center; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--bg); }
.logo-img { max-height: 64px; max-width: 220px; width: auto; height: auto; }
.inv-status { width: auto; min-height: 38px; padding: 6px 10px; }
.due-amt { color: var(--gold); font-weight: 600; }
