:root {
  --ink: #0a0a0a;
  --panel: #141414;
  --panel-2: #1c1c1c;
  --rule: rgba(244, 241, 234, 0.12);
  --bone: #f4f1ea;
  --muted: #b9b5ae;
  --dim: #7d7a74;
  --amber: #f5b301;
  --amber-dim: rgba(245, 179, 1, 0.14);
  --red: #e5484d;
  --green: #46c37b;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  --radius: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--bone); }
body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--amber); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand span {
  font-family: var(--cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.16em; font-size: 15px;
}
.nav { display: flex; gap: 24px; font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; font-size: 14px; }
.nav a { text-decoration: none; padding: 8px 0; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--amber); }
@media (max-width: 560px) { .brand span { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background:
    radial-gradient(ellipse at 80% 0%, rgba(245, 179, 1, 0.12), transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(255, 255, 255, 0.05), transparent 50%),
    var(--ink);
}
.hero .inner { max-width: 1200px; margin: 0 auto; padding: 56px 20px 40px; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.24em; font-size: 13px; color: var(--amber);
}
.kicker::before { content: ""; width: 28px; height: 2px; background: var(--amber); }
.hero h1 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  line-height: 0.9; letter-spacing: -0.005em; margin: 14px 0 0;
  font-size: clamp(3.2rem, 11vw, 7.5rem);
}
.hero h1 .accent { color: var(--amber); display: block; }
.hero .tagline {
  margin-top: 22px; max-width: 560px; padding: 10px 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-family: var(--cond); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.2em; font-size: 14px; color: var(--muted);
}

/* ---------- ticker ---------- */
.ticker { background: var(--amber); color: var(--ink); overflow: hidden; white-space: nowrap; border-bottom: 1px solid #000; }
.ticker .track { display: inline-flex; animation: ticker 40s linear infinite; }
.ticker span { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; font-size: 13px; padding: 9px 18px; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker .track { animation: none; } }

/* ---------- layout ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 40px 20px 80px; }
.narrow { max-width: 820px; }
.section-label {
  display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px;
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1;
}
.section-label .num { font-family: var(--cond); font-weight: 700; color: var(--amber); font-size: 15px; letter-spacing: 0.2em; }
.step { margin-bottom: 44px; }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); }

/* ---------- form controls ---------- */
label.field { display: block; margin-bottom: 18px; }
label.field > .lbl, .lbl {
  display: block; margin-bottom: 8px;
  font-family: var(--cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 14px; color: var(--muted);
}
.lbl .req { color: var(--amber); }
.input, select.input, textarea.input {
  width: 100%; background: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 14px 16px; font-size: 17px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { min-height: 96px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--amber) 50%), linear-gradient(135deg, var(--amber) 50%, transparent 50%); background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 44px; }
.input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-dim); }
.input::placeholder { color: var(--dim); }
.input-unit { display: flex; align-items: center; gap: 10px; }
.input-unit .unit { font-family: var(--cond); font-weight: 700; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 16px; padding: 15px 28px; border-radius: var(--radius); cursor: pointer;
  border: 2px solid var(--amber); background: var(--amber); color: var(--ink);
  transition: transform 0.1s, background 0.15s, color 0.15s; text-decoration: none;
}
.btn:hover { background: #ffc426; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--bone); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn.small { padding: 9px 16px; font-size: 13px; }
.btn.danger { background: transparent; border-color: rgba(229, 72, 77, 0.5); color: var(--red); }
.btn.danger:hover { background: var(--red); color: var(--ink); }

/* ---------- task cards ---------- */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.task-card {
  position: relative; text-align: left; cursor: pointer; padding: 20px 20px 18px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.task-card:hover { border-color: rgba(245, 179, 1, 0.55); transform: translateY(-2px); }
.task-card[aria-pressed="true"] { border-color: var(--amber); background: linear-gradient(180deg, var(--amber-dim), var(--panel) 70%); }
.task-card[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 14px; right: 16px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--amber); color: var(--ink); font-weight: 700; font-size: 14px;
}
.task-card .area { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; font-size: 12px; color: var(--amber); }
.task-card .name { display: block; font-family: var(--display); font-size: 1.55rem; text-transform: uppercase; line-height: 1.05; margin: 6px 0 8px; }
.task-card .desc { color: var(--muted); font-size: 15px; line-height: 1.4; }
.task-card .meta { margin-top: 12px; font-family: var(--cond); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; color: var(--dim); }

/* ---------- checklist ---------- */
.progress-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.progress { flex: 1; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--amber); transition: width 0.25s; }
.progress-count { font-family: var(--display); font-size: 1.4rem; min-width: 64px; text-align: right; }
.checklist { list-style: none; margin: 0; padding: 0; }
.check-item { border-bottom: 1px solid var(--rule); }
.check-item:last-child { border-bottom: 0; }
.check-item label { display: flex; align-items: center; gap: 16px; padding: 16px 18px; cursor: pointer; transition: background 0.12s; }
.check-item label:hover { background: rgba(255, 255, 255, 0.02); }
.check-item input { position: absolute; opacity: 0; pointer-events: none; }
.check-item .box {
  flex: none; width: 28px; height: 28px; border: 2px solid var(--dim); border-radius: 3px;
  display: grid; place-items: center; transition: all 0.12s;
}
.check-item input:checked + .box { background: var(--amber); border-color: var(--amber); }
.check-item input:checked + .box::after { content: ""; width: 8px; height: 14px; border: solid var(--ink); border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check-item input:focus-visible + .box { box-shadow: 0 0 0 3px var(--amber-dim); }
.check-item input:checked ~ .text { color: var(--muted); }
.check-all { background: none; border: 0; color: var(--amber); cursor: pointer; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; padding: 4px 0; }

.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.fields-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .fields-grid { grid-template-columns: 1fr; } }

.submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid var(--rule); }
.submit-bar .hint { color: var(--muted); font-size: 15px; }
.error-msg { color: var(--red); font-weight: 600; margin: 12px 0 0; }
.hidden { display: none !important; }

/* ---------- success ---------- */
.success { text-align: center; padding: 56px 24px; }
.success .belt { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; background: var(--amber); color: var(--ink); display: grid; place-items: center; font-size: 34px; font-weight: 700; }
.success h2 { font-family: var(--display); text-transform: uppercase; font-size: clamp(2.4rem, 7vw, 4rem); line-height: 0.95; margin: 0 0 12px; }
.success p { color: var(--muted); margin: 0 auto 26px; max-width: 460px; }
.success .summary { display: inline-grid; grid-template-columns: auto auto; gap: 6px 22px; text-align: left; margin-bottom: 28px; font-size: 15px; }
.success .summary dt { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); font-size: 13px; }
.success .summary dd { margin: 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 28px 20px; text-align: center; color: var(--dim); font-family: var(--cond); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; }
.site-footer a { color: var(--muted); }

/* ---------- admin ---------- */
.login-card { max-width: 420px; margin: 40px auto; padding: 32px; }
.login-card h2 { font-family: var(--display); text-transform: uppercase; font-size: 2.2rem; margin: 0 0 6px; line-height: 1; }
.login-card p { color: var(--muted); margin: 0 0 22px; font-size: 15px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 18px 20px; }
.stat .k { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; color: var(--muted); }
.stat .v { font-family: var(--display); font-size: 2.4rem; line-height: 1.05; margin-top: 4px; }
.stat .v.amber { color: var(--amber); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px; margin-bottom: 14px; }
.toolbar label { flex: 1 1 160px; }
.toolbar .lbl { font-size: 12px; margin-bottom: 6px; }
.toolbar .input { padding: 10px 12px; font-size: 15px; }
.toolbar .actions { display: flex; gap: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--muted); }
.chip:hover { border-color: var(--amber); color: var(--amber); }
.chip[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--ink); }

.table-wrap { overflow-x: auto; }
table.log { width: 100%; border-collapse: collapse; font-size: 15px; }
table.log th {
  text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--rule); white-space: nowrap;
  font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; color: var(--muted);
}
table.log td { padding: 14px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.log tbody tr.row { cursor: pointer; transition: background 0.1s; }
table.log tbody tr.row:hover { background: rgba(255, 255, 255, 0.025); }
table.log tbody tr.row[aria-expanded="true"] { background: var(--panel-2); }
table.log .when { white-space: nowrap; }
table.log .when small { display: block; color: var(--dim); font-size: 13px; }
table.log .staff { font-weight: 600; }
table.log .task-name { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
table.log .details { color: var(--muted); max-width: 340px; }
.score { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-family: var(--cond); font-weight: 700; letter-spacing: 0.06em; }
.score .bar { width: 64px; height: 5px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.score .bar i { display: block; height: 100%; background: var(--amber); }
.score.full { color: var(--amber); }
.score.partial .bar i { background: var(--red); }
.score.partial { color: #ff8a8e; }
tr.detail td { background: var(--panel-2); padding: 4px 16px 22px; }
.detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid h4 { margin: 14px 0 10px; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; color: var(--amber); }
.detail-grid ul { list-style: none; margin: 0; padding: 0; }
.detail-grid li { display: flex; gap: 10px; padding: 4px 0; font-size: 15px; }
.detail-grid li .mark { flex: none; width: 18px; font-weight: 700; }
.detail-grid li.yes .mark { color: var(--green); }
.detail-grid li.no { color: #ff8a8e; }
.detail-grid dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; }
.detail-grid dt { color: var(--dim); }
.detail-grid dd { margin: 0; white-space: pre-wrap; }
.detail-actions { margin-top: 18px; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty strong { display: block; font-family: var(--display); font-size: 1.8rem; text-transform: uppercase; color: var(--bone); margin-bottom: 6px; font-weight: 400; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; color: var(--muted); font-size: 14px; }
.pager .btns { display: flex; gap: 8px; }
