@import url("fonts.css");
@import url("tokens.css");

    /* Input container styling */
    #inputContainer {
      width: 100%;
      text-align: center;
      padding: 20px 0;
    }
    textarea {
      width: 100%;
      height: 150px;
      font-family: monospace;
      padding: 10px;
      border: 1px solid var(--line-1);
      border-radius: 4px;
    }
    button {
      margin-top: 10px;
      padding: 10px 20px;
      font-size: 16px;
      cursor: pointer;
      background-color: var(--accent);
      color: var(--on-accent);
      border: none;
      border-radius: 4px;
    }
    button:hover {
      background-color: var(--accent-hover);
    }
    /* Stats billboard styling */
    #stats {
      margin: 0 auto;
      width: 100%;
      max-width: 1200px;
      flex-shrink: 0;  /* Prevent shrinking */
    }
    /* Tree container styling: make it responsive */
    #treeContainer {
      flex: 1;  /* Take remaining space */
      min-height: 600px;
      height: calc(100vh - 200px);  /* Subtract header and footer height */
      background: var(--bg-1);
      border-radius: 8px;
      box-shadow: 0 2px 10px var(--shadow-color);
      margin: 10px 0;
      padding: 10px;
      overflow: hidden;
      position: relative;  /* For proper SVG positioning */
    }
    /* Ensure the SVG takes up full container space */
    #treeContainer svg {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
    }
    /* Node and Link styles */
    .node rect {
      fill: var(--bg-2);
      stroke: var(--line-1);
      stroke-width: 1px;
      rx: 8px;
      ry: 8px;
      cursor: pointer;
    }
    .node text {
      fill: var(--ink-0);
      font-size: 14px;
      text-anchor: middle;
      pointer-events: none;  /* Allow hover on rect to work */
    }
    .link {
      fill: none;
      stroke: var(--heat-0);
    }
    /* Textarea styling */
    #jsonInput {
      width: 100%;
      height: 200px;
      padding: 15px;
      margin-bottom: 10px; /* Space for buttons */
    }
    .query-display-container {
      position: relative;
      margin: 10px 0;
      border: 1px solid var(--line-1);
      border-radius: 4px;
      background: var(--bg-0);
    }

    .query-display {
      max-height: 100px;
      overflow-y: auto;
      padding: 12px;
      margin: 0;
      font-family: monospace;
      font-size: 13px;
      white-space: pre;
      color: var(--ink-0);
      text-align: left;
      tab-size: 4;
      -moz-tab-size: 4;
    }

    .copy-button-container {
      position: absolute;
      top: 8px;
      right: 8px;
    }

