/* Digital Genesis dashboard.
   One stylesheet, no framework, no web fonts — it loads instantly and works
   offline, which is the whole point of running locally. */

/* The three palettes (dark, light, crypto) are in palette.css, loaded first —
   shared with the raffle page. */

/**
 * Layout constants, kept out of the theme blocks because they are not colours
 * and must not differ between themes.
 *
 * `--topbar-h` is the sidebar's offset and the basis of its height. The bar is
 * `flex-wrap: wrap`, so it is not fixed-height by nature — `min-height` below
 * pins it to this value, and the narrow-screen rule drops the sidebar out of
 * its own scroll container before wrapping becomes likely. Without both, a
 * wrapped bar would push the sidebar's last entry below the fold.
 */
:root {
  --topbar-h: 57px;
}

* { box-sizing: border-box; }

/**
 * `hidden` must actually hide.
 *
 * The HTML `hidden` attribute works through `display: none` in the browser's
 * own stylesheet, which any author `display` rule outranks. Three elements here
 * set one — `.login` is `display: grid`, `.savebar` is `display: flex`,
 * `.logdetail` is `display: grid` — so every `node.hidden = true` in the client
 * silently did nothing and they rendered down the page regardless.
 *
 * That is why a sign-in card and a stray "Loading…" appeared below the
 * dashboard. Declared once, here, so the next element with a display rule does
 * not reintroduce it.
 */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  background: var(--panel-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ login */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login .card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  gap: 12px;
}

.login h1 { margin: 0; font-size: 20px; }

label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

input {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.6; cursor: default; }

/**
 * The Discord sign-in control is an `<a>`, not a `<button>`.
 *
 * It has to be a real link because it is a top-level navigation to
 * `/auth/discord`, and the CSP is `script-src 'self'` with no nonce — so no
 * inline handler could drive it, and a `<form>` posting there would trip the
 * guard's CSRF-header check for a request that changes nothing. A link also
 * gets middle-click, "open in new tab" and keyboard activation for free.
 *
 * It only needs to look like the button next to it.
 */
a.button {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
a.button:hover { filter: brightness(1.08); }

button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
  font-weight: 500;
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

/* -------------------------------------------------------------- structure */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  min-height: var(--topbar-h);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  /* Above the sidebar, which is also sticky and now scrolls its own content
     underneath rather than past it. */
  z-index: 5;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}
.dot.good { background: var(--good); }
.dot.warn { background: var(--warn); }

.main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 22px;
  display: grid;
  gap: 18px;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat { padding: 14px 16px; display: grid; gap: 4px; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 22px; }
.stat-value.good { color: var(--good); }
.stat-value.warn { color: var(--warn); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.panel-head { margin-bottom: 12px; }
.panel-head h2 { margin: 0 0 4px; font-size: 16px; }
.panel-head p { margin: 0; }

/* ------------------------------------------------------------------ lists */

.list { display: grid; gap: 2px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-2);
}

.row-main { display: grid; gap: 2px; min-width: 0; }
.row-main strong { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------- bars */

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; gap: 6px; }
.bar-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bar-head strong { text-transform: capitalize; }

.bar-track {
  height: 8px;
  background: var(--panel-2);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.bar-fill.tier-member { background: var(--good); }
.bar-fill.tier-mod { background: var(--warn); }
.bar-fill.tier-admin { background: var(--accent); }
.bar-fill.tier-owner { background: var(--danger); }

/* Audit rows: the action, then what it actually did. */
.row-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.row-heading .detail {
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 12.5px;
  /* An audit detail is often one long unbroken token (a JSON blob, an id, a
     URL). Without this it ran straight out of its box on a phone (26 Nov). */
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

/* Rows never let their contents push past the box: the text column shrinks
   and wraps, the timestamp or pill on the right stays whole (26 Nov 2026). */
.row { min-width: 0; }
.row > :last-child:not(.row-main) { flex: none; white-space: nowrap; }
.row-heading { min-width: 0; }
.row-main > * { overflow-wrap: anywhere; min-width: 0; }
.stat-value { overflow-wrap: anywhere; }
.bar-head > * { min-width: 0; overflow-wrap: anywhere; }
.panel, .card { min-width: 0; }
.panel code, .card code { overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 520px) {
  /* On a phone the time goes under the text instead of squeezing it. */
  #audit .row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px; }
  .stat-value { font-size: 18px; }
  .panel { padding: 14px; }
}

/* ============================================================ app shell */

.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}



/**
 * The sidebar scrolls as its own column.
 *
 * It was `position: sticky` with no height and no scroll container, which is
 * fine for a short menu and wrong for this one. There are forty-odd entries,
 * so the nav is taller than the viewport: reaching "Crypto" meant scrolling the
 * whole page, and on a long screen — the logs view especially — the sidebar
 * scrolled away above you. You then had to scroll the content back to the top
 * just to change screen.
 *
 * `height` pinned to the viewport minus the top bar, plus its own `overflow-y`,
 * makes the two columns independent: the log list scrolls under a nav that
 * stays put, and a long nav scrolls without moving the log list.
 *
 * `overscroll-behavior: contain` stops a flick at the end of the nav from
 * continuing into the page behind it, which is the thing that makes nested
 * scroll areas feel broken.
 */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 2px;
  align-content: start;
  /* A thin scrollbar in the theme's own colours rather than the browser's
     default light one, which looked like a seam on the dark themes. */
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--line);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 6px;
}
.sidebar:hover::-webkit-scrollbar-thumb { background-color: var(--muted); background-clip: content-box; }

