/* Mismos colores que el panel de realtime-hub. */
:root {
    --bg: #f6f7f9; --card: #fff; --text: #16181d; --muted: #5f6775; --line: #dfe3e8; --accent: #2563eb; --on-accent: #fff; --sel: #eaf1ff;
    --red: #c42121; --red-bg: #fee2e2; --green: #137a39; --green-bg: #dcfce7; --yellow: #975a05; --yellow-bg: #fef3c7;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace; color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1115; --card: #171a21; --text: #e7e9ee; --muted: #9aa1ad; --line: #2a2f3a; --accent: #7aa5ff; --on-accent: #0f1115; --sel: #1b2740;
        --red: #ff8b8b; --red-bg: #3b1515; --green: #6fd895; --green-bg: #12301d; --yellow: #f3bf61; --yellow-bg: #3a2c0c;
    }
}
* { box-sizing: border-box; min-width: 0; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: 20px; }
h2 { font-size: 18px; overflow-wrap: anywhere; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 18px 16px 40px; display: grid; gap: 16px; }
.stack { display: grid; gap: 16px; align-content: start; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
nav, .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { align-items: end; }
button, .button, input, select, textarea {
    font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 6px;
    padding: 8px 12px; min-height: 42px; max-width: 100%;
}
button, .button { cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { border-color: var(--accent); }
.primary, .button[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.danger { color: var(--red); border-color: var(--red); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
textarea { width: 100%; font: 13px/1.5 var(--mono); }
.note { padding: 10px 12px; border-radius: 6px; }
.note.good { background: var(--green-bg); color: var(--green); }
.note.bad { background: var(--red-bg); color: var(--red); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.box { padding: 16px; }
.login { width: min(100%, 380px); display: grid; gap: 16px; }
.secret { border-color: var(--yellow); background: var(--yellow-bg); }
.filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; }
.filters input, .filters select { width: 100%; }
.filters .wide { grid-column: 1 / -1; }
.filters .button { text-align: center; }
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; }
.item { display: grid; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.item:last-child { border-bottom: 0; }
.item:hover, .item[aria-current] { background: var(--sel); }
.item strong { font-weight: 600; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pill { font-size: 12px; font-weight: 600; border-radius: 99px; padding: 1px 9px; background: var(--line); }
.pill.new { background: var(--red-bg); color: var(--red); }
.pill.reopened { background: var(--yellow-bg); color: var(--yellow); }
.pill.resolved { background: var(--green-bg); color: var(--green); }
dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
dt { color: var(--muted); font-size: 13px; }
dd { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
summary { cursor: pointer; overflow-wrap: anywhere; }
details p { margin-top: 8px; overflow-wrap: anywhere; }
pre { font: 13px/1.6 var(--mono); margin: 8px 0 0; padding: 12px; background: var(--bg); border-radius: 6px; overflow-x: auto; white-space: pre; }
.confirm summary { list-style: none; }
.confirm form { display: grid; gap: 8px; padding-top: 8px; justify-items: start; }
.back { display: none; justify-self: start; }
@media (max-width: 820px) {
    .filters { grid-template-columns: 1fr 1fr; }
    .cols { grid-template-columns: minmax(0, 1fr); }
    .cols.open .list, .cols:not(.open) .detail { display: none; }
    .back { display: inline-block; }
    select { padding-inline: 6px; font-size: 14px; }
    /* Con un error abierto, los filtros solo obligarían a bajar para leerlo. */
    main:has(.cols.open) > :is(.filters, .muted) { display: none; }
}
