:root {
  --ink: #14201d;
  --green: #102d25;
  --green-2: #1d473b;
  --ivory: #f4efe5;
  --paper: #fbf8f1;
  --white: #fffdf8;
  --gold: #caa767;
  --gold-light: #e5d3aa;
  --red: #862f34;
  --red-soft: #f1d7d2;
  --mint: #b8d3c8;
  --muted: #68736f;
  --line: rgba(20, 32, 29, .16);
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", Georgia, serif;
  --sans: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  letter-spacing: 0;
}
button, select, textarea { font: inherit; }
button { cursor: pointer; }
.wrap { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }

.site-header {
  height: 82px;
  padding: 0 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; position: relative; display: grid; place-items: center;
  background: var(--green); color: var(--ivory); overflow: hidden;
}
.brand-mark i { position: absolute; width: 50px; height: 16px; border: 2px solid var(--gold); border-color: var(--gold) transparent transparent; border-radius: 50%; transform: rotate(-14deg); top: 8px; left: -7px; }
.brand-mark b { position: relative; font: 700 18px/1 Georgia, serif; }
.brand strong { display: block; font: 700 17px/1.1 Georgia, serif; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font: 600 8px/1 var(--sans); letter-spacing: .15em; }
.header-meta { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 11px; letter-spacing: .09em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(134, 47, 52, .12); }
.quiet-button { border: 0; background: transparent; color: var(--green); padding: 10px 0 10px 18px; border-left: 1px solid var(--line); margin-left: 7px; }

.first-view { min-height: calc(100vh - 82px); display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(500px, .92fr); }
.editorial-hero { position: relative; min-height: 730px; overflow: hidden; background: var(--green); color: var(--ivory); }
.editorial-hero img { width: 100%; height: 100%; object-fit: cover; object-position: 58% center; position: absolute; inset: 0; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4, 17, 14, .85) 0%, rgba(4, 17, 14, .48) 42%, rgba(4, 17, 14, .04) 76%), linear-gradient(0deg, rgba(4, 17, 14, .45), transparent 45%); }
.hero-copy { position: absolute; left: clamp(34px, 6vw, 100px); top: 14%; width: min(590px, 76%); }
.eyebrow, .section-kicker { margin: 0 0 18px; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .22em; }
.hero-copy h1 { margin: 0; font: 500 clamp(42px, 5.1vw, 76px)/1.28 var(--serif); letter-spacing: 0; }
.hero-copy h1 em { color: var(--gold-light); font-style: normal; }
.hero-copy > p:last-child { max-width: 540px; margin: 32px 0 0; font: 500 15px/2.1 var(--serif); color: rgba(255, 253, 248, .82); }
.hero-index { position: absolute; left: clamp(34px, 6vw, 100px); bottom: 46px; display: flex; align-items: center; gap: 14px; font: 600 9px/1 var(--sans); letter-spacing: .15em; color: rgba(255,255,255,.56); }
.hero-index i { width: 80px; height: 1px; background: var(--gold); }

