:root{font:15px/1.5 system-ui,sans-serif;color:#343c34;--surface:#fffcf5;--ink:#343c34;--line:#d7d4c8;--accent:#466652}*{box-sizing:border-box}body{margin:0;overflow:hidden;background:#f4efe3}button,input,select,textarea{font:inherit}button{min-height:44px;min-width:44px;cursor:pointer;border:1px solid transparent;border-radius:10px;background:transparent;color:inherit;padding:8px 12px}button:hover{background:#79867420}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,canvas:focus-visible{outline:3px solid #b47a38;outline-offset:3px}button:disabled{opacity:.35;cursor:default}button.primary{background:var(--accent);color:white}button.danger{color:#9b392e}canvas{position:absolute;width:100%;height:100%;touch-action:none}.toolbar,.palette,.bottom,.zoom,#presentation{position:fixed;display:flex;align-items:center;background:var(--surface);color:var(--ink);box-shadow:0 4px 24px #363b2910;border:1px solid var(--line);border-radius:16px}.toolbar{top:20px;left:24px;right:24px;justify-content:space-between;padding:12px 18px;background:transparent;border:0;box-shadow:none;pointer-events:none}.toolbar button{background:var(--surface);pointer-events:auto;border:1px solid var(--line)}h1{font:normal 26px Georgia,serif;margin:3px 0}.eyebrow{font-size:10px;letter-spacing:.19em}.palette{left:24px;top:145px;flex-direction:column;padding:8px;align-items:stretch;gap:3px}.palette button{text-align:left;font-size:13px}.palette button [aria-hidden]{font-size:22px;display:inline-block;width:33px}.bottom{bottom:35px;left:50%;transform:translateX(-50%);padding:6px;white-space:nowrap}.separator{height:24px;border-right:1px solid var(--line);margin:0 6px}.zoom{bottom:35px;right:24px;padding:4px}.empty{position:fixed;left:50%;top:45%;transform:translate(-50%,-50%);text-align:center}.empty span{font:32px Georgia,serif}.empty p{color:#747a6f;font-size:16px}.empty button{background:var(--accent);color:white;margin-top:12px}.panel{position:fixed;right:24px;top:100px;bottom:108px;width:330px;padding:22px;background:var(--surface);border:1px solid var(--line);border-radius:18px;overflow:auto;box-shadow:0 14px 45px #303a4020}.panel h2,dialog h2{font:25px Georgia,serif;margin:0 0 16px}.panel label,dialog label{display:block;margin:12px 0;font-size:13px}.panel input:not([type=checkbox]),.panel select,.panel textarea,dialog input:not([type=checkbox]),dialog textarea,dialog select{display:block;width:100%;margin-top:4px;border:1px solid var(--line);border-radius:8px;padding:9px;background:white;color:#343c34}.panel input[type=range]{padding:0}.panel textarea,dialog textarea{min-height:75px;resize:vertical}.row{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.row>*{flex:1}.panel .close{float:right;margin:-12px -12px 0 0}.help{font-size:12px;color:#697368}.orbit{position:fixed;width:220px;height:220px;pointer-events:none;transform:translate(-50%,-50%)}.orbit button{position:absolute;width:44px;height:44px;padding:0;pointer-events:auto;background:var(--surface);border:1px solid var(--line);border-radius:50%;box-shadow:0 3px 10px #3332}.orbit button[data-handle]{touch-action:none;background:#e9e2d0}#status{position:fixed;bottom:7px;left:24px;right:24px;text-align:center;font-size:11px;pointer-events:none}dialog{width:min(460px,calc(100vw - 24px));max-height:85dvh;border:1px solid var(--line);border-radius:18px;padding:26px;color:var(--ink);background:var(--surface)}dialog::backdrop{background:#28382e55}dialog .row{margin-top:20px}.mobile-add{display:none}.snapshot{padding:10px 0;border-bottom:1px solid var(--line)}.snapshot strong{display:block}.snapshot button{font-size:12px;padding:5px 8px}.lens{width:100%;text-align:left}.lens.active{background:#dde5d9}.questions{padding-left:18px}.questions li{margin:14px 0}#presentation{top:16px;right:16px;padding:5px}.presenting .toolbar,.presenting .palette,.presenting .bottom,.presenting .zoom,.presenting .orbit,.presenting .mobile-add,.presenting #status,.presenting .empty{display:none!important}[hidden]{display:none!important}@media(max-width:1000px){.zoom{bottom:100px;right:14px}.palette{left:14px}.toolbar{left:8px;right:8px}}@media(max-width:600px){h1{font-size:19px}.toolbar{top:8px;padding:8px}.eyebrow{font-size:9px}.palette{display:none;top:auto;bottom:100px;z-index:3}.palette.open{display:flex}.mobile-add{display:block;position:fixed;bottom:93px;left:16px;background:var(--accent);color:white;border-radius:50%;font-size:24px}.bottom{bottom:30px;max-width:calc(100% - 16px);width:max-content;padding:3px;gap:0}.bottom button{font-size:11px;padding:6px}.separator{margin:0 1px}.zoom{bottom:94px}.panel{top:auto;bottom:0;left:0;right:0;width:100%;max-height:55dvh;border-radius:20px 20px 0 0;padding:18px 22px;z-index:5}.orbit{left:50%!important;top:auto!important;bottom:157px;transform:translateX(-50%);width:auto;height:auto;display:flex;gap:2px;background:var(--surface);padding:5px;border-radius:16px}.orbit button{position:static;border:0;box-shadow:none;width:40px;min-width:40px}.empty{width:90%}.empty span{font-size:27px}#status{font-size:9px;bottom:8px}#presentation{left:8px;right:8px;justify-content:center}#presentation button{font-size:12px}}@media(prefers-reduced-motion:no-preference){.panel{animation:appear .18s ease-out}@keyframes appear{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}}
.demo-launch{margin-left:auto;margin-right:12px;font-size:13px}.phase{display:inline-flex;padding:4px 10px;border-radius:100px;font-size:10px;letter-spacing:.07em;text-transform:uppercase;background:#e4e7df;color:#455441}.phase.problem{background:#f0e0d5;color:#80573b}.phase.possibility{background:#dce9df;color:#376449}.phase.next{background:#dce6ed;color:#3c6078}.figure-protocol h3{font:22px Georgia}.figure-protocol details{margin:18px 0}summary{cursor:pointer;padding:7px 0}.soma-tags{display:flex;flex-wrap:wrap;gap:3px}.soma-tags button{font-size:11px;min-height:32px;background:#f0f1e9}.body-meters{padding:8px 0}.body-meter{display:grid;grid-template-columns:85px 1fr 45px;gap:8px;align-items:center;font-size:11px;margin:7px 0}.body-meter meter{width:100%;height:10px}.body-meter meter::-webkit-meter-bar{background:#e7e7df;border:0}.body-meter.heaviness meter::-webkit-meter-optimum-value{background:#b18c60}.body-meter.relief meter::-webkit-meter-optimum-value{background:#739884}.body-meter b{font-weight:500}.sensation{font-size:13px;color:#586355}.figure-protocol hr{border:0;border-top:1px solid var(--line);margin:24px 0}#board-badge{position:fixed;top:108px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:10px;max-width:65%;font-size:12px;background:#fffcf5ec;padding:8px 12px;border-radius:12px;pointer-events:none}#board-badge>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.demo-shell{position:fixed;inset:0;pointer-events:none;color:#343c34}.demo-shell button,.demo-shell select,.demo-shell input,.demo-shell summary{pointer-events:auto}.demo-mode .toolbar,.demo-mode .palette,.demo-mode .bottom,.demo-mode .zoom,.demo-mode .mobile-add,.demo-mode .orbit,.demo-mode .empty,.demo-mode #board-badge,.demo-mode #status,.demo-mode .panel{display:none!important}.demo-library{position:absolute;inset:0;overflow:auto;pointer-events:auto;background:#f4efe3;padding:40px max(26px,calc((100vw - 1300px)/2))}.demo-library header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:36px}.demo-library h1{font:clamp(32px,4vw,54px)/1.1 Georgia;margin:18px 0}.demo-library header p{font-size:16px;color:#677162;line-height:1.6}.demo-library header>button{border:1px solid #cacdbf;background:#fffcf5}.scene-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.scene-card{position:relative;text-align:left;border:1px solid #d7d4c8;background:#fffdf7;display:flex;flex-direction:column;padding:26px;min-height:260px;border-radius:17px;overflow:hidden}.scene-card:hover{background:#fff;border-color:var(--scene-color);transform:translateY(-2px)}.scene-number{font:42px Georgia;color:var(--scene-color);opacity:.6;position:absolute;right:20px;top:14px}.scene-topic{font-size:9px;text-transform:uppercase;letter-spacing:.08em;max-width:80%;color:#707b6a;margin:6px 0 22px}.scene-card strong{font:25px/1.2 Georgia;max-width:92%;margin-bottom:16px}.scene-intro{font-size:12px;color:#788070;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.scene-meta{font-size:11px;margin-top:auto;padding-top:25px;width:100%;display:flex;justify-content:space-between;color:var(--scene-color)}.scene-meta b{font-size:20px}.library-note{font-size:12px;color:#717a69;margin:28px 0;max-width:720px}.demo-header{position:absolute;top:0;left:0;right:0;padding:14px 22px;display:flex;align-items:center;gap:18px;background:#fffdf7f0;border-bottom:1px solid #d7d4c8;pointer-events:auto}.demo-header>div{flex:1}.demo-header strong{display:block;font:19px Georgia;margin-top:3px}.demo-header [data-detach]{background:#e8ecdf;font-size:12px}.demo-caption{position:absolute;top:105px;left:30px;max-width:390px;pointer-events:auto}.demo-caption h2{font:30px/1.18 Georgia;margin:12px 0}.demo-caption [data-context]{font-size:11px;padding:5px 0;color:#68725e;text-decoration:underline;text-underline-offset:4px}.demo-controls{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);width:min(960px,calc(100% - 32px));border:1px solid #d7d4c8;border-radius:18px;background:#fffdf7f5;box-shadow:0 12px 35px #24322614;padding:10px 20px;pointer-events:auto}.player-top{display:flex;align-items:center;gap:10px;font-size:11px}.player-top>.row{flex:0 0 auto}.player-top label{display:flex;gap:5px;align-items:center}.player-top select{padding:6px;border:0;background:transparent;color:inherit;font-size:11px}.player-top [data-position]{margin-left:auto;white-space:nowrap}.player-top button{font-size:11px;padding:6px 9px}.player-top .play-button{background:#476652;color:white;white-space:nowrap;min-width:105px}.branch-rail{height:84px;position:relative;margin:0 10px;touch-action:none}.branch-rail svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.branch-rail path{fill:none;stroke:#d2d8c9;stroke-width:4;vector-effect:non-scaling-stroke}.rail-node{position:absolute;transform:translate(-50%,-50%);width:34px;height:34px;min-width:34px;min-height:34px;padding:0;background:#f2f1e9;border:1px solid #c4caba;border-radius:50%;font-size:11px}.rail-node.is-current{background:#476652;color:white}.rail-thumb{position:absolute;transform:translate(-50%,-50%);border-radius:50%;width:44px;height:44px;min-width:44px;min-height:44px;border:2px solid #476652;background:#47665222;cursor:grab;touch-action:none}.rail-thumb:active{cursor:grabbing;background:#47665255}.branch-labels{display:flex;align-items:center;gap:8px;font-size:10px;margin-top:2px}.branch-labels>span{flex:1;color:#7b806f}.branch-labels button{font-size:11px;background:#eeeee5;min-height:34px;padding:5px 10px;max-width:32%}.branch-labels button.is-chosen{background:#dbe5d5;color:#365032;box-shadow:inset 0 0 0 1px #88a07f}.reveal-bar{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:#8a8f80}.reveal-bar button{min-height:27px;font-size:10px;padding:2px 0}.demo-inspector{position:absolute;right:22px;top:100px;bottom:250px;width:340px;background:#fffdf7f5;pointer-events:auto;padding:24px;overflow:auto;border:1px solid #d7d4c8;border-radius:16px;box-shadow:0 10px 35px #24322618}.demo-inspector h3{font:25px Georgia;margin:0 0 18px}.demo-inspector>button[data-hide]{float:right;margin:-15px -15px 0 0}.demo-inspector p{font-size:13px}.demo-inspector label{display:block;margin:14px 0;font-size:14px}.inspector-thought,.inspector-speech{padding:14px 16px;border-radius:16px;border:1px solid #d0d4c5;margin:14px 0}.inspector-thought{border-style:dashed;background:#f1f2e9}.inspector-thought span,.inspector-speech span{font-size:9px;text-transform:uppercase;letter-spacing:.12em;color:#7b8371}.demo-comparison{position:absolute;inset:90px 20px 20px;background:#fffdf7;pointer-events:auto;overflow:auto;border:1px solid #d7d4c8;border-radius:18px;padding:25px;z-index:10;box-shadow:0 15px 70px #24322633}.demo-comparison header{display:flex;justify-content:space-between;align-items:center}.demo-comparison h2{font:27px Georgia}.compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px}.compare-grid article{border-top:1px solid #ddd;padding-top:18px}.compare-grid article>span{font-size:10px;letter-spacing:.1em}.compare-grid h3{font:22px Georgia}.compare-grid canvas{position:static;width:100%;height:auto;border-radius:12px}.compare-grid p{font-size:13px}.compare-grid button{background:#476652;color:white;margin-top:12px}.protocol-mini h2{font:19px Georgia}.protocol-mini h3{font:16px Georgia}.protocol-mini section{border-top:1px solid #ddd;padding:16px 0;margin-top:18px}
@media(max-width:1050px){.scene-grid{grid-template-columns:repeat(2,1fr)}.demo-caption{max-width:300px}.demo-caption h2{font-size:24px}.player-top{flex-wrap:wrap;gap:4px}.player-top [data-position]{margin-left:10px}.demo-header{gap:8px}.demo-controls{padding:8px 14px}.demo-inspector{bottom:270px}}
@media(max-width:600px){.toolbar .demo-launch{font-size:10px;min-width:90px;margin-right:5px;padding:5px}.toolbar h1{max-width:170px;font-size:17px}.scene-grid{grid-template-columns:1fr}.scene-card{min-height:220px;padding:22px}.demo-library{padding:24px 18px}.demo-library h1{font-size:35px}.demo-header{padding:8px;flex-wrap:wrap}.demo-header>div{min-width:55%}.demo-header strong{font-size:15px}.demo-header .eyebrow{font-size:8px}.demo-header [data-library]{font-size:11px}.demo-header [data-detach]{font-size:10px;order:4;min-height:30px;width:100%}.demo-caption{top:113px;left:16px;right:16px;max-width:unset;pointer-events:none}.demo-caption h2{font-size:22px;max-width:90%;margin:7px 0}.demo-caption [data-context]{background:#fffcf5d9;border-radius:5px;pointer-events:auto;padding:3px 6px}.demo-controls{bottom:8px;width:calc(100% - 16px);padding:8px}.player-top{gap:0}.player-top label{font-size:10px}.player-top>.row{flex:1}.player-top button{font-size:10px;padding:4px 6px;min-height:34px}.player-top [data-position]{margin-left:auto}.player-top [data-layers],.player-top [data-protocol],.player-top [data-compare]{margin-top:4px}.branch-rail{height:76px;margin:0 8px}.branch-labels{flex-wrap:wrap;gap:5px}.branch-labels>span{flex-basis:100%;font-size:9px}.branch-labels button{max-width:unset;flex:1;font-size:9px;line-height:1.2;padding:5px;min-height:36px}.rail-node{width:30px;height:30px;min-width:30px;min-height:30px}.demo-inspector{top:auto;left:0;right:0;bottom:0;width:100%;max-height:60dvh;z-index:12;border-radius:20px 20px 0 0}.demo-comparison{inset:10px;padding:16px}.demo-comparison h2{font-size:23px}.compare-grid{grid-template-columns:1fr}.compare-grid canvas{max-height:250px;object-fit:contain}#board-badge{top:90px;max-width:95%;width:95%;font-size:10px;gap:5px}#board-badge .phase{font-size:8px}#board-badge>span:last-child{display:none}}
@media(prefers-reduced-motion:reduce){.scene-card:hover{transform:none}.demo-shell *{scroll-behavior:auto}}
.branch-rail .rail-node{width:44px;height:44px;min-width:44px;min-height:44px}.demo-header button:focus-visible,.rail-thumb:focus-visible{outline:3px solid #a97430;outline-offset:4px}
/* ── Farbwähler: volle Fläche statt Strich ── */
.panel input[type=color]{height:42px;padding:4px 6px;cursor:pointer;border-radius:8px;background:white}
.panel input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.panel input[type=color]::-webkit-color-swatch{border:0;border-radius:5px}
/* ── Schnellauswahl-Farbfelder ── */
.color-swatches{display:flex;flex-wrap:wrap;gap:5px;margin:6px 0 10px}
.color-swatch{width:28px;height:28px;min-width:28px;min-height:28px;border-radius:6px;border:2px solid transparent;padding:0;cursor:pointer;transition:transform .1s,border-color .1s}
.color-swatch:hover{transform:scale(1.15)}
.color-swatch.is-active{border-color:#343c34;box-shadow:0 0 0 1px #343c3460}
/* ── Figurenform-Kacheln ── */
.shape-tiles{display:flex;gap:5px;margin:6px 0 10px}
.shape-tile{flex:1;min-width:0;height:52px;padding:4px 2px 3px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:9px;color:#697368;border:2px solid var(--line);border-radius:9px;background:white;cursor:pointer;transition:border-color .1s,background .1s}
.shape-tile:hover{border-color:#a0a89a;background:#f5f3ec}
.shape-tile.is-active{border-color:var(--accent);background:#e8f0ea;color:var(--accent)}
.shape-tile svg{display:block}
/* ── Palette minimiert ── */
.palette{transition:width .2s ease}
.palette .palette-label{display:inline}
.palette.palette--mini{width:46px;overflow:hidden}
.palette.palette--mini .palette-label{display:inline-block;max-width:0;opacity:0;overflow:hidden;vertical-align:middle;transition:max-width .2s,opacity .15s}
.palette.palette--mini button[data-add]{justify-content:center;padding:6px 4px}
.palette.palette--mini #hide-palette{font-size:18px;min-height:36px;padding:4px;text-align:center}

/* ── Sequenz-Modus (Momente als Player-Leiste) ── */
body.demo-sequence-mode .bottom { display: none !important; }
.demo-controls.sequence-controls {
    z-index: 20;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 253, 248, 0.96);
    border-top: 1px solid #d2daca;
    box-shadow: 0 -8px 30px rgba(30, 45, 34, 0.12);
}

.sequence-controls .player-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 14px;
}

.sequence-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sequence-group.group-moments {
    border-left: 1px solid rgba(40, 60, 45, 0.14);
    border-right: 1px solid rgba(40, 60, 45, 0.14);
    padding: 0 10px;
    margin: 0 4px;
}

.sequence-group.group-view {
    border-right: 1px solid rgba(40, 60, 45, 0.14);
    padding-right: 10px;
    margin-right: 4px;
}

.sequence-group.group-close {
    margin-left: auto;
}

.sequence-moment-title {
    background: #f2f6ee;
    border: 1px solid #c9d5c4;
    border-radius: 9px;
    color: #243e2e;
    font-weight: 600;
    font-size: 12px;
    padding: 5px 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.16s ease;
}

.sequence-moment-title:hover {
    background: #e6ede1;
    border-color: #8da693;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(36, 50, 38, 0.1);
}

.sequence-btn-add {
    background: linear-gradient(135deg, #3d634d, #2e4d3a) !important;
    color: #fffdf8 !important;
    border: 1px solid #233e2e !important;
    border-radius: 10px !important;
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.16s ease;
    box-shadow: 0 2px 6px rgba(46, 77, 58, 0.22);
}

.sequence-btn-add:hover {
    background: linear-gradient(135deg, #49755b, #355943) !important;
    border-color: #2b4b37 !important;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(46, 77, 58, 0.32);
}

.sequence-btn-add:active {
    transform: translateY(0.5px);
}

.sequence-btn-fork {
    background: #f0f6ee !important;
    border: 1px solid #3d6849 !important;
    color: #1e432a !important;
    border-radius: 9px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.16s ease;
}

.sequence-btn-fork:hover {
    background: #e3efdf !important;
    border-color: #2a5234 !important;
    transform: translateY(-1.5px);
    box-shadow: 0 3px 10px rgba(30, 67, 42, 0.16);
}

.sequence-btn-compare {
    background: #fbf5e9 !important;
    border: 1px solid #c9b99a !important;
    color: #6a4f1e !important;
    border-radius: 9px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.16s ease;
}

.sequence-btn-compare:hover {
    background: #f4ebd5 !important;
    border-color: #9f8c69 !important;
    transform: translateY(-1.5px);
    box-shadow: 0 3px 10px rgba(106, 79, 30, 0.16);
}

.sequence-btn-delete {
    background: #fdf3f2 !important;
    border: 1px solid #ebd0cd !important;
    color: #922c26 !important;
    border-radius: 9px !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
    cursor: pointer;
    transition: all 0.16s ease;
}

.sequence-btn-delete:hover:not(:disabled) {
    background: #fce8e6 !important;
    border-color: #d89e98 !important;
    transform: translateY(-1.5px);
    box-shadow: 0 3px 8px rgba(146, 44, 38, 0.15);
}

.sequence-btn-delete:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.sequence-btn-close {
    background: #f0f4ec !important;
    border: 1px solid #c8d4c4 !important;
    color: #354d3e !important;
    border-radius: 9px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    cursor: pointer;
    transition: all 0.16s ease;
}

.sequence-btn-close:hover {
    background: #e4ebe0 !important;
    border-color: #a4b89e !important;
    transform: translateY(-1.5px);
    box-shadow: 0 3px 8px rgba(53, 77, 62, 0.14);
}

.sequence-save-btn {
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.sequence-save-btn.is-clean {
    opacity: 0.45;
    background: #eef2ec;
    color: #6a7c6e;
    border: 1px solid #cbd6c7;
    cursor: default;
    pointer-events: none;
}
.sequence-save-btn.is-dirty {
    opacity: 1;
    background: #2e7d32;
    color: #ffffff;
    border: 1px solid #1b5e20;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.35);
    animation: save-pulse 2s infinite;
}
@keyframes save-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.35); }
    50% { box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.65); }
}
.sequence-save-btn.is-saved {
    background: #1b5e20 !important;
    color: #ffffff !important;
    border-color: #0d3813 !important;
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.5) !important;
}
.sequence-toast {
    background: #e6f4ea;
    border: 1px solid #a8dab5;
    color: #1b5e20;
    padding: 4px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
}

/* ── Ausrichtungs-Hilfe (Horizontale Drehung) ── */
.rotation-guide {
    position: fixed;
    transform: translate(-50%, -100%);
    pointer-events: none;
    z-index: 1000;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(28, 38, 30, 0.45);
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.rotation-guide-head {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.rotation-guide-arrow {
    opacity: 0.65;
    font-size: 10px;
}
.rotation-guide-angle {
    min-width: 28px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.rotation-guide-target {
    font-size: 10px;
    font-weight: 500;
    color: #f7eed7;
    opacity: 0.95;
    letter-spacing: 0.02em;
}
.orbit button[data-handle="rotation"] {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.figure-form label output {
    float: right;
    font-size: 11px;
    color: #466652;
    font-weight: 600;
}

/* ── Beziehungen-Tab im Figuren-Panel ── */
.relations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}
.rel-row {
    background: #f7f5ed;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rel-row--empty {
    background: transparent;
    border: 1px dashed var(--line);
    padding: 8px 12px;
}
.rel-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.rel-target-info {
    font-size: 13px;
    color: var(--ink);
}
.rel-target-head {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    min-height: 28px;
    min-width: unset;
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.rel-target-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #e9ece4;
    border-radius: 50%;
    font-size: 12px;
}
.rel-add-btn {
    font-size: 12px;
    padding: 4px 10px;
    min-height: 32px;
    min-width: unset;
    border: 1px solid var(--line);
    background: white;
    border-radius: 8px;
}
.rel-add-btn:hover {
    border-color: var(--accent);
    background: #f0f4ee;
}
.rel-del-btn {
    min-width: 28px;
    min-height: 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 26px;
    font-size: 16px;
    border-radius: 50%;
    border: 1px solid #d9c5c2;
    background: white;
    color: #9b392e;
    cursor: pointer;
}
.rel-del-btn:hover {
    background: #fbeee8;
    border-color: #9b392e;
}
.rel-row-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.rel-arrows-line,
.rel-arrows-group {
    display: flex;
    gap: 6px;
    width: 100%;
}
.rel-arrow-btn {
    flex: 1;
    min-width: 0;
    min-height: 36px;
    height: 36px;
    padding: 4px 10px;
    border: 1.5px solid var(--line);
    border-radius: 9px;
    background: white;
    color: #4f5b4d;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.rel-arrow-btn.is-active {
    background: #eef4ec;
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(70, 102, 82, 0.15);
}
.rel-arrow-btn:hover {
    border-color: var(--accent);
    background: #f7faf5;
}
.rel-line-btn {
    min-width: 38px;
    min-height: 30px;
    height: 30px;
    padding: 0 6px;
    border: none;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font-family: monospace;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
}
.rel-line-btn:hover {
    background: #f0f4ee;
}
.rel-strength-group {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    overflow: hidden;
}
.rel-strength-btn {
    min-width: unset;
    min-height: 30px;
    padding: 0 8px;
    border: none;
    border-right: 1px solid var(--line);
    background: transparent;
    color: #697368;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.rel-strength-btn:last-child {
    border-right: none;
}
.rel-strength-btn.is-active {
    background: #e3ebe0;
    color: var(--accent);
    font-weight: 700;
}
.rel-row-inputs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rel-emoji-group {
    display: flex;
    gap: 6px;
    align-items: center;
}
.rel-emoji-select {
    flex: 1;
    height: 34px;
    font-size: 12px;
    padding: 4px 6px !important;
}
.rel-emoji-input {
    width: 38px !important;
    min-width: 38px;
    height: 32px;
    text-align: center;
    font-size: 15px;
    line-height: 28px;
    padding: 0 !important;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.rel-emoji-input:hover {
    border-color: var(--accent);
    background: #f7f9f5;
}
.rel-emoji-input:focus {
    border-color: var(--accent);
    outline: none;
    background: white;
    box-shadow: 0 0 0 2px rgba(90, 115, 80, 0.2);
}
.rel-label-input {
    flex: 1 1 auto;
    min-width: 100px;
    height: 32px;
    font-size: 12px;
    padding: 4px 8px !important;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

/* ── Ein-Zeilen-Layout für Beziehungen ── */
.rel-row-single {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    padding: 8px 10px;
    min-height: 50px;
}
@media (max-width: 700px) {
    .rel-row-single {
        overflow-x: auto;
    }
}
/* Alle direkten Kindelemente der Beziehungszeile auf gleicher vertikaler Mitte ohne Fremdmargins */
.rel-row-single > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-self: center !important;
}
.rel-row-single .rel-target-head {
    flex-shrink: 0;
    max-width: 130px;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    line-height: 1;
}
.rel-row-single .rel-target-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #e9ece4;
    border-radius: 50%;
    font-size: 12px;
    flex-shrink: 0;
}
.rel-row-single .rel-arrows-line {
    flex-shrink: 0;
}
.rel-row-single .rel-strength-group {
    flex-shrink: 0;
}
/* ── Kompakter Emoji-Picker für Beziehungen ── */
.rel-row-single .rel-emoji-picker {
    position: relative;
    flex-shrink: 0;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    display: inline-flex;
    align-items: center;
    padding: 0;
    margin: 0 !important;
    box-sizing: border-box;
}
.rel-row-single .rel-emoji-input {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center;
    font-size: 15px;
    line-height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    box-sizing: border-box;
}
.rel-row-single .rel-label-input {
    flex: 1 1 auto;
    min-width: 90px;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    font-size: 12px;
    box-sizing: border-box;
    line-height: 1.4;
}
.rel-emoji-picker {
    position: relative;
    flex-shrink: 0;
}
.rel-symbol-select {
    display: none !important;
}
.rel-emoji-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 70;
    width: 220px;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(35, 45, 40, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: appear 0.14s ease-out;
}
.rel-emoji-menu[hidden] {
    display: none !important;
}
.rel-emoji-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: #f6f5ef;
    border-bottom: 1px solid var(--line);
}
.rel-emoji-clear-btn {
    background: none;
    border: none;
    font-size: 11px;
    color: #b33a2b;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
}
.rel-emoji-clear-btn:hover {
    background: rgba(179, 58, 43, 0.12);
}
.rel-emoji-menu-list {
    overflow-y: auto;
    max-height: 220px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rel-emoji-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    color: var(--ink);
    transition: background 0.12s ease;
}
.rel-emoji-item:hover {
    background: #eef3ea;
}
.rel-emoji-item.is-selected {
    background: #e0ebd7;
    font-weight: 600;
}
.rel-emoji-char {
    font-size: 15px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.rel-emoji-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rel-row-single .rel-del-btn {
    flex-shrink: 0;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 18px;
    border-radius: 50%;
    border: 1px solid #d9c5c2;
    background: white;
    color: #9b392e;
    cursor: pointer;
    box-sizing: border-box;
}

/* ── Ausklapp-Menü für Pfeile, Linienart & Stärke ── */
.rel-menu-details {
    position: relative;
    flex-shrink: 0;
}
.rel-row-single .rel-menu-details {
    position: relative;
    flex-shrink: 0;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    display: inline-flex;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
}
.rel-menu-details summary {
    list-style: none;
    user-select: none;
    cursor: pointer;
}
.rel-menu-details summary::-webkit-details-marker {
    display: none;
}
.rel-menu-summary {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    font-size: 13px;
    color: var(--ink);
    transition: border-color 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}
.rel-row-single .rel-menu-summary {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    margin: 0 !important;
    padding: 0 8px !important;
}
.rel-menu-summary:hover {
    border-color: var(--accent);
    background: #f7f9f5;
}
.rel-summary-arrow {
    font-weight: 700;
    min-width: 12px;
    text-align: center;
    transition: opacity 0.15s ease;
}
.rel-summary-arrow.is-dim {
    opacity: 0.28;
}
.rel-summary-arrow.is-active {
    opacity: 1;
    color: var(--accent);
}
.rel-summary-caret {
    font-size: 10px;
    color: #7b8577;
    margin-left: 2px;
    transition: transform 0.15s ease;
}
.rel-menu-details[open] .rel-summary-caret {
    transform: rotate(180deg);
}
.rel-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 80;
    width: 330px;
    min-width: 330px;
    background: #fffefb;
    border: 1px solid #d4ded0;
    border-radius: 14px;
    box-shadow: 0 14px 38px rgba(35, 48, 38, 0.22);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    animation: appear 0.14s ease-out;
}
.rel-menu-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rel-menu-heading {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6a7767;
}

/* 1. Pfeil-Richtung Buttons */
.rel-arrows-group {
    display: flex;
    gap: 8px;
    width: 100%;
}
.rel-arrow-btn {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    padding: 6px 10px;
    border: 1.5px solid #d5ddd0;
    border-radius: 9px;
    background: white;
    color: #4b5848;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.rel-arrow-btn:hover {
    border-color: var(--accent);
    background: #f7faf5;
}
.rel-arrow-btn.is-active {
    background: #e9f2e5;
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(70, 102, 82, 0.12);
}
.rel-arrow-icon {
    font-size: 14px;
    font-weight: 700;
    color: inherit;
    line-height: 1;
}
.rel-arrow-text {
    font-size: 12px;
    color: inherit;
    line-height: 1;
}

/* 2. Linienart Kacheln */
.rel-line-styles-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
}
.rel-line-pick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 4px 7px;
    min-height: 48px;
    border: 1.5px solid #d5ddd0;
    border-radius: 9px;
    background: white;
    color: #4b5848;
    cursor: pointer;
    transition: all 0.15s ease;
}
.rel-line-pick-btn:hover {
    border-color: var(--accent);
    background: #f7faf5;
}
.rel-line-pick-btn.is-active {
    background: #e9f2e5;
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 2px 6px rgba(70, 102, 82, 0.12);
}
.rel-line-preview {
    display: block;
    width: 70%;
    height: 0;
    border-top-width: 2.5px;
    border-top-color: currentColor;
    margin: 2px 0 0;
}
.rel-line-preview--solid {
    border-top-style: solid;
}
.rel-line-preview--dashed {
    border-top-style: dashed;
}
.rel-line-preview--dotted {
    border-top-style: dotted;
}
.rel-line-name {
    font-size: 11px;
    font-weight: 500;
    color: inherit;
    line-height: 1;
}
.rel-line-pick-btn.is-active .rel-line-name {
    font-weight: 700;
}

/* 3. Stärke Kacheln */
.rel-strength-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
}
.rel-strength-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 4px 7px;
    min-height: 48px;
    border: 1.5px solid #d5ddd0;
    border-radius: 9px;
    background: white;
    color: #4b5848;
    cursor: pointer;
    transition: all 0.15s ease;
}
.rel-strength-btn:hover {
    border-color: var(--accent);
    background: #f7faf5;
}
.rel-strength-btn.is-active {
    background: #e9f2e5;
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 2px 6px rgba(70, 102, 82, 0.12);
}
.rel-thickness-bar {
    display: block;
    width: 70%;
    background: currentColor;
    border-radius: 2px;
    margin: 2px 0 0;
}
.rel-strength-name {
    font-size: 11px;
    font-weight: 500;
    color: inherit;
    line-height: 1;
}
.rel-strength-name small {
    font-size: 9px;
    opacity: 0.8;
    font-weight: normal;
}
.rel-strength-btn.is-active .rel-strength-name {
    font-weight: 700;
}

/* ── Inline-Name-Pill auf dem Arbeitsbrett ── */
.board-inline-name-input {
    position: fixed;
    transform: translate(-50%, -50%);
    z-index: 100;
    min-width: 70px;
    max-width: 140px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    background: #fffcf5f0;
    color: var(--ink);
    border: 1px solid var(--accent);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(70, 102, 82, 0.25);
    outline: none;
}

/* ── 3D-Badge auf dem Haltung-Tab ── */
.tab-badge-3d {
    margin-left: 5px;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #466652;
    background: #e3ebe0;
    border: 1px solid #c2d4bc;
    border-radius: 6px;
    cursor: pointer;
    vertical-align: middle;
}
.tab-badge-3d:hover {
    background: #466652;
    color: white;
}

/* ── Dropdown Emoji-Picker im Figur-Tab (analog zu Beziehungen) ── */
.figure-emoji-picker {
    position: relative;
    width: 100%;
    margin: 4px 0 12px;
}
.figure-emoji-trigger {
    width: 100%;
    height: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--ink);
    font-size: 13px;
    cursor: pointer;
    box-sizing: border-box;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.figure-emoji-trigger:hover {
    border-color: var(--accent);
    background: #f7faf5;
}
.figure-emoji-char-preview {
    font-size: 18px;
    min-width: 26px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}
.figure-emoji-label-preview {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
}
.figure-emoji-caret {
    font-size: 11px;
    color: #7b8577;
    margin-left: 4px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.figure-emoji-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 75;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(35, 45, 40, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: appear 0.14s ease-out;
}
.figure-emoji-menu[hidden] {
    display: none !important;
}
.figure-emoji-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted, #677163);
    background: #f6f5ef;
    border-bottom: 1px solid var(--line);
}
.figure-emoji-clear-btn {
    background: none;
    border: none;
    font-size: 11px;
    color: #b33a2b;
    cursor: pointer;
    padding: 2px 6px;
    min-height: unset;
    min-width: unset;
    border-radius: 4px;
    line-height: 1;
}
.figure-emoji-clear-btn:hover {
    background: rgba(179, 58, 43, 0.12);
}
.figure-emoji-menu-list {
    overflow-y: auto;
    max-height: 250px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.figure-emoji-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    color: var(--ink);
    transition: background 0.12s ease;
}
.figure-emoji-item:hover {
    background: #eef3ea;
}
.figure-emoji-item.is-selected {
    background: #e0ebd7;
    font-weight: 600;
}
.figure-emoji-char {
    font-size: 17px;
    min-width: 26px;
    text-align: center;
    flex-shrink: 0;
}
.figure-emoji-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Frontalansicht 3D Beschriftung & 3D Glow ── */
.figure-preview .help.figure-preview-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #3b5c46;
    background: #e1eae0;
    border: 1px solid #bed2bd;
    border-radius: 999px;
    padding: 3px 12px;
    margin: 4px auto 10px;
    transition: all 0.16s ease;
    user-select: none;
}
.figure-preview .help.figure-preview-label:hover {
    background: #3b5c46;
    color: #fff;
    border-color: #2e4937;
    box-shadow: 0 2px 10px rgba(59, 92, 70, 0.3);
    transform: translateY(-1px);
}
@keyframes button3DGlow {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(70, 102, 82, 0.4), 0 0 14px 4px rgba(70, 102, 82, 0.6);
        border-color: #466652;
        transform: scale(1.06);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(70, 102, 82, 0.7), 0 0 24px 8px rgba(70, 102, 82, 0.9);
        border-color: #2b4535;
        transform: scale(1.1);
    }
}
.view-switch button[data-mode="3d"].is-highlight-glow,
button[data-mode="3d"].is-highlight-glow {
    animation: button3DGlow 1s ease-in-out infinite !important;
    background: #3f6251 !important;
    color: #fffdf6 !important;
    border-color: #5bb382 !important;
    z-index: 10;
    position: relative;
}
.view-switch.is-switch-glowing {
    border-color: #466652 !important;
    box-shadow: 0 0 18px rgba(70, 102, 82, 0.4) !important;
}

/* ── Körpergefühl Leerer Zustand Klickbarer Satz ── */
.feeling-empty-state {
    padding: 16px 0;
    text-align: center;
}
.feeling-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #466652;
    background: #f3f6f0;
    border: 1.5px dashed #a8bba4;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.16s ease;
    text-align: center;
    box-sizing: border-box;
}
.feeling-empty-btn:hover {
    background: #e8f0e4;
    border-color: #466652;
    color: #2b4535;
    box-shadow: 0 3px 12px rgba(70, 102, 82, 0.14);
    transform: translateY(-1px);
}
.feeling-empty-icon {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}
.feeling-empty-text {
    line-height: 1.3;
}

