@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;450;500;550;600;650;700&family=Lora:ital,wght@0,400;0,500;1,400;1,500&display=swap');

/* Two deliberate palettes. All fills are solid; semantic colors are for outcomes. */
:root {
  color-scheme: dark;
  --page: #0a0a0b; --surface: #111113; --raised: #19191c; --sidebar: #101012;
  --hover: #1d1d21; --selected: #202025; --line: #2b2b30; --strong-line: #45454d;
  --ink: #ededf0; --muted: #a1a1aa; --faint: #8e8e98;
  --accent: #adbef6; --primary: #ededf0; --primary-ink: #111113; --primary-hover: #d6d6dc;
  --green: #83cf9b; --green-bg: #14251b; --amber: #e1b976; --amber-bg: #2c2316;
  --red: #e7a09a; --red-bg: #2c1b1b; --blue: #acbaea; --blue-bg: #1d2233;
  --heading: 'Geist', system-ui, sans-serif; --heading-weight: 550;
  --sans: 'Geist', system-ui, -apple-system, sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --radius: 7px; --overlay: #000000b3;
  font-family: var(--sans); font-size: 14px; font-synthesis: none;
  background: var(--page); color: var(--ink);
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f8f6f0; --surface: #fdfbf6; --raised: #f1eee6; --sidebar: #f0ede5;
  --hover: #eae6dc; --selected: #e9e3d7; --line: #ddd8cd; --strong-line: #b5ac9d;
  --ink: #302e2a; --muted: #706b62; --faint: #6f695f;
  --accent: #a2533a; --primary: #9d4e35; --primary-ink: #fffaf5; --primary-hover: #87422e;
  --green: #456848; --green-bg: #e9eee2; --amber: #805922; --amber-bg: #f4ead7;
  --red: #9d4c44; --red-bg: #f5e7e0; --blue: #62567e; --blue-bg: #eeebf2;
  --heading: 'Lora', Georgia, serif; --heading-weight: 400; --overlay: #29262066;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-family: var(--heading); font-size: 32px; font-weight: var(--heading-weight); letter-spacing: -1px; line-height: 1.25; }
h2 { font-size: 17px; font-weight: 550; letter-spacing: -.3px; }
h3 { font-size: 14px; font-weight: 550; }
small { font-size: 12px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono, code { font-family: var(--mono); }
.spacer { margin-top: 20px; }

/* Shell */
.workspace { display: flex; min-height: 100vh; }
.sidebar { width: 218px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 26px 16px 0; background: var(--sidebar); border-right: 1px solid var(--line); z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 600 24px var(--sans); letter-spacing: -1px; color: var(--ink); margin: 0 10px 35px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 32px; color: var(--ink); }
.brand-mark svg { width: 31px; height: 31px; stroke-width: 2; }
.brand-period { display: none; }
.workspace-switch { display: flex; align-items: center; gap: 10px; padding: 11px 10px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; min-width: 0; }
.workspace-switch>span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.workspace-switch small { display: block; color: var(--faint); font-size: 11px; margin-top: 3px; }
.workspace-avatar, .profile-avatar { display: grid; place-items: center; width: 27px; height: 27px; flex-shrink: 0; border: 1px solid var(--strong-line); border-radius: 5px; font: 11px var(--mono); color: var(--muted); }
.chevron { margin-left: auto; color: var(--faint); }
.nav-caption { font: 10px var(--mono); letter-spacing: 1.2px; color: var(--faint); margin: 29px 11px 10px; }
.nav-link { display: flex; gap: 11px; align-items: center; padding: 10px 11px; margin: 3px 0; color: var(--muted); font-size: 13px; border-radius: 5px; line-height: 1.5; }
.nav-link>span:first-child { display: flex; }
.nav-link.active { color: var(--ink); background: var(--selected); }
.nav-link:hover { color: var(--ink); background: var(--hover); }
.nav-link svg { width: 16px; height: 16px; }
.nav-button { width: 100%; text-align: left; border: 0; background: none; }
.nav-count { margin-left: auto; padding: 0 5px; color: var(--faint); font: 11px var(--mono); }
.sidebar-bottom { margin-top: auto; padding-top: 36px; }
.sandbox-note { display: none; }
.profile { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 20px 6px; font-size: 12px; }
.profile small { display: block; margin-top: 3px; color: var(--faint); font-size: 11px; }
.profile-link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.main-column { width: calc(100% - 218px); margin-left: 218px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; height: 65px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); font-size: 12px; background: var(--page); }
.breadcrumb { color: var(--faint); white-space: nowrap; }
.breadcrumb span { margin: 0 12px; color: var(--strong-line); }
.breadcrumb strong { color: var(--muted); font-weight: 400; }
.topbar-right { display: flex; align-items: center; gap: 14px; padding-right: 97px; }
.environment { padding: 3px 7px; border: 1px solid var(--line); color: var(--muted); border-radius: 4px; font: 10px var(--mono); }
.local-label { color: var(--faint); font-size: 11px; }
.mobile-account { display: none !important; }
.theme-toggle { position: fixed; top: 16px; right: 27px; height: 32px; display: flex; gap: 7px; align-items: center; justify-content: center; padding: 0 9px; z-index: 12; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font-size: 12px; }
.theme-toggle:hover { background: var(--hover); color: var(--ink); }
.theme-toggle svg { width: 14px; height: 14px; }
main { padding: 42px 34px 30px; max-width: 1390px; width: 100%; margin: 0 auto; flex: 1; outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-heading p { margin-top: 10px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font: 10px/1.5 var(--mono); color: var(--faint); letter-spacing: .6px; }
.page-kicker { margin-bottom: 12px; font-size: 10px; letter-spacing: 1.3px; }
footer { padding: 16px 34px 24px; display: flex; gap: 15px; align-items: center; justify-content: space-between; font: 10px/1.6 var(--mono); color: var(--faint); }
.skip-link { position: fixed; left: 15px; top: -150px; padding: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); z-index: 99; }
.skip-link:focus { top: 10px; }

/* Controls */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 13px; min-height: 36px; border: 1px solid var(--strong-line); border-radius: 5px; color: var(--ink); background: var(--surface); font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.button:hover:not(:disabled) { background: var(--hover); }
.button svg { width: 15px; height: 15px; }
.button.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.button.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.button.small { min-height: 30px; padding: 6px 10px; font-size: 11px; }
.button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.button.danger { color: var(--red); border-color: var(--red); }
.button-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.subtle-link { display: inline-block; font: inherit; font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--strong-line); background: none; border: 0; padding: 0; line-height: 1.6; }
.subtle-link:hover { color: var(--ink); text-decoration-color: currentColor; }
.field { display: block; margin-bottom: 19px; font-size: 12px; font-weight: 500; }
.field input, .field select, .field textarea { display: block; width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--strong-line); border-radius: 5px; color: var(--ink); background: var(--page); line-height: 1.5; font-size: 14px; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); opacity: 1; }
.field textarea { font: 12px/1.7 var(--mono); min-height: 150px; resize: vertical; }
.field small { display: block; color: var(--muted); font-weight: 400; line-height: 1.7; margin-top: 7px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0; font-size: 13px; line-height: 1.6; }
.check-row input { accent-color: var(--accent); margin-top: 4px; }
.check-row small { display: block; color: var(--muted); }
.error-text { color: var(--red); font-size: 12px; line-height: 1.7; margin-top: 10px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 4px; font-size: 10px; font-weight: 450; white-space: nowrap; line-height: 1.5; background: var(--raised); color: var(--muted); }
.status:before { content: ''; height: 4px; width: 4px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status.attention, .status.conflict { color: var(--amber); background: var(--amber-bg); }
.status.recovered, .status.safe, .status.completed { color: var(--green); background: var(--green-bg); }
.status.partial { color: var(--blue); background: var(--blue-bg); }
.status.failed { color: var(--red); background: var(--red-bg); }
.status.irreversible, .status.manual, .status.blocked, .status.pending { color: var(--muted); background: var(--raised); }

/* Operation workspace */
.history-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.history-filters .field { margin: 0; min-width: 170px; }
.history-filters .history-search { flex: 1; min-width: 240px; }
.history-filters .button { min-height: 43px; }
.history-result { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; line-height: 1.6; margin: 16px 0 22px; }
.history-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.stat { padding: 23px 25px; display: flex; align-items: center; min-width: 0; }
.stat:first-child { padding-left: 0; }
.stat+.stat { border-left: 1px solid var(--line); }
.stat-icon { display: none; }
.stat-title { font-size: 12px; color: var(--muted); margin-bottom: 11px; }
.stat-value { display: flex; align-items: baseline; gap: 11px; font-size: 26px; font-weight: 450; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 11px; font-weight: 400; color: var(--faint); letter-spacing: 0; }
.content-grid { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: 22px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-header { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-header h2 { font-size: 12px; font-weight: 500; }
.tiny-label { color: var(--faint); font: 9px var(--mono); letter-spacing: .7px; text-transform: uppercase; }
.operation-list { padding: 0; max-height: 700px; overflow-y: auto; }
.operation-card { display: block; width: 100%; text-align: left; padding: 18px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); border-left: 2px solid transparent; }
.operation-card:last-child { border-bottom: 0; }
.operation-card:hover { background: var(--hover); }
.operation-card.selected { background: var(--selected); border-left-color: var(--accent); }
.operation-top { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 11px; }
.operation-top .eyebrow { margin: 0; font-size: 9px; }
.operation-title { display: block; font-size: 13px; font-weight: 500; line-height: 1.6; }
.operation-meta { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.operation-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--faint); font-size: 10px; margin-top: 17px; }
.app-icons { display: flex; gap: 4px; }
.app-icon { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--strong-line); border-radius: 4px; color: var(--muted); font: 9px var(--mono); }
.list-tip { font-size: 11px; color: var(--faint); line-height: 1.8; padding: 17px 18px; border-top: 1px solid var(--line); }
.detail-heading { padding: 25px 25px 20px; }
.detail-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.detail-title h2 { font-size: 20px; font-weight: 500; letter-spacing: -.5px; }
.detail-heading p { font-size: 12px; line-height: 1.7; color: var(--muted); margin-top: 9px; }
.detail-submeta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--faint); font-size: 11px; margin-top: 16px; }
.detail-submeta span { display: flex; align-items: center; gap: 6px; }
.detail-submeta svg { width: 13px; height: 13px; }
.notice { display: flex; gap: 10px; padding: 12px 14px; margin: 0 25px 23px; background: var(--amber-bg); color: var(--amber); border: 1px solid transparent; border-radius: 4px; font-size: 12px; line-height: 1.7; }
.notice svg { width: 15px; height: 15px; margin-top: 3px; }
.notice.green { background: var(--green-bg); color: var(--green); }
.notice.neutral { background: var(--raised); color: var(--muted); }
.section-tabs { display: flex; gap: 24px; padding: 0 25px; border-bottom: 1px solid var(--line); }
.section-tab { position: relative; padding: 0 0 13px; font-size: 12px; color: var(--muted); border: 0; background: none; }
.section-tab.active { color: var(--ink); }
.section-tab.active:after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.section-tab span { font: 10px var(--mono); padding: 2px 4px; margin-left: 4px; color: var(--faint); }
.steps { padding: 2px 25px 0; }
.step { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 13px; padding: 23px 0; }
.step:not(:last-child):before { content: ''; position: absolute; left: 12px; top: 50px; bottom: -19px; width: 1px; background: var(--line); }
.step-number { display: grid; place-items: center; height: 25px; width: 25px; border: 1px solid var(--line); border-radius: 50%; font: 10px var(--mono); color: var(--faint); background: var(--surface); z-index: 1; }
.step-number.done { color: var(--green); border-color: var(--green); }
.step-number svg { width: 13px; height: 13px; }
.step-content { min-width: 0; }
.step-title { display: flex; gap: 12px; justify-content: space-between; align-items: center; min-height: 25px; }
.step-title h3 { font-size: 13px; }
.step-context { color: var(--faint); font: 10px/1.7 var(--mono); margin-top: 5px; }
.diff { display: grid; grid-template-columns: 1fr 24px 1fr; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; background: var(--page); border: 1px solid var(--line); border-radius: 4px; font: 12px var(--mono); }
.diff-label { display: block; color: var(--faint); font: 10px var(--sans); margin-bottom: 7px; }
.diff-value { overflow-wrap: anywhere; line-height: 1.6; }
.diff-before { color: var(--muted); }
.diff-after { color: var(--ink); }
.diff .arrow { color: var(--faint); }
.step-note { color: var(--amber); font-size: 11px; line-height: 1.7; margin-top: 10px; }
.step-note.muted { color: var(--muted); }
.conflict-action { margin-top: 9px; }
.detail-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 25px; border-top: 1px solid var(--line); }
.detail-footer p { font-size: 11px; line-height: 1.7; color: var(--faint); }
.detail-footer strong { color: var(--muted); font-weight: 500; }
.support-strip { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 11px; line-height: 1.7; margin-top: 20px; }
.support-strip svg { width: 14px; height: 14px; }
.activity { padding: 16px 25px 23px; }
.activity h3 { margin-bottom: 3px; }
.activity-entry { display: flex; gap: 15px; padding: 15px 0; font-size: 12px; line-height: 1.7; border-bottom: 1px solid var(--line); }
.activity-entry time { min-width: 85px; color: var(--faint); font: 10px/1.8 var(--mono); }
.activity-entry p { color: var(--muted); }
.timeline-footnote { margin-top: 20px; font-size: 10px; color: var(--faint); }

