/* ============================================================
		   Farb-Tokens (dunkel = Default, hell per data-theme="light")
		   ============================================================ */
:root {
    --bg: #0a0e14;
    --bg-rgb: 10, 14, 20;
    --raised: #1a2332;
    --raised-hover: #243044;
    --surface: #11161e;
    --surface-focus: #131a25;
    --text: #c8d1dc;
    --text-strong: #d6dce5;
    --text-soft: #a8b3c2;
    --muted-soft: #8994a3;
    --muted: #6b7785;
    --dim: #4b5666;
    --accent: #e8b964;
    --accent-rgb: 232, 185, 100;
    --accent-hover: #f5cd7e;
    --line-rgb: 107, 119, 133;
    --scroll: #3a4a60;
    --danger: #c0392b;
    --notice-rgb: 224, 148, 44;
    color-scheme: dark;
}
:root[data-theme="light"] {
    --bg: #e9ecf1;
    --bg-rgb: 233, 236, 241;
    --raised: #ffffff;
    --raised-hover: #f0f3f7;
    --surface: #f6f7f9;
    --surface-focus: #ffffff;
    --text: #1f2731;
    --text-strong: #101720;
    --text-soft: #3b4652;
    --muted-soft: #4f5a67;
    --muted: #67717e;
    --dim: #8b95a2;
    --accent: #b4761a;
    --accent-rgb: 180, 118, 26;
    --accent-hover: #d08d27;
    --line-rgb: 60, 72, 88;
    --scroll: #b8c0ca;
    --danger: #b83227;
    --notice-rgb: 186, 105, 12;
    color-scheme: light;
}
:root[data-theme="light"] .rotate360 {
    --r360-btn-bg: rgba(255, 255, 255, 0.85);
    --r360-btn-bg-hover: #fff;
    --r360-btn-fg: #1f2731;
    --r360-btn-border: 1px solid rgba(60, 72, 88, 0.25);
}

