/* MIRANDA admin console. Endless Games and Learning Lab tokens. */
:root {
  --surface: #ffffff;
  --raised: #f6f4fb;
  --ink: #231f20;
  --muted: #484848;
  --hairline: #e8e8e8;
  --border: #747474;
  --accent: #8c1d40;
  --on-accent: #ffffff;
  --deep: #2b0d1a;
  --deep-raised: #3b1728;
  --deep-line: #52283b;
  --mist: #f3f3f9;
  --mist-muted: #cbbfc6;
  --gold: #ffca38;
  --green: #78be20;
  --blue: #00a3e0;
  --orange: #ff7f32;
  --asu-gold: #ffc627;
  --black: #191919;
  --s-none: #f6f4fb;
  --s-detected: #f1d5df;
  --s-developing: #d98aa5;
  --s-learned: #b2456a;
  --s-mastered: #8c1d40;
  --font: "Neue Haas Grotesk Display Pro", "Neue Haas Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #2b0d1a;
    --raised: #3b1728;
    --ink: #f3f3f9;
    --muted: #cbbfc6;
    --hairline: #52283b;
    --border: #9a7d8a;
    --accent: #ffca38;
    --on-accent: #2b0d1a;
    --s-none: #3b1728;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--surface); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidenav { flex: 1 1 232px; background: var(--deep); color: var(--mist); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.brand { padding: 0 12px 20px; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--mist-muted); }
.nav-link { display: block; padding: 10px 12px; border-radius: 6px; color: var(--mist-muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-link:hover { background: var(--deep-raised); color: var(--mist); }
.nav-link[aria-current="page"] { background: var(--deep-raised); color: var(--gold); }
.nav-link:focus-visible { outline-color: var(--gold); }
.nav-back { margin-bottom: 12px; border: 1px solid var(--deep-line); }
/* Wide screens: the menu stays in view however long the page is. */
@media (min-width: 701px) { .sidenav { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; } }
.nav-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--deep-line); }
.who { padding: 8px 12px 0; font-size: 12px; color: var(--mist-muted); overflow-wrap: anywhere; }

.main { flex: 999 1 560px; min-width: 0; padding: 24px 40px 48px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 700px) { .main { padding: 20px 16px 40px; } }
.view { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

h1 { margin: 0; font-size: 36px; line-height: 1.05; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 17px; font-weight: 700; }
h3 { margin: 0; font-size: 15px; font-weight: 700; }
.lede { color: var(--muted); max-width: 72ch; margin: 6px 0 0; font-size: 14px; }
.caption { font-size: 12px; color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }

.scope-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding-bottom: 16px; border-bottom: 1px solid var(--hairline); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 12px; color: var(--muted); }
select, input[type="text"], input[type="search"], input[type="date"], textarea {
  min-height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); max-width: 100%;
}
textarea { padding: 8px 10px; min-height: 80px; }
.status { font-size: 13px; color: var(--muted); min-height: 1em; }
.status.error { color: #b8433a; }

.btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 8px 14px; min-height: 40px; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { min-height: 32px; padding: 4px 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }

.card { border: 1px solid var(--hairline); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.raised { background: var(--raised); }
.card.selected { border: 2px solid var(--accent); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tile { background: var(--raised); border: 1px solid var(--hairline); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.tile .k { font-size: 13px; font-weight: 500; color: var(--muted); }
.tile .v { font-size: 32px; font-weight: 500; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.split > .grow { flex: 999 1 520px; min-width: 0; }
.split > .side { flex: 1 1 300px; min-width: 0; }

.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 6px; white-space: nowrap; color: var(--black); background: var(--raised); border: 1px solid var(--hairline); }
.tag.anon { background: var(--deep); color: var(--mist); border-color: var(--deep); }
.tag.named { background: var(--asu-gold); border-color: var(--asu-gold); }
.tag.well, .tag.verified, .tag.ok { background: var(--green); border-color: var(--green); }
.tag.thin, .tag.warn { background: var(--asu-gold); border-color: var(--asu-gold); }
.tag.asserted { background: var(--surface); color: var(--ink); border: 1px dashed var(--border); }
.tag.bad { background: var(--orange); border-color: var(--orange); }
.tag.info { background: var(--blue); border-color: var(--blue); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.table-box { overflow-x: auto; border: 1px solid var(--hairline); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--hairline); }
th { font-size: 12px; font-weight: 500; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover, tr.active { background: var(--raised); }
.empty { padding: 20px; color: var(--muted); font-size: 14px; }

.bar-row { display: grid; grid-template-columns: minmax(100px, 200px) minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.bar { height: 12px; background: var(--raised); border-radius: 4px; overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--hairline); display: inline-block; }

.heatmap { border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.heatmap th { vertical-align: bottom; padding: 0 4px 6px; max-width: 120px; }
.heatmap th.row { text-align: left; padding: 0 8px 0 0; font-size: 13px; max-width: 200px; overflow-wrap: anywhere; color: var(--ink); }
.heatmap td { padding: 0; height: 34px; min-width: 70px; border: 0; border-radius: 4px; text-align: center; font-weight: 500; }
.heatmap td button { width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; color: inherit; font-weight: 500; }
.s-NONE { background: var(--s-none); }
.s-DETECTED { background: var(--s-detected); color: var(--black); }
.s-DEVELOPING { background: var(--s-developing); color: var(--black); }
.s-LEARNED { background: var(--s-learned); color: #ffffff; }
.s-MASTERED { background: var(--s-mastered); color: #ffffff; }

.trace { display: grid; grid-template-columns: minmax(120px, 1fr) 20px minmax(140px, 1.1fr) 20px minmax(170px, 1.3fr) 20px minmax(130px, 1fr); align-items: start; min-width: 700px; }
.trace .col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.trace .arrow { padding-top: 40px; text-align: center; color: var(--border); }
.node { border: 1px solid var(--hairline); border-radius: 10px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.node.root { border: 2px solid var(--accent); background: var(--raised); }
.node .n { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.node .m { font-size: 12px; color: var(--muted); }

dl.kv { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 13px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.check-list label { display: inline-flex; gap: 6px; align-items: center; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px; background: var(--deep); color: var(--mist); }
.bulk .btn { background: transparent; border-color: var(--mist-muted); color: var(--mist); }
.bulk .btn.primary { background: var(--gold); border-color: var(--gold); color: var(--black); }
.evidence { border: 1px solid var(--hairline); border-radius: 8px; padding: 10px 12px; font-size: 13px; background: var(--surface); }
.super-banner { padding: 10px 14px; border-radius: 8px; background: var(--asu-gold); color: var(--black); font-size: 13px; font-weight: 500; }
