/* base reset (the claude.ai artifact host supplied this; the self-hosted page needs its own) */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
img { max-width: 100%; }

/* Layout: one phone screen. Header with tabs on top, the list scrolls in the middle, the note box stays at the bottom. */
:root {
  --bg: #f1f4f7;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #586675;
  --line: #d7dee6;
  --tape: #1c68b8;        /* painter's tape blue */
  --tape-ink: #ffffff;
  --tape-soft: #e3eefa;
  --flag: #f4cf4a;        /* carpenter's pencil yellow, for open questions */
  --flag-ink: #3a2d00;
  --ok: #23774a;
  --err: #a8321f;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --body: "Atkinson Hyperlegible", -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f151b; --surface: #19222b; --ink: #e8eef4; --muted: #9aa8b6; --line: #2c3945;
    --tape: #62a8f0; --tape-ink: #06121f; --tape-soft: #1b2e44;
    --flag: #dcb534; --flag-ink: #2a2100; --ok: #62c592; --err: #f08a78;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f151b; --surface: #19222b; --ink: #e8eef4; --muted: #9aa8b6; --line: #2c3945;
  --tape: #62a8f0; --tape-ink: #06121f; --tape-soft: #1b2e44;
  --flag: #dcb534; --flag-ink: #2a2100; --ok: #62c592; --err: #f08a78;
  color-scheme: dark;
}
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.4;
  display: flex; flex-direction: column;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 16px 0; }
.top h1 { font-family: var(--display); font-size: 1.35rem; font-weight: 700; margin: 0 0 10px; letter-spacing: -0.01em; text-wrap: balance; }
.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tab {
  flex: 1 0 auto; background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 10px 10px 9px; color: var(--muted); font-weight: 700; white-space: nowrap; min-height: 44px;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--tape); }
.count { font-variant-numeric: tabular-nums; font-weight: 400; margin-left: 4px; }
.count.flag { background: var(--flag); color: var(--flag-ink); border-radius: 999px; padding: 1px 7px; font-weight: 700; }

main { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.banner { background: var(--flag); color: var(--flag-ink); padding: 10px 16px; font-weight: 700; }
h2 { font-family: var(--display); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.group { display: flex; flex-direction: column; }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .txt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.row .sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.check {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--muted);
  background: var(--surface); display: grid; place-items: center; padding: 0; margin-top: -2px; font-weight: 700;
}
.check[aria-checked="true"] { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.done .txt > :first-child { text-decoration: line-through; color: var(--muted); }
.empty { color: var(--muted); padding: 14px 12px; }
details > summary { color: var(--muted); font-weight: 700; padding: 8px 2px; cursor: pointer; }
.link { background: none; border: 0; padding: 6px 0; color: var(--tape); font-weight: 700; text-decoration: underline; }

.job { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.job-head { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.job-head strong { font-size: 1.05rem; min-width: 0; overflow-wrap: anywhere; }
.pill { background: var(--tape-soft); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.next { border-left: 4px solid var(--flag); padding-left: 10px; }
.contact { border-top: 1px solid var(--line); padding-top: 8px; overflow-wrap: anywhere; }
.contact .meta { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.jobs { display: flex; flex-direction: column; gap: 12px; }

.q { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--flag); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.q-form { display: flex; gap: 8px; }
.q-form input, .filter {
  flex: 1 1 auto; min-width: 0; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); min-height: 44px;
}
.btn { background: var(--tape); color: var(--tape-ink); border: 0; border-radius: 8px; padding: 0 16px; font-weight: 700; min-height: 44px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.place b { display: block; }
.hours-row { font-variant-numeric: tabular-nums; }
.hours-line { display: flex; justify-content: space-between; gap: 12px; }
.rows.pad { padding: 12px; overflow: visible; }
.hours-form { display: flex; flex-direction: column; gap: 10px; }
.hf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hf { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 700; color: var(--muted); min-width: 0; }
.hf input { font-size: 17px; font-weight: 400; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); min-height: 44px; width: 100%; min-width: 0; }
.hf-submit { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hours-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.period { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; background: var(--tape-soft); border-radius: 10px; padding: 12px; font-variant-numeric: tabular-nums; }
.period b { font-size: 1.25rem; }
.note-meta { color: var(--muted); font-size: 0.85rem; }
.changes { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.9rem; }

.say { margin: 0 16px; padding: 10px 12px; border-radius: 10px 10px 0 0; background: var(--tape-soft); border: 1px solid var(--line); border-bottom: 0; display: flex; gap: 10px; align-items: flex-start; }
.say.err { border-color: var(--err); }
.say p { margin: 0; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.say button { background: none; border: 0; font-weight: 700; padding: 0 4px; min-height: 28px; }
.compose { background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px 12px; display: flex; gap: 8px; align-items: flex-end; }
.compose textarea { flex: 1 1 auto; min-width: 0; resize: none; max-height: 9em; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
@media (min-width: 720px) {
  .top, main, .compose { padding-inline: max(16px, calc(50% - 340px)); }
  .say { margin-inline: max(16px, calc(50% - 340px)); }
}
@media (prefers-reduced-motion: no-preference) { .check { transition: background-color .15s; } }

/* self-hosted additions: header row with sign-out, and the passphrase gate */
.top-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.top-row form { margin: 0; }
.top-row .link { font-size: 0.85rem; padding: 0; white-space: nowrap; }
/* main.gate outranks the wide-screen `main` padding above, which would otherwise eat the 420px box */
main.gate { justify-content: center; max-width: 420px; width: 100%; margin: 0 auto; padding-inline: 16px; }
.gate h1 { font-family: var(--display); font-size: 1.6rem; margin: 0; }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-form label { font-weight: 700; }
.gate-form input { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-height: 48px; }
.gate .banner { border-radius: 8px; margin: 0; }
