:root {
  --ink: #0b1220;
  --muted: #526174;
  --paper: #f5f8fb;
  --panel: #ffffff;
  --line: #d8e0e9;
  --navy: #071423;
  --blue: #175cff;
  --blue-dark: #0d43c7;
  --cyan: #27d7c5;
  --amber: #9a5d00;
  --amber-bg: #fff6df;
  --danger: #b42318;
  --danger-bg: #fff0ee;
  --success: #067647;
  --radius: 14px;
  --shadow: 0 18px 50px rgb(15 32 52 / 9%);
}

* { box-sizing: border-box; }
html { color-scheme: light; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 1rem; line-height: 1.55; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 10px 14px; background: #fff; color: var(--ink); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 760; text-decoration: none; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 2px; color: #96a8bd; font-size: .75rem; font-weight: 500; letter-spacing: 0; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px 4px 11px 4px; background: linear-gradient(135deg, var(--blue), #6b8fff); color: white; font-size: .76rem; letter-spacing: .08em; box-shadow: 0 7px 22px rgb(23 92 255 / 30%); }

.public-page { min-height: 100vh; background: radial-gradient(circle at 80% 10%, rgb(39 215 197 / 12%), transparent 30%), var(--paper); }
.public-header { display: flex; align-items: center; justify-content: space-between; max-width: 1220px; margin: auto; padding: 28px 32px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(330px, .7fr); gap: 72px; align-items: center; max-width: 1220px; min-height: 620px; margin: auto; padding: 72px 32px 90px; }
.eyebrow { margin: 0 0 18px; color: var(--blue-dark); font-size: .8rem; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.hero-grid h1 { max-width: 760px; margin: 0; font-size: clamp(3.2rem, 7vw, 6.8rem); line-height: .93; letter-spacing: -.065em; }
.hero-grid h1 span { color: var(--blue); }
.hero-copy { max-width: 670px; margin: 32px 0 0; color: #344358; font-size: 1.18rem; line-height: 1.6; }
.ru-copy { margin-top: 13px; color: var(--muted); font-size: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin-top: 36px; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:disabled, .ghost-button:disabled { cursor: not-allowed; opacity: .55; }
.button.primary { color: white; background: var(--blue); box-shadow: 0 9px 25px rgb(23 92 255 / 22%); }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { border-color: var(--line); background: #fff; color: var(--ink); }
.button.danger { background: var(--danger); color: #fff; }
.button.wide { width: 100%; }
.text-link { color: var(--blue-dark); font-weight: 700; text-underline-offset: 4px; }
.boundary-card { position: relative; overflow: hidden; padding: 36px; border-radius: 30px 8px 30px 8px; background: var(--navy); color: #e9f0f8; box-shadow: 0 30px 80px rgb(5 18 32 / 24%); }
.boundary-card::after { position: absolute; right: -80px; bottom: -100px; width: 230px; height: 230px; border: 1px solid rgb(39 215 197 / 30%); border-radius: 50%; content: ""; }
.step-number { color: var(--cyan); font-size: .75rem; font-weight: 800; letter-spacing: .18em; }
.boundary-card h2 { margin: 12px 0 30px; font-size: 1.8rem; letter-spacing: -.03em; }
.boundary-card ol { list-style: none; margin: 0; padding: 0; }
.boundary-card li { display: grid; grid-template-columns: 82px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid rgb(255 255 255 / 13%); }
.boundary-card li span { color: #aebdcd; font-size: .9rem; }
.boundary-note { position: relative; z-index: 1; margin: 24px 0 0; padding: 16px; border-left: 3px solid var(--cyan); background: rgb(255 255 255 / 6%); color: #cfdae6; font-size: .88rem; }
.principle-strip { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 1220px; margin: 0 auto 60px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principle-strip article { padding: 26px 30px; border-right: 1px solid var(--line); }
.principle-strip article:last-child { border: 0; }
.principle-strip span { font-weight: 800; }
.principle-strip p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 80px 24px; background: linear-gradient(135deg, var(--navy) 0 42%, var(--paper) 42%); }
.login-page > .brand { position: absolute; top: 28px; left: 32px; color: white; }
.login-card { width: min(100%, 520px); padding: clamp(28px, 5vw, 52px); border: 1px solid var(--line); border-radius: 26px 8px 26px 8px; background: var(--panel); box-shadow: var(--shadow); }
.login-card h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.05; letter-spacing: -.05em; }
.login-card > p:not(.eyebrow) { color: var(--muted); }
.login-actions { display: grid; gap: 12px; margin-top: 30px; }
.login-footnote { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .9rem; }
.login-footnote p { color: var(--muted); }

.app-frame { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 28px 20px; background: var(--navy); color: #e9f0f8; }
.nav-list { display: grid; gap: 5px; margin-top: 44px; }
.nav-list a { padding: 10px 12px; border-radius: 8px; color: #adbbcb; font-size: .92rem; text-decoration: none; }
.nav-list a:hover, .nav-list a[aria-current="page"] { background: rgb(255 255 255 / 9%); color: white; }
.nav-list a[aria-current="page"] { box-shadow: inset 3px 0 var(--cyan); }
.ghost-button { border: 0; background: transparent; color: inherit; cursor: pointer; }
.signout { margin-top: auto; padding: 10px 12px; color: #adbbcb; text-align: left; }
.main-content { min-width: 0; padding: 48px clamp(24px, 5vw, 72px) 80px; }
.page-header { display: flex; max-width: 1080px; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-header h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -.05em; }
.page-header p { max-width: 620px; margin: 12px 0 0; color: var(--muted); }
.page-kicker { margin: 0 0 9px !important; color: var(--blue-dark) !important; font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; max-width: 1080px; align-items: start; }
.stack { display: grid; gap: 18px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 8px 28px rgb(15 32 52 / 5%); }
.panel h2, .panel h3 { margin-top: 0; letter-spacing: -.025em; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0; }
.notice { display: flex; gap: 8px; flex-direction: column; padding: 15px 17px; border: 1px solid; border-radius: 10px; font-size: .9rem; }
.notice.warning { border-color: #e9c87d; background: var(--amber-bg); color: #704200; }
.notice code { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.ocr-preview { position: relative; width: 100%; margin: 12px 0; line-height: 0; }
.ocr-preview canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.ocr-box { position: absolute; pointer-events: none; border: 2px solid #0b4094; background: rgb(0 0 0 / 35%); box-sizing: border-box; }
.notice.info { border-color: #acc4ff; background: #eef3ff; color: #183d94; }
.notice.success { border-color: #98d7bc; background: #ecfdf3; color: #05603b; }
.field { display: grid; gap: 7px; }
.field label, .field-label { font-weight: 720; }
.field-hint { margin: 0; color: var(--muted); font-size: .84rem; }
.field textarea, .field input, .field select, textarea.text-output { width: 100%; border: 1px solid #aab7c6; border-radius: 9px; background: #fff; color: var(--ink); }
.field textarea { min-height: 280px; padding: 16px; resize: vertical; line-height: 1.6; }
.field input, .field select { min-height: 44px; padding: 8px 11px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
.toolbar .field { min-width: 150px; }
.form-error { margin: 0; color: var(--danger); font-weight: 680; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: #f8fafc; color: var(--muted); font-size: .78rem; font-weight: 700; }
.status-pill::before { width: 7px; height: 7px; border-radius: 50%; background: var(--success); content: ""; }
.data-list { display: grid; gap: 0; margin: 0; }
.data-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; font-weight: 700; text-align: right; }
.empty-state { padding: 50px 20px; border: 1px dashed #aebdcc; border-radius: 12px; color: var(--muted); text-align: center; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.danger-zone { border-color: #efb0aa; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
.review-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 24px; max-width: 1240px; align-items: start; }
.highlight-text { min-height: 320px; max-height: 620px; overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; }
.highlight-text mark { padding: 2px 3px; border: 2px solid #386fee; border-radius: 4px; background: #e9efff; color: var(--ink); }
.detection-list { display: grid; max-height: 410px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.detection-row { display: grid; grid-template-columns: 22px 1fr; gap: 11px; padding: 13px; border-bottom: 1px solid var(--line); cursor: pointer; }
.detection-row:last-child { border: 0; }
.detection-row.excluded { background: #f6f7f9; color: var(--muted); }
.detection-row input { width: 18px; height: 18px; margin-top: 3px; }
.detection-row strong, .detection-row small, .detection-row code, .detection-row em { display: block; }
.detection-row small { color: var(--muted); }
.detection-row code { margin-top: 4px; font-family: inherit; font-weight: 680; overflow-wrap: anywhere; }
.detection-row em { margin-top: 5px; color: var(--amber); font-size: .78rem; }
.manual-span { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.manual-span legend { padding-inline: 5px; font-weight: 750; }
.manual-grid { display: grid; grid-template-columns: .7fr .7fr 1.6fr; gap: 10px; margin-bottom: 12px; }
.review-actions { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.review-actions > div { text-align: right; }
.review-actions .field-hint { margin-bottom: 7px; }
.text-output { min-height: 220px; padding: 16px; resize: vertical; line-height: 1.6; }
.check-row { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 10px; }
.check-row input { width: 18px; height: 18px; margin-top: 3px; }
.check-row strong, .check-row small { display: block; }
.check-row small { color: var(--muted); }
.restored-panel { border-color: #9bd8c0; box-shadow: inset 4px 0 var(--success); }
.mono-short { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.confirm-dialog { width: min(92vw, 520px); padding: 28px; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 28px 90px rgb(2 12 27 / 34%); }
.confirm-dialog::backdrop { background: rgb(5 18 32 / 65%); backdrop-filter: blur(3px); }
.confirm-dialog h2 { margin: 0 0 14px; font-size: 1.65rem; letter-spacing: -.035em; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.session-list, .token-list { display: grid; }
.session-list article, .token-list article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.session-list article p, .token-list article small { display: block; margin: 4px 0 0; color: var(--muted); }
.scope-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.scope-grid legend { padding-inline: 5px; font-weight: 750; }
.scope-grid label { display: flex; align-items: center; gap: 8px; }
.scope-grid input { width: 18px; height: 18px; }
.secret-panel { border-color: #e9c87d; background: #fffbf1; }
.secret-value { display: block; overflow-wrap: anywhere; padding: 16px; border: 1px solid #d5b972; border-radius: 9px; background: white; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.text-button { border: 0; background: none; color: var(--blue-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.help-page { min-height: 100vh; background: radial-gradient(circle at 90% 3%, rgb(39 215 197 / 11%), transparent 25%), var(--paper); }
.help-article { max-width: 820px; margin: auto; padding: 70px 28px 110px; }
.help-article > h1 { max-width: 720px; margin: 0 0 26px; font-size: clamp(3rem, 7vw, 6rem); line-height: .95; letter-spacing: -.06em; }
.help-article .lede { color: #33445a; font-size: 1.25rem; line-height: 1.65; }
.help-article section { margin-top: 48px; padding-top: 30px; border-top: 1px solid var(--line); }
.help-article h2 { font-size: 1.7rem; letter-spacing: -.035em; }
.help-article p, .help-article li { color: #435268; }
.help-article li { margin: 9px 0; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 46px; padding-top: 50px; }
  .principle-strip { grid-template-columns: 1fr; margin-inline: 24px; }
  .principle-strip article { border-right: 0; border-bottom: 1px solid var(--line); }
  .app-frame { display: block; }
  .sidebar { position: static; height: auto; padding: 18px 20px; }
  .sidebar .brand small { display: none; }
  .nav-list { display: flex; margin-top: 18px; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .nav-list a { flex: 0 0 auto; }
  .nav-list a[aria-current="page"] { box-shadow: inset 0 -3px var(--cyan); }
  .signout { position: absolute; top: 22px; right: 16px; margin: 0; }
  .main-content { padding-top: 34px; }
  .page-grid { grid-template-columns: 1fr; }
  .review-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .public-header { padding: 20px; }
  .public-header .button { padding-inline: 12px; font-size: .86rem; }
  .hero-grid { padding: 44px 20px 64px; }
  .hero-grid h1 { font-size: 3.3rem; }
  .boundary-card { padding: 26px; }
  .boundary-card li { grid-template-columns: 1fr; gap: 4px; }
  .login-page { background: var(--paper); padding: 100px 16px 30px; }
  .login-page > .brand { color: var(--ink); }
  .main-content { padding: 30px 16px 60px; }
  .panel { padding: 18px; }
  .page-header { align-items: start; flex-direction: column; }
  .manual-grid { grid-template-columns: 1fr 1fr; }
  .manual-grid .field:last-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .nav-list a { transition: background-color .16s ease, color .16s ease, transform .16s ease; }
  .button:active { transform: translateY(1px); }
}

/* Clear Review: readable content, explicit decisions, compact navigation. */
:root { --ink: #142033; --paper: #f8fafc; --navy: #0c1829; --blue: #2448d8; --blue-dark: #1c39b2; --cyan: #8fc6ff; }
:focus-visible { outline-color: var(--blue); }
.sidebar :focus-visible { outline-color: #8fc6ff; }
h1, h2, h3, p, dd { overflow-wrap: anywhere; }
button, summary, .text-link, .text-button { touch-action: manipulation; }
.button { box-shadow: none; text-align: center; line-height: 1.4; }
.button.primary { box-shadow: none; }
.text-button { min-height: 44px; padding: 8px 4px; }
.brand-mark { flex-shrink: 0; background: var(--blue); box-shadow: none; }
.public-page, .help-page { background: var(--paper); }
.public-header { max-width: 1240px; padding-block: 22px; gap: 24px; border-bottom: 1px solid var(--line); }
.public-navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; font-size: .9rem; }
.public-navigation > a:not(.button) { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
.public-navigation > a:hover, .public-navigation > a[aria-current] { text-decoration: underline; text-underline-offset: 5px; }
.public-menu-toggle, .app-menu-toggle { display: none; }
.hero-grid { max-width: 1240px; grid-template-columns: 1fr 1fr; min-height: 0; padding: 64px 32px 80px; gap: 56px; }
.hero-grid h1 { font-size: clamp(2.5rem, 4.2vw, 3.65rem); line-height: 1.08; letter-spacing: -.045em; }
.hero-grid h1 span { display: block; }
.hero-copy { margin-top: 24px; font-size: 1.06rem; }
.hero-actions { gap: 18px; margin-top: 28px; }
.hero-boundary { max-width: 480px; margin: 18px 0 0; font-size: .86rem; color: var(--muted); }
.eyebrow { font-size: .74rem; letter-spacing: .09em; }
.example-card { margin: 0; border: 1px solid #c7d3e5; border-radius: 16px; background: #fff; box-shadow: 0 16px 38px rgb(15 32 52 / 7%); overflow: hidden; }
.example-card figcaption { display: grid; gap: 6px; padding: 22px 24px; background: var(--navy); color: #fff; }
.example-card figcaption strong { font-size: 1.15rem; }
.example-card figcaption > span:last-child { color: #bccadc; font-size: .8rem; }
.example-label { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.example-text { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.example-text p { margin: 10px 0 0; font-size: .98rem; line-height: 1.85; }
.example-text mark { background: #fff0c7; border-bottom: 2px solid #956200; color: var(--ink); padding: 2px 0; }
.example-text code { background: #edf1ff; color: var(--blue-dark); font-size: .86em; overflow-wrap: anywhere; }
.example-note { margin: 0; padding: 16px 24px; font-size: .8rem; color: var(--muted); }
.public-section { max-width: 1240px; margin: 0 auto; padding: 48px 32px; border-top: 1px solid var(--line); }
.public-section h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.2; letter-spacing: -.035em; }
.public-section p { color: var(--muted); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-heading > .text-link { flex-shrink: 0; }
.workflow-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.workflow-number { display: inline-grid; width: 36px; height: 36px; place-items: center; background: #e9eeff; color: var(--blue-dark); border-radius: 50%; font-size: .78rem; font-weight: 750; }
.workflow-cards h3 { margin: 16px 0 8px; font-size: 1.04rem; }
.workflow-cards p { margin: 0; font-size: .93rem; }
.feature-section, .faq-section { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.format-card { border: 1px solid var(--line); border-radius: 14px; padding: 26px; background: white; }
.format-card p { font-size: .9rem; }
.format-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.format-tags span { padding: 7px 12px; border-radius: 6px; background: #edf1ff; color: var(--blue-dark); font-size: .78rem; font-weight: 750; }
.storage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.storage-grid article { padding-left: 20px; border-left: 2px solid #acbceb; }
.storage-grid h3 { margin: 0; font-size: 1.02rem; }
.storage-grid p { margin-bottom: 0; font-size: .94rem; }
.faq-list details { border-top: 1px solid var(--line); padding-block: 8px; }
.faq-list details:last-child { border-bottom: 1px solid var(--line); }
summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 650; }
.faq-list p { margin: 0 0 16px; font-size: .94rem; }
.closing-cta { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 40px 64px; }
.public-footer { max-width: 1240px; margin: auto; border-top: 1px solid var(--line); padding: 28px 32px 40px; display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 18px 32px; color: var(--muted); font-size: .84rem; }
.public-footer nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.public-footer a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 4px; }
.help-article { max-width: 860px; padding-top: 56px; }
.help-article > h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); line-height: 1.12; letter-spacing: -.04em; }
.help-article .lede { font-size: 1.1rem; }
.help-article section { scroll-margin-top: 24px; }
.help-article section:last-of-type { margin-bottom: 32px; }
.article-contents { margin-top: 28px; padding: 10px 24px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.article-contents ul { padding-left: 20px; }
.article-contents a { display: inline-block; padding: 4px 0; text-underline-offset: 4px; }
.login-page { background: var(--paper); }
.login-page > .brand { color: var(--ink); }
.login-card { border-radius: 16px; }
.login-card h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); line-height: 1.12; }
.app-frame { grid-template-columns: 218px minmax(0, 1fr); }
.sidebar { padding: 26px 16px; }
.sidebar .brand { gap: 9px; font-size: .98rem; }
.sidebar .brand small { max-width: 126px; font-size: .65rem; }
.sidebar .brand-mark { width: 32px; height: 34px; }
.nav-list { margin-top: 32px; }
.nav-list a { min-height: 44px; display: flex; align-items: center; }
.nav-list a:nth-child(3), .nav-list a:nth-child(6) { margin-top: 14px; }
.nav-list a[aria-current="page"] { box-shadow: inset 3px 0 #8fc6ff; }
.signout { min-height: 44px; }
.main-content { width: 100%; max-width: 1440px; padding: 32px clamp(24px, 3vw, 44px) 64px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: clamp(1.9rem, 3vw, 2.4rem); line-height: 1.13; letter-spacing: -.035em; }
.page-header p { font-size: .96rem; }
.page-grid { max-width: 1240px; grid-template-columns: minmax(0, 1fr) 300px; }
.panel { box-shadow: none; }
.panel h2 { font-size: 1.15rem; }
.panel-heading { margin-bottom: 0; flex-wrap: wrap; gap: 8px; }
.flow-steps { display: flex; list-style: none; padding: 0; margin: 0 0 26px; gap: 24px; color: var(--muted); font-size: .8rem; }
.flow-steps li { display: flex; align-items: center; gap: 8px; }
.flow-steps li > span { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border: 1px solid #b3bed0; border-radius: 50%; font-size: .7rem; }
.flow-steps [aria-current="step"] { color: var(--blue-dark); font-weight: 750; }
.flow-steps [aria-current="step"] > span { border-color: var(--blue); color: white; background: var(--blue); }
.upload-zone, .selected-file { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; border: 1px dashed #9baac0; border-radius: 10px; padding: 16px; }
.selected-file { border-style: solid; border-color: #b8c7ee; background: #f4f6ff; }
.scan-options { align-items: start; }
.scan-options .field { flex: 1; }
.processing-boundary { padding: 14px 0; border-block: 1px solid var(--line); font-size: .85rem; }
.processing-boundary p { margin: 5px 0 0; color: var(--muted); }
.scan-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.workspace-grid textarea { min-height: 220px; }
.status-pill::before { content: none; }
.lifecycle-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; max-width: 1240px; margin: 0 0 24px; padding: 18px 22px; border: 1px solid #b7c5e8; border-radius: 12px; background: #f0f4ff; }
.lifecycle-summary > div { flex: 1 1 200px; }
.lifecycle-summary p { margin: 6px 0 0; }
.lifecycle-summary .status-pill { border-color: #b7c5e8; background: white; color: var(--ink); }
.review-layout { grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); }
.highlight-text { min-height: 180px; max-height: 65vh; }
.highlight-text mark:focus { outline: 3px solid var(--blue); outline-offset: 3px; }
.finding-navigation { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.finding-navigation .button { font-size: .8rem; padding-inline: 10px; }
.detection-list { max-height: 480px; }
.detection-row { display: block; cursor: auto; }
.detection-choice { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; cursor: pointer; min-height: 44px; }
.detection-choice small { font-size: .78rem; }
.detection-details { margin: 6px 0 0 32px; color: var(--muted); font-size: .8rem; }
.detection-details summary { font-weight: 500; }
.detection-details p { margin: 4px 0 10px; }
.manual-span { padding: 14px; }
.manual-grid { margin-top: 16px; grid-template-columns: 1fr 1fr; }
.manual-grid .field:last-child { grid-column: 1 / -1; }
.manual-grid .field { min-width: 0; }
.selection-preview { margin: 12px 0; padding: 12px; border-left: 3px solid var(--blue); background: #f0f4ff; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-actions { flex-wrap: wrap; align-items: center; }
.review-actions > div { flex: 1 1 170px; }
.review-actions > div > .button { width: 100%; }
textarea:disabled { background: #f1f4f8; color: #526174; }
.confirm-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.confirm-dialog::backdrop { backdrop-filter: none; }
.dialog-actions { flex-wrap: wrap; }
@media (max-width: 1100px) {
  .page-grid { grid-template-columns: 1fr; }
  .page-grid > aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-layout { grid-template-columns: 1fr; }
  .hero-grid { gap: 32px; }
  .public-navigation { gap: 16px; }
}
@media (max-width: 860px) {
  .app-frame { display: block; }
  .sidebar { position: static; display: grid; grid-template-columns: 1fr auto; gap: 0 12px; height: auto; padding: 14px 20px; }
  .sidebar .brand small { display: none; }
  .app-menu-toggle { display: block; min-height: 44px; padding: 10px 14px; border: 1px solid #65738a; border-radius: 8px; }
  .nav-list { display: none; grid-column: 1 / -1; margin-top: 18px; padding: 0; overflow: visible; }
  .sidebar.menu-open .nav-list { display: grid; }
  .sidebar .signout { display: none; position: static; grid-column: 1 / -1; margin-top: 18px; }
  .sidebar.menu-open .signout { display: block; }
  .sidebar .form-error { grid-column: 1 / -1; color: #ffccc6; }
  .nav-list a[aria-current="page"] { box-shadow: inset 3px 0 #8fc6ff; }
  .hero-grid { grid-template-columns: 1fr; padding-top: 42px; gap: 36px; }
  .hero-copy, .hero-boundary { max-width: 620px; }
  .example-card { max-width: 620px; width: 100%; }
  .workflow-cards { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .public-header { flex-wrap: wrap; }
  .public-menu-toggle { display: inline-flex; }
  .public-navigation { display: none; width: 100%; align-items: stretch; gap: 6px; }
  .public-navigation.menu-open { display: flex; flex-direction: column; }
  .public-navigation .button { align-self: start; }
  .feature-section, .faq-section { grid-template-columns: 1fr; gap: 24px; }
  .storage-grid { grid-template-columns: 1fr; }
  .section-heading { flex-wrap: wrap; }
  .closing-cta { align-items: start; flex-direction: column; }
}
@media (max-width: 560px) {
  .public-header { padding: 16px 20px; }
  .hero-grid { padding: 38px 20px 48px; }
  .hero-grid h1 { font-size: clamp(2rem, 8vw, 2.65rem); }
  .public-section { padding: 32px 20px; }
  .public-footer { padding-inline: 20px; }
  .workflow-cards { grid-template-columns: 1fr; }
  .example-card figcaption, .example-text, .example-note { padding-inline: 18px; }
  .page-grid > aside { grid-template-columns: 1fr; }
  .main-content { padding: 24px 16px 48px; }
  .flow-steps { gap: 10px; font-size: .68rem; align-items: start; }
  .flow-steps li { flex: 1; flex-direction: column; align-items: start; gap: 6px; }
  .panel { padding: 18px; }
  .toolbar .field { min-width: 0; flex-basis: 100%; }
  .scan-submit .button { width: 100%; }
  .lifecycle-summary { padding: 16px; }
  .lifecycle-summary > .button { width: 100%; }
  .review-actions > .button { flex: 1 1 100%; }
  .dialog-actions { flex-direction: column; }
  .dialog-actions .button { width: 100%; }
  .confirm-dialog { padding: 22px; }
  .help-article { padding: 36px 20px 64px; }
  .help-article h2 { font-size: 1.4rem; }
  .session-list article, .token-list article { align-items: start; flex-wrap: wrap; }
  .scope-grid { grid-template-columns: 1fr; }
}

.selection-actions { display: grid; gap: 12px; }
.selection-actions .button { justify-self: start; }
.selection-context-menu { max-height: calc(100dvh - 16px); overflow-y: auto; position: fixed; z-index: 50; width: min(256px, calc(100vw - 16px)); padding: 6px; border: 1px solid #9baac0; border-radius: 10px; background: #fff; box-shadow: 0 10px 32px rgb(15 32 52 / 20%); }
.selection-context-menu button { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 6px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; line-height: 1.4; }
.selection-context-menu button:first-child { font-weight: 750; color: var(--blue-dark); }
.selection-context-menu button:hover, .selection-context-menu button:focus-visible { background: #edf1ff; }
.selection-context-menu button:focus-visible { outline-offset: -3px; }
.manual-advanced > summary { color: var(--muted); font-size: .86rem; }
.manual-advanced[open] > summary { margin-bottom: 12px; }
@media (max-width: 560px) { .selection-actions .button { width: 100%; } }
