:root {
  --ink-900: #16191b;
  --ink-800: #252a35;
  --slate-700: #515c6f;
  --slate-600: #687386;
  --slate-500: #8690a0;
  --canvas-050: #f6f7fb;
  --surface-000: #ffffff;
  --surface-100: #eef2f7;
  --line-200: #d6dee8;
  --line-400: #b7c3d1;
  --blue-050: #eef5ff;
  --blue-100: #dceaff;
  --blue-600: #216ff3;
  --blue-750: #1555c7;
  --green-050: #edf9f5;
  --green-700: #087c5b;
  --amber-050: #fff7e8;
  --amber-700: #b96700;
  --red-050: #fff1f2;
  --red-700: #c61046;
  --violet-050: #f5f0ff;
  --violet-650: #6f46c2;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-overlay: 0 20px 55px rgb(22 25 27 / 12%);
  --focus-ring: 0 0 0 3px rgb(33 111 243 / 25%);
  --sidebar-width: 256px;
  --header-height: 68px;
  color: var(--ink-900);
  background: var(--canvas-050);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.5;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--canvas-050); color: var(--ink-900); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue-750); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
h1, h2, h3, p { margin-block-start: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.55rem); line-height: 1.12; letter-spacing: -0.03em; margin-bottom: .75rem; }
h2 { font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.25; letter-spacing: -0.015em; margin-bottom: .35rem; }
h3 { font-size: 1rem; line-height: 1.35; margin-bottom: .4rem; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .9em; }

:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.skip-link {
  position: fixed; z-index: 9999; top: 8px; left: 8px; transform: translateY(-160%);
  background: var(--ink-900); color: white; padding: .7rem 1rem; border-radius: var(--radius-sm); font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }
