:root {
  --bg: #0b0d10;
  --card: #14181d;
  --border: #222831;
  --text: #e6e9ef;
  --muted: #8a92a3;
  --primary: #5eead4;
  --primary-ink: #042f2e;
  --accent: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0 0 0.4em; }

/* Disable smooth-scroll for users who've asked for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Visible keyboard focus rings — important for accessibility and only kick in
   for keyboard users (not mouse clicks). */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Touch hint: removes the 300ms tap delay on iOS for buttons/links. */
.btn, .tab, summary { touch-action: manipulation; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px 16px;
}
.top .brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.top nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; }
.top nav a:not(.btn) { color: var(--muted); }
.top nav a:not(.btn):hover { color: var(--text); }

.container { max-width: 960px; margin: 40px auto; padding: 0 24px; }
.hero { padding: 80px 24px; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.03em; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 24px; }

.btn {
  display: inline-block; padding: 12px 18px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 600;
  min-height: 44px; line-height: 1.2;
  text-align: center;
}
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--danger { background: var(--danger); color: white; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
/* Long URLs (pages.dev, custom domains) inside cards should wrap rather than
   overflow on narrow screens. */
.card a { overflow-wrap: anywhere; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

[hidden] { display: none !important; }
.form { display: grid; gap: 14px; max-width: 520px; }
.form label { display: grid; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.form input, .form textarea, .form select {
  background: #0e1116; color: var(--text); border: 1px solid var(--border);
  padding: 12px 12px; border-radius: var(--radius); font: inherit;
  /* >=16px prevents iOS Safari from auto-zooming on focus. */
  font-size: max(1rem, 16px);
  width: 100%;
}
.form input[type="checkbox"], .form input[type="radio"] {
  width: auto; padding: 0;
}
.form textarea { resize: vertical; min-height: 96px; }
.form .row { display: flex; gap: 12px; flex-wrap: wrap; }
.form .row > * { flex: 1 1 200px; }

.tabs {
  display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border);
  /* On narrow screens, let long tab labels scroll horizontally instead of
     wrapping or overflowing the viewport. */
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 12px 14px; border: 1px solid transparent; border-bottom: none;
  background: transparent; color: var(--muted); cursor: pointer; border-radius: 10px 10px 0 0;
  white-space: nowrap; font: inherit; min-height: 44px;
}
.tab.is-active { color: var(--text); border-color: var(--border); background: var(--card); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 0.78rem; background: #1e242c; border: 1px solid var(--border); color: var(--muted);
}
.tag.ok { color: #5eead4; border-color: #115e59; background: #042f2e; }
.tag.warn { color: #fbbf24; border-color: #92400e; background: #1c1303; }
.tag.err { color: #f87171; border-color: #7f1d1d; background: #1a0606; }

.site-list { display: grid; gap: 14px; }
.site-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.site-row > * { min-width: 0; }
.site-row h3 { margin: 0 0 4px; word-break: break-word; }
.site-row a { word-break: break-word; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.88rem; word-break: break-all; }

.toast {
  position: fixed; bottom: 24px; right: 24px; left: 24px; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  max-width: 380px; margin-left: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 1000;
}
.toast.err { border-color: #7f1d1d; color: #fecaca; }

/* ---- Mobile / narrow-screen overrides ----------------------------------- */
@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  .container { margin: 24px auto; padding: 0 16px; }
  .card { padding: 16px; }
  .site-row { flex-direction: column; align-items: stretch; }
  /* Action containers inside site-row use inline `display:flex` to keep tag +
     button(s) on one line. Force them to wrap on mobile so full-width buttons
     don't overflow. */
  .site-row > div { flex-wrap: wrap; }
  .site-row .btn { width: 100%; }
  .form .row > * { flex-basis: 100%; }
  .form .row .btn { width: 100%; }
}

/* ---- Editor (chat-left, iframe-right) ----------------------------------- */
.editor-body { height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: #0a0c10; }
.editor-body .top {
  flex: 0 0 auto;
  background: rgba(20, 24, 29, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
}
.editor {
  flex: 1 1 auto; min-height: 0;
  display: grid;
  grid-template-columns: minmax(340px, 440px) 1fr;
  gap: 0;
}
.editor__chat {
  display: flex; flex-direction: column; min-height: 0;
  /* Clip any child that tries to grow past the chat column's grid track.
     Without `min-width: 0` the column would refuse to shrink below
     content min-size; with `overflow: hidden` long target labels and
     pasted URLs can't visually leak under the preview pane. */
  min-width: 0; overflow: hidden;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #0d1015 0%, #0a0c10 100%);
}
.chat-scroll {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  padding: 20px 20px 12px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-scroll::-webkit-scrollbar { width: 8px; }
.chat-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.chat-input {
  flex: 0 0 auto;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
  background: rgba(20, 24, 29, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid; gap: 10px;
  /* Grid children default to min-width: auto, refusing to shrink below
     their content width. Override here so a long target-badge label or a
     pasted URL in the title input can't push the chat column wider. */
  min-width: 0;
}
.chat-input > * { min-width: 0; }
.chat-input__row > * { min-width: 0; }
.chat-input textarea {
  background: #0e1116; color: var(--text); border: 1px solid var(--border);
  padding: 12px 14px; border-radius: 12px; font: inherit;
  font-size: max(0.95rem, 16px); resize: vertical; min-height: 72px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chat-input textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
}
.chat-input__row { display: flex; gap: 8px; }
.chat-input__row input {
  flex: 1 1 auto; min-width: 0;
  background: #0e1116; color: var(--text); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: 10px; font: inherit;
  font-size: max(0.9rem, 16px);
  transition: border-color 0.15s ease;
}
.chat-input__row input:focus { outline: none; border-color: var(--primary); }
.chat-input__row .btn { flex: 0 0 auto; min-height: 40px; padding: 8px 18px; }

.btn--sm { padding: 6px 12px; min-height: 32px; font-size: 0.85rem; border-radius: 8px; }

/* Chat bubbles: user-aligned-right, assistant/system-aligned-left, with a
   distinct accent for the user's request. */
.msg {
  border-radius: 14px;
  padding: 12px 14px;
  display: grid; gap: 6px;
  max-width: 92%;
  font-size: 0.92rem; line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.msg--user {
  background: linear-gradient(135deg, #0f3a36 0%, #0b2826 100%);
  border-color: #134e4a;
  color: #d1faf3;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg--assistant {
  background: var(--card);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg--system {
  background: transparent;
  border-style: dashed;
  border-color: var(--border);
  color: var(--muted);
  align-self: stretch;
  max-width: 100%;
}
.msg__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted);
}
.msg__from { font-weight: 700; color: inherit; opacity: 0.85; }
.msg--user .msg__from { color: var(--primary); }
.msg__body { word-wrap: break-word; }
.msg__log {
  margin: 0; font-family: var(--mono); font-size: 0.78rem;
  color: var(--muted); white-space: pre-wrap; word-break: break-word;
  background: rgba(10, 12, 16, 0.6); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; max-height: 220px; overflow-y: auto;
}
.msg__log--full { max-height: 320px; }
.msg__details summary { cursor: pointer; color: var(--muted); font-size: 0.8rem; }
.msg__details summary:hover { color: var(--text); }
.msg__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.link {
  background: none; border: none; color: var(--primary); cursor: pointer;
  padding: 0; font: inherit; text-decoration: underline;
}

/* Browser-chrome preview pane: rounded "window" with traffic-light dots and
   a centered URL pill. Sits inside a darker stage so the white iframe pops. */
.editor__preview {
  display: flex; flex-direction: column; min-height: 0;
  background: #0a0c10;
  padding: 16px 16px 0;
  gap: 12px;
}
.preview-window {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: #161a20;
  border: 1px solid var(--border);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.02) inset;
}
.preview-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #1a1f26 0%, #161a20 100%);
  border-bottom: 1px solid var(--border);
}
.preview-bar__dots { display: flex; gap: 6px; }
.preview-bar__dots span {
  width: 11px; height: 11px; border-radius: 50%;
  display: inline-block;
}
.preview-bar__dots span:nth-child(1) { background: #ff5f57; }
.preview-bar__dots span:nth-child(2) { background: #febc2e; }
.preview-bar__dots span:nth-child(3) { background: #28c840; }
.preview-bar__url {
  flex: 1 1 auto; min-width: 0;
  text-align: center;
  font: 0.82rem var(--mono);
  color: var(--muted);
  background: #0e1116;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.preview-bar__url > span:last-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.preview-bar__badge {
  flex: 0 0 auto;
  font-size: 0.62rem; letter-spacing: 0.08em; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  background: var(--primary); color: var(--primary-ink);
}
.preview-bar__open,
.preview-bar__action {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--muted);
  background: transparent; border: 1px solid var(--border);
  text-decoration: none; font-size: 0.95rem;
  cursor: pointer; padding: 0; font: inherit;
}
.preview-bar__open:hover,
.preview-bar__action:hover { color: var(--text); border-color: var(--muted); }
.preview-bar__action.is-active {
  color: var(--primary-ink); background: var(--primary); border-color: var(--primary);
}

.viewport-toggle {
  flex: 0 0 auto;
  display: flex; gap: 0;
  background: #0e1116; border: 1px solid var(--border); border-radius: 7px; padding: 2px;
}
.viewport-toggle__btn {
  background: transparent; border: 0; cursor: pointer; padding: 0;
  width: 26px; height: 22px; line-height: 1;
  color: var(--muted); border-radius: 5px;
  font: 0.8rem var(--mono);
}
.viewport-toggle__btn:hover { color: var(--text); }
.viewport-toggle__btn.is-active {
  background: var(--card); color: var(--text);
}

.preview-frame {
  flex: 1 1 auto; min-height: 0; position: relative;
  background: #fff;
  display: flex; align-items: stretch; justify-content: center;
  overflow: auto;
}
.preview-frame[data-viewport="tablet"] { background: #0a0c10; padding: 16px 0; }
.preview-frame[data-viewport="tablet"] iframe {
  max-width: 768px; width: 100%; height: 100%;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.preview-frame[data-viewport="mobile"] { background: #0a0c10; padding: 16px 0; }
.preview-frame[data-viewport="mobile"] iframe {
  max-width: 390px; width: 100%; height: 100%;
  border: 1px solid var(--border); border-radius: 22px; background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.target-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.4);
  border-radius: 8px;
  font-size: 0.82rem; color: var(--text);
  min-width: 0; max-width: 100%;
}

/* ---- Change-request rate badge + scheduled queue ------------------- */
.rate-panel {
  display: grid; gap: 8px;
  font-size: 0.82rem;
}
.rate-panel__row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.rate-panel__row--limited {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.35);
}
.rate-panel__count { color: var(--text); font-variant-numeric: tabular-nums; }
.rate-panel__sep { color: var(--muted); }
.rate-panel__toggle {
  margin-left: auto;
  border: 0; background: transparent; color: var(--muted);
  font: inherit; cursor: pointer; padding: 0;
}
.rate-panel__toggle:hover { color: var(--text); }
.rate-panel__list {
  display: grid; gap: 6px;
  max-height: 200px; overflow-y: auto;
  padding: 4px 0;
}
.rate-panel__item {
  display: grid; gap: 4px;
  padding: 8px 10px;
  background: #0e1116;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.rate-panel__item-head {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.rate-panel__item-title {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
}
.rate-panel__item-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.rate-panel__item-desc {
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rate-panel__item-actions {
  display: flex; gap: 6px; justify-content: flex-end;
}
.rate-panel__edit textarea, .rate-panel__edit input {
  width: 100%;
  background: #0a0c10; color: var(--text); border: 1px solid var(--border);
  padding: 6px 8px; border-radius: 6px; font: inherit; font-size: 0.85rem;
  resize: vertical;
}
.rate-panel__edit { display: grid; gap: 6px; }
.target-badge__clear {
  border: 0; background: transparent; color: var(--muted);
  font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 4px;
}
.target-badge__clear:hover { color: var(--text); }

.preview-frame {
  flex: 1 1 auto; min-height: 0; position: relative;
  background: #fff;
}
.preview-frame iframe {
  width: 100%; height: 100%; border: 0; display: block;
}
.preview-overlay {
  position: absolute; inset: 0;
  background: rgba(11, 13, 16, 0.72); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.preview-overlay__inner {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 20px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.preview-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px; color: var(--muted); background: var(--bg);
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Bottom panel system — a single-active-tab strip + an expandable
   content stage below it. Replaces the old accordion grid: collapsed
   state is one ~36px tab row (no panels open = no wasted space); when
   a tab is active, the stage opens BELOW the tabs with full width for
   the panel body. No reflow of other tabs when switching. */
.panel-tabs {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: rgba(20, 24, 29, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.panel-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: transparent; color: var(--muted);
  border: 1px solid transparent; border-radius: 6px;
  font: inherit; font-size: 0.82rem; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  min-height: 32px;
}
.panel-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.panel-tab.is-active {
  color: var(--text);
  background: var(--card);
  border-color: var(--border);
}
.panel-tab .tag { margin-left: 2px; }
.panel-tab--close {
  margin-left: auto;
  color: var(--muted); font-size: 1.1rem; line-height: 1;
  padding: 6px 10px;
}

.panel-stage {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: rgba(14, 17, 22, 0.85);
  padding: 16px 20px;
  max-height: 55vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.panel-stage::-webkit-scrollbar { width: 8px; }
.panel-stage::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.panel { min-width: 0; }
.panel[hidden] { display: none; }
.panel__head {
  margin: 0 0 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.panel__head h3 {
  margin: 0; font-size: 1rem; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em;
}
.panel__head p {
  margin: 0; font-size: 0.85rem; color: var(--muted);
  max-width: 70ch;
}
.panel__toolbar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 14px;
}

/* Site-settings sub-blocks: side-by-side cards on wide screens, stacked
   on narrow. Keeps the four settings (domain / preview / backup / fonts)
   readable without one huge scroll. */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.settings-block {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(20, 24, 29, 0.5);
}
.settings-block h4 {
  margin: 0 0 6px; font-size: 0.92rem; font-weight: 600;
}
.settings-block p { margin: 0 0 10px; font-size: 0.85rem; }
.settings-block .form { margin-top: 4px; }

.suggestion-group {
  display: grid; gap: 6px;
  margin-top: 8px;
}
.suggestion-group:first-of-type { margin-top: 4px; }
.suggestion-group__head {
  display: flex; align-items: center; gap: 8px;
  padding: 0 2px;
}

.suggestions { display: grid; gap: 6px; }
.suggestion {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  background: rgba(10, 12, 16, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
}
.suggestion > div { min-width: 0; }
.suggestion .btn { flex: 0 0 auto; }
.suggestion__cat {
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
  font-size: 0.68rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 3px;
  color: var(--muted);
}

/* ---- Link health panel -------------------------------------------------
   Findings are grouped by status (broken / skipped / ok); each finding is
   a collapsible row showing the target URL plus the pages that reference it. */
.link-group { margin-bottom: 8px; }
.link-group > summary {
  display: flex; align-items: center; gap: 8px;
  list-style: none; cursor: pointer;
  padding: 6px 0; color: var(--text);
}
.link-group > summary::-webkit-details-marker { display: none; }
.link-group > summary::before { content: "▸ "; opacity: 0.6; margin-right: 2px; }
.link-group[open] > summary::before { content: "▾ "; }
.link-group__body { display: grid; gap: 6px; padding: 4px 0 8px; }

.link-finding {
  background: rgba(10, 12, 16, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
}
.link-finding[data-status="broken"], .link-finding[data-status="unreachable"] {
  border-color: rgba(239, 68, 68, 0.3);
}
.link-finding > summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  list-style: none; cursor: pointer;
  padding: 8px 10px;
  min-width: 0;
}
.link-finding > summary::-webkit-details-marker { display: none; }
.link-finding > summary > .btn { flex: 0 0 auto; margin-left: auto; }
.link-finding__target {
  flex: 1 1 220px; min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}
.link-finding__body {
  padding: 0 12px 10px;
  border-top: 1px dashed var(--border);
}
.link-refs {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 4px;
  max-height: 220px; overflow-y: auto;
}
.link-ref {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 4px 6px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
}
.link-ref .mono { color: var(--text); }

/* The "Did you mean: /about" affordance — high contrast so it's
   obviously the recommended action. */
.link-suggestion {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; margin: 0 0 10px;
  border: 1px solid rgba(94, 234, 212, 0.25);
  background: rgba(94, 234, 212, 0.05);
  border-radius: 6px;
  font-size: 0.86rem;
}
.link-suggestion code {
  background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 3px;
  color: var(--primary);
  overflow-wrap: anywhere;
}
.link-suggestion .btn { margin-left: auto; flex: 0 0 auto; }

/* Per-host rollup row — compact, so 20 hosts don't chew up screen. */
.host-rollup {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  background: rgba(10, 12, 16, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.86rem;
}

.inquiry-list { display: grid; gap: 8px; }
.inquiry {
  background: rgba(10, 12, 16, 0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.inquiry.is-unread { border-color: var(--primary); background: rgba(94, 234, 212, 0.06); }
.inquiry > summary {
  list-style: none; cursor: pointer;
  padding: 10px 12px; font-size: 0.88rem;
}
.inquiry > summary::-webkit-details-marker { display: none; }
.inquiry__head {
  display: flex; gap: 8px; align-items: center; min-width: 0;
}
.inquiry__snip {
  font-size: 0.8rem; margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inquiry__body {
  padding: 0 12px 12px; border-top: 1px solid var(--border);
}
.kv-row {
  display: grid; grid-template-columns: minmax(80px, 1fr) 3fr; gap: 12px;
  padding: 6px 0; border-bottom: 1px dashed var(--border);
  font-size: 0.85rem;
}
.kv-row:last-child { border-bottom: 0; }
.kv-key {
  color: var(--muted); font-family: var(--mono); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kv-val { white-space: pre-wrap; word-break: break-word; }

.analytics-install {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
}
.analytics-install > div { flex: 1; min-width: 0; }
.analytics-install .btn { flex: 0 0 auto; }

.analytics-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 4px 0 12px;
}
.analytics-stats > div {
  padding: 10px 12px;
  background: rgba(10, 12, 16, 0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.analytics-num { font-size: 1.5rem; font-weight: 700; line-height: 1; }

.sparkline {
  display: flex; align-items: flex-end; gap: 2px;
  height: 48px; padding: 4px;
  background: rgba(10, 12, 16, 0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
}
.sparkline__bar {
  flex: 1 1 0;
  min-height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}

.analytics-cols {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 480px) { .analytics-cols { grid-template-columns: 1fr 1fr; } }
.analytics-h {
  margin: 0 0 6px; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted);
}
.analytics-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 4px;
  font-size: 0.85rem;
}
.analytics-list li {
  display: flex; justify-content: space-between; gap: 8px;
  overflow: hidden;
}
.analytics-list .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gbp-card {
  padding: 12px;
  background: rgba(10, 12, 16, 0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.gbp-candidate {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  background: rgba(10, 12, 16, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
}
.gbp-candidate > div { min-width: 0; }
.gbp-candidate .btn { flex: 0 0 auto; }

.history-list { display: grid; gap: 8px; }
.history-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(10, 12, 16, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.history-row > div { min-width: 0; }
.history-row .btn { flex: 0 0 auto; }

@media (max-width: 900px) {
  /* Stack: chat on top, preview below. Each scrolls itself. */
  .editor-body { height: auto; overflow: visible; }
  .editor {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 60vh) minmax(360px, 60vh);
  }
  .editor__chat { border-right: 0; border-bottom: 1px solid var(--border); }
  .editor__preview { padding: 12px 12px 0; }
}
