:root {
  --bg: #f4f4f1;
  --sidebar: rgba(255, 255, 255, .92);
  --surface: #ffffff;
  --surface-raised: #f5f5f2;
  --surface-soft: #fafaf8;
  --line: #e3e3df;
  --line-strong: #cdcec8;
  --text: #171816;
  --muted: #62645f;
  --subtle: #71746d;
  --accent: #2457ff;
  --accent-soft: #eef2ff;
  --accent-ink: #1739a8;
  --green: #217052;
  --green-dark: #e4f4ec;
  --cyan: #006dcc;
  --violet: #6b57d9;
  --amber: #a46916;
  --red: #c7434c;
  --focus: #2457ff;
  --topbar: rgba(244, 244, 241, .82);
  --section-bg: rgba(255, 255, 255, .94);
  --input-bg: #ffffff;
  --track-bg: #e8e8e4;
  --result-bg: #ffffff;
  --primary-text: #ffffff;
  --primary-hover: #1747e6;
  --control-hover: #eeeeeb;
  --control-hover-line: #b8bab3;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(18, 20, 17, .03), 0 12px 34px rgba(18, 20, 17, .045);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #121310;
  --sidebar: rgba(18, 19, 16, .94);
  --surface: #1b1d19;
  --surface-raised: #232520;
  --surface-soft: #171915;
  --line: #30322d;
  --line-strong: #444740;
  --text: #f4f4f0;
  --muted: #a7aaa1;
  --subtle: #a0a49a;
  --accent: #7892ff;
  --accent-soft: #252d50;
  --accent-ink: #bac6ff;
  --green: #73e6a7;
  --green-dark: #163c2b;
  --cyan: #6ed8f5;
  --violet: #9887ff;
  --amber: #f6bd62;
  --red: #ff7f88;
  --focus: #8fdcff;
  --topbar: rgba(18, 19, 16, .84);
  --section-bg: rgba(27, 29, 25, .94);
  --input-bg: #151713;
  --track-bg: #10120f;
  --result-bg: #171915;
  --primary-text: #06110c;
  --primary-hover: #9af0bd;
  --control-hover: #1c2432;
  --control-hover-line: #4b5870;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 18px 44px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: light;
  color: var(--text);
  font-family: var(--sans);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

html[data-theme="dark"] { color-scheme: dark; }

body {
  background:
    radial-gradient(circle at 82% -8%, rgba(36, 87, 255, .09), transparent 28rem),
    var(--bg);
  margin: 0;
  min-width: 320px;
}

button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.noscript-notice {
  background: #fff4d8;
  border-bottom: 1px solid #ddc47d;
  color: #573f00;
  font-size: .82rem;
  line-height: 1.6;
  margin: 0;
  padding: .85rem 1rem;
  text-align: center;
}

.skip-link {
  background: var(--text);
  border-radius: 8px;
  color: var(--bg);
  left: 1rem;
  padding: .75rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 200;
}

.skip-link:focus { top: 1rem; }

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  backdrop-filter: blur(24px);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.25rem .9rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: .72rem;
  padding: .4rem .5rem 1.45rem;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--text);
  border-radius: 10px;
  color: var(--surface);
  display: inline-flex;
  font-size: .92rem;
  font-weight: 780;
  height: 2.15rem;
  justify-content: center;
  width: 2.15rem;
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: .94rem; font-weight: 690; letter-spacing: -.025em; }
.brand-copy small { color: var(--subtle); font-family: var(--mono); font-size: .57rem; letter-spacing: .035em; margin-top: .3rem; }

.side-nav { border-top: 1px solid var(--line); padding-top: 1.15rem; }
.nav-label { color: var(--subtle); font-family: var(--mono); font-size: .58rem; font-weight: 650; letter-spacing: .1em; margin: 0 .7rem .65rem; }