/**
 * The ☰ in the top bar, the ✕ inside the drawer, and the scrim behind it.
 *
 * ORDER MATTERS AND THIS BLOCK HAS TO STAY HERE — above the drawer media
 * query, not below it. `.nav-toggle` and `@media … { .nav-toggle }` are the
 * same specificity (a media query adds none), so whichever is written second
 * wins. Written after, this `display: none` would quietly cancel the
 * `inline-flex` that makes the drawer openable at all, and the symptom would
 * be a phone with no way to reach the nav.
 *
 * Hidden by CSS rather than by script, so the desktop layout never depends on
 * JavaScript having run — if app.js fails to load, the dashboard is still a
 * sidebar and a page rather than a sidebar, a page and two stray buttons.
 */
.nav-toggle,
.nav-close {
  display: none;
  align-items: center;
  gap: 6px;
}

.nav-close {
  width: 100%;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
}

/**
 * The scrim behind the drawer.
 *
 * `display: none` here rather than a `hidden` attribute: the drawer's open
 * state lives in one class on `.app`, and a second source of truth in an
 * attribute is how the two get out of step.
 */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.55);
}

/**
 * ═══════════════════════════════════════════════ the narrow-screen drawer
 *
 * This block MUST come after the `.sidebar` rules above. It already had to
 * once: an earlier version sat before them, same specificity, so the later
 * block won and only `position: static !important` survived — a static 100vh
 * scroll box at the top of every narrow window. Caught by looking at a render,
 * not by a test; CSS cascade bugs do not throw.
 *
 * WHAT THIS REPLACED, AND WHY IT WASN'T GOOD ENOUGH
 *
 * The previous version stacked the nav ABOVE the content in one column. That
 * is correct and it is unusable: there are forty-odd screens, so measured in
 * the harness at a real phone width (390px), the first setting on the page sat
 * at
 *                          main top = 1959px
 *
 * — nearly two thousand pixels of navigation before the thing you came to
 * change. "It's a lot to scroll through" is the whole bug, and no amount of
 * tightening the list fixes a list that long.
 *
 * So the nav comes out of the flow entirely and slides in over the page.
 *
 * WHY FULL HEIGHT, COVERING THE TOP BAR
 *
 * The obvious shape is a drawer that starts below the top bar — `top:
 * var(--topbar-h)` — which keeps the ☰ visible to close it. Measured in
 * `tools/mobile-harness.js`, that is wrong. Every figure below was read off a
 * render; none of them is estimated:
 *
 *     viewport    --topbar-h says    .topbar measures
 *     --------    ---------------    ----------------
 *      1235px          57px                67px
 *       804px          57px                70px
 *       430px          57px               110px
 *       390px          57px               110px
 *
 * `.topbar` is `flex-wrap: wrap`; below ~500px the brand and the actions fall
 * onto separate rows and it is nearly twice the height the variable claims.
 * It is not even right on a desktop — `min-height: var(--topbar-h)` is a
 * floor, and the buttons push past it. Anchoring the drawer to that variable
 * would have left it 53px too high at exactly the widths it exists for. The
 * variable is not wrong; it is a MINIMUM, and the sidebar's desktop offset
 * still wants it. It was never a measurement of the rendered bar.
 *
 * (The 110px readings are after the tighter mobile padding below; before it
 * they were 124px. Neither is 57px, which is the point.)
 *
 * Making the bar fit one row on a phone was the alternative and does not work
 * either: ☰ + brand + guild picker + three theme buttons + Refresh + Sign out
 * is about 505px of content, and the only way to fit it is to drop controls.
 *
 * `top: 0; bottom: 0` depends on no measurement at all, so it cannot drift.
 * The cost is that the drawer covers the ☰, which is why `renderSidebar` puts
 * a close button inside it — and why the scrim is dismissible, and Escape
 * works, and choosing a screen closes it. Four ways out of a thing that covers
 * the screen is not excessive.
 */
