/* ==========================================================
   zestlystorycrats.lat — Emerald Crystal UI
   Frosted-glass surfaces, faceted gradients, deep emerald and
   amber palette. Tokens, reset, layout, navigation, records,
   tools, articles, legal layout, cookie notice and responsive
   rules in one file.
   ========================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #EEF6F2;
  --panel: #FFFFFF;
  --text: #10231F;
  --primary: #0F766E;
  --secondary: #E08A1E;
  --border: #BBD3CB;

  /* derived tints and shades only */
  --primary-dark: #0A4F4A;
  --secondary-dark: #8F4F06;
  --muted: #40564F;
  --row: rgba(255, 255, 255, 0.55);
  --tint: #DAF0EA;
  --sand: #E6EFEB;
  --amber-tint: #FCEBCF;

  /* crystal surfaces */
  --glass: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.66) 55%, rgba(255, 255, 255, 0.82) 100%);
  --glass-edge: rgba(255, 255, 255, 0.95);
  --shadow: 0 10px 30px rgba(10, 79, 74, 0.13), 0 2px 6px rgba(16, 35, 31, 0.06);
  --gem-gradient: linear-gradient(135deg, #0F8173 0%, #0F766E 55%, #0A4F4A 100%);
  --stripe: linear-gradient(90deg, #0F766E, #2DB3A0 50%, #E08A1E);
  --radius: 18px;
  --radius-sm: 10px;

  --u: 8px;
  --font-head: Georgia, "Times New Roman", serif;
  --font-body: Arial, Helvetica, sans-serif;
  --font-data: "Courier New", Courier, monospace;

  --pad: 16px;
  --rhythm: 28px;
  --tab-radius: 10px 10px 0 0;
  --sticky-offset: 88px;
}

@media (min-width: 768px) {
  :root { --pad: 24px; --rhythm: 40px; }
}
@media (min-width: 1000px) {
  :root { --rhythm: 64px; }
}
@media (min-width: 1280px) {
  :root { --pad: 40px; }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
  hyphens: auto;
}
/* Faceted crystal backdrop, purely decorative */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(15, 118, 110, 0.09) 0 16%, transparent 16%),
    linear-gradient(245deg, rgba(224, 138, 30, 0.10) 0 18%, transparent 18%),
    linear-gradient(62deg, rgba(45, 179, 160, 0.10) 0 9%, transparent 9%),
    radial-gradient(800px 520px at 8% 0%, rgba(45, 179, 160, 0.26), transparent 62%),
    radial-gradient(700px 520px at 100% 18%, rgba(224, 138, 30, 0.18), transparent 62%),
    linear-gradient(160deg, #F1F8F4 0%, #E9F5EF 50%, #FBF3E4 100%);
}
@media (min-width: 768px) {
  body { font-size: 18px; line-height: 1.6; }
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; }
img, svg { max-width: 100%; height: auto; }
[id] { scroll-margin-top: 24px; }
@media (min-width: 768px) {
  [id] { scroll-margin-top: 96px; }
}
[hidden] { display: none !important; }
code { font-family: var(--font-data); font-size: 0.9em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--text);
  line-height: 1.2;
  font-weight: 700;
  hyphens: manual;
}
h1 { font-size: 34px; }
h2 { font-size: 28px; margin-bottom: 16px; }
h3 { font-size: 22px; }
h4 { font-size: 16px; }
@media (min-width: 768px) {
  h1 { font-size: 44px; }
  h2 { font-size: 32px; }
}
/* Section headings get a short faceted underline */
.section > .wrap > h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: 10px;
  border-radius: 2px;
  background: var(--stripe);
}
p + p, p + ul, p + ol, ul + p, ol + p, p + .table-wrap, .table-wrap + p { margin-top: 16px; }

