/* Shared Relics dashboard components. Layout variants are in ui.css. */
@font-face {
  font-family: "Hanken Grotesk";
  src: url(../fonts/hanken-grotesk.woff2) format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}
:root, [data-theme="dark"] {
  color-scheme: dark;
  --canvas: #000; --canvas-subtle: #1d1d1f; --canvas-inset: #151517; --canvas-overlay: #27272b;
  --border: #333336; --border-muted: #2a2a30;
  --fg: #f5f5f7; --fg-muted: #a1a1a6; --fg-subtle: #9999a3;
  --accent: #76b9ff; --accent-emphasis: #006bd6; --accent-hover: #a6d2ff; --accent-subtle: rgba(77, 161, 255, 0.16); --on-accent: #fff;
  --success: #77d6a0; --success-emphasis: #247842; --success-subtle: rgba(119, 214, 160, 0.13);
  --danger: #ff9b8b; --danger-emphasis: #e8776a; --danger-subtle: rgba(255, 155, 139, 0.15);
  --attention: #f0b866; --attention-subtle: rgba(240, 184, 102, 0.15);
  --done: #b9a2ff; --severe: #ff9b8b; --neutral: #9999a3; --salmon: #ff9b8b; --code: #292931;
  --heat-empty: #1d1d20; --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --sheet-line: #37373c; --sheet-head: #202024; --sheet-head-strong: #2d2d33; --sheet-cell: #19191c; --sheet-hover: #25252a; --sheet-accent: #76b9ff; --sheet-radius: 10px;
}
[data-theme="light"] {
  color-scheme: light;
  --canvas: #f5f5f7; --canvas-subtle: #ffffff; --canvas-inset: #eeeef2; --canvas-overlay: #e6e6ed;
  --border: #d2d2d7; --border-muted: #e6e6eb;
  --fg: #1d1d1f; --fg-muted: #585860; --fg-subtle: #66666e;
  --accent: #0064c8; --accent-emphasis: #0064c8; --accent-hover: #004e9c; --accent-subtle: #e4efff; --on-accent: #ffffff;
  --success: #216e42; --success-emphasis: #216e42; --success-subtle: #e2f3e9;
  --danger: #c2412d; --danger-emphasis: #a83624; --danger-subtle: #fde9e5;
  --attention: #8a5c00; --attention-subtle: #fff4d1;
  --done: #7a55d6; --severe: #c2412d; --neutral: #66666e; --salmon: #e0715f; --code: #eeeef2;
  --heat-empty: #eeeef2; --shadow: 0 8px 24px rgba(40, 80, 80, 0.15);
  --sheet-line: #d9d9e1; --sheet-head: #f2f2f5; --sheet-head-strong: #e6e6ed; --sheet-cell: #ffffff; --sheet-hover: #edf4ff; --sheet-accent: #0064c8; --sheet-radius: 10px;
}
* { box-sizing: border-box; }
/* Component rules below set `display`, which would otherwise override the HTML hidden attribute. */
[hidden] { display: none !important; }
html { font-size: 14px; }
body {
  margin: 0; background: var(--canvas); color: var(--fg); line-height: 1.5;
  font-family: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 85%; }
h1, h2, h3 { margin: 0; font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.octicon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: text-bottom; flex: none; }
.octicon.big { width: 24px; height: 24px; }

/* ----- header ----- */
.app-header { background: var(--canvas); border-bottom: 1px solid var(--border); padding: 0 max(14px, calc((100% - 1360px) / 2 + 18px)); min-height: 52px; display: flex; align-items: center; gap: 12px; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 600; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; object-fit: contain; border-radius: 7px; }
.brand .brand-product { color: var(--fg-muted); font-size: 13px; font-weight: 500; }
.header-spacer { flex: 1; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-muted); font-size: 12px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.pulse.off { background: var(--danger); }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--fg); border-radius: 6px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: var(--canvas-subtle); border-color: var(--fg-subtle); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 12px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-emphasis); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; text-transform: uppercase; }

/* ----- page layout ----- */
.container { max-width: 1360px; margin: 0 auto; padding: 16px 18px; }
.pagehead { background: var(--canvas-subtle); border-bottom: 1px solid var(--border); }
.pagehead .container { padding-bottom: 0; }
.pagehead-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: clamp(24px, 3vw, 31px); font-weight: 700; letter-spacing: -.04em; }
.pagehead-title .octicon { color: var(--fg-muted); width: 20px; height: 20px; }
.pagehead-meta { color: var(--fg-muted); margin: 4px 0 10px; display: flex; gap: 4px 13px; flex-wrap: wrap; font-size: 12px; }
.pagehead-meta span { display: inline-flex; align-items: center; gap: 6px; }
.tabnav { display: flex; gap: 4px; overflow-x: auto; padding: 3px 2px 8px; }
.tabnav a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; color: var(--fg-muted); border-radius: 999px; white-space: nowrap; font-weight: 600; }
.tabnav a:hover { background: var(--canvas-overlay); color: var(--fg); text-decoration: none; }
.tabnav a[aria-current="page"] { background: var(--accent-subtle); color: var(--accent); }
.tabnav a[aria-current="page"] .octicon { color: inherit; }
.tabnav .octicon { color: var(--fg-muted); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 276px; gap: 14px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .container { padding: 16px; } }
.stack > * + * { margin-top: 12px; }

