:root {
    /* Tells the browser to paint its own native form-control chrome (the <select> option list,
       scrollbars, etc.) using its built-in dark palette instead of the default light one -- the
       option list itself is OS-drawn and ignores ordinary CSS, so without this it stayed white
       even once the closed <select> box was fully dark-themed. */
    color-scheme: dark;

    /* The one monospace stack for anything showing a key, a hint or other fixed-width value
       (license keys, request IDs, hardware IDs...). Several rules below reference this through
       var(--font-mono, ui-monospace, monospace) -- defining it here, matching .mono's own stack,
       is what keeps them all actually on the same typeface instead of silently falling back to
       whatever "ui-monospace" resolves to on a given OS. */
    --font-mono: "SF Mono", Menlo, Consolas, monospace;

    /* Flat neutral grays (R=G=B), not the slightly blue-leaning ones before -- and darker
       across the board so the UI reads as black, not charcoal-grey. */
    --bg: #050505;
    --surface: #111111;
    --surface-2: #161616;
    --border: #242424;
    --text: #f2f2f0;
    --text-dim: #9a9a9e;
    --text-faint: #636366;
    --white: #ffffff;
    --danger: #e5484d;
    --danger-dim: #3a1f20;
    --success: #4fd1a5;
    --info: #4f9dff;
    --warning: #f5b94f;
    --radius: 10px;

    /* Every clickable "button-shaped" control (the filled primary button, .icon-btn, .text-btn,
       .chip-btn) shares this corner radius so they read as one family at a glance, not four
       separately-tuned shapes that happen to sit near each other. */
    --btn-radius: 8px;
    /* The one red for a destructive action's own label/icon (delete, remove, revoke) -- brighter
       than --danger so it stays legible as small text/glyphs on a bordered pill or bare icon.
       --danger itself stays reserved for things like the critical-risk badge background, which
       wants the deeper tone. Used by button.danger, .chip-btn--red and .icon-btn--danger so a
       bin icon in a table row and a "Remove" chip button read as the exact same red. */
    --danger-text: #ff7b80;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    /* Inter first and loaded explicitly (see the <link> in index.html/login.html), not left to
       whatever each OS happens to substitute -- -apple-system/Segoe UI differ enough in metrics
       (ascent/descent, x-height) that spacing and alignment that looks right on one platform reads
       slightly off on another. Inter loading everywhere makes the UI render identically regardless
       of OS, and is the fallback chain only for the rare case the stylesheet fails to load. */
    font-family: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.45;
}

/* Film-grain overlay, the same texture as the aster. logo marks -- fixed, low-opacity,
   generated with an SVG turbulence filter so it never needs an image asset to tile. */
body {
    position: relative;
    min-height: 100vh;
    isolation: isolate;
}

/* Oversized ghost wordmark bleeding off the bottom-left, the same background detail as the
   aster. banners -- sits UNDER the grain (z-index -1, grain is 0) so the noise reads on top of
   the letters exactly like the reference art, and under all real UI (z-index 1+). No center glow:
   this is the only background treatment now -- a dark page with the watermark and grain on it. */
body::after {
    content: "aster";
    position: fixed;
    left: -2%;
    bottom: -9%;
    font-size: 440px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: rgba(255,255,255,0.045);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: -1;
    /* Soft-focus, matching the icon mark below -- a crisp-edged wordmark read as a sticker laid
       on top of the page rather than a bled-in background detail. */
    filter: blur(5px);
}

/* Film grain, the same texture as the aster. logo marks. mix-blend-mode: screen rather than
   overlay -- overlay barely registers against a background this close to black, screen adds the
   noise as light so it actually reads as grain instead of disappearing into the bg. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.1;
    mix-blend-mode: screen;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Oversized ghost icon mark, same silhouette as the aster. app-icon banners, bleeding off the
   top-right to balance the wordmark bleeding off the bottom-left. Isolated from the icon PNG's
   own black tile so only the glyph itself shows through, tinted to match the wordmark's grey.
   Pulled in a bit further (was -14%/-8%, cutting the glyph off with a hard flat edge right where
   the topbar and first card sit).
   Uses logo-icon-mask-soft.png, not the original mask: a live CSS `filter: blur()` on a masked
   element doesn't blur the mask's own edges smoothly in Chromium -- it stayed visibly jagged/
   stair-stepped under blur, while the wordmark (plain text, no mask) blurred cleanly, so the two
   never matched. The soft asset bakes the same softness directly into the alpha channel (upscaled
   with smooth resampling, then the alpha itself gaussian-blurred), so no live blur filter is
   needed here at all. */
.bg-mark {
    position: fixed;
    top: -8%;
    right: -4%;
    width: 620px;
    height: 620px;
    background-color: rgba(255,255,255,0.05);
    -webkit-mask: url("/assets/logo-icon-mask-soft.png") no-repeat center / contain;
    mask: url("/assets/logo-icon-mask-soft.png") no-repeat center / contain;
    pointer-events: none;
    z-index: -1;
}

a { color: inherit; }

/* ---------- Header / brand ---------- */

.topbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

/* Who is logged in: name, and the role underneath in its colour. Hidden on narrow screens. */
.whoami { text-align: right; line-height: 1.25; min-width: 0; }
.who-name { font-size: 13px; color: var(--text); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: 11px; }
.who-role.role-admin { color: #ff7b80; }
.who-role.role-moderator { color: #f5a266; }
.who-role.role-user { color: #7ab6ff; }
@media (max-width: 640px) { .whoami { display: none !important; } }

.brand {
    display: flex;
    /* `baseline` (not `center`) lines up the image's bottom edge with the *text's own baseline*,
       not with the wordmark's line-box center -- a line box's vertical center sits visibly higher
       than the baseline (ascent/descent isn't symmetric), which is what made the logo read as
       floating above the text no matter how it was nudged. Baseline alignment is what flexbox
       specifically exists for in an icon-next-to-text layout like this, and holds up across
       platforms/fonts, unlike a hand-picked pixel offset tuned to one screenshot. */
    align-items: baseline;
    gap: 10px;
}

/* No badge, no glow -- just the bare glyph (the same transparent-background silhouette used for
   the big background watermark) sitting directly on the header, so it reads as part of the dark
   surface instead of an isolated lit icon dropped on top of it.

   `logo-icon.svg` is a true vector trace of the real brand mark (contour-traced from the actual
   vector artwork, not the old lossy 128px bitmap mask) -- it stays pixel-sharp at any zoom/DPI
   instead of softening or pixelating the way a PNG does, and its own path bounds coincide exactly
   with the visible glyph with no baked-in padding, so box-level alignment on .brand works
   correctly.

   Sized here to the wordmark's actual rendered cap-height (measured via canvas text metrics:
   12px at this 16px/700-weight Inter, not the 16px font-size box) rather than the font's full
   em-square, which is taller than the capital letters themselves -- that mismatch was what made
   the icon look oversized/misaligned next to the text even with correct baseline alignment, since
   the glyph's top extended well above the letters' own cap-height. Width follows the asset's
   fixed 83:53.89 (~1.540:1) aspect ratio. */
.brand img {
    width: 18.5px;
    height: 12px;
    display: inline-block;
    vertical-align: baseline;
}

.brand .wordmark {
    position: relative;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.brand .wordmark .dim {
    color: var(--text-faint);
    font-weight: 500;
}

/* ---------- Buttons ---------- */

button {
    font-family: inherit;
    font-size: 12.5px;
    border-radius: var(--btn-radius);
    border: 1px solid transparent;
    padding: 8px 14px;
    cursor: pointer;
    background: var(--white);
    color: #0a0a0a;
    font-weight: 600;
    letter-spacing: -0.005em;
    transition: opacity 0.12s ease, transform 0.08s ease, background 0.15s ease;
}

button:hover { opacity: 0.85; }
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* A quiet outlined button (the "Copy all" of a list of new keys). The two buttons of a popup are
   symbols now: see .sym and .modal-actions at the end of this file. */
button.secondary {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}
button.secondary:hover { background: rgba(255, 255, 255, 0.05); opacity: 1; }

/* A text button for a destructive action: flat, red label. */
button.danger {
    background: transparent;
    color: var(--danger-text);
    border-color: var(--border);
}
button.danger:hover { background: rgba(255, 255, 255, 0.05); opacity: 1; }

/* Side-by-side icon action buttons inside a table cell (Settings tab: pause/resume, regenerate,
   delete). A table cell's own padding already separates it from neighboring columns, so this
   only needs to space the icon buttons from each other. */
.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* A small bordered text button ("See all", "Show it", "Show new keys", ...) -- one shared rule
   instead of the half-dozen identical copies (one per container) this used to be scattered
   across, which had already started to drift (one copy had picked up its own font-weight). Also
   the "ghost" pill (a plain bordered text button with no icon): one is a near-duplicate of the
   other, so there is no second class left to drift out of sync with this one. */
.text-btn { height: 28px; padding: 0 11px; border-radius: var(--btn-radius); border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 12px; cursor: pointer; transition: background 0.15s ease; }
.text-btn:hover { background: #1c1c1c; }

/* ---------- Tabs ---------- */

.tabbar {
    position: relative;
    z-index: 1;
    display: flex;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

.tab {
    appearance: none;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--text-faint);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: -0.005em;
    padding: 15px 18px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.tab:hover { opacity: 1; color: var(--text-dim); }

.tab.active { color: var(--white); }

main {
    position: relative;
    z-index: 1;
    padding: 22px 24px 44px;
    /* Fluid, not a hard stop: a flat max-width left everything pinned at the same pixel size on a
       wide monitor or once the page is zoomed out (zooming out just makes the CSS viewport wider,
       which this never used), with the content stranded in a shrinking island mid-screen. Letting
       it track the viewport up to a higher ceiling means it actually fills more of the window as
       the window (or the zoomed-out "window" in CSS px) gets wider, and still caps out before
       lines get absurdly long on a huge display. */
    width: min(94vw, 1600px);
    margin: 0 auto;
}

.panel { display: none; }
.panel.active { display: block; }

/* ---------- Cards / layout ---------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 16px;
}

.card .value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.card .label { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }
.card .value-sm { font-size: 14px; font-weight: 600; letter-spacing: 0; line-height: 1.5; }
.cards-tight { margin-bottom: 0; }

/* Per-minute request strip on the user Overview: one bar per minute, newest on the right. */
.minute-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 96px;
}
.minute-bar {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
}
.minute-bar span {
    display: block;
    width: 100%;
    border-radius: 3px 3px 0 0;
    background: var(--text-faint);
}
/* .zero is listed first on purpose: the current minute very often *is* the zero one (nothing has
   happened yet this minute), and it still needs to read as "this is now" rather than disappear
   into the same dim flatline as an empty past minute -- so .current, coming second, is what wins
   the tie when a bar carries both classes. */
.minute-bar.zero span { background: var(--border); }
.minute-bar.current span { background: var(--white); }

section.block {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px 18px;
    margin-bottom: 22px;
}

/* Superseded by the single .block-head/h2 definition further down (search "Same card
   everywhere") -- kept as a bare selector reset here so nothing above this point in the
   cascade can out-specificity it by accident. */

/* ---------- Filters ---------- */

/* The fields wrap among themselves; the action icons stay pinned at the right end of the row, so
   Apply and Export never drop onto a line of their own. */
/* A distinct toolbar panel rather than a loose row of boxes sitting directly on the page
   background -- without this every field and the table below all read as the same flat
   color, with nothing separating "the controls" from "the data". */
.filters {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px 10px 10px 14px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.filter-fields {
    display: flex;
    /* Always one row. Wrapping let a pill that fell alone onto a second line stretch its flex-grow
       across that whole row (e.g. "All users" spanning the full width by itself) -- nowrap removes
       the second row entirely, and the pills themselves shrink to fit (flex: 1 1 140px; min-width:
       100px on .filter-pill) rather than this container needing to scroll.
       Deliberately no overflow-x here: per spec, giving either axis a non-"visible" overflow forces
       the OTHER axis's "visible" to compute as "auto" too (they can't be set independently), so
       overflow-x:auto was silently clipping overflow-y as well -- any dropdown panel taller than
       this 36px-high row (a select with more than a couple of options) got scroll-clipped down to
       a sliver, which is exactly the "broken" cut-off status dropdown that was reported. */
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    padding-left: 10px;
    border-left: 1px solid var(--border);
}

/* Square icon buttons, the same 36px as the fields beside them. Apply, Export and + are all the
   same dark outlined button: plain clickable actions, no on/off look. */
/* Neutral, matching the dashboard's own resting field tone instead of an arbitrary blue --
   these are plain actions (export, import, retrieve), not a "connected" or "on" state, so they
   take the same border/background every other field uses and brighten on hover like a button. */
.icon-action {
    appearance: none;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease, transform 0.08s ease;
}
.icon-action svg { display: block; flex: none; width: 16px; height: 16px; }
.icon-action:hover { border-color: var(--text-dim); color: var(--text); background: #1c1c1c; }
.icon-action:active { transform: scale(0.96); }
.icon-action:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18); }

.filters input, .filters select {
    height: 36px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.12s ease;
}

.filters input:hover, .filters select:hover { border-color: #333; }
.filters input:focus, .filters select:focus {
    outline: none;
    border-color: var(--text-dim);
}

.filters input::placeholder { color: var(--text-faint); }

/* The closed <select> box can be fully restyled, but its open option list is rendered by the OS,
   not by CSS -- `appearance: none` + a custom chevron fixes the ugly native arrow on the closed
   box, and `color-scheme: dark` (set globally, see :root below) tells Chromium/Firefox/Safari to
   paint their *native* form-control chrome -- the option list, its scrollbar, checkboxes, the
   native date/time pickers if any slip in -- in their own built-in dark palette instead of
   always-white, which is what was happening before (dark closed box, white dropdown list). */
.filters select {
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9a9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    cursor: pointer;
}

.filters select:hover { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f2f2f0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }

.filters select option {
    background: var(--surface-2);
    color: var(--text);
}

/* Fixed, tidy widths so the whole checkout row fits on one line at a normal window size. A select
   would otherwise size itself to its longest option (a long user name made "All users" huge). */
.filters select { min-width: 124px; max-width: 168px; text-overflow: ellipsis; }
#checkoutHostFilter { width: 150px; }
#checkoutMinPriceFilter, #checkoutMaxPriceFilter { width: 100px; }
#sessionsEmailFilter { width: 190px; }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
/* Tables read left to right: text starts at the left edge, header and values together. Only short
   columns that read better as a centered line -- a status, a count, a price, a time, a risk -- are
   centered (.col-center, .num, .status-col, and the Checkout price/quantity), header included. The
   unlabelled row-actions cell at the far right stays right. */
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th.col-center, td.col-center { text-align: center; }
th { color: var(--text-faint); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.055em; padding-bottom: 12px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.025); }
td { line-height: 1.4; }

.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- Session content (collapsed cookie/data JSON) ---------- */

.session-detail-row td { padding: 0 10px 14px; border-bottom: 1px solid var(--border); }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.inactive-row { opacity: 0.4; }

/* ---------- Auto-checkout control (Checkouts tab, per row) ---------- */
/* No ring, no track, no box -- just the Aster mark sized to sit with the row's text. Off is a
   dim mark; clicking to "on" flips it a full turn in 3D (perspective on the button, rotateY on
   the glyph) and crosses it over to --success with a soft glow partway through the flip, so
   resuming it reads as an action, not just a flipped flag. Pausing is a plain reverse flip with
   no glow -- the glow is reserved for "turning it on". */

.auto-btn {
    appearance: none;
    width: auto;
    height: auto;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-faint);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    perspective: 160px;
    transition: color 0.15s ease, transform 0.1s ease;
    /* Same fix as the row checkboxes: an inline-flex box with no baseline-eligible child (the svg
       isn't one) falls back to aligning its bottom edge to the surrounding text's baseline, which
       sits visibly above this cell's true center since nothing else in the cell establishes a
       baseline either. vertical-align:middle corrects that. */
    vertical-align: middle;
}

.auto-btn svg {
    display: block;
    flex: none;
    width: 17px;
    height: 17px;
    transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.3, 1), filter 0.3s ease;
}

.auto-btn:hover:not(:disabled) { color: var(--text-dim); }
/* Without this, hovering an "on" button would lose to the plain :hover rule above (2 class-level
   selectors beats 1) and the button would visually look "off" while the mouse sits on it. */
.auto-btn[data-on="true"]:hover:not(:disabled) { color: var(--success); }

.auto-btn:active:not(:disabled) { transform: scale(0.92); }

.auto-btn[data-on="true"] {
    color: var(--success);
}

.auto-btn[data-on="true"] svg {
    transform: rotateY(360deg);
    filter: drop-shadow(0 0 5px rgba(79, 209, 165, 0.7));
}

.auto-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 209, 165, 0.2);
    border-radius: 4px;
}

/* ACO (auto-checkout) only ever appears on the Checkout tab, so instead of the generic green
   "success" tone it takes on Checkout's own identity color -- same idea as every other stat card
   matching its tab's color, just applied to this one toggle. */
#panel-checkouts .auto-btn[data-on="true"],
#panel-checkouts .auto-btn[data-on="true"]:hover:not(:disabled) {
    color: #d8ba58;
}
#panel-checkouts .auto-btn[data-on="true"] svg {
    filter: drop-shadow(0 0 5px rgba(216, 186, 88, 0.7));
}
#panel-checkouts .auto-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(216, 186, 88, 0.2);
}

