:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
  --ink: #172033;
  --muted: #667085;
  --line: #dce3ec;
  --panel: rgba(255,255,255,.92);
  --soft: #f5f8fc;
  --nav: #0f172a;
  --blue: #1669e8;
  --blue2: #0ea5e9;
  --green: #0f9f6e;
  --amber: #b7791f;
  --danger: #b42318;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(15,23,42,.07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 80% -10%, #e6f4ff 0, transparent 28%), #f4f7fb; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.skip-link { position: fixed; left: -999px; top: 12px; z-index: 100; background: white; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { left: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: var(--nav); color: #dbe6f5; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid #41506a; border-radius: 11px; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(145deg,#192744,#0d1323); }
.brand strong { display: block; color: #fff; font-size: 16px; }.brand small { display: block; color: #8fa1bb; font-size: 10px; margin-top: 2px; }
.sidebar nav { display: grid; gap: 4px; }.nav-item { text-decoration: none; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #9db0ca; font-size: 14px; }.nav-item:hover { background: #17233b; color: #e8eef8; }.nav-item.active { background: #1b2a46; color: white; box-shadow: inset 3px 0 0 #4db7ff; }.nav-item span:first-child { width: 20px; text-align: center; color: #7dc9ff; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #26344d; padding: 16px 8px 0; display: grid; gap: 8px; }.sidebar-foot div { display: flex; justify-content: space-between; font-size: 12px; color: #98a8bd; }.sidebar-foot strong { color: white; }.sidebar-foot small { margin-top: 8px; color: #687990; font-size: 10px; }
.main { min-width: 0; padding: 38px clamp(22px,4vw,62px) 72px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; gap: 26px; align-items: end; margin-bottom: 26px; }.page-header h1 { margin: 4px 0 8px; font-size: clamp(30px,4vw,48px); line-height: 1.05; letter-spacing: -.045em; color: #101828; }.page-header p { max-width: 800px; margin: 0; color: var(--muted); line-height: 1.7; }.eyebrow,.kicker { color: #527092; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.button { appearance: none; border: 1px solid #cbd5e1; background: white; color: #24334d; border-radius: 10px; padding: 10px 14px; cursor: pointer; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }.button:hover { border-color: #98a9bd; box-shadow: 0 3px 10px rgba(15,23,42,.06); }.button.primary { color: white; border-color: #1769e8; background: linear-gradient(135deg,#1769e8,#0b86cf); }.button.small { padding: 8px 10px; font-size: 12px; }.button.danger { color: #fff; background: var(--danger); border-color: var(--danger); }.text-button { border: 0; background: transparent; color: var(--blue); padding: 8px 2px; cursor: pointer; font-weight: 700; font-size: 12px; }.file-button input { display: none; }
.metrics-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }.metric { padding: 19px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }.metric span,.metric small { display: block; color: var(--muted); font-size: 11px; }.metric strong { display: block; margin: 10px 0 5px; font-size: 27px; letter-spacing: -.04em; color: #10213b; }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }.two-col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; margin-bottom: 18px; }.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 18px; }.section-head h2,.panel h2 { margin: 3px 0 0; color: #14223a; font-size: 19px; }.section-head a { color: var(--blue); font-size: 12px; text-decoration: none; font-weight: 700; }
.progress-row { display: grid; gap: 6px; }.progress-row>div:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }.progress-row span { color: var(--muted); }.progress-row strong { color: #334155; }.track { height: 7px; background: #edf1f7; overflow: hidden; border-radius: 99px; }.track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#2d72e8,#20a4d9); }.dimension-stack { display: grid; gap: 13px; }
.callout { margin-top: 18px; padding: 13px 14px; background: #f1f7ff; border: 1px solid #d5e7fb; border-radius: 11px; color: #42556f; font-size: 12px; line-height: 1.65; }.callout.warning { background: #fff9ea; border-color: #f4dfaa; color: #6c5525; }.empty { padding: 30px 18px; border: 1px dashed #cdd7e5; border-radius: 12px; color: var(--muted); text-align: center; line-height: 1.7; background: #fbfcfe; }.compact-list { display: grid; gap: 8px; }.compact-row { text-decoration: none; display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; border: 1px solid #e5eaf1; border-radius: 10px; }.compact-row:hover { background: #f8fbff; }.compact-row strong,.compact-row small { display: block; }.compact-row small { color: var(--muted); margin-top: 3px; font-size: 10px; }.compact-row>span { color: var(--blue); font-weight: 800; }.session-feature { display: flex; justify-content: space-between; gap: 20px; align-items: center; }.session-feature h3 { margin: 10px 0 5px; }.session-feature p { color: var(--muted); margin: 0; font-size: 12px; }.session-feature>div:last-child { min-width: 120px; text-align: right; }.session-feature>div:last-child strong { display: block; font-size: 28px; color: #153257; }.session-feature>div:last-child small { color: var(--muted); }
.reader-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.45fr); gap: 18px; }.reader-input label { display: grid; gap: 7px; font-size: 12px; font-weight: 750; color: #44536a; }.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }.form-row:has(select) { grid-template-columns: minmax(200px,320px); }.reader-input input,.reader-input select,.reader-input textarea,.search { width: 100%; border: 1px solid #cfd8e5; border-radius: 10px; background: #fff; padding: 10px 12px; outline: none; color: #19263a; }.reader-input textarea { min-height: 300px; resize: vertical; line-height: 1.65; margin-bottom: 13px; }.reader-input input:focus,.reader-input select:focus,.reader-input textarea:focus,.search:focus { border-color: #5ca4ff; box-shadow: 0 0 0 3px rgba(64,145,255,.12); }.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }.muted { color: var(--muted); font-size: 11px; }.clean-list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 4px; }.clean-list li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #edf1f5; font-size: 12px; }.clean-list li span { color: var(--muted); }
.analysis-section { margin-top: 26px; }.inline-metrics { display: flex; gap: 8px; flex-wrap: wrap; }.inline-metrics span,.badge { display: inline-flex; padding: 5px 8px; border-radius: 99px; background: #eef5ff; color: #2c5f9f; font-size: 10px; font-weight: 800; }.badge.ghost { background: #f2f4f7; color: #667085; margin-left: 5px; }.candidate-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }.candidate-card { position: relative; padding: 18px; border: 1px solid #dce3ec; border-radius: 16px; background: rgba(255,255,255,.9); }.candidate-card.high { border-color: #b7d7fb; box-shadow: inset 0 3px 0 #3f8cec; }.candidate-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }.rank { font-size: 10px; font-weight: 800; color: #8b98aa; }.score { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #10213b; color: #fff; font-size: 12px; font-weight: 800; }.candidate-card h3 { margin: 10px 0 7px; font-size: 22px; letter-spacing: -.025em; }.definition { margin: 0; color: #475467; line-height: 1.65; font-size: 13px; }.candidate-card blockquote,.modal blockquote { margin: 13px 0; padding: 11px 12px; border-left: 3px solid #9cc8fb; background: #f6faff; color: #4a5b72; font-size: 12px; line-height: 1.65; }.candidate-meta { display: flex; justify-content: space-between; color: #7a8798; font-size: 10px; padding-top: 2px; margin-bottom: 10px; }
.library-list { display: grid; gap: 10px; }.library-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 2px; border-bottom: 1px solid #edf1f5; }.library-row:last-child { border-bottom: 0; }.library-row h3 { margin: 8px 0 4px; }.library-row p { color: var(--muted); margin: 0; font-size: 11px; }.library-stats { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 10px; }.library-stats span { text-align: center; }.library-stats strong { display: block; color: #263a58; font-size: 15px; }
.knowledge-layout { display: grid; grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr); gap: 18px; }.knowledge-list-panel { padding: 14px; }.search { margin-bottom: 10px; }.knowledge-list { display: grid; gap: 5px; max-height: 68vh; overflow: auto; }.knowledge-row { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 11px; cursor: pointer; display: flex; justify-content: space-between; text-align: left; align-items: center; }.knowledge-row:hover { background: #f5f8fc; }.knowledge-row.active { border-color: #c5dcf7; background: #eff6ff; }.knowledge-row strong,.knowledge-row small { display: block; }.knowledge-row small { color: var(--muted); margin-top: 3px; font-size: 10px; }.knowledge-row>span { color: #2767b7; font-size: 11px; font-weight: 800; }.object-head { display: flex; justify-content: space-between; gap: 24px; }.object-head h2 { font-size: 32px; margin: 12px 0 8px; letter-spacing: -.035em; }.object-head p { color: #526173; line-height: 1.7; }.mastery-ring { flex: 0 0 92px; height: 92px; border-radius: 50%; border: 8px solid #e8f2ff; display: grid; place-content: center; text-align: center; box-shadow: inset 0 0 0 1px #cbe1fa; }.mastery-ring strong { font-size: 20px; color: #194f8e; }.mastery-ring small { color: var(--muted); font-size: 9px; }.knowledge-detail>.dimension-stack { margin: 22px 0; }.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.detail-grid section { padding: 14px; background: #f8fafc; border: 1px solid #e7ecf2; border-radius: 11px; }.detail-grid p,.detail-grid ul { margin: 8px 0 0; color: #4d5c70; font-size: 12px; line-height: 1.65; }.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }.chips button,.chips span { border: 1px solid #d7e0eb; background: white; border-radius: 99px; padding: 6px 9px; font-size: 10px; color: #4b5d75; cursor: pointer; }
.review-layout { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(280px,.7fr); gap: 18px; }.review-card { min-height: 440px; display: flex; flex-direction: column; justify-content: center; }.review-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }.review-card h2 { font-size: 36px; margin: 18px 0 14px; }.review-prompt { white-space: normal; font-size: 18px; line-height: 1.8; color: #29384d; margin-bottom: 26px; }.answer { background: #f5f9ff; border: 1px solid #d8e8fb; border-radius: 13px; padding: 16px; margin-bottom: 16px; }.answer p { line-height: 1.75; color: #425571; font-size: 13px; }.grade-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }.grade-grid button { border: 1px solid #d4dde8; background: white; border-radius: 10px; padding: 11px; cursor: pointer; color: #233650; font-weight: 800; }.grade-grid button:hover { border-color: #76aef0; background: #f5f9ff; }.grade-grid small { color: var(--muted); font-weight: 600; }.review-side .dimension-stack { margin-top: 16px; }
.timeline { display: grid; }.timeline>div { display: grid; grid-template-columns: 110px 1fr 90px; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf1f5; align-items: center; font-size: 11px; }.timeline span { color: var(--muted); }.timeline strong { color: #314158; }.timeline em { text-align: right; color: #2867b2; font-style: normal; font-weight: 800; }.danger-zone { border-color: #f0d2cf; margin-top: 18px; }.danger-zone p { color: var(--muted); }
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(8,15,28,.58); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }.modal { position: relative; max-width: 720px; max-height: 88vh; overflow: auto; width: 100%; background: white; border-radius: 18px; padding: 26px; box-shadow: 0 35px 80px rgba(0,0,0,.25); }.modal-close { position: absolute; right: 16px; top: 12px; border: 0; background: transparent; font-size: 28px; color: #778499; cursor: pointer; }.modal h2 { font-size: 32px; margin: 12px 0; }.modal h3 { margin-top: 22px; font-size: 14px; }.modal p,.modal li { color: #536176; line-height: 1.7; font-size: 13px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; padding: 11px 15px; border-radius: 10px; background: #10213b; color: white; box-shadow: 0 12px 30px rgba(15,23,42,.2); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; font-size: 12px; }.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }.sidebar { position: sticky; z-index: 30; height: auto; padding: 10px 14px; flex-direction: row; align-items: center; gap: 12px; overflow-x: auto; }.brand small,.sidebar-foot { display: none; }.brand-mark { width: 34px; height: 34px; }.sidebar nav { display: flex; gap: 2px; }.nav-item { white-space: nowrap; padding: 8px 10px; }.main { padding-top: 28px; }.metrics-grid { grid-template-columns: repeat(2,1fr); }.reader-layout,.review-layout,.knowledge-layout { grid-template-columns: 1fr; }.knowledge-list { max-height: 320px; }
}
@media (max-width: 680px) {
  .brand>div:last-child { display: none; }.nav-item span:first-child { display: none; }.main { padding: 22px 14px 55px; }.page-header { align-items: start; flex-direction: column; }.page-header h1 { font-size: 34px; }.metrics-grid,.two-col,.candidate-grid,.detail-grid { grid-template-columns: 1fr; }.form-row { grid-template-columns: 1fr; }.session-feature,.library-row { align-items: start; flex-direction: column; }.library-stats { width: 100%; justify-content: space-between; }.grade-grid { grid-template-columns: repeat(2,1fr); }.object-head { flex-direction: column; }.mastery-ring { width: 84px; height: 84px; }.timeline>div { grid-template-columns: 84px 1fr 65px; }.candidate-card blockquote { max-height: 120px; overflow: auto; }
}
.manual-capture { margin-top: 18px; border-top: 1px solid #e8edf4; padding-top: 14px; }
.manual-capture summary { cursor: pointer; color: #385b83; font-size: 12px; font-weight: 750; margin-bottom: 12px; }
.manual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.manual-capture .muted { margin-left: 8px; }
@media (max-width: 680px) { .manual-grid { grid-template-columns: 1fr; } }

/* Document Intelligence 1.1 */
.file-drop { display:flex; align-items:center; gap:14px; padding:18px; margin-bottom:18px; border:1.5px dashed #b9c9dc; border-radius:16px; background:linear-gradient(180deg,#fbfdff,#f5f9ff); transition:.18s ease; }
.file-drop.dragging { border-color:#4b91e8; background:#edf6ff; transform:translateY(-1px); }
.file-drop.busy { opacity:.72; }
.file-drop-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:12px; background:#e9f3ff; color:#2d70bd; font-size:22px; font-weight:800; }
.file-drop>div:nth-child(3) { flex:1; min-width:0; }
.file-drop strong,.file-drop span { display:block; }
.file-drop span { margin-top:4px; color:var(--muted); font-size:10px; line-height:1.5; }
.document-strip { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:12px 14px; margin:-6px 0 16px; border:1px solid #dce8f5; border-radius:12px; background:#f8fbff; }
.document-strip>div { min-width:0; }.document-strip strong,.document-strip small { display:block; }.document-strip strong { margin:4px 0 2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }.document-strip small { color:var(--muted); font-size:10px; }
.reader-actions { flex-wrap:wrap; }.backend-line { display:flex; align-items:center; gap:7px; margin-top:10px; color:#8b5b24; font-size:10px; }.backend-line.ready { color:#2d6a4f; }.status-dot { width:7px; height:7px; border-radius:50%; background:#d39a52; box-shadow:0 0 0 4px rgba(211,154,82,.12); }.backend-line.ready .status-dot { background:#40a16d; box-shadow:0 0 0 4px rgba(64,161,109,.12); }
.section-pills { display:flex; gap:7px; flex-wrap:wrap; }.section-pills span { padding:7px 10px; border:1px solid #d9e3ef; border-radius:999px; background:#fff; color:#51647d; font-size:10px; }
.thesis-panel { border-color:#c9ddf5; background:linear-gradient(180deg,#fbfdff,#f4f9ff); }.thesis-panel h3 { margin:8px 0; font-size:22px; line-height:1.45; }.thesis-panel p { margin:0; color:#53657e; line-height:1.75; }
.document-map-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:14px 0; }.document-map-grid h3 { margin:8px 0 14px; }.document-map-grid h4 { margin:16px 0 6px; font-size:11px; text-transform:uppercase; letter-spacing:.07em; color:#6e7d91; }.document-map-grid p,.document-map-grid li { color:#4c5d74; line-height:1.65; font-size:12px; }.document-map-grid ul { padding-left:17px; }
.argument-chain { display:grid; gap:0; }.argument-chain>div { display:grid; grid-template-columns:34px 170px 1fr; gap:12px; align-items:start; padding:13px 0; border-bottom:1px solid #edf1f5; }.argument-chain>div:last-child { border-bottom:0; }.argument-chain span { width:28px; height:28px; display:grid; place-items:center; border-radius:50%; background:#eaf4ff; color:#2367b3; font-size:10px; font-weight:800; }.argument-chain strong { color:#263a58; }.argument-chain p { margin:0; color:#536176; line-height:1.65; font-size:12px; }
.section-map { display:grid; }.section-map article { display:grid; grid-template-columns:42px 1fr; gap:12px; padding:15px 0; border-bottom:1px solid #edf1f5; }.section-map article:last-child { border-bottom:0; }.section-map article>span { color:#91a0b2; font-size:10px; font-weight:800; padding-top:4px; }.section-map h4 { margin:0 0 7px; font-size:14px; }.section-map p,.section-map li { color:#536176; line-height:1.65; font-size:12px; }.section-map ul { margin:7px 0; padding-left:18px; }.section-map small { display:block; color:#3974b6; margin-top:7px; }
.concept-table { display:grid; }.concept-row { display:grid; grid-template-columns:38px minmax(0,1fr) auto; gap:14px; align-items:start; padding:16px 0; border-bottom:1px solid #edf1f5; }.concept-row:last-child { border-bottom:0; }.concept-index { color:#9aa6b5; font-size:10px; font-weight:800; padding-top:5px; }.concept-main>div { display:flex; gap:8px; flex-wrap:wrap; align-items:baseline; }.concept-main strong { font-size:15px; }.concept-main>div>span { color:#326baa; font-size:12px; }.concept-main em { color:#98a4b2; font-size:9px; font-style:normal; text-transform:uppercase; letter-spacing:.05em; }.concept-main p { margin:6px 0 4px; color:#4b5d75; line-height:1.65; font-size:12px; }.concept-main small { color:#738197; }.concept-main blockquote { margin:9px 0; padding:9px 11px; border-left:3px solid #b9d8fb; background:#f8fbff; color:#52657c; font-size:11px; line-height:1.6; }.mini-line { color:#718096; font-size:10px; margin-top:5px; }
.expression-list { display:grid; gap:10px; max-height:760px; overflow:auto; padding-right:3px; }.expression-list article { padding:12px; border:1px solid #e5ebf2; border-radius:12px; background:#fbfcfe; }.expression-list strong { display:block; }.expression-list span { display:inline-block; margin:5px 0; padding:3px 7px; border-radius:99px; background:#edf5ff; color:#3372ba; font-size:9px; text-transform:uppercase; }.expression-list p { margin:2px 0 7px; color:#536176; font-size:12px; }.expression-list blockquote { margin:6px 0; padding-left:9px; border-left:2px solid #c5d8ef; color:#65768b; font-size:10px; line-height:1.6; }
.relation-list { display:grid; gap:8px; }.relation-list>div { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:8px; padding:10px; border:1px solid #e6ebf1; border-radius:10px; align-items:center; }.relation-list span { color:#3474bb; font-size:9px; text-transform:uppercase; }.relation-list p { grid-column:1/-1; margin:0; color:#64748b; font-size:10px; line-height:1.5; }
.translation-progress { height:8px; border-radius:99px; background:#e7edf4; overflow:hidden; margin-bottom:12px; }.translation-progress i { display:block; height:100%; background:#4c91e6; border-radius:inherit; transition:width .2s ease; }.bilingual-list { display:grid; gap:14px; }.bilingual-list article { display:grid; grid-template-columns:1fr 1fr; border:1px solid #e0e7ef; border-radius:14px; overflow:hidden; background:white; }.bilingual-list article>div { padding:16px; }.bilingual-list .source { background:#fbfcfe; border-right:1px solid #e7edf3; }.bilingual-list span { display:block; margin-bottom:8px; color:#6f8094; font-size:9px; font-weight:800; letter-spacing:.08em; }.bilingual-list p { white-space:pre-wrap; margin:0; color:#40536c; line-height:1.75; font-size:12px; }.bilingual-list .translation p { color:#293a51; }
@media (max-width: 1100px) { .document-map-grid { grid-template-columns:1fr; } .argument-chain>div { grid-template-columns:34px 130px 1fr; } }
@media (max-width: 680px) { .file-drop,.document-strip { align-items:flex-start; flex-direction:column; }.concept-row { grid-template-columns:28px 1fr; }.concept-row>button { grid-column:2; justify-self:start; }.argument-chain>div { grid-template-columns:30px 1fr; }.argument-chain p { grid-column:2; }.bilingual-list article { grid-template-columns:1fr; }.bilingual-list .source { border-right:0; border-bottom:1px solid #e7edf3; } }

/* ContextLab 1.1.3 — cost-aware document intelligence */
.mode-explainer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  margin: 10px 0 14px;
  border: 1px solid var(--line, #dbe3ee);
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
}
.mode-explainer strong { color: #0f172a; }
.mode-explainer span { font-size: 13px; line-height: 1.45; }
.mode-explainer em { font-style: normal; font-size: 12px; color: #64748b; white-space: nowrap; }
.ai-run-status {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}
.ai-run-status > div:first-child { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ai-run-status strong { color: #0f172a; }
.ai-run-status span { color: #475569; font-size: 12px; }
.cost-mini { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 9px 0 7px; }
.cost-mini span { font-variant-numeric: tabular-nums; }
.usage-panel {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) 1.6fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}
.usage-panel h3 { margin: 4px 0 6px; }
.usage-panel p { margin: 0; color: #64748b; font-size: 13px; }
.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 8px;
}
.usage-grid span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  background: #f8fafc;
  border-radius: 10px;
}
.usage-grid small { color: #64748b; font-size: 11px; }
.usage-grid strong { color: #0f172a; font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) {
  .mode-explainer { grid-template-columns: 1fr; }
  .mode-explainer em { white-space: normal; }
  .ai-run-status > div:first-child { align-items: flex-start; flex-direction: column; }
  .usage-panel { grid-template-columns: 1fr; }
  .usage-grid { grid-template-columns: repeat(2, minmax(90px, 1fr)); }
}
.cost-control-row { display:flex; gap:14px; align-items:end; margin: 0 0 14px; }
.cost-control-row label { min-width: 180px; margin:0; }
.cost-control-row input { width: 100%; }
.cost-control-row span { color:#64748b; font-size:12px; line-height:1.45; padding-bottom:9px; }
@media (max-width: 700px) { .cost-control-row { flex-direction:column; align-items:stretch; } .cost-control-row label { min-width:0; } }

/* ContextLab 1.1.3 — resumable standard pipeline */
.cost-mini.live { padding-top: 7px; border-top: 1px dashed #bfdbfe; }
.checkpoint-mini { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 8px; }
.checkpoint-mini span { padding:4px 7px; border-radius:999px; border:1px solid #cbd5e1; background:#fff; font-size:10px; }
.checkpoint-mini span.hit { border-color:#bbf7d0; background:#f0fdf4; color:#166534; }
.checkpoint-mini span.fresh { border-color:#bfdbfe; background:#eff6ff; color:#1d4ed8; }

/* ContextLab 1.1.4 adaptive reader */
.inline-input-action{display:flex;gap:8px;align-items:center}.inline-input-action input{flex:1}.auto-profile{display:block;margin-top:6px;color:var(--muted,#64748b);line-height:1.4}.profile-strip{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:10px 12px;margin:10px 0;border:1px solid rgba(148,163,184,.28);border-radius:12px;background:rgba(248,250,252,.8)}.profile-strip span{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted,#64748b)}.profile-strip strong{font-size:14px}.profile-strip em{font-style:normal;font-size:12px;padding:2px 7px;border-radius:999px;background:#eef2ff}.profile-strip small{width:100%;color:var(--muted,#64748b)}
.translation-options{display:flex;gap:10px;align-items:center;margin:10px 0 12px;padding:10px 12px;border:1px solid rgba(148,163,184,.24);border-radius:12px;background:rgba(248,250,252,.65)}.translation-options>div{display:flex;flex-direction:column;gap:2px}.translation-options small{color:var(--muted,#64748b)}.toggle{width:38px;height:22px;border:0;border-radius:999px;background:#cbd5e1;padding:2px;cursor:pointer;display:inline-flex;align-items:center}.toggle span{width:18px;height:18px;border-radius:50%;background:white;display:block;transition:transform .18s ease}.toggle.on{background:#334155}.toggle.on span{transform:translateX(16px)}
.callout.error{border-color:#fecaca;background:#fff7f7;color:#7f1d1d}.translation-section-label{font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--muted,#64748b);margin:0 0 8px}.cost-mini{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--muted,#64748b);margin:8px 0}

/* ContextLab 2.1 Stable — non-overlay Research Reader + product polish */
:root {
  --nav: #0b1220;
  --panel: rgba(255,255,255,.94);
  --line: #d8e1ec;
  --shadow: 0 16px 46px rgba(15,23,42,.065);
  --blue: #1266d6;
}
body { background: radial-gradient(circle at 78% -8%, rgba(183,220,255,.42) 0, transparent 29%), linear-gradient(180deg,#f6f9fd,#f2f6fb 46%,#f5f7fb); }
.main { max-width: 1560px; }
.brand { position:relative; }.release-badge { margin-left:auto; padding:3px 7px; border:1px solid #33455f; border-radius:999px; color:#88bfff; font-size:9px; font-weight:800; letter-spacing:.08em; }
.page-header { padding: 3px 0 4px; }.page-header h1 { font-weight:780; }.page-header p { font-size:14px; }
.panel { backdrop-filter: blur(14px); }
.final-reader { grid-template-columns:minmax(0,1.65fr) minmax(280px,.35fr); }
.controls-row { grid-template-columns: 1fr 1fr 160px !important; }
.source-text-details { margin:12px 0; border:1px solid #dbe4ef; border-radius:12px; background:#fbfdff; overflow:hidden; }
.source-text-details summary { cursor:pointer; padding:12px 14px; color:#52627a; font-size:12px; font-weight:750; }
.source-text-details[open] summary { border-bottom:1px solid #e7edf4; }
.source-text-details textarea { border:0; border-radius:0; margin:0; box-shadow:none!important; background:#fff; }
.translation-options.final { justify-content:space-between; }.translation-options.final>div:last-child { flex:1; }
.reference-choice button { appearance:none; border:1px solid #cbd5e1; background:#fff; color:#475569; border-radius:999px; padding:7px 10px; font-size:11px; font-weight:800; cursor:pointer; }
.reference-choice button.active { border-color:#9bc4f4; background:#eaf4ff; color:#145da6; }
.reader-side.final { background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,251,255,.92)); }
.continue-card { display:flex; justify-content:space-between; gap:24px; align-items:center; margin-bottom:18px; background:linear-gradient(135deg,#ffffff,#f3f8ff); border-color:#cfe0f6; }.continue-card h2{margin:7px 0 6px;font-size:24px}.continue-card p{margin:0;color:var(--muted)}
.document-status-row { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }.document-status-row span { padding:5px 8px; border-radius:999px; background:#eef5ff; color:#355f91; font-size:10px; font-weight:750; }
.final-metrics .metric { min-height:118px; }

.research-reader-section { margin-top:24px; }
.research-reader-toolbar { padding:11px 14px; display:grid; grid-template-columns:auto auto minmax(180px,1fr); gap:14px; align-items:center; box-shadow:none; border-radius:15px; }
.reader-layout-toggle,.sidecar-tabs { display:flex; gap:5px; flex-wrap:wrap; }
.reader-layout-toggle button,.sidecar-tabs button { appearance:none; border:0; background:#eef2f7; color:#5d6a7d; padding:8px 11px; border-radius:9px; font-size:11px; font-weight:800; cursor:pointer; }
.reader-layout-toggle button.active,.sidecar-tabs button.active { background:#13233d; color:#fff; }
.reader-current-section { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#526177; font-size:11px; text-align:right; }
.reader-section-nav { display:flex; gap:7px; overflow:auto; padding:9px 2px 11px; scrollbar-width:thin; }
.reader-section-chip { flex:0 0 auto; border:1px solid #d8e2ef; background:#fff; color:#5b6a80; border-radius:999px; padding:6px 9px; font-size:10px; cursor:pointer; }
.reader-section-chip.active { border-color:#8fbbe9; background:#edf6ff; color:#145fae; }
.research-reader-grid { display:grid; grid-template-columns:minmax(0,1.72fr) minmax(320px,.88fr); min-height:680px; height:min(80vh,980px); border:1px solid #d8e1ec; border-radius:18px; overflow:hidden; background:#fff; box-shadow:var(--shadow); }
.research-reader-grid.focus { grid-template-columns:1fr; }
.research-pdf-pane { min-width:0; min-height:0; background:#2a2f36; border-right:1px solid #d9e2ec; }
.research-reader-grid.focus .research-pdf-pane { border-right:0; }
.research-pdf-frame { width:100%; height:100%; border:0; background:#fff; display:block; }
.research-sidecar { min-width:0; min-height:0; display:flex; flex-direction:column; background:linear-gradient(180deg,#fbfdff,#f5f8fc); }
.sidecar-tabs { padding:10px; border-bottom:1px solid #dde5ee; background:rgba(255,255,255,.96); position:sticky; top:0; z-index:2; }
.sidecar-tabs button { flex:1 1 auto; background:transparent; }
.sidecar-tabs button.active { background:#e9f3ff; color:#155fa8; box-shadow:inset 0 0 0 1px #bfd8f3; }
.sidecar-body { padding:16px; overflow:auto; min-height:0; }
.sidecar-empty { padding:18px; border:1px dashed #cbd8e6; border-radius:13px; background:#fff; color:#617187; font-size:12px; line-height:1.7; }
.sidecar-guide { display:grid; gap:16px; }.sidecar-guide h3,.sidecar-logic h3,.paper-qa h3 { margin:5px 0 8px; font-size:18px; color:#1b2d46; }
.sidecar-guide p,.sidecar-guide li,.sidecar-logic p,.sidecar-logic li,.paper-qa p,.paper-qa li { color:#40536b; font-size:12px; line-height:1.7; }
.guide-status { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }.guide-status>div { padding:11px; border:1px solid #dfe7f0; border-radius:12px; background:#fff; }.guide-status span,.guide-status strong,.guide-status small { display:block; }.guide-status span { color:#6b7890; font-size:9px; text-transform:uppercase; letter-spacing:.08em; }.guide-status strong { font-size:20px; color:#18304f; margin:3px 0; }.guide-status small { color:#8793a3; font-size:9px; }
.translation-preview { padding:10px 11px; margin:7px 0; border-radius:10px; background:#fff; border:1px solid #e0e7ef; }
.sidecar-translation-list { display:grid; gap:10px; }.sidecar-unit { border:1px solid #dbe4ed; border-radius:13px; background:#fff; padding:12px; box-shadow:0 5px 16px rgba(15,23,42,.035); }.sidecar-unit-head { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }.sidecar-unit-head span { padding:2px 6px; border-radius:999px; background:#eef5fd; color:#62758e; font-size:8px; font-weight:800; }.sidecar-zh { margin:0; color:#1e3048; font-size:12.5px; line-height:1.75; }.sidecar-unit details { margin-top:9px; }.sidecar-unit summary { color:#3272b6; font-size:10px; cursor:pointer; }.sidecar-en { color:#56687f; font-size:11px; line-height:1.65; margin:8px 0 0; white-space:pre-wrap; }
.logic-next { margin-top:12px; padding:10px 11px; border-radius:10px; background:#edf6ff; color:#276aa9; font-size:11px; }.mini-chain { display:grid; gap:7px; margin-top:15px; }.mini-chain>div { display:grid; grid-template-columns:25px 1fr; gap:8px; padding:8px 0; border-top:1px solid #e4eaf1; }.mini-chain span { width:23px; height:23px; border-radius:50%; display:grid; place-items:center; background:#eaf3fd; color:#2469aa; font-size:9px; font-weight:800; }.mini-chain p { margin:0; }.mini-chain strong { display:block; color:#23364f; }
.sidecar-concepts { display:grid; gap:9px; }.sidecar-concepts article { border:1px solid #dce5ee; border-radius:12px; background:#fff; padding:11px 12px; }.sidecar-concepts article>div { display:flex; justify-content:space-between; gap:10px; align-items:baseline; }.sidecar-concepts strong { color:#1f334f; }.sidecar-concepts span { color:#2e73b9; font-size:10px; }.sidecar-concepts p { color:#596b81; font-size:11px; line-height:1.6; margin:7px 0; }
.paper-qa textarea { width:100%; resize:vertical; margin:10px 0; min-height:82px; }.paper-qa>.button { width:100%; }.qa-answer { margin-top:14px; border-top:1px solid #dde5ef; padding-top:14px; }.qa-answer>p { color:#23364e; font-size:12.5px; }.qa-citations { display:grid; gap:7px; margin:12px 0; }.qa-citations>span { margin-bottom:2px; }.qa-citations button { display:grid; grid-template-columns:38px 1fr; gap:8px; text-align:left; border:1px solid #dce6f0; background:#fff; border-radius:10px; padding:8px; cursor:pointer; }.qa-citations strong { color:#1768ac; }.qa-citations span { color:#5c6d82; font-size:10px; line-height:1.5; }

.aligned-translation { display:grid; gap:16px; }.translation-group { border:1px solid #dce5ef; border-radius:16px; overflow:hidden; background:#fff; box-shadow:0 8px 24px rgba(15,23,42,.035); }.translation-group-head { position:sticky; top:0; z-index:2; display:flex; justify-content:space-between; gap:14px; padding:11px 14px; background:#f4f8fc; border-bottom:1px solid #e1e8f0; }.translation-group-head strong { color:#20314b; font-size:12px; }.translation-group-head span { color:#718096; font-size:10px; }
.aligned-row { display:grid; grid-template-columns:1fr 1fr; border-bottom:1px solid #edf1f5; }.aligned-row:last-child{border-bottom:0}.aligned-row>div { padding:15px 16px; min-width:0; }.aligned-row .source { background:#fbfcfe; border-right:1px solid #e7edf3; }.aligned-meta { display:flex; gap:7px; margin-bottom:7px; }.aligned-meta span { padding:2px 6px; border-radius:999px; background:#edf4fc; color:#61738c; font-size:8px; font-weight:800; letter-spacing:.06em; }.aligned-row p { margin:0; white-space:pre-wrap; line-height:1.72; font-size:12.5px; color:#354960; }.aligned-row .translation p { color:#1f3047; }

.library-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:18px; }.library-card { display:flex; flex-direction:column; gap:14px; }.library-card-top { display:flex; justify-content:space-between; gap:14px; }.library-card h3 { margin:9px 0 5px; font-size:17px; }.library-card p { margin:0; color:var(--muted); font-size:11px; }.library-date { color:#8693a5; font-size:10px; white-space:nowrap; }.library-progress { display:flex; flex-wrap:wrap; gap:6px; }.library-progress span { padding:5px 8px; border-radius:999px; background:#f2f4f7; color:#667085; font-size:10px; }.library-progress span.done { background:#eef9f3; color:#17724e; }.library-cost { color:#64748b; font-size:10px; }
.knowledge-summary { display:flex; gap:8px; flex-wrap:wrap; margin:-8px 0 14px; }.knowledge-summary span { padding:7px 10px; border:1px solid #dce4ee; border-radius:999px; background:#fff; color:#64748b; font-size:10px; }.knowledge-summary strong { color:#1e3350; font-size:12px; margin-right:3px; }
.next-action-strip { display:flex; justify-content:space-between; gap:14px; align-items:center; padding:13px 14px; margin:14px 0 18px; border-radius:12px; background:linear-gradient(135deg,#eef6ff,#f8fbff); border:1px solid #d4e6fa; }.next-action-strip strong,.next-action-strip small { display:block; }.next-action-strip strong { margin:3px 0; }.next-action-strip small { color:#64748b; font-size:10px; }
.review-progress { height:10px; position:relative; margin:-8px 0 16px; border-radius:999px; background:#e7edf5; overflow:hidden; }.review-progress i { display:block; height:100%; background:linear-gradient(90deg,#2275df,#3eb0d8); }.review-progress span { position:absolute; right:10px; top:-1px; z-index:1; font-size:8px; color:#314259; }.focus-card { min-height:460px; }.reveal-button { margin-top:18px; }
.settings-grid { display:grid; grid-template-columns:1.3fr .7fr; gap:18px; margin-bottom:18px; }.status-list { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:14px; }.status-list span { padding:8px 10px; border-radius:10px; background:#f3f8fd; color:#425873; font-size:11px; }

@media (max-width: 1100px) {
  .final-reader { grid-template-columns:1fr; }
  .research-reader-grid { grid-template-columns:minmax(0,1.4fr) minmax(300px,.8fr); }
  .research-reader-toolbar { grid-template-columns:1fr 1fr; }
  .reader-current-section { grid-column:1/-1; text-align:left; }
  .library-grid { grid-template-columns:1fr; }
}
@media (max-width: 760px) {
  .controls-row { grid-template-columns:1fr !important; }
  .research-reader-grid,.research-reader-grid.focus { grid-template-columns:1fr; height:auto; min-height:0; }
  .research-pdf-pane { height:68vh; min-height:520px; border-right:0; border-bottom:1px solid #d9e2ec; }
  .research-sidecar { max-height:none; }
  .sidecar-body { max-height:none; }
  .research-reader-toolbar { grid-template-columns:1fr; }
  .reader-current-section { grid-column:auto; text-align:left; }
  .aligned-row { grid-template-columns:1fr; }
  .aligned-row .source { border-right:0; border-bottom:1px solid #e7edf3; }
  .continue-card { align-items:flex-start; flex-direction:column; }
  .settings-grid { grid-template-columns:1fr; }
  .status-list { grid-template-columns:1fr; }
}

/* ContextLab 2.2 — Research Workspace visual system */
:root {
  --ink: #142033;
  --muted: #6d7888;
  --line: #e1e7ef;
  --line-strong: #d2dbe7;
  --panel: #ffffff;
  --soft: #f7f9fc;
  --soft-blue: #f1f6fc;
  --nav: #111827;
  --nav-2: #172033;
  --blue: #245fa7;
  --blue2: #3b82b8;
  --green: #1f8a68;
  --amber: #a97122;
  --danger: #b54747;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15,23,42,.045), 0 1px 2px rgba(15,23,42,.03);
  --shadow-hover: 0 16px 38px rgba(15,23,42,.075), 0 2px 5px rgba(15,23,42,.04);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 88% -8%, rgba(217,231,246,.7) 0, rgba(217,231,246,0) 25%),
    linear-gradient(180deg,#f8fafc 0,#f4f7fb 100%);
}

.app-shell { grid-template-columns: 236px minmax(0,1fr); }
.sidebar {
  padding: 20px 14px 18px;
  gap: 18px;
  background:
    radial-gradient(circle at 35% -10%, rgba(81,112,158,.18), transparent 31%),
    linear-gradient(180deg,#111827 0,#101726 100%);
  border-right: 1px solid rgba(255,255,255,.035);
  box-shadow: 10px 0 34px rgba(15,23,42,.035);
}
.brand { gap: 10px; padding: 1px 7px 5px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  border: 1px solid rgba(144,174,214,.25);
  border-radius: 12px;
  background: linear-gradient(145deg,#1d2a42,#121a2a);
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 7px 18px rgba(0,0,0,.12);
}
.brand-mark span { font-size: 13px; font-weight: 800; color: #edf6ff; letter-spacing: -.03em; }
.brand-copy { min-width: 0; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { margin-top: 3px; color: #788aa3; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.release-badge { margin-left: auto; align-self: flex-start; padding: 3px 6px; border: 1px solid #334159; border-radius: 999px; color: #9eb1ca; background: rgba(255,255,255,.025); font-size: 8px; font-weight: 800; }
.sidebar-section-label { padding: 2px 11px 0; margin-top: 2px; color: #56667d; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-section-label.settings-label { margin-top: 8px; }
.sidebar nav { gap: 4px; }
.nav-item {
  min-height: 40px;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #93a4ba;
  font-size: 13px;
  font-weight: 650;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item:hover { background: rgba(255,255,255,.055); color: #e8eef7; transform: translateX(1px); }
.nav-item.active {
  background: linear-gradient(90deg,rgba(71,118,183,.26),rgba(56,85,130,.16));
  color: #f7fbff;
  box-shadow: inset 2px 0 0 #64a5df, inset 0 0 0 1px rgba(110,154,211,.1);
}
.nav-icon { width: 17px; height: 17px; flex: 0 0 17px; color: #6f8daf; }
.nav-item.active .nav-icon { color: #8fc6f0; }
.sidebar-foot { padding: 14px 8px 0; gap: 7px; border-top-color: rgba(255,255,255,.07); }
.sidebar-stat { padding: 1px 2px; }
.local-status { margin-top: 7px; display: flex !important; justify-content: flex-start !important; gap: 7px; align-items: center; color: #65778f !important; }
.local-status i { width: 6px; height: 6px; border-radius: 999px; background: #4ab38d; box-shadow: 0 0 0 3px rgba(74,179,141,.1); }
.local-status span { font-size: 9px; }

.main { max-width: 1600px; padding: 34px clamp(24px,3.6vw,58px) 72px; }
.page-header { align-items: center; margin-bottom: 24px; padding-bottom: 2px; }
.page-title-block { min-width: 0; }
.page-header h1 { margin: 5px 0 7px; font-size: clamp(32px,3.5vw,44px); font-weight: 760; letter-spacing: -.045em; color: #111a29; }
.page-header p { max-width: 850px; color: #758092; line-height: 1.65; font-size: 13px; }
.page-header-action { flex: 0 0 auto; }
.eyebrow,.kicker { color: #66809e; letter-spacing: .16em; font-size: 9px; }

.button {
  min-height: 38px;
  border-color: #d8e0ea;
  border-radius: 10px;
  color: #2b3c53;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.02);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.button:hover { border-color: #b9c6d6; box-shadow: 0 5px 14px rgba(15,23,42,.055); transform: translateY(-1px); }
.button.primary { border-color: #245f9e; background: linear-gradient(135deg,#2d6ba8,#24578c); box-shadow: 0 6px 15px rgba(37,94,158,.16); }
.button.primary:hover { background: linear-gradient(135deg,#28629d,#214f82); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.text-button { color: #2f6ea9; }

.panel {
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  background: rgba(255,255,255,.95);
}
.panel:hover { border-color: #d9e1eb; }
.section-head h2,.panel h2 { color: #1a283d; font-weight: 735; letter-spacing: -.018em; }

.metrics-grid { gap: 12px; }
.metric {
  min-height: 112px;
  padding: 18px 19px;
  border-color: var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.metric::before { content:""; position:absolute; left:0; right:0; top:0; height:2px; background:linear-gradient(90deg,#7da7d3,#c8d9ea); opacity:.78; }
.metric:nth-child(2)::before { background:linear-gradient(90deg,#69a98f,#bfdacc); }
.metric:nth-child(3)::before { background:linear-gradient(90deg,#9a91c6,#d9d2ec); }
.metric:nth-child(4)::before { background:linear-gradient(90deg,#b69a6f,#e5d6bf); }
.metric-label,.metric span,.metric small { color: #7a8595; font-size: 10px; }
.metric strong { margin: 12px 0 5px; font-size: 28px; font-weight: 740; color:#16243a; }
.final-metrics .metric { min-height: 112px; }

.continue-card {
  border-color:#dce5ef;
  background: linear-gradient(120deg,#fff 0,#fbfdff 58%,#f1f6fb 100%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.continue-card::after { content:""; position:absolute; width:220px; height:220px; border-radius:50%; right:-90px; top:-105px; background:radial-gradient(circle,rgba(83,126,177,.12),transparent 67%); pointer-events:none; }

.track { height: 6px; background:#edf1f5; }
.track i { background: linear-gradient(90deg,#467db2,#55a3c5); }
.callout { background:#f5f8fc; border-color:#dde6f0; color:#4f6074; }
.callout.warning { background:#fffaf0; border-color:#eadcbd; color:#715d35; }
.empty { background:#fafbfd; border-color:#d7dee8; }
.badge,.inline-metrics span { background:#f0f5fa; color:#59708b; border:1px solid #e1e8ef; }
.inline-metrics .status-good { background:#eef8f4; color:#39765e; border-color:#d8ebe3; }

.reader-layout.final-reader { grid-template-columns:minmax(0,1.6fr) minmax(280px,.48fr); gap:16px; }
.reader-control-panel { padding:20px; }
.reader-principles { background:linear-gradient(180deg,#fbfdff,#f7f9fc); }
.file-drop {
  min-height: 94px;
  border: 1px dashed #bfcddd;
  background: linear-gradient(180deg,#fbfdff,#f7fafe);
  border-radius: 14px;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.file-drop:hover,.file-drop.dragover { border-color:#7fa8d2; background:#f4f9fe; box-shadow:inset 0 0 0 1px rgba(77,128,180,.05); }
.file-drop-icon { background:#edf4fb !important; color:#3e6f9e !important; border:1px solid #dce8f3; }
.document-strip.final { margin-top:12px; border:1px solid #e1e7ef; background:#fbfcfe; border-radius:12px; padding:12px 13px; }
.document-strip.final strong { font-size:12px; color:#22344b; }
.document-strip.final small { color:#8290a1; }
.reader-input input,.reader-input select,.reader-input textarea,.search,.paper-qa textarea {
  border-color:#d8e0e9;
  border-radius:10px;
  background:#fff;
  transition:border-color .15s ease,box-shadow .15s ease;
}
.reader-input input:focus,.reader-input select:focus,.reader-input textarea:focus,.search:focus,.paper-qa textarea:focus {
  border-color:#7ea8d1;
  box-shadow:0 0 0 3px rgba(68,126,183,.09);
}

.research-reader-section { margin-top:30px; }
.research-reader-head { margin-bottom:14px; align-items:end; }
.research-reader-head h2 { font-size:20px; max-width:760px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.research-reader-toolbar {
  min-height:56px;
  padding:9px 11px;
  grid-template-columns:auto auto auto minmax(160px,1fr);
  gap:12px;
  border-radius:14px 14px 0 0;
  border-bottom-color:#d7e0ea;
  background:rgba(255,255,255,.98);
  box-shadow:none;
}
.workspace-mode-label { display:flex; align-items:center; gap:8px; padding:0 6px; color:#4a596d; font-size:10px; white-space:nowrap; }
.workspace-dot { width:7px; height:7px; border-radius:50%; background:#49a384; box-shadow:0 0 0 3px rgba(73,163,132,.1); }
.reader-layout-toggle { padding:3px; border:1px solid #e0e6ed; background:#f4f6f9; border-radius:10px; }
.reader-layout-toggle button { min-height:30px; padding:6px 10px; border-radius:7px; background:transparent; color:#697689; }
.reader-layout-toggle button.active { background:#fff; color:#253a53; box-shadow:0 1px 4px rgba(15,23,42,.08); }
.lens-page-controls { display:flex; align-items:center; gap:6px; padding:2px 4px; border-left:1px solid #edf0f4; border-right:1px solid #edf0f4; }
.lens-page-controls strong { min-width:42px; text-align:center; font-size:11px; color:#45556a; }
.reader-current-section { color:#68778a; font-size:10px; font-weight:650; }
.reader-section-nav { margin:0; padding:9px 2px 10px; gap:6px; }
.reader-section-chip { border-color:#dfe6ee; color:#69788b; background:rgba(255,255,255,.72); padding:6px 9px; }
.reader-section-chip:hover { border-color:#b9c8d8; background:#fff; }
.reader-section-chip.active { border-color:#b4cce3; background:#edf4fa; color:#315f8c; }
.research-reader-grid {
  min-height:720px;
  height:min(81vh,1020px);
  grid-template-columns:minmax(0,1.68fr) minmax(340px,.82fr);
  border-color:#d7e0ea;
  border-radius:0 0 16px 16px;
  box-shadow:0 18px 42px rgba(15,23,42,.065);
}
.research-pdf-pane { padding:10px; background:linear-gradient(180deg,#2b3037,#22272e); border-right-color:#d7e0ea; }
.research-pdf-frame { border-radius:9px; box-shadow:0 4px 18px rgba(0,0,0,.18); }
.research-sidecar { background:#f7f9fc; }
.sidecar-tabs {
  padding:8px 9px;
  gap:3px;
  background:rgba(255,255,255,.97);
  border-bottom-color:#e0e6ed;
  box-shadow:0 2px 8px rgba(15,23,42,.025);
}
.sidecar-tabs button { padding:8px 9px; border-radius:8px; color:#718095; font-size:10px; }
.sidecar-tabs button:hover { background:#f4f7fa; color:#43546a; }
.sidecar-tabs button.active { background:#edf3f8; color:#285b88; box-shadow:inset 0 0 0 1px #d4e2ef; }
.sidecar-body { padding:16px 16px 22px; }
.sidecar-guide { gap:18px; }
.sidecar-guide h3,.sidecar-logic h3,.paper-qa h3 { font-size:17px; letter-spacing:-.02em; color:#1d2e43; }
.sidecar-guide p,.sidecar-guide li,.sidecar-logic p,.sidecar-logic li,.paper-qa p,.paper-qa li { color:#52647a; font-size:11.5px; line-height:1.72; }
.guide-status { gap:7px; }
.guide-status>div { padding:10px; border-color:#e0e6ed; box-shadow:0 1px 2px rgba(15,23,42,.02); }
.guide-status strong { font-size:18px; }
.translation-preview { border-color:#e2e7ed; box-shadow:0 1px 2px rgba(15,23,42,.018); }
.sidecar-unit,.sidecar-concepts article { border-color:#dfe6ee; box-shadow:0 4px 14px rgba(15,23,42,.028); }
.sidecar-zh { font-size:13px; line-height:1.8; color:#24384f; }
.sidecar-en { color:#718094; }
.logic-next { background:#f0f5fa; color:#3f6e9a; }
.paper-qa>.button { min-height:40px; }
.qa-citations button:hover { border-color:#b8cadb; background:#fbfdff; }

.library-grid { gap:14px; }
.library-card { transition:transform .17s ease,box-shadow .17s ease,border-color .17s ease; }
.library-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-hover); border-color:#d2dce7; }
.library-card h3 { font-size:16px; line-height:1.35; }
.library-progress span { border:1px solid #e6e9ee; background:#f7f8fa; }
.library-progress span.done { border-color:#dbece4; background:#f1f8f5; }

.knowledge-summary span { box-shadow:0 1px 2px rgba(15,23,42,.018); }
.candidate-card { border-color:#e0e6ee; border-radius:14px; box-shadow:0 4px 14px rgba(15,23,42,.025); transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease; }
.candidate-card:hover { transform:translateY(-1px); box-shadow:0 10px 24px rgba(15,23,42,.055); border-color:#ced9e5; }
.candidate-card.high { border-color:#bfd4e8; box-shadow:inset 0 2px 0 #6d99c7,0 4px 14px rgba(15,23,42,.025); }
.score { background:#243b58; }
.next-action-strip { background:linear-gradient(135deg,#f2f6fa,#fbfcfe); border-color:#dce7f1; }

.focus-card { border-color:#dde4ec; box-shadow:var(--shadow); }
.grade-grid button { border-radius:12px !important; }
.review-progress { height:8px; background:#e9edf2; }
.review-progress i { background:linear-gradient(90deg,#4d7fae,#5aa0ba); }

.timeline>div { transition:background .15s ease; }
.timeline>div:hover { background:#f8fafc; }
.settings-grid .panel,.two-col .panel { box-shadow:var(--shadow); }
.danger-zone { border-color:#eadbdb; background:#fffcfc; }

.modal-backdrop { backdrop-filter: blur(6px); background:rgba(10,18,30,.42); }
.modal { border:1px solid #e0e5ec; box-shadow:0 28px 70px rgba(15,23,42,.22); }
.toast { border-radius:11px; box-shadow:0 16px 34px rgba(15,23,42,.16); }

@media (min-width: 1500px) {
  .main { padding-left:58px; padding-right:58px; }
  .research-reader-grid { grid-template-columns:minmax(0,1.75fr) minmax(360px,.75fr); }
}

@media (max-width: 1100px) {
  .research-reader-toolbar { grid-template-columns:auto auto 1fr; }
  .workspace-mode-label { display:none; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns:76px minmax(0,1fr); }
  .sidebar { padding:16px 10px; align-items:stretch; }
  .brand { justify-content:center; padding:0; }
  .brand-copy,.release-badge,.sidebar-section-label,.sidebar-foot { display:none; }
  .brand-mark { width:40px; height:40px; flex-basis:40px; }
  .nav-item { justify-content:center; padding:10px; }
  .nav-item span { display:none; }
  .nav-icon { width:19px; height:19px; }
  .main { padding-left:22px; padding-right:22px; }
}

@media (max-width: 760px) {
  .app-shell { display:block; }
  .sidebar { position:sticky; z-index:20; top:0; width:100%; height:auto; min-height:0; flex-direction:row; align-items:center; padding:9px 10px; gap:8px; overflow-x:auto; }
  .brand { flex:0 0 auto; }
  .brand-mark { width:34px; height:34px; flex-basis:34px; }
  .sidebar nav { display:flex; gap:3px; flex:0 0 auto; }
  .nav-item { width:38px; height:38px; min-height:38px; padding:8px; }
  .main { padding:22px 15px 54px; }
  .page-header { align-items:flex-start; }
  .page-header h1 { font-size:32px; }
  .page-header-action { width:100%; }
  .page-header-action .button { width:100%; }
  .metrics-grid { grid-template-columns:1fr 1fr; }
  .research-reader-grid,.research-reader-grid.focus { border-radius:0 0 14px 14px; }
  .research-reader-toolbar { grid-template-columns:1fr auto; }
  .reader-layout-toggle { order:1; }
  .lens-page-controls { order:2; border-right:0; }
  .reader-current-section { order:3; grid-column:1/-1; }
  .research-reader-head { align-items:flex-start; }
  .research-reader-head h2 { white-space:normal; }
  .research-pdf-pane { padding:6px; height:65vh; }
  .sidecar-tabs { overflow-x:auto; flex-wrap:nowrap; }
  .sidecar-tabs button { flex:0 0 auto; }
}

/* ContextLab 3.2 Candidate — evidence-native research learning system */
:root {
  --cl-bg: #f4f7fb;
  --cl-surface: rgba(255,255,255,.97);
  --cl-surface-soft: #f8fafc;
  --cl-ink: #17263a;
  --cl-muted: #66768a;
  --cl-line: #dbe3ec;
  --cl-line-strong: #c9d5e2;
  --cl-accent: #315f8c;
  --cl-accent-soft: #edf4fa;
  --cl-success: #2f7d63;
  --cl-warning: #9a6a2f;
  --cl-danger: #9a4141;
}
body {
  color: var(--cl-ink);
  background:
    radial-gradient(circle at 83% -9%, rgba(166,205,239,.28) 0, transparent 30%),
    radial-gradient(circle at 8% 105%, rgba(217,228,241,.32) 0, transparent 26%),
    linear-gradient(180deg,#f7f9fc 0,#f3f6fa 48%,#f6f8fb 100%);
}
.page-header { margin-bottom: 24px; }
.page-header .eyebrow { letter-spacing:.12em; font-weight:800; }
.page-header h1 { letter-spacing:-.035em; color:#142337; }
.page-header p { max-width:820px; color:#6b7a8d; line-height:1.65; }
.panel { border-color:var(--cl-line); background:var(--cl-surface); box-shadow:0 10px 32px rgba(27,43,65,.045); }
.metric { border-color:var(--cl-line); box-shadow:0 5px 18px rgba(27,43,65,.035); }
.metric strong { letter-spacing:-.025em; }
.button { border-color:#d6dee8; }
.button.primary { background:#274f75; border-color:#274f75; box-shadow:0 5px 13px rgba(39,79,117,.14); }
.button.primary:hover { background:#203f5d; border-color:#203f5d; }

/* Research reader: paper remains dominant; evidence sidecar is calm and auditable. */
.research-reader-section { margin-top:34px; }
.research-reader-head { padding:0 2px; }
.research-reader-head .inline-metrics { justify-content:flex-end; }
.research-reader-toolbar { border:1px solid var(--cl-line); border-bottom:0; }
.research-reader-grid {
  grid-template-columns:minmax(0,1.78fr) minmax(350px,.72fr);
  height:min(83vh,1080px);
  min-height:740px;
  border-color:var(--cl-line-strong);
  box-shadow:0 20px 54px rgba(20,35,53,.075);
}
.research-pdf-pane { background:#252b32; padding:12px; }
.research-pdf-frame { background:#fff; border:0; }
.research-sidecar { background:#f8fafc; }
.sidecar-body { padding:18px 18px 28px; }
.sidecar-tabs { position:sticky; top:0; z-index:2; }
.sidecar-tabs button { min-height:34px; }
.sidecar-tabs button.active { font-weight:800; }

.evidence-panel { display:grid; gap:12px; }
.evidence-summary {
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:12px 13px; border:1px solid #d7e2ed; border-radius:13px;
  background:linear-gradient(135deg,#f4f8fc,#fff);
}
.evidence-summary>div { display:flex; align-items:baseline; gap:8px; }
.evidence-summary strong { font-size:24px; letter-spacing:-.035em; color:#294f73; }
.evidence-summary span,.evidence-summary small { font-size:10px; color:#758397; }
.evidence-disclaimer { margin:-3px 2px 1px; color:#8591a1; font-size:10px; line-height:1.5; }
.evidence-card {
  padding:13px 13px 12px; border:1px solid #dfe6ee; border-radius:13px;
  background:#fff; box-shadow:0 3px 12px rgba(25,42,62,.028);
}
.evidence-card.confidence-high { border-left:3px solid #4d8a73; }
.evidence-card.confidence-medium { border-left:3px solid #7296b8; }
.evidence-card.confidence-low { border-left:3px solid #c7a56d; }
.evidence-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; }
.evidence-card-head>div { display:flex; align-items:center; gap:5px; flex-wrap:wrap; justify-content:flex-end; }
.evidence-confidence { font-size:9px; text-transform:uppercase; letter-spacing:.07em; color:#8794a4; }
.evidence-card>p { margin:0 0 9px; font-size:12px; line-height:1.65; color:#34485f; }
.evidence-card blockquote { margin:7px 0 0; padding:9px 10px; border-left:2px solid #ccd9e6; border-radius:0 8px 8px 0; background:#f8fafc; color:#617187; font-size:10.5px; line-height:1.62; }
.page-link { min-width:31px; max-width:100%; padding:4px 7px; border:1px solid #d9e3ec; border-radius:999px; background:#fff; color:#365f85; font-size:9px; line-height:1.35; white-space:normal; text-align:left; cursor:pointer; }
.page-link:hover { background:#edf4fa; border-color:#bcd0e1; }
.skim-grid { display:grid; gap:8px; }
.skim-grid button {
  width:100%; text-align:left; padding:10px 11px; border:1px solid #dfe6ee; border-radius:11px;
  background:#fff; cursor:pointer; transition:border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.skim-grid button:hover { border-color:#c3d2df; transform:translateY(-1px); box-shadow:0 6px 16px rgba(27,43,65,.045); }
.skim-grid button span { display:block; margin-bottom:4px; font-size:9px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; color:#527a9e; }
.skim-grid button strong { display:block; color:#2a3d53; font-size:11.5px; line-height:1.55; font-weight:680; }
.skim-grid button small { display:block; margin-top:5px; color:#8a96a5; font-size:9px; }

.translation-qa { display:grid; gap:5px; margin-top:9px; }
.translation-qa span { padding:6px 8px; border:1px solid #ead7b8; border-radius:8px; background:#fffaf1; color:#8a6532; font-size:9.5px; line-height:1.45; }
.qa-badge { border-radius:999px; padding:2px 6px; background:#fff3d9; color:#8e642d; font-weight:800; }
.qa-flag { border-color:#ead7b8!important; }
.sidecar-unit { padding:13px; }
.sidecar-unit-head { display:flex; align-items:center; gap:6px; color:#8794a4; font-size:9px; letter-spacing:.04em; }
.sidecar-unit details summary { margin-top:8px; cursor:pointer; color:#54718f; font-size:10px; }

.paper-notes textarea { width:100%; margin:10px 0; }
.note-list { display:grid; gap:8px; margin-top:14px; }
.note-list article { padding:11px 12px; border:1px solid #dfe6ee; border-radius:11px; background:#fff; }
.note-list article>div { display:flex; align-items:center; gap:8px; color:#758397; font-size:9px; }
.note-list article p { margin:8px 0 0; color:#374c64; line-height:1.6; font-size:11px; }
.note-remove { margin-left:auto; width:24px; height:24px; display:grid; place-items:center; border:0; border-radius:7px; background:transparent; color:#9aa6b3; cursor:pointer; font-size:15px; }
.note-remove:hover { background:#fff1f1; color:#a34b4b; }
.media-list { display:grid; gap:7px; }
.media-list>div { padding:9px 10px; border:1px solid #e0e6ed; border-radius:10px; background:#fff; }
.media-list span { display:block; margin-bottom:3px; color:#52799d; font-size:8px; font-weight:850; text-transform:uppercase; letter-spacing:.08em; }
.media-list p { margin:0; color:#586a80; font-size:10px; line-height:1.5; }

/* Parser evidence and source identity */
.extraction-evidence { display:grid; gap:11px; }
.parser-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.parser-metrics span { padding:9px 10px; border:1px solid #e2e8ef; border-radius:10px; background:#fafbfd; color:#758397; font-size:9px; }
.parser-metrics strong { display:block; margin-bottom:2px; color:#2d435c; font-size:15px; }
.identifier-row { display:flex; flex-wrap:wrap; gap:7px; }
.identifier-row span { padding:5px 8px; border-radius:999px; background:#eef4f9; color:#4a6887; font-size:9px; }

/* Learning loop */
.paper-review-card { margin-bottom:15px; border-top:3px solid #6f93b3; }
.paper-review-card textarea { width:100%; margin:10px 0 12px; }
.paper-due-mini { display:grid; gap:7px; margin-bottom:9px; }
.compact-row.paper { border-left:2px solid #7897b4; }
.metrics-grid.expanded,.final-metrics.expanded { grid-template-columns:repeat(4,minmax(0,1fr)); }

/* Refined workspace ergonomics */
.reader-control-panel { border-top:3px solid #7f9db9; }
.reader-principles { background:linear-gradient(180deg,#fbfcfe,#f6f9fc); }
.reader-principles .clean-list li { padding:10px 0; }
.reader-principles .clean-list strong { color:#29445f; }
.document-skeleton { margin-top:22px; }
.document-skeleton .inline-metrics span { background:#f6f8fb; }
.status-good { color:#34755f!important; background:#eef8f3!important; border-color:#d5eadf!important; }

@media (min-width: 1500px) {
  .research-reader-grid { grid-template-columns:minmax(0,1.9fr) minmax(365px,.70fr); }
}
@media (max-width: 1100px) {
  .parser-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metrics-grid.expanded,.final-metrics.expanded { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .research-reader-grid { height:auto; min-height:0; }
  .research-pdf-pane { height:68vh; }
  .research-sidecar { min-height:460px; }
  .parser-metrics { grid-template-columns:1fr 1fr; }
  .evidence-card-head { align-items:flex-start; }
}
@media (max-width: 520px) {
  .parser-metrics,.metrics-grid.expanded,.final-metrics.expanded { grid-template-columns:1fr; }
}
.metrics-grid.final-metrics:not(.expanded) { grid-template-columns:repeat(auto-fit,minmax(165px,1fr)); }

/* ContextLab 3.2 Candidate 2 — Research workstation refresh */
:root {
  --cl-bg:#f6f7f9;
  --cl-surface:#ffffff;
  --cl-surface-soft:#f9fafb;
  --cl-border:#e4e7ec;
  --cl-border-strong:#d3d8e0;
  --cl-text:#151b26;
  --cl-muted:#697386;
  --cl-accent:#3157d5;
  --cl-accent-soft:#eef2ff;
  --cl-sidebar:#10131a;
  --cl-sidebar-muted:#8d96a8;
  --cl-shadow:0 10px 30px rgba(20,28,45,.06);
}
html { background:var(--cl-bg); }
body { background:var(--cl-bg); color:var(--cl-text); font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.app-shell { background:var(--cl-bg); }
.sidebar { background:var(--cl-sidebar); border-right:1px solid rgba(255,255,255,.06); }
.brand { padding-bottom:20px; }
.brand-mark { background:#fff; color:#111827; box-shadow:none; }
.brand-copy strong { letter-spacing:-.015em; }
.brand-copy small,.sidebar-section-label { color:var(--cl-sidebar-muted); }
.release-badge { border-color:rgba(255,255,255,.12); color:#c6d2ff; background:rgba(99,102,241,.11); }
.nav-item { border-radius:9px; color:#aeb6c6; }
.nav-item:hover { background:rgba(255,255,255,.055); color:#eef1f6; }
.nav-item.active { color:#fff; background:rgba(255,255,255,.09); box-shadow:inset 2px 0 0 #8ea2ff; }
.sidebar-stat,.local-status { border-color:rgba(255,255,255,.08); }
.main { max-width:none; padding:0; min-width:0; }
.workspace-topbar { height:54px; position:sticky; top:0; z-index:20; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:0 28px; border-bottom:1px solid var(--cl-border); background:rgba(250,251,252,.93); backdrop-filter:blur(18px); }
.workspace-crumb { min-width:0; display:flex; align-items:center; gap:8px; color:#98a1af; font-size:11px; }
.workspace-crumb strong { color:#303846; font-size:12px; }
.workspace-crumb span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:48vw; }
.workspace-system { display:flex; gap:7px; align-items:center; flex:0 0 auto; }
.system-pill { display:inline-flex; align-items:center; gap:6px; min-height:27px; padding:0 9px; border:1px solid var(--cl-border); border-radius:999px; background:#fff; color:#5e6878; font-size:9.5px; font-weight:700; }
.system-pill i { width:6px; height:6px; border-radius:50%; background:#a7afba; }
.system-pill.online i { background:#2c9a68; box-shadow:0 0 0 3px rgba(44,154,104,.09); }
.system-pill.offline i { background:#b96b63; }
.system-pill.subtle { color:#8b94a2; background:#f8f9fb; }
.workspace-content { max-width:1640px; margin:0 auto; padding:26px 28px 54px; }
.page-header { margin-bottom:18px; }
.page-header h1 { font-size:clamp(27px,2.4vw,37px); letter-spacing:-.035em; color:#161d2a; }
.page-header p { max-width:820px; color:#657082; }
.panel { background:var(--cl-surface); border-color:var(--cl-border); border-radius:14px; box-shadow:none; backdrop-filter:none; }
.button { border-color:var(--cl-border-strong); background:#fff; color:#374151; box-shadow:none; }
.button:hover { border-color:#bfc6d1; background:#fafbfc; }
.button.primary { background:#202938; border-color:#202938; color:white; }
.button.primary:hover { background:#141b27; border-color:#141b27; }
.text-button { color:#4d61b8; }
.kicker,.eyebrow { color:#778294; letter-spacing:.12em; }
.metric { border-color:var(--cl-border); background:var(--cl-surface); box-shadow:none; }
.metric strong { color:#1c2431; }
.callout { background:#f7f8fb; border-color:#e2e5eb; color:#536071; }

/* Loaded documents become a workstation, not an upload form. */
.reader-layout.final-reader { grid-template-columns:minmax(0,1fr) 320px; gap:14px; }
.reader-control-panel { border-top:1px solid var(--cl-border); }
.reader-layout.has-document .compact-when-loaded { min-height:0; padding:9px 11px; border-style:solid; background:#fafbfc; }
.reader-layout.has-document .compact-when-loaded .file-drop-icon,
.reader-layout.has-document .compact-when-loaded > div:not(.file-drop-icon),
.reader-layout.has-document .compact-when-loaded > .button { display:none; }
.document-strip.final { border:1px solid var(--cl-border); background:#fff; border-radius:11px; }
.document-strip-actions { display:flex; align-items:center; gap:9px; }
.danger-text { color:#9a4e4e!important; }
.reader-principles { background:#fafbfc; }
.reader-principles h2 { letter-spacing:-.025em; }
.reader-actions { position:sticky; bottom:10px; z-index:4; padding:9px; margin:10px -2px -2px; border:1px solid var(--cl-border); border-radius:12px; background:rgba(255,255,255,.94); backdrop-filter:blur(14px); box-shadow:0 8px 26px rgba(20,28,45,.08); }
.backend-line { border-top-color:var(--cl-border); }

/* Three-pane research reader: outline | source | evidence sidecar. */
.research-reader-section { margin-top:28px; }
.research-reader-head { margin-bottom:11px; }
.research-reader-toolbar { grid-template-columns:auto auto auto minmax(160px,1fr); border-radius:12px 12px 0 0; margin-bottom:0; border-bottom:0; padding:9px 11px; }
.research-reader-grid { grid-template-columns:224px minmax(0,1.65fr) minmax(360px,.72fr); height:min(84vh,1040px); min-height:720px; border-color:var(--cl-border-strong); border-radius:0 0 14px 14px; box-shadow:var(--cl-shadow); }
.research-reader-grid.focus { grid-template-columns:1fr; border-radius:0 0 14px 14px; }
.research-outline { min-width:0; min-height:0; display:flex; flex-direction:column; background:#fbfbfc; border-right:1px solid var(--cl-border); }
.outline-head { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:49px; padding:10px 12px; border-bottom:1px solid var(--cl-border); background:#fff; }
.outline-head strong { color:#8a93a1; font-size:9px; font-weight:700; }
.outline-list { padding:7px; overflow:auto; }
.reader-outline-row { width:100%; display:grid; grid-template-columns:24px minmax(0,1fr); gap:7px; align-items:start; border:0; border-radius:8px; padding:8px 7px; background:transparent; text-align:left; cursor:pointer; color:#7b8492; }
.reader-outline-row:hover { background:#f0f2f5; }
.reader-outline-row.active { background:#edf0fa; color:#324a9d; }
.reader-outline-row > span { padding-top:2px; color:#a1a8b3; font-size:8px; font-variant-numeric:tabular-nums; }
.reader-outline-row div { min-width:0; }
.reader-outline-row strong { display:block; overflow:hidden; text-overflow:ellipsis; line-height:1.38; color:#444d5b; font-size:10.5px; font-weight:650; }
.reader-outline-row.active strong { color:#31478f; }
.reader-outline-row small { display:block; margin-top:3px; color:#a0a8b4; font-size:8px; }
.research-pdf-pane { background:#333840; border-right:1px solid var(--cl-border); }
.research-sidecar { background:#fafbfc; }
.sidecar-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; padding:7px; border-bottom-color:var(--cl-border); background:#fff; }
.sidecar-tabs button { min-width:0; padding:7px 5px; border-radius:7px; color:#737d8c; font-size:9.5px; }
.sidecar-tabs button.active { background:#eff2f9; color:#314a9b; box-shadow:none; }
.sidecar-body { padding:14px; }
.sidecar-guide h3,.sidecar-logic h3,.paper-qa h3 { color:#202938; }
.sidecar-empty,.sidecar-unit,.sidecar-concepts article,.guide-status>div,.translation-preview,.media-list>div,.note-list article { border-color:var(--cl-border); border-radius:10px; box-shadow:none; }
.evidence-card { border-radius:10px; box-shadow:none; }
.page-link,.inline-citation { border:0; border-radius:5px; background:#edf1ff; color:#3d56ad; font-size:9px; font-weight:800; cursor:pointer; padding:2px 5px; }
.inline-citation { margin:0 2px; vertical-align:baseline; }

/* Paper QA: visibly separate local retrieval time from provider generation time. */
.paper-qa textarea { border-color:var(--cl-border-strong); background:#fff; }
.qa-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px; }
.qa-actions .button { width:auto; }
.qa-live { margin-top:12px; padding:12px; border:1px solid #dce1ee; border-radius:11px; background:#f9faff; }
.qa-live-head { display:flex; align-items:center; gap:8px; color:#394760; font-size:10px; }
.qa-pulse { width:7px; height:7px; border-radius:50%; background:#526fd7; box-shadow:0 0 0 0 rgba(82,111,215,.35); animation:qaPulse 1.5s infinite; }
@keyframes qaPulse { 70% { box-shadow:0 0 0 7px rgba(82,111,215,0); } 100% { box-shadow:0 0 0 0 rgba(82,111,215,0); } }
.qa-live-metrics { margin-top:6px; color:#8791a1; font-size:9px; font-variant-numeric:tabular-nums; }
.qa-live-answer { min-height:34px; margin-top:11px; color:#263345; white-space:pre-wrap; font-size:12px; line-height:1.68; }
.qa-answer { border-top-color:var(--cl-border); }
.qa-answer-text { color:#243143; font-size:12.5px; line-height:1.78; }
.qa-citations button { grid-template-columns:34px minmax(0,1fr); border-color:var(--cl-border); border-radius:9px; }
.qa-citations button b { display:block; margin-bottom:3px; color:#44506a; font-size:8.5px; font-weight:650; }
.qa-performance { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; margin-top:12px; }
.qa-performance span { padding:8px; border:1px solid var(--cl-border); border-radius:8px; background:#fafbfc; }
.qa-performance small,.qa-performance strong { display:block; }
.qa-performance small { color:#9199a6; font-size:8px; }
.qa-performance strong { margin-top:2px; color:#364154; font-size:10px; font-variant-numeric:tabular-nums; }
.qa-cost { display:block; margin-top:8px; color:#8c95a2; }

/* Dense analytical surfaces. */
.document-map-grid { gap:12px; }
.concept-row,.expression-list article,.translation-group { box-shadow:none; border-color:var(--cl-border); }
.translation-group-head { background:#f8f9fb; border-bottom-color:var(--cl-border); }
.aligned-row .source { background:#fbfbfc; }
.continue-card { background:#fff; border-color:var(--cl-border); }

@media (min-width:1700px) {
  .research-reader-grid { grid-template-columns:238px minmax(0,1.75fr) minmax(390px,.7fr); }
}
@media (max-width:1280px) {
  .reader-layout.final-reader { grid-template-columns:1fr; }
  .reader-side.final { display:none; }
  .research-reader-grid { grid-template-columns:190px minmax(0,1fr) 340px; }
}
@media (max-width:1040px) {
  .workspace-topbar { padding:0 18px; }
  .workspace-content { padding:20px 18px 44px; }
  .research-reader-grid { grid-template-columns:minmax(0,1fr) 340px; }
  .research-outline { display:none; }
}
@media (max-width:760px) {
  .workspace-system .subtle { display:none; }
  .workspace-content { padding:16px 12px 36px; }
  .research-reader-toolbar { grid-template-columns:1fr auto; }
  .reader-current-section { grid-column:1/-1; text-align:left; }
  .research-reader-grid { height:auto; grid-template-columns:1fr; border-radius:0 0 12px 12px; }
  .research-pdf-pane { height:66vh; border-right:0; border-bottom:1px solid var(--cl-border); }
  .research-sidecar { min-height:520px; }
  .qa-performance { grid-template-columns:1fr 1fr; }
}