/* ----- boxes, labels, counters, buttons, forms ----- */
.box { min-width: 0; background: var(--canvas-subtle); border: 1px solid var(--border); border-radius: 14px; }
.box-header { background: transparent; padding: 9px 12px; border-bottom: 1px solid var(--border-muted); border-radius: 14px 14px 0 0; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.box-header .grow { flex: 1; }
.box-body { padding: 12px; }
.box-row { padding: 8px 12px; border-top: 1px solid var(--border-muted); display: flex; gap: 12px; align-items: center; }
.box-row:first-child { border-top: 0; }
.box-title { font-size: 12px; font-weight: 600; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--fg-muted); }
.small { font-size: 12px; }
.label { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 2em; padding: 0 8px; font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap; color: var(--fg-muted); }
.label.success { color: var(--success); border-color: var(--success); background: var(--success-subtle); }
.label.danger { color: var(--danger); border-color: var(--danger); background: var(--danger-subtle); }
.label.attention { color: var(--attention); border-color: var(--attention); background: var(--attention-subtle); }
.label.accent { color: var(--accent); border-color: var(--accent); background: var(--accent-subtle); }
.label.done { color: var(--done); border-color: var(--done); }
.label.big { font-size: 14px; line-height: 24px; padding: 0 12px; }
.counter { background: rgba(110, 118, 129, 0.4); border-radius: 2em; padding: 0 6px; font-size: 12px; font-weight: 500; line-height: 18px; min-width: 20px; text-align: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; justify-content: center; font: inherit; font-size: 14px; font-weight: 500; line-height: 20px; cursor: pointer; border: 1px solid var(--border); border-radius: 999px; background: var(--canvas-inset); color: var(--fg); }
.btn:hover { background: var(--canvas-overlay); border-color: var(--fg-subtle); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent-emphasis); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.12); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-emphasis); color: #fff; border-color: var(--danger-emphasis); }
.btn.sm { padding: 3px 10px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; }
.field { margin-bottom: 16px; max-width: 440px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { color: var(--fg-muted); font-size: 12px; margin-top: 4px; }
input[type="text"], input[type="password"], input[type="number"], select {
  width: 100%; padding: 5px 12px; font: inherit; line-height: 20px; color: var(--fg); background: var(--canvas-inset);
  border: 1px solid var(--border); border-radius: 6px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 1px solid var(--accent); }
select.inline { width: auto; padding: 2px 8px; font-size: 12px; }
.flash { padding: 12px 16px; border: 1px solid var(--border); border-radius: 6px; display: flex; gap: 10px; align-items: flex-start; }
.flash.error { background: var(--danger-subtle); border-color: var(--danger); }
.flash.warn { background: var(--attention-subtle); border-color: var(--attention); }
.flash.success { background: var(--success-subtle); border-color: var(--success); }
.flash .octicon { margin-top: 3px; }
.flash .grow { flex: 1; min-width: 0; }
.secret { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--canvas-inset); border: 1px solid var(--border); user-select: all; }

/* ----- sign-in ----- */
.auth { max-width: 340px; margin: 48px auto; padding: 0 16px; text-align: center; }
.auth h1 { font-size: 24px; font-weight: 300; margin: 16px 0; }
.auth .box { text-align: left; background: var(--canvas-subtle); padding: 20px; }
.auth .footnote { margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 6px; }

/* ----- statistics ----- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat { padding: 12px; }
.stat .value { font-size: 26px; font-weight: 600; line-height: 1.2; margin: 6px 0 2px; }
.stat .value small { font-size: 14px; font-weight: 400; color: var(--fg-muted); }
.stat .what { display: flex; align-items: center; gap: 6px; color: var(--fg-muted); font-size: 12px; }
.ok-text { color: var(--success); } .bad-text { color: var(--danger); } .warn-text { color: var(--attention); }

/* ----- availability grid (like the contribution graph) ----- */
.heat { display: grid; grid-template-rows: repeat(4, 20px); grid-auto-flow: column; grid-auto-columns: minmax(3px, 1fr); gap: 3px; }
.heat-scale { display: flex; justify-content: space-between; }
.cell { height: 20px; min-width: 3px; border-radius: 3px; background: var(--heat-empty); outline: 1px solid rgba(240, 246, 252, 0.05); outline-offset: -1px; }
.cell.up { background: var(--success); } .cell.degraded { background: var(--attention); } .cell.down { background: var(--danger); }
.legend { display: flex; align-items: center; gap: 6px; color: var(--fg-muted); font-size: 12px; flex-wrap: wrap; }
.legend .cell { width: 12px; height: 12px; min-width: 12px; display: inline-block; }
.spark { width: 100%; height: 90px; display: block; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .area { fill: var(--accent-subtle); stroke: none; }
.spark .grid { stroke: var(--border-muted); stroke-width: 1; }
.spark .dotpoint { fill: var(--accent); }

/* ----- distribution bars ----- */
.bar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--border-muted); }
.bar span { display: block; height: 100%; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.c-high { background: var(--danger); } .c-mid { background: var(--severe); } .c-low { background: var(--accent); }
.c-ongoing { background: var(--done); } .c-other { background: var(--neutral); }
.c-open { background: var(--fg-subtle); } .c-working { background: var(--attention); } .c-done { background: var(--success); }
.legend-list { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--fg-muted); }
.legend-list span { display: inline-flex; align-items: center; gap: 6px; }

