:root {
  --bg: #f7f6f3; --surface: #ffffff; --text: #1f2328; --muted: #6a6f76; --border: #e3e1dc;
  --accent: #e8590c; --accent-ink: #ffffff; --danger: #c92a2a; --ok: #2b8a3e; --warn: #b35c00; --info: #1c6dd0;
  --soft-ok: #ebfbee; --soft-err: #fff0f0; --soft-warn: #fff6e6; --soft-info: #eef5ff;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --surface: #1d2024; --text: #e8e6e3; --muted: #9aa0a6; --border: #2e3237;
    --soft-ok: #13291a; --soft-err: #331717; --soft-warn: #33240f; --soft-info: #142336; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
/* Author display rules (flex/grid) would otherwise override the hidden attribute. */
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--info); }
h1 { font-size: 1.6rem; margin: .2em 0 .6em; } h2 { font-size: 1.15rem; margin: 0 0 .7em; } h3 { font-size: 1rem; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: color-mix(in srgb, var(--border) 50%, transparent); padding: .05em .35em; border-radius: 4px; font-size: .92em; word-break: break-all; }
pre { background: color-mix(in srgb, var(--border) 40%, transparent); padding: .8em; border-radius: 8px; overflow-x: auto; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 1em; top: 1em; z-index: 10; background: var(--surface); padding: .5em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .small { font-size: .85em; }
.topbar { display: flex; align-items: center; gap: 1.2rem; padding: .6rem 1.2rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: .45em; }
.brand.big { font-size: 1.8rem; justify-content: center; margin: 2rem 0 1rem; }
.dot { width: .8em; height: .8em; border-radius: 50%; background: var(--accent); display: inline-block; }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.nav a { padding: .35em .7em; border-radius: 6px; color: var(--muted); text-decoration: none; }
.nav a:hover { background: var(--bg); color: var(--text); } .nav a.active { background: var(--bg); color: var(--text); font-weight: 600; }
.who { display: flex; gap: .8rem; align-items: center; }
.container { max-width: 1180px; margin: 0 auto; padding: 1.2rem; } .container.narrow { max-width: 440px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; } .grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); } .grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.grid > .card { margin-bottom: 0; } .grid + .card, .grid + .grid { margin-top: 1rem; }
.stack { display: flex; flex-direction: column; gap: .7rem; }
.row { display: flex; gap: .7rem; align-items: end; flex-wrap: wrap; } .row > label { flex: 1; min-width: 110px; } .or { padding-bottom: .55em; color: var(--muted); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; } .actions form { margin: 0; }
.inline { display: inline; margin: 0; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: .45rem; font-weight: 400; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; display: flex; flex-direction: column; gap: .35rem; } legend { font-size: .9rem; font-weight: 500; }
input, select, textarea { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: .45em .6em; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=color] { width: 4rem; height: 2.4rem; padding: .2em; cursor: pointer; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { display: inline-flex; align-items: center; gap: .4em; padding: .45em .95em; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); } .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; } .danger-text { color: var(--danger); }
.btn.ghost { background: transparent; } .btn.small { padding: .2em .6em; font-size: .85rem; } .btn.big { padding: .7em 1.3em; font-size: 1.05rem; justify-content: center; }
.btn[disabled], .btn.loading { opacity: .65; cursor: progress; }
.btn.loading::after { content: ""; width: .9em; height: .9em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
button.link { background: none; border: 0; color: var(--info); cursor: pointer; font: inherit; padding: 0; }
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.flash ul { margin: .3em 0 0; padding-left: 1.2em; }
.flash.success { background: var(--soft-ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.flash.error { background: var(--soft-err); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.flash.warn { background: var(--soft-warn); } .flash.info { background: var(--soft-info); }
.banner { display: flex; gap: 1rem; align-items: center; justify-content: center; padding: .5rem 1rem; flex-wrap: wrap; }
.banner.error { background: var(--soft-err); } .banner.info { background: var(--soft-info); }
.running-bar { display: flex; gap: .8rem; align-items: center; justify-content: center; padding: .45rem 1rem; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-bottom: 1px solid var(--border); }
.pulse { width: .6em; height: .6em; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.empty { text-align: center; padding: 1.4rem .5rem; } .empty p { margin: .3em 0; }
.day-nav { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; } .day-nav h1 { margin: 0; }
.week { display: grid; grid-template-columns: repeat(8, 1fr); gap: .4rem; margin: 1rem 0; }
.week a, .week-total { display: flex; flex-direction: column; align-items: center; padding: .45rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); font-size: .85rem; }
.week a.active { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); } .week a.today span { font-weight: 700; } .week-total { background: transparent; }
@media (max-width: 700px) { .week { grid-template-columns: repeat(4, 1fr); } }
.running-card { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.big-clock { font-size: 2.2rem; font-weight: 600; }
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--border); align-items: center; }
.entries li.running { background: color-mix(in srgb, var(--accent) 6%, transparent); margin: 0 -1.2rem; padding: .8rem 1.2rem; }
@media (max-width: 700px) { .entries li { grid-template-columns: 1fr auto; } .entries .actions { grid-column: 1 / -1; } }
.hours { font-size: 1.2rem; font-weight: 600; }
.notes { margin: .3em 0 0; color: var(--muted); white-space: pre-line; }
.tag { display: inline-block; font-size: .78rem; padding: 0 .45em; margin: .2em .25em 0 0; border-radius: 99px; background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.pill { display: inline-block; font-size: .75rem; padding: .05em .5em; border-radius: 99px; background: color-mix(in srgb, var(--muted) 15%, transparent); color: var(--muted); }
.pill.ok { background: var(--soft-ok); color: var(--ok); } .pill.warn { background: var(--soft-warn); color: var(--warn); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table .num { text-align: right; white-space: nowrap; } .table tr.archived { opacity: .55; }
.table td.actions { justify-content: flex-end; }
.card > .table { display: block; overflow-x: auto; } .card > .table > * { display: table; width: 100%; }
.bar-cell { width: 28%; } .bar { height: .7rem; background: var(--accent); border-radius: 4px; min-width: 2px; }
.filters { display: flex; gap: .7rem; align-items: end; flex-wrap: wrap; } .filters label { min-width: 140px; }
.quick { display: flex; gap: .7rem; margin-left: auto; font-size: .9rem; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5em .9em; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--text); border-color: var(--accent); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; display: flex; flex-direction: column; }
.stat span { color: var(--muted); font-size: .85rem; } .stat strong { font-size: 1.6rem; } .stat small { color: var(--muted); }
.weekday-chart { display: flex; gap: .6rem; align-items: end; height: 150px; margin: .5rem 0 1rem; }
.weekday-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; height: 100%; font-size: .8rem; }
.colbar { width: 70%; background: color-mix(in srgb, var(--accent) 75%, transparent); border-radius: 4px 4px 0 0; min-height: 2px; }
.focus-card { text-align: center; } .focus-card.is-break { background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.focus-clock { font-size: 4.5rem; font-weight: 600; letter-spacing: .02em; margin: .2rem 0; }
.focus-card .actions { justify-content: center; }
.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin: .5rem auto 1rem; max-width: 420px; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width 1s linear; }
.dialog { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); max-width: 520px; padding: 1.4rem; }
.dialog::backdrop { background: rgba(0,0,0,.4); } .dialog .actions { flex-direction: column; align-items: stretch; }
.error-text { color: var(--danger); }
.pagination { display: flex; justify-content: space-between; padding-top: .8rem; }
.json { max-height: 320px; font-size: .8rem; white-space: pre-wrap; }
.events td { font-size: .88rem; } details summary { cursor: pointer; color: var(--info); }
details > summary.btn { list-style: none; margin: .6rem 0; } details[open] > summary.btn { display: none; }
.token { display: block; margin: .4rem 0; font-size: .95rem; }
.steps li { margin-bottom: .8rem; }
.footer { text-align: center; padding: 1rem 1rem 2rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
/* Searchable select (app.js combobox) */
.combo { position: relative; font-weight: 400; }
.combo-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; margin: 0; padding: .3rem 0; list-style: none; max-height: 18rem; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.combo-list [role=option] { padding: .35em .8em .35em 1.4em; cursor: pointer; }
.combo-list [role=option]:hover, .combo-list [aria-selected=true] { background: var(--soft-info); }
.combo-empty { padding: .4em .8em; color: var(--muted); }