/* ============================================================
		   Demo-Page
		   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(
        ellipse at top,
        var(--raised) 0%,
        var(--bg) 70%
    );
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--text);
}
.page-title {
    font-size: clamp(1rem, 2.4vw, 1.4rem);
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
    text-align: center;
    padding-top: 2.5rem;
}

/* -- Tabs ---------------------------------------------- */
.tabs {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    margin-top: 1.8rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(
        180deg,
        rgba(var(--bg-rgb), 0.92) 0%,
        rgba(var(--bg-rgb), 0.78) 100%
    );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(var(--line-rgb), 0.18);
}
.tab-btn {
    background: transparent;
    border: 0;
    padding: 0.7rem 1.6rem;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn:hover {
    color: var(--text-soft);
}
.theme-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(var(--line-rgb), 0.3);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-btn:hover {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.5);
}
.theme-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.theme-btn .sun {
    display: none;
}
:root[data-theme="light"] .theme-btn .sun {
    display: block;
}
:root[data-theme="light"] .theme-btn .moon {
    display: none;
}
.tab-btn[aria-selected="true"] {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.tab-panel {
    display: none;
}
.tab-panel[data-active="true"] {
    display: block;
}

/* -- Demo-Panel ---------------------------------------- */
#panel-demo {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}
#panel-demo[data-active="true"] {
    display: grid;
}
.demo {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-width: 0;
}
.demo > .caption {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--dim);
}
.demo .rotate360 {
    --r360-radius: 8px;
    --r360-border: 1px solid rgba(var(--line-rgb), 0.22);
    --r360-bg: #f2f2f4;
    --r360-loader-color: var(--accent);
    --r360-poi-bg: var(--accent);
    --r360-poi-bg-hover: var(--accent-hover);
    --r360-leader-color: var(--accent);
    --r360-callout-link: var(--danger);
}
.demo-log {
    font-family: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace;
    font-size: 0.76rem;
    color: var(--muted-soft);
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.16);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    min-height: 3.6rem;
    max-height: 7rem;
    overflow: auto;
    white-space: pre-wrap;
    line-height: 1.5;
}
.demo-log b {
    color: var(--accent);
    font-weight: 600;
}
.demo-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* -- Doku-Panel ---------------------------------------- */
#panel-docs {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
    line-height: 1.65;
}
#panel-docs h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
    margin: 2.6rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.18);
}
#panel-docs h2:first-of-type {
    margin-top: 1rem;
}
#panel-docs h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 1.6rem 0 0.6rem;
}
#panel-docs p {
    margin: 0.6rem 0;
    color: var(--text-soft);
}
#panel-docs strong {
    color: var(--text-strong);
    font-weight: 600;
}
#panel-docs em {
    color: var(--accent);
    font-style: normal;
    font-family: ui-monospace, monospace;
    font-size: 0.92em;
}
#panel-docs code {
    font-family: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace;
    font-size: 0.86em;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
    padding: 0.1em 0.4em;
    border-radius: 3px;
}
#panel-docs pre {
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.16);
    border-radius: 6px;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 0.8rem 0 1.2rem;
    font-size: 0.84rem;
    line-height: 1.55;
}
#panel-docs pre code {
    background: transparent;
    color: var(--text);
    padding: 0;
    font-size: inherit;
}
#panel-docs ul {
    margin: 0.6rem 0 1rem;
    padding-left: 1.4rem;
    color: var(--text-soft);
}
#panel-docs li {
    margin: 0.3rem 0;
}
#panel-docs table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8rem 0 1.2rem;
    font-size: 0.88rem;
}
#panel-docs th,
#panel-docs td {
    text-align: left;
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid rgba(var(--line-rgb), 0.14);
    vertical-align: top;
}
#panel-docs th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    border-bottom-color: rgba(var(--line-rgb), 0.32);
}
#panel-docs td:first-child code {
    white-space: nowrap;
}
#panel-docs .attr-table tr.cat th {
    padding-top: 1.4rem;
    font-size: 0.7rem;
    color: var(--accent);
    border-bottom-color: rgba(var(--accent-rgb), 0.35);
}
.dl-box {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 1.2rem;
    margin: 1.6rem 0 2rem;
    background: linear-gradient(
        180deg,
        rgba(var(--accent-rgb), 0.06) 0%,
        rgba(var(--accent-rgb), 0.02) 100%
    );
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    border-radius: 8px;
}
.dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.2rem;
    background: var(--raised);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    border-radius: 5px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.86rem;
    letter-spacing: 0.04em;
    transition: background 0.15s ease, border-color 0.15s ease,
        transform 0.1s ease;
}
.dl-btn:hover {
    background: var(--raised-hover);
    border-color: rgba(var(--accent-rgb), 0.55);
}
.dl-btn:active {
    transform: translateY(1px);
}
.dl-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.dl-btn .dl-size {
    color: var(--muted);
    font-weight: 400;
    font-size: 0.78rem;
}
.lead {
    font-size: 1.02rem;
    color: var(--text) !important;
    margin-bottom: 1.4rem;
}
.note {
    padding: 0.9rem 1.1rem;
    margin: 1rem 0 1.2rem;
    background: rgba(var(--accent-rgb), 0.05);
    border-left: 3px solid rgba(var(--accent-rgb), 0.45);
    border-radius: 0 4px 4px 0;
    font-size: 0.92rem;
}
.note strong {
    color: var(--accent);
}

/* ============================================================
		   Spielwiese
		   ============================================================ */
