:root{color-scheme:dark;--bg:#0c1222;--panel:#151f34;--surface:#1c2942;--line:#34435f;--text:#eef1ff;--muted:#a4b0cc;--accent:#a9baff}
:root[data-theme=light]{color-scheme:light;--bg:#f3f5fb;--panel:#fff;--surface:#f2f5fb;--line:#cbd3e5;--text:#162137;--muted:#52627f;--accent:#385daa}
:root{--fdc-bg:var(--bg);--fdc-panel:var(--panel);--fdc-border:var(--line);--fdc-text:var(--text);--fdc-muted:var(--muted);--fdc-primary:var(--accent);--fdc-primary-soft:var(--surface);--fdc-shadow:#0003}
body{padding-top:var(--trickcal-top-occupied-height,var(--trickcal-topbar-height,3.25rem))}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,"Noto Sans JP",sans-serif}
main{max-width:1280px;margin:auto;padding:14px 16px 32px}h1{font-size:20px;margin:0 0 12px}h1 small{font-size:13px;color:var(--muted)}h2{font-size:16px;margin:0}p{margin:6px 0}button,select{font:inherit;color:inherit;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:7px 9px}button{cursor:pointer}button:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.panel{border:1px solid var(--line);border-radius:12px;background:var(--panel);margin-bottom:12px}.controls{padding:12px}.control-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.control-grid label{display:grid;gap:4px;font-size:12px;color:var(--muted)}select{width:100%;min-width:0;color:var(--text)}.control-row{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:10px 0 7px;font-size:13px}.control-row label{display:flex;align-items:center;gap:4px}input{accent-color:var(--accent)}.control-row button{margin-left:auto;font-size:12px}.muted,#state-note{color:var(--muted);font-size:12px;line-height:1.5}.section-heading{display:flex;align-items:center;justify-content:space-between;padding:12px;border-bottom:1px solid var(--line);gap:10px}#result-count{font-size:12px;color:var(--muted)}#results{display:grid;gap:8px;padding:10px}.candidate{background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:10px;display:grid;grid-template-columns:minmax(200px,1fr) minmax(260px,1.6fr);gap:8px}.candidate-title{display:flex;align-items:center;gap:8px}.portrait{width:42px;height:42px;object-fit:contain}.name{font-weight:700}.meta{font-size:11px;color:var(--muted);margin-top:2px}.effect{font-size:13px;color:var(--accent);margin-top:3px}.costs{display:flex;align-items:center;flex-wrap:wrap;gap:5px}.cost{display:inline-flex;align-items:center;gap:4px;font-size:12px;white-space:nowrap}.cost img{width:20px;height:20px;object-fit:contain}.candidate details{grid-column:1/-1;font-size:12px}summary{cursor:pointer;color:var(--muted)}.breakdown{display:grid;gap:5px;margin-top:7px}.breakdown>div{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.breakdown label{min-width:112px}.route-list{color:var(--muted);overflow-wrap:anywhere}.warning{color:#ee9b64;font-size:12px}.empty{padding:16px;color:var(--muted)}
@media(max-width:800px){.control-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.candidate{grid-template-columns:1fr}}
.route-legend{display:flex;flex-wrap:wrap;gap:5px 12px;font-size:11px;margin:10px 0 6px;color:var(--muted)}.legend-required{color:var(--accent)}.legend-filled{color:#51af89}.legend-target{color:#cba64c}.route-boards{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap}.route-board{margin:0;padding:8px;border:1px solid var(--line);border-radius:8px;flex:1 1 200px;max-width:280px;background:var(--bg)}.route-board figcaption{font-size:12px;font-weight:700;text-align:center;margin-bottom:6px}.route-board svg{display:block;width:100%;max-height:390px}.board-edge{stroke:var(--line);stroke-width:1}.route-edge{stroke:var(--accent);stroke-width:4}.route-node rect{fill:var(--surface);stroke:var(--line);stroke-width:1}.route-node text{font-size:10px;text-anchor:middle;fill:var(--muted);pointer-events:none}.route-node.is-filled rect{fill:#275948;stroke:#51af89}.route-node.is-filled text{fill:#fff}.route-node.is-required rect{fill:var(--accent);stroke:var(--accent)}.route-node.is-required text{fill:var(--bg);font-weight:800}.target-ring{fill:none;stroke:#cba64c;stroke-width:2}.route-next{align-self:center;color:var(--muted);font-size:20px}
@media(max-width:600px){.route-boards{flex-direction:column;align-items:center}.route-board{flex:none;width:100%;max-width:280px}.route-next{transform:rotate(90deg)}}
.candidate-board-link{color:inherit;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:3px}.candidate-board-link:hover{color:var(--accent)}.candidate-title>a{flex-shrink:0}
.route-orientation{display:flex;gap:4px;margin-top:8px}.route-orientation button{font-size:12px;padding:3px 10px}.route-orientation button[aria-pressed=true]{border-color:var(--accent);color:var(--accent)}.route-boards[data-orientation=horizontal]{flex-direction:column;align-items:stretch}.route-boards[data-orientation=horizontal] .route-board{flex:none;width:100%;max-width:500px}.route-boards[data-orientation=horizontal] .route-next{align-self:flex-start;margin-left:20px;transform:rotate(90deg)}
@media(max-width:480px){main{padding:10px 8px 24px}.control-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.control-grid label:last-child{grid-column:1/-1}.controls{padding:9px}h1{font-size:18px}.candidate{padding:9px}.cost img{width:18px;height:18px}}
