/* Reading diagrams share the guide palette; the original reference tables remain. */
.viz-panel[data-visual-guide] { min-width:0; max-width:100%; margin:20px 0 26px; padding:22px; border:1px solid var(--line); border-radius:12px; background:linear-gradient(145deg,#211b29,#17141d); scroll-margin-top:calc(var(--nav-h,16px) + 14px); }
.viz-panel h3 { margin:0 0 10px; font-size:20px; line-height:1.55; letter-spacing:-.035em; }
.viz-panel h4 { margin:12px 0 8px; font-size:16px; line-height:1.6; }
.viz-note { margin:8px 0 16px; color:var(--muted); font-size:13px; line-height:1.8; overflow-wrap:anywhere; }
.viz-readout { margin:12px 0; color:var(--ink); font-size:17px; font-weight:600; line-height:1.7; }
.viz-panel button,.viz-panel a,.viz-panel summary { -webkit-tap-highlight-color:#69527e44; }
.viz-panel button { min-height:44px; padding:9px 13px; border-radius:8px; line-height:1.6; white-space:normal; }
.viz-panel select,.viz-panel input:not([type="checkbox"]) { width:100%; min-height:44px; }
.viz-panel label { min-width:0; }
.viz-panel img { object-fit:contain; flex:none; }
.viz-tabs { display:flex; gap:7px; width:100%; max-width:100%; overflow-x:auto; padding:3px 2px 10px; scrollbar-width:thin; overscroll-behavior-x:contain; }
.viz-tabs > button { flex:none; max-width:min(260px,85%); border:1px solid var(--line-strong); background:#27202f; color:var(--muted); font-size:13px; white-space:nowrap; }
.viz-tabs > button[aria-selected="true"],.viz-dungeon-route button[aria-pressed="true"] { background:#d4c3e5; color:#2c2036; border-color:#d4c3e5; }
.viz-tab-content { min-width:0; padding-top:4px; }
.viz-route { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:0; list-style:none; }
.viz-route > li { min-width:0; padding:12px; border:1px solid var(--line); border-radius:9px; background:#17131d; }
.viz-route a { display:flex; align-items:center; gap:9px; min-height:44px; color:var(--ink); font-size:14px; text-decoration:none; }
.viz-route a img { width:30px; height:30px; }
.viz-route .viz-check { margin-top:8px; }
.viz-route > li:has(input:checked) { border-color:#546c5c; background:#1b2620; }
.viz-panel progress { width:100%; height:9px; margin:8px 0 0; accent-color:var(--mint); border:0; border-radius:20px; overflow:hidden; }
.viz-panel progress::-webkit-progress-bar { background:#39313f; }
.viz-panel progress::-webkit-progress-value { background:var(--mint); }
.viz-npc-result { display:flex; align-items:center; gap:20px; margin:12px 0 0; }
.viz-npc-result > img { width:112px; height:112px; object-fit:cover; border:1px solid var(--line-strong); border-radius:12px; }
.viz-npc-result > div { min-width:0; }
.viz-npc-result p { margin:4px 0; }
.viz-input-details { margin-bottom:16px; padding:0 0 12px; border-bottom:1px solid var(--line); }
.viz-input-details summary { min-height:44px; padding:10px 0; cursor:pointer; color:var(--accent); }
.viz-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:14px 0 18px; }
.viz-fields > label { display:grid; gap:6px; font-size:13px; }
.viz-stat-row { display:grid; grid-template-columns:108px minmax(0,1fr) 72px; align-items:center; gap:10px; margin:14px 0; }
.viz-stat-row > strong { color:var(--muted); font-size:13px; font-weight:500; }
.viz-stat-row > b { text-align:right; font-size:14px; font-variant-numeric:tabular-nums; }
.viz-stat-tracks { display:grid; gap:5px; }
.viz-stat-track { height:9px; overflow:hidden; border-radius:12px; background:#3b3244; }
.viz-stat-fill { display:block; height:100%; border-radius:inherit; background:#c7b5df; }
.viz-stat-track.is-current .viz-stat-fill { background:#b6d1c0; }
.viz-chart { margin:16px 0; max-width:100%; }
.viz-chart svg { display:block; width:100%; max-height:300px; overflow:visible; }
.viz-chart text { fill:var(--muted); font:15px var(--sans); }
.viz-chart figcaption { margin:5px 0 0; color:var(--muted); font-size:12px; text-align:center; line-height:1.7; }
.viz-grid-line { stroke:var(--line); stroke-width:1; }
.viz-curve { stroke:#c7b5df; stroke-width:3; stroke-linejoin:round; }
.viz-current-point { fill:#b6d1c0; stroke:#17141d; stroke-width:2; }
.viz-facts { display:flex; flex-wrap:wrap; gap:8px; }
.viz-facts > p { margin:0; padding:8px 10px; border:1px solid var(--line); border-radius:7px; font-size:13px; font-variant-numeric:tabular-nums; }
.viz-probability { height:20px; overflow:hidden; border:1px solid var(--line-strong); border-radius:20px; background:#3e3548; }
.viz-probability > span { display:block; height:100%; background:#c7b5df; }
.viz-ladder { display:grid; grid-template-columns:repeat(auto-fit,minmax(90px,1fr)); gap:8px; list-style:none; margin:16px 0 0; padding:0; }
.viz-ladder li { display:flex; flex-direction:column; align-items:center; gap:5px; min-width:0; padding:12px 5px; border:1px solid var(--line-strong); border-radius:8px; font-variant-numeric:tabular-nums; }
.viz-ladder .is-safe { border-color:#4e6958; background:#1c2821; }
.viz-ladder .is-risk { border-color:#785a66; background:#2c1f27; }
.viz-step-icon { font-size:20px; color:var(--mint); }
.viz-ladder .is-risk .viz-step-icon { color:#e5b1bd; }
.viz-ladder small { color:var(--muted); font-size:12px; }
.viz-checks { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:16px 0; }
.viz-check { display:flex; align-items:center; gap:10px; min-height:44px; font-size:13px; line-height:1.7; cursor:pointer; }
.viz-check input[type="checkbox"] { flex:none; width:24px; height:24px; margin:8px; accent-color:var(--accent); }
.viz-result-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.viz-condition { min-width:0; padding:16px; border:1px solid var(--line-strong); border-radius:9px; background:#1c1722; }
.viz-condition h4 { margin:0 0 8px; }
.viz-condition > strong { font-size:15px; }
.viz-condition.is-ready { border-color:#4e6958; }
.viz-condition.is-ready > strong { color:#bed9c8; }
.viz-condition.is-blocked { border-color:#785a66; }
.viz-condition.is-blocked > strong { color:#e5b1bd; }
.viz-condition ul { margin:10px 0 0; padding-left:19px; color:var(--muted); font-size:13px; line-height:1.8; }
.viz-dungeon-route { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:9px; margin:16px 0; padding:0; list-style:none; }
.viz-dungeon-route li { display:flex; flex-direction:column; align-items:stretch; gap:5px; min-width:0; }
.viz-dungeon-route button { border:1px solid var(--line-strong); color:var(--ink); }
.viz-route-arrow { text-align:center; color:var(--muted); }
.viz-door { display:flex; flex-direction:column; align-items:center; gap:7px; padding:12px 8px; border:1px solid var(--line); border-radius:9px; background:#141019; color:var(--ink); text-decoration:none; text-align:center; }
.viz-door small { font-size:12px; color:var(--muted); }
.viz-floor-detail { padding:12px 14px; background:#2b2334; border-radius:8px; font-size:14px; }
.viz-floor-detail p { margin:7px 0; color:var(--muted); font-size:13px; }
.viz-floor-detail a { display:inline-flex; align-items:center; min-height:44px; }
.viz-loot-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:10px 0; }
.viz-loot-item { display:flex; align-items:center; gap:9px; min-width:0; padding:9px 10px; border:1px solid var(--line); border-radius:8px; background:#17131d; font-size:13px; line-height:1.7; text-decoration:none; color:var(--ink); overflow-wrap:anywhere; }
.viz-loot-item img { width:32px; height:32px; }
.viz-panel > svg { display:block; width:100%; max-height:350px; margin:16px auto; }
.viz-panel > svg text { fill:var(--muted); font:13px var(--sans); }
.viz-range-ring { stroke:#66576e; stroke-dasharray:4 5; }
.viz-danger-zone { fill:#99576844; stroke:#db9bad; stroke-width:2; }
.viz-danger-zone[data-stage="1"] { fill:#b1586c99; stroke:#f1bac7; }
.viz-danger-zone[data-stage="2"] { fill:#99576818; stroke-dasharray:5 4; }
.viz-boss-dot { fill:#c7b5df; stroke:#fff3ff; stroke-width:2; }
.viz-player-dot { fill:#b6d1c0; stroke:#183423; stroke-width:3; }
.viz-facing { fill:none; stroke:#c7b5df; stroke-width:2; }
.viz-escape-path { stroke:#b6d1c0; stroke-width:3; stroke-dasharray:5 4; }
.viz-day-track { position:relative; height:34px; margin-top:18px; overflow:visible; background:#302738; border:1px solid #55425f; border-radius:8px; }
.viz-day-window { position:absolute; top:0; bottom:0; min-width:1px; border-radius:4px; background:#b49dcb; }
.viz-plan-pin { position:absolute; top:50%; width:12px; height:12px; transform:translate(-50%,-50%); border:2px solid #183423; border-radius:50%; background:#c3e1cd; box-shadow:0 0 0 2px #c3e1cd; }
.viz-time-ticks { display:flex; justify-content:space-between; margin:8px 0; color:var(--muted); font-size:12px; }
.viz-plan-link { display:block; width:100%; margin-top:10px; color:var(--mint); text-align:left; }
@media(max-width:650px) {
  .viz-panel[data-visual-guide] { padding:16px 13px; margin-block:16px 22px; }
  .viz-panel h3 { font-size:18px; }
  .viz-route { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .viz-route > li { padding:9px; }
  .viz-route a { align-items:flex-start; font-size:13px; }
  .viz-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .viz-stat-row { grid-template-columns:96px minmax(0,1fr) 62px; gap:7px; }
  .viz-stat-row > strong { font-size:12px; }
  .viz-stat-row > b { font-size:13px; }
  .viz-checks,.viz-result-grid { grid-template-columns:minmax(0,1fr); }
  .viz-dungeon-route { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .viz-loot-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .viz-npc-result { gap:12px; align-items:flex-start; }
  .viz-npc-result > img { width:84px; height:84px; }
  .viz-npc-result h4 { margin-top:0; font-size:15px; }
  .viz-chart svg { max-height:none; }
  .viz-tabs > button { font-size:13px; }
}
@media(max-width:359px) { .viz-loot-grid { grid-template-columns:minmax(0,1fr); } .viz-route a { flex-direction:column; } }
@media print {
  .viz-panel[data-visual-guide] { break-inside:avoid; background:transparent; border-color:#777; }
  .viz-panel button,.viz-panel input,.viz-panel select,.viz-input-details { display:none; }
  .viz-chart text,.viz-panel > svg text { fill:#333; }
  .viz-grid-line { stroke:#ccc; }
}