#panel-playground {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem;
}
.pg-stage {
    display: grid;
    grid-template-columns: minmax(0, 480px) 1fr;
    gap: 1.4rem;
    align-items: start;
    padding: 1.6rem;
    margin-bottom: 2.5rem;
    background: radial-gradient(
            ellipse at center top,
            rgba(var(--accent-rgb), 0.06) 0%,
            rgba(var(--accent-rgb), 0) 65%
        ),
        linear-gradient(
            180deg,
            rgba(var(--bg-rgb), 0.4) 0%,
            rgba(var(--bg-rgb), 0.2) 100%
        );
    border: 1px solid rgba(var(--line-rgb), 0.22);
    border-radius: 10px;
}
@media (max-width: 820px) {
    .pg-stage {
        grid-template-columns: 1fr;
    }
}
#pg-viewer {
    --r360-radius: 8px;
    --r360-loader-color: var(--accent);
    --r360-poi-bg: var(--accent);
    --r360-poi-bg-hover: var(--accent-hover);
    --r360-leader-color: var(--accent);
}
.pg-side {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 0;
}
.pg-status {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.pg-status div {
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.16);
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
}
.pg-status span {
    display: block;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--dim);
}
.pg-status strong {
    font-family: ui-monospace, monospace;
    font-size: 1.05rem;
    color: var(--accent);
    font-weight: 600;
}
.pg-log {
    flex: 1;
    min-height: 8rem;
    max-height: 14rem;
}
.pg-stage-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.pg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.05rem;
    background: var(--raised);
    border: 1px solid rgba(var(--accent-rgb), 0.32);
    border-radius: 5px;
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease,
        transform 0.08s ease;
}
.pg-btn:hover {
    background: var(--raised-hover);
    border-color: rgba(var(--accent-rgb), 0.6);
}
.pg-btn:active {
    transform: translateY(1px);
}

.pg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.6rem 2.2rem;
    align-items: start;
}
@media (max-width: 720px) {
    .pg-grid {
        grid-template-columns: 1fr;
        gap: 1.4rem;
    }
}
.pg-col {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    min-width: 0;
}
.pg-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.pg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}
.pg-row > div {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}
.pg-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
}
.pg-input,
.pg-select {
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.3);
    border-radius: 4px;
    color: var(--text);
    padding: 0.55rem 0.7rem;
    font: inherit;
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.pg-input:focus,
.pg-select:focus {
    outline: none;
    border-color: rgba(var(--accent-rgb), 0.6);
    background: var(--surface-focus);
}
.pg-input.is-mono {
    font-family: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.pg-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%236b7785' stroke-width='1.6' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2rem;
    cursor: pointer;
}
.pg-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.88rem;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    padding: 0.2rem 0;
}
.pg-checkbox input {
    accent-color: var(--accent);
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}
.pg-checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.8rem;
}
.pg-radio-row {
    display: flex;
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.3);
    border-radius: 4px;
    padding: 3px;
}
.pg-radio {
    position: relative;
    flex: 1;
    cursor: pointer;
    user-select: none;
}
.pg-radio input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
}
.pg-radio-label {
    display: block;
    padding: 0.42rem 0.4rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--muted);
    border-radius: 3px;
    transition: background 0.15s ease, color 0.15s ease;
}
.pg-radio input:checked ~ .pg-radio-label {
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
}
.pg-radio:hover .pg-radio-label {
    color: var(--text-soft);
}
.pg-radio input:checked:hover ~ .pg-radio-label {
    color: var(--accent);
}
.pg-hint {
    font-size: 0.78rem;
    color: var(--dim);
    margin-top: 0.15rem;
    line-height: 1.45;
}
.pg-range {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.pg-range input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
}
.pg-range output {
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    color: var(--accent);
    min-width: 3.2em;
    text-align: right;
}

/* ============================================================
		   Editor
		   ============================================================ */