/* ----- tables, timeline, key/value ----- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--fg-muted); font-weight: 600; padding: 8px 16px; background: var(--canvas-subtle); border-bottom: 1px solid var(--border); }
td { padding: 10px 16px; border-top: 1px solid var(--border-muted); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border-muted); align-items: flex-start; }
.timeline li:first-child { border-top: 0; }
.timeline .badge { width: 28px; height: 28px; border-radius: 50%; background: var(--canvas-subtle); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--fg-muted); }
.timeline .badge.ok { color: var(--success); border-color: var(--success); } .timeline .badge.warn { color: var(--attention); border-color: var(--attention); }
.timeline .badge.error { color: var(--danger); border-color: var(--danger); }
.timeline .when { color: var(--fg-muted); font-size: 12px; }
.kv { margin: 0; } .kv div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--border-muted); }
.kv div:first-child { border-top: 0; } .kv dt { color: var(--fg-muted); } .kv dd { margin: 0; font-weight: 500; text-align: right; }
.empty { padding: 32px 16px; text-align: center; color: var(--fg-muted); }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 560px) {
  .app-header { padding: 10px 12px; gap: 10px; }
  .brand .brand-product, .live span:last-child { display: none; }
  .stat .value { font-size: 22px; }
  .pagehead-title { font-size: 18px; }
  .box-header { flex-wrap: wrap; }
  .box-header .small { flex: 1 0 100%; }
}

/* ----- dropdown with search (combo.js) ----- */
.combo { position: relative; max-width: 440px; }
.combo.disabled .combo-box { opacity: .55; }
.combo-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 34px; padding: 4px 8px; background: var(--canvas); border: 1px solid var(--border); border-radius: 6px; cursor: text; }
.combo-box:focus-within { border-color: var(--accent); outline: 1px solid var(--accent); }
.combo-chips { display: contents; }
.combo-input { flex: 1; min-width: 90px; border: 0 !important; outline: 0 !important; background: transparent; color: var(--fg); padding: 2px 0; font: inherit; }
.single { font-weight: 600; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 240px; overflow: auto; background: var(--canvas-overlay); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.combo-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.combo-item.active { background: var(--accent-subtle); }
.combo-item.on { font-weight: 600; }
.combo-item .tick { width: 16px; color: var(--success); }
.combo-empty { padding: 8px; color: var(--fg-muted); }

.chip { display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 3px 0 9px; border-radius: 999px; background: var(--accent-subtle); color: var(--accent); font-size: 12px; font-weight: 600; line-height: 1; }
.combo .chip-x { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; cursor: pointer; color: inherit; opacity: .7; }
.combo .chip-x:hover { opacity: 1; background: var(--accent-subtle); }
.combo .chip-x:focus-visible { outline: 2px solid var(--accent); }
.combo .chip-x .octicon { width: 10px; height: 10px; stroke-width: 2; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1px solid var(--border); background: transparent; color: var(--fg-muted); border-radius: 999px; padding: 4px 14px; cursor: pointer; font: inherit; font-weight: 600; }

/* ----- the to-do sheet (view-tasks.js): lettered columns, numbered rows, like the bot's Google Sheet ----- */
.sheet-page { display: grid; gap: 12px; }
.sheet-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.sheet-bar h2 { font-size: 20px; }
.sheet-progress { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 13px; }
.sheet-meter { width: 96px; height: 6px; border-radius: 3px; background: var(--border-muted); overflow: hidden; }
.sheet-meter i { display: block; height: 100%; background: var(--sheet-accent); }
.sheet-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.pill:hover { background: var(--canvas-overlay); color: var(--fg); }
.pill.on { background: var(--accent-subtle); border-color: var(--accent); color: var(--fg); }
/* The sheet scrolls with the page (not in a box of its own) so an open dropdown is never clipped or able to shift the page when it closes. */
.sheet-wrap { border: 1px solid var(--sheet-line); border-radius: var(--sheet-radius); background: var(--sheet-cell); --sticky-top: 0px; }
.sheet thead tr:first-child th:first-child { border-top-left-radius: calc(var(--sheet-radius) - 1px); }
.sheet thead tr:first-child th:last-child { border-top-right-radius: calc(var(--sheet-radius) - 1px); }
.sheet tbody tr:last-child th:first-child { border-bottom-left-radius: calc(var(--sheet-radius) - 1px); }
.sheet tbody tr:last-child td:last-child { border-bottom-right-radius: calc(var(--sheet-radius) - 1px); }
.sheet tbody tr:last-child th, .sheet tbody tr:last-child td { border-bottom: 0; }
.sheet { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px; font-size: 14px; }
.sheet th, .sheet td { border-right: 1px solid var(--sheet-line); border-bottom: 1px solid var(--sheet-line); padding: 0 10px; height: 38px; text-align: left; vertical-align: middle; }
.sheet th:last-child, .sheet td:last-child { border-right: 0; }
.sheet thead th { position: sticky; background: var(--sheet-head); color: var(--fg-muted); font-weight: 600; z-index: 2; }
.sheet .names th { top: var(--sticky-top); font-size: 12px; letter-spacing: .02em; }
.sheet .corner, .sheet .rownum { width: 44px; min-width: 44px; padding: 0; text-align: center; background: var(--sheet-head); color: var(--fg-subtle); font-size: 11px; font-weight: 500; }
.sheet tbody .rownum { position: sticky; left: 0; z-index: 1; }
.sheet .corner { left: 0; z-index: 3; }
.sheet tbody tr:hover td { background: var(--sheet-hover); }
.sheet tbody tr:hover .rownum { color: var(--fg); background: var(--sheet-head-strong); }
.sheet td { background: var(--sheet-cell); }
.sheet .cell-center { width: 92px; text-align: center; }
.sheet .cell-text { min-width: 280px; width: 46%; }
.sheet .cell-end { width: 44px; padding: 0; }
.sheet-check { width: 16px; height: 16px; accent-color: var(--sheet-accent); cursor: pointer; vertical-align: middle; }
.sheet-check:disabled { cursor: default; opacity: .75; }
.sheet-check:focus-visible { outline: 2px solid var(--sheet-accent); outline-offset: 2px; }
.cell-btn { all: unset; box-sizing: border-box; display: block; width: 100%; min-height: 36px; padding: 6px 0; cursor: pointer; color: inherit; }
.cell-btn:hover { color: var(--accent); }
.cell-btn:focus-visible { outline: 2px solid var(--sheet-accent); outline-offset: -2px; }
.task-text { display: block; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.35; }
.r-done .task-text { text-decoration: line-through; color: var(--fg-subtle); }
.r-done td, .r-done td * { color: var(--fg-subtle); text-decoration: line-through; }
.r-done td::before, .r-done td input, .r-done .sheet-check { text-decoration: none; }
.r-working td.cell-text { box-shadow: inset 3px 0 0 var(--attention); }
.prio { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--canvas-subtle); color: var(--fg-muted); border: 1px solid var(--border); white-space: nowrap; }
.prio.c-high { background: var(--danger-subtle); color: var(--danger); border-color: transparent; }
.prio.c-mid { background: var(--attention-subtle); color: var(--attention); border-color: transparent; }
.prio.c-low { background: var(--success-subtle); color: var(--success); border-color: transparent; }
.prio.c-ongoing { background: var(--accent-subtle); color: var(--accent); border-color: transparent; }
.people { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px 0; }
.person { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px 0 2px; border-radius: 999px; background: var(--canvas-subtle); border: 1px solid var(--border-muted); font-size: 12px; line-height: 20px; }
.person i { font-style: normal; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--sheet-accent); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.sheet .row-x { opacity: 0; }
.sheet tr:hover .row-x, .sheet .row-x:focus-visible { opacity: 1; }
.sheet-empty td { height: 90px; text-align: center; color: var(--fg-muted); }
.sheet-add td { background: var(--sheet-head); }
.sheet-add:hover td { background: var(--sheet-head); }
.sheet-add .combo-box { min-height: 30px; }
.add-line { display: flex; gap: 8px; align-items: center; margin: 0; }
.sheet-new { flex: 1; min-width: 0; border: 0 !important; outline: 0 !important; background: transparent; color: var(--fg); font: inherit; padding: 6px 0; }
.sheet-new::placeholder { color: var(--fg-muted); opacity: 1; }
.sheet-add:focus-within td { box-shadow: inset 0 -2px 0 var(--sheet-accent); }
.sheet-edit td { background: var(--sheet-cell); height: auto; padding: 12px; }
.sheet-edit:hover td { background: var(--sheet-cell); }
.edit-grid { display: grid; gap: 10px; max-width: 760px; }
.edit-opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.edit-opts .combo { flex: 1 1 220px; }
.sheet-edit-text { width: 100%; resize: vertical; background: var(--canvas-inset); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font: inherit; }
.edit-grid .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.edit-grid .push { margin-left: auto; }
/* On a narrow screen the sheet scrolls sideways inside its frame; an open dropdown then keeps the frame tall enough. */
@media (max-width: 900px) { .sheet-wrap { overflow-x: auto; } .sheet-wrap:has(.combo-list:not([hidden])) { min-height: 380px; } .sheet thead th { position: static; } }
@media (max-width: 700px) { .sheet-filters { margin-left: 0; } }

