/* LANDA Clients. Brand tokens from vault/businesses/B12-landa/brand/tokens/brand.json. Radius is 0 by brand rule. */
@font-face{font-family:"DM Sans";src:url("fonts/dm-sans-regular.woff") format("woff");font-style:normal;font-weight:400;font-display:swap}
@font-face{font-family:"DM Sans";src:url("fonts/dm-sans-semibold.woff") format("woff");font-style:normal;font-weight:500 800;font-display:swap}
@font-face{font-family:"Barlow Condensed";src:url("fonts/barlow-condensed-semibold.woff") format("woff");font-style:normal;font-weight:600;font-display:swap}

:root {
  color-scheme:light;
  --paper:#F2F1EC;
  --ink:#202820;
  --oxide:#BE3F28;
  --bright:#E9603D;
  --muted:#62685F;
  --rule:#CDD0C5;
  --panel:#E4E7DF;
  --white:#FAFAF6;
  --ink-2:#2B342B;
  --ink-line:rgba(242,241,236,.16);
  --ink-quiet:#B4B8AE;
  --oxide-deep:#A3341F;
  --display:"Barlow Condensed","Arial Narrow",sans-serif;
  --sans:"DM Sans",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  --gutter:16px;
  --rail:248px;
  --ease:cubic-bezier(.2,.7,.2,1);
  --nav-h:64px;
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-t:env(safe-area-inset-top,0px);
  font-family:var(--sans);
  font-synthesis:none;
  -webkit-text-size-adjust:100%;
}
* { box-sizing:border-box; }
html { background:var(--paper); scrollbar-color:var(--rule) transparent; }
body {
  margin:0;
  min-height:100dvh;
  background:var(--paper);
  color:var(--ink);
  font-size:15.5px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  caret-color:var(--oxide);
}
::selection { background:var(--oxide); color:var(--paper); }
button,input,select,textarea { font:inherit; color:inherit; }
button,a,input,select,textarea,summary { -webkit-tap-highlight-color:transparent; }
a { color:inherit; text-underline-offset:4px; text-decoration-thickness:1px; }
h1,h2,h3,p { margin:0; }
img { display:block; max-width:100%; height:auto; }
:focus-visible { outline:2px solid var(--oxide); outline-offset:3px; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.icon { width:18px; height:18px; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:square; stroke-linejoin:miter; }

/* Type */
h1 {
  font-family:var(--display);
  font-weight:600;
  text-transform:uppercase;
  font-size:52px;
  line-height:.92;
  letter-spacing:-.005em;
  text-wrap:balance;
}
h2 { font-family:var(--display); font-weight:600; text-transform:uppercase; font-size:23px; line-height:1.05; letter-spacing:.01em; }
h3 { font-size:16.5px; line-height:1.35; font-weight:600; letter-spacing:-.005em; }
.muted,small { color:var(--muted); }
small { font-size:12.5px; }
.lede { margin-top:10px; color:var(--muted); font-size:15px; max-width:56ch; }
.note { margin:14px 0 32px; color:var(--muted); font-size:13.5px; max-width:80ch; }
.note strong { color:var(--ink); font-weight:600; }
.body-copy { white-space:pre-wrap; overflow-wrap:anywhere; }
.nowrap { white-space:nowrap; }
.count,.figure-value,.figure-sm,.figure-md { font-variant-numeric:tabular-nums lining-nums; }

/* Buttons: sharp rectangles, as on withlanda.com */
button,.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:0 16px;
  border:1px solid var(--ink);
  border-radius:0;
  background:transparent;
  color:var(--ink);
  font-size:14.5px;
  font-weight:600;
  line-height:1.2;
  cursor:pointer;
  text-decoration:none;
  white-space:nowrap;
  touch-action:manipulation;
}
button:hover,.button:hover { background:var(--ink); color:var(--paper); }
button:active,.button:active { transform:translateY(1px); }
button:disabled { opacity:.5; cursor:not-allowed; transform:none; }
.primary { background:var(--ink); color:var(--paper); border-color:var(--ink); }
.primary .icon { color:var(--bright); }
.primary:hover { background:var(--oxide); border-color:var(--oxide); color:var(--paper); }
.primary:hover .icon { color:var(--paper); }
.ghost { border-color:var(--rule); background:transparent; }
.ghost:hover { border-color:var(--ink); background:var(--white); color:var(--ink); }
.ghost .icon { width:16px; height:16px; }
.icon-button { width:44px; padding:0; border-color:var(--rule); }
.icon-button:hover { border-color:var(--ink); background:var(--white); color:var(--ink); }
.text-button { border:0; padding:0; min-height:44px; background:none; text-decoration:underline; text-underline-offset:5px; font-weight:600; justify-self:start; }
.text-button:hover { background:none; color:var(--oxide); }
.danger { background:var(--oxide); border-color:var(--oxide); color:var(--paper); }
.danger:hover { background:var(--oxide-deep); border-color:var(--oxide-deep); }
.on-ink { border-color:var(--ink-line); color:var(--paper); }
.on-ink:hover { background:var(--paper); color:var(--ink); border-color:var(--paper); }
.actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }

/* Forms */
input,textarea,select {
  width:100%;
  min-width:0;
  min-height:48px;
  border:1px solid var(--rule);
  border-radius:0;
  background:var(--white);
  color:var(--ink);
  padding:11px 14px;
  font-size:16px;
  font-weight:400;
  text-transform:none;
  letter-spacing:0;
  appearance:none;
  -webkit-appearance:none;
}
input:hover,textarea:hover,select:hover { border-color:var(--muted); }
input:focus,textarea:focus,select:focus { border-color:var(--ink); outline:none; box-shadow:0 0 0 3px rgba(190,63,40,.22); }
input::placeholder,textarea::placeholder { color:var(--muted); opacity:1; }
select {
  padding-right:40px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23202820' stroke-width='1.75' stroke-linecap='square'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:18px;
  text-overflow:ellipsis;
}
textarea { resize:vertical; min-height:112px; line-height:1.5; }
input[type=checkbox] {
  width:22px; height:22px; min-height:22px; padding:0; flex-shrink:0;
  border:1.5px solid var(--ink); background:var(--white); display:inline-grid; place-content:center; cursor:pointer;
}
input[type=checkbox]:checked { background:var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2F1EC' stroke-width='2.25' stroke-linecap='square'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/16px no-repeat; }
input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button { -webkit-appearance:none; }
label {
  display:grid;
  gap:7px;
  font-size:11.5px;
  font-weight:600;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--muted);
}
.form-grid { display:grid; gap:18px; }
.form-grid .wide { grid-column:1/-1; }
.form-grid label.checkbox { display:flex; align-items:center; gap:12px; min-height:48px; color:var(--ink); font-size:14.5px; letter-spacing:0; text-transform:none; cursor:pointer; }
.form-hint { font-size:13.5px; color:var(--muted); margin:0 0 18px; }
.form-footer {
  display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px;
  margin-top:24px; position:sticky; bottom:0; z-index:2;
  background:var(--paper); border-top:1px solid var(--rule);
  padding:14px 0 calc(14px + var(--safe-b));
}
.form-footer [data-action=delete] { margin-right:auto; color:var(--oxide); border-color:var(--rule); }
.form-footer [data-action=delete]:hover { background:var(--oxide); border-color:var(--oxide); color:var(--paper); }
.error {
  border:1px solid var(--oxide);
  background:var(--white);
  padding:12px 14px;
  margin:16px 0;
  white-space:pre-wrap;
  font-size:14px;
  color:var(--ink);
  display:flex; gap:10px;
}
.error::before { content:""; width:8px; height:8px; margin-top:6px; background:var(--oxide); flex-shrink:0; }
.error:empty { display:none; }