.eyebrow { margin: 0 0 .35rem; color: var(--blue-750); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.lead { max-width: 72ch; color: var(--slate-700); font-size: 1.05rem; line-height: 1.65; }
.muted { color: var(--slate-600); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.button {
  display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: .5rem; border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: .6rem .95rem; font-weight: 720; text-decoration: none; cursor: pointer; transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.button:hover { text-decoration: none; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-primary { background: var(--blue-600); color: white; border-color: var(--blue-600); }
.button-primary:hover:not(:disabled) { background: var(--blue-750); border-color: var(--blue-750); }
.button-secondary { background: var(--surface-000); color: var(--ink-900); border-color: var(--line-400); }
.button-secondary:hover:not(:disabled) { background: var(--surface-100); border-color: var(--ink-800); }
.button-danger { background: var(--red-700); color: white; border-color: var(--red-700); }
.button-ghost { background: transparent; color: var(--ink-900); border-color: transparent; }
.button-ghost:hover { background: var(--surface-100); }
.button-large { min-height: 50px; padding: .8rem 1.25rem; }
.button-small { min-height: 34px; padding: .38rem .65rem; font-size: .875rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.break-anywhere { overflow-wrap: anywhere; word-break: break-word; }

.status-badge {
  display: inline-flex; align-items: center; gap: .35rem; width: max-content; border: 1px solid var(--line-200); border-radius: 999px;
  padding: .24rem .55rem; background: var(--surface-100); color: var(--ink-800); font-size: .78rem; font-weight: 750; white-space: nowrap;
}
.status-badge::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status-success { color: var(--green-700); background: var(--green-050); border-color: #a9dccb; }
.status-warning { color: var(--amber-700); background: var(--amber-050); border-color: #edcb92; }
.status-error { color: var(--red-700); background: var(--red-050); border-color: #efb9be; }
.status-analysis { color: var(--violet-650); background: var(--violet-050); border-color: #d8c6f5; }
.status-neutral { color: var(--slate-700); background: var(--surface-100); }

.alert { border: 1px solid var(--line-400); border-left-width: 4px; border-radius: var(--radius-md); padding: 1rem 1.15rem; margin-bottom: 1.25rem; background: var(--surface-000); }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert-error { border-color: #e6a7ad; border-left-color: var(--red-700); background: var(--red-050); }
.alert-warning { border-color: #edcb92; border-left-color: var(--amber-700); background: var(--amber-050); }
.alert-success { border-color: #a9dccb; border-left-color: var(--green-700); background: var(--green-050); }
.alert-info { border-color: #aebfe3; border-left-color: var(--blue-600); background: var(--blue-050); }
.correlation-note { color: var(--slate-700); font-size: .875rem; }

.field { display: grid; gap: .38rem; min-width: 0; font-weight: 680; }
.field > span { font-size: .9rem; }
.field em { color: var(--slate-600); font-size: .78rem; font-style: normal; font-weight: 500; }
.field small { color: var(--slate-600); font-weight: 450; line-height: 1.45; }
.field input, .field select, .field textarea, .search-input {
  width: 100%; min-height: 44px; border: 1px solid var(--line-400); border-radius: var(--radius-sm); background: var(--surface-000); padding: .64rem .75rem;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--slate-700); }
.field input:focus, .field select:focus, .field textarea:focus, .search-input:focus { border-color: var(--blue-600); outline: none; box-shadow: var(--focus-ring); }
.field input:invalid:not(:placeholder-shown) { border-color: var(--red-700); }
.check-field { display: flex; gap: .65rem; align-items: flex-start; color: var(--ink-800); font-weight: 580; }
.check-field input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: var(--blue-600); }
.form-grid { display: grid; gap: 1rem; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-span { grid-column: 1 / -1; }

/* Installer */
.install-body { padding: 0 1.25rem 4rem; }
.install-header { display: flex; align-items: center; gap: .8rem; max-width: 1180px; margin: 0 auto; min-height: 76px; border-bottom: 1px solid var(--line-200); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: white; background: var(--ink-900); font-weight: 850; }
.brand-logo-frame { display: grid; flex: 0 0 auto; width: 52px; height: 52px; place-items: center; overflow: hidden; border: 1px solid rgb(255 255 255 / 28%); border-radius: 15px; background: #fff; box-shadow: 0 10px 30px rgb(0 0 0 / 16%); }
.brand-logo-frame img { width: 100%; height: 100%; object-fit: cover; }
.brand-logo-frame-small { width: 40px; height: 40px; border-radius: 11px; border-color: var(--line-200); box-shadow: 0 5px 16px rgb(22 25 27 / 10%); }
.install-header p { margin: 0; }
.brand-subtitle { color: var(--slate-600); font-size: .84rem; }
.install-shell { width: min(1180px, 100%); margin: 0 auto; }
.install-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; padding: clamp(2rem, 5vw, 4.75rem) 0 1.8rem; }
.install-intro h1 { max-width: 16ch; }
.install-trust { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.install-trust span { border: 1px solid var(--line-200); border-radius: 999px; background: var(--surface-000); padding: .35rem .65rem; color: var(--slate-700); font-size: .8rem; font-weight: 650; }
.install-panel { border: 1px solid var(--line-200); border-radius: var(--radius-lg); background: var(--surface-000); padding: clamp(1.1rem, 2.8vw, 2rem); margin-bottom: 1rem; }
.section-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .85rem; align-items: start; margin-bottom: 1.35rem; }
.section-heading h2 { margin: 0; }
.section-heading p { margin: .15rem 0 0; color: var(--slate-600); }
.step-number { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line-400); border-radius: 50%; color: var(--blue-750); font-size: .84rem; font-weight: 800; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.check-item { display: flex; gap: .6rem; min-width: 0; align-items: flex-start; border: 1px solid var(--line-200); border-radius: var(--radius-sm); padding: .7rem; background: var(--canvas-050); }
.check-item span:last-child { min-width: 0; }
.check-item strong, .check-item small { display: block; overflow-wrap: anywhere; }
.check-item strong { font-size: .84rem; }
.check-item small { color: var(--slate-600); font-size: .74rem; }
.check-icon { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; font-size: .75rem; font-weight: 850; }
.is-ok .check-icon { color: white; background: var(--green-700); }
.is-warning .check-icon { color: white; background: var(--amber-700); }
.is-error .check-icon { color: white; background: var(--red-700); }
.database-count-field { max-width: 28rem; margin-bottom: 1.25rem; }
.database-stack { display: grid; gap: .85rem; }
.database-card { min-inline-size: 0; margin: 0; border: 1px solid var(--line-200); border-radius: var(--radius-md); padding: 1rem; background: var(--canvas-050); }
.database-card legend { display: flex; gap: .65rem; align-items: baseline; padding: 0 .4rem; font-weight: 800; }
.database-card legend small { color: var(--slate-600); font-size: .75rem; font-weight: 550; }
.db-grid { grid-template-columns: minmax(9rem, 1.2fr) minmax(6rem, .45fr) minmax(9rem, 1fr) minmax(9rem, 1fr); }
.db-grid .check-field { grid-column: 1 / -1; }
.install-submit { display: flex; justify-content: space-between; gap: 2rem; align-items: center; border-top: 1px solid var(--line-400); padding: 1.5rem .25rem; }
.install-submit p { max-width: 72ch; margin: .25rem 0 0; color: var(--slate-600); }
.success-panel { max-width: 900px; margin: clamp(2rem, 8vw, 6rem) auto; border: 1px solid var(--line-200); border-radius: var(--radius-lg); background: var(--surface-000); padding: clamp(1.5rem, 5vw, 3.5rem); }
.success-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 1rem; border-radius: 50%; color: white; background: var(--green-700); font-size: 1.5rem; font-weight: 850; }
.success-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line-200); border-radius: var(--radius-md); overflow: hidden; margin: 1.5rem 0; }
.success-grid div { display: grid; gap: .15rem; min-width: 0; padding: .85rem 1rem; border-right: 1px solid var(--line-200); border-bottom: 1px solid var(--line-200); }
.success-grid div:nth-child(2n) { border-right: 0; }
.success-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.success-grid span { color: var(--slate-600); font-size: .78rem; }
.success-grid strong { overflow-wrap: anywhere; }
.secret-callout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem 1rem; border: 1px solid #edcb92; border-left: 4px solid var(--amber-700); border-radius: var(--radius-md); background: var(--amber-050); padding: 1rem; }
.secret-callout p { margin: .2rem 0 0; color: var(--slate-700); }
.secret-value { grid-column: 1 / -1; display: block; max-width: 100%; overflow-wrap: anywhere; border: 1px solid var(--line-400); border-radius: var(--radius-sm); background: white; padding: .75rem; }
.success-actions { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.5rem; }
.success-actions p { margin: 0; color: var(--slate-600); }

/* Authentication */
.auth-body { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.05fr) minmax(24rem, .95fr); background: white; }
.auth-brand { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(2rem, 6vw, 5rem); color: white; background: var(--ink-900); }
.auth-brand::after { content: ""; position: absolute; right: -18%; bottom: -15%; width: 65%; aspect-ratio: 1; border: 1px solid rgb(255 255 255 / 14%); border-radius: 50%; box-shadow: 0 0 0 70px rgb(255 255 255 / 3%), 0 0 0 140px rgb(255 255 255 / 2%); }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .eyebrow { color: #aac5ff; }
.auth-brand h1 { max-width: 12ch; font-size: clamp(2.2rem, 5vw, 4.2rem); }
.auth-brand p { max-width: 52ch; color: #dbe7f6; }
.auth-proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: 2rem; }
.auth-proof div { border-top: 1px solid rgb(255 255 255 / 28%); padding-top: .75rem; }
.auth-proof strong, .auth-proof span { display: block; }
.auth-proof strong { font-size: 1.3rem; }
.auth-proof span { color: #bdcce0; font-size: .78rem; }
.auth-main { display: grid; place-items: center; min-height: 100vh; padding: 2rem; }
.auth-card { width: min(440px, 100%); }
.auth-card.legal-card { width: min(900px, 100%); }
.legal-document { max-height: 65vh; overflow: auto; border: 1px solid var(--line-200); border-radius: var(--radius-md); background: var(--canvas-050); padding: 1rem; white-space: normal; }
.auth-card .field { margin-bottom: 1rem; }
.auth-card .button-primary { width: 100%; margin-top: .4rem; }
.auth-meta { display: flex; justify-content: space-between; gap: 1rem; margin: .25rem 0 1rem; font-size: .875rem; }
.auth-footer { margin-top: 1.5rem; color: var(--slate-600); font-size: .82rem; }

/* Application shell */
.app-body { background: var(--canvas-050); }
.app-shell { display: grid; min-height: 100vh; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: var(--header-height) minmax(0, 1fr); }
.app-sidebar { grid-row: 1 / -1; border-right: 1px solid var(--line-200); background: var(--surface-000); padding: 1rem .75rem; }
.sidebar-brand { display: flex; align-items: center; gap: .65rem; min-height: 44px; padding: 0 .55rem 1rem; border-bottom: 1px solid var(--line-200); text-decoration: none; color: var(--ink-900); }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand small { color: var(--slate-600); font-size: .68rem; }
.app-nav { display: grid; gap: .2rem; margin-top: 1rem; }
.nav-section { margin: 1.2rem .65rem .35rem; color: var(--slate-600); font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.app-nav a { display: flex; min-height: 40px; align-items: center; gap: .65rem; border-radius: var(--radius-sm); padding: .55rem .65rem; color: var(--ink-800); font-size: .9rem; font-weight: 620; text-decoration: none; }
.app-nav a:hover { background: var(--surface-100); }
.app-nav a[aria-current="page"] { background: var(--blue-050); color: var(--blue-750); font-weight: 760; }
.nav-icon { display: grid; place-items: center; width: 1.25rem; color: currentColor; }
.app-header { grid-column: 2; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line-200); background: rgb(255 255 255 / 96%); padding: 0 1.25rem; }
.context-picker { min-width: 0; }
.context-picker strong, .context-picker span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-picker span { color: var(--slate-600); font-size: .72rem; }
.header-search { flex: 1; max-width: 580px; margin-inline: auto; }
.search-input { min-height: 40px; background: var(--canvas-050); }
.header-actions { display: flex; align-items: center; gap: .35rem; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; cursor: pointer; }
.icon-button:hover { border-color: var(--line-200); background: var(--surface-100); }
.notification-link { position: relative; color: var(--ink-900); text-decoration: none; }
.notification-count { position: absolute; top: 1px; right: 0; display: grid; min-width: 17px; height: 17px; place-items: center; border-radius: 999px; background: var(--red-700); color: white; padding: 0 4px; font-size: .62rem; font-weight: 800; }
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .35rem .5rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-900); }
.user-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink-900); color: white; font-size: .72rem; font-weight: 800; }
.app-main { grid-column: 2; min-width: 0; padding: clamp(1rem, 2.5vw, 2rem); }
.page-container { width: min(1440px, 100%); margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; margin-bottom: 1.25rem; }
.page-heading h1 { font-size: clamp(1.55rem, 2.5vw, 2.15rem); margin-bottom: .3rem; }
.page-heading p { margin: 0; color: var(--slate-600); }
.page-actions { display: flex; gap: .55rem; flex-wrap: wrap; justify-content: flex-end; }
.context-strip { display: flex; flex-wrap: wrap; gap: .55rem 1rem; border: 1px solid var(--line-200); border-radius: var(--radius-sm); background: var(--surface-000); padding: .65rem .8rem; margin-bottom: 1rem; font-size: .82rem; }
.context-strip span { color: var(--slate-600); }
.context-strip strong { color: var(--ink-900); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-bottom: .85rem; }
.metric-card, .panel { border: 1px solid var(--line-200); border-radius: var(--radius-md); background: var(--surface-000); }
.metric-card { min-width: 0; padding: 1rem; }
.metric-label { display: flex; justify-content: space-between; gap: .6rem; color: var(--slate-600); font-size: .8rem; }
.metric-value { display: flex; align-items: baseline; gap: .5rem; margin: .45rem 0 .2rem; }
.metric-value strong { font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1; letter-spacing: -.03em; }
.metric-value span { color: var(--slate-600); font-size: .8rem; }
.metric-meta { color: var(--slate-600); font-size: .72rem; }
.metric-delta { font-size: .75rem; font-weight: 750; }
.delta-positive { color: var(--green-700); }
.delta-negative { color: var(--red-700); }
.panel { min-width: 0; padding: 1rem; }
.panel-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding-bottom: .8rem; border-bottom: 1px solid var(--line-200); }
.panel-header h2 { font-size: 1rem; margin: 0; }
.panel-header p { margin: .1rem 0 0; color: var(--slate-600); font-size: .8rem; }
.panel-body { padding-top: 1rem; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: .85rem; }
.stack { display: grid; gap: .85rem; }

.status-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; border: 1px solid var(--line-200); border-left: 4px solid var(--blue-600); border-radius: var(--radius-md); background: var(--surface-000); padding: .9rem 1rem; margin-bottom: .85rem; }
.status-strip-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--blue-750); background: var(--blue-050); font-weight: 850; }
.status-strip p { margin: .1rem 0 0; color: var(--slate-600); font-size: .8rem; }
.progress { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-100); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--blue-600); }