/* ----- send and manage boards (view-boards.js) ----- */
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--canvas); border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.board-card .grow { flex: 1; min-width: 160px; }
.board-card strong { font-size: 15px; }
.board-actions { display: flex; align-items: center; gap: 6px; }
.send-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.send-row .combo { flex: 1 1 260px; }
.chip { background: var(--accent-subtle); border: 1px solid var(--accent); color: var(--fg); font-weight: 700; font-size: 13px; height: 26px; padding: 0 4px 0 10px; }
.combo .chip-x { width: 15px; height: 15px; color: var(--danger); opacity: 1; }
.combo .chip-x:hover { background: var(--danger-subtle); }
.combo .chip-x .octicon { width: 9px; height: 9px; stroke-width: 2.6; }
.combo .combo-input { background: transparent !important; }


/* ----- delete X and the confirmation dialog of the task sheet ----- */
.row-x { all: unset; box-sizing: border-box; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fg-muted); }
.row-x:hover { color: var(--danger); background: var(--danger-subtle); }
.row-x:focus-visible { outline: 2px solid var(--accent); }
.row-x .octicon { width: 12px; height: 12px; stroke-width: 2.2; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(1, 4, 9, .65); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(420px, 100%); background: var(--canvas-overlay); color: var(--fg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.modal h3 { font-size: 16px; }
.modal-task { margin: 0; padding: 8px 10px; background: var(--canvas-inset); border: 1px solid var(--border-muted); border-radius: 8px; color: var(--fg-muted); overflow-wrap: anywhere; max-height: 120px; overflow: auto; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn.danger.solid { background: var(--danger-emphasis); border-color: var(--danger-emphasis); color: #fff; }
.btn.danger.solid:hover { background: var(--danger); }

/* ----- forwarded responses, laid out like the Discord post but in the dashboard's dark tone ----- */
.embeds { display: grid; gap: 14px; }
.embed { display: flex; background: var(--canvas); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; max-width: 720px; }
.embed-bar { width: 4px; background: var(--accent); flex: none; }
.embed-body { padding: 12px 16px 14px; display: grid; gap: 10px; min-width: 0; flex: 1; }
.embed-author { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--fg-muted); }
.embed-title { font-size: 16px; color: var(--fg); }
.embed-field { display: grid; gap: 2px; }
.embed-name { font-weight: 700; font-size: 13px; color: var(--fg); overflow-wrap: anywhere; }
.embed-value { color: var(--fg-muted); overflow-wrap: anywhere; white-space: pre-wrap; }
.embed-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--border-muted); }

/* ----- latency with numbers ----- */
.lat-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.lat-stat { display: grid; gap: 0; padding: 8px 14px; min-width: 96px; background: var(--canvas); border: 1px solid var(--border); border-radius: 8px; }
.lat-num { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--fg); }
.lat-num small { font-size: 12px; font-weight: 500; color: var(--fg-muted); }
.lat-name { font-size: 12px; color: var(--fg-muted); }
.latency { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: stretch; }
.latency .axis { display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: 11px; color: var(--fg-muted); min-width: 28px; padding: 2px 0; font-variant-numeric: tabular-nums; }
.latency .spark { height: 110px; }