#panel-editor {
    max-width: min(1680px, 96vw);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem;
}
.ed-drop {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    border: 1px dashed rgba(var(--accent-rgb), 0.4);
    border-radius: 10px;
    padding: 1.1rem 1.4rem;
    background: rgba(var(--accent-rgb), 0.03);
    color: var(--muted-soft);
    font-size: 0.9rem;
    line-height: 1.5;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.ed-drop:hover,
.ed-drop.is-over {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.07);
}
.ed-drop input {
    display: none;
}
.ed-drop svg {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ed-drop strong {
    display: block;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.98rem;
}
.ed-drop small {
    display: block;
    color: var(--dim);
    font-size: 0.78rem;
    margin-top: 0.15rem;
}
.ed-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin: 1rem 0;
}
.ed-toolbar .spacer {
    flex: 1;
}
.ed-toolbar .pg-input {
    width: auto;
}
.ed-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--muted);
}
.ed-toolbar label .pg-input {
    width: 5.5rem;
}
.ed-toolbar label .pg-input.is-wide {
    width: 9rem;
}
.ed-strip {
    display: flex;
    gap: 6px;
    overflow-x: scroll;
    overflow-y: hidden;
    padding: 8px 8px 10px;
    height: 222px;
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.16);
    border-radius: 8px;
    scrollbar-width: auto;
    scrollbar-color: var(--scroll) var(--bg);
}
.ed-strip::-webkit-scrollbar {
    height: 16px;
}
.ed-strip::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 0 0 8px 8px;
}
.ed-strip::-webkit-scrollbar-thumb {
    background: var(--scroll);
    border-radius: 8px;
    border: 3px solid var(--bg);
}
.ed-strip::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}
/* Leerzustand (von renderStrip gerendert, mit Einstieg in den Rundgang) */
.ed-strip-empty {
    margin: auto;
    color: var(--dim);
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.9;
}
.ed-linkbtn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ed-linkbtn:hover {
    color: var(--accent-hover);
}