/* Shell */
.skip { position:fixed; left:12px; top:-100px; z-index:200; background:var(--ink); color:var(--paper); padding:12px 16px; }
.skip:focus { top:12px; }
.topbar {
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  min-height:64px;
  padding:calc(10px + var(--safe-t)) var(--gutter) 10px;
  background:var(--paper);
  border-bottom:1px solid var(--ink);
}
.brand { display:flex; align-items:center; gap:12px; text-decoration:none; min-height:44px; }
.brand-lockup { width:116px; }
.brand-product {
  font-family:var(--display); font-weight:600; text-transform:uppercase;
  font-size:19px; line-height:1; letter-spacing:.03em;
  padding-left:12px; border-left:1px solid var(--rule);
  align-self:stretch; display:flex; align-items:center;
}
#account-actions { display:flex; gap:8px; }
#account-actions .new-button { padding:0 14px; }
.signout { width:44px; padding:0; }
.signout span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.rail { display:none; }
#navigation[hidden] { display:none; }
#navigation {
  position:fixed; left:0; right:0; bottom:0; z-index:30;
  display:grid; grid-template-columns:repeat(6,1fr);
  height:calc(var(--nav-h) + var(--safe-b));
  padding-bottom:var(--safe-b);
  background:var(--ink);
}
#navigation a {
  position:relative;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
  color:var(--ink-quiet);
  text-decoration:none;
  font-size:10.5px; font-weight:600; letter-spacing:.02em;
  min-width:0;
}
#navigation a .icon { width:21px; height:21px; }
#navigation a[aria-current=page] { color:var(--paper); }
#navigation a[aria-current=page] .icon { color:var(--bright); }
#navigation a[aria-current=page]::before { content:""; position:absolute; top:0; left:22%; right:22%; height:2px; background:var(--bright); }
main {
  display:block;
  padding:24px var(--gutter) calc(var(--nav-h) + var(--safe-b) + 40px);
  min-width:0;
}
main:focus { outline:none; }
.app:has(#navigation[hidden]) main { padding-bottom:48px; }

/* Page head */
.page-head { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:14px 16px; margin-bottom:24px; }
.page-title { min-width:0; flex:1 1 220px; }
.page-head .actions { flex-shrink:0; }

/* Ledger: the figures band, set like the clock on withlanda.com */
.ledger {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1px; background:var(--ink-line);
  margin:0 calc(var(--gutter) * -1);
  border-top:1px solid var(--ink); border-bottom:1px solid var(--ink);
}
.figure { background:var(--ink); color:var(--paper); padding:16px 14px 18px; min-width:0; display:grid; gap:8px; align-content:start; }
.figure-label { display:flex; align-items:center; gap:7px; font-size:10.5px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-quiet); }
.figure-value { font-family:var(--display); font-weight:600; font-size:30px; line-height:.95; letter-spacing:0; overflow-wrap:anywhere; }
.figure-value em,.figure-sm em,.figure-md em { font-style:normal; font-size:.5em; color:var(--bright); margin-left:3px; letter-spacing:.02em; }
.figure.lead { grid-column:1/-1; padding:22px 16px 24px; }
.figure.lead .figure-value { font-size:64px; }
.figure.alert .figure-label::before { content:""; width:7px; height:7px; background:var(--bright); }
.figure.alert .figure-value { color:var(--bright); }
.figure-text { font-size:14.5px; line-height:1.4; }
.ledger.light { margin:0; background:var(--rule); border:1px solid var(--rule); grid-template-columns:repeat(2,minmax(0,1fr)); }
.ledger.light .figure { background:var(--white); color:var(--ink); }
.ledger.light .figure-label { color:var(--muted); }
.ledger.light .figure-value { font-size:34px; }
.ledger.light em { color:var(--oxide); }
.ledger.compact { grid-template-columns:repeat(3,minmax(0,1fr)); margin-bottom:24px; }
.ledger.compact .figure-value { font-size:28px; }
.figure-sm { font-family:var(--display); font-weight:600; font-size:26px; line-height:1; letter-spacing:0; color:var(--ink); }
.figure-sm em,.figure-md em { color:var(--oxide); }
.figure-md { font-family:var(--display); font-weight:600; font-size:36px; line-height:1; }

/* Sections and rows */
.grid { display:grid; gap:14px; }
.grid.board { gap:40px; }
.stack { display:grid; gap:12px; }
.panel { border-top:1px solid var(--ink); padding-top:14px; min-width:0; }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; min-height:44px; }
.count {
  display:inline-grid; place-items:center; min-width:30px; height:30px; padding:0 7px;
  font-family:var(--display); font-weight:600; font-size:17px; line-height:1;
  background:var(--ink); color:var(--paper);
}
.count.zero { background:transparent; color:var(--muted); border:1px solid var(--rule); }
.urgent .count:not(.zero) { background:var(--oxide); }
.urgent h2 { color:var(--oxide); }
.row { display:flex; gap:12px; align-items:flex-start; padding:14px 0; border-bottom:1px solid var(--rule); }
.row:last-child { border-bottom:0; }
.row-content { flex:1; min-width:0; display:grid; gap:3px; }
.row-content p,.card p { overflow-wrap:anywhere; white-space:pre-wrap; }
.row-title { font-weight:600; font-size:16px; line-height:1.35; }
.row-title a { text-decoration:none; }
.row-title a:hover { text-decoration:underline; }
.row-meta { display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; font-size:13.5px; color:var(--muted); white-space:normal !important; }
.sep { display:none; }
.company-ref { color:var(--ink); font-weight:600; text-decoration:none; }
a.company-ref:hover { text-decoration:underline; }
.company-ref.quiet { color:var(--muted); font-weight:400; }
.due { font-size:13.5px; color:var(--muted); display:inline-flex; align-items:center; gap:6px; }
.due.late { color:var(--oxide); font-weight:600; }
.due.now { color:var(--ink); font-weight:600; }
.due.now::before { content:""; width:7px; height:7px; background:var(--oxide); }
.flag { font-size:10.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--oxide); border:1px solid currentColor; padding:2px 6px; }
.row .ghost { width:44px; padding:0; flex-shrink:0; }
.row .ghost span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

