/* =====================================================================
   360° Touren – Designsystem
   ===================================================================== */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e9ecf1;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-contrast: #ffffff;
  --accent-soft: #eef4ff;
  --accent-ring: rgba(37, 99, 235, .25);
  --warn: #b45309;
  --warn-soft: #fff7e8;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --orange: #f97316;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 6px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .22);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1e222a;
    --surface-3: #262b35;
    --border: #2a2f39;
    --border-strong: #3a404c;
    --text: #eef0f3;
    --text-2: #cbd0d8;
    --muted: #8e96a3;
    --accent: #4f8cff;
    --accent-hover: #6b9dff;
    --accent-soft: #1a2a47;
    --accent-ring: rgba(79, 140, 255, .3);
    --warn: #f5a524;
    --warn-soft: #33260f;
    --ok: #34d399;
    --ok-soft: #10291f;
    --danger: #f87171;
    --danger-soft: #3a1717;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 6px 16px rgba(0, 0, 0, .3);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
[hidden] { display: none !important; }
.icon { width: 16px; height: 16px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 500 14px var(--font);
  cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn--sm .icon { width: 15px; height: 15px; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Formulare ---------- */
input[type=text], textarea, select {
  width: 100%; padding: 8px 11px; font: 14px var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
select { height: 36px; padding: 0 8px; }
textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input[type=text]:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
label.field { display: block; margin-bottom: 12px; min-width: 0; }
label.field > span { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
label.field > span em { font-style: normal; font-weight: 400; color: var(--muted); }
.field-row { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 4px; }
.field-row .field { flex: 1; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { width: 34px; height: 20px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background .15s; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px var(--accent-ring); }

.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--muted); line-height: 1.6; }
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }

.tab { height: 28px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 500 13px var(--font); cursor: pointer; }
.tab:hover { background: var(--surface-2); }
.tab.is-active { background: var(--text); border-color: var(--text); color: var(--surface); }

/* ---------- Kopfzeile ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; }
.topbar__spacer { flex: 1; }
.topbar__sep { color: var(--border-strong); font-size: 20px; font-weight: 300; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand__mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, .35); }
.brand__mark svg { width: 20px; height: 20px; }

/* ---------- Übersichtsseiten ---------- */
.page { max-width: 1160px; margin: 0 auto; padding: 32px 20px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.create-form { display: flex; gap: 8px; width: min(100%, 480px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; color: inherit; text-decoration: none;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-strong); }
.card__img { aspect-ratio: 2 / 1; background: var(--surface-3) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.card__img .icon { width: 28px; height: 28px; opacity: .5; }
.card__body { padding: 14px 16px 6px; flex: 1; }
.card__body h2 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.card__meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.card__meta span + span::before { content: "·"; margin-right: 6px; }
.progress { height: 4px; border-radius: 99px; background: var(--surface-3); margin-top: 10px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.card__actions { display: flex; gap: 6px; padding: 10px 12px 12px; align-items: center; }
.card__actions .topbar__spacer { flex: 1; }
.empty { text-align: center; padding: 64px 20px; color: var(--muted); border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }
.empty .icon { width: 36px; height: 36px; margin-bottom: 8px; opacity: .6; }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ---------- Anmeldung ---------- */
body.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--accent-soft), transparent 50%), var(--bg); }
.login-card { width: min(100%, 380px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px; }
.login-card h1 { font-size: 22px; margin: 20px 0 4px; letter-spacing: -.02em; }
.login-card > p { margin: 0 0 16px; }
.login-card form { margin-top: 8px; }
.login-error { color: var(--danger); background: var(--danger-soft); border-radius: var(--radius); padding: 8px 10px; font-size: 13px; }
input[type=password] { width: 100%; padding: 8px 11px; font: 14px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; }
input[type=password]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

/* ---------- Editor: Gerüst ---------- */
body.editor-page { overflow: hidden; }
.editor { display: grid; grid-template-columns: 264px minmax(0, 1fr) 400px; grid-template-rows: 60px minmax(0, 1fr); height: 100vh; }
.editor > .topbar { grid-column: 1 / -1; }
.title-input { max-width: 380px; font-weight: 600 !important; font-size: 15px !important; border-color: transparent !important; background: transparent !important; }
.title-input:hover { border-color: var(--border) !important; }
.title-input:focus { border-color: var(--accent) !important; background: var(--surface) !important; }
.save-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.save-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-status.is-error { color: var(--danger); }
.save-status.is-error::before { background: var(--danger); }

.sidebar, .panel { background: var(--surface); overflow-y: auto; overflow-x: hidden; min-height: 0; min-width: 0; }
.sidebar { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.panel { border-left: 1px solid var(--border); }
.section { padding: 18px; border-bottom: 1px solid var(--border); }
.sidebar > .section { flex: none; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.section > .section-title { margin-bottom: 12px; }
.section-head .section-title { margin: 0; }
.help { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.45; }

/* Upload-Flächen */
.dropzone, .plan-empty {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 16px 12px;
  background: var(--surface-2); color: var(--muted); transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover, .plan-empty:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); color: var(--accent); margin-bottom: 6px; }
.dropzone__icon .icon { width: 18px; height: 18px; }
.dropzone__title { font-weight: 600; font-size: 13px; color: var(--text); }
.dropzone__hint { font-size: 12px; }
.upload-switch { margin: 10px 4px 0; font-size: 12px; line-height: 1.3; white-space: normal; }
.upload-switch__hint { display: block; font-style: normal; font-weight: 400; font-size: 11px; color: var(--muted); }

/* Raumliste */
.room-list { list-style: none; margin: 0; padding: 8px; }
.floor-heading { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 12px 8px 6px; }
.room-item { display: flex; gap: 10px; align-items: center; padding: 7px 6px 7px 8px; border-radius: var(--radius); cursor: pointer; position: relative; transition: background .12s; }
.room-item:hover { background: var(--surface-2); }
.room-item.is-active { background: var(--accent-soft); }
.room-item.is-active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.room-item img { width: 68px; height: 34px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-3); flex: none; box-shadow: var(--shadow-sm); }
.room-item__text { min-width: 0; flex: 1; }
.room-item__title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.room-item__name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.room-item__title .badge { flex: none; }
.room-item__status { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item__status.is-warn { color: var(--warn); }
.room-item__status.is-ok { color: var(--ok); }
.room-item__actions { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .12s; }
.room-item:hover .room-item__actions, .room-item__actions:focus-within { opacity: 1; pointer-events: auto; }
@media (hover: none) { .room-item__actions { opacity: 1; pointer-events: auto; position: static; transform: none; box-shadow: none; background: transparent; } }
.room-item__delete { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; transition: background .12s, color .12s; }
.room-item__delete .icon { width: 15px; height: 15px; }
.room-item__delete:hover { background: var(--danger-soft); color: var(--danger); }

.room-item__toggle { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--accent); cursor: pointer; transition: background .12s, color .12s; }
.room-item__toggle .icon { width: 16px; height: 16px; }
.room-item__toggle:hover { background: var(--surface-3); }
.room-item__toggle { color: var(--text-2); }
.room-item__toggle.is-off { color: var(--accent); }
.room-item[draggable="true"] { -webkit-user-drag: element; }
.room-item.is-dragging { opacity: .4; }
.room-item.drop-before::after, .room-item.drop-after::after { content: ""; position: absolute; left: 6px; right: 6px; height: 2px; border-radius: 2px; background: var(--accent); pointer-events: none; }
.room-item.drop-before::after { top: -1px; }
.room-item.drop-after::after { bottom: -1px; }
.room-item.is-excluded img { filter: grayscale(1); opacity: .55; }
.room-item.is-excluded .room-item__name { color: var(--muted); }
.room-item.is-excluded .room-item__status { color: var(--muted); }
.list-heading { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); padding: 10px 8px 6px; }
.list-heading .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
.list-heading--muted { color: var(--muted); margin-top: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.list-empty { font-size: 12px; color: var(--muted); padding: 2px 8px 8px; }
.switch-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 6px; }
.switch-row .switch { margin-bottom: 8px; }
.switch.is-disabled { opacity: .45; cursor: not-allowed; }
.notice { font-size: 12px; line-height: 1.45; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin: 4px 0 10px; }

/* ---------- Editor: Bühne ---------- */
.stage { position: relative; background: #0b0d10; min-width: 0; min-height: 0; }
.stage #pano { position: absolute; inset: 0; }
.stage-toolbar { position: absolute; top: 14px; left: 14px; right: 14px; z-index: 200; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; pointer-events: none; }
.stage-toolbar > * { pointer-events: auto; }
.toolbar-group { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: rgba(17, 20, 26, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 4px 16px rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .08); }
.tool-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #e8ebf0; font: 500 13px var(--font); cursor: pointer; transition: background .15s; }
.tool-btn:hover { background: rgba(255, 255, 255, .12); }
.tool-btn.is-active { background: var(--accent); color: #fff; }
.tool-btn:disabled { opacity: .4; cursor: default; }
.stage-hint { background: rgba(17, 20, 26, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; font-size: 13px; padding: 9px 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .08); max-width: 560px; }
.stage-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #9aa3b0; text-align: center; padding: 20px; }
.stage-empty__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .06); color: #cdd3dc; margin-bottom: 6px; }
.stage-empty__icon .icon { width: 26px; height: 26px; }
.stage-empty__title { font-size: 17px; font-weight: 600; color: #fff; }
.stage.is-picking .psv-container { cursor: crosshair !important; }

.picker { position: absolute; z-index: 300; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; min-width: 230px; max-height: 340px; overflow: auto; }

/* Zielauswahl für Verknüpfungen (Liste + Mini-Grundriss) */
.picker--link { width: min(640px, calc(100% - 24px)); min-width: 0; max-height: calc(100% - 24px); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.picker--list-only { width: min(320px, calc(100% - 24px)); }
.picker__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.picker__body { display: flex; min-height: 0; flex: 1; }
.picker__plan { flex: 1 1 55%; min-width: 0; padding: 12px; background: var(--surface-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.picker__tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-plan { position: relative; width: 100%; margin: 0 auto; flex: none; background: #fff; border-radius: 6px; box-shadow: var(--shadow-sm); }
.mini-plan img { display: block; width: 100%; height: 100%; border-radius: 6px; pointer-events: none; }
.mini-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; padding: 0; border-radius: 50%; border: 2.5px solid #fff; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-ring), 0 1px 4px rgba(0, 0, 0, .45); cursor: pointer; animation: pulse 1.6s infinite; }
.mini-dot span { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 3px; font: 600 11px var(--font); white-space: nowrap; background: rgba(17, 20, 26, .82); color: #fff; padding: 1px 6px; border-radius: 5px; pointer-events: none; }
.mini-dot:hover, .mini-dot.is-hover { background: var(--orange); transform: scale(1.25); animation: none; z-index: 2; }
.mini-dot.is-self { background: var(--muted); cursor: default; animation: none; opacity: .85; }
.picker__list { flex: 1 1 45%; min-width: 0; overflow: auto; padding: 6px; }
.picker--list-only .picker__list { flex-basis: 100%; }
.picker__group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 8px 4px; }
.picker__room { display: flex; width: 100%; gap: 10px; align-items: center; background: none; border: 0; padding: 6px 8px; border-radius: 8px; color: inherit; font: 500 14px var(--font); cursor: pointer; text-align: left; }
.picker__room:hover, .picker__room.is-hover { background: var(--accent-soft); }
.picker__room img { width: 56px; height: 28px; object-fit: cover; border-radius: 5px; flex: none; }
.picker__room-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .55), 0 1px 4px rgba(0, 0, 0, .45); } 70% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0), 0 1px 4px rgba(0, 0, 0, .45); } 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0), 0 1px 4px rgba(0, 0, 0, .45); } }
@media (max-width: 700px) { .picker__body { flex-direction: column; } .picker__plan { border-right: 0; border-bottom: 1px solid var(--border); } }

/* Icon-/Farbwahl für Links */
.link-style { --hs: #2563eb; display: grid; place-items: center; width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; background: var(--hs); color: #fff; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .12s; }
.link-style:hover { transform: scale(1.1); }
.link-style .ico { font-size: 17px; }
.style-pop { --hs: #2563eb; position: fixed; z-index: 800; width: 340px; max-height: calc(100vh - 24px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 12px; }
.style-pop__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.style-pop__head > div { flex: 1; min-width: 0; }
.style-pop__title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.style-pop__preview { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--hs); box-shadow: 0 0 0 3px var(--hs), 0 2px 8px rgba(0, 0, 0, .2); flex: none; }
.style-pop__preview .ico { font-size: 24px; }
.style-pop__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 12px 0 6px; }
.style-pop__text { width: 100%; }
.style-pop__hint { margin-top: 4px; }
.style-pop__sizes { display: flex; gap: 6px; }
.style-pop__colors { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { position: relative; width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); display: grid; place-items: center; }
.swatch.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch--custom { background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #3b82f6, #a855f7, #ef4444); color: #fff; }
.swatch--custom.is-active { background: var(--c); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch--custom .icon { width: 14px; height: 14px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.swatch--custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.style-pop { width: 380px; }
.style-pop__search { margin-top: 14px; }
.style-pop__search input { padding-left: 34px; background: var(--surface) no-repeat 10px center / 16px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); }
.style-pop__sets { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.chip { height: 24px; padding: 0 9px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 500 12px var(--font); cursor: pointer; }
.chip:hover { background: var(--surface-2); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--surface); }
.style-pop__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; max-height: 300px; overflow-y: auto; padding: 2px; }
.icon-tile { position: relative; }
.icon-choice { display: grid; place-items: center; width: 100%; height: 44px; border: 1px solid transparent; border-radius: 8px; background: var(--surface-2); color: var(--text-2); cursor: pointer; transition: background .12s, color .12s; }
.icon-choice:hover { background: var(--surface-3); color: var(--hs); }
.icon-choice.is-active { background: var(--hs); color: #fff; }
.icon-choice .ico { font-size: 22px; }
.fav-toggle { position: absolute; top: 1px; right: 1px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 12px; line-height: 18px; cursor: pointer; opacity: 0; transition: opacity .12s, color .12s; }
.icon-tile:hover .fav-toggle, .fav-toggle:focus-visible { opacity: .9; }
.fav-toggle:hover { color: #f59e0b; }
.fav-toggle.is-fav { opacity: 1; color: #f59e0b; }
.style-pop__empty { grid-column: 1 / -1; margin: 8px 0; font-size: 13px; color: var(--muted); text-align: center; }
.style-pop__foot { margin-top: 10px; font-size: 11px; color: var(--muted); text-align: center; }

/* ---------- Editor: Grundriss ---------- */
.floor-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.plan { position: relative; border-radius: var(--radius); user-select: none; touch-action: none; display: grid; place-items: center; }
.plan.has-plan { height: min(54vh, 500px); padding: 10px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.plan.has-plan .plan-empty { display: none; }
.plan:not(.has-plan) { width: 100%; }
.plan:not(.has-plan) .plan-empty { width: 100%; padding: 28px 12px; }
.plan-stage { position: relative; display: none; background: #fff; box-shadow: var(--shadow-sm); border-radius: 4px; }
.plan.has-plan .plan-stage { display: block; }
.plan-stage img { display: block; width: 100%; height: 100%; pointer-events: none; border-radius: 4px; }
#plan-layer { position: absolute; inset: 0; }
.plan.is-placing { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.plan.is-placing .plan-stage { cursor: crosshair; }
.plan-expand { position: absolute; top: 8px; right: 8px; z-index: 5; display: none; background: var(--surface); box-shadow: var(--shadow); color: var(--text-2); }
.plan.has-plan .plan-expand { display: inline-grid; }
.plan.is-expanded { position: fixed; inset: 76px 24px 24px; height: auto; z-index: 700; padding: 20px; background: var(--surface-2); box-shadow: var(--shadow-lg); }
.plan-backdrop { position: fixed; inset: 0; z-index: 690; background: rgba(10, 12, 16, .5); backdrop-filter: blur(2px); }
.plan svg.plan-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.plan-dot {
  position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: var(--accent); border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); cursor: grab; z-index: 2;
}
.plan-dot:active { cursor: grabbing; }
.plan-dot.is-excluded { background: #9ca3af; opacity: .6; }
.plan-dot.is-target { cursor: pointer; animation: pulse 1.6s infinite; }
.plan-dot.is-target:hover { background: var(--orange); transform: scale(1.25); }
.plan-dot.is-active { background: var(--orange); width: 20px; height: 20px; margin: -10px 0 0 -10px; z-index: 3; }
.plan-dot span { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 4px; font: 600 11px var(--font); white-space: nowrap; background: rgba(17, 20, 26, .82); color: #fff; padding: 1px 6px; border-radius: 5px; pointer-events: none; }
.plan-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.icon-btn--field { width: 36px; height: 36px; border: 1px solid var(--border-strong); background: var(--surface); }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; color: var(--muted); }

/* ---------- Editor: Raum ---------- */
.steps { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.step { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.step__mark { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 700; margin-top: 1px; }
.step.is-done .step__mark { background: var(--ok-soft); color: var(--ok); }
.step__mark .icon { width: 14px; height: 14px; stroke-width: 3; }
.step__body { flex: 1; min-width: 0; }
.step__title { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.step__hint { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 1px; }
.step .btn { flex: none; align-self: center; }
/* Optionale Einstellung (z. B. fester Startblick) */
.option-card { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 4px 0 12px; }
.option-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.option-card .switch { margin-bottom: 4px; }
.option-card__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); font-size: 11px; }

.link-list { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius); }
.link-row { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 8px; }
.link-row.is-selected { background: var(--accent-soft); }
.link-row__name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px; border: 0; background: none; color: var(--text); font: 500 13px var(--font); cursor: pointer; text-align: left; border-radius: 6px; }
.link-row__name:hover { background: var(--surface-2); }
.link-row__name span:not(.badge) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row__name .icon { color: var(--accent); width: 15px; height: 15px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; background: #111827; color: #fff; padding: 11px 18px; border-radius: var(--radius); font-size: 14px; max-width: min(640px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); white-space: pre-line; }
.toast.is-error { background: var(--danger); }

@media (max-width: 1100px) {
  .editor { grid-template-columns: 240px minmax(0, 1fr) 340px; }
}
@media (max-width: 900px) {
  body.editor-page { overflow: auto; }
  .editor { grid-template-columns: 1fr; grid-template-rows: 60px 55vh auto auto; height: auto; }
  .stage { grid-row: 2; }
  .sidebar, .panel { border: 0; border-top: 1px solid var(--border); overflow: visible; }
  .topbar__sep, .save-status { display: none; }
}

/* ---------- Hotspots (Viewer + Editor) ---------- */
.ico { display: inline-block; width: 1em; height: 1em; flex: none; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.tour-hotspot { --hs: #2563eb; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; transform: translateY(-16px); }
.tour-hotspot__icon {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .94); color: var(--hs);
  box-shadow: 0 0 0 3px var(--hs), 0 0 0 6px rgba(255, 255, 255, .45), 0 6px 18px rgba(0, 0, 0, .45);
  transition: transform .18s, background .18s, color .18s;
}
.tour-hotspot__icon .ico { font-size: 26px; }
.tour-hotspot--s { gap: 4px; transform: translateY(-12px); }
.tour-hotspot--s .tour-hotspot__icon { width: 34px; height: 34px; box-shadow: 0 0 0 2px var(--hs), 0 0 0 4px rgba(255, 255, 255, .45), 0 4px 12px rgba(0, 0, 0, .45); }
.tour-hotspot--s .tour-hotspot__icon .ico { font-size: 18px; }
.tour-hotspot--s .tour-hotspot__label { font-size: 11px; padding: 3px 8px; }
.tour-hotspot--l { gap: 8px; transform: translateY(-22px); }
.tour-hotspot--l .tour-hotspot__icon { width: 68px; height: 68px; box-shadow: 0 0 0 4px var(--hs), 0 0 0 8px rgba(255, 255, 255, .45), 0 8px 22px rgba(0, 0, 0, .45); }
.tour-hotspot--l .tour-hotspot__icon .ico { font-size: 38px; }
.tour-hotspot--l .tour-hotspot__label { font-size: 16px; padding: 5px 13px; }
.tour-hotspot:hover .tour-hotspot__icon { transform: scale(1.12); background: var(--hs); color: #fff; }
.tour-hotspot__label { background: rgba(17, 20, 26, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; font: 600 13px/1.3 var(--font); padding: 4px 10px; border-radius: 99px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.tour-hotspot.is-auto .tour-hotspot__icon { box-shadow: 0 0 0 3px var(--hs), 0 0 0 6px rgba(249, 115, 22, .9), 0 6px 18px rgba(0, 0, 0, .45); }
.tour-hotspot.is-selected .tour-hotspot__icon { background: var(--hs); color: #fff; box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--orange), 0 6px 18px rgba(0, 0, 0, .45); }

/* ---------- Öffentlicher Viewer ---------- */
body.viewer-page { background: #000; overflow: hidden; }
#viewer { position: fixed; inset: 0; }
.glass { background: rgba(17, 20, 26, .62); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.viewer-title { position: fixed; top: 14px; left: 14px; z-index: 150; color: #fff; padding: 10px 16px 10px 12px; border-radius: 14px; max-width: min(440px, calc(100vw - 210px)); pointer-events: none; display: flex; gap: 12px; align-items: center; }
.viewer-title .brand__mark { width: 34px; height: 34px; flex: none; }
.viewer-title > div { min-width: 0; }
.viewer-title h1 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-title .room { font-size: 13px; color: rgba(255, 255, 255, .75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.floor-switch { position: fixed; top: 82px; left: 14px; z-index: 150; display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; max-width: calc(100vw - 28px); flex-wrap: wrap; }
.floor-switch button { height: 30px; padding: 0 12px; background: transparent; color: #e8ebf0; border: 0; border-radius: 8px; font: 500 13px var(--font); cursor: pointer; }
.floor-switch button:hover { background: rgba(255, 255, 255, .12); }
.floor-switch button.is-active { background: #fff; color: #111827; }
.viewer-message { position: fixed; inset: 0; display: grid; place-items: center; color: #cfd4dc; font: 16px var(--font); text-align: center; padding: 16px; }

/* =====================================================================
   Photo Sphere Viewer – modernes Skin (Viewer + Editor)
   Überschreibt nur das Standard-CSS von PSV, keine Änderungen am Plugin-Code.
   ===================================================================== */
.psv-container { --glass: rgba(17, 20, 26, .62); --glass-strong: rgba(17, 20, 26, .82); --glass-border: rgba(255, 255, 255, .12); }

/* Navigationsleiste: schwebende Glas-Pille statt grauem Balken */
.psv-navbar {
  left: 50%; width: auto; max-width: calc(100% - 24px); height: 50px; bottom: -80px;
  transform: translateX(-50%); padding: 0 6px; gap: 2px; align-items: center;
  border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); font: 14px var(--font);
  transition: bottom .25s cubic-bezier(.2, .8, .2, 1);
}
.psv-navbar--open { bottom: 16px; }
.psv-button {
  width: 20px; height: 20px; padding: 9px; border-radius: 11px;
  color: rgba(255, 255, 255, .82); transition: background .15s, color .15s, transform .15s;
}
.psv-button:not(.psv-button--disabled):not(.psv-caption):hover { background: rgba(255, 255, 255, .14); color: #fff; }
.psv-button:not(.psv-button--disabled):active { transform: scale(.94); }
.psv-button--active { background: #2563eb !important; color: #fff !important; }
.psv-button:not(.psv-button--disabled):focus-visible { outline: 2px solid #60a5fa; outline-offset: 1px; }
.psv-button-svg { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }

/* Zoom-Regler */
.psv-zoom-range.psv-button { padding: 9px 8px; border-radius: 11px; }
.psv-zoom-range-line { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .3); }
.psv-zoom-range-handle { top: -5.5px; width: 14px; height: 14px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-line { background: rgba(255, 255, 255, .5); }
.psv-zoom-range:not(.psv-button--disabled):hover .psv-zoom-range-handle { transform: scale(1.15); }

/* Bildunterschrift (Raumname) */
.psv-caption {
  flex: 0 0 auto; width: clamp(120px, 26vw, 340px); padding: 0 16px; margin: 0 4px;
  border-left: 1px solid var(--glass-border); border-right: 1px solid var(--glass-border);
  color: #fff; font: 600 14px var(--font); letter-spacing: -.01em;
}
.psv-caption { display: flex; align-items: center; justify-content: center; align-self: stretch; height: auto; }
.psv-caption-content { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; padding: 0; }

/* Galerie: schwebende Glas-Leiste über der Navigation */
.psv--has-navbar .psv-gallery { bottom: 78px; transform: translateY(calc(100% + 120px)); }
.psv-gallery {
  left: 16px; width: auto; right: 16px; border: 1px solid var(--glass-border); border-radius: 18px;
  background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.psv-gallery-container { padding: 12px; scrollbar-color: rgba(255, 255, 255, .35) transparent; }
.psv-gallery-item { border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.psv-gallery-item:not(:last-child) { margin-right: 10px; }
.psv-gallery-item-title {
  top: auto; bottom: 0; height: auto; padding: 22px 10px 8px; justify-content: flex-start;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent); font: 600 13px var(--font); color: #fff;
}
.psv-gallery-item:hover .psv-gallery-item-title { background: linear-gradient(to top, rgba(0, 0, 0, .85), transparent); }
.psv-gallery-item--active::after { border: 0; border-radius: 12px; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #2563eb; }
.psv-gallery-arrow { color: #fff; }

/* Grundriss-Minimap */
.psv-map { margin: 14px; }
.psv-map--square { border-radius: 16px; overflow: hidden; border: 1px solid var(--glass-border); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.psv-map__container { background: rgba(255, 255, 255, .92); }
.psv-map__button { background: var(--glass-strong); color: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.psv-map__button:hover { color: #fff; background: #2563eb; }
.psv-map__toolbar { background: var(--glass-strong); font: 600 12px var(--font); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }

/* Tooltips, Hinweise, Seitenpanel, Ladeanzeige */
.psv-tooltip { background: var(--glass-strong); border-radius: 10px; border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.psv-tooltip-content { font: 500 13px var(--font); text-shadow: none; padding: .5em .9em; }
.psv-tooltip-arrow { display: none; }
.psv-notification-content { background: var(--glass-strong); border-radius: 12px; border: 1px solid var(--glass-border); font: 500 14px var(--font); padding: .7em 1.1em; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.psv-panel { background: var(--glass-strong); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-left: 1px solid var(--glass-border); color: #e8ebf0; font: 14px/1.55 var(--font); }
.psv--has-navbar .psv-panel { height: 100%; }
.psv-panel-content h3 { font-size: 18px; margin: 0 0 8px; color: #fff; }
.psv-panel-close-button { border-radius: 10px; }
.psv-loader { color: rgba(255, 255, 255, .9); }
.psv-loader-text { font: 600 13px var(--font); }
.psv-overlay-title { font: 600 18px var(--font); }
.psv-overlay-text { font: 14px var(--font); }

@media (max-width: 600px) {
  .psv-navbar { height: 44px; padding: 0 4px; border-radius: 14px; }
  .psv-navbar--open { bottom: 10px; }
  .psv-button { padding: 6px; }
  .psv-zoom-range.psv-button, .psv-move-button { display: none; }
  .psv--has-navbar .psv-gallery { bottom: 64px; left: 8px; right: 8px; }
}
@media (max-width: 600px) {
  .viewer-title { max-width: calc(100vw - 200px); padding: 8px 12px 8px 8px; }
  .viewer-title .brand__mark { display: none; }
}
