:root {
  --ink: #1a2a31;
  --muted: #62717a;
  --teal: #087f70;
  --teal-dark: #05685c;
  --amber: #a96708;
  --level-one: #16845f;
  --level-two: #d49a16;
  --level-three: #c74848;
  --line: #d5dee0;
  --paper: #f7f9f8;
  --soft-teal: #e5f4f0;
  --soft-amber: #fbf0d8;
  --soft-gray: #edf1f2;
  --card: #ffffff;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.page-header { padding: 42px 0 32px; border-bottom: 1px solid var(--line); background: #fff; }
.project-label, .section-label { margin: 0 0 8px; color: var(--teal); font-size: .8rem; font-weight: 800; letter-spacing: .025em; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-family: Georgia, serif; font-size: clamp(2.2rem, 5vw, 3.7rem); line-height: 1.05; font-weight: 600; }
h2 { margin-bottom: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(1.35rem, 3vw, 1.8rem); overflow-wrap: anywhere; }
h3 { margin-bottom: 0; font-size: 1.35rem; }
h4 { margin: 8px 0 10px; font-family: Georgia, serif; font-size: 1.15rem; line-height: 1.3; }
.intro { max-width: 780px; margin-bottom: 0; color: var(--muted); }

.search-form { max-width: 920px; margin-top: 25px; }
.search-form label { display: block; margin-bottom: 7px; font-size: .86rem; font-weight: 750; }
.search-row { display: flex; overflow: hidden; border: 1px solid #aebdc0; border-radius: 9px; background: #fff; box-shadow: 0 7px 20px rgba(24, 50, 58, .06); }
.search-row:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,127,112,.12); }
.search-row input { min-width: 0; flex: 1; padding: 14px 16px; border: 0; outline: 0; color: var(--ink); background: transparent; font: inherit; }
.search-row button { padding: 0 28px; border: 0; color: #fff; background: var(--teal); font: inherit; font-weight: 800; cursor: pointer; }
.search-row button:hover { background: var(--teal-dark); }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: .82rem; }
.examples span { font-weight: 750; }
.examples a { padding: 3px 9px; border-radius: 999px; color: #36535d; background: var(--soft-gray); text-decoration: none; }
.examples a:hover { color: var(--teal-dark); background: var(--soft-teal); }
.level-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 14px; margin-top: 17px; color: var(--muted); font-size: .78rem; }
.legend-title { color: var(--ink); font-weight: 800; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.legend-item.level-one i { background: var(--level-one); }
.legend-item.level-two i { background: var(--level-two); }
.legend-item.level-three i { background: var(--level-three); }

.main-content { min-height: 450px; padding: 34px 0 72px; }
.message-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.message-panel.warning { border-color: #e3c78e; background: var(--soft-amber); }
.message-panel p { margin: 3px 0 0; }
.status-label { font-size: .8rem; font-weight: 900; letter-spacing: .025em; }
.count-chip { flex: none; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.8); font-size: .82rem; font-weight: 800; }

.evidence-card, .candidate-section, .welcome-card { padding: 34px 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 12px 35px rgba(23, 48, 55, .06); }
.evidence-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.identity-title > p { margin-bottom: 3px; color: var(--muted); }
.identity-meta { font-size: .9rem; }
.tier-badge { flex: none; padding: 7px 16px; border-radius: 999px; color: #fff; font-size: .9rem; font-weight: 850; }
.tier-badge.level-one { background: var(--level-one); }
.tier-badge.level-two { color: #332300; background: var(--level-two); }
.tier-badge.level-three { background: var(--level-three); }
.evidence-alert { margin: 24px 0 28px; padding: 16px 20px; border-radius: 9px; font-weight: 800; }
.evidence-alert.candidate { color: #0c655b; background: var(--soft-teal); }
.evidence-alert.review { color: #965e08; background: var(--soft-amber); }
.evidence-alert.none { color: #9f2f2f; background: #fae7e7; }

.statement-block { padding: 4px 0 22px; }
.statement-block > p { margin-bottom: 10px; font-size: 1.08rem; }
.statement-source { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .88rem; font-style: italic; }
.statement-source a { text-decoration: none; }
.statement-source a:hover { text-decoration: underline; }
.level-tag { display: inline-flex; min-width: 90px; justify-content: center; padding: 5px 13px; border-radius: 999px; color: #fff; font-style: normal; font-weight: 800; }
.level-tag.entity { background: var(--teal); }

.metadata-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.metadata-row div { padding: 13px 15px; border-right: 1px solid var(--line); background: #fbfcfc; }
.metadata-row div:last-child { border-right: 0; }
.metadata-row dt { color: var(--muted); font-size: .75rem; font-weight: 850; letter-spacing: .02em; }
.metadata-row dd { margin: 2px 0 0; overflow-wrap: anywhere; font-weight: 700; }

.publication-section { margin-top: 30px; padding-top: 27px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-heading > p { margin-bottom: 2px; color: var(--muted); font-size: .86rem; text-align: right; }
.section-heading.compact { margin-bottom: 17px; }
.paper-list { display: grid; gap: 13px; }
.paper-card { padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.paper-meta, .identifier-links { display: flex; flex-wrap: wrap; gap: 7px; }
.paper-meta span { padding: 3px 8px; border-radius: 999px; color: #44565d; background: var(--soft-gray); font-size: .73rem; font-weight: 750; }
.matched-name { margin-bottom: 12px; color: var(--muted); font-size: .86rem; }
blockquote { margin: 14px 0; padding: 14px 16px; border-left: 3px solid #d5a440; color: #33464b; background: #fbf7ed; }
blockquote span { display: block; margin-bottom: 5px; color: #87651d; font-size: .75rem; font-weight: 850; letter-spacing: .02em; }
.identifier-links a { color: var(--teal-dark); font-size: .82rem; font-weight: 800; }
.no-publications { margin: 0; padding: 20px; border-radius: 8px; color: var(--muted); background: var(--soft-gray); }
.candidate-section { margin-top: 20px; }
.candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.candidate-card { display: flex; flex-direction: column; gap: 5px; padding: 17px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.candidate-card:hover { border-color: var(--teal); background: #fbfefd; }
.candidate-card strong { color: var(--teal-dark); overflow-wrap: anywhere; }
.candidate-card small { color: var(--muted); }

.welcome-card { display: grid; grid-template-columns: .8fr 1.2fr; gap: 45px; }
.welcome-card h2 { font-family: Georgia, serif; }
.welcome-card ol { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.welcome-card li { display: grid; grid-template-columns: 32px 105px 1fr; gap: 10px; counter-increment: steps; }
.welcome-card li::before { content: counter(steps); display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); font-size: .75rem; font-weight: 850; }
.welcome-card li span { color: var(--muted); }
@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1180px); }
  .page-header { padding: 30px 0 25px; }
  .search-row { display: block; }
  .search-row input, .search-row button { width: 100%; }
  .search-row button { padding: 12px; }
  .evidence-card, .candidate-section, .welcome-card { padding: 22px 20px; }
  .evidence-header, .message-panel, .section-heading { align-items: flex-start; flex-direction: column; }
  .metadata-row, .candidate-grid, .welcome-card { grid-template-columns: 1fr; }
  .metadata-row div { border-right: 0; border-bottom: 1px solid var(--line); }
  .metadata-row div:last-child { border-bottom: 0; }
  .section-heading > p { text-align: left; }
  .welcome-card { gap: 20px; }
  .welcome-card li { grid-template-columns: 28px 1fr; }
  .welcome-card li span { grid-column: 2; }
}