/* Settings page */
.field.wide { max-width: 640px; }
.field.wide input, .field.wide select { width: 100%; }
.field.wide :is(input[type="checkbox"], input[type="radio"]) { width: 18px; }
.field.wide textarea.msg-edit { width: 100%; resize: vertical; background: var(--canvas-inset); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font: inherit; }
.markdown-example { display: inline-block; margin-inline-end: 0.75em; }
.discord-preview { background: var(--canvas-inset); border: 1px solid var(--border); border-radius: 6px; padding: 8px; margin-block: 4px 12px; min-height: 2.5rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.discord-preview :is(h1, h2, h3, ul, ol, pre, blockquote) { margin: 0.35em 0; }
.discord-preview ul { padding-inline-start: 1.6em; }
:is(.discord-preview, .questionnaire-preview-body) ol { padding-inline-start: 0; list-style-position: inside; }
.discord-subtext { font-size: 0.8em; color: var(--fg-muted); }
.discord-preview h1 { font-size: 1.5em; }
.discord-preview h2 { font-size: 1.25em; }
.discord-preview h3 { font-size: 1em; }
.discord-preview blockquote { padding-inline-start: 0.65em; border-inline-start: 3px solid var(--border); }
.discord-preview pre { white-space: pre-wrap; }
.field.wide input[type="number"] { width: 8em; }
.reset-one { margin: -8px 0 18px; }
.actions-start { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.codeblock { position: relative; margin: 8px 0; }
.codeblock pre { margin: 0; padding: 10px 12px; padding-right: 96px; border: 1px solid var(--border); border-radius: 6px; background: var(--canvas-inset); overflow-x: auto; white-space: pre; }
.codeblock .btn { position: absolute; top: 6px; right: 6px; }
details.help { border: 1px solid var(--border); border-radius: 6px; }
details.help > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; }
details.help[open] > summary { border-bottom: 1px solid var(--border); }
details.help .help-body { padding: 12px 14px; }
details.help ol { padding-left: 20px; margin: 8px 0; }
details.help li { margin: 6px 0; }

/* Extra channels on the Get started page */
.hint.intro { color: var(--fg-muted); margin: 0 0 14px; max-width: 70ch; }
.route { border: 1px solid var(--border); border-radius: 8px; background: var(--canvas-subtle); padding: 14px 16px 2px; margin-bottom: 16px; }
.route-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.field .check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; }


::selection { background: var(--accent-emphasis); color: var(--on-accent); }
input[type="text"], input[type="number"], input[type="password"], select, textarea, .combo-box { border-radius: 8px; }
.field .check { white-space: nowrap; }
.field input[type="number"].wide-input { width: min(100%, 260px); }