/* Records, guides, and setup */
.record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.record-card { padding: 24px; }
.record-card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.record-card-header h2 { font-size: 16px; }
.record-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.record-table td { border-top: 1px solid var(--line); padding: 12px 0; vertical-align: top; overflow-wrap: anywhere; }
.record-table td:first-child { width: 42%; font: 10px/1.8 var(--mono); color: var(--faint); padding-right: 10px; }
.record-meta { font-size: 10px; line-height: 1.8; color: var(--faint); margin-top: 18px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.guide-card { padding: 26px; }
.guide-card>svg { height: 25px; width: 25px; margin-bottom: 24px; color: var(--accent); }
.guide-card h2 { font-size: 17px; margin-bottom: 12px; }
.guide-card p, .guide-bottom p { color: var(--muted); font-size: 13px; line-height: 1.9; max-width: 740px; }
.guide-bottom { margin-top: 24px; padding: 25px; }
.guide-bottom h2 { margin-bottom: 12px; }
.guide-bottom code { font-size: 11px; overflow-wrap: anywhere; }
.code-block { padding: 20px; margin: 20px 0 0; background: var(--page); border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font: 12px/1.9 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; }
.no-top { margin-top: 0; }
.integration-layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(270px, 1fr); gap: 32px; align-items: start; }
.integration-layout>div>.panel { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 0 0 28px; margin-top: 30px; }
.integration-layout>div>.panel:first-child { margin-top: 0; }
.integration-layout aside .panel { padding: 22px; }
.connection-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 38px; background: var(--surface); }
.connection-step { display: flex; flex-direction: column; min-width: 0; padding: 21px; }
.connection-step+.connection-step { border-left: 1px solid var(--line); }
.connection-number { color: var(--faint); font: 11px var(--mono); margin-bottom: 18px; }
.connection-step.complete .connection-number { color: var(--green); }
.connection-step h2 { font-size: 13px; font-weight: 500; letter-spacing: -.1px; line-height: 1.6; }
.connection-step p { color: var(--muted); font-size: 11px; line-height: 1.8; margin: 8px 0 16px; }
.connection-step .subtle-link { margin-top: auto; font-size: 11px; text-align: left; }
.endpoint { display: flex; align-items: flex-start; gap: 12px; padding: 13px; margin-top: 20px; background: var(--raised); border: 1px solid var(--line); border-radius: 5px; font: 11px/1.8 var(--mono); }
.endpoint b { font-weight: 400; color: var(--accent); }
.endpoint code { min-width: 0; overflow-wrap: anywhere; color: var(--muted); }
.endpoint .subtle-link { margin-left: auto; flex-shrink: 0; font-size: 11px; }
.setup-details { margin-top: 23px; }
.setup-details summary { cursor: pointer; color: var(--muted); font-size: 12px; line-height: 1.8; }
.key-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 17px 0; border-bottom: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
.key-row strong { font-weight: 500; }
.key-row p { font-size: 10px; margin: 5px 0; }
.key-row small { color: var(--faint); font-size: 10px; line-height: 1.7; }
.key-row .subtle-link { flex-shrink: 0; font-size: 11px; }
.onboarding { padding: 58px 28px; text-align: center; }
.onboarding-icon { color: var(--accent); margin: 0 auto 25px; width: 80px; height: 70px; }
.onboarding-icon svg { width: 80px; height: 70px; stroke-width: 1.5; }
.onboarding .eyebrow { justify-content: center; }
.onboarding h2 { font-family: var(--heading); font-size: 28px; font-weight: var(--heading-weight); margin: 14px 0; }
.onboarding p { font-size: 14px; color: var(--muted); line-height: 1.8; max-width: 460px; margin: 0 auto 25px; }
.onboarding>a { display: table; margin-left: auto; margin-right: auto; }
.onboarding-steps { display: flex; justify-content: center; gap: 30px; border-top: 1px solid var(--line); padding-top: 26px; margin-top: 40px; color: var(--faint); font-size: 12px; }
.onboarding-steps b { margin-right: 8px; font: 11px var(--mono); color: var(--accent); }
.empty { padding: 36px; color: var(--muted); font-size: 13px; line-height: 1.8; text-align: center; }

