/* Levoko Ops, on the Levoko brand system:
   paper ground, forest for headings and buttons, one small yellow accent.
   Flat: borders, not shadows (the only shadow is on the sticky note). */

@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/BricolageGrotesque-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: Figtree; src: url("/fonts/Figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: Caveat; src: url("/fonts/Caveat-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --forest: #1F5C4A;
  --forest-dk: #174536;
  --forest-band: #1F5C4A;
  --ink: #14221E;
  --ink-2: #33443E;
  --ink-3: #56655F;
  --paper: #EBF0ED;
  --surface: #FFFFFF;
  --band: #DFE8E3;
  --mint: #D6EADF;
  --line: #C5D3CC;
  --cream: #EBF0ED;
  --note: #FFE27A;
  --note-ink: #2B2A20;
  --focus: #FFD34D;
  --warn-bg: #FFF4CC;
  --warn-ink: #5C4700;
  --bad-bg: #F6E3DF;
  --bad-ink: #8A3B2E;
  --shadow-note: 0 1px 2px rgba(27, 43, 39, .08), 0 4px 10px rgba(27, 43, 39, .06);
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 16px;
  --display: "Bricolage Grotesque", Figtree, sans-serif;
  --sans: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: Caveat, cursive;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --forest: #5FB896;
    --forest-dk: #7CCBAC;
    --forest-band: #16443A;
    --ink: #EEF3F1;
    --ink-2: #BCCAC5;
    --ink-3: #8FA09A;
    --paper: #111917;
    --surface: #18221F;
    --band: #151E1B;
    --mint: #1D2E29;
    --line: #2A3833;
    --warn-bg: #3A3216;
    --warn-ink: #FFE27A;
    --bad-bg: #3A2320;
    --bad-ink: #F4B9AC;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.boot { display: grid; place-items: center; min-height: 80vh; }
.boot img { animation: breathe 1.6s ease-in-out infinite; }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) clamp(16px, 4vw, 32px) 12px;
  background: var(--paper); border-bottom: 1px solid transparent;
}
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--forest); }
.brand { gap: 12px; }
.brand picture { display: flex; }
.brand .wordmark { height: 24px; width: auto; }
.brand b { font: 700 15px/1 var(--sans); color: var(--ink-3); padding-left: 12px; border-left: 1px solid var(--line); }
.top .spacer { flex: 1; }
.pulse { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); }
.pulse i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.pulse.on i { background: var(--forest); color: var(--forest); animation: ping 2.4s infinite; }
.pulse.off i { background: var(--bad-ink); }
.link { background: none; border: 0; padding: 6px 8px; border-radius: var(--r-sm); color: var(--ink-3); font-size: 14px; font-weight: 600; }
.link:hover { color: var(--forest); background: var(--band); }

