:root {
  --bg: #ffffff; --panel: #ffffff; --panel-alt: #f7f5f4; --ink: #151515; --muted: #68645f; --line: #e4e0db;
  --accent: #c8211a; --accent-bright: #ee2e24; --accent-ink: #ffffff; --accent-soft: #fbe4e1;
  --header-bg: #151515; --header-ink: #f4f1ec; --header-muted: #b9b2a9;
  --red-soft-bg: #fbe4e1; --red-soft-ink: #8c1f17; --ok-ink: #151515; --ok-bg: #f1efea;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0d0c; --panel: #1a1816; --panel-alt: #141312; --ink: #f1ede7; --muted: #a79f96; --line: #332e29;
    --accent: #ff5146; --accent-bright: #ff6a5f; --accent-ink: #1a0706; --accent-soft: #3a1714;
    --header-bg: #000000; --header-ink: #f4f1ec; --header-muted: #948c82;
    --red-soft-bg: #3a1714; --red-soft-ink: #ff9d92; --ok-ink: #f1ede7; --ok-bg: #201d1a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 28px 0 10px; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stamp { font-variant-numeric: tabular-nums; white-space: nowrap; }

#top { background: var(--header-bg); border-bottom: 3px solid var(--accent); position: sticky; top: 0; z-index: 5; }
.bar { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo { height: 38px; width: 38px; display: block; border-radius: 6px; background: #fff; padding: 2px; flex: none; }
.brand { font-weight: 700; font-size: 16px; color: var(--header-ink); text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brandtext span, .brand > span:last-child { display: block; font-weight: 400; font-size: 12px; color: var(--header-muted); }
nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav a { padding: 6px 12px; border-radius: 99px; text-decoration: none; color: var(--header-muted); font-weight: 500; }
nav a:hover { color: var(--header-ink); }
nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.who { font-size: 13px; color: var(--header-muted); display: flex; align-items: center; gap: 10px; }
.who button { background: transparent; border-color: var(--header-muted); color: var(--header-ink); }
.who button:hover { border-color: var(--header-ink); }

#app { max-width: 1120px; margin: 0 auto; padding: 26px 20px 80px; outline: none; }
.lede { color: var(--muted); max-width: 70ch; margin-bottom: 18px; }
.banner { background: var(--panel-alt); border: 1px solid var(--line); border-left: 4px solid var(--accent); color: var(--ink); border-radius: 8px; padding: 9px 14px; margin-bottom: 18px; font-size: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 18px; align-items: start; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }

button, .btn { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
button.danger { color: var(--accent); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
button:disabled { opacity: 0.55; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=date], input[type=password], input[type=search], input[type=email], select, textarea {
  width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 14px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; min-width: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters > div { flex: 1 1 150px; }
.filters .check { flex: 0 0 auto; padding-bottom: 8px; }
.check label { display: flex; gap: 6px; align-items: center; font-weight: 400; margin: 0; font-size: 14px; }
.error { background: var(--red-soft-bg); color: var(--red-soft-ink); border-radius: 8px; padding: 9px 12px; margin: 10px 0; }

.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.date { white-space: nowrap; font-weight: 600; }
td.date span { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.title a { font-weight: 600; text-decoration: none; }
.title a:hover { text-decoration: underline; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.flag { display: inline-block; font-size: 12.5px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.flag.over { background: var(--accent); color: var(--accent-ink); }
.flag.limit { background: var(--red-soft-bg); color: var(--red-soft-ink); }
.flag.ok { background: var(--ok-bg); color: var(--ok-ink); }

.notice { border-radius: 10px; padding: 14px 16px; border: 1px solid var(--line); background: var(--panel); }
.notice.over { border-color: var(--accent); background: var(--red-soft-bg); }
.notice.over h3 { color: var(--red-soft-ink); }
.notice.limit { border-color: var(--accent); background: var(--red-soft-bg); }
.notice.ok { border-color: var(--line); background: var(--panel-alt); }
.notice ul { margin: 8px 0 0; padding-left: 18px; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 13px; }
dl.facts dd { margin: 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 9px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }

.calhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.calhead h2 { margin: 0; min-width: 170px; }
.cal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 0 4px; }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-height: 104px; padding: 6px 7px; font-size: 12.5px; }
.day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.day.past { opacity: 0.6; }
.day.limit { background: var(--red-soft-bg); border-color: var(--accent); }
.day.over { background: var(--accent-soft); border-color: var(--accent); }
.day .num { font-weight: 700; }
.day .load { display: block; font-weight: 600; font-size: 11.5px; color: var(--red-soft-ink); }
.day a { display: block; margin-top: 4px; text-decoration: none; color: var(--ink); line-height: 1.3; }
.day a:hover { text-decoration: underline; }
.day a small { color: var(--muted); display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 12px; }
@media (max-width: 700px) { .cal { grid-template-columns: 1fr; } .cal .dow, .day.blank { display: none; } .day { min-height: 0; } }

.signin { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.people { display: flex; flex-direction: column; gap: 6px; max-height: 330px; overflow: auto; }
.people button { text-align: left; }
.people button span { color: var(--muted); font-size: 12.5px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; flex: 1 1 150px; }
.stat b { display: block; font-size: 24px; line-height: 1.1; color: var(--accent); }
.stat span { font-size: 13px; color: var(--muted); }