.check { width:44px; height:44px; min-height:44px; padding:0; border:0; background:none; margin:-8px 0 -8px -10px; flex-shrink:0; }
.check:hover { background:none; }
.check .box { width:22px; height:22px; border:1.5px solid var(--ink); display:grid; place-items:center; background:var(--white); }
.check .box .icon { width:16px; height:16px; stroke-width:2.25; color:transparent; }
.check:hover .box { border-color:var(--oxide); }
.check:hover .box .icon { color:var(--rule); }
.check[aria-pressed=true] .box { background:var(--ink); }
.check[aria-pressed=true] .box .icon { color:var(--paper); }
.task.done .row-title { color:var(--muted); text-decoration:line-through; text-decoration-color:var(--rule); }
.monogram {
  display:grid; place-items:center; flex-shrink:0;
  width:44px; height:44px;
  background:var(--ink); color:var(--paper);
  font-family:var(--display); font-weight:600; font-size:19px; letter-spacing:.03em;
}
.monogram.sm { width:36px; height:36px; font-size:16px; }
.monogram.lg { width:58px; height:58px; font-size:26px; }

/* Empty and loading states */
.empty {
  display:flex; flex-wrap:wrap; align-items:center; gap:10px 12px;
  padding:16px;
  background:var(--panel);
  color:var(--muted);
  font-size:14.5px;
}
.empty .icon { width:20px; height:20px; color:var(--muted); }
.empty p { flex:1 1 160px; margin:0; }
.empty .primary { flex-shrink:0; }
.panel > .empty { margin-top:6px; }
.boot { min-height:60dvh; display:grid; place-content:center; justify-items:center; gap:16px; color:var(--muted); font-size:12px; font-weight:600; letter-spacing:.14em; text-transform:uppercase; }
.boot img { width:44px; height:44px; }
.skeleton { display:grid; gap:12px; }
.sk { display:block; background:var(--panel); height:64px; }
.sk-title { height:52px; width:55%; }
.sk-band { height:150px; background:var(--ink); opacity:.92; margin:8px calc(var(--gutter) * -1) 16px; }
.sk-row.short { width:70%; }

/* Chips */
.chip {
  display:inline-flex; align-items:center; gap:6px;
  height:24px; padding:0 8px;
  font-size:10.5px; font-weight:600; letter-spacing:.09em; text-transform:uppercase;
  border:1px solid var(--rule); color:var(--ink); background:transparent;
  white-space:nowrap; flex-shrink:0;
}
.chip::before { content:""; width:6px; height:6px; background:var(--muted); }
.chip:is([data-tone=active-client],[data-tone=active],[data-tone=won],[data-tone=paid],[data-tone=available],[data-tone=received],[data-tone=primary]) { background:var(--ink); border-color:var(--ink); color:var(--paper); }
.chip:is([data-tone=active-client],[data-tone=active],[data-tone=won],[data-tone=paid],[data-tone=available],[data-tone=received],[data-tone=primary])::before { background:var(--bright); }
.chip:is([data-tone=lead],[data-tone=new]) { color:var(--oxide); border-color:var(--oxide); }
.chip:is([data-tone=lead],[data-tone=new])::before { background:var(--oxide); }
.chip[data-tone=overdue] { background:var(--oxide); border-color:var(--oxide); color:var(--paper); }
.chip[data-tone=overdue]::before { background:var(--paper); }
.chip:is([data-tone=prospect],[data-tone=trial],[data-tone=sent],[data-tone=waiting],[data-tone=contacted],[data-tone=call-booked],[data-tone=proposal-sent],[data-tone=negotiating]) { background:var(--panel); border-color:var(--panel); }
.chip:is([data-tone=prospect],[data-tone=trial],[data-tone=sent],[data-tone=waiting],[data-tone=contacted],[data-tone=call-booked],[data-tone=proposal-sent],[data-tone=negotiating])::before { background:var(--ink); }
.chip:is([data-tone=paused],[data-tone=former-client],[data-tone=not-a-fit],[data-tone=cancelled],[data-tone=void],[data-tone=draft],[data-tone=inactive],[data-tone=lost]) { color:var(--muted); }
.chip:is([data-tone=paused],[data-tone=former-client],[data-tone=not-a-fit],[data-tone=cancelled],[data-tone=void],[data-tone=draft],[data-tone=inactive],[data-tone=lost])::before { background:var(--rule); }