a {
  color: var(--primary-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(10, 79, 74, 0.55);
  transition: text-decoration-color 150ms ease-out, opacity 150ms ease-out;
}
a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: calc(1200px + var(--pad) * 2);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.section { padding-top: var(--rhythm); padding-bottom: var(--rhythm); }
.section + .section { border-top: 1px solid var(--border); }
.section-dense { padding-top: 24px; padding-bottom: 24px; }
.section-note { max-width: 68ch; margin-bottom: 24px; }
.reading { max-width: 68ch; }
.after-list { max-width: 68ch; margin-top: 24px; padding-bottom: var(--rhythm); }

.skip-link {
  position: absolute;
  left: 8px; top: -80px;
  z-index: 100;
  background: var(--text);
  color: var(--panel);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 8px; }

/* ---------- Header and navigation ---------- */
.site-header {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 3px solid transparent;
  border-image: var(--stripe) 1;
  box-shadow: 0 6px 24px rgba(10, 79, 74, 0.12);
}
@media (min-width: 768px) {
  .site-header { position: sticky; top: 0; z-index: 40; }
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  padding-top: 8px;
  padding-bottom: 0;
}
.brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  overflow-wrap: anywhere;
}
/* Decorative faceted gem mark, drawn in CSS so it follows the palette */
.brand::before {
  content: "";
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #2DB3A0 0%, #0F766E 50%, #E08A1E 130%);
  clip-path: polygon(25% 4%, 75% 4%, 100% 38%, 50% 100%, 0 38%);
}
@media (min-width: 768px) { .brand { font-size: 24px; } }
.primary-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
}
.primary-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  font-size: 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 3px solid transparent;
  transition: border-color 150ms ease-out;
}
.primary-nav a:hover { border-bottom-color: var(--secondary); }
.primary-nav a[aria-current="page"] {
  border-bottom-color: var(--secondary);
  font-weight: 700;
  color: var(--primary-dark);
}
@media (max-width: 767px) {
  .primary-nav { width: 100%; border-top: 1px solid var(--border); }
  .primary-nav ul { gap: 0; }
  .primary-nav a { padding: 0 12px 0 0; margin-right: 12px; }
}

/* ---------- Page head and breadcrumb ---------- */
.page-head { padding-top: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--border); margin-bottom: var(--rhythm); }
.page-head h1 { margin-top: 16px; max-width: 26ch; }
.page-head h1::after {
  content: "";
  display: block;
  width: 88px;
  height: 5px;
  margin-top: 16px;
  border-radius: 3px;
  background: var(--stripe);
}
.page-intro { margin-top: 16px; max-width: 68ch; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 15px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--muted); }
.breadcrumb a { display: inline-block; min-height: 24px; }
.page-head + .section { padding-top: 0; }

