:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --panel-2: #243040;
  --text: #e8eef4;
  --muted: #9aabbc;
  --accent: #c9a227;
  --accent-2: #5b9fd4;
  --danger: #c45c5c;
  --ok: #5cad7a;
  --radius: 10px;
  --font: "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

body.is-embed {
  overflow: hidden;
}

body.is-embed .app-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

body.is-embed .topbar {
  padding: 0.45rem 0.65rem;
  gap: 0.5rem;
}

body.is-embed .topbar h1 {
  font-size: 0.9rem;
}

body.is-embed .hint {
  font-size: 0.75rem;
  bottom: 0.65rem;
}

.embed-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}

.embed-error code {
  color: var(--text);
}

.embed-snippet-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.embed-snippet-row textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

a {
  color: var(--accent-2);
}

button,
input,
select,
textarea {
  font: inherit;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn-primary {
  background: var(--accent);
  color: #1a1408;
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
  border-color: #3a4a5a;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ——— Listing ——— */
.home {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.home h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.home .lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.museum-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.museum-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--panel);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  border: 1px solid #2a3542;
}

.museum-list a:hover {
  border-color: var(--accent);
}

.museum-list .meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* ——— Viewer shell ——— */
.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#pano-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#pano-canvas.is-dragging {
  cursor: grabbing;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: min(120px, 40vw);
  min-height: 0;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 20, 25, 0.78);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.hotspot .hs-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.hotspot .hs-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.95;
}

/* ——— Flèches sol (style visite virtuelle / Street View) ——— */
.hotspot.is-nav,
.hotspot.kind-room {
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  max-width: none;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-weight: 600;
  overflow: visible;
}

.hotspot.is-nav .nav-floor {
  position: relative;
  width: 88px;
  height: 64px;
  display: block;
  transform: perspective(160px) rotateX(62deg);
  transform-origin: 50% 85%;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.hotspot.is-nav .nav-shadow {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 70%;
  height: 28%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.45) 0%, transparent 70%);
  pointer-events: none;
}

