/* CR & AD. Type scale and polish from Roasters Desk round 3 (Polaris 13.9 measured):
   page title 24/32 650 -0.012em, page meta 13/20 muted, section heading 14/20 600, body and cells 13/20,
   secondary 12/16, column heads 12/16 550 muted (never caps), stat figures 20/28 600, rows about 40 px, 8 px grid.
   Round 3 (rd-patterns) takes Roasters Desk's structure, not its brand: a charcoal top bar whose tab highlight
   glides, a page head band in the lightest cream over a deeper cream canvas, lists as cards with their column
   heads inside, a filter with counts, sortable heads and a side drawer for detail.
   Round 4: group heads are bars across the table, Needs action is its own group at the top, Systems is read only
   with a Sync button, and the drawer is the rolling status report.
   Colour stays neutral: charcoal and cream. The status lights are the only colour.
   Motion: hovers ease at 200 ms; highlights glide at 350 ms; the drawer enters at 320 ms and leaves at 220 ms;
   rows fill from and drain to their centre at 420 ms ease-out; reduced motion turns movement off. */

@font-face { font-family: Figtree; font-weight: 400; font-display: swap; src: url(/fonts/figtree-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Figtree; font-weight: 500; font-display: swap; src: url(/fonts/figtree-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Figtree; font-weight: 600; font-display: swap; src: url(/fonts/figtree-latin-600-normal.woff2) format("woff2"); }

:root {
  --canvas: #f1eee7;
  --surface: #fcfbf8;
  --fill: #f5f2ec;
  --seg: #e9e5dd;
  --bar: #efece6;
  --field: #ffffff;
  --line: #ebe7df;
  --border: #d9d4c9;
  --ink: #22211f;
  --ink-soft: #4a4743;
  --muted: #6e6a63;
  --faint: #a8a39a;
  --char: #22211f;
  --cream: #f7f5f0;

  --green: #1f9d55;
  --amber: #d98a00;
  --red: #d1392b;

  --font: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.4, 0, 1, 1);
  --hover: 0.2s;
  --fillmove: 0.42s;
  --ring: 0 0 0 3px rgba(34, 33, 31, 0.1);
  --gutter: 20px;
  --side: 40px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scrollbar-gutter: stable; }
html.has-drawer { overflow: hidden; }
body { background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: 13px; line-height: 20px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
:where(button, a, input, select, textarea, .srow, .datecell, .row) {
  transition: background-color var(--hover) var(--ease), border-color var(--hover) var(--ease), color var(--hover) var(--ease),
    opacity var(--hover) var(--ease), box-shadow var(--hover) var(--ease);
}

/* ---------- The mark: CR & AD, the ampersand lighter so the two names carry it ---------- */
.mark { font-weight: 600; font-size: 15px; line-height: 20px; letter-spacing: -0.01em; white-space: nowrap; }
.mark .amp { font-weight: 400; color: rgba(247, 245, 240, 0.5); }

/* ---------- Sign in: charcoal, the mark, two fields, one button ---------- */
.signin-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 48px 16px; background: var(--char); color: var(--cream); }
.signin { width: 100%; max-width: 320px; display: grid; gap: 16px; animation: rise 0.6s var(--ease) both; }
.mark--signin { font-size: 22px; line-height: 28px; margin-bottom: 16px; }
.signin label { display: grid; gap: 6px; font-size: 13px; line-height: 20px; font-weight: 500; color: rgba(247, 245, 240, 0.72); }
.signin input { width: 100%; height: 40px; padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(247, 245, 240, 0.16);
  background: rgba(247, 245, 240, 0.06); color: var(--cream); font-size: 14px; }
.signin input:hover { border-color: rgba(247, 245, 240, 0.3); }
.signin input:focus { outline: none; border-color: rgba(247, 245, 240, 0.55); box-shadow: 0 0 0 3px rgba(247, 245, 240, 0.12); }
.signin input:-webkit-autofill { -webkit-text-fill-color: var(--cream); -webkit-box-shadow: 0 0 0 40px #2e2d2a inset; caret-color: var(--cream); }
.pw { position: relative; display: block; }
.pw input { padding-right: 64px; }
.pw__show { position: absolute; right: 4px; top: 4px; height: 32px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 550; color: rgba(247, 245, 240, 0.72); }
.pw__show:hover { color: var(--cream); background: rgba(247, 245, 240, 0.08); }
.pw__show:focus-visible { outline-color: var(--cream); outline-offset: -2px; }
/* The error sits above the button, collapsed until there is something to say. */
.err-slot { display: grid; grid-template-rows: 0fr; margin: -8px 0; transition: grid-template-rows var(--fillmove) var(--ease), margin var(--fillmove) var(--ease); }
.err-slot > div { overflow: hidden; }
.err-slot.has-err { grid-template-rows: 1fr; margin: 0; }
.signin .err { margin: 0; font-size: 13px; line-height: 20px; color: #f2b8b0; }
.signin .go { height: 40px; border-radius: 8px; background: var(--cream); color: var(--char); font-size: 14px; font-weight: 550; }
.signin .go:hover { background: #fff; }
.signin .go:focus-visible { outline-color: var(--cream); }
.signin .go[disabled] { opacity: 0.7; cursor: default; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Shell: the charcoal bar ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--side); }
.bar { position: sticky; top: 0; z-index: 10; background: var(--char); color: var(--cream); }
.bar__in { max-width: 1280px; margin: 0 auto; padding: 0 var(--side); height: 56px; display: flex; align-items: center; gap: 40px; }
.tabs { position: relative; display: flex; gap: 4px; }
.thumb { position: absolute; left: 0; transform-origin: 0 50%; pointer-events: none; }
.thumb.is-sliding { transition: transform 0.35s var(--ease); }
.tabs .thumb { top: 0; bottom: 0; border-radius: 8px; background: rgba(247, 245, 240, 0.14); }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px;
  font-size: 14px; line-height: 20px; font-weight: 500; color: rgba(247, 245, 240, 0.68); text-decoration: none; white-space: nowrap; }
.tab:hover, .tab[aria-current="page"] { color: var(--cream); }
.tabs:not(.has-thumb) .tab[aria-current="page"] { background: rgba(247, 245, 240, 0.14); }
.tab:focus-visible { outline-color: var(--cream); outline-offset: -2px; }
/* A flag on the Systems tab only: how many lights want a look. */
.tab__slot:empty { display: none; }
.tab__flag { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--amber); color: var(--char);
  font-size: 11px; line-height: 16px; font-weight: 600; text-align: center; }
.tab__flag--red { background: var(--red); color: #fff; }
.who { margin-left: auto; display: flex; align-items: center; gap: 16px; color: rgba(247, 245, 240, 0.5); white-space: nowrap; }
.textbtn { font-size: 13px; line-height: 20px; font-weight: 550; color: rgba(247, 245, 240, 0.85); border-radius: 6px; padding: 6px 8px; margin: -6px -8px; }
.textbtn:hover { color: var(--cream); background: rgba(247, 245, 240, 0.1); }
.textbtn:focus-visible { outline-color: var(--cream); }

/* ---------- The page head band ---------- */
.page.is-entering main { animation: enter 0.24s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.headband { background: var(--surface); border-bottom: 1px solid var(--line); padding: 24px 0; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; min-height: 32px; }
.head__stack { display: grid; gap: 4px; min-width: 0; }
.subline { margin: 0; font-size: 12px; line-height: 16px; color: var(--muted); }
p.meta { margin: 0; }
/* Sync keeps one width whether it says Sync or Checking. */
.btn.btn--sync { display: inline-grid; place-items: center; }
.btn--sync > span { grid-area: 1 / 1; text-align: center; }
.btn__sizer { visibility: hidden; }
.btn.btn--sync[disabled] { cursor: progress; opacity: 0.75; }
.head__title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; min-width: 0; }
.title { margin: 0; font-weight: 650; font-size: 24px; line-height: 32px; letter-spacing: -0.012em; white-space: nowrap; }
.meta { font-size: 13px; line-height: 20px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 12px; flex: none;
  border: 1px solid var(--border); border-radius: 8px; background: var(--field); font-size: 13px; line-height: 20px; font-weight: 550; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn--dark { background: var(--char); border-color: var(--char); color: var(--cream); }
.btn--dark:hover { background: #3a3835; border-color: #3a3835; }
.btn--dark:focus-visible { outline-color: var(--char); }
.btn--key { padding-right: 6px; }
.key { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 4px; background: var(--seg); color: var(--muted);
  font: 500 11px/16px var(--font); text-align: center; }
.btn--dark .key { background: rgba(247, 245, 240, 0.16); color: rgba(247, 245, 240, 0.85); }

/* ---------- A filter with counts: one joined control, the highlight glides ---------- */
.segments { position: relative; display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--seg); flex: none; }
.segments button { position: relative; display: flex; gap: 6px; padding: 3px 10px; border-radius: 6px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
.segments button span { font-weight: 400; color: var(--faint); }
.segments button[aria-pressed="true"] { color: var(--ink); }
.segments:not(.has-thumb) button[aria-pressed="true"] { background: var(--field); }
.segments button:not([aria-pressed="true"]):hover { color: var(--ink); }
.segments .thumb { top: 3px; bottom: 3px; border-radius: 6px; background: var(--field); box-shadow: 0 1px 2px rgba(34, 33, 31, 0.08); }
.segments button:focus-visible { outline-offset: -2px; }

/* ---------- Content: cards on the canvas ---------- */
main.wrap { padding-top: 24px; padding-bottom: 96px; }
.card { background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px rgba(34, 33, 31, 0.04); }
.colhead { padding: 12px var(--gutter) 8px; font-size: 12px; line-height: 16px; font-weight: 550; color: var(--muted); }
/* Group heads are bars across the table: a soft grey fill, amber or red for Needs action. */
.gbar { display: flex; align-items: baseline; gap: 8px; padding: 6px var(--gutter); background: var(--bar); font-weight: 600; font-size: 13px; line-height: 20px; color: var(--ink); }
.gbar small { font-weight: 400; font-size: 13px; color: var(--muted); }
.gbar--amber { background: #f6e9d2; color: #6f4600; }
.gbar--amber small { color: #8a6420; }
.gbar--red { background: #f6dcd8; color: #9a2419; }
.gbar--red small { color: #a8564c; }
.gbar + .srow { border-top: 0; }
.srow + .gbar { margin-top: 0; }

/* Sortable heads: the arrow shows on hover and stays on the column in force. */
.th { display: inline-flex; align-items: center; gap: 4px; margin: -4px -8px; padding: 4px 8px; border-radius: 6px; font: inherit; color: inherit; white-space: nowrap; }
.th:hover { background: var(--fill); color: var(--ink); }
.th__arrow { width: 12px; height: 12px; flex: none; opacity: 0; transition: opacity var(--hover) var(--ease), transform var(--hover) var(--ease); }
.th:hover .th__arrow { opacity: 0.4; }
.th.is-on { color: var(--ink); font-weight: 600; }
.th.is-on .th__arrow { opacity: 1; }
.th.is-asc .th__arrow { transform: rotate(180deg); }

/* ---------- Lights: the only colour on the page, and they breathe ---------- */
.light { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; --glow: rgba(168, 163, 154, 0.35);
  animation: live 2.6s ease-in-out var(--pulse-a, 0s) infinite; }
.light--green { background: var(--green); --glow: rgba(31, 157, 85, 0.28); }
.light--amber { background: var(--amber); --glow: rgba(217, 138, 0, 0.3); }
.light--red { background: var(--red); --glow: rgba(209, 57, 43, 0.32); animation-duration: 2s; animation-delay: var(--pulse-r, 0s); }
.light--still { animation: none; }
.light--none { background: transparent; animation: none; }
.light--off { background: var(--border); animation: none; }
@keyframes live {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--glow); }
  50% { opacity: 0.55; box-shadow: 0 0 0 4px transparent; }
}

/* ---------- Rows (shared) ---------- */
.row, .srow { padding: 10px var(--gutter); border-top: 1px solid var(--line); }
.card > .row:first-child { border-top: 0; }
.row:focus-within { background: var(--fill); }
.is-new { animation: fillin var(--fillmove) var(--ease) both; transform-origin: center; }
.is-leaving { animation: drain var(--fillmove) var(--ease) both; transform-origin: center; pointer-events: none; }
@keyframes fillin { from { opacity: 0; transform: scaleY(0.6); } to { opacity: 1; transform: none; } }
@keyframes drain { to { opacity: 0; transform: scaleY(0.6); } }

/* Quiet fields: read as text until touched; a well appears on hover, a ring on focus. */
.cell { display: block; width: calc(100% + 9px); min-width: 0; height: 32px; padding: 5px 8px; margin: -6px 0 -6px -9px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 13px; line-height: 20px; }
.cell:hover { background: var(--field); border-color: var(--line); }
.cell:focus { outline: none; background: var(--field); border-color: var(--border); box-shadow: var(--ring); }
.cell::placeholder { color: var(--faint); opacity: 1; }
input.cell { padding-top: 4px; padding-bottom: 6px; } /* optical: inputs sat 1 px below the textareas beside them */
.cell--strong { font-weight: 600; }
.cell--muted { color: var(--muted); }
.cell--paused { color: var(--muted); }
textarea.cell { resize: none; overflow: hidden; }
textarea.cell--wrap { min-height: 32px; height: 32px; }
select.cell { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236e6a63' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
select.cell:not(:hover):not(:focus) { background-image: none; }

.datecell { position: relative; display: block; min-height: 32px; padding: 5px 8px; margin: -6px 0 -6px -9px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.datecell:hover { background: var(--field); border-color: var(--line); }
.datecell:focus-within { background: var(--field); border-color: var(--border); box-shadow: var(--ring); }
.datecell b { font-weight: 400; }
.datecell .ago { margin-left: 8px; font-size: 12px; line-height: 16px; color: var(--muted); }
.datecell__txt > .ago:only-child { margin-left: 0; color: var(--faint); font-size: 13px; line-height: 20px; }
.datecell__in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* Row actions belong to the row's own hover and keyboard focus. */
.rowacts, .c-act { display: flex; justify-content: flex-end; gap: 4px; margin: -4px 0; }
.rowact { height: 28px; padding: 0 8px; border-radius: 6px; font-size: 12px; line-height: 16px; font-weight: 550; color: var(--muted); white-space: nowrap; opacity: 0; }
.row:hover .rowact, .row:focus-within .rowact { opacity: 1; }
.rowact:hover { color: var(--ink); background: var(--field); }
.rowact:focus-visible { opacity: 1; }

.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px var(--gutter); color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 8px); max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 8px; background: var(--char); color: var(--cream); font-size: 13px; line-height: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); opacity: 0; pointer-events: none; transition: opacity 0.24s var(--ease), transform 0.24s var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Systems ---------- */
.sgrid { display: grid; grid-template-columns: 8px minmax(168px, 1.1fr) 120px minmax(0, 2.2fr) 136px 88px; gap: 16px; align-items: center; }
.sgrid > .r { text-align: right; }
.srow { cursor: pointer; }
.srow:hover, .srow.is-current { background: var(--fill); }
.srow:focus-visible { outline-offset: -2px; border-radius: 8px; }
.s-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-client, .s-checked, .s-renew { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-report { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.s-renew b { font-weight: 500; color: var(--ink); }

/* ---------- The drawer: groups by space and weight, not lines ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(34, 33, 31, 0.28); }
.drawer { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: 560px; max-width: 100%; display: flex; flex-direction: column;
  background: var(--surface); box-shadow: -16px 0 48px rgba(34, 33, 31, 0.16); }
.drawer.is-entering { animation: slide-in 0.32s var(--ease); }
.scrim.is-entering { animation: fade-in 0.32s var(--ease); }
.drawer.is-leaving { transform: translateX(100%); transition: transform 0.22s var(--ease-out); pointer-events: none; }
.scrim.is-leaving { opacity: 0; transition: opacity 0.22s var(--ease-out); pointer-events: none; }
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.drawer__body { flex: 1; overflow-y: auto; padding: 24px 32px 48px; }
.drawer__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.drawer__name { min-width: 0; }
.dtitle { display: flex; align-items: center; gap: 12px; margin: 4px 0 0; font-weight: 650; font-size: 22px; line-height: 28px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.dsub { margin: 4px 0 0 20px; color: var(--muted); }
.dsec { margin-top: 32px; }
.dsec > h3 { margin: 0 0 12px; font-weight: 600; font-size: 14px; line-height: 20px; }
.soft { padding: 12px 16px; border-radius: 10px; background: var(--fill); }
.dreport { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.soft small { display: block; margin-top: 8px; font-size: 12px; line-height: 16px; color: var(--muted); }

/* The rolling status report: newest first, a status change set on a soft fill and said in words. */
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hist { display: grid; grid-template-columns: 8px 120px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 8px 12px; margin: 0 -12px; border-radius: 8px; }
.hist .light { align-self: start; margin-top: 6px; }
.hist__when { color: var(--muted); white-space: nowrap; }
.hist__what { min-width: 0; overflow-wrap: anywhere; }
.hist__what b { display: block; font-weight: 600; }
.hist.is-change { background: var(--fill); }
.muted { margin: 0; color: var(--muted); }

/* ---------- Projects ---------- */
.pgrid { display: grid; grid-template-columns: minmax(176px, 1fr) minmax(128px, 0.8fr) 104px minmax(0, 2.6fr); gap: 16px; align-items: start; }
.colhead.pgrid { align-items: center; }
.pgrid.is-done .cell { color: var(--faint); }
.pgrid.is-done .cell--strong { font-weight: 500; }

/* ---------- Ideas ---------- */
.igrid { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.igrid .dot { width: 4px; height: 4px; margin: 8px 2px 0; border-radius: 50%; background: var(--faint); }
.igrid--new { align-items: center; }
.ideas { max-width: 880px; }
.plus { position: relative; width: 8px; height: 8px; }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; top: 3.25px; width: 8px; height: 1.5px; border-radius: 1px; background: var(--muted); }
.plus::after { transform: rotate(90deg); }
.igrid--new .cell::placeholder { color: var(--muted); }
.igrid--new:focus-within .key { opacity: 0; }

/* ---------- Contacts ---------- */
.cgrid { display: grid; grid-template-columns: 8px minmax(144px, 0.9fr) minmax(120px, 0.8fr) minmax(0, 2fr) 176px 72px; gap: 16px; align-items: start; }
.colhead.cgrid { align-items: center; }
.cgrid > .light { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  .signin, .page.is-entering main, .is-new, .is-leaving, .drawer.is-entering, .scrim.is-entering { animation: none; }
  .light { animation: none; }
  .err-slot, .toast, .thumb.is-sliding, .drawer.is-leaving, .scrim.is-leaving { transition: none; }
}

/* ---------- 1100 and down: Systems drops the client column ---------- */
@media (max-width: 1100px) {
  .sgrid { grid-template-columns: 8px minmax(160px, 1fr) minmax(0, 2fr) 128px 80px; }
  .sgrid .s-client { display: none; }
}

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  :root { --gutter: 16px; --side: 16px; }
  .bar__in { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 8px; gap: 8px 16px; }
  .tabs { order: 3; width: 100%; margin: 0 -4px; }
  .tab { flex: 1; justify-content: center; height: 40px; padding: 0 4px; }
  .who .name { display: none; }
  .key { display: none; }
  .btn--key { padding-right: 12px; }
  .headband { padding: 20px 0 24px; }
  .head { align-items: flex-start; }
  .head__title { gap: 4px 16px; }
  .head__title .segments { margin-top: 12px; }
  main.wrap { padding-top: 16px; padding-bottom: 64px; }
  .colhead { display: none !important; }
  .card > .colhead + .row { border-top: 0; }
  .rowact { opacity: 1; height: 32px; }
  .btn { height: 40px; }

  .sgrid { grid-template-columns: 8px minmax(0, 1fr) auto; grid-template-areas: "l n c" ". r r" ". w w"; gap: 2px 12px; padding-top: 12px; padding-bottom: 12px; }
  .sgrid .light { grid-area: l; align-self: center; }
  .sgrid .s-name { grid-area: n; }
  .sgrid .s-checked { grid-area: c; font-size: 12px; }
  .sgrid .s-report { grid-area: r; white-space: normal; font-size: 12px; line-height: 16px; color: var(--muted); }
  .sgrid .s-renew { grid-area: w; font-size: 12px; line-height: 16px; }
  .sgrid .s-renew:empty { display: none; }

  .drawer { width: 100%; box-shadow: none; }
  .drawer__body { padding: 16px 16px 48px; }
  .hist { grid-template-columns: 8px minmax(0, 1fr); row-gap: 0; }
  .hist__when { font-size: 12px; line-height: 16px; }
  .hist__what { grid-column: 2; }

  .row { padding-top: 12px; padding-bottom: 12px; }
  .pgrid { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cgrid { grid-template-columns: 8px minmax(0, 1fr) auto; grid-template-areas: "l name act" ". company company" ". why why" ". contact contact"; gap: 2px 12px; }
  .cgrid > .light { grid-area: l; margin-top: 6px; } .c-name { grid-area: name; } .c-company { grid-area: company; }
  .c-why { grid-area: why; } .c-contact { grid-area: contact; } .c-act { grid-area: act; margin-right: -8px; }
  [data-label] { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; }
  [data-label]::before { content: attr(data-label); font-size: 12px; line-height: 16px; color: var(--muted); }
  .igrid { grid-template-columns: 8px minmax(0, 1fr); }
  /* On a phone the idea's actions appear when you tap into the idea, so the list stays one line each. */
  .igrid .rowacts { grid-column: 2; justify-content: flex-start; margin: 4px 0 -4px -8px; display: none; }
  .igrid:focus-within .rowacts { display: flex; }
}