/* MD design system overrides. The legacy selectors above preserve the static
   application's established behavior while these rules own its presentation. */

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg-0); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(1200px 600px at 20% -10%, var(--crit-wash), transparent 60%), radial-gradient(900px 500px at 110% 20%, var(--note-wash), transparent 60%);
}
a { color: inherit; }
code, pre, textarea { font-family: var(--font-mono); }
button, input { font: inherit; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select { background-color: var(--bg-0); color: var(--ink-0); border-color: var(--line-1); }
input::placeholder, textarea::placeholder { color: var(--ink-2-aa); opacity: 1; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, a { transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
:focus-visible { outline: 2px solid var(--heat-5); outline-offset: 3px; }

.wrap { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }
.site-header.topbar, .site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line-0);
  box-shadow: none;
  background: var(--header-bg);
  color: var(--ink-0);
  backdrop-filter: blur(18px) saturate(1.2);
}
.header-content { width: min(1280px, calc(100% - 48px)); max-width: none; height: 56px; margin: auto; display: flex; gap: 24px; align-items: center; }
.domain-name, .wordmark { color: var(--ink-0); font-family: var(--font-display); font-size: 22px; text-decoration: none; opacity: 1; white-space: nowrap; }
.wordmark em { color: var(--ink-1); font-weight: 400; }
.top-nav { display: flex; gap: 2px; }
.nav-pill { padding: 6px 12px; border-radius: var(--r-pill); color: var(--ink-1); font-size: var(--text-sm); text-decoration: none; }
.nav-pill:hover, .nav-pill.active { color: var(--ink-0); background: var(--bg-2); }

.document-main { width: min(920px, calc(100% - 48px)); margin: 0 auto; padding: 64px 0; }
.document-main article { padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line-0); border-radius: var(--r-lg); background: var(--bg-1); box-shadow: var(--shadow-2); }
.document-main h1, .document-main h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: var(--tracking-tight); }
.document-main h1 { margin: 0 0 16px; font-size: clamp(44px, 8vw, 64px); line-height: 1; }
.document-main h2 { margin: 36px 0 10px; font-size: var(--text-xl); }
.document-main p, .document-main li { color: var(--ink-1); line-height: 1.65; }
.document-main a { color: var(--ink-0); text-decoration-color: var(--line-2); }
.document-main pre { max-width: 100%; padding: 16px; overflow-x: auto; border: 1px solid var(--line-1); border-radius: var(--r-md); background: var(--bg-0); color: var(--ink-0); font-size: var(--text-xs); }
.document-main .notice { padding: 14px 16px; border-left: 3px solid var(--heat-3); background: var(--bg-2); }
.back { display: inline-block; margin-bottom: 20px; color: var(--ink-1); }
.footer { flex: none; margin: 0; padding: 32px 0 48px; border-top: 1px solid var(--line-0); background: transparent; color: var(--ink-2-aa); font-size: var(--text-xs); text-align: left; }
.footer .container { width: min(1280px, calc(100% - 48px)); max-width: none; margin: auto; padding: 0; color: inherit; font-weight: 400; }
.footer a { color: var(--ink-1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: 0ms !important; }
}
@media (max-width: 600px) {
  .wrap, .header-content, .footer .container, .document-main { width: min(100% - 24px, 1280px); }
  .header-content { gap: 12px; }
  .top-nav { margin-left: auto; }
  .nav-pill { padding-inline: 8px; }
  .document-main { padding-block: 32px; }
  .document-main article { padding: 24px 16px; }
}

    /* Code textarea styling */
    .code-textarea {
      font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
      font-size: 14px;
      line-height: 1.4;
      padding: 15px;
      tab-size: 4;
      text-align: left;
      white-space: pre;
      word-spacing: normal;
      word-break: normal;
      overflow-x: auto;
      background: var(--bg-1);
      width: 100%;
      box-sizing: border-box;
    }

    /* Add tooltip styling */
    .node-tooltip {
      position: fixed;
      padding: 10px;
      background: var(--bg-1);
      color: var(--ink-0);
      border-radius: 4px;
      font-size: 12px;
      pointer-events: none;
      z-index: 1000;
      max-width: 300px;
      white-space: pre-wrap;
    }

    /* Stats billboard styling */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 15px;
      padding: 10px;
    }

    .stat-card {
      padding: 8px;
      margin: 0;
    }

    .stat-value {
      font-size: 24px;
      font-weight: bold;
      color: var(--accent);
      margin: 10px 0;
    }

    .stat-label {
      font-size: 14px;
      color: var(--ink-2-aa);
      margin: 0;
    }

    /* Add styles for disabled buttons */
    button:disabled {
      background-color: var(--bg-3);
      cursor: not-allowed;
      opacity: 0.7;
    }

    /* Header styles */
    .site-header {
      padding: 1rem 2rem;
      background: var(--bg-1);
      box-shadow: 0 2px 15px var(--shadow-soft-color);
      margin-bottom: 2rem;
      background: var(--header-bg);
      color: var(--ink-0);
    }

    .header-content {
      max-width: 1200px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: auto 1fr;
      align-items: center;
    }

    .domain-name {
      color: var(--ink-0);
      font-size: 1.8em;
      font-weight: 500;
      text-align: left;
      text-decoration: none;
      opacity: 0.9;
    }

    .domain-name:hover {
      opacity: 1;
      text-decoration: underline;
    }

    .title-container {
      text-align: center;
    }

    .page-title {
      font-size: 1.2em;
      color: var(--ink-0);
      margin: 0;
      font-weight: normal;
    }

    /* Footer styles */
    .footer {
      background: var(--bg-0);
      color: var(--ink-1);
      padding: 1rem;
      text-align: center;
      font-size: 0.9em;
      flex-shrink: 0;  /* Prevent footer from shrinking */
    }

    .footer .container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 0 2rem;
      text-align: left;
      font-weight: 500;
      letter-spacing: 0.2px;
    }

    .footer a {
      color: var(--ink-1);
      text-decoration: none;
      position: relative;
      padding-bottom: 2px;
    }

    .footer a:hover {
      text-decoration: none;
    }

    .footer a::after {
      content: '';
      position: absolute;
      width: 100%;
      height: 2px;
      bottom: 0;
      left: 0;
      background-color: currentColor;
      transform: scaleX(0);
      transition: transform 0.3s ease;
    }

    .footer a:hover::after {
      transform: scaleX(1);
    }

    /* Main content wrapper */
    .main-content {
      flex: 1;
      display: flex;
      flex-direction: row;
      overflow: hidden;
      padding: 0 20px;
      height: calc(100vh - 150px);  /* Subtract header and footer */
      gap: 20px;
    }

    /* Analysis panel (left side) */
    .analysis-container {
      width: 33%;
      min-width: 400px;
      display: flex;
      flex-direction: column;
      gap: 20px;
      overflow-y: auto;
      padding-right: 10px;
      border-right: 1px solid var(--line-1);
      height: 100%;  /* Take full height of parent */
    }

    /* Tree container (right side) */
    #treeContainer {
      flex: 1;  /* Take remaining space */
      min-height: 600px;
      background: var(--bg-1);
      border-radius: 8px;
      box-shadow: 0 2px 10px var(--shadow-color);
      margin: 10px 0;
      padding: 10px;
      overflow: hidden;
    }

    /* Stats grid - make it more compact for side panel */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);  /* Change to 2 columns */
      gap: 10px;
      padding: 10px;
    }

    /* Recommendations panel - adjust for side panel */
    .recommendations-panel {
      margin: 0;
      width: 100%;
      background: var(--bg-1);
      border-radius: 8px;
      box-shadow: 0 2px 10px var(--shadow-soft-color);
    }

    /* Make recommendations single column in side panel */
    .severity-group {
      display: flex;
      flex-direction: column;
      gap: 15px;
      margin-top: 15px;
    }

    /* Adjust issue cards for narrower layout */
    .issue {
      margin: 0 10px;
      padding: 12px;
    }

    /* Add styles for recommendations */
    .no-issues {
      padding: 15px;
      background: var(--ok-soft);
      color: var(--ok);
      border-radius: 4px;
      text-align: center;
    }

    .issue-header {
      display: flex;
      gap: 10px;
      margin-bottom: 10px;
    }

    .severity {
      padding: 2px 6px;
      border-radius: 3px;
      font-size: 0.8em;
      font-weight: bold;
      background: var(--crit-soft);
      color: var(--crit);
    }

    .type {
      font-size: 0.8em;
      font-weight: bold;
      color: var(--ink-2-aa);
    }

    .message {
      margin-bottom: 8px;
      color: var(--ink-0);
    }

    .recommendation {
      color: var(--accent);
      font-style: italic;
    }

    /* Add styles for enhanced recommendations */
    .issues-summary {
      margin-bottom: 20px;
      padding: 10px;
      background: var(--bg-0);
      border-radius: 4px;
      display: flex;
      gap: 20px;
      font-weight: 500;
    }

    .highlight-node {
      margin-top: 10px;
      padding: 5px 10px;
      background: var(--accent);
      color: var(--on-accent);
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 0.9em;
      transition: background 0.2s;
    }

    .highlight-node:hover {
      background: var(--accent-hover);
    }

    .node.highlighted rect {
      stroke: var(--crit) !important;
      stroke-width: 4px !important;
      filter: drop-shadow(0 0 8px var(--heat-glow));
    }

    .node rect {
      fill: var(--bg-2);
      stroke: var(--line-1);
      stroke-width: 1px;
      rx: 8px;
      ry: 8px;
      cursor: pointer;
    }

    .performance-metrics {
      margin-top: 10px;
      font-size: 0.9em;
      color: var(--ink-2-aa);
    }

    .metric {
      display: inline-block;
      margin-right: 15px;
    }

    .metric-icon {
      margin-right: 5px;
    }

    :root {
      --bg: var(--bg-0);
      --panel: var(--bg-1);
      --panel-soft: var(--bg-0);
      --ink: var(--ink-0);
      --muted: var(--ink-2-aa);
      --line: var(--line-0);
      --line-strong: var(--line-1);
      --blue: var(--accent);
      --blue-strong: var(--accent-hover);
      --cyan: var(--note);
      --green: var(--ok);
      --amber: var(--warn);
      --red: var(--crit);
      --violet: var(--op-window);
      --shadow: var(--shadow-2);
      --soft-shadow: var(--shadow-1);
      --radius: 8px;
      --mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
    }

    * {
      box-sizing: border-box;
    }

    body {
      background: var(--bg);
      color: var(--ink);
      letter-spacing: 0;
      -webkit-font-smoothing: antialiased;
    }

    body,
    textarea,
    button {
      font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    button {
      margin: 0;
      border-radius: 8px;
      font-weight: 700;
      letter-spacing: 0;
      transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
    }

    button:hover:not(:disabled) {
      transform: translateY(-1px);
    }

    button:disabled {
      background: var(--bg-3);
      color: var(--ink-3-aa);
      opacity: 1;
    }

    .site-header {
      padding: 11px 22px;
      margin: 0;
      color: var(--ink);
      background: var(--header-bg);
      border-bottom: 1px solid var(--line-0);
      box-shadow: none;
      backdrop-filter: saturate(180%) blur(18px);
    }

    .header-content {
      max-width: none;
      display: grid;
      grid-template-columns: minmax(220px, auto) 1fr auto;
      gap: 28px;
    }

    .domain-name {
      font-size: 18px;
      font-weight: 800;
      color: var(--ink);
      text-decoration: none;
      opacity: 1;
      letter-spacing: 0;
    }

    .domain-name::before {
      content: "CH";
      display: inline-grid;
      place-items: center;
      width: 34px;
      height: 34px;
      margin-right: 10px;
      border-radius: 8px;
      color: var(--bg-0);
      background: var(--ink-0);
      font-size: 13px;
      font-weight: 900;
      vertical-align: middle;
    }

    .domain-name:hover {
      text-decoration: none;
    }

    .title-container {
      text-align: left;
    }

    .page-title {
      margin: 0;
      color: var(--ink);
      font-size: 14px;
      font-weight: 800;
    }

    .subtitle {
      margin: 4px 0 0;
      max-width: none;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.35;
    }

    .header-actions {
      text-align: right;
    }

    .service-link {
      color: var(--muted);
      font-size: 13px;
      font-weight: 700;
      text-decoration: none;
      border-bottom: 1px solid transparent;
    }

    .service-link:hover {
      color: var(--blue);
      border-bottom-color: var(--accent-line);
    }

    .main-content {
      display: grid;
      grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
      gap: 18px;
      height: calc(100vh - 104px);
      padding: 18px;
      overflow: hidden;
    }

    .analysis-container {
      width: auto;
      min-width: 0;
      height: 100%;
      padding: 0;
      gap: 14px;
      border-right: 0;
      overflow-y: auto;
      scrollbar-width: thin;
    }

    #inputContainer {
      padding: 0;
      text-align: left;
    }

    .intro-card {
      position: relative;
      overflow: hidden;
      padding: 22px;
      border: 1px solid var(--line-1);
      border-radius: var(--radius);
      background: var(--bg-1);
      box-shadow: var(--soft-shadow);
      backdrop-filter: blur(18px);
    }

    .intro-card::after {
      content: none;
    }

    .product-kicker {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0;
      text-transform: uppercase;
    }

    .product-kicker::before {
      content: none;
    }

    .intro-card h2 {
      margin: 13px 0 12px;
      color: var(--ink);
      font-size: 42px;
      line-height: 1;
      font-weight: 800;
      letter-spacing: 0;
    }

    .intro-card p {
      margin: 0;
      max-width: 32rem;
      color: var(--muted);
      font-size: 16px;
      line-height: 1.45;
    }

    .workflow-strip {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin: 18px 0 20px;
      position: relative;
      z-index: 1;
    }

    .workflow-step {
      padding: 10px;
      border: 1px solid var(--line-0);
      border-radius: 8px;
      background: var(--bg-1);
      color: var(--ink);
      font-size: 12px;
      font-weight: 800;
    }

    .workflow-step span {
      display: block;
      margin-bottom: 4px;
      color: var(--muted);
      font-family: var(--mono);
      font-size: 11px;
    }

    .privacy-note {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }

    #stats {
      margin: 0;
      max-width: none;
      width: 100%;
    }

    .dashboard-section {
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--bg-1);
      box-shadow: var(--soft-shadow);
      backdrop-filter: blur(18px);
    }

    .section-label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin: 0 0 12px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 900;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .status-pill {
      padding: 4px 8px;
      border-radius: 999px;
      background: var(--bg-2);
      color: var(--muted);
      font-size: 11px;
      letter-spacing: 0;
      text-transform: none;
    }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      padding: 0;
    }

    .stat-card {
      min-height: 92px;
      padding: 13px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--bg-1);
      box-shadow: none;
    }

    .stat-card::before {
      content: "";
      display: block;
      width: 28px;
      height: 3px;
      margin-bottom: 14px;
      border-radius: 999px;
      background: var(--ink-0);
    }

    .stat-card:nth-child(2)::before,
    .stat-card:nth-child(3)::before,
    .stat-card:nth-child(4)::before { background: var(--ink-2-aa); }

    .stat-value {
      margin: 0;
      color: var(--ink);
      font-size: 28px;
      line-height: 1;
      font-weight: 900;
    }

    .stat-label {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
    }

    #treeContainer {
      position: relative;
      min-height: 0;
      height: 100%;
      margin: 0;
      padding: 0;
      overflow: hidden;
      border: 1px solid var(--line-1);
      border-radius: var(--radius);
      background:
        linear-gradient(var(--map-dot) 1px, transparent 1px),
        linear-gradient(90deg, var(--map-dot) 1px, transparent 1px),
        var(--map-canvas);
      background-size: 28px 28px;
      box-shadow: var(--shadow);
    }

    #treeContainer::before {
      content: "Plan canvas";
      position: absolute;
      z-index: 2;
      top: 14px;
      left: 14px;
      padding: 7px 10px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--bg-1);
      color: var(--muted);
      font-size: 12px;
      font-weight: 900;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      backdrop-filter: blur(10px);
    }

    #treeContainer svg {
      z-index: 1;
    }

    .graph-empty {
      position: absolute;
      z-index: 3;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 28px;
      pointer-events: none;
    }

    .graph-empty-card {
      width: min(520px, 84%);
      padding: 24px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--bg-1);
      box-shadow: var(--soft-shadow);
      backdrop-filter: blur(12px);
    }

    .graph-empty-card h2 {
      margin: 0 0 8px;
      font-size: 22px;
      line-height: 1.15;
    }

    .graph-empty-card p {
      margin: 0;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.5;
    }

    .mini-plan {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      margin-top: 18px;
    }

    .mini-plan div {
      width: fit-content;
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--bg-0);
      color: var(--muted);
      font-family: var(--mono);
      font-size: 12px;
      font-weight: 800;
    }

    .mini-plan div:nth-child(2) {
      margin-left: 46px;
      border-color: var(--line);
      background: var(--bg-1);
    }

    .mini-plan div:nth-child(3) {
      margin-left: 92px;
      border-color: var(--line);
      background: var(--bg-2);
    }

    .graph-toolbar {
      position: absolute;
      z-index: 4;
      top: 14px;
      right: 14px;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--bg-1);
      box-shadow: var(--soft-shadow);
      backdrop-filter: blur(10px);
    }

    .tool-button {
      min-width: 72px;
      padding: 7px 10px;
      border: 0;
      border-radius: 999px;
      background: transparent;
      color: var(--muted);
      font-size: 12px;
      font-weight: 900;
    }

    .tool-button:hover:not(:disabled) {
      background: var(--bg-2);
      color: var(--ink);
      transform: none;
    }

    .tool-button:disabled {
      background: transparent;
      color: var(--ink-3-aa);
    }

    .inspector-panel {
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--bg-1);
      box-shadow: var(--soft-shadow);
      backdrop-filter: blur(18px);
    }

    .inspector-empty {
      padding: 14px;
      border: 1px dashed var(--line-strong);
      border-radius: 8px;
      background: var(--panel-soft);
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }

    .inspector-title {
      margin: 0 0 8px;
      color: var(--ink);
      font-size: 17px;
      font-weight: 900;
    }

    .inspector-subtitle {
      margin: 0 0 12px;
      color: var(--muted);
      font-family: var(--mono);
      font-size: 12px;
      line-height: 1.45;
      overflow-wrap: anywhere;
    }

    .detail-grid {
      display: grid;
      gap: 8px;
    }

    .detail-row {
      display: grid;
      grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
      gap: 10px;
      padding: 9px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--bg-1);
      font-size: 12px;
    }

    .detail-label {
      color: var(--muted);
      font-weight: 900;
    }

    .detail-value {
      color: var(--ink);
      font-family: var(--mono);
      font-weight: 800;
      overflow-wrap: anywhere;
    }

    .node.selected rect {
      stroke: var(--ink-0) !important;
      stroke-width: 4px !important;
      filter: drop-shadow(0 14px 24px var(--shadow-color));
    }

    .recommendations-panel {
      width: 100%;
      margin: 0;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--bg-1);
      box-shadow: var(--soft-shadow);
      backdrop-filter: blur(18px);
    }

    .recommendations-panel h3 {
      margin: 0 0 12px;
      color: var(--ink);
      font-size: 16px;
      font-weight: 900;
    }

    .issues-summary {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin: 0 0 12px;
      padding: 0;
      background: transparent;
      border-radius: 0;
      font-size: 12px;
    }

    .severity-count {
      display: grid;
      gap: 3px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--bg-1);
      color: var(--muted);
      font-weight: 800;
    }

    .severity-count strong {
      color: var(--ink);
      font-size: 20px;
      line-height: 1;
    }

    .severity-group {
      gap: 10px;
      margin-top: 10px;
    }

    .issue {
      margin: 0;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--bg-1);
      box-shadow: none;
    }

    .issue-header {
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .severity {
      padding: 4px 8px;
      border-radius: 999px;
      background: var(--bg-2);
      color: var(--red);
      font-size: 11px;
      letter-spacing: 0.04em;
    }

    .type {
      color: var(--muted);
      font-family: var(--mono);
      font-size: 11px;
      text-align: right;
    }

    .message {
      margin: 0 0 10px;
      color: var(--ink);
      font-size: 13px;
      line-height: 1.45;
      white-space: pre-line;
    }

    .recommendation {
      padding: 10px;
      border-radius: 8px;
      background: var(--bg-2);
      color: var(--ink);
      font-size: 13px;
      line-height: 1.45;
      font-style: normal;
    }

    .highlight-node {
      width: 100%;
      margin-top: 10px;
      padding: 8px 10px;
      border-radius: 8px;
      background: var(--accent);
      font-size: 12px;
    }

    .highlight-node:hover {
      background: var(--accent-hover);
    }

    .no-issues {
      padding: 14px;
      border: 1px solid var(--ok);
      border-radius: 8px;
      background: var(--bg-2);
      color: var(--ink);
      font-weight: 800;
    }

    .code-textarea {
      min-height: 280px;
      padding: 14px;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      background: var(--bg-0);
      color: var(--ink);
      font-family: var(--mono);
      font-size: 13px;
      line-height: 1.5;
      resize: vertical;
      outline: none;
    }

    .code-textarea:focus {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px var(--accent-glow);
    }

    .query-display-container {
      margin: 0 0 10px;
      border: 1px solid var(--line-1);
      border-radius: 8px;
      background: var(--bg-0);
      overflow: hidden;
    }

    .query-display {
      max-height: 148px;
      padding: 14px;
      color: var(--ink-0);
      font-family: var(--mono);
      font-size: 12px;
      line-height: 1.5;
    }

    .node-tooltip {
      padding: 12px;
      border: 1px solid var(--line-1);
      border-radius: 8px;
      background: var(--bg-1);
      box-shadow: 0 18px 40px var(--shadow-color);
      font-family: var(--mono);
      font-size: 12px;
      line-height: 1.45;
    }

    .link {
      stroke: var(--heat-0);
      stroke-linecap: round;
    }

    .node rect {
      rx: 8px;
      ry: 8px;
      stroke: var(--line-1);
      filter: drop-shadow(0 8px 10px var(--shadow-soft-color));
    }

    .node text {
      font-family: var(--mono);
      font-size: 12px;
      font-weight: 800;
    }

    .node.highlighted rect {
      stroke: var(--crit) !important;
      stroke-width: 4px !important;
      filter: drop-shadow(0 14px 22px var(--shadow-color));
    }

    .footer {
      padding: 10px 18px;
      background: transparent;
      color: var(--muted);
      font-size: 12px;
    }

    .footer .container {
      max-width: none;
      padding: 0;
      color: var(--muted);
      font-weight: 700;
    }

    .footer a {
      color: var(--muted);
      font-weight: 700;
    }

    .footer a::after {
      background: var(--muted);
    }

    .footer-note {
      margin-top: 3px;
      color: var(--ink-2-aa);
      font-size: 11px;
      font-weight: 600;
    }

    .workspace-shell {
      display: grid;
      grid-template-columns: minmax(292px, 336px) minmax(0, 1fr) minmax(292px, 360px);
      grid-template-rows: minmax(0, 1fr) auto;
      grid-template-areas:
        "evidence canvas inspector"
        "evidence drawer inspector";
      gap: 12px;
      min-height: 0;
      height: calc(100vh - 105px);
      padding: 12px;
      overflow: hidden;
    }

    .evidence-rail,
    .inspector-rail,
    .bottom-drawer,
    .visualizer-panel {
      border: 1px solid var(--line-1);
      border-radius: 8px;
      background: var(--bg-1);
      box-shadow: 0 18px 55px var(--shadow-soft-color);
      backdrop-filter: saturate(180%) blur(18px);
    }

    .evidence-rail {
      grid-area: evidence;
      position: relative;
      z-index: 5;
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-height: 0;
      padding: 12px;
      overflow-y: auto;
    }

    .visualizer-area {
      grid-area: canvas;
      position: relative;
      z-index: 1;
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-width: 0;
      min-height: 0;
    }

    .visualizer-panel {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      overflow: hidden;
    }

    .inspector-rail {
      grid-area: inspector;
      position: relative;
      z-index: 4;
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-height: 0;
      padding: 12px;
      overflow-y: auto;
    }

    .bottom-drawer {
      grid-area: drawer;
      position: relative;
      z-index: 3;
      display: grid;
      grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
      gap: 12px;
      min-height: 144px;
      max-height: 188px;
      padding: 12px;
      overflow: hidden;
    }

    .top-nav {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      min-width: 0;
    }

    .nav-pill {
      padding: 7px 10px;
      border-radius: 999px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
      text-decoration: none;
    }

    .nav-pill.active {
      background: var(--bg-2);
      color: var(--ink-0);
    }

    .hero-panel {
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
    }

    .hero-panel h2 {
      margin: 10px 0 8px;
      font-size: 32px;
      line-height: 1.04;
      font-weight: 900;
      letter-spacing: 0;
    }

    .hero-panel p {
      margin: 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }

    .agent-prompt {
      margin-top: 14px;
      padding-top: 14px;
      border-top: 1px solid var(--line);
    }

    .agent-prompt h3 {
      margin: 0 0 6px;
      font-size: 13px;
    }

    .agent-prompt-code {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      margin-top: 8px;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--bg-0);
    }

    .agent-prompt-code code {
      min-width: 0;
      color: var(--ink);
      font-family: var(--mono);
      font-size: 11px;
      line-height: 1.45;
      overflow-wrap: anywhere;
    }

    .agent-prompt-code button {
      padding: 7px 9px;
      border: 1px solid var(--line-strong);
      background: var(--bg-1);
      color: var(--ink);
      font-size: 11px;
    }

    .agent-prompt a {
      color: var(--blue-strong);
      font-weight: 800;
    }

    .primary-action-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: 14px;
    }

    .evidence-card,
    .drawer-card,
    .rail-card {
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--bg-1);
    }

    .evidence-list {
      display: grid;
      gap: 8px;
    }

    .evidence-item {
      display: grid;
      grid-template-columns: 24px minmax(0, 1fr) auto;
      gap: 9px;
      align-items: center;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--bg-0);
    }

    .evidence-dot {
      width: 12px;
      height: 12px;
      border-radius: 999px;
      border: 2px solid var(--line-1);
      background: var(--bg-1);
    }

    .evidence-item.complete .evidence-dot {
      border-color: var(--green);
      background: var(--green);
      box-shadow: 0 0 0 4px var(--ok-soft);
    }

    .evidence-title {
      color: var(--ink);
      font-size: 13px;
      font-weight: 900;
    }

    .evidence-subtitle,
    .mini-meta {
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
    }

    .evidence-state {
      color: var(--muted);
      font-size: 11px;
      font-weight: 900;
    }

    .compact-button {
      width: 100%;
      padding: 9px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--bg-2);
      color: var(--ink);
      font-size: 12px;
      font-weight: 900;
    }

    .evidence-actions {
      display: grid;
      gap: 8px;
      margin-top: 10px;
    }

    .share-options {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      line-height: 1.35;
    }

    .share-options input {
      margin: 1px 0 0;
    }

    .share-status {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      line-height: 1.4;
    }

    .share-status.warning {
      color: var(--warn);
    }

    .compact-button:disabled {
      cursor: not-allowed;
      opacity: 0.55;
    }

    .tab-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px;
      border-bottom: 1px solid var(--line);
    }

    .segmented-control {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 4px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--bg-2);
    }

    .segment {
      padding: 7px 12px;
      border-radius: 999px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 900;
    }

    .segment.active {
      background: var(--bg-1);
      color: var(--ink);
      box-shadow: 0 4px 14px var(--shadow-soft-color);
    }

    .canvas-tools {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .plan-search {
      width: min(220px, 22vw);
      min-width: 140px;
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--bg-1);
      color: var(--ink);
      font: 800 12px "Inter", sans-serif;
      outline: none;
    }

    .canvas-body {
      position: relative;
      min-height: 0;
      flex: 1;
    }

    #treeContainer {
      height: 100%;
      border: 0;
      border-radius: 0;
      box-shadow: none;
    }

    #treeContainer::before {
      content: "Bottleneck path";
      top: 12px;
      left: 12px;
    }

    .graph-toolbar {
      top: auto;
      right: 12px;
      bottom: 12px;
    }

    .graph-minimap {
      position: absolute;
      z-index: 4;
      right: 14px;
      top: 58px;
      width: 132px;
      height: 88px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--bg-1);
      box-shadow: var(--soft-shadow);
      backdrop-filter: blur(10px);
      pointer-events: none;
    }

    .graph-minimap::before,
    .graph-minimap::after {
      content: "";
      position: absolute;
      border-radius: 999px;
      background: var(--op-neutral);
    }

    .graph-minimap::before {
      width: 68px;
      height: 5px;
      left: 18px;
      top: 24px;
      box-shadow: 26px 22px 0 var(--ok), 48px 44px 0 var(--warn);
    }

    .graph-minimap::after {
      width: 58px;
      height: 44px;
      right: 12px;
      bottom: 12px;
      border: 1px solid var(--accent-line);
      background: var(--accent-soft);
    }

    .inspector-panel {
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      backdrop-filter: none;
    }

    .suggestion-card {
      display: grid;
      gap: 8px;
      margin-top: 12px;
      padding: 12px;
      border: 1px solid var(--accent-line);
      border-radius: 8px;
      background: var(--accent-soft);
    }

    .suggestion-card strong {
      color: var(--ink);
      font-size: 13px;
    }

    .suggestion-card span {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      font-weight: 700;
    }

    .drawer-title {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 8px;
      color: var(--ink);
      font-size: 13px;
      font-weight: 900;
    }

    .code-preview,
    .raw-preview {
      margin: 0;
      max-height: 154px;
      overflow: auto;
      color: var(--ink-0);
      font: 700 11px/1.45 var(--mono);
      text-align: left;
      white-space: pre-wrap;
    }

    .timeline {
      display: grid;
      gap: 8px;
      overflow: auto;
      max-height: 154px;
    }

    .bottom-drawer .code-preview,
    .bottom-drawer .timeline {
      max-height: 112px;
    }

    .timeline-step {
      display: grid;
      grid-template-columns: 70px minmax(0, 1fr);
      gap: 8px;
      align-items: center;
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
    }

    .timeline-bar {
      height: 8px;
      border-radius: 999px;
      background: var(--line-1);
    }

    .timeline-step.hot .timeline-bar { background: var(--red); }
    .timeline-step.warm .timeline-bar { background: var(--amber); }
    .timeline-step.good .timeline-bar { background: var(--green); }

    .empty-copy {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      font-weight: 700;
    }

    .recommendations-panel {
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
    }

    .recommendations-panel h3 {
      font-size: 13px;
    }

    .node rect {
      rx: 10px;
      ry: 10px;
    }

    @media (max-width: 1160px) {
      .workspace-shell {
        grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
        grid-template-rows: minmax(520px, 1fr) auto auto;
        grid-template-areas:
          "evidence canvas"
          "evidence inspector"
          "drawer drawer";
        height: auto;
        min-height: calc(100vh - 105px);
        overflow: auto;
      }

      .inspector-rail {
        min-height: 220px;
      }
    }

    @media (max-width: 900px) {
      body {
        min-height: 100vh;
        overflow: auto;
      }

      .header-content {
        grid-template-columns: 1fr;
        gap: 10px;
      }

      .header-actions {
        text-align: left;
      }

      .main-content,
      .workspace-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(620px, 1fr) auto auto;
        grid-template-areas:
          "evidence"
          "canvas"
          "inspector"
          "drawer";
        height: auto;
        min-height: calc(100vh - 112px);
        overflow: visible;
      }

      .analysis-container {
        overflow: visible;
      }

      #treeContainer {
        min-height: 620px;
      }

      .workflow-strip,
      .issues-summary {
        grid-template-columns: 1fr;
      }

      .graph-toolbar {
        top: auto;
        right: 12px;
        bottom: 12px;
      }

      .bottom-drawer {
        grid-template-columns: 1fr;
        max-height: none;
      }

      .tab-bar,
      .canvas-tools {
        align-items: stretch;
        flex-direction: column;
      }

      .segmented-control,
      .plan-search {
        width: 100%;
      }
    }