/* Cards */
.card {
  position:relative;
  display:grid; gap:12px; align-content:start;
  background:var(--white);
  border:1px solid var(--rule);
  padding:18px;
  min-width:0;
}
.card-top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.card-top h3 { overflow-wrap:anywhere; }
.card-sub { font-size:13.5px; color:var(--muted); margin-top:3px; }
.card > p { font-size:14.5px; }
.card .actions { padding-top:12px; border-top:1px solid var(--rule); }
.card .muted { font-size:14px; }
.money-pair { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 14px; white-space:normal !important; }
.money-pair span { font-size:13.5px; color:var(--muted); }
.price-pair { display:grid; grid-template-columns:1fr 1fr; gap:1px; margin:0; background:var(--rule); border:1px solid var(--rule); }
.price-pair div { background:var(--paper); padding:12px; }
.price-pair dt { font-size:10.5px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); }
.price-pair dd { margin:6px 0 0; }
.out-link { display:inline-flex; align-items:center; gap:6px; min-height:44px; color:var(--oxide); font-weight:600; text-decoration:underline; }
.out-link .icon { width:16px; height:16px; }
.out-link:hover { color:var(--ink); }
.card.company { gap:16px; transition:border-color .16s var(--ease); }
.card.company:hover { border-color:var(--ink); }
.card.company:has(.stretch:focus-visible) { outline:2px solid var(--oxide); outline-offset:2px; }
.company-id { display:flex; align-items:center; gap:12px; min-width:0; }
.company-name { min-width:0; }
.company-name h3 { font-size:17px; }
.stretch { text-decoration:none; }
.stretch:focus-visible { outline:none; }
.stretch::after { content:""; position:absolute; inset:0; }
.company-figures { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.next-step { border-top:1px solid var(--rule); padding-top:12px; display:grid; gap:4px; }
.next-label { font-size:10.5px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); display:flex; align-items:center; gap:7px; }
.next-step p { font-size:15px; line-height:1.45; }
.card.invoice[data-tone=overdue] { border-color:var(--oxide); }
.amount-line { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:6px 12px; }
.card.invoice .actions .primary { flex:1; }

/* Filters */
.filters { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; margin-bottom:18px; }
.filters label { flex:1 1 140px; }
.filters .search { flex-basis:100%; display:block; position:relative; }
.filters .search .icon { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--muted); pointer-events:none; }
.filters .search input { padding-left:44px; }
.result-count { font-size:12px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); margin:0 0 12px; }

/* Company detail */
.back { display:inline-flex; align-items:center; gap:6px; min-height:44px; margin:-8px 0 4px -4px; padding:0 4px; color:var(--muted); font-size:14px; font-weight:600; text-decoration:none; }
.back:hover { color:var(--ink); }
.company-hero { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; }
.hero-id { display:flex; align-items:center; gap:14px; min-width:0; flex:1 1 260px; }
.hero-id h1 { font-size:44px; overflow-wrap:anywhere; }
.hero-id .lede { margin-top:6px; }
.company-controls { display:grid; gap:12px; }
.status-select { display:flex; align-items:center; gap:12px; }
.status-select select { flex:1; max-width:260px; font-weight:600; }
.quick-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.quick-actions button { justify-content:flex-start; border-color:var(--rule); background:var(--white); }
.quick-actions button:hover { border-color:var(--ink); background:var(--ink); color:var(--paper); }
.tabs {
  display:flex; overflow-x:auto; gap:0;
  margin:26px calc(var(--gutter) * -1) 22px; padding:0 calc(var(--gutter) - 12px);
  border-bottom:1px solid var(--rule);
  scrollbar-width:none;
}
.tabs::-webkit-scrollbar { display:none; }
.tabs a {
  position:relative; flex-shrink:0;
  display:inline-flex; align-items:center; gap:8px;
  min-height:50px; padding:0 12px;
  color:var(--muted); font-size:14.5px; font-weight:600; text-decoration:none; white-space:nowrap;
}
.tabs a:hover { color:var(--ink); }
.tabs a[aria-current=page] { color:var(--ink); }
.tabs a[aria-current=page]::after { content:""; position:absolute; left:12px; right:12px; bottom:-1px; height:2px; background:var(--oxide); }
.tab-count { min-width:20px; height:20px; padding:0 5px; display:inline-grid; place-items:center; background:var(--panel); color:var(--ink); font-size:11.5px; font-weight:600; }
.tab-head { margin-bottom:14px; }
.overview { display:grid; gap:14px; }
.next-block { background:var(--ink); color:var(--paper); padding:22px 18px 18px; display:grid; gap:14px; }
.next-block .next-label { color:var(--ink-quiet); }
.next-block .next-label::before { content:""; width:7px; height:7px; background:var(--bright); }
.next-text { font-size:21px; line-height:1.35; white-space:pre-wrap; overflow-wrap:anywhere; }
.next-foot { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding-top:14px; border-top:1px solid var(--ink-line); }
.next-block .due { color:var(--ink-quiet); }
.next-block .due.late,.next-block .due.now { color:var(--paper); }
.next-block .due.late::before { content:""; width:7px; height:7px; background:var(--bright); }
.details-panel,.details-panel + .panel { margin-top:36px; }
.details { display:grid; grid-template-columns:1fr; margin:0; }
.details > div { display:grid; grid-template-columns:minmax(96px,34%) 1fr; gap:12px; padding:12px 0; border-bottom:1px solid var(--rule); }
.details dt { font-size:13.5px; color:var(--muted); }
.details dd { margin:0; font-size:15px; overflow-wrap:anywhere; white-space:pre-wrap; }
.details dd.unset { color:var(--muted); opacity:.75; }
.card .details > div:last-child { border-bottom:0; }