/* ── Orbit Duo-Tone Buttons & Active State ── */
.orbit button {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.orbit button svg {
    display: block;
    margin: auto;
}
.orbit button.is-highlighted,
.orbit button.is-active {
    background: #e6ede3 !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    box-shadow: 0 0 0 2.5px rgba(70, 102, 82, 0.42), 0 5px 16px rgba(70, 102, 82, 0.35) !important;
    transform: scale(1.14);
    z-index: 10;
}
.orbit button.is-highlighted svg,
.orbit button.is-active svg {
    color: var(--accent);
}

/* ── Mehrzeilige hellgraue Placeholder für Inneres Erleben ── */
.thought-label textarea,
.voice-label textarea,
.panel textarea[data-thought],
.panel textarea[data-field="voice"] {
    min-height: 96px;
    line-height: 1.5;
    font-size: 12.5px;
    padding: 10px 12px;
    border-radius: 9px;
    border: 1px solid var(--line);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.thought-label textarea:focus,
.voice-label textarea:focus,
.panel textarea[data-thought]:focus,
.panel textarea[data-field="voice"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(70, 102, 82, 0.18);
}
.thought-label textarea::placeholder,
.voice-label textarea::placeholder,
.panel textarea[data-thought]::placeholder,
.panel textarea[data-field="voice"]::placeholder {
    color: #8c9789;
    font-size: 11px;
    line-height: 1.5;
    font-style: italic;
    opacity: 0.85;
}

/* ── Player Optik-Politur & Taktile Button-Hovers ── */
.demo-controls {
    width: min(var(--player-max-width, 960px), calc(100vw - 32px)) !important;
    max-width: 1460px !important;
    background: rgba(255, 253, 247, 0.96) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(210, 216, 204, 0.9) !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 45px rgba(28, 42, 32, 0.12), 0 2px 6px rgba(28, 42, 32, 0.05) !important;
    transition: width 0.22s ease, max-width 0.22s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.branch-rail {
    position: relative;
    width: 100%;
    touch-action: pan-x;
    transition: height 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.branch-rail.is-expanded {
    height: 134px !important;
}

/* Horizontales Scroll-Band für schmale Viewports und lange Momentenreihen */
.branch-rail-scroll-wrap {
    position: relative;
    width: 100%;
    margin: 4px 0;
    overflow: hidden;
    border-radius: 14px;
}

.branch-rail-scroll-wrap::before,
.branch-rail-scroll-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 38px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.branch-rail-scroll-wrap::before {
    left: 0;
    background: linear-gradient(to right, rgba(255, 253, 247, 0.98) 20%, rgba(255, 253, 247, 0));
}

.branch-rail-scroll-wrap::after {
    right: 0;
    background: linear-gradient(to left, rgba(255, 253, 247, 0.98) 20%, rgba(255, 253, 247, 0));
}

.branch-rail-scroll-wrap.has-overflow-left::before {
    opacity: 1;
}

.branch-rail-scroll-wrap.has-overflow-right::after {
    opacity: 1;
}

.branch-rail-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(71, 102, 82, 0.25) transparent;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 6px 6px 4px 6px;
}

.branch-rail-scroll::-webkit-scrollbar {
    height: 4px;
}

.branch-rail-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.branch-rail-scroll::-webkit-scrollbar-thumb {
    background: rgba(71, 102, 82, 0.25);
    border-radius: 4px;
}

.branch-rail-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(71, 102, 82, 0.5);
}

/* Dichter Modus für Großensembles mit 15+ Schritten */
.demo-controls.is-dense .branch-rail .rail-node {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    min-height: 35px !important;
    font-size: 11px !important;
}

.demo-controls.is-dense .branch-rail .rail-thumb {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
}

.player-top {
    gap: 8px;
}

.player-top button {
    font-size: 11.5px;
    padding: 6px 11px;
    border-radius: 9px;
    border: 1px solid #ccd4c7;
    background: #ffffff;
    color: #27382d;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.15s ease,
                border-color 0.15s ease,
                box-shadow 0.15s ease,
                color 0.15s ease;
}

.player-top button:hover {
    background: #f4f8f2;
    border-color: #8da693;
    color: #17291e;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(36, 50, 38, 0.12), 0 1px 2px rgba(36, 50, 38, 0.06);
}

.player-top button:active {
    transform: translateY(0.5px);
    box-shadow: 0 1px 2px rgba(36, 50, 38, 0.08);
}

.player-top button:focus-visible {
    outline: 2.5px solid #476652;
    outline-offset: 2px;
}

/* Play/Pause Button */
.player-top .play-button {
    background: linear-gradient(135deg, #3d634d, #2e4d3a) !important;
    color: #ffffff !important;
    border: 1px solid #233e2e !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    padding: 7px 16px !important;
    box-shadow: 0 2px 8px rgba(46, 77, 58, 0.26) !important;
}

.player-top .play-button:hover {
    background: linear-gradient(135deg, #49755b, #355943) !important;
    border-color: #2b4b37 !important;
    transform: translateY(-1.5px);
    box-shadow: 0 5px 16px rgba(46, 77, 58, 0.36), 0 2px 4px rgba(46, 77, 58, 0.18) !important;
}

.player-top .play-button:active {
    transform: translateY(0.5px);
    box-shadow: 0 2px 4px rgba(46, 77, 58, 0.2) !important;
}

/* Pfeil-Buttons */
.player-top [data-prev],
.player-top [data-next] {
    min-width: 34px;
    height: 32px;
    font-size: 13px;
    font-weight: 700;
}

/* Zoom Buttons */
.player-top [data-zoom-out],
.player-top [data-zoom-in],
.player-top [data-zoom-fit] {
    min-width: 32px;
    height: 32px;
    padding: 4px 8px;
    font-size: 13px;
}

/* Position pill */
.player-top [data-position] {
    background: #edf2e9;
    border: 1px solid #d4decfa0;
    color: #384e40;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-left: auto;
}

/* Tempo Dropdown */
.player-top label {
    background: #f7faf5;
    border: 1px solid #ccd4c7;
    border-radius: 9px;
    padding: 2px 8px;
    color: #405244;
    transition: border-color 0.15s ease;
}
.player-top label:hover {
    border-color: #8da693;
}
.player-top select {
    cursor: pointer;
    font-weight: 500;
}

/* Rail Nodes & Thumb */
.branch-rail .rail-node {
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.18s ease,
                background 0.18s ease,
                border-color 0.18s ease;
}
.branch-rail .rail-node:hover {
    transform: translate(-50%, -50%) scale(1.18);
    background: #ffffff;
    border-color: #3d634d;
    box-shadow: 0 4px 12px rgba(36, 50, 38, 0.22);
}
.branch-rail .rail-node.is-current {
    background: #3d634d !important;
    color: #ffffff !important;
    border-color: #274332 !important;
    box-shadow: 0 0 0 3px rgba(61, 99, 77, 0.25), 0 4px 10px rgba(36, 50, 38, 0.2) !important;
}

.branch-rail .rail-thumb {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.branch-rail .rail-thumb:hover {
    border-color: #274332;
    box-shadow: 0 0 0 4px rgba(61, 99, 77, 0.22);
}

/* Branch Labels */
.branch-labels button {
    transition: all 0.16s ease;
    border-radius: 9px;
    cursor: pointer;
}
.branch-labels button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(36, 50, 38, 0.12);
    border-color: #8da693;
}

/* Header Buttons */
.demo-header button {
    transition: all 0.16s ease;
    border-radius: 8px;
    cursor: pointer;
}
.demo-header button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(36, 50, 38, 0.1);
}
.demo-header [data-detach]:hover {
    background: #dbe4d2 !important;
    border-color: #7b9c83 !important;
}

/* ── Überarbeitetes Wege-Vergleichen (Modal & High-DPI Cards) ── */
.demo-comparison {
    position: fixed !important;
    inset: 40px max(24px, calc((100vw - 1280px) / 2)) !important;
    background: rgba(255, 253, 248, 0.98) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid #d0d7ca !important;
    border-radius: 22px !important;
    padding: 0 !important;
    z-index: 40 !important;
    box-shadow: 0 25px 90px rgba(24, 38, 28, 0.35) !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

.compare-modal-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: auto;
    padding: 28px 34px 34px;
}

.compare-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e1e6db;
}

.compare-eyebrow {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #637562;
    display: block;
    margin-bottom: 4px;
}

.compare-modal-header h2 {
    font: 28px/1.2 Georgia, serif !important;
    color: #1f3325;
    margin: 4px 0 6px !important;
}

.compare-intro {
    font-size: 13.5px;
    color: #556253;
    line-height: 1.5;
    margin: 0;
    max-width: 820px;
}

.compare-modal-close {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    border: 1px solid #cfd7c9;
    background: #ffffff;
    font-size: 20px;
    line-height: 1;
    color: #4a5c4e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.compare-modal-close:hover {
    background: #f0f4ec;
    border-color: #8da493;
    transform: rotate(90deg);
}

.compare-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)) !important;
    gap: 24px !important;
    align-items: stretch;
}