@media (max-width: 820px) {
  /*
   * `minmax(0, 1fr)`, not `1fr`. A bare `1fr` is `minmax(auto, 1fr)`, and the
   * `auto` floor is the item's MIN-CONTENT width — so one stubborn grid inside
   * `main` (the permissions table, below) stretched the single column to 460px
   * in a 390px viewport and the whole page scrolled sideways. The desktop rule
   * has always said `minmax(0, 1fr)` for this exact reason; the mobile one
   * disagreed with it by accident.
   */
  .shell { grid-template-columns: minmax(0, 1fr); }

  /* The only place the toggle and the in-drawer close button exist. Above this
     width the drawer is not a drawer and both would be noise. */
  .nav-toggle,
  .nav-close { display: inline-flex; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    /* `height` and `overflow-y` are re-stated rather than inherited: the
       desktop rule pins the height to `calc(100vh - var(--topbar-h))`, which
       here would stop the nav 57px short of the bottom of the screen. */
    height: auto;
    overflow-y: auto;
    z-index: 40;
    padding: 14px 12px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%);
    /*
     * `visibility` as well as `transform`, and the delay is the point.
     *
     * A drawer moved off-screen by transform alone is still focusable: Tab
     * from the top bar walks into forty invisible buttons. `visibility:
     * hidden` takes it out of the tab order, and the 180ms delay lets the
     * slide-out finish before it blinks away. Opening has no delay, so it
     * becomes visible first and then slides in.
     */
    visibility: hidden;
    transition: transform 180ms ease, visibility 0s linear 180ms;
  }

  .app.nav-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform 180ms ease, visibility 0s linear 0s;
  }

  .app.nav-open .nav-backdrop { display: block; }

  /* Narrower gutters: 22px each side is 44px of a 390px screen spent on
     nothing, and every field in here is already capped at 560px. */
  .main { padding: 14px; }
  .topbar { padding: 10px 14px; gap: 10px; }
}

/* Somebody who has asked their system not to animate gets the drawer without
   the slide. It still opens; it simply arrives. `visibility` keeps its delay
   or the closed drawer would stay in the tab order. */
@media (prefers-reduced-motion: reduce) {
  /* Both selectors, because `.app.nav-open .sidebar` sets its own transition
     at 0-3-0 and a bare `.sidebar` at 0-1-0 would lose to it — the drawer
     would still slide on the way in, which is the direction you notice. */
  .sidebar,
  .app.nav-open .sidebar { transition: visibility 0s linear 0s; }
}

.nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 14px 10px 6px;
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.nav-item:hover { background: var(--panel-2); filter: none; }
.nav-item.active { background: var(--accent); color: #fff; }

.divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  display: inline-block;
}

.guild-picker { display: flex; align-items: center; }
.guild-name { font-weight: 600; }

