/* admin.css: the one look for every admin tool (the site admin page /account/admin.html and burgerchan's
   moderator page /burgerchan/mod.html). Loaded after /style.css (tan page, teal text, Meiryo) and, on burgerchan
   pages, after chan.css. The rules behind it are in DESIGN.md at the root of the website repo: change both together.

   Page layout, top to bottom:
     the site menu bar                     /core/menubar/menubar.js
     .banner   centered: .logo (the area: "burgersandwich.jp", "burgerchan") and h1 (the page), then a thin <hr>
     .tabs     centered tab buttons (role=tab, aria-selected); .tabs.sub is the smaller second row inside a tab;
               a.tablink at the end of the row goes to the other admin page (dashed border, "→")
     .who      "Signed in as ..." under the tabs, small and centered
     .panel    the tab's content, at most 1000px wide
   Inside a tab:
     .box            a light box with a thin border; its h2 is the box's title (teal, 16px, no dark title bar)
     .option         a checkbox (or other control) with a bold name and a .hint under it; options in one box are
                     separated only by a thin line
     .grid           a form: bold labels on the left, fields on the right (one column on phones)
     .row            a line of controls (fields, buttons, a .msg) that wraps
     table.list      a table, inside .tablewrap (grows past its box up to the screen's width; scrolls sideways only beyond that)
     .tagresult      the result box on /account/tag.html (a tapped NFC tag): centered, big symbol (.big), h2, text
     .notice         a centered message box (.notice.err for problems)
     .msg            the result of an action next to its button (.msg.ok green, .msg.err red)
     .hint / .muted / .small    small gray text / gray text / small text
     .tag            a small label (.tag.super .admin .trusted .banned .off .hp .prog .res .ign .lbl)
   Buttons are the browser's own, bold; .go is green (approve), .no / .danger red (delete, ban, reject).
   .cbtn and .btns are burgerchan's older names for a button and a .row: they look the same. */

:root {
  --ui-panel: #f6e8cf;     /* boxes and table rows: a lighter tan */
  --ui-border: #d4b98c;    /* every thin line */
  --ui-label: #e3c99c;     /* table headings, selected tab, tags */
  --ui-heading: #316563;   /* titles: the site's dark teal */
  --ui-text: #222;         /* typed text */
  --ui-input: #fffaf0;     /* fields */
  --ui-muted: #6f6a5c;
  --ui-hover: #f1dfbf;
  --ui-picked: #ead3a8;
  --ui-error: #a01010;
  --ui-ok: #1f5a14;
  --ui-accent: #a8420e;    /* burgerchan's burnt orange, for the odd thing that must stand out */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 14px; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------------------------------------------------------------- page */
.wrap { max-width: 1200px; margin: 0 auto; padding: 6px 10px 40px; }
.banner { text-align: center; margin: 12px 0 8px; }
.banner .logo { font-size: 44px; font-weight: bold; color: var(--ui-heading); text-decoration: none; }
.banner h1 { font-size: 28px; color: var(--ui-heading); margin: 4px 0; }
hr { border: 0; border-top: 1px solid var(--ui-border); margin: 10px 0; }
.panel { max-width: 1000px; margin: 0 auto; }
.who { text-align: center; font-size: 12px; color: var(--ui-muted); margin: -6px 0 12px; }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; justify-content: center; margin: 8px 0 14px; flex-wrap: wrap; }
.tabs button { background: var(--ui-panel); border: 1px solid var(--ui-border); padding: 5px 14px; cursor: pointer; color: var(--ui-heading); font-weight: normal; }
.tabs button:hover { background: var(--ui-hover); }
.tabs button[aria-selected=true] { background: var(--ui-label); font-weight: bold; border-color: var(--ui-heading); }
.tabs a.tablink { border: 1px dashed var(--ui-border); padding: 5px 14px; color: var(--ui-heading); text-decoration: none; margin-left: 8px; }
.tabs a.tablink:hover { background: var(--ui-hover); }
.tabs.sub { margin: 0 0 12px; }
.tabs.sub button { padding: 3px 10px; font-size: 13px; }