/* Pipeline */
.pipeline {
  display:flex; gap:10px; overflow-x:auto; align-items:flex-start;
  margin:0 calc(var(--gutter) * -1); padding:0 var(--gutter) 24px;
  scroll-snap-type:x mandatory; scroll-padding:0 var(--gutter);
}
.column { flex:0 0 82%; max-width:300px; background:var(--panel); padding:0 12px 12px; scroll-snap-align:start; display:grid; gap:10px; }
.column-head { border-top:2px solid var(--ink); margin:0 -12px; padding:10px 12px 12px; border-bottom:1px solid var(--rule); display:grid; gap:4px; }
.column-head .section-head { margin:0; min-height:36px; }
.column-head h2 { font-size:20px; }
.column[data-stage=won] .column-head { border-top-color:var(--oxide); }
.column[data-stage=lost] .column-head { border-top-color:var(--muted); }
.column-warn { font-size:12.5px; color:var(--oxide); }
.column-empty { font-size:13.5px; color:var(--muted); padding:18px 2px; }
.card.deal { padding:14px; gap:8px; }
.card.deal h3 { font-size:15.5px; }
.deal-foot { display:flex; align-items:flex-end; gap:8px; margin-top:4px; }
.inline-select { flex:1; gap:5px; font-size:10.5px; }
.inline-select select { min-height:44px; font-size:14px; padding:8px 34px 8px 10px; background-position:right 8px center; }
.deal-foot .ghost { width:44px; padding:0; }
.deal-foot .ghost span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* Tasks, money */
details.completed { margin-top:44px; }
details.completed summary {
  list-style:none; cursor:pointer;
  display:flex; align-items:center; justify-content:space-between; min-height:44px;
  font-family:var(--display); font-weight:600; text-transform:uppercase; font-size:23px;
}
details.completed summary::-webkit-details-marker { display:none; }
details.completed summary:hover { color:var(--oxide); }
.revenue { margin-top:44px; }
.revenue .row { align-items:center; }
.revenue .section-head .figure-sm { font-size:28px; }
main > .ledger + .section-head,main > .ledger + .note + .section-head { margin-top:28px; }

/* Dialog: bottom sheet on phones, centered panel on desktop */
dialog {
  border:0; border-radius:0;
  background:var(--paper); color:var(--ink);
  padding:0 var(--gutter);
  width:100%; max-width:100%;
  max-height:92dvh;
  margin:auto 0 0;
  overflow-y:auto; overscroll-behavior:contain;
  border-top:4px solid var(--ink);
}
dialog::backdrop { background:rgba(32,40,32,.62); }
.modal-head { position:sticky; top:0; z-index:3; background:var(--paper); padding:14px 0 12px; margin:0 0 18px; border-bottom:1px solid var(--rule); }
.modal-head h2 { font-size:28px; }
dialog > p { margin-bottom:12px; font-size:15px; }
.menu { display:grid; gap:8px; padding-bottom:calc(20px + var(--safe-b)); }
.menu-item { justify-content:flex-start; gap:14px; min-height:76px; padding:14px 16px; border-color:var(--rule); background:var(--white); text-align:left; white-space:normal; }
.menu-item .icon { width:24px; height:24px; color:var(--oxide); }
.menu-item:hover { background:var(--ink); border-color:var(--ink); color:var(--paper); }
.menu-item:hover .icon { color:var(--bright); }
.menu-item:hover small { color:var(--ink-quiet); }
.menu-text { display:grid; gap:2px; }
.menu-text strong { font-size:16px; }
.menu-text small { font-size:13.5px; font-weight:400; }
.csv { min-height:300px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:13px; text-transform:none; letter-spacing:0; }

/* Toast */
#notice {
  position:fixed; z-index:100;
  left:var(--gutter); right:var(--gutter);
  bottom:calc(var(--nav-h) + var(--safe-b) + 12px);
  display:flex; align-items:center; gap:10px;
  background:var(--ink); color:var(--paper);
  padding:14px 16px;
  font-weight:600; font-size:14.5px;
  box-shadow:0 12px 32px rgba(32,40,32,.28);
}
#notice::before { content:""; width:8px; height:8px; background:var(--bright); flex-shrink:0; }
#notice[hidden] { display:none; }

