/* Palette from Thmanyah's brand guide; text colours darkened where needed for AA contrast. */
:root {
  --bg: #f5efec;
  --surface: #ffffff;
  --surface-2: #faf6f4;
  --sunken: #efe7e3;
  --border: #e4d9d4;
  --border-strong: #cfc1ba;
  --text: #1e1f33;
  --muted: #5f5b6b;
  --primary: #0068ff;
  --primary-text: #ffffff;
  --focus: color-mix(in srgb, #0068ff 30%, transparent);
  --danger: #d4321f;
  --danger-soft: #fdebe8;
  --ok: #00875a;
  --ok-dot: #00ba74;
  --ok-soft: #e3f6ee;
  --warn: #7a5600;
  --warn-soft: #fff4cc;
  --added: #e3f6ee;
  --removed: #fdebe8;
  --critical: #ef4632;
  --caution: #ffcb00;
  --calm: #00ba74;
  --get: #0057d6;
  --post: #00875a;
  --put: #9a5b00;
  --patch: #7a3fc2;
  --delete: #d4321f;
  --shadow-sm: 0 1px 2px rgba(30, 31, 51, 0.06);
  --shadow: 0 18px 50px rgba(30, 31, 51, 0.18);
  --radius: 14px;
  --radius-sm: 9px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151f;
    --surface: #1e1f33;
    --surface-2: #23253a;
    --sunken: #181927;
    --border: #2f3249;
    --border-strong: #42465f;
    --text: #f5efec;
    --muted: #a8a4b6;
    --primary: #4d8dff;
    --primary-text: #0b0c14;
    --focus: color-mix(in srgb, #4d8dff 35%, transparent);
    --danger: #ff7a66;
    --danger-soft: #3a1f22;
    --ok: #3ddc97;
    --ok-dot: #3ddc97;
    --ok-soft: #15322a;
    --warn: #ffd96a;
    --warn-soft: #3a3115;
    --added: #15322a;
    --removed: #3a1f22;
    --get: #7fb0ff;
    --post: #3ddc97;
    --put: #ffb45b;
    --patch: #c49bff;
    --delete: #ff7a66;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
}

h1, h2, p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
svg { width: 16px; height: 16px; flex: none; }

/* ------------------------------------------------------------ environment */

.env-stripe { height: 4px; background: var(--calm); }
body[data-tone="critical"] .env-stripe { background: var(--critical); height: 5px; }
body[data-tone="caution"] .env-stripe { background: var(--caution); }

.env-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
}
body[data-tone="critical"] .env-badge { background: var(--critical); color: #fff; }
body[data-tone="caution"] .env-badge { background: var(--caution); color: #1e1f33; }

/* ------------------------------------------------------------ top bar */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand h1 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.key { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }

.account { position: relative; }
.account-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--surface-2);
}
.account-email { max-width: 240px; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.chevron { width: 14px; height: 14px; color: var(--muted); }
.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: #0068ff;
}
.avatar.tone-1 { background: #ef4632; }
.avatar.tone-2 { background: #00875a; }
.avatar.tone-3 { background: #6d1a22; }
.avatar.tone-4 { background: #7a3fc2; }
.avatar.tone-5 { background: #1e1f33; outline: 1px solid var(--border-strong); }
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 300px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.menu-label { color: var(--muted); font-size: 12px; }
.menu-email { font-weight: 650; margin: 2px 0 8px; word-break: break-all; }
.menu-note { color: var(--muted); font-size: 12.5px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.menu-action {
  display: block;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-weight: 600;
  text-decoration: none;
}
.menu-action:hover { background: var(--danger-soft); }

/* ------------------------------------------------------------ controls */

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  width: 100%;
  min-width: 0;
}
textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, filter 0.12s, border-color 0.12s;
}
button:hover { background: var(--surface-2); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
button.primary:hover { filter: brightness(1.08); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger:hover { filter: brightness(1.06); }
button.ghost { background: transparent; }
button.ghost:hover { background: var(--surface-2); }
button.quiet { border-color: transparent; background: transparent; padding: 6px 10px; color: var(--muted); }
button.quiet:hover { background: var(--sunken); color: var(--text); }
button.quiet.danger-text:hover { background: var(--danger-soft); color: var(--danger); }
.icon-button { padding: 7px; border-color: transparent; background: transparent; color: var(--muted); }
.icon-button:hover { color: var(--text); }

kbd {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
}

/* ------------------------------------------------------------ gate (loading, signed out, not allowed) */

.gate { display: grid; place-items: center; min-height: calc(100vh - 70px); padding: 24px; }
.gate-card {
  width: min(460px, 100%);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
}
.gate-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--sunken);
  display: grid;
  place-items: center;
}
.gate-icon svg { width: 26px; height: 26px; color: var(--muted); }
.gate-icon.spin svg { animation: spin 0.9s linear infinite; }
.gate-icon.bad { background: var(--danger-soft); }
.gate-icon.bad svg { color: var(--danger); }
.gate h2 { font-size: 19px; margin-bottom: 8px; }
.gate p { color: var(--muted); }
.gate-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.gate-actions a { text-decoration: none; }
@keyframes spin { to { transform: rotate(360deg); } }

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

main { max-width: 1360px; margin: 0 auto; padding: 22px 28px 64px; }

.banner {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 550;
}
.banner.warn { background: var(--warn-soft); color: var(--warn); }

.live {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.live-state { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 260px; }
.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok-dot);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok-dot) 60%, transparent);
  animation: pulse 2.4s infinite;
}
.pulse.idle { background: var(--border-strong); animation: none; }
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.live-title { font-size: 15px; font-weight: 700; }
.live-title .mono { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.live-sub { color: var(--muted); font-size: 13px; }
.live-sub strong { color: var(--text); font-weight: 600; }
.live-stats { display: flex; gap: 28px; margin: 0; }
.live-stats div { display: flex; flex-direction: column-reverse; }
.live-stats dt { color: var(--muted); font-size: 12px; }
.live-stats dd { margin: 0; font-size: 18px; font-weight: 700; }
.live-actions { display: flex; gap: 8px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }

/* ------------------------------------------------------------ routes */

.routes-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.routes-head h2 { font-size: 17px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.search {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.search input { border: none; padding: 9px 0; background: transparent; box-shadow: none !important; }
.search input:focus-visible { box-shadow: none; }

.segmented {
  display: flex;
  background: var(--sunken);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.segmented button {
  border: none;
  background: transparent;
  padding: 5px 11px;
  font-size: 12.5px;
  color: var(--muted);
  border-radius: 7px;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.segmented .count { font-weight: 500; opacity: 0.7; margin-left: 2px; }

.route-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.route-list:empty { display: none; }
.route {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 4px 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.route:last-child { border-bottom: none; }
.route:hover { background: var(--surface-2); }
.route.changed { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--ok-soft); } }
.route .method { grid-row: span 3; align-self: start; margin-top: 1px; }
.route-path { font-family: var(--mono); font-weight: 650; font-size: 14px; word-break: break-all; }
.route-target { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 13px; min-width: 0; }
.route-target .arrow { color: var(--border-strong); }
.route-target .mono { color: var(--text); word-break: break-all; }
.route-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip strong { color: var(--text); font-weight: 600; }
.route-actions { grid-row: 1 / span 3; grid-column: 3; display: flex; gap: 2px; align-self: start; }

.method {
  display: inline-block;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 0;
  width: 62px;
  border-radius: 6px;
  color: var(--get);
  background: color-mix(in srgb, currentColor 11%, transparent);
}
.method.POST { color: var(--post); }
.method.PUT { color: var(--put); }
.method.PATCH { color: var(--patch); }
.method.DELETE { color: var(--delete); }

.empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty h3 { color: var(--text); font-size: 16px; margin: 0 0 6px; }
.empty p { max-width: 460px; margin: 0 auto; }
.empty button { margin-top: 18px; }

.skeleton { height: 76px; border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 22px 18px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--sunken), var(--surface-2), var(--sunken));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ rail */

.rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 86px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.panel h2 { font-size: 15px; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: 13px; }
.explain-form { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.explain-form button { grid-column: 1 / -1; }
.explain-result { margin-top: 12px; font-size: 13px; }
.explain-result:empty { display: none; }
.verdict { padding: 11px 12px; border-radius: var(--radius-sm); background: var(--sunken); }
.verdict.dynamic { background: var(--ok-soft); }
.verdict.blocked { background: var(--danger-soft); }
.verdict-title { font-weight: 650; margin-bottom: 4px; }
.verdict .mono { word-break: break-all; }
.verdict-line { color: var(--muted); }
.verdict-line .mono { color: var(--text); }

.how ol { margin: 10px 0 12px; padding-left: 20px; font-size: 13px; }
.how li { margin-bottom: 6px; }

/* ------------------------------------------------------------ drawer (editor) */

dialog { color: var(--text); }
dialog::backdrop { background: rgba(20, 21, 31, 0.5); }

.drawer {
  margin: 0 0 0 auto;
  height: 100vh;
  max-height: 100vh;
  width: min(760px, 100vw);
  max-width: 100vw;
  padding: 0;
  border: none;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.drawer[open] { animation: slide-in 0.18s ease-out; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.drawer-form { display: flex; flex-direction: column; height: 100%; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 26px 12px; }
.eyebrow { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.drawer-head h2 { font-size: 18px; word-break: break-all; }
.tabs { display: flex; gap: 4px; padding: 0 26px; border-bottom: 1px solid var(--border); }
.tab {
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 9px 4px;
  margin-right: 14px;
  color: var(--muted);
}
.tab:hover { background: transparent; color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 26px 26px; }

fieldset { border: none; padding: 0; margin: 0 0 22px; }
legend { font-weight: 700; font-size: 13.5px; margin-bottom: 10px; padding: 0; }
.grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 14px; }
.grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.grid small { color: var(--muted); font-weight: 400; font-size: 12px; }
.grid .check { flex-direction: row; align-items: center; gap: 9px; font-weight: 400; align-self: end; padding-bottom: 8px; }
.grid .check input { width: auto; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.code { min-height: 420px; font-size: 12.5px; }
.panel-json .hint { margin-top: 8px; }

.notice {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--sunken);
  margin-bottom: 16px;
  font-size: 13px;
}
.notice.warn { background: var(--warn-soft); color: var(--warn); }

.drawer-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 26px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.preview { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); }
.preview .mono { color: var(--text); word-break: break-all; }
.drawer-actions { display: flex; gap: 8px; }

.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}

/* ------------------------------------------------------------ confirmation */

.dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 24px 26px;
  width: min(620px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}
.dialog h2 { font-size: 18px; margin-bottom: 12px; word-break: break-all; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.confirm-body { font-size: 14px; }
.confirm-body p { margin-bottom: 10px; }
.impact {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 14px;
  font-size: 13px;
}
body[data-tone="critical"] .impact { background: var(--danger-soft); color: var(--danger); }
.confirm-author { color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.diff { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.diff th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.diff td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; font-family: var(--mono); word-break: break-all; }
.diff .before { background: var(--removed); }
.diff .after { background: var(--added); }
.diff .field { font-family: var(--sans); color: var(--muted); white-space: nowrap; }
.summary-list { margin: 6px 0 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 12.5px; }
.summary-list li { padding: 3px 8px; border-radius: 5px; margin-bottom: 2px; }
.summary-list .add { background: var(--added); }
.summary-list .del { background: var(--removed); }
.summary-list .mod { background: var(--warn-soft); }
.summary-list.scroll { max-height: 40vh; overflow-y: auto; }

.import-file { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.import-file input { font: inherit; font-weight: 400; min-width: 0; }

/* ------------------------------------------------------------ history */

.history-intro { margin-bottom: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: start;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}
.entry:last-child { border-bottom: none; }
.entry.loading, .entry.empty-entry { display: block; color: var(--muted); padding: 18px 4px; }
.entry-main { min-width: 0; }
.entry-title { font-weight: 600; word-break: break-word; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 4px 0; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.entry-meta > span + span::before { content: "·"; margin: 0 7px; color: var(--border-strong); }
.version-tag {
  min-width: 46px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--sunken);
  color: var(--muted);
}
.live-entry .version-tag { background: var(--ok-soft); color: var(--ok); }
.live-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
}
button.small { padding: 5px 11px; font-size: 13px; }

.action-tag {
  min-width: 74px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--sunken);
}
.action-tag.create { color: var(--post); background: color-mix(in srgb, var(--post) 12%, transparent); }
.action-tag.update { color: var(--put); background: color-mix(in srgb, var(--put) 12%, transparent); }
.action-tag.delete { color: var(--delete); background: color-mix(in srgb, var(--delete) 12%, transparent); }
.action-tag.rollback { color: var(--get); background: color-mix(in srgb, var(--get) 12%, transparent); }
.action-tag.apply { color: var(--patch); background: color-mix(in srgb, var(--patch) 12%, transparent); }
.entry .action-tag + .entry-main { grid-column: 2 / -1; }

.entry-details { margin-top: 8px; }
.entry-details summary { cursor: pointer; color: var(--primary); font-size: 13px; font-weight: 600; width: fit-content; }
.entry-details[open] summary { margin-bottom: 8px; }
.change-block { margin-bottom: 12px; }
.change-head { font-size: 13px; padding: 5px 8px; border-radius: 6px 6px 0 0; background: var(--sunken); word-break: break-all; }
.change-head.added { background: var(--added); }
.change-head.removed { background: var(--removed); }
.change-head.changed { background: var(--warn-soft); }
.request-info { font-size: 12px; word-break: break-word; }
.more { display: flex; justify-content: center; padding-top: 12px; }

/* ------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  z-index: 20;
}
.toast.error { background: var(--danger); color: #fff; }

/* ------------------------------------------------------------ small screens */

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
}

@media (max-width: 720px) {
  .topbar { padding: 10px 16px; gap: 10px; }
  .key, .account-email, .chevron { display: none; }
  .account-button { padding: 4px; }
  main { padding: 16px 16px 48px; }
  .live { gap: 14px; }
  .live-stats { gap: 20px; }
  .live-actions { width: 100%; flex-wrap: wrap; }
  .live-actions button { flex: 1 1 auto; }
  .entry { grid-template-columns: minmax(0, 1fr); }
  .entry .action-tag + .entry-main { grid-column: auto; }
  .entry > button, .entry > .version-tag, .entry > .action-tag { justify-self: start; }
  .segmented { width: 100%; overflow-x: auto; }
  .route { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .route .method { grid-row: auto; }
  .route-actions { grid-row: auto; grid-column: auto; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid > * { grid-column: auto; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 16px; padding-right: 16px; }
  .tabs { padding: 0 16px; }
  .drawer-foot { flex-direction: column; align-items: stretch; }
  .drawer-actions button { flex: 1; }
}

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