.compare-card {
    border-radius: 18px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 18px rgba(36, 50, 38, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    overflow: hidden;
}

.compare-card.branch-a {
    background: #ffffff;
    border: 1px solid #bed2c4;
    border-top: 5px solid #3d634d;
}

.compare-card.branch-b {
    background: #ffffff;
    border: 1px solid #ded0b4;
    border-top: 5px solid #8c6a2e;
}

.compare-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(36, 50, 38, 0.12);
}

.compare-card-top {
    margin-bottom: 12px;
}

.compare-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.compare-branch-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 100px;
}

.compare-branch-tag.tag-a {
    background: #eaf2ec;
    color: #274b35;
    border: 1px solid #bdd3c3;
}

.compare-branch-tag.tag-b {
    background: #fbf5e9;
    color: #6a4f1e;
    border: 1px solid #e1d3b7;
}

.compare-current-badge {
    font-size: 10px;
    font-weight: 600;
    background: #edf3e7;
    color: #3b5c46;
    padding: 3px 8px;
    border-radius: 100px;
    border: 1px solid #c9d8c3;
}

.compare-choice-title {
    font: 23px/1.25 Georgia, serif !important;
    color: #1a2a1f;
    margin: 4px 0 4px !important;
}

.compare-node-title {
    font-size: 13px;
    font-weight: 600;
    color: #637160;
}