/* ---------------------------------------------------------------- boxes */
.box, .boardedit { background: var(--ui-panel); border: 1px solid var(--ui-border); padding: 10px 14px; margin: 10px 0; }
.box > h2, .boardedit > h3 { margin: 0 0 8px; font-size: 16px; color: var(--ui-heading); }
.box h3, .item h3 { margin: 12px 0 4px; font-size: 14px; color: var(--ui-heading); }
.box > p:first-of-type { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }

/* a checkbox with a name and a hint; several in one box are split by thin lines */
.option { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--ui-border); cursor: pointer; }
.box > h2 + .option, .option:first-child { border-top: 0; padding-top: 2px; }
.option > input[type=checkbox] { width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
.option .text b { display: block; color: var(--ui-heading); }
.option .text .hint { display: block; }
.option .saved { margin-left: auto; font-size: 12px; color: var(--ui-muted); white-space: nowrap; }
div.option { cursor: default; }

/* ---------------------------------------------------------------- forms */
.grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 10px; align-items: center; }
.grid > label, .grid > b { font-weight: bold; color: var(--ui-heading); }
.grid label.check { font-weight: normal; display: block; color: inherit; }
.grid label.check input { margin-right: 4px; }
.grid input[type=text], .grid input[type=number], .grid textarea, .grid select { width: 100%; max-width: 420px; }
.grid textarea { height: 60px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  border: 1px solid var(--ui-border); padding: 3px 5px; background: var(--ui-input); color: var(--ui-text); max-width: 100%;
}
textarea { width: 100%; min-height: 60px; resize: vertical; }
.row, .btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
label { cursor: pointer; }

/* ---------------------------------------------------------------- buttons */
button { padding: 4px 14px; font-weight: bold; cursor: pointer; }
button.go { color: var(--ui-ok); }
button.no, button.danger { color: var(--ui-error); }
button:disabled { opacity: 0.5; cursor: default; }
button[aria-pressed=true] { background: var(--ui-label); border: 1px solid var(--ui-heading); }
.cbtn { padding: 4px 14px; font-weight: bold; cursor: pointer; }
.cbtn.go { color: var(--ui-ok); }
.cbtn.no { color: var(--ui-error); }

/* ---------------------------------------------------------------- text */
.notice { margin: 10px auto; max-width: 640px; padding: 8px 12px; background: var(--ui-panel); border: 1px solid var(--ui-border); text-align: center; }
.notice.err { color: var(--ui-error); }
.box .notice { max-width: none; text-align: left; }
.msg { margin-left: 8px; font-size: 13px; }
.msg.ok, .good { color: var(--ui-ok); }
.msg.err, .bad { color: var(--ui-error); }
.hint { font-size: 12px; color: var(--ui-muted); }
.muted { color: var(--ui-muted); }
.small { font-size: 12px; }
.rules { text-align: center; font-size: 12px; color: var(--ui-muted); margin-bottom: 6px; }
.empty { color: var(--ui-muted); font-style: italic; }

/* ---------------------------------------------------------------- tables */
/* A table wider than its box grows past it (centered), up to the width of the screen, and only as wide as it
   needs; it scrolls sideways only when even that isn't enough (phones). */
.tablewrap { overflow-x: auto; margin: 6px 0; width: max-content; min-width: 100%; max-width: calc(100vw - 40px);
  position: relative; left: 50%; transform: translateX(-50%); box-sizing: border-box; }
/* Inside a .box, the box grows with it instead (same rule: centered, up to the screen's width, only as wide as the
   widest table needs), so the table never sticks out past the box's background. The box's other contents
   (paragraphs, headings, forms) don't count toward its width (contain: inline-size); they just fill it. */
.box:has(> .tablewrap) { width: max-content; min-width: 100%; max-width: calc(100vw - 40px); position: relative; left: 50%;
  transform: translateX(-50%); box-sizing: border-box; }