.hotspot.is-nav .nav-chevron {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.hotspot.is-nav .nav-chevron-fill {
  fill: rgba(255, 255, 255, 0.88);
}

.hotspot.is-nav .nav-chevron-edge {
  fill: none;
  stroke: rgba(40, 90, 140, 0.35);
  stroke-width: 1.5;
}

.hotspot.is-nav:hover .nav-floor,
.hotspot.is-nav.is-selected .nav-floor {
  transform: perspective(160px) rotateX(62deg) scale(1.08);
}

.hotspot.is-nav:hover .nav-chevron-fill,
.hotspot.is-nav.is-selected .nav-chevron-fill {
  fill: rgba(255, 255, 255, 1);
}

.hotspot.is-nav .nav-caption {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: rgba(10, 16, 24, 0.72);
  color: #e8eef4;
  max-width: 140px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.hotspot.is-nav:hover .nav-caption,
.hotspot.is-nav.is-selected .nav-caption,
.hotspot.is-nav.show-caption .nav-caption {
  opacity: 1;
}

.hotspot.is-nav.is-incomplete .nav-chevron-fill {
  fill: rgba(255, 200, 120, 0.75);
}

.hotspot.is-nav.is-dragging-hs .nav-floor {
  outline: 2px dashed rgba(255, 255, 255, 0.8);
  outline-offset: 6px;
}

.hotspot.kind-sketchfab {
  border-color: rgba(201, 162, 39, 0.85);
  background: rgba(40, 32, 12, 0.88);
}

.hotspot.kind-url {
  border-color: rgba(120, 190, 140, 0.85);
  background: rgba(18, 40, 28, 0.88);
}

.hotspot.kind-youtube {
  border-color: rgba(220, 80, 80, 0.9);
  background: rgba(50, 18, 18, 0.9);
}

.hotspot.kind-pdf {
  border-color: rgba(180, 140, 220, 0.85);
  background: rgba(35, 25, 50, 0.9);
}

.hotspot.kind-image {
  border-color: rgba(90, 170, 220, 0.9);
  background: rgba(18, 36, 52, 0.9);
}

.hotspot.is-draggable {
  cursor: grab;
}

.hotspot.is-dragging-hs {
  cursor: grabbing;
  opacity: 0.9;
  outline: 2px dashed #fff;
}

.hotspot.is-incomplete {
  border-style: dashed;
  opacity: 0.85;
}

.hs-item.is-incomplete .meta {
  color: #e0a060;
}

.hotspot.is-hidden {
  display: none;
}

.hotspot.is-selected {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.side-hint {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

.place-btns .btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.55rem;
}

.hs-item .btn-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.hs-item .btn-x:hover {
  color: var(--danger);
}

.room-item .meta,
.hs-item .meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.room-item .btn-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.room-item .btn-x:hover {
  color: var(--danger);
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(to bottom, rgba(10, 14, 18, 0.85), transparent);
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.viewer-logo {
  display: block;
  height: 2rem;
  max-width: 7rem;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.viewer-logo[hidden] {
  display: none;
}

.topbar h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-edit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.logo-preview {
  height: 2.5rem;
  max-width: 6rem;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
}

.logo-preview[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.room-chip {
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(26, 34, 44, 0.8);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
}

.share-wrap {
  position: relative;
  flex-shrink: 0;
}

#btn-share.is-open {
  border-color: var(--accent);
  color: var(--accent);
}

.share-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 9.75rem;
  padding: 0.4rem;
  border-radius: 10px;
  background: rgba(15, 20, 25, 0.96);
  border: 1px solid #3a4a5a;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.share-panel[hidden] {
  display: none !important;
}

.share-link {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0.4rem 0.65rem 0.4rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: inset 3px 0 0 #5b9fd4;
}

.share-link:hover {
  border-color: var(--accent);
}

.share-link--fb { box-shadow: inset 3px 0 0 #1877f2; }
.share-link--x { box-shadow: inset 3px 0 0 #e8eef4; }
.share-link--in { box-shadow: inset 3px 0 0 #0a66c2; }
.share-link--wa { box-shadow: inset 3px 0 0 #25d366; }
.share-link--mail { box-shadow: inset 3px 0 0 #9aabbc; }

.hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  background: rgba(15, 20, 25, 0.7);
  color: var(--muted);
  font-size: 0.8rem;
  pointer-events: none;
}

/* Loader circulaire — ouverture / chargement d’une salle 360 */
.room-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  pointer-events: none;
  background: rgba(15, 20, 25, 0.42);
}
.room-loader[hidden] {
  display: none !important;
}
.room-loader__ring {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 3px solid rgba(232, 238, 244, 0.22);
  border-top-color: var(--accent);
  animation: room-loader-spin 0.75s linear infinite;
}
.room-loader__msg {
  color: var(--text);
  font-size: 0.9rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}
@keyframes room-loader-spin {
  to { transform: rotate(360deg); }
}

.site-credit {
  position: fixed;
  bottom: 0.55rem;
  right: 0.75rem;
  z-index: 6;
  margin: 0;
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.3;
  color: rgba(232, 238, 244, 0.72);
  background: rgba(10, 14, 18, 0.45);
  border-radius: 6px;
  pointer-events: auto;
}

.site-credit a {
  color: #e8eef4;
  font-weight: 600;
  text-decoration: none;
}

.site-credit a:hover {
  text-decoration: underline;
  color: var(--accent);
}

body.is-embed .site-credit {
  bottom: 0.35rem;
  right: 0.45rem;
  font-size: 0.68rem;
  background: rgba(10, 14, 18, 0.55);
}

.home:not([hidden]) ~ .site-credit {
  position: static;
  display: block;
  width: fit-content;
  margin: 1.5rem auto 0;
  background: transparent;
  text-align: center;
}

/* Lightbox Sketchfab */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-panel {
  width: min(960px, 100%);
  height: min(640px, 85vh);
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #333;
}

/* Image : quasi plein écran */
.lightbox.is-image-mode {
  padding: 0.4rem;
  background: rgba(0, 0, 0, 0.88);
}

.lightbox.is-image-mode .lightbox-panel {
  width: min(98vw, 100%);
  height: min(96vh, 100%);
  max-width: none;
  border-radius: 8px;
}

.lightbox.is-image-mode .lightbox-body {
  min-height: 0;
  background: #0a0a0a;
}

.lightbox.is-image-mode .lightbox-pdf-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: #0a0a0a;
  overflow: auto;
}

.lightbox-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: #1a1a1a;
}

.lightbox-head strong {
  flex: 1;
  font-size: 0.95rem;
}

.lightbox-body {
  flex: 1;
  height: 0;
  min-height: 320px;
  position: relative;
  width: 100%;
  background: #222;
  overflow: hidden;
}

/* Overlay descriptif (Sketchfab / Image) */
.lightbox-desc {
  position: absolute;
  z-index: 8;
  top: 0.75rem;
  right: 0.75rem;
  width: min(320px, calc(100% - 1.5rem));
  max-height: min(70%, calc(100% - 1.5rem));
  display: flex;
  flex-direction: column;
  background: rgba(18, 24, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  color: var(--text, #e8eef4);
  backdrop-filter: blur(6px);
}

.lightbox-desc[hidden] {
  display: none !important;
}

.lightbox-desc__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem 0.4rem 0.65rem;
  cursor: grab;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  touch-action: none;
}

.lightbox-desc__head:active {
  cursor: grabbing;
}

.lightbox-desc__title {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted, #9aabbc);
  text-transform: uppercase;
}

.lightbox-desc__min {
  padding: 0.15rem 0.5rem;
  min-width: 2rem;
  font-size: 1.1rem;
  line-height: 1;
}

.lightbox-desc__body {
  padding: 0.65rem 0.75rem 0.75rem;
  overflow: auto;
  min-height: 0;
}

.lightbox-desc__text {
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  margin-bottom: 0.55rem;
}

.lightbox-desc__text:last-child {
  margin-bottom: 0;
}

.lightbox-desc__audio {
  display: block;
  width: 100%;
  margin-top: 0.15rem;
  height: 2.1rem;
}

/* Sous-titres sur le média (visibles aussi en plein écran lightbox) */
.lightbox-captions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72) 45%);
}

.lightbox-captions__langs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  pointer-events: auto;
}

.lightbox-captions__controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: min(640px, 96%);
  pointer-events: auto;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.lightbox-captions__play {
  appearance: none;
  border: 0;
  background: transparent;
  color: #f4f0e6;
  width: 1.7rem;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox-captions__seek {
  flex: 1;
  min-width: 4rem;
  accent-color: var(--accent, #c9a227);
}

.lightbox-captions__time {
  font-size: 0.72rem;
  color: #d5deE6;
  font-variant-numeric: tabular-nums;
  min-width: 2.4rem;
}

.lightbox-captions__vol {
  width: 4.2rem;
  accent-color: var(--accent, #c9a227);
}

.lightbox-captions__srt {
  appearance: none;
  border: 0;
  background: transparent;
  width: 1rem;
  height: 1rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  border-radius: 3px;
}

.lightbox-captions__srt img {
  width: 1rem;
  height: 1rem;
  display: block;
  object-fit: contain;
}

.lightbox-captions__srt.is-on {
  box-shadow: 0 0 0 1px var(--accent, #c9a227);
}

.lightbox-captions__srt:disabled {
  opacity: 0.35;
  cursor: default;
}

.lightbox-captions__lang-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.55);
  color: #c8d4e0;
  border-radius: 6px;
  padding: 0.22rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.lightbox-captions__lang-btn:hover {
  filter: brightness(1.12);
}

.lightbox-captions__lang-btn.is-active {
  border-color: var(--accent, #c9a227);
  color: #1a1408;
  background: var(--accent, #c9a227);
}

.lightbox-captions__text {
  max-width: min(920px, 94%);
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(201, 162, 39, 0.4);
  color: #f4f0e6;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  line-height: 1.4;
  white-space: pre-wrap;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.lightbox-captions__text[hidden] {
  display: none !important;
}

.lightbox-panel:fullscreen,
.lightbox-panel:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  border: 0;
}

.lightbox-panel:fullscreen .lightbox-body,
.lightbox-panel:-webkit-full-screen .lightbox-body {
  min-height: 0;
  flex: 1;
}

.hs-srt-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hs-srt-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
}

.hs-srt-row__lang {
  font-weight: 600;
  white-space: nowrap;
}

.hs-srt-row__file {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted, #9aabbc);
  font-size: 0.72rem;
}

.lightbox-body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #222;
}

.lightbox-pdf-pane {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 12px;
  box-sizing: border-box;
  background: #525659;
  text-align: center;
}

.lightbox-pdf-pane[hidden] {
  display: none !important;
}

.lightbox-pdf-page {
  display: block;
  margin: 0 auto 12px;
  max-width: 100%;
  height: auto;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  background: #fff;
}

.lightbox-pdf-status {
  margin: 2rem auto;
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.4;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox.is-image-mode .lightbox-image {
  max-width: 100%;
  max-height: calc(96vh - 3.2rem);
  width: auto;
  height: auto;
}

.lightbox-pdf-status.is-err {
  color: #f0a0a0;
}

/* ——— Éditeur ——— */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  height: 100%;
}

.editor-side {
  background: var(--panel);
  border-right: 1px solid #2a3542;
  overflow: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.editor-main {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.editor-side h2 {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}

.field label {
  font-size: 0.8rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #3a4a5a;
  background: var(--bg);
  color: var(--text);
}

.field textarea {
  min-height: 3rem;
  resize: vertical;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.room-item,
.hs-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}

.room-item:hover,
.hs-item:hover {
  background: var(--panel-2);
}

.room-item.is-active,
.hs-item.is-active {
  border-color: var(--accent);
  background: rgba(201, 162, 39, 0.12);
}

.room-item .title,
.hs-item .title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.status-line {
  margin: 0.15rem 0 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.2em;
}

.status-line.is-ok {
  color: var(--ok);
}

.status-line.is-err {
  color: var(--danger);
}

.place-mode {
  position: absolute;
  top: 3.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  background: rgba(201, 162, 39, 0.92);
  color: #1a1408;
  font-size: 0.85rem;
  font-weight: 600;
  display: none;
}

.place-mode.is-on {
  display: block;
}

@media (max-width: 820px) {
  .editor-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .editor-side {
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid #2a3542;
  }
}