/* Dialogs and transient states */
dialog { width: calc(100% - 36px); max-width: 600px; max-height: 88vh; padding: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--strong-line); border-radius: 9px; box-shadow: 0 20px 70px #00000030; }
dialog::backdrop { background: var(--overlay); }
.modal-header { padding: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 21px; font-family: var(--heading); font-weight: var(--heading-weight); }
.modal-header p { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 9px; }
.close-button { display: grid; place-items: center; height: 26px; width: 26px; flex-shrink: 0; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 20px; }
.close-button:hover { background: var(--hover); }
.modal-body { padding: 24px; }
.modal-body>p { font-size: 13px; line-height: 1.7; }
.modal-footer { padding: 16px 24px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); background: var(--surface); }
.modal-note { padding: 13px; color: var(--muted); background: var(--raised); border-left: 2px solid var(--strong-line); font-size: 12px; line-height: 1.8; }
.recovery-summary { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 15px; }
.recovery-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.6; }
.recovery-item:last-child { border-bottom: 0; }
.recovery-item>svg { color: var(--muted); }
.recovery-item>span { flex: 1; }
.recovery-item>.status { flex: 0 0 auto; }
.recovery-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; overflow-wrap: anywhere; }
.toast { position: fixed; left: calc(50% + 109px); bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 40px); padding: 13px 18px; background: var(--raised); color: var(--ink); border: 1px solid var(--strong-line); border-radius: 6px; box-shadow: 0 6px 25px #00000022; z-index: 30; font-size: 12px; line-height: 1.7; }
.warning-bar { padding: 13px 18px; background: var(--amber-bg); color: var(--amber); border: 1px solid var(--line); font-size: 12px; line-height: 1.7; }
.simulation-loader { height: 2px; background: var(--raised); overflow: hidden; }
.simulation-loader:after { content: ''; display: block; width: 35%; height: 100%; background: var(--accent); animation: progress 1s ease-in-out infinite; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(390%); } }