/* ---------- Hero: dark emerald crystal stage ---------- */
.opener {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: 48px;
  padding-bottom: 64px;
  color: #EEF6F2;
  background:
    linear-gradient(115deg, rgba(45, 179, 160, 0.16) 0 13%, transparent 13%),
    linear-gradient(245deg, rgba(224, 138, 30, 0.18) 0 11%, transparent 11%),
    linear-gradient(72deg, rgba(255, 255, 255, 0.05) 0 30%, transparent 30%),
    radial-gradient(720px 480px at 88% 8%, rgba(45, 179, 160, 0.38), transparent 65%),
    radial-gradient(620px 420px at 0% 100%, rgba(224, 138, 30, 0.22), transparent 65%),
    linear-gradient(145deg, #06201D 0%, #0A3F3A 58%, #0C2522 100%);
  border-bottom: 4px solid transparent;
  border-image: var(--stripe) 1;
}
.opener + .section { border-top: 0; }
/* Large translucent crystal facets, decorative only */
.opener::before,
.opener::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  clip-path: polygon(25% 4%, 75% 4%, 100% 38%, 50% 100%, 0 38%);
}
.opener::before {
  width: 420px; height: 420px;
  right: -120px; top: -140px;
  transform: rotate(14deg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 70%);
}
.opener::after {
  width: 260px; height: 260px;
  left: -80px; bottom: -110px;
  transform: rotate(-12deg);
  background: linear-gradient(135deg, rgba(224, 138, 30, 0.28), rgba(224, 138, 30, 0) 70%);
}
.opener-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }
.opener-copy { min-width: 0; }
.opener .kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FCD9A0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(252, 217, 160, 0.45);
  border-left: 4px solid var(--secondary);
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 20px;
}
.opener h1 {
  color: #FFFFFF;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 15ch;
}
.opener .hero-accent { color: #FCD9A0; font-style: italic; }
@media (min-width: 480px) { .opener h1 { font-size: 42px; } }
@media (min-width: 768px) { .opener h1 { font-size: 52px; } }
@media (min-width: 1000px) {
  .opener { padding-top: 72px; padding-bottom: 88px; }
  .opener h1 { font-size: 62px; }
  .opener-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 64px; }
}
.opener .lead { margin-top: 24px; max-width: 62ch; color: #DCEBE5; }
.opener .coverage {
  display: inline-block;
  max-width: 100%;
  margin-top: 24px;
  font-family: var(--font-data);
  font-size: 15px;
  line-height: 1.5;
  color: #FFFFFF;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-left: 4px solid var(--secondary);
  border-radius: var(--radius-sm);
}
/* Archive pages reuse the coverage strip on a light background */
.coverage {
  display: inline-block;
  max-width: 100%;
  margin-top: 24px;
  font-family: var(--font-data);
  font-size: 15px;
  line-height: 1.5;
  padding: 6px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-left: 4px solid var(--secondary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.opener .coverage { box-shadow: none; }

/* Right-hand hero visual: crystal illustration, month card and stats */
.hero-visual { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.hero-crystal-illustration {
  align-self: center;
  width: 120px;
  height: auto;
  margin-bottom: -34px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.45));
  animation: hero-crystal-float 6s ease-in-out infinite;
}
@keyframes hero-crystal-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (min-width: 768px) { .hero-crystal-illustration { width: 150px; margin-bottom: -44px; } }
@media (min-width: 1000px) { .hero-crystal-illustration { align-self: flex-end; margin-right: 32px; width: 170px; margin-bottom: -56px; } }

/* Solid emerald crystal card for the month label */
.month-label {
  position: relative;
  overflow: hidden;
  font-family: var(--font-head);
  color: #FFFFFF;
  line-height: 1;
  text-align: center;
  padding: 56px 24px 28px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.16) 0 22%, transparent 22%),
    linear-gradient(300deg, rgba(224, 138, 30, 0.38) 0 14%, transparent 14%),
    linear-gradient(145deg, #0F8173 0%, #0A4F4A 62%, #0C2522 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 5px solid var(--secondary);
  border-radius: var(--radius);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.month-label .month { display: block; font-size: 44px; font-weight: 700; letter-spacing: -0.02em; }
.month-label .year { display: block; margin-top: 10px; font-family: var(--font-data); font-size: 24px; color: #FCD9A0; letter-spacing: 0.12em; }
@media (min-width: 768px) {
  .month-label .month { font-size: 68px; }
}
@media (min-width: 1000px) {
  .month-label { text-align: right; padding: 64px 32px 36px; }
  .month-label .month { font-size: 76px; }
  .month-label .year { font-size: 32px; }
}

.hero-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.09);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-bottom: 3px solid var(--secondary);
  border-radius: var(--radius-sm);
  text-align: center;
}
.hero-stats li + li { margin-top: 0; }
.hero-stats li:nth-child(even) { border-bottom-color: #2DB3A0; }
.hero-stats strong { font-family: var(--font-data); font-size: 20px; line-height: 1.2; color: #FCD9A0; }
.hero-stats span { font-size: 13px; line-height: 1.3; color: #DCEBE5; }
@media (min-width: 768px) {
  .hero-stats strong { font-size: 24px; }
  .hero-stats span { font-size: 14px; }
}

/* Hero search card: bright frosted glass on the dark stage */
.mini-search {
  margin-top: 28px;
  max-width: 460px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(236, 247, 242, 0.92) 100%);
  border: 1px solid var(--glass-edge);
  border-bottom: 4px solid var(--secondary);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.mini-search label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.mini-search-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-search input { width: 120px; }

/* ---------- Form controls ---------- */
input[type="text"], input[type="number"], select, textarea {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  min-height: 48px;
  padding: 8px 12px;
  max-width: 100%;
  box-shadow: inset 0 1px 2px rgba(16, 35, 31, 0.06);
}
input[type="number"] { font-family: var(--font-data); }
textarea { width: 100%; resize: vertical; line-height: 1.5; }
select { width: 100%; }
label { display: block; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.field + .field { margin-top: 24px; }
.hint { font-size: 14px; color: var(--muted); margin-top: 6px; }
.error { font-size: 15px; font-weight: 700; color: #8A1F11; margin-top: 6px; }
.error::before { content: "Error: "; }
[aria-invalid="true"] { border-bottom-color: #8A1F11; outline: 2px solid #8A1F11; outline-offset: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 20px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--panel);
  background: var(--gem-gradient);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 3px solid var(--secondary);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 150ms ease-out;
}
.btn:hover { opacity: 0.9; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-quiet {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-edge);
  border-bottom: 3px solid var(--primary);
  box-shadow: var(--shadow);
}
.status { min-height: 24px; margin-top: 16px; font-size: 15px; font-weight: 700; color: var(--primary-dark); }

/* ---------- Master-detail shell ---------- */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
@media (min-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); gap: 40px; }
}
.col-title {
  font-size: 15px;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-dark);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 12px;
}

/* Ledger rows (home list) */
.ledger {
  list-style: none;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
}
.ledger li {
  background: var(--glass);
  border-bottom: 1px solid var(--border);
  border-left: 4px solid transparent;
  padding: 16px;
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}
.ledger li:first-child { border-left-color: var(--secondary); }
.ledger li:hover { background: var(--panel); border-left-color: var(--primary); }
.ledger li:last-child { border-bottom: 0; }
.row-date { font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.row-numbers { font-family: var(--font-data); font-size: 16px; margin-top: 4px; line-height: 1.5; }
.pool-tag {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--secondary-dark);
  border-bottom: 2px solid var(--secondary);
  padding: 0 2px;
  margin: 0 2px 0 6px;
}
.badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--gem-gradient);
  color: var(--panel);
  padding: 2px 10px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}
.read-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  font-weight: 700;
}