.data-table-wrap { overflow-x: auto; border: 1px solid var(--line-200); border-radius: var(--radius-md); background: var(--surface-000); }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th, .data-table td { padding: .75rem .8rem; border-bottom: 1px solid var(--line-200); text-align: left; vertical-align: middle; }
.data-table th { color: var(--slate-700); background: var(--canvas-050); font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafbfd; }
.table-actions { display: flex; justify-content: flex-end; gap: .3rem; }
.table-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: .75rem; }
.table-toolbar .field { min-width: 160px; }

.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: .7rem; padding-bottom: 1rem; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 1px; background: var(--line-400); }
.timeline-marker { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-400); border-radius: 50%; background: white; font-size: .7rem; font-weight: 800; }
.timeline-item.is-complete .timeline-marker { color: white; border-color: var(--green-700); background: var(--green-700); }
.timeline-item.is-active .timeline-marker { color: white; border-color: var(--blue-600); background: var(--blue-600); box-shadow: 0 0 0 4px var(--blue-100); }
.timeline-content { padding-top: .15rem; }
.timeline-content p { margin: .15rem 0 0; color: var(--slate-600); font-size: .78rem; }

.empty-state { display: grid; place-items: center; min-height: 240px; padding: 2rem; text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: .8rem; border-radius: 50%; background: var(--surface-100); color: var(--slate-700); }
.empty-state p { max-width: 48ch; color: var(--slate-600); }
.pagination { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-top: .75rem; color: var(--slate-600); font-size: .8rem; }