.ed-thumb {
    position: relative;
    flex: 0 0 auto;
    height: 100%;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    background: var(--bg);
    user-select: none;
}
.ed-thumb img {
    height: 100%;
    display: block;
    pointer-events: none;
}
.ed-thumb.is-selected {
    border-color: var(--accent);
}
.ed-thumb.is-dragging {
    opacity: 0.4;
}
.ed-thumb .n {
    position: absolute;
    left: 4px;
    bottom: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--accent);
    font: 600 0.68rem ui-monospace, monospace;
    padding: 0.15em 0.4em;
    border-radius: 3px;
}
.ed-thumb .row-badge {
    position: absolute;
    right: 4px;
    top: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-soft);
    font: 0.62rem ui-monospace, monospace;
    padding: 0.15em 0.4em;
    border-radius: 3px;
}
.ed-thumb .poi-badge {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}
.ed-thumb:hover .x {
    opacity: 1;
}
.ed-thumb .x {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: 0;
    cursor: pointer;
    font-size: 12px;
    line-height: 18px;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.ed-thumb .x:hover {
    background: var(--danger);
}
.ed-thumb .start-badge {
    position: absolute;
    left: 4px;
    bottom: 4px;
    transform: translateX(26px);
    background: var(--accent);
    color: var(--bg);
    font: 700 0.62rem ui-monospace, monospace;
    padding: 0.2em 0.45em;
    border-radius: 3px;
}

.ed-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px 340px;
    gap: 1.4rem;
    margin-top: 1.4rem;
    align-items: start;
}
@media (max-width: 1240px) {
    .ed-main {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
    .ed-main > .ed-side:last-child {
        grid-column: 1 / -1;
    }
}
@media (max-width: 860px) {
    .ed-main {
        grid-template-columns: 1fr;
    }
    .ed-main > .ed-side:last-child {
        grid-column: auto;
    }
}
.ed-stage-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-width: 0;
}
.ed-stage {
    position: relative;
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.16);
    border-radius: 8px;
    overflow: hidden;
    cursor: crosshair;
    user-select: none;
    touch-action: none;
}
.ed-stage img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    -webkit-user-drag: none;
}
.ed-stage:empty {
    aspect-ratio: 1;
}
.ed-stage:empty::after {
    content: "Bild auswählen - Klick ins Bild setzt einen POI.";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--dim);
    font-size: 0.85rem;
}
.ed-stage .onion {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    pointer-events: none;
    mix-blend-mode: multiply;
}
.ed-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    cursor: grab;
}
.ed-marker.is-selected {
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.5);
}
.ed-marker.is-other {
    opacity: 0.35;
    cursor: pointer;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    z-index: 0;   /* eigene Marker liegen darüber, auch wenn sie sich decken */
}
.ed-marker:not(.is-other) {
    z-index: 1;
}
.ed-marker.is-other span {
    display: none;
}
.ed-marker span {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.72rem;
    padding: 0.2em 0.5em;
    border-radius: 3px;
    pointer-events: none;
}
/* Sprechblase + Führungslinie im Editor */
.ed-leader {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.ed-leader line {
    stroke: var(--accent);
    stroke-width: 1.5px;
    stroke-linecap: round;
}
.ed-callout {
    position: absolute;
    width: max-content;
    max-width: 220px;
    padding: 0.5em 0.75em;
    background: #fff;
    color: #222;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    font-size: 0.8rem;
    line-height: 1.4;
    cursor: grab;
    border: 2px solid transparent;
}
.ed-callout.is-right {
    transform: translate(0, -50%);
}
.ed-callout.is-left {
    transform: translate(-100%, -50%);
}
.ed-callout.is-selected {
    border-color: var(--accent);
}
.ed-callout a {
    color: var(--danger);
    pointer-events: none;
}
/* Vorschau der Library-Fußzeile "Detailbild" (POI- oder Hotspot-Bild wirksam) */
.ed-callout-detail {
    margin-top: 0.45em;
    color: var(--danger);
    font-size: 0.92em;
    white-space: nowrap;
}
/* Marker mit eigenem Detailbild: kleiner Punkt oben rechts */
.ed-marker.has-detail::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    border: 1.5px solid #fff;
}
.ed-callout em {
    color: #888;
}
.ed-nav {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.ed-nav input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
}
.ed-nav output {
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    color: var(--accent);
    min-width: 6em;
    text-align: center;
}
.ed-side {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-width: 0;
}
.ed-poi-list,
.ed-hs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: calc(100vh - 240px);
    min-height: 8rem;
    overflow: auto;
    padding: 2px;
}
.ed-side-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ed-side-head .pg-label {
    flex: 1;
}
.ed-side-head button {
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    padding: 0;
    letter-spacing: 0.04em;
}
.ed-side-head button:hover {
    color: var(--accent);
}
.ed-poi,
.ed-hs {
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.16);
    border-radius: 6px;
    padding: 0.6rem 0.7rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.5rem;
    cursor: pointer;
}
.ed-hs {
    display: flex;
    flex-direction: column;
    border-left: 3px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ed-poi.is-selected {
    border-color: rgba(var(--accent-rgb), 0.6);
}
.ed-poi.is-linked {
    border-color: rgba(var(--accent-rgb), 0.35);
    border-left: 3px solid var(--accent);
}
/* Stufe 1: ein POI dieses Hotspots liegt im aktuellen Bild */
.ed-hs.is-active {
    border-left-color: var(--accent);
}
.ed-hs.is-active .ed-hs-head .id {
    color: var(--accent);
}
/* Stufe 2: am zugehörigen POI (oder am Hotspot selbst) wird gearbeitet */
.ed-hs.is-selected {
    border-color: rgba(var(--accent-rgb), 0.7);
    border-left-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35);
}
.ed-hs-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    min-width: 0;
    cursor: pointer;
    user-select: none;
}
.ed-hs-head .chev {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.15s ease;
}
.ed-hs.is-collapsed .ed-hs-head .chev {
    transform: rotate(-90deg);
}
.ed-hs-head .id {
    font-family: ui-monospace, monospace;
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
}
.ed-hs-head .excerpt {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}
.ed-hs-head .cnt {
    font-family: ui-monospace, monospace;
    font-size: 0.7rem;
    color: var(--dim);
    flex-shrink: 0;
}
.ed-hs-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.4rem;
}
.ed-hs.is-collapsed .ed-hs-body {
    display: none;
}
.ed-poi .full {
    grid-column: 1 / -1;
}
.ed-poi .pg-input,
.ed-poi .pg-select,
.ed-hs .pg-input,
.ed-hs .pg-select {
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}
.ed-poi .meta,
.ed-hs .meta {
    font: 0.72rem ui-monospace, monospace;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.ed-poi .meta button,
.ed-hs .meta button {
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    padding: 0;
}
.ed-poi .meta button:hover,
.ed-hs .meta button:hover {
    color: var(--accent);
}
.ed-poi .frames-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.ed-poi .frames-row .pg-input {
    flex: 1;
}
.ed-range {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--muted);
    padding-top: 0.2rem;
}
.ed-range .pg-input {
    width: 3.6rem;
}
.ed-range .pg-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.7rem;
}
.ed-hs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.ed-hs textarea {
    width: 100%;
    resize: vertical;
    background: var(--bg);
    border: 1px solid rgba(var(--line-rgb), 0.3);
    border-radius: 4px;
    color: var(--text);
    font: 0.82rem/1.45 inherit;
    font-family: inherit;
    padding: 0.4rem 0.5rem;
}
.ed-hs textarea:focus {
    outline: none;
    border-color: rgba(var(--accent-rgb), 0.6);
}
.ed-hs-file {
    justify-content: center;
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
}
.ed-hs-file input {
    display: none;
}
.ed-hs-thumb {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 0.5rem;
    align-items: center;
}
.ed-hs-thumb img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(var(--line-rgb), 0.3);
}
.ed-poi-list:empty::after {
    content: "Keine POIs in diesem Bild - Klick ins Bild setzt einen.";
    color: var(--dim);
    font-size: 0.85rem;
}
.ed-hs-list:empty::after {
    content: "Keine Hotspots.";
    color: var(--dim);
    font-size: 0.85rem;
}
.ed-import {
    display: none;
    margin: 0.8rem 0;
    gap: 0.6rem;
}
.ed-import.is-open {
    display: flex;
    flex-direction: column;
}
.ed-import textarea {
    width: 100%;
    min-height: 6rem;
    resize: vertical;
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.3);
    border-radius: 6px;
    color: var(--text);
    font: 0.78rem/1.5 ui-monospace, monospace;
    padding: 0.6rem 0.8rem;
}
.ed-import .row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}
.ed-import .row .pg-hint {
    flex: 1;
    margin: 0;
}
.ed-out textarea {
    width: 100%;
    min-height: 12rem;
    resize: vertical;
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.16);
    border-radius: 6px;
    color: var(--text);
    font: 0.78rem/1.5 ui-monospace, "SF Mono", "JetBrains Mono", Consolas,
        monospace;
    padding: 0.7rem 0.8rem;
}
.ed-out {
    margin-top: 1.6rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}