.compare-canvas-wrap {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #d5dcce;
    background: #f7f5ed;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.05);
    margin: 12px 0 16px;
    position: relative;
}

.compare-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
}

.compare-quote {
    margin: 0 0 14px;
    padding: 10px 14px;
    background: #f4f6ef;
    border-left: 3px solid #688572;
    border-radius: 0 8px 8px 0;
    font: italic 13.5px/1.4 Georgia, serif;
    color: #2f4033;
}

.compare-field-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #727e6e;
    margin-bottom: 4px;
}

.compare-dynamics {
    font-size: 13px;
    line-height: 1.5;
    color: #374338;
    margin-bottom: 12px;
}

.compare-dynamics p {
    margin: 0;
}

.compare-somatic {
    margin-bottom: 16px;
}

.compare-soma-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.compare-soma-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    background: #f9faf6;
    padding: 5px 9px;
    border-radius: 7px;
    border: 1px solid #e5eae0;
}

.compare-soma-label {
    font-weight: 600;
    color: #2e3e31;
}

.compare-soma-values {
    display: flex;
    align-items: center;
    gap: 6px;
}

.soma-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
.soma-badge.heaviness {
    background: #f5ebe1;
    color: #8c5d33;
}
.soma-badge.relief {
    background: #e2ede5;
    color: #2f593e;
}
.soma-tag {
    font-size: 10.5px;
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #d8dfd2;
}