/* Application shell ------------------------------------------------------ */
html { background: var(--bg-0); }
body { display: block; min-height: 100vh; height: auto; overflow-x: hidden; overflow-y: auto; background: var(--bg-0); color: var(--ink-0); font-family: var(--font-ui); }
.site-header { position: sticky; top: 0; z-index: 50; margin: 0; padding: 0; border-bottom: 1px solid var(--line-0); box-shadow: none; background: var(--header-bg); backdrop-filter: blur(18px) saturate(1.2); }
.header-content { display: flex; grid-template-columns: none; width: min(1280px, calc(100% - 48px)); max-width: none; height: 56px; margin: auto; gap: 24px; align-items: center; }
.domain-name { color: var(--ink-0); font-family: var(--font-display); font-size: 22px; text-decoration: none; opacity: 1; }
.wordmark em { color: var(--ink-1); font-weight: 400; }
.top-nav { display: flex; gap: 2px; }
.nav-pill { padding: 6px 12px; border-radius: var(--r-pill); color: var(--ink-1); font-size: var(--text-sm); text-decoration: none; }
.nav-pill.active, .nav-pill:hover { color: var(--ink-0); background: var(--bg-2); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.compact-button, .header-button, .tool-button, .text-button {
  min-height: 32px; margin: 0; padding: 0 14px; border: 1px solid var(--line-1); border-radius: var(--r-pill); background: var(--bg-2); color: var(--ink-0); font: 500 var(--text-sm)/1 var(--font-ui); cursor: pointer;
}
.btn, .header-button { white-space: nowrap; }
.compact-button:hover, .tool-button:hover { border-color: var(--line-2); background: var(--bg-3); }
.header-button.primary { background: var(--ink-0); color: var(--bg-0); }
button:disabled { background: var(--bg-2); color: var(--ink-3-aa); opacity: .62; cursor: not-allowed; }
.server-chip { display: inline-flex; height: 28px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line-1); border-radius: var(--r-pill); color: var(--ink-1); font: var(--text-xs)/1 var(--font-mono); white-space: nowrap; }
.server-chip[hidden] { display: none; }
.server-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

.page-content { display: block; }
#inputContainer.hero { padding: 64px 0 40px; }
.hero h1 { max-width: 900px; margin: 0 0 20px; color: var(--ink-0); font: 400 clamp(40px, 5vw, 64px)/1.05 var(--font-display); letter-spacing: -.025em; }
.hero h1 span { color: var(--accent); font-style: italic; }
.section-label { color: var(--ink-2-aa); font: 500 var(--text-2xs)/1.2 var(--font-ui); letter-spacing: var(--tracking-wide); text-transform: uppercase; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--ink-1); white-space: nowrap; }
.text-button:hover { background: transparent; color: var(--ink-0); }
.agent-panel { display: flex; max-width: 900px; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid var(--line-0); border-radius: var(--r-lg); background: var(--bg-1); box-shadow: var(--shadow-2); }
.agent-panel h2 { margin: 0; color: var(--ink-0); font: 400 var(--text-xl)/1.2 var(--font-display); }
.agent-panel > p { margin: 0; color: var(--ink-1); font-size: var(--text-sm); }
.agent-prompt-code { position: relative; margin: 0; padding: 16px 82px 16px 16px; border: 1px solid var(--line-1); border-radius: var(--r-md); background: var(--bg-0); color: var(--ink-0); font: var(--text-sm)/1.5 var(--font-mono); }
.agent-prompt-code code { display: block; color: inherit; white-space: pre-wrap; }
.agent-code-copy { position: absolute; top: 10px; right: 10px; display: inline-flex; min-height: 30px; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid var(--line-1); border-radius: var(--r-sm); background: var(--bg-1); color: var(--ink-1); font: 500 var(--text-xs)/1 var(--font-ui); cursor: pointer; }
.agent-code-copy:hover { border-color: var(--line-2); background: var(--bg-2); color: var(--ink-0); }
.agent-code-copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.agent-primary-action { display: flex; align-items: center; gap: 20px; }
.agent-primary-action p { margin: 0; color: var(--ink-2-aa); font-size: var(--text-xs); line-height: 1.5; }
#agentCopyStatus:empty { display: none; }

