:root {
  --navy: #303943;
  --navy-2: #252c32;
  --blue: #8e2f33;
  --blue-soft: #f3ebe7;
  --ink: #22282e;
  --muted: #706a62;
  --line: #d9d2c7;
  --surface: #fffefb;
  --page: #f6f3ed;
  --high: #a22b2b;
  --high-soft: #fff0f0;
  --medium: #8a6500;
  --medium-soft: #fff7df;
  --low: #486b70;
  --low-soft: #edf3f1;
  --success: #23764f;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(59, 50, 42, .06);
}
* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; color: var(--ink); background: var(--page); line-height: 1.65; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }
button, input, select, textarea { font: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(142,47,51,.28); outline-offset: 3px; }
.container { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.page-shell { min-height: calc(100vh - 140px); padding-top: 36px; padding-bottom: 64px; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 254, 251, .97); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.topbar-inner { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 15px; min-width: 0; color: var(--navy); }
.brand:hover { color: var(--navy); }
.brand-logo { display: block; width: 132px; height: auto; flex: 0 0 auto; }
.brand-text { font-size: 23px; font-weight: 800; letter-spacing: .025em; white-space: nowrap; }
.nav-actions { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav-actions a { color: var(--ink); }
.nav-actions .quiet-link { color: var(--muted); }
.user-name { padding-left: 16px; border-left: 1px solid var(--line); color: var(--muted); }
.inline-form { display: inline; margin: 0; }
.link-button { border: 0; padding: 0; color: var(--muted); background: transparent; cursor: pointer; }
.site-footer { color: var(--muted); border-top: 1px solid var(--line); padding: 20px 0; font-size: 13px; background: rgba(255, 254, 251, .97); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 6px; }
h1, h2, h3 { color: var(--navy); line-height: 1.3; margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 12px; }
h2 { font-size: 22px; margin-bottom: 10px; }
h3 { font-size: 16px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 7px; min-height: 42px; padding: 9px 18px; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { color: #fff; background: var(--navy-2); }
.btn-secondary { color: var(--navy); background: var(--surface); border-color: #bdb4a9; }
.btn-secondary:hover { background: var(--blue-soft); }
.btn-danger-outline { color: var(--high); background: var(--surface); border-color: #dab5b5; }
.btn-large { min-height: 50px; padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.export-menu { position: relative; }
.export-menu > summary { list-style: none; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu[open] > summary { background: var(--navy-2); }
.export-options { position: absolute; z-index: 12; right: 0; top: calc(100% + 8px); width: 230px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 14px 34px rgba(59, 50, 42, .16); }
.export-options a { display: grid; gap: 1px; padding: 10px 12px; border-radius: 6px; color: var(--ink); }
.export-options a:hover { color: var(--navy); background: var(--blue-soft); }
.export-options strong { font-size: 14px; }
.export-options span { color: var(--muted); font-size: 12px; font-weight: 400; }
.hero { display: grid; grid-template-columns: 1fr 330px; gap: 56px; align-items: center; min-height: 365px; padding: 52px 56px; color: #fff; background: linear-gradient(125deg, #102b4d 0%, #1f4c77 72%, #2c608f 100%); border-radius: 14px; box-shadow: 0 18px 50px rgba(20,45,75,.18); }
.hero h1, .hero .eyebrow { color: #fff; }
.hero > div > p:not(.eyebrow):not(.helper) { color: #d7e5f2; font-size: 17px; max-width: 650px; }
.hero-actions { display: flex; align-items: center; gap: 14px; margin: 28px 0 12px; }
.hero .btn-primary { background: #fff; color: var(--navy); border-color: #fff; }
.hero .btn-primary:hover { background: #eef5fb; }
.hero .btn-secondary { color: #fff; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.42); }
.hero .helper { color: #b9ccdd; font-size: 13px; }
.hero-note { display: grid; gap: 10px; padding: 24px; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; background: rgba(255,255,255,.08); }
.hero-note strong { font-size: 17px; }
.hero-note span { color: #d6e3ef; font-size: 14px; padding-left: 15px; position: relative; }
.hero-note span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #83b6e3; position: absolute; left: 0; top: .7em; }
.home-theme {
  --navy: #303943;
  --navy-2: #252c32;
  --blue: #8e2f33;
  --blue-soft: #f3ebe7;
  --ink: #22282e;
  --muted: #706a62;
  --line: #d9d2c7;
  --surface: #fffefb;
  --page: #f6f3ed;
  --shadow: 0 8px 24px rgba(59, 50, 42, .06);
}
.home-theme .topbar, .home-theme .site-footer { background: rgba(255, 254, 251, .97); }
.nav-actions a.active { color: var(--ink); font-weight: 800; position: relative; }
.nav-actions a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -26px; height: 3px; background: #d71920; }
.home-theme .page-shell { padding-top: 28px; }
.home-hero { overflow: hidden; color: var(--ink); background: #e8e2d8; border: 1px solid #d2cabf; border-radius: 12px; box-shadow: 0 16px 42px rgba(64, 54, 44, .09); }
.home-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(390px, .82fr); gap: 54px; align-items: center; padding: 34px 46px 20px; }
.home-hero .eyebrow { color: #59534d; letter-spacing: .08em; }
.home-hero h1 { color: #252a2f; font-size: clamp(28px, 2.8vw, 38px); margin: 7px 0 10px; }
.home-lead { margin: 0; color: #514c47; font-size: 16px; }
.home-features { display: grid; gap: 12px; margin: 23px 0 0; padding: 0; list-style: none; }
.home-features li { display: flex; align-items: center; gap: 14px; min-height: 42px; }
.feature-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; color: #3d4246; border: 1px solid #9f978d; border-radius: 7px; background: rgba(255, 254, 251, .38); }
.feature-icon svg, .upload-entry-icon svg, .home-data-notice svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.home-features strong { color: #30353a; font-size: 16px; }
.home-upload-entry { text-align: center; }
.home-upload-card { display: grid; place-items: center; gap: 6px; min-height: 255px; padding: 22px 28px; color: var(--ink); border: 1px solid #d9d1c7; border-radius: 10px; background: #fffefb; box-shadow: 0 8px 22px rgba(55, 47, 39, .06); outline: 1px dashed #c9c0b5; outline-offset: -14px; transition: border-color .18s, box-shadow .18s; }
.home-upload-card:hover { color: var(--ink); border-color: #9e958a; box-shadow: 0 12px 28px rgba(55, 47, 39, .1); }
.upload-entry-icon { display: grid; place-items: center; color: #303943; }
.upload-entry-icon svg { width: 52px; height: 52px; stroke-width: 1.45; }
.home-upload-card > strong { font-size: 20px; }
.home-upload-card > span:not(.upload-entry-icon) { color: var(--muted); font-size: 13px; }
.home-upload-card > b { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; width: min(100%, 310px); margin-top: 5px; color: #fff; background: #303943; border-radius: 6px; }
.home-upload-card > small { color: #7d7770; }
.home-upload-entry > p { margin: 10px 0 0; color: #59534d; font-size: 13px; }
.home-upload-entry > p a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.home-workflow { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 46px; padding: 14px 0 18px; border-top: 1px solid #c9c0b5; list-style: none; }
.home-workflow li { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; color: #393d40; }
.home-workflow li + li::before { content: ""; position: absolute; left: -12%; width: 24%; border-top: 1px dashed #9e958a; }
.home-workflow span { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #8e8780; border-radius: 50%; font-size: 17px; }
.home-workflow strong { font-size: 14px; }
.home-data-notice { display: flex; align-items: center; gap: 14px; min-height: 58px; margin-top: 14px; padding: 10px 22px; color: #464b4e; border: 1px solid #ded7cd; border-radius: 9px; background: #fffefb; }
.home-data-notice > span { display: grid; place-items: center; flex: 0 0 30px; color: #303943; }
.home-data-notice p { margin: 0; font-size: 13px; }
.home-records-head { display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: center; margin: 16px 0 10px; padding: 18px 20px; border: 1px solid #ded7cd; border-bottom: 0; border-radius: 10px 10px 0 0; background: #fffefb; }
.home-records-head h2 { color: #303943; margin-bottom: 1px; }
.home-records-head p { margin: 0; color: var(--muted); font-size: 13px; }
.home-record-stats { display: flex; justify-content: center; gap: 0; }
.home-record-stats span { min-width: 108px; padding: 0 18px; color: #5f5a54; border-left: 1px solid #e0d9d0; font-size: 12px; }
.home-record-stats span:first-child { border-left: 0; }
.home-record-stats b { display: block; color: #303943; font-size: 20px; line-height: 1.2; }
.home-record-stats span:nth-child(2) b { color: var(--high); }
.home-record-stats span:nth-child(3) b { color: var(--medium); }
.home-record-filters { display: flex; gap: 10px; }
.home-record-filters input { width: 190px; }
.home-record-filters select { width: 132px; }
.home-records-card { margin-top: -10px; border-radius: 0 0 10px 10px; box-shadow: var(--shadow); }
.home-records-card .data-table th { background: #f5f1eb; }
.home-records-card [data-record-empty] td { color: var(--muted); text-align: center; padding: 30px; }
.section-heading, .page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.section-heading { margin: 42px 0 16px; }
.section-heading p, .page-heading p { color: var(--muted); margin: 4px 0 0; }
.page-heading { align-items: center; margin-bottom: 26px; }
.page-heading h1 { margin-bottom: 6px; font-size: 32px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { color: var(--muted); background: #f5f1eb; text-align: left; font-size: 12px; letter-spacing: .04em; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.table-link { color: var(--ink); font-weight: 700; }
.status, .risk { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 800; }
.status-review_completed { color: var(--success); background: #e8f6ef; }
.status-parse_failed, .status-review_failed { color: var(--high); background: var(--high-soft); }
.status-uploaded, .status-parsing, .status-pending_review, .status-reviewing { color: var(--low); background: var(--low-soft); }
.risk-high { color: var(--high); background: var(--high-soft); }
.risk-medium { color: var(--medium); background: var(--medium-soft); }
.risk-low { color: var(--low); background: var(--low-soft); }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state p { color: var(--muted); }
.login-layout { min-height: calc(100vh - 165px); display: grid; grid-template-columns: 1.1fr 420px; gap: 84px; align-items: center; }
.login-intro { padding-left: 4vw; }
.login-intro p:not(.eyebrow) { color: var(--muted); font-size: 17px; max-width: 560px; }
.login-card { padding: 34px; }
.login-card label { display: block; margin: 16px 0 6px; font-weight: 700; }
.login-card .btn { margin-top: 24px; }
.notice, .data-notice { color: #57514b; background: #f3eee7; border-left: 3px solid #9b8c7e; padding: 12px 14px; border-radius: 4px; font-size: 13px; }
input, select, textarea { width: 100%; color: var(--ink); background: var(--surface); border: 1px solid #c8beb3; border-radius: 6px; padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(142,47,51,.12); }
textarea { resize: vertical; }
.form-layout { display: grid; gap: 20px; }
.form-card { padding: 28px; box-shadow: 0 10px 28px rgba(59, 50, 42, .055); }
.form-card > h2 { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label, .label-row label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 800; }
.optional { color: var(--muted); font-size: 12px; font-weight: 400; }
.upload-zone { min-height: 165px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; text-align: center; color: var(--muted); border: 2px dashed #aaa095; border-radius: 9px; background: #faf7f2; cursor: pointer; transition: border-color .18s, background .18s; }
.upload-zone:hover { border-color: var(--blue); background: var(--blue-soft); }
.upload-zone:has(+ input:focus-visible) { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(142,47,51,.12); }
.upload-zone strong { color: var(--navy); font-size: 18px; }
.upload-zone .file-name { color: var(--blue); margin-top: 8px; font-weight: 700; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.helper { color: var(--muted); font-size: 13px; }
.form-card .data-notice { margin: 20px 0; }
.label-row { display: flex; justify-content: space-between; color: var(--muted); }
.contract-textarea { min-height: 420px; font-family: "Microsoft YaHei", monospace; line-height: 1.8; }
.alert { padding: 12px 16px; border: 1px solid; border-radius: 7px; margin-bottom: 18px; white-space: pre-line; }
.alert-danger { color: #7e2020; background: #fff0f0; border-color: #ecc4c4; }
.alert-warning { color: #735b0a; background: #fff9e8; border-color: #e8d697; }
.alert-success { color: #1f6546; background: #eaf7f1; border-color: #b8dece; }
.alert-info { color: #285f8f; background: #edf5fb; border-color: #bed6e8; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status-card { display: flex; align-items: center; gap: 22px; padding: 30px; margin: 20px 0; border-top: 3px solid #8e2f33; }
.status-card h2, .status-card p { margin-bottom: 2px; }
.status-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--blue-soft); border: 8px solid #dfd3cc; }
.status-icon-parsing, .status-icon-reviewing { animation: pulse 1.8s ease-in-out infinite; }
.status-icon-parse_failed, .status-icon-review_failed { background: var(--high-soft); border-color: #efc6c6; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .65; } }
.summary-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.summary-main, .contract-meta { padding: 25px; }
.summary-top { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.summary-top span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.summary-top strong { font-size: 20px; }
.risk-text-high { color: var(--high); }.risk-text-medium { color: var(--medium); }.risk-text-low { color: var(--low); }
.review-trace { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; margin-bottom: 18px; border-top: 3px solid #8e2f33; box-shadow: none; }
.review-trace > div:first-child span { display: block; color: var(--muted); font-size: 12px; }
.review-trace > div:first-child strong { color: var(--navy); font-size: 14px; }
.trace-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.trace-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; }
.trace-primary { color: var(--success); background: #e8f6ef; }
.trace-arbiter { color: var(--low); background: var(--low-soft); }
.trace-warning { color: var(--medium); background: var(--medium-soft); }
.model-timings { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.model-timings strong { color: var(--navy); }
.model-timings .timing-failed, .model-timings .timing-failed strong { color: var(--danger); }
.model-timings .timing-total { margin-left: auto; color: var(--ink); font-weight: 700; }
.contract-meta dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.contract-meta dl div { min-width: 0; }
.contract-meta dt { color: var(--muted); font-size: 12px; }
.contract-meta dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin: 20px 0 28px; }
.stat { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 5px 16px rgba(59, 50, 42, .04); }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-size: 28px; line-height: 1.2; }
.stat-high strong { color: var(--high); }.stat-medium strong { color: var(--medium); }.stat-low strong { color: var(--low); }
.result-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(340px,.75fr); gap: 24px; align-items: start; }
.result-main .section-heading:first-child { margin-top: 0; }
.filter-buttons { display: flex; background: #e8e2d8; border-radius: 7px; padding: 3px; }
.filter { border: 0; background: transparent; color: var(--muted); padding: 5px 11px; border-radius: 5px; cursor: pointer; }
.filter.active { color: var(--navy); background: var(--surface); box-shadow: 0 2px 5px rgba(59,50,42,.08); }
.issue-list { display: grid; gap: 16px; }
.issue-card { overflow: hidden; border-left: 4px solid; }
.issue-high { border-left-color: var(--high); }.issue-medium { border-left-color: var(--medium); }.issue-low { border-left-color: var(--low); }
.issue-card > header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 10px; }
.issue-card > header > div { display: flex; align-items: center; gap: 10px; }
.detail-toggle, .paragraph-link, .copy-button { border: 0; color: var(--blue); background: transparent; cursor: pointer; }
.paragraph-links { padding: 0 20px 12px; color: var(--muted); font-size: 13px; }
.paragraph-link { padding: 2px 5px; text-decoration: underline; }
.issue-detail { border-top: 1px solid var(--line); }
.quote { padding: 15px 20px; background: #f5f1eb; }
.quote span { color: var(--muted); font-size: 12px; font-weight: 800; }
.quote p { margin: 5px 0 0; white-space: pre-wrap; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; }
.detail-grid > div { position: relative; padding: 18px 20px; border-top: 1px solid var(--line); }
.detail-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.detail-grid h3 { margin-bottom: 6px; font-size: 13px; }
.detail-grid p { margin: 0; white-space: pre-wrap; }
.copy-button { margin-top: 10px; padding: 0; font-size: 12px; }
.missing-clause-list { overflow: hidden; padding: 0; border-top: 3px solid #a79b8d; box-shadow: 0 8px 24px rgba(59,50,42,.045); }
.missing-clause-item { position: relative; padding: 20px 20px 20px 18px; }
.missing-clause-item + .missing-clause-item { border-top: 1px solid var(--line); }
.missing-clause-item-heading { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.missing-clause-index { display: grid; place-items: center; width: 30px; height: 30px; color: var(--blue); background: #f7f2eb; border: 1px solid #d8cec1; border-radius: 50%; font-size: 11px; font-weight: 900; }
.missing-clause-item h3 { margin: 0; color: var(--navy); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.missing-clause-content { margin: 13px 0 0 44px; }
.missing-clause-content > div { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
.missing-clause-content dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.missing-clause-content dd { margin: 0; line-height: 1.75; }
.missing-clause-reason { border-top: 1px dashed #ded5ca; }
.missing-clause-suggestion { margin-top: 3px; padding: 10px 12px !important; color: #245b47; background: #eef6f1; border-left: 3px solid var(--success); }
.missing-clause-suggestion dt { color: var(--success); }
.question-list { margin: 0; padding: 22px 22px 22px 44px; }
.question-list li + li { margin-top: 10px; }
.original-panel { max-height: calc(100vh - 100px); overflow: auto; position: sticky; top: 82px; box-shadow: none; }
.sticky-heading { position: sticky; top: 0; z-index: 2; padding: 18px 20px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sticky-heading h2 { margin-bottom: 0; font-size: 18px; }
.sticky-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.paragraph-list { padding: 10px; }
.contract-paragraph { padding: 12px; border-radius: 6px; scroll-margin-top: 100px; transition: background .3s, box-shadow .3s; }
.contract-paragraph + .contract-paragraph { border-top: 1px solid #ebe4da; }
.contract-paragraph header { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.contract-paragraph header strong { color: var(--blue); font-size: 12px; }
.contract-paragraph p { margin: 5px 0 0; white-space: pre-wrap; font-size: 13px; }
.contract-paragraph.highlight { background: #fff8d8; box-shadow: inset 0 0 0 2px #e7c95b; }
.disclaimer { margin: 30px 0 18px; padding: 20px; color: #57514b; background: #f1ece5; box-shadow: none; }
.disclaimer p { margin-bottom: 4px; }
.print-only { display: none; }
.assessment-overview { overflow: hidden; margin-bottom: 18px; border-top: 3px solid var(--blue); }
.assessment-status-row { display: grid; grid-template-columns: 180px 190px 1fr; border-bottom: 1px solid var(--line); }
.assessment-metric { padding: 18px 20px; border-right: 1px solid var(--line); }
.assessment-metric > span { display: block; color: var(--muted); font-size: 12px; }
.assessment-metric > strong { display: block; margin-top: 3px; font-size: 20px; }
.signing-advice { display: flex; align-items: center; gap: 14px; padding: 16px 20px; color: #64373a; background: var(--high-soft); }
.signing-advice strong { flex: 0 0 auto; color: var(--high); font-size: 13px; }
.signing-advice p { margin: 0; }
.assessment-layers { display: grid; grid-template-columns: repeat(3, 1fr); }
.assessment-layers > section { min-width: 0; padding: 20px; }
.assessment-layers > section + section { border-left: 1px solid var(--line); }
.assessment-layers h2 { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; font-size: 16px; }
.assessment-layers h2 span { display: grid; place-items: center; width: 25px; height: 25px; color: var(--blue); border: 1px solid #bdb4a9; border-radius: 50%; font-size: 12px; }
.assessment-layers ul, .assessment-layers ol { margin: 0; padding-left: 20px; }
.assessment-layers li + li { margin-top: 8px; }
.summary-paragraph-link { padding: 0; color: var(--blue); background: transparent; border: 0; cursor: pointer; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.overall-opinion-card { margin: 0 18px 18px; overflow: hidden; background: #fffdf9; border: 2px solid #dab8b5; border-left: 6px solid var(--blue); border-radius: 9px; }
.overall-opinion-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 15px; color: var(--blue); background: var(--high-soft); border-bottom: 1px solid #dfbfbc; }
.overall-opinion-heading h2 { margin: 0; color: var(--navy); font-size: 16px; }
.overall-opinion-heading p { margin: 2px 0 0; color: #77565a; font-size: 11px; }
.overall-opinion-heading > span { padding: 4px 9px; color: var(--blue); background: var(--surface); border: 1px solid #dab8b5; border-radius: 999px; white-space: nowrap; font-size: 11px; font-weight: 800; }
.overall-opinion-preview { display: -webkit-box; margin: 0; padding: 15px 16px; overflow: hidden; white-space: pre-line; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.overall-opinion-details { border-top: 1px solid var(--line); }
.overall-opinion-details summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 64px; padding: 10px 12px 10px 16px; color: var(--navy); background: #fffaf5; cursor: pointer; list-style: none; }
.overall-opinion-details summary::-webkit-details-marker { display: none; }
.overall-opinion-details summary:hover { background: #fbf0ea; }
.overall-opinion-details summary:focus-visible { outline: 3px solid rgba(142,47,51,.24); outline-offset: -3px; }
.overall-opinion-toggle-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.overall-opinion-toggle-copy strong { color: var(--blue); font-size: 14px; }
.overall-opinion-toggle-copy small { color: var(--muted); font-size: 11px; font-weight: 400; }
.overall-opinion-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 116px; min-height: 40px; padding: 8px 12px; color: #fff; background: var(--blue); border: 2px solid var(--blue); border-radius: 7px; box-shadow: 0 4px 10px rgba(142,47,51,.16); white-space: nowrap; font-size: 13px; font-weight: 800; }
.overall-opinion-action b { font-size: 17px; line-height: 1; transition: transform .18s ease; }
.overall-opinion-details[open] .overall-opinion-action { color: var(--blue); background: var(--surface); }
.overall-opinion-details[open] .overall-opinion-action b { transform: rotate(180deg); }
.overall-opinion-full { padding: 16px; background: #faf6ee; border-top: 1px solid var(--line); }
.overall-opinion-full p { width: 100%; margin: 0; white-space: pre-line; line-height: 1.8; text-align: justify; text-justify: inter-ideograph; overflow-wrap: anywhere; line-break: strict; }
.overall-opinion-card.is-expanded .overall-opinion-preview { display: none; }
.contract-meta-strip { margin-bottom: 25px; padding: 16px 20px; box-shadow: none; }
.contract-meta-strip dl { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin: 0; }
.contract-meta-strip dl div { min-width: 0; }
.contract-meta-strip dt { color: var(--muted); font-size: 13px; line-height: 1.4; }
.contract-meta-strip dd { margin: 4px 0 0; font-size: 16px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
.review-workbench-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 38px 0 15px; }
.review-workbench-heading h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; color: var(--navy); font-size: 26px; font-weight: 900; letter-spacing: .02em; }
.review-workbench-heading h2::before { content: ""; width: 6px; height: 27px; background: var(--blue); border-radius: 3px; box-shadow: 0 0 0 3px rgba(142,47,51,.09); }
.review-workbench-heading p { margin: 0 0 0 16px; color: var(--muted); font-size: 13px; }
.review-workbench { display: grid; grid-template-columns: minmax(0, 3fr) minmax(390px, 2fr); height: min(960px, calc(133vh - 146px)); min-height: 740px; overflow: hidden; box-shadow: 0 10px 28px rgba(59, 50, 42, .065); }
.source-pane, .risk-pane { min-width: 0; min-height: 0; }
.source-pane { display: grid; grid-template-rows: auto auto 1fr; background: #fbf8f2; border-right: 1px solid var(--line); }
.risk-pane { display: grid; grid-template-rows: auto 1fr; background: var(--surface); }
.workbench-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.workbench-panel-heading h3 { margin: 0; font-size: 18px; }
.workbench-panel-heading p { margin: 1px 0 0; color: var(--muted); font-size: 12px; }
.workbench-panel-heading > span { color: var(--muted); font-size: 12px; }
.source-annotation-tip { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 18px; color: #5e4630; background: #fff7e5; border-bottom: 1px solid #e3cf9e; }
.source-annotation-tip-icon { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; color: #fff; background: var(--blue); border-radius: 50%; font-size: 13px; font-weight: 900; font-family: Georgia, serif; }
.source-annotation-tip > span:last-child { display: flex; min-width: 0; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.source-annotation-tip strong { color: var(--blue); font-size: 13px; }
.source-annotation-tip small { color: #706354; font-size: 11px; }
.source-scroll, .risk-pane-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.source-scroll { padding: 18px 20px 84px; scroll-padding-bottom: 84px; }
.source-instruction { margin: 0 0 14px 52px; color: var(--muted); font-size: 12px; }
.source-margin-guide { display: grid; grid-template-columns: minmax(0, 1fr) 188px; gap: 16px; margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.source-margin-guide span:first-child { padding-left: 48px; }
.source-margin-guide .source-margin-guide-action { display: flex; align-items: center; gap: 5px; padding-left: 10px; color: #6d4e33; border-left: 1px solid #ded5ca; font-weight: 800; }
.source-margin-guide .source-margin-guide-action span { flex: 0 0 auto; padding: 0; }
.source-paragraph { display: grid; grid-template-columns: 48px 1fr; width: 100%; margin: 0; padding: 11px 8px 11px 0; color: var(--ink); background: transparent; border: 0; border-radius: 0; text-align: left; scroll-margin: 20px; }
.source-paragraph-meta { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; color: var(--muted); font-size: 10px; }
.source-paragraph-meta strong { color: var(--blue); font-size: 11px; }
.source-paragraph-text { margin: 0; white-space: pre-wrap; font-size: 15px; line-height: 1.85; }
.contract-subheading { padding-top: 18px; padding-bottom: 10px; }
.contract-subheading .source-paragraph-text { color: var(--navy); font-size: 18px; font-weight: 800; line-height: 1.55; letter-spacing: .01em; }
.source-text-trigger { padding: 0; color: var(--ink); background: transparent; border: 0; cursor: pointer; text-align: left; }
.source-risk-marker { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; width: 100%; min-height: 58px; margin: 0; padding: 9px 8px 9px 11px; color: var(--medium); background: transparent; border: 0; border-bottom: 1px solid #e5d9cc; cursor: pointer; font-size: 12px; text-align: left; }
.source-risk-marker:last-child { border-bottom: 0; }
.source-risk-marker:hover { background: #f7eee4; }
.source-risk-marker-copy { display: block; min-width: 0; }
.source-risk-marker-copy strong { display: block; color: var(--navy); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.source-risk-marker-copy > span { display: inline-flex; align-items: center; min-height: 22px; margin-top: 5px; padding: 2px 8px; color: var(--muted); background: #f4f0e9; border: 1px solid #ddd4c8; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1; }
.source-risk-marker-arrow { flex: 0 0 auto; color: var(--muted); font-size: 17px; line-height: 1; }
.risk-marker-high:not([aria-current="true"]) { box-shadow: inset 3px 0 0 #c8474e; }
.risk-marker-medium:not([aria-current="true"]) { box-shadow: inset 3px 0 0 #b77a08; }
.risk-marker-low:not([aria-current="true"]) { box-shadow: inset 3px 0 0 #4f7c80; }
.risk-marker-high .source-risk-marker-copy > span { color: var(--high); background: var(--high-soft); border-color: #efc2c0; }
.risk-marker-medium .source-risk-marker-copy > span { color: var(--medium); background: var(--medium-soft); border-color: #e7cd82; }
.risk-marker-low .source-risk-marker-copy > span { color: var(--low); background: var(--low-soft); border-color: #bfd2d0; }
.source-risk-group { margin: 0; color: var(--ink); scroll-margin-block: 24px 72px; }
.source-risk-group-body { display: grid; grid-template-columns: minmax(0, 1fr) 188px; gap: 16px; align-items: stretch; }
.source-risk-copy { min-width: 0; border-left: 3px solid transparent; border-radius: 5px; transition: background .18s, box-shadow .18s, border-color .18s; }
.source-margin-notes { min-width: 0; align-self: start; margin: 5px 0 12px; overflow: hidden; background: #fffaf3; border: 1px solid #d5c5b4; border-radius: 9px; box-shadow: 0 5px 14px rgba(59,50,42,.05); }
.source-margin-notes-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; padding: 8px 9px; color: #6d4e33; background: #f2e8db; border-bottom: 1px solid #ddcfbf; }
.source-margin-notes-heading strong { min-width: 0; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.source-margin-notes-heading > .source-risk-summary { display: inline-flex; flex: 0 0 auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 2px 4px; font-size: 11px; font-weight: 900; line-height: 1.45; }
.source-risk-count { white-space: nowrap; }
.source-risk-count-high { color: var(--high); }
.source-risk-count-medium { color: var(--medium); }
.source-risk-count-low { color: var(--low); }
.source-risk-separator { color: #9c9185; }
.source-margin-note-list { display: block; }
.current-view-label { display: inline-flex !important; grid-column: 2; grid-row: 1; align-items: center; justify-content: center; min-width: 54px; min-height: 26px; margin: 0 !important; padding: 4px 8px; color: #fff !important; background: var(--blue); border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1; white-space: nowrap; writing-mode: horizontal-tb; }
.current-view-label[hidden] { display: none !important; }
.source-risk-marker[aria-current="true"] .source-risk-marker-arrow { display: none; }
.source-risk-group:hover .source-risk-copy { background: #fffaf3; }
.source-risk-group.is-selected .source-risk-copy { background: #fff6e7; border-left-color: var(--high); box-shadow: inset 0 0 0 1px #ecd0cb; }
.source-risk-group.source-group-medium.is-selected .source-risk-copy { border-left-color: var(--medium); box-shadow: inset 0 0 0 1px #e3d29d; }
.source-risk-group.source-group-low.is-selected .source-risk-copy { background: #eef7f4; border-left-color: var(--low); box-shadow: inset 0 0 0 1px #c5d8d2; }
.source-risk-marker[aria-current="true"] { color: var(--high); background: #fff0ee; box-shadow: inset 4px 0 0 var(--high); padding-left: 13px; }
.source-risk-marker[aria-current="true"] strong { color: var(--high); }
.risk-marker-medium[aria-current="true"] { color: var(--medium); background: #fff7de; box-shadow: inset 4px 0 0 var(--medium); }
.risk-marker-medium[aria-current="true"] strong { color: var(--medium); }
.risk-marker-low[aria-current="true"] { color: var(--low); background: #edf7f4; box-shadow: inset 4px 0 0 var(--low); }
.risk-marker-low[aria-current="true"] strong { color: var(--low); }
.source-risk-marker:focus-visible, .source-text-trigger:focus-visible { outline: 3px solid rgba(142,47,51,.28); outline-offset: 2px; }
.risk-navigation { display: grid; grid-template-columns: 34px auto 34px; align-items: center; gap: 8px; }
.risk-detail-panel[hidden] { display: none !important; }
.risk-navigation button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: var(--navy); background: transparent; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.risk-navigation strong { min-width: 56px; color: var(--blue); text-align: center; font-size: 12px; }
.risk-pane-scroll { padding: 18px; }
.risk-detail-title { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.risk-detail-title h3 { margin: 0; font-size: 20px; }
.risk-source-reference { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.risk-source-reference > span { margin-right: 2px; }
.risk-source-reference em { font-style: normal; }
.risk-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.risk-detail-block { min-height: 150px; padding: 0 16px 16px; overflow: hidden; background: var(--surface); border: 2px solid #dfbfbc; border-radius: 8px; box-shadow: 0 5px 14px rgba(59,50,42,.055); }
.risk-detail-block h4 { display: flex; align-items: center; gap: 9px; margin: 0 -16px 12px; padding: 11px 14px; color: var(--high); background: #f9ecea; border-bottom: 2px solid #dfbfbc; font-size: 14px; }
.risk-detail-block h4::before { content: ""; width: 5px; height: 20px; border-radius: 3px; background: currentColor; }
.risk-detail-block h4 span { color: var(--navy); font-weight: 800; }
.risk-detail-block p { margin: 0; white-space: pre-wrap; }
.risk-consequence { background: #fffdf8; border-color: #ddcb92; }
.risk-consequence h4 { color: var(--medium); background: #fbf3da; border-bottom-color: #ddcb92; }
.risk-suggestion { background: #fbfefc; border-color: #b8d3c4; }
.risk-suggestion h4 { color: var(--success); background: #e8f3ed; border-bottom-color: #b8d3c4; }
.risk-clause { background: #fbfdfd; border-color: #b9cdca; }
.risk-clause h4 { color: var(--low); background: #e8f1f0; border-bottom-color: #b9cdca; }
.risk-issue-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.risk-issue-rail button { min-height: 43px; padding: 7px 9px; color: var(--muted); background: #faf7f2; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; text-align: left; }
.risk-issue-rail button span { margin-right: 5px; font-weight: 800; }
.risk-issue-rail button.active { color: var(--blue); background: var(--high-soft); border-color: #deb0ad; }
.risk-issue-rail button[hidden] { display: none; }
.followup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.error-page { text-align: center; margin: 10vh auto; padding: 50px; max-width: 650px; }
.error-page > span { font-size: 60px; color: #b8c3cd; font-weight: 800; }
.retention-notice { margin: 0 0 16px; padding: 10px 14px; color: #6c4e25; background: #fff8e5; border: 1px solid #e3cf98; border-radius: 8px; font-size: 13px; line-height: 1.6; }
.retention-notice strong { color: #8a5a00; }

@media (min-width: 901px) {
  .home-hero h1 { white-space: nowrap; }
}

@media (max-width: 900px) {
  .hero, .login-layout, .summary-grid, .result-layout { grid-template-columns: 1fr; }
  .hero { gap: 25px; padding: 38px 30px; }
  .home-hero-grid { grid-template-columns: 1fr; gap: 28px; padding: 32px; }
  .home-workflow { margin: 0 32px; }
  .home-records-head { grid-template-columns: 1fr; gap: 16px; }
  .home-record-stats { justify-content: flex-start; }
  .home-record-stats span:first-child { padding-left: 0; }
  .home-record-filters { width: 100%; }
  .home-record-filters input { flex: 1; }
  .login-layout { gap: 30px; }.login-intro { padding-left: 0; }
  .original-panel { position: static; max-height: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .nav-actions > a { display: none; }
  .assessment-status-row { grid-template-columns: 1fr 1fr; }
  .overall-opinion-heading { align-items: flex-start; flex-direction: column; }
  .overall-opinion-details summary { align-items: stretch; flex-direction: column; }
  .overall-opinion-action { width: 100%; }
  .signing-advice { grid-column: 1 / -1; }
  .assessment-layers { grid-template-columns: 1fr; }
  .assessment-layers > section + section { border-left: 0; border-top: 1px solid var(--line); }
  .contract-meta-strip dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .review-workbench { grid-template-columns: 1fr; height: auto; max-height: none; }
  .source-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .source-scroll, .risk-pane-scroll { max-height: 610px; }
  .source-margin-guide, .source-risk-group-body { grid-template-columns: minmax(0, 1fr) 176px; gap: 12px; }
  .followup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .container { width: min(100% - 28px, 1180px); }
  .page-shell { padding-top: 22px; }
  .topbar-inner { height: 64px; gap: 12px; }
  .brand { gap: 9px; }
  .brand-logo { width: 92px; }
  .brand-text { font-size: 17px; }
  .topbar .user-name { display: none; }
  .nav-actions a.active::after { bottom: -20px; }
  .hero-actions, .page-heading, .section-heading { align-items: stretch; flex-direction: column; }
  .home-hero-grid { padding: 24px 20px 18px; }
  .home-workflow { grid-template-columns: 1fr; gap: 12px; margin: 0 20px; }
  .home-workflow li { justify-content: flex-start; }
  .home-workflow li + li::before { display: none; }
  .home-record-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
  .home-record-stats span { min-width: 0; padding: 0 10px; }
  .home-record-filters { flex-direction: column; }
  .home-record-filters input, .home-record-filters select { width: 100%; }
  .form-grid, .detail-grid, .contract-meta dl, .summary-top { grid-template-columns: 1fr; }
  .detail-grid > div:nth-child(odd) { border-right: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-card { padding: 20px; }
  .assessment-status-row { grid-template-columns: 1fr; }
  .assessment-metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .signing-advice { grid-column: auto; align-items: flex-start; flex-direction: column; }
  .contract-meta-strip dl { grid-template-columns: 1fr 1fr; }
  .review-workbench-heading { align-items: stretch; flex-direction: column; }
  .risk-detail-grid { grid-template-columns: 1fr; }
  .source-scroll, .risk-pane-scroll { padding: 14px; }
  .source-margin-guide { display: none; }
  .source-risk-group-body { display: block; }
  .source-margin-notes { display: block; margin: 0 0 12px 48px; }
  .source-margin-note-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-risk-marker:nth-child(odd) { border-right: 1px solid #e5d9cc; }
  .source-risk-marker { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  body { background: #fff; font-size: 10pt; }
  .container { width: 100%; }.page-shell { padding: 0; }.no-print, .site-footer, .topbar { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
  .result-layout, .summary-grid { display: block; }.original-panel { position: static; max-height: none; margin-top: 20px; }
  .issue-card, .summary-main, .contract-meta { margin-bottom: 12px; }
  .result-main .section-heading { margin-top: 22px; }
  .original-panel { break-before: page; }
  .detail-grid { display: block; }.detail-grid > div { border-right: 0 !important; }
  .print-only { display: inline; }
  .assessment-layers, .assessment-status-row, .contract-meta-strip dl { display: grid; }
  .review-workbench { display: block; height: auto; overflow: visible; border: 0; }
  .source-pane { display: block; border: 0; }
  .source-scroll, .risk-pane-scroll { overflow: visible; max-height: none; padding: 0; }
  .source-paragraph { break-inside: avoid; }
  .risk-pane { display: block; margin-top: 24px; }
  .risk-detail-panel { display: block !important; break-inside: avoid; margin-bottom: 18px; }
  .risk-detail-grid { display: grid; }
}