/* ===== Phones: tables become stacked cards (column names come from data-label, set in main.js) ===== */
@media (max-width: 720px) {
  .sheet-wrap, .table-wrap { overflow: visible; border: 0; background: none; }
  .sheet, .table-wrap table { display: block; min-width: 0; width: 100%; }
  .sheet thead, .table-wrap thead { display: none; }
  .sheet tbody, .table-wrap tbody { display: block; }
  .sheet tbody tr, .table-wrap tbody tr { display: block; margin: 0 0 12px; padding: 4px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--canvas-subtle); }
  .sheet th.rownum { display: none; }
  .sheet td, .table-wrap td { display: block; width: auto; min-width: 0; height: auto; padding: 10px 0; border: 0; border-bottom: 1px solid var(--border-muted); background: transparent; text-align: left; overflow-wrap: anywhere; }
  .sheet td:last-child, .table-wrap td:last-child { border-bottom: 0; }
  .sheet td::before, .table-wrap td::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); }
  .sheet td:not([data-label])::before, .table-wrap td:not([data-label])::before { content: none; }
  .sheet .cell-center, .sheet .cell-text { width: auto; min-width: 0; }
  .sheet tbody tr:hover td { background: transparent; }
  .sheet .row-x { opacity: 1; }
  .sheet .cell-center { text-align: left; }
  .sheet .cell-end { text-align: right; padding: 8px 0; }
  .sheet .cell-end::before, .sheet td:empty { display: none; }
}


/* ===== Cards: related settings grouped in tiles ===== */
.section { margin: 0; }
.section-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 4px 0; }
.section-lead { color: var(--fg-muted); margin: 0 0 14px; max-width: 80ch; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 12px; align-items: stretch; }
.card-grid.two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.card-grid > .box { margin: 0; }
.card-grid .field, .card-grid .field.wide, .card-grid .combo { max-width: none; }
.card-grid .box-body > .field:last-child { margin-bottom: 0; }
.card-grid textarea { width: 100%; }
.card-grid .box-header .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.action-box { margin-top: 16px; }
.route-list { display: grid; gap: 16px; }
.route-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 24px; align-items: start; }
.route-fields .field, .route-fields .field.wide { max-width: none; }
.route-fields .field.span-all { grid-column: 1 / -1; }
.route-fields .field .checks { padding-top: 2px; }
.sheet-sort { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 13px; }
.sheet-sort select { width: auto; min-width: 0; padding: 4px 28px 4px 10px; font-size: 13px; }