@media (max-width: 860px) {
    .ed-out {
        grid-template-columns: 1fr;
    }
}
.ed-out-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}
.ed-out-head .pg-label {
    flex: 1;
}
.ed-preview {
    margin-top: 1.6rem;
}
.ed-widths {
    display: inline-flex;
    gap: 2px;
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.3);
    border-radius: 4px;
    padding: 2px;
    margin-right: 0.8rem;
}
.ed-widths button {
    background: none;
    border: 0;
    color: var(--muted);
    font: 600 0.72rem ui-monospace, monospace;
    padding: 0.25rem 0.55rem;
    border-radius: 3px;
    cursor: pointer;
}
.ed-widths button:hover {
    color: var(--text);
}
.ed-widths button.is-on {
    background: rgba(var(--accent-rgb), 0.14);
    color: var(--accent);
}
.pg-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
.pg-btn:disabled:hover {
    background: var(--raised);
    border-color: rgba(var(--accent-rgb), 0.32);
}
#ed-preview {
    transition: max-width 0.2s ease;
    overflow-anchor: none;   /* Neuaufbau der Vorschau darf den Scroll-Anker nicht verschieben */
}
.ed-preview .rotate360 {
    --r360-radius: 8px;
    --r360-poi-bg: var(--accent);
    --r360-poi-bg-hover: var(--accent-hover);
    --r360-loader-color: var(--accent);
    --r360-leader-color: var(--accent);
}
.ed-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid rgba(var(--notice-rgb), 0.45);
    border-left: 4px solid rgb(var(--notice-rgb));
    border-radius: 8px;
    background: rgba(var(--notice-rgb), 0.1);
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.55;
}
.ed-notice[hidden] {
    display: none;
}
.ed-notice > svg {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 0.1rem;
    fill: none;
    stroke: rgb(var(--notice-rgb));
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ed-notice strong {
    display: block;
    color: var(--text-strong);
}
.ed-notice-close {
    flex: none;
    width: 26px;
    height: 26px;
    margin: -0.2rem -0.2rem 0 0;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: none;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.ed-notice-close:hover {
    background: rgba(var(--notice-rgb), 0.16);
    color: var(--text-strong);
}
.ed-notice-close:focus-visible {
    outline: 2px solid rgb(var(--notice-rgb));
    outline-offset: 1px;
}

.ed-menu {
    position: fixed;
    z-index: 200;
    min-width: 210px;
    max-width: 300px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.25rem;
    background: var(--surface);
    border: 1px solid rgba(var(--line-rgb), 0.22);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    font-size: 0.85rem;
}
.ed-menu hr {
    margin: 0.25rem 0.4rem;
    border: 0;
    border-top: 1px solid rgba(var(--line-rgb), 0.16);
}
.ed-menu-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.4rem 0.55rem;
    border: 0;
    border-radius: 5px;
    background: none;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.ed-menu-item:hover:not(:disabled),
.ed-menu-item:focus-visible {
    background: rgba(var(--line-rgb), 0.1);
    outline: none;
}
.ed-menu-item:disabled {
    color: var(--dim);
    cursor: default;
}
.ed-menu-item > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ed-menu-item em {
    flex: none;
    color: var(--dim);
    font-style: normal;
    font-size: 0.78em;
}
.ed-menu-item.has-sub::after {
    content: "›";
    flex: none;
    color: var(--dim);
}
.ed-menu-item.is-back {
    color: var(--dim);
}
.ed-status {
    font-size: 0.78rem;
    color: var(--dim);
}
.ed-status b {
    color: var(--muted);
    font-weight: 600;
}

/* -- Footer -------------------------------------------- */
.site-footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 2.5rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--dim);
    border-top: 1px solid rgba(var(--line-rgb), 0.12);
}
.site-footer a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--line-rgb), 0.3);
    transition: color 0.15s ease, border-color 0.15s ease;
}
.site-footer a:hover {
    color: var(--accent);
    border-bottom-color: rgba(var(--accent-rgb), 0.5);
}
.site-footer code {
    font-family: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace;
    font-size: 0.92em;
    color: var(--muted);
}
/* ============================================================
		   Rundgang (lib/rundgang.js) - an die Seitenfarben angelehnt.
		   .rg-root liegt im Light DOM; seine --rg-*-Tokens erreicht die
		   Seite, das Innere nicht. Das Theme (hell/dunkel) setzt
		   js/editor-tour.js am .rg-root.
		   ============================================================ */
.rg-root {
    --rg-accent: var(--accent);
    --rg-accent-fg: #111820;   /* dunkle Schrift auf Gold - in beiden Themes über 4,5:1 */
    --rg-accent-soft: rgba(var(--accent-rgb), 0.14);
    --rg-card-bg: var(--raised);
    --rg-text: var(--text-strong);
    --rg-text-mute: var(--muted-soft);
    --rg-border: rgba(var(--line-rgb), 0.3);
    --rg-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.pg-btn[aria-pressed="true"] {
    background: rgba(var(--accent-rgb), 0.16);
    border-color: rgba(var(--accent-rgb), 0.7);
}