/* Archive index rail */
.index-rail .rail-list {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
}
.rail-list a {
  display: block;
  padding: 12px 16px;
  min-height: 48px;
  background: var(--glass);
  border-bottom: 1px solid var(--border);
  border-left: 4px solid transparent;
  text-decoration: none;
  color: var(--text);
  transition: opacity 150ms ease-out;
}
.rail-list a:hover { background: var(--panel); border-left-color: var(--secondary); }
.rail-date { display: block; font-family: var(--font-head); font-weight: 700; font-size: 17px; }
.rail-numbers { display: block; font-family: var(--font-data); font-size: 14px; margin-top: 2px; }
.rail-list a:hover .rail-date { text-decoration: underline; }
@media (min-width: 480px) and (max-width: 999px) {
  .index-rail .rail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0; }
}
@media (min-width: 1000px) {
  .index-rail { position: sticky; top: var(--sticky-offset); max-height: calc(100vh - 112px); overflow-y: auto; }
}

/* ---------- Detail sheets ---------- */
.sheet {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--glass-edge);
  border-bottom: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 28px 16px 24px;
  margin-top: 32px;
}
@media (min-width: 768px) { .sheet { padding: 36px 36px 32px; } }
.sheet + .sheet { margin-top: 56px; }
.records .sheet:first-child { margin-top: 32px; }
.shell > .sheet { margin-top: 32px; }
@media (min-width: 1000px) and (min-height: 820px) {
  .shell > .sheet { position: sticky; top: var(--sticky-offset); }
}
.tab {
  position: absolute;
  top: -28px;
  left: 16px;
  margin: 0;
  background: var(--gem-gradient);
  color: var(--panel);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 20px;
  padding: 4px 14px;
  border-radius: var(--tab-radius);
  box-shadow: 0 -2px 10px rgba(15, 118, 110, 0.25);
}
.sheet h3 { font-size: 28px; }
.record:target { outline: 3px solid var(--secondary); outline-offset: 6px; }
.draw-id { font-size: 15px; color: var(--muted); margin-top: 8px; }
.draw-id code { color: var(--text); }
.pool { margin-top: 24px; padding-left: 14px; border-left: 4px solid var(--primary); }
.pool-euro { border-left-color: var(--secondary); }
.pool h4 {
  font-family: var(--font-body);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-dark);
}
.pool-euro h4 { color: var(--secondary-dark); }
.pool-rule { font-size: 15px; color: var(--muted); margin: 2px 0 12px; }
.numbers { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
/* Main numbers are round gems */
.numbers li {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  width: 62px;
  height: 62px;
  text-align: center;
  color: var(--text);
  background: radial-gradient(circle at 30% 25%, #FFFFFF 0%, #DAF0EA 100%);
  border: 1px solid var(--border);
  border-bottom: 4px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 5px 12px rgba(15, 118, 110, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
/* Euro numbers are rounded amber tiles, so the pools differ by shape as well as colour */
.pool-euro .numbers li {
  border-radius: 16px;
  background: linear-gradient(145deg, #FFFFFF 0%, var(--amber-tint) 100%);
  border-bottom-color: var(--secondary);
  box-shadow: 0 5px 12px rgba(224, 138, 30, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.numbers li.is-match {
  background: var(--tint);
  outline: 3px solid var(--text);
  outline-offset: -3px;
}
@media (max-width: 479px) {
  .numbers { gap: 8px; }
  .numbers li { font-size: 22px; width: 52px; height: 52px; }
  .sheet h3 { font-size: 24px; }
}
.facts { margin-top: 24px; border-top: 1px solid var(--border); }
.facts > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--border); }
@media (min-width: 768px) {
  .facts > div { grid-template-columns: 200px minmax(0, 1fr); gap: 16px; }
}
.facts dt { font-weight: 700; font-size: 15px; }
.facts dd { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.note { margin-top: 16px; font-size: 15px; color: var(--muted); max-width: 68ch; }
.sheet .note { color: var(--text); }
.records .sheet .note { color: var(--muted); }

/* ---------- Field guide ---------- */
#field-guide .reading { max-width: none; }
#field-guide .reading > p { max-width: 68ch; }
.field-list { list-style: none; counter-reset: field; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 768px) {
  .field-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
.field-list li {
  counter-increment: field;
  padding: 20px 20px 20px 68px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-bottom: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.field-list li:nth-child(even) { border-bottom-color: var(--secondary); }
.field-list li::before {
  content: counter(field);
  position: absolute;
  left: 20px; top: 20px;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 22px;
  color: var(--primary-dark);
  width: 32px;
  text-align: center;
  border-bottom: 3px solid var(--secondary);
}
.field-list h3 { font-size: 20px; margin-bottom: 4px; }
.reading > p:last-child, .reading > .field-list + p { margin-top: 24px; }

/* ---------- Labels ---------- */
.label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  padding: 2px 10px;
  margin-right: 6px;
  border: 1px solid;
  border-bottom-width: 2px;
  border-radius: 999px;
  vertical-align: 1px;
}
.label-fact { color: var(--primary-dark); background: var(--tint); border-color: var(--primary); }
.label-calc { color: var(--secondary-dark); background: var(--amber-tint); border-color: var(--secondary); }
.label-note { color: var(--text); background: var(--sand); border-color: var(--border); }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid var(--glass-edge);
  border-bottom: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 16px;
  max-width: 100%;
}
.table-wrap:focus-visible { outline-offset: -3px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-family: var(--font-body); }
.wide-table { min-width: 520px; }
caption {
  text-align: left;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  padding: 16px;
  color: var(--text);
}
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.4; }
thead th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--primary);
  color: var(--primary-dark);
  vertical-align: bottom;
  background: rgba(218, 240, 234, 0.75);
}
tbody tr:nth-child(even) th, tbody tr:nth-child(even) td { background: rgba(238, 246, 242, 0.6); }
tbody tr:hover th, tbody tr:hover td { background: rgba(218, 240, 234, 0.85); }
tbody th[scope="row"], tfoot th[scope="row"] { font-weight: 700; }
th.num, td.num { text-align: right; font-family: var(--font-data); font-variant-numeric: tabular-nums; }
thead th.num { font-family: var(--font-body); }
td.data { font-family: var(--font-data); }
td.hit { font-weight: 700; color: var(--primary-dark); }
.freq-table tbody tr:not(:has(.hit)) td, .freq-table tbody tr:not(:has(.hit)) th { color: var(--muted); font-weight: 400; }
.freq-table tbody tr:not(:has(.hit)) th[scope="row"] { font-weight: 400; }
tfoot th, tfoot td { border-top: 2px solid var(--primary); border-bottom: 0; background: rgba(218, 240, 234, 0.75); }
.register .url { overflow-wrap: anywhere; font-family: var(--font-data); font-size: 14px; }
.scroll-hint { display: none; font-size: 14px; color: var(--muted); margin-top: 16px; }
@media (max-width: 767px) { .scroll-hint { display: block; } .freq-table { min-width: 320px; } }

/* Sample statistics as a row of cards */
.summary-list {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 24px 0;
}
@media (min-width: 600px) { .summary-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .summary-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.summary-list li {
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 16px;
  line-height: 1.4;
}
.summary-list li:nth-child(even) { border-left-color: var(--secondary); }
.summary-list strong { font-family: var(--font-data); font-size: 1.3em; color: var(--primary-dark); }

.freq-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; align-items: start; }
@media (min-width: 1000px) { .freq-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.freq-grid > div:last-child .scroll-hint { margin-top: 24px; }
@media (max-width: 999px) { .freq-grid > div + div { margin-top: 32px; } }

/* ---------- Filters and tools ---------- */
.filters {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--glass-edge);
  border-bottom: 4px solid var(--secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 16px;
  margin-top: 16px;
}
@media (min-width: 768px) { .filters { padding: 32px; } }
.filter-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 768px) { .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.filter-help { font-size: 15px; color: var(--muted); margin-top: 16px; max-width: 68ch; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.result-count {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 20px;
  margin-top: 24px;
  padding: 6px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  display: inline-block;
}
.filter-summary { font-size: 15px; margin-top: 12px; max-width: 68ch; }
.empty-state {
  margin-top: 24px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-bottom: 3px solid var(--secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 16px;
}
.empty-state p { font-weight: 700; margin-bottom: 16px; }
.local-only {
  font-size: 18px;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-left: 5px solid var(--secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.feedback { margin-bottom: 40px; }
.draft-output {
  margin-top: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-bottom: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  font-family: var(--font-data);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.feedback + section, .local-only + p { margin-top: 16px; }
.reading section { margin-top: 40px; }
.reading section h2 { margin-bottom: 12px; }
.reading ul, .reading ol { padding-left: 24px; }
.reading li + li { margin-top: 8px; }
.reading .field-list { padding-left: 0; }
.reading .field-list li + li { margin-top: 0; }
.reading .toc ol { padding-left: 24px; }

/* ---------- FAQ ---------- */
.faq-list { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--glass-edge); box-shadow: var(--shadow); }
.faq-list details { background: var(--glass); border-bottom: 1px solid var(--border); }
.faq-list details:last-child { border-bottom: 0; }
.faq-list details + details { margin-top: 0; }
.faq-list summary {
  min-height: 56px;
  padding: 16px;
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.3;
  display: flex;
  align-items: center;
}
.faq-list summary:hover { background: rgba(218, 240, 234, 0.6); }
.faq-list summary::marker { color: var(--secondary); }
.faq-list details[open] { border-bottom: 3px solid var(--secondary); }
.faq-list details[open] summary { border-bottom: 1px solid var(--border); background: rgba(218, 240, 234, 0.6); }
.faq-list details > p { padding: 16px; margin: 0; }
.faq-list details > p + p { padding-top: 0; }

/* ---------- Provenance and support ---------- */
.prov-list > div { padding: 16px 0; border-bottom: 1px solid var(--border); }
.prov-list dt { font-weight: 700; margin-bottom: 4px; }
.prov-list dd { margin: 0; }
.support-panel {
  margin-top: 32px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid var(--glass-edge);
  border-left: 5px solid var(--secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
}
.support-panel h3 { font-size: 20px; margin-bottom: 8px; }
@media (min-width: 1000px) {
  #provenance .reading {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }
  #provenance .support-panel { margin-top: 16px; position: sticky; top: var(--sticky-offset); }
}

/* ---------- Guides, legal and reading pages ---------- */
.toc {
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid var(--glass-edge);
  border-bottom: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 32px;
  max-width: 720px;
}
.toc h2 {
  font-family: var(--font-body);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.toc ol { list-style: decimal; padding-left: 24px; font-size: 16px; }
.toc li + li { margin-top: 0; }
.toc a { display: inline-block; min-height: 32px; padding: 4px 0; }

.legal { max-width: 720px; padding-bottom: var(--rhythm); }
.legal section { margin-top: 40px; }
.legal section:first-of-type { margin-top: 0; }
.legal .toc + section { margin-top: 0; }
.legal h2 { font-size: 26px; margin-bottom: 12px; }
.legal ul { padding-left: 24px; margin-top: 16px; }
.legal li + li { margin-top: 8px; }
.legal .table-wrap { margin-bottom: 16px; }
/* Two-column reading layout: sticky contents list beside the text */
@media (min-width: 1000px) {
  .legal {
    display: grid;
    grid-template-columns: 260px minmax(0, 720px);
    column-gap: 56px;
    row-gap: 0;
    max-width: none;
  }
  .legal > .toc {
    grid-column: 1;
    grid-row: 1 / span 30;
    position: sticky;
    top: var(--sticky-offset);
    align-self: start;
    max-width: none;
    margin-bottom: 0;
  }
  .legal > section { grid-column: 2; }
  .legal > .toc ol { font-size: 15px; }
}

.guides { padding-bottom: var(--rhythm); }
.guide { padding: 40px 0; border-top: 4px solid transparent; border-image: var(--stripe) 1; }
.guide h2 { font-size: 30px; }
.guide ol { padding-left: 24px; margin-top: 16px; }
.guide li + li { margin-top: 12px; }
.guide .table-wrap { margin-top: 24px; margin-bottom: 24px; }
.guides .toc { max-width: 100%; }

.sitemap-groups { padding-bottom: var(--rhythm); }
.sitemap-groups ul ul { margin-top: 8px; }
.sitemap-groups a { display: inline-block; min-height: 32px; padding: 2px 0; }
.reading.sitemap-groups { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 768px) { .reading.sitemap-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; } }
.reading.sitemap-groups > section {
  margin-top: 0;
  padding: 24px 20px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-bottom: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.reading.sitemap-groups > section:nth-child(even) { border-bottom-color: var(--secondary); }

/* ---------- Footer ---------- */
.site-footer { margin-top: var(--rhythm); }
.footer-index {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-top: 3px solid transparent;
  border-image: var(--stripe) 1;
  border-bottom: 1px solid var(--border);
}
.footer-index ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 24px; padding-top: 8px; padding-bottom: 8px; }
.footer-index a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  color: var(--text);
  text-decoration-color: rgba(16, 35, 31, 0.4);
}
.footer-index a[aria-current="page"] { font-weight: 700; text-decoration-color: var(--secondary); text-decoration-thickness: 3px; }
.footer-colophon {
  background: linear-gradient(135deg, #0C2522 0%, #0A3F3A 62%, #0F5A4C 100%);
  color: var(--bg);
  padding: 40px 0;
}
.footer-colophon .wrap > * { max-width: 72ch; }
.footer-colophon p + p { margin-top: 12px; }
.footer-colophon p { font-size: 16px; line-height: 1.6; }
.footer-colophon a { color: var(--bg); text-decoration-color: rgba(238, 246, 242, 0.7); }
.footer-colophon a:hover { text-decoration-color: var(--bg); }
.footer-colophon :focus-visible { outline-color: var(--bg); }
.colophon-name { font-family: var(--font-head); font-weight: 700; font-size: 24px !important; overflow-wrap: anywhere; }
.copyright { font-size: 14px !important; opacity: 1; border-top: 1px solid rgba(238, 246, 242, 0.35); padding-top: 12px; margin-top: 20px !important; }

/* ---------- Cookie notice ---------- */
.cookie-notice {
  position: fixed;
  z-index: 60;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 460px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(236, 247, 242, 0.9) 100%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--glass-edge);
  border-top: 4px solid var(--secondary);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(16, 35, 31, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: var(--text);
  animation: cookie-notice-in 240ms ease-out;
}
@keyframes cookie-notice-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.cookie-notice h2 {
  font-size: 20px;
  margin: 0 0 8px;
}
.cookie-notice p { font-size: 15px; line-height: 1.5; }
.cookie-notice p + p { margin-top: 8px; }
.cookie-notice-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.cookie-notice .btn { min-height: 44px; }
@media (min-width: 768px) {
  .cookie-notice { left: 24px; bottom: 24px; right: auto; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Fallback when backdrop blur is unavailable ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header, .footer-index { background: #FFFFFF; }
  .cookie-notice { background: #FFFFFF; }
  .opener .coverage, .hero-stats li { background: rgba(10, 63, 58, 0.9); }
}

/* ---------- Narrow-screen refinements ---------- */
@media (max-width: 480px) {
  .row-date { font-size: 18px; }
  .caption, caption { font-size: 16px; }
  .btn { width: 100%; }
  .mini-search .btn { width: auto; }
  .filter-actions .btn { width: 100%; }
  .cookie-notice .btn { width: 100%; }
  .coverage { font-size: 14px; }
  .field-list li { padding: 16px 16px 16px 60px; }
  .field-list li::before { left: 14px; top: 16px; }
  .opener { padding-top: 32px; padding-bottom: 48px; }
  .opener .kicker { font-size: 12px; border-radius: var(--radius-sm); }
  .hero-stats { gap: 8px; }
  .hero-stats li { padding: 10px 6px; }
}