/* Reserve a visible preview area above the guided tour, including on phones. */
body.demo-tour-open { padding-bottom:var(--demo-tour-space,18rem); }
.demo-tour { background:rgba(1,4,5,.76); inset:0; pointer-events:auto; position:fixed; z-index:110; }
.demo-tour-card { background:#111819; border:1px solid rgba(130,222,215,.7); box-shadow:0 1.5rem 4rem rgba(0,0,0,.7); pointer-events:auto; position:fixed; transform:translateX(-50%); }
#demo-tour-card { border-radius:.7rem; color:var(--paper); inset:auto auto max(.6rem,env(safe-area-inset-bottom)) 50%; margin:0; max-height:48dvh; overflow:auto; padding:1rem 1.2rem; width:min(38rem,calc(100vw - 1.2rem)); max-width:none; }
#demo-tour-card:popover-open { display:grid; grid-template-rows:auto auto minmax(0,1fr) auto; }
#demo-tour-copy { overflow:auto; }
#demo-tour-card h2 { font-size:clamp(1.2rem,3vw,1.55rem); margin:.2rem 0 .55rem; }
#demo-tour-card p { color:#d6cdbd; font-size:.88rem; line-height:1.5; margin:.35rem 0 1rem; }
#demo-tour-card .demo-tour-step { font-size:.65rem; margin:0 0 .35rem; }
.demo-tour-step { color:#82ded7; font-weight:800; letter-spacing:.15em; text-transform:uppercase; }
.demo-tour-actions { display:flex; flex-wrap:wrap; gap:.55rem; justify-content:space-between; }
.demo-tour-actions .button { flex:1; min-height:44px; }
.demo-tour-actions .button.secondary { background:transparent; border:1px solid var(--line); color:var(--paper); }
.demo-tour-actions .button:disabled { opacity:.4; cursor:default; }
.demo-tour-target { box-shadow:0 0 0 3px #82ded7,0 0 2.2rem rgba(130,222,215,.65) !important; position:relative; z-index:111 !important; }
body.demo-tour-open #workspace-scrim { display:none; }
body.demo-tour-open #people-panel { backdrop-filter:none; }
body.demo-tour-open #conversation-panel.chat-open,
body.demo-tour-open #partner-channel.channel-open,
body.demo-tour-open #case-archives[open],
body.demo-tour-open #chief-dialog[open] {
    bottom:auto; box-sizing:border-box; height:calc(100dvh - var(--demo-tour-space) - 1.2rem); inset:.6rem auto auto 50%; margin:0;
    max-height:calc(100dvh - var(--demo-tour-space) - 1.2rem); min-height:0; max-width:calc(100vw - 1.2rem); overflow:auto; position:fixed; transform:translateX(-50%); z-index:111 !important;
}
body.demo-tour-open #conversation-panel .messages { min-height:2rem; flex:1 0 2rem; }
body.demo-tour-open #conversation-panel .panel-head,
body.demo-tour-open #conversation-panel .question-form { flex-shrink:0; }
body.demo-tour-open #chief-dialog .chief-dialog-card { height:auto; min-height:100%; }
body.demo-tour-open #chief-form { gap:.3rem; }
body.demo-tour-open #chief-form label { font-size:.63rem; line-height:1.4; }
body.demo-tour-open #chief-form select { min-height:2rem; padding:.3rem; }
body.demo-tour-open #chief-form textarea { min-height:3rem; height:3rem; padding:.4rem; }
body.demo-tour-open #nora-companion { bottom:calc(var(--demo-tour-space) + .6rem); }
body.demo-tour-open:is([data-demo-tour-window="conversation"],[data-demo-tour-window="archives"],[data-demo-tour-window="channel"],[data-demo-tour-window="chief"]) #nora-companion { visibility:hidden; }
body[data-demo-tour-window="nora"] #nora-companion { inset:.6rem auto auto 50%; transform:translateX(-50%); height:calc(100dvh - var(--demo-tour-space) - 1.2rem); }
body[data-demo-tour-window="nora"] .nora-dock { display:none; }
body[data-demo-tour-window="nora"] .nora-panel { display:block; height:100%; margin:0; overflow:auto; }
body[data-demo-tour-window="nora"] .nora-workspace { overflow:visible; }
body[data-demo-tour-window="nora"] .nora-panel[hidden] { display:none; }
@media(max-width:600px) {
    #demo-tour-card { padding:.75rem .85rem; }
    #demo-tour-card p { font-size:.8rem; margin-bottom:.7rem; }
    .demo-tour-actions { gap:.4rem; }
    .demo-tour-actions .button { font-size:.6rem; letter-spacing:.06em; padding:.6rem; }
}
@media(max-height:500px) and (min-width:700px) {
    body.demo-tour-open { --demo-tour-side:22rem; padding-bottom:0; }
    #demo-tour-card { inset:.6rem .6rem auto auto; height:calc(100dvh - 1.2rem); max-height:none; transform:none; width:var(--demo-tour-side); padding:.8rem; }
    #demo-tour-card p { font-size:.82rem; }
    body.demo-tour-open #conversation-panel.chat-open,
    body.demo-tour-open #partner-channel.channel-open,
    body.demo-tour-open #case-archives[open],
    body.demo-tour-open #chief-dialog[open],
    body.demo-tour-open #nora-companion {
        inset:.6rem auto auto .6rem; height:calc(100dvh - 1.2rem); max-height:calc(100dvh - 1.2rem); transform:none; width:calc(100vw - var(--demo-tour-side) - 1.8rem); max-width:none;
    }
    body.demo-tour-open #nora-companion:has(.nora-panel[hidden]) { height:auto; }
    body[data-demo-tour-window=""] .workspace-overview > .demo-tour-target,
    body[data-demo-tour-window=""] #people.demo-tour-target { background:#111819; box-sizing:border-box; left:.6rem; max-height:calc(100dvh - 1.2rem); overflow:auto; padding:1rem; position:fixed; top:.6rem; width:calc(100vw - var(--demo-tour-side) - 1.8rem); }
}
