/* 4Cee's admin console (/admin, Moe's 4Cee row 23): a top bar, the sections on the left and the section's content, in the
   app's own tokens and components (app.css). Every class here starts adm- or av-, so nothing in the app is touched. */
body.adm { margin: 0; display: block; min-height: 100vh; background: var(--bg); }
.adm-skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 8px 12px; background: var(--panel); border-radius: 8px; } .adm-skip:focus { left: 12px; }
.adm-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 max(18px, env(safe-area-inset-right, 0px)) 0 max(18px, env(safe-area-inset-left, 0px)); background: var(--panel); border-bottom: 1px solid var(--line); }
.adm-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); white-space: nowrap; }
.adm-tag { margin-left: 6px; font: 600 10.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; }
.adm-env { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.adm-grow { flex: 1; }
.adm-stamp { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.adm-menu { all: unset; display: none; box-sizing: border-box; width: 38px; height: 38px; border-radius: 9px; place-items: center; cursor: pointer; color: var(--fg); }
.adm-menu svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.adm-menu:hover { background: var(--panel-2); } .adm-menu:focus-visible { outline: 2px solid var(--accent); }
.adm-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 58px); }
/* The menu's column keeps its color and edge down the whole page, however long the section. */
@media (min-width: 961px) { .adm-shell { background: linear-gradient(90deg, var(--panel) 0 235px, var(--line) 235px 236px, transparent 236px); } .adm-nav { border-right: 0; background: none; } }
.adm-nav { position: sticky; top: 58px; align-self: start; height: calc(100vh - 58px); overflow: auto; padding: 14px 12px 24px; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.adm-nav .grp { font: 600 10.5px var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
.adm-nav .grp:first-child { padding-top: 4px; }
.adm-nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 500; }
.adm-nav a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.adm-nav a:hover { background: var(--panel-2); color: var(--fg); }
.adm-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.adm-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.adm-nav .badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 10px; font-size: 11.5px; font-weight: 700; text-align: center; background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); }
.adm-nav .badge.warn { background: var(--warn-soft); color: var(--s2); }
.adm-scrim { display: none; }
.adm-main { padding: 26px max(20px, env(safe-area-inset-right, 0px)) 64px 30px; display: flex; flex-direction: column; gap: 18px; min-width: 0; max-width: 1320px; outline: none; }
.adm-loading { color: var(--muted); }

/* a section's head */
.adm-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.adm-h h1 { margin: 0; font: 600 26px/1.15 var(--head); letter-spacing: -.015em; display: flex; align-items: center; gap: 8px; }
.adm-h h1 .help { margin-top: 3px; }
.adm-h p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 72ch; }
.adm-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adm-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.adm-stack { display: flex; flex-direction: column; gap: 18px; }
.adm-meter { display: flex; flex-direction: column; gap: 6px; }
.adm-meter-t { height: 10px; border-radius: 5px; background: var(--panel-2); overflow: hidden; }
.adm-meter-t i { display: block; height: 100%; border-radius: 5px; background: var(--s1); }
.adm-meter-t i.some { background: var(--s2); } .adm-meter-t i.neg { background: var(--down); } .adm-meter-t i.pos { background: var(--up); }
.adm-meter-l { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.adm .panel { margin: 0; }
.adm .panel-h .h2 { display: flex; align-items: center; gap: 7px; }

/* tiles */
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
@media (min-width: 961px) { .adm-tiles.n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .adm-tiles.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .adm-tiles.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.adm-tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 15px 16px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--fg); transition: border-color .12s, box-shadow .12s; }
a.adm-tile:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 4px 14px rgba(15, 20, 26, .07); }
.adm-tile-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.adm-tile-h > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-tile b { font: 600 24px/1.15 var(--head); letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.adm-tile small { color: var(--muted); font-size: 12.5px; }
.adm-tile .adm-tile-v { min-height: 0; }
.adm-tile .adm-tile-l { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-key-k { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: var(--muted); }
.adm-key-k i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: -.5px; }
.adm-key-k i.pos { background: var(--up); } .adm-key-k i.some { background: var(--s2); } .adm-key-k i.neg { background: var(--down); } .adm-key-k i.none { background: color-mix(in srgb, var(--muted) 38%, transparent); }

/* pills and dots */
.adm .ev-pill { white-space: nowrap; }
.ev-pill.s1 { color: var(--s1); background: color-mix(in srgb, var(--s1) 11%, transparent); }
.adm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: color-mix(in srgb, var(--muted) 45%, transparent); }
.adm-dot.pos { background: var(--up); } .adm-dot.neg { background: var(--down); } .adm-dot.some { background: var(--s2); } .adm-dot.s1 { background: var(--s1); }