.side-nav a {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  display: flex;
  font-size: .81rem;
  font-weight: 590;
  gap: .75rem;
  margin: .22rem 0;
  padding: .7rem .75rem;
  text-decoration: none;
  transition: background-color .16s, border-color .16s, color .16s;
}

.side-nav a span { color: var(--subtle); font-family: var(--mono); font-size: .9rem; width: 1rem; }
.side-nav a:hover { background: var(--surface-raised); color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); border-color: rgba(36, 87, 255, .16); color: var(--accent-ink); }
.side-nav a[aria-current="page"] span { color: var(--accent); }

.sidebar-status {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 13px;
  display: flex;
  gap: .7rem;
  margin-top: auto;
  padding: .85rem;
}

.status-dot { background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px rgba(115, 230, 167, .09); height: .48rem; width: .48rem; }
.sidebar-status div { display: flex; flex-direction: column; }
.sidebar-status strong { font-size: .77rem; }
.sidebar-status span { color: var(--subtle); font-size: .68rem; margin-top: .2rem; }
.sidebar-note { color: var(--subtle); font-size: .66rem; line-height: 1.6; margin: .7rem .5rem 0; }

.workspace { min-width: 0; }

.topbar {
  align-items: center;
  backdrop-filter: blur(16px);
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: .9rem clamp(1.2rem, 3vw, 2.7rem);
  position: sticky;
  top: 0;
  z-index: 15;
}

.breadcrumb { color: var(--subtle); font-family: var(--mono); font-size: .59rem; letter-spacing: .065em; margin: 0 0 .35rem; }
.topbar h1 { font-size: 1.02rem; font-weight: 660; letter-spacing: -.03em; margin: 0; }
.topbar-badges { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: flex-end; }
.topbar-badges > span, .theme-toggle, .phase-chip, .security-badge, .optional-label {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .59rem;
  letter-spacing: .025em;
  padding: .43rem .68rem;
}

.theme-toggle {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  gap: .35rem;
}
.theme-toggle:hover { border-color: var(--line-strong); color: var(--text); }
.theme-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: rgba(36, 87, 255, .26); color: var(--accent-ink); }

.dashboard {
  margin: 0 auto;
  max-width: 1440px;
  padding: clamp(1.2rem, 3vw, 2.65rem);
}

.dashboard-section, .scope-grid {
  scroll-margin-top: 100px;
}

.dashboard-section {
  background: var(--section-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  padding: clamp(1.35rem, 2.7vw, 2.4rem);
}

.section-title-row {
  align-items: flex-start;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin-bottom: 1.7rem;
}

.section-title-row.compact { align-items: center; }
.section-title-row > div { max-width: 780px; }
.section-kicker { color: var(--accent); font-family: var(--mono); font-size: .61rem; font-weight: 680; letter-spacing: .1em; margin: 0 0 .62rem; }

h2, h3, p { text-wrap: pretty; }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.45rem); font-weight: 680; letter-spacing: -.055em; line-height: 1.15; margin: 0; }
.section-title-row p:not(.section-kicker) { color: var(--muted); font-size: .88rem; line-height: 1.78; margin: .75rem 0 0; }
.phase-chip { background: var(--accent-soft); border-color: rgba(36, 87, 255, .18); color: var(--accent-ink); flex: 0 0 auto; }

.overview-grid {
  display: grid;
  gap: .72rem;
  grid-template-columns: 1.45fr 1fr 1fr;
}

.overview-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 205px;
  padding: 1.35rem;
}

.overview-card-primary { background: linear-gradient(135deg, var(--accent-soft), var(--surface-soft) 68%); border-color: rgba(36, 87, 255, .22); }
.card-heading { align-items: center; display: flex; gap: .65rem; }
.card-icon { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; color: var(--accent); display: inline-flex; font-family: var(--mono); height: 2rem; justify-content: center; width: 2rem; }
.card-label { color: var(--muted); font-size: .7rem; font-weight: 700; }
.overview-card h3 { font-size: clamp(1.08rem, 1.7vw, 1.42rem); font-weight: 660; letter-spacing: -.04em; line-height: 1.32; margin: 1.55rem 0 .72rem; }
.overview-card p { color: var(--muted); font-size: .8rem; line-height: 1.65; margin: 0; }
.card-value { display: block; font-size: clamp(1.45rem, 2.3vw, 2.1rem); font-weight: 670; letter-spacing: -.05em; margin: 1.55rem 0 .72rem; }