.box:has(> .tablewrap) > :not(.tablewrap) { contain: inline-size; }
.box > .tablewrap { left: 0; transform: none; width: auto; min-width: 0; max-width: 100%; }
table.list { border-collapse: collapse; width: 100%; background: var(--ui-panel); border: 1px solid var(--ui-border); }
table.list th, table.list td { text-align: left; padding: 5px 8px; border-top: 1px solid var(--ui-border); vertical-align: top; white-space: nowrap; }
table.list th { background: var(--ui-label); color: var(--ui-heading); border-top: 0; }
table.list td.wrap-text { white-space: normal; min-width: 220px; overflow-wrap: anywhere; }
table.list td button { font-size: 13px; padding: 2px 8px; margin: 1px 2px; }
table.list th.sortable { cursor: pointer; user-select: none; }
table.list th.sortable:hover { text-decoration: underline; }
table.list tr.pick { cursor: pointer; }
table.list tr.pick:hover td { background: var(--ui-hover); }
table.list tr.picked td { background: var(--ui-picked); }

/* ---------------------------------------------------------------- tags */
/* A waiting count in brackets, "Feedback (4)": bold red (DESIGN.md "Waiting counts"). The menu bar uses #ff6b6b. */
.count { font-weight: bold; color: #c8102e; }
.tag { display: inline-block; font-size: 11px; font-weight: bold; padding: 1px 6px; border-radius: 3px; margin-right: 3px; white-space: nowrap; vertical-align: middle; }
.tag.super { background: #7a2e6e; color: #fff; }
.tag.admin, .tag.prog { background: var(--ui-heading); color: #edd5af; }
.tag.banned, .tag.hp { background: var(--ui-error); color: #fff; }
.tag.res { background: #5a7a2a; color: #fff; }
.tag.trusted { background: #1d6f8a; color: #fff; }
.tag.off, .tag.ign { background: #888; color: #fff; }
.tag.lbl { background: var(--ui-label); color: var(--ui-heading); }

/* ---------------------------------------------------------------- list items that open (feedback, review queue) */
.item { background: var(--ui-panel); border: 1px solid var(--ui-border); margin: 6px 0; }
.item.closed { opacity: 0.6; }
.item > .head { display: flex; gap: 8px; align-items: baseline; padding: 6px 10px; cursor: pointer; flex-wrap: wrap; }
.item > .head:hover { background: var(--ui-hover); }
.item > .head .num { font-weight: bold; min-width: 3em; }
.item > .head .ttl { flex: 1; min-width: 200px; font-weight: bold; color: var(--ui-heading); }
.item > .head .by { font-size: 12px; color: var(--ui-muted); }
.item > .body { border-top: 1px solid var(--ui-border); padding: 8px 10px 12px; background: var(--ui-input); }
.thread-msg { margin: 6px 0; padding: 6px 8px; background: #fff; border: 1px solid var(--ui-border); white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-msg.admin { border-left: 4px solid var(--ui-heading); }
.thread-msg .by { font-size: 12px; font-weight: bold; margin-bottom: 2px; white-space: normal; }
.event { font-size: 12px; font-style: italic; color: var(--ui-muted); margin: 4px 0 4px 8px; }

/* burgerchan's review queue and reports */
.qitem { background: var(--ui-panel); border: 1px solid var(--ui-border); margin: 10px 0; padding: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.qitem .qimg { flex: none; width: 260px; }
.qitem .qimg img { max-width: 260px; max-height: 260px; display: block; background: repeating-conic-gradient(#ddd 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.qitem .qbody { flex: 1; min-width: 240px; }
.qitem blockquote { margin: 6px 0; }
.qitem ul { margin: 2px 0 4px; padding-left: 18px; }

/* ---------------------------------------------------------------- the account details and actions (Accounts tab) */
.actions { display: grid; gap: 10px; margin-top: 10px; }
.actions .act { border-top: 1px solid var(--ui-border); padding-top: 8px; }
.actions .act h3 { margin: 0 0 4px; }

/* ---------------------------------------------------------------- the map (Map tab) */
.mapbox { height: 380px; border: 1px solid var(--ui-border); margin: 8px 0; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #888; vertical-align: middle; }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .banner .logo { font-size: 34px; }
  .qitem .qimg, .qitem .qimg img { width: 100%; max-width: 100%; }
}

/* ---------------------------------------------------------------- profiles (/u/<name> and the profile editor)
   Public pages built from the same pieces: .box, .hint, .row, .msg, .notice. Two columns on wide screens: the
   card on the left (picture, name, mood, status, song, achievements), the custom part and the profile book on the
   right; one column on phones. */
.profile { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0 16px; align-items: start; }
.profile .card { text-align: center; }
.avatar { width: 200px; height: 200px; object-fit: cover; border: 1px solid var(--ui-border); background: var(--ui-input); display: block; margin: 4px auto 8px; }
.avatar.small { width: 48px; height: 48px; margin: 0; display: inline-block; vertical-align: middle; }
.profile .card h1 { font-size: 24px; color: var(--ui-heading); margin: 0 0 2px; overflow-wrap: anywhere; }
.profile .card h1 .verified { display: inline-block; margin-left: 6px; vertical-align: 1px; white-space: nowrap; } /* admins and trusted accounts */
.mood { font-style: italic; margin: 2px 0 8px; overflow-wrap: anywhere; }
.status { font-size: 13px; margin: 2px 0; }
.status .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2a9d3a; margin-right: 5px; vertical-align: middle; }
.facts { text-align: left; margin: 8px 0 0; }
/* a fixed line height keeps every row the same height whatever font the profile uses (Edit profile -> Page
   style): a character the font doesn't have (the ฿ of burgerbux) comes from a fallback font, whose own spacing
   would otherwise make that row taller */
.facts div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; line-height: 17px; border-top: 1px solid var(--ui-border); }
.facts div:first-child { border-top: 0; }
.facts b { color: var(--ui-heading); }
.bar { height: 10px; background: var(--ui-input); border: 1px solid var(--ui-border); margin-top: 4px; }
.bar > i { display: block; height: 100%; background: var(--ui-heading); }
/* (inside .facts, whose rows are divs with padding: the bar keeps its own height, or the fill shrinks to nothing) */
.facts div.bar { display: block; padding: 0; border: 1px solid var(--ui-border); }
/* rows with a progress bar: the label and number over the bar; no line between two of them */
.facts div.barrow { display: block; }
.facts div.barrow + div.barrow { border-top: 0; padding-top: 6px; }
.song audio { width: 100%; margin-top: 4px; }
/* The stamp book (profiles): stamps pressed straight onto the page, no box; /core/script/stamps.js draws them. */
.stampsec { margin: 22px 0 10px; text-align: center; }
.stampsec > h2 { color: var(--ui-heading); font-size: 18px; margin: 0 0 4px; }
.stampsec > .hint { margin: 0 0 6px; }
.stampbook { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; padding: 8px 0 14px; }
.stampcell { width: 170px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 4px; font: inherit; cursor: zoom-in; }
.stampcell .t { max-width: 150px; font-size: 12px; font-weight: bold; color: var(--ui-heading); text-align: center; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
.stampcell .new { font: bold 10px/1 Tahoma, sans-serif; color: #fff; background: #c8102e; padding: 2px 5px; border-radius: 3px; letter-spacing: .05em; }
/* choosing the square part of a new profile picture (/core/script/crop.js): always in the site's own look */
.cropview { position: fixed; inset: 0; z-index: 2147483600; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cropview .card { background: #fbf6ea; border: 1px solid var(--ui-border); padding: 18px 20px; max-width: 520px; }
.cropview h2 { margin: 0 0 10px; color: var(--ui-heading); font-size: 18px; }
.cropview .parts { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cropview .stage { display: block; cursor: grab; touch-action: none; outline-offset: 2px; }
.cropview .stage.moving { cursor: grabbing; }
.cropview .side .label { font-size: 12px; color: var(--ui-muted); margin-bottom: 4px; }
.cropview .prev { display: block; border: 1px solid var(--ui-border); }
.cropview .zoom { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; font-weight: bold; color: var(--ui-heading); }
.cropview .zoom input { flex: 1; }
.cropview .hint { margin: 4px 0 10px; }
.stampview { position: fixed; inset: 0; z-index: 2147483600; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.stampview .card { background: #fbf6ea; border: 1px solid var(--ui-border); padding: 22px; text-align: center; max-width: 420px; display: flex; flex-direction: column; align-items: center; }
.stampview h2 { margin: 14px 0 4px; color: var(--ui-heading); font-size: 18px; }
.stampview p { margin: 4px 0; }
.stampview .card > button { margin-top: 12px; }
.stampview .tools { margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.stampview .swatches { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 360px; }
.stampview .sw { width: 26px; height: 26px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); cursor: pointer; }
.stampview .sw:not([style]) { width: auto; border-radius: 13px; padding: 0 10px; font-size: 12px; background: #fff; }
.stampview .sw.on { box-shadow: 0 0 0 3px var(--ui-heading); }
.achievement { text-align: left; padding: 6px 0; border-top: 1px solid var(--ui-border); }
.achievement:first-of-type { border-top: 0; }
.achievement b { display: block; color: var(--ui-heading); }
.profileframe { width: 100%; height: 160px; border: 0; display: block; background: #fff; }
.framebox { padding: 0; overflow: hidden; }
.framebox > .hint, .framebox > .notice { margin: 8px 12px; }
.entry { padding: 8px 0; border-top: 1px solid var(--ui-border); }
.entry:first-of-type { border-top: 0; }
.entry .by { font-size: 12px; color: var(--ui-muted); }
.entry .by a { font-weight: bold; }
.entry .text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.entry .tools { float: right; font-size: 12px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; font-weight: normal; color: var(--ui-heading); text-decoration: underline; cursor: pointer; }
.linkbtn.danger { color: var(--ui-error); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photos figure { margin: 0; background: var(--ui-input); border: 1px solid var(--ui-border); padding: 6px; }
.photos img { width: 100%; height: 110px; object-fit: cover; display: block; }
.photos input { width: 100%; font-size: 11px; margin: 4px 0; }
.code { font-family: Consolas, "Courier New", monospace; font-size: 13px; width: 100%; min-height: 380px; white-space: pre; tab-size: 2; }
.problems { color: var(--ui-error); margin: 6px 0; padding-left: 20px; }
table.list.leaderboard td { vertical-align: middle; }
/* everything centered but the profile column */
table.list.leaderboard th, table.list.leaderboard td { text-align: center; }
table.list.leaderboard th:nth-child(2), table.list.leaderboard td:nth-child(2) { text-align: left; }
table.list.leaderboard .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2a9d3a; margin-right: 5px; vertical-align: middle; }
table.list.leaderboard .avatar.small { width: 28px; height: 28px; }
.problems li { margin: 3px 0; }
/* the profile picture with its hat (/core/script/profile-look.js puts the hat over the top-right corner) */
.avatarwrap { position: relative; width: 200px; height: 200px; margin: 4px auto 8px; }
.avatarwrap > .avatar { margin: 0; }
/* a profile with its owner's page style (.looked; the colors are the --ui-* variables set on #app) */
.looked .profileframe { background: transparent; }
/* inside boxes, the text colors worked out for the box's own color (profile-look.js: readable on what it sits on) */
.looked .box { --text: var(--pb-text); --ui-heading: var(--pb-heading); --ui-muted: var(--pb-muted); --link: var(--pb-link); --link-visited: var(--pb-link);
  --link-active: var(--pb-link); --ui-error: var(--pb-error); --ui-ok: var(--pb-ok); color: var(--pb-text); }
.looked .bar { background: transparent; }
.looked.c-rounded .box, .looked.c-rounded .notice { border-radius: 8px; }
.looked.c-round .box, .looked.c-round .notice { border-radius: 18px; }
.looked .hl { background: var(--p-hl); -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .12em; border-radius: 2px; }
/* Edit profile: the page style's swatches and preview, and the hat picker */
.styleform .swrow { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.styleform .sw { width: 24px; height: 24px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); cursor: pointer; }
.styleform .sw.word { width: auto; border-radius: 12px; padding: 0 9px; font-size: 12px; font-weight: normal; background: #fff; }
.styleform .sw.on { box-shadow: 0 0 0 3px var(--ui-heading); }
.styleform .pick { font-weight: normal; }
.styleform .pick[aria-pressed=true] { font-weight: bold; }
.styleform .presets button { font-weight: normal; border: 1px solid var(--ui-border); }
.lookpreview { border: 1px solid var(--ui-border); margin-top: 8px; overflow: hidden; }
.lookpreview .mb { display: flex; align-items: center; gap: 18px; height: 34px; padding: 0 12px; font-size: 13px; }
.lookpreview .mb b { font-size: 14px; }
.lookpreview .mb .dd { padding: 2px 8px; margin-left: auto; }
.lookpreview .pg { padding: 10px; background-color: var(--bg); color: var(--text); }
.lookpreview .pg .box { margin: 0 0 8px; }
.lookpreview .pg h1 { font-size: 20px; margin: 0; color: var(--ui-heading); }
.hatpicks { display: flex; flex-wrap: wrap; gap: 8px; }
.hatpicks button { width: 96px; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; font-weight: normal; font-size: 12px; background: var(--ui-input); border: 1px solid var(--ui-border); padding: 6px 4px; position: relative; }
.hatpicks button[aria-pressed=true] { border: 2px solid var(--ui-heading); font-weight: bold; background: var(--ui-label); }
.hatpicks .thumb { width: 54px; height: 54px; position: relative; }
.hatpicks .new { position: absolute; top: 3px; right: 3px; font: bold 10px/1 Tahoma, sans-serif; color: #fff; background: #c8102e; padding: 2px 5px; border-radius: 3px; }
@media (max-width: 760px) {
  .profile { grid-template-columns: 1fr; }
}

/* The result box on /account/tag.html (what a tapped NFC tag gave). */
.tagresult { text-align: center; padding: 18px 14px; }
.tagresult .big { font-size: 46px; line-height: 1.1; margin: 4px 0 8px; }
.tagresult h2 { font-size: 22px; margin: 0 0 6px; }
.tagresult p { margin: 6px 0; }

/* ---- the Analytics tab (account/admin-analytics.js): stat tiles, line charts with a tooltip, share bars ---- */
.astats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.astat { background: var(--ui-input); border: 1px solid var(--ui-border); padding: 6px 8px; text-align: center; }
.astat .num { font-size: 20px; font-weight: bold; color: var(--ui-heading); line-height: 1.25; }
.astat .what { font-size: 12px; color: var(--ui-muted); }
.achart { position: relative; margin: 4px 0 8px; }
.achart-svg { width: 100%; }
.achart-svg svg { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.achart-svg svg:focus-visible { outline: 2px solid var(--ui-heading); outline-offset: 2px; }
.achart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin-bottom: 2px; }
.achart-legend i { display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; }
.achart-tip { position: absolute; z-index: 2; pointer-events: none; display: flex; flex-direction: column; gap: 1px; padding: 5px 8px; font-size: 12px;
  line-height: 1.35; white-space: nowrap; background: var(--ui-input); color: var(--ui-text); border: 1px solid var(--ui-heading); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.achart-tip[hidden] { display: none; }
.achart-tip b { color: var(--ui-heading); }
.abars { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.abar { display: grid; grid-template-columns: minmax(70px, 30%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.abar-key { overflow-wrap: anywhere; }
.abar-track { height: 10px; background: var(--ui-input); border: 1px solid var(--ui-border); }
.abar-fill { display: block; height: 100%; background: var(--ui-heading); }
.abar-n { font-size: 12px; color: var(--ui-muted); white-space: nowrap; }
.acols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .acols { grid-template-columns: 1fr; } }
.box h3 { font-size: 14px; color: var(--ui-heading); margin: 10px 0 4px; }