/* lists */
.adm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.adm-list li { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.adm-list li:first-child { border-top: 0; padding-top: 2px; }
.adm-list .adm-dot { margin-top: 6px; }
.adm-list .grow { flex: 1; min-width: 0; } .adm-list small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.adm-list a { color: var(--accent); font-weight: 500; } .adm-list a:hover { text-decoration: underline; }
.adm-empty { margin: 0; padding: 18px 8px; text-align: center; color: var(--muted); font-size: 13.5px; }
.adm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; background: var(--panel); }
.adm-chip:hover { border-color: var(--muted); }
.adm-glance { display: flex; flex-direction: column; gap: 14px; }
.adm-gl-h { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.adm-meta { font-size: 12.5px; color: var(--muted); }

/* tables */
.adm-tbl { overflow-x: auto; margin: 0 -4px; }
.adm-tbl table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.adm-tbl th, .adm-tbl td { text-align: left; padding: 10px; border-top: 1px solid var(--line); vertical-align: top; }
.adm-tbl th { font-size: 12px; color: var(--muted); font-weight: 600; border-top: 0; white-space: nowrap; padding-top: 2px; }
.adm-tbl td.num, .adm-tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-tbl td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.adm-tbl tfoot td { font-weight: 600; border-top: 1px solid color-mix(in srgb, var(--muted) 40%, var(--line)); }
.adm-tbl .nowrap { white-space: nowrap; }
.adm-tbl .adm-pills { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.adm-tbl .said { color: var(--muted); font-size: 12.5px; }
.adm-tbl tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.adm-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; overflow-wrap: anywhere; }

/* charts */
.adm-chart { width: 100%; height: auto; display: block; overflow: visible; }
.adm-chart .bar { fill: color-mix(in srgb, var(--s1) 50%, transparent); } .adm-chart .bar.today { fill: var(--s1); }
.adm-chart .ax { fill: var(--muted); font: 11px var(--sans); } .adm-chart .grid { stroke: var(--line); stroke-dasharray: 2 3; }
.adm-hbars { display: flex; flex-direction: column; gap: 9px; }
.adm-hbar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 56px; gap: 12px; align-items: center; font-size: 13px; }
.adm-hbar .t { height: 10px; border-radius: 5px; background: var(--panel-2); overflow: hidden; } .adm-hbar .t i { display: block; height: 100%; border-radius: 5px; background: var(--s1); }
.adm-hbar b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.adm-runs { display: flex; gap: 3px; align-items: flex-end; height: 34px; }
.adm-runs i { width: 9px; border-radius: 2px; background: var(--up); } .adm-runs i.bad { background: var(--down); } .adm-runs i.skip { background: color-mix(in srgb, var(--muted) 40%, transparent); }

/* forms */
.adm-in { box-sizing: border-box; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg); font: 400 13.5px var(--sans); min-width: 0; }
.adm-in:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; border-color: var(--accent); }
.adm-in.money { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.adm-msg { font-size: 13px; min-height: 1.2em; margin: 0; color: var(--muted); } .adm-msg.ok { color: var(--up); } .adm-msg.bad { color: var(--down); }
.adm .btn { white-space: nowrap; }
.adm .btn[disabled] { opacity: .55; cursor: default; }

/* keys */
.adm-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.adm-key { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.adm-kh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.adm-kh h2 { margin: 0; font: 600 16px var(--head); display: flex; align-items: center; gap: 7px; min-width: 0; }
.adm-key p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.adm-how { font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); display: flex; flex-direction: column; gap: 3px; }
.adm-how a { color: var(--accent); font-weight: 600; }
.adm-keyin { display: flex; gap: 8px; } .adm-keyin .adm-in { flex: 1; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }

/* limits */
.adm-limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px 28px; }
.adm-limit { display: flex; flex-direction: column; gap: 8px; }
.adm-limit label { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.adm-limit .adm-row small { color: var(--muted); font-size: 12px; }

/* the Copilot's settings */
.adm-form { display: flex; flex-direction: column; gap: 14px; }
.adm-f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.adm-f .adm-in { color: var(--fg); max-width: 320px; }
.adm-check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--fg); cursor: pointer; }
.adm-check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.adm-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.adm-fields .adm-f { padding-top: 10px; }
.adm-fields .adm-in.money { width: 120px; }

