/* KiloGraham3D Daily Report: one narrow work column, sticky progress header, big tap targets for a workbench phone. */
:root {
  --bg: #f3f4f6; --surface: #ffffff; --fg: #16181c; --muted: #5f6672; --line: #dde0e5;
  --accent: #d9480f; --accent-soft: #fde8dd; --done: #2f8a4c; --done-soft: #e3f3e8;
  --warn: #b45309; --warn-soft: #fdf0d9; --bad: #b42318;
  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #121417; --surface: #1b1e23; --fg: #eceef1; --muted: #9aa1ad; --line: #2c3139;
  --accent: #ff7a3d; --accent-soft: #3a2318; --done: #5cc27e; --done-soft: #17301f;
  --warn: #f0a648; --warn-soft: #33260f; --bad: #ff8a7a; color-scheme: dark;
} }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.45; }
.wrap { max-width: 760px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
a { color: var(--accent); }

header { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
header .wrap { padding-block: 12px 10px; display: grid; gap: 10px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
h1 { font-family: var(--display); font-size: 22px; font-weight: 700; margin: 0; letter-spacing: 0.01em; }
h1 small { display: block; font-family: var(--body); font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
select, input[type=text], input[type=password] { font: 500 15px var(--body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.progress { display: grid; gap: 6px; }
.progress-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.progress-line b { font-family: var(--mono); font-size: 20px; color: var(--fg); font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.bar.full > i { background: var(--done); }
.tools { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.tools label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.tools .spacer { flex: 1; }
.btn { font: 600 13.5px var(--body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }

main .wrap { padding-block: 16px 48px; display: grid; gap: 18px; }
section.cat { display: grid; gap: 8px; }
.cat-head { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 2px; }
.cat-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.cat-head .chev { width: 14px; height: 14px; transition: transform .15s ease; color: var(--muted); flex: none; }
.cat.collapsed .chev { transform: rotate(-90deg); }
.cat-head .name { flex: 1; min-width: 0; }
.cat-head .tally { font-family: var(--mono); font-weight: 500; font-size: 13.5px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.cat-head .tally.full { color: var(--done); }
.cat.collapsed .cat-body { display: none; }
.cat-body { display: grid; gap: 8px; }

.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.item.overdue { border-left: 4px solid var(--warn); }
.item.done { background: var(--done-soft); border-color: transparent; }
.item.done .title { text-decoration: line-through; color: var(--muted); }
.check { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; }
.check svg { width: 18px; height: 18px; }
.item.done .check { background: var(--done); border-color: var(--done); color: var(--surface); }
.info { min-width: 0; }
.title { font-weight: 600; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; font-size: 12.5px; color: var(--muted); align-items: center; }
.chip { background: var(--accent-soft); color: var(--fg); border-radius: 6px; padding: 1px 7px; font-weight: 500; }
.chip.warn { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.catpick { margin-top: 6px; display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.catpick select { font-size: 13px; padding: 4px 8px; max-width: 100%; }
.counter { display: flex; align-items: center; gap: 4px; }
.counter button { width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: 600 20px var(--mono); cursor: pointer; line-height: 1; }
.counter button.plus { background: var(--accent); border-color: var(--accent); color: #fff; }
.item.done .counter button.plus { background: var(--bg); border-color: var(--line); color: var(--muted); }
.counter button:disabled { opacity: .35; cursor: default; }
.count { min-width: 64px; text-align: center; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 700; }
.count small { font-weight: 500; color: var(--muted); font-size: 13px; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.notice { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: var(--muted); }
.notice b { color: var(--fg); }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--fg); }
.notice.bad { border-color: var(--bad); color: var(--fg); }
.notice .btn { margin-top: 10px; }
.empty-done { text-align: center; padding: 14px; color: var(--done); font-weight: 600; background: var(--done-soft); border-radius: 10px; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 14px; max-width: calc(100% - 32px); z-index: 20; }

/* Login and settings pages */
.card { max-width: 440px; margin: 10vh auto 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px 24px; display: grid; gap: 14px; }
.card.wide { max-width: 640px; margin-top: 24px; }
.card h1 { font-size: 24px; }
.card form { display: grid; gap: 12px; }
.card label { display: grid; gap: 5px; font-weight: 600; font-size: 14px; }
.card .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.card .err { color: var(--bad); font-weight: 600; }
.card .ok { color: var(--done); font-weight: 600; }
.card dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; overflow-wrap: anywhere; }
.card code { font-family: var(--mono); font-size: 13px; background: var(--bg); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.card hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

@media (max-width: 460px) {
  .item { grid-template-columns: auto minmax(0, 1fr); }
  .counter { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { .bar > i, .cat-head .chev { transition: none; } }
