:root {
  --paper: #f6f5f0;
  --white: #fff;
  --ink: #233c34;
  --muted: #596b62;
  --line: #dce1d9;
  --green: #234d3e;
  --dark: #153c30;
  --soft: #edf1e9;
  --olive: #617348;
  --amber: #795318;
  --amber-soft: #f6ebd5;
  --red: #963d2e;
  --red-soft: #f8e9e4;
  --radius: 8px;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.55 var(--body); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 4px; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #ab752c; outline-offset: 3px; }
::selection { color: #123c2d; background: #d9e4c3; }
input, textarea { caret-color: var(--green); }
* { scrollbar-width: thin; scrollbar-color: #aab5a6 transparent; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
h4 { font-size: 14px; }
p { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip { position: fixed; top: -100px; left: 16px; background: var(--green); color: white; padding: 12px; z-index: 100; }
.skip:focus { top: 8px; }
.app { display: grid; grid-template-columns: 236px minmax(0,1fr); min-height: 100vh; }
.sidebar { background: var(--dark); color: #e7ede4; padding: 28px 16px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; min-height: 0; }
.brand { display: flex; align-items: center; gap: 16px; padding: 0 12px 26px; font-size: 22px; letter-spacing: .12em; font-weight: 500; text-decoration: none; }
.brand small { display: block; font-size: 10px; letter-spacing: .04em; color: #bbcfc1; margin-top: 2px; }
.monogram { font: italic 44px/1 var(--display); letter-spacing: -.04em; width: 34px; color: inherit; }
.sidebar nav { overflow-y: auto; min-height: 0; padding: 0 4px 0 0; scrollbar-color: #5b7a67 transparent; }
.nav-group + .nav-group { margin-top: 20px; }
.nav-label { font-size: 11px; color: #b7cab9; margin: 0 12px 6px; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 12px; border: 0; border-radius: 5px; background: transparent; width: 100%; min-height: 38px; padding: 8px 12px; margin: 1px 0; text-align: left; color: #d3e0d3; font-size: 12px; }
.nav-item:hover { background: #285342; color: white; }
.nav-item.active { background: #e2ebd7; color: #193d2f; font-weight: 600; }
.nav-icon { flex: 0 0 auto; width: 17px; height: 17px; }
.nav-count { margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; padding-top: 20px; }
.profile { display: flex; gap: 12px; border-top: 1px solid #3a5c4c; padding: 18px 10px 0; align-items: center; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; background: #335846; color: #e2ebd7; border-radius: 50%; font: 17px var(--display); flex-shrink: 0; }
.profile strong { font-size: 12px; font-weight: 500; }
.profile small { display: block; font-size: 11px; color: #b7cab9; }
.shell { min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 68px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 12px 36px; gap: 16px; background: var(--paper); }
.breadcrumbs { font-size: 12px; color: var(--muted); }
.breadcrumbs span { padding: 0 12px; color: #829080; }
.breadcrumbs strong { font-weight: 500; color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-actions > .button { border-color: transparent; background: transparent; padding: 6px; }
.icon-button { border: 1px solid var(--line); border-radius: 5px; background: transparent; width: 40px; height: 40px; color: var(--green); display: inline-grid; place-items: center; }
.menu-toggle { display: none; }
.account-menu { position: relative; font-size: 12px; }
.account-menu summary { display: flex; align-items: center; gap: 8px; padding: 8px; cursor: pointer; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu > div { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 180px; background: white; box-shadow: 0 8px 28px #19392c21; border-radius: 8px; padding: 8px; display: grid; gap: 4px; }
.account-menu .button { justify-content: flex-start; border-color: transparent; }
main { padding: 36px; width: 100%; max-width: 1680px; margin: 0 auto; flex: 1; min-width: 0; }
main:focus { outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 28px; margin-bottom: 32px; }
.page-head h1 { font: 400 clamp(28px,2.5vw,34px)/1.2 var(--display); letter-spacing: -.025em; margin: 0 0 12px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; max-width: 75ch; line-height: 1.65; }
.button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; padding: 10px 15px; background: var(--green); color: white; border: 1px solid var(--green); border-radius: 5px; font-size: 12px; font-weight: 600; text-decoration: none; line-height: 1.4; min-height: 40px; }
.button:hover { background: #173c2f; border-color: #173c2f; }
.button.secondary { background: var(--white); color: var(--ink); border-color: #cdd7ca; }
.button.secondary:hover { background: #edf2e9; border-color: #96ad91; }
.button.text { background: transparent; border: 0; padding-left: 0; justify-content: flex-start; text-align: left; }
.flex-actions, .card-actions, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.page-head > .flex-actions { flex-shrink: 0; }
.muted, .field-help { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; font-size: 11px; }
.field-help { font-size: 12px; font-weight: 400; line-height: 1.65; }
.pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 4px; background: #eaf0e6; color: #355536; font-size: 11px; line-height: 1.4; white-space: normal; }
.pill.amber { color: var(--amber); background: var(--amber-soft); }
.pill.red { color: var(--red); background: var(--red-soft); }
.pill.blue { color: #375f78; background: #e8f0f5; }
label.field { display: grid; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink); min-width: 0; }
input, textarea, select { font: inherit; color: var(--ink); background: white; border: 1px solid #becbbb; border-radius: 5px; padding: 11px 12px; min-width: 0; width: 100%; }
input::placeholder, textarea::placeholder { color: #68776b; opacity: 1; }
input[type=checkbox] { width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--green); }
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.form-stack { display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-error { color: var(--red); font-size: 13px; margin: 0; }
.form-error:empty { display: none; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.6; margin: 14px 0; }
.check input { margin-top: 3px; }
.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 20px 0; }
.toolbar .field { min-width: 240px; flex: 1; }
.toolbar select { width: 100%; }
.table-wrap { max-width: 100%; overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { font-size: 11px; color: var(--muted); text-align: left; padding: 14px 18px; background: #eeeee7; font-weight: 600; white-space: nowrap; }
table.data td { padding: 18px; border-top: 1px solid var(--line); vertical-align: top; max-width: 360px; min-width: 130px; overflow-wrap: anywhere; }
table.data td .button { text-align: left; justify-content: flex-start; white-space: normal; }
table.data td:first-child .button { border: 0; padding: 0; min-height: 28px; background: transparent; color: var(--green); font-size: 13px; }
table.data td p { margin: 8px 0 0; }
table.data tr:hover td { background: #fafbf7; }
.row-title { display: block; margin-top: 8px; color: var(--muted); }
.panel, .card, .live-card { border: 1px solid var(--line); background: white; border-radius: var(--radius); min-width: 0; }
.panel.pad, .card, .live-card { padding: 24px; }
.cards-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.card h3 { font: 22px/1.35 var(--display); margin: 16px 0 12px; }
.card p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.card-actions { margin-top: 20px; }
.empty { padding: 36px 24px; text-align: center; color: var(--muted); background: #f8f9f4; border: 1px dashed #b8c5b2; border-radius: var(--radius); }
.empty h3 { color: var(--ink); font: 23px/1.35 var(--display); margin: 0 0 12px; }
.empty p { max-width: 52ch; margin: 0 auto 20px; line-height: 1.75; font-size: 13px; }
.live-banner { background: var(--soft); border: 1px solid #d6dfcc; border-radius: 6px; padding: 16px 20px; font-size: 13px; line-height: 1.7; margin: 24px 0; }
.live-banner.warning { background: var(--amber-soft); border-color: #e1cfab; color: #685126; }
.prose { white-space: pre-wrap; line-height: 1.85; font-size: 14px; overflow-wrap: anywhere; }
.evidence-quote { border-left: 1px solid #8b9f80; padding: 16px 20px; margin: 16px 0; background: #f1f4eb; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.8; }
.evidence-quote p { margin-bottom: 12px; }
.source-tag { font-size: 11px; color: #506342; }
.question-card { border-top: 1px solid var(--line); padding: 24px 0; margin: 12px 0; }
.question-card h3 { font: 21px/1.5 var(--display); }
.question-card .why { color: var(--muted); font-size: 13px; }
.question-card blockquote { margin: 12px 0; padding: 16px; background: var(--soft); font-size: 13px; }
.document-pick { max-height: 260px; overflow-y: auto; padding: 4px 16px; border: 1px solid var(--line); border-radius: 6px; }
.upload-drop { border: 1px dashed #9cac8e; background: #f1f5e9; border-radius: 6px; padding: 24px; text-align: center; cursor: pointer; font-size: 13px; }
.upload-drop input { margin-top: 16px; }
.report-title { font: 25px/1.3 var(--display); margin: 32px 0 18px; }
.section-gap { margin-top: 32px; }
.section-heading, .panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.section-heading h2, .panel-heading h2 { font: 23px/1.3 var(--display); margin: 0; }
.count { font: 11px var(--body); color: var(--muted); background: #e9ede3; border-radius: 4px; padding: 3px 6px; white-space: nowrap; vertical-align: middle; }
.split-work { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(270px,1fr); gap: 28px; }
.list-line { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.list-line time { color: var(--muted); font-size: 11px; }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 16px 36px; font-size: 10px; color: var(--muted); border-top: 1px solid var(--line); margin-top: auto; }
dialog { border: 0; border-radius: 12px; max-width: 720px; width: calc(100% - 32px); max-height: calc(100dvh - 48px); padding: 32px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 90px #142f3045; overflow-y: auto; }
dialog::backdrop { background: #0e292a80; }
dialog h2 { font: 29px/1.3 var(--display); margin: 0 32px 16px 0; overflow-wrap: anywhere; }
dialog h3 { font-size: 16px; margin: 28px 0 16px; }
dialog p { font-size: 13px; }
dialog .flex-actions { margin: 24px 0; }
dialog #close-modal { position: sticky; float: right; bottom: 0; margin-top: 24px; z-index: 3; }
#modal-body > details { margin: 20px 0; padding: 14px 0; border-block: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--dark); color: white; padding: 14px 20px; border-radius: 8px; font-size: 13px; box-shadow: 0 5px 25px #18392f20; z-index: 100; max-width: min(600px,calc(100% - 32px)); display: none; }
#toast.show { display: block; }
@media (prefers-reduced-motion:no-preference) { button,a { transition: background .16s ease-out, border-color .16s ease-out, color .16s ease-out; } }
@media print { .sidebar,.topbar,.app-footer,.matter-context,.actions,.button,.reader-tabs { display: none!important; }.app { display: block; } main { padding: 0; } .panel { break-inside: avoid; } }