.guild-select {
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.page-head { margin-bottom: 4px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; }
.page-head p { margin: 0; }

.stack { display: grid; gap: 18px; margin-top: 16px; }

/* --------------------------------------------------------- server rows */

.row-button {
  width: 100%;
  border: 1px solid transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.row-button:hover { border-color: var(--line); filter: none; }
.row-button.selected { border-color: var(--accent); }

.pill {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.row-button.selected .pill { border-color: var(--accent); color: var(--accent); }

/* -------------------------------------------------------------- fields */

.fields { display: grid; gap: 18px; }

.field { display: grid; gap: 6px; max-width: 560px; }
.field.disabled { opacity: 0.45; }

.field-label { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.field-help { margin: 0; font-size: 13px; color: var(--muted); }

.field-error {
  margin: 0;
  font-size: 13px;
  color: var(--danger);
  font-weight: 500;
}

/**
 * A checkbox is a fixed-size control, not a field that fills its column.
 *
 * `.field` is a grid and `.perm-form` stretches every cell in a row to the
 * tallest one, so a bare checkbox inherited both: on the Panels screen the
 * toggle beside a one-line help text rendered as a 70px square while the one
 * beside a four-line help text stayed small. Nothing was wrong with the
 * markup — the control simply had no size of its own.
 */
.field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  justify-self: start;
  align-self: start;
  margin: 2px 0;
}

.field select,
.field textarea,
.field input[type="text"],
.field input[type="number"] {
  width: 100%;
  padding: 9px 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.field textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; resize: vertical; }
.field input[type="number"] { max-width: 180px; }

/* A worked example is what makes a setting click. */
.example {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding-left: 10px;
  font-style: italic;
}

/* ------------------------------------------------------------- switches */

.field-inline { max-width: none; }
.switch-row { display: flex; align-items: flex-start; gap: 12px; }
.switch-text { display: grid; gap: 3px; }

.switch { position: relative; display: inline-block; flex: 0 0 auto; cursor: pointer; margin-top: 2px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch-track {
  display: block;
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: var(--line);
  transition: background 120ms ease;
  position: relative;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 120ms ease;
}
.switch input:checked + .switch-track { background: var(--good); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------- document editor */

/* One button, condition or action inside a document. */
.block-card {
  padding: 14px;
  margin-bottom: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.block-card .block-card { background: var(--panel); }

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

/* What the bot's own validator said. Problems block a save; warnings do not. */
.notice { border-left: 3px solid var(--line); }
.notice.bad { border-left-color: var(--danger); }
.notice.warn { border-left-color: var(--warn); }
.notice-list { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.notice-list li { margin-bottom: 4px; }

.warn-text { color: var(--warn); }

/* Send and arm reach outside the dashboard, so they do not look like Save. */
button.danger { background: var(--danger); color: #fff; }
button.danger:hover:not(:disabled) { filter: brightness(1.1); }

/* --------------------------------------------------------- list actions */

/* Edit and Remove sit side by side in the last column of a list row. */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.form-actions { display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------ checklist */

.checklist {
  display: grid;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.check:hover { background: var(--panel); }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }

/* -------------------------------------------------------------- savebar */

.savebar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 14px 11px 18px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
  z-index: 20;
  font-size: 14px;
  font-weight: 600;
}
.savebar-actions { display: flex; gap: 8px; }

.flash {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--good);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  z-index: 25;
  max-width: 420px;
}
.flash.bad { background: var(--danger); }

/* ================================================================== logs */

.tabbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.tabs { display: flex; gap: 4px; }

.tab {
  padding: 7px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { background: var(--panel-2); filter: none; }
.tab.active { background: var(--panel); border-color: var(--line); color: var(--text); }

.log-filters { display: flex; gap: 8px; align-items: center; }
.log-filters select {
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  min-width: 190px;
}

/* A real table: aligned columns, so a long list is scannable. */
.logtable {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

/**
 * ─────────────────────────────────────────────────────────────────────────────
 * COLUMNS COME FROM `--cols`, AND THAT IS NOT A STYLE CHOICE
 *
 * Ten render functions in `app.js` build these tables and each one knows its
 * own column count, so the widths have to come from JavaScript. They used to
 * come from JavaScript the obvious way — `row.style.gridTemplateColumns = …`
 * — and that quietly broke the whole mobile layout.
 *
 * An inline style beats every stylesheet rule that is not `!important`,
 * including one inside a media query. So
 * `@media (max-width: 720px) { .logrow { grid-template-columns: 1fr } }`
 * below never applied to a single one of those tables: on a phone they kept
 * their desktop widths — a 150px, a 110px and a 90px track out of ~350px of
 * usable width — leaving almost nothing for the first column. Combined with
 * the `overflow-wrap: anywhere` further down, prose in a squeezed track breaks
 * mid-word, which is what it looked like: text wrapped two or three characters
 * at a time.
 *
 * Setting a **custom property** inline instead moves the declaration that uses
 * it into this stylesheet, where the media query can beat it normally. The
 * fallback is the old four-column default, so a row that sets nothing is
 * unchanged.
 *
 * `test/mobileTables.test.js` fails if an inline assignment comes back.
 */
.logrow {
  display: grid;
  grid-template-columns: var(--cols, minmax(0, 1fr) 150px 110px 90px);
  gap: 12px;
  align-items: baseline;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.logrow:first-child { border-top: 0; }
.logrow:hover { background: var(--panel-2); filter: none; }

/**
 * Cells wrap rather than overflowing their track.
 *
 * `minmax(0, 1fr)` lets a column shrink, but a cell holding one unbroken
 * 44-character string — a Solana address — has no break opportunity, so it
 * spills sideways and paints over its neighbour. The columns looked jumbled;
 * the grid was fine and the text was escaping it.
 *
 * `anywhere` rather than `break-word` because base58 contains no spaces or
 * hyphens to break at, and `min-width: 0` because a grid item's automatic
 * minimum size is its content, which silently overrides the `0` in minmax.
 */
.logrow > span { min-width: 0; overflow-wrap: anywhere; }

/**
 * Buttons are the exception: they never break mid-word.
 *
 * The first version applied `overflow-wrap: anywhere` to every child including
 * `.row-actions`, so "View member" rendered as "Vie / w / me / mbe / r" down the
 * side of the row. Long *data* should wrap; a control's label should make the
 * control wider, and if it cannot, the track is too narrow — which is a sizing
 * bug to fix rather than to hide by shredding the word.
 */
.logrow > .row-actions { min-width: 0; }
.logrow > .row-actions button { white-space: nowrap; }

.loghead {
  cursor: default;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--panel-2);
  font-weight: 600;
}
.loghead:hover { background: var(--panel-2); }

.log-what { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.log-what strong { overflow-wrap: anywhere; }

.logrow[aria-expanded="true"] { background: var(--panel-2); }
.logrow[aria-expanded="true"] strong { color: var(--accent); }

.logdetail {
  padding: 14px 18px 18px;
  background: var(--panel-2);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 6px 14px;
  font-size: 13.5px;
}
.detail-label { color: var(--muted); }
.detail-value { overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

.detail-heading {
  margin: 6px 0 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

@media (max-width: 720px) {
  .logrow { grid-template-columns: 1fr; gap: 2px; }
  .loghead { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-label { font-weight: 600; margin-top: 6px; }
}

/* ========================================================== permissions */

.perm-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}
.perm-form .field { max-width: none; }
.perm-form input[type="text"],
.perm-form select {
  width: 100%;
  padding: 9px 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.small-button { padding: 4px 10px; font-size: 12px; }

.pill.good { color: var(--good); border-color: var(--good); }
.pill.bad { color: var(--danger); border-color: var(--danger); }

/*
 * Consequence notes under the save bar.
 *
 * Quiet on purpose. These are not warnings — nothing here is wrong, and
 * styling them as errors would teach people to dismiss the bar without
 * reading. They say "this also changes something elsewhere", which is
 * information, not a problem.
 */
.savebar-consequences {
  flex-basis: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
}
.savebar-consequences p { margin: 0; }

/*
 * Sidebar filter. Sticks to the top of the scrolling nav so it stays reachable
 * — the list it filters is the thing that scrolls, and a filter you have to
 * scroll back up to find is a filter nobody uses twice.
 */
.nav-filter {
  position: sticky;
  top: 0;
  z-index: 2;
  width: 100%;
  margin-bottom: 8px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}
.nav-filter::placeholder { color: var(--muted); }
.nav-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-empty { padding: 8px 10px; }

/*
 * Preset chips — one-click groups above a `strings` box (the link allow list
 * is the first user). Deliberately quieter than a real button: these are a
 * shortcut past typing, not the primary action on the page, and the primary
 * action is Save.
 *
 * `.chip-warn` is not decoration. It marks a group whose contents are a real
 * trade-off rather than a convenience — the Discord-attachments group allows
 * linking to any file uploaded to Discord by anyone. Colour alone would fail
 * anyone who cannot see it, so the chip also carries its reason in `title`,
 * which is what a keyboard or screen-reader user reaches on focus.
 */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-warn { border-style: dashed; }
.chip-warn:hover { border-color: var(--danger); color: var(--danger); }
.field.disabled .chip { pointer-events: none; opacity: 0.5; }

.test-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  display: grid;
  gap: 4px;
}
.test-result p { margin: 0; font-size: 13.5px; }
.test-result.yes { border-color: var(--good); }
.test-result.yes strong { color: var(--good); }
.test-result.no { border-color: var(--danger); }
.test-result.no strong { color: var(--danger); }

/* The permissions table has four columns, not the logs' timestamp layout. */
#perm-rules .logrow { grid-template-columns: minmax(0, 1fr) 160px 110px 90px; cursor: default; }
#perm-rules .logrow:hover { background: transparent; }
#perm-rules .loghead { background: var(--panel-2); }

/**
 * …and it collapses on a narrow screen like every other row — but the rule has
 * to live HERE, below, rather than with the other mobile rules further up.
 *
 * `.logrow` already collapses at 720px. This table never did, because
 * `#perm-rules .logrow` is id-plus-class (1-1-0) and `.logrow` is class alone
 * (0-1-0): the specific selector wins inside the media query just as it does
 * outside one, since a media query contributes no specificity of its own.
 *
 * Writing the override higher up in the 820px block did not work either —
 * equal specificity, and the rule three lines above this one comes later in
 * the file, so it won. The fix has to match the selector AND follow it.
 *
 * It was not cosmetic. 1fr + 160 + 110 + 90 plus gaps is ~390px of minimum
 * width, and with the panel and page padding around it the single mobile
 * column was forced to 460px in a 390px viewport: the entire dashboard
 * scrolled sideways, on every screen, because of one table.
 *
 * 720px to match `.logrow` itself, not the 820px drawer breakpoint — between
 * the two the four columns still fit, and one table collapsing at a different
 * width from its siblings is the kind of detail nobody can explain later.
 */
@media (max-width: 720px) {
  #perm-rules .logrow { grid-template-columns: 1fr; gap: 2px; }
}

/* ================================================================== shop */

.shop-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 80px 110px 150px; cursor: default; }
.shop-row:hover { background: transparent; }
#shop-items .loghead { background: var(--panel-2); }

.perm-row { grid-template-columns: minmax(0, 1fr) 110px 110px 110px; cursor: default; }
.perm-row:hover { background: transparent; }

.shop-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.shop-flags { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0; }

.shop-editor {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.shop-editor textarea {
  width: 100%;
  padding: 9px 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
.shop-editor .field { max-width: none; }

@media (max-width: 900px) {
  .shop-row, .perm-row { grid-template-columns: 1fr; gap: 2px; }
}

/* The log keyword search sits beside the stream / member picker. */
.log-search {
  width: min(320px, 100%);
  font-family: inherit;
  padding: 5px 10px;
  font-size: 14px;
}

/* ---------------------------------------------------------- emoji picker */
/* The control that replaced a text box you had to paste `<:name:id>` into.
   Sized so the grid is browsable without becoming the whole form: about four
   rows of the server's emoji before it scrolls. */
.emoji-control { display: grid; gap: 8px; }

.emoji-head { display: flex; align-items: center; gap: 8px; }

.emoji-chosen {
  display: flex; align-items: center; gap: 6px;
  min-width: 96px; min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg);
}
.emoji-preview { width: 22px; height: 22px; object-fit: contain; }
.emoji-preview-char { font-size: 20px; line-height: 1; }
.emoji-input { flex: 1; min-width: 0; }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 4px;
  max-height: 168px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg);
}

.emoji-option {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: 6px;
  cursor: pointer;
}
.emoji-option:hover { background: var(--panel); border-color: var(--line); }
.emoji-option img { width: 24px; height: 24px; object-fit: contain; }

/* ------------------------------------------------------------ colour picker */

.colour-control { display: grid; gap: 8px; }

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.swatch:hover { transform: translateY(-1px); }

/* The chosen one is ringed rather than recoloured — recolouring it would mean
   the swatch no longer shows the colour it stands for, which is its whole job.
   The ring is drawn with two shadows so it reads on both light and dark. */
.swatch.is-on {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
.swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* "A" on the default swatch, painted in the colour it would fall back to. */
.swatch-default { font-style: italic; }

.swatch-custom {
  background: conic-gradient(#ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  color: #ffffff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
  border-color: var(--line);
}

/* The real colour input sits behind the Custom swatch rather than being
   hidden: `display:none` inputs cannot be opened by a synthetic click in
   Safari, so the picker would simply never appear there. */
.colour-wheel {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.colour-readout {
  justify-self: start;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

/* --------------------------------------------------------- tinted rows */

/* A row painted its own colour. The background and text colour are set
   inline, because they come from the data — the stylesheet cannot know them.
   Everything here is what has to give way so those two read properly. */
.logrow.tinted { color: inherit; }
.logrow.tinted span { color: inherit; opacity: 0.92; }
.logrow.tinted:hover { filter: brightness(1.12); }

/* Buttons on a tinted row cannot use --text: half the time it is the same
   colour as the row. They inherit the row's derived ink and get a faint
   backing so the edge is visible against any hue. */
.logrow.tinted .ghost {
  color: inherit;
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.14);
}
.logrow.tinted .ghost:hover { background: rgba(255, 255, 255, 0.26); }

/* ======================================================= module entitlements
 *
 * A screen for a module this server has not been given. It stays in the
 * sidebar and stays readable — revoking a module deletes nothing, so the
 * owner's gates and shop items are still there and must still be visible.
 * These styles say "off", not "gone".
 *
 * Muted rather than hidden, and never `pointer-events: none`: the entry has to
 * remain clickable so the values behind it can be read.
 */
.nav-item.locked { color: var(--muted); }
.nav-item.locked:hover { background: var(--panel-2); }
.nav-item.locked.active { background: var(--panel-2); color: var(--text); }

/* The small tag after the title. Lower case and dull on purpose: an alarming
 * badge on eight sidebar rows reads as eight faults rather than one billing
 * state. */
.nav-lock {
  float: right;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--warn);
  /* A fixed rgba rather than color-mix: nothing else in this file uses
   * color-mix, and a badge is not worth being the one thing that needs a
   * newer CSS engine than the rest of the panel. */
  background: rgba(250, 166, 26, 0.14);
  border-radius: 5px;
  padding: 1px 6px;
  margin-left: 8px;
}

/* The banner above a read-only page. Warn, not danger: nothing is broken and
 * nothing has been lost. */
.locked-banner {
  border-left: 3px solid var(--warn);
}
.locked-banner h2 { margin-bottom: 4px; }

/* Disabled controls on a read-only page. Legible — the values are the reason
 * the page is still open — just plainly not editable. */
.fields input:disabled,
.fields select:disabled,
.fields textarea:disabled,
.fields button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

/* The operator's entitlements grid: one card per server, one cell per module.
 * Laid out so a whole deployment can be read at a glance, which is the reason
 * this screen is not per-server. */
.entitlement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  padding: 12px;
}

.entitlement {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--panel-2);
}
/* Live, rather than merely granted — all three keys held. */
.entitlement.on { border-color: var(--good); }

.entitlement-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* Which of the three keys failed. Muted: on a new server every module says
 * "not granted" and that is the intended state, not a page full of faults. */
.entitlement-why {
  font-size: 12px;
  color: var(--muted);
}

/* ═════════════════════════════════════════════════════════ the theme switch
 *
 * Three small segmented buttons in the top bar. A radio group rather than one
 * cycling button: with three options, a cycling button makes you guess how
 * many presses away your choice is, and it is never the next one.
 */
.themes {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.theme-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.6;
}
.theme-btn:hover { color: var(--text); background: var(--panel-2); }

/* `aria-pressed`, not a class: the attribute the screen reader uses and the
   attribute the style keys off are then the same one, so they cannot drift. */
.theme-btn[aria-pressed='true'] {
  background: var(--accent);
  color: #fff;
}

/* On light, a white-on-accent chip is the one place the accent needs to be
   readable against itself; the darker accent in that palette handles it. */
.theme-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ───────────────────────────────────────────── lifting panels off the page
 *
 * The flat-white complaint was only half palette. The other half is that a
 * panel and the page were a hard 1px line apart and nothing else, so a long
 * screen read as one undifferentiated sheet. A soft shadow per theme gives
 * the cards an edge without adding visual noise.
 */
.card,
.panel {
  box-shadow: var(--shadow);
}

/* The sidebar and top bar sit on the page rather than floating above it, so
   they keep their borders and take no shadow. */
.sidebar, .topbar { box-shadow: none; }

/* ───────────────────────────────── telling the three keys apart at a glance
 *
 * One `off` badge for all three reasons is what made the Entitlements screen
 * and the sidebar look like they disagreed. The badge text differs now (see
 * `lockBadge`), and so does its colour: the server's own switch is ordinary
 * and reads muted, while "not granted" is a billing state and earns the warn
 * colour.
 */
.nav-lock-disabled-by-the-server {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

/* Granted, but the server switched it off — the state that gets misread as
 * "on" because the checkbox is ticked. Amber edge and a plain sentence. */
.entitlement.conflict {
  border-color: var(--warn);
}
.entitlement-note {
  font-size: 11px;
  line-height: 1.45;
  color: var(--warn);
}

/* ─────────────────────────────────────────────────────── server approvals
 *
 * Three states, told apart by colour AND by a word, because colour alone is
 * the thing an accessibility pass always catches. The chip carries the word;
 * the border carries the colour.
 *
 * Amber for pending rather than red: a server waiting on a decision is not an
 * error, it is a queue. Red is kept for declined, which is a decision.
 */
.approval { margin-bottom: 14px; }
.approval.pending   { border-left: 3px solid var(--warn); }
.approval.approved  { border-left: 3px solid var(--good); }
.approval.declined  { border-left: 3px solid var(--danger); }

/* The head is a title and a chip on one line, and wraps rather than squashing
 * the name on a narrow screen — the mobile fix from 11 Nov applies here too. */
.approval .panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.approval .panel-head h2 { margin: 0; }

.state-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.state-chip.pending  { color: var(--warn);   border-color: var(--warn); }
.state-chip.approved { color: var(--good);   border-color: var(--good); }
.state-chip.declined { color: var(--danger); border-color: var(--danger); }

.approval-concerns {
  margin: 2px 0 10px 18px;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--warn);
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* A fact the screen is reporting about itself — a missing row, say — rather
 * than a styled error. Amber text, no box: it is information, not a failure. */
.warn-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--warn);
}

/* ──────────────────────────────────────────── the pending-server banner
 *
 * Sits above every screen for a server that is not approved. Deliberately
 * plain: it is the explanation for why nothing works, and an owner needs to
 * read it once rather than have it shout on every navigation.
 */
.banner {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.banner strong { display: block; margin-bottom: 4px; }
.banner p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.banner.pending  { border-left-color: var(--warn); }
.banner.declined { border-left-color: var(--danger); }

/* ─────────────────────────────────────────────────────────── post images
 *
 * One row per stored file. Reuses `.state-chip` and `.warn-note` from the
 * approvals screen rather than inventing parallel styles for the same two
 * jobs — a chip that names a state, and a line that reports a fact about
 * the row.
 */
.image-row { margin-bottom: 10px; }
.image-row .panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.image-row .panel-head h2 { margin: 0; }
.image-row button { margin-top: 8px; }

/* The file input, which browsers style inconsistently and which is otherwise
 * invisible against a dark panel. */
.field input[type="file"] {
  width: 100%;
  padding: 8px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 10px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

/* Raffle approvals: the requirement fields on a submission card. */
.raffle-req { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 10px 0; }
.raffle-req .field > span { font-size: 13px; color: var(--muted); }
.raffle-req select[multiple] { min-height: 64px; }

/* Operator → Staking → Members (24 Nov 2026) */
.compact-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 10px; }
.compact-table th, .compact-table td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compact-table th { color: var(--muted); font-weight: 600; }
.staking-member details { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.staking-member summary { cursor: pointer; }
.staking-member p { margin: 2px 0; }

/* Operator → Interaction log (26 Nov 2026) */
.interaction-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.interaction-filters input, .interaction-filters select { min-width: 0; flex: 1 1 160px; }
.interaction-list { display: flex; flex-direction: column; gap: 4px; }
.interaction-row { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--panel); }
.interaction-row summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; cursor: pointer; }
.interaction-target { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; flex: 1 1 200px; }
.interaction-badge { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--panel-2); }
.interaction-badge.outcome-error { color: var(--danger); }
.interaction-badge.outcome-unanswered { color: var(--warn); }
.interaction-badge.outcome-refused { color: var(--muted); }
.interaction-badge.outcome-ok { color: var(--good); }
.interaction-row.outcome-error { border-left: 3px solid var(--danger); }
.interaction-row.outcome-unanswered { border-left: 3px solid var(--warn); }
.interaction-detail p { margin: 3px 0; overflow-wrap: anywhere; }
.interaction-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; background: var(--panel-2); padding: 8px; border-radius: 6px; max-height: 320px; overflow: auto; }
