/* MSA CRM — design tokens · v0.18.0 "Morning Ledger" restyle
   1974 trade-journal aesthetic per design-guidelines.md v1.0:
   cream paper #F3EEE3 · navy ink #1E2F3A · brass #C39A3C (editorial numbers)
   terracotta #A5482E (everything alive/clickable) · burgundy #7A2E2E (alerts)
   Fraunces headlines · IBM Plex Sans body · IBM Plex Mono data.
   NOTE: --navy and --accent stay the JS-overridable brand hooks —
   applyAppearance() still repaints them from Settings for client installs. */
:root {
  --navy:#1E2F3A; --navy-2:#2C3E4B; --paper:#F3EEE3; --line:#D6CFBF;
  --on-navy:#F3EEE3; --on-accent:#F3EEE3; /* v0.17.0: readable text on primary/accent, set by JS from contrast */
  --accent:#A5482E; --green:#2E6B47; --red:#7A2E2E; --muted:#5B5247; --ink:#1E2F3A;
  --brass:#C39A3C; --brass-deep:#9B7A28;
  /* v0.7 (A5): surface + heading tokens so light AND dark share one component set.
     --navy/--accent are the BRAND colors, overridden per-house at load from house_config. */
  --surface:#F3EEE3; --surface-2:#E8E1D1; --surface-3:#EEE8DA; --line-2:#E2DBCB; --hover:#E8E1D1;
  --heading:var(--navy);
  --serif:'Fraunces','Georgia','Times New Roman',serif;
  --sans:'IBM Plex Sans','Helvetica Neue',Helvetica,Arial,sans-serif;
  --mono:'IBM Plex Mono','Courier New',monospace;
}
/* Dark mode: warm night-ledger — navy ink paper, cream text, brass keeps its glow.
   Toggled via <html data-theme="dark"> (remembered per device in localStorage). */
[data-theme="dark"] {
  --paper:#141F27; --line:#33414C; --line-2:#2A3742; --ink:#EDE7DA; --muted:#A39B8B;
  --surface:#1B2831; --surface-2:#22303B; --surface-3:#182530; --hover:#243440;
  --heading:#EDE7DA; --navy-2:#2C3E4B;
}
* { box-sizing:border-box; margin:0; }
html, body { height:100%; }
body { font-family:var(--sans); background:var(--paper); color:var(--ink); font-size:15px; }
button { font-family:inherit; cursor:pointer; }
a { color:inherit; }

.shell { display:flex; min-height:100vh; }

/* ---------- sidebar — navy ink panel with a brass rule ---------- */
.side { width:208px; background:linear-gradient(180deg, var(--navy), var(--navy-2)); color:var(--on-navy); padding:22px 14px; position:sticky;
        top:0; height:100vh; display:flex; flex-direction:column; gap:2px; flex-shrink:0;
        border-right:2px solid var(--brass); }
.wordmark { font-family:var(--serif); font-weight:800; font-size:22px; letter-spacing:-.01em;
            padding:0 10px 18px; line-height:1.1; overflow-wrap:anywhere; word-break:break-word; max-width:100%; }
.wordmark span { color:var(--brass); }
.side a { display:block; padding:10px 12px; border-radius:0; text-decoration:none; font-size:12.5px;
          text-transform:uppercase; letter-spacing:.05em; font-weight:500; white-space:nowrap;
          color:var(--on-navy); opacity:.78; border-left:3px solid transparent; }
/* v0.18.2: nav rows never wrap — the Desk badge stays on the same line as its label */
.side a .navbadge { white-space:nowrap; }
.side a:hover { background:rgba(127,127,127,.16); color:var(--on-navy); opacity:1; border-left-color:var(--brass); }
.side a.active { background:var(--accent); color:var(--on-accent); opacity:1; font-weight:600; border-left-color:var(--brass); }
.logout { margin-top:auto; background:none; border:1px solid currentColor; color:var(--on-navy); opacity:.7;
          padding:8px; border-radius:0; font-size:12px; text-transform:uppercase; letter-spacing:.07em; }
.logout:hover { opacity:1; color:var(--brass); }