.plan-section, .report-section, .server-section { padding: 64px 0; }
#plan { scroll-margin-top: 56px; }
.section-heading { display: flex; align-items: baseline; gap: 16px; margin-bottom: 24px; }
.section-heading h2 { margin: 0; color: var(--ink-0); font: 400 var(--text-2xl)/1.1 var(--font-display); letter-spacing: var(--tracking-tight); }
.section-heading p { margin: 0; color: var(--ink-2-aa); font-size: var(--text-sm); }
.workspace-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr) 340px; grid-template-areas: "evidence canvas inspector"; min-height: 760px; overflow: hidden; border: 1px solid var(--line-0); border-radius: var(--r-lg); background: var(--bg-1); box-shadow: var(--shadow-2); }
.workspace-shell.hide-evidence { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "canvas inspector"; }
.workspace-shell.hide-inspector { grid-template-columns: 260px minmax(0, 1fr); grid-template-areas: "evidence canvas"; }
.workspace-shell.hide-evidence.hide-inspector { grid-template-columns: minmax(0, 1fr); grid-template-areas: "canvas"; }
.workspace-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; color: var(--ink-1); font-size: var(--text-xs); }
.workspace-controls > span { flex: 1; min-width: 180px; }
.workspace-controls [aria-expanded="true"], .graph-actions [aria-pressed="true"] { border-color: var(--ink-1); }
.workspace-shell [hidden], .graph-actions[hidden] { display: none !important; }
.graph-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-0); background: var(--bg-0); }
#graphZoom { margin-left: auto; color: var(--ink-2-aa); font: 12px var(--font-mono); }
.metric-note { color: var(--ink-2-aa); font-size: 12px; line-height: 1.5; }
.analysis-container { grid-area: evidence; width: auto; min-width: 0; height: auto; padding: 16px; gap: 16px; overflow: hidden; border-right: 1px solid var(--line-0); background: var(--bg-1); }
.evidence-card, .rail-card, .drawer-card, .visualizer-panel { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.evidence-item { grid-template-columns: 16px minmax(0,1fr) auto; padding: 9px 4px; border: 0; background: transparent; }
.evidence-item:hover { background: var(--bg-2); }
.evidence-title { color: var(--ink-0); font-size: var(--text-sm); }
.evidence-subtitle, .evidence-state, .empty-copy, .share-status, .mini-meta { color: var(--ink-2-aa); font-size: var(--text-xs); }
.evidence-dot { border-color: var(--line-2); background: transparent; }
.evidence-item.complete .evidence-dot { border-color: var(--ok); background: var(--ok); }
.evidence-actions { border-top-color: var(--line-0); }
.share-options { color: var(--ink-1); }
.status-pill { border-color: var(--line-1); background: var(--bg-2); color: var(--ink-1); }
.stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0; }
.stat-card { border: 1px solid var(--line-0); border-radius: var(--r-sm); background: var(--bg-2); }
.stat-value { color: var(--ink-0); font: 400 25px/1 var(--font-display); }
.stat-label { color: var(--ink-2-aa); font-size: var(--text-2xs); }
.sql-card { margin-top: auto; overflow: hidden; border: 1px solid var(--line-0); border-radius: var(--r-md); background: var(--bg-0); }
.code-preview, .raw-preview { color: var(--ink-1); }
.visualizer-area { grid-area: canvas; min-width: 0; height: auto; padding: 0; background: var(--bg-0); }
.visualizer-panel { height: 100%; }
.tab-bar { min-height: 56px; border-bottom-color: var(--line-0); background: var(--bg-0); }
.segmented-control { border-color: var(--line-0); background: var(--bg-2); }
.segment { color: var(--ink-1); }
.segment.active { background: var(--bg-0); color: var(--ink-0); }
.plan-search { width: 150px; border-color: var(--line-1); background: var(--bg-2); color: var(--ink-0); }
.canvas-body { min-height: 700px; }
#treeContainer { min-height: 700px; height: 700px; margin: 0; padding: 0; border-radius: 0; background: radial-gradient(700px 360px at 50% 110%, var(--crit-wash), transparent 70%), var(--bg-0); box-shadow: none; }
#treeContainer::before { display: none; }
#treeContainer > svg { display: block; }
.graph-empty-card { border-color: var(--line-1); background: var(--bg-1); box-shadow: var(--shadow-1); }
.graph-empty-card h2 { color: var(--ink-0); font-family: var(--font-display); font-weight: 400; }
.graph-empty-card p { color: var(--ink-1); }
.mini-plan div { border-color: var(--line-1); background: var(--bg-2); color: var(--ink-1); }
.tool-button { min-height: 28px; padding-inline: 10px; font-size: var(--text-xs); }
.heat-legend { position: static; flex: 1 0 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--ink-2-aa); font: 10px/1.2 var(--font-mono); }
.heat-legend i { width: 100px; height: 6px; border-radius: 3px; background: linear-gradient(90deg,var(--heat-1),var(--heat-2),var(--heat-3),var(--heat-5)); }
.inspector-rail { grid-area: inspector; display: flex; width: auto; min-width: 0; padding: 16px; gap: 16px; overflow-x: hidden; overflow-y: auto; border-left: 1px solid var(--line-0); background: var(--bg-1); }
.inspector-title { overflow-wrap: anywhere; color: var(--ink-0); font: 400 var(--text-xl)/1.15 var(--font-display); }
.inspector-subtitle { color: var(--ink-1); font-family: var(--font-mono); }
.detail-grid { gap: 0; }
.detail-row { grid-template-columns: 108px minmax(0, 1fr); gap: var(--sp-3); padding: 7px 0; border: 0; border-top: 1px dashed var(--line-0); border-radius: 0; background: transparent; font-family: var(--font-mono); }
.detail-label { color: var(--ink-2-aa); font-weight: 400; }
.detail-value { color: var(--ink-0); font-family: var(--font-mono); font-weight: 500; }
.raw-preview { border-color: var(--line-0); background: var(--bg-0); }
.suggestion-card { border-color: var(--line-0); background: var(--bg-2); }
.suggestion-card strong { color: var(--ink-0); }
.suggestion-card span { color: var(--ink-1); }
.server-card { padding: 24px; border: 1px solid var(--line-0); border-radius: var(--r-lg); background: var(--bg-1); }
.footer { background: transparent; color: var(--ink-2-aa); }
.footer .container { width: min(1280px, calc(100% - 48px)); max-width: none; color: var(--ink-2-aa); }
.footer a { color: var(--ink-1); }
.footer-note { color: var(--ink-2-aa); }

.wizard-error { margin: 12px 22px 0; padding: 12px; color: var(--ink-0); border: 1px solid var(--heat-5); border-radius: var(--r-sm); }
.code-textarea { border-color: var(--line-1); background: var(--bg-0); color: var(--ink-0); }
.query-display-container { border-color: var(--line-1); background: var(--bg-0); }
.query-display { color: var(--ink-0); }
.code-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
#storedShareButton:not(:disabled) { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
#storedShareButton:not(:disabled):hover { background: var(--accent-hover); }

@media (max-width: 1080px) {
  .workspace-shell, .workspace-shell.hide-evidence, .workspace-shell.hide-inspector { grid-template-columns: minmax(0, 1fr); grid-template-areas: "evidence" "canvas" "inspector"; }
  .analysis-container { border-right: 0; border-bottom: 1px solid var(--line-0); }
  .inspector-rail { border-top: 1px solid var(--line-0); border-left: 0; }
}
@media (max-width: 760px) {
  .header-content { width: calc(100% - 24px); height: auto; min-height: 56px; flex-wrap: wrap; gap: 8px 10px; padding-block: 10px; }
  .top-nav { display: flex; order: 3; width: 100%; justify-content: space-between; margin: 0; }
  .nav-pill { display: block; padding: 6px 8px; }
  .header-actions { gap: 6px; }
  #copyMarkdownReportButton { padding-inline: 12px; }
  .server-chip { display: none !important; }
  #inputContainer.hero { padding: 32px 0; }
  .hero h1 { font-size: 40px; }
  .agent-panel { padding: 16px; }
  .agent-primary-action { align-items: flex-start; flex-direction: column; gap: 10px; }
  .plan-section, .report-section, .server-section { padding: 40px 0; }
  #plan { scroll-margin-top: 104px; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 6px; }
  .workspace-shell { min-height: 0; }
  .canvas-body, #treeContainer { min-height: 540px; }
  #treeContainer { height: 540px; }
  .inspector-rail { overflow: visible; }
  .sql-card { display: none; }
  .footer .container { width: calc(100% - 24px); }
}

/* River graph ------------------------------------------------------------ */
.river-ribbon { stroke-linecap: round; }
.bottleneck-current { fill: none; stroke: var(--heat-5); stroke-width: 1.5; stroke-dasharray: 2 7; stroke-linecap: round; opacity: .85; pointer-events: none; animation: river-current 6s linear infinite; }
@keyframes river-current { to { stroke-dashoffset: 36; } }
.same-table-tie { fill: none; stroke: var(--ink-2-aa); stroke-width: 1; stroke-dasharray: 4 6; opacity: .65; pointer-events: none; }
.node rect:not(.node-heat) { fill: var(--bg-2) !important; stroke: var(--line-1) !important; stroke-width: 1px !important; filter: drop-shadow(0 8px 12px var(--shadow-color)); }
.node { cursor: pointer; }
.node text { font-family: var(--font-mono); pointer-events: none; text-anchor: start; }
.node text.node-kind { fill: var(--ink-2-aa) !important; font-size: 11px; font-weight: 500; letter-spacing: 0; }
.node .node-name { fill: var(--ink-0); font-size: 14px; }
.node .node-count { fill: var(--ink-1); font-size: 12px; text-anchor: start; }
.node .node-pruning { fill: var(--ink-1); font-size: 11px; text-anchor: end; }
.node.grouped rect:not(.node-heat) { stroke-dasharray: 5 3; }
.node-tooltip { white-space: pre-line; max-width: 320px; pointer-events: none; }
.node-heat { pointer-events: none; }
.node.highlighted rect:not(.node-heat) { stroke: var(--heat-5) !important; stroke-width: 1.5px !important; filter: drop-shadow(0 0 9px var(--heat-glow)); }
.node.selected rect:not(.node-heat) { stroke: var(--ink-0) !important; stroke-width: 2px !important; filter: none; }
.node.selected::before { color: var(--heat-5); }
@media (prefers-reduced-motion: reduce) { .bottleneck-current { animation: none; } }

