:root {
  color-scheme: light;
  --back: #e9d6b7;
  --paper: #fffefa;
  --green: #24563d;
  --pine: #202e22;
  --ink: #202c23;
  --quiet: #536458;
  --sand-ink: #403326;
  --line: #dbe2d9;
  --soft: #eef3e9;
  --amber: #754710;
  --error: #963623;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  background: var(--back);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html:not([data-public-demo]) .demo-only,
html[data-public-demo] [data-local-server] { display: none; }
.demo-only { margin-bottom: 10px; }
body {
  margin: 0;
  min-height: 100vh;
  isolation: isolate;
  background-color: var(--back);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgb(251 237 212 / 20%), transparent 62%),
    linear-gradient(90deg, rgb(249 230 199 / 54%), rgb(249 233 206 / 66%) 18% 82%, rgb(249 230 199 / 34%)),
    url('kum-pisti.webp');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
main { min-height: calc(100vh - 148px); }
a { color: var(--green); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button, select, summary, .button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, select:focus-visible, .button:focus-within {
  outline: 2px solid #387352;
  outline-offset: 3px;
}
a, button, .button { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1350px, calc(100% - 72px)); margin-inline: auto; }
.masthead { background: var(--pine); color: white; }
.header-inner { min-height: 68px; display: flex; align-items: center; gap: 48px; }
.identity { display: inline-flex; gap: 10px; align-items: center; color: #fffefa; text-decoration: none; white-space: nowrap; font-size: 19px; letter-spacing: -.025em; }
.identity b { font-weight: 700; }
.brand-mark { display: block; width: 38px; height: 38px; flex: none; filter: brightness(0) invert(1); }
nav { display: flex; gap: 25px; align-items: stretch; align-self: stretch; }
nav a { display: grid; align-content: center; border-bottom: 3px solid transparent; border-top: 3px solid transparent; color: #d5dfd3; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
nav a[aria-current="page"] { border-bottom-color: #bedb96; color: #fffefa; }
.connection { margin-left: auto; color: #e2efdf; font-size: 12px; font-weight: 600; white-space: nowrap; }
.connection::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 100%; background: #c5de99; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 38px 0 24px; }
.intro-actions, .actions, .data-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; }
h1, h2, h3, p { margin: 0; }
h1 { font-family: Georgia, serif; font-weight: normal; font-size: clamp(35px, 5.2vw, 54px); line-height: 1.04; letter-spacing: -.057em; }
h2 { font-size: 22px; line-height: 1.22; letter-spacing: -.025em; }
h3 { font-size: 16px; line-height: 1.35; }
.eyebrow { font-size: 11px; font-weight: 750; letter-spacing: .14em; color: var(--green); margin-bottom: 8px; }
.intro p:last-child { color: var(--quiet); margin-top: 9px; }
.intro:not(.analysis-intro) p:last-child,
#reports-page > .muted { color: var(--sand-ink); }
.intro.analysis-intro {
  --turf-fade: linear-gradient(90deg, #fffdf7 27%, rgb(255 253 247 / 96%) 38%, rgb(255 253 247 / 67%) 58%, rgb(246 250 235 / 28%) 89%);
  display: grid;
  grid-template: 'copy art' 1fr 'actions art' 1fr / minmax(0, 1fr) minmax(0, 300px);
  align-items: start;
  gap: 17px 22px;
  margin: 22px 0 15px;
  padding: 15px clamp(18px, 3vw, 42px);
  border: 1px solid #d9c7aa;
  border-radius: 12px;
  background: var(--turf-fade), url('cim-pisti.webp') right 44% / cover no-repeat, #edf2e2;
}
.analysis-intro .intro-copy { grid-area: copy; align-self: end; }
.analysis-intro .intro-copy p:last-child { font-size: 1.067rem; line-height: 1.45; }
.analysis-intro .intro-actions { grid-area: actions; }
.horse-art { grid-area: art; align-self: center; display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 6px rgb(44 69 38 / 14%)); }
.work-status {
  position: fixed;
  z-index: 2;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 7px;
  border: 1px solid #d9c7aa;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 3px 14px rgb(64 51 38 / 15%);
  color: var(--sand-ink);
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
}
.work-status[data-active] { opacity: 1; }
.work-horse {
  width: 66px;
  height: 46px;
  background: center / contain no-repeat url('yaris-ati.webp');
  mix-blend-mode: multiply;
}
@media (prefers-reduced-motion: no-preference) {
  .work-status[data-active] .work-horse { background-image: url('jokeyli-yaris-ati.webp'); }
}
.muted { color: var(--quiet); font-size: 13px; line-height: 1.45; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.source-bar { padding: 15px 17px; display: flex; align-items: end; gap: 12px; }
.grow { flex: 1; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 650; min-width: 0; }
input:not([type="checkbox"]), select { color: var(--ink); border-radius: 7px; border: 1px solid #c9d5c9; background: #fff; min-height: 40px; padding: 7px 10px; width: 100%; min-width: 0; }
input[type="checkbox"] { accent-color: var(--green); width: 17px; height: 17px; margin: 0; }
input.file-control { position: absolute; width: 1px; height: 1px; min-height: 0; margin: -1px; padding: 0; clip-path: inset(50%); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 550; }
button, .button { display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; border: 1px solid transparent; min-height: 40px; padding: 8px 12px; font-size: 13px; font-weight: 700; line-height: 1.25; text-align: center; }
.primary { background: var(--green); color: #fff; }
.primary:hover:enabled, label.primary:hover { background: #1b452f; }
.outline { background: #fffefa; border-color: #c4d3c3; color: var(--green); }
.outline:hover:enabled, label.outline:hover { background: var(--soft); }
.full { width: 100%; }
.data-panel { margin: 10px 0 18px; padding: 12px 16px; }
.data-panel summary { font-size: 13px; font-weight: 700; }
.data-panel .data-actions, .data-panel > p { margin-top: 12px; }
#data-count { margin-left: 7px; color: var(--quiet); font-weight: 500; font-size: 12px; }
.notice { padding: 10px 13px; border: 1px solid #c6d9c2; background: #edf5e8; border-radius: 8px; color: #2a5130; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.notice.error { border-color: #e9cbbd; color: var(--error); background: #fff3ec; }
.notice + .source-bar { margin-top: 12px; }
.empty { min-height: 285px; display: grid; align-content: center; justify-items: center; text-align: center; padding: 30px 16px; gap: 11px; }
.empty p { color: var(--quiet); }
.empty-mark { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 13px; font-size: 30px; font-weight: 750; background: var(--soft); color: #376d49; }
.dashboard { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(305px, 408px); gap: 17px; align-items: start; }
.program-picks { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.picks-card { min-width: 0; }
.picks-card summary { padding: 12px; font-size: 1rem; font-weight: 750; }
.picks-surprises summary { color: var(--amber); }
.picks-bankers summary { color: var(--green); }
.picks-context { padding: 0 12px 9px; }
.picks-empty { padding: 8px 12px 12px; border-top: 1px solid var(--line); }
.picks-list { list-style: none; padding: 0 6px; margin: 0; max-height: min(54vh, 450px); overflow-y: auto; }
.picks-list li { border-top: 1px solid var(--line); }
.pick-entry {
  display: grid;
  justify-content: stretch;
  justify-items: start;
  gap: 3px;
  width: 100%;
  padding: 8px 6px;
  background: transparent;
  color: var(--ink);
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}
.pick-entry:hover, .pick-entry:focus-visible { background: var(--soft); }
.pick-time { color: var(--green); font-size: 0.8rem; }
.pick-entry .muted { font-weight: 400; }
@media (min-width: 1740px) {
  .program-picks { position: absolute; inset: 0; display: block; pointer-events: none; }
  .picks-card { position: absolute; top: 0; width: min(285px, calc((100vw - 1350px) / 2 - 30px)); pointer-events: auto; }
  .picks-surprises { right: calc(100% + 14px); }
  .picks-bankers { left: calc(100% + 14px); }
}
.race-column { min-width: 0; }
.race-column { min-width: 0; }
.race-panel, .builder { min-width: 0; }
.race-heading { display: flex; justify-content: space-between; gap: 14px; align-items: end; padding: 17px 18px 14px; }
.race-heading .muted { margin-top: 5px; overflow-wrap: anywhere; }
.race-heading .eyebrow { margin-bottom: 4px; }
.race-heading h2 { font-size: 27px; }
.race-tabs { display: flex; gap: 6px; padding: 0 17px 13px; overflow-x: auto; }
.race-tabs button, .seg-tabs button { background: var(--soft); color: var(--green); border-color: transparent; flex-shrink: 0; }
.race-tabs button[aria-pressed="true"], .seg-tabs button[aria-pressed="true"] { background: var(--green); color: white; }
.race-tabs button { min-width: 48px; }
.race-context { padding: 13px 17px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8faf4; }
.race-context p { margin-top: 4px; }
.badge { display: inline-flex; align-items: center; color: #2d5b3f; background: #ebf2e6; border-radius: 20px; padding: 3px 7px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.badge.amber { background: #f8ecd7; color: var(--amber); }
.candidate-box { display: grid; gap: 6px; padding: 11px 17px; border-bottom: 1px solid var(--line); font-size: 13px; }
.candidate-box p span { margin-left: 4px; }
.candidate-box ol { display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 0; padding: 0; list-style: none; }
.candidate-box li { padding: 3px 7px; border-radius: 6px; background: #ebf2e6; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--quiet); font-weight: 700; text-align: left; font-size: 12px; white-space: nowrap; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 17px; }
td:last-child, th:last-child { padding-right: 17px; }
.horse-table td:nth-child(2), .horse-table td:nth-child(4), .horse-table td:nth-child(5) { white-space: nowrap; }
.horse-table td:nth-child(2) { font-variant-numeric: tabular-nums; color: var(--quiet); }
.horse-table td:nth-child(4) { font-variant-numeric: tabular-nums; font-weight: 750; }
.horse-table tr:has(input:checked) { background: #edf5e9; }
.horse-table th:first-child { width: 34px; }
.horse-table td button { white-space: normal; min-height: 32px; background: transparent; color: var(--green); justify-content: start; padding: 1px 0; text-align: left; }
.horse-table button:hover { text-decoration: underline; }
.horse-signals { display: flex; flex-wrap: wrap; gap: 3px; }
.detail-row td { background: #f6f8f3; }
.factor-grid { display: grid; gap: 8px 14px; padding: 5px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.factor-grid div { min-width: 0; font-size: 12px; line-height: 1.35; }
.factor-grid b { display: block; color: var(--green); margin-bottom: 1px; }
.table-note { padding: 10px 17px; }
.builder { padding: 16px; }
.builder-header { display: flex; gap: 5px; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.seg-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 13px; }
.seg-tabs button { padding-inline: 9px; font-size: 12px; min-height: 35px; }
.builder form { display: grid; gap: 10px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#coupon-error { margin-top: 10px; }
.ticket { border-top: 1px solid var(--line); margin-top: 17px; padding-top: 12px; }
.ticket:last-child { margin-bottom: 2px; }
.ticket header { display: flex; justify-content: space-between; align-items: baseline; gap: 7px; }
.ticket header strong { color: var(--green); font-size: 19px; white-space: nowrap; }
.ticket .muted, .ticket .actions { margin-top: 7px; }
.ticket-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; overflow: hidden; }
.ticket-leg { text-align: center; min-width: 0; padding: 5px 1px 7px; }
.ticket-leg + .ticket-leg { border-left: 1px solid var(--line); }
.ticket-leg b { display: block; font-size: 10px; line-height: 2; margin-bottom: 4px; background: #edf1e9; white-space: nowrap; }
.ticket-leg span { display: block; width: max-content; min-width: 20px; margin: 3px auto; padding: 1px 3px; border-radius: 4px; font-size: 13px; font-weight: 700; }
.ticket-leg .old-bank { color: #1d5b30; background: #d0ecd2; }
.ticket-leg .chosen { box-shadow: 0 0 0 1px #4b755a inset; }
.ticket-detail { margin: 10px 0; font-size: 12px; line-height: 1.4; }
.ticket-detail summary { color: var(--green); font-weight: 700; }
.ticket-detail ul { margin: 4px 0 0; padding-left: 19px; }
.alternative-action { margin: 2px 0 4px; padding: 4px 7px; min-height: 33px; }
.variant { margin: 16px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.variant-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.variant .notice { margin-top: 8px; }
.comparison { padding: 14px 16px; margin-top: 17px; }
.comparison h2 { margin-bottom: 7px; }
.comparison th:first-child, .comparison td:first-child, .review th:first-child, .review td:first-child { padding-left: 1px; }
.archive-item, .review, .weekly-card { padding: 16px 18px; }
.archive-item summary, .weekly-card summary { font-weight: 700; }
.archive-item .ticket { max-width: 990px; border-top: none; margin-top: 7px; }
.flow { display: grid; gap: 10px; }
.section-title { margin: 24px 0 5px; }
#weekly-list { margin-top: 9px; }
.review .data-actions { margin: 10px 0; }
.review .data-actions label { width: 145px; }
.weekly-card h3 { margin-top: 12px; }
.weekly-card p { margin-block: 7px; }
.weekly-card details { margin-top: 8px; }
.weekly-card a { overflow-wrap: anywhere; }
.footer { margin-top: 30px; border-top: 1px solid #bda17c; min-height: 50px; display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; color: var(--sand-ink); }
@media (max-width: 1000px) {
  .shell { width: calc(100% - 36px); }
  .dashboard { grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; }
  .horse-table th, .horse-table td { padding-left: 6px; padding-right: 6px; }
  .horse-table th:first-child, .horse-table td:first-child { padding-left: 12px; }
}
@media (max-width: 730px) {
  .shell { width: calc(100% - 23px); }
  .header-inner { flex-wrap: wrap; gap: 0; min-height: 0; padding-top: 9px; }
  .identity { font-size: 17px; }
  .brand-mark { width: 32px; height: 32px; }
  nav { order: 3; flex-basis: 100%; min-height: 40px; gap: 18px; }
  nav a { font-size: 13px; }
  .intro { align-items: start; flex-direction: column; gap: 13px; padding: 23px 0 16px; }
  .intro.analysis-intro {
    --turf-fade: linear-gradient(138deg, #fffdf7 28%, rgb(255 253 247 / 91%) 52%, rgb(246 250 235 / 33%) 91%);
    grid-template: 'copy copy' auto 'actions art' auto / minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 10px;
    margin-top: 12px;
    padding: 15px;
  }
  .analysis-intro .intro-actions { align-self: end; }
  .horse-art { width: min(100%, 240px); justify-self: end; }
  .source-bar { display: grid; grid-template-columns: 1fr 1fr; padding: 11px; gap: 9px; }
  .dashboard { grid-template-columns: 1fr; }
  .race-heading { padding-left: 12px; padding-right: 12px; }
  .race-tabs { padding-left: 12px; padding-right: 12px; }
  .race-context, .candidate-box { padding-left: 12px; padding-right: 12px; }
  .horse-table td:nth-child(3) { min-width: 120px; }
}
@media (max-width: 375px) {
  nav { gap: 12px; }
  .factor-grid { grid-template-columns: 1fr; }
  .source-bar { grid-template-columns: 1fr; }
  .program-picks { grid-template-columns: 1fr; }
}
