  /* ── Constellation preloader ──────────────────────────────────────── */
  #const-preloader {
    position: absolute; inset: 0; z-index: 500;
    display: flex; align-items: center; justify-content: center;
    background: #0d0d1a;
    transition: opacity .5s ease;
  }
  #const-preloader.fade-out {
    opacity: 0; pointer-events: none;
  }
  .const-preloader-inner {
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
  }
  .const-preloader-spinner {
    width: 48px; height: 48px; color: rgba(255,255,255,.5);
  }
  .const-preloader-text {
    font-size: .88rem; color: rgba(255,255,255,.45); letter-spacing: .02em;
  }

  .res-wrap   { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
  .res-header { display:flex; align-items:baseline; gap:1rem; margin-bottom:1.25rem; flex-wrap:wrap; }
  .res-header h1 { font-size:1.3rem; }
  .back-link  { font-size:.85rem; color:#4a90d9; text-decoration:none; }
  .back-link:hover { text-decoration:underline; }

  /* ── Gaze controls ──────────────────────────────────────────────────── */
  #gaze-controls {
    display: flex; align-items: center; gap: .45rem;
    margin-bottom: .3rem; margin-top: 1.5em; flex-wrap: wrap; font-size: .82rem;
  }
  .gaze-label { color: #555; font-weight: 600; }
  .gaze-btn, .height-btn {
    padding: .22rem .65rem; border-radius: 0; font-size: .82rem;
    background: #f0f0f0; color: #555; border: 1px solid #ddd;
    cursor: pointer; font-family: inherit; transition: background .12s, color .12s;
  }
  .gaze-btn:hover, .height-btn:hover { background: #e4e4e4; color: #222; }
  .gaze-btn.active, .height-btn.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }
  .gaze-key-hint   { font-size: .73rem; color: #bbb; }
  .gaze-thresholds { font-size: .73rem; color: #ccc; }
  .gaze-desc {
    font-size: .75rem; color: #aaa; margin-bottom: .4rem;
    font-style: italic;
  }
  #height-controls {
    display: flex; align-items: center; gap: .45rem;
    margin-bottom: .3rem; flex-wrap: wrap; font-size: .82rem;
  }
  .height-desc {
    font-size: .75rem; color: #aaa; margin-bottom: .75rem;
    font-style: italic;
  }

  /* ── Canvas wrapper ─────────────────────────────────────────────────── */
  #const-wrap {
    position: relative; width: 100%; height: 580px;
    background: #f5f0ea; border-radius: 0; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.10); cursor: crosshair;
  }
  #const-wrap canvas { display: block; }
  #const-wrap:fullscreen          { height: 100vh !important; border-radius: 0; }
  #const-wrap:-webkit-full-screen { height: 100vh !important; border-radius: 0; }
  #const-wrap:-moz-full-screen    { height: 100vh !important; border-radius: 0; }


  /* ── WebGL context lost overlay ─────────────────────────────────────────── */
  #const-ctx-lost {
    display: none; position: absolute; inset: 0; z-index: 25;
    align-items: center; justify-content: center;
    background: rgba(245,240,234,.92); backdrop-filter: blur(4px);
  }
  #const-ctx-lost.visible { display: flex; }
  .ctx-lost-box {
    text-align: center; padding: 2rem 2.5rem;
    background: rgba(255,255,255,.97); border-radius: 0;
    box-shadow: 0 6px 28px rgba(0,0,0,.15); max-width: 320px;
  }
  .ctx-lost-box h2  { font-size: 1.1rem; margin: 0 0 .5rem; color: #333; }
  .ctx-lost-box p   { font-size: .85rem; color: #888; margin: .3rem 0; line-height: 1.5; }
  .ctx-lost-actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1.2rem; flex-wrap: wrap; }
  .ctx-lost-retry {
    padding: .5rem 1.3rem; background: #4a90d9; color: #fff;
    border: none; border-radius: 0; font-size: .9rem; cursor: pointer;
    font-family: inherit; transition: background .15s;
  }
  .ctx-lost-retry:hover { background: #3578c0; }
  .ctx-lost-2d {
    padding: .5rem 1.3rem; background: #f0f0f0; color: #444;
    border: 1px solid #ddd; border-radius: 0; font-size: .9rem;
    cursor: pointer; font-family: inherit; text-decoration: none;
    display: inline-block; transition: background .15s;
  }
  .ctx-lost-2d:hover { background: #e4e4e4; }

  /* ── Výkonnostní varování (FPS < 24) ────────────────────────────────────── */
  #const-perf-warn {
    display: none; position: absolute; bottom: .7rem; left: 50%;
    transform: translateX(-50%); z-index: 18;
    background: rgba(0,0,0,.60); color: #fff;
    font-size: .76rem; padding: .3rem .85rem; border-radius: 0;
    white-space: nowrap; pointer-events: auto;
  }
  #const-perf-warn a { color: #7ec8f5; }

  /* ── Mode chip (Desktop / Mobile) ──────────────────────────────────────── */
  #const-mode-chip {
    position: absolute; bottom: .55rem; right: 3em; z-index: 18;
    font-size: .65rem; padding: .18rem .5rem; border-radius: 0;
    background: rgba(0,0,0,.35); color: rgba(255,255,255,.7);
    pointer-events: none; user-select: none;
  }

  /* ── Zkusit plné 3D / reset na Mobile ────────────────────────────────────── */
  #const-quality-toggle {
    display: none; position: absolute; top: .5rem; left: .5rem; z-index: 18;
    font-size: .7rem; padding: .22rem .6rem; border-radius: 0;
    background: rgba(0,0,0,.40); color: rgba(255,255,255,.80);
    border: 1px solid rgba(255,255,255,.18); cursor: pointer;
    font-family: inherit;
  }
  #const-quality-toggle:hover { background: rgba(0,0,0,.60); color: #fff; }

  /* ── Fullscreen toggle button (uprostřed nahoře) ──────────────────────── */
  #const-fs-toggle {
    position: absolute; top: .6rem; left: 50%; transform: translateX(-50%); z-index: 17;
    display: flex; align-items: center; gap: .32rem;
    padding: .38rem .78rem; border-radius: 0;
    background: rgba(255,255,255,.88); backdrop-filter: blur(6px);
    border: 1.5px solid rgba(0,0,0,.11); color: #333;
    font-size: .82rem; font-family: inherit; cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
    user-select: none; line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,.10);
  }
  #const-fs-toggle:hover { background: #fff; color: #111; border-color: rgba(0,0,0,.22); }
  #const-fs-toggle .fs-icon { font-size: 1.05rem; }
  #const-wrap:fullscreen          #const-fs-toggle,
  #const-wrap:-webkit-full-screen #const-fs-toggle { left: 50%; transform: translateX(-50%); top: 1rem; }

  /* ── Responzivní výška canvasu na mobilu ────────────────────────────────── */
  @media (max-width: 540px) {
    #const-wrap { height: 58svh; min-height: 320px; max-height: 520px; }
  }


  /* ── Locked-view indicator ──────────────────────────────────────────── */
  #const-lock-badge {
    display: none; position: absolute; top: .65rem; left: 50%; transform: translateX(-50%);
    z-index: 16; background: rgba(74,144,217,.85); color: #fff;
    border-radius: 0; padding: .25rem .75rem; font-size: .78rem;
    pointer-events: none; white-space: nowrap;
  }

  /* ── Proximity info panel ───────────────────────────────────────────── */
  #const-info {
    position: absolute; bottom: 1.2rem; left: 1.2rem;
    max-width: 220px; display: none; z-index: 15; pointer-events: none;
    background: rgba(255,255,255,.92); border-radius: 0;
    padding: .65rem .9rem; font-size: .8rem; line-height: 1.75;
    box-shadow: 0 2px 12px rgba(0,0,0,.13); border-left: 3px solid #4a90d9;
  }
  #const-info strong { display:block; font-size:.95rem; margin-bottom:.1rem; color:#1a1a2e; }
  #const-info .type-tag {
    display: inline-block; font-size:.72rem; font-weight:700;
    padding: .1rem .45rem; border-radius: 0; margin-bottom:.2rem; letter-spacing: .03em;
  }
  .type-pos { background:#d4edda; color:#155724; }
  .type-neg { background:#f8d7da; color:#721c24; }
  .type-neu { background:#e2e3e5; color:#383d41; }
  #const-info .ci-pill {
    display:inline-block; background:#e8f0fb; border-radius: 0;
    padding:.1rem .4rem; font-size:.74rem; color:#2a5fa8; margin-top:.15rem;
  }
  .const-gaze-tip {
    margin-top: .3rem; font-style: italic; font-size: .75rem; color: #555;
    border-top: 1px solid #eee; padding-top: .3rem;
  }

  /* ── Key hints ──────────────────────────────────────────────────────── */
  #const-keys {
    position: absolute; bottom: 1.2rem; right: .9rem;
    display: none; z-index: 15; pointer-events: none;
    font-size: .76rem; color: rgba(0,0,0,.72);
    line-height: 2; text-align: right;
    background: rgba(255,255,255,.78); border-radius: 0;
    padding: .45rem .8rem; box-shadow: 0 1px 6px rgba(0,0,0,.09);
  }
  #const-keys .key-esc { font-weight: 700; color: #c0392b; }
  #const-keys .key-l   { color: #4a90d9; }
  #const-keys .eye-h   { opacity: .55; font-size: .72rem; }

  /* ── View switcher pod canvasem ─────────────────────────────────────── */
  .view-switcher-above { float: right; text-align: right; margin-bottom: .9rem; }

  /* ── CSS2D labels ───────────────────────────────────────────────────── */
  .node-label-c {
    font-family: system-ui, sans-serif; font-size: 11px;
    background: rgba(255,255,255,.80); padding: 1px 5px; border-radius: 0;
    pointer-events: none; white-space: nowrap; color: #333;
    text-shadow: 0 0 4px rgba(255,255,255,.9);
  }
  .node-label-c.is-central { font-weight:700; color:#1a5fa8; }
  .node-label-c.is-self    { font-weight:700; color:#9a5000; font-size:13px;
                              background:rgba(255,200,50,.22); border:1px solid rgba(243,156,18,.4); }
  .node-label-c.is-near    { font-weight:600; background: rgba(255,255,255,.97); }
  /* ── Guided Tour panel ──────────────────────────────────────────────────────── */
  #tour-panel {
    position: absolute; right: 0; top: 0; width: 280px; height: 100%;
    background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
    z-index: 25; display: flex; flex-direction: column;
    box-shadow: -3px 0 18px rgba(0,0,0,.14);
    border-left: 1px solid rgba(0,0,0,.07);
  }
  /* ── Tour ear tab ──────────────────────────────────────────────────────────── */
  #tour-ear {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%) rotate(180deg);
    writing-mode: vertical-rl;
    background: #1a1a2e;
    color: #fff;
    padding: .3rem .4rem;
    border-radius: 0;
    cursor: pointer;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    z-index: 26;
    user-select: none;
    transition: background .15s, right .25s;
    border: none;
  }
  #tour-ear:hover { background: #2d2d5e; }
  body.tour-open #tour-ear { right: 280px; }
  /* Mobilní varianta: spodní drawer místo pravého sidebaru */
  #tour-panel.tour-mobile {
    right: unset; top: unset; left: 0; bottom: 0;
    width: 100%; height: 52%;
    border-left: none; border-top: 1px solid rgba(0,0,0,.10);
    box-shadow: 0 -4px 18px rgba(0,0,0,.14);
  }
  /* Swipe hint na spodním draweru */
  #tour-panel.tour-mobile::before {
    content: ''; display: block; width: 36px; height: 4px;
    background: #ddd; border-radius: 0;
    margin: .55rem auto .1rem; flex-shrink: 0;
  }
  /* Tlačítko Průvodce (inline pod canvasem v non-story módu) */
  #mobile-tour-btn {
    padding: .42rem .9rem; background: rgba(26,26,46,.82); color: #fff;
    border: none; border-radius: 0; font-size: .85rem; cursor: pointer;
    font-family: inherit; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
  }
  #mobile-tour-btn:hover { background: rgba(26,26,46,1); }
  .tour-header {
    display: flex; align-items: flex-start; gap: .35rem;
    padding: .75rem .9rem .5rem; border-bottom: 1px solid #eee;
  }
  .tour-title {
    flex: 1; font-size: .88rem; font-weight: 700; color: #1a1a2e; line-height: 1.3;
  }
  .tour-step-label {
    font-size: .7rem; color: #aaa; white-space: nowrap; margin-top: .15rem;
  }
  #tour-close, #tour-fs {
    background: none; border: none; cursor: pointer;
    color: #aaa; padding: .1rem .3rem; border-radius: 0; line-height: 1;
  }
  #tour-close { font-size: .9rem; margin-left: .1rem; }
  #tour-fs    { font-size: 1rem; }
  #tour-close:hover, #tour-fs:hover { background: #f0f0f0; color: #333; }
  .tour-card-body {
    flex: 1; padding: .9rem .95rem .7rem; font-size: .84rem; color: #444;
    line-height: 1.65; overflow-y: auto;
  }
  .tour-nav {
    display: flex; gap: .45rem; padding: .65rem .9rem;
    border-top: 1px solid #eee;
  }
  .tour-nav-btn {
    flex: 1; padding: .42rem .6rem; font-size: .82rem; border-radius: 0;
    border: 1px solid #ddd; background: #f7f7f7; color: #555;
    cursor: pointer; font-family: inherit; transition: background .12s;
  }
  .tour-nav-btn:hover:not(:disabled) { background: #eee; color: #222; }
  .tour-nav-btn:disabled { opacity: .35; cursor: default; }
  .tour-nav-primary { background: #4a90d9; color: #fff; border-color: #3578c0; }
  .tour-nav-primary:hover:not(:disabled) { background: #3578c0; }
  .tour-link-btn {
    display: inline-block; margin: .2rem 0;
    padding: .32rem .75rem; background: #f0f4ff; color: #2563eb;
    border: 1px solid #c7d2fe; border-radius: 0;
    font-size: .82rem; text-decoration: none; font-weight: 600;
    transition: background .12s;
  }
  .tour-link-btn:hover { background: #dbeafe; }
  .tour-links-list { list-style: none; margin: .4rem 0 0; padding: 0; }
  .tour-links-list li { margin-bottom: .6rem; }
  .tour-link-desc { font-size: .75rem; color: #9ca3af; display: block; margin-top: .1rem; }
  .tour-btn {
    display: inline-block; margin-top: .5rem; margin-left: .4rem;
    padding: .5rem 1.25rem; background: #7c5cbf; color: #fff;
    border-radius: 0; font-size: .88rem; cursor: pointer;
    border: none; font-family: inherit; transition: background .15s;
  }
  .tour-btn:hover { background: #6848aa; }
  .tour-look-btn {
    display: inline-block; margin-top: .65rem;
    padding: .35rem .9rem; background: #1a1a2e; color: #fff;
    border-radius: 0; font-size: .8rem; cursor: pointer;
    border: none; font-family: inherit; transition: background .12s;
  }
  .tour-look-btn:hover { background: #2e2e50; }
  .tour-look-hint {
    display: inline-block; margin-top: .35rem; padding: .18rem .55rem;
    background: rgba(0,0,0,.07); border-radius: 0;
    font-size: .73rem; color: #888; font-style: italic;
  }
  /* ── Tour tabs ───────────────────────────────────────────────────────────── */
  .tour-tabs {
    display: flex; border-bottom: 1px solid #eee; flex-shrink: 0;
  }
  .tour-tab {
    flex: 1; padding: .45rem .3rem; font-size: .78rem; font-weight: 600;
    background: none; border: none; border-bottom: 2px solid transparent;
    cursor: pointer; color: #aaa; font-family: inherit; transition: color .12s;
  }
  .tour-tab.active { color: #7c5cbf; border-bottom-color: #7c5cbf; }
  .tour-tab:hover:not(.active) { color: #555; }

  /* ── Tour step notes ─────────────────────────────────────────────────────── */
  .tour-note-wrap {
    border-top: 1px solid #f0f0f0; padding: .5rem .9rem .4rem; flex-shrink: 0;
  }
  .tour-note-label {
    font-size: .7rem; font-weight: 600; color: #aaa; letter-spacing: .03em;
    text-transform: uppercase; margin-bottom: .28rem;
  }
  #tour-note-input {
    width: 100%; font-size: .8rem; font-family: inherit;
    border: 1px solid #ddd; border-radius: 0; padding: .3rem .5rem;
    resize: none; line-height: 1.45; background: #fafafa; color: #333;
    min-height: 42px;
  }
  #tour-note-input:focus { outline: none; border-color: #7c5cbf; background: #fff; }
  .tour-note-saved { font-size: .68rem; color: #aaa; margin-top: .18rem; min-height: .9rem; }

  /* ── Tour interpretation (admin-written) ─────────────────────────────────── */
  .tour-interp-acc {
    border: 1px solid #e5d9fb; border-radius: 0;
    margin: .4rem .9rem .1rem; overflow: hidden; flex-shrink: 0;
  }
  .tour-interp-acc > summary {
    padding: .4rem .75rem; cursor: pointer; list-style: none; user-select: none;
    display: flex; justify-content: space-between; align-items: center;
    background: #faf8ff; font-size: .78rem; font-weight: 600; color: #5b21b6;
  }
  .tour-interp-acc > summary::-webkit-details-marker { display: none; }
  .tour-interp-acc > summary::after { content: '▸'; font-size: .7rem; color: #a78bfa; }
  .tour-interp-acc[open] > summary::after { content: '▾'; }
  .tour-interp-body { padding: .5rem .75rem .65rem; font-size: .82rem; color: #333; line-height: 1.65; }

  /* ── Admin interpretation editor ─────────────────────────────────────────── */
  .tour-admin-interp {
    border-top: 1px dashed #e0c8ff; padding: .45rem .9rem .5rem; flex-shrink: 0;
  }
  .tour-admin-label {
    font-size: .7rem; font-weight: 600; color: #7c3aed; letter-spacing: .03em;
    text-transform: uppercase; margin-bottom: .28rem;
  }
  #tour-admin-input {
    width: 100%; font-size: .8rem; font-family: inherit;
    border: 1px solid #c4b5fd; border-radius: 0; padding: .3rem .5rem;
    resize: none; line-height: 1.45; background: #faf8ff; color: #333;
    min-height: 55px;
  }
  #tour-admin-input:focus { outline: none; border-color: #7c3aed; background: #fff; }
  .tour-admin-actions { display: flex; gap: .4rem; margin-top: .28rem; align-items: center; }
  .tour-admin-save {
    padding: .28rem .75rem; background: #7c3aed; color: #fff;
    border: none; border-radius: 0; cursor: pointer; font-size: .78rem; font-family: inherit;
  }
  .tour-admin-save:hover { background: #6d28d9; }
  .tour-admin-saved { font-size: .68rem; color: #aaa; }

  /* ── Admin owner chat history ───────────────────────────────────────────── */
  .admin-chat-hist {
    margin-top: .8rem; border-top: 1px dashed #e0d9f7; padding-top: .6rem;
  }
  .admin-chat-hist summary {
    font-size: .72rem; color: #9d78ef; font-weight: 700; cursor: pointer;
    user-select: none; list-style: none; display: inline-flex; align-items: center; gap: .3rem;
  }
  .admin-chat-hist summary::-webkit-details-marker { display: none; }
  .admin-chat-hist[open] summary::before { content: "▾"; }
  .admin-chat-hist summary::before { content: "▸"; font-size: .65rem; opacity: .7; }
  .admin-chat-hist-body {
    margin-top: .5rem; display: flex; flex-direction: column; gap: .35rem;
  }
  .ach-msg { font-size: .77rem; padding: .3rem .5rem; border-radius: 0; line-height: 1.55; }
  .ach-msg.user      { background: #ede9fe; color: #2e1065; align-self: flex-end; max-width: 92%; }
  .ach-msg.assistant { background: #f3f4f6; color: #1f2937; align-self: flex-start; max-width: 92%; }
  .ach-empty { font-size: .75rem; color: #bbb; font-style: italic; }

  /* ── AI chat tab ─────────────────────────────────────────────────────────── */
  #tour-tab-ai {
    display: flex; flex-direction: column; flex: 1; min-height: 0;
  }
  .tour-ai-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .6rem .9rem .45rem; border-bottom: 1px solid #eee; flex-shrink: 0;
  }
  .tour-ai-title { font-size: .82rem; font-weight: 700; color: #5b21b6; }
  #tour-ai-close {
    background: none; border: none; cursor: pointer; color: #aaa;
    padding: .1rem .3rem; border-radius: 0; font-size: .9rem;
  }
  #tour-ai-close:hover { background: #f0f0f0; color: #333; }
  .tour-ai-messages {
    flex: 1; overflow-y: auto; padding: .55rem .9rem; display: flex;
    flex-direction: column; gap: .45rem; min-height: 0;
  }
  .tour-ai-msg {
    font-size: .8rem; line-height: 1.6; padding: .38rem .55rem;
    border-radius: 0; word-break: break-word; max-width: 96%;
  }
  .tour-ai-msg.user {
    background: #ede9fe; color: #2e1065; align-self: flex-end;
    border-bottom-right-radius: 2px;
  }
  .tour-ai-msg.assistant {
    background: #f3f4f6; color: #1f2937; align-self: flex-start;
    border-bottom-left-radius: 2px;
  }
  .tour-ai-bottom { flex-shrink: 0; border-top: 1px solid #eee; padding: .45rem .9rem .55rem; }
  .tour-ai-limit { font-size: .69rem; color: #bbb; margin-bottom: .3rem; }
  .tour-ai-form { display: flex; gap: .3rem; align-items: flex-end; }
  #tour-ai-input {
    flex: 1; font-size: .8rem; font-family: inherit;
    border: 1px solid #ddd; border-radius: 0; padding: .3rem .5rem;
    resize: none; line-height: 1.4; background: #fafafa; color: #333;
  }
  #tour-ai-input:focus { outline: none; border-color: #7c5cbf; background: #fff; }
  #tour-ai-send {
    padding: .3rem .62rem; background: #7c5cbf; color: #fff;
    border: none; border-radius: 0; cursor: pointer; font-size: .92rem; flex-shrink: 0;
  }
  #tour-ai-send:hover { background: #6848aa; }
  #tour-ai-send:disabled { background: #ccc; cursor: default; }
  .tour-ai-input-label {
    font-size: .71rem; font-weight: 700; color: #7c3aed;
    text-transform: uppercase; letter-spacing: .04em; margin-bottom: .22rem;
  }
  /* Tlačítko "Zeptat se AI" v Průvodci */
  .btn-goto-ai {
    display: block; width: calc(100% - 1.8rem); margin: .4rem .9rem .1rem;
    padding: .38rem .7rem; background: #7c3aed; color: #fff; border: none;
    border-radius: 0; font-size: .8rem; font-weight: 700; cursor: pointer;
    font-family: inherit; text-align: center; flex-shrink: 0;
  }
  .btn-goto-ai:hover { background: #6848aa; }
  /* Nav tlačítka v AI tabu */
  .tour-nav-in-ai {
    border-top: 1px solid #eee; padding: .4rem .9rem .5rem;
    flex-shrink: 0;
  }

  /* ── Interp tab (admin) ─────────────────────────────────────────────────────── */

  /* ── Data tab ───────────────────────────────────────────────────────────────── */
  #tour-tab-data {
    overflow-y: auto; flex: 1; min-height: 0; padding: .6rem .9rem;
  }
  .dt-section { margin-bottom: .9rem; }
  .dt-label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #aaa; margin-bottom: .35rem;
  }
  .dt-concept-name {
    font-size: .9rem; font-weight: 700; color: #1a1a2e; margin-bottom: .4rem;
  }
  .dt-metric-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .78rem; padding: .18rem 0; border-bottom: 1px solid #f0f0f0;
    gap: .5rem;
  }
  .dt-metric-row:last-child { border-bottom: none; }
  .dt-metric-name { color: #666; flex-shrink: 0; }
  .dt-metric-val  { font-weight: 600; color: #1a1a2e; text-align: right; }
  .dt-bar-wrap { flex: 1; height: 4px; background: #f0f0f0; border-radius: 0; margin: 0 .4rem; }
  .dt-bar { height: 100%; border-radius: 0; background: #7c5cbf; }
  .dt-links { font-size: .75rem; color: #666; margin-top: .3rem; }
  .dt-links span { font-weight: 600; color: #333; }
  .dt-sep { border: none; border-top: 1px solid #eee; margin: .55rem 0; }
  .dt-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
  .dt-pole-card { background: #f9f7ff; border-radius: 0; padding: .45rem .6rem; }
  .dt-pole-label { font-size: .68rem; color: #aaa; font-weight: 700; text-transform: uppercase; margin-bottom: .25rem; }
  .dt-pole-name  { font-size: .85rem; font-weight: 700; color: #1a1a2e; margin-bottom: .3rem; }
  .dt-empty { font-size: .8rem; color: #bbb; text-align: center; padding: 1.5rem 0; font-style: italic; }

  /* ── Demo CTA ───────────────────────────────────────────────────────────────── */
  #demo-cta {
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, #7c5cbf 0%, #4a90d9 100%);
    color: #fff; border-radius: 0; padding: .65rem 1.1rem;
    margin-bottom: .9rem; font-size: .88rem; gap: 1rem; flex-wrap: wrap;
  }
  .demo-cta-btn {
    padding: .38rem 1.1rem; background: #fff; color: #7c5cbf;
    border-radius: 0; font-size: .85rem; font-weight: 700;
    text-decoration: none; white-space: nowrap; flex-shrink: 0;
  }
  .demo-cta-btn:hover { background: #f3f0ff; }

  /* ── Story info panel (left slide-out) ─────────────────────────────────── */
  #sinfo-panel {
    position: absolute; left: 0; top: 0; height: 100%;
    display: flex; align-items: flex-start; z-index: 21; pointer-events: none;
  }
  .sinfo-tab {
    pointer-events: auto; display: flex; align-items: center; justify-content: center;
    width: 22px; height: 54px; margin-top: 1.1rem;
    background: rgba(26,26,46,.72); color: #fff; border: none;
    border-radius: 0; cursor: pointer; font-size: .6rem;
    letter-spacing: .07em; writing-mode: vertical-rl; text-orientation: mixed;
    transition: background .12s;
  }
  .sinfo-tab:hover { background: rgba(26,26,46,.95); }
  .sinfo-body {
    align-self: stretch;
    display: flex; flex-direction: column;
    pointer-events: auto; overflow: hidden;
    width: 0; max-width: 0; transition: max-width .2s, width .2s;
    background: rgba(255,255,255,.97); border-right: 1px solid #e0e0e0;
    box-shadow: 3px 0 14px rgba(0,0,0,.13); order: -1;
  }
  #sinfo-panel.open .sinfo-body { width: 238px; max-width: 238px; }
  .sinfo-inner { padding: .7rem .8rem; min-width: 238px; overflow-y: auto; flex: 1; }
  .sinfo-section { margin-bottom: .85rem; }
  .sinfo-section-title {
    font-size: .65rem; font-weight: 700; color: #aaa;
    text-transform: uppercase; letter-spacing: .07em; margin-bottom: .3rem;
  }
  .sinfo-item {
    font-size: .8rem; color: #1a1a2e; padding: .18rem .3rem;
    border-radius: 0; cursor: pointer; display: flex;
    justify-content: space-between; align-items: center; gap: .3rem;
    transition: background .1s;
  }
  .sinfo-item:hover { background: #f5f0ea; }
  .sinfo-item.sinfo-active { background: #fef9c3; font-weight: 700; }
  #sinfo-panel.has-selection .sinfo-tab { background: rgba(245,158,11,.88) !important; color: #fff !important; }
  .sinfo-pct { font-size: .7rem; color: #bbb; flex-shrink: 0; }
  .sinfo-sep { border: none; border-top: 1px solid #f0f0f0; margin: .4rem 0; }
  .sinfo-axes { display: flex; flex-direction: column; gap: .1rem; }
  .sinfo-axes label {
    display: flex; align-items: center; gap: .4rem;
    font-size: .8rem; color: #444; padding: .1rem 0; cursor: pointer;
  }
  .sinfo-axes input[type=checkbox] { cursor: pointer; width: 13px; height: 13px; }
  @media (max-width: 600px) { #sinfo-panel { display: none; } }

  /* ── Mobile tour adjustments ─────────────────────────────────────────────── */
  @media (max-width: 600px) {
    /* Shorter bottom drawer — 32% */
    #tour-panel.tour-mobile { height: 32%; }

    /* Hide note textarea on mobile */
    #tour-panel.tour-mobile .tour-note-wrap { display: none; }

    /* Compact header + nav */
    #tour-panel.tour-mobile .tour-header { padding: .45rem .75rem .3rem; }
    #tour-panel.tour-mobile .tour-nav { padding: .4rem .75rem; }
    #tour-panel.tour-mobile .tour-card-body { padding: .5rem .75rem .4rem; font-size: .82rem; }

    /* Tour ear — right edge, vertical text rotated 90° */
    #tour-ear {
      top: 50%; right: 0; bottom: unset; left: unset;
      transform: translateY(-50%) rotate(180deg);
      writing-mode: vertical-rl;
      border-radius: 0;
      padding: .3rem .6rem;
      font-size: .72rem;
      box-shadow: -2px 0 8px rgba(0,0,0,.12);
    }
    body.tour-open #tour-ear {
      right: unset; left: 50%;
      top: 63%; bottom: unset; height: 35px;
      transform: translateX(-50%) rotate(0deg);
      writing-mode: horizontal-tb;
      border-radius: 0;
      padding: .35rem .9rem;
      font-size: .78rem;
    }
  }

  /* ── Story panel ──────────────────────────────────────────────────────────── */
  #story-panel {
    position: absolute; right: 0; top: 0; width: 300px; height: 100%;
    background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
    display: flex; flex-direction: column; z-index: 22;
    border-left: 1px solid #eee; box-shadow: -2px 0 16px rgba(0,0,0,.08);
  }
  #story-panel.story-mobile {
    right: unset; top: unset; left: 0; bottom: 0; width: 100%; height: 50%;
    border-left: none; border-top: 1px solid #eee;
  }
  .story-hdr {
    display: flex; align-items: center; gap: .4rem;
    padding: .7rem .9rem .5rem; border-bottom: 1px solid #eee; flex-shrink: 0;
  }
  .story-hdr-title  { flex: 1; font-size: .88rem; font-weight: 700; color: #1a1a2e; }
  .story-hdr-step   { font-size: .7rem; color: #aaa; white-space: nowrap; }
  .story-close-btn  { background: none; border: none; cursor: pointer; color: #aaa; padding: .1rem .3rem; border-radius: 0; font-size: .9rem; }
  .story-close-btn:hover { background: #f0f0f0; color: #333; }
  /* ── Playback ── */
  .story-scene-title {
    font-size: .78rem; font-weight: 700; color: #666; padding: .6rem .9rem .2rem;
    text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0;
    border-bottom: 1px solid #f5f5f5; min-height: 1.5rem;
  }
  .story-bubbles {
    flex: 1; padding: .6rem .9rem; overflow-y: auto;
    display: flex; flex-direction: column; gap: .55rem;
  }
  .story-bubble {
    background: #f0ecfd; border-radius: 0;
    padding: .5rem .75rem; font-size: .84rem; color: #333; line-height: 1.65;
    animation: storyFadeIn .22s ease-out;
  }
  @keyframes storyFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .story-nav {
    display: flex; gap: .45rem; padding: .65rem .9rem; border-top: 1px solid #eee; flex-shrink: 0;
  }
  .story-nav-btn {
    flex: 1; padding: .42rem .6rem; font-size: .82rem; border-radius: 0;
    border: 1px solid #ddd; background: #f7f7f7; color: #555;
    cursor: pointer; font-family: inherit; transition: background .12s;
  }
  .story-nav-btn:hover:not(:disabled) { background: #eee; color: #222; }
  .story-nav-btn:disabled             { opacity: .35; cursor: default; }
  .story-nav-primary { background: #4a90d9; color: #fff; border-color: #3578c0; }
  .story-nav-primary:hover:not(:disabled) { background: #3578c0; }
  /* ── Edit mode ── */
  .story-edit-list { flex: 1; overflow-y: auto; }
  .story-edit-wp   { border-bottom: 1px solid #f0f0f0; padding: .75rem .9rem; }
  .story-edit-wp-hdr   { display: flex; align-items: flex-start; gap: .3rem; margin-bottom: .45rem; }
  .story-edit-wp-num   { font-size: .72rem; font-weight: 700; color: #aaa; padding-top: .15rem; }
  .story-edit-wp-meta  { flex: 1; font-size: .66rem; color: #ccc; font-family: monospace; padding-top: .15rem; }
  .story-edit-wp-acts  { display: flex; gap: .2rem; flex-shrink: 0; }
  .story-edit-btn {
    background: none; border: 1px solid #e0e0e0; border-radius: 0;
    cursor: pointer; font-size: .72rem; padding: .15rem .35rem; color: #888;
  }
  .story-edit-btn:hover         { background: #f5f5f5; color: #333; }
  .story-edit-btn.del           { border-color: #f0b0b0; color: #c0392b; }
  .story-edit-btn.del:hover     { background: #fdf0f0; }
  .story-edit-title-inp {
    width: 100%; box-sizing: border-box; font-size: .82rem; border: 1px solid #e0e0e0;
    border-radius: 0; padding: .3rem .45rem; font-family: inherit; color: #333; margin-bottom: .45rem;
  }
  .story-edit-title-inp:focus { border-color: #4a90d9; outline: none; }
  .story-bubbles-label { font-size: .7rem; color: #aaa; margin-bottom: .3rem; }
  .story-edit-bubble-row { display: flex; gap: .3rem; margin-bottom: .3rem; align-items: flex-start; }
  .story-edit-bubble-inp {
    flex: 1; font-size: .8rem; border: 1px solid #e0e0e0; border-radius: 0;
    padding: .3rem .45rem; font-family: inherit; color: #444; resize: vertical; min-height: 52px;
  }
  .story-edit-bubble-inp:focus  { border-color: #4a90d9; outline: none; }
  .story-edit-add-bubble {
    font-size: .72rem; padding: .22rem .5rem; background: none; border: 1px dashed #ccc;
    border-radius: 0; color: #888; cursor: pointer; width: 100%; margin-bottom: .35rem;
  }
  .story-edit-add-bubble:hover  { border-color: #4a90d9; color: #4a90d9; }
  .story-edit-save-row { display: flex; align-items: center; gap: .5rem; margin-top: .25rem; }
  .story-edit-save-btn {
    font-size: .75rem; padding: .25rem .65rem; background: #4a90d9; color: #fff;
    border: none; border-radius: 0; cursor: pointer;
  }
  .story-edit-save-btn:hover  { background: #3578c0; }
  .story-edit-saved-lbl { font-size: .68rem; color: #aaa; }
  .story-add-wp-btn {
    padding: .5rem .9rem; background: #27ae60; color: #fff;
    border: none; border-radius: 0; cursor: pointer; font-size: .82rem;
    font-family: inherit; flex-shrink: 0;
  }
  .story-add-wp-btn:hover { background: #219a52; }
  .story-edit-footer { display: flex; flex-direction: column; gap: .45rem; padding: .75rem .9rem; border-top: 1px solid #eee; flex-shrink: 0; }
  .story-enter-btn {
    padding: .45rem .9rem; background: #1a1a2e; color: #fff;
    border: none; border-radius: 0; cursor: pointer; font-size: .82rem;
    font-family: inherit; display: flex; align-items: center; justify-content: center; gap: .4rem;
  }
  .story-enter-btn:hover { background: #2d2d50; }
  .story-enter-btn .key-hint { font-size: .68rem; opacity: .7; }
  /* Speaker dropdown */
  .story-speaker-sel {
    font-size: .75rem; border: 1px solid #e0e0e0; border-radius: 0;
    padding: .2rem .35rem; font-family: inherit; color: #555; background: #fafafa; width: 100%;
  }
  .story-speaker-sel:focus { border-color: #4a90d9; outline: none; }
  .story-bubble-speaker {
    font-size: .7rem; font-weight: 700; color: #7b4ea0; margin-bottom: .15rem;
    display: block;
  }
  /* Story button prominence (when existing in const view) */
  .story-prominent-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .42rem 1rem; background: #1a1a2e; color: #fff;
    border-radius: 0; font-size: .83rem; text-decoration: none;
    font-family: inherit; border: none; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: background .12s;
  }
  .story-prominent-btn:hover { background: #2d2d50; text-decoration: none; }

  /* ── Story recording bar (edit mode) ───────────────────────────────── */
  .story-rec-bar {
    display: flex; align-items: center; gap: .45rem;
    padding: .55rem .9rem; border-bottom: 1px solid #eee;
    background: #fafafa; flex-wrap: wrap;
  }
  .story-rec-btn {
    padding: .3rem .8rem; border-radius: 0; font-size: .8rem;
    border: 1px solid #ddd; cursor: pointer; font-family: inherit;
    background: #f0f0f0; color: #333; transition: background .12s, color .12s;
  }
  .story-rec-btn.rec-start  { background: #e74c3c; color: #fff; border-color: #c0392b; }
  .story-rec-btn.rec-start:hover { background: #c0392b; }
  .story-rec-btn.rec-pause  { background: #f39c12; color: #fff; border-color: #d68910; }
  .story-rec-btn.rec-pause:hover { background: #d68910; }
  .story-rec-btn.rec-resume { background: #27ae60; color: #fff; border-color: #219a52; }
  .story-rec-btn.rec-resume:hover { background: #219a52; }
  .story-rec-btn.rec-stop   { background: #555; color: #fff; border-color: #333; }
  .story-rec-btn.rec-stop:hover  { background: #333; }
  .story-rec-timer { font-size: .8rem; color: #888; font-variant-numeric: tabular-nums; min-width: 3.5rem; }
  .story-rec-status { font-size: .75rem; color: #aaa; flex: 1; }
  .story-rec-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%;
    background: #e74c3c; animation: recPulse 1s ease-in-out infinite; margin-right: .25rem; }
  @keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

  /* ── Story audio bar (play mode) ───────────────────────────────────── */
  .story-audio-bar {
    padding: .5rem .9rem; border-bottom: 1px solid #eee;
    background: #f7f5ff;
  }
  .story-audio-bar audio { width: 100%; height: 28px; outline: none; }
  .story-audio-label { font-size: .7rem; color: #9b89c4; margin-bottom: .2rem; }

  /* ── Story compare bar (edit mode) ─────────────────────────────────── */
  .story-cmp-bar {
    display: flex; align-items: center; gap: .4rem;
    padding: .38rem .9rem; background: #eef2ff;
    border-bottom: 1px solid #d4dbff; flex-shrink: 0; flex-wrap: wrap;
  }
  .story-cmp-icon  { font-size: .82rem; flex-shrink: 0; }
  .story-cmp-label { font-size: .72rem; color: #5566aa; font-weight: 600; white-space: nowrap; }
  .story-cmp-name  { font-size: .74rem; color: #1a1a2e; flex: 1; min-width: 0;
                     overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .story-cmp-picker {
    display: none; padding: .45rem .9rem .55rem;
    background: #f5f7ff; border-bottom: 1px solid #d4dbff;
    flex-direction: column; gap: .35rem; flex-shrink: 0;
  }
  .story-cmp-picker.open { display: flex; }
  .story-cmp-sel {
    width: 100%; font-size: .78rem; padding: .28rem .4rem;
    border: 1px solid #b8c0dd; border-radius: 0;
    font-family: inherit; background: #fff; color: #1a1a2e;
  }
  .story-cmp-sel:focus { outline: none; border-color: #4a90d9; }
  .story-cmp-row { display: flex; gap: .4rem; align-items: center; }
  .story-cmp-save { font-size: .78rem; padding: .28rem .75rem;
    background: #4a90d9; color: #fff; border: none; border-radius: 0;
    cursor: pointer; font-family: inherit; white-space: nowrap; }
  .story-cmp-save:hover { background: #3578c0; }
  .story-cmp-clear { font-size: .78rem; padding: .28rem .55rem;
    background: #f0f0f0; color: #666; border: 1px solid #ddd; border-radius: 0;
    cursor: pointer; font-family: inherit; }
  .story-cmp-clear:hover { background: #e4e4e4; }
  .story-cmp-toggle { font-size: .8rem; padding: .18rem .45rem;
    background: none; border: 1px solid #b8c0dd; border-radius: 0;
    cursor: pointer; color: #5566aa; line-height: 1; flex-shrink: 0; }
  .story-cmp-toggle:hover { background: #e0e6ff; }
  .story-cmp-vis-btn { font-size: .75rem; padding: .18rem .45rem;
    background: none; border: 1px solid #b8c0dd; border-radius: 0;
    cursor: pointer; color: #5566aa; line-height: 1; flex-shrink: 0; }
  .story-cmp-vis-btn:hover { background: #e0e6ff; }
  .story-cmp-vis-btn.active { background: #dde8ff; border-color: #4a90d9; color: #2255bb; }


  /* ── Canvas ctrl overlay (spodní lišta) ─────────────────────────── */
  #const-ctrl-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    z-index: 12; display: flex; flex-direction: column; font-size: .8rem;
  }
  .const-ctrl-expanded {
    display: none; flex-direction: column;
    box-shadow: 0 -3px 12px rgba(0,0,0,.10);
  }
  #const-ctrl-overlay:hover .const-ctrl-expanded,
  #const-ctrl-overlay.ctrl-open .const-ctrl-expanded { display: flex; }
  .const-ctrl-row {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: .35rem .6rem; padding: .3rem .5rem;
    background: rgba(255,255,255,.92); backdrop-filter: blur(4px);
    border-top: 1px solid rgba(0,0,0,.06);
  }
  .const-ctrl-expand-arrow {
    margin-left: auto; font-size: .72rem; color: #aaa;
    border: none; background: none; cursor: pointer; padding: 0 .15rem;
    line-height: 1; transition: transform .15s; flex-shrink: 0;
    transform: rotate(180deg); /* šipka nahoru = klik otevírá nahoru */
    font-family: inherit;
  }
  #const-ctrl-overlay:hover .const-ctrl-expand-arrow,
  #const-ctrl-overlay.ctrl-open .const-ctrl-expand-arrow { transform: rotate(0deg); color: #555; }

  /* ── Result2d-style header ───────────────────────────────────────────── */
  .map2d-back {
    font-size: .82rem; color: #6b7280; padding: .6rem 0 .1rem;
    display: block; text-decoration: none; text-align: right;
  }
  .map2d-back:hover { color: #374151; }
  .map2d-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.1rem;
    margin-bottom: 1.5rem;
  }
  .map2d-header-eyebrow {
    display: flex; justify-content: space-between; align-items: baseline;
    flex-wrap: wrap; gap: .35rem;
    font-size: .72rem; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: #6b7280; margin-bottom: .55rem;
  }
  .map2d-done { font-size: .8rem; font-weight: 600; color: #9ca3af; letter-spacing: .03em; text-transform: none; }
  .map2d-question {
    font-size: .9rem; color: #4b5563; line-height: 1.6;
    background: #f8f9ff; border-left: 3px solid #c7d2fe;
    padding: .55rem .9rem; border-radius: 0;
    margin-bottom: .7rem; white-space: pre-wrap; word-break: break-word;
  }
  .map2d-h1-row { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; margin-top:.25rem; }
  .map2d-h1-row h1 { margin:0; flex-shrink:0; }
  .map2d-h1-row .view-switcher { flex-shrink:0; margin:0; }
  /* Plan badge */
  .plan-pill { display:inline-block; font-size:.6rem; font-weight:700; letter-spacing:.05em; padding:.1rem .4rem; border-radius: 0; vertical-align:middle; margin-left:.4rem; }
  .plan-pill-free   { background:#f1f5f9; color:#94a3b8; }
  .plan-pill-basic  { background:#dbeafe; color:#1e40af; }
  .plan-pill-full   { background:#ede9fe; color:#5b21b6; }
  .plan-pill-admin  { background:#fef3c7; color:#92400e; }

  /* Sinfo inner tabs */
  .sinfo-inner-tabs {
    display: flex; flex-shrink: 0; border-bottom: 1px solid #e5e7eb; background: #f8f9fa;
  }
  .sinfo-inner-tab-btn {
    flex: 1; border: none; background: none; cursor: pointer; font-size: .72rem;
    padding: .35rem .2rem; color: #6b7280; border-bottom: 2px solid transparent;
    transition: color .12s, border-color .12s;
  }
  .sinfo-inner-tab-btn.active { color: #1d4ed8; border-bottom-color: #1d4ed8; font-weight: 600; }
  .sinfo-tab-pane { display: flex; flex-direction: column; flex: 1; overflow-y: auto; overflow-x: hidden; }
  .sinfo-tab-pane.hidden { display: none; }
  /* Chapter nav */
  .sinfo-ch-nav {
    display: flex; align-items: center; gap: .3rem; padding: .4rem .6rem .3rem;
    font-size: .75rem; color: #6b7280; flex-shrink: 0; border-bottom: 1px solid #f0f0f0;
  }
  .sinfo-ch-nav button {
    border: 1px solid #ddd; background: #fff; border-radius: 0; cursor: pointer;
    width: 22px; height: 22px; font-size: .9rem; color: #555;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .sinfo-ch-nav button:hover { background: #f0f4fb; }
  .sinfo-ch-title-el {
    flex: 1; text-align: center; font-size: .7rem; font-weight: 600; color: #374151;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .sinfo-ch-counter { font-size: .65rem; color: #9ca3af; flex-shrink: 0; }
  #sinfo-chapters-list { overflow-y: auto; flex: 1; padding: .3rem 0; }
  /* Chapter items in sinfo */
  .sinfo-chapter-item {
    font-size: .79rem; color: #374151; padding: .22rem .8rem;
    cursor: pointer; transition: background .1s;
  }
  .sinfo-chapter-item:hover { background: #f5f0ea; }
  .sinfo-chapter-item.sinfo-ch-active { background: #fef9c3; font-weight: 700; color: #1a1a2e; }
  /* Collapsible chapter vykladu */
  .sinfo-ch-vykladu { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
  .sinfo-ch-vykladu.open { max-height: 400px; }
  .sinfo-ch-vykladu-inner { padding: .35rem .8rem .45rem; border-bottom: 1px solid #f0f0f0; font-size: .78rem; color: #4b5563; line-height: 1.55; }

  /* AI tab highlight */
  .tour-tab[data-tab="ai"] {
    color: #7c3aed;
  }
  .tour-tab[data-tab="ai"].active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
    background: linear-gradient(to bottom, #faf5ff, transparent);
  }
  .tour-tab[data-tab="ai"]:not(.active) {
    background: linear-gradient(to bottom, #f9f5ff, transparent);
  }