/* Inspector, findings, and evidence states ------------------------------- */
.inspector-kind { display: flex; align-items: center; gap: 8px; color: var(--ink-2-aa); font: 500 var(--text-2xs)/1 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; }
.inspector-kind i { width: 8px; height: 8px; border-radius: 2px; box-shadow: 0 0 10px currentColor; }
.inspector-kind .heat-0 { background: var(--heat-0); }
.inspector-kind .heat-1 { background: var(--heat-1); }
.inspector-kind .heat-2 { background: var(--heat-2); }
.inspector-kind .heat-3 { background: var(--heat-3); }
.inspector-kind .heat-4 { background: var(--heat-4); }
.inspector-kind .heat-5 { background: var(--heat-5); }
.inspector-kpis { display: grid; grid-template-columns: repeat(3,1fr); margin: 16px -16px; border-block: 1px solid var(--line-0); }
.inspector-kpis div { min-width: 0; padding: 12px; border-right: 1px solid var(--line-0); }
.inspector-kpis div:last-child { border-right: 0; }
.inspector-kpis span { display: block; color: var(--ink-2-aa); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.inspector-kpis b { display: block; margin-top: 3px; overflow-wrap: anywhere; color: var(--ink-0); font: 400 20px/1.1 var(--font-display); }
.node-findings { display: grid; gap: 8px; margin-block: 16px; }
.inspector-finding { padding: 12px; border: 1px solid var(--line-1); border-left: 3px solid var(--heat-3); border-radius: var(--r-sm); background: var(--bg-0); }
.inspector-finding.severity-high { border-left-color: var(--heat-5); }
.inspector-finding.severity-medium { border-left-color: var(--heat-4); }
.inspector-finding.severity-low { border-left-color: var(--heat-2); }
.severity-chip { color: var(--heat-4); font: 500 10px/1 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; }
.inspector-finding strong { display: block; margin-top: 7px; color: var(--ink-0); font-size: var(--text-sm); }
.inspector-finding p { margin: 5px 0 0; color: var(--ink-1); font-size: var(--text-xs); }
.evidence-heading { margin-top: 18px; }

.recommendations-panel { width: 100%; margin: 0; border: 0; background: transparent; box-shadow: none; }
.issues-summary { display: flex; gap: 24px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line-0); border-radius: var(--r-md); background: var(--bg-1); color: var(--ink-1); font: var(--text-xs)/1 var(--font-mono); }
.issues-summary strong { color: var(--ink-0); }
.findings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.finding-card.issue { box-sizing: border-box; display: grid; grid-template-columns: 52px minmax(0,1fr); width: 100%; min-width: 0; gap: 16px; margin: 0; padding: 24px; border: 1px solid var(--line-0); border-left: 1px solid var(--line-0); border-radius: var(--r-lg); background: var(--bg-1); box-shadow: var(--shadow-1); }
.finding-card .finding-body { width: auto; min-width: 0; }
.finding-card:hover { border-color: var(--line-1); transform: translateY(-2px); }
.finding-number { color: var(--ink-3-aa); font: 400 40px/1 var(--font-display); }
.finding-card .issue-header { display: flex; align-items: center; gap: 8px; margin: 0; }
.finding-card .severity { padding: 3px 8px; border: 1px solid currentColor; border-radius: var(--r-pill); background: transparent; color: var(--heat-3); font: 500 10px/1 var(--font-mono); }
.finding-card.severity-high .severity { color: var(--heat-5); }
.finding-card.severity-medium .severity { color: var(--heat-4); }
.finding-card.severity-low .severity { color: var(--heat-2); }
.finding-card .type { color: var(--ink-2-aa); font: 500 var(--text-2xs)/1 var(--font-mono); letter-spacing: .06em; }
.finding-card .message { margin: 10px 0 6px; overflow-wrap: anywhere; color: var(--ink-0); font: 400 var(--text-xl)/1.15 var(--font-display); }
.finding-why { margin: 12px 0; }
.finding-why summary { width: fit-content; cursor: pointer; color: var(--ink-2-aa); font: 500 var(--text-2xs)/1 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; }
.finding-why[open] summary { color: var(--ink-0); }
.finding-evidence { margin: 12px 0; font: var(--text-xs)/1.4 var(--font-mono); }
.finding-evidence div { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 12px; padding: 6px 0; border-top: 1px dashed var(--line-0); }
.finding-evidence dt { color: var(--ink-2-aa); }
.finding-evidence dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-0); }
.finding-card .recommendation { padding-top: 10px; border-top: 1px dashed var(--line-0); color: var(--ink-1); font-size: var(--text-sm); font-style: normal; }
.finding-card .recommendation span { display: block; margin-bottom: 4px; color: var(--ink-2-aa); font: 500 var(--text-2xs)/1 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; }
.highlight-node { margin-top: 14px; padding: 0; border: 0; background: transparent; color: var(--ink-0); font-size: var(--text-xs); }
.highlight-node:hover { background: transparent; color: var(--heat-5); }
.no-issues { border: 1px solid var(--line-0); background: var(--bg-1); color: var(--ink-1); }

.server-card dl { display: grid; gap: 0; margin: 0; }
.server-card dl div { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--line-0); }
.server-card dl div:last-child { border-bottom: 0; }
.server-card dt { color: var(--ink-2-aa); font-size: var(--text-xs); text-transform: uppercase; }
.server-card dd { margin: 0; color: var(--ink-0); font: var(--text-sm)/1.6 var(--font-mono); white-space: pre-wrap; }
.status-pill.partial { border-style: dashed; border-color: var(--heat-3); color: var(--heat-3); }
#step2, #step3, #step4 { display: none; }
.settings-field { display: grid; gap: 7px; margin-top: 14px; color: var(--ink-1); font-size: var(--text-xs); }
.settings-input { min-height: 42px; padding: 10px 12px; resize: none; }
.node-settings { display: grid; gap: 9px; margin-bottom: 18px; }
.inspector-setting { display: grid; gap: 5px; padding: 10px 0; border-top: 1px dashed var(--line-0); }
.inspector-setting code { color: var(--heat-4); font: 500 var(--text-xs)/1.3 var(--font-mono); overflow-wrap: anywhere; }
.inspector-setting span { color: var(--ink-1); font: var(--text-xs)/1.4 var(--font-mono); }
.inspector-setting s { color: var(--ink-2-aa); }
.inspector-setting p { margin: 0; color: var(--ink-2-aa); font-size: var(--text-xs); line-height: 1.45; }
.graph-empty.error-state .graph-empty-card { border-color: var(--crit); }
.graph-empty button { pointer-events: auto; margin-top: 16px; }
.state-mark { display: grid; width: 36px; height: 36px; margin: 0 auto 14px; place-items: center; border: 1px solid var(--heat-5); border-radius: 50%; color: var(--heat-5); font: 500 var(--text-lg)/1 var(--font-mono); }
.state-spinner { width: 28px; height: 28px; margin: 0 auto 16px; border: 2px solid var(--line-2); border-top-color: var(--ink-0); border-radius: 50%; animation: state-spin .8s linear infinite; }
@keyframes state-spin { to { transform: rotate(1turn); } }
.graph-toolbar { top: 12px; right: 12px; bottom: auto; }

@media (max-width: 760px) {
  .findings-grid { grid-template-columns: 1fr; }
  .finding-card.issue { grid-template-columns: 38px 1fr; padding: 18px 14px; gap: 10px; }
  .finding-number { font-size: 30px; }
  .server-card dl div { grid-template-columns: 1fr; gap: 4px; }
  .visualizer-area { order: -1; }
}