.scope-grid {
  display: grid;
  gap: .72rem;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  margin-bottom: 1.25rem;
}

.scope-heading, .scope-card {
  background: var(--section-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.45rem;
}

.scope-heading { display: flex; flex-direction: column; justify-content: center; }
.scope-heading h2 { font-size: 1.3rem; font-weight: 660; letter-spacing: -.04em; }
.scope-card { background: var(--surface-soft); }
.scope-card-positive { border-color: rgba(36, 87, 255, .2); }
.scope-index { color: var(--subtle); font-family: var(--mono); font-size: .64rem; }
.scope-card h3 { font-size: .9rem; font-weight: 650; margin: 1.5rem 0 .52rem; }
.scope-card p { color: var(--muted); font-size: .77rem; line-height: 1.65; margin: 0; }

code { background: var(--accent-soft); border-radius: 5px; color: var(--accent-ink); font-family: var(--mono); font-size: .8em; overflow-wrap: anywhere; padding: .14em .32em; }
.security-badge { background: rgba(115, 230, 167, .08); border-color: rgba(115, 230, 167, .22); color: var(--green); white-space: nowrap; }
.security-badge span { font-size: .5rem; }

.connect-layout { display: grid; gap: .72rem; grid-template-columns: minmax(0, 1.7fr) minmax(250px, .8fr); }
.connect-panel, .connection-notes, .relation-section, .result-panel, .limitations-panel {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.connect-panel { padding: clamp(1.2rem, 2.5vw, 2rem); }
.form-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 1.7rem; }
.form-heading > div { align-items: center; display: flex; gap: .7rem; }
.form-heading h3 { font-size: .95rem; font-weight: 650; margin: 0; }
.step-number { align-items: center; background: var(--accent-soft); border: 1px solid rgba(36, 87, 255, .18); border-radius: 8px; color: var(--accent); display: inline-flex; font-family: var(--mono); font-size: .68rem; height: 1.9rem; justify-content: center; width: 1.9rem; }
.optional-label { padding: .32rem .55rem; }
input[type="search"], select {
  background: var(--input-bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  min-height: 2.8rem;
  padding: .65rem .8rem;
  width: 100%;
}

input::placeholder { color: var(--muted); }
.library-status, .scan-limit, .result-note { color: var(--muted); font-size: .74rem; line-height: 1.65; }
.library-status { margin: 1rem 0 0; }

.connection-ready { align-items: flex-start; background: linear-gradient(135deg, var(--accent-soft), var(--surface-soft)); border: 1px solid rgba(36, 87, 255, .16); border-radius: 12px; display: flex; gap: .85rem; margin-bottom: 1.35rem; padding: 1.1rem; }
.ready-icon { align-items: center; background: var(--green-dark); border-radius: 50%; color: var(--green); display: inline-flex; flex: 0 0 auto; font-weight: 850; height: 1.8rem; justify-content: center; width: 1.8rem; }
.connection-ready h4 { font-size: .85rem; margin: .1rem 0 .4rem; }
.connection-ready p { color: var(--muted); font-size: .74rem; line-height: 1.65; margin: 0; }
.connect-actions { display: flex; gap: .7rem; }

.primary-button, .secondary-button, .ghost-button, .reveal-button {
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 650;
  min-height: 2.8rem;
  padding: .65rem 1rem;
  transition: background-color .16s, border-color .16s, color .16s, opacity .16s;
}

.primary-button { background: var(--accent); box-shadow: 0 4px 12px rgba(36, 87, 255, .18); color: var(--primary-text); flex: 1; }
.primary-button:hover:not(:disabled) { background: var(--primary-hover); }
.primary-button:disabled { cursor: not-allowed; opacity: .32; }
.secondary-button, .ghost-button, .reveal-button { background: var(--surface-raised); border-color: var(--line-strong); color: var(--text); }
.secondary-button:hover, .ghost-button:hover, .reveal-button:hover { border-color: var(--control-hover-line); background: var(--control-hover); }

.connection-notes { padding: 1.25rem; }
.connection-notes h3 { font-size: .85rem; font-weight: 650; margin: 0 0 1.2rem; }
.connection-notes dl { margin: 0; }
.connection-notes dl > div { border-top: 1px solid var(--line); display: grid; gap: .8rem; grid-template-columns: 5.5rem 1fr; padding: .85rem 0; }
.connection-notes dt { color: var(--subtle); font-size: .68rem; }
.connection-notes dd { color: var(--muted); font-size: .72rem; line-height: 1.5; margin: 0; }

.scan-section { border-color: rgba(36, 87, 255, .2); }
.scan-heading { align-items: center; display: flex; gap: 1rem; justify-content: space-between; }
.scan-title-group { align-items: center; display: flex; gap: 1rem; }
.live-indicator { background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 7px rgba(36, 87, 255, .08); height: .65rem; width: .65rem; }
.scan-heading h2 { font-size: 1.25rem; }
.scan-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.ghost-button.danger { color: var(--red); }
.ghost-button[hidden] { display: none; }
.progress-track { background: var(--track-bg); border-radius: 999px; height: 6px; margin-top: 1.5rem; overflow: hidden; }
.progress-track span { background: linear-gradient(90deg, var(--accent), var(--violet)); border-radius: inherit; display: block; height: 100%; transform-origin: left; transition: width .3s; width: 8%; }
.progress-track span.running { animation: scan-pulse 1.7s ease-in-out infinite; }
@keyframes scan-pulse { 0% { transform: scaleX(.35); } 60% { transform: scaleX(1); } 100% { transform: translateX(100%); } }
.scan-status { font-size: .92rem; font-weight: 700; margin: 1.15rem 0 .3rem; }
.scan-limit { margin: 0; }

.results-section { padding-bottom: 1.4rem; }
.results-intro { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(280px, 1.2fr); }
.results-intro h2 { font-size: clamp(1.45rem, 2.35vw, 2.15rem); }
.results-intro .result-note { justify-self: end; max-width: 440px; text-align: right; }
.summary-list { display: grid; gap: .65rem; grid-template-columns: repeat(4, 1fr); margin: 0 0 .72rem; }
.summary-list > div { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 13px; padding: 1.1rem; }
.summary-list dt { color: var(--muted); font-size: .68rem; line-height: 1.45; }
.summary-list dd { font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 680; letter-spacing: -.055em; margin: .85rem 0 0; }

.relation-section { margin-bottom: .72rem; overflow: hidden; padding: 1.35rem; }
.relation-heading { align-items: end; display: grid; gap: 2rem; grid-template-columns: 1fr minmax(250px, .75fr); }
.relation-heading h3 { font-size: 1.08rem; font-weight: 650; letter-spacing: -.025em; margin: 0; }
.relation-caption { margin: 0; }
.relation-labels, .relation-row { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.2fr) minmax(130px, .75fr) minmax(0, 1fr); }
.relation-labels { color: var(--subtle); font-size: .63rem; font-weight: 700; margin-top: 1.6rem; padding: 0 .8rem .55rem; }
.relation-map { border-bottom: 1px solid var(--line); }
.relation-row { align-items: stretch; border-top: 1px solid var(--line); min-height: 4.35rem; padding: .7rem .8rem; }
.relation-node { align-items: center; display: flex; min-width: 0; position: relative; }
.relation-node:not(:last-child)::after { background: var(--line-strong); content: ""; height: 1px; left: calc(100% + .35rem); position: absolute; top: 50%; width: .8rem; }
.relation-file { font-size: .78rem; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.relation-exposure { color: var(--amber); font-size: .72rem; line-height: 1.45; }
.relation-audience { color: var(--muted); font-family: var(--mono); font-size: .68rem; line-height: 1.45; overflow-wrap: anywhere; }
.relation-priority { border-radius: 50%; flex: 0 0 auto; height: .5rem; margin-right: .6rem; width: .5rem; }
.relation-priority-critical { background: var(--red); }
.relation-priority-high { background: var(--amber); }
.relation-priority-medium { background: var(--green); }
.relation-priority-info { background: var(--subtle); }

.result-panel { overflow: hidden; }
.result-controls { align-items: end; border-bottom: 1px solid var(--line); display: grid; gap: .7rem; grid-template-columns: minmax(220px, 1.5fr) minmax(130px, .6fr) minmax(140px, .65fr) auto; padding: 1.1rem; }
.result-controls label > span { color: var(--subtle); display: block; font-size: .65rem; font-weight: 700; margin-bottom: .45rem; }
.result-controls input, .result-controls select { font-size: .75rem; }
.reveal-button { min-height: 2.8rem; white-space: nowrap; }
.reveal-button[aria-pressed="true"] { background: var(--accent-soft); border-color: rgba(36, 87, 255, .26); color: var(--accent-ink); }
.visible-count { color: var(--subtle); font-family: var(--mono); font-size: .64rem; margin: 0; padding: .9rem 1rem; }
.result-list { list-style: none; margin: 0; padding: 0 1rem 1rem; }
.result-item { align-items: start; background: var(--result-bg); border: 1px solid var(--line); border-radius: 13px; display: grid; gap: 1rem; grid-template-columns: 2.2rem minmax(0, 1.1fr) minmax(260px, 1fr) auto; margin-top: .65rem; padding: 1.05rem; }
.result-number { color: var(--subtle); font-family: var(--mono); font-size: .64rem; padding-top: .22rem; }
.file-title { font-size: .9rem; line-height: 1.45; margin: 0; overflow-wrap: anywhere; }
.file-meta { color: var(--subtle); font-size: .67rem; line-height: 1.55; margin: .45rem 0 0; }
.finding-list { display: flex; flex-direction: column; gap: .45rem; }
.finding { align-items: baseline; display: grid; gap: .55rem; grid-template-columns: 4.2rem 1fr; }
.priority { font-family: var(--mono); font-size: .59rem; font-weight: 700; letter-spacing: .04em; }
.priority-critical { color: var(--red); }
.priority-high { color: var(--amber); }
.priority-medium { color: var(--green); }
.priority-info { color: var(--subtle); }
.finding-copy { color: var(--muted); font-size: .7rem; line-height: 1.5; overflow-wrap: anywhere; }
.drive-link { align-self: center; color: var(--accent); font-size: .67rem; font-weight: 620; text-decoration: none; white-space: nowrap; }
.drive-link:hover { text-decoration: underline; text-underline-offset: .2em; }
.empty-results { border-top: 1px solid var(--line); color: var(--muted); padding: 2rem 1rem; }

.privacy-section { margin-bottom: 0; }
.policy-grid { display: grid; gap: .75rem; grid-template-columns: repeat(4, 1fr); }
.policy-grid article { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 13px; padding: 1.1rem; }
.policy-icon { align-items: center; background: var(--accent-soft); border: 1px solid rgba(36, 87, 255, .16); border-radius: 9px; color: var(--accent); display: inline-flex; font-family: var(--mono); height: 2rem; justify-content: center; width: 2rem; }
.policy-grid h3 { font-size: .82rem; margin: 1rem 0 .5rem; }
.policy-grid p { color: var(--muted); font-size: .72rem; line-height: 1.65; margin: 0; }
.limitations-panel { display: grid; gap: 2rem; grid-template-columns: minmax(220px, .75fr) 1.25fr; margin-top: .9rem; padding: 1.25rem; }
.limitations-panel h3 { font-size: 1rem; line-height: 1.45; margin: 0; }
.limitations-panel ul { color: var(--muted); font-size: .75rem; line-height: 1.75; margin: 0; padding-left: 1.2rem; }
.limitations-panel li + li { margin-top: .45rem; }

.footer { color: var(--subtle); display: flex; font-family: var(--mono); font-size: .61rem; gap: 1rem; justify-content: space-between; padding: 1.4rem 0 .2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .9rem; }
.footer-links a { color: inherit; text-underline-offset: .25em; }
.footer-links a:hover { color: var(--text); }

.legal-page {
  background:
    radial-gradient(circle at 75% -10%, rgba(36, 87, 255, .1), transparent 30rem),
    var(--bg);
  min-height: 100vh;
}

.legal-shell { margin: 0 auto; max-width: 980px; padding: 0 clamp(1rem, 4vw, 3rem); }
.legal-header { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; min-height: 84px; }
.legal-header .brand { padding: 0; }
.legal-back { color: var(--muted); font-size: .76rem; font-weight: 620; text-decoration: none; }
.legal-back:hover { color: var(--text); }
.legal-main { padding: clamp(3.2rem, 8vw, 6.5rem) 0 2rem; }
.legal-heading { max-width: 760px; }
.legal-heading h1 { font-size: clamp(2.6rem, 7vw, 5.25rem); font-weight: 680; letter-spacing: -.075em; line-height: .98; margin: 0; }
.legal-heading > p:not(.section-kicker) { color: var(--muted); font-size: clamp(.96rem, 2vw, 1.15rem); line-height: 1.8; margin: 1.35rem 0 0; max-width: 680px; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 2.5rem; margin: 2rem 0 0; }
.legal-meta div { display: flex; flex-direction: column; gap: .35rem; }
.legal-meta dt { color: var(--subtle); font-family: var(--mono); font-size: .6rem; letter-spacing: .05em; }
.legal-meta dd { color: var(--muted); font-size: .75rem; margin: 0; }

.draft-notice { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid rgba(36, 87, 255, .2); border-radius: var(--radius); margin: 3rem 0 1rem; padding: 1.35rem 1.5rem; }
.draft-notice strong { font-size: .83rem; }
.draft-notice p { color: var(--muted); font-size: .76rem; line-height: 1.7; margin: .45rem 0 0; }

.legal-section { align-items: start; background: var(--section-bg); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 1.5rem; grid-template-columns: 2.3rem minmax(0, 1fr); margin-top: .75rem; padding: clamp(1.35rem, 3.4vw, 2.2rem); }
.legal-index { color: var(--subtle); font-family: var(--mono); font-size: .62rem; padding-top: .22rem; }
.legal-section h2, .legal-reference h2 { font-size: clamp(1.15rem, 2.4vw, 1.45rem); font-weight: 660; letter-spacing: -.035em; margin: 0 0 1rem; }
.legal-section p, .legal-section li, .legal-reference p { color: var(--muted); font-size: .82rem; line-height: 1.85; }
.legal-section p { margin: 0; }
.legal-section p + p { margin-top: .85rem; }
.legal-section ul { margin: .9rem 0; padding-left: 1.15rem; }
.legal-section li + li { margin-top: .35rem; }
.legal-section a, .legal-reference a { color: var(--accent); text-underline-offset: .25em; }
.legal-steps { color: var(--muted); margin: 0 0 1rem; padding-left: 1.2rem; }
.legal-action { display: inline-block; font-size: .78rem; font-weight: 650; margin: .7rem 0 1rem; }
.legal-placeholder { background: var(--surface-raised); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 1rem; }
.legal-reference { border-left: 2px solid var(--accent); margin: 2rem 0 0; padding: .5rem 0 .5rem 1.5rem; }
.legal-reference p { margin: 0 0 .8rem; max-width: 760px; }
.legal-reference a { font-size: .76rem; font-weight: 650; }
.legal-footer { align-items: center; border-top: 1px solid var(--line); color: var(--subtle); display: flex; font-family: var(--mono); font-size: .61rem; justify-content: space-between; margin-top: 3rem; padding: 1.4rem 0 2rem; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 208px minmax(0, 1fr); }
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .overview-card-primary { grid-column: 1 / -1; }
  .scope-grid { grid-template-columns: repeat(3, 1fr); }
  .scope-heading { grid-column: 1 / -1; }
  .connect-layout { grid-template-columns: 1fr; }
  .connection-notes dl { display: grid; grid-template-columns: 1fr 1fr; }
  .connection-notes dl > div { grid-template-columns: 5rem 1fr; }
  .result-controls { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .result-item { grid-template-columns: 2rem minmax(0, 1fr) auto; }
  .finding-list { grid-column: 2 / -1; }
  .policy-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { border-bottom: 1px solid var(--line); border-right: 0; height: auto; padding: .8rem 1rem; position: static; }
  .brand { padding: .2rem 0 .8rem; }
  .side-nav { display: flex; gap: .3rem; overflow-x: auto; padding-top: .7rem; }
  .nav-label, .sidebar-status, .sidebar-note { display: none; }
  .side-nav a { flex: 0 0 auto; font-size: .75rem; margin: 0; padding: .55rem .7rem; }
  .topbar { position: static; }
  .dashboard-section, .scope-grid { scroll-margin-top: 1rem; }
  .section-title-row { align-items: flex-start; }
  .scope-grid { grid-template-columns: 1fr; }
  .scope-heading { grid-column: auto; }
  .connection-notes dl { display: block; }
  .summary-list { grid-template-columns: 1fr 1fr; }
  .results-intro { grid-template-columns: 1fr; }
  .results-intro .result-note { justify-self: start; max-width: 100%; text-align: left; }
  .relation-heading { grid-template-columns: 1fr; }
  .result-item { grid-template-columns: 2rem minmax(0, 1fr); }
  .finding-list, .drive-link { grid-column: 2; }
  .drive-link { justify-self: start; }
  .limitations-panel { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar { align-items: flex-start; gap: 1rem; padding: .9rem 1rem; }
  .topbar-badges { max-width: 11rem; }
  .dashboard { padding: .8rem; }
  .dashboard-section { padding: 1rem; }
  .section-title-row, .section-title-row.compact { display: block; }
  .phase-chip, .security-badge { display: inline-block; margin-top: .8rem; }
  .overview-grid, .summary-list, .policy-grid { grid-template-columns: 1fr; }
  .overview-card-primary { grid-column: auto; }
  .connect-actions { flex-direction: column; }
  .scan-heading { align-items: flex-start; flex-direction: column; }
  .results-intro .result-note { margin-top: .8rem; text-align: left; }
  .relation-labels { display: none; }
  .relation-map { margin-top: 1rem; }
  .relation-row { gap: .25rem; grid-template-columns: 1fr; padding: .8rem 0; }
  .relation-node { min-height: 2rem; padding-left: 1rem; }
  .relation-node:not(:last-child)::after { height: .5rem; left: .35rem; top: calc(100% - .1rem); width: 1px; }
  .result-controls { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .result-item { gap: .65rem; grid-template-columns: 1.6rem minmax(0, 1fr); padding: .85rem; }
  .finding { grid-template-columns: 3.8rem 1fr; }
  .footer { align-items: flex-start; flex-direction: column; gap: .5rem; }
  .legal-header { min-height: 72px; }
  .legal-header .brand-copy small { display: none; }
  .legal-main { padding-top: 3rem; }
  .legal-section { gap: .7rem; grid-template-columns: 1fr; }
  .legal-index { padding: 0; }
  .legal-footer { align-items: flex-start; flex-direction: column; gap: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
