body[data-edition] {
  --edition-line: #d3d9dd;
  --edition-bg: #edf1f3;
  --paper-front: #fff;
  --display-band: #9d292c;
  --directory-head: #185970;
  --directory-paper: #faf0cf;
  --directory-edge: #e4cc8a;
  --blue-ball: #1864bf;
  --red-ball: #ca302f;
  --green-ball: #168156;
}
body[data-edition=news] { --edition-dark:#292850;--edition-rich:#47417b;--edition-ink:#232a43;--edition-soft:#eff0f8;--edition-bg:#edf0f5;--directory-head:#205b73;--display-band:#a52937; }
body[data-edition=topics] { --edition-dark:#084671;--edition-rich:#0b67a9;--edition-ink:#133145;--edition-soft:#e9f5fb;--edition-bg:#eaf3f8;--directory-head:#145575;--display-band:#b53433; }
body[data-edition=index] { --edition-dark:#224c40;--edition-rich:#2c7059;--edition-ink:#273b36;--edition-soft:#e9f2ed;--edition-bg:#eef2ef;--directory-paper:#f8efd3;--directory-head:#286453;--display-band:#92532b; }
body[data-edition=hall] { --edition-dark:#791d23;--edition-rich:#a12c31;--edition-ink:#342421;--edition-soft:#faefeb;--edition-bg:#f5efea;--display-band:#ad292b; }

body[data-page=home] main.shell { width:min(830px,100%);background:var(--paper-front);box-shadow:0 0 32px #1a33420e; }
.masthead .shell,.footer { width:min(830px,calc(100% - 20px)); }
body[data-page=home][data-edition=hall] .masthead,body[data-page=home][data-edition=topics] .masthead { display:none; }
body[data-page=home][data-edition=index] .masthead { background:#e9efeb;border-bottom:1px solid #bacec3;color:var(--edition-ink); }
body[data-page=home][data-edition=index] .masthead a,body[data-page=home][data-edition=index] .masthead small,body[data-page=home][data-edition=index] .masthead-zone { color:var(--edition-dark); }
body[data-page=home][data-edition=index] .brand-icon { width:29px;height:29px;background:#fff3cf;color:#365441;border-color:#c6ac6b; }
body[data-page=home][data-edition=index] .masthead-inner { min-height:42px; }
body[data-page=home][data-edition=index] .brand small { display:none; }

.editorial-hero { border:0;border-radius:0;margin:0;background:var(--edition-dark); }
.editorial-slide { min-height:0;aspect-ratio:830 / 300; }
.editorial-title { padding:10px clamp(14px,4.5vw,34px) 18px; }
.editorial-title h1 { text-shadow:0 2px 8px #12132045; }
.editorial-slide::after { background:linear-gradient(90deg,#1f1124d4,transparent 72%); }
body[data-edition=hall] .editorial-slide { aspect-ratio:1.66;max-height:390px; }
body[data-edition=hall] .editorial-slide:not(.light)::after { background:linear-gradient(90deg,#3b0e12ae,#5c1a1900 77%); }
body[data-edition=hall] .editorial-slide img { object-position:center 51%; }
body[data-edition=hall] .editorial-title h1 { color:#ffdf9b;text-shadow:0 2px 10px #4f0505; }
body[data-edition=hall] .editorial-slide.light .editorial-title h1 { color:#553416;text-shadow:0 1px #fff; }
body[data-edition=news] .editorial-slide img { object-position:center 44%; }
body[data-edition=topics] .editorial-slide:not(.light)::after { background:linear-gradient(90deg,#073a67c9,transparent 80%); }
body[data-edition=topics] .editorial-slide img { object-position:center 33%; }
body[data-edition=topics] .editorial-title h1 { color:#ffecac; }
body[data-edition=topics] .editorial-slide.light .editorial-title h1 { color:#58401e; }
.editorial-title .edition-kicker { letter-spacing:.095em; }
.banner-controls { background:#22243476;bottom:7px; }
.banner-controls button { width:28px;height:23px; }

.edition-shortcuts { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;padding:9px 8px;border-block:1px solid var(--edition-line);background:#fff; }
.edition-shortcuts button,.edition-shortcuts a { display:grid;place-items:center;border-radius:999px;min-height:35px;font-weight:750;padding:2px 3px;background:var(--edition-rich);color:white;white-space:nowrap; }
body[data-edition=news] .edition-shortcuts button,body[data-edition=news] .edition-shortcuts a { background:#932932; }
body[data-edition=topics] .edition-shortcuts button { background:#126ca8; }
.site-directory { background:var(--directory-paper); }
.site-directory h2 { background:var(--directory-head);color:#fff0ae;text-align:center;font-size:1.15rem;font-weight:830;letter-spacing:.08em;padding:7px 8px;line-height:1.2; }
.site-directory .presentations { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin:0;border:0;border-radius:0;background:var(--directory-paper);gap:0; }
.site-directory .presentations a { padding:7px 4px;text-align:center;font-weight:730;color:#243b50;border-left:1px solid var(--directory-edge);background:transparent; }
.site-directory .presentations a[aria-current] { color:var(--edition-dark);background:#f3df9d;box-shadow:inset 0 -2px #b59849; }
.site-directory .presentations small { display:none; }

.live-region { margin:0; }
body[data-edition=index] .live-region { margin:0; }
.draw-card { border:0;border-bottom:1px solid var(--edition-line);border-radius:0;background:#f5f6f7;padding:0 0 5px; }
.draw-band { padding:6px 10px;background:var(--display-band);border-bottom:1px solid #fff5de;color:#fff4e2;font-weight:800;letter-spacing:.035em;font-size:1.08rem; }
.draw-top { min-height:34px;padding:4px 10px 2px; }
.draw-identity { display:flex;align-items:center;gap:5px;white-space:nowrap;min-width:0;font-size:.98rem;font-weight:650; }
.draw-identity strong { color:var(--display-band);font-weight:850;font-variant-numeric:tabular-nums; }
.draw-history-link { color:var(--display-band);font-size:.86rem;font-weight:750;white-space:nowrap; }
.draw-identity .status-pill { font-size:.67rem;line-height:1.15;padding:3px 5px; }
.draw-card>.balls { margin:4px 10px 6px;gap:5px; }
.draw-card .ball-pair { border-radius:5px;padding:2px 3px 4px;gap:2px;box-shadow:inset 0 1px #ffffff40;background:#e8eced; }
.draw-card .ball-pair:has(.ball-red) { background:var(--red-ball); }
.draw-card .ball-pair:has(.ball-blue) { background:var(--blue-ball); }
.draw-card .ball-pair:has(.ball-green) { background:var(--green-ball); }
.draw-card .ball-pair.special { outline:1px solid #bca06b;outline-offset:1px; }
.draw-card .ball,.draw-card .special .ball { border:0;outline:0;box-shadow:none;background:transparent;width:100%;aspect-ratio:auto;min-height:40px;font-size:2rem;color:#fff;text-shadow:0 1px #14223a55;border-radius:0; }
.draw-card .ball-empty { color:#6b7a80;text-shadow:none; }
.draw-card .ball-pair small { background:#fff;padding:1px 4px;border-radius:3px;color:#20232b;font-weight:650;min-width:75%;text-align:center; }
.draw-card .ball-plus { margin:0;align-self:center; }
.draw-bottom { margin:0;padding:5px 10px 1px;border:0; }
.draw-bottom>div:first-child { display:flex;gap:5px;align-items:baseline;min-width:0; }
.draw-bottom strong { margin-top:0;white-space:nowrap; }
.draw-bottom .meta-label { white-space:nowrap; }
.draw-bottom .countdown { font-size:1rem; }
.draw-bottom .neutral-button { min-height:29px;padding:3px 7px;background:#f5d59a;color:#522c16;border-radius:4px; }
.draw-notice { margin-top:3px;margin-bottom:4px; }

.tools-panel { gap:0;margin:0;border-block:1px solid var(--edition-line); }
.tools-panel a { border:0;border-right:1px solid var(--edition-line);border-radius:0;min-height:46px;background:#fff; }
.tools-panel a:last-child { border-right:0; }
.topics { margin:0; }
.topic-heading { background:#fff;border:0;border-bottom:1px solid var(--edition-line);border-radius:0; }
.topic-heading>.section-head,.zodiac-board>.section-head { border-radius:0;padding:7px 10px;background:var(--edition-dark); }
.topic-heading .section-head a { color:#fff5cc;white-space:nowrap; }
.topic-filter { padding:7px 9px;color:var(--edition-ink);font-size:.84rem;background:var(--edition-soft); }
.topic-filter summary { cursor:pointer;font-weight:720; }
.topic-filter .categories { padding:6px 0 0; }
.period-board { border-radius:0;margin:0 0 6px;border-inline:0;border-color:var(--edition-line); }
.period-board header { justify-content:center;border:0;padding:6px 6px;color:#fff; }
.period-board h3 { line-height:1.25;letter-spacing:.04em; }
.period-board.tone-0 header { background:var(--edition-dark); }
.period-board.tone-1 header { background:#294e6b; }
.period-board.tone-2 header { background:#35674c; }
.period-board.tone-3 header { background:#855938; }
body[data-edition=topics] .period-board header { background:linear-gradient(120deg,#f0f7ff,#d1e4fa);color:#0d4672;border-top:1px solid #79acd6;border-bottom:1px solid #a9cee6; }
body[data-edition=topics] .period-board.tone-1 header,body[data-edition=topics] .period-board.tone-3 header { background:linear-gradient(120deg,#f6f9f4,#dfede3);color:#20533e;border-color:#b5cebd; }
body[data-edition=news] .period-board.tone-0 header { background:#38396a; }
body[data-edition=index] .period-board.tone-0 header { background:#355d47; }
.period-table { background:#fff; }
.period-table th,.period-table td { border-color:#d8e2e7; }
.period-table thead { background:#edf1f4;color:#3b4a56; }
.period-table tbody tr:nth-child(even) { background:#f4f8fa; }
.period-table td:nth-child(2) { color:#166248; }
.period-table td:nth-child(3) b { color:#a32030; }
body[data-edition=hall] .period-table th,body[data-edition=hall] .period-table td { border-color:#ebdcd1; }
body[data-edition=hall] .period-table thead { background:#f7ebd8; }
body[data-edition=hall] .period-table tbody tr:nth-child(even) { background:#fff8ec; }
.period-art,.zodiac-board { border-radius:0;margin:6px 0;border-inline:0; }
.period-art img { height:clamp(188px,46vw,345px); }
.zodiac-visual img { height:clamp(158px,38vw,290px); }
.public-summaries .panel,.references { margin:8px 0 0;border-inline:0;border-radius:0; }
.references a { background:var(--edition-soft); }
.footer { margin-top:12px;padding:11px 0 15px;border-top:0;text-align:center;justify-content:center; }

.record-search { padding:11px 13px;background:var(--edition-soft);border-bottom:1px solid var(--edition-line); }
.record-search label { font-size:.86rem;font-weight:750;display:block;margin-bottom:4px; }
.record-search-controls { display:flex;gap:6px; }
.record-search-controls input { width:100%;min-width:0;border:1px solid var(--edition-line);border-radius:5px;padding:8px 9px;font-size:1rem;background:white; }
.record-search-controls button[type=submit] { color:white;background:var(--edition-rich);border-radius:5px;white-space:nowrap;padding:6px 13px;font-weight:750; }
.record-search-controls [data-clear-query] { white-space:nowrap; }

body[data-page=history] .masthead { display:none; }
body[data-page=history] main.shell { width:min(830px,100%);background:#fff;box-shadow:0 0 32px #1a33420e; }
.record-titlebar { min-height:48px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:4px;padding-inline:10px;background:#214f3e;color:#fff; }
.record-titlebar h1 { font-size:1.19rem;font-weight:790; }
.record-titlebar button,.record-titlebar a { justify-self:start;background:transparent;display:grid;place-items:center;min-height:42px;padding-inline:6px;color:#fff;font-size:.9rem;font-weight:700; }
.record-titlebar a { justify-self:end; }
body[data-page=history] .history-tabs { margin:0;gap:0;border-bottom:1px solid var(--edition-line); }
body[data-page=history] .history-tabs button { display:grid;justify-items:center;align-content:center;gap:4px;min-height:66px;padding:6px 2px;border:0;border-radius:0;background:#fff;color:#283433; }
body[data-page=history] .history-tabs button[aria-pressed=true] { box-shadow:inset 0 -2px #a34826;color:#8e381d; }
body[data-page=history] .history-tabs .tool-icon { width:29px;height:29px;border-radius:50%; }
body[data-page=history] .history-panel { border:0;border-radius:0; }
body[data-page=history] .history-controls { align-items:center;gap:7px;padding:7px 9px; }
body[data-page=history] .history-controls label { display:flex;align-items:center;gap:4px; }
body[data-page=history] .history-controls select { min-height:33px;border-radius:4px; }
body[data-page=history] .record-search { padding:7px 9px; }
body[data-page=history] .record-options { padding:7px 9px; }
#history-results .history-row { min-height:59px;gap:8px;padding:6px 8px;border-bottom:1px solid #e1e8e5; }
#history-results .history-row:nth-child(even) { background:#f7faf8; }
#history-results .history-meta { width:94px; }
#history-results .history-meta time { margin:0 0 2px;color:#5c6664;font-variant-numeric:tabular-nums; }
#history-results .history-meta strong { color:#252e30;font-weight:850;font-size:1rem; }
#history-results .balls.compact { max-width:620px;gap:4px; }
#history-results .compact .ball { width:min(100%,38px);box-shadow:inset 0 0 0 2px #ffffff60; }
#history-results .compact .ball-pair small { color:#252e30; }

@media(max-width:730px) {
  html { scrollbar-width:none; }
  .masthead-inner { min-height:49px; }
  body[data-page=home][data-edition=index] .masthead-inner { min-height:37px; }
  body[data-page=home][data-edition=index] .masthead .top-nav { font-size:.78rem; }
  .editorial-slide { aspect-ratio:2.92;min-height:140px; }
  body[data-edition=hall] .editorial-slide { aspect-ratio:1.66; }
  .editorial-title { padding:11px 15px 21px;max-width:79%; }
  .editorial-title h1 { font-size:clamp(1.35rem,6vw,2.2rem); }
  body[data-edition=hall] .editorial-title h1 { font-size:clamp(1.7rem,7.8vw,2.55rem); }
  .editorial-title p { white-space:normal;line-height:1.37; }
  .banner-controls { bottom:3px; }
  .banner-controls button { width:22px;height:19px; }
  .edition-shortcuts { padding:7px 4px;gap:4px; }
  .edition-shortcuts button,.edition-shortcuts a { min-height:28px;padding:3px 1px;font-size:clamp(.61rem,2.97vw,.86rem); }
  .site-directory h2 { font-size:1.02rem;padding:6px; }
  .site-directory .presentations { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .site-directory .presentations a { min-height:29px;font-size:.88rem;border-top:1px solid var(--directory-edge); }
  .draw-band { font-size:.94rem;padding:5px 4px; }
  .draw-top { padding:3px 6px 1px;min-height:32px; }
  .draw-identity { gap:3px;font-size:.86rem; }
  .draw-card>.balls { margin:3px 6px 5px;gap:3px; }
  .draw-card .ball-pair { padding:1px 2px 3px;gap:2px; }
  .draw-card .ball,.draw-card .special .ball { min-height:32px;font-size:clamp(1.18rem,6.15vw,1.72rem); }
  .draw-card .ball-pair small { min-width:95%;padding:1px 0;font-size:.65rem; }
  .draw-bottom { padding:4px 6px 0; }
  .draw-bottom .countdown { font-size:.87rem; }
  .draw-bottom .meta-label,.draw-bottom strong { font-size:.73rem; }
  .draw-bottom .neutral-button { min-height:26px;font-size:.73rem; }
  .tools-panel a { min-height:37px; }
  .topic-heading>.section-head { padding:6px 9px; }
  .period-board h3 { font-size:.99rem; }
  .period-table th,.period-table td { padding:3px 2px; }
  .period-art img { height:clamp(182px,55vw,264px); }
  .record-search-controls input,.record-search-controls button { min-height:42px; }
  .record-titlebar { min-height:40px; }
  .record-titlebar button,.record-titlebar a { min-height:39px; }
  body[data-page=history] .history-tabs button { min-height:56px;font-size:.8rem; }
  body[data-page=history] .history-tabs .tool-icon { width:26px;height:26px; }
  #history-results .history-meta { width:73px; }
  #history-results .history-meta strong { font-size:.9rem; }
  #history-results .balls.compact { gap:2px; }
  #history-results .compact .ball { width:min(100%,30px); }
}
