:root{font-family:Inter,"Yu Gothic UI",Meiryo,sans-serif;color:var(--text);background:var(--page);font-synthesis:none;color-scheme:light;--navy:#101d38;--primary:#173052;--primary-hover:#24466f;--accent:#245c89;--cyan:#60d9f5;--text:#182943;--muted:#52637a;--page:#f2f5fa;--surface:#fff;--surface-soft:#f7f9fc;--tint:#e8eff8;--border:#d7e0ec;--control-border:#8192aa;--focus:#287ca8;--on-dark:#f6f8ff}*{box-sizing:border-box}body{margin:0}header{height:76px;padding:0 5%;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--navy);background:var(--navy)}.brand{text-decoration:none;color:var(--on-dark);font-size:23px;font-weight:850;letter-spacing:2px}.brand span{color:var(--cyan)}.local{font-size:10px;letter-spacing:2px;color:var(--muted)}main{max-width:1480px;margin:auto;padding:42px 5%}.eyebrow,.step{font-size:11px;letter-spacing:2px;font-weight:700;color:var(--accent)}h1{font-size:clamp(30px,3.5vw,46px);line-height:1.35;letter-spacing:-1px;margin:15px 0}h2{font-size:20px;margin:8px 0 20px}.intro>p:last-child{color:var(--muted);font-size:14px;margin:18px 0 32px}.workspace{display:grid;grid-template-columns:365px minmax(0,1fr);gap:28px;align-items:start}.panel{background:white;border:1px solid var(--border);border-radius:16px;padding:26px;box-shadow:0 5px 20px #101d3808}.step{margin:0 0 10px}.tabs{display:flex;background:var(--tint);padding:4px;border-radius:9px;margin-bottom:22px}.tabs button{flex:1;font-size:12px;padding:10px 4px;border:0;background:transparent;color:var(--muted);border-radius:6px}.tabs .active{background:var(--primary);color:var(--on-dark);box-shadow:0 2px 6px #101d3810;font-weight:700}label{font-size:12px;font-weight:600;display:block;margin:14px 0 8px}input:not([type=checkbox]),select{width:100%;padding:12px;border:1px solid var(--control-border);border-radius:8px;background:#fbfcff;font:inherit;font-size:14px;min-width:0}#race-id{font-variant-numeric:tabular-nums;letter-spacing:1px}button{font:inherit;cursor:pointer}button:disabled{opacity:.5;cursor:wait}input:focus,select:focus,button:focus-visible{outline:2px solid var(--focus);outline-offset:2px}.hint{font-size:11px;line-height:1.8;color:var(--muted);margin:10px 0}.hint a{color:var(--accent)}hr{border:0;border-top:1px solid var(--border);margin:26px 0}.model-option{display:flex;gap:10px;align-items:center;border:1px solid var(--border);border-radius:9px;padding:14px 10px;font-size:13px}.model-option:has(input:checked){border-color:var(--accent);background:#eef5fc}input[type=checkbox]{accent-color:var(--accent);width:16px;height:16px;flex-shrink:0}.model-option small{display:block;color:var(--muted);font-size:10px;margin-top:6px;font-weight:400}.tag{margin-left:auto;color:var(--muted);font-size:9px;letter-spacing:1px}.saved{display:flex;align-items:center;gap:7px;font-size:11px;margin-top:22px}.primary{border:0;border-radius:9px;background:var(--primary);color:white;padding:15px;width:100%;font-size:14px;font-weight:700;margin-top:18px;display:flex;justify-content:space-between}.secondary{border:1px solid var(--control-border);border-radius:8px;background:var(--tint);padding:10px 14px;font-size:12px}.date-row{display:flex;gap:8px}.empty{min-height:535px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:radial-gradient(ellipse at center,#f0f6fd,white 65%)}.empty-icon{width:64px;height:64px;border-radius:18px;background:#e0edf9;color:var(--accent);font-size:34px;line-height:64px;margin-bottom:20px}.empty h2{font-size:26px;margin:14px 0}.empty p:not(.eyebrow){font-size:13px;line-height:2;color:var(--muted)}.legend{display:flex;gap:8px;margin-top:26px}.pill{display:inline-block;border-radius:5px;padding:5px 8px;font-size:10px;white-space:nowrap;font-weight:700}.grade-a{background:var(--primary);color:white}.grade-b{background:#dcebf8;color:#204c75}.grade-c{background:#edf0f4;color:#566579}.legend-label{align-self:center;font-size:11px;color:var(--muted)}.result-head{margin-bottom:20px}.result-head h2{font-size:25px;margin:0 0 8px}.result-head p{font-size:12px;color:var(--muted);line-height:1.8}.model-result{margin-bottom:22px;padding:24px}.model-heading{display:flex;justify-content:space-between;align-items:center}.model-heading h3{margin:0;font-size:18px}.model-heading small{font-size:10px;color:var(--muted)}.conditions{font-size:11px;line-height:1.9;color:var(--muted);padding:12px 0;margin:10px 0;border-bottom:1px solid var(--border)}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;white-space:nowrap;font-size:12px}th{font-size:10px;text-align:right;color:var(--muted);font-weight:500;padding:12px 8px;background:var(--surface-soft)}th:nth-child(2),th:last-child{text-align:left}td{padding:16px 8px;border-bottom:1px solid #e6edf5;text-align:right}td:nth-child(2),td:last-child{text-align:left}td strong{font-size:13px}td small{display:block;font-size:10px;line-height:1.5;color:var(--muted);white-space:normal;max-width:170px;margin-top:6px}.horse-number{display:inline-grid;place-items:center;width:27px;height:27px;border:1px solid var(--border);border-radius:6px;background:white;font-weight:700}.score-cell{font-weight:750;color:var(--accent)}.footnote{font-size:11px;color:var(--muted);line-height:1.8;margin:16px 0 0}footer{font-size:11px;color:var(--muted);margin:28px 0;line-height:1.8}#notice:not(:empty){padding:14px 18px;border:1px solid #dfc9ae;background:#fff6e8;border-radius:10px;font-size:13px;line-height:1.8;margin-bottom:20px}#progress{margin-bottom:22px}.progress-title{display:flex;align-items:center;gap:12px;font-size:14px}pre{font-size:11px;line-height:1.7;white-space:pre-wrap;overflow:auto;max-height:260px;background:var(--surface-soft);padding:14px;border-radius:8px}summary{font-size:12px;cursor:pointer;color:var(--muted)}.spinner{height:18px;width:18px;border:2px solid #d4e2f1;border-top-color:var(--accent);border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}[hidden]{display:none!important}@media(max-width:1100px){.workspace{grid-template-columns:315px minmax(0,1fr);gap:18px}.panel{padding:20px}}@media(max-width:850px){.workspace{grid-template-columns:1fr}.empty{min-height:330px}main{padding:28px 5%}.intro br{display:none}h1{font-size:30px}.local{font-size:8px}.model-heading{align-items:start;gap:10px;flex-direction:column}}
.secondary{flex-shrink:0;white-space:nowrap}.result-head a{color:var(--accent);font-size:12px}
.batch-button{width:100%;margin-top:12px;white-space:normal;line-height:1.6}.batch-race{margin-bottom:16px}.batch-race>summary{font-size:14px;font-weight:700;color:var(--accent);line-height:1.8}.batch-race[open]>summary{margin-bottom:20px}.batch-race .model-result{padding:16px}
.progress-card{position:relative;overflow:hidden;padding:28px;background:linear-gradient(140deg,#fff 45%,#edf4fc);border-color:var(--border);box-shadow:0 10px 32px #101d380a}.progress-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.progress-kicker{font-size:11px;letter-spacing:.12em;font-weight:700;color:var(--muted)}.progress-badge{display:inline-flex;align-items:center;gap:7px;padding:6px 10px;border-radius:20px;background:#e0edf9;color:var(--accent);font-size:10px;font-weight:700}.progress-badge:before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor}.progress-card[data-state=running] .progress-badge:before{animation:breathe 1.8s ease-in-out infinite}.progress-hero{display:flex;align-items:center;gap:22px;margin:24px 0}.progress-ring{position:relative;width:100px;height:100px;flex-shrink:0;display:grid;place-items:center}.progress-ring svg{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg);overflow:visible}.progress-ring circle{fill:none;stroke-width:6}.ring-track{stroke:#dce6f2}.ring-value{stroke:var(--accent);stroke-linecap:round;transition:stroke-dasharray .45s ease}.progress-ring>span{font-size:23px;font-weight:750;color:var(--accent);font-variant-numeric:tabular-nums}.progress-ring.indeterminate svg{animation:spin 2.5s linear infinite}.progress-context{font-size:11px;color:var(--accent);font-weight:650;margin:0 0 7px}.progress-copy{min-width:0}.progress-copy h2{font-size:22px;line-height:1.5;margin:0 0 8px;letter-spacing:-.03em}.progress-copy>p:last-child{font-size:12px;line-height:1.9;color:var(--muted);margin:0;overflow-wrap:anywhere}.progress-measure{display:flex;justify-content:space-between;gap:10px;font-size:11px;color:var(--muted);margin-bottom:9px;font-variant-numeric:tabular-nums}.progress-measure>span:first-child{color:#294c72;font-weight:650}.progress-bar{height:7px;border-radius:20px;background:#dce6f2;overflow:hidden}.progress-bar>span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#4c9bbf,var(--primary));transition:width .45s ease}.progress-bar.indeterminate>span{width:35%!important;animation:progress-slide 2s ease-in-out infinite}.progress-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:20px}.progress-stat{border:1px solid var(--border);border-radius:10px;padding:13px 14px;background:#ffffffb0}.progress-stat>span{display:block;font-size:10px;color:var(--muted);margin-bottom:7px}.progress-stat strong{font-size:25px;font-weight:700;line-height:1.2;font-variant-numeric:tabular-nums}.progress-stat small{font-size:10px;margin-left:7px;color:var(--muted)}.progress-stat.success strong{color:var(--accent)}.progress-stat.failure strong{color:#925d25}.progress-steps{display:flex;flex-wrap:wrap;gap:9px 15px;list-style:none;padding:18px 0 0;margin:20px 0 0;border-top:1px solid var(--border)}.progress-steps li{display:flex;align-items:center;gap:6px;font-size:10px;color:#62718a}.step-icon{display:inline-grid;place-items:center;width:19px;height:19px;border-radius:50%;border:1px solid var(--control-border);font-size:10px;font-weight:700}.progress-steps .complete{color:#355e87}.complete .step-icon{background:#e0edf9;border-color:transparent}.progress-steps .active{color:var(--accent);font-weight:700}.active .step-icon{background:var(--accent);color:white;border-color:var(--accent);box-shadow:0 0 0 3px #245c8918}.progress-note{margin:18px 0 0;font-size:10px;line-height:1.8;color:var(--muted)}.progress-card[data-state=error]{border-color:#ebd5cb;background:linear-gradient(140deg,white,#fff7f1)}.progress-card[data-state=error] .progress-badge,.progress-steps .failed{color:#9b412f;background:#fae9df}.progress-card[data-state=error] .ring-value{stroke:#9b412f}.progress-card[data-state=error] .progress-ring>span{color:#9b412f}.progress-card[data-state=warning] .progress-badge{color:#765019;background:#f8edd7}@keyframes progress-slide{0%{transform:translateX(-110%)}100%{transform:translateX(390%)}}@keyframes breathe{50%{opacity:.3}}@media(max-width:600px){.progress-card{padding:21px}.progress-hero{gap:15px}.progress-ring{width:76px;height:76px}.progress-ring>span{font-size:19px}.progress-copy h2{font-size:18px}.progress-stat{padding:11px 9px}.progress-stat strong{font-size:22px}.progress-stat small{margin-left:4px}.progress-steps{gap:10px}.progress-measure{font-size:10px}}@media(prefers-reduced-motion:reduce){.progress-card *{animation:none!important;transition:none!important}}
.task-tabs{max-width:560px;padding:5px;margin-bottom:26px;border:1px solid var(--border);background:var(--tint)}.task-tabs button{font-size:14px;padding:14px 20px}.task-tabs .active{box-shadow:0 2px 8px #101d3810}#batch-fetch{white-space:normal;line-height:1.8;display:block}@media(max-width:600px){.task-tabs button{font-size:13px;padding:13px 10px}}

/* Keep grid items within the viewport, including long configuration/error text. */
.workspace>*,.panel,.model-heading>*{min-width:0}
.model-heading{gap:12px;flex-wrap:wrap}
.model-heading small,.result-head,.footnote,#notice,.progress-copy,.progress-measure,.batch-race>summary{overflow-wrap:anywhere}
.date-row>input{flex:1;min-width:0;max-width:100%}
button,select,input:not([type=checkbox]),.model-option{min-height:44px}
button,.model-option,.batch-race>summary{touch-action:manipulation}
.batch-race>summary{min-height:44px;padding:8px 0}
.progress-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
.progress-stat{min-width:0}
.progress-measure{flex-wrap:wrap}
.full-field{margin-bottom:22px;padding:18px 24px}
.full-field>summary{font-size:14px;font-weight:700;color:var(--accent);line-height:1.7;cursor:pointer}
.full-field[open]>summary{padding-bottom:12px;border-bottom:1px solid var(--border)}
.full-field .footnote{margin:12px 0}
.full-field td:last-child{border-top:0;padding-top:16px}
@media(max-width:850px){
  .workspace{grid-template-columns:minmax(0,1fr)}
  input:not([type=checkbox]),select{font-size:16px}
}
@media(max-width:600px){
  header{height:64px;padding:0 16px}.brand{font-size:21px}.local{letter-spacing:1px}
  main{padding:24px 16px}.panel,.model-result{padding:16px}
  .task-tabs{margin-bottom:20px}.task-tabs button{padding:12px 4px}
  .tabs button{line-height:1.6}.workspace{gap:20px}
  .intro>p:last-child{line-height:1.8;margin-bottom:24px}
  .hint,.footnote,.conditions,.model-option small{font-size:12px}
  .model-option>span{min-width:0}.tag{letter-spacing:0}
  .empty{min-height:300px}.empty h2{font-size:22px}
  .legend{flex-wrap:wrap;justify-content:center}
  .result-head h2{font-size:22px;line-height:1.5}
  .model-heading small{font-size:11px;line-height:1.6}
  .progress-card{padding:16px}.progress-hero{align-items:flex-start;gap:12px}
  .progress-top{gap:8px}.progress-kicker{letter-spacing:.05em}
  .progress-ring{width:64px;height:64px}.progress-ring>span{font-size:17px}
  .progress-copy h2{font-size:17px}.progress-context,.progress-note,.progress-steps li{font-size:11px}
  .progress-stat{padding:10px 7px}.progress-stat small{display:block;margin:4px 0 0}
  .progress-stats{gap:8px}.step-icon{flex-shrink:0}
}

.grade-s{background:#f3e4b7;color:#654508}.grade-c{background:#eaf0f7;color:#435c78}.grade-d{background:#edf0f4;color:#566579}
.model-result .model-heading{flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:8px;margin-bottom:8px}
.model-heading .field-count{font-size:12px;color:var(--muted)}
.model-heading .model-version{margin-left:auto;flex-shrink:0;font-size:10px;font-weight:400;line-height:1.5;white-space:nowrap}
/* Midnight blue theme: clear text, controls and keyboard focus on light surfaces. */
button,input,select{color:var(--text)}
input::placeholder{color:var(--muted);opacity:1}
input[type=checkbox]{accent-color:var(--primary)}
.primary{color:var(--on-dark)}
.secondary{color:#21466f}
button:disabled{opacity:.65}
.primary:not(:disabled):hover{background:var(--primary-hover)}
.secondary:not(:disabled):hover{background:#dae7f4}
.tabs button:not(.active):not(:disabled):hover{background:#dce7f4;color:var(--primary)}
a:focus-visible,summary:focus-visible,input[type=checkbox]:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
.hint a:hover,.result-head a:hover{text-decoration:underline}
#notice:not(:empty){color:#765019}
.previous-prediction{display:flex;flex-direction:column;align-items:flex-start;gap:5px;width:100%;margin-top:10px;padding:12px 14px}
.previous-prediction small{font-size:11px;font-weight:400;color:var(--muted)}
#history-status:empty{display:none}

/* Keep shared column headings visible at every viewport size. */
.prediction-table th,.prediction-table td{padding:5px 8px;line-height:1.3}
.prediction-table th:nth-child(n+5),.prediction-table td:nth-child(n+5){text-align:right;font-variant-numeric:tabular-nums}
.prediction-table td:nth-child(3){white-space:normal;overflow-wrap:anywhere}
.prediction-table .horse-number{width:23px;height:23px;border-radius:4px}
.prediction-table th:nth-child(3),.prediction-table td:nth-child(3){text-align:left}
.prediction-table th:nth-child(2),.prediction-table td:nth-child(2){text-align:center}
.prediction-table .prediction-mark{font-size:18px;font-weight:700;color:var(--primary);line-height:1.3}
.prediction-table .leader-recommendation{display:inline-block;width:17px;height:17px;margin-inline-start:4px;vertical-align:-3px;color:#946209}
.leader-recommendation svg{display:block;width:100%;height:100%}
.horse-number.gate-1{background:#fff;color:#182943;border-color:#b8c2cf}
.horse-number.gate-2{background:#242424;color:#fff;border-color:#242424}
.horse-number.gate-3{background:#c62828;color:#fff;border-color:#c62828}
.horse-number.gate-4{background:#2359b5;color:#fff;border-color:#2359b5}
.horse-number.gate-5{background:#f4d83c;color:#182943;border-color:#f4d83c}
.horse-number.gate-6{background:#187a45;color:#fff;border-color:#187a45}
.horse-number.gate-7{background:#ef8b24;color:#182943;border-color:#ef8b24}
.horse-number.gate-8{background:#ef9fbc;color:#182943;border-color:#ef9fbc}
.prediction-table td small{display:inline-block;margin:0 0 0 .5em;font-size:11px}
@media(min-width:851px) and (max-width:1050px){
  .prediction-table th,.prediction-table td{padding-inline:2px}
  .prediction-table td:nth-child(3){min-width:145px}
  .prediction-table td small{display:block;margin:0}
}
@media(max-width:600px){
  .prediction-table{table-layout:fixed}
  .prediction-table th,.prediction-table td{padding:3px 2px}
  .prediction-table th:nth-child(1){width:27px}
  .prediction-table th:nth-child(2){width:22px}
  .prediction-table th:nth-child(4){width:54px}
  .prediction-table th:nth-child(5),.prediction-table th:nth-child(6){width:43px}
  .prediction-table td small{display:block;margin:0;line-height:1.2}
}
@media(max-width:400px){
  .model-result{margin-inline:-8px;padding-inline:6px}
}
@media(max-width:375px){
  .model-result{margin-inline:-15px;padding-inline:2px}
  .prediction-table th:nth-child(1){width:25px}
  .prediction-table th:nth-child(2){width:20px}
  .prediction-table th:nth-child(5),.prediction-table th:nth-child(6){width:41px}
  .prediction-table td strong{font-size:12px}
  .prediction-table .leader-recommendation{width:14px;height:14px;margin-inline-start:2px}
}
.session-footer{margin-top:24px;display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px}.session-badge{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:5px 10px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--muted);font-size:11px;line-height:1.5}.session-badge::before{content:"";width:6px;height:6px;flex-shrink:0;border-radius:50%;background:#778599}.session-badge[data-state="authenticated"]::before{background:#27805c}.session-badge[data-state="expired"]::before{background:#a46b18}.session-message{max-width:560px;color:var(--muted);font-size:11px;line-height:1.6}.session-check{padding:5px 8px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--muted);font-size:11px}