/* M8 evidence views and graph interaction -------------------------------- */
.view-panel[hidden] { display: none !important; }
.segmented-control .segment { min-height: 30px; margin: 0; padding: 7px 12px; border: 0; background: transparent; font: 500 var(--text-xs)/1 var(--font-ui); cursor: pointer; }
.segmented-control .segment.active { background: var(--bg-0); color: var(--ink-0); }
.bottleneck-button[aria-pressed="true"] { border-color: var(--heat-5); color: var(--heat-5); }
.river-tools-hidden { visibility: hidden; }
.evidence-view { min-height: 700px; height: 100%; padding: 24px; overflow: auto; background: radial-gradient(700px 360px at 50% 110%, var(--crit-wash), transparent 70%), var(--bg-0); }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line-0); }
.view-heading h3, .view-empty h3, .index-card h3 { margin: 5px 0 0; color: var(--ink-0); font: 400 var(--text-xl)/1.15 var(--font-display); }
.view-heading p { max-width: 42ch; margin: 0; color: var(--ink-2-aa); font-size: var(--text-xs); text-align: right; }
.view-empty { display: grid; max-width: 520px; min-height: 480px; margin: auto; place-content: center; justify-items: center; color: var(--ink-1); text-align: center; }
.view-empty p { margin: 12px 0 18px; padding: 10px 12px; border: 1px solid var(--line-0); border-radius: var(--r-sm); background: var(--bg-1); }
.view-empty code { color: var(--ink-0); font: var(--text-xs)/1.4 var(--font-mono); }
.pipeline-list { width: min(720px, 100%); margin: 0 auto; padding: 0; list-style: none; }
.pipeline-stage { position: relative; display: grid; grid-template-columns: 30px 12px minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 70px; padding: 10px 12px; border-bottom: 1px solid var(--line-0); }
.pipeline-stage > i { width: 8px; height: 8px; border: 2px solid var(--heat-1); border-radius: 50%; background: var(--bg-0); }
.pipeline-stage > i::after { content: ""; position: absolute; top: 45px; bottom: -25px; margin-left: 2px; border-left: 1px solid var(--line-1); }
.pipeline-stage:last-child > i::after { display: none; }
.pipeline-stage.blocking { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--heat-4) 8%, transparent)); }
.pipeline-stage.blocking > i { border-color: var(--heat-5); box-shadow: 0 0 10px var(--heat-glow); }
.stage-order { color: var(--ink-3-aa); font: var(--text-xs)/1 var(--font-mono); }
.stage-plan { display: block; color: var(--ink-2-aa); font: 500 var(--text-2xs)/1.2 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; }
.pipeline-stage strong { display: block; margin-top: 4px; color: var(--ink-0); font: 500 var(--text-sm)/1.3 var(--font-mono); overflow-wrap: anywhere; }
.plan-node-link { margin: 5px 0 0; padding: 0; border: 0; background: transparent; color: var(--ink-2-aa); font: var(--text-2xs)/1 var(--font-mono); cursor: pointer; }
.plan-node-link:hover { color: var(--heat-5); }
.stage-flow { min-width: 70px; text-align: right; }
.stage-flow b { display: block; color: var(--ink-0); font: 400 22px/1 var(--font-mono); }
.stage-flow span, .stage-flow small { display: block; margin-top: 4px; color: var(--ink-2-aa); font: var(--text-2xs)/1 var(--font-mono); }
.runtime-guidance { margin-bottom: 20px; padding: 20px; border: 1px solid var(--line-0); border-radius: var(--r-md); background: var(--bg-1); }
.runtime-guidance h3 { margin: 8px 0; color: var(--ink-0); font: 500 24px/1.2 var(--font-ui); letter-spacing: -.02em; }
.runtime-guidance p { max-width: 76ch; color: var(--ink-1); font: 400 14px/1.6 var(--font-ui); }
.runtime-guidance .runtime-missing { overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 12px; }
.runtime-guidance .runtime-privacy { margin-bottom: 0; color: var(--ink-2-aa); font-size: 12px; }
.runtime-guidance button { max-width: 100%; white-space: normal; }
.runtime-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); margin-bottom: 20px; border: 1px solid var(--line-0); border-radius: var(--r-md); background: var(--bg-1); }
.runtime-metrics > div { min-width: 0; padding: 12px; border-right: 1px solid var(--line-0); }
.runtime-metrics > div:last-child { border-right: 0; }
.runtime-metrics span:first-child, .index-kpis span:first-child { display: block; color: var(--ink-2-aa); font: var(--text-2xs)/1.2 var(--font-ui); text-transform: uppercase; }
.runtime-metrics b, .index-kpis b { display: block; margin: 7px 0; color: var(--ink-0); font: 500 var(--text-sm)/1 var(--font-mono); overflow-wrap: anywhere; }
.evidence-badge { display: inline-block; padding: 3px 6px; border: 1px solid var(--line-1); border-radius: var(--r-pill); color: var(--ink-2-aa); font: 500 9px/1 var(--font-mono); text-transform: uppercase; }
.evidence-badge.known { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.evidence-badge.inferred { color: var(--ink-1); border-style: dashed; }
.cost-table { border-top: 1px solid var(--line-0); }
.cost-row { display: grid; grid-template-columns: minmax(0,1fr) 120px 80px; width: 100%; min-height: 48px; margin: 0; padding: 8px 10px; gap: 16px; align-items: center; border: 0; border-bottom: 1px solid var(--line-0); border-radius: 0; background: transparent; color: var(--ink-0); text-align: left; font-family: var(--font-mono); }
button.cost-row { cursor: pointer; }
button.cost-row:hover { background: var(--bg-1); }
.cost-row > span:first-child { position: relative; min-width: 0; padding: 4px 8px; }
.cost-row b, .cost-row small { position: relative; display: block; z-index: 1; }
.cost-row b { font-size: var(--text-xs); }
.cost-row small { margin-top: 3px; color: var(--ink-2-aa); font-size: var(--text-2xs); }
.cost-header { min-height: 34px; color: var(--ink-2-aa); font: 500 var(--text-2xs)/1 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; }
.heat-bar { position: absolute; z-index: 0; inset: 0 auto 0 0; width: var(--row-width); border-left: 2px solid currentColor; opacity: .14; background: currentColor; }
.heat-bar.heat-0 { color: var(--heat-0); }.heat-bar.heat-1 { color: var(--heat-1); }.heat-bar.heat-2 { color: var(--heat-2); }.heat-bar.heat-3 { color: var(--heat-3); }.heat-bar.heat-4 { color: var(--heat-4); }.heat-bar.heat-5 { color: var(--heat-5); }
.index-list { display: grid; gap: 14px; }
.index-card { padding: 18px; border: 1px solid var(--line-0); border-radius: var(--r-md); background: var(--bg-1); }
.index-card header { display: flex; justify-content: space-between; gap: 16px; }
.index-kpis { display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0; border-block: 1px solid var(--line-0); }
.index-kpis > div { padding: 12px; border-right: 1px solid var(--line-0); }
.index-kpis > div:last-child { border-right: 0; }
.index-card dl { margin: 0; }
.index-card dl > div { display: grid; grid-template-columns: 110px minmax(0,1fr); padding: 8px 0; border-bottom: 1px dashed var(--line-0); font: var(--text-xs)/1.4 var(--font-mono); }
.index-card dt { color: var(--ink-2-aa); }.index-card dd { margin: 0; color: var(--ink-0); overflow-wrap: anywhere; }
.skip-indexes > div { display: grid; grid-template-columns: 120px minmax(0,1fr) auto; gap: 12px; margin-top: 12px; padding: 10px; background: var(--bg-0); color: var(--ink-1); font: var(--text-xs)/1.4 var(--font-mono); }
.skip-indexes code { color: var(--ink-0); overflow-wrap: anywhere; }.skip-indexes p { color: var(--ink-2-aa); font-size: var(--text-xs); }
.index-suggestion { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-0); color: var(--ink-1); font-size: var(--text-xs); }
.index-suggestion span { display: block; margin-bottom: 5px; color: var(--heat-4); font: 500 var(--text-2xs)/1 var(--font-mono); text-transform: uppercase; }
.graph-minimap { position: static; width: 84px; height: 64px; flex: 0 0 84px; padding: 5px; border-color: var(--line-1); background: var(--bg-1); cursor: crosshair; pointer-events: auto; }
.graph-minimap::before, .graph-minimap::after { display: none; }
.graph-minimap svg { width: 100%; height: 100%; }.graph-minimap line { stroke: var(--line-2); stroke-width: 3; }.graph-minimap rect { fill: var(--ink-2-aa); }
.graph-minimap .minimap-viewport { fill: color-mix(in srgb, var(--ink-0) 10%, transparent); stroke: var(--ink-0); stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.bottleneck-flow { opacity: 0; transition: opacity var(--motion-fast); }
.bottleneck-only .bottleneck-flow { opacity: 1; }
.bottleneck-only .links, .bottleneck-only .node:not(.pruning-path), .bottleneck-only .same-table-tie { opacity: .18; }
.node.search-match rect:not(.node-heat), .node.keyboard-focus rect:not(.node-heat) { stroke: var(--heat-5) !important; stroke-width: 2px !important; filter: drop-shadow(0 0 9px var(--heat-glow)); }
.node.keyboard-focus { outline: none; }
.node.keyboard-focus rect:not(.node-heat) { stroke-dasharray: 3 2; }

@media (max-width: 760px) {
  .tab-bar { align-items: stretch; }
  .segmented-control { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .segmented-control .segment { min-width: 0; padding-inline: 5px; }
  .canvas-tools { flex-direction: row; }
  .plan-search { min-width: 0; }
  .bottleneck-button { white-space: nowrap; }
  .evidence-view { min-height: 540px; padding: 16px 12px; }
  .view-heading { display: block; }.view-heading p { margin-top: 7px; text-align: left; }
  .runtime-metrics > div { border-bottom: 1px solid var(--line-0); }
  .cost-row { grid-template-columns: minmax(0,1fr) 86px 62px; gap: 6px; padding-inline: 4px; }
  .cost-row b, .cost-row small { overflow-wrap: anywhere; }
  .pipeline-stage { grid-template-columns: 22px 10px minmax(0,1fr) 52px; gap: 7px; padding-inline: 4px; }
  .index-card, .index-card header > div { min-width: 0; }
  .index-card h3 { overflow-wrap: anywhere; }
  .index-card header .plan-node-link { flex: 0 0 auto; white-space: nowrap; }
  .skip-indexes > div { grid-template-columns: 1fr; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .bottleneck-flow, .node, .cost-row { transition: none; }
}

.stored-share-dialog { box-sizing: border-box; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px; border: 1px solid var(--line-0); border-radius: 14px; background: var(--bg-1); color: var(--ink-1); box-shadow: 0 24px 80px var(--shadow-color); font-size: 14px; line-height: 1.55; }
.stored-share-dialog::backdrop { background: var(--backdrop); }
.stored-share-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.stored-share-heading h2 { margin: 5px 0 14px; font-size: 24px; line-height: 1.2; color: var(--ink-0); }
.stored-share-dialog p { margin: 12px 0; }
.stored-share-dialog ul { padding-left: 20px; margin: 14px 0; }
.stored-share-dialog li + li { margin-top: 7px; }
.stored-share-dialog .stored-consent { align-items: start; padding: 12px; border: 1px solid var(--line-0); border-radius: 8px; margin: 16px 0; font-size: 14px; }
.stored-share-dialog .stored-consent input { margin-top: 4px; flex-shrink: 0; }
.stored-share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.stored-share-dialog .compact-button { width: auto; min-height: 40px; flex: none; }
.stored-share-dialog button:disabled { opacity: .5; cursor: not-allowed; }
#storedShareSuccess { border-top: 1px solid var(--line-0); padding-top: 16px; }
#storedShareUrl, #urlShareValue { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; padding: 10px; border: 1px solid var(--line-0); border-radius: 6px; background: var(--bg-0); color: var(--ink-0); font: 12px/1.5 monospace; resize: vertical; overflow-wrap: anywhere; }
.upgrade-notes { margin-top: 20px; padding: 14px; border: 1px solid var(--line-1); border-radius: var(--r-md); }
.upgrade-notes > summary, .node-settings > summary { cursor: pointer; color: var(--ink-1); }
.stored-share-manage { border-top: 1px solid var(--line-0); margin: 16px 0; padding-top: 12px; }
.stored-share-manage summary { cursor: pointer; }
#importDeletionReceipt { display: block; max-width: 100%; margin-top: 8px; }
@media (max-width: 600px) {
  .stored-share-dialog { padding: 18px; }
}

/* Shell finish: an editorial introduction and a quiet evidence workspace.
   Keep diagram geometry and semantic heat colors owned by query-map.css. */
.page-content > section:not(#plan) > .wrap,
.site-header .header-content,
.footer .container {
  width: min(1280px, calc(100% - 2 * var(--shell-gutter)));
}
.header-content { min-height: 68px; height: auto; gap: 24px; flex-wrap: wrap; }
.top-nav { flex-wrap: wrap; max-width: 100%; }
.domain-name { font-size: 28px; font-weight: 400; letter-spacing: -.035em; }
.domain-name::before { display: none; }
.report-label-short { display: none; }
.nav-pill { font-weight: 500; }
.header-actions { justify-content: flex-end; }
.header-button { width: auto; }
.header-button, .compact-button { min-height: var(--control-height); }
.header-button:disabled { opacity: 1; color: var(--ink-3-aa); border-color: var(--line-0); background: transparent; }
.header-button.primary:disabled { color: var(--ink-3-aa); background: var(--bg-2); }
.text-button { min-height: var(--control-height); line-height: 1.4; }

#inputContainer.hero { padding: clamp(40px, 6vw, 88px) 0 48px; }
.hero h1 { max-width: 15ch; font-size: clamp(48px, 5.3vw, 76px); line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.agent-panel { gap: 20px; padding: 28px; border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.agent-panel h2 { font-size: 28px; letter-spacing: -.02em; }
.agent-panel .agent-prompt-code { display: block; padding: 18px 20px; border-color: var(--line-0); border-radius: var(--r-sm); }
.agent-panel .agent-prompt-code code { font: 400 13px/1.8 var(--font-mono); }
.agent-primary-action { gap: 16px; }
.agent-primary-action p { font-weight: 400; }
#agentCopyStatus { color: var(--accent); line-height: 1.5; }

.report-section, .server-section { padding: 48px 0; }
.report-section > .wrap, .server-section > .wrap { padding-top: 32px; border-top: 1px solid var(--line-1); }
#plan, #findings, #server, #inspectorRail { scroll-margin-top: 92px; }
.section-heading { gap: 20px; margin-bottom: 28px; }
.section-heading h2 { font-size: clamp(32px, 3vw, 42px); }
.section-heading p { line-height: 1.6; }
.evidence-title { font-weight: 500; line-height: 1.5; }
.evidence-subtitle, .evidence-state, .empty-copy, .share-status, .mini-meta { font-weight: 400; line-height: 1.6; }
.evidence-state { font-size: 10px; }
.evidence-item { gap: 8px; padding-block: 12px; border-radius: var(--r-xs); }
.evidence-item + .evidence-item { border-top: 1px solid var(--line-0); }
.evidence-list { gap: 0; margin-top: 12px; }
.evidence-actions { gap: 14px; margin-top: 18px; }
.share-options { font-weight: 400; line-height: 1.6; }
.share-options input { accent-color: var(--accent); }
.drawer-title { flex-wrap: wrap; gap: 4px 12px; font-weight: 500; }
.code-preview, .raw-preview { font-weight: 400; line-height: 1.65; overflow-wrap: anywhere; }
.inspector-empty { color: var(--ink-2-aa); font-weight: 400; line-height: 1.65; }
.suggestion-card { gap: 10px; }
.suggestion-card strong { font-weight: 500; }
.suggestion-card span { font-weight: 400; line-height: 1.65; }
.finding-card.issue { border-radius: var(--r-md); box-shadow: none; }
.finding-card:hover { transform: none; }
.finding-card .message { font-size: 26px; line-height: 1.2; }
.finding-card .recommendation { line-height: 1.65; }
.issues-summary { flex-wrap: wrap; gap: 12px 24px; line-height: 1.5; }
.server-card { box-shadow: none; border-radius: var(--r-md); }
.server-card dd { min-width: 0; overflow-wrap: anywhere; }
.footer { padding: 28px 0 36px; }
.footer .container, .footer a, .footer-note { font-weight: 400; line-height: 1.7; }
.footer-note { max-width: 95ch; margin-top: 8px; }

.code-textarea { padding: 16px; font-family: var(--font-mono); font-weight: 400; line-height: 1.65; }
.code-textarea::placeholder { color: var(--ink-2-aa); opacity: 1; }
.query-display { padding: 16px; font-family: var(--font-mono); line-height: 1.65; }
.wizard-error { margin-inline: 28px; background: var(--bg-0); line-height: 1.6; }
.stored-share-dialog { padding: 28px; border-color: var(--line-1); border-radius: var(--r-md); overflow-y: auto; }
.stored-share-dialog h2 { margin: 8px 0 16px; color: var(--ink-0); font: 400 34px/1.1 var(--font-display); letter-spacing: -.025em; }
.stored-share-dialog .stored-consent { padding: 16px; border-color: var(--line-1); background: var(--bg-0); }
.stored-share-dialog .compact-button { min-height: var(--control-touch-height); }
.stored-share-dialog .share-status { font-size: 12px; line-height: 1.65; }
.stored-share-dialog summary { text-underline-offset: 4px; }
.stored-share-dialog summary:hover { text-decoration: underline; }
.stored-share-dialog form { margin-top: 20px; }
.stored-share-dialog textarea { font-family: var(--font-mono); }

@media (min-width: 1100px) {
  .hero > .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(40px, 5vw, 80px); align-content: start; }
  .hero h1 { grid-column: 1; align-self: end; margin-bottom: 24px; }
  .hero-lede { grid-column: 1; align-self: start; margin-bottom: 0; }
  .hero .agent-panel { grid-column: 2; grid-row: 1 / 4; }
}
@media (max-width: 1099px) {
  .header-content { flex-wrap: wrap; gap: 8px 20px; padding-block: 12px; }
  .header-actions { gap: 6px; }
  #plan, #findings, #server, #inspectorRail { scroll-margin-top: 136px; }
  .report-label-long { display: none; }
  .report-label-short { display: inline; }
  .hero h1 { max-width: 19ch; }
  .hero .agent-panel { max-width: 760px; }
}
@media (max-width: 760px) {
  .header-content { column-gap: 12px; }
  .header-actions { flex: 1 1 100%; order: 3; justify-content: flex-start; gap: 4px; }
  .top-nav { order: 0; width: auto; margin-left: auto; gap: 0; }
  .nav-pill { padding-inline: 7px; font-size: 12px; }
  .domain-name { font-size: 26px; }
  .header-button { flex: 1; padding-inline: 6px; font-size: 12px; }
  .header-button, .nav-pill { min-height: var(--control-touch-height); }
  .nav-pill { display: flex; align-items: center; }
  #copyMarkdownReportButton { padding-inline: 6px; }
  #inputContainer.hero { padding: 40px 0 28px; }
  .hero h1 { font-size: clamp(44px, 10vw, 60px); max-width: 17ch; margin-bottom: 20px; }
  .agent-panel { padding: 20px; gap: 18px; }
  .agent-panel .agent-prompt-code { padding: 14px 78px 14px 14px; }
  .agent-panel .agent-prompt-code code { font-size: 12px; line-height: 1.75; }
  .agent-code-copy { min-height: 36px; }
  .agent-primary-action { gap: 12px; }
  .report-section, .server-section { padding: 28px 0; }
  #plan, #findings, #server, #inspectorRail { scroll-margin-top: 128px; }
  .section-heading p { margin-top: 10px; }
  .wizard-error { margin-inline: 20px; }
  .code-textarea { font-size: 16px; min-height: 240px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .settings-input { min-height: 44px; }
  .stored-share-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 20px; }
  .stored-share-dialog h2 { font-size: 30px; }
  .stored-share-heading { gap: 8px; }
  .stored-share-actions > .compact-button { flex: 1 1 auto; }
}
@media (max-width: 380px) {
  .header-content { column-gap: 8px; }
  .nav-pill { padding-inline: 3px; font-size: 11px; }
}

/* Investigation review never changes the original evidence or rule severity. */
.finding-confidence, .review-note { color: var(--ink-2-aa); font-size: 13px; line-height: 1.6; }
.grouped-review { margin: 20px 0 28px; padding: 16px; border: 1px solid var(--line-1); border-radius: var(--r-md); background: var(--bg-0); }
.grouped-review > summary { cursor: pointer; font-weight: 600; }
.finding-group-list { display: grid; gap: 10px; margin-top: 14px; }
.finding-group-review { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 12px; border-top: 1px dashed var(--line-1); }
.finding-group-review:first-child { border-top: 0; }
.finding-group-review > div:first-child { min-width: 0; }
.finding-group-review b, .finding-group-review span { display: block; overflow-wrap: anywhere; }
.finding-group-review span { margin-top: 3px; color: var(--ink-2-aa); font-size: 12px; }
.finding-group-review .review-controls { flex: 0 0 auto; }
.review-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.review-controls .compact-button { min-height: 36px; }
.review-controls span { font-size: 13px; }
.review-report-option { display: flex; align-items: flex-start; gap: 10px; margin: 24px 0 16px; font-size: 14px; line-height: 1.6; }
.review-report-option input { margin-top: 5px; }
.observation-findings, .reviewed-findings { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line-1); }
.observation-findings > summary, .reviewed-findings > summary { cursor: pointer; padding: 10px 0; font-size: 16px; }
.finding-card.observation { border-left-color: var(--ink-2); }
.finding-card:focus-visible { outline: 2px solid var(--ink-0); outline-offset: 4px; }
@media (max-width: 600px) {
  .review-controls .compact-button { min-height: 44px; }
  .review-report-option { min-height: 44px; }
}

/* Manual evidence collection uses the existing static workspace design tokens. */
.collection-status { margin: 12px 28px; font-size: 13px; line-height: 1.6; }
.collection-status:empty { display: none; }
.collection-help { margin: 18px 0; font-size: 14px; line-height: 1.65; }
.collection-help summary, .collection-dialog summary { cursor: pointer; padding-block: 8px; }
.collection-help .query-display, .collection-dialog .query-display { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.collection-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.6; margin: 16px 0; }
.collection-consent[hidden] { display: none; }
.collection-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; }
.collection-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 28px; color: var(--ink-0); background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-md); overflow-y: auto; }
.collection-dialog::backdrop { background: var(--backdrop); }
.collection-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.collection-dialog h2 { margin: 0; font: 400 32px/1.15 var(--font-display); }
.collection-dialog p, .collection-dialog li { font-size: 14px; line-height: 1.65; }
.collection-dialog label:not(.collection-consent) { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; font-size: 14px; }
.collection-dialog input:not([type=checkbox]), .collection-dialog textarea, .collection-dialog select { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line-1); border-radius: var(--r-sm); background: var(--bg-0); color: var(--ink-0); font: 14px/1.5 var(--font-mono); }
.collection-dialog button { min-height: 44px; }
.collection-dialog [role=alert]:not([hidden]) { border-left: 3px solid var(--accent); background: var(--bg-0); padding: 12px; }
.collection-dialog [aria-invalid=true] { outline: 2px solid var(--accent); }
.role-selection-dialog #roleSelectionSources { display: grid; gap: 10px; margin: 18px 0; }
.role-selection-dialog [data-role-source] { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(180px, .45fr); align-items: center; gap: 16px; margin: 0 !important; padding: 12px; border: 1px solid var(--line-1); border-radius: var(--r-sm); background: var(--bg-0); }
.role-selection-dialog [data-role-source] span { overflow-wrap: anywhere; font-family: var(--font-mono); }
.runtime-window { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.runtime-manual-action { margin: 20px 0; padding: 16px; border: 1px solid var(--line-0); border-radius: var(--r-sm); }
.runtime-manual-action p { margin: 10px 0 0; font-size: 13px; line-height: 1.6; }
.copy-fallback { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .collection-dialog { padding: 20px; width: calc(100% - 24px); }
  .collection-dialog h2 { font-size: 26px; }
  .collection-dialog input:not([type=checkbox]), .collection-dialog textarea, .collection-dialog select { font-size: 16px; }
  .role-selection-dialog [data-role-source] { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .finding-group-review { align-items: flex-start; flex-direction: column; }
  .runtime-window { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* Agent-first entry; personal evidence remains in the full results workspace. */
.hero > .wrap { display: block; }
.home-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 20px; }
.home-actions [hidden] { display: none; }
#startAnalysis { min-height: 44px; }
.analysis-import { font-size: 12px; }
.analysis-import > summary { cursor: pointer; padding-block: 12px; }
.analysis-import[open] { flex-basis: 100%; }
.analysis-import > div { max-width: 52ch; padding: 14px; border: 1px solid var(--line-1); border-radius: 6px; background: var(--bg-1); }
.analysis-import p { margin: 0 0 12px; line-height: 1.6; }
.agent-entry { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0 4px; }
.agent-entry a { display: inline-flex; align-items: center; width: auto; flex: 0 0 auto; min-height: 44px; text-decoration: none; }
.agent-trust { color: var(--ink-1); font-size: 13px; line-height: 1.5; margin: 8px 0; }
.header-button.save-link-button, .stored-share-dialog .save-link-button { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.save-link-button:not(:disabled):hover { background: var(--accent-hover); }
.stored-receipt { margin: 16px 0; padding: 12px 0; border-block: 1px solid var(--line-0); font-size: 12px; }
.stored-receipt > summary { cursor: pointer; }
.share-menu { position: relative; margin-left: auto; }
.share-menu > summary { display: flex; align-items: center; cursor: pointer; min-height: 36px; }
.share-menu-items { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; display: grid; gap: 8px; width: min(300px, calc(100vw - 24px)); padding: 12px; background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.share-menu-items button { min-height: 44px; }
.share-options-select { display: grid; gap: 5px; }
.share-options-select select { width: 100%; min-width: 0; }
.comparison-agent { padding: 16px; margin-block: 16px; border: 1px solid var(--line-1); border-radius: var(--r-md); }
.comparison-agent > summary { cursor: pointer; }
#comparisonAgentPrompt { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 var(--font-mono); }
#compareRevision { margin-top: 16px; min-height: 44px; }
body[data-page="home"] #inputContainer { padding: 28px 0; background: linear-gradient(120deg, var(--bg-1) 30%, var(--accent-soft)); border-bottom: 1px solid var(--line-0); }
body[data-page="home"] .hero > .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
body[data-page="home"] .hero h1 { font: 600 clamp(38px, 4.2vw, 62px)/1.08 var(--font-ui); max-width: none; margin: 18px 0; letter-spacing: -.055em; text-align: left; text-wrap: initial; }
body[data-page="home"] .hero h1 span { color: var(--accent); font-style: normal; }
body[data-page="home"] .hero-lede { margin: 0 0 18px; font-size: 16px; max-width: 48ch; line-height: 1.65; }
.hero-intro > .section-label { justify-content: flex-start; gap: 8px; }
.brand-signal { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 2px; background: var(--accent); box-shadow: 4px -4px 0 var(--accent-line); }
body[data-page="home"] .hero .agent-panel { grid-column: auto; grid-row: auto; gap: 12px; padding: 22px; border: 1px solid var(--accent-line); border-radius: 12px; box-shadow: 0 4px 0 var(--map-step-active), 0 14px 36px -18px var(--accent-glow); }
.agent-panel > .section-label { color: var(--accent); }
body[data-page="home"] .agent-panel h2 { font: 600 24px/1.2 var(--font-ui); letter-spacing: -.03em; }
body[data-page="home"] .agent-panel .agent-prompt-code { padding: 14px 78px 14px 14px; background: var(--map-canvas); border-radius: 6px; }
body[data-page="home"] .agent-panel .agent-prompt-code code { font-size: 11px; line-height: 1.65; }
.saved-work-panel { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line-1); }
.saved-work-panel h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.saved-work-panel p { margin: 4px 0 0; color: var(--ink-1); font-size: 12px; line-height: 1.5; }
.saved-work-panel button { flex-shrink: 0; color: var(--accent); }
.summary-question { margin: 0 0 16px; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--bg-0); }
body[data-page="home"] .agent-trust { max-width: 52ch; margin: 18px 0; font-size: 12px; line-height: 1.7; }
body[data-page="home"] .home-actions { justify-content: flex-start; gap: 8px 18px; padding-top: 16px; border-top: 1px solid var(--line-0); }
.manual-entry-label { flex-basis: 100%; font-size: 12px; color: var(--ink-2-aa); }
body[data-page="home"] #startAnalysis { border: 1px solid var(--line-1); background: var(--bg-1); border-radius: 6px; padding-inline: 14px; color: var(--ink-0); }
body[data-page="home"] #startAnalysis:hover { border-color: var(--accent); color: var(--accent); }
.agent-panel .agent-entry { margin: 0; justify-content: flex-start; gap: 8px 16px; }
.agent-entry p { margin: 0; font-size: 12px; color: var(--ink-1); }
body[data-page="home"] #plan { padding-top: 24px; }
body:not([data-page="home"]) .home-only { display: none; }
body[data-page="home"] .header-actions,
body[data-page="home"]:not([data-investigations="true"]):not([data-comparison="true"]) #openInvestigations,
body[data-page="home"] .nav a[href="#findings"],
body[data-page="home"] .nav a[href="#server"],
body[data-page="home"] #findings,
body[data-page="home"] #server,
body[data-page="home"] #plan .map-intro,
body[data-page="home"] #plan .workspace-controls,
body[data-page="home"] #plan .share-status,
body[data-page="home"] #plan .tab-bar,
body[data-page="home"] #plan .stage-findings { display: none; }
.demo-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.demo-heading > a { flex-shrink: 0; color: var(--accent); text-decoration: none; }
.demo-label { font-size: 11px; font-weight: 650; color: var(--accent); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.demo-label > span { font-weight: 400; color: var(--ink-1); }
.demo-label .live-example { color: var(--accent); font-weight: 600; }
.live-example::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
.demo-intro h2 { font: 600 clamp(19px, 2vw, 26px)/1.2 var(--font-ui); letter-spacing: -.035em; margin: 10px 0 6px; }
.demo-intro p { font-size: 13px; line-height: 1.6; color: var(--ink-1); margin: 8px 0; }
.demo-meta { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 14px; }
.demo-meta > p { font-size: 12px; }
.demo-sql { margin: 0; font-size: 12px; }
.demo-sql[open] { flex-basis: 100%; }
.demo-sql summary { cursor: pointer; padding: 4px 0; width: fit-content; }
.demo-sql pre { max-height: 400px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; border: 1px solid var(--line-0); background: var(--bg-1); line-height: 1.6; }
body[data-page="home"] #plan .workspace-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "canvas canvas" "inspector recommendation"; }
body[data-page="home"][data-home-loading="true"] #plan .workspace-shell { visibility: hidden; }
body[data-page="home"] #plan .canvas-body,
body[data-page="home"] #plan #treeContainer { height: 520px; min-height: 520px; }
body[data-page="home"] #plan .graph-actions { padding: 8px 16px; }
body[data-page="home"] .map-direction { flex: 1; justify-content: flex-end; }
body[data-page="home"] .map-direction > span { flex-basis: 100%; text-align: right; }
body[data-page="home"] #plan .inspector-rail { max-height: none; padding: 18px 24px; border-left: 0; border-top: 1px solid var(--line-0); }
body[data-page="home"] #inspectorRail > .rail-card:not(:first-child),
body[data-page="home"] #nodeInspector .node-findings,
body[data-page="home"] #nodeInspector .node-settings,
body[data-page="home"] #nodeInspector .upgrade-notes { display: none; }
body[data-page="home"] #nodeInspector { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(180px, 1fr); gap: 4px 16px; }
body[data-page="home"] #nodeInspector .inspector-kind { grid-column: 1; }
body[data-page="home"] #nodeInspector .inspector-title { grid-column: 1; margin: 4px 0; }
body[data-page="home"] #nodeInspector .inspector-subtitle { grid-column: 1; margin: 0; }
body[data-page="home"] #nodeInspector .inspector-kpis { grid-column: 2; grid-row: 1 / 4; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-page="home"] #nodeInspector .inspector-kpis > :nth-child(3) { display: none; }
body[data-page="home"] #nodeInspector .metric-note { grid-column: 1 / -1; margin: 4px 0; }
body[data-page="home"] #nodeInspector .detail-grid,
body[data-page="home"] #nodeInspector .evidence-heading { grid-column: 1 / -1; }
.demo-recommendation { grid-area: recommendation; margin: 0; padding: 20px 24px; border-left: 3px solid var(--accent); border-top: 1px solid var(--line-0); background: var(--accent-soft); }
.demo-recommendation h3 { margin: 8px 0; font-size: 19px; font-weight: 500; }
.demo-recommendation p { margin: 0; max-width: 105ch; font-size: 14px; line-height: 1.65; }
body:is([data-page="results"], [data-page="loading"]) .hero h1,
body:is([data-page="results"], [data-page="loading"]) .hero-lede { display: none; }
body:is([data-page="results"], [data-page="loading"]) #inputContainer { padding: 12px 0; }
body[data-page="wizard"] .page-content > :not(#inputContainer),
body[data-page="wizard"] .header-actions { visibility: hidden; }
@media (max-width: 760px) {
  body[data-page="home"] #plan .workspace-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "canvas" "recommendation" "inspector"; }
  body[data-page="home"] #inputContainer { padding: 28px 0; }
  body[data-page="home"] .hero > .wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  body[data-page="home"] .hero-intro { display: contents; }
  body[data-page="home"] .hero .agent-panel { order: -1; margin: 0 0 20px; }
  body[data-page="home"] .hero .home-actions { order: 2; margin-top: 24px; }
  body[data-page="home"] .agent-panel .agent-entry { order: -1; }
  body[data-page="home"] .hero h1 { font-size: clamp(32px, 8vw, 52px); margin: 16px 0; }
  body[data-page="home"] .hero-lede { font-size: 15px; }
  body[data-page="home"] .agent-trust { margin: 12px 0; }
  body[data-page="home"] .hero .agent-panel { padding: 18px; }
  .saved-work-panel { order: 3; align-items: flex-start; flex-direction: column; gap: 8px; margin-top: 20px; }
  .home-actions { gap: 8px 16px; }
  .home-actions button { min-height: 44px; }
  .demo-intro h2 { font-size: 23px; }
  .demo-heading > a { display: none; }
  .demo-meta { gap: 2px; }
  body[data-page="home"] #plan .canvas-body,
  body[data-page="home"] #plan #treeContainer { height: 420px; min-height: 420px; }
  body[data-page="home"] #plan .graph-actions { flex-wrap: wrap; }
  body[data-page="home"] #plan .node .node-count { font-size: 13px; }
  body[data-page="home"] .map-direction { flex-basis: 100%; justify-content: flex-start; }
  body[data-page="home"] .map-direction > span { text-align: left; }
  body[data-page="home"] #plan .inspector-rail { max-height: none; padding: 16px; }
  body[data-page="home"] #nodeInspector { display: block; }
  body[data-page="home"] #nodeInspector .inspector-kpis { margin: 16px 0; }
  .demo-recommendation { padding: 16px; }
}

/* Personal results: evidence and an optional next step before deep exploration. */
body:not([data-page="results"]) .analysis-summary,
body:not([data-page="results"]) .results-only { display: none; }
.analysis-summary { margin: 0 0 24px; padding: 24px; border: 1px solid var(--line-0); background: var(--bg-1); overflow-wrap: anywhere; }
.analysis-summary[hidden], #summaryContent[hidden] { display: none; }
.summary-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.summary-heading h2 { font: 500 25px/1.2 var(--font-ui); letter-spacing: -.03em; margin: 0; }
.summary-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.analysis-summary button, .analysis-summary summary { min-height: 32px; }
.analysis-summary summary { cursor: pointer; width: fit-content; }
.summary-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; }
.summary-grid > div { min-width: 0; }
.summary-grid h3 { font: 600 14px/1.4 var(--font-ui); margin: 0 0 10px; }
.summary-card-heading { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.summary-card-heading h3 { margin-bottom: 0; }
.summary-agent { flex: 0 0 auto; }
.analysis-summary p, .analysis-summary dl, .analysis-summary details { font-size: 13px; line-height: 1.6; color: var(--ink-1); }
.analysis-summary p { margin: 8px 0; }
.analysis-summary .summary-candidate { color: var(--ink-0); font-size: 15px; }
.summary-observations { margin: 8px 0; }
.brief-checks, .brief-gaps, .summary-observations { padding-left: 20px; }
.brief-checks li + li, .brief-gaps li + li, .summary-observations li + li { margin-top: 8px; }
.brief-checks p { margin: 4px 0 0; }
.receipt-attribution, .scoped-intents { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line-1); }
.receipt-attribution h4, .scoped-intents h4 { margin: 0 0 6px; font-size: 13px; }
.receipt-attribution p, .scoped-intents p { font-size: 12px; line-height: 1.55; }
.summary-primary { margin-top: 10px; background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.analysis-summary .summary-action-reason { font-size: 12px; }
.summary-disclaimer { margin-top: 20px !important; padding: 12px; border-left: 3px solid var(--line-1); background: var(--bg-0); font-size: 12px !important; }
.summary-coverage-line { border-top: 1px solid var(--line-0); padding-top: 12px; }
.summary-coverage dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; }
.summary-coverage dt { font-weight: 600; }
.summary-coverage dd { margin: 0; }
.summary-coverage dd button { display: block; }
.runtime-group-label { display: block; margin: 16px 0; font-size: 13px; }
.runtime-group-label select { display: block; width: 100%; max-width: 600px; min-height: 40px; margin-top: 8px; font: inherit; color: var(--ink-0); background: var(--bg-1); border: 1px solid var(--line-0); }
.runtime-metrics small { display: block; font-size: 12px; }
.runtime-sample-details { max-height: 260px; overflow: auto; overflow-wrap: anywhere; }
#summaryStatus { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#analysisSummaryTitle, #runtimeEvidenceTitle, .analysis-summary button, #findings h2, #fitGraphButton { scroll-margin-top: 100px; }
.agent-handoff-finding { padding: 12px; border-left: 3px solid var(--accent); background: var(--bg-0); color: var(--ink-0) !important; }
.agent-handoff-dialog fieldset { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0 16px; padding: 12px; border: 1px solid var(--line-1); }
.agent-handoff-dialog fieldset label { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px !important; margin: 0 !important; font-family: var(--font-ui) !important; }
.agent-handoff-dialog pre { max-height: min(46dvh, 440px); padding: 14px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line-1); background: var(--bg-0); font: 12px/1.55 var(--font-mono); }
.agent-handoff-actions, .agent-handoff-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
@media (max-width: 760px) {
  .analysis-summary { padding: 16px; }
  .summary-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .summary-heading { margin-bottom: 16px; }
  .summary-links { gap: 8px 12px; }
  .summary-coverage dl { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .summary-coverage dd { margin-bottom: 10px; }
  #analysisSummaryTitle, #runtimeEvidenceTitle, .analysis-summary button, #findings h2, #fitGraphButton { scroll-margin-top: 140px; }
}

/* Comparison is a separate in-memory surface; single-run state stays mounted. */
body[data-investigations="true"] .page-content > :not(#investigationWorkspace),
body[data-investigations="true"] .header-actions { display: none; }
body[data-investigations="true"] .site-header { position: relative; background: var(--bg-0); }
#investigationWorkspace[hidden], #investigationWorkspace [hidden] { display: none; }
#investigationWorkspace { padding-top: 32px; padding-bottom: 60px; overflow-wrap: anywhere; }
#openInvestigations { font: inherit; background: transparent; cursor: pointer; }
#investigationStatus { padding: 12px 16px; background: var(--bg-2); border-left: 3px solid var(--accent); }
#investigationError { padding: 16px; border: 1px solid var(--ink-1); }
#investigationOmissions { display: flex; flex-wrap: wrap; gap: 4px 20px; border: 1px solid var(--line-0); padding: 12px; }
.investigation-record { padding: 12px 0; border-bottom: 1px solid var(--line-0); }
.investigation-record button { margin-right: 12px; }
#investigationHeading { scroll-margin-top: 140px; }
body[data-comparison="true"] .page-content > :not(#comparisonWorkspace),
body[data-comparison="true"] .header-actions { display: none; }
#comparisonWorkspace[hidden], #comparisonWorkspace [hidden] { display: none; }
#comparisonWorkspace { padding-top: 32px; padding-bottom: 60px; overflow-wrap: anywhere; }
#openComparison { font: inherit; background: transparent; cursor: pointer; }
.comparison-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.comparison-heading h1 { margin: 8px 0; font: 500 36px/1.15 var(--font-ui); letter-spacing: -.035em; }
.comparison-workspace p { color: var(--ink-1); line-height: 1.6; font-size: 14px; }
.comparison-workspace h2 { font: 500 23px/1.3 var(--font-ui); margin: 0 0 12px; }
.comparison-workspace h3 { font: 600 16px/1.4 var(--font-ui); }
.comparison-workspace label { display: block; font-size: 13px; margin: 12px 0; }
.comparison-workspace input:not([type="checkbox"]), .comparison-workspace select, .comparison-workspace textarea { display: block; width: 100%; min-width: 0; min-height: 40px; margin-top: 6px; padding: 8px; border: 1px solid var(--line-0); background: var(--bg-0); color: var(--ink-0); font: inherit; }
.comparison-workspace input[type="checkbox"] { width: 16px; height: 16px; vertical-align: middle; }
.comparison-workspace summary { cursor: pointer; min-height: 32px; padding: 8px 0; }
.comparison-workspace button { min-height: 40px; width: auto; flex: 0 0 auto; }
.comparison-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 16px 0; }
.comparison-actions > label { margin: 0; width: auto; padding: 0; border: 0; border-radius: 0; background: transparent; }
.comparison-actions input[type="file"] { max-width: 280px; }
.comparison-link-entry { display: flex; gap: 8px; align-items: center; }
.comparison-link-entry input[type="url"] { margin: 0; flex: 1; }
.comparison-files { margin: 12px 0; color: var(--ink-1); font-size: 13px; }
.comparison-reopen { margin: 12px 0; padding: 8px 20px; border: 1px solid var(--line-0); }
.comparison-export > .section-label { display: block; margin-bottom: 12px; }
.comparison-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.comparison-slot, #comparisonResults > section, #comparisonInspection, .comparison-export { min-width: 0; margin: 20px 0; padding: 24px; border: 1px solid var(--line-0); background: var(--bg-1); }
.comparison-slot:first-child { border-top: 3px solid var(--ink-1); }
.comparison-slot:last-child { border-top: 3px solid var(--accent); }
.comparison-context { padding: 8px 20px; border: 1px solid var(--line-0); }
#comparisonStatus { padding: 12px 16px; background: var(--bg-2); border-left: 3px solid var(--accent); }
#comparisonError { border: 1px solid var(--ink-1); padding: 16px; }
#comparisonResults[data-stale="true"]::before { content: "Previous comparison — not current"; display: block; padding: 12px; font-weight: 600; }
.comparison-verdict-line { font-weight: 600; }
.comparison-table { max-width: 100%; overflow: auto; margin: 16px 0; }
.comparison-table table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.comparison-table th, .comparison-table td { min-width: 130px; max-width: 300px; padding: 12px; border-bottom: 1px solid var(--line-0); vertical-align: top; }
.comparison-table th { background: var(--bg-2); }
.comparison-counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px 12px; }
.comparison-counts dt { grid-row: 1; font-size: 13px; }
.comparison-counts dd { margin: 0; font-size: 25px; font-weight: 500; }
#comparisonResults .text-button { margin-right: 18px; }
.comparison-workspace pre { max-height: 440px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg-0); border: 1px solid var(--line-0); padding: 16px; font: 12px/1.6 var(--font-mono); }
.comparison-evidence-card { padding: 12px 0; border-bottom: 1px solid var(--line-0); }
.comparison-branch-focus { margin: 18px 0; }
.comparison-branch-card, .comparison-claim-card { margin: 10px 0; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--bg-2); }
.comparison-branch-card p, .comparison-claim-card p { margin-bottom: 0; }
#comparisonOmissions { display: flex; flex-wrap: wrap; gap: 4px 20px; border: 1px solid var(--line-0); padding: 12px; }
#comparisonOmissions label { margin: 0; }
#comparisonTitle, #comparisonInspectionTitle { scroll-margin-top: 110px; }
@media (max-width: 760px) {
  .comparison-table table, .comparison-table tbody, .comparison-table tr { display: block; }
  .comparison-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .comparison-table tr { margin-bottom: 20px; border: 1px solid var(--line-0); }
  .comparison-table td { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 12px; min-width: 0; max-width: none; }
  .comparison-table td::before { content: attr(data-label); font-weight: 600; }
  .comparison-heading { flex-direction: column; }
  .comparison-heading h1 { font-size: 30px; }
  .comparison-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .comparison-slot, #comparisonResults > section, #comparisonInspection, .comparison-export { padding: 16px; }
  .comparison-counts { grid-template-columns: minmax(0, 1fr) auto; }
  .comparison-counts dt { grid-row: auto; }
  .comparison-counts dd { font-size: 18px; }
  .comparison-workspace button, .comparison-workspace summary { min-height: 44px; }
  .comparison-actions { align-items: stretch; }
}