.auto-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* ---------- API key reveal (password-manager-style show/hide) ---------- */

.apikey-cell { display: flex; align-items: center; gap: 8px; }
.apikey-mask { letter-spacing: 0.15em; }

.apikey-toggle {
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-faint);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.apikey-toggle svg { display: block; flex: none; }
.apikey-toggle:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.apikey-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79, 209, 165, 0.2); }

/* ---------- Modal dialogs (replaces the browser's own confirm()/alert()) ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    animation: modal-fade-in 0.12s ease;
}

@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.modal-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.modal-message {
    text-align: center;
    font-size: 13.5px;
    color: var(--text-dim);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.modal-key-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 8px 8px 12px;
}

.modal-key {
    flex: 1;
    min-width: 0;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: var(--text);
    overflow-wrap: break-word;
    word-break: break-all;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}
.modal-btn {
    min-width: 104px; height: 36px; padding: 0 20px;
    font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
    border-radius: 9px; border: 1px solid var(--border); background: transparent; color: var(--text-dim);
    cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.modal-btn:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.4); outline-offset: 2px; }
.modal-btn--ghost:hover { color: var(--text); border-color: #3a3a3a; background: rgba(255, 255, 255, 0.04); }
.modal-btn--ok { color: #4fd1a5; border-color: rgba(79, 209, 165, 0.45); background: rgba(79, 209, 165, 0.10); }
.modal-btn--ok:hover { background: rgba(79, 209, 165, 0.20); border-color: rgba(79, 209, 165, 0.7); }
.modal-btn--danger { color: #e5484d; border-color: rgba(229, 72, 77, 0.45); background: rgba(229, 72, 77, 0.10); }
.modal-btn--danger:hover { background: rgba(229, 72, 77, 0.20); border-color: rgba(229, 72, 77, 0.7); }
.modal-btn:disabled { opacity: 0.5; cursor: default; }

/* A key reveal: the one dialog in the app showing something that can never be shown again.
   Used to get its own amber border/glow to stand out from every other "are you sure?" popup --
   dropped per review feedback (read as a stray yellow outline, not a deliberate cue), so it now
   sits on the same plain .modal-card as everything else, with just the badge below marking it. */
.modal-reveal-badge {
    display: inline-flex; align-items: center; gap: 6px;
    margin-bottom: 10px; padding: 3px 9px 3px 7px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.modal-reveal-badge svg { width: 12px; height: 12px; }
.modal-message--warn { color: var(--text-dim); }
.modal-key-row--reveal {
    margin-top: 14px;
    background: var(--bg);
    border-color: var(--border);
    padding: 12px 10px 12px 16px;
}
.modal-key-row--reveal .modal-key { font-size: 14px; font-weight: 500; letter-spacing: 0.03em; }

/* ---------- Custom date picker (replaces the native <input type=date>, whose popover is
   always light/white and can't be themed -- this one follows the dashboard's own colors). ---- */

.datepicker { position: relative; display: inline-block; }

/* The date filter is just the calendar glyph now, the same 36px icon-button shape as the filter
   funnel/export/add icons it sits beside -- the chosen date used to be spelled out in the pill
   itself, which both repeated "today's date" across every tab and ran long next to them. The date
   is still there on hover (see the title set in createDatePicker). */
.datepicker-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}
.datepicker-label { display: none; }

.datepicker-trigger:hover { border-color: var(--text-dim); color: var(--text); background: #1c1c1c; }
.datepicker-trigger.open { border-color: var(--text-dim); color: var(--text); }
.datepicker-trigger svg { flex: none; display: block; width: 16px; height: 16px; color: inherit; }
/* Same "a filter is set" highlight as every other field in the row (.filter-pill.active,
   .pf.is-active) -- lit once a non-default date is picked, see createDatePicker's
   isFilterActive/resetSelection and wireLiveFilters' [data-custom-filter] handling. Per-tab color
   overrides sit with the rest of that tab's filter-accent rules further down. */
.datepicker.is-active .datepicker-trigger { border-color: var(--success); background-color: rgba(79, 209, 165, 0.07); color: var(--success); }

.datepicker-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    width: 248px;
    background: var(--surface-2);
    border: 1px solid #2c2c2c;
    border-radius: 12px;
    padding: 14px;
}

.dp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.dp-month-label { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; }

.dp-nav {
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
    transition: background 0.12s ease, color 0.12s ease;
}

.dp-nav:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}

.dp-weekdays span {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 4px 0;
}

.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.dp-day {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    /* Override the global `button { padding: 9px 16px }` rule -- left unreset, that padding was
       wider than an entire 7-column grid cell, so each day button's own minimum content size
       (padding included) forced the grid wider than its panel, spilling the right-hand columns
       out past the panel's rounded background and onto the page behind it. */
    padding: 0;
    margin: 0;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s ease, color 0.1s ease;
}

.dp-day:hover:not(:disabled) { background: rgba(255,255,255,0.08); }

.dp-day:disabled {
    color: var(--text-faint);
    opacity: 0.35;
    cursor: default;
}

.dp-day.dp-day-today { box-shadow: inset 0 0 0 1px var(--text-dim); font-weight: 600; }

.dp-day.dp-day-selected {
    background: var(--white);
    color: #0a0a0a;
    font-weight: 700;
}

.dp-day.dp-day-selected:hover { background: var(--white); }

.dp-footer {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.dp-today-btn {
    background: transparent;
    color: var(--text-dim);
    border: none;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    cursor: pointer;
}

.dp-today-btn:hover { color: var(--text); }

.empty-row td {
    text-align: center;
    color: var(--text-faint);
}

/* ---------- Badges ---------- */

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.6;
}

/* Checkout status badges: one distinct color per state (not a two-tone ok/bad scheme) so
   "waiting" (yellow), "in flight" (blue), "done" (green), and "errored" (red) are each
   recognizable at a glance without reading the text. */
