/* Raceline Elite: site styles. Mobile first. Fonts are self-hosted (no third-party requests). */

@font-face { font-family: "Cinzel"; font-weight: 600; font-display: swap; src: url("/fonts/cinzel-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-weight: 700; font-display: swap; src: url("/fonts/cinzel-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url("/fonts/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("/fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("/fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("/fonts/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("/fonts/montserrat-latin-800-normal.woff2") format("woff2"); }

:root {
  --green: #0B3D2E;
  --green-deep: #072A20;
  --green-soft: #12513D;
  --gold: #C9A227;
  --gold-light: #E3C766;
  --gold-ink: #7A5C0F;       /* gold for text on light backgrounds (contrast 5.6:1 on cream) */
  --cream: #F7F3E8;
  --sand: #EFE8D6;
  --paper: #FFFFFF;
  --ink: #17231E;
  --ink-soft: #4E5E57;
  --line: #E2DACA;
  --won: #14623A;
  --lost: #A23B2A;

  --display: "Cinzel", "Times New Roman", serif;
  --body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(7, 42, 32, .08);
  --shadow-lg: 0 24px 60px rgba(7, 42, 32, .18);
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1rem/1.65 var(--body);
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: .18em; }
a:hover { color: var(--gold-ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 .6em; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 7vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4.6vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 8px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font: 700 .75rem/1 var(--body); letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-ink); margin: 0 0 1rem;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.on-dark .eyebrow { color: var(--gold); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .8rem 1.5rem; border-radius: 999px;
  font: 700 .95rem/1 var(--body); letter-spacing: .02em; text-decoration: none;
  border: 2px solid transparent; background: none; cursor: pointer; transition: transform .15s, background .15s, color .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--green-deep); }
.btn-gold:hover { background: var(--gold-light); color: var(--green-deep); }
.btn-green { background: var(--green); color: var(--cream); }
.btn-green:hover { background: var(--green-soft); color: var(--cream); }
.btn-ghost { border-color: rgba(247, 243, 232, .45); color: var(--cream); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-outline { border-color: var(--green); color: var(--green); }
.btn-outline:hover { background: var(--green); color: var(--cream); }
.btn-block { width: 100%; }

/* Responsible-gambling strip (every page) */
.rg-strip {
  background: var(--green-deep); color: #CFE0D8;
  font-size: .78rem; text-align: center; padding: .45rem 16px;
}
.rg-strip a { color: var(--gold); }
.rg-strip strong { color: var(--cream); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 243, 232, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { flex: none; }
.brand img { width: 172px; height: auto; aspect-ratio: 429 / 136; }
.nav-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: .55rem .9rem; font: 600 .85rem/1 var(--body); color: var(--green); cursor: pointer;
}
.nav-toggle .bars { width: 18px; height: 12px; position: relative; }
.nav-toggle .bars::before, .nav-toggle .bars::after, .nav-toggle .bars span {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px;
}
.nav-toggle .bars::before { top: 0; } .nav-toggle .bars span { top: 5px; } .nav-toggle .bars::after { bottom: 0; }
.site-nav { display: none; }
.site-nav.open {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--cream); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  padding: .5rem 16px 1.25rem;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav ul a {
  display: block; padding: .8rem .25rem; border-bottom: 1px solid var(--line);
  font-weight: 600; color: var(--ink); text-decoration: none;
}
.site-nav ul a[aria-current="page"] { color: var(--gold-ink); }
.nav-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.nav-actions .btn { flex: 1; min-height: 44px; padding: .7rem 1rem; }

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.open {
    display: flex; align-items: center; gap: 1.5rem; position: static;
    background: none; border: 0; box-shadow: none; padding: 0;
  }
  .site-nav ul { display: flex; gap: 1.4rem; }
  .site-nav ul a { border: 0; padding: .4rem 0; font-size: .92rem; position: relative; }
  .site-nav ul a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
    background: var(--gold); transform: scaleX(0); transition: transform .2s;
  }
  .site-nav ul a:hover::after, .site-nav ul a[aria-current="page"]::after { transform: scaleX(1); }
  .nav-actions { margin: 0; }
  .nav-actions .btn { flex: none; }
  .brand img { width: 200px; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden; color: var(--cream);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(201, 162, 39, .22), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(18, 81, 61, .9), transparent 60%),
    var(--green);
  padding: 3.5rem 0 4rem;
}
.hero::after {   /* fine racing-line pattern */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background: repeating-linear-gradient(115deg, transparent 0 22px, var(--gold) 22px 23px);
  mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
}
.hero .wrap { position: relative; z-index: 1; display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { color: var(--cream); }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lede { font-size: 1.1rem; color: #D8E6DF; max-width: 34em; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 1rem; }
.hero-note { font-size: .85rem; color: #B9CEC4; margin: 0; }
.hero-note strong { color: var(--gold); }
@media (min-width: 900px) {
  .hero { padding: 5.5rem 0 6rem; }
  .hero .wrap { grid-template-columns: 1.15fr .85fr; gap: 4rem; }
}

/* Tip card (matches the data a real tip has) */
.tip-card {
  background: var(--paper); color: var(--ink); border-radius: 18px; box-shadow: var(--shadow-lg);
  overflow: hidden; position: relative; max-width: 440px; width: 100%; justify-self: center;
}
.tip-card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .9rem 1.25rem; background: var(--sand); border-bottom: 1px solid var(--line);
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
}
.tip-card-body { padding: 1.4rem 1.25rem 1.25rem; }
.tip-race { font-size: .9rem; color: var(--ink-soft); font-weight: 600; margin: 0 0 .25rem; }
.tip-horse { font: 600 1.7rem/1.1 var(--display); color: var(--green); margin: 0 0 1rem; }
.tip-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 0 1rem; }
.tip-facts div { background: var(--cream); border-radius: 10px; padding: .6rem .5rem; text-align: center; }
.tip-facts dt { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.tip-facts dd { margin: .15rem 0 0; font-weight: 800; font-size: 1.05rem; color: var(--green); }
.tip-reason { font-size: .92rem; color: var(--ink-soft); border-left: 3px solid var(--gold); padding-left: .9rem; margin: 0; }
.tip-badges { display: inline-flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }

.badge { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.badge-pending { background: #FBF3D8; color: #7A5D00; }
.badge-won { background: #E3F2E8; color: var(--won); }
.badge-free { background: var(--green); color: var(--cream); }
.badge-example { background: var(--gold); color: var(--green-deep); text-transform: uppercase; letter-spacing: .1em; }

/* Sections */
.section { padding: 4rem 0; }
.section-tight { padding: 3rem 0; }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }
.bg-paper { background: var(--paper); }
.bg-sand { background: var(--sand); }
@media (min-width: 900px) { .section { padding: 6rem 0; } }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem 1.5rem 1.5rem;
}
.steps li::before {
  content: counter(step); display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; margin-bottom: 1rem;
  background: var(--green); color: var(--gold); font: 600 1.25rem/1 var(--display);
}
.steps p { color: var(--ink-soft); margin: 0; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* Pillars */
.pillars { display: grid; gap: 1rem; }
.pillar { padding: 1.5rem; border-top: 3px solid var(--gold); background: var(--cream); border-radius: 0 0 var(--radius) var(--radius); }
.pillar h3 { color: var(--green); }
.pillar p { margin: 0; color: var(--ink-soft); }
@media (min-width: 760px) { .pillars { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }

/* Record tiles */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .85rem; margin: 0 0 1.5rem; }
.stat { background: var(--paper); border-radius: var(--radius); padding: 1.2rem 1rem; text-align: center; box-shadow: var(--shadow); border-top: 3px solid var(--gold); }
.stat-n { display: block; font: 600 1.9rem/1.1 var(--display); color: var(--green); }
.stat-l { display: block; margin-top: .35rem; font-size: .72rem; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.record { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .record { grid-template-columns: .9fr 1.1fr; gap: 4rem; } }
.checklist { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.checklist li { position: relative; padding-left: 1.9rem; margin-bottom: .7rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .3em; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23C9A227' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat;
}

/* Pricing band */
.pricing-band { background: var(--green); color: var(--cream); position: relative; overflow: hidden; }
.pricing-band::before {
  content: ""; position: absolute; width: 640px; height: 640px; right: -220px; top: -260px; border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, .25); box-shadow: 0 0 0 60px rgba(201, 162, 39, .04), 0 0 0 140px rgba(201, 162, 39, .03);
}
.pricing-band .wrap { position: relative; display: grid; gap: 2.5rem; align-items: center; }
.pricing-band h2 { color: var(--cream); }
.pricing-band p { color: #D0E0D8; }
.pricing-band .price-card p { color: var(--ink-soft); }
@media (min-width: 900px) { .pricing-band .wrap { grid-template-columns: 1fr 420px; gap: 4rem; } }

.price-card {
  background: var(--paper); color: var(--ink); border-radius: 20px; padding: 2rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-lg); border: 2px solid var(--gold); position: relative;
}
.price-card .ribbon {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: var(--green-deep); border-radius: 999px; padding: .35rem 1rem;
  font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.price-card h3 { text-align: center; color: var(--green); font-size: 1.35rem; margin-bottom: .25rem; }
.price { text-align: center; margin: .75rem 0 .25rem; }
.price .amount { font: 600 3.2rem/1 var(--display); color: var(--green); }
.price .per { font-weight: 600; color: var(--ink-soft); }
.price-sub { text-align: center; font-size: .9rem; color: var(--ink-soft); margin-bottom: 1.25rem; }
.price-sub code { background: var(--sand); color: var(--green); font-weight: 800; padding: .1rem .4rem; border-radius: 6px; font-family: var(--body); letter-spacing: .05em; }
.price-card .checklist { font-size: .95rem; }
.price-card .alt { text-align: center; font-size: .88rem; margin: 1rem 0 0; color: var(--ink-soft); }

/* Page header (inner pages) */
.page-hero {
  background: var(--green); color: var(--cream); padding: 3rem 0 3.25rem; position: relative; overflow: hidden;
}
.page-hero::after {
  content: ""; position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background: repeating-linear-gradient(115deg, transparent 0 22px, var(--gold) 22px 23px);
}
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { color: var(--cream); font-size: clamp(1.9rem, 6vw, 3rem); margin-bottom: .4em; }
.page-hero p { color: #D0E0D8; max-width: 38em; font-size: 1.05rem; margin: 0; }
.crumbs { font-size: .8rem; margin-bottom: 1rem; color: #A9C2B7; }
.crumbs a { color: var(--gold); text-decoration: none; }

/* Plans (membership page) */
.plans { display: grid; gap: 1.5rem; margin-top: -2rem; position: relative; z-index: 2; }
.plan {
  background: var(--paper); border-radius: 20px; padding: 2rem 1.5rem 1.75rem; box-shadow: var(--shadow);
  border: 1px solid var(--line); display: flex; flex-direction: column;
}
.plan h2 { font-size: 1.5rem; color: var(--green); margin-bottom: .25rem; }
.plan .tag { font-size: .85rem; color: var(--ink-soft); margin: 0 0 1rem; }
.plan .price { text-align: left; }
.plan .price-sub { text-align: left; }
.plan .checklist { flex: 1; }
.plan .checklist li.no { color: #5F6B66; }
.plan .checklist li.no::before {
  background: var(--sand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 8h6' stroke='%238A938F' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/80% no-repeat;
}
.plan-elite { border: 2px solid var(--gold); box-shadow: var(--shadow-lg); position: relative; }
.plan-elite .ribbon {
  position: absolute; top: -14px; left: 1.5rem;
  background: var(--gold); color: var(--green-deep); border-radius: 999px; padding: .35rem 1rem;
  font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
@media (min-width: 820px) { .plans { grid-template-columns: 1fr 1.15fr; align-items: stretch; } }

/* Comparison table */
.compare-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); }
.compare { width: 100%; border-collapse: collapse; min-width: 420px; font-size: .95rem; }
.compare caption { text-align: left; padding: 1rem 1.25rem 0; font-weight: 700; color: var(--ink-soft); font-size: .85rem; }
.compare th, .compare td { padding: .9rem 1.25rem; text-align: center; border-bottom: 1px solid var(--line); }
.compare th:first-child, .compare td:first-child { text-align: left; }
.compare thead th { font: 600 1rem/1.2 var(--display); color: var(--green); }
.compare thead th.elite { color: var(--gold-ink); }
.compare tbody tr:last-child td, .compare tbody tr:last-child th { border-bottom: 0; }
.compare tbody th { font-weight: 600; }
.yes { color: var(--won); font-weight: 800; }
.no-mark { color: #5F6B66; }

/* FAQ */
.faq { max-width: 760px; margin-inline: auto; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: .75rem; }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.1rem 3rem 1.1rem 1.25rem; font-weight: 700; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%);
  font: 400 1.5rem/1 var(--body); color: var(--gold-ink);
}
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 1.25rem 1.1rem; margin: 0; color: var(--ink-soft); }

.disclaimer { font-size: .85rem; color: var(--ink-soft); text-align: center; max-width: 46em; margin: 2rem auto 0; }

/* Footer */
.site-footer { background: var(--green-deep); color: #B9CEC4; padding: 3.5rem 0 1.5rem; font-size: .9rem; }
.footer-grid { display: grid; gap: 2rem; }
.footer-grid img { width: 190px; aspect-ratio: 429 / 136; }
.footer-grid h2 { font: 700 .75rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .5rem; }
.site-footer a { color: var(--cream); text-decoration: none; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.rg-box {
  margin-top: 2.5rem; padding: 1.25rem; border: 1px solid rgba(201, 162, 39, .35); border-radius: var(--radius);
  display: flex; gap: 1rem; align-items: flex-start;
}
.rg-box .age {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--gold); color: var(--gold); font: 800 1rem/1 var(--body);
}
.rg-box p { margin: 0; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .8rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

/* Site notice (editable in admin) */
.notice-bar { background: var(--gold); color: var(--green-deep); text-align: center; font-size: .88rem; font-weight: 600; padding: .55rem 16px; }

/* Prose (legal pages, about) */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.35rem; color: var(--green); margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose .updated { color: var(--ink-soft); font-size: .9rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1.25rem; }
.grid-2 { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }

/* Tips list (free / members pages) */
.tips-day { color: var(--ink-soft); font-weight: 600; margin: 0 0 1rem; }
.tip-list { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { .tip-list { grid-template-columns: repeat(2, 1fr); } }
.tip-list .tip-card { max-width: none; justify-self: stretch; box-shadow: var(--shadow); }
.tip-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .85rem; color: var(--ink-soft); margin-top: 1rem; }

/* Locked panel (members-only content) */
.locked {
  text-align: center; padding: 2.5rem 1.5rem; border-radius: 18px; border: 2px dashed var(--gold);
  background: linear-gradient(180deg, var(--paper), var(--cream));
}
.locked .lock-icon { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: var(--gold); }
.locked h2 { font-size: 1.5rem; color: var(--green); }
.locked .btns { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: 1.25rem; }

/* Results */
.results-table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--paper); }
.results-table th, .results-table td { padding: .75rem .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.results-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); background: var(--sand); }
.results-table td.num, .results-table th.num { text-align: right; white-space: nowrap; }
.pos { color: var(--won); font-weight: 700; }
.neg { color: var(--lost); font-weight: 700; }
.badge-lost { background: #F1EEE8; color: #6B675E; }
.badge-void { background: #EEF1F4; color: #4D5A66; }
.badge-corrected { background: #FFF0D6; color: #8A5A00; cursor: help; }
@media (max-width: 700px) {
  .results-table thead { display: none; }
  .results-table, .results-table tbody, .results-table tr, .results-table td { display: block; width: 100%; }
  .results-table tr { border-bottom: 1px solid var(--line); padding: .6rem 0; }
  .results-table td { border: 0; padding: .2rem .9rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .results-table td::before { content: attr(data-label); font-weight: 700; color: var(--ink-soft); text-align: left; font-size: .8rem; }
  .results-table td.num { text-align: right; }
}
.chart { background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); padding: 1rem 1rem .5rem; margin-bottom: 1.5rem; }
.chart svg { width: 100%; height: auto; }
.chart figcaption { font-size: .8rem; color: var(--ink-soft); margin-top: .25rem; }

/* Forms */
.form-card { max-width: 520px; margin: 0 auto; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .35rem; }
.field .hint { font-size: .8rem; color: var(--ink-soft); margin-top: .3rem; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=date], .field input[type=time],
.field input[type=number], .field select, .field textarea, .input {
  width: 100%; min-height: 48px; padding: .7rem .9rem; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid #CFC6B2; border-radius: 10px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); outline: 3px solid rgba(201, 162, 39, .35); outline-offset: 0; }
.field-row { display: grid; gap: 1rem; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } .field-row.three { grid-template-columns: repeat(3, 1fr); } }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; margin-bottom: 1rem; }
.check input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--green); flex: none; }
.form-foot { text-align: center; font-size: .9rem; margin-top: 1.25rem; color: var(--ink-soft); }
.flash { border-radius: 12px; padding: .9rem 1.1rem; margin-bottom: 1.25rem; font-weight: 600; font-size: .95rem; }
.flash-error { background: #FBE9E5; color: #8A2A1B; border: 1px solid #F0C4BA; }
.flash-ok { background: #E3F2E8; color: #14623A; border: 1px solid #BFDFCB; }
.flash-info { background: #FBF3D8; color: #6A4F00; border: 1px solid #EEDDA4; }

/* Account */
.account-grid { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .account-grid { grid-template-columns: 1.2fr 1fr; } }
.status-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; font-weight: 800; font-size: .8rem; }
.status-elite { background: var(--green); color: var(--gold); }
.status-free { background: var(--sand); color: var(--ink-soft); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
.kv dt { color: var(--ink-soft); font-weight: 600; }
.kv dd { margin: 0; }

/* Racecards */
.rc-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.rc-courses { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
.rc-courses a {
  flex: none; padding: .5rem 1rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line);
  font-weight: 700; font-size: .85rem; text-decoration: none; color: var(--green);
}
.rc-courses a:hover { border-color: var(--gold); }
.rc-updated { font-size: .8rem; color: var(--ink-soft); }
.rc-note { font-size: .85rem; }
.meeting { margin-bottom: 2.5rem; scroll-margin-top: 90px; }
.meeting-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--gold); padding-bottom: .5rem; margin-bottom: 1rem; }
.meeting-head h2 { margin: 0; color: var(--green); font-size: 1.6rem; }
.meeting-head span { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.race { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .85rem; overflow: hidden; }
.race > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .9rem 1rem;
}
.race > summary::-webkit-details-marker { display: none; }
.race-time { font: 700 1.15rem/1 var(--body); color: var(--green); background: var(--cream); border-radius: 10px; padding: .55rem .6rem; min-width: 64px; text-align: center; }
.race-name { font-weight: 700; }
.race-sub { font-size: .8rem; color: var(--ink-soft); }
.race-fav { font-size: .8rem; color: var(--ink-soft); text-align: right; }
.race-fav strong { display: block; color: var(--ink); font-size: .9rem; }
.race[open] > summary { border-bottom: 1px solid var(--line); background: var(--sand); }
.race-status { display: inline-block; font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .15rem .45rem; border-radius: 6px; margin-left: .4rem; vertical-align: .15em; }
.race-status.in-play { background: #FBE9E5; color: #8A2A1B; }
.race-status.closed { background: #EEF1F4; color: #4D5A66; }
.race-status.suspended { background: #FBF3D8; color: #7A5D00; }
.runners { width: 100%; border-collapse: collapse; font-size: .9rem; }
.runners th { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.runners td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.runners tr:last-child td { border-bottom: 0; }
.runners .no { width: 2.5rem; text-align: center; font-weight: 800; color: var(--green); }
.runners .no small { display: block; font-weight: 600; color: var(--ink-soft); font-size: .7rem; }
.runners .silk { width: 30px; height: 30px; border-radius: 6px; background: var(--sand); }
.runner-name { font-weight: 700; }
.runner-sub { font-size: .78rem; color: var(--ink-soft); }
.runners .odds { text-align: right; white-space: nowrap; }
.price-chip { display: inline-block; min-width: 64px; text-align: center; padding: .45rem .5rem; border-radius: 8px; background: #E8F0FB; color: #183B66; font-weight: 800; }
.price-chip small { display: block; font-weight: 600; font-size: .68rem; color: #4D6A8C; }
.runners tr.nr td { opacity: .5; }
.runners tr.nr .runner-name { text-decoration: line-through; }
.runners .hide-sm { display: none; }
@media (min-width: 720px) { .runners .hide-sm { display: table-cell; } }

/* Utility */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn-sm { min-height: 38px; padding: .5rem 1rem; font-size: .85rem; }
.btn-danger { background: #A23B2A; color: #fff; }
.btn-danger:hover { background: #8A2A1B; color: #fff; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--green); text-decoration: underline; cursor: pointer; }

/* Admin */
.admin-shell { display: grid; min-height: 100vh; }
@media (min-width: 960px) { .admin-shell { grid-template-columns: 240px 1fr; } }
.admin-side { background: var(--green-deep); color: var(--cream); padding: 1.25rem; }
.admin-side img { width: 160px; margin-bottom: 1.5rem; }
.admin-side nav a { display: block; color: #CFE0D8; text-decoration: none; padding: .55rem .75rem; border-radius: 8px; font-weight: 600; font-size: .92rem; }
.admin-side nav a:hover, .admin-side nav a[aria-current="page"] { background: rgba(255, 255, 255, .08); color: var(--gold); }
.admin-main { padding: 1.5rem 16px 3rem; background: var(--cream); min-width: 0; }
@media (min-width: 960px) { .admin-main { padding: 2rem 2.5rem 3rem; } }
.admin-main h1 { font-size: 1.8rem; color: var(--green); }
.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.admin-table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.admin-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); background: var(--sand); }
.admin-table td.wrap { white-space: normal; min-width: 220px; }
.inline-form { display: inline; }
.settle-btns { display: flex; gap: .35rem; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 2rem; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

/* Tip form: When */
fieldset.when { border: 1px solid var(--line, #E2DACA); border-radius: 12px; padding: .75rem 1rem .25rem; margin: 0 0 1rem; }
fieldset.when legend { font-weight: 700; padding: 0 .35rem; }
[hidden] { display: none !important; }
.tip-link { display: inline-block; margin-top: .3rem; font-size: .78rem; font-weight: 700; color: var(--green); background: var(--sand); border-radius: 999px; padding: .2rem .6rem; text-decoration: none; }
.tip-link:hover { background: var(--gold); }

/* Admin menu: folded behind "Menu" on phones, always open on wide screens */
.admin-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.admin-side > a img { margin-bottom: 0; width: 140px; }
.admin-menu { width: 100%; }
.admin-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: .5rem .9rem; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; font-weight: 700; }
.admin-menu > summary::-webkit-details-marker { display: none; }
.admin-menu > summary span { font-weight: 600; color: #CFE0D8; }
.admin-menu[open] > summary { margin-bottom: .5rem; }
@media (min-width: 960px) {
  .admin-side { display: block; }
  .admin-side > a img { width: 160px; margin-bottom: 1.5rem; }
  .admin-menu > summary { display: none; }
}

/* Results filters and month-by-month table */
.results-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem 1rem; align-items: end; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1.25rem; }
.results-filter .field { margin: 0; }
.results-filter-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.results-showing { font-weight: 600; color: var(--green); }
.month-table { margin: 1.5rem 0; }
.month-table > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.month-table > summary::-webkit-details-marker { display: none; }
.month-table > summary::after { content: "▾"; color: var(--ink-soft); }
.month-table:not([open]) > summary::after { content: "▸"; }
.month-table > summary h2 { font-size: 1.3rem; color: var(--green); margin: 0; }
.results-table tr.current td { background: var(--sand); }

.plan-yearly { margin-top: .75rem; }

/* Racecards: Today / Tomorrow switch */
.rc-days { display: inline-flex; gap: .25rem; background: var(--sand); border-radius: 999px; padding: .25rem; margin-bottom: 1.25rem; }
.rc-days a { padding: .4rem 1rem; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--green); text-decoration: none; }
.rc-days a[aria-current="page"] { background: var(--green); color: var(--cream); }