/* ---------- main — the ledger page ---------- */
main { flex:1; padding:32px 40px; max-width:1280px; }
.loading { color:var(--muted); padding:40px; font-family:var(--serif); font-style:italic; font-size:18px; }
.page-head { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:22px; flex-wrap:wrap; gap:10px;
             border-bottom:2px solid var(--brass); padding-bottom:14px; }
h1 { font-family:var(--serif); font-weight:700; font-size:34px; letter-spacing:-.01em; color:var(--heading); }
.sub { color:var(--muted); font-size:13px; margin-top:3px; font-family:var(--mono); }

.btn { background:var(--navy); color:var(--on-navy); border:none; border-radius:0; padding:9px 16px;
       font-size:12px; font-weight:500; text-transform:uppercase; letter-spacing:.07em; }
.btn:hover { background:var(--navy-2); }
.btn.accent { background:var(--accent); color:var(--on-accent); }
.btn.accent:hover { background:#AE633F; }
.btn.ghost { background:none; color:var(--heading); border:1px solid var(--line); }
.btn.ghost:hover { border-color:var(--accent); color:var(--accent); }
.btn.sm { padding:5px 10px; font-size:11px; }
.btn.danger { background:none; color:var(--red); border:1px solid var(--line); }
.btn:focus-visible, .side a:focus-visible, .logout:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* ---------- cards & stats — the brass proof band ---------- */
.stat-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px,1fr)); gap:0; margin-bottom:28px;
            border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.stat { background:none; border:none; border-right:1px solid var(--line); border-radius:0; padding:18px 20px 18px 16px; }
.stat:last-child { border-right:none; }
.stat:hover { background:var(--surface-2); }
.stat .label { font-size:11px; text-transform:uppercase; letter-spacing:.14em; color:var(--heading); font-weight:500; }
.stat .value { font-family:var(--serif); font-weight:700; font-size:42px; color:var(--brass); letter-spacing:-.02em;
               font-variant-numeric:tabular-nums; margin-top:6px; }
.stat .value.money::before { content:'$'; font-size:26px; vertical-align:14%; margin-right:2px; }
.stat.alert .value { color:var(--accent); }
.stat.alert .label::after { content:' ●'; color:var(--accent); }

.card { background:var(--surface); border:none; border-top:1px solid var(--brass); border-radius:0; padding:18px 2px; margin-bottom:26px; }
.card h2 { font-family:var(--serif); font-weight:600; font-size:22px; letter-spacing:-.005em;
           color:var(--heading); margin-bottom:12px; }

/* ---------- tables — ruled ledger lines ---------- */
table { width:100%; border-collapse:collapse; background:var(--surface); border:none;
        border-top:1px solid var(--line); border-radius:0; overflow:hidden; }
th { text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.14em;
     color:var(--muted); padding:11px 14px 11px 4px; border-bottom:1px solid var(--brass); background:none; font-weight:500; }
td { padding:13px 14px 13px 4px; border-bottom:1px solid var(--line); vertical-align:middle; }
tr:last-child td { border-bottom:none; }
tr.rowlink { cursor:pointer; }
tr.rowlink:hover { background:var(--hover); }
td.money { font-variant-numeric:tabular-nums; font-weight:500; font-family:var(--mono); }
td.muted, .muted { color:var(--muted); }
.empty { padding:34px; text-align:left; color:var(--muted); background:none;
         border:none; border-radius:0; font-family:var(--serif); font-style:italic; font-size:18px; }

/* ---------- pipeline kanban ---------- */
.kanban { display:flex; gap:12px; overflow-x:auto; padding-bottom:8px; }
.kcol { background:var(--surface-2); border-radius:0; border-top:2px solid var(--brass); flex:1 1 180px; min-width:180px; padding:10px; }
/* v0.17.3/.4: desktop columns share the width and stay >=180px each, so all stages
   are visible on a normal monitor and only a gentle horizontal scroll appears on a
   narrow window. Mobile (below) overrides this back to one-per-swipe. */
.kcol h3 { font-family:var(--serif); font-size:17px; font-weight:600; letter-spacing:0; color:var(--heading);
           padding:2px 4px 10px; display:flex; justify-content:space-between; }