/* Sign in */
.app:has(.login-screen) .topbar { display:none; }
main:has(> .login-screen) { padding:0; }
.login-screen { min-height:100dvh; display:grid; grid-template-rows:auto 1fr; }
.login-hero {
  background:var(--ink); color:var(--paper);
  padding:calc(26px + var(--safe-t)) 20px 36px;
  display:flex; flex-direction:column; gap:44px;
}
.login-lockup { width:164px; }
.login-meta { display:flex; align-items:center; gap:10px; font-size:11.5px; font-weight:600; letter-spacing:.14em; text-transform:uppercase; color:var(--ink-quiet); margin-bottom:18px; }
.square { width:9px; height:9px; background:var(--bright); flex-shrink:0; }
.login-hero h1 { font-size:60px; line-height:.9; }
.login-hero h1 span { color:var(--bright); }
.login-lede { margin-top:18px; color:var(--ink-quiet); font-size:16px; line-height:1.6; max-width:34ch; }
.login-panel { padding:32px 20px calc(28px + var(--safe-b)); display:flex; flex-direction:column; justify-content:space-between; gap:36px; }
.login-form { display:grid; gap:16px; width:100%; max-width:420px; }
.login-form h2 { font-size:34px; }
.login-hint { color:var(--muted); font-size:14.5px; margin-top:-8px; }
.login-form .error { margin:0; }
.cta { justify-content:space-between; min-height:56px; padding:0 18px 0 20px; font-size:16px; }
.cta .icon { width:20px; height:20px; }
.login-status { font-size:14.5px; color:var(--ink); }
.login-status:empty { display:none; }
.login-foot { font-size:12px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); padding-top:16px; border-top:1px solid var(--rule); }
.login { max-width:560px; margin:6vh auto; padding:28px 22px; background:var(--white); border:1px solid var(--rule); display:grid; gap:14px; }
.login .page-head { margin-bottom:4px; }
.login h1 { font-size:44px; }
.login code { font-size:14px; background:var(--panel); padding:1px 5px; }

/* Phones: page level secondary actions collapse to icons beside the title */
@media (max-width:699px) {
  .page-head .ghost,.company-hero .actions .ghost { width:44px; padding:0; }
  .page-head .ghost span,.company-hero .actions .ghost span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .company-hero { flex-wrap:nowrap; }
  .hero-id { flex:1 1 auto; }
}
.status-select select,.inline-select select,#company-status,#company-sort,#money-status,dialog select:is([name=status],[name=stage],[name=kind],[name=priority],[name=direction],[name=source],[name=method]) { text-transform:capitalize; }

/* Tablet and up */
@media (min-width:700px) {
  :root { --gutter:28px; }
  h1 { font-size:64px; }
  .brand-lockup { width:136px; }
  .signout { width:auto; padding:0 14px; }
  .signout span { position:static; width:auto; height:auto; overflow:visible; clip:auto; }
  .ledger { grid-template-columns:2fr 1fr 1fr 1fr; margin:0; border:0; }
  .figure { padding:22px 22px 24px; }
  .figure.lead { grid-column:auto; padding:22px 22px 24px; }
  .figure-value { font-size:44px; }
  .figure.lead .figure-value { font-size:72px; }
  .ledger.light,.ledger.compact { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .ledger.compact { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .ledger.light .figure-value { font-size:40px; }
  .ledger.compact .figure-value { font-size:36px; }
  .grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
  .grid.board { grid-template-columns:repeat(2,minmax(0,1fr)); gap:48px 40px; }
  .grid.board > .wide { grid-column:1/-1; }
  .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .filters .search { flex:2 1 300px; }
  .company-controls { grid-template-columns:auto 1fr; align-items:center; }
  .quick-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; }
  .hero-id h1 { font-size:60px; }
  .monogram.lg { width:72px; height:72px; font-size:32px; }
  .overview { grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); align-items:stretch; }
  .overview .ledger.light { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .details { grid-template-columns:1fr 1fr; column-gap:40px; }
  .column { flex:0 0 272px; }
  .row .ghost { width:auto; padding:0 14px; }
  .row .ghost span { position:static; width:auto; height:auto; overflow:visible; clip:auto; }
  dialog { width:min(680px,calc(100% - 48px)); margin:auto; max-height:88dvh; padding:0 28px; border:1px solid var(--ink); border-top:4px solid var(--ink); box-shadow:0 30px 80px rgba(32,40,32,.3); }
  .menu { padding-bottom:28px; }
  #notice { left:50%; right:auto; transform:translateX(-50%); width:max-content; max-width:calc(100% - 48px); }
  .login-screen { grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); grid-template-rows:1fr; }
  .login-form h2 { font-size:42px; }
  .login-hero { padding:48px 56px 56px; justify-content:space-between; }
  .login-lockup { width:200px; }
  .login-hero h1 { font-size:clamp(68px,6.4vw,112px); }
  .login-lede { font-size:17px; max-width:38ch; }
  .login-panel { padding:48px 56px; justify-content:center; align-items:center; }
  .login-foot { width:100%; max-width:420px; }
}