.compare-card-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #ebeee6;
}

.compare-take-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.16s ease;
}

.compare-take-btn.btn-a {
    background: #3d634d;
    color: #ffffff;
    border: 1px solid #284433;
}
.compare-take-btn.btn-a:hover {
    background: #47755b;
    box-shadow: 0 4px 14px rgba(61, 99, 77, 0.3);
    transform: translateY(-1px);
}

.compare-take-btn.btn-b {
    background: #8c6a2e;
    color: #ffffff;
    border: 1px solid #634b20;
}
.compare-take-btn.btn-b:hover {
    background: #a37c35;
    box-shadow: 0 4px 14px rgba(140, 106, 46, 0.3);
    transform: translateY(-1px);
}

/* ── Kontextuelle Erklär-Karten im Player-Inspector ── */
body.demo-sequence-mode .demo-inspector {
    bottom: 170px !important;
    top: 90px !important;
    z-index: 25;
}

.player-help-card {
    display: flex;
    flex-direction: column;
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.help-badge {
    background: #eaf1e7;
    color: #2d553b;
    border: 1px solid #c2d6c6;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 100px;
}

.help-close-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    border-radius: 50%;
    border: 1px solid #ccd5c5;
    background: transparent;
    color: #556654;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.help-close-btn:hover {
    background: #eef3eb;
    color: #1e2e21;
    border-color: #8fa895;
}

.help-title {
    font: 21px/1.25 Georgia, serif !important;
    color: #1a2f21;
    margin: 6px 0 2px !important;
}

.help-subtitle {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6c7968;
    margin-bottom: 12px;
}

.help-desc {
    font-size: 13.5px;
    line-height: 1.55;
    color: #354336;
    margin: 0 0 14px;
}

.help-tips {
    background: #f4f6ef;
    border: 1px solid #dce3d5;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.help-tips strong {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #385b44;
    display: block;
    margin-bottom: 6px;
}

.help-tips ul {
    margin: 0;
    padding-left: 17px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #425042;
}

.help-tips li {
    margin: 4px 0;
}

.help-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e3e8de;
}

.help-dismiss-btn {
    background: #3d634d;
    color: #ffffff;
    border: 1px solid #284433;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.help-dismiss-btn:hover {
    background: #47755b;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(61, 99, 77, 0.25);
}

.help-mute-btn {
    background: transparent;
    border: 0;
    color: #72806f;
    font-size: 11px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s ease;
}

.help-mute-btn:hover {
    color: #323f31;
}

/* ── Protokoll & Export Panel ── */
.protocol-help-lead {
    font-size: 13px !important;
    line-height: 1.55 !important;
    color: #314436 !important;
    background: #edf3ea;
    padding: 11px 13px;
    border-radius: 9px;
    border-left: 3.5px solid #3d634d;
    margin: 0 0 14px 0 !important;
}

.protocol-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: #516252;
    margin-bottom: 12px;
}

.protocol-branch-tag {
    background: #e1ebde;
    color: #2b5236;
    border: 1px solid #c2d6c3;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2.5px 8px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}

.protocol-export-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.protocol-export-buttons button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 9px;
    border: 1px solid #cad2c4;
    background: #f7f9f5;
    color: #27372b;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.16s ease;
}

.protocol-export-buttons button:hover {
    background: #ffffff;
    border-color: #8da492;
    box-shadow: 0 3px 10px rgba(45, 75, 55, 0.12);
    transform: translateY(-1px);
}

.protocol-export-buttons .protocol-btn-pdf {
    background: #3d634d !important;
    color: #ffffff !important;
    border-color: #284433 !important;
    font-weight: 600 !important;
}

.protocol-export-buttons .protocol-btn-pdf:hover {
    background: #47755b !important;
    box-shadow: 0 4px 14px rgba(61, 99, 77, 0.3) !important;
}

.protocol-export-buttons .protocol-btn-json {
    background: #fcfbf6 !important;
    border-color: #dcd4c0 !important;
    color: #4a3e26 !important;
}

.protocol-export-buttons .protocol-btn-json:hover {
    background: #ffffff !important;
    border-color: #a48c5b !important;
    color: #2e2617 !important;
}

/* ==========================================================================
   Szenenübersicht: Kategorien, Filter-Tabs & Film-Abschnitt
   ========================================================================== */
.library-filter-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.library-tab {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 100px;
    background: #e9e5d8;
    color: #4b5448;
    border: 1px solid #d4d0c2;
    cursor: pointer;
    transition: all 0.15s ease;
}

.library-tab:hover {
    background: #dfdacb;
    color: #2e362c;
}

.library-tab.is-active {
    background: #3a5c48;
    color: #ffffff;
    border-color: #284433;
    box-shadow: 0 2px 8px rgba(40, 68, 51, 0.25);
}

.library-section {
    margin-bottom: 48px;
}

.library-section-header {
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid #dcd7c9;
}

.library-section-heading-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.library-section-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    background: #e4ece3;
    color: #355e42;
    border: 1px solid #c9d8c7;
}

.library-section-badge--film {
    background: #f4e8e1;
    color: #7a2822;
    border-color: #e5cfc6;
}

.library-section h2 {
    font: 26px/1.2 Georgia, serif;
    margin: 0;
    color: #2d382e;
}

.library-section-desc {
    font-size: 14px;
    color: #677162;
    line-height: 1.55;
    margin: 6px 0 0;
    max-width: 860px;
}

.scene-badge-film {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 2px 7px;
    border-radius: 4px;
    background: #fbf2ea;
    color: var(--scene-color);
    border: 1px solid rgba(122, 40, 34, 0.25);
    margin-bottom: 8px;
    width: fit-content;
}

.scene-card--film {
    background: #fffefb;
    border-color: #d8cebf;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.scene-card--film:hover {
    box-shadow: 0 8px 24px rgba(122, 40, 34, 0.12);
}

/* ── Fokusmodus (Header & Figure Panel) ── */
.demo-focus-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
    border: 1px solid #c9d5c4;
    background: #f7faf5;
    color: #2e4a34;
}

.demo-focus-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(36, 60, 42, 0.12);
}

.demo-focus-pill.is-active {
    background: #eaf4e6;
    color: #1e5a28;
    border-color: #8bbd8c;
    box-shadow: 0 2px 6px rgba(30, 90, 40, 0.14), inset 0 0 0 1px #8bbd8c;
}

.demo-focus-pill.is-all-visible {
    background: #fdfbf7;
    color: #656c60;
    border-color: #ded8cd;
    opacity: 0.92;
}

.demo-focus-pill.is-all-visible:hover {
    background: #f5f2ea;
    color: #3b4437;
    border-color: #cac0b1;
}

/* Figure Panel Fokus-Pill */
.figure-focus-row {
    margin: 8px 0 14px 0;
    width: 100%;
}

.figure-focus-pill {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}

.figure-focus-pill .focus-pill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.figure-focus-pill .focus-pill-icon svg {
    width: 18px;
    height: 18px;
}

.figure-focus-pill.is-focused {
    background: #eef6ec;
    border-color: #9ecc9f;
    color: #1b5324;
    box-shadow: 0 1px 4px rgba(27, 83, 36, 0.08);
}

.figure-focus-pill.is-focused:hover {
    background: #e3f0e0;
    border-color: #84b886;
}

.figure-focus-pill.is-background {
    background: #f7f6f1;
    border-color: #dcd7cc;
    border-style: dashed;
    color: #727a6f;
    opacity: 0.85;
}

.figure-focus-pill.is-background:hover {
    background: #edece4;
    border-color: #c4bcb0;
    color: #3b4437;
    opacity: 1;
}

.figure-focus-pill .focus-pill-label {
    flex: 1;
    text-align: left;
}

/* ==========================================================================
   Mehrdimensionale Szenenerzählung: Exkurse & Seitenäste
   ========================================================================== */

.demo-header.is-excursion {
    background: #f8faf5f8;
    border-bottom: 2px solid #839d89;
}

.demo-header-info.is-excursion strong {
    color: #203a27;
}

