:root {
  --bg: #f6f5f3; --panel: #fff; --text: #1c1917; --text2: #44403c; --muted: #78716c; --line: #e7e5e4;
  --accent: #c2410c; --accent-ink: #fff; --accent-soft: #ffedd5; --danger: #b91c1c; --r: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #141210; --panel: #1f1c19; --text: #f5f5f4; --text2: #d6d3d1; --muted: #a8a29e;
    --line: #34302c; --accent: #f97316; --accent-ink: #1c1917; --accent-soft: #431407; --danger: #f87171; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 760px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { color: var(--muted); font-size: 12px; }
#who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me { color: var(--text2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main { max-width: 760px; margin: 0 auto; padding: 4px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
h1.hello { margin: 8px 0 0; }
h2 { margin: 0; font-size: 18px; }
p { margin: 0; color: var(--text2); }
.note { color: var(--muted); font-size: 14px; }
.note a { color: inherit; }
.err { color: var(--danger); font-size: 14px; min-height: 1em; }
.input { width: 100%; height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn { height: 46px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.phead { display: flex; align-items: center; gap: 12px; }
.key { font: 700 13px ui-monospace, monospace; padding: 5px 9px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.surfaces { margin: 0; padding-left: 20px; color: var(--text2); }
.skel { height: 18px; border-radius: 6px; background: var(--line); }
/* icons (icons.js): inline SVG in the text's colour */
.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.btn { gap: 7px; }
/* the spinner (spinner.js): a ring, a border with its top in the text's colour over a faint track, turning with its box
   about the box's centre — centred by construction. One rule, one phase: spinner.js sets each one's animation-delay from
   the page clock (through the CSSOM: no inline style for the CSP), so one drawn again goes on where the last one was */
.spinner { display: inline-block; flex: none; position: relative; box-sizing: border-box; width: 1em; height: 1em; border-radius: 50%;
  vertical-align: -0.125em; transform-origin: 50% 50%; animation: spinner .8s linear infinite; will-change: transform; }
.spinner::before { content: ""; position: absolute; inset: var(--sp-in, .0833em); box-sizing: border-box; border-radius: 50%;
  border: var(--sp-w, .125em) solid color-mix(in srgb, currentColor 22%, transparent); border-top-color: currentColor; }
@keyframes spinner { to { transform: rotate(360deg); } }
@keyframes spinner-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: spinner-pulse 1.6s ease-in-out infinite; } }
/* the checkbox (check.js): its box first, then its label and a hint under it; the native input under it is hidden but
   keeps the focus, and its state draws the box. A 44px row to tap; a box alone (.ck-bare) is a 44px square */
.ck { position: relative; display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 12px 0; cursor: pointer;
  color: var(--text); text-align: left; -webkit-tap-highlight-color: transparent; }
.ck-in { position: absolute; top: 12px; left: 0; width: 20px; height: 20px; margin: 0; opacity: 0; pointer-events: none; }
.ck-box { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid color-mix(in srgb, var(--muted) 55%, var(--line));
  border-radius: 6px; background: var(--panel); color: var(--accent-ink); transition: background .12s, border-color .12s, box-shadow .12s; }
.ck-box .i { width: 14px; height: 14px; stroke-width: 3; vertical-align: 0; opacity: 0; transform: scale(.6); transition: opacity .12s, transform .12s; }
.ck:hover .ck-box { border-color: var(--accent); }
.ck-in:checked + .ck-box, .ck-in:indeterminate + .ck-box { background: var(--accent); border-color: var(--accent); }
.ck-in:checked + .ck-box .i { opacity: 1; transform: none; }
.ck-in:indeterminate + .ck-box .i { display: none; }
.ck-in:indeterminate + .ck-box::after { content: ""; width: 10px; height: 2px; border-radius: 1px; background: var(--accent-ink); }
.ck-in:focus-visible + .ck-box { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ck-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 20px; overflow-wrap: anywhere; }
.ck-h { color: var(--muted); font-size: 13px; line-height: 1.4; }
.ck:has(.ck-in:disabled) { cursor: default; }
.ck-in:disabled ~ .ck-box, .ck-in:disabled ~ .ck-t { opacity: .5; }
.ck:has(.ck-in:disabled):hover .ck-box { border-color: color-mix(in srgb, var(--muted) 55%, var(--line)); }
.ck:has(.ck-in:disabled:checked):hover .ck-box { border-color: var(--accent); }
.ck.ck-bare { padding: 0; min-width: 44px; align-items: center; justify-content: center; }
.ck.ck-bare .ck-in { top: 50%; left: 50%; transform: translate(-50%, -50%); }
@media (prefers-reduced-motion: reduce) { .ck-box, .ck-box .i { transition: none; } }
/* dialogs (dialog.js): a sheet at the bottom on a phone, a box in the middle on a wider screen */
.dlg { border: 0; padding: 0; background: var(--panel); color: var(--text); border-radius: var(--r); width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
.dlg::backdrop { background: rgb(28 25 23 / .45); }
.dlg-form { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.dlg-title { margin: 0; font-size: 19px; }
.dlg-text { margin: 0; color: var(--text2); line-height: 1.45; }
.dlg-field { display: flex; flex-direction: column; gap: 6px; }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.dlg-foot .btn { flex: 1; }
@media (max-width: 599px) {
  .dlg { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--r) var(--r) 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
.signin { display: flex; flex-direction: column; gap: 10px; }
/* a phone: the header on one line — the brand's name whole, the person's name dropped (their projects say who), Sign out unbroken */
.brand b, .brand strong { white-space: nowrap; }
#who .btn { white-space: nowrap; }
/* the account: name and Sign out on a wide screen; on a phone a round initial that opens a small menu (account.js) */
.acc-me { display: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--accent-soft);
  color: var(--accent); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; flex: none; }
@media (max-width: 480px) {
  .top { gap: 8px; }
  .brand span { white-space: nowrap; }
  #who { gap: 6px; }
  #who .acc-wide { display: none; }
  .acc-me { display: grid; place-items: center; }
}
dialog.amenu { margin: 60px 12px auto auto; padding: 6px; min-width: 230px; max-width: calc(100vw - 24px); border: 1px solid var(--line);
  border-radius: 14px; background: var(--panel); color: var(--text); box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
dialog.amenu::backdrop { background: rgba(0, 0, 0, .15); }
.amenu-who { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.amenu-who small { color: var(--muted); overflow-wrap: anywhere; }
.amenu-i { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-radius: 9px; background: none; color: inherit;
  font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.amenu-i:hover, .amenu-i:focus-visible { background: var(--bg); }
.amenu-i svg { width: 17px; height: 17px; }
