/* Route home, viewer and editor. Route mode fills the viewport: companion header, status and footer hide;
   the compact route bar keeps a Companion link. Map ≈ 75%+, instructions panel ≈ 320px, collapsible. */
body.route-mode{padding:0;overflow:hidden}
.route-mode .game-window{display:flex;flex-direction:column;height:100vh;max-width:none;margin:0;border-radius:0;padding:3px}
.route-mode .topbar,.route-mode #status,.route-mode footer,.route-mode .skip{display:none}
.route-mode #app{flex:1;min-height:0;display:flex;flex-direction:column}
.route-mode #app>main{overflow:auto}
.route-screen{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--ui-surface)}

/* Bar */
.route-bar{display:flex;align-items:center;gap:12px;min-height:46px;padding:4px 12px;border:1px solid #504d44;border-bottom:2px ridge #8a8068;background:linear-gradient(#ffffff09,#0008),url('/assets/ui-rock.png') repeat;box-shadow:inset 0 1px #aaa28b33,0 2px 5px #000}
.route-back,.route-bar-link{flex:none;font:15px var(--ui-font);color:#ffe39a;text-decoration:none;text-shadow:1px 1px #000}.route-back:hover,.route-bar-link:hover{color:#fff4c6;text-decoration:underline}
.route-bar-link{color:#d8cfb8;padding-left:12px;border-left:1px solid #726956}
.route-bar-title{min-width:0;flex:1;display:flex;flex-direction:column;line-height:1.2;padding-left:12px;border-left:1px solid #726956}
.route-bar-title .eyebrow{font-size:10px;color:#b8ad99;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.route-bar-title strong{font:500 19px/1.2 var(--ui-font);color:var(--ui-gold);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:1px 1px 2px #000}
.route-bar-status{flex:0 1 auto;min-width:0;margin:0;display:flex;gap:8px;align-items:center;font:12px/1.35 Arial,sans-serif;color:#c9c0af}
.route-save{white-space:nowrap}.route-save.is-saved{color:#9fd586}.route-save.is-error{color:#ffb48a;white-space:normal;max-width:420px}
.route-share-chip{padding:1px 7px;border:1px solid #6b5940;border-radius:2px;background:#0007;color:#e8d08a;white-space:nowrap}.route-share-chip.is-done{color:#b7e396;border-color:#4f6b3b}.route-share-chip.is-problem{color:#ffb48a;border-color:#8a4b33}
.route-bar-actions{flex:none;display:flex;gap:6px;align-items:center}

/* Buttons: the shell's metal buttons, compact; primary is the red/gold action. */
.route-button,.route-tool,.route-floor,.route-segmented button,.route-order button{display:inline-flex;justify-content:center;align-items:center;gap:4px;min-height:29px;margin:0;padding:2px 12px;font:15px/1.25 var(--ui-font);color:var(--ui-gold);text-decoration:none;border:2px ridge #7e7463;border-radius:3px;background:linear-gradient(#55534c,#20201f 55%,#111);box-shadow:inset 0 0 0 1px #050505,0 1px 3px #000;text-shadow:1px 1px #000;cursor:pointer;white-space:nowrap}
.route-button:hover,.route-tool:hover,.route-floor:hover,.route-segmented button:hover,.route-order button:hover{border-color:#b7a47b;color:#fff0a5;filter:brightness(1.16);background:linear-gradient(#55534c,#20201f 55%,#111)}
.route-button:active,.route-tool:active{transform:translateY(1px);filter:brightness(.85)}
.route-button.is-primary,.route-tool.is-primary{background:linear-gradient(#811b15,#5e0b08 55%,#380403)}
.route-button.is-small{min-height:25px;padding:1px 9px;font-size:13px}
.route-button.is-danger{color:#ffb19c}
.route-button:disabled,.route-tool:disabled,.route-order button:disabled{opacity:.4;cursor:default;filter:none;transform:none}
.route-tool[aria-pressed="true"],.route-floor[aria-pressed="true"],.route-segmented button[aria-pressed="true"]{background:linear-gradient(90deg,#58451eaa,#c3a31d50 60%,#32261444),#15130e;border-color:#ad8c40;box-shadow:inset 0 1px #ffe39555,inset 0 -2px #ba9d3633;color:#fff7cd}
.route-file{position:relative;overflow:hidden}.route-file input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.route-file:focus-within{outline:2px solid #ffe580;outline-offset:3px}

/* Body: map + panel */
.route-body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 16px 320px}
.route-screen.is-collapsed .route-body{grid-template-columns:minmax(0,1fr) 16px 0}.route-screen.is-collapsed .route-panel{display:none}
.route-map-pane{min-width:0;min-height:0;display:flex;flex-direction:column;background:#0a0b0d}
.route-mapbar{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;justify-content:space-between;padding:6px 10px;background:#19181a;border-bottom:1px solid #514b3e}
.route-floors,.route-tools{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.route-floor{flex-direction:column;gap:0;min-height:34px;padding:2px 12px;font-size:14px;line-height:1.1}.route-floor small{font:10px Arial,sans-serif;color:#b8ad99}
.route-floor-single{font:15px var(--ui-font);color:#decc9a}
.route-tool{font-size:14px;padding:2px 10px}
.route-inline{display:inline-flex;align-items:center;gap:6px;font:12px Arial,sans-serif;color:#e4d9bd}
.route-inline select{padding:2px 6px;font:13px Arial,sans-serif;background:#0b0c10;color:#f0e7d4;border:2px groove #6d6655;border-radius:2px}
.route-zoom{display:inline-flex;gap:3px}.route-zoom .route-button{min-width:29px}
.route-map-surface{flex:1;min-height:0;position:relative;overflow:hidden;background:radial-gradient(ellipse,#25211a,#090a0c 78%)}
.route-hint{margin:0;min-height:28px;padding:5px 12px;font:12px/1.45 Arial,sans-serif;color:#d2c5a8;background:#101012;border-top:1px solid #3e3930}
.route-hint-message{color:#ffd88a}
.route-panel-toggle{width:16px;min-height:0;padding:0;margin:0;border:0;border-left:1px solid #514b3e;border-right:1px solid #2c2a25;border-radius:0;background:linear-gradient(90deg,#2a2721,#141311);color:var(--ui-gold);font:16px var(--ui-font);cursor:pointer}
.route-panel-toggle:hover{background:linear-gradient(90deg,#3b352a,#1d1b17);color:#fff0a5}
.route-panel{min-width:0;min-height:0;border-left:2px groove #706858;background:#111113 url('/assets/ui-marble.png') repeat}
.route-panel-scroll{height:100%;overflow:auto;padding:12px 14px 20px;color:#e4ddcf}
.route-panel-heading{font:500 24px/1.15 var(--ui-font);color:#fff0bd;margin:2px 0 8px}
.route-description,.route-step-text{white-space:pre-line;font:13px/1.55 Arial,sans-serif;color:#e0d6bc}
.route-section{margin-top:14px;padding-top:4px;border-top:1px solid #413b30}
.route-section-title{display:flex;justify-content:space-between;align-items:baseline;margin:10px 0 8px;font:500 17px/1.2 var(--ui-font);color:var(--ui-gold)}.route-section-title span{font:12px Arial,sans-serif;color:#aaa18e}
.route-help,.route-footnote,.route-empty,.route-credit,.route-message-line{font:12px/1.5 Arial,sans-serif;color:#b6ad9c;margin:6px 0}
.route-footnote{color:#a99f8b;margin-top:14px}.route-credit a,.route-help a{color:#e4cb8c}
.route-warn{color:#ffb48a;font-weight:400}
.route-field-error{margin:4px 0 0;font:12px/1.4 Arial,sans-serif;color:#ffb48a}.route-field-error:empty{display:none}
.route-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}

/* Fields */
.route-field{display:flex;flex-direction:column;gap:3px;margin:9px 0 0;font:12px Arial,sans-serif;color:#e2d5b8}
.route-field>span{font:12px Arial,sans-serif;color:#e2d5b8}
.route-field input[type=text],.route-field textarea,.route-field select,.route-coords input,.route-share-url input{width:100%;padding:5px 7px;font:14px/1.35 Arial,sans-serif;color:#f0e7d4;background:#0b0c10;border:2px groove #6d6655;border-radius:2px}
.route-field textarea{resize:vertical;min-height:56px}
.route-field input[type=range]{width:100%;accent-color:#c3a251}
.route-field input:invalid{border-color:#9a5a3c}
.route-coords{display:flex;gap:8px;align-items:end;margin-top:9px;font:12px Arial,sans-serif;color:#e2d5b8}.route-coords label{display:flex;flex-direction:column;gap:3px;flex:1}.route-coords span{color:#9e9585;padding-bottom:7px}
.route-fieldset{margin:12px 0 0;padding:6px 10px 10px;border:1px solid #5b5040}.route-fieldset legend{font:14px var(--ui-font);color:#e9cb7f;padding:0 4px}
.route-swatches{display:flex;flex-wrap:wrap;gap:6px}
.route-swatch-button{width:26px;height:26px;min-height:0;padding:0;margin:0;border:2px ridge #8a7a60;border-radius:3px;background:var(--leg);box-shadow:inset 0 0 0 1px #0008;cursor:pointer}
.route-swatch-button:hover{background:var(--leg);border-color:#d8c290}
.route-swatch-button.is-active{outline:2px solid #ffe580;outline-offset:2px}
.route-segmented{display:inline-flex;gap:3px;margin:2px 8px 0 0}.route-segmented button{min-height:25px;padding:1px 9px;font-size:13px}
.route-inspector{padding:10px 12px 12px;border:2px ridge #786449;border-radius:3px;background:radial-gradient(ellipse at 25% 0,#51402b55,transparent 75%),#151516;box-shadow:inset 0 0 0 2px #080808,0 3px 8px #0008}
.route-inspector-head{display:flex;align-items:center;gap:8px}.route-inspector-head .eyebrow{flex:1;color:#e8d08a}
.route-close{width:25px;height:25px;min-height:0;padding:0;margin:0;font:19px/1 var(--ui-font);color:var(--ui-gold);border:2px ridge #7e7463;border-radius:3px;background:linear-gradient(#811b15,#5e0b08 55%,#380403);cursor:pointer}
.route-close:hover{background:linear-gradient(#811b15,#5e0b08 55%,#380403);border-color:#b7a47b;color:#fff0a5}

/* Lists */
.route-step-list,.route-leg-list,.route-legend,.route-drafts,.route-catalog{list-style:none;margin:0;padding:0}
.route-step-item{display:flex;flex-wrap:wrap;align-items:flex-start;border-bottom:1px solid #353127}
.route-step-pick,.route-leg-pick{flex:1;min-width:0;display:flex;gap:9px;align-items:flex-start;padding:8px 6px;margin:0;text-align:left;font:inherit;color:inherit;background:none;border:1px solid transparent;border-radius:0;cursor:pointer}
.route-step-pick:hover,.route-leg-pick:hover{background:#8e79231f;border-color:#78653a}
.route-step-item.is-active,.route-leg-list li.is-active{background:linear-gradient(90deg,#b49a2666,#856b1c33 80%,#5c4d1722);box-shadow:inset 2px 0 #efc848}
.route-step-num{flex:none;display:grid;place-items:center;width:26px;height:26px;border-radius:50%;border:2px solid #d2aa4d;background:#2a1d0c;color:#fff2c5;font:700 13px/1 var(--ui-font)}
.route-step-item.kind-danger .route-step-num{border-color:#e03c31}.route-step-item.kind-pull .route-step-num{border-color:#ff7d0a}.route-step-item.kind-skip .route-step-num{border-color:#3fc7eb}.route-step-item.kind-cc .route-step-num{border-color:#7fb6ff}.route-step-item.kind-stand .route-step-num{border-color:#1eff00}.route-step-item.kind-transition .route-step-num{border-color:#a335ee}.route-step-item.kind-note .route-step-num{border-color:#a8a08f}
.route-step-body{min-width:0;display:flex;flex-direction:column}.route-step-body strong{font:500 16px/1.25 var(--ui-font);color:var(--ui-gold)}.route-step-item.is-active .route-step-body strong{color:#fff4bc}
.route-step-body small,.route-leg-pick small{display:block;font:11px/1.4 Arial,sans-serif;color:#b7af9c}
.route-step-text{flex-basis:100%;margin:-2px 6px 9px 41px}
.route-order{display:flex;flex-direction:column;gap:2px;padding:6px 2px}.route-order button{min-height:18px;padding:0 6px;font-size:10px}
.route-leg-list li{display:flex;border-bottom:1px solid #353127}.route-leg-pick{align-items:center;font:15px/1.25 var(--ui-font);color:var(--ui-gold)}
.route-swatch{flex:none;display:inline-block;width:24px;height:6px;border-radius:3px;background:var(--leg);box-shadow:0 0 0 1px #000}
.route-swatch.is-dashed{background:repeating-linear-gradient(90deg,var(--leg) 0 6px,transparent 6px 10px)}
.route-legend{margin:8px 0 4px;display:grid;gap:4px}.route-legend li{display:flex;align-items:center;gap:8px;font:14px var(--ui-font);color:#e6d7ac}.route-legend small{font:11px Arial,sans-serif;color:#aaa18e}
.route-share-notice{margin:4px 0 8px;padding:7px 9px;font:13px/1.45 Arial,sans-serif;color:#e0d6bc;background:#171715;border-left:3px solid #8a7a50}
.route-share-notice.is-done{border-color:#6f9c4f;background:#182415;color:#c7e6a8}.route-share-notice.is-problem{border-color:#b0603c;background:#241712;color:#ffc9a8}
.route-share-url{display:flex;gap:6px;margin:6px 0}.route-share-url input{flex:1;min-width:0;font-size:12px}

/* Map SVG */
.route-canvas{display:block;width:100%;height:100%;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
.route-canvas:active{cursor:grabbing}
.route-canvas[data-tool="draw"],.route-canvas[data-tool="step"],.route-canvas[data-tool="mark"]{cursor:crosshair}
.route-canvas:focus-visible{outline:2px solid #ffe580;outline-offset:-3px}
.route-canvas [tabindex]:focus-visible{outline:none}
.route-map-missing{fill:#151515}.route-map-missing-text{fill:#aaa292;font-family:var(--ui-font)}
.route-poi circle{fill:#0009;stroke:#c9c0af;stroke-width:1.5;stroke-dasharray:2 2;vector-effect:non-scaling-stroke}.route-poi.kind-boss circle,.route-poi.kind-rare circle{stroke:#e3c67c}.route-poi.kind-quest circle,.route-poi.kind-possible circle{stroke:#a5d6b9}
.route-leg-hit{fill:none;stroke:transparent;stroke-linecap:round;stroke-linejoin:round;pointer-events:stroke;cursor:pointer}
.route-leg-casing{fill:none;stroke:#000b;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.route-leg-line{fill:none;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.route-leg-head,.route-leg-chevron,.route-leg-start{stroke:#000c;stroke-width:1.5;stroke-linejoin:round;vector-effect:non-scaling-stroke;pointer-events:none}
.route-leg.is-selected .route-leg-casing{stroke:#fff3c2cc}
.route-leg.is-ghost,.route-mark.is-ghost{opacity:.3}.route-step.is-ghost{opacity:.5}
.route-vertex,.route-mark-handle{fill:#1a1408;stroke:#ffe8a0;stroke-width:2;vector-effect:non-scaling-stroke;cursor:move}
.route-vertex.is-selected,.route-mark-handle.is-selected{fill:#ffd45d;stroke:#fff}.route-mark-handle.is-end{fill:#ffd100}
.route-vertex:focus-visible,.route-mark-handle:focus-visible{stroke:#fff;stroke-width:4;filter:drop-shadow(0 0 4px #ffe28a)}
.route-midpoint{fill:#ffd10044;stroke:#ffd100;stroke-width:1.2;vector-effect:non-scaling-stroke;cursor:copy}.route-midpoint:hover{fill:#ffd100}
.route-step{cursor:pointer}.route-canvas.is-editing .route-step{cursor:move}
.route-step-disc{fill:#2a1d0c;stroke:#ffd100;stroke-width:2.5;vector-effect:non-scaling-stroke}
.route-step text{fill:#fff2c5;font-family:var(--ui-font);font-weight:700;font-variant-numeric:lining-nums;pointer-events:none}
.route-step-halo,.route-mark-halo{fill:none;stroke:none;pointer-events:none}
.route-step.is-selected .route-step-halo,.route-step:focus-visible .route-step-halo,.route-mark.is-selected .route-mark-halo,.route-mark:focus-visible .route-mark-halo{stroke:#ffe8a0;stroke-width:3;vector-effect:non-scaling-stroke;filter:drop-shadow(0 0 4px #f8c342)}
.route-step.is-selected .route-step-disc{fill:#ffd45d}.route-step.is-selected text{fill:#241707}
.route-step.kind-danger .route-step-disc{stroke:#e03c31}.route-step.kind-pull .route-step-disc{stroke:#ff7d0a}.route-step.kind-skip .route-step-disc{stroke:#3fc7eb}.route-step.kind-cc .route-step-disc{stroke:#7fb6ff}.route-step.kind-stand .route-step-disc{stroke:#1eff00}.route-step.kind-transition .route-step-disc{stroke:#c36bff}.route-step.kind-note .route-step-disc{stroke:#c9c0af}
.route-mark{cursor:pointer}.route-canvas.is-editing .route-mark{cursor:move}
.route-mark-badge{fill:#151311;stroke:#c9c0af;stroke-width:2;vector-effect:non-scaling-stroke}
.route-mark-glyph{fill:#f2eee5;font-family:"Segoe UI Symbol",var(--ui-font);pointer-events:none}
.route-mark.kind-danger .route-mark-badge{stroke:#e03c31}.route-mark.kind-danger .route-mark-glyph{fill:#ff8a7a}
.route-mark.kind-pull .route-mark-badge{stroke:#ff7d0a}.route-mark.kind-skip .route-mark-badge{stroke:#3fc7eb}.route-mark.kind-cc .route-mark-badge{stroke:#7fb6ff}.route-mark.kind-quest .route-mark-badge{stroke:#ffd100}.route-mark.kind-quest .route-mark-glyph{fill:#ffd100}.route-mark.kind-stand .route-mark-badge{stroke:#1eff00}.route-mark.kind-transition .route-mark-badge{stroke:#c36bff}
.route-area{fill:#e03c3120;stroke:#e03c31;stroke-width:2;stroke-dasharray:7 5;vector-effect:non-scaling-stroke}
.route-arrow-hit{stroke:transparent;stroke-linecap:round}
.route-arrow-line{stroke:#ffd100;stroke-linecap:round;pointer-events:none}
.route-arrow-head{fill:#ffd100;stroke:#000c;stroke-width:1.5;vector-effect:non-scaling-stroke;pointer-events:none}
.route-mark.is-selected .route-arrow-line{stroke:#fff3c2}
.route-map-label{fill:#fff2c5;font-family:var(--ui-font);paint-order:stroke;stroke:#000;stroke-width:3px;stroke-linejoin:round;pointer-events:none}
.raid-star{fill:#ffd100}.raid-circle{fill:#ff7d0a}.raid-diamond{fill:#c060ff}.raid-triangle{fill:#2ecc40}.raid-moon{fill:#c8d6e5}.raid-square{fill:#2e8bff}.raid-cross{fill:none;stroke:#e03c31;stroke-linecap:round}.raid-skull circle,.raid-skull rect{fill:#f2eee5}.raid-skull .raid-skull-eye{fill:#111}
.raid-star,.raid-circle,.raid-diamond,.raid-triangle,.raid-moon,.raid-square,.raid-skull circle:not(.raid-skull-eye),.raid-skull rect{stroke:#000;stroke-width:1.5;vector-effect:non-scaling-stroke}

/* Home and messages */
.route-home{flex:1;min-height:0;overflow:auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:18px;align-content:start;padding:20px;max-width:1300px;width:100%;margin:0 auto}
.route-card{padding:16px 20px 18px;border:2px ridge #786449;border-radius:3px;background:radial-gradient(ellipse at 25% 0,#51402b55,transparent 75%),#151516;box-shadow:inset 0 0 0 2px #080808,0 3px 8px #0008}
.route-card h2{font:500 23px/1.2 var(--ui-font);color:#f4e6c7;margin:0 0 6px}
.route-catalog{display:grid;gap:8px;margin-top:10px}
.route-catalog-item{display:flex;align-items:center;gap:12px;padding:10px 12px;text-decoration:none;border:1px solid #37332c;background:#0c0c0dbb}.route-catalog-item:hover{border-color:#78653a;background-color:#5d4f2422}
.route-catalog-item strong{flex:1;font:18px/1.2 var(--ui-font);color:var(--ui-gold)}.route-catalog-item small{font:12px Arial,sans-serif;color:#aaa18e}
.route-drafts{display:grid;gap:6px;margin-top:10px}
.route-draft{display:flex;align-items:center;gap:8px;border:1px solid #37332c;background:#0c0c0dbb}
.route-draft-open{flex:1;min-width:0;display:flex;flex-direction:column;padding:9px 12px;text-decoration:none}.route-draft-open:hover{background:#5d4f2422}
.route-draft-open strong{font:17px/1.2 var(--ui-font);color:var(--ui-gold)}.route-draft-open small{font:11px/1.5 Arial,sans-serif;color:#b7af9c}
.route-draft .route-button{margin-right:8px}
.route-message{padding:40px 30px;max-width:760px}.route-message h1{font:500 30px/1.2 var(--ui-font);color:#fff0bd;margin:0 0 10px}.route-message p{font:14px/1.6 Arial,sans-serif;color:#d1c5b0}
.route-message-links{display:flex;gap:8px;margin-top:16px}

/* Companion entry point */
.route-plan-link{min-height:27px;padding:2px 12px;font-size:14px}

@media(max-width:1100px){.route-body{grid-template-columns:minmax(0,1fr) 16px 280px}.route-bar-status{display:none}}
@media(max-width:800px){
  body.route-mode{overflow:auto}.route-mode .game-window{height:auto;min-height:100vh}
  .route-bar{flex-wrap:wrap}.route-bar-actions{width:100%;justify-content:flex-end}
  .route-body{display:flex;flex-direction:column}.route-map-surface{flex:none;height:62vh}
  .route-panel-toggle{display:none}.route-screen.is-collapsed .route-panel{display:block}
  .route-panel-scroll{height:auto;overflow:visible}
}