/* Entry page: a small, useful diagram in place of a promotional banner. */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-story { min-height: 100vh; padding: 34px 65px; display: flex; flex-direction: column; justify-content: space-between; gap: 60px; border-right: 1px solid var(--line); }
.auth-story .brand { margin: 0; align-self: flex-start; }
.auth-story-content { max-width: 470px; margin: 0 auto; width: 100%; padding-bottom: 25px; }
.auth-eyebrow { font: 10px var(--mono); letter-spacing: 1.8px; color: var(--faint); }
.auth-story h1 { font-size: clamp(36px, 3.4vw, 54px); line-height: 1.2; margin: 22px 0; letter-spacing: -2px; }
.auth-story h1 em { font-style: normal; color: var(--muted); }
.auth-story p { max-width: 335px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.auth-story>small { font: 9px var(--mono); letter-spacing: 1.2px; color: var(--faint); padding-bottom: 3px; }
.history-sketch { width: 100%; margin-top: 35px; }
.history-sketch svg { width: 100%; height: auto; stroke: none; }
.sketch-lines { fill: none; stroke: var(--strong-line); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.sketch-lines .return-line { stroke: var(--accent); }
.sketch-lines .sketch-tick { stroke: var(--green); }
.history-sketch text { fill: var(--muted); font-family: var(--mono); }
.history-sketch .sketch-caption { font-size: 9px; letter-spacing: .8px; fill: var(--faint); }
.history-sketch .sketch-key { font-size: 11px; }
.history-sketch .sketch-value { fill: var(--ink); font-size: 13px; }
.history-sketch .sketch-note { font-family: var(--heading); font-size: 13px; fill: var(--accent); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 90px 45px; }
.auth-card { width: 100%; max-width: 350px; }
.auth-card h2 { font: var(--heading-weight) 29px/1.3 var(--heading); letter-spacing: -.7px; margin: 15px 0 12px; }
.auth-card>p { font-size: 13px; color: var(--muted); line-height: 1.8; }
.auth-card form { margin-top: 29px; }
.auth-card .field { margin-bottom: 18px; }
.auth-submit { width: 100%; min-height: 41px; justify-content: space-between; font-size: 13px; }
.auth-switch { text-align: center; margin-top: 20px; }
.auth-switch .subtle-link { font-size: 13px; color: var(--ink); }
.auth-divider { margin: 27px 0 21px; border-top: 1px solid var(--line); height: 10px; text-align: center; }
.auth-divider span { position: relative; top: -9px; padding: 0 12px; font-size: 11px; color: var(--faint); background: var(--page); }
.auth-card .auth-fine { margin-top: 20px; font-size: 10px; color: var(--faint); line-height: 1.8; }
[data-theme="light"] .auth-story h1 em { color: var(--accent); font-style: italic; }
[data-theme="light"] .history-sketch .sketch-note { font-style: italic; font-size: 15px; }
[data-theme="light"] .sketch-lines { stroke-width: 1.4; }
[data-theme="light"] .brand-mark { color: var(--accent); transform: rotate(-7deg); }
[data-theme="light"] .guide-card { border-radius: 5px 9px 5px 8px; }

/* Responsive layout keeps labels visible and touch targets usable. */
@media (max-width: 1200px) {
  .content-grid { grid-template-columns: 250px minmax(0, 1fr); gap: 18px; }
  .local-label { display: none; }
  .detail-title { flex-wrap: wrap; }
  .stat-value small { display: none; }
  .connection-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connection-step:nth-child(3) { border-left: 0; }
  .connection-step:nth-child(n+3) { border-top: 1px solid var(--line); }
  .auth-story { padding: 34px 40px; }
}
@media (max-width: 1040px) {
  .integration-layout { grid-template-columns: 1fr; }
  .integration-layout aside { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
  .integration-layout aside .panel { margin-top: 0; }
  .sidebar { width: 186px; padding-left: 11px; padding-right: 11px; }
  .main-column { margin-left: 186px; width: calc(100% - 186px); }
  main { padding-left: 26px; padding-right: 26px; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card { padding: 23px; }
  .guide-card>svg { float: left; margin: 0 22px 15px 0; }
  .record-grid { grid-template-columns: 1fr; }
}
@media (max-width: 870px) {
  .sidebar { width: 67px; align-items: center; padding: 25px 8px; }
  .sidebar .brand { margin: 0 0 28px; }
  .sidebar .brand-name, .workspace-switch, .nav-caption, .sidebar-bottom, .nav-count { display: none; }
  .sidebar nav { width: 100%; }
  .nav-link { font-size: 0; padding: 13px 10px; justify-content: center; }
  .nav-link svg { width: 18px; height: 18px; }
  .main-column { margin-left: 67px; width: calc(100% - 67px); }
  .topbar { padding-left: 26px; padding-right: 26px; }
  .mobile-account { display: inline-flex !important; }
  .content-grid { grid-template-columns: 215px minmax(0, 1fr); gap: 14px; }
  .detail-heading, .steps { padding-left: 18px; padding-right: 18px; }
  .notice { margin-left: 18px; margin-right: 18px; }
  .detail-footer { padding: 18px; }
  .section-tabs { padding-left: 18px; }
  .toast { left: calc(50% + 34px); }
  .auth-story { padding: 34px 30px; }
  .auth-story h1 { font-size: 35px; letter-spacing: -1.5px; }
  .auth-form { padding: 80px 28px; }
  .auth-card h2 { font-size: 25px; }
}
@media (max-width: 720px) {
  .sidebar { inset: auto 0 0; width: 100%; height: auto; min-height: 64px; padding: 5px 7px max(5px, env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); flex-direction: row; }
  .sidebar .brand { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 3px; }
  .nav-link { flex: 1 0 66px; flex-direction: column; gap: 5px; padding: 7px 6px; margin: 0; font-size: 10px; min-width: 66px; line-height: 1.4; }
  .nav-button { width: auto; }
  .nav-link svg { width: 17px; height: 17px; }
  .main-column { margin: 0; width: 100%; padding-bottom: 73px; }
  .topbar { height: 58px; padding: 0 18px; }
  .breadcrumb { font-size: 0; }
  .breadcrumb span { display: none; }
  .breadcrumb strong { font-size: 11px; white-space: normal; }
  .topbar-right { gap: 5px; padding-right: 44px; }
  .topbar-right .button { font-size: 11px; padding: 5px; min-height: 30px; }
  .environment { font-size: 9px; }
  .theme-toggle { top: 13px; right: 16px; width: 32px; padding: 0; }
  .theme-toggle span { display: none; }
  .theme-toggle svg { width: 15px; height: 15px; }
  main { padding: 30px 18px 24px; }
  h1 { font-size: 28px; letter-spacing: -.9px; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 19px; margin-bottom: 26px; }
  .page-heading p { font-size: 13px; }
  .page-heading .button { min-height: 38px; }
  .page-kicker { font-size: 9px; }
  .history-filters .field { flex: 1 1 100%; min-width: 0; }
  .history-result { margin-bottom: 18px; }
  .stats { margin-bottom: 25px; }
  .stat { padding: 18px 12px; }
  .stat-title { font-size: 10px; line-height: 1.5; margin-bottom: 10px; }
  .stat-value { font-size: 24px; }
  .content-grid { grid-template-columns: 1fr; gap: 20px; }
  .operation-list { display: flex; overflow-x: auto; max-height: none; }
  .operation-card { flex: 1 0 248px; max-width: 100%; border-bottom: 0; border-left: 0; border-right: 1px solid var(--line); }
  .operation-card.selected { border-left: 0; box-shadow: inset 0 2px var(--accent); }
  .list-tip { display: none; }
  .detail-title h2 { font-size: 19px; }
  .detail-submeta { gap: 11px; font-size: 10px; }
  .step-title { flex-wrap: wrap; gap: 7px; }
  .step-title h3 { font-size: 12px; }
  .step { grid-template-columns: 23px minmax(0, 1fr); gap: 9px; }
  .step-number { width: 23px; height: 23px; }
  .step:not(:last-child):before { left: 11px; }
  .diff { gap: 6px; padding: 10px; font-size: 11px; grid-template-columns: 1fr 15px 1fr; }
  .diff-label { font-size: 9px; }
  .detail-footer .button-row { width: 100%; }
  .detail-footer .button.primary { flex: 1; }
  footer { padding: 10px 18px 20px; font-size: 9px; flex-direction: column; align-items: flex-start; gap: 5px; }
  .toast { left: 50%; bottom: 85px; min-width: 260px; }
  .connection-steps { grid-template-columns: 1fr; margin-bottom: 30px; }
  .connection-step { position: relative; padding: 17px 18px 17px 48px; }
  .connection-step+.connection-step { border-left: 0; border-top: 1px solid var(--line); }
  .connection-number { position: absolute; left: 19px; top: 23px; }
  .connection-step p { margin: 5px 0 10px; }
  .integration-layout aside { grid-template-columns: 1fr; gap: 20px; }
  .integration-layout { gap: 26px; }
  .record-card { padding: 20px; }
  .onboarding { padding: 40px 20px; }
  .onboarding h2 { font-size: 25px; }
  .onboarding-steps { flex-direction: column; gap: 14px; align-items: flex-start; max-width: 240px; margin-left: auto; margin-right: auto; }
  .recovery-item { align-items: flex-start; flex-wrap: wrap; }
  .modal-header, .modal-body { padding: 20px; }
  .modal-footer { padding: 15px 20px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: auto; border-right: 0; padding: 20px 24px 0; gap: 38px; }
  .auth-story .brand { display: flex; margin: 0; font-size: 23px; }
  .auth-story-content { padding-bottom: 0; max-width: 390px; }
  .auth-story h1 { font-size: 38px; margin: 17px 0 14px; letter-spacing: -1.5px; }
  .auth-story p { font-size: 13px; max-width: 300px; }
  .auth-eyebrow { font-size: 9px; }
  .auth-story>small { display: none; }
  .history-sketch { display: none; }
  .auth-form { padding: 35px 24px 45px; }
  .auth-card { max-width: 390px; }
  .auth-card>.eyebrow { display: none; }
  .auth-card h2 { font-size: 25px; }
  .auth-card form { margin-top: 23px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .auth-card .field input { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
