:root {
  --maroon: #760000;
  --maroon-dark: #4d0000;
  --ink: #292521;
  --muted: #716960;
  --paper: #fbfaf7;
  --panel: #fff;
  --line: #ddd2c4;
  --cream: #f3eee6;
  --gold: #bd8a24;
  --blue: #245b7a;
  --green: #34735a;
  --shadow: 0 4px 18px rgba(56, 38, 24, .07);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.48 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--maroon); }
.site-header { background: var(--maroon); color: white; border-bottom: 4px solid var(--gold); }
.header-inner { max-width: 1240px; margin: auto; min-height: 76px; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 13px; color: white; text-decoration: none; font: 700 24px/1.05 Georgia, serif; }
.brand img { width: 46px; height: 52px; object-fit: contain; filter: brightness(0) invert(1); }
.brand small { display: block; margin-bottom: 4px; font: 600 11px/1.1 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .14em; opacity: .75; }
nav { display: flex; flex-wrap: wrap; gap: 7px; }
nav a { color: white; text-decoration: none; font-weight: 650; padding: 8px 11px; border-radius: 4px; }
nav a:hover { background: rgba(255,255,255,.13); }
main { max-width: 1240px; margin: auto; padding: 34px 24px 70px; }
.hero { display: grid; grid-template-columns: 1fr minmax(280px, 430px); gap: 38px; align-items: end; margin-bottom: 26px; }
.eyebrow,.kicker { color: var(--maroon); font-size: 11px; font-weight: 800; letter-spacing: .14em; margin: 0 0 5px; }
h1,h2 { font-family: Georgia, serif; color: var(--maroon); }
h1 { font-size: clamp(36px, 6vw, 66px); line-height: .98; margin: 0; }
.lede { margin: 12px 0 0; color: var(--muted); font-size: 18px; }
.hero-note { border-left: 4px solid var(--gold); padding: 4px 0 4px 16px; color: var(--muted); }
.hero-note strong { display: block; color: var(--ink); margin-bottom: 4px; }
.control-panel { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 175px 220px 1fr auto; gap: 14px; align-items: end; background: var(--cream); border: 1px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: var(--shadow); }
label { font-size: 12px; font-weight: 750; color: var(--muted); }
select { display: block; width: 100%; margin-top: 4px; padding: 9px 30px 9px 10px; border: 1px solid #b9aa98; border-radius: 4px; background: white; color: var(--ink); font: 650 16px Georgia, serif; }
.layer-description { font-size: 13px; color: var(--muted); padding-bottom: 5px; }
.layer-description strong { color: var(--ink); }
.primary-action { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border-radius: 4px; background: var(--maroon); color: white; text-decoration: none; font-weight: 750; white-space: nowrap; }
.warning { margin: 16px 0; border: 1px solid #ddcfa5; border-radius: 5px; padding: 10px 13px; background: #fff9e9; color: #665323; font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin: 18px 0; }
.stat-card { min-height: 118px; border: 1px solid var(--line); background: white; border-radius: 7px; padding: 17px; box-shadow: var(--shadow); }
.stat-card span,.stat-card small { display: block; color: var(--muted); }
.stat-card span { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.stat-card strong { display: block; margin: 5px 0 1px; font: 700 34px Georgia, serif; color: var(--maroon); }
.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.panel { grid-column: span 6; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; box-shadow: var(--shadow); }
.works-panel,.evidence-panel,.method-panel { grid-column: 1 / -1; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 11px; margin-bottom: 15px; }
h2 { margin: 0; font-size: 25px; }
h3 { font: 700 13px system-ui, sans-serif; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 9px; }
.panel-intro,.footnote { color: var(--muted); }
.panel-intro { margin: 0 0 14px; }
.footnote { font-size: 12px; margin: 14px 0 0; }
.help { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; background: var(--cream); color: var(--maroon); font-weight: 900; cursor: help; }
.status-pill { display: inline-block; border-radius: 99px; background: #e7f2ec; color: #245b45; padding: 4px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pill.neutral { background: var(--cream); color: var(--muted); }
.bar-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; align-items: center; gap: 10px; margin: 9px 0; }
.bar-label strong,.bar-label small { display: block; }
.bar-label small { color: var(--muted); font-size: 11px; }
.bar-track { height: 13px; border-radius: 20px; background: #eee8df; overflow: hidden; }
.bar-fill { height: 100%; min-width: 2px; background: var(--maroon); border-radius: inherit; }
.bar-row:nth-child(even) .bar-fill { background: var(--gold); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.compact .bar-row { grid-template-columns: minmax(130px, 190px) 1fr 42px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.three-way { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.rank-item { display: grid; grid-template-columns: minmax(0, 1fr) 45px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dotted #ddd5cb; }
.rank-item span:first-child { overflow: hidden; text-overflow: ellipsis; }
.rank-item b { text-align: right; color: var(--maroon); font-variant-numeric: tabular-nums; }
.gloss-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.gloss { display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--line); background: var(--cream); border-radius: 4px; padding: 7px 10px; }
.gloss b { color: var(--maroon); }
.reliability-card { border-left: 4px solid var(--blue); background: #f4f8fa; margin: 10px 0; padding: 11px 12px; }
.reliability-card.daphne { border-color: var(--green); background: #f3f8f5; }
.reliability-card header { display: flex; justify-content: space-between; gap: 12px; }
.reliability-card strong { color: var(--ink); }
.delta { font-weight: 850; color: var(--maroon); }
.reliability-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
table { border-collapse: collapse; width: 100%; }
th,td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
td:nth-child(n+3),th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.work-title { font-family: Georgia, serif; font-weight: 700; color: var(--maroon); }
.work-title small { display: block; font: 12px system-ui, sans-serif; color: var(--muted); }
.zero-row { color: #aaa; }
.example { display: grid; grid-template-columns: 185px 1fr auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.example:last-child { border: 0; }
.example-meta { color: var(--muted); font-size: 12px; }
.example-meta strong { display: block; color: var(--maroon); font: 700 15px Georgia, serif; }
.greek { font: 18px/1.55 Georgia, "Times New Roman", serif; }
mark { background: #fff0a8; color: var(--maroon-dark); padding: 1px 2px; border-bottom: 2px solid var(--gold); }
.inspect-link { white-space: nowrap; align-self: center; font-weight: 750; text-decoration: none; }
.source-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.source-card { background: var(--cream); padding: 13px; border-radius: 5px; }
.source-card strong,.source-card span { display: block; }
.source-card span { color: var(--muted); font-size: 12px; margin-top: 3px; }
details { margin-top: 16px; }
summary { cursor: pointer; font-weight: 750; color: var(--maroon); }
dl { display: grid; grid-template-columns: 1fr auto; max-width: 500px; }
dt,dd { padding: 5px; border-bottom: 1px solid var(--line); margin: 0; }
dd { text-align: right; font-variant-numeric: tabular-nums; }
#tooltip { position: fixed; z-index: 20; max-width: 280px; background: #241d18; color: white; padding: 9px 11px; border-radius: 4px; font-size: 12px; box-shadow: var(--shadow); pointer-events: none; }
.error { max-width: 800px; margin: 80px auto; padding: 25px; background: #fff0f0; border: 1px solid #c88; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .control-panel { position: static; grid-template-columns: 1fr 1fr; }
  .layer-description { grid-column: 1 / -1; }
  .primary-action { grid-column: 1 / -1; }
  .panel { grid-column: 1 / -1; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .source-cards { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  main { padding: 24px 14px 50px; }
  .control-panel,.stat-grid,.split,.three-way { grid-template-columns: 1fr; }
  .example { grid-template-columns: 1fr; gap: 7px; }
  .table-scroll { overflow-x: auto; }
}