.chart { min-height: 230px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: var(--line-200); stroke-width: 1; }
.chart-series-blue { fill: none; stroke: var(--blue-600); stroke-width: 2.5; }
.chart-series-violet { fill: none; stroke: var(--violet-650); stroke-width: 2.5; }
.chart-point { fill: white; stroke-width: 2; }
.chart-table { margin-top: 1rem; }

.diff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line-200); border-radius: var(--radius-md); overflow: hidden; }
.diff-pane { min-width: 0; background: var(--surface-000); }
.diff-pane + .diff-pane { border-left: 1px solid var(--line-200); }
.diff-label { padding: .6rem .75rem; border-bottom: 1px solid var(--line-200); color: var(--slate-700); background: var(--canvas-050); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.diff-content { padding: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-before del { background: var(--red-050); color: var(--red-700); text-decoration: none; }
.diff-after ins { background: var(--green-050); color: var(--green-700); text-decoration: none; }

.mobile-nav-button { display: none; }
.sidebar-close { display: none; }
.mobile-card-list { display: none; }

@media (max-width: 1050px) {
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
}

@media (max-width: 780px) {
  .install-body { padding-inline: .8rem; }
  .install-intro, .install-submit, .success-actions { align-items: stretch; flex-direction: column; }
  .install-trust { justify-content: flex-start; }
  .check-grid, .two-columns, .db-grid, .success-grid { grid-template-columns: 1fr; }
  .success-grid div, .success-grid div:nth-child(2n), .success-grid div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line-200); }
  .success-grid div:last-child { border-bottom: 0; }
  .section-heading { grid-template-columns: auto minmax(0, 1fr); }
  .section-heading .status-badge { grid-column: 2; }
  .auth-body { grid-template-columns: 1fr; }
  .auth-brand { min-height: auto; padding: 2rem 1.25rem; }
  .auth-brand h1 { font-size: 2.2rem; }
  .auth-proof { display: none; }
  .auth-main { min-height: auto; padding: 2.5rem 1.25rem; }
  .app-shell { display: block; padding-top: var(--header-height); }
  .app-sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(285px, 88vw); transform: translateX(-102%); box-shadow: var(--shadow-overlay); transition: transform .18s ease; }
  .app-sidebar[data-open="true"] { transform: translateX(0); }
  .sidebar-close { display: grid; position: absolute; top: .9rem; right: .75rem; }
  .sidebar-brand { padding-right: 2.7rem; }
  body.nav-open { overflow: hidden; }
  .app-header { position: fixed; z-index: 40; inset: 0 0 auto; min-height: var(--header-height); padding-inline: .75rem; }
  .mobile-nav-button { display: grid; }
  .header-search { display: none; }
  .user-chip span:not(.user-avatar) { display: none; }
  .app-main { padding: 1rem; }
  .page-heading { flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .diff-grid { grid-template-columns: 1fr; }
  .diff-pane + .diff-pane { border-left: 0; border-top: 1px solid var(--line-200); }
}

@media (max-width: 520px) {
  .install-header { min-height: 66px; }
  .install-panel, .success-panel { border-radius: var(--radius-md); padding: 1rem; }
  .database-card { padding: .75rem; }
  .database-card legend { align-items: flex-start; flex-direction: column; gap: 0; }
  .metric-grid { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: auto minmax(0, 1fr); }
  .status-strip .button { grid-column: 1 / -1; }
  .auth-proof { grid-template-columns: 1fr; }
}

@media print {
  .app-sidebar, .app-header, .page-actions, .button, .skip-link { display: none !important; }
  .app-shell, .app-main { display: block; padding: 0; }
  body { background: white; }
  .panel, .metric-card, .data-table-wrap { break-inside: avoid; box-shadow: none; }
}