/* the lock */
.adm-lock { max-width: 420px; margin: 8vh auto 0; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.adm-lock h1 { margin: 0; font: 600 24px var(--head); }
.adm-lock p { margin: 0; color: var(--muted); font-size: 14px; }
.adm-lock form { display: flex; gap: 8px; width: 100%; }
.adm-lock .adm-in { flex: 1; height: 40px; font-size: 14px; }

/* the small pictures (admin-viz.js) */
.av { display: block; width: 100%; height: auto; max-height: 44px; overflow: visible; }
.av-t { fill: var(--muted); font: 500 10.5px var(--sans); }
.av-bg { fill: var(--panel-2); }
.av-fill { fill: var(--up); } .av-fill.s1 { fill: var(--s1); } .av-fill.some { fill: var(--s2); } .av-fill.neg { fill: var(--down); }
.av-part.s1 { fill: var(--s1); } .av-part.s2 { fill: var(--s2); } .av-part.s3 { fill: var(--s3); } .av-part.pos { fill: var(--up); } .av-part.none { fill: color-mix(in srgb, var(--muted) 40%, transparent); }
.av-unit.pos { fill: var(--up); } .av-unit.neg { fill: var(--down); } .av-unit.some { fill: var(--s2); } .av-unit.none { fill: color-mix(in srgb, var(--muted) 30%, transparent); }
.av-bar { fill: color-mix(in srgb, var(--s1) 42%, transparent); } .av-bar.on { fill: var(--s1); }
.av-bar.neg { fill: color-mix(in srgb, var(--down) 40%, transparent); } .av-bar.neg.on { fill: var(--down); }
.av-bar.pos { fill: color-mix(in srgb, var(--up) 40%, transparent); } .av-bar.pos.on { fill: var(--up); }

.adm-toast { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); z-index: 60; padding: 10px 14px; border-radius: 10px; background: var(--fg); color: var(--bg); font-size: 13.5px; box-shadow: var(--pop); max-width: min(420px, calc(100vw - 36px)); }
.adm-toast[hidden] { display: none; }

@media (max-width: 1100px) { .adm-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 960px) {
  .adm-shell { grid-template-columns: minmax(0, 1fr); }
  .adm-menu { display: inline-grid; margin-left: -8px; }
  .adm-nav { position: fixed; top: 58px; left: 0; bottom: 0; width: 260px; height: auto; z-index: 40; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--pop); }
  .adm-nav.open { transform: none; }
  .adm-scrim:not([hidden]) { display: block; position: fixed; inset: 58px 0 0; z-index: 35; background: rgba(15, 20, 26, .28); }
  .adm-main { padding: 20px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); }
  .adm-stamp { display: none; }
}
@media (max-width: 640px) {
  .adm-top { gap: 8px; padding: 0 12px; }
  .adm-env, .adm-open { display: none; }
  .adm-h h1 { font-size: 22px; }
  .adm-tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .adm-tile { padding: 13px 13px 12px; } .adm-tile b { font-size: 20px; }
  .adm-tile-h { flex-wrap: wrap; row-gap: 5px; } .adm-tile-h > span:first-child { white-space: normal; flex-basis: 100%; }
  .adm-tile .adm-tile-l, .adm-tile .adm-key-k { display: none; }
  .adm-hbar { grid-template-columns: 92px minmax(0, 1fr) 44px; gap: 8px; }
  .adm-tbl { margin: 0; overflow: visible; }
  .adm-tbl colgroup, .adm-tbl thead, .adm-tbl .sm-hide { display: none; }
  .adm-tbl table, .adm-tbl tbody, .adm-tbl tfoot { display: block; }
  .adm-tbl tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 18px; padding: 12px 0; border-top: 1px solid var(--line); }
  .adm-tbl tbody tr:first-child { border-top: 0; padding-top: 4px; }
  .adm-tbl tfoot tr { border-top: 1px solid color-mix(in srgb, var(--muted) 40%, var(--line)); }
  .adm-tbl td, .adm-tbl tfoot td { display: block; padding: 0; border: 0; text-align: left; white-space: normal; min-width: 0; }
  .adm-tbl td.num { text-align: left; }
  .adm-tbl td:first-child, .adm-tbl td.wide { flex-basis: 100%; }
  .adm-tbl td:empty { display: none; }
  .adm-tbl td[data-l]:not(:first-child)::before { content: attr(data-l); display: block; margin-bottom: 2px; font: 500 11px var(--sans); color: var(--muted); }
  .adm-tbl tbody tr:hover td { background: none; }
  .adm-lock form { flex-direction: column; }
}
@media (max-width: 380px) { .adm-tiles { grid-template-columns: minmax(0, 1fr); } .adm-tag { display: none; } }
@media (prefers-reduced-motion: reduce) { .adm-nav, .adm-tile { transition: none; } }