.kcol h3 .sum { color:var(--muted); font-family:var(--mono); font-size:12px; font-weight:400; }
.kcard { background:var(--paper); border:1px solid var(--line); border-radius:0; padding:11px 12px;
         margin-bottom:8px; cursor:pointer; }
.kcard:hover { border-color:var(--accent); }
.kcard .t { font-weight:600; font-size:13.5px; }
.kcard .c { color:var(--muted); font-size:12.5px; margin-top:3px; }
.kcard .v { color:var(--brass-deep); font-weight:700; font-size:14px; margin-top:6px; font-variant-numeric:tabular-nums; font-family:var(--serif); }
.kcard .movers { display:flex; gap:6px; margin-top:8px; }
.kcard .movers button { border:1px solid var(--line); background:var(--paper); border-radius:0;
                        padding:2px 9px; font-size:12px; color:var(--heading); }
.kcard .movers button:hover { border-color:var(--accent); color:var(--accent); }

/* ---------- the signature: job traveler strip — punch-card lifecycle ---------- */
.traveler { display:flex; gap:0; margin:4px 0; }
.traveler .step { font-family:var(--mono); font-weight:500; font-size:10.5px; letter-spacing:.08em;
  text-transform:uppercase; padding:4px 10px 3px; border:1px solid var(--line); color:var(--muted);
  border-right:none; background:var(--paper); white-space:nowrap; }