.control-surface { background: var(--paper); padding: clamp(48px, 6vh, 76px) clamp(36px, 5vw, 84px); display: flex; flex-direction: column; justify-content: center; }
.surface-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.surface-intro h2, .result-heading h2, .method-layout h2, .ask-intro h2 { margin: 0; font: 600 clamp(28px, 3vw, 44px)/1.35 var(--serif); }
.demo-badge { border: 1px solid var(--red); color: var(--red); padding: 7px 9px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.surface-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 15px 0 25px; }
.race-type { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.race-type-button { text-align: left; border: 0; background: rgba(255,255,255,.45); padding: 18px 19px; color: var(--ink); display: grid; grid-template-columns: auto 1fr; gap: 4px 11px; align-items: center; min-width: 0; }
.race-type-button + .race-type-button { border-left: 1px solid var(--line); }
.race-type-button span { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; background: var(--ivory); color: var(--green); font: 700 10px/1 Georgia, serif; }
.race-type-button strong { font-size: 14px; }
.race-type-button small { color: var(--muted); font-size: 10px; }
.race-type-button.is-active { background: var(--green); color: var(--white); }
.race-type-button.is-active span { background: var(--gold); color: var(--green); }
.race-type-button.is-active small { color: var(--mint); }
.selector-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 12px; margin-top: 22px; }
.selector-grid label > span { display: block; font-size: 11px; font-weight: 700; margin-bottom: 8px; color: var(--muted); }
.selector-grid select { width: 100%; height: 48px; border: 1px solid var(--line); background: var(--white); border-radius: 0; color: var(--ink); padding: 0 12px; }
.selection-preview { margin-top: 18px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr auto; gap: 17px; align-items: center; }
.selection-preview > div:first-child { display: grid; gap: 2px; text-align: center; min-width: 53px; }
.selection-preview > div:first-child span { font-size: 11px; color: var(--muted); }
.selection-preview > div:first-child strong { font: 700 24px/1 Georgia, serif; color: var(--green); }
.selection-main { border-left: 1px solid var(--line); padding-left: 17px; min-width: 0; }
.selection-main p { margin: 0 0 5px; font: 600 15px/1.4 var(--serif); }
.selection-main span { color: var(--muted); font-size: 11px; }
.weather { text-align: center; }
.weather span { display: block; color: var(--muted); font-size: 9px; }
.weather strong { font: 600 18px/1.5 var(--serif); }
.factor-list { display: flex; gap: 7px; flex-wrap: wrap; margin: 18px 0 22px; }
.factor-list span { border-bottom: 1px solid var(--gold); padding: 4px 1px; color: var(--muted); font-size: 10px; }
.primary-action { min-height: 58px; padding: 0 20px 0 24px; display: flex; justify-content: space-between; align-items: center; border: 0; background: var(--red); color: var(--white); font-weight: 700; box-shadow: 0 14px 36px rgba(134, 47, 52, .2); transition: transform .2s, background .2s; }
.primary-action:hover { background: #75272c; transform: translateY(-2px); }
.primary-action:disabled { opacity: .68; cursor: wait; transform: none; }
.primary-action b { font-size: 22px; }
.analysis-status { margin: 12px 0 0; min-height: 18px; color: var(--muted); font-size: 10px; }

.analysis-result { background: var(--white); padding: 92px 0 0; }
.analysis-result[hidden], .ask-section[hidden] { display: none; }
.result-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 34px; }
.confidence { display: flex; align-items: baseline; color: var(--green); }
.confidence span { margin-right: 12px; font: 700 9px/1 var(--sans); letter-spacing: .15em; color: var(--muted); }
.confidence strong { font: 500 48px/1 Georgia, serif; }
.confidence small { font-size: 11px; color: var(--muted); }
.verdict-band { background: var(--green); color: var(--white); display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.verdict-race, .main-pick { padding: 42px max(32px, calc((100vw - 1180px) / 2)); }
.verdict-race { padding-right: 5vw; }
.verdict-race span { font-size: 12px; color: var(--gold); font-weight: 700; }
.verdict-race h3 { margin: 9px 0; font: 600 clamp(24px, 3vw, 38px)/1.3 var(--serif); }
.verdict-race p { margin: 0; color: var(--mint); font-size: 12px; }
.main-pick { border-left: 1px solid rgba(255,255,255,.18); padding-left: 5vw; display: flex; align-items: center; gap: 22px; }
.horse-number { width: 70px; height: 70px; flex: 0 0 auto; display: grid; place-items: center; background: var(--ivory); color: var(--green); font: 700 36px/1 Georgia, serif; }
.main-pick small { font-size: 9px; color: var(--gold); letter-spacing: .15em; }
.main-pick strong { display: block; margin: 6px 0; font: 600 25px/1.3 var(--serif); }
.main-pick p { margin: 0; color: rgba(255,255,255,.7); font-size: 11px; line-height: 1.7; }
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr .9fr; gap: 0; padding-block: 70px; }
.analysis-grid > section { padding: 0 34px; border-right: 1px solid var(--line); }
.analysis-grid > section:first-child { padding-left: 0; }
.analysis-grid > section:last-child { padding-right: 0; border-right: 0; }
.panel-title { margin-bottom: 27px; }
.panel-title .section-kicker { margin-bottom: 9px; }
.panel-title h3, .reasoning h3 { margin: 0; font: 600 22px/1.3 var(--serif); }
.score-row { display: grid; grid-template-columns: 72px 1fr 28px; align-items: center; gap: 10px; margin: 15px 0; }
.score-row span { color: var(--muted); font-size: 11px; }
.score-row i { height: 5px; background: var(--ivory); position: relative; overflow: hidden; }
.score-row i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--score); background: var(--green-2); }
.score-row b { font: 600 14px/1 Georgia, serif; text-align: right; }
.pace-track { height: 200px; position: relative; background: var(--ivory); border: 1px solid rgba(202, 167, 103, .35); overflow: hidden; }
.track-line { position: absolute; left: 35px; right: 35px; top: 50%; height: 1px; background: var(--gold); }
.pace-label { position: absolute; top: 15px; color: var(--muted); font-size: 9px; }
.pace-front { left: 15px; }.pace-back { right: 15px; }
.pace-horse { position: absolute; top: calc(50% - 15px); left: var(--left); width: 30px; height: 30px; display: grid; place-items: center; background: var(--green); color: var(--white); border-radius: 50%; font: 700 11px/1 Georgia, serif; transform: translateX(-50%); }
.pace-horse.is-main { width: 40px; height: 40px; top: calc(50% - 20px); background: var(--red); box-shadow: 0 0 0 6px rgba(134,47,52,.13); }
.pace-horse small { position: absolute; top: 38px; left: 50%; transform: translateX(-50%); color: var(--ink); white-space: nowrap; font: 500 8px/1 var(--sans); }
.pace-horse.is-main small { top: 47px; color: var(--red); font-weight: 700; }
.pace-comment { margin: 15px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.ticket-row { display: grid; grid-template-columns: 55px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.ticket-row span { color: var(--muted); font-size: 10px; }
.ticket-row strong { font: 600 16px/1.5 Georgia, var(--serif); }
.ticket-note { color: var(--muted); font-size: 9px; line-height: 1.7; margin-top: 16px; }
.reasoning { display: grid; grid-template-columns: .9fr 1.1fr; gap: 70px; padding-block: 64px; border-top: 1px solid var(--line); }
.reasoning-copy > p:not(.section-kicker) { color: var(--muted); font-size: 13px; line-height: 2; }
.risk-box { display: grid; grid-template-columns: 48px 1fr; gap: 12px; margin-top: 25px; padding-top: 18px; border-top: 1px solid var(--red-soft); }
.risk-box span { color: var(--red); font: 700 9px/1 var(--sans); letter-spacing: .12em; }
.risk-box p { margin: 0; color: var(--red); font-size: 11px; line-height: 1.8; }
.evidence-item { display: grid; grid-template-columns: 54px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.evidence-item:first-child { border-top: 1px solid var(--line); }
.evidence-item span { color: var(--gold); font: 600 16px/1 Georgia, serif; }
.evidence-item strong { display: block; font: 600 14px/1.4 var(--serif); margin-bottom: 6px; }
.evidence-item p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.action-bar { display: flex; gap: 1px; background: var(--line); }
.action-bar button { flex: 1; min-height: 58px; border: 0; background: var(--ivory); color: var(--green); font-size: 12px; font-weight: 700; }
.action-bar button:hover { background: var(--gold-light); }

.ask-section { padding: 110px 0; background: #e8eee9; }
.ask-layout { display: grid; grid-template-columns: .68fr 1.32fr; gap: 80px; }
.ask-intro > p:not(.section-kicker) { color: var(--muted); font-size: 13px; line-height: 2; }
.reset-chat { border: 0; border-bottom: 1px solid var(--green); padding: 7px 0; background: transparent; color: var(--green); font-size: 11px; }
.chat-surface { min-width: 0; }
.quick-questions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.quick-questions button { border: 1px solid rgba(16,45,37,.2); background: rgba(255,255,255,.55); color: var(--green); padding: 9px 11px; font-size: 10px; border-radius: 0; }
.conversation { height: 360px; overflow-y: auto; padding: 22px; background: rgba(255,255,255,.64); border: 1px solid rgba(16,45,37,.13); }
.message { max-width: 86%; margin: 0 0 17px; padding: 16px 18px; background: var(--white); border-left: 3px solid var(--green); }
.message.user { margin-left: auto; background: #f7ece9; border-left: 0; border-right: 3px solid var(--red); }
.message span { color: var(--green); font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.message.user span { color: var(--red); }
.message p { white-space: pre-wrap; margin: 7px 0 0; font: 500 13px/1.9 var(--serif); }
.chat-form { margin-top: 13px; padding: 16px; background: var(--white); border: 1px solid rgba(16,45,37,.13); }
.chat-form label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 700; }
.chat-form textarea { display: block; width: 100%; min-height: 90px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; line-height: 1.8; }
.chat-form > div { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.chat-form span { color: var(--muted); font-size: 9px; }
.chat-form button { border: 0; background: var(--green); color: var(--white); min-width: 120px; padding: 12px; font-size: 11px; font-weight: 700; }
.chat-form button:disabled { opacity: .6; cursor: wait; }
.chat-status { min-height: 16px; margin: 8px 0 0; color: var(--muted); font-size: 10px; }

.method-section { padding: 110px 0; background: var(--paper); }
.method-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 90px; }
.method-layout ol { list-style: none; margin: 0; padding: 0; }
.method-layout li { display: grid; grid-template-columns: 50px 1fr; gap: 20px; padding: 21px 0; border-bottom: 1px solid var(--line); }
.method-layout li:first-child { border-top: 1px solid var(--line); }
.method-layout li > span { color: var(--gold); font: 600 15px/1 Georgia, serif; }
.method-layout strong { font: 600 15px/1.4 var(--serif); }
.method-layout li p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
footer { background: var(--green); color: var(--white); padding: 52px 0; }
.footer-grid { display: grid; grid-template-columns: .5fr 1.5fr; gap: 80px; align-items: end; }
.footer-grid strong { font: 700 18px/1 Georgia, serif; }
.footer-grid p { margin: 7px 0 0; color: rgba(255,255,255,.62); font-size: 10px; line-height: 1.9; }

dialog { width: min(560px, calc(100% - 32px)); border: 0; padding: 28px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 100px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(5,17,14,.72); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.dialog-head h2 { margin: 0; font: 600 24px/1.3 var(--serif); }
.dialog-head button { border: 0; background: transparent; font-size: 25px; color: var(--green); }
dialog > p { color: var(--muted); font-size: 11px; }
.history-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.history-item strong { display: block; font-size: 12px; }
.history-item span { color: var(--muted); font-size: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--white); padding: 12px 18px; font-size: 11px; transition: .2s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1060px) {
  .first-view { grid-template-columns: 1fr; }
  .editorial-hero { min-height: 610px; }
  .control-surface { min-height: auto; }
  .analysis-grid { grid-template-columns: 1fr 1fr; }
  .analysis-grid > section { border-right: 0; padding: 0; }
  .analysis-grid > section:nth-child(1) { padding-right: 30px; border-right: 1px solid var(--line); }
  .analysis-grid > section:nth-child(2) { padding-left: 30px; }
  .tickets-panel { grid-column: 1 / -1; margin-top: 55px; }
  .ticket-rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .ask-layout { gap: 45px; }
}

@media (max-width: 720px) {
  .wrap { width: min(100% - 36px, 1180px); }
  .site-header { height: 68px; padding-inline: 18px; }
  .brand-mark { width: 37px; height: 37px; }
  .brand strong { font-size: 15px; }
  .brand small, .header-meta > span:not(.live-dot) { display: none; }
  .quiet-button { padding-left: 12px; }
  .first-view { min-height: auto; }
  .editorial-hero { min-height: 550px; }
  .editorial-hero img { object-position: 62% center; }
  .hero-shade { background: linear-gradient(90deg, rgba(4,17,14,.86), rgba(4,17,14,.18)), linear-gradient(0deg, rgba(4,17,14,.55), transparent 55%); }
  .hero-copy { left: 25px; top: 17%; width: calc(100% - 50px); }
  .hero-copy h1 { font-size: 41px; }
  .hero-copy > p:last-child { margin-top: 24px; font-size: 13px; line-height: 2; max-width: 88%; }
  .hero-index { left: 25px; bottom: 30px; }
  .control-surface { padding: 52px 20px; }
  .selector-grid { grid-template-columns: 1fr; }
  .selection-preview { gap: 10px; }
  .selection-main { padding-left: 10px; }
  .selection-main p { font-size: 13px; }
  .factor-list { gap: 5px 12px; }
  .analysis-result { padding-top: 68px; }
  .result-heading { align-items: flex-start; }
  .confidence span { display: none; }
  .confidence strong { font-size: 37px; }
  .verdict-band { grid-template-columns: 1fr; }
  .verdict-race, .main-pick { padding: 32px 20px; }
  .main-pick { border-left: 0; border-top: 1px solid rgba(255,255,255,.18); }
  .horse-number { width: 58px; height: 58px; font-size: 30px; }
  .main-pick strong { font-size: 20px; }
  .analysis-grid { display: block; padding-block: 50px; }
  .analysis-grid > section, .analysis-grid > section:nth-child(1), .analysis-grid > section:nth-child(2) { padding: 0; border: 0; margin-bottom: 48px; }
  .ticket-rows { display: block; }
  .reasoning { grid-template-columns: 1fr; gap: 35px; padding-block: 48px; }
  .action-bar { width: 100%; flex-direction: column; }
  .action-bar button { flex: auto; }
  .ask-section, .method-section { padding: 78px 0; }
  .ask-layout, .method-layout { grid-template-columns: 1fr; gap: 42px; }
  .quick-questions { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .quick-questions button { white-space: nowrap; }
  .conversation { height: 330px; padding: 14px; }
  .message { max-width: 94%; }
  .footer-grid { grid-template-columns: 1fr; gap: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