.demo-excursion-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.demo-excursion-return-pill {
    background: #eef3eb !important;
    border: 1px solid #b8c8ba !important;
    color: #27432f !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    cursor: pointer;
    transition: all 0.16s ease;
}

.demo-excursion-return-pill:hover {
    background: #e1ebdc !important;
    border-color: #8fa892 !important;
    transform: translateY(-1px);
}

.demo-excursion-continue-pill {
    background: #3c5d46 !important;
    border: 1px solid #27432f !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    cursor: pointer;
    transition: all 0.16s ease;
}

.demo-excursion-continue-pill:hover {
    background: #314d3a !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(39, 67, 47, 0.25);
}

.branch-rail.is-expanded {
    height: 136px;
}

.rail-node.is-origin-anchor {
    border: 2px solid #8c6a2e !important;
    background: #fff8ee !important;
    color: #634718 !important;
    box-shadow: 0 0 0 3px rgba(140, 106, 46, 0.2) !important;
    z-index: 6;
}

.rail-node.is-origin-anchor.is-current {
    background: #3d634d !important;
    color: #ffffff !important;
    border: 2px solid #274332 !important;
}

.rail-node.is-excursion-inline {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border: 2px dashed #4e6b57 !important;
    background: #f1f7ef !important;
    color: #223f2a !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    z-index: 5;
}

.rail-node.is-excursion-inline:hover {
    background: #ffffff !important;
    border-color: #274332 !important;
    transform: translate(-50%, -50%) scale(1.15) !important;
    box-shadow: 0 4px 12px rgba(34, 63, 42, 0.2) !important;
}

.rail-node.is-excursion-inline.is-current {
    background: #385942 !important;
    color: #ffffff !important;
    border: 2px solid #1c3222 !important;
    box-shadow: 0 0 0 3px rgba(56, 89, 66, 0.3), 0 4px 10px rgba(28, 50, 34, 0.22) !important;
}

.rail-origin-indicator {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: 700;
    color: #735324;
    background: #fdf5ea;
    border: 1px solid #d8be92;
    padding: 1px 6px;
    border-radius: 10px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.rail-excursion-toggle-pill {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 9.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f8faf6;
    border: 1px solid #9db5a1;
    color: #2e4d35;
    cursor: pointer;
    white-space: nowrap;
    z-index: 6;
    transition: all 0.15s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.rail-excursion-toggle-pill:hover {
    background: #eef6ec;
    border-color: #3b5f45;
    transform: translate(-50%, calc(-50% - 1px));
    box-shadow: 0 3px 8px rgba(46, 74, 56, 0.18);
}

.demo-header-excursion-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #eef6eb;
    border: 1px solid #8bad93;
    color: #24422b;
}

.rail-node.is-excursion {
    border: 2px dashed #4e6b57;
    background: #eef4ec;
    color: #26432e;
}

.rail-node.is-excursion.is-current {
    background: #3c5d46 !important;
    color: #ffffff !important;
    border: 2px solid #213a27 !important;
    box-shadow: 0 0 0 3px rgba(60, 93, 70, 0.3) !important;
}

.rail-node.is-anchor {
    border: 2px solid #7c6239 !important;
    background: #fdf6ec !important;
    color: #5c431b !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    z-index: 6;
    cursor: pointer;
}

.rail-node.is-anchor:hover {
    background: #f7ebd5 !important;
    border-color: #523e1e !important;
    transform: translate(-50%, -50%) scale(1.08);
}

.rail-anchor-label {
    position: absolute;
    transform: translate(-50%, 0);
    font-size: 9px;
    font-weight: 700;
    color: #634b22;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    pointer-events: none;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rail-step-label {
    position: absolute;
    transform: translate(-50%, 0);
    font-size: 9px;
    font-weight: 600;
    color: #4b6653;
    white-space: nowrap;
    letter-spacing: 0.02em;
    pointer-events: none;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rail-step-label.is-excursion {
    font-size: 8px;
    font-weight: 500;
    max-width: 54px;
    opacity: 0.72;
    transition: all 0.16s ease;
}

.demo-controls.is-dense .rail-step-label.is-excursion {
    max-width: 46px;
    font-size: 7.5px;
}

.rail-step-label.is-excursion:hover,
.rail-step-label.is-excursion.is-current,
.demo-controls.is-dense .rail-step-label.is-excursion:hover,
.demo-controls.is-dense .rail-step-label.is-excursion.is-current {
    opacity: 1;
    font-weight: 700;
    color: #1e3f28;
    background: rgba(238, 246, 237, 0.96);
    border: 1px solid rgba(75, 102, 83, 0.35);
    border-radius: 5px;
    padding: 1px 7px;
    max-width: 180px;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translate(-50%, -2px);
}

.branch-rail .rail-excursion-arrow-toggle,
.rail-excursion-arrow-toggle,
.rail-excursion-pill {
    position: absolute !important;
    transform: translate(-50%, -50%) !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 1px solid #7c9684 !important;
    color: #274430 !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14) !important;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease !important;
    z-index: 10 !important;
}

.branch-rail .rail-excursion-arrow-toggle:hover,
.rail-excursion-arrow-toggle:hover,
.rail-excursion-pill:hover {
    background: #eef6ec !important;
    border-color: #24422c !important;
    color: #1a3321 !important;
    transform: translate(-50%, -50%) scale(1.15) !important;
    box-shadow: 0 2px 6px rgba(36, 66, 44, 0.25) !important;
}

.branch-rail .rail-excursion-arrow-toggle.is-open,
.rail-excursion-arrow-toggle.is-open {
    background: #f1f6ef !important;
    border-color: #5d7c66 !important;
    color: #294933 !important;
}

.branch-rail .rail-excursion-arrow-toggle.is-open:hover,
.rail-excursion-arrow-toggle.is-open:hover {
    background: #e2ede0 !important;
    border-color: #24422c !important;
    color: #1a3321 !important;
}

.branch-rail .rail-excursion-arrow-toggle svg,
.rail-excursion-arrow-toggle svg {
    position: static !important;
    width: 9px !important;
    height: 9px !important;
    min-width: 9px !important;
    min-height: 9px !important;
    max-width: 9px !important;
    max-height: 9px !important;
    display: block !important;
    margin: 0 !important;
    overflow: visible !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
    pointer-events: none !important;
}

.rail-excursion-return-pill {
    position: absolute;
    bottom: 6px;
    right: 12px;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    background: #edf3e9;
    border: 1px solid #b7c7b8;
    color: #26442e;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rail-excursion-return-pill:hover {
    background: #deebd8;
    border-color: #799a7e;
}

.rail-excursion-continue-pill {
    position: absolute;
    bottom: 6px;
    left: 12px;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    background: #3c5d46;
    border: 1px solid #284430;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rail-excursion-continue-pill:hover {
    background: #304d39;
}

.phase.is-excursion {
    background: #e1ede2;
    color: #23432b;
    border: 1px solid #aec4b2;
}

.demo-excursion-container {
    margin-top: 14px;
}

.demo-excursion-discovery {
    background: #ffffff;
    border: 1.5px solid #bdd0be;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 4px 16px rgba(40, 65, 45, 0.08);
}

.demo-excursion-discovery-label {
    font-size: 11px;
    font-weight: 700;
    color: #2e4d36;
    display: block;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.demo-excursion-discovery-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.demo-excursion-discovery-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f6faf5;
    border: 1px solid #c2d6c4;
    color: #1e3825;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.demo-excursion-discovery-btn .exc-kind {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    color: #4b6a52;
    margin-right: 6px;
}

.demo-excursion-discovery-btn:hover {
    background: #eaf4e8;
    border-color: #4c7356;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(35, 65, 40, 0.12);
}

.demo-excursion-banner {
    background: #fbfbf8;
    border: 1.5px solid #8ca693;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 4px 16px rgba(40, 65, 45, 0.08);
}

.demo-excursion-banner-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 10px;
}

.demo-excursion-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #35563e;
}

.demo-excursion-crumbs {
    font-size: 12px;
    color: #4c5d50;
    font-weight: 500;
}

.demo-excursion-banner-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.demo-excursion-pill-back {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    background: #edf2eb;
    border: 1px solid #b8cbba;
    color: #294932;
    cursor: pointer;
    transition: all 0.15s ease;
}

.demo-excursion-pill-back:hover {
    background: #dfead7;
    border-color: #8fa991;
    transform: translateY(-1px);
}

.demo-excursion-pill-continue {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    background: #3b5a45;
    border: 1px solid #284430;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.demo-excursion-pill-continue:hover {
    background: #2e4936;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(40, 68, 48, 0.25);
}



/* Shared export action: quick export and clearly accessible report selection. */
#export-hub { background:#f8f4eb; color:#344d3c; border-color:#d3d1c6; font-weight:600;
  min-height:40px; padding:7px 11px; white-space:nowrap; }
#export-options { background:#f8f4eb; border-color:#d3d1c6; color:#344d3c;
  font-size:18px; min-width:31px; padding:5px 6px; margin-left:-8px; }
