:root {
  color-scheme: light;
  --canvas: #f7f9fc;
  --paper: #fff;
  --ink: #171f2d;
  --muted: #4b586e;
  --line: #dce3ee;
  --deep: #102747;
  --accent: #235da8;
  --accent-strong: #164b8c;
  --soft-blue: #edf5ff;
  --green: #165946;
  --green-bg: #dbf4e9;
  --red: #8c2943;
  --red-bg: #fae3e9;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #529cdb; outline-offset: 3px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
a { color: var(--accent-strong); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
p { line-height: 1.6; }
h1, h2, h3, p { margin-block-start: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h3 { font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.content, .header-inner { width: min(1290px, calc(100% - 80px)); margin: 0 auto; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.brand { color: var(--ink); display: inline-flex; align-items: center; gap: 0; text-decoration: none; font-size: 1.35rem; font-weight: 750; letter-spacing: -.065em; }
.brand > span:last-child { color: var(--accent); }
.brand-mark { position: relative; margin-inline-end: 10px; width: 26px; height: 26px; border-radius: 7px; background: var(--deep); display: inline-block; }
.brand-mark:before, .brand-mark:after { content: ""; position: absolute; height: 2px; left: 6px; border-radius: 2px; transform: rotate(-23deg); }
.brand-mark:before { width: 15px; top: 9px; background: #eef7ff; }
.brand-mark:after { width: 15px; top: 15px; background: #73c7cd; }
nav { align-self: stretch; display: flex; gap: 28px; }
nav button { border: 0; background: none; color: var(--muted); font-size: .94rem; padding: 0 2px; border-bottom: 2px solid transparent; }
nav button[aria-current="page"] { color: var(--accent-strong); border-bottom-color: var(--accent); font-weight: 650; }
.search-area { position: relative; overflow: clip; background: radial-gradient(ellipse at 83% 10%, #23456d 0%, #142c50 43%, #102747 70%); color: #fff; }
.search-area:not(.compact)::before { content: ""; position: absolute; top: -290px; right: -220px; width: 800px; height: 900px; opacity: .36; transform: rotate(29deg); background: repeating-linear-gradient(90deg, transparent 0 40px, #6589b07a 41px 42px), repeating-linear-gradient(0deg, transparent 0 40px, #6589b07a 41px 42px); mask-image: radial-gradient(ellipse, #000 20%, transparent 69%); pointer-events: none; }
.search-inner { position: relative; width: min(1290px, calc(100% - 80px)); margin: 0 auto; padding: 75px 0 66px; }
.eyebrow { color: #a8cfe8; font-size: .81rem; letter-spacing: .095em; font-weight: 700; text-transform: uppercase; margin-bottom: 18px; }
.small-line { display: inline-block; vertical-align: middle; width: 22px; height: 2px; margin-right: 8px; background: #5faab5; }
.hero-copy h1 { font-size: clamp(3.2rem, 7vw, 6rem); line-height: 1.03; letter-spacing: -.064em; margin-bottom: 15px; }
.hero-copy h1 em { color: #a2dbe1; font-weight: 400; }
.hero-description { color: #d4e1ee; max-width: 670px; margin-bottom: 28px; font-size: 1.13rem; }
.search-form { display: flex; align-items: stretch; width: min(100%, 720px); gap: 5px; border: 1px solid #deeafb; box-shadow: 0 8px 25px #06172d58; padding: 5px; background: white; color: var(--ink); border-radius: 10px; }
.search-language { flex: 0 0 min(30%, 155px); border-right: 1px solid var(--line); }
.search-form select, .search-form input { min-height: 41px; border: 0; background-color: white; }
select { color: var(--ink); padding: 8px 32px 8px 11px; border: 1px solid var(--line); border-radius: 7px; appearance: none; background: #fff linear-gradient(45deg, transparent 50%, #576d89 50%) calc(100% - 15px) 54% / 5px 5px no-repeat; background-image: linear-gradient(45deg, transparent 50%, #576d89 50%), linear-gradient(135deg, #576d89 50%, transparent 50%); background-position: calc(100% - 15px) 54%, calc(100% - 10px) 54%; background-size: 5px 5px; background-repeat: no-repeat; max-width: 100%; }
.search-form select { width: 100%; font-size: .92rem; }
.search-input { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; padding-left: 9px; }
.search-input input { color: var(--ink); width: 100%; min-width: 0; }
.search-icon { display: inline-block; width: 13px; height: 13px; flex: 0 0 13px; border: 1.6px solid #557291; border-radius: 50%; position: relative; margin-right: 2px; }
.search-icon::after { position: absolute; width: 6px; height: 1.5px; right: -4px; bottom: -2px; background: #557291; transform: rotate(46deg); content: ""; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 12px; background: var(--paper); color: var(--ink); font-size: .875rem; font-weight: 650; text-decoration: none; }
.button:hover, .icon-button:hover { border-color: #a6bad3; background: #f1f6fd; }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.primary:hover { background: var(--accent-strong); }
.suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; color: #c9d9e9; font-size: .875rem; }
.suggestions span { margin-right: 5px; }
.suggestions button { background: #ffffff0d; border: 1px solid #acc9e253; color: #eef6ff; padding: 5px 10px; border-radius: 5px; }
.suggestions button:hover { background: #ffffff24; }
.search-results { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; width: min(720px, 100%); overflow: hidden; margin-top: 8px; box-shadow: 0 8px 25px #06172d20; }
.search-results button { display: block; width: 100%; text-align: start; padding: 10px 15px; background: var(--paper); color: var(--ink); border: 0; border-bottom: 1px solid var(--line); }
.search-results button:last-child { border-bottom: 0; }
.search-results button:hover { background: var(--soft-blue); }
.search-results p { margin: 0; padding: 12px 15px; }
.search-results span { display: block; font-size: .875rem; color: var(--muted); margin-top: 4px; }
.search-area.compact { background: #eaf1f9; border-bottom: 1px solid var(--line); }
.compact .search-inner { padding: 15px 0; }
.compact .search-form { box-shadow: none; border-color: #cedaeb; }
.compact .hero-copy, .compact .suggestions { display: none; }

.start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 29px 0 44px; }
.start article { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 23px; }
.start h2 { margin: 12px 0 7px; font-size: 1.48rem; letter-spacing: -.02em; }
.start p { margin: 0; color: var(--muted); }
.mode-mark { width: 43px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: .83rem; font-weight: 700; color: var(--accent-strong); background: var(--soft-blue); }
.mode-mark i { font-style: normal; }
.revision-mark { gap: 4px; }
.revision-mark i { width: 3px; background: var(--accent); border-radius: 2px; height: 12px; }
.revision-mark i:nth-child(2) { height: 22px; }
.revision-mark i:nth-child(3) { height: 17px; }
.edition-mark { gap: 3px; background: #ebf7f5; color: #28665d; }
.insight-mark { background: #f4edff; color: #634391; font-size: 1.4rem; }
.workspace, .library { padding-top: 29px; padding-bottom: 42px; min-height: 60vh; }
.workspace-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 13px; margin-bottom: 16px; }
.workspace-head h1, .library h1 { font-size: clamp(2.3rem, 5vw, 3.65rem); line-height: 1.08; letter-spacing: -.042em; margin-bottom: 7px; }
.meta, .muted { color: var(--muted); font-size: .875rem; }
.meta { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px 13px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mode-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.mode-tabs button { padding: 12px 2px; margin-bottom: -1px; color: var(--muted); font-weight: 650; border: 0; background: transparent; border-bottom: 2px solid transparent; }
.mode-tabs button[aria-pressed="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.pane-grid { display: grid; grid-template-columns: minmax(255px, 305px) minmax(0, 1fr); gap: 17px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0; }
.panel-pad { padding: 15px; }
.panel-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 9px; }
.panel-title h2, .panel-title h3 { margin: 0; }
.panel h2, .library h2 { font-size: 1.45rem; letter-spacing: -.025em; }
.panel + .panel, .stack > * + *, .library-list + .library-list { margin-top: 13px; }
.panel :is(p, ul):last-child { margin-bottom: 0; }
.filter-form { padding: 12px 0 4px; display: flex; flex-wrap: wrap; gap: 7px; }
.filter-form input, .date-filter input { max-width: 100%; min-width: 0; }
input:not([type="checkbox"]):not([type="search"]) { border: 1px solid var(--line); padding: 7px 9px; border-radius: 7px; background: white; color: var(--ink); }
.revision-list { max-height: 500px; overflow: auto; border-block: 1px solid var(--line); margin: 9px -15px 12px; }
.revision-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; border-bottom: 1px solid #e9edf4; padding-right: 10px; }
.revision-item:last-child { border-bottom: none; }
.revision-item.active { background: var(--soft-blue); box-shadow: inset 3px 0 var(--accent); }
.revision-item button.revision { text-align: start; min-width: 0; width: 100%; background: none; border: 0; padding: 10px 7px 10px 15px; color: var(--ink); }
.revision-item button.revision:hover { background: #edf5ff7d; }
.revision time { display: block; font-weight: 650; font-size: .9rem; }
.revision small { display: block; font-size: .8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.icon-button { border: 1px solid transparent; background: transparent; color: var(--accent-strong); border-radius: 6px; padding: 4px 7px; font-weight: 700; }
.finding-dot { font-size: .78rem; color: #563599; background: #eee8fd; border-radius: 4px; padding: 1px 4px; margin-left: 5px; }
.active-author { color: var(--accent-strong); background: var(--soft-blue); border-radius: 7px; padding: 8px 9px; margin-top: 10px; font-size: .88rem; }
.range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.field-label { display: block; color: var(--muted); font-size: .875rem; font-weight: 640; margin-bottom: 5px; }
.range select, .wide { width: 100%; }
.findings { background: #faf8ff; border-color: #ded6ee; }
.findings .button { border-color: #dacdf2; color: #553782; }
.ai-label { display: inline-flex; align-items: center; gap: 7px; color: #563782; font-weight: 700; margin: 0; }
.ai-label span { font-size: 1.2rem; }
.finding-list { display: grid; gap: 8px; list-style: none; padding: 0; margin: 10px 0 0; }
.finding { background: #fff; width: 100%; text-align: start; border: 1px solid #e2d9ef; border-radius: 7px; color: var(--ink); padding: 9px 10px; font-size: .91rem; line-height: 1.45; }
.finding:hover, .finding[aria-current="true"] { border-color: #9f82cd; background: #f8f3ff; }
.category { display: inline-block; font-size: .78rem; font-weight: 750; color: #64428c; margin-right: 7px; }
.status { padding: 11px 0; margin: 0; font-size: .9rem; color: var(--muted); }
.status.error { color: #852442; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split > :nth-child(even) { border-inline-start: 1px solid var(--line); }
.split-label { background: #f3f6fb; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.split-label strong { display: block; margin-bottom: 4px; overflow-wrap: anywhere; }
.split-label .meta { font-size: .8125rem; }
.passage { padding: 16px 15px 20px; min-height: 155px; font: 400 1.06rem/1.68 Georgia, "Times New Roman", serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.passage .absent { font: 400 .9rem/1.55 -apple-system, BlinkMacSystemFont, sans-serif; color: var(--muted); }
del, ins, mark { border-radius: 2px; text-decoration: none; }
del { color: var(--red); background: var(--red-bg); text-decoration: line-through; text-decoration-thickness: 1px; }
ins { color: var(--green); background: var(--green-bg); }
mark { color: #3d2765; background: #f0e5ff; box-shadow: 0 1px #9c75c3; }
.compare-toolbar { padding: 12px 13px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.compare-toolbar .field-label { margin: 0; }
.compare-toolbar select { min-width: min(100%, 200px); max-width: min(100%, 370px); }
.compare-toolbar h2 { margin: 0; }
.legend { display: flex; font-size: .81rem; gap: 10px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.legend .removed::before { background: #dd91a4; }
.legend .added::before { background: #77c6a7; }
.split > .section-picker { border-bottom: 1px solid var(--line); padding: 10px 13px; }
.section-picker select { width: 100%; }
.source-note { font-size: .8125rem; color: var(--muted); padding: 8px 13px; border-top: 1px solid var(--line); margin: 0; }
details summary { cursor: pointer; color: var(--accent-strong); font-size: .9rem; font-weight: 650; }
.credit-list, .library-list ul { list-style: none; padding: 0; }
.credit-list li, .library-list li { padding: 8px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag { border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; color: var(--muted); font-size: .79rem; }
.library-list { padding: 16px 18px; }
.library-list h2 { margin-bottom: 6px; }
.text-button { color: var(--accent-strong); background: none; border: 0; text-align: start; text-decoration: underline; text-underline-offset: .15em; padding: 0; }
.site-footer { background: var(--paper); border-top: 1px solid var(--line); }
.footer-inner { display: flex; padding-top: 16px; padding-bottom: 16px; gap: 19px; align-items: baseline; }
.footer-inner > span { font-weight: 720; }
.footer-inner p { margin: 0; font-size: .8125rem; color: var(--muted); }
.record-dialog { width: min(410px, calc(100% - 36px)); border: 1px solid var(--line); border-radius: 11px; padding: 20px; box-shadow: 0 14px 40px #0c1d3a40; color: var(--ink); }
.record-dialog::backdrop { background: #06152a70; }
.dialog-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dialog-top h2 { margin: 0; }
.favorite-control { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.record-dialog input:not([type="checkbox"]) { width: 100%; }
.dialog-actions { display: flex; justify-content: end; margin-top: 15px; }
.notification:not(:empty) { position: fixed; z-index: 2; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--deep); color: white; padding: 9px 14px; border-radius: 7px; max-width: min(90%, 500px); box-shadow: 0 8px 25px #08183044; }

@media (max-width: 850px) {
  .content, .header-inner, .search-inner { width: calc(100% - 36px); }
  .pane-grid { grid-template-columns: minmax(200px, 235px) minmax(0, 1fr); gap: 11px; }
  .range { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .range .button { grid-column: 1 / -1; justify-self: start; }
  .start { gap: 8px; }
  .start article { padding: 14px; }
}

@media (max-width: 620px) {
  .search-inner { padding: 44px 0 36px; }
  .start, .pane-grid { grid-template-columns: minmax(0, 1fr); }
  .start { padding-top: 16px; padding-bottom: 22px; }
  .start article { padding: 14px 15px; }
  .start h2 { font-size: 1.3rem; }
  .revision-list { max-height: 240px; }
  .search-form { flex-wrap: wrap; }
  .search-form .search-input { flex-basis: 60%; }
  .search-form .button { margin-left: auto; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .passage { padding: 11px 9px; font-size: 1rem; line-height: 1.55; }
  .split-label, .split > .section-picker { padding-left: 9px; padding-right: 9px; }
  .footer-inner { gap: 10px; }
}