.traveler .step:first-child { border-radius:0; }
.traveler .step:last-child { border-radius:0; border-right:1px solid var(--line); }
.traveler .step.done { color:var(--heading); border-color:var(--brass); background:var(--surface-2); }
.traveler .step.now { color:var(--on-accent); background:var(--accent); border-color:var(--accent); }
.traveler .step.paid { color:#F3EEE3; background:var(--green); border-color:var(--green); }

/* ---------- pills — square status stamps ---------- */
.pill { display:inline-block; padding:3px 9px; border-radius:0; font-size:10.5px; font-weight:500;
        text-transform:uppercase; letter-spacing:.08em; font-family:var(--mono); border:1px solid currentColor; background:none; }
.pill.draft { color:var(--muted); }
.pill.sent { color:var(--navy-2); }
[data-theme="dark"] .pill.sent { color:#9FB6C9; }
.pill.overdue { color:var(--red); transform:rotate(-1deg); }
[data-theme="dark"] .pill.overdue { color:#C97B6A; }
.pill.paid { color:var(--green); }
[data-theme="dark"] .pill.paid { color:#7CAE8F; }

/* ---------- forms / modal ---------- */
.modal-back { display:none; position:fixed; inset:0; background:rgba(30,47,58,.55); z-index:50;
              align-items:flex-start; justify-content:center; padding:6vh 16px; overflow-y:auto; }
.modal-back.open { display:flex; }
.modal { background:var(--surface); border-radius:0; border-top:3px solid var(--brass); width:min(480px,100%); padding:24px;
         box-shadow:0 24px 70px rgba(0,0,0,.3); }
.modal h2 { font-family:var(--serif); font-size:24px; font-weight:600; color:var(--heading); margin-bottom:14px; }
.field { margin-bottom:12px; }
.field label { display:block; font-size:11.5px; font-weight:500; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:5px; }
.field input, .field select, .field textarea { width:100%; padding:9px 11px; border:1px solid var(--line);
  border-radius:0; font-size:14px; font-family:inherit; background:var(--paper); color:var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline:2px solid var(--accent); outline-offset:1px; }
/* v0.8: readable input text in both themes + softer placeholders */
.field input::placeholder, .field textarea::placeholder, .search::placeholder, .tl-add input::placeholder { color:var(--muted); opacity:.8; }
.search, .tl-add input { color:var(--ink); background:var(--paper); }
.modal .actions { display:flex; justify-content:space-between; gap:10px; margin-top:18px; }
.modal .actions .right { display:flex; gap:10px; margin-left:auto; }

/* ---------- timeline ---------- */
.tl { list-style:none; }
.tl li { display:flex; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); font-size:13.5px; }
.tl li:last-child { border-bottom:none; }
.tl .dot { width:8px; height:8px; border-radius:99px; background:var(--brass); margin-top:6px; flex-shrink:0; }
.tl .dot.alert { background:var(--accent); } .tl .dot.milestone { background:var(--green); }
.tl .dot.email { background:var(--brass); }
.tl time { color:var(--muted); font-size:12px; white-space:nowrap; margin-left:auto; font-family:var(--mono); }

/* ---------- settings ---------- */
code.key { background:var(--surface-2); padding:3px 8px; border-radius:0; font-size:12.5px; word-break:break-all; font-family:var(--mono); }
.hint { font-size:12.5px; color:var(--muted); margin-top:8px; line-height:1.5; }

.checkbox-done { accent-color:var(--accent); width:16px; height:16px; }
.taskdone { text-decoration:line-through; color:var(--muted); }

/* ---------- v0.12: mobile top bar + slide-in drawer (hidden on desktop) ---------- */
.mobilebar { display:none; }
.drawer-back { display:none; }
.menubtn { background:none; border:none; color:var(--on-navy); font-size:22px; line-height:1; padding:10px 12px; margin-left:-8px; }
.mobilebrand { font-family:var(--serif); font-weight:800; font-size:19px; letter-spacing:-.01em; color:var(--on-navy); }
.mobilebrand::first-letter { text-transform:none; }
/* v0.17.6: tiny brand logo in the mobile top bar (between ☰ and the name). The bar is
   mobile-only, so this never shows on desktop. Hidden until applyAppearance sets a src. */
.mobilelogo { height:26px; width:auto; max-width:88px; object-fit:contain; flex-shrink:0; }

@media (max-width: 760px) {
  /* top bar */
  body { padding-top:52px; }
  .mobilebar { display:flex; position:fixed; top:0; left:0; right:0; height:52px; z-index:70;
    background:var(--navy); color:var(--on-navy); align-items:center; gap:8px; padding:0 12px;
    border-bottom:2px solid var(--brass); box-shadow:none; }
  /* drawer: the sidebar slides in from the left over a dimmed backdrop */
  .side { position:fixed; top:0; left:0; bottom:0; height:100vh; width:min(78vw, 300px); z-index:80;
    transform:translateX(-105%); transition:transform .22s ease; overflow-y:auto;
    box-shadow:8px 0 30px rgba(0,0,0,.3); padding:18px 14px; }
  body.drawer-open .side { transform:translateX(0); }
  body.drawer-open .drawer-back { display:block; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:75; }
  .side a { padding:13px 12px; font-size:14px; }            /* finger-sized menu rows */
  .sidecollapse { display:none; }                          /* collapse is a desktop idea */
  .sideopen { display:none !important; }
  body.side-collapsed .side { display:flex; }              /* ignore desktop-collapsed state */
  body.side-collapsed main { padding-left:14px; }

  main { padding:16px 12px; max-width:100%; }
  h1 { font-size:27px; }
  .page-head { flex-direction:column; align-items:stretch; gap:8px; }
  .page-head > div:last-child { width:100%; }
  .search { width:100%; margin:0 0 6px; }

  /* touch targets + no-zoom inputs (16px stops mobile browsers zooming the form) */
  .btn { min-height:44px; padding:10px 16px; }
  .btn.sm { min-height:36px; padding:7px 12px; }
  .field input, .field select, .field textarea, .search, .tl-add input { font-size:16px; min-height:44px; }
  .field textarea { min-height:88px; }
  .field input[type=checkbox] { min-height:0; width:20px; height:20px; }
  .field input[type=color] { min-height:0; }
  .checkbox-done { width:20px; height:20px; }

  /* modals: full-width sheets. v0.12.2: z-index above the top bar (the header was
     covering pop-ups) and breathing room at the top so the title is never clipped. */
  .modal-back { padding:14px 10px; z-index:95; }
  .modal { padding:18px 16px; }
  .modal .actions { position:sticky; bottom:0; background:var(--surface); padding-top:10px; }

  /* v0.12: tables become stacked cards (labels come from data-label, set by app.js) */
  table.cardify, table.cardify tbody { display:block; background:none; border:none; }
  table.cardify tr { display:block; background:var(--surface); border:1px solid var(--line);
    border-radius:0; margin-bottom:10px; padding:6px 14px; }
  table.cardify tr.hdr { display:none; }
  table.cardify td { display:flex; justify-content:space-between; align-items:baseline; gap:12px;
    border:none; padding:8px 0; border-bottom:1px solid var(--line-2); }
  table.cardify tr td:last-child { border-bottom:none; }
  table.cardify td::before { content:attr(data-label); font-size:11px; text-transform:uppercase;
    letter-spacing:.14em; color:var(--muted); font-weight:500; flex-shrink:0; }
  table.cardify td.nolabel::before, table.cardify td:not([data-label])::before { display:none; content:none; }
  table.cardify td:empty { display:none; }
  table.cardify td .traveler { overflow-x:auto; max-width:100%; }

  /* kanban: one column per swipe */
  .kanban { scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; }
  .kcol { scroll-snap-align:start; flex:0 0 82vw; min-width:82vw; width:82vw; }
  .kcard .movers button { padding:6px 14px; font-size:13px; }

  .stat-row { grid-template-columns:repeat(2, 1fr); gap:0; }
  .stat { padding:12px 14px; border-bottom:1px solid var(--line); }
  .stat .value { font-size:30px; }
  .tl time { margin-left:0; }
}
@media (prefers-reduced-motion: reduce) { * { transition:none !important; } }

/* search box in page headers */
.search { padding:8px 12px; border:1px solid var(--line); border-radius:0; font-size:13.5px;
  font-family:inherit; width:200px; vertical-align:middle; margin-right:6px; }
.search:focus { outline:2px solid var(--accent); outline-offset:1px; }
.page-head > div:last-child { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

/* client health lights */
.hdot { display:inline-block; width:10px; height:10px; border-radius:99px; margin-right:6px; vertical-align:1px; }
.hdot.g { background:var(--green); } .hdot.y { background:var(--brass); } .hdot.r { background:var(--red); }

/* v0.7 (A5): theme transitions, dark toggle, appearance controls */
body, .side, .card, .stat, table, td, th, .kcard, .kcol, .modal, .empty,
.field input, .field select, .field textarea, .search {
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.themetgl { background:none; border:1px solid rgba(243,238,227,.3); color:var(--on-navy); opacity:.8;
  padding:8px; border-radius:0; font-size:12px; text-transform:uppercase; letter-spacing:.07em;
  margin-top:16px; margin-bottom:8px; text-align:left; }
.themetgl:hover { border-color:var(--brass); color:var(--brass); opacity:1; }
.swatch { width:26px; height:26px; border-radius:0; border:2px solid var(--line);
  cursor:pointer; display:inline-block; vertical-align:middle; margin:0 6px 6px 0; padding:0; }
.swatch.sel { outline:2px solid var(--accent); outline-offset:1px; }
.field input[type=color] { width:46px; height:34px; padding:2px; cursor:pointer; vertical-align:middle; }
.field input[type=file] { width:auto; max-width:100%; }
.field input.hex { width:120px; display:inline-block; vertical-align:middle; margin-left:8px; text-transform:uppercase; }
[title] { }

/* v0.8: sidebar logo + collapse */
.brandlogo { max-width:100%; min-width:0; width:auto; max-height:calc(56px * var(--logo-scale, 1));
  object-fit:contain; object-position:center; align-self:flex-start; display:block; margin:0 0 12px;
  /* v0.17.0: horizontal position 0..100. margin-left slides the box across the track;
     the matching translateX(-align%) pulls it back by its own width so edges never overflow. */
  margin-left:calc(var(--logo-align, 50) * 1%); transform:translateX(calc(var(--logo-align, 50) * -1%)); }
.sidecollapse { align-self:flex-end; background:none; border:none; color:var(--on-navy); opacity:.7; font-size:18px;
  line-height:1; cursor:pointer; padding:0 2px 6px; }
.sidecollapse:hover { color:var(--brass); }
.sideopen { display:none; position:fixed; top:12px; left:12px; z-index:60; background:var(--navy);
  color:var(--on-navy); border:none; border-radius:0; padding:9px 13px; font-size:16px; cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,.25); }
.sideopen:hover { background:var(--navy-2); }
body.side-collapsed .side { display:none; }
body.side-collapsed .sideopen { display:block; }
body.side-collapsed main { padding-left:64px; }

/* v0.7 (A2/A3): pipeline discipline + timeline */
.kcard .next { font-size:12px; color:var(--heading); margin:4px 0 2px; }
.kcard .next.muted { color:var(--muted); font-style:italic; }
.kcard .next time { color:var(--muted); font-size:11px; }
.kcard.rotting { border-left:3px solid var(--accent); }
.tl-add { display:flex; gap:6px; margin:6px 0 8px; }
.tl-add input { flex:1; padding:7px 10px; border:1px solid var(--line); border-radius:0; font-family:inherit; font-size:13px; }

/* ---------- v0.10: Claude's Desk ---------- */
.navbadge { display:inline-block; min-width:18px; text-align:center; background:var(--accent);
  color:var(--on-accent); border-radius:0; font-size:11px; font-weight:600; font-family:var(--mono); padding:2px 6px; margin-left:6px; }
.desk-item { border-left:3px solid var(--accent); padding-left:16px; }
.desk-head { display:flex; align-items:center; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
.desk-head time { margin-left:auto; font-size:12px; }
.desk-detail { color:var(--muted); font-size:13.5px; margin-bottom:12px; white-space:pre-wrap; }
.desk-actions { display:flex; gap:10px; margin-top:12px; }
.tl .dot.system { background:var(--navy-2); }
[data-theme="dark"] .tl .dot.system { background:var(--muted); }

/* v0.10.1 — scrolling list window (Claude's Desk: Decided recently + Recent activity) */
.tl.scrollbox { max-height: 320px; overflow-y: auto; padding-right: 6px; }

/* v0.10.4 — checkboxes inside .field render as normal little boxes, not full-width bordered inputs */
.field input[type=checkbox] { width:16px; height:16px; padding:0; border:none; display:inline-block; vertical-align:-3px; margin-right:6px; accent-color:var(--accent); }
.field input[type=checkbox]:focus { outline:2px solid var(--accent); outline-offset:2px; }
/* v0.10.4 — the Claude spark */
.claude-ico { vertical-align:-1px; margin-right:6px; }

/* ---------- demo banner (only present when DEMO_MODE=1) ---------- */
/* Fixed 34px strip across the top; the .has-demo-banner class pushes the whole
   app (sidebar, mobile top bar, content) down by 34px so nothing hides under it. */
.demo-banner { position:fixed; top:0; left:0; right:0; height:34px; z-index:200;
  background:#000; color:#FF4136; display:flex; align-items:center; justify-content:center;
  font-family:var(--sans); font-weight:700; font-size:13px; letter-spacing:.2px;
  padding:0 14px; box-shadow:0 1px 4px rgba(0,0,0,.18); }
.demo-banner span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; padding:0 10px; }
.demo-banner strong { font-weight:700; }
body.has-demo-banner { padding-top:34px; }
body.has-demo-banner .side { top:34px; height:calc(100vh - 34px); }
body.has-demo-banner .sideopen { top:46px; }
@media (max-width:760px) {
  body.has-demo-banner { padding-top:86px; }        /* 34 banner + 52 mobile top bar */
  body.has-demo-banner .mobilebar { top:34px; }
  body.has-demo-banner .side { top:34px; height:calc(100vh - 34px); }
}

/* ---------- v0.17.1: mobile right-edge overflow fixes ---------- */
@media (max-width: 760px) {
  /* Safety net: nothing should push the page sideways on a phone. The pipeline's
     kanban keeps its own internal horizontal scroll, so this doesn't harm it. */
  main { overflow-x:hidden; }
  /* v0.17.7: drop the browser's default ~40px list indent so the dashboard lists
     (Needs attention, Tasks due, Recent activity) use the full width on a phone. */
  .tl { padding-left:0; }
  /* "Needs attention" rows: let the row wrap and the action buttons drop to a new
     full-width line instead of running off the right edge. */
  .tl li { flex-wrap:wrap; }
  .tl li > span:not(.dot) { flex:1 1 0; min-width:0; }           /* sit beside the dot and wrap its own words, not to a new line */
  .tl time { width:100%; margin-left:0; white-space:normal;
    display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
  .tl time .btn.sm { flex:0 0 auto; }
}
