:root {
  color-scheme: dark;
  --ink: #eff3f4;
  --muted: #a6b6bd;
  --bg: #111719;
  --panel: #1b2327;
  --float: #232d32;
  --line: #344249;
  --accent: #84e0c0;
  --warn: #ffcf91;
  --error: #ffb3ae;
  font: 15px/1.45 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, select, input, textarea { font: inherit; color: inherit; }
button, select, input, textarea {
  border: 1px solid var(--line); border-radius: .45rem; background: var(--float); padding: .52rem .72rem;
}
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .48; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
textarea { min-height: 6rem; resize: vertical; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0 0 .65rem; }
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 660; letter-spacing: -.035em; }
h2 { font-size: 1.24rem; }
h3 { font-size: 1.06rem; }
small, .muted { color: var(--muted); }
.topbar { border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 1.2rem; background: #151d20; }
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; font-weight: 680; }
.brand span:last-child { color: var(--muted); font-weight: 500; }
.mark { background: var(--accent); color: #12201e; border-radius: .4rem; padding: .25rem .43rem; font-size: .75rem; }
#layout { display: flex; min-height: calc(100vh - 62px); }
aside { border-right: 1px solid var(--line); width: 13.5rem; flex: 0 0 13.5rem; background: #151d20; padding: 1rem; }
nav { display: grid; gap: .25rem; }
nav button { text-align: left; background: transparent; border-color: transparent; }
nav button[aria-current="page"] { background: #263934; color: var(--accent); }
main { flex: 1; min-width: 0; max-width: 100rem; margin-inline: auto; padding: clamp(1rem, 3.2vw, 2.8rem); }
.row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: grid; align-content: start; gap: .8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; margin-top: 1rem; }
.stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); margin-bottom: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: .7rem; padding: 1rem; min-width: 0; }
.metric { font-size: 1.55rem; font-weight: 670; font-variant-numeric: tabular-nums; }
.primary { background: var(--accent); color: #14241f; font-weight: 680; border-color: transparent; }
.primary:hover { background: #a0ebd2; }
.status { display: inline-block; border-radius: 1rem; padding: .2rem .55rem; font-size: .78rem; background: var(--float); }
.status.approved, .status.completed { color: var(--accent); }
.status.rejected, .status.failed { color: var(--error); }
.status.stale, .status.revision_requested { color: var(--warn); }
progress { accent-color: var(--accent); height: .7rem; width: 100%; }
label { display: grid; gap: .3rem; color: var(--muted); }
label.checkbox { display: flex; align-items: center; }
form { display: grid; gap: .72rem; }
details { min-width: 0; }
summary { cursor: pointer; padding: .28rem 0; color: var(--accent); }
img, video, audio { width: 100%; display: block; border-radius: .4rem; }
img, video { max-height: 28rem; object-fit: contain; background: #101517; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: .65rem; background: #12191b; border-radius: .4rem; }
dt { color: var(--muted); }
dd { margin: 0 0 .55rem; overflow-wrap: anywhere; }
dialog { border: 1px solid var(--line); border-radius: .8rem; background: var(--panel); color: var(--ink);
  padding: 1.3rem; width: min(92vw, 44rem); max-height: 86vh; }
dialog::backdrop { background: rgb(0 0 0 / 65%); }
#notices { position: fixed; right: 1rem; bottom: 1rem; max-width: min(90vw, 34rem); z-index: 4; }
#notices:empty { display: none; }
#notices p { padding: .8rem 1rem; margin: 0; background: var(--float); border: 1px solid var(--accent); border-radius: .5rem; }
.login { width: min(30rem, 100%); margin: 8vh auto; }
.timeline { overflow-x: auto; display: flex; gap: .5rem; padding-bottom: .6rem; }
.timeline button { min-width: 9rem; flex: 1 0 auto; }
.timeline button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
@media (max-width: 780px) {
  #layout { display: block; }
  aside { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .45rem .65rem; }
  nav { display: flex; overflow-x: auto; }
  nav button { white-space: nowrap; }
  .topbar { padding: .7rem; }
}