.badge.ok { background: rgba(79,209,165,0.14); color: var(--success); }
.badge.pending { background: rgba(232,179,57,0.14); color: #e8b339; }
.badge.processing { background: rgba(88,166,255,0.14); color: #58a6ff; }
.badge.bad { background: var(--danger-dim); color: var(--danger); }
.badge.muted { background: rgba(255,255,255,0.06); color: var(--text-dim); }

/* The Accounts tab's admin/developer row view: the status badge is also a button that opens the
   status editor, so it needs a pointer and a visible focus ring, but otherwise no button chrome. */
.status-edit-btn { all: unset; cursor: pointer; display: inline-flex; border-radius: 100px; }
.status-edit-btn:hover .badge { filter: brightness(1.18); }
.status-edit-btn:focus-visible { outline: 2px solid var(--success); outline-offset: 2px; }

/* The one status indicator: no pill, just a dot and the word, in the colour of the status (--st is
   the colour as an R,G,B triplet). Used for every checkout status and for HTTP codes in the request
   log. pending yellow, processing blue, completed green, failed and declined red, expired grey. */
.badge.st { display: inline-flex; align-items: center; gap: 6px; padding: 0; border-radius: 0; font-size: 12px; font-weight: 600; letter-spacing: 0; font-feature-settings: "tnum" 1; color: rgb(var(--st)); background: transparent; }
.badge.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
/* Status column only (Checkout/Account/Session): every entry reserves the same width regardless of
   word length ("processing" vs "expired" vs "Expiring soon"), with the dot+word centered inside
   that width, so the column reads as a clean centered strip even without a pill background to
   anchor it visually. Scoped to .status-col so it never touches the same .badge.st class reused for
   HTTP codes in the request log, which stay their natural compact width. */
.status-col .badge.st { min-width: 118px; justify-content: center; }
.st-pending { --st: 240, 190, 50; }
.st-accepted { --st: 88, 166, 255; }
.st-completed { --st: 79, 209, 165; }
.st-failed { --st: 255, 95, 102; }

/* The dot breathes only while a row is actually waiting on something (pending) or in flight
   (accepted) -- it's a "this is still live" signal, not decoration, so completed/failed stay
   perfectly still. */
@keyframes badgeDotBreathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.badge.st.st-pending::before,
.badge.st.st-accepted::before {
    animation: badgeDotBreathe 1.6s ease-in-out infinite;
}

/* Plays once when a badge's own JS render marks it as changed from last time (see badgeChangedClass
   in index.js) -- a full table re-render has no DOM diffing, so that class is the only signal that
   this value is new rather than the same one redrawn. The new word scales in from slightly big and
   soft-focus to normal size and sharp, like it's advancing into place rather than just appearing. */
@keyframes badgeDepthIn {
    0% { transform: scale(1.3); filter: blur(2px); opacity: 0; }
    100% { transform: scale(1); filter: blur(0); opacity: 1; }
}
.badge.st.badge-changed { animation: badgeDepthIn 0.32s ease-out both; }

/* Accept / Decline under a pending checkout's status badge. */

/* The viewer's own paired user key, above the API keys table. */
.paired-key { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 13px; }
.badge.role-admin, .chip.role-admin { background: rgba(229,72,77,0.14); color: #ff7b80; }
.badge.role-moderator, .chip.role-moderator { background: rgba(240,136,62,0.14); color: #f5a266; }
.badge.role-user, .chip.role-user { background: rgba(79,157,255,0.14); color: #7ab6ff; }

.status-2 { color: var(--success); }
.status-4 { color: #e8b339; }
.status-5 { color: var(--danger); }

/* ---------- Auth pages (login) ---------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
    /* Wide enough that a full 20-character key, five groups ("XXXX XXXX XXXX XXXX XXXX"), never
       scrolls/clips inside the key field below, right up against the submit arrow. */
    width: 398px;
    position: relative;
    z-index: 1;
}

.auth-card .brand { justify-content: center; margin-bottom: 28px; }
/* Same vector asset, sized to this page's own larger wordmark cap-height (14px, measured at this
   page's 19px/700-weight Inter) rather than forced to a square -- see the .brand img comment above
   for why cap-height (not font-size) is the right target. */
.auth-card img { width: 21.6px; height: 14px; }
.auth-card .wordmark { font-size: 19px; }

.auth-card input {
    width: 100%;
    padding: 12px 13px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    box-sizing: border-box;
    font-family: inherit;
    font-size: 13px;
    transition: border-color 0.12s ease;
}

.auth-card input:focus { outline: none; border-color: var(--text-dim); }

.auth-card button { width: 100%; padding: 12px; margin-top: 4px; }

#error {
    color: var(--danger);
    font-size: 12px;
    margin-bottom: 10px;
    display: none;
    text-align: center;
}

/* A dark, bordered button like every other button in the dashboard, not a stark white pill --
   this is the login screen, but it should still look like it belongs to the same app. */
.discord-btn {
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.discord-btn:hover { background: #1c1c1c; border-color: var(--text-dim); }
.invite-title { text-align: center; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.invite-text { text-align: center; color: var(--text-dim); font-size: 13px; margin: 0 0 18px; line-height: 1.5; }

/* ---------- Dates everywhere: plain even-width digits ---------- */
td.faint, .datepicker-panel { font-feature-settings: "tnum" 1; }

/* ---------- Custom dropdown (replaces the OS-drawn <select> list) ---------- */

.cselect { position: relative; display: inline-block; }
.cselect-native { display: none !important; }

.cselect-trigger {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 124px;
    max-width: 190px;
    height: 36px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 400;
    cursor: pointer;
    transition: border-color 0.12s ease;
}
.cselect-trigger:hover { border-color: #333; }
.cselect-trigger.open { border-color: var(--text-dim); }
.cselect-trigger:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18); }
.cselect-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-trigger svg { flex: none; width: 14px; height: 14px; color: var(--text-dim); }
.cselect-trigger:hover svg, .cselect-trigger.open svg { color: var(--text); }

.cselect-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 100%;
    max-width: 280px;
    max-height: 264px;
    overflow-y: auto;
    background: var(--surface-2);
    border: 1px solid #2c2c2c;
    border-radius: 12px;
    padding: 4px;
}
.cselect-item {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: 7px;
    padding: 0 10px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}
.cselect-item span { overflow: hidden; text-overflow: ellipsis; }
.cselect-item:hover, .cselect-item:focus-visible, .cselect-item.sel { background: rgba(255, 255, 255, 0.06); outline: none; }
.cselect-item svg { flex: none; width: 14px; height: 14px; color: var(--white); }

/* ---------- Settings: API keys ---------- */

.role-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }

.create-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.create-bar input[type=text], .create-bar #newUserName { flex: 1; min-width: 160px; max-width: 420px; }
.keys-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.keys-filter input { width: 220px; }
.create-bar input, .keys-filter input {
    height: 36px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.12s ease;
}
.create-bar input:hover, .keys-filter input:hover { border-color: #333; }
.create-bar input:focus, .keys-filter input:focus { outline: none; border-color: var(--text-dim); }
.create-bar input::placeholder, .keys-filter input::placeholder { color: var(--text-faint); }

/* Segmented control: a row of options, one selected. */
.seg { display: inline-flex; gap: 2px; height: 36px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.seg button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    border-radius: 7px;
    padding: 0 11px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.seg button:hover { color: var(--text); }
/* button.on's own background is set further down (.seg button.on { background: transparent })
   once the sliding .seg-thumb exists to paint the fill instead -- only color stays set here. */
.seg button.on { color: var(--text); }
/* Softer than before (was 0.25 alpha): with the pill itself now clearly visible on its own
   (see .seg-thumb above), this ring only needs to be a hint, not the main signal that a click
   landed -- at the old strength, right after a real click it visually overpowered the pill. */
.seg button:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.role-admin { background: #e5484d; }
.dot.role-moderator { background: #f0883e; }
.dot.role-user { background: #4f9dff; }
.who-role.role-admin .dot { background: #e5484d; }
.who-role.role-moderator .dot { background: #f0883e; }
.who-role.role-user .dot { background: #4f9dff; }

.apikey-copy { appearance: none; border: none; background: transparent; color: var(--text-dim); cursor: pointer; padding: 2px; display: inline-flex; }
.apikey-copy:hover { color: var(--text); }
.apikey-copy svg { width: 15px; height: 15px; display: block; }

/* One line per key inside an account row. Every column that has per-key values uses the same
   line height so the lines of the different columns stay level with each other. */
.key-line { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.key-label { display: inline-flex; align-items: center; gap: 7px; width: 96px; flex: none; font-size: 12px; color: var(--text-dim); white-space: nowrap; }

/* ---------- Shared form-field styling (showForm dialogs: Account edit, License keys, Queue) ---------- */

.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 160px; min-width: 140px; max-width: 340px; }
.field-wide { flex: 3 1 340px; max-width: none; }
.field input, .field textarea {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.12s ease;
}
.field textarea {
    padding: 9px 12px;
    height: 36px;
    min-height: 36px;
    resize: vertical;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
}

/* A single cramped line of monospace was never going to be a nice place to paste a JSON cookie
   blob -- this button opens a proper code-block popup (.code-modal below) instead. Styled like
   the other .field inputs so it still reads as part of the same row, with a dashed border and a
   monospace preview to signal "this opens into something bigger" before it's clicked. */
.code-field-trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; height: 36px; padding: 0 10px 0 12px;
    background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px;
    color: var(--text-dim); cursor: pointer; text-align: left;
    transition: border-color 0.12s ease, background 0.12s ease;
}
/* Border-only hover, matching every other .field input/textarea (line below) instead of also
   darkening the background - the extra background flash was the odd one out here. */
.code-field-trigger:hover { border-color: #333; }
.code-field-trigger.has-value { border-style: solid; color: var(--text); }
.code-field-preview {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px;
}
.code-field-trigger svg { flex: none; width: 15px; height: 15px; color: var(--text-faint); }

/* The popup itself: a plain modal-card with one big code-styled textarea. */
.code-modal { width: min(560px, 92vw); }
.code-modal textarea {
    width: 100%; height: 220px; margin-top: 10px; padding: 12px 14px; resize: vertical;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    color: var(--text); font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 12.5px; line-height: 1.55; outline: none;
}
.code-modal textarea:focus { border-color: var(--text-dim); }
.field input:hover, .field textarea:hover { border-color: #333; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--text-dim); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }

.form-msg { margin: 10px 0 0; font-size: 12.5px; color: var(--text-dim); }
.form-msg:empty { display: none; }
.form-msg.ok { color: var(--success); }
.form-msg.bad { color: var(--danger); }

.seg-count { margin-left: 7px; color: var(--text-faint); font-size: 12px; font-feature-settings: "tnum" 1; }
.seg button.on .seg-count { color: var(--text-dim); }

/* ---------- Tick boxes and the bulk bar (Sessions and the Queue pools) ---------- */

/* line-height:0 matters here: without it, the cell's line box takes its height from the ambient
   font (its line-height), and "vertical-align:middle" on the checkbox then centers it against that
   font's x-height midpoint, not the row's true geometric center -- a mismatch of a couple of px
   against the row height. Zeroing the line-height makes the checkbox itself the only thing that
   establishes the line box, so there's nothing left for it to be off-center against. */
th.col-check, td.col-check { width: 34px; padding-right: 0; vertical-align: middle; line-height: 0; }
/* A plain flat square, not the browser's native control (which the accent-color trick above
   couldn't fully re-skin -- it still looked like three different checkboxes across Chrome/Safari/
   Firefox). Box and glyph are both whole pixel numbers on purpose: 14px box, 1px border -> 12px
   content box, 8px glyph -> (12-8)/2 = 2px of margin on every side exactly. Fractional numbers
   (the 13px/1.3px this replaces) forced the browser to round the border to a whole device pixel
   per edge, and rounding doesn't always land the same on every edge -- that sub-pixel wobble was
   the glyph's real "off-center" cause, not the glyph itself. */
input[type=checkbox] {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; margin: 0; cursor: pointer; vertical-align: middle; flex: none;
    border: 1px solid #3a3a3e; border-radius: 3px; background: #0c0c0c no-repeat center;
    background-size: 8px 8px;
}
input[type=checkbox]:hover { border-color: #55555a; }
input[type=checkbox]:checked, input[type=checkbox]:indeterminate { background-color: #e8e8e8; border-color: #e8e8e8; }
input[type=checkbox]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c0c0c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
}
input[type=checkbox]:indeterminate {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='11' width='14' height='2' rx='1' fill='%230c0c0c'/%3E%3C/svg%3E");
}
/* Same idea as the ACO toggle and the filter funnel just above: no single shared color, each
   table picks up its own tab's identity color instead. */
#panel-checkouts input[type=checkbox]:checked, #panel-checkouts input[type=checkbox]:indeterminate { background-color: #d8ba58; border-color: #d8ba58; }
#panel-accounts input[type=checkbox]:checked, #panel-accounts input[type=checkbox]:indeterminate { background-color: #cf8c3e; border-color: #cf8c3e; }
#panel-sessions input[type=checkbox]:checked, #panel-sessions input[type=checkbox]:indeterminate { background-color: #c05f33; border-color: #c05f33; }
#panel-queue input[type=checkbox]:checked, #panel-queue input[type=checkbox]:indeterminate { background-color: #a3382e; border-color: #a3382e; }
tbody tr.row-selected { background: rgba(255,255,255,0.04); }
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 4px 0 10px;
    padding: 5px 8px 5px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.bulk-count { margin-right: 6px; color: var(--text-dim); font-size: 13px; }

/* ---------- Access tab ---------- */
.access-notice {
    margin: 0 0 14px;
    padding: 10px 14px;
    border: 1px solid rgba(232, 179, 57, 0.35);
    background: rgba(232, 179, 57, 0.08);
    color: #e8b339;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.5;
}
#accessDiscordId { width: 200px; }
.invite-link { display: inline-flex; align-items: center; gap: 8px; }
.invite-link .mono { word-break: break-all; }

/* ================= Rework: motion, one look for every tab ================= */

:root { --ease: cubic-bezier(0.2, 0.7, 0.2, 1); }

/* Tab bar: a single indicator that slides under the active tab. */
.tabbar { position: relative; }
.tab-ind {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--white);
    border-radius: 2px;
    pointer-events: none;
}
.tab-ind.animate { transition: transform 0.32s var(--ease), width 0.32s var(--ease); }

/* A panel rises 6 px and fades in when its tab opens. */
.panel.active { animation: panel-in 0.28s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Segmented control: one thumb that slides between the options. */
.seg { position: relative; }
.seg .seg-thumb {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 0;
    /* Was #232326 -- almost the same color as the segmented control's own border (#242424), so
       the "selected" pill barely showed against its own background and leaned entirely on the
       bold white label text to read as selected. Clearly lighter now, so the pill itself is
       visible at a glance instead of looking unselected until you notice the bold text. */
    background: #3a3a42;
    border-radius: 7px;
    pointer-events: none;
}
.seg .seg-thumb.animate { transition: transform 0.28s var(--ease), width 0.28s var(--ease); }
.seg button { position: relative; z-index: 1; transition: color 0.2s ease; }
.seg button.on { background: transparent; }

/* Same card everywhere: header (title and count left, tools right), then content. A plain word
   sitting in empty space (Memory, System, Discord webhooks, Recent requests -- anything with no
   segmented control or button next to it to lean on) read as an afterthought rather than a
   heading, so the title itself now carries the weight: bigger, bolder, and set off from the body
   below by a rule line instead of margin alone. */
section.block { border-radius: 12px; padding: 16px 18px; }
.block-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); min-height: 30px;
}
.block-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.015em; display: flex; align-items: center; gap: 9px; }
/* The count used to be a bare "(12)" sitting right after the title -- flat and easy to miss. Now
   it's a small muted chip, so it still reads as metadata (not part of the title) but looks like a
   deliberate piece of UI instead of a leftover parenthetical. Every title always carries one, "0"
   included, so a title's counter never silently disappears depending on the data. */
.block-head h2 .count {
    display: inline-flex; align-items: center;
    margin-left: 0; padding: 2px 8px;
    border-radius: 100px; background: rgba(255, 255, 255, 0.06);
    font-weight: 500; color: var(--text-dim); font-size: 11px;
    font-feature-settings: "tnum" 1; letter-spacing: 0;
}

/* Per-title accent: a breathing dot plus a short breathing underline under the word, each in a
   color tied to that section's own stat card (set via --accent on the h2). Opt-in via
   .title-pulse rather than folded into the base h2 rule, since not every title has a stat card
   to draw its color from yet. The dot's glow is deliberately bare opacity, no blur halo -- same
   motion as the status-pill dots elsewhere (badgeDotBreathe) rather than a diffused glow. The
   underline stays short and never reaches full width/opacity so it never reads as a loading or
   progress bar -- just a quiet pulse, not an event. Both animations share one duration and phase
   (same keyframe shape, same timing) so the dot and its underline breathe as a single pulse
   instead of two clocks drifting in and out of step; the width below is a fallback only --
   syncTitleUnderlines() in index.js measures the actual title and overrides it inline so the line
   runs a little past the word regardless of how long that word is. */
.block-head h2.title-pulse { flex-direction: column; align-items: flex-start; gap: 5px; }
.title-pulse .title-top { display: flex; align-items: center; gap: 9px; }
.title-dot {
    width: 6px; height: 6px; border-radius: 50%; flex: none;
    background: var(--accent); animation: titlePulse 2.6s ease-in-out infinite;
}
.title-under {
    /* Starts at the very left of .title-top (under the dot), not indented past it, so the line
       runs under the whole dot+word group it belongs to instead of just the word. */
    width: 46px; height: 2px; border-radius: 2px;
    background: var(--accent); transform-origin: left; animation: titleUnderPulse 2.6s ease-in-out infinite;
}
@keyframes titlePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes titleUnderPulse { 0%, 100% { transform: scaleX(0.85); opacity: 0.4; } 50% { transform: scaleX(1); opacity: 0.75; } }

.block-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }

/* A bit wider than the shared .tool-input default so "Search name, Discord, key" has room to
   breathe next to the role filter and the now icon-only clear/add buttons. */

tbody tr { transition: background 0.15s ease; }
.card { border-radius: 12px; transition: border-color 0.15s ease; }
.card .value { font-feature-settings: "tnum" 1; }

/* ---------- Licenses ---------- */
.lic-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; }
@media (max-width: 860px) { .lic-grid { grid-template-columns: 1fr; } }
.lic-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px 18px; }
.lic-card-table { padding: 4px 6px; }
.lic-card-table th:first-child, .lic-card-table td:first-child { padding-left: 14px; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; min-height: 46px; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--text-faint); }
.kv .kv-val { display: flex; align-items: center; gap: 8px; }
.lic-key { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12.5px; letter-spacing: 0.03em; color: var(--text); }
.slots { display: inline-flex; gap: 5px; }
.slots i { display: block; width: 22px; height: 6px; border-radius: 3px; background: var(--border); transition: background 0.4s ease; }
.slots i.u { background: var(--white); }
.usage { height: 5px; width: 92px; background: var(--border); border-radius: 3px; overflow: hidden; }
.usage i { display: block; height: 100%; background: var(--white); border-radius: 3px; transition: width 0.7s var(--ease); }
.usage i.full { background: #e8b339; }
.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-right: 8px; animation: live-pulse 2.2s ease-in-out infinite; }
.live.off { background: var(--text-faint); animation: none; }
@keyframes live-pulse { 50% { opacity: 0.35; } }
tr.lic-row { cursor: pointer; }
tr.lic-detail > td { padding: 0; border-bottom: 1px solid var(--border); }
tr.lic-detail:last-child > td { border-bottom: 0; }
.exp { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.32s var(--ease); }
.exp.open { grid-template-rows: 1fr; }
.exp > div { overflow: hidden; visibility: hidden; transition: visibility 0s linear 0.32s; }
/* Closed content is not just clipped: it is hidden, so the buttons inside it cannot be reached by Tab. */
.exp.open > div { visibility: visible; transition-delay: 0s; }
.lic-sub { background: var(--surface-2); border-radius: 10px; margin: 2px 12px 12px; padding: 4px 14px; }
.lic-sub .line { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 12.5px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.lic-sub .line:last-child { border-bottom: 0; }
.lic-sub .grow { flex: 1; }

.lic-name { line-height: 1.35; }
.lic-name .faint { font-size: 12px; }

/* ---------- Login: license key, then Discord ---------- */
.gate-key { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.4s var(--ease), opacity 0.3s ease; }
.gate-key > div { overflow: hidden; }
.gate-key.gone { grid-template-rows: 0fr; opacity: 0; }
.key-field {
    position: relative;
    display: flex; align-items: center; gap: 8px;
    height: 44px; padding: 0 6px 0 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    opacity: 0.78;
    transition: border-color 0.25s ease, opacity 0.3s ease, box-shadow 0.35s ease;
}
.key-field.unlocked, .key-field.ok, .key-field.bad { opacity: 1; }
.key-field:focus-within, .key-field.unlocked { border-color: var(--text-dim); }
.key-field.ok { border-color: var(--success); box-shadow: 0 0 0 3px rgba(79, 209, 165, 0.1); }
.key-field.bad { border-color: var(--danger); animation: shake 0.35s; }
.key-field > svg { width: 16px; height: 16px; color: var(--text-faint); flex: none; transition: color 0.3s ease; }
.key-field.unlocked > .key-lock { color: var(--text); }
.key-field.ok > .key-lock { color: var(--success); }
/* The padlock: its shackle lifts and swings open when the box unlocks. */
.key-lock .shackle { transform-box: view-box; transform-origin: 16px 11px; transition: transform 0.45s var(--ease); }
.key-field.unlocked .key-lock .shackle, .key-field.ok .key-lock .shackle { transform: translateY(-3px) rotate(-32deg); }
/* No more separate "ASTR" prefix chip: a real key is always typed or pasted whole ("ASTR-XXXX-
   XXXX-XXXX-XXXX" is the literal string the owner was given), so the field is just five identical
   groups and the first one fills in the same way the rest do -- nothing here treats it specially,
   so there's nothing for the field itself to give away before someone has typed their own key.
   .key-center does the centering (the whole five-group block sits centered between the lock and
   the arrow, not pinned to the left edge); .key-input is sized to its own content so it centers as
   one unit. The ghost (normal flow, the fixed 24-char template -- five 4-char groups) now defines
   that width; the real input sits absolutely on top of it, left-aligned the same as the ghost, so
   typed/pasted characters visually replace the dots as before. */
.key-center { flex: 1; min-width: 0; display: flex; justify-content: center; }
.key-input { position: relative; flex: none; display: inline-block; }
.auth-card .key-field input { all: unset; position: absolute; inset: 0; width: 100%; margin: 0; padding: 0; border: 0; background: transparent; font-family: var(--font-mono, ui-monospace, monospace); font-size: 14px; font-weight: 500; letter-spacing: 0.08em; color: var(--text); caret-color: var(--text); z-index: 1; transition: color 0.4s ease; }
.key-field.ok input { color: var(--success); }
.key-ghost { position: relative; display: inline-block; pointer-events: none; white-space: pre; font-family: var(--font-mono, ui-monospace, monospace); font-size: 14px; font-weight: 500; letter-spacing: 0.08em; color: var(--text-faint); transition: color 0.4s ease; }
.key-ghost .kh { visibility: hidden; }
.key-ghost .kg { transition: color 0.4s ease; }
.key-field.unlocked .key-ghost { color: var(--text-dim); }
/* Unlocking: the groups light up one after the other and a beam runs once around the border. */
.key-field.unlocking .kg { animation: key-wave 0.7s ease both; animation-delay: calc(var(--i) * 0.09s); }
@keyframes key-wave { 0% { color: var(--text-faint); } 40% { color: var(--text); } 100% { color: var(--text-dim); } }
@property --beam { syntax: '<angle>'; inherits: false; initial-value: -60deg; }
.key-field::after {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0;
    background: conic-gradient(from var(--beam), transparent 0deg, transparent 250deg, rgba(255, 255, 255, 0.95) 330deg, transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.key-field.unlocking::after { animation: key-beam 1.1s var(--ease) both; }
@keyframes key-beam { 0% { --beam: -60deg; opacity: 0; } 15% { opacity: 0.95; } 85% { opacity: 0.95; } 100% { --beam: 300deg; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .key-field.unlocking .kg, .key-field.unlocking::after { animation: none; }
    .key-lock .shackle, .key-field, .key-ghost, .key-ghost .kg { transition: none; }
}
.auth-card .key-field button { width: 32px; height: 32px; padding: 0; margin: 0; border-radius: 8px; background: transparent; border: 0; color: var(--text-dim); display: inline-flex; align-items: center; justify-content: center; }
.auth-card .key-field button:hover { background: #1c1c1c; opacity: 1; }
.key-field button svg { width: 16px; height: 16px; }
.key-field.ok button { color: var(--success); }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.gate-msg { min-height: 18px; margin-top: 10px; font-size: 12px; color: var(--text-dim); text-align: center; transition: color 0.2s ease; }
.gate-msg.bad { color: var(--danger); }
.gate-msg.ok { color: var(--success); }
.gate-chip {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 0; opacity: 0; overflow: hidden;
    font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; letter-spacing: 0.04em;
    color: var(--success);
    background: rgba(62, 207, 142, 0.08);
    border: 1px solid transparent;
    border-radius: 10px;
    transition: height 0.4s var(--ease), opacity 0.35s ease 0.1s, margin 0.4s var(--ease), border-color 0.3s;
}
.gate-chip.show { height: 36px; opacity: 1; margin-bottom: 14px; border-color: rgba(62, 207, 142, 0.3); }
.gate-chip svg { width: 15px; height: 15px; }
.gate-discord { max-height: 0; overflow: hidden; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity 0.4s var(--ease) 0.25s, transform 0.4s var(--ease) 0.25s, max-height 0.4s var(--ease); }
.gate-discord.show { max-height: 120px; opacity: 1; transform: none; pointer-events: auto; }
.gate-discord .gate-sub { margin-top: 12px; font-size: 12px; color: var(--text-dim); text-align: center; }
.discord-btn { display: flex; align-items: center; justify-content: center; gap: 9px; }
.discord-btn svg { width: 17px; height: 17px; flex: none; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-card { transition: height 0.4s var(--ease); }

/* ---------- Licenses as credentials: pending keys, key dialogs ---------- */
.badge.warn { background: rgba(232,179,57,0.14); color: #e8b339; }
.lic-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding: 10px 14px; background: rgba(232,179,57,0.07); border: 1px solid rgba(232,179,57,0.25); border-radius: 10px; font-size: 13px; color: #e8b339; }
.modal-keylist { margin: 14px 0 4px; max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.kl-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.kl-row:last-child { border-bottom: 0; }
.kl-name { flex: none; color: var(--text-dim); white-space: nowrap; }
.kl-key { flex: 1; min-width: 0; color: var(--text); font-weight: 600; letter-spacing: 0.03em; user-select: all; overflow-wrap: break-word; word-break: break-all; text-align: right; }
/* No "Developer key"/"User key" caption to align away from -- the key reads left-to-right like any
   other value instead of being pinned to the right edge of an otherwise-empty row. */
.kl-row--plain .kl-key { text-align: left; }
.kl-copy { flex: none; width: 26px; height: 26px; }
.kl-copy svg { width: 14px; height: 14px; }
.kl-copy.copied { color: var(--success); }
.modal-key-row--end { justify-content: flex-end; }
.modal-key-row--end .modal-copy { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; font-size: 12px; }
.modal-key-row--end .modal-copy svg { width: 14px; height: 14px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Licenses: people and their keys ---------- */
.grow { flex: 1; }
.acct-list { display: flex; flex-direction: column; gap: 8px; }
.acct, .inv-row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.15s ease; }
.acct:hover, .acct.open { border-color: #333; }
.acct.paused .acct-head { opacity: 0.6; }
.acct-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; border-radius: 12px; user-select: none; }
.acct-head:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.avatar { position: relative; width: 36px; height: 36px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); }
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.role-admin { background: rgba(229,72,77,0.12); border-color: rgba(229,72,77,0.3); color: #ff7b80; }
.avatar.role-moderator { background: rgba(240,136,62,0.12); border-color: rgba(240,136,62,0.3); color: #f5a266; }
.avatar.role-user { background: rgba(79,157,255,0.12); border-color: rgba(79,157,255,0.3); color: #7ab6ff; }
.acct-id { flex: 1; min-width: 0; }
.acct-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
.acct-sub { margin-top: 3px; font-size: 12.5px; color: var(--text-dim); }
.disc { color: var(--text-faint); }
.disc.on { color: var(--text-dim); }
.disc.on::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #7b8cff; vertical-align: 1px; }

.chev { width: 18px; height: 18px; flex: none; color: var(--text-faint); transition: transform 0.25s var(--ease); }
.chev svg { display: block; width: 18px; height: 18px; }
.acct.open .chev { transform: rotate(180deg); }
/* Right padding trimmed to 4px (not the 16px the left side keeps) -- stacked on top of .key's own
   right padding below, the full 16px here was pushing each key row's trailing icon group a good
   30px short of the block's own right edge, visibly out of line with the "+" New user button
   sitting right above it. 4px still leaves the card its own border, the rest of the alignment
   comes from trimming .key's padding to match. */
.acct-body { padding: 4px 4px 16px 16px; }

.acct-empty, .no-keys { padding: 22px 0; text-align: center; font-size: 13px; }

/* one key */
.keys { display: flex; flex-direction: column; gap: 10px; }

.inv-row { display: flex; align-items: center; gap: 14px; padding: 10px 16px; }

/* dialogs with fields */
.modal-form { max-width: 420px; }
.form-fields { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.field-hint { font-size: 12px; color: var(--text-faint); }
.field input { height: 38px; padding: 0 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font: inherit; font-size: 13.5px; }
.field input:hover { border-color: #333; }
.field input:focus { outline: none; border-color: var(--text-dim); }
.field input::placeholder { color: var(--text-faint); }
/* The type selector used to size to its own content (align-self: flex-start), so it sat noticeably
   shorter than the input bars above and below it. Stretched to the field's full width instead, with
   its segments sharing that width equally, so it reads as one more bar the same length as the rest. */
.field .seg { align-self: stretch; width: 100%; }
.field .seg button { flex: 1; justify-content: center; }

.modal-form .form-msg { margin: 0; }
.modal-form .modal-actions { margin-top: 4px; }

.form-fields .field { flex: none; min-width: 0; max-width: none; }
.form-fields .field .field-hint { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }

/* ================= Two tab rails: Admin and Bot ================= */
/* Replaces the single underlined bar. Each group is a labelled pill track with its own sliding
   thumb. The group that holds the open tab is lit; the other one rests dimmed until hovered. */
.tabbar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 9px 16px;
    padding: 13px 24px 11px;
    overflow: visible;
    border-bottom: 1px solid var(--border);
}
.tabgroup { display: flex; flex-direction: column; gap: 7px; opacity: 0.55; transition: opacity 0.25s ease; }
.tabgroup.lit, .tabgroup:hover, .tabgroup:focus-within { opacity: 1; }
.tg-label {
    display: inline-flex; align-items: center; gap: 7px;
    padding-left: 6px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-faint);
    transition: color 0.25s ease;
}
.tg-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); transition: background-color 0.42s var(--ease), box-shadow 0.42s var(--ease); }
.tabgroup.lit .tg-label { color: var(--text-dim); }
/* Per-tab dot/pill color lives further down, on --g/--g-text (see "Rails keep their own colour"
   below) -- it used to be a flat per-GROUP color set right here, now it's set inline per tab by
   placeTabIndicator() in index.js and just fades between tabs via the transitions above. */

.tg-track {
    position: relative;
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: border-color 0.42s var(--ease), box-shadow 0.42s var(--ease);
}
.tabgroup.lit .tg-track { border-color: #343434; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45); }
.tabgroup[data-group="bot"].lit .tg-track { border-color: rgba(79, 157, 255, 0.35); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(79, 157, 255, 0.06) inset; }

.tg-track .tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 9px;
    font-size: 12.5px;
    color: var(--text-faint);
    transition: color 0.42s var(--ease);
}
.tg-track .tab:hover { color: var(--text); }
.tg-track .tab.active { color: var(--white); }

/* The sliding thumb of a group (absolute inside .tg-track; placed by placeTabIndicator). Its
   color fades to whichever tab is active (see --g/--g-text, set per-tab in index.js) rather than
   staying one flat color per group -- background-color/border-color are the transition here
   on purpose: --g itself can't be animated (custom properties don't interpolate by default), but
   the properties that consume it can. */
.tg-track .tab-ind {
    position: absolute;
    top: 4px; bottom: 4px; left: 0;
    height: auto; width: 0;
    background: #262626;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    opacity: 0;
    z-index: 0;
    transition: background-color 0.42s var(--ease), border-color 0.42s var(--ease);
}
.tabgroup.lit .tab-ind { opacity: 1; }
.tg-track .tab-ind.animate { transition: transform 0.34s var(--ease), width 0.34s var(--ease), opacity 0.2s ease, background-color 0.42s var(--ease), border-color 0.42s var(--ease); }

.tg-sep { align-self: stretch; width: 1px; margin: 22px 0 4px; background: linear-gradient(to bottom, transparent, var(--border) 30%, var(--border) 70%, transparent); }

@keyframes badge-pulse { 0% { box-shadow: 0 0 8px rgba(255, 90, 96, 0.8), 0 0 0 0 rgba(229, 72, 77, 0.55); } 70% { box-shadow: 0 0 8px rgba(255, 90, 96, 0.8), 0 0 0 7px rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 8px rgba(255, 90, 96, 0.8), 0 0 0 0 rgba(229, 72, 77, 0); } }

@media (max-width: 760px) {
    .tabbar { padding: 12px 14px; gap: 12px; }
    .tg-sep { display: none; }
    .tabgroup { width: 100%; opacity: 1; }
    .tg-track { display: flex; overflow-x: auto; scrollbar-width: none; }
    .tg-track .tab { flex: 1 0 auto; justify-content: center; padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
 .tg-track .tab-ind.animate { transition: none; } }

/* ================= Security tab ================= */
.sec-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .sec-grid { grid-template-columns: 1fr; } }
.card .value .of { font-size: 14px; font-weight: 500; color: var(--text-faint); margin-left: 4px; }
.card.tone-crit { border-color: rgba(229, 72, 77, 0.45); }
.card.tone-crit .value { color: #ff7b80; }
.card.tone-warn .value { color: var(--warning); }
.card.tone-ok .value { color: var(--success); }

.inst-list { display: flex; flex-direction: column; gap: 8px; }

/* Two visual rows, not three: name+count on top, the bar and its instance count share the second
   row (count right-aligned past the bar) instead of the count getting a whole line to itself. */
.mod-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 7px; padding: 11px 2px; border-bottom: 1px solid var(--border); }
.mod-row:last-child { border-bottom: 0; }
.mod-name { font-weight: 600; font-size: 13px; }
.mod-num { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--text-dim); }
.bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3d86e6, #7ab6ff); transition: width 0.4s var(--ease); }
.mod-sub { font-size: 11px; color: var(--text-faint); white-space: nowrap; }

/* Event log (the Security tab's "Event" block): the same row shape as Checkout/Session -- User
   (Discord picture + name) first, then the Risk and Type columns, then Details, and the view + bin
   icons at the far right (same pattern as every other table in this app). tr.read dims a row once
   it's acknowledged, the same way a session or checkout row never gets a dedicated "read" column of
   its own either. */
.ev-detail { min-width: 0; }
.ev-table tr.read { opacity: 0.55; }
/* A checkout the owner has hidden from their own view, as admin/moderator still see it (same
   dimming idea as tr.read above) -- the row and its data are otherwise completely normal, just
   visually set apart as "they let this go". */
#checkoutsConfirmedBody tr.row-hidden { opacity: 0.55; }

.alert-count { font-size: 11px; font-weight: 700; color: var(--text-dim); background: rgba(255, 255, 255, 0.07); padding: 1px 7px; border-radius: 999px; margin-left: 8px; }
.hook-note { font-size: 12px; color: var(--text-faint); }
.hook-note.on { color: var(--success); }
.more-row { display: flex; justify-content: center; margin-top: 12px; }

/* ================= Settings tab ================= */
.meter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.store-body { display: flex; flex-direction: column; }

/* Provider pill (Discord/AYCD): same .badge.muted pill, with an icon ahead of the text. Discord's
   mark is a single currentColor path (tinted via .p-discord); AYCD's carries its own brand red as
   a hardcoded fill, so .p-aycd only tints its text, and its icon is sized up since it's a more
   detailed interlocking-gear outline that needs the extra pixels to read clearly this small. */
.badge.muted.provider { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; }
.badge.muted.provider svg { width: 11px; height: 11px; flex: none; display: block; }
.badge.muted.provider.p-discord { color: #a8b6ff; }
.badge.muted.provider.p-aycd { color: #ff8a73; padding-left: 4px; }
.badge.muted.provider.p-aycd svg { width: 18px; height: 18px; }
.tg-track .tab-ind { transition: opacity 0.2s ease; }
/* A hidden control stays hidden even where a button style sets its own display. */
button[hidden] { display: none !important; }

.tabbar-end { margin-left: auto; align-self: flex-end; display: flex; align-items: center; gap: 10px; padding-bottom: 1px; }
.tabbar-end-label { font-size: 12px; color: var(--text-faint); letter-spacing: .02em; }
.tabbar-end .seg button { padding: 0 16px; }
.tabbar-end .seg button:disabled { opacity: 1; }
@media (max-width: 900px) { .tabbar-end { margin-left: 0; } }

/* ================= Stat-card icons, request chips, people rows, tables, empty states ================= */
.card { position: relative; }
.card-ico { position: absolute; top: 16px; right: 18px; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.card-ico svg { width: 19px; height: 19px; }
.card:has(.card-ico) .value { padding-right: 46px; }
.ico-blue { background: rgba(79, 157, 255, 0.14); color: #7ab6ff; }
.ico-green { background: rgba(79, 209, 165, 0.14); color: #4fd1a5; }
.ico-amber { background: rgba(245, 185, 79, 0.14); color: #f5b94f; }
.ico-red { background: rgba(229, 72, 77, 0.15); color: #ff7b80; }
.ico-violet { background: rgba(167, 139, 250, 0.15); color: #b9a4fb; }

/* Just the colored word, no pill -- same "text carries the meaning, not a background chip" look as
   the Risk/Status columns next to it. */
.m-chip { display: inline-block; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.m-get { color: #7ab6ff; }
.m-post { color: #4fd1a5; }
.m-put { color: #f5b94f; }
.m-del { color: #ff7b80; }

/* Column alignment by what the column IS, not by its position -- a positional nth-child rule
   silently points at the wrong column the next time a table's columns are reordered or one is
   added (exactly what happened here: these used to target Price/Quantity by counting cells, and
   went stale the moment Checkout gained a User column and had Price move). th and td share the
   same class so a header and its data always line up without having to keep two rules in sync. */
#panel-overview table th.num, #panel-overview table td.num { text-align: center; }
/* Checkout's short columns -- quantity, price, status -- are centered; the rest follow the left default. */
#panel-checkouts table th.qty, #panel-checkouts table td.qty,
#panel-checkouts table th.price, #panel-checkouts table td.price,
#panel-checkouts table th.status-col, #panel-checkouts table td.status-col { text-align: center; }
#panel-checkouts table th.price, #panel-checkouts table td.price { font-weight: 600; }
#panel-checkouts table td.strong { font-weight: 600; }
#panel-accounts table th.status-col, #panel-accounts table td.status-col,
#panel-sessions table th.status-col, #panel-sessions table td.status-col { text-align: center; }

/* The Site column (and the Site line of Queue's merged cell): a short site identifier -- axs, mlb,
   ticketmaster -- shown as typed, not forced to capitals, the same convention wherever a site/host
   value appears: Checkout, Account, Session (table and per-user summary) and Queue. */
.site-cell { letter-spacing: 0.02em; }
/* A plain count/figure cell (Queue's Used and Expires, Checkout's Quantity and Price, the per-user
   Sessions/Accounts summary count) -- same font and size as before, just not full-bright white, so
   it reads as data sitting in the row rather than a headline. Site names, paths and Type codes stay
   at full brightness; only these. */
.mono.col-center, .mono.qty, .mono.price, .mono.num { color: var(--text-dim); }
tbody tr:not(.empty-row):not(.session-detail-row):not(.lic-detail) td:first-child { transition: box-shadow 0.12s ease; }
tbody tr:not(.empty-row):not(.session-detail-row):not(.lic-detail):hover { background: rgba(255, 255, 255, 0.035); }
tbody tr:not(.empty-row):not(.session-detail-row):not(.lic-detail):hover td:first-child { box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.9); }

.avatar { overflow: visible; }
.avatar-img { border-radius: 50%; }
.acct-head .avatar::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: #3a3a3a; border: 2px solid #111; }
.acct.is-online .avatar::after { background: var(--success); box-shadow: 0 0 8px rgba(79, 209, 165, 0.7); }

.empty-box { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 10px; text-align: center; color: var(--text-dim); font-size: 12.5px; }
.empty-box b { font-weight: 600; font-size: 14px; color: var(--text); }
.empty-ico { width: 42px; height: 42px; margin-bottom: 8px; border-radius: 13px; display: grid; place-items: center; background: #1a1a1a; border: 1px solid var(--border); color: var(--text-dim); }
.empty-ico svg { width: 21px; height: 21px; }
.empty-row td { padding: 8px 10px; }

/* One rectangle instead of a row of separate cards: a big donut on the left, small stat tiles
   top-right, the request-volume chart filling the rest of the right side underneath them.
   #overviewCards keeps its id for the JS that targets it, but it now holds a single .ov-panel,
   not a grid of .card children -- display: block (an id beats .cards' specificity outright)
   cancels the old card-grid behavior entirely. */
#overviewCards { display: block; margin-bottom: 20px; }

.ov-panel {
    display: grid;
    grid-template-columns: minmax(170px, 210px) 1fr;
    gap: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
}
.ov-panel-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding-right: 26px;
    border-right: 1px solid var(--border);
}
/* The activity ring is now a real SVG (one <path> wedge per category) instead of a CSS
   conic-gradient circle -- that's what lets each wedge carry its own hover tooltip via data-tip
   (see showChartTip/hideChartTip in index.js). No center total and no legend rows underneath
   any more: hovering a wedge is the only way to read a category's count, by design. */
.donut-svg-wrap { width: 148px; height: 148px; flex: none; }
.donut-svg-wrap svg { width: 100%; height: 100%; overflow: visible; }
.donut-svg-wrap path { cursor: default; transition: filter 0.12s ease; }
.donut-svg-wrap path:hover { filter: brightness(1.15); }

.ov-panel-right { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ov-stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
/* Sizing/icon/value/label now all come from .card--accent -- the same stat-card component the
   Security and License tabs use -- so these tiles stop being a visibly smaller, separate thing.
   This rule only adds what's specific to sitting in a flexible row here. */
.ov-stat { flex: 1; min-width: 148px; }

.ov-chart-row { flex: 1; display: flex; flex-direction: column; min-height: 90px; }
/* The histogram is the whole story here now -- no "N requests, last hour / avg Xms / N errors"
   printed line above or below it -- so it stretches to fill whatever space the row actually has
   next to the stat cards, rather than sitting at a fixed height with dead space left over. A
   smooth filled sparkline reads less noisy than a bar-per-minute histogram at this width; each
   minute is still readable individually via its own hover tooltip. */
.ov-trend-big { flex: 1; min-height: 110px; position: relative; }
.ov-trend-big svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ov-trend-big circle { cursor: default; }

@media (max-width: 860px) {
    .ov-panel { grid-template-columns: 1fr; }
    .ov-panel-left { flex-direction: row; justify-content: flex-start; border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 20px; }
    .ov-stats-row { flex-wrap: wrap; }
}

/* Shared floating tooltip for interactive chart pieces (donut wedges, sparkline points) -- one
   element, reused by whichever chart is on screen, positioned at the pointer via JS. */
.chart-tip {
    position: fixed; pointer-events: none; z-index: 60; opacity: 0;
    background: #1c1c1c; border: 1px solid var(--border); border-radius: 8px;
    padding: 7px 10px; font-size: 12px; color: var(--text); white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -130%); transition: opacity 0.08s ease;
}
.chart-tip b { margin-left: 6px; font-feature-settings: "tnum" 1; }
.chart-tip-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }

/* ---------- User Overview: latest-checkouts / latest-sessions lists under the panel ---------- */
.ov-sub { margin-top: 2px; font-size: 11px; color: var(--text-faint); }
.ov-sub.warn { color: var(--warning); }
.ov-lists { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; }
.ov-lists .block { margin-bottom: 0; }
.ov-rows { display: flex; flex-direction: column; }
.ov-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); font-size: 13px; }
.ov-row:first-child { border-top: 0; padding-top: 2px; }
.ov-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-align: left; }
.ov-sub2 { display: block; margin-top: 2px; font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; }
.ov-dim { color: var(--text-dim); font-feature-settings: "tnum" 1; }
.ov-lists .block-head { margin-bottom: 10px; }
@media (max-width: 900px) { .ov-lists { grid-template-columns: minmax(0, 1fr); } }

/* ---------- User License tab: the account (Discord) above the keys linked to it ---------- */
.me-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.me-avatar .avatar { width: 52px; height: 52px; font-size: 16px; overflow: visible; }
.me-avatar .avatar-img { border-radius: 50%; }
.me-avatar .avatar::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; background: #3a3a3a; border: 2px solid var(--surface); }
.me-avatar.linked .avatar::after { background: var(--success); box-shadow: 0 0 8px rgba(79, 209, 165, 0.6); }
.me-id { flex: 1; min-width: 180px; text-align: left; }
.me-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.me-discord { margin-top: 4px; font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.me-stats { display: flex; }
.me-stats div { display: flex; flex-direction: column; }
.me-stats b { font-size: 18px; font-weight: 600; font-feature-settings: "tnum" 1; }
.me-stats span { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.me-sub { margin: 20px 0 10px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-faint); text-align: left; }
@media (max-width: 720px) { .me-stats { width: 100%; justify-content: flex-start; } .me-stats div { align-items: flex-start; } }
.me-discord .live { margin-right: 0; }
.ov-lists .block-head { align-items: center; }
.ov-lists .block-head h2 { line-height: 28px; font-size: 15px; }
.ov-lists .block-head { flex-wrap: nowrap; min-height: 28px; border-bottom: none; padding-bottom: 0; }
.ov-lists .block-head .text-btn { margin: 0; }
.ov-lists .block-head h2 { margin: 0; }
/* The two mini list headers ("Latest Checkout"/"Latest Session") also carry the title-pulse
   dot+underline now -- that needs two lines, so the fixed single-line height above is relaxed
   just for them instead of clipping the underline. */
.ov-lists .block-head h2.title-pulse { line-height: 1.3; gap: 3px; }
.ov-lists .block-head:has(h2.title-pulse) { height: auto; align-items: flex-start; padding-top: 1px; }

/* Same 26x26 icon button as everywhere else in the dashboard (Session/Account row actions, etc.)
   -- it used to be shrunk to 24px and nudged with a negative margin, which just made it a
   slightly-off-size one-off instead of matching its siblings elsewhere. */

/* The User column: Discord picture and name. */
.person { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; }
.person .avatar { width: 22px; height: 22px; font-size: 10px; }
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dates in tables: time on top, small date below. */
.dt { display: inline-flex; flex-direction: column; gap: 1px; line-height: 1.25; white-space: nowrap; }
.dt-time { color: var(--text-dim); font-size: 13px; font-feature-settings: "tnum" 1; }
.dt-date { color: var(--text-faint); font-size: 11px; font-feature-settings: "tnum" 1; }

/* Each rail's dot/pill/outline fade to whichever tab inside it is active (--g/--g-text, a plain
   RGB triplet + hex, set inline per tab by placeTabIndicator() in index.js from that tab's own
   data-color) instead of staying one flat colour per group. The values below are just the
   fallback shown before JS has run once -- JS always overrides them immediately after. */
.tabgroup[data-group="admin"] { --g: 79, 157, 255; --g-text: #4f9dff; }
.tabgroup[data-group="bot"] { --g: 216, 186, 88; --g-text: #d8ba58; }
.tabgroup .tg-dot { background: rgb(var(--g)); }
.tabgroup[data-group] .tg-dot { background: rgb(var(--g)); }
.tabgroup[data-group].lit .tg-dot { background: rgb(var(--g)); box-shadow: 0 0 0 3px rgba(var(--g), 0.2); }
.tabgroup[data-group].lit .tg-track { border-color: rgba(var(--g), 0.4); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(var(--g), 0.06) inset; }
.tabgroup[data-group] .tab-ind { background: rgba(var(--g), 0.16); border-color: rgba(var(--g), 0.42); }
.tabgroup[data-group] .tab.active { color: var(--g-text); }

/* License, account card: the two numbers sit in equal columns, centred over their labels, with a divider. */
.me-stats { gap: 0; margin-left: auto; align-items: stretch; }
.me-stats div { align-items: center; justify-content: center; min-width: 118px; padding: 2px 22px; text-align: center; }
.me-stats div + div { border-left: 1px solid var(--border); }
.me-stats div:last-child { padding-right: 0; }
@media (max-width: 720px) { .me-stats { margin-left: 0; } .me-stats div { align-items: flex-start; text-align: left; padding-left: 0; min-width: 0; } .me-stats div + div { padding-left: 22px; } }

/* Welcome after a login: the logo over the blurred dashboard, a soft amber glow, then it goes. */
.intro { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; animation: intro-veil 2.6s ease both; }
.intro img { width: min(34vw, 300px); height: auto; opacity: 0; animation: intro-logo 2.6s ease both; }
@keyframes intro-veil {
    0% { opacity: 0; -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); background: rgba(11, 11, 11, 0); }
    15% { opacity: 1; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); background: rgba(11, 11, 11, 0.6); }
    80% { opacity: 1; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); background: rgba(11, 11, 11, 0.6); }
    100% { opacity: 0; -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); background: rgba(11, 11, 11, 0); }
}
@keyframes intro-logo {
    0% { opacity: 0; transform: scale(0.92); filter: drop-shadow(0 0 0 rgba(245, 185, 79, 0)); }
    20% { opacity: 1; filter: drop-shadow(0 0 0 rgba(245, 185, 79, 0)); }
    45% { transform: scale(1.04); filter: drop-shadow(0 0 14px rgba(245, 185, 79, 0.4)); }
    70% { opacity: 1; transform: scale(1.06); filter: drop-shadow(0 0 5px rgba(245, 185, 79, 0.15)); }
    100% { opacity: 0; transform: scale(1.08); filter: drop-shadow(0 0 0 rgba(245, 185, 79, 0)); }
}
@media (prefers-reduced-motion: reduce) { .intro { display: none; } }

/* Accounts tab -- Pending/Completed reuse the shared st-pending/st-completed colors defined above
   (same palette as Checkout), only Banned needs its own color. */
.st-banned { --st: 255, 95, 102; }

/* Sessions tab Status column -- derived client-side from expires_at (see sessionStatusBadge in
   index.js): green while there's plenty of runway or no expiry at all, yellow inside the 24h
   window, grey if it ever actually lapses (reads already hide expired rows server-side, so this
   last one is mostly defensive). */
.st-session-refreshed { --st: 79, 209, 165; }

.st-session-expired { --st: 154, 154, 158; }

/* the add / edit dialog is wider and lays its fields out in two columns */
.modal-form--wide { max-width: 620px; max-height: calc(100vh - 48px); overflow-y: auto; }
.modal-form--wide .form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.modal-form--wide .form-fields .field { grid-column: 1 / -1; }
.modal-form--wide .form-fields .field.half { grid-column: auto; }
.modal-form--wide .form-fields .form-msg, .modal-form--wide .form-fields .modal-actions { grid-column: 1 / -1; }
.field input[readonly] { opacity: 0.55; cursor: not-allowed; }

/* ================================================================
   Dashboard-wide redesign pass: accent-bar stat cards, the icon-chip
   action button, click-to-reveal rows and the live filter pills.
   ================================================================ */

/* Stat cards: a left-to-right gradient wash in the metric's own tone, fading to black toward the
   right edge of the card, plus a left accent bar and an icon chip in the same color. Icon and the
   value/label block now sit on a strict two-column grid (not a flex row centered against a
   two-line block of uneven line-heights), so the icon no longer drifts off-center and "0 / 6"
   styled values no longer sit at an odd baseline. */
.card--accent {
    display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px;
    border-left: 3px solid var(--accent-c, var(--border)); padding: 12px 16px;
    background: linear-gradient(92deg, var(--surface) 0%, color-mix(in srgb, var(--accent-c, var(--border)) 16%, var(--surface)) 115%);
}
.card--accent .card-ico {
    position: static; width: 34px; height: 34px; border-radius: 9px; flex: none;
    background: color-mix(in srgb, var(--accent-c, var(--border)) 24%, transparent);
    color: var(--accent-c, var(--text-dim));
    display: flex; align-items: center; justify-content: center;
}
.card--accent .card-ico svg { width: 17px; height: 17px; }
.card--accent .card-body { min-width: 0; }
.card--accent .card-body .value { padding-right: 0; display: flex; align-items: baseline; gap: 5px; font-size: 21px; font-weight: 700; line-height: 1; color: var(--accent-c, var(--text)); font-feature-settings: "tnum" 1; }
.card--accent .card-body .value .of { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.card--accent .card-body .label { margin-top: 4px; line-height: 1; font-size: 11px; color: var(--text-dim); }

/* License account rows: left accent border by role. */
.acct { border-left: 3px solid var(--text-faint); }
.acct[data-role="admin"] { border-left-color: #ff7b80; }
.acct[data-role="moderator"] { border-left-color: #f5a266; }
.acct[data-role="user"] { border-left-color: #7ab6ff; }

/* Live filter pills: a field only lights up once it holds a value, so the
   active ones are the ones that catch the eye. */
.filter-pill {
    display: inline-flex; align-items: center; height: 36px; border-radius: 8px;
    border: 1px solid var(--border); background: transparent; padding: 0 4px 0 10px;
    /* Grow AND shrink together with every other pill on the row, now that the row never wraps --
       the old bug was a pill landing alone on a wrapped second row and growing to fill it by
       itself (e.g. "All users" spanning the full width); with nowrap every pill always shares the
       row with its siblings, so a few pills grow evenly to use the space and many shrink evenly
       (down to min-width) to fit it, rather than any one of them stretching or being clipped alone. */
    flex: 1 1 140px; min-width: 100px;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.filter-pill input, .filter-pill select {
    /* text-faint, not text-dim -- "All categories" etc. is the unset state of this field, the
       same as an input's own placeholder, so it should read exactly as dim as one. */
    border: none; background-color: transparent; height: 100%; color: var(--text-faint);
    font-size: 12.5px; outline: none; padding: 0; flex: 1; min-width: 0; width: 100%;
}
.filter-pill input { padding: 0 6px 0 0; }
.filter-pill select { padding: 0 26px 0 0; }
/* The browser's own number spinner is sized for a full-height input, not this 36px-tall pill --
   left alone it towers over the field's own text. Hide it and draw a tiny matching pair instead. */
.filter-pill input[type="number"] { padding-right: 2px; -moz-appearance: textfield; }
.filter-pill input[type="number"]::-webkit-inner-spin-button,
.filter-pill input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.num-pill { padding-right: 6px; }
.num-spin { display: flex; flex-direction: column; justify-content: center; gap: 1px; flex: none; }
.num-spin button {
    appearance: none; border: none; background: transparent; color: var(--text-faint);
    width: 14px; height: 11px; padding: 0; display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 3px;
}
.num-spin button:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.num-spin button svg { width: 9px; height: 9px; display: block; }
.filter-pill.active .num-spin button { color: var(--text-dim); }
.filter-pill.active { border-color: var(--success); background-color: rgba(79, 209, 165, 0.08); }
.filter-pill.active input, .filter-pill.active select { color: var(--text); }
/* The multi-select ("N selected") dropdown replaces the native <select> with its own trigger
   button, which otherwise carries its own border+background (meant for standalone use) and sits
   as a second, taller box nested inside this pill. Strip that back so it blends in exactly like
   a plain .filter-pill select does, and let .filter-pill.active light up the whole pill instead
   of nothing visibly changing. */
.filter-pill .cselect { height: 100%; flex: 1; min-width: 0; }
.filter-pill .cselect-trigger {
    height: 100%; width: 100%; min-width: 0; max-width: none; border: none; background: transparent;
    padding: 0 6px 0 0; gap: 4px; color: var(--text-faint); font-size: 12.5px;
}
.filter-pill.active .cselect-trigger { color: var(--text); }
.filter-pill .cselect-trigger svg { width: 12px; height: 12px; }

/* Price-range filter: the slider and both number fields sit inline in the filter row at all
   times, same as every other field here -- always visible reads better than collapsing behind a
   click, even though it means a fixed-width strip of the row while unset. Wrapped in a bordered
   pill (.pf) like .filter-pill so it belongs to the same row visually and lights up the same way
   (border + tint) once a non-default range is set. */
.pf {
    position: relative; flex: none; display: inline-flex; align-items: center; gap: 10px;
    height: 36px; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; transition: border-color 0.12s ease, background-color 0.12s ease;
}
.pf:hover { border-color: #333; }
.pf.is-active { border-color: var(--success); background-color: rgba(79, 209, 165, 0.07); }
/* Only Queue's usage filter needs this -- Checkout's price range reads as "price" purely from its
   position in the row (between Quantity and Status), but a bare "0 - 20" would be ambiguous there,
   so this one small-caps label carries the field name the way every other filter's option text does. */
.pf-filter-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); flex: none; }
.pf-slider { position: relative; width: 108px; height: 18px; flex: none; touch-action: none; }
.pf-track { position: absolute; left: 2px; right: 2px; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: #2c2c2c; }
.pf-fill { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--success); }
.pf-nums { display: flex; align-items: center; justify-content: center; gap: 5px; flex: none; width: 128px; }
/* Scoped as .filters .pf-num (not just .pf-num): the page has a generic ".filters input, .filters
   select" rule (height 36px, padding 0 12px, 10px radius, 13px font) that's a closer match for the
   DOM (class+type selector) than a single class, so it was silently winning the cascade here and
   squeezing this field's digits into the wrong padding/size. Adding the .filters ancestor class
   gives this rule one more class than that one, so it wins instead. */
.filters .pf-num {
    /* The page-wide border-box reset would otherwise eat into the "Nch" width this control sets
       in JS (padding+border counted inside it), clipping the digits -- override back to content-box
       so "Nch" means pure glyph width, same fix as the approved mockup. */
    box-sizing: content-box; min-width: 30px; height: 22px; border-radius: 5px; border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04); color: var(--text); font-family: var(--font-mono);
    /* font-weight 600 to match td.price.mono in the table below -- same mono stack and size were
       already shared, but this field was rendering at the default 400, visibly thinner than the
       price figures it's filtering by. */
    font-size: 12px; font-weight: 600; text-align: center; outline: none; padding: 0 2px; -moz-appearance: textfield;
    transition: width 0.1s ease;
}
.filters .pf-num::-webkit-inner-spin-button, .filters .pf-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.filters .pf-num:hover { border-color: #333; }
.filters .pf-num:focus { border-color: var(--success); background: rgba(255, 255, 255, 0.06); outline: none; }
.pf-dash { color: var(--text-faint); font-size: 12px; }
.pf-thumb {
    /* Same color as .pf-fill (the track's filled portion) instead of a plain white dot, so the
       handle reads as part of the same colored element it rides on, per-tab accent included.
       Deliberately static: no hover/active scale or glow -- it looks the same at rest, hovered,
       and mid-drag. Only the cursor icon (grab / grabbing) still signals interactivity. */
    position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
    border-radius: 50%; background: var(--success); border: none; padding: 0; cursor: grab;
    box-shadow: none; opacity: 1;
}
/* It's a <button>, so without these it also picks up the site-wide generic "button:hover {
   opacity: .85 }" and "button:active { transform: scale(.97) }" -- that 15% fade is exactly the
   "translucent when in use" look that was rejected, and the mouse stays over/near the thumb
   throughout a drag so :hover is active the whole time, not just on arrival. */
button.pf-thumb:hover, button.pf-thumb:active:not(:disabled) { opacity: 1; transform: none; }
.pf-thumb:active { cursor: grabbing; }
.pf-thumb:focus-visible { outline: none; }
/* A filter funnel, not a "Clear" chip: always present, dim like an unset .filter-pill until a
   filter is actually applied, then it lights up the same green as the pills themselves (an Excel-
   style "filter is on" indicator) and clicking it while lit switches it back off and resets every
   field in the row. Same size/resting color as .icon-action (the Export/download button it always
   sits beside) so the two read as one family of icon buttons, not two different ones. */
.filter-clear {
    appearance: none;
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    padding: 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-dim); cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}
.filter-clear:hover { color: var(--text); border-color: var(--text-dim); background: #1c1c1c; }
.filter-clear.active { color: var(--success); border-color: var(--success); background-color: rgba(79, 209, 165, 0.08); }
.filter-clear.active:hover { background-color: rgba(79, 209, 165, 0.16); }
.filter-clear svg { width: 16px; height: 16px; display: block; }

/* Same idea as the ACO toggle: an "active filter" indicator reads as generic green everywhere,
   but each tab already has its own identity color (the stat cards, the title dot), so the filter
   funnel, the price slider and its focus rings pick up that same color per tab instead of one
   shared green -- the whole filter row then feels like it belongs to the tab it's in. */
#panel-checkouts .filter-clear.active { color: #d8ba58; border-color: #d8ba58; background-color: rgba(216, 186, 88, 0.08); }
#panel-checkouts .filter-clear.active:hover { background-color: rgba(216, 186, 88, 0.16); }
#panel-checkouts .pf.is-active { border-color: #d8ba58; background-color: rgba(216, 186, 88, 0.07); }
/* No active/focus glow override here on purpose: a translucent box-shadow ring around a solid
   ball reads as the ball itself going semi-transparent while dragging, which is exactly the
   "not 100% opaque when in use" look that was rejected -- the thumb is meant to look identical,
   fully solid, in every state. */
#panel-checkouts .pf-fill, #panel-checkouts .pf-thumb { background: #d8ba58; }
#panel-checkouts .filters .pf-num:focus { border-color: #d8ba58; }

#panel-accounts .filter-clear.active { color: #cf8c3e; border-color: #cf8c3e; background-color: rgba(207, 140, 62, 0.08); }
#panel-accounts .filter-clear.active:hover { background-color: rgba(207, 140, 62, 0.16); }

#panel-sessions .filter-clear.active { color: #c05f33; border-color: #c05f33; background-color: rgba(192, 95, 51, 0.08); }
#panel-sessions .filter-clear.active:hover { background-color: rgba(192, 95, 51, 0.16); }

#panel-queue .filter-clear.active { color: #a3382e; border-color: #a3382e; background-color: rgba(163, 56, 46, 0.08); }
#panel-queue .filter-clear.active:hover { background-color: rgba(163, 56, 46, 0.16); }
#panel-queue .pf.is-active { border-color: #a3382e; background-color: rgba(163, 56, 46, 0.07); }
#panel-queue .pf-fill, #panel-queue .pf-thumb { background: #a3382e; }
#panel-queue .filters .pf-num:focus { border-color: #a3382e; }

#panel-licenses .filter-clear.active { color: #d8ba58; border-color: #d8ba58; background-color: rgba(216, 186, 88, 0.08); }
#panel-licenses .filter-clear.active:hover { background-color: rgba(216, 186, 88, 0.16); }

/* Same per-tab-color treatment for the filter-pill selects. The search box's own "has-text" glow
   (below) outlines the whole rectangle -- icon and input together -- in the tab's color, rather
   than coloring the icon and a separate clear button independently. */
#panel-checkouts .filter-pill.active { border-color: #d8ba58; background-color: rgba(216, 186, 88, 0.08); }
#panel-checkouts .search-box.is-open, #panel-checkouts .search-box.has-text { border-color: #d8ba58; background-color: rgba(216, 186, 88, 0.07); box-shadow: 0 0 0 3px rgba(216, 186, 88, 0.12); }
#panel-checkouts .search-box.has-text .search-trigger { color: #d8ba58; }
#panel-checkouts .datepicker.is-active .datepicker-trigger { border-color: #d8ba58; background-color: rgba(216, 186, 88, 0.07); color: #d8ba58; }

#panel-accounts .filter-pill.active { border-color: #cf8c3e; background-color: rgba(207, 140, 62, 0.08); }
#panel-accounts .search-box.is-open, #panel-accounts .search-box.has-text { border-color: #cf8c3e; background-color: rgba(207, 140, 62, 0.07); box-shadow: 0 0 0 3px rgba(207, 140, 62, 0.12); }
#panel-accounts .search-box.has-text .search-trigger { color: #cf8c3e; }
#panel-accounts .datepicker.is-active .datepicker-trigger { border-color: #cf8c3e; background-color: rgba(207, 140, 62, 0.07); color: #cf8c3e; }

#panel-sessions .filter-pill.active { border-color: #c05f33; background-color: rgba(192, 95, 51, 0.08); }
#panel-sessions .search-box.is-open, #panel-sessions .search-box.has-text { border-color: #c05f33; background-color: rgba(192, 95, 51, 0.07); box-shadow: 0 0 0 3px rgba(192, 95, 51, 0.12); }
#panel-sessions .search-box.has-text .search-trigger { color: #c05f33; }
#panel-sessions .datepicker.is-active .datepicker-trigger { border-color: #c05f33; background-color: rgba(192, 95, 51, 0.07); color: #c05f33; }

#panel-queue .filter-pill.active { border-color: #a3382e; background-color: rgba(163, 56, 46, 0.08); }
#panel-queue .search-box.is-open, #panel-queue .search-box.has-text { border-color: #a3382e; background-color: rgba(163, 56, 46, 0.07); box-shadow: 0 0 0 3px rgba(163, 56, 46, 0.12); }
#panel-queue .search-box.has-text .search-trigger { color: #a3382e; }
#panel-licenses .search-box.is-open, #panel-licenses .search-box.has-text { border-color: #d8ba58; background-color: rgba(216, 186, 88, 0.07); box-shadow: 0 0 0 3px rgba(216, 186, 88, 0.12); }
#panel-licenses .search-box.has-text .search-trigger { color: #d8ba58; }

#panel-licenses .filter-pill.active { border-color: #d8ba58; background-color: rgba(216, 186, 88, 0.08); }

mark.fmatch { background: rgba(79, 209, 165, 0.25); color: var(--text); border-radius: 3px; padding: 0 1px; }

/* Per-tab keyword search (Queue/Checkout/Sessions/Accounts): one bordered rectangle holding both
   the magnifying-glass icon and the input, instead of two separate boxes with a separate "x" to
   clear -- the icon alone does both jobs now (click to open, click again to clear-and-collapse; see
   wireSearchToggle() in index.js). Collapsed, it's just the icon at rest; opening only grows the
   input's width inside the same rectangle, so the border never jumps or resizes abruptly. Filters
   client-side across every column already on screen, so it needs no server round trip. */
.search-box {
    display: inline-flex; align-items: center;
    height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-dim);
    transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}
.search-box:hover { border-color: var(--text-dim); }
.search-box .search-trigger {
    appearance: none; border: none; background: transparent; padding: 0; margin: 0;
    width: 36px; height: 36px; flex: none; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    color: inherit; cursor: pointer; transition: color 0.12s ease;
}
.search-box .search-trigger:hover { color: var(--text); }
.search-box .search-trigger svg { width: 16px; height: 16px; display: block; }
.search-box .search-trigger:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18); }
.search-box .search-input {
    width: 0; min-width: 0; border: none; background: transparent; color: var(--text);
    font-size: 13px; padding: 0; outline: none; opacity: 0;
    transition: width 0.16s ease, opacity 0.12s ease, padding 0.16s ease;
}
.search-box.is-open .search-input { width: 180px; padding-right: 12px; opacity: 1; }
.search-box.is-open, .search-box:focus-within { border-color: var(--text-dim); }
@media (max-width: 760px) { .search-box.is-open .search-input { width: 140px; } }

@media (max-width: 560px) { .modal-form--wide .form-fields .field.half { grid-column: 1 / -1; } }


/* =====================================================================================
   Symbols, and the parts of each tab that are built around them
   =====================================================================================
   Every action in the dashboard is a bare symbol: no background, no border, no shadow. A 32px
   hit area with a 16px glyph, the same colour for the same action on every tab. A symbol is
   drawn in two tones (see the action symbols in index.js); on hover the lighter half goes
   solid, and nothing is washed in behind it. The boxed buttons of a toolbar (search, date,
   clear filters, export, add) are a different family and keep their own look: .icon-action,
   .filter-clear, .search-box. */
button.sym {
    appearance: none; width: 32px; height: 32px; padding: 0; margin: 0; flex: none;
    border: none; border-radius: 8px; background: transparent; box-shadow: none;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-dim); cursor: pointer; font-weight: 400;
    transition: transform 0.1s ease, color 0.12s ease;
}
button.sym svg { display: block; flex: none; width: 16px; height: 16px; }
button.sym:hover { opacity: 1; background: transparent; }
button.sym:active:not(:disabled) { transform: scale(0.9); }
button.sym:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22); }
button.sym:disabled { opacity: 0.35; cursor: not-allowed; }
.sym-ic [opacity] { transition: opacity 0.12s ease; }
button:hover > .sym-ic [opacity] { opacity: 1; }

/* One colour per action. */
button.sym--delete { color: #e5484d; }
button.sym--shutdown { color: #ff7b80; }
button.sym--pause { color: #f5b94f; }
button.sym--resume { color: #4fd1a5; }
button.sym--refresh { color: #7ab6ff; }
button.sym--files { color: #b0b0b4; }
button.sym--copy { color: #c8c8cc; }
button.sym--edit { color: #c8c8cc; }
button.sym--compact { color: #5eb8ff; }
button.sym--allread { color: #4f9dff; }
button.sym--view { color: #ececea; }
button.sym--logout { color: #9a9a9e; }
button.sym--cancel { color: #b8c2cf; }
/* The bin is drawn a little smaller than the rest, so it does not stand out. */
button.sym--delete svg { width: 14px; height: 14px; }

/* Row actions: side by side with no gap (32px pitch), right-aligned, 16px from the table edge. */
.row-actions { gap: 0; flex-wrap: nowrap; justify-content: flex-end; }
td:last-child:has(.row-actions) { text-align: right; padding-right: 8px; }
td .sym { margin-top: -5px; margin-bottom: -5px; vertical-align: middle; }
.bulk-bar .sym { margin: -4px 0; }

.modal-key-row .sym, .kl-row .sym { flex: none; }

/* A "more" control under a list: the arrow and how many more there are. */
.more-count { align-items: center; gap: 4px; color: var(--text-dim); font-size: 12px; font-feature-settings: "tnum" 1; }
.more-row[hidden] { display: none; }

/* ---------- Top bar ---------- */
/* The Security badge: a bare number in the colour of the tab that is open (--tab-c, set in
   index.js). No dot and no background. */
.tab-badge { margin-left: 8px; font-size: 12px; font-weight: 600; line-height: 1; color: var(--tab-c, var(--text-dim)); font-feature-settings: "tnum" 1; transition: color 0.3s ease; }
.tab-badge[hidden] { display: none; }
/* The "View as" switch never takes the colour of the open tab: the chosen side is a mid grey
   with dark text, the other one grey text. */
.tabbar-end .seg button { color: #8e8e93; }
.tabbar-end .seg button.on { background: #8f8f95; color: #0a0a0a; font-weight: 600; }

/* ---------- Overview ---------- */
/* The status code of a request is the number in its colour, with no dot before it. */
#overviewRequestsBody .badge.st::before { content: none; }

/* ---------- Labelled values (an instance card, a machine's details) ---------- */
.fld { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fld-l { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; }
.fld-v { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fld-v.mono { font-family: var(--font-mono, "SF Mono", Menlo, Consolas, monospace); font-size: 12.5px; font-feature-settings: "tnum" 1; }
.up-counter { font-feature-settings: "tnum" 1; }

/* ---------- Security ---------- */
/* Instance and Task sit side by side at the same height. */
.sec-grid { align-items: stretch; }
.sec-grid > .block { margin-bottom: 18px; }
/* One instance: picture (with a status dot) and name, the two actions at the top right, the
   labelled fields across the card, then what it runs. The left edge is the tab's own red. */
.inst {
    display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 10px;
    padding: 14px 10px 14px 16px; background: var(--surface-2);
    border: 1px solid var(--border); border-left: 3px solid var(--text-faint); border-radius: 12px;
}
.inst.is-online, .inst.is-closing { border-left-color: var(--danger-text); }
.inst.is-down, .inst.is-closed { opacity: 0.62; }
.inst-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.inst-head .avatar::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: #3a3a3a; border: 2px solid #161616; }
.inst.is-online .inst-head .avatar::after { background: var(--success); }
.inst.is-closing .inst-head .avatar::after { background: var(--warning); }
.inst-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-weight: 600; font-size: 13.5px; }
.inst-note { font-weight: 400; font-size: 12px; color: var(--text-faint); }
.inst.is-closing .inst-note { color: var(--warning); }
.inst-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.inst-actions button.sym { width: 40px; height: 40px; }
.inst-actions button.sym svg { width: 20px; height: 20px; }
.inst-actions button.sym--delete svg { width: 18px; height: 18px; }
.inst-fields { display: grid; grid-template-columns: auto auto minmax(0, 1fr); column-gap: 32px; row-gap: 12px; padding-left: 48px; padding-right: 6px; }
@media (min-width: 1900px) { .inst-fields { grid-template-columns: repeat(5, auto) minmax(0, 1fr); column-gap: 26px; } }
.inst-fields .fld { align-items: flex-start; text-align: left; }
.inst-tasks { display: flex; align-items: center; gap: 6px 22px; flex-wrap: wrap; padding-left: 48px; }
.inst-task { display: inline-flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.inst-task b { color: var(--text); font-weight: 500; font-feature-settings: "tnum" 1; }
@media (max-width: 720px) { .inst-fields, .inst-tasks { padding-left: 0; } .inst-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Task bars in the tab's red. */
.mod-row .bar > i { background: linear-gradient(90deg, #b23a3f, var(--danger-text)); }
/* Risk is plain text: no colour, no dot, capitalised ("Standard", "Low", "Medium", "Critical"). */
.ev-risk { color: var(--text); font-weight: 500; white-space: nowrap; }
/* A symbol at the right of a block's title ("Mark all read", "Compact database") sits over the
   delete column of the table under it. */
.block-head .block-tools > button.sym:last-child { margin-right: 8px; }

/* ---------- License ---------- */
/* The three colours a key can be: developer, moderator, user. */
.kt-admin { --kt: #ff7b80; }
.kt-moderator { --kt: #f5a266; }
.kt-user { --kt: #7ab6ff; }
/* A person: the name, and under it Discord and whether they are online. On the right only the
   two user buttons (never on your own card) and the arrow. */
.acct-sep { margin: 0 8px; color: #3a3a3e; }
/* "Discord not linked", for a developer: the same quiet words, but they open the link dialog. */
button.disc-link { appearance: none; padding: 0; margin: 0; border: none; border-radius: 4px; background: transparent; font: inherit; letter-spacing: inherit; color: var(--text-faint); cursor: pointer; }
button.disc-link:hover { opacity: 1; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
button.disc-link:active:not(:disabled) { transform: none; }
button.disc-link:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22); }
.acct-state { color: var(--text-dim); }
.acct-acts { display: inline-flex; align-items: center; flex: none; margin-right: 4px; }
.acct-body { padding: 4px 4px 14px 16px; }
.acct-body > .key + .key, .keys > .key + .key { margin-top: 10px; }
/* One key: the key and its type on the left; the hardware limit and the actions on the right. */
.key { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 6px 9px 14px; }
.key-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 32px; }
.key-id { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.key.is-off .key-id { opacity: 0.45; }
/* The key: one compact line in the code font, hyphens dim. In full it is a button that copies. */
.key-serial {
    font-family: var(--font-mono, "SF Mono", Menlo, Consolas, monospace); font-size: 13px; font-weight: 400;
    letter-spacing: 0.02em; color: #d6d6d9; white-space: nowrap; font-feature-settings: "tnum" 1, "zero" 1;
}
.key-serial u { text-decoration: none; color: #6a6a6e; margin: 0 1px; }
.key-serial i { font-style: normal; color: #55555a; }
button.key-serial { appearance: none; padding: 0; margin: 0; border: none; border-radius: 4px; background: transparent; cursor: copy; user-select: text; transition: color 0.12s ease; }
button.key-serial:hover { opacity: 1; color: var(--text); }
button.key-serial:active:not(:disabled) { transform: none; }
button.key-serial:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22); }
button.key-serial.is-copied, button.key-serial.is-copied u { color: var(--success); }
.key-type { font-size: 12px; color: var(--kt, var(--text-dim)); white-space: nowrap; }
.key-note { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.key-id .sym { margin: 0 -4px; }
.key-actions { display: flex; align-items: center; gap: 0; }
/* Hardware limit: five dashes. Gold = a machine is using the slot, light grey = allowed but
   free, dark = not activated. The two a developer can click are buttons (taller than they look,
   so they are easy to hit). */
.hw { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; }
.hw > i, .hw > button { position: relative; display: block; width: 14px; height: 18px; padding: 0; margin: 0; border: none; border-radius: 0; background: transparent; flex: none; }
.hw > i::before, .hw > button::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 4px; border-radius: 2px; background: #2a2a2a; transition: background 0.12s ease; }
.hw > .free::before { background: #6e6e73; }
.hw > .on::before { background: var(--lic, #d8ba58); }
.hw > button { cursor: pointer; }
.hw > button:hover { opacity: 1; }
.hw > button:active:not(:disabled) { transform: none; }
.hw > button:not(.free):hover::before { background: #55555a; }
.hw > button.free:hover::before { background: #9a9a9e; }
.hw > button:focus-visible { outline: none; }
.hw > button:focus-visible::before { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); }
.key.is-off .hw { opacity: 0.55; }
/* Machines: a dot in the key's colour (solid = online, hollow ring = offline), the name, the
   hardware ID in full; show, copy and delete line up under refresh, pause and delete. */
.key-machines:empty { display: none; }
.key-machines { margin-top: 8px; border-top: 1px solid var(--border); }
.mline { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 5px 0; font-size: 12.5px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.key-machines > :last-child { border-bottom: none; }
.mline .grow { flex: 1; min-width: 12px; }
.mline .sym { margin-left: -12px; }
.mdot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--kt, var(--text-dim)); box-shadow: 0 0 6px color-mix(in srgb, var(--kt, #9a9a9e) 55%, transparent); }
.mdot.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--kt, var(--text-dim)); }
.mname { color: var(--text); white-space: nowrap; }
.mhw { font-size: 12px; color: var(--text-dim); letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mseen { white-space: nowrap; margin-right: 12px; }
.mline.is-open { border-bottom-color: transparent; }
.mdetail { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 18px; padding: 2px 16px 16px 19px; border-bottom: 1px solid var(--border); }
@media (max-width: 900px) { .mdetail { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Add key: a thin dashed row with a plus under the last key, green when pointed at. */
button.addkey-row {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 38px; margin-top: 10px; padding: 0;
    border: 1px dashed #2c2c2c; border-radius: 10px; background: transparent; color: #5c5c61; cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease;
}
button.addkey-row:hover { opacity: 1; color: #4fd1a5; border-color: rgba(79, 209, 165, 0.45); }
button.addkey-row svg { width: 16px; height: 16px; display: block; }
.me-discord .live { display: none; }

/* ---------- Settings ---------- */
/* Memory: a tile per figure, with an arc gauge in the tile's own colour (--m-c). */
.meter { display: grid; grid-template-columns: 68px minmax(0, 1fr); column-gap: 16px; align-items: center; padding: 16px 18px; background: #151515; border: 1px solid var(--border); border-radius: 12px; }
.gauge { position: relative; width: 68px; height: 68px; }
.gauge svg { display: block; width: 68px; height: 68px; transform: rotate(135deg); }
.gauge circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.gauge-track { stroke: #242424; }
.gauge-fill { stroke: var(--m-c, var(--info)); transition: stroke-dasharray 0.4s var(--ease); }
.gauge b { position: absolute; left: 0; right: 0; top: 24px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.2; color: var(--text); font-feature-settings: "tnum" 1; }
.gauge small { position: absolute; left: 0; right: 0; top: 41px; text-align: center; font-size: 9px; line-height: 1.2; color: var(--text-faint); letter-spacing: 0.06em; }
.meter-body { display: flex; flex-direction: column; min-width: 0; }
.meter-name { font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.meter-val { margin-top: 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.meter-sub { margin-top: 4px; font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* System and Webhook: plain tables. */
.set-table td { padding-top: 12px; padding-bottom: 12px; font-size: 13.5px; color: var(--text); vertical-align: middle; }
.set-table td.dim { font-size: 13px; color: var(--text-dim); }
.set-table th.num, .set-table td.num { text-align: center; font-feature-settings: "tnum" 1; }
.set-table td.mono { font-size: 12.5px; }
.set-table th:last-child { width: 48px; }
.hook-table th:first-child { width: 140px; }
.hook-table th:nth-child(3) { width: 170px; }
.hook-table th:last-child { width: 112px; }
.hook-url { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: #1c1c1c; color: var(--text); font-size: 12px; outline: none; transition: border-color 0.12s ease; }
.hook-url:hover { border-color: #333; }
.hook-url:focus { border-color: var(--text-dim); }
.hook-url.is-saving { opacity: 0.6; }
.hook-url::placeholder { color: var(--text-faint); }
.hook-st { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }
.hook-st i { width: 6px; height: 6px; border-radius: 50%; background: #55555a; flex: none; }
.hook-st.on { color: var(--text-dim); }
.hook-st.on i { background: var(--success); }
button.hook-test { appearance: none; background: transparent; border: none; padding: 0; margin: 0; font: inherit; font-size: 12.5px; cursor: pointer; border-radius: 6px; }
button.hook-test .hs-b, button.hook-test .hs-c { display: none; }
button.hook-test:hover .hs-a, button.hook-test:focus-visible .hs-a { display: none; }
button.hook-test:hover .hs-b, button.hook-test:focus-visible .hs-b { display: inline; color: var(--text); }
button.hook-test:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22); }
button.hook-test.sent .hs-a, button.hook-test.sent .hs-b { display: none; }
button.hook-test.sent .hs-c { display: inline; color: var(--success); }

/* ---------- Account ---------- */
/* The details of an account use the whole width of the table, four to a row. */
.acc-detail { padding: 16px 12px 10px; }
.acc-detail dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 24px; width: 100%; }
.acc-detail dt { margin: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.055em; color: var(--text-faint); }
.acc-detail dd { margin: 0; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
@media (max-width: 900px) { .acc-detail dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- What the arrow (view) button opens ---------- */
/* Labelled values are centred in their column (an account's details, a machine's details). */
.acc-detail dl > div { text-align: left; }
.mdetail { padding: 2px 16px 16px; }
.mdetail .fld { align-items: flex-start; text-align: left; }
/* JSON stays JSON, in a panel as wide as the row: one line per row, each level four characters in
   (--d is the line's depth, set by jsonView in index.js) with a faint guide per level, coloured by
   what each piece is. A long value wraps under its own start, and a tall one scrolls in the panel. */
.json-view {
    --j-pad: 24px;
    margin: 8px 0 0; padding: 16px 0; max-height: 440px; overflow: auto; text-align: left;
    background: #181818; border: 1px solid #2a2a2a; border-radius: 10px;
    font-family: var(--font-mono, "SF Mono", Menlo, Consolas, monospace); font-size: 12.5px; line-height: 1.75;
}
.jl {
    padding: 0 var(--j-pad) 0 calc(var(--j-pad) + var(--d, 0) * 4ch);
    background-image: repeating-linear-gradient(to right, #2a2a2a 0, #2a2a2a 1px, transparent 1px, transparent 4ch);
    background-size: calc(var(--d, 0) * 4ch) 100%; background-repeat: no-repeat; background-position: var(--j-pad) 0;
}
.jl:hover { background-color: rgba(255, 255, 255, 0.035); }
/* The panel's edges sit exactly on the edges of the row it belongs to (the cell has 10px of padding). */
.session-detail-row .json-view { margin-left: -10px; margin-right: -10px; }
.jc { white-space: pre-wrap; overflow-wrap: anywhere; color: #6a6a6f; }
.jk { color: #ececea; }
.js { color: #d8ba58; }
.jnum { color: #f0a23e; }
.jb { color: #eb7a45; }
.jtext { color: #d8ba58; }


@media (prefers-reduced-motion: reduce) {
    .sym-ic [opacity], button.sym, .gauge-fill, .tab-badge { transition: none; }
}

/* ================= Narrow screens ================= */
/* A table that is wider than the screen scrolls inside itself instead of widening the whole page
   (display:block lets overflow apply; its rows still lay out as a table). */
@media (max-width: 900px) {
    table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table th, table td { white-space: nowrap; }
    .filters { flex-wrap: wrap; }
    .filter-fields { flex-wrap: wrap; width: 100%; }
    .filter-fields .filter-pill { flex: 1 1 140px; min-width: 120px; }
    .filter-fields .pf { flex: 1 1 100%; }
    .filter-actions { padding-left: 0; border-left: none; width: 100%; }
}

/* ================= Popup fixes ================= */
/* A card focused by script (a key reveal) must not show the browser's white focus ring. */
.modal-card:focus, .modal-card:focus-visible { outline: none; }
/* The "New key" badge sits centred over the centred title. */
.modal-reveal-badge { display: flex; width: fit-content; margin-left: auto; margin-right: auto; }
/* A list of keys: wide enough that a key never wraps its last characters onto a second line. */
.modal-card:has(.modal-keylist) { max-width: 480px; }
.kl-key { word-break: normal; overflow-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* "Copy all" is a plain centred button, not an empty bordered box with a button inside it. */
.modal-key-row--end { justify-content: center; background: transparent; border-color: transparent; padding: 0; margin-top: 10px; }

