:root{
 --navy:#10284d;--navy2:#1e3c67;--blue:#1467e8;--green:#0b7a45;
 --ink:#14233c;--muted:#6c7d92;--line:#dce5ef;--panel:#fff;--bg:#f4f7fb;
 --room:#e8f1dc;--room-stroke:#d4e0c6;--corridor:#eef3f8;
 --stair:#ffd74e;--lift:#dcecff
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{min-height:100vh}
.site-header{background:#fff;border-bottom:1px solid #dfe6ee}
.header-inner{max-width:1320px;margin:0 auto;padding:22px 26px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.product-brand{display:flex;align-items:center;gap:14px}
.brand-mark{width:52px;height:52px;border:2px solid var(--navy);border-radius:14px;display:grid;place-items:center;font-size:28px;color:var(--navy)}
.eyebrow{font-size:.72rem;font-weight:800;letter-spacing:.16em;color:#6b7e98}
h1{margin:2px 0 1px;font-size:2.1rem;line-height:1.06}
.product-brand p{margin:0;color:var(--muted)}
.uni-brand{display:flex;align-items:center;gap:11px;color:var(--green)}
.uni-shield{width:52px;height:52px;background:var(--green);color:#fff;display:grid;place-items:center;font-family:Georgia,serif;font-size:30px;font-weight:700;border-radius:4px}
.uni-brand strong{display:block;font:700 1.45rem Georgia,serif;letter-spacing:.03em}
.uni-brand span{display:block;font-size:.62rem;letter-spacing:.18em;margin-top:2px}

.page-shell{max-width:1320px;margin:20px auto;padding:0 20px 28px;display:grid;gap:16px}
.control-card,.map-card,.info-card,.journey-card{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 6px 24px rgba(18,40,77,.045)}
.control-card{padding:16px;display:grid;grid-template-columns:1.2fr 1.2fr 1.2fr 1.4fr auto auto;gap:12px;align-items:end}
.control-card label>span,.map-tools label>span{display:block;font-size:.82rem;font-weight:800;margin-bottom:6px}
select,input[type=text]{width:100%;padding:11px 12px;border:1px solid #cbd6e3;border-radius:9px;background:#fff;font:inherit;color:var(--ink)}
.btn{border:0;border-radius:10px;padding:12px 20px;font:inherit;font-weight:800;cursor:pointer;white-space:nowrap}
.primary{background:var(--navy);color:#fff}.primary:hover{background:#0c2243}
.secondary{background:#eef3f8;color:#23374f}
.nav-icon{margin-right:6px}
.message{grid-column:1/-1;background:#f3f6f9;padding:10px 12px;border-radius:9px;color:#56677d;font-size:.86rem}
.message.ok{background:#eef9f1;color:#27653a}.message.error{background:#fff0f0;color:#a52a2a}
.check-row{min-height:42px;border:1px solid #cbd6e3;border-radius:9px;padding:9px 11px;display:flex!important;align-items:center;gap:8px;background:#fbfcfe}
.check-row input{width:auto}.check-row span{margin:0!important;font-size:.78rem!important;font-weight:700!important}
.qr-input-row{display:grid;grid-template-columns:1fr auto;gap:7px}
.qr-btn{border:1px solid #cbd6e3;background:#fff;color:#24364f;border-radius:9px;padding:10px 12px;font-weight:800;cursor:pointer;white-space:nowrap}

.journey-card{padding:16px 18px}
.journey-card.hidden,.hidden{display:none!important}
.journey-head{display:flex;justify-content:space-between;gap:16px;align-items:center}
.journey-head strong{font-size:1.12rem}
.profile-badge{background:#eef4fb;border:1px solid #d7e2ef;color:#24405f;padding:7px 10px;border-radius:999px;font-size:.76rem;font-weight:800}
.floor-steps{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:14px}
.floor-step{border:1px solid #cbd8e7;background:#fff;border-radius:12px;padding:9px 12px;display:flex;align-items:center;gap:8px;cursor:pointer;color:var(--ink)}
.floor-step span{width:22px;height:22px;border-radius:50%;background:#e7eef7;display:grid;place-items:center;font-size:.72rem;font-weight:900}
.floor-step.active{border-color:var(--blue);box-shadow:0 0 0 2px rgba(20,103,232,.12)}
.floor-step.active span{background:var(--blue);color:#fff}
.step-arrow{font-style:normal;color:#71839a}
.transition-card{margin-top:14px;border-radius:14px;padding:12px 14px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px}
.transition-card.stair{background:#fff8db;border:1px solid #eed27b}
.transition-card.lift{background:#eef6ff;border:1px solid #b8d3f4}
.transition-icon{font-size:1.8rem}
.transition-copy span{display:block;font-size:.68rem;font-weight:900;letter-spacing:.12em;color:#6e7d91}
.transition-copy strong{display:block;margin-top:2px}
.transition-card button{border:0;background:var(--navy);color:#fff;border-radius:9px;padding:10px 12px;font-weight:800;cursor:pointer}

.map-card{padding:18px}
.map-header{display:flex;justify-content:space-between;align-items:end;gap:16px}
.map-header h2{margin:4px 0 0;font-size:1.7rem}
.map-tools{min-width:290px}
.legend{display:flex;gap:16px;flex-wrap:wrap;font-size:.78rem;color:#3f5067;margin-top:14px}
.legend span{display:flex;align-items:center;gap:6px}
.legend-you,.legend-room,.legend-stair,.legend-lift{width:13px;height:13px;border-radius:3px;display:inline-block}
.legend-you{border-radius:50%;background:var(--blue);box-shadow:0 0 0 3px rgba(20,103,232,.12)}
.legend-room{border:2px solid var(--navy);background:#fff}
.legend-stair{background:var(--stair);border:1px solid #ae8200}
.legend-lift{background:var(--lift);border:1px solid var(--blue)}
.legend-route{width:28px;height:4px;border-radius:99px;background:var(--blue);display:inline-block}
.map-stage{margin-top:12px;border-radius:12px;overflow:hidden;background:linear-gradient(#f9fbfd,#f7f9fc);border:1px solid #e4eaf1}
#map{display:block;width:100%;height:auto;min-height:455px}
.note{margin:9px 0 0;color:#728399;font-size:.72rem}

.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.info-card{padding:18px}.info-card h3{margin:0 0 15px}
.route-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.metric{display:flex;align-items:center;gap:12px;background:#f8fafc;border-radius:12px;padding:14px}
.metric-icon{font-size:1.65rem}.metric span{display:block;color:#73849b;font-size:.75rem}
.metric strong{display:block;margin-top:2px;font-size:1.35rem}
.instructions{list-style:none;margin:0;padding:0;display:grid;gap:9px;counter-reset:step}
.instructions li{counter-increment:step;display:grid;grid-template-columns:28px 1fr;align-items:start;gap:10px;line-height:1.4;padding:4px;border-radius:8px}
.instructions li::before{content:counter(step);width:24px;height:24px;border-radius:50%;background:var(--navy);color:#fff;display:grid;place-items:center;font-size:.72rem;font-weight:800}
.instructions li.floor-change-instruction{background:#fff7d8;font-weight:800}
.instructions li.floor-change-instruction::before{background:#b88400}
footer{text-align:center;padding:18px;color:#8191a5;font-size:.74rem}

.map-bg{fill:#f9fbfd}.top-strip{fill:#c9d5e1}.top-strip-line{stroke:#fff;stroke-width:1.5;stroke-dasharray:7 6}
.building-outline{fill:#fff;stroke:#8fa1b5;stroke-width:1.4}.inner-wall{stroke:#d7e0e9;stroke-width:1}
.room-box{fill:#e7f0dc;stroke:#cbd9bf;stroke-width:1}.room-box.selected{fill:#eef5ff;stroke:#1467e8;stroke-width:2.5}
.bottom-box{fill:#dfead4;stroke:#c9d8bc;stroke-width:1}.blue-block{fill:#2c7bdc}.yellow-block{fill:#ffd74e}
.sector-circle{fill:#fff;stroke:#2575d7;stroke-width:2}.sector-text{font-size:13px;font-weight:800;fill:#163761;text-anchor:middle}
.corridor-edge{stroke:#304966;stroke-width:3.3;stroke-linecap:round}.route-edge{stroke:#1467e8;stroke-width:7;stroke-linecap:round}
.route-room-link{stroke:#1467e8;stroke-width:5;stroke-linecap:round}
.junction{fill:#fff;stroke:#1d395e;stroke-width:2.2}.junction.route{fill:var(--blue);stroke:#fff;stroke-width:2}
.room-dot{fill:#fff;stroke:#1d395e;stroke-width:2}.room-dot.route{fill:var(--blue);stroke:#fff}
.you-dot{fill:var(--blue);stroke:#fff;stroke-width:3;filter:drop-shadow(0 2px 4px rgba(20,103,232,.25))}
.room-label{font-size:10px;fill:#24364f;text-anchor:middle;font-weight:800;pointer-events:none}
.small-label{font-size:10px;fill:#334963;text-anchor:middle;pointer-events:none}
.amenity{font-size:16px;fill:#1268d9}.map-title{font-size:18px;fill:#26364d;font-weight:800;text-anchor:middle}
.f1-corridor{fill:#f0f4f8;stroke:#d4dee9;stroke-width:1}
.facility-box{stroke-width:2}.facility-box.stair{fill:#ffd74e;stroke:#a87a00}.facility-box.lift{fill:#dcecff;stroke:#2c7bdc}
.facility.route .facility-box{stroke:#1467e8;stroke-width:4}
.facility-label{font-size:9px;fill:#24364f;text-anchor:middle;font-weight:900;pointer-events:none}
.change-box{stroke-width:1.5}.change-box.stair{fill:#fff2ae;stroke:#b88400}.change-box.lift{fill:#e7f2ff;stroke:#2470c9}
.change-label{font-size:11px;fill:#18324f;text-anchor:middle;font-weight:900}

@media(max-width:1100px){
 .control-card{grid-template-columns:1fr 1fr}
 .message{grid-column:1/-1}
}
@media(max-width:900px){
 .header-inner{padding:18px}.uni-brand{display:none}.page-shell{padding:0 10px 24px}
 .info-grid{grid-template-columns:1fr}.route-metrics{grid-template-columns:1fr}
 .legend{display:none}.map-header{align-items:stretch;flex-direction:column}.map-tools{min-width:0}
 #map{min-height:360px}h1{font-size:1.7rem}
 .transition-card{grid-template-columns:auto 1fr}.transition-card button{grid-column:1/-1}
}
@media(max-width:700px){
 .control-card{grid-template-columns:1fr}.message{grid-column:1}
}

/* Phase 3.2G — stacked multi-floor and orientation views */
.map-tools{display:grid;gap:10px;min-width:430px}
.map-view-row{display:grid;grid-template-columns:auto minmax(180px,1fr);gap:10px;align-items:end}
.tool-label{display:block;font-size:.82rem;font-weight:800;margin-bottom:6px}
.segmented{display:inline-flex;border:1px solid #cbd6e3;border-radius:10px;padding:3px;background:#f7f9fc;gap:2px}
.segmented button{border:0;background:transparent;color:#41556f;border-radius:7px;padding:8px 10px;font-weight:800;cursor:pointer;white-space:nowrap}
.segmented button.active{background:var(--navy);color:#fff;box-shadow:0 1px 4px rgba(16,40,77,.18)}
.orientation-picker select{padding:9px 11px}
.map-card.stacked-mode .single-floor-picker{opacity:.45;pointer-events:none}
.stacked-panel{margin-top:12px}
.stacked-intro{display:flex;justify-content:space-between;gap:18px;align-items:center;background:#f6f9fc;border:1px solid #e0e8f0;border-radius:12px;padding:11px 13px;color:#52667e;font-size:.78rem}
.stacked-intro strong{color:#213b5a;font-size:.88rem;white-space:nowrap}
.stacked-floors{display:flex;flex-direction:column;gap:0;margin-top:12px}
.stack-floor-card{border:1px solid #dce5ef;border-radius:14px;background:#fff;overflow:hidden;box-shadow:0 3px 12px rgba(18,40,77,.035);cursor:pointer;transition:box-shadow .15s,border-color .15s}
.stack-floor-card:hover{border-color:#a9c4e7;box-shadow:0 5px 18px rgba(20,103,232,.09)}
.stack-floor-card.route-floor{border-color:#a9c8ef}
.stack-floor-card.current-floor{box-shadow:0 0 0 2px rgba(20,103,232,.16)}
.stack-floor-head{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:9px 12px;background:#f8fafc;border-bottom:1px solid #e7edf4}
.stack-floor-head strong{font-size:.9rem}.stack-floor-head span{font-size:.7rem;color:#6c7d92;font-weight:800}
.stack-floor-map{background:#fbfcfe}
.stack-floor-map svg{display:block;width:100%;height:auto;max-height:250px}
.stack-transition{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;min-height:56px;color:#60738a}
.stack-transition::before,.stack-transition::after{content:"";height:1px;background:#d8e3ee}
.stack-transition-badge{display:flex;align-items:center;gap:8px;border:1px solid #d5e1ed;border-radius:999px;padding:7px 12px;background:#fff;font-size:.75rem;font-weight:900}
.stack-transition-badge.stair{background:#fff9de;border-color:#ead27e;color:#775a00}
.stack-transition-badge.lift{background:#eef6ff;border-color:#b9d5f4;color:#1b558f}
.stack-empty{padding:28px;text-align:center;color:#71839a;border:1px dashed #cdd9e6;border-radius:12px}
.stack-you{fill:var(--blue);stroke:#fff;stroke-width:4}
.stack-destination{fill:#fff;stroke:var(--blue);stroke-width:4}
.stack-route-edge{stroke:var(--blue);stroke-width:8;stroke-linecap:round}
.stack-base-edge{stroke:#a2b1c2;stroke-width:2.4;stroke-linecap:round;opacity:.55}
.stack-facility{stroke-width:3}
.orientation-note{font-size:.68rem;color:#7a8ba0}
@media(max-width:900px){.map-tools{min-width:0}.map-view-row{grid-template-columns:1fr}.stacked-intro{align-items:flex-start;flex-direction:column}.stack-floor-map svg{max-height:210px}}
@media(max-width:560px){.segmented{display:flex}.segmented button{flex:1}.stack-floor-map svg{max-height:180px}}

/* Phase 3.2G.2 — independent per-floor zoom/pan in stacked view */
.stack-floor-actions{display:flex;align-items:center;gap:6px}
.stack-floor-actions>span{margin-right:4px}
.stack-floor-actions button{
 border:1px solid #cfd9e5;background:#fff;color:#25425f;border-radius:7px;
 min-width:30px;height:28px;padding:0 8px;font-size:.75rem;font-weight:850;cursor:pointer
}
.stack-floor-actions button:hover{background:#eef4fb;border-color:#a9c4e7}
.stack-floor-actions .stack-open-btn{background:#10284d;color:#fff;border-color:#10284d}
.stack-floor-map{overflow:hidden;position:relative}
.stack-floor-map svg{cursor:default;user-select:none}
.stack-floor-map svg.is-panning{cursor:grabbing}
.stack-floor-card .stack-floor-map:after{
 content:"Zoom + then drag to pan";position:absolute;right:10px;bottom:7px;
 font-size:.62rem;font-weight:750;color:#8796a8;background:rgba(255,255,255,.84);
 padding:3px 6px;border-radius:6px;pointer-events:none
}
@media(max-width:700px){
 .stack-floor-head{align-items:flex-start}
 .stack-floor-actions{flex-wrap:wrap;justify-content:flex-end}
 .stack-floor-actions>span{width:100%;text-align:right}
}

/* Phase 3.5A — camera QR scanner */
.qr-input-row{grid-template-columns:1fr auto auto}
.scan-btn{background:#10284d;color:#fff;border-color:#10284d}
.scanner-modal{position:fixed;inset:0;background:rgba(8,23,44,.72);z-index:1000;display:grid;place-items:center;padding:18px}
.scanner-modal.hidden{display:none}
body.scanner-open{overflow:hidden}
.scanner-card{width:min(650px,100%);background:#fff;border-radius:18px;padding:18px;box-shadow:0 24px 70px rgba(0,0,0,.28)}
.scanner-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:12px}
.scanner-head h2{margin:5px 0}
.qr-reader{width:100%;min-height:280px;border-radius:12px;overflow:hidden;background:#111}
.scanner-message{margin:12px 0 4px;font-weight:750;color:#53667c}
.scanner-message.ok{color:#08764b}.scanner-message.error{color:#a12a2a}
.scanner-help{font-size:.78rem;color:#7c8ca0}
@media(max-width:700px){.qr-input-row{grid-template-columns:1fr 1fr}.qr-input-row input{grid-column:1/3}.scanner-card{padding:14px}.qr-reader{min-height:240px}}


/* Phase 3.7F — journey semantics */
.floor-step>div{display:flex;flex-direction:column;align-items:flex-start;line-height:1.05}
.floor-step small{display:block;margin-top:4px;color:#708198;font-size:.68rem;font-weight:700;white-space:nowrap}
.floor-step.campus-step{background:#f2f8f2;border-color:#b8d7bd;cursor:default}
.floor-step.campus-step span{background:#dff0e2;font-size:.9rem}
.floor-step.campus-step strong{color:#245f36}
.floor-step.campus-step small{color:#53725c}
@media(max-width:760px){.floor-step small{white-space:normal}.floor-step{padding:8px 10px}.floor-steps{gap:6px}}

/* 7DNav V1 — multi-building journey hierarchy */
.floor-steps{align-items:stretch;gap:10px}
.journey-building{border:1px solid #d7e2ef;border-radius:14px;background:#f9fbfd;padding:10px;min-width:220px}
.journey-building-head{display:flex;flex-direction:column;gap:2px;margin-bottom:9px;padding:0 2px}
.journey-building-head span{font-size:.62rem;font-weight:900;letter-spacing:.12em;color:#7a8ba0}
.journey-building-head strong{font-size:.88rem;color:#193b63}
.journey-building-floors{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.journey-building .floor-step{background:#fff}
.journey-campus{display:flex;align-items:center;gap:9px;align-self:center;border:1px solid #b8d7bd;background:#f2f8f2;border-radius:14px;padding:10px 13px;color:#245f36}
.journey-campus-icon{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#dff0e2}
.journey-campus>div{display:flex;flex-direction:column;line-height:1.1}
.journey-campus strong{font-size:.82rem}.journey-campus small{margin-top:4px;color:#53725c;font-size:.67rem;font-weight:700;white-space:nowrap}
.journey-major-arrow{font-style:normal;color:#71839a;align-self:center;font-size:1.1rem}
.stack-floor-title{display:flex;flex-direction:column;gap:2px}
.stack-floor-title small{font-size:.66rem!important;color:#56708d!important;font-weight:800;letter-spacing:.02em}
.stack-floor-title strong{font-size:.92rem}
.stack-transition-badge.campus{background:#f2f8f2;border-color:#b8d7bd;color:#245f36}
@media(max-width:760px){
 .floor-steps{display:flex;flex-direction:column}
 .journey-building{width:100%;min-width:0}
 .journey-building-floors{flex-direction:column;align-items:stretch}
 .journey-building-floors .floor-step{width:100%;justify-content:flex-start}
 .journey-building-floors .step-arrow{transform:rotate(90deg);align-self:center}
 .journey-major-arrow{transform:rotate(90deg)}
 .journey-campus{align-self:stretch}
 .journey-campus small{white-space:normal}
}

/* 7DNav V1 — 2D stabilization polish: hierarchy + vertical continuity */
.journey-building .floor-step small{
  font-size:.61rem;
  font-weight:650;
  color:#91a0b2;
  letter-spacing:.01em;
  opacity:.86;
}
.journey-building .floor-step strong{color:#24384f}

/* Make the route between stacked floors read as one continuous vertical journey. */
.stack-transition{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-height:68px;
  position:relative;
  color:#60738a;
}
.stack-transition::before,.stack-transition::after{content:none}
.stack-transition>span{
  display:block;
  width:3px;
  height:13px;
  border-radius:999px;
  background:#b8c8da;
}
.stack-transition-badge{
  position:relative;
  z-index:1;
  box-shadow:0 2px 8px rgba(18,40,77,.045);
}
.stack-transition-badge.stair~span,
.stack-transition:has(.stack-transition-badge.stair)>span{background:#d2b743}
.stack-transition-badge.lift~span,
.stack-transition:has(.stack-transition-badge.lift)>span{background:#77aada}
.stack-transition-badge.campus~span,
.stack-transition:has(.stack-transition-badge.campus)>span{background:#8fbe98}

@media(max-width:760px){
  .journey-building .floor-step small{font-size:.64rem}
  .stack-transition{min-height:62px}
}
