:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  background: #100e16;
  color: #f2edf9;
  --surface: #181421;
  --border: #32283e;
  --muted: #b3a8c0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header, .intro, .toolbar, .brand, .actions, footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
header { min-height: 72px; padding: 12px max(24px, calc((100vw - 1320px) / 2)); background: #14111d; border-bottom: 1px solid var(--border); }
.brand { justify-content: start; letter-spacing: .08em; }
small, .mode, .eyebrow { display: block; color: var(--muted); font-size: .72rem; letter-spacing: .09em; }
.mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #743bd7; font-size: 1.4rem; font-weight: 900; }
.mode { color: #d5b8ff; background: #261936; padding: 8px 12px; border-radius: 30px; white-space: nowrap; }
main { max-width: 1368px; margin: auto; padding: 36px 24px; }
.eyebrow { color: #c69bff; font-weight: 700; margin: 0 0 6px; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.055em; }
h2 { margin: 0; font-size: 1.15rem; }
h3 { margin: 0; font-size: .92rem; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
#stats { margin: 28px 0 36px; }
.stat, .lane, dialog { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.stat { padding: 16px; }
.stat strong { display: block; margin-top: 8px; font-size: 1.8rem; }
.stat span, .lane h3 { color: var(--tone); }
.lane { padding: 13px; min-height: 225px; border-top: 2px solid var(--tone); }
.lane.over { outline: 2px solid var(--tone); }
.lane h3 { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 12px; }
[data-status="available"] { --tone: #70ddb4; }
[data-status="patrol"] { --tone: #c79aff; }
[data-status="response"] { --tone: #ffc480; }
[data-status="off"] { --tone: #bdb1cc; }
.card { background: #211a2d; border: 1px solid #3b2b4a; border-radius: 10px; padding: 12px; margin-bottom: 8px; overflow-wrap: anywhere; }
.card button { padding: 0; border: 0; background: none; color: #e5d1ff; font-weight: 750; text-align: left; }
.card p, .empty, #notice { color: var(--muted); font-size: .85rem; white-space: pre-wrap; }
.card p { margin: 6px 0 0; }
#notice { margin: 8px 0; }
button, input, select, textarea { font: inherit; color: inherit; border: 1px solid #4a385d; border-radius: 8px; background: #221a2d; padding: 9px 12px; }
button { cursor: pointer; }
button:hover { border-color: #c79aff; }
:focus-visible { outline: 2px solid #d4b1ff; outline-offset: 3px; }
.primary { background: #743bd7; border-color: #9860ef; color: white; font-weight: 700; }
.danger { color: #ffadbb; }
dialog { width: min(580px, calc(100% - 24px)); padding: 22px; }
dialog::backdrop { background: #09070dd9; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
label { display: grid; gap: 5px; font-size: .86rem; color: var(--muted); }
label > * { width: 100%; color: #f2edf9; }
.wide { grid-column: 1 / -1; }
footer .actions { margin-left: auto; gap: 8px; }
#form-error { color: #ffadbb; }
.login-panel { max-width: 460px; padding: 28px; margin: 8vh auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.login-panel h1 { font-size: 2rem; }
.login-panel label { margin-top: 16px; }
.login-panel button { width: 100%; margin-top: 20px; }
#login-error { color: #ffadbb; margin-bottom: 0; }
button:disabled { opacity: .65; cursor: wait; }
.module-nav { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; margin-bottom: 26px; border-bottom: 1px solid var(--border); }
.module-nav button[aria-pressed="true"] { background: #33214c; border-color: #9d66eb; color: #e5d1ff; }
.dossier-toolbar { margin-top: 24px; color: var(--muted); }
.dossier-toolbar input { width: min(100%, 380px); }
.dossier-list { display: grid; gap: 8px; }
.dossier-row, .audit-row { display: grid; gap: 5px; padding: 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-align: left; overflow-wrap: anywhere; }
.dossier-row strong { color: #e5d1ff; }
.dossier-row span, .audit-row span, #dossier-notice { color: var(--muted); }
#dossier-detail, #dossier-editor { max-height: calc(100% - 24px); overflow: auto; }
#detail-body { margin: 16px 0; overflow-wrap: anywhere; }
#detail-body dl { display: grid; gap: 10px; margin: 0 0 16px; }
#detail-body dt { color: var(--muted); font-size: .8rem; }
#detail-body dd { margin: 3px 0 0; white-space: pre-wrap; }
#detail-body section { margin: 16px 0; }
#detail-body section button { display: block; text-align: left; margin-top: 6px; }
#dossier-error, #detail-error { color: #ffadbb; }
@media (max-width: 850px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) {
  main { padding: 24px 14px; }
  header { padding-inline: 14px; }
  .login-panel { margin: 28px 14px; }
  #account { flex-direction: column; align-items: flex-end; gap: 6px; }
  .intro, .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar .actions { width: 100%; gap: 6px; flex-wrap: wrap; }
  .toolbar input { flex: 1; min-width: 160px; }
  #board { grid-template-columns: 1fr; }
  .lane { min-height: 105px; }
  footer { flex-wrap: wrap; }
}