/* ---------- Page ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 32px) 80px; min-width: 0; }
.hello { margin: 20px 0 24px; }
.hello h1 { font: 800 clamp(34px, 5vw, 48px)/1.04 var(--display); letter-spacing: -.03em; margin: 0 0 8px; color: var(--ink); text-wrap: balance; }
.hello p { margin: 0; color: var(--ink-2); font-size: 18px; }

/* ---------- Needs you ---------- */
.needs { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--note); border-radius: var(--r-lg); padding: 18px 20px 12px; margin-bottom: 16px; }
.needs h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font: 800 20px/1.1 var(--display); letter-spacing: -.01em; }
.count { background: var(--note); color: var(--note-ink); font: 700 13px/1 var(--sans); border-radius: 6px; padding: 4px 8px; }
.needs ul { list-style: none; margin: 0; padding: 0; }
.needs li + li { border-top: 1px solid var(--line); }
.need { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline; width: 100%; text-align: left; background: none; border: 0; padding: 11px 6px; border-radius: var(--r-md); }
.need:hover { background: var(--paper); }
.need .who { font-size: 13px; font-weight: 700; color: var(--forest); background: var(--mint); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.need .what { overflow-wrap: anywhere; }
.need .what small { display: block; color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.need time { font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.more { margin-top: 2px; }

/* The one handwritten moment: shows only when nothing needs Louis. */
.sticky {
  display: inline-block; background: var(--note); color: var(--note-ink); box-shadow: var(--shadow-note);
  font: 700 27px/1.05 var(--hand); padding: 14px 20px 16px; margin: 0 0 22px 4px; transform: rotate(-1.5deg); border-radius: 2px;
}

/* ---------- Tell Atlas ---------- */
.tell { margin-bottom: 44px; }
.tell form { display: flex; align-items: flex-end; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 8px 8px 18px; }
.tell form:focus-within { border-color: var(--forest); }
.tell textarea { flex: 1; border: 0; background: none; resize: none; outline: none; padding: 9px 0; min-height: 26px; max-height: 180px; line-height: 1.45; font-size: 17px; }
.tell textarea::placeholder { color: var(--ink-3); }
.send { flex: none; height: 44px; padding: 0 16px; border-radius: var(--r-sm); border: 0; background: var(--forest); color: var(--surface); display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16.5px; }
.send:hover { background: var(--forest-dk); }
.send:disabled { background: var(--band); color: var(--ink-3); cursor: default; }
.send svg { width: 18px; height: 18px; }
.sent { list-style: none; margin: 10px 4px 0; padding: 0; display: grid; gap: 4px; }
.sent li { min-width: 0; display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--ink-3); }
.sent li span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.sent li > :not(:first-child) { white-space: nowrap; }

/* ---------- Org chart ---------- */
.chart { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.chart > h2 { align-self: stretch; font: 800 clamp(26px, 3.4vw, 34px)/1.1 var(--display); letter-spacing: -.02em; margin: 0 0 18px; }
.section-label { font-size: 15px; font-weight: 700; letter-spacing: .01em; color: var(--forest); margin: 0 0 12px; }
.stem { width: 2px; height: 26px; background: var(--line); }

.owner { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 18px 8px 8px; }
.owner .face { width: 42px; height: 42px; border-radius: var(--r-md); background: var(--mint); color: var(--forest); display: grid; place-items: center; font: 800 20px/1 var(--display); }
.owner b { display: block; font: 800 18px/1.1 var(--display); letter-spacing: -.01em; }
.owner small { color: var(--ink-3); font-size: 14px; }

.card { position: relative; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
button.card:hover { border-color: var(--forest); }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.avatar { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--mint); color: var(--forest); display: grid; place-items: center; flex: none; }
.avatar svg { width: 22px; height: 22px; }
.card h3 { margin: 0; font: 800 20px/1.1 var(--display); letter-spacing: -.01em; color: var(--ink); }
.card .role { font-size: 14px; color: var(--ink-3); margin-top: 3px; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--ink-3); padding-top: 10px; border-top: 1px solid var(--line); margin-top: auto; }
.card .foot b { color: var(--ink); font-weight: 700; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badge { font-size: 13px; font-weight: 700; border-radius: 6px; padding: 2px 8px; background: var(--band); color: var(--ink-2); }

/* Atlas: the one green band on the screen */
.card.lead { width: min(580px, 100%); background: var(--forest-band); border-color: var(--forest-band); color: var(--cream); padding: 24px; }
button.card.lead:hover { border-color: var(--note); }
.card.lead h3 { color: #fff; font-size: 30px; letter-spacing: -.02em; }
.card.lead .role, .card.lead p, .card.lead .foot { color: rgba(235, 240, 237, .85); }
.card.lead .foot { border-top-color: rgba(235, 240, 237, .2); }
.card.lead .foot b { color: var(--note); }
.card.lead .avatar { background: rgba(235, 240, 237, .12); color: var(--note); width: 52px; height: 52px; }
.card.lead .avatar svg { width: 26px; height: 26px; }
.card.lead p { -webkit-line-clamp: 3; line-clamp: 3; }

/* Team */
.tray { width: 100%; min-width: 0; border-radius: var(--r-xl); padding: 22px; background: var(--band); border: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.grid + .section-label { margin-top: 26px; }
.grid.live { grid-template-columns: repeat(auto-fit, minmax(230px, 300px)); justify-content: center; }
.grid.soon { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }

/* Planned roles: on the chart, but quiet */
.card.planned { background: transparent; border: 1.5px dashed var(--line); padding: 14px 16px; gap: 8px; }
.card.planned h3 { color: var(--ink-3); font-size: 18px; }
.card.planned p { color: var(--ink-3); font-size: 14px; }
.card.planned .avatar { width: 36px; height: 36px; background: transparent; border: 1.5px dashed var(--line); color: var(--ink-3); }
.card.planned .avatar svg { width: 18px; height: 18px; }
button.card.planned:hover { border-color: var(--ink-3); }

/* Status tags (squared, not pills) */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; border-radius: 6px; padding: 3px 9px; white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.working { background: var(--mint); color: var(--forest); }
.pill.working i { animation: ping 1.8s infinite; }
.pill.idle { background: var(--band); color: var(--ink-2); }
.pill.off { background: var(--bad-bg); color: var(--bad-ink); }
.pill.setup { background: var(--warn-bg); color: var(--warn-ink); }
.pill.soon { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }
.pill.soon i { background: var(--line); }
.card.lead .pill { background: rgba(235, 240, 237, .14); color: #fff; }
.card.lead .pill.working i { background: var(--note); color: var(--note); }
.card.lead .pill.off { background: var(--bad-bg); color: var(--bad-ink); }
.card.lead .pill.setup { background: var(--note); color: var(--note-ink); }

/* ---------- Drawer (agent detail) ---------- */
.drawer { position: fixed; inset: 0; z-index: 20; }
.scrim { position: absolute; inset: 0; background: rgba(20, 34, 30, .35); animation: fade .2s ease; }
.panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(470px, 100%); background: var(--surface); border-left: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain; animation: slide .24s cubic-bezier(.2, .8, .2, 1);
  padding: max(20px, env(safe-area-inset-top)) 24px max(32px, env(safe-area-inset-bottom));
}
.panel .close { position: sticky; top: 0; float: right; width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); }
.panel .close svg { width: 18px; height: 18px; }
.panel .head { display: flex; gap: 14px; align-items: center; margin: 4px 0 16px; }
.panel .head .avatar { width: 56px; height: 56px; }
.panel .head .avatar svg { width: 28px; height: 28px; }
.panel h2 { margin: 0; font: 800 32px/1.05 var(--display); letter-spacing: -.02em; }
.panel .role { font-size: 15px; color: var(--ink-3); margin-top: 4px; }
.panel .about { color: var(--ink-2); margin: 0 0 14px; }
.panel .note { font-size: 15px; color: var(--ink-2); background: var(--paper); border-radius: var(--r-md); padding: 10px 12px; margin: 12px 0 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 6px; }
.stat { background: var(--paper); border-radius: var(--r-md); padding: 12px; }
.stat b { display: block; font: 800 28px/1 var(--display); letter-spacing: -.03em; color: var(--forest); margin-bottom: 4px; }
.stat span { font-size: 14px; color: var(--ink-3); }
.panel h4 { font-size: 15px; font-weight: 700; color: var(--forest); margin: 26px 0 6px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.list li:first-child { border-top: 0; }
.list .t { overflow-wrap: anywhere; }
.list .why { grid-column: 1 / -1; color: var(--ink-3); font-size: 14px; overflow-wrap: anywhere; }
.list time { font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.list .flag .t::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--note); box-shadow: inset 0 0 0 1px rgba(43, 42, 32, .25); margin-right: 8px; vertical-align: 2px; }
.list .err .t { color: var(--bad-ink); }
.tag { font-size: 12px; font-weight: 700; border-radius: 5px; padding: 1px 6px; margin-right: 6px; background: var(--band); color: var(--ink-2); vertical-align: 1px; }
.tag.done { background: var(--mint); color: var(--forest); }
.tag.flagged { background: var(--warn-bg); color: var(--warn-ink); }
.tag.failed { background: var(--bad-bg); color: var(--bad-ink); }
.tag.running { background: var(--forest); color: var(--surface); }
.empty { color: var(--ink-3); font-size: 15px; padding: 8px 0; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .box { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px 28px; }
.login img { width: 48px; height: 48px; }
.login h1 { font: 800 34px/1.05 var(--display); letter-spacing: -.03em; margin: 16px 0 8px; }
.login p { color: var(--ink-2); margin: 0 0 20px; }
.login input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 12px 14px; font-size: 17px; }
.login input:focus { outline: none; border-color: var(--forest); }
.login input.code { letter-spacing: .35em; font-size: 24px; font-weight: 700; text-align: center; }
.btn { width: 100%; margin-top: 10px; border: 0; border-radius: var(--r-sm); padding: 13px; background: var(--forest); color: var(--surface); font-weight: 700; font-size: 16.5px; }
.btn:hover { background: var(--forest-dk); }
.btn:disabled { background: var(--band); color: var(--ink-3); }
.login .err { color: var(--bad-ink); font-size: 14px; margin-top: 10px; min-height: 1em; }
.login .link { margin-top: 6px; padding-left: 0; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: var(--r-sm); font-size: 15px; font-weight: 600; z-index: 30; animation: rise .22s ease; }

@keyframes ping { 0% { box-shadow: 0 0 0 0 currentColor; } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
@keyframes breathe { 50% { opacity: .55; transform: scale(.94); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes rise { from { transform: translate(-50%, 10px); opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

@media (max-width: 640px) {
  .pulse span { display: none; }
  .hello { margin-top: 8px; }
  .hello p { font-size: 17px; }
  .tray { padding: 14px; }
  .grid, .grid.soon { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid.live { grid-template-columns: 1fr; }
  .card { padding: 14px; gap: 8px; }
  .card .row { flex-wrap: wrap; }
  .avatar { width: 38px; height: 38px; }
  .card.lead { padding: 20px; }
  .card.lead .row { flex-wrap: nowrap; }
  .card.planned { padding: 12px; }
  .card.planned h3 { font-size: 17px; }
  .card.planned p { -webkit-line-clamp: 3; line-clamp: 3; }
  .need { grid-template-columns: 1fr auto; }
  .need .who { grid-column: 1 / -1; width: fit-content; }
  .send span { display: none; }
  .send { width: 44px; padding: 0; justify-content: center; }
  .sent li > time { display: none; }
  .panel { top: auto; height: 92vh; width: 100%; border-left: 0; border-top: 1px solid var(--line); border-radius: var(--r-xl) var(--r-xl) 0 0; animation-name: up; }
}
@media (max-width: 360px) {
  .grid, .grid.soon { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Nav ---------- */
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-3); font-weight: 700; font-size: 15px; padding: 6px 10px; border-radius: var(--r-sm); }
.nav a:hover { background: var(--band); color: var(--forest); }
.nav a.on { color: var(--forest); background: var(--mint); }
.nav .count { font-size: 12px; padding: 2px 6px; }

/* ---------- Bills (main screen + list) ---------- */
.bills { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px 12px; margin-bottom: 16px; }
.bills-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.bills h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 800 20px/1.1 var(--display); letter-spacing: -.01em; }
.bills .sum { font: 800 20px/1 var(--display); color: var(--forest); letter-spacing: -.02em; }
.bill-list { list-style: none; margin: 0; padding: 0; }
.bill-list li + li { border-top: 1px solid var(--line); }
.bill-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 12px 6px; border-radius: var(--r-md); color: inherit; text-decoration: none; }
.bill-row:hover { background: var(--paper); }
.bill-row .who b { display: block; font-weight: 700; }
.bill-row .who small { color: var(--ink-3); font-size: 14px; }
.bill-row .amt { font: 800 18px/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.card-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 14px; }
.group { font-size: 15px; font-weight: 700; color: var(--forest); margin: 28px 0 10px; }
.tag.ready { background: var(--mint); color: var(--forest); }
.tag.approved { background: var(--forest); color: var(--surface); }
.tag.rejected { background: var(--bad-bg); color: var(--bad-ink); }
.bill-row .tag { margin: 0; font-size: 12.5px; padding: 3px 8px; }

/* ---------- Payment packet ---------- */
.packet { max-width: 760px; padding-bottom: 180px; }
.back { display: inline-block; margin: 14px 0 6px; color: var(--forest); font-weight: 700; text-decoration: none; }
.packet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 6px 0 16px; }
.packet-head h1 { font: 800 clamp(30px, 5vw, 44px)/1.04 var(--display); letter-spacing: -.03em; margin: 0 0 6px; text-wrap: balance; }
.packet-head p { margin: 0; color: var(--ink-2); font-size: 17px; }
.packet-head .big { font: 800 clamp(34px, 6vw, 48px)/1 var(--display); letter-spacing: -.03em; color: var(--forest); text-align: right; }
.packet-head .big small { display: block; font: 700 13px/1.4 var(--sans); letter-spacing: .02em; color: var(--ink-3); }
.verdict { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 12px; border: 1px solid var(--line); }
.verdict svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.verdict b { display: block; font: 800 18px/1.2 var(--display); letter-spacing: -.01em; }
.verdict span { color: var(--ink-2); font-size: 15px; }
.verdict.ok { background: var(--mint); border-color: var(--mint); }
.verdict.ok svg { color: var(--forest); }
.verdict.no { background: var(--warn-bg); border-color: var(--warn-bg); }
.verdict.no svg { color: var(--bad-ink); }
.decided { border: 1px solid var(--line); background: var(--surface); border-left: 6px solid var(--forest); border-radius: var(--r-lg); padding: 12px 16px; margin-bottom: 12px; font-size: 15px; color: var(--ink-2); }
.decided.rejected { border-left-color: var(--bad-ink); }
.decided b { color: var(--ink); }
.decided p { margin: 4px 0 0; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 12px; }
.box h3 { margin: 0 0 10px; font: 800 18px/1.1 var(--display); letter-spacing: -.01em; }
.box p { margin: 0 0 6px; color: var(--ink-2); }
.box p.muted { color: var(--ink-3); font-size: 14px; }
.box .bad, .actions .bad { color: var(--bad-ink); font-weight: 600; }
.box.warn { border-left: 6px solid var(--note); }
.box.warn ul { margin: 0; padding-left: 18px; }
.box.warn li + li { margin-top: 6px; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; padding-top: 2px; }
.checks b { display: block; font-weight: 700; }
.checks span { color: var(--ink-2); font-size: 15px; }
.checks li.no b { color: var(--bad-ink); }
.ck { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; color: var(--ink-3); background: var(--band); }
.ck svg { width: 15px; height: 15px; }
.ck.ok { background: var(--mint); color: var(--forest); }
.ck.no { background: var(--bad-bg); color: var(--bad-ink); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 4px 0 8px; }
.facts dt { color: var(--ink-3); font-size: 15px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.ext { display: inline-block; padding-left: 0; }

/* The decision bar stays at the bottom of the screen. */
.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 12px clamp(16px, 4vw, 32px) max(12px, env(safe-area-inset-bottom));
  display: grid; gap: 8px; justify-items: center;
}
.actions > * { width: min(760px, 100%); }
.actions .buttons { display: flex; gap: 10px; }
.actions .btn { margin-top: 0; flex: 1; }
.actions textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface); resize: vertical; font-size: 16px; }
.actions textarea:focus { outline: none; border-color: var(--forest); }
.actions p { margin: 0; font-size: 14px; }
.actions .fine { color: var(--ink-3); text-align: center; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: var(--band); }
.btn.bad { background: var(--bad-ink); color: #fff; }
.btn.bad:hover { filter: brightness(.95); }

@media (max-width: 640px) {
  .nav { margin-left: 0; }
  .nav a { padding: 6px 8px; }
  .top .link { padding: 6px 4px; }
  .bill-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .bill-row .tag { grid-row: 2; grid-column: 1; width: fit-content; }
  .bill-row .amt { grid-row: 1 / 3; grid-column: 2; }
  .packet-head .big { text-align: left; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
}
.top .link { white-space: nowrap; }
body:has(.actions) .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
@media (max-width: 640px) {
  .brand b { display: none; }
  .top { gap: 6px; }
}
.bills-link { display: block; text-align: center; text-decoration: none; margin-top: 16px; }