/* Desktop: ink rail on the left, like the dark hero on withlanda.com */
@media (min-width:1100px) {
  :root { --gutter:56px; }
  .rail {
    display:flex; flex-direction:column; gap:14px;
    position:fixed; left:0; top:0; width:var(--rail); height:132px; z-index:25;
    background:var(--ink); padding:32px 28px 0;
  }
  .rail-brand img { width:172px; }
  .rail-product { display:flex; align-items:center; gap:9px; font-size:11px; font-weight:600; letter-spacing:.2em; text-transform:uppercase; color:var(--ink-quiet); }
  .rail-product::before { content:""; width:8px; height:8px; background:var(--bright); }
  #navigation {
    top:132px; bottom:132px; left:0; right:auto; width:var(--rail); height:auto;
    display:flex; flex-direction:column; gap:2px;
    padding:20px 16px;
    border-top:1px solid var(--ink-line);
  }
  #navigation a {
    flex-direction:row; justify-content:flex-start; gap:14px;
    min-height:48px; padding:0 12px;
    font-size:15px; letter-spacing:0;
  }
  #navigation a:hover { color:var(--paper); background:var(--ink-2); }
  #navigation a[aria-current=page] { background:var(--ink-2); }
  #navigation a[aria-current=page]::before { top:50%; bottom:auto; left:auto; right:14px; width:7px; height:7px; transform:translateY(-50%); }
  .topbar {
    position:fixed; left:0; bottom:0; top:auto; width:var(--rail); z-index:25;
    min-height:0; padding:20px 28px 28px;
    background:var(--ink); border-bottom:0; border-top:1px solid var(--ink-line);
  }
  .topbar .brand { display:none; }
  #account-actions { flex-direction:column; width:100%; }
  #account-actions button { width:100%; }
  #account-actions .new-button { background:var(--paper); color:var(--ink); border-color:var(--paper); justify-content:flex-start; gap:10px; min-height:50px; }
  #account-actions .new-button .icon { color:var(--oxide); }
  #account-actions .new-button:hover { background:var(--bright); border-color:var(--bright); }
  #account-actions .new-button:hover .icon { color:var(--ink); }
  .signout { color:var(--ink-quiet); border-color:var(--ink-line); justify-content:flex-start; }
  .signout:hover { background:var(--ink-2); color:var(--paper); border-color:var(--ink-line); }
  main { margin-left:var(--rail); padding:52px var(--gutter) 96px; }
  main > * { max-width:1240px; }
  main > .pipeline { max-width:none; }
  h1 { font-size:80px; }
  .page-head { margin-bottom:32px; align-items:flex-end; }
  .company-hero { align-items:flex-end; }
  .lede { font-size:16px; }
  .figure.lead .figure-value { font-size:88px; }
  .figure-value { font-size:52px; }
  .grid.companies,.grid.services,.grid.invoices { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .hero-id h1 { font-size:72px; }
  .pipeline { margin:0 calc(var(--gutter) * -1); }
  .tabs { margin-left:-12px; margin-right:0; padding:0; }
  /* Signed-out and setup screens: no rail, plain paper header */
  .app:has(#navigation[hidden]) .rail { display:none; }
  .app:has(#navigation[hidden]) .topbar { position:sticky; top:0; width:auto; padding:14px 56px; background:var(--paper); border-top:0; border-bottom:1px solid var(--ink); }
  .app:has(#navigation[hidden]) .topbar .brand { display:flex; }
  .app:has(#navigation[hidden]) #account-actions { flex-direction:row; width:auto; }
  .app:has(#navigation[hidden]) .signout { color:var(--ink); border-color:var(--rule); }
  .app:has(#navigation[hidden]) main { margin-left:0; }
  #notice { left:calc(50% + var(--rail) / 2); bottom:28px; }
}

@media (prefers-reduced-motion:no-preference) {
  button,a,.card,input,select,textarea { transition:background-color .16s var(--ease),border-color .16s var(--ease),color .16s var(--ease),box-shadow .16s var(--ease),transform .12s var(--ease); }
  dialog[open] { animation:sheet-in .26s var(--ease); }
  #notice:not([hidden]) { animation:toast-in .22s var(--ease); }
  .sk { animation:pulse 1.4s ease-in-out infinite alternate; }
  @media (min-width:700px) { dialog[open] { animation:panel-in .22s var(--ease); } }
}
@keyframes sheet-in { from { transform:translateY(32px); opacity:0; } }
@keyframes panel-in { from { transform:translateY(10px) scale(.985); opacity:0; } }
@keyframes toast-in { from { opacity:0; translate:0 8px; } }
@keyframes pulse { to { opacity:.55; } }