/* Authentication and compact dashboard details */
.auth { max-width: 380px; margin: clamp(32px, 12vh, 100px) auto 24px; }
.auth .brand-mark { width: 52px; height: 52px; border-radius: 13px; }
.auth h1 { margin: 10px 0 16px; font-size: 26px; font-weight: 700; letter-spacing: -.035em; }
.auth .footnote { margin-top: 10px; border: 0; padding: 4px; }
.app-header .icon-btn, .avatar { flex: none; }
.user-chip { min-width: 0; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.section-title { font-size: 20px; letter-spacing: -.025em; }
.section-lead { margin-bottom: 10px; }
.route-list { gap: 10px; }
.route-fields { column-gap: 14px; }
.actions-row { flex-wrap: wrap; }
.stat .value { font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.embed-q { text-decoration: underline; text-underline-offset: 3px; color: var(--fg); }
.embed-field + .embed-field { margin-top: 8px; }
@media (max-width: 560px) {
  .app-header { min-height: 48px; padding: 0 12px; gap: 7px; }
  .container { padding: 12px; }
  .user-name { max-width: 66px; }
}

/* Animate the frame when navigation creates it, keeping live updates still. */
@media (prefers-reduced-motion: no-preference) {
  .pagehead-title, #main, .auth { animation: page-enter 180ms ease-out both; }
  .btn, .icon-btn, .tabnav a, .ui-choice {
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
  }
  .btn:active:not(:disabled), .icon-btn:active { transform: scale(.97); }
  @media (hover: hover) and (pointer: fine) {
    .btn:hover:not(:disabled), .icon-btn:hover { transform: translateY(-1px); }
    .stat { transition: border-color 160ms ease, transform 160ms ease; }
    .stat:hover { transform: translateY(-2px); border-color: var(--accent); }
  }
}
@keyframes page-enter {
  from { opacity: .72; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dashboard-workspace > main.container:has(.form-review-grid) { max-width: none; }
.form-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  align-items: start;
}
.form-review-grid > section { min-width: 0; }
.form-response { border: 1px solid var(--border); border-radius: 12px; }
.form-response summary { cursor: pointer; padding: 12px; }
.form-response summary .label { margin-inline: 4px 8px; }
.form-response-name { font-weight: 700; overflow-wrap: anywhere; }
.form-response-body { display: grid; gap: 10px; padding: 0 12px 12px; }
@media (max-width: 900px) {
  .form-review-grid { grid-template-columns: minmax(0, 1fr); }
}
.form-forwarding-status { display: grid; gap: 8px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.form-forwarding-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-forwarding-status p, .form-forwarding-status .actions-row { margin: 0; }
.form-forwarding-status .actions-row:empty { display: none; }
.form-response-search { width: min(100%, 440px); }
.form-results-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.form-response-filter { max-width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--canvas-inset); color: var(--fg); font: inherit; }
.form-response-status { float: right; margin-inline-start: 8px; }
.form-response-body :is(.actions-row, .form-results-controls)[hidden] { display: none; }

/* Editable command responses */

/* Command responses: two commands side by side, preview drawn like a Discord message */
.command-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; row-gap: 10px; align-items: start;
  width: 100%; }
.command-grid > form { display: grid; grid-row: span 9; grid-template-rows: subgrid; row-gap: 8px; padding: 16px; margin-top: 0; min-width: 0; }
.command-grid > form > * { margin: 0; }
.command-grid > form > .hint { align-self: start; }
.command-grid > form > .actions-row { align-self: end; }
@media (max-width: 900px) { .command-grid { grid-template-columns: minmax(0, 1fr); } .command-grid > form { grid-row: auto; display: flex; flex-direction: column; } }
.command-grid .field.wide { max-width: none; }
.dc-message { display: flex; gap: 16px; padding: 12px 16px; border-radius: 8px; background: #313338; color: #dbdee1; font: 400 16px/1.375 "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; overflow-x: auto; }
.dc-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #1e1f22; color: #5b8cff; display: grid; place-items: center; font-weight: 700; }
.dc-main { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 6px; }
.dc-author { font-weight: 500; color: #f2f3f5; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 500; line-height: 15px; padding: 0 4px; border-radius: 3px; }
.dc-content { margin-top: 2px; }
.dc-mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-embed { margin-top: 4px; max-width: 520px; background: #2b2d31; border: 1px solid #1e1f22; border-inline-start: 4px solid #5865f2; border-radius: 4px; padding: 8px 16px 16px 12px; }
.dc-embed-grid { display: flex; gap: 16px; }
.dc-embed-main { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.dc-embed-title { margin-top: 8px; font-size: 16px; font-weight: 600; color: #f2f3f5; }
.dc-embed-description { margin-top: 8px; font-size: 14px; font-weight: 400; line-height: 1.375; white-space: pre-wrap; }
.dc-md :is(h1, h2, h3, ul, ol, pre, blockquote) { margin: 8px 0 0; }
.dc-md h1 { font-size: 1.5em; } .dc-md h2 { font-size: 1.25em; } .dc-md h3 { font-size: 1em; }
.dc-md :is(h1, h2, h3) { color: #f2f3f5; }
.dc-md ul { padding-inline-start: 1.6em; } .dc-md ol { padding-inline-start: 0; list-style-position: inside; }
.dc-md blockquote { padding-inline-start: 12px; border-inline-start: 4px solid #4e5058; }
.dc-md :is(pre, code) { background: #1e1f22; border-radius: 4px; font-family: Consolas, "Andale Mono WT", monospace; }
.dc-md code { padding: 0 4px; font-size: 85%; } .dc-md pre { padding: 6px; white-space: pre-wrap; }
.dc-md .discord-subtext { font-size: 12px; color: #b5bac1; }
.dc-embed-footer { margin-top: 8px; font-size: 12px; font-weight: 500; color: #b5bac1; overflow-wrap: anywhere; }
.dc-embed-thumb { flex: none; width: 80px; height: 80px; margin-top: 8px; border-radius: 4px; background: linear-gradient(135deg, #3b4252, #1e1f22); }
.command-grid > form > .dc-message { align-self: start; width: 100%; box-sizing: border-box; }
.command-grid > form .field { margin: 0; padding: 0; } .command-grid > form label { display: block; margin-bottom: 4px; }
.command-grid > form textarea.msg-edit { min-height: 0; }
.command-grid > form h3, .command-grid > form h4 { margin: 0; line-height: 1.3; }
.dc-content { font-size: 16px; line-height: 1.375; white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-embed-image { display: block; max-width: 100%; max-height: 300px; margin-top: 16px; border-radius: 4px; }
.dc-slot { min-width: 0; margin-block: 4px 12px; }
.dc-md a.dc-link, .dc-embed a.dc-link, .dc-content a.dc-link { color: #00a8fc; text-decoration: none; overflow-wrap: anywhere; } .dc-md a.dc-link:hover { text-decoration: underline; }
.dc-spoiler { background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer; } .dc-spoiler:not(.shown) * { visibility: hidden; } .dc-spoiler.shown { background: rgba(255,255,255,.1); color: inherit; cursor: auto; }
.dc-emoji { height: 1.375em; width: 1.375em; vertical-align: bottom; object-fit: contain; }
/* Embed editor: author, fields, thumbnail picture, role colours */
.dc-embed-author { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 600; color: #f2f3f5; }
.dc-embed-author-icon, .dc-embed-footer-icon { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.dc-embed-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; } .dc-embed-footer-icon { width: 20px; height: 20px; }
.dc-fields { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; margin-top: 8px; }
.dc-field { grid-column: 1 / -1; min-width: 0; } .dc-field.inline { grid-column: span 4; }
@media (max-width: 520px) { .dc-field.inline { grid-column: 1 / -1; } }
.dc-field-name { font-size: 14px; font-weight: 600; color: #f2f3f5; margin-bottom: 2px; }
.dc-field-value { font-size: 14px; white-space: pre-wrap; }
.dc-embed-thumb-img { object-fit: cover; background: none; }
.dc-md .dc-mention, .dc-embed-title .dc-mention { cursor: default; }
/* Embed editor page */
.embed-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.embed-layout .embed-preview { position: sticky; top: 12px; display: grid; gap: 10px; }
@media (max-width: 1100px) { .embed-layout { grid-template-columns: minmax(0, 1fr); } .embed-layout .embed-preview { position: static; } }
.embed-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.embed-tools .btn { min-width: 32px; padding: 2px 8px; font-size: 13px; }
.embed-tools .combo { width: 180px; }
.embed-section { border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; display: grid; gap: 12px; }
.embed-section > summary { cursor: pointer; font-weight: 600; }
.embed-section .field, .embed-layout .field.wide { max-width: none; margin: 0; }
.embed-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.embed-field-card { border: 1px solid var(--border); border-radius: 6px; padding: 10px; display: grid; gap: 8px; background: var(--canvas-inset); }
.embed-field-card .actions-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.embed-count { color: var(--fg-muted); font-size: 12px; text-align: end; } .embed-count.over { color: var(--danger); font-weight: 600; }
.embed-color { width: 56px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--canvas-inset); cursor: pointer; }
.embed-layout input[type="text"], .embed-layout input[type="url"], .embed-layout textarea { width: 100%; box-sizing: border-box; background: var(--canvas-inset); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font: inherit; }
.embed-layout textarea { resize: vertical; }
.embed-layout .field.wide input.embed-color { width: 56px; padding: 2px; }

/* Word-like Markdown editor (embed creator) */
.re { position: relative; display: grid; gap: 4px; }
.re-surface { box-sizing: border-box; width: 100%; background: var(--canvas-inset); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font: inherit; line-height: 1.5; overflow-wrap: anywhere; outline: none; cursor: text; }
.re-surface { position: relative; }
.re-surface:focus { border-color: var(--accent); }
.re-surface[data-empty="1"] .re-line:first-child::before { content: "Write here. Select text and right-click for formatting."; color: var(--fg-muted); pointer-events: none; position: absolute; top: 8px; inset-inline-start: 8px; }
.re-line { min-height: 1.5em; }
.re-line[data-b="h1"] { font-size: 1.6em; font-weight: 700; line-height: 1.25; }
.re-line[data-b="h2"] { font-size: 1.35em; font-weight: 700; line-height: 1.3; }
.re-line[data-b="h3"] { font-size: 1.15em; font-weight: 700; }
.re-line[data-b="q"] { border-inline-start: 4px solid var(--border); padding-inline-start: 10px; }
.re-line[data-b="li"] { padding-inline-start: 1.4em; position: relative; } .re-line[data-b="li"]::before { content: "•"; position: absolute; inset-inline-start: .4em; }
.re-surface code { background: rgba(127, 127, 127, .2); border-radius: 3px; padding: 0 .3em; font-family: ui-monospace, monospace; font-size: .92em; }
.re-surface a { color: #00a8fc; text-decoration: underline; cursor: text; }
.re-spoiler { background: rgba(127, 127, 127, .35); border-radius: 3px; padding: 0 2px; }
.re-chip { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 3px; font-weight: 500; white-space: nowrap; }
.re-source { width: 100%; box-sizing: border-box; background: var(--canvas-inset); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font: 13px/1.5 ui-monospace, monospace; }
.re-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.re-toggle { font-size: 12px; opacity: .8; } .re-toggle[aria-pressed="true"] { opacity: 1; border-color: var(--accent); }
.re-menu { position: absolute; z-index: 30; width: 230px; background: var(--canvas-overlay, #1b1f27); border: 1px solid var(--border); border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); display: grid; }
.re-menu[hidden] { display: none; }
.re-menu hr { border: 0; border-top: 1px solid var(--border-muted, var(--border)); margin: 4px 0; width: 100%; }
.re-item { display: flex; align-items: center; gap: 6px; text-align: start; background: none; border: 0; color: var(--fg); padding: 6px 8px; border-radius: 5px; font: inherit; cursor: pointer; }
.re-item:hover, .re-item:focus-visible { background: rgba(127, 127, 127, .2); outline: none; }
.re-item.on { font-weight: 600; }
.re-tick { width: 1em; color: var(--accent); } .re-hint { color: var(--fg-muted); font-size: 12px; }
.embed-drop { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; border: 1px dashed transparent; border-radius: 8px; padding: 2px; }
.embed-drop input[type="url"] { flex: 1 1 140px; min-width: 0; }
.embed-drop.over { border-color: var(--accent); background: rgba(10, 132, 255, .1); }
.embed-preview .dc-slot { min-height: 60px; border-radius: 8px; }
.embed-preview .dc-slot.pv-drop { outline: 2px dashed var(--accent); outline-offset: 4px; }
.pv-pick { cursor: pointer; border-radius: 4px; transition: outline-color .15s; outline: 1px solid transparent; outline-offset: 2px; position: relative; }
.pv-pick:hover { outline-color: var(--accent); }
.dc-field.pv-pick { cursor: grab; } .dc-field.pv-drag { opacity: .4; } .dc-field.pv-over { outline: 2px solid var(--accent); }
.pv-inline { position: absolute; top: -2px; inset-inline-end: -2px; display: none; background: var(--canvas-overlay); color: var(--fg); border: 1px solid var(--border); border-radius: 4px; font-size: 12px; padding: 0 5px; cursor: pointer; }
.dc-field:hover .pv-inline, .pv-inline:focus-visible { display: block; }
.pv-flash, .pv-flash > .re-surface { animation: pvflash .9s ease; }
@keyframes pvflash { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .pv-flash, .pv-flash > .re-surface { animation: none; } }
