/* Shared guide-layout.css and guide-brand.css provide the User Guide design system. */
main,footer{max-width:1120px}.topline{flex-wrap:nowrap}.topline-tools{display:flex;align-items:center;gap:28px}.brand{flex-shrink:0}.brand-mark{width:auto;filter:drop-shadow(0 0 10px #c9d1ff40)}.brand-wordmark{width:auto}.setup-hero{margin-bottom:36px}.setup-hero h1{font-size:clamp(36px,5vw,58px)}.intro{max-width:760px;margin-bottom:0}.panel{padding:30px;margin:20px 0;border:1px solid var(--border);border-radius:20px;background:var(--card)}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.panel-heading h2{font-size:23px;margin:0;letter-spacing:-.025em}.panel-heading .badge{font-size:10px;overflow-wrap:anywhere;max-width:100%}.actions{display:flex;gap:12px;flex-wrap:wrap;margin:24px 0}button,select,input{font:inherit;color:var(--text);border:1px solid var(--border);border-radius:8px;padding:11px 14px;background:var(--bg)}button{cursor:pointer;font-weight:500;background:transparent;transition:border-color .15s,background .15s}button:hover:enabled{border-color:var(--accent);background:#a78bfa0a}button:disabled{opacity:.45;cursor:default}#connect,#preview,#save-settings,#prepare-binding{background:#a78bfa18;border-color:#a78bfa66;color:#d8cbff}button:focus-visible,select:focus-visible,input:focus-visible,a:focus-visible{outline:2px solid var(--accent);outline-offset:4px}.muted,.foot{font-size:13px;color:var(--muted)}#status{min-height:25px}#status[data-error=true],#settings-status[data-error=true],#room-status[data-error=true]{color:#ffb6a8}dl{display:grid;grid-template-columns:minmax(110px,1fr) minmax(0,2fr);gap:0 24px}dt,dd{padding:12px 0;margin:0;border-bottom:1px solid var(--border);overflow-wrap:anywhere}dt{font-weight:400;color:var(--muted)}dd{font-family:var(--font-mono);color:var(--text)}.foot{display:flex;flex-direction:column;gap:12px;margin-top:32px}fieldset{border:0;padding:0;margin:0;min-width:0}legend,h3{font-size:17px;font-weight:500;margin:24px 0 12px}label{display:flex;flex-direction:column;gap:8px;margin:18px 0;font-size:14px}input{width:100%;min-width:0}label select{width:100%;min-width:0}.check{flex-direction:row;align-items:flex-start;gap:10px}.check input{width:18px;height:18px;flex-shrink:0;margin-top:3px;accent-color:var(--accent)}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 22px}.form-grid label{min-width:0}hr{border:0;border-top:1px solid var(--border);margin:30px 0}.notice{padding:16px 20px;border-left:3px solid #f97316;background:#f973160a;border-radius:0 8px 8px 0;color:#e8bc96;font-size:13px}#change-list{padding-left:22px;overflow-wrap:anywhere}#settings-status,#room-status{font-weight:500;color:#7bdca0;overflow-wrap:anywhere}.language-switch{position:relative;display:flex;border:1px solid var(--border);border-radius:8px;padding:3px;gap:3px}.language-switch button{font:500 11px/1.5 var(--font-mono);padding:6px 10px;border:1px solid transparent;border-radius:5px;color:var(--muted)}.language-switch button[aria-pressed=true]{background:#a78bfa18;color:#d8cbff;border-color:#a78bfa40}.language-native{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;pointer-events:none;padding:0;border:0}[hidden]{display:none!important}
@media(max-width:680px){.panel{padding:24px}.topline-tools{gap:14px}.brand{gap:8px}.brand-wordmark{height:15px}.brand-mark{height:24px}.panel-heading h2{font-size:21px}}
@media(max-width:520px){.topline{gap:12px}.topline-tools{gap:10px}.topline-tools .guide-back{font-size:0;gap:0}.topline-tools .guide-back::before{width:18px;height:18px}.language-switch button{padding:6px 8px}.panel{padding:20px}.form-grid{grid-template-columns:1fr}dl{grid-template-columns:1fr;gap:0}dt{padding-bottom:0;border:0}dd{padding-top:3px}.actions button{width:100%}}
@media(prefers-reduced-motion:reduce){button{transition:none}}

.setup-hero{position:relative;isolation:isolate;padding:36px 32px 40px;border-radius:20px;overflow:hidden;background:var(--card);border:1px solid var(--border)}
.setup-hero::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background-image:var(--topographic-background,none);background-size:cover;background-position:65% 45%;opacity:.8;mask-image:linear-gradient(110deg,transparent 5%,#000 70%)}
.setup-hero .intro{max-width:680px}.setup-hero h1{margin-top:18px}
@media(max-width:680px){.setup-hero{padding:28px 24px}.setup-hero::before{opacity:.5}}
/* Open page composition: contours belong to the header, not another card. */
.setup-hero{padding:28px 0 36px;border:0;border-radius:0;background:transparent;overflow:visible}
.setup-hero::before{inset:-20px -24px -8px;opacity:.65;mask-image:linear-gradient(to bottom,#000 45%,transparent 100%);background-position:75% 45%}
.panel{padding:30px 0;margin:0;border:0;border-top:1px solid var(--border);border-radius:0;background:transparent}
.setup-hero{margin-bottom:0}.foot{padding-top:24px;border-top:1px solid var(--border)}
@media(max-width:680px){.setup-hero{padding:24px 0 30px}.setup-hero::before{inset:-12px 0 0;opacity:.35}.panel{padding:26px 0}}

.foot{flex-direction:row;align-items:center;justify-content:space-between;gap:16px 32px;margin:8px 0 0;padding:24px 0;flex-wrap:wrap}.foot .recovery-link{font-size:11px;color:var(--guide-lavender);max-width:100%}.recovery-link::before{transform:rotate(180deg)}.power-note{font-size:12px;line-height:1.6;color:var(--muted);max-width:380px}.foot .recovery-link:hover{color:#e1e5ff}@media(max-width:680px){.foot{align-items:flex-start;flex-direction:column;gap:8px}.power-note{padding-left:23px}}

.connection-panel,#room-panel{padding:30px;margin:0 0 28px;background:var(--card);border:1px solid var(--border);border-radius:20px}@media(max-width:680px){.connection-panel,#room-panel{padding:24px}}@media(max-width:520px){.connection-panel,#room-panel{padding:20px}}

/* All functional sections retain their cards; only the page hero stays open. */
.panel{padding:30px;margin:20px 0;border:1px solid var(--border);border-radius:20px;background:var(--card)}
@media(max-width:680px){.panel{padding:24px}}@media(max-width:520px){.panel{padding:20px}}

.gateway-setup footer{position:relative;isolation:isolate}.gateway-setup footer::before{content:'';position:absolute;inset:-150px 0 -24px;z-index:-1;pointer-events:none;background-image:var(--topographic-background,none);background-size:cover;background-position:30% 80%;opacity:.55;mask-image:linear-gradient(to bottom,transparent,#000 85%)}@media(max-width:680px){.gateway-setup footer::before{opacity:.35}}
/* Extend hero contours behind navigation and fade toward both page edges. */
.setup-hero::before{inset:-145px -24px -8px;mask-image:linear-gradient(to bottom,transparent 0%,#000 30%,#000 65%,transparent 100%)}
@media(max-width:680px){.setup-hero::before{inset:-120px 0 0;mask-image:linear-gradient(to bottom,transparent 0%,#000 32%,#000 65%,transparent 100%)}}
/* Softer, wider fade around the header contours. */
.setup-hero::before{opacity:.45;mask-image:linear-gradient(to bottom,transparent 0%,#0003 22%,#0009 44%,#0008 58%,#0003 78%,transparent 100%)}
@media(max-width:680px){.setup-hero::before{opacity:.3}}
/* Keep the contours legible while retaining soft edges. */
.setup-hero::before{opacity:.6;mask-image:linear-gradient(to bottom,transparent 0%,#0006 18%,#000 38%,#000 60%,#0006 82%,transparent 100%)}
@media(max-width:680px){.setup-hero::before{opacity:.4}}

#factory-status{font-weight:500;color:var(--guide-lavender);text-align:center}#factory-status[data-error=true],#backup-status[data-error=true]{color:#ffb6a8}#factory-progress{display:block;width:100%;height:10px;accent-color:var(--accent);margin:18px 0}#factory-install{background:#f9731618;border-color:#f9731670;color:#ffbe8e}#factory-details dd{font-size:13px}#backup-panel h2{font-size:23px}#backup-status{color:var(--muted)}

.setup-modes{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 24px;padding-bottom:18px;border-bottom:1px solid var(--border)}.setup-modes button{padding:10px 18px}.setup-modes button[aria-pressed=true],#backup-panel button[aria-pressed=true]{color:#d8cbff;background:#a78bfa18;border-color:#a78bfa66}body[data-setup-mode=settings] #factory-panel,body[data-setup-mode=firmware] [data-settings-section]{display:none!important}

.backup-location{margin:20px 0;padding:16px 0;border-top:1px solid var(--border)}.backup-location p{margin:0 0 10px;max-width:760px}.backup-location button{font-size:13px;padding:8px 12px}

.secret-field{position:relative;display:block}.secret-field input{padding-right:52px}.secret-eye{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:40px;height:40px;display:grid;place-items:center;padding:8px;border:0;background:transparent;color:var(--muted)}.secret-eye svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.secret-eye .eye-slash{display:none}.secret-eye[aria-pressed=true] .eye-slash{display:block}.secret-eye:hover:enabled{background:#a78bfa12;color:var(--guide-lavender)}

/* Room configuration belongs to the USB device, rather than a separate card. */
#device-panel #room-panel{margin:28px 0 0;padding:24px 0 0;border:0;border-top:1px solid var(--border);border-radius:0;background:transparent}
/* Guided bento flow; controllers keep ownership of operation locks and confirmations. */
.wizard-paths{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:24px 0}.wizard-paths button{text-align:left;padding:24px;border-radius:14px;display:flex;flex-direction:column;gap:10px;min-height:150px;background:#a78bfa06}.wizard-paths strong{font-size:18px;color:var(--guide-lavender)}.wizard-paths span{font-size:14px;color:var(--muted);font-weight:400}.wizard-navigation{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:24px 0}.wizard-navigation p{flex:1}.wizard-navigation #wizard-next{background:#a78bfa18;border-color:#a78bfa66}#wizard-progress{display:flex;flex-wrap:wrap;gap:8px 18px;margin:12px 0 24px;font-size:12px;color:var(--muted)}#wizard-progress [aria-current]{color:var(--guide-lavender)}#wizard-heading{margin:24px 0}#wizard-heading h2{margin:14px 0 8px}.wizard-view-switch button{font-size:12px;border:0;padding:6px 0;color:var(--muted)}
body:not([data-wizard-step=all]) .setup-modes{display:none}
body[data-wizard-step=start] .connection-panel,body[data-wizard-step=start] #device-panel,body[data-wizard-step=start] #settings-panel,body[data-wizard-step=start] #backup-panel,body[data-wizard-step=start] #factory-panel{display:none!important}
body:not([data-wizard-step=all]):not([data-wizard-step=connect]) .connection-panel{display:none!important}
body:not([data-wizard-step=all]):not([data-wizard-step=connect]):not([data-wizard-step=room]):not([data-wizard-step=done]) #device-panel{display:none!important}
body:not([data-wizard-step=all]):not([data-wizard-step=room]):not([data-wizard-step=done]) #room-panel{display:none!important}
body:not([data-wizard-step=all]):not([data-wizard-step=node]):not([data-wizard-step=wifi]):not([data-wizard-step=radio]):not([data-wizard-step=channel]):not([data-wizard-step=review]):not([data-wizard-step=room]) #settings-panel{display:none!important}
body:not([data-wizard-step=all]):not([data-wizard-step=connect]) #backup-panel{display:none!important}
body:not([data-wizard-step=all]):not([data-wizard-step=firmware]) #factory-panel{display:none!important}
body:not([data-wizard-step=all]) #settings-panel>.panel-heading,body:not([data-wizard-step=all]) #settings-panel>[data-i18n=settingsIntro]{display:none}
body:not([data-wizard-step=all]) [data-wizard-group]{display:none}
body[data-wizard-step=wifi] [data-wizard-group=wifi],body[data-wizard-step=radio] [data-wizard-group=radio],body[data-wizard-step=channel] [data-wizard-group=channel],body[data-wizard-step=review] [data-wizard-group=review]{display:block}
body:not([data-wizard-step=all]) [data-wizard-group] hr{display:none}
body[data-wizard-step=room] #settings-fields{display:none}
@media(max-width:600px){.wizard-paths{grid-template-columns:1fr}.wizard-paths button{min-height:0;padding:20px}.wizard-navigation{flex-wrap:wrap}.wizard-navigation p{order:3;flex-basis:100%;margin:0}#wizard-progress{gap:6px 12px;font-size:11px}}

.channel-option{border-top:1px solid var(--border);padding:16px 0}.channel-option summary{cursor:pointer;color:var(--guide-lavender);font-weight:500}.channel-option[open] summary{margin-bottom:18px}body:not([data-wizard-step=all]):not([data-wizard-step=start]) .setup-hero{display:none}

body[data-wizard-step=all] #wizard-channel-current{display:none}

/* Contours remain visible in task cards and each guided step after the hero is hidden. */
.wizard-paths button{position:relative;isolation:isolate;overflow:hidden}
.wizard-paths button::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background-image:var(--topographic-background,none);background-size:800px auto;background-position:75% 45%;opacity:.42;mask-image:linear-gradient(110deg,transparent 5%,#0005 45%,#000 100%)}
.wizard-paths button:nth-child(2)::before{background-position:25% 70%}.wizard-paths button:nth-child(3)::before{background-position:70% 15%}.wizard-paths button:nth-child(4)::before{background-position:10% 30%}
#wizard-heading{position:relative;isolation:isolate}
#wizard-heading::before{content:'';position:absolute;inset:-170px -24px -24px;z-index:-1;pointer-events:none;background-image:var(--topographic-background,none);background-size:cover;background-position:75% 45%;opacity:.6;mask-image:linear-gradient(to bottom,transparent 0%,#0006 18%,#000 38%,#000 60%,#0006 82%,transparent 100%)}
@media(max-width:680px){#wizard-heading::before{inset:-145px 0 -24px;opacity:.4}.wizard-paths button::before{opacity:.32}}

.topline-tools .wizard-start{font:500 11px/1.4 var(--font-mono);padding:8px 12px;color:var(--guide-lavender);max-width:220px;text-align:center}
@media(max-width:520px){.topline:has(.wizard-start:not([hidden])){flex-wrap:wrap}.topline:has(.wizard-start:not([hidden])) .topline-tools{margin-left:auto;flex-wrap:wrap;justify-content:flex-end}.topline-tools .wizard-start{font-size:10px;max-width:180px;padding:7px 9px}}

/* Compact connected step navigation, with keyboard-accessible visited steps. */
#wizard-progress{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:0;margin:24px 0 30px;padding:10px 0}
#wizard-progress .wizard-step{position:relative;display:flex;flex-direction:column;align-items:center;gap:9px;min-width:0;padding:0 4px;border:0;border-radius:0;background:none;opacity:1;font-size:12px;line-height:1.3;letter-spacing:.02em;color:var(--muted)}
.wizard-step:not(:last-child)::after{content:'';position:absolute;top:17px;left:calc(50% + 24px);width:calc(100% - 48px);height:1px;background:var(--border);pointer-events:none}
.wizard-step-number{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--border);border-radius:50%;background:var(--bg);font:500 12px/1 var(--font-mono);transition:background .18s,border-color .18s,box-shadow .18s}
#wizard-progress .wizard-step[aria-current=step]{color:var(--guide-lavender);font-weight:700}.wizard-step[aria-current=step] .wizard-step-number{background:#a78bfa25;border-color:#a78bfab0;box-shadow:0 0 0 5px #a78bfa0c,0 0 22px #a78bfa14}
#wizard-progress .wizard-step.is-visited{color:#c3c8dd}.wizard-step.is-visited .wizard-step-number{border-color:#a78bfa65;background:#a78bfa0e}.wizard-step.is-visited::after{background:#a78bfa50}
#wizard-progress .wizard-step:disabled:not([aria-current]){color:#7c8391;cursor:default}#wizard-progress .wizard-step:hover:enabled .wizard-step-number{border-color:var(--accent);background:#a78bfa20}#wizard-progress .wizard-step:focus-visible{outline-offset:6px;border-radius:8px}
@media(max-width:600px){#wizard-progress{margin:18px 0 24px}#wizard-progress .wizard-step{font-size:9px;gap:8px;padding:0 1px}.wizard-step-number{width:28px;height:28px;font-size:10px}.wizard-step:not(:last-child)::after{top:13px;left:calc(50% + 17px);width:calc(100% - 34px)}}
@media(prefers-reduced-motion:reduce){.wizard-step-number{transition:none}}

/* A viewport-wide contour layer avoids clipping at the content column edges. */
body.gateway-setup{position:relative;isolation:isolate}
body.gateway-setup::before{content:'';position:fixed;inset:0;z-index:-1;pointer-events:none;background-image:var(--topographic-background,none);background-size:cover;background-position:center top;opacity:.58;mask-image:linear-gradient(to bottom,#000 0%,#000b 28%,#0003 55%,#0005 75%,#000c 100%)}
.gateway-setup .setup-hero::before,.gateway-setup #wizard-heading::before,.gateway-setup footer::before{display:none}
.wizard-paths button::before{opacity:.85;mask-image:linear-gradient(110deg,#0003 0%,#0009 45%,#000 100%)}
@media(max-width:680px){body.gateway-setup::before{opacity:.42}.wizard-paths button::before{opacity:.68}}

.topline-tools #wizard-start{display:inline-flex;align-items:center;gap:9px;width:fit-content;max-width:none;padding:7px 0;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--guide-muted);font:400 11px/1.5 var(--font-mono);letter-spacing:.02em}
.topline-tools #wizard-start:hover:enabled{background:transparent;border-color:transparent;color:var(--guide-lavender)}
.topline-tools #wizard-start::before{width:14px;height:14px;flex:0 0 14px}
@media(max-width:520px){.topline-tools #wizard-start{font-size:10px}}

.firmware-release-label{font:500 16px/1.6 var(--font-mono);color:var(--guide-lavender);overflow-wrap:anywhere}.backup-location summary{cursor:pointer;color:var(--muted);font-size:13px}.backup-location[open] summary{margin-bottom:12px}

#factory-prepare{background:#a78bfa18;border-color:#a78bfa66;color:#d8cbff}

#room-device-summary{display:none}
body[data-wizard-step=room] #room-device-summary{display:block;font-family:var(--font-mono);margin-top:0}
body[data-wizard-step=room] #device-panel>.panel-heading,body[data-wizard-step=room] #device-details,body[data-wizard-step=room] #device-panel>[data-i18n=profileNote]{display:none}

body[data-wizard-step=done] #device-panel{display:none!important}

body[data-wizard-step=room] #settings-panel[data-has-feedback=false]{display:none!important}
.room-auth-state{font-size:13px;color:var(--guide-lavender)}.manual-room{padding:18px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);margin:18px 0}.manual-room summary{cursor:pointer;color:var(--guide-lavender);font-weight:500}

body[data-wizard-step=node] [data-wizard-group=node]{display:block}

#node-position-map{height:360px;min-height:280px;width:100%;border:1px solid var(--border);border-radius:12px;overflow:hidden;margin:14px 0}#node-map-panel{margin:16px 0}#node-position-map button{padding:0}#node-position-map .maplibregl-ctrl-attrib,#node-position-map .maptiler-ctrl-attrib{color:#222}#node-map-status{min-height:20px}
