:root {
  color-scheme: light;
  --ink: #152019;
  --muted: #68756d;
  --line: #dce4de;
  --paper: #fbfcf8;
  --panel: rgba(255, 255, 255, .9);
  --green: #236a45;
  --green-dark: #17482f;
  --lime: #d9f36b;
  --soft: #edf3ee;
  --danger: #b42318;
  font-family: "Noto Sans", "Segoe UI", Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; }
button, input, select { font: inherit; }
.hidden { display: none !important; }
.topbar {
  height: 72px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(35, 106, 69, .12); background: rgba(251, 252, 248, .88);
  backdrop-filter: blur(14px); position: relative; z-index: 2;
}
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 760; }
.brand-mark {
  width: 36px; height: 36px; display: block;
}
.top-note { color: var(--muted); font-size: 13px; letter-spacing: .06em; }
.landing-main {
  width: 100%; max-width: 100%;
  min-height: calc(100vh - 72px); padding: 42px 5vw 56px;
  background:
    radial-gradient(circle at 14% 18%, rgba(217, 243, 107, .25), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(35, 106, 69, .12), transparent 24%);
}
.hero {
  width: min(1200px, 100%); max-width: 100%; height: calc(100vh - 170px);
  min-height: 600px; max-height: 720px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(28px, 5vw, 72px); align-items: stretch;
}
.hero > *, .hero-copy, .create-card, .token-result > * { min-width: 0; }
.hero-copy { align-self: center; margin-top: 0; }
.eyebrow, .step-label { color: var(--green); letter-spacing: .16em; font-size: 12px; font-weight: 800; }
.hero-copy h1 { font-family: Georgia, serif; font-size: clamp(46px, 5vw, 68px); line-height: 1.06; margin: 18px 0 22px; font-weight: 500; letter-spacing: -.04em; }
.hero-copy h1 span { color: var(--green); }
.hero-copy > p { color: var(--muted); max-width: 620px; font-size: 17px; line-height: 1.72; }
.feature-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 28px; }
.feature-row span { padding: 8px 13px; border: 1px solid #cad9ce; background: rgba(255,255,255,.65); border-radius: 999px; color: #405248; font-size: 13px; }
.card-mode-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
  margin-bottom: 24px; padding: 5px; border-radius: 13px; background: #edf2ee;
}
.card-mode-switch button {
  border: 0; border-radius: 9px; padding: 10px 12px;
  background: transparent; color: #617067; font-weight: 750; cursor: pointer;
}
.card-mode-switch button.active {
  background: white; color: var(--green-dark);
  box-shadow: 0 4px 12px rgba(24, 65, 42, .09);
}
.existing-workspace { display: grid; gap: 15px; }
.existing-intro {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 13px; align-items: center;
  padding: 15px; border: 1px solid #d9e3dc; border-radius: 14px; background: #f6f9f6;
}
.existing-key-mark {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 13px; background: #234d35; color: white;
  font-family: Georgia, serif; font-size: 21px;
}
.existing-intro strong { display: block; font-size: 15px; }
.existing-intro p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.existing-token-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.existing-token-row input {
  min-width: 0; height: 43px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.existing-token-row button {
  height: 43px; padding: 0 15px; border: 0; border-radius: 10px;
  background: #263c30; color: white; font-weight: 750; cursor: pointer;
}
.existing-token-row button:hover { background: #172a20; }
.existing-token-row button:disabled { opacity: .58; cursor: wait; }
.existing-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.existing-details > div {
  padding: 16px 14px; border: 1px solid #e0e5e1; border-radius: 12px; background: white;
}
.existing-details span {
  display: block; color: #78827b; font-size: 9px; font-weight: 850; letter-spacing: .1em;
}
.existing-details strong { display: block; margin-top: 5px; font-size: 13px; }
.existing-details p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.existing-help {
  padding: 14px; border-radius: 11px; background: #f1f3ed; color: #4d574f;
}
.existing-help strong { display: block; font-size: 12px; }
.existing-help p { margin: 4px 0 0; font-size: 11px; line-height: 1.45; }
.existing-help code {
  padding: 1px 5px; border-radius: 5px; background: #e1e5dc;
  color: #304438; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.existing-workspace .form-message { min-height: 0; margin: -3px 2px 0; }
.existing-workspace .form-message:empty { display: none; }
.existing-card-heading { margin-bottom: 18px; }
.create-card {
  width: 100%; max-width: 100%;
  min-height: 570px; align-self: center; margin-top: 0;
  display: flex; flex-direction: column;
  padding: 25px; border: 1px solid rgba(35, 106, 69, .16); border-radius: 22px;
  background: var(--panel); box-shadow: 0 30px 80px rgba(24, 65, 42, .12);
}
.create-card > [role="tabpanel"] { flex: 1; }
.card-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 19px; }
.card-heading h2, .token-result h2 { margin: 5px 0 0; font-size: 26px; }
.retention-badge { padding: 7px 10px; border-radius: 999px; background: #f0f5dc; color: #52641c; font-size: 12px; white-space: nowrap; }
.upload-zone {
  min-height: 158px; border: 1.5px dashed #9eb6a6; border-radius: 17px; display: flex;
  flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px;
  cursor: pointer; background: #f8faf6; transition: .2s ease; margin-bottom: 18px;
}
.upload-zone:hover, .upload-zone.dragging { border-color: var(--green); background: #f1f7ef; transform: translateY(-2px); }
.upload-zone.has-file { border-style: solid; background: #eef7ef; }
.upload-zone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--green); color: white; font-size: 22px; margin-bottom: 14px; }
.upload-zone strong { font-size: 16px; }
.upload-zone > span:last-child { margin-top: 5px; color: var(--muted); font-size: 13px; }
.field-block { margin-bottom: 16px; }
.field-block label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
select, input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px;
  background: white; color: var(--ink); outline: none;
}
select:focus, input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(35,106,69,.1); }
.primary-button, .workspace-button, .secondary-button {
  width: 100%; border: 0; border-radius: 12px; padding: 14px 18px; background: var(--green);
  color: white; font-weight: 760; cursor: pointer; display: flex; justify-content: space-between;
  text-decoration: none; transition: .2s ease;
}
.primary-button:hover, .workspace-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.secondary-button {
  justify-content: center; margin: -4px 0 16px;
  border: 1px solid #cfdcd3; background: white; color: var(--green-dark);
}
.secondary-button:hover { border-color: var(--green); background: #f2f8f3; transform: translateY(-1px); }
.form-note, .form-message { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 12px 2px 0; }
.notice { padding: 11px 13px; border-radius: 10px; background: #fff4e5; color: #8a4b08; margin-bottom: 16px; font-size: 13px; }
.error { color: var(--danger) !important; }
.model-dialog {
  width: min(520px, calc(100vw - 32px)); border: 1px solid #d8e4dc;
  border-radius: 18px; padding: 0; background: white; color: var(--ink);
  box-shadow: 0 28px 90px rgba(13, 37, 24, .28);
}
.model-dialog::backdrop { background: rgba(14, 28, 19, .45); backdrop-filter: blur(3px); }
.model-dialog form { padding: 24px; }
.dialog-heading {
  display: flex; justify-content: space-between; gap: 18px; align-items: start;
  margin-bottom: 18px;
}
.dialog-heading h2 { margin: 5px 0 0; font-size: 24px; }
.dialog-heading button {
  width: auto; border: 1px solid #d8e2db; border-radius: 9px;
  padding: 8px 11px; background: #f8faf8; color: #405247; cursor: pointer;
}
.dialog-heading button:hover { background: #eef5ef; }
.token-result {
  width: min(960px, 100%); margin: 112px auto 0; padding: 30px; border-radius: 22px;
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 26px; background: #10291b; color: white;
}
.token-result p { color: #b9c9bf; }
.token-box { display: flex; gap: 8px; align-items: center; padding: 8px; background: #193727; border-radius: 12px; }
.token-box code { padding: 8px; word-break: break-all; overflow-wrap: anywhere; min-width: 0; flex: 1; color: #e9f4ec; }
.copy-button { width: auto; border: 0; border-radius: 9px; padding: 10px 13px; background: var(--lime); color: #25310d; cursor: pointer; }
.workspace-button { grid-column: 1 / -1; background: var(--lime); color: #25310d; }

/* Workbench */
body.workbench {
  background:
    radial-gradient(circle at 82% 0%, rgba(35, 106, 69, .08), transparent 28rem),
    #f3f5f2;
}
.workspace-header {
  padding: 42px 4vw 38px; color: white;
  background:
    radial-gradient(circle at 78% 15%, rgba(217, 243, 107, .15), transparent 23rem),
    linear-gradient(135deg, #0d2518, #173d29);
}
.workspace-header-inner { width: min(1320px, 100%); margin: 0 auto; }
.workspace-eyebrow { color: #b9d7c3; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.workspace-header h1 {
  max-width: 1180px; margin: 12px 0 8px;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(30px, 3.5vw, 46px); line-height: 1.12; font-weight: 600;
  letter-spacing: -.025em; text-wrap: pretty;
}
.workspace-header p { margin: 0; color: #b8c8be; font-size: 14px; }
.workspace-header .workspace-subtitle {
  max-width: 1180px; margin: -1px 0 10px; color: #e0e9e3;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(19px, 2vw, 27px); line-height: 1.3; font-weight: 500;
}
.workspace-main { width: min(1320px, calc(100% - 32px)); margin: -18px auto 70px; }
.control-panel {
  position: relative; z-index: 2; padding: 20px 22px; margin-bottom: 20px;
  border: 1px solid rgba(33, 82, 52, .12); border-radius: 18px;
  background: rgba(255, 255, 255, .96); box-shadow: 0 16px 46px rgba(24, 65, 42, .1);
}
.workspace-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.progress-summary { min-width: 0; }
.progress-summary p { margin: 0; color: #45554b; font-size: 13px; }
.model-switch {
  display: grid; grid-template-columns: minmax(210px, 1fr) auto;
  align-items: end; gap: 8px; min-width: 320px;
}
.model-field { min-width: 0; }
.model-switch label {
  display: block; margin: 0 0 8px;
  font-size: 12px; line-height: 1; font-weight: 700; color: var(--muted);
}
.model-switch select {
  min-width: 0; min-height: 48px; padding-block: 11px;
  white-space: normal; line-height: 1.35; cursor: pointer;
}
.model-switch.single-model { grid-template-columns: minmax(210px, 1fr); }
.model-note {
  display: block; min-height: 16px; margin-top: 5px;
  color: var(--muted); font-size: 10px; line-height: 1.4;
}
.progress { height: 7px; background: #e5ebe6; border-radius: 10px; overflow: hidden; margin-bottom: 11px; }
.progress > div { height: 100%; background: linear-gradient(90deg, #236a45, #9dbc43); transition: width .3s; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.actions button, .model-switch button {
  width: auto; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px;
  background: var(--green); color: white; cursor: pointer; transition: .18s ease;
}
.actions button:hover, .model-switch button:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(35,106,69,.14); }
.model-switch button { height: 48px; margin-bottom: 21px; align-self: end; }
.model-switch button:disabled { opacity: .5; cursor: not-allowed; }
.actions .secondary { border-color: #dbe4dd; background: #f6f8f6; color: var(--ink); }
.actions .danger { border-color: #f6ceca; background: #fff4f3; color: var(--danger); }
.artifact-workspace {
  display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 680px;
  overflow: visible; border: 1px solid #dce5de; border-radius: 22px;
  background: white; box-shadow: 0 22px 60px rgba(28, 55, 38, .09);
}
.workspace-sidebar {
  align-self: stretch; padding: 26px 18px; border-radius: 21px 0 0 21px;
  background: linear-gradient(180deg, #f0f5f1, #f8faf8);
  border-right: 1px solid #dfe7e1;
}
.sidebar-label {
  display: block; margin: 0 10px 16px; color: #758379;
  font-size: 10px; font-weight: 850; letter-spacing: .16em;
}
.tabs { display: grid; gap: 6px; position: sticky; top: 18px; }
.tabs button {
  width: 100%; border: 1px solid transparent; border-radius: 12px; padding: 12px;
  background: transparent; color: #34443a; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 10px;
  transition: .18s ease;
}
.tabs button:hover { background: rgba(255,255,255,.72); border-color: #dce5de; }
.tabs button.active { background: white; color: #173d29; border-color: #d3e0d7; box-shadow: 0 7px 20px rgba(34,78,50,.08); }
.tab-index {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: #dfe9e2; color: #52645a; font-size: 11px; font-weight: 800;
}
.tabs button.active .tab-index { background: var(--green); color: white; }
.tab-copy { min-width: 0; }
.tab-name { display: block; font-size: 13px; font-weight: 750; line-height: 1.3; }
.tab-state { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.tab-state.running { color: #946200; }
.tab-state.done { color: var(--green); }
.artifact { min-width: 0; padding: 34px clamp(24px, 4vw, 48px) 48px; }
.artifact > h2 {
  margin: 0 0 6px; font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 32px; font-weight: 600; letter-spacing: -.02em;
}
.artifact-lead { margin: 0 0 26px; color: var(--muted); line-height: 1.65; }
.artifact h3 { margin-top: 0; }
.artifact-section {
  border: 1px solid #e1e8e3; border-radius: 16px; padding: 20px;
  margin-bottom: 16px; background: #fcfdfc;
}
.artifact-section h3, .artifact-section h4 { margin: 0 0 10px; }
.artifact-section p { line-height: 1.72; white-space: pre-wrap; }
.compact-list { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }
.compact-list li + li { margin-top: 5px; }
.artifact-list { margin: 0; padding-left: 21px; }
.artifact-list li { margin: 8px 0; line-height: 1.65; }
.artifact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.artifact-card { border: 1px solid #e1e8e3; border-radius: 14px; padding: 17px; background: white; min-width: 0; }
.artifact-card h4 { margin: 0 0 8px; }
.managed-fold { min-width: 0; align-self: start; }
.managed-fold-body {
  --managed-fold-height: 440px;
  --managed-fold-fade: #fff;
  position: relative; max-height: var(--managed-fold-height); overflow: hidden;
}
.managed-fold-body::after {
  content: ""; position: absolute; z-index: 2;
  left: 0; right: 0; bottom: 0; height: 64px;
  background: linear-gradient(180deg, transparent, var(--managed-fold-fade) 88%);
  pointer-events: none;
}
.managed-fold.expanded .managed-fold-body { max-height: none; overflow: visible; }
.managed-fold.expanded .managed-fold-body::after { display: none; }
.managed-fold-toggle {
  width: 100%; min-height: 34px; display: flex; align-items: center;
  justify-content: center; gap: 8px; margin-top: 7px; padding: 7px 12px;
  border: 1px solid #d7e0da; border-radius: 9px;
  background: #f8faf8; color: #45564b;
  font: inherit; font-size: 11px; font-weight: 780; cursor: pointer;
}
.managed-fold-toggle:hover { border-color: #aebfb3; background: #f0f5f1; }
.managed-fold-toggle:focus-visible {
  outline: 3px solid rgba(56, 113, 76, .18); outline-offset: 2px;
}
.managed-fold-icon {
  width: 8px; height: 8px; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px);
  transition: transform .16s ease;
}
.managed-fold.expanded .managed-fold-icon { transform: rotate(225deg) translate(-1px, -1px); }
.managed-fold-compact .managed-fold-toggle {
  width: fit-content; min-height: 28px; margin: 5px 4px 0 auto;
  padding: 5px 9px; border-color: transparent; background: transparent;
  color: #6c7770;
}
.managed-fold-compact .managed-fold-toggle:hover {
  border-color: #d7e0da; background: #f4f7f5; color: #435148;
}
.key-value { display: grid; grid-template-columns: minmax(120px, .3fr) 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf1ee; }
.key-value:last-child { border-bottom: 0; }
.key-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.status-placeholder { padding: 46px 22px; text-align: center; border: 1px dashed #ccd8cf; border-radius: 13px; background: #f8faf8; }
.finding { border-left: 4px solid #8ca096; padding: 13px 15px; margin-bottom: 10px; background: #f7f9f7; border-radius: 0 10px 10px 0; }
.finding.warning { border-color: #d99a22; background: #fff8e8; }
.finding.error { border-color: var(--danger); background: #fff1f0; color: var(--ink) !important; }
.finding.info { border-color: #4f83a8; background: #eef7fc; }
.finding strong { display: block; margin-bottom: 4px; }
.compliance-finding-list { display: grid; gap: 10px; }
.compliance-finding-list .finding { margin-bottom: 0; }
.compliance-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px; margin: 18px 0 18px;
}
.compliance-summary-item {
  padding: 12px 13px; border: 1px solid #dfe8e1; border-radius: 12px;
  background: #fbfdfb;
}
.compliance-summary-item span {
  display: block; color: var(--muted); font-size: 10px; font-weight: 850;
  letter-spacing: .09em; text-transform: uppercase;
}
.compliance-summary-item strong { display: block; margin-top: 6px; font-size: 24px; }
.compliance-summary-item.pass { border-color: #bdd9c8; background: #f2faf5; }
.compliance-summary-item.warning { border-color: #efd28d; background: #fff9e9; }
.compliance-summary-item.error { border-color: #efb4ae; background: #fff4f2; }
.compliance-summary-item.info { border-color: #b9d5e8; background: #f0f8fc; }
.compliance-summary-item.unknown { border-color: #cfd8d2; background: #f7f9f7; }
.compliance-checklist-section { padding: 0; overflow: hidden; }
.compliance-checklist-section > h3 { padding: 20px 20px 0; }
.compliance-check-group { border-top: 1px solid #e4ebe6; padding: 18px 20px; }
.compliance-check-group h4 {
  margin: 0 0 12px; color: var(--green-dark); font-size: 12px;
  font-weight: 850; letter-spacing: .08em; text-transform: uppercase;
}
.compliance-check {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px;
  align-items: start; padding: 13px 0; border-top: 1px solid #edf2ee;
}
.compliance-check:first-of-type { border-top: 0; }
.compliance-check-mark {
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 900; font-size: 12px; background: #edf4ee; color: var(--green-dark);
}
.compliance-check.pass .compliance-check-mark { background: #e5f5eb; color: #17613c; }
.compliance-check.warning .compliance-check-mark { background: #fff0c2; color: #8a5a00; }
.compliance-check.error .compliance-check-mark { background: #ffe0dc; color: var(--danger); }
.compliance-check.info .compliance-check-mark { background: #e5f3fb; color: #356b92; }
.compliance-check.unknown .compliance-check-mark { background: #ecefec; color: #5d6a62; }
.compliance-check-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.compliance-check-head strong { min-width: 0; font-size: 15px; }
.compliance-check-status {
  flex: none; padding: 4px 8px; border-radius: 999px; background: #edf3ee;
  color: #506058; font-size: 11px; font-weight: 800;
}
.compliance-check.pass .compliance-check-status { background: #e5f5eb; color: #17613c; }
.compliance-check.warning .compliance-check-status { background: #fff0c2; color: #8a5a00; }
.compliance-check.error .compliance-check-status { background: #ffe0dc; color: var(--danger); }
.compliance-check.info .compliance-check-status { background: #e5f3fb; color: #356b92; }
.compliance-check p { margin: 6px 0 0; line-height: 1.58; }
.compliance-check-meta { font-size: 12px; overflow-wrap: anywhere; }
.section-source { white-space: pre-wrap; max-height: 280px; overflow: auto; background: #f4f6f4; border-radius: 9px; padding: 12px; }
.paper-readout {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: 18px; align-items: stretch; margin: 0 0 18px;
  padding: 22px; border: 1px solid #cfe0d5; border-radius: 16px;
  background: linear-gradient(135deg, #eff7f1, #fbfdfb);
}
.paper-readout-copy { min-width: 0; }
.paper-readout-label {
  display: inline-block; margin-bottom: 9px; color: var(--green);
  font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase;
}
.paper-readout-copy strong {
  display: block; font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 28px; line-height: 1.18; font-weight: 600; letter-spacing: -.02em;
}
.paper-readout-copy p { margin: 9px 0 0; color: #52635a; line-height: 1.6; }
.paper-readout-facts { display: grid; gap: 8px; align-content: center; }
.compact-fact {
  min-width: 0; padding: 10px 12px; border: 1px solid #dce7df;
  border-radius: 11px; background: rgba(255,255,255,.78);
}
.compact-fact span {
  display: block; color: var(--muted); font-size: 10px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
}
.compact-fact strong {
  display: block; margin-top: 3px; font-size: 12px; line-height: 1.35;
  overflow-wrap: anywhere;
}
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 10px; margin: 22px 0; }
.metric-card { padding: 14px; border: 1px solid #dfe7e1; border-radius: 13px; background: #f8faf8; }
.metric-card strong { display: block; color: #1d5738; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.metric-card span { color: var(--muted); font-size: 11px; }
.paper-media-strip {
  margin: 0 0 18px; padding: 18px; border: 1px solid #dfe8e2;
  border-radius: 16px; background: #fbfcfb;
}
.paper-media-strip h3 { margin: 0 0 12px; }
.media-section-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.media-section-card {
  min-width: 0; padding: 13px; border: 1px solid #dfe7e1;
  border-radius: 12px; background: white;
}
.media-section-card strong {
  display: block; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere;
}
.media-section-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.outline-tree { border: 1px solid #e1e8e3; border-radius: 16px; overflow: hidden; }
.outline-tree-nested { background: #fbfcfb; }
.outline-group-header {
  display: grid; grid-template-columns: minmax(170px, .35fr) minmax(0, 1fr);
  align-items: center; gap: 12px; padding: 11px 16px;
  border-bottom: 1px solid #dfe9e3; background: #f3f8f5;
}
.outline-group-header strong {
  color: #1f3f2c; font-size: 12px; font-weight: 850; text-transform: uppercase;
}
.outline-group-header span {
  color: var(--muted); font-size: 11px; line-height: 1.4;
}
.outline-row { border-bottom: 1px solid #edf1ee; background: white; }
.outline-row:last-child { border-bottom: 0; }
.outline-node { position: relative; }
.outline-toggle {
  width: 100%; border: 0; border-radius: 0; cursor: pointer; padding: 14px 16px;
  display: grid; grid-template-columns: 24px minmax(38px, auto) minmax(220px, .72fr) minmax(180px, 1fr);
  align-items: center; gap: 12px; background: transparent;
  color: inherit; text-align: left;
}
.outline-no-numbers .outline-toggle {
  grid-template-columns: 24px minmax(260px, .78fr) minmax(180px, 1fr);
}
.outline-toggle:hover { background: #f8faf8; }
.outline-caret {
  flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 7px; background: #edf4ef; color: var(--green); font-weight: 850;
}
.outline-number {
  min-width: 38px; color: var(--green); font-size: 13px; font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.outline-number:empty { display: none; }
.outline-title {
  min-width: 0; font-weight: 780; line-height: 1.35;
  overflow-wrap: normal; word-break: normal; text-wrap: balance;
}
.outline-node.has-children > .outline-toggle .outline-title::after {
  content: "Subsections";
  display: inline-block; margin-left: 8px; padding: 2px 7px;
  border-radius: 999px; background: #edf4ef; color: #3f604c;
  font-size: 9px; line-height: 1.4; font-weight: 850; letter-spacing: .04em;
  text-transform: uppercase; vertical-align: middle;
}
.outline-meta {
  min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.outline-body { padding: 0 18px 18px; }
.outline-body[hidden] { display: none; }
.outline-depth-2 .outline-toggle { padding-left: 38px; }
.outline-depth-3 .outline-toggle { padding-left: 62px; }
.outline-depth-4 .outline-toggle { padding-left: 86px; }
.outline-no-numbers .outline-depth-2 .outline-toggle { padding-left: 54px; }
.outline-no-numbers .outline-depth-3 .outline-toggle { padding-left: 82px; }
.outline-no-numbers .outline-depth-4 .outline-toggle { padding-left: 110px; }
.outline-children {
  margin-top: 14px; border: 1px solid #e4ebe6; border-radius: 13px;
  overflow: hidden; background: #fbfcfb;
}
.outline-children .outline-row { border-left: 4px solid #d8e6dc; }
.outline-children .outline-row:last-child { border-bottom: 0; }
.section-preview { display: grid; gap: 13px; }
.reader-text {
  max-height: 340px; padding: 15px; background: #fbfcfb; border: 1px solid #e3e9e5;
  font-size: 14px; line-height: 1.75;
}
.markdown-rendered {
  max-height: 520px; overflow: auto; padding: 16px;
  border: 1px solid #e3e9e5; border-radius: 12px;
  background: #fbfcfb; font-size: 14px; line-height: 1.75;
}
.markdown-rendered > *:first-child { margin-top: 0; }
.markdown-rendered > *:last-child { margin-bottom: 0; }
.markdown-rendered h4,
.markdown-rendered h5,
.markdown-rendered h6 {
  margin: 18px 0 8px; color: #21382a; line-height: 1.35;
}
.markdown-rendered h4 { font-size: 17px; }
.markdown-rendered h5 { font-size: 15px; }
.markdown-rendered h6 { font-size: 14px; color: #4a5a51; }
.markdown-rendered p { margin: 0 0 12px; }
.markdown-rendered ul,
.markdown-rendered ol { margin: 0 0 13px 22px; padding: 0; }
.markdown-rendered li { margin: 5px 0; }
.markdown-rendered blockquote {
  margin: 0 0 13px; padding: 10px 14px;
  border-left: 4px solid #b9cbbf; background: #f3f7f4; color: #415047;
}
.markdown-heading-block {
  margin: 0 0 12px; border: 1px solid #dfe8e2;
  border-radius: 11px; background: white; overflow: hidden;
}
.markdown-heading-block > summary {
  cursor: pointer; padding: 10px 12px;
  background: #f3f7f4; color: #21382a;
  font-weight: 780; line-height: 1.4;
}
.markdown-heading-block > summary:hover { background: #eef5f0; }
.markdown-heading-content { padding: 12px 14px 2px; }
.markdown-heading-content .markdown-heading-content { padding-right: 0; }
.markdown-heading-level-2 { margin-left: 12px; }
.markdown-heading-level-3,
.markdown-heading-level-4 { margin-left: 24px; }
.markdown-rendered a { color: #1d6840; font-weight: 700; text-decoration-thickness: 1px; }
.markdown-inline-code,
.markdown-rendered code {
  padding: 2px 5px; border-radius: 5px;
  background: #edf2ef; color: #264331;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}
.markdown-inline-math {
  display: inline-block; max-width: 100%; color: #203728;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  line-height: 1.25; vertical-align: baseline; overflow-wrap: anywhere;
}
.markdown-inline-math mjx-container { display: inline-block; vertical-align: middle; }
.markdown-inline-math math { font-size: 1.02em; }
.markdown-inline-math sub,
.markdown-inline-math sup,
.markdown-math sub,
.markdown-math sup {
  font-size: .72em; line-height: 0;
}
.markdown-code {
  margin: 0 0 13px; padding: 13px; overflow: auto;
  border: 1px solid #dfe7e1; border-radius: 10px;
  background: #f3f5f3;
}
.markdown-code code { padding: 0; background: transparent; }
.markdown-math {
  margin: 8px 0 18px; padding: 18px 22px; overflow-x: auto;
  border: 1px solid #dde8e1; border-radius: 10px;
  background: #f7faf8; color: #24392c;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  white-space: pre-wrap;
}
.markdown-math mjx-container {
  min-width: max-content; margin: 0 auto !important;
}
.markdown-math math {
  min-width: max-content; font-size: 1.28em;
}
.markdown-math math[display="block"] {
  display: block; margin: 0 auto; text-align: center;
}
.markdown-figure {
  margin: 0 0 14px; overflow: hidden;
  border: 1px solid #dfe7e1; border-radius: 13px; background: white;
}
.markdown-image {
  display: block; max-width: 100%; max-height: 420px; object-fit: contain;
  margin: 0 auto; background: #f7f8f7;
}
.markdown-image-missing {
  display: inline-block; padding: 3px 7px; border-radius: 7px;
  background: #eef2ef; color: var(--muted); font-size: 12px;
}
.markdown-table-scroll { margin-bottom: 13px; }
.markdown-table {
  width: 100%; min-width: 480px; border-collapse: collapse; font-size: 12px;
}
.markdown-table th,
.markdown-table td {
  padding: 8px 10px; border: 1px solid #edf1ee;
  text-align: left; vertical-align: top;
}
.markdown-table th { background: #f2f6f3; color: #43554a; font-weight: 780; }
.markdown-table td { background: white; }
.figure-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.figure-card {
  margin: 0; overflow: hidden; border: 1px solid #dfe7e1;
  border-radius: 13px; background: white;
}
.figure-card img {
  display: block; width: 100%; max-height: 360px; object-fit: contain;
  background: #f7f8f7; border-bottom: 1px solid #e5ebe7;
}
.figure-caption {
  padding: 10px 12px; color: #4d5a52; font-size: 12px; line-height: 1.45;
  overflow-wrap: anywhere;
}
.table-stack { display: grid; gap: 12px; }
.mineru-table-card {
  min-width: 0; padding: 14px; border: 1px solid #dfe7e1;
  border-radius: 13px; background: white;
}
.mineru-table-card h4 { margin: 0 0 9px; font-size: 13px; }
.table-scroll { overflow-x: auto; border: 1px solid #e5ebe7; border-radius: 10px; }
.mineru-table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 12px; }
.mineru-table th, .mineru-table td {
  padding: 8px 10px; border-bottom: 1px solid #edf1ee; text-align: left; vertical-align: top;
}
.mineru-table th { background: #f2f6f3; color: #43554a; font-weight: 780; }
.mineru-table tr:last-child td { border-bottom: 0; }
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.chip { padding: 5px 9px; border-radius: 999px; background: #edf4ef; color: #3f604c; font-size: 11px; }
.landscape-summary { padding: 24px; border-radius: 17px; color: white; background: linear-gradient(135deg, #173d29, #286846); line-height: 1.75; }
.field-tree-grid { display: grid; gap: 18px; margin-top: 16px; }
.field-tree-card {
  padding: 20px; border: 1px solid #dce4de; border-radius: 17px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
  box-shadow: 0 10px 24px rgba(34, 58, 42, .05);
}
.field-tree-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; }
.field-tree-heading h4 { margin: 0; font-size: 16px; }
.field-tree-index {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 12px; background: #e7f1e9; color: #315d40;
  font-size: 12px; font-weight: 850;
}
.field-tree-question {
  margin: 12px 0; padding: 11px 13px; border-radius: 11px;
  background: #f3f7f4; color: #40574a; font-weight: 650;
}
.lineage-map {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px; margin-top: 16px;
}
.lineage-lane {
  min-width: 0; padding: 12px; border: 1px solid #e0e6e2; border-radius: 14px;
  background: #f8faf8;
}
.lineage-lane h5 {
  margin: 0 0 10px; color: #56635b; font-size: 11px; letter-spacing: .05em;
  text-transform: uppercase;
}
.lineage-lane-nodes { display: grid; gap: 10px; }
.lineage-paper-node {
  padding: 13px 14px; border: 1px solid #dfe7e1; border-radius: 13px;
  background: white; min-width: 0; box-shadow: 0 7px 14px rgba(34, 58, 42, .04);
}
.lineage-paper-head { display: grid; gap: 4px; }
.lineage-paper-head strong { line-height: 1.35; }
.lineage-paper-meta { color: var(--muted); font-size: 11px; line-height: 1.35; }
.lineage-paper-node p { margin: 8px 0 0; line-height: 1.55; }
.lineage-paper-node small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.45; }
.lineage-source-submitted-paper { border-color: #8fb89a; background: #f2faf4; }
.lineage-source-internal-reference { border-color: #d8c69c; background: #fffaf0; }
.lineage-source-search-result { border-color: #d8e2dc; }
.lineage-source-inferred-gap { border-style: dashed; border-color: #d6b0a6; background: #fff7f4; }
.lineage-evidence-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: 14px; align-items: stretch;
}
.lineage-relations {
  display: grid; gap: 8px; margin-top: 14px; padding: 12px;
  border: 1px solid #e1e6e2; border-radius: 13px; background: #fafbfa;
}
.lineage-relations h5 { margin: 0 0 2px; font-size: 12px; color: #526057; }
.lineage-paper-index {
  display: grid; gap: 6px; padding: 8px;
  border: 1px solid #e4ebe6; border-radius: 9px; background: white;
}
.lineage-paper-index-item {
  display: grid; grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px; align-items: start; min-width: 0;
}
.lineage-paper-index-letter,
.lineage-relation-letter {
  width: 18px; height: 18px; display: grid; place-items: center;
  border: 1px solid #c9d3cc; border-radius: 50%;
  color: #53615a; background: #fbfcfb; font-size: 9px; font-weight: 850;
}
.lineage-paper-index-item strong {
  overflow-wrap: anywhere; color: #344039; font-size: 11px; line-height: 1.35;
}
.lineage-relations-list { display: grid; gap: 8px; }
.lineage-relation {
  display: grid; gap: 4px; padding: 9px 10px; border-radius: 10px;
  background: white; border: 1px solid #e5ebe7;
}
.lineage-relation-endpoints {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 7px; align-items: start; min-width: 0;
}
.lineage-relation-endpoint {
  display: grid; grid-template-columns: 20px minmax(0, 1fr);
  gap: 6px; align-items: start; min-width: 0;
}
.lineage-relation-arrow {
  color: #7b8780; font-size: 11px; font-weight: 800; line-height: 20px;
}
.lineage-relation strong { font-size: 12px; line-height: 1.45; }
.lineage-relation small { color: var(--muted); line-height: 1.45; }
.lineage-edge-relation {
  width: fit-content; padding: 3px 7px; border-radius: 999px; background: #e5ece7;
  color: #3c5f48; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em;
}
.lineage-mini-graph {
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  gap: 8px; margin-top: 14px; padding: 12px; height: 360px;
  border: 1px solid #e1e6e2; border-radius: 13px; background: #fbfcfb;
}
.lineage-mini-graph h5 { margin: 0; font-size: 12px; color: #526057; }
.field-tree-gaps { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fff9ef; border: 1px solid #eadfc9; }
.field-tree-gaps ul { margin: 8px 0 0 18px; padding: 0; }
.field-tree-gaps li { margin: 4px 0; }
.paper-position {
  margin-top: 18px; padding: 15px 17px;
  border: 1px solid #dce4df; border-radius: 13px; background: #f8faf8;
}
.paper-position-heading {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.paper-position-heading h3 { margin: 0; font-size: 14px; }
.paper-position-marker {
  padding: 3px 6px; border-radius: 5px; background: #e7eee9;
  color: #52645a; font-size: 8px; font-weight: 850; letter-spacing: .09em;
}
.paper-position-body p { margin: 0; color: #45534b; font-size: 12px; line-height: 1.62; }
.paper-position-body .artifact-section {
  margin: 8px 0 0; padding: 12px; border-radius: 10px; background: white;
}
.research-graph-guide {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px; align-items: center; margin-bottom: 12px;
  padding: 15px 17px; border: 1px solid #d7dfe5;
  border-radius: 8px; background: #f7f9fa;
}
.research-graph-guide-copy h3 { margin: 0 0 5px; font-size: 14px; }
.research-graph-guide-copy p {
  margin: 0; color: #5d6a75; font-size: 11px; line-height: 1.55;
}
.research-graph-legend {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  justify-content: flex-end;
}
.research-legend-item {
  display: inline-flex; gap: 6px; align-items: center;
  color: #52606b; font-size: 10px; white-space: nowrap;
}
.research-legend-node {
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 1.5px solid #75838f; border-radius: 50%;
  background: white; color: #26323c;
  font-size: 9px; font-style: normal; font-weight: 850;
}
.research-legend-node.submitted { border-color: #397a50; background: #e7f5eb; }
.research-legend-node.internal { border-color: #a97b25; background: #fff6df; }
.research-legend-node.gap {
  border-color: #b56558; border-style: dashed; background: #fff3f0;
}
.research-legend-edge {
  position: relative; width: 34px; height: 12px; display: inline-block;
}
.research-legend-edge::before {
  content: ""; position: absolute; top: 5px; left: 0; right: 7px;
  border-top: 2px solid #7e8b96;
}
.research-legend-edge::after {
  content: ""; position: absolute; top: 1px; right: 0;
  border-width: 5px 0 5px 8px; border-style: solid;
  border-color: transparent transparent transparent #7e8b96;
}
.research-legend-edge.direct::before { border-color: #49735a; border-width: 2px; }
.research-legend-edge.direct::after { border-left-color: #49735a; }
.research-legend-edge.search::before { border-color: #5d7890; }
.research-legend-edge.search::after { border-left-color: #5d7890; }
.research-legend-edge.inferred::before { border-color: #9aa39e; border-style: dashed; }
.research-legend-edge.inferred::after { border-left-color: #9aa39e; }
.research-graph-editor {
  display: grid; grid-template-columns: 220px minmax(0, 1fr);
  min-height: 640px; overflow: hidden;
  border: 1px solid #d7dce1; border-radius: 8px; background: #f7f8fa;
}
.research-graph-dialog {
  width: min(1180px, calc(100% - 28px)); height: min(880px, calc(100vh - 28px));
  padding: 0; border: 1px solid #bfc8d0; border-radius: 7px;
  background: white; color: var(--ink);
  box-shadow: 0 24px 70px rgba(22, 31, 40, .28);
}
.research-graph-dialog::backdrop { background: rgba(22, 29, 35, .52); }
.research-graph-dialog-panel {
  height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px; padding: 16px; overflow: hidden;
}
.research-graph-dialog-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.research-graph-dialog-header h3 { margin: 0; font-size: 16px; }
.research-graph-dialog-close {
  padding: 7px 10px; border: 1px solid #d4dbe0; border-radius: 4px;
  background: #f6f7f8; color: #3f4b55; cursor: pointer;
}
.dialog-research-graph-editor { min-height: 0; height: 100%; }
.dialog-research-graph-editor .research-graph-expand-button { display: none; }
.research-graph-sidebar {
  padding: 18px 12px; border-right: 1px solid #d7dce1;
  background: #f1f3f5;
}
.research-graph-sidebar-label {
  display: block; margin: 0 8px 12px; color: #66717d;
  font-size: 10px; font-weight: 800; letter-spacing: .12em;
}
.research-field-button {
  width: 100%; min-width: 0; padding: 11px 12px;
  border: 1px solid transparent; border-radius: 5px;
  background: transparent; color: #27313b; text-align: left; cursor: pointer;
}
.research-field-button + .research-field-button { margin-top: 4px; }
.research-field-button:hover { background: #e7eaee; }
.research-field-button.active {
  border-color: #b9c6d2; background: white;
  box-shadow: 0 2px 7px rgba(31, 42, 53, .07);
}
.research-field-button strong {
  display: block; overflow-wrap: anywhere; font-size: 12px; line-height: 1.4;
}
.research-field-button span {
  display: block; margin-top: 4px; color: #78838e; font-size: 10px;
}
.research-graph-canvas { min-width: 0; background: #fbfcfd; }
.research-graph-viewport { width: 100%; height: 100%; overflow: auto; }
.research-graph-frame {
  position: relative; width: 100%; min-width: 720px;
  min-height: 640px; height: 100%; display: grid; place-items: stretch;
}
.research-graph-frame.compact {
  min-width: 0; min-height: 0; height: 100%;
  border: 1px solid #e1e6e2; border-radius: 10px; overflow: hidden;
}
.research-graph-frame.expanded {
  position: fixed; inset: 16px; z-index: 1200;
  width: auto; min-width: 0; height: auto; min-height: 0;
  border: 1px solid #bfc8d0; border-radius: 8px; background: #fbfcfd;
  box-shadow: 0 18px 60px rgba(20, 29, 38, .25);
}
.research-graph-frame.expanded .research-graph-svg { min-height: 0; }
.research-graph-empty { align-self: center; justify-self: center; }
.research-graph-expand-button {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  min-width: 70px; height: 36px; padding: 0 11px;
  border: 1px solid #bac4cd; border-radius: 5px;
  background: rgba(255, 255, 255, .95); color: #34414c;
  font-size: 11px; font-weight: 800; cursor: pointer;
  box-shadow: 0 3px 10px rgba(27, 38, 49, .11);
}
.research-graph-svg {
  width: 100%; height: 100%; min-height: 640px;
  background-color: #f8faf9;
  background-image:
    radial-gradient(circle at 52% 46%, rgba(222, 235, 226, .42), transparent 46%),
    linear-gradient(rgba(216, 225, 219, .42) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 225, 219, .42) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
  touch-action: none; user-select: none;
}
.research-graph-frame.compact .research-graph-svg { min-height: 0; }
.research-graph-frame.compact .research-graph-expand-button {
  top: 8px; right: 8px; min-width: 54px; height: 30px; padding-inline: 8px;
}
.research-graph-frame.compact .research-graph-edge-label { font-size: 15px; }
.research-graph-frame.compact .research-node-letter { font-size: 19px; }
.research-graph-frame.compact .research-graph-lane text { display: none; }
.research-graph-lane rect {
  fill: rgba(255, 255, 255, .46); stroke: rgba(125, 146, 133, .2);
  stroke-width: 1; vector-effect: non-scaling-stroke;
}
.research-graph-lane:nth-child(even) rect { fill: rgba(239, 245, 241, .52); }
.research-graph-lane.submitted rect {
  fill: rgba(228, 242, 232, .68); stroke: rgba(73, 127, 89, .32);
}
.research-graph-lane text {
  fill: #718078; font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.research-graph-edge {
  fill: none; stroke: #829087; stroke-width: 1.7;
  vector-effect: non-scaling-stroke; transition: stroke .14s ease, stroke-width .14s ease;
}
.research-graph-edge.evidence-direct-citation { stroke: #49735a; stroke-width: 2.1; }
.research-graph-edge.evidence-search-snippet { stroke: #5d7890; }
.research-graph-edge.evidence-inferred {
  stroke: #9aa39e; stroke-width: 1.45; stroke-dasharray: 6 5;
}
.research-graph-edge.highlighted { stroke: #245f83; stroke-width: 2.8; }
.research-graph-edge-hit {
  fill: none; stroke: transparent; stroke-width: 14;
  cursor: pointer; pointer-events: stroke;
}
.research-edge-layer marker path { fill: #697681; }
.research-graph-edge-label-group { pointer-events: all; cursor: pointer; }
.research-graph-edge-label-group rect {
  fill: rgba(255, 255, 255, .94); stroke: #d4ddd7; stroke-width: 1;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 2px 3px rgba(32, 50, 40, .1));
}
.research-graph-edge-label-group.evidence-direct-citation rect { stroke: #a8c2b0; }
.research-graph-edge-label-group.evidence-search-snippet rect { stroke: #b7c7d3; }
.research-graph-edge-label-group.evidence-inferred rect {
  fill: rgba(248, 249, 248, .94); stroke: #cfd5d1; stroke-dasharray: 3 2;
}
.research-graph-edge-label-group.highlighted rect {
  fill: #eef6fb; stroke: #6992ae;
}
.research-graph-edge-label {
  fill: #4d5d54; text-anchor: middle;
  font-size: 13px; font-weight: 780; pointer-events: none;
}
.research-graph-node { cursor: grab; outline: none; }
.research-graph-node.dragging { cursor: grabbing; }
.research-graph-node .research-node-halo {
  fill: rgba(65, 113, 80, .08); stroke: rgba(65, 113, 80, .2);
  stroke-width: 2; opacity: 0; transition: opacity .14s ease;
}
.research-graph-node .research-node-core {
  fill: white; stroke: #75838f; stroke-width: 1.8;
  filter: drop-shadow(0 3px 5px rgba(27, 38, 49, .12));
  transition: stroke .14s ease, stroke-width .14s ease, filter .14s ease;
}
.research-graph-node:hover .research-node-halo,
.research-graph-node:focus .research-node-halo { opacity: 1; }
.research-graph-node:hover .research-node-core,
.research-graph-node:focus .research-node-core {
  stroke: #315f83; stroke-width: 2.7;
  filter: drop-shadow(0 5px 8px rgba(40, 83, 111, .2));
}
.research-node-submitted-paper .research-node-halo { opacity: .72; }
.research-node-submitted-paper .research-node-core { fill: #e7f5eb; stroke: #397a50; }
.research-node-internal-reference .research-node-core { fill: #fff6df; stroke: #a97b25; }
.research-node-inferred-gap .research-node-core {
  fill: #fff3f0; stroke: #b56558; stroke-dasharray: 5 3;
}
.research-node-letter {
  fill: #26323c; font-size: 22px; font-weight: 850; pointer-events: none;
}
.research-details-dialog {
  width: min(680px, calc(100% - 32px)); max-height: min(82vh, 760px);
  padding: 0; overflow: hidden;
  border: 1px solid #cbd3da; border-radius: 7px;
  background: white; color: var(--ink);
  box-shadow: 0 24px 70px rgba(22, 31, 40, .28);
}
.research-details-dialog::backdrop { background: rgba(22, 29, 35, .5); }
.research-details-panel { max-height: min(82vh, 760px); overflow-y: auto; }
.research-details-header {
  position: sticky; top: 0; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px; align-items: start; padding: 20px 22px;
  border-bottom: 1px solid #e0e5e9; background: white;
}
.research-details-header h3 {
  margin: 0; overflow-wrap: anywhere; font-size: 18px; line-height: 1.4;
}
.research-details-close {
  min-width: 58px; height: 34px; padding: 0 10px;
  border: 1px solid #d4dbe0; border-radius: 4px;
  background: #f6f7f8; color: #3f4b55; font-size: 11px; cursor: pointer;
}
.research-details-section { padding: 18px 22px; border-bottom: 1px solid #e8ecef; }
.research-details-section:last-child { border-bottom: 0; }
.research-details-section h4 {
  margin: 0 0 12px; color: #586572; font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase;
}
.research-details-section p { margin: 0; line-height: 1.65; white-space: pre-wrap; }
.research-details-fields {
  display: grid; grid-template-columns: 132px minmax(0, 1fr);
  margin: 0; font-size: 12px;
}
.research-details-fields dt,
.research-details-fields dd {
  margin: 0; padding: 8px 0; border-top: 1px solid #edf0f2;
  overflow-wrap: anywhere;
}
.research-details-fields dt { color: #71808c; font-weight: 700; }
.research-details-fields dd { color: #28343e; }
.research-relationship-list { display: grid; gap: 8px; }
.research-relationship-item {
  padding: 12px 13px; border: 1px solid #dfe4e8;
  border-radius: 5px; background: #fafbfc;
}
.research-relationship-heading {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.research-relationship-heading span {
  padding: 3px 6px; border-radius: 3px;
  background: #e7edf2; color: #52616e;
  font-size: 9px; font-weight: 800; text-transform: uppercase;
}
.research-relationship-heading strong { font-size: 11px; text-transform: capitalize; }
.research-relationship-item p { margin-top: 8px; font-weight: 700; }
.research-relationship-item small {
  display: block; margin-top: 6px; color: #697681; line-height: 1.5;
}
.review-columns, .story-grid, .section-review-grid, .section-reader-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.section-reader-grid { grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); align-items: start; }
.section-issue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.review-panel {
  min-width: 0; max-width: 100%; padding: 20px;
  border-radius: 15px; border: 1px solid #e0e7e2; background: white;
}
.review-panel.positive { border-top: 4px solid #4c9867; }
.review-panel.critical { border-top: 4px solid #d28254; }
.issue-panel { border-top: 0; background: #fffdfb; }
.severity-list { display: grid; gap: 9px; min-width: 0; max-width: 100%; }
.severity-item {
  position: relative; min-width: 0; max-width: 100%; padding: 13px 14px 13px 17px;
  border: 1px solid #eadfd2; border-radius: 11px; background: #fffaf2;
}
.severity-item::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #d0a13a;
}
.severity-item p { margin: 7px 0 0; line-height: 1.58; overflow-wrap: anywhere; }
.severity-item small {
  display: block; margin-top: 6px; color: var(--muted); line-height: 1.5;
  overflow-wrap: anywhere;
}
.severity-structured { min-width: 0; max-width: 100%; margin-top: 7px; }
.severity-structured .analysis-fields { gap: 6px; }
.severity-structured .analysis-field {
  min-width: 0; max-width: 100%; background: rgba(255, 255, 255, .55);
}
.severity-structured p { margin-top: 0; }
.severity-detail { color: var(--muted); font-size: 11px; }
.severity-badge {
  display: inline-block; padding: 3px 7px; border-radius: 999px;
  background: #f6e7bd; color: #75520a; font-size: 9px; font-weight: 850;
  letter-spacing: .05em; text-transform: uppercase;
}
.severity-critical { border-color: #efcbc7; background: #fff4f3; }
.severity-critical::before { background: #b42318; }
.severity-critical .severity-badge { background: #f5d3cf; color: #8d1c14; }
.severity-high { border-color: #efd8c3; background: #fff7f1; }
.severity-high::before { background: #d15e32; }
.severity-high .severity-badge { background: #f7ddcf; color: #93401f; }
.severity-low { border-color: #eadfbf; background: #fffdf5; }
.severity-low::before { background: #d6ae4d; }
.severity-low .severity-badge { background: #f6ebc9; color: #725a1a; }
.severity-evidence { margin-top: 10px; }
.review-policy {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 12px;
  align-items: center; margin-bottom: 16px; padding: 15px 18px;
  border: 1px solid #cfe0d4; border-radius: 14px; background: #eff7f1;
}
.review-policy-label {
  grid-row: 1 / 3; padding: 7px 10px; border-radius: 999px;
  background: var(--green); color: white; font-size: 11px; font-weight: 800;
}
.review-policy strong { font-size: 14px; }
.review-policy p { margin: 0; color: var(--muted); font-size: 12px; }
.review-score-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px; margin: 0 0 18px;
}
.review-score-card {
  min-width: 0; padding: 15px; border: 1px solid #dde6df;
  border-radius: 14px; background: #fafcfb;
}
.review-score-card.overall { grid-column: span 2; }
.review-score-heading { display: grid; gap: 3px; }
.review-score-name {
  display: block; color: #33473b; font-size: 11px; font-weight: 850;
  letter-spacing: .035em; text-transform: uppercase;
}
.review-score-label {
  color: var(--muted); font-size: 11px; font-weight: 650; line-height: 1.35;
}
.review-score-card.score-excellent {
  color: white; border-color: #1b5636;
  background: linear-gradient(135deg, #123c25, #246843);
}
.review-score-card.score-excellent .review-score-name,
.review-score-card.score-excellent .review-score-label,
.review-score-card.score-excellent p { color: #cde0d3; }
.review-score-card.score-positive { border-color: #bcd8c5; background: #eaf5ed; }
.review-score-card.score-positive .review-score-value { color: #246843; }
.review-score-card.score-neutral { border-color: #ead9a8; background: #fff9e9; }
.review-score-card.score-neutral .review-score-value { color: #8c6914; }
.review-score-card.score-negative { border-color: #ecc9c4; background: #fff2f1; }
.review-score-card.score-negative .review-score-value { color: #a33127; }
.review-score-value {
  display: block; margin-top: 5px;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 29px; line-height: 1; font-weight: 600;
}
.review-score-card p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.todo-list { display: grid; gap: 12px; }
.todo-card {
  position: relative; overflow: hidden; padding: 17px 19px 17px 23px;
  border: 1px solid #e0e6e1; border-radius: 14px; background: white;
}
.todo-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: #7693a8;
}
.todo-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.todo-category { color: #405047; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.todo-priority { padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 850; }
.todo-card p { margin: 10px 0 0; line-height: 1.65; }
.todo-card.priority-critical { background: #fff6f5; border-color: #f1cfcb; }
.todo-card.priority-critical::before { background: #b42318; }
.todo-card.priority-critical .todo-priority { background: #f9d8d4; color: #8d1c14; }
.todo-card.priority-high { background: #fffaf0; border-color: #eddcb7; }
.todo-card.priority-high::before { background: #c47b16; }
.todo-card.priority-high .todo-priority { background: #f7e4bd; color: #81500d; }
.todo-card.priority-medium::before { background: #3977a4; }
.todo-card.priority-medium .todo-priority { background: #dcecf7; color: #285f86; }
.todo-card.priority-low::before { background: #4f8a65; }
.todo-card.priority-low .todo-priority { background: #dceee2; color: #356546; }
.page-budget {
  margin-top: 18px; padding: 17px; border: 1px solid #dfe6e1;
  border-radius: 14px; background: #fafcfb;
}
.page-budget > h3 { margin: 0 0 10px; }
.page-budget-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 7px;
}
.page-budget-metric {
  min-width: 0; padding: 9px 11px; border: 1px solid #e1e5e2;
  border-radius: 10px; background: white;
}
.page-budget-metric span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; }
.page-budget-metric strong { display: block; margin-top: 3px; font-size: 13px; line-height: 1.35; }
.page-budget-group { margin-top: 12px; }
.page-budget-group h4 { margin: 0 0 7px; color: #59615c; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.page-budget-rows { display: grid; gap: 6px; }
.page-budget-row {
  padding: 10px 12px; border: 1px solid #e2e6e3;
  border-radius: 10px; background: white;
}
.page-budget-row-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.page-budget-row-heading > strong { min-width: 0; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.page-budget-values { display: flex; justify-content: flex-end; gap: 6px; flex: 0 1 190px; flex-wrap: wrap; }
.page-budget-value {
  max-width: 92px; min-width: 58px; padding: 4px 7px; border-radius: 7px;
  text-align: right; background: #f0f2f0;
}
.page-budget-value small { display: block; color: var(--muted); font-size: 8px; }
.page-budget-value b { display: block; margin-top: 1px; color: #3c443f; font-size: 11px; overflow-wrap: anywhere; }
.page-budget-row p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.page-budget-text span {
  display: inline-block; margin-right: 6px; color: #4c5a52; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
}
.page-budget-row > small { display: block; margin-top: 5px; color: #7b817d; font-size: 9px; }
.page-budget-note { margin: 0; color: var(--muted); line-height: 1.5; }
.story-step { padding: 18px; border-radius: 15px; border: 1px solid #dce5de; background: #fbfcfb; }
.story-step span { color: var(--green); font-size: 11px; font-weight: 850; letter-spacing: .12em; }
.method-overview {
  padding: 22px; border: 1px solid #d7dfda; border-radius: 16px;
  background: linear-gradient(135deg, #f7f9f8, #eef2ef);
}
.method-overview p { margin: 8px 0 0; max-width: 900px; font-size: 16px; line-height: 1.7; }
.method-analysis-section { margin-top: 20px; }
.method-analysis-section > h3 { margin-bottom: 11px; }
.method-step-flow { display: grid; gap: 11px; }
.method-step-card {
  position: relative; padding: 17px 18px 17px 62px; border: 1px solid #dde4df;
  border-radius: 14px; background: white;
}
.method-step-card::after {
  content: ""; position: absolute; left: 27px; top: 43px; bottom: -12px;
  width: 1px; background: #d8dfda;
}
.method-step-card:last-child::after { display: none; }
.method-step-index {
  position: absolute; left: 14px; top: 14px; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%; background: #526158;
  color: white; font-size: 10px; font-weight: 800;
}
.method-step-card h4 { margin: 2px 0 10px; font-size: 15px; }
.method-coherence { padding: 20px; border: 1px solid #dfe4e1; border-radius: 15px; background: #fafbfa; }
.method-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.method-evidence-card { padding: 16px; border: 1px solid #e0e5e2; border-radius: 13px; background: white; }
.method-evidence-card .analysis-value:first-child h4 { color: #34483c; font-size: 11px; }
.analysis-block { margin-top: 18px; }
.analysis-block > h3 { margin-bottom: 10px; }
.section-analysis-card { margin-bottom: 14px; border: 1px solid #dfe7e1; border-radius: 16px; background: white; overflow: hidden; }
.section-analysis-card > summary {
  cursor: pointer; padding: 17px 20px; font-weight: 760; background: #f8faf8;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.section-summary-title { min-width: 0; line-height: 1.35; }
.section-summary-meta {
  flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 650;
}
.section-analysis-content { padding: 20px; }
.source-pane { border-radius: 13px; padding: 16px; background: #f2f5f3; }
.source-pane .section-source { max-height: 420px; background: transparent; padding: 0; }
.analysis-value { margin-top: 12px; }
.analysis-value:first-of-type { margin-top: 0; }
.analysis-value h4 {
  margin: 0 0 6px; color: #59615c; font-size: 10px; font-weight: 850;
  letter-spacing: .06em; text-transform: uppercase;
}
.analysis-value p { margin: 0 0 7px; line-height: 1.58; white-space: pre-wrap; }
.analysis-fields { display: grid; gap: 9px; }
.analysis-field {
  padding: 9px 10px; border: 1px solid #e5ebe7; border-radius: 10px;
  background: #fbfcfb;
}
.analysis-field > strong {
  display: block; margin-bottom: 5px; color: #405449; font-size: 11px;
}
.analysis-list { margin: 3px 0 0; padding-left: 18px; }
.analysis-list li { margin: 5px 0; line-height: 1.5; }
.muted { color: var(--muted); }
@media (max-width: 860px) {
  .hero { height: auto; min-height: 0; grid-template-columns: 1fr; gap: 42px; align-items: start; }
  .landing-main { padding-top: 42px; }
  .hero-copy { align-self: auto; margin-top: 0; }
  .create-card { min-height: 0; margin-top: 0; }
  .token-result { grid-template-columns: 1fr; }
  .workspace-button { grid-column: auto; }
  .workspace-toolbar { grid-template-columns: 1fr; }
  .model-switch { min-width: 0; width: 100%; }
  .artifact-workspace { grid-template-columns: 1fr; overflow: hidden; }
  .workspace-sidebar { border-right: 0; border-bottom: 1px solid #dfe7e1; border-radius: 21px 21px 0 0; }
  .research-graph-guide { grid-template-columns: 1fr; }
  .research-graph-legend { justify-content: flex-start; }
  .research-graph-editor { grid-template-columns: 1fr; min-height: 560px; }
  .research-graph-sidebar {
    display: flex; gap: 6px; overflow-x: auto;
    padding: 10px; border-right: 0; border-bottom: 1px solid #d7dce1;
  }
  .research-graph-sidebar-label { display: none; }
  .research-field-button { flex: 0 0 180px; }
  .research-field-button + .research-field-button { margin-top: 0; }
  .research-graph-frame, .research-graph-svg { min-height: 500px; }
  .lineage-evidence-row { grid-template-columns: 1fr; }
  .lineage-mini-graph { height: 420px; }
  .tabs { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outline-toggle {
    grid-template-columns: 24px minmax(34px, auto) minmax(0, 1fr);
  }
  .outline-no-numbers .outline-toggle {
    grid-template-columns: 24px minmax(0, 1fr);
  }
  .outline-meta {
    grid-column: 3; white-space: normal;
  }
  .outline-no-numbers .outline-meta {
    grid-column: 2;
  }
  .outline-group-header {
    grid-template-columns: 1fr; gap: 4px;
  }
  .artifact-grid { grid-template-columns: 1fr; }
  .review-columns, .story-grid, .section-review-grid, .section-reader-grid, .section-issue-grid { grid-template-columns: 1fr; }
  .method-card-grid { grid-template-columns: 1fr; }
  .paper-readout { grid-template-columns: 1fr; }
  .media-section-grid, .figure-gallery { grid-template-columns: 1fr; }
  .review-score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .topbar { padding-inline: 18px; }
  .top-note { display: none; }
  .landing-main { padding: 32px 16px 56px; }
  .hero-copy h1 { font-size: 42px; }
  .existing-token-row { grid-template-columns: 1fr; }
  .existing-token-row button { width: 100%; }
  .existing-details { grid-template-columns: 1fr; }
  .create-card { padding: 20px; border-radius: 18px; }
  .card-heading { align-items: flex-start; flex-direction: column; }
  .token-result { padding: 22px; }
  .token-box { align-items: stretch; flex-direction: column; }
  .tabs { grid-template-columns: 1fr; }
  .key-value { grid-template-columns: 1fr; gap: 4px; }
  .review-policy { grid-template-columns: 1fr; }
  .review-policy-label { grid-row: auto; width: fit-content; }
  .review-score-grid { grid-template-columns: 1fr; }
  .review-score-card.overall { grid-column: auto; }
  .research-details-fields { grid-template-columns: 1fr; }
  .research-details-fields dt { padding-bottom: 2px; }
  .research-details-fields dd { padding-top: 2px; border-top: 0; }
  .lineage-relation-endpoints { grid-template-columns: 1fr; }
  .lineage-relation-arrow { padding-left: 6px; line-height: 14px; }
}
.public-demo-disabled-control { display: none !important; }