.export-choice { display:flex!important; align-items:center; gap:8px; }
.export-choice input { width:auto; min-width:16px; height:16px; margin:0; }
.scene-capability { display:inline-flex; align-self:start; margin-top:8px;
  font-size:10px; color:#3b604b; background:#e9f0e7; padding:4px 9px;
  border:1px solid #d0decd; border-radius:999px; }
@media(max-width:700px) {
  #export-hub { font-size:11px; padding:5px 7px; min-height:36px; }
  #export-options { min-height:36px; }
  .toolbar { gap:3px; }
}
@media(max-width:530px) {
  .toolbar h1 { display:none; }
  .toolbar .demo-launch { min-width:76px; font-size:10px; padding:5px; margin-right:0; }
  #export-hub { font-size:0; min-width:35px; padding:5px; }
  #export-hub::after { content:'⤓'; font-size:19px; }
  #export-options { min-width:26px; margin-left:-3px; }
  .toolbar #menu { min-width:35px; padding:4px; }
}


/* Documentary psychotherapeutic history is distinct from film storytelling. */
.scene-badge-history {
  display: inline-flex;
  align-self: flex-start;
  width: max-content;
  background: #e7e5d7;
  color: #4c5a4b;
  border: 1px solid #d2d0c0;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  margin-bottom: 7px;
  font-weight: 600;
}
.library-section--historical .scene-card {
  background: #faf7ec;
  border-color: #dbd5c7;
}
.library-section--historical .scene-card:hover {
  background: #fffaf1;
}
.scene-source-list {
  padding-left: 17px;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.scene-source-list a { color: #2e6854; text-decoration: underline; text-underline-offset: 3px; }
.scene-source-list a:focus-visible { outline: 2px solid #be8848; outline-offset: 3px; }


/* Roles and dynamics share the existing right-hand inspector and sandy palette. */
.pattern-editor { display:grid; gap:12px; padding:8px 4px 20px; color:var(--ink,#343c34); }
.pattern-editor label { display:grid; gap:6px; font-size:12px; font-weight:600; }
.pattern-editor input:not([type=checkbox]),.pattern-editor select,.pattern-editor textarea {
  min-height:35px; width:100%; max-width:100%; box-sizing:border-box; border:1px solid #c8cfc5;
  border-radius:8px; background:#fffcf6; color:#343c34; padding:7px 9px;
  font:inherit; font-weight:400;
}
.pattern-editor input[type=range] {accent-color:#648b75;}
.pattern-editor textarea {min-height:60px; resize:vertical;}
.pattern-intro {display:flex; align-items:center; gap:12px; padding:10px 12px; background:#f1eee3;
  border-radius:13px; border:1px solid #dadbcd;}
.pattern-intro p {margin:0;display:grid;gap:4px;}
.pattern-intro small {font-size:11px;font-weight:400;opacity:.76;}
.pattern-dynamic-icon {display:grid; place-items:center; width:54px;height:54px;
  border:2px solid #ad8871; border-radius:50%;font-size:36px;color:#996f58;}
.pattern-inline-check {display:flex!important; flex-direction:row; align-items:center; gap:10px;}
.pattern-inline-check input {width:auto;}
.pattern-step {display:grid; gap:9px; border:1px solid #d8d8ce; border-radius:10px; background:#f8f5eb;
  padding:11px; margin:0;}
.pattern-step legend {color:#43574d;font-size:12px;font-weight:600;}
.pattern-editor h3 {font-size:13px;margin:8px 0 0;}
.pattern-editor .pattern-edge {display:flex;flex-wrap:wrap;gap:7px;align-items:center;padding:8px;
  background:#f5f1e8;border-radius:8px;font-size:11px;}
.pattern-editor .pattern-edge select {width:auto;max-width:150px;}
.pattern-editor .pattern-cycle-state {padding:8px;border-left:3px solid #739384;
  background:#e5ece4;font-size:12px;margin:0;}
.pattern-picker {display:grid;gap:7px;max-height:min(52dvh,440px);overflow-y:auto;margin:12px 0;}
.pattern-picker-row {display:flex!important; align-items:center;gap:12px;background:#f8f4eb;
  border:1px solid #ded6c6;border-radius:11px;padding:8px 12px;cursor:pointer;}
.pattern-picker-row:has(input:checked) {background:#e7efe8;outline:2px solid #89a58e;}
.pattern-picker-row small {display:block;margin-top:4px;font-size:11px;font-weight:400;color:#5a665d;}
.pattern-picker-glyph {width:40px;height:40px;display:grid;place-items:center;font-size:30px;
  color:#a17f68;}
.template-card {display:flex; flex-direction:column; gap:9px; background:#f8f4eb!important;
  padding:16px; border:1px solid #d9dbcb!important; border-radius:13px;}
.template-card .scene-intro {min-height:64px;}
.template-card button {align-self:flex-start;margin-top:auto;}
.library-tab--templates {border-color:#a4af91;}
.template-preview {display:block;width:min(100%,520px);height:auto;aspect-ratio:520/270;
  background:#f4efe3;border-radius:12px;border:1px solid #d9d1bc;}
.template-replace-warning {font-size:12px;line-height:1.45;padding:9px 11px;
  border-left:3px solid #b59563;background:#fbefd9;color:#604c30;}
@media(max-width:600px) {
 .pattern-picker {max-height:40dvh;}
 .pattern-picker-row {padding:7px 8px;gap:8px;}
 .pattern-editor {gap:10px;}
 .template-card {padding:12px;}
}


/* Compact, accessible role picker: override the generic dialog input width
   for radio controls (previously stretched to 100% across each row). */
#dialog .pattern-picker { gap: 4px; max-height: min(46dvh, 360px); margin: 8px 0; }
#dialog .pattern-picker-hint { margin: 0 0 8px; font-size: 13px; line-height: 1.4; }
#dialog .pattern-picker-row {
  display: flex !important; align-items: center; gap: 10px;
  min-height: 44px; margin: 0; padding: 6px 10px;
  border-radius: 9px; font-size: 13px;
}
#dialog .pattern-picker-row input[type="radio"] {
  display: inline-block; flex: 0 0 18px; width: 18px; height: 18px;
  min-width: 18px; min-height: 18px; padding: 0; margin: 0;
  border: 0; border-radius: 50%; accent-color: #466652;
}
#dialog .pattern-picker-row svg { flex: 0 0 28px; width: 28px; height: 28px; }
#dialog .pattern-picker-row span { flex: 1; }
#dialog .custom-role-fields { border-top: 1px solid #ded6c6; margin-top: 10px; padding-top: 4px; }
#dialog .custom-role-fields[hidden] { display: none !important; }
#dialog .custom-role-fields input[type="color"] {
  display: block; width: 64px; height: 40px; padding: 4px; cursor: pointer;
}
@media (max-width: 600px) {
  #dialog .pattern-picker { max-height: 36dvh; }
  #dialog .pattern-picker-row { gap: 7px; padding: 5px 7px; }
}

/* Context-sensitive Stift submenu: not three permanent new palette rows. */
#palette .drawing-menu[hidden]{display:none!important}
#palette .drawing-menu{display:flex;flex-direction:column;gap:3px;margin:3px 4px 6px;padding:7px;
 background:#fffaf1;border:1px solid #d7cbb4;border-radius:12px;box-shadow:0 6px 18px #313d2522}
#palette .drawing-menu button{text-align:left;min-height:36px;border-radius:8px;font:inherit;padding:7px 10px;}
#graphic-properties{position:fixed;z-index:32;border:1px solid #a9bdb1;border-radius:12px;
 background:#fffdf5;color:#385d46;padding:8px 12px;box-shadow:0 2px 12px #0002;white-space:nowrap}
#graphic-properties[hidden]{display:none!important}
.drawing-inline-editor{position:fixed;z-index:40;min-height:75px;max-height:60vh;
 border:1px solid #416e54;outline:2px solid #d4e8d9;border-radius:6px;background:#fffdf7ed;
 padding:4px 8px;font-family:system-ui;line-height:1.3;resize:both}
.drawing-editor{display:grid;gap:12px;padding:10px 0}
.drawing-editor label{display:grid;gap:5px;color:#465f4c;font-size:13px}
.drawing-editor textarea{min-height:96px;line-height:1.4}
.drawing-editor input,.drawing-editor textarea,.drawing-editor select{width:100%;box-sizing:border-box}
.drawing-editor .drawing-check{display:flex;align-items:center;gap:8px}
.drawing-editor .drawing-check input{width:auto}

/* One-step export dialog: format and all relevant settings remain together. */
#dialog-form:has(#export-format) { max-height:min(82dvh,760px); overflow-y:auto; }
#dialog-form .export-fields[hidden] { display:none!important; }
#dialog-form fieldset.export-fields {
  border:1px solid #d6d9cc; background:rgba(242,246,237,.5);
  border-radius:12px; margin:12px 0; padding:12px 14px;
}
#dialog-form fieldset.export-fields legend {
  color:#3d624c; font-weight:650; padding:0 6px;
}
#dialog-form:has(#export-format) .export-choice {
  display:flex!important; flex-flow:row nowrap; gap:9px; align-items:flex-start;
  margin:7px 0; line-height:1.4;
}
#dialog-form:has(#export-format) .export-choice input[type="checkbox"] {
  width:17px!important; height:17px!important; min-width:17px;
  flex:0 0 17px; margin:2px 0 0!important;
}
#dialog-form:has(#export-format) [data-export-result] { min-height:1.4em; }

/* Coordinate inspector V2 – readable axis-oriented controls, no tall one-field-per-line stack. */
.drawing-editor.coordinate-inspector {display:block; padding:0;min-width:0;}
.coordinate-inspector .axis-inspector {display:flex;flex-direction:column;gap:12px;padding:1px 0 12px;}
.coordinate-inspector .axis-intro {display:flex;align-items:center;gap:12px;margin:2px 0 5px;}
.coordinate-inspector .axis-intro strong {font:600 15px system-ui;color:#345b46;}
.coordinate-inspector .axis-intro p,
.coordinate-inspector .axis-hint {font:12px/1.5 system-ui;color:#687568;margin:5px 0 0;}
.coordinate-inspector .axis-section {
  padding:12px;border:1px solid #deded0;border-radius:13px;
  background:#fffdf8;box-shadow:0 1px 3px #304c3920;min-width:0;
}
.coordinate-inspector .axis-section h3 {margin:0 0 10px;font:650 14px/1.3 system-ui;letter-spacing:0;color:#355b46;}
.coordinate-inspector .axis-section.axis-x {border-left:3px solid #669a8e;}
.coordinate-inspector .axis-section.axis-y {border-left:3px solid #b99565;}
.coordinate-inspector .axis-direction {
  display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;
  width:24px;height:24px;margin-right:2px;background:#e4eee9;border-radius:7px;
  color:#315f54;font-size:17px;
}
.coordinate-inspector .axis-y .axis-direction {background:#f6eddc;color:#896839;}
.coordinate-inspector label.axis-field {display:flex;flex-direction:column;gap:5px;margin:0 0 9px;
  font:12px/1.4 system-ui;color:#455d50;min-width:0;}
.coordinate-inspector .axis-field input:not([type="color"]),
.coordinate-inspector .axis-field select {
  box-sizing:border-box;width:100%;height:36px;min-height:36px;margin:0;
  font:14px system-ui;padding:6px 9px;border:1px solid #d0d8cf;border-radius:8px;
  background:white;color:#273f34;
}
.coordinate-inspector .axis-field input:focus-visible,
.coordinate-inspector input:focus-visible,
.coordinate-inspector select:focus-visible {outline:2px solid #86ad92;outline-offset:1px;}
.coordinate-inspector .axis-triple {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;}
.coordinate-inspector .axis-triple input {font-variant-numeric:tabular-nums;}
.coordinate-inspector .axis-inline {display:grid;grid-template-columns:minmax(0,1fr) 100px;gap:12px;align-items:end;}
.coordinate-inspector .axis-inline input[type=color] {
  display:block;width:100%;height:36px;padding:3px;border-radius:8px;background:white;
  border:1px solid #d0d8cf;cursor:pointer;
}
.coordinate-inspector .axis-size {
  display:grid!important;grid-template-columns:1fr 73px auto;align-items:center;
  gap:7px!important;margin:9px 0!important;
}
.coordinate-inspector .axis-size span {grid-column:1/-1;color:#455d50;font:12px system-ui;}
.coordinate-inspector .axis-size input[type=range] {width:100%;min-width:0;accent-color:#547864;margin:0;height:20px;}
.coordinate-inspector .axis-size input[type=number] {
  width:73px!important;max-width:73px!important;height:32px;padding:3px 5px;
  border:1px solid #d0d8cf;border-radius:7px;font:13px system-ui;text-align:right;
}
.coordinate-inspector .axis-size small {font:10px system-ui;color:#819080;}
.coordinate-inspector .axis-actions {display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:9px 0 2px;}
.coordinate-inspector .axis-actions button[data-axis-add] {
  background:#e7f0e7;border:1px solid #abc6b1;border-radius:8px;
  color:#335f47;padding:7px 10px;font:600 12px system-ui;cursor:pointer;
}
.coordinate-inspector .axis-actions button:disabled {opacity:.4;cursor:not-allowed;}
.coordinate-inspector label.axis-check {
  display:inline-flex!important;flex-direction:row!important;align-items:center;gap:6px!important;
  width:auto;margin:0;color:#415d4b;font:12px/1.4 system-ui;
}
.coordinate-inspector .axis-check input {width:15px!important;height:15px!important;margin:0;accent-color:#3f715b;}
.coordinate-inspector .axis-category-list {display:flex;flex-direction:column;gap:6px;margin:9px 0;}
.coordinate-inspector .axis-category-row {
  display:grid;grid-template-columns:18px minmax(0,1fr) 32px 23px;
  gap:6px;align-items:center;
}
.coordinate-inspector .axis-index {font:600 11px system-ui;text-align:center;color:#84938a;}
.coordinate-inspector .axis-category-row input[type=text] {
  width:100%;height:34px;box-sizing:border-box;min-width:0;
  border:1px solid #d2d9d1;border-radius:7px;padding:5px 8px;
  font:13px system-ui;color:#334e3e;background:white;
}
.coordinate-inspector .axis-category-row .axis-color {
  width:32px!important;height:32px!important;min-width:32px;
  padding:2px;background:white;border-radius:7px;border:1px solid #d2d9d1;cursor:pointer;
}
.coordinate-inspector .axis-category-row .axis-strength {
  display:block;width:31px;height:30px;border-radius:6px;
  background:rgba(74,118,94,var(--level-opacity));border:1px solid #92ad9b;
}
.coordinate-inspector .axis-category-row button {
  width:23px;height:28px;padding:0!important;border:0;background:transparent;
  color:#79877b;font:20px system-ui;cursor:pointer;border-radius:6px;
}
.coordinate-inspector .axis-category-row button:hover:not(:disabled) {background:#f7e5df;color:#ad5545;}
.coordinate-inspector .axis-category-row button:disabled {opacity:.25;cursor:not-allowed;}
.coordinate-inspector .axis-mini-labeled {display:grid;grid-template-columns:17px 70px;
  grid-template-rows:54px 16px;gap:2px;flex:0 0 89px;}
.coordinate-inspector .axis-mini-grid {display:grid;grid-column:2;grid-row:1;gap:2px;
  border:1px solid #8ba298;border-radius:5px;overflow:hidden;}
.coordinate-inspector .axis-mini-grid span {display:block;min-width:0;min-height:0;}
.coordinate-inspector .axis-mini-x {grid-column:2;grid-row:2;text-align:center;}
.coordinate-inspector .axis-mini-y {grid-column:1;grid-row:1;writing-mode:vertical-rl;
  transform:rotate(180deg);text-align:center;}
.coordinate-inspector .axis-mini-x,.coordinate-inspector .axis-mini-y {
  font:600 11px system-ui;color:#4b7763;
}
.coordinate-inspector .axis-mini-numeric {position:relative;flex:0 0 82px;width:82px;height:71px;
  background:linear-gradient(90deg,#d3e4da35 1px,transparent 1px),
    linear-gradient(#d3e4da35 1px,transparent 1px);background-size:15px 15px;
}
.coordinate-inspector .axis-mini-line {position:absolute;left:15px;right:4px;bottom:17px;
  height:2px;background:#638c79;}
.coordinate-inspector .axis-mini-line::before {content:'';position:absolute;left:0;bottom:0;
  width:2px;height:45px;background:#638c79;}
.coordinate-inspector .axis-mini-numeric .axis-mini-x {position:absolute;right:0;bottom:0;}
.coordinate-inspector .axis-mini-numeric .axis-mini-y {position:absolute;left:0;top:4px;writing-mode:initial;transform:none;}
@media(max-width:480px) {
  .coordinate-inspector .axis-section {padding:10px;}
  .coordinate-inspector .axis-category-row {grid-template-columns:15px minmax(0,1fr) 32px 23px;gap:4px;}
  .coordinate-inspector .axis-intro {gap:9px;}
}

/* Scene library V2: thematic categories + composable capability facets. */
.library-feature-row {
  display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;
  margin:-17px 0 26px;padding:12px 0;
  border-top:1px solid #e1ded1;border-bottom:1px solid #e1ded1;
}
.library-feature-label {font:600 12px system-ui;color:#596d5d;}
.library-feature-nav {display:flex;align-items:center;flex-wrap:wrap;gap:7px;}
.library-feature-tab {
  display:inline-flex;align-items:center;gap:8px;
  font:500 12px system-ui;color:#445f51;
  min-height:32px;min-width:0;padding:6px 11px;
  border-radius:100px;border:1px solid #b9cabb;background:#f8f9f4;
}
.library-feature-tab small {font:600 10px system-ui;color:#738274;}
.library-feature-tab.is-active,.library-feature-tab[aria-pressed="true"] {
  background:#365d48;color:#fff;border-color:#365d48;
}
.library-feature-tab.is-active small {color:#deedde;}
.library-clear-filters {font:12px system-ui;min-height:30px;border-radius:100px;
  border:1px solid #d5c6b3;color:#7b593e;background:#f8f1e7;padding:5px 10px;}
.library-empty {font:14px system-ui;color:#826950;background:#fff9ee;
  border:1px solid #e8d9be;border-radius:12px;padding:18px;}
.scene-feature-pills {
  display:flex;gap:5px;flex-wrap:wrap;margin-top:11px;
  align-items:center;
}
.scene-feature-pill {
  display:inline-flex;align-items:center;justify-content:center;
  font:600 10px/1.3 system-ui;letter-spacing:.01em;
  border:1px solid #cfddd1;border-radius:100px;
  color:#435e4d;background:#eef4ed;padding:4px 9px;
  white-space:nowrap;
}
.scene-feature-pill--moments {border-color:#d7d3c1;background:#f3f0e5;color:#6b6148;}
.scene-feature-pill--genogram {border-color:#c9cddc;background:#f0eff7;color:#625976;}
.scene-feature-pill--coordinate {border-color:#bcd6d4;background:#ecf5f3;color:#386b67;}
.scene-feature-pill--grid {border-color:#d8cfbd;background:#f7f1e8;color:#806242;}
.library-section--research .library-section-badge {background:#e8f0ed;color:#42685d;}
/* Only one entrance to the scene library is visible: the shared 'Szenen'
   action. The old launch remains in the DOM for external legacy event wiring. */
body .toolbar #demos {display:none!important;}
body .view-tools #menu {
  display:inline-flex!important;align-items:center;justify-content:center;
  width:34px;min-width:34px!important;height:34px;min-height:34px!important;
  padding:3px!important;border:1px solid #d5ddd1;border-radius:9px;
  background:#f6f7f0;color:#385442;font-size:20px;
}
body .view-tools #workshop-btn:not([style*="display:none"]):not([hidden]) {
  font-size:11px;min-height:34px;padding:4px 9px;white-space:nowrap;
}
@media(max-width:1100px) {
  body .toolbar > div:first-child {max-width:235px;overflow:hidden;}
  body .toolbar h1 {font-size:20px;white-space:nowrap;}
}
@media(max-width:820px) {
  body .toolbar > div:first-child {display:none;}
  body .view-tools #menu {width:31px;min-width:31px!important;height:31px;min-height:31px!important;}
}

/* Accessible dismiss control for the single-step export window. */
#dialog-form:has(#export-format) { position:relative; }
#dialog-form #close-export-dialog {
  position:absolute;right:-8px;top:-8px;
  display:flex;align-items:center;justify-content:center;
  width:34px!important;height:34px!important;
  min-width:34px!important;min-height:34px!important;
  padding:0!important;border-radius:50%;
  background:#f1f0e9;border:1px solid #d9d8cf;
  color:#5b665d;font:24px/1 system-ui;cursor:pointer;
}
#dialog-form #close-export-dialog:hover {
  background:#eadcd1;color:#774f42;
}
#dialog-form:has(#export-format) > h2 {padding-right:38px;}

/* Export modal: persistent heading and action; only the settings area scrolls.
   Do not let PDF/3D long option labels create sideways scrolling. */
dialog#dialog:has(#export-format){
  width:min(580px,calc(100vw - 30px));
  max-width:calc(100vw - 30px);
  max-height:min(90dvh,900px);
  padding:0;
  overflow:hidden;
}
#dialog-form:has(#export-format){
  display:flex;flex-direction:column;
  width:100%;height:min(88dvh,865px);max-height:min(88dvh,865px);
  min-height:0;overflow:hidden;box-sizing:border-box;
}
#dialog-form .export-dialog-header {
  flex:0 0 auto;display:flex;align-items:center;
  justify-content:space-between;gap:16px;
  padding:16px 20px 11px;border-bottom:1px solid #d9decf;
  background:#fffcf5;
}
#dialog-form .export-dialog-header h2{
  margin:0;padding:0;font-size:24px;
}
#dialog-form .export-dialog-header #close-export-dialog{
  position:static;flex:0 0 34px;z-index:auto;
  width:34px!important;height:34px!important;
  border:1px solid #d9d8cf;
}
#dialog-form .export-dialog-options{
  flex:1 1 auto;overflow-y:auto;overflow-x:hidden;
  min-width:0;min-height:0;max-width:100%;
  padding:14px 20px 20px;overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
#dialog-form .export-dialog-options fieldset,
#dialog-form .export-dialog-options label,
#dialog-form .export-dialog-options p,
#dialog-form .export-dialog-options select {
  max-width:100%;min-width:0;box-sizing:border-box;
}
#dialog-form .export-dialog-options fieldset {min-inline-size:0;}
#dialog-form .export-choice{
  white-space:normal;overflow-wrap:anywhere;
}
#dialog-form .export-choice span {min-width:0;}
#dialog-form .export-dialog-footer{
  flex:0 0 auto;display:flex;gap:12px;align-items:center;
  margin:0!important;padding:14px 20px 17px;
  background:#fffcf5;border-top:1px solid #d9decf;
  box-shadow:0 -5px 14px #253b2d0a;z-index:2;
}
#dialog-form .export-dialog-footer button{
  flex:1 1 0;min-width:0;
}
@media(max-width:600px){
  #dialog-form .export-dialog-header{padding:12px 14px;}
  #dialog-form .export-dialog-options{padding:12px 13px 16px;}
  #dialog-form .export-dialog-footer{padding:11px 14px;}
}

/* Explicit, opt-in persistence notice (never autosaves before consent). */
.unsaved-notice {position:fixed;z-index:55;left:50%;bottom:90px;transform:translateX(-50%);width:min(750px,calc(100% - 30px));padding:10px 14px;background:#fff7df;color:#443a25;border:1px solid #d2af67;border-radius:12px;box-shadow:0 5px 24px #0002;display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;}
body.demo-sequence-mode .unsaved-notice,
body:has(.sequence-controls) .unsaved-notice {bottom:185px;}
.unsaved-notice[hidden],.share-person-warning[hidden] {display:none!important;}
.unsaved-notice span {flex:1 1 260px;}
.unsaved-notice button {flex:0 1 auto;font-size:12px;padding:6px 12px;min-height:34px;border-radius:8px;border:1px solid #c29f52;background:#fff;color:#3b301a;cursor:pointer;transition:background .15s,border-color .15s;}
.unsaved-notice button:hover {background:#fdf2d0;border-color:#a88334;}
.unsaved-notice button.unsaved-dismiss {background:#f5ecda;border-color:#cdb585;color:#493c24;}
.unsaved-notice button.unsaved-dismiss:hover {background:#ebddbe;border-color:#9f7a2d;color:#281f0e;}
.share-warning,.share-person-warning {background:#fff5df;border:1px solid #dac492;border-radius:8px;padding:10px 12px;margin:8px 0;color:#453820;line-height:1.45;}
.share-person-warning label {margin-top:10px;}
#dialog-form [data-export-result] {overflow-wrap:anywhere;margin-top:14px;}
#dialog-form [data-export-result]:not(:empty) {padding:12px 14px;background:#f3f7f4;border:1px solid #bfd3c4;border-radius:10px;box-shadow:0 4px 14px rgba(44,75,55,.08);}
#dialog-form [data-export-result] textarea {display:block;max-width:100%;resize:vertical;margin:8px 0;border:1px solid #b8cbbe;border-radius:8px;background:#fff;padding:8px 10px;font-family:monospace;font-size:11px;}
#btn-new-board {display:flex;align-items:center;justify-content:center;gap:8px;font-weight:600;border:1px solid #c2ccbc;background:#f0f4ee;color:#2b3b2f;margin-bottom:8px;border-radius:10px;transition:background .15s,border-color .15s;}
#btn-new-board:hover {background:#e2ede0;border-color:var(--accent);}
@media(max-width:1050px){body.demo-sequence-mode .unsaved-notice,body:has(.sequence-controls) .unsaved-notice{bottom:215px;}}
@media(max-width:600px){.unsaved-notice {bottom:75px;padding:8px 10px;font-size:12px;}.unsaved-notice button{flex:1 1 auto;}body.demo-sequence-mode .unsaved-notice,body:has(.sequence-controls) .unsaved-notice{bottom:250px;}}