/* ---- Design tokens (lifted from the explorer app) ---- */
:root {
  --bg-deep: #070d16;
  --left-sidebar: #08101a;
  --right-sidebar: whitesmoke;
  --border: #172030;
  --accent-orig: #2dd4b4;
  --accent: #549c8e;
  --accent-dim: rgba(45, 212, 180, 0.15);
  --text-primary: #e4edf5;
  --text-secondary: #7a8fa3;
  --text-muted: #3d5060;

  /* Right "console" rail: a lifted ink surface + a warm brass counter-accent
     borrowed from the cream artifact, so the dark editor reads as the survey
     instrument framing the document rather than generic chrome. */
  --panel: #0c1623;
  --panel-input: rgba(255, 255, 255, 0.04);
  --brass: #c9a25f;
  --red: #ff1c1c;
  --mono: ui-monospace, 'SF Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Published-page palette (cream) */
  --page-bg: #f0ebe0;
  --page-ink: #1c1814;
  --page-body: #3d3530;
  --page-muted: #8a7f72;
  --page-faint: #a09080;
  --page-rule: #d8d0c4;
  --img-bg: #e0d9cc;
  --img-border: #c0b0a0;
}

* { box-sizing: border-box; }

/* Thin, dark scrollbars on every scrolling surface (the look the media library
   established). `color-scheme` tells the browser this is a dark UI, which is all
   Firefox needs; Blink/WebKit ignore it for scrollbars, hence the ::-webkit-
   rules. Both are universal-selector-weak, so the cream .cms__stage scrollbar
   further down still wins where the page itself is light. */
:root { color-scheme: dark; }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18); border-radius: 6px;
  border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3); background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }

html, body {
  margin: 0;
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.cms {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Left: list ---- */
.cms__list {
  flex: 0 0 20vw;
  min-width: 220px;
  max-width: 380px;
  background: var(--left-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.cms__list-head { padding: 18px 16px 12px; border-bottom: 1px solid var(--border); }
.cms__list-head h1 {
  font-size: 16px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-secondary); margin: 0 0 8px;
}
/* Search box mirrors the right-panel field controls (see .ed__control input). */
#site-search {
  width: 100%; padding: 11px 12px; border-radius: 8px;
  background: var(--panel-input); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 14px; font-family: inherit;
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}
#site-search:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: rgba(45, 212, 180, 0.04);
}
#site-search::placeholder { color: var(--text-muted); }
/* Room for the custom clear button; hide the browser's native one (it can't be
   themed and is absent in Firefox anyway). */
.cms__search { position: relative; }
.cms__search #site-search { padding-right: 36px; }
#site-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.cms__search-clear {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 22px; height: 22px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.08); color: var(--text-secondary);
  font-size: 16px; line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.cms__search-clear:hover { background: rgba(255, 255, 255, 0.16); color: var(--text-primary); }
.cms__count { font-size: 10px; letter-spacing: 0.1em; color: var(--text-muted); margin: 10px 2px; }

.cms__sites { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.site-item {
  padding: 10px 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent; transition: background 0.15s, border-color 0.15s;
}
.site-item:hover { background: rgba(45, 212, 180, 0.06); }
.site-item.is-active { background: var(--accent-dim); border-color: rgba(45, 212, 180, 0.4); }
.site-item__name { font-size: 13px; color: var(--text-primary); }
.site-item__meta { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
/* Published shipwrecks: dark slate row (keeps text legible on the darker bg). */
.site-item.is-published { background-color: #25333f; }
.site-item.is-published:hover { background-color: #2c3d4b; }
.site-item.is-published .site-item__name { color: #eaf1f4; }
.site-item.is-published .site-item__meta { color: #9fb3bf; }
.site-item.is-published.is-active { background-color: #25333f; border-color: rgba(45, 212, 180, 0.55); }
/* In-review shipwrecks: warm brown row. */
.site-item.is-review { background-color: #54421d; }
.site-item.is-review:hover { background-color: #634e24; }
.site-item.is-review .site-item__name { color: #f5ecdd; }
.site-item.is-review .site-item__meta { color: #c2ac86; }
.site-item.is-review.is-active { background-color: #54421d; border-color: rgba(45, 212, 180, 0.55); }

/* "Add Shipwreck" button (list header) */
.cms__add { width: 100%; margin: 0 0 12px; }

/* List footer: pinned beneath the scrolling vessel list (ul is flex:1). */
.cms__foot {
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 16px 16px; border-top: 1px solid var(--border);
}
.cms__user { font-size: 11px; color: var(--text-secondary); }
.cms__user strong { color: var(--text-primary); font-weight: 600; }
.cms__foot form { margin: 0; }
.cms__logout {
  width: 100%; padding: 9px 12px; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500;
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
  transition: color 0.14s, border-color 0.14s, background 0.14s;
}
.cms__logout:hover { color: var(--text-primary); border-color: var(--text-secondary); background: rgba(255, 255, 255, 0.04); }

/* Per-row delete "×": revealed on hover/focus, top-right. */
.site-item { position: relative; }
.site-item__name { padding-right: 20px; }
.site-item__del {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 20px; height: 20px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); color: var(--text-secondary);
  font-size: 15px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.site-item:hover .site-item__del,
.site-item__del:focus { opacity: 1; }
.site-item__del:hover { background: #b5462f; color: #fff; }

/* ---- Publish / status bar (top of the right edit panel) ---- */
.statusbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 16px 10px 0; border-bottom: 1px solid var(--border);
}
.statusbar--empty { padding: 0; border-bottom: none; }
.statusbar__label {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-secondary);
}
.statusbar__seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.statusbar__btn {
  appearance: none; border: none; border-right: 1px solid var(--border); cursor: pointer; border-radius: 4px;
  padding: 6px 12px; font-size: 12px; font-family: inherit; line-height: 1;
  background: transparent; color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}
.statusbar__btn:last-child { border-right: none; }
.statusbar__btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }
.statusbar__btn.is-on { color: #fff; }
.statusbar__btn--draft.is-on { background: rgba(255, 255, 255, 0.16); }
.statusbar__btn--review.is-on { background: #c9952f; color: #1f1505; }
.statusbar__btn--pub.is-on { background: var(--accent); color: #08130f; }
.statusbar__since { font-size: 12px; color: var(--text-secondary); }

/* ---- Marine Accident flag (between status bar and edit body) ---- */
.marine-accident {
  padding: 10px 16px 10px 0; border-bottom: 1px solid var(--border);
}
.marine-accident__row {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 13px; color: var(--text-secondary);
}
.marine-accident__check {
  appearance: none;
  width: 15px; height: 15px; margin: 0; flex: 0 0 auto;
  cursor: pointer; background: var(--panel-input);
  border: thin solid #666;
  border-radius: 3px;
}
.marine-accident__check:checked {
  background: var(--red);
  border-color: var(--red);
}

/* ---- Snapshots / history (foot of the right panel) ---- */
[x-cloak] { display: none !important; }

.snaps {
  /* Pinned to the bottom third of the panel; scrolls internally if the
     snapshot list grows. */
  flex: 0 0 33.333%;
  min-height: 0;
  overflow-y: auto;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* Cross-link to the enregister review queue, pinned beneath the snapshots. */
.cms__cross-link {
  flex: 0 0 auto;
  display: block;
  margin-top: 14px;
  text-align: center;
  text-decoration: none;
}
.snaps__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.snaps__title {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-secondary); margin: 0;
}
.snaps__create { margin-bottom: 14px; padding: 0 4px;}
.snaps__input {
  flex: 1; min-width: 0; padding: 7px 10px; border-radius: 6px;
  background: var(--panel-input); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 12px; font-family: inherit;
  width: 80%; margin-top: 8px;
}
.snaps__input::placeholder { color: var(--text-muted); }
.snaps__create .btn { white-space: nowrap; }

.snaps__list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.snap { display: flex; align-items: stretch; gap: 8px; }
.snap__check { margin-top: 12px; flex: 0 0 auto; accent-color: var(--accent); cursor: pointer; }
.snap__main {
  flex: 1; min-width: 0; text-align: left; cursor: pointer;
  padding: 8px 10px; border-radius: 6px;
  background: var(--panel-input); border: 1px solid var(--border);
  color: var(--text-primary); font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}
.snap__main:hover { background: rgba(45, 212, 180, 0.08); border-color: rgba(45, 212, 180, 0.4); }
.snap__label { display: block; font-size: 12px; color: var(--text-primary); }
.snap__meta { display: block; font-size: 10px; color: var(--text-secondary); margin-top: 3px; }
.snaps__remove { width: 100%; }
.snaps__empty { font-size: 12px; font-style: italic; color: var(--text-secondary); margin: 4px 0 0; }

/* ---- Modal (rollback confirmation) ---- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 8, 14, 0.66); }
.modal__card {
  position: relative; z-index: 1; width: min(420px, calc(100vw - 40px));
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px 22px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.modal__title { margin: 0 0 10px; font-size: 16px; color: var(--text-primary); }
.modal__text { margin: 0 0 18px; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
.modal__text strong { color: var(--text-primary); }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---- Center: stage (cream page) ---- */
/* Middle column: a flex column holding the fixed content-language bar above the
   scrolling stage. It owns the 60vw width + full height so the stage can scroll
   within it (the bar stays put). */
.cms__center {
  flex: 1 1 60vw;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cms__stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--page-bg);
  color: var(--page-ink);
}
.cms__empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--page-faint); font-style: italic;
}

.page { max-width: 1280px; margin: 0 auto; padding: 0 0 60px; }

/* Editable / read-only field affordances */
.f { position: relative; cursor: pointer; border-radius: 4px; transition: box-shadow 0.12s, background 0.12s; }
.f:hover { box-shadow: 0 0 0 2px rgba(45, 212, 180, 0.55); }
.f.is-selected { box-shadow: 0 0 0 2px var(--accent); background: rgba(45, 212, 180, 0.08); }
.f--empty { color: var(--page-faint); font-style: italic; }

/* Hero + images */
.page__hero { aspect-ratio: 21 / 9; }
.imgslot {
  position: relative;
  background: var(--img-bg); border: 1px dashed var(--img-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--page-faint); font-size: 12px; letter-spacing: 0.06em;
  overflow: hidden;
  height: 100%;
}
.imgslot-sm {
  position: relative;
  background: var(--img-bg); border: 1px dashed var(--img-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--page-faint); font-size: 12px; letter-spacing: 0.06em;
  overflow: hidden;
  height: 50%;
}

.imgslot img, .imgslot-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Remove-image control: corner "×" revealed on hover/focus over a filled slot. */
.imgslot__remove {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 24px; height: 24px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: rgba(20, 18, 16, 0.6); color: #fff;
  font-size: 17px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity 0.12s ease, background 0.12s ease;
}
.imgslot:hover .imgslot__remove,
.imgslot-sm:hover .imgslot__remove,
.imgslot__remove:focus { opacity: 1; }
.imgslot__remove:hover { background: rgba(20, 18, 16, 0.88); }

.page__title-wrap { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 24px 24px 18px; border-bottom: 1px solid var(--page-rule); }
/* Below 1280px stack the stats beneath the title instead of sitting beside it. */
@media (max-width: 1280px) { .page__title-wrap { flex-direction: column; } }
.page__title { font-family: Georgia, 'Times New Roman', serif; font-size: 38px; line-height: 1.05; letter-spacing: -0.02em; margin: 0; padding: 8px; color: var(--page-ink); }
.page__stats { display: flex; gap: 26px; flex-shrink: 0; }
.stat { text-align: left; padding: 8px; }
.stat__label { display: block; font-size: 9px; letter-spacing: 0.14em; color: var(--page-muted); }
.stat__value { display: block; font-family: Georgia, serif; font-size: 22px; color: var(--page-ink); margin-top: 4px; }

.page__layout { display: grid; grid-template-columns: 1fr 230px; gap: 40px; padding: 24px 24px 0; }
/* Below 1024px the 230px rail crams the body text; collapse to one column so the
   sidebar stacks full-width directly beneath the gallery (the body's last child). */
@media (max-width: 1280px) { .page__layout { grid-template-columns: 1fr; } }
.page__body { font-family: Georgia, 'Times New Roman', serif; color: var(--page-body); }
.lead { font-size: 18px; line-height: 1.55; color: var(--page-ink); margin: 0 0 18px; padding: 8px; }
.bodytext { font-size: 15px; line-height: 1.65; margin: 0 0 14px; padding: 8px;}
.divider { border: none; border-top: 1px solid var(--page-rule); margin: 20px 0; }
.narrativetext {
  line-height: 1.65;
  margin: 40px 20px;
  background-color: #fff;
  padding: 24px;
  font-size: 14px;
  border: thin solid #dcdcdc;
  border-radius: 10px;
  box-shadow: 3px 5px 7px 2px rgba(0, 0, 0, 0.2);
}
@media (min-width: 1600px) { .narrativetext { margin: 40px 80px; font-size: 18px; } }
@media (max-width: 1280px) { .narrativetext { margin: 40px 20px; font-size: 16px; } }
@media (max-width: 1024px) { .narrativetext { margin: 40px 10px; } }
.pullquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; margin: 18px 8px; font-size: 19px; font-style: italic; color: #3a3028; border-radius: 0; }
.pullquote cite { display: block; font-size: 12px; font-style: normal; letter-spacing: 0.08em; color: var(--page-muted); margin-top: 10px; }
.bodynote { font-size: 12px; font-style: italic; color: var(--page-faint); margin: 16px 0; padding: 8px; }

.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin: 22px 0 36px; }
/* Every slot is a fixed box sized by the layout, never by the image. The wide
   slot fills its box (cover); the two narrow slots keep a consistent box and are
   top-aligned (no stretch), with their images scaled to fit inside (contain) so
   any aspect ratio — portrait, landscape, square — stays within the layout. */
.gallery > .imgslot { aspect-ratio: 4 / 3; height: auto; }
.gallery > .imgslot-sm { aspect-ratio: 4 / 3; height: auto; align-self: start; }
.gallery > .imgslot-sm img { object-fit: contain; }

.sidebar { font-family: 'Inter', sans-serif; }
.side-sec { margin-bottom: 22px; }
.side-sec__title { font-size: 10px; letter-spacing: 0.16em; color: var(--accent); margin: 0 0 10px; }
/* Stacked rows: small uppercase label, value beneath (see concept mock). */
.side-row { display: block; padding: 8px; border-bottom: 1px solid var(--page-rule); }
.side-row__label { display: block; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--page-muted); margin-bottom: 4px; }
.side-row__value { display: block; font-size: 14px; color: #2a241e; }

/* ---- Right: edit console ---- */
/* A dark instrument rail (not the old whitesmoke). Together with the left list
   it frames the cream stage as "the document under glass". */
.cms__edit {
  flex: 0 0 22vw;
  min-width: 320px;
  max-width: 400px;
  background:
    linear-gradient(180deg, rgba(45, 212, 180, 0.05), transparent 120px),
    var(--panel);
  border-left: 1px solid var(--border);
  padding: 2px 20px 28px;
  /* Flex column so the snapshots section can pin to the bottom third while the
     status bar + editor fill (and scroll within) the top two thirds. */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.statusbar { flex: 0 0 auto; }
#edit-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.cms__edit-empty {
  color: var(--text-secondary); font-size: 13px; line-height: 1.6;
  font-style: italic; margin-top: 4px;
}

/*
{ animation: ed-in 0.18s ease both; }
@keyframes ed-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ed { animation: none; } }
*/

/* Header: brass catalogue eyebrow + serif title — each field reads like a
   catalogued specimen, echoing the page's serif. */
.ed__head { margin: 0 0 18px; }
.ed__tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--brass);
}
.ed__tag::before { content: ""; width: 16px; height: 1px; background: var(--brass); opacity: 0.8; }
.ed__title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 23px; line-height: 1.15; font-weight: 500;
  color: var(--text-primary); margin: 8px 0 0; letter-spacing: -0.01em;
}
.ed__hint { font-size: 12px; line-height: 1.5; color: var(--text-secondary); margin: 8px 0 0; }

/* Controls */
.ed__control { margin-top: 16px; }
.ed__control input[type="text"],
.ed__control input[type="number"],
.ed__control textarea,
.ed__select select {
  width: 100%; padding: 11px 12px; border-radius: 8px;
  background: var(--panel-input); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 14px; font-family: inherit;
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}
.ed__control input:focus,
.ed__control textarea:focus,
.ed__select select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: rgba(45, 212, 180, 0.04);
}
.ed__control input::placeholder,
.ed__control textarea::placeholder { color: var(--text-muted); }
.ed__control textarea { min-height: 180px; resize: vertical; line-height: 1.6; }

/* Coordinates — a paired survey readout with °N / °W units. */
.ed__coords { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ed__sublabel {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-secondary); margin: 0 0 5px;
}
.ed__sublabel span { color: var(--brass); letter-spacing: 0.08em; }

/* Native select with a custom chevron. */
.ed__select { position: relative; }
.ed__select select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; }
.ed__select::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 1.5px solid var(--text-secondary); border-bottom: 1.5px solid var(--text-secondary);
  transform: translateY(-65%) rotate(45deg); pointer-events: none;
}

/* File picker styled as a button (hides the raw input). */
.ed__upload { display: flex; gap: 8px; align-items: stretch; margin: 4px 0 18px; padding: 0 8px; }
.ed__file {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  background: var(--panel-input); border: 1px dashed var(--border);
  color: var(--text-secondary); font-size: 13px; transition: border-color 0.14s, color 0.14s;
}
.ed__file:hover { border-color: var(--accent); color: var(--text-primary); }
.ed__file input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.ed__actions { display: flex; gap: 8px; margin-top: 18px; margin-bottom: 18px; }
.btn {
  padding: 10px 18px; border-radius: 8px; font-size: 13px; cursor: pointer;
  border: 1px solid transparent; font-family: inherit; font-weight: 500;
  transition: filter 0.14s, color 0.14s, border-color 0.14s, background 0.14s;
}
/* Anchors styled as buttons (the Data Management link, the enregister cross-link,
   the empty-state CTA) must render like <button>s: no underline, and a block-like
   box so width/margins from .cms__add etc. apply and reserve space (an inline <a>
   ignores them, which otherwise lets the search box overlap it). */
a.btn { display: inline-block; text-decoration: none; text-align: center; box-sizing: border-box; }
.btn--save { background: var(--accent); color: #04120f; font-weight: 600; }
.btn--save:hover { filter: brightness(1.08); }
.btn--save:disabled { opacity: 0.5; cursor: default; }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.btn--ghost:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.btn--danger { background: #b5462f; color: #fff; font-weight: 600; }
.btn--danger:hover { filter: brightness(1.08); }

.ed__status { font-size: 12px; margin-top: 14px; min-height: 16px; }
.ed__status.is-ok { color: var(--accent); }
.ed__status.is-err { color: #f08a8a; }

/* ---- Stage scrollbar (cream track, dark thumb) ---- */
.cms__stage { scrollbar-width: thin; scrollbar-color: #1b1b1d #d7cfc0; }
.cms__stage::-webkit-scrollbar { width: 12px; }
.cms__stage::-webkit-scrollbar-track { background: #d7cfc0; }
.cms__stage::-webkit-scrollbar-thumb { background: #1b1b1d; border-radius: 6px; border: 3px solid #d7cfc0; }

/* ---- Media library picker (lives in the dark console) ---- */
.medlib { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.medlib__item { display: block; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; cursor: pointer; background: rgba(255, 255, 255, 0.03); text-align: left; font: inherit; transition: border-color 0.14s; }
.medlib__item:hover { border-color: var(--accent); }
.medlib__item.is-current { outline: 2px solid var(--accent); outline-offset: -2px; }
.medlib__item img { width: 100%; height: 76px; object-fit: cover; display: block; }
.medlib__name { display: block; font-size: 10px; color: var(--text-secondary); padding: 5px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.medlib__empty { grid-column: 1 / -1; color: var(--text-muted); font-size: 12px; font-style: italic; }

/* ---- Related section (cream stage, concept-002) ---- */
.related { padding: 4px 24px 56px; }
.related__title {
  font-family: Georgia, 'Times New Roman', serif; font-style: italic;
  font-size: 30px; color: var(--page-ink); margin: 28px 0 20px;
}
.related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.related__item { display: block; text-align: left; background: none; border: none; padding: 8px; font: inherit; cursor: pointer; color: inherit; }
.related__img {
  aspect-ratio: 1 / 1; background: var(--img-bg); border: 1px solid var(--img-border);
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.related__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Empty slot: the wireframe "X" from the concept. */
.related__img.is-empty {
  background-image:
    linear-gradient(to top right, transparent calc(50% - 0.5px), var(--img-border) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(to bottom right, transparent calc(50% - 0.5px), var(--img-border) 50%, transparent calc(50% + 0.5px));
}
.related__plus { font-size: 34px; font-weight: 300; color: var(--page-faint); line-height: 1; }
.related__name { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; color: var(--page-ink); margin: 14px 0 6px; }
.related__name--add { font-weight: 500; font-style: italic; color: var(--page-muted); }
.related__link { font-family: 'Inter', sans-serif; font-size: 12px; color: var(--page-muted); }

/* ---- Login (the gate to the archive) ----------------------------------------
   Same survey-instrument identity as the editor: deep ink ground, a teal glow
   off the top edge, a brass catalogue eyebrow over a serif title. The sign-in
   card reads as a single instrument panel; the form fields reuse the editor's
   field treatment so logging in already feels like the console behind it. */
.login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(45, 212, 180, 0.10), transparent 60%),
    var(--bg-deep);
}
.login__card {
  width: min(400px, 100%);
  background:
    linear-gradient(180deg, rgba(45, 212, 180, 0.05), transparent 120px),
    var(--panel);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 36px 34px 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.login__tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--brass);
}
.login__tag::before { content: ""; width: 18px; height: 1px; background: var(--brass); opacity: 0.8; }
.login__title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px; line-height: 1.1; font-weight: 500; letter-spacing: -0.01em;
  color: var(--text-primary); margin: 12px 0 0;
}
.login__hint { font-size: 13px; line-height: 1.55; color: var(--text-secondary); margin: 8px 0 26px; }

.login__field { margin-bottom: 16px; }
.login__label {
  display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-secondary); margin: 0 0 6px;
}
.login__field input {
  width: 100%; padding: 11px 12px; border-radius: 8px;
  background: var(--panel-input); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 14px; font-family: inherit;
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}
.login__field input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim); background: rgba(45, 212, 180, 0.04);
}
.login__field input::placeholder { color: var(--text-muted); }

.login__submit { width: 100%; margin-top: 6px; padding: 12px 18px; }

.login__error {
  display: flex; gap: 8px; margin: 0 0 22px; padding: 11px 13px;
  border-radius: 8px; font-size: 12.5px; line-height: 1.5;
  background: rgba(240, 138, 138, 0.08); border: 1px solid rgba(240, 138, 138, 0.35);
  color: #f0a8a8;
}

/* Survey stamp: a faint mono coordinate readout, echoing the editor's °N/°W
   coordinate fields, sealing the card like a logged dive site. */
.login__stamp {
  margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted);
  display: flex; justify-content: center; gap: 12px;
}

/* ---- Media Library manager (full-surface modal) ----------------------------- */
.modal--full { z-index: 55; }
.lib-modal {
  position: relative; z-index: 1;
  width: min(1200px, 94vw); height: min(840px, 90vh);
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  overflow: hidden; display: flex; flex-direction: column;
}
#library-modal-body { height: 100%; }
.lib { height: 100%; display: flex; flex-direction: column; }
.lib__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.lib__heading { margin: 0; font-family: 'Open Sans', sans-serif; font-size: 20px; color: var(--text-primary); }
.lib__close {
  width: 32px; height: 32px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--panel-input); color: var(--text-secondary); font-size: 22px; line-height: 1;
}
.lib__close:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }

.lib__body {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 200px 1fr 320px;
  /* Pin the single row to the available height so the columns scroll
     internally instead of growing the body past the modal. */
  grid-template-rows: minmax(0, 1fr);
}

/* Folder rail */
.lib__rail {
  border-right: 1px solid var(--border); padding: 14px 12px;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0;
}
.lib__folder {
  text-align: left; width: 100%; padding: 8px 10px; border-radius: 7px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--text-secondary);
  font: inherit; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.lib__folder:hover { background: var(--panel-input); color: var(--text-primary); }
.lib__folder.is-active { background: var(--accent-dim); border-color: var(--accent); color: var(--text-primary); }
.lib__folder-count { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.lib__folder-row { display: flex; align-items: center; gap: 2px; }
.lib__folder-row .lib__folder { flex: 1; min-width: 0; }
.lib__folder-del {
  flex: 0 0 auto; width: 24px; height: 24px; border: none; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--text-muted); font-size: 16px; line-height: 1;
}
.lib__folder-del:hover { background: rgba(181,70,47,0.18); color: #f08a8a; }
.lib__newfolder { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.lib__newfolder input {
  flex: 1; min-width: 0; padding: 7px 9px; border-radius: 6px;
  background: var(--panel-input); border: 1px solid var(--border); color: var(--text-primary); font: inherit; font-size: 12px;
}
.lib__newfolder input:focus { outline: none; border-color: var(--accent); }
.lib__newfolder-add {
  flex: 0 0 auto; padding: 0 12px; border-radius: 6px; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary); font: inherit; font-size: 12px;
}
.lib__newfolder-add:hover { color: var(--text-primary); border-color: var(--text-secondary); }

/* Main column: toolbar + grid */
.lib__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lib__toolbar { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.lib__search {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 8px;
  background: var(--panel-input); border: 1px solid var(--border); color: var(--text-primary); font: inherit; font-size: 13px;
}
.lib__search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.lib__upload { flex: 0 0 auto; }
.lib__file {
  display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: #04120f; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.lib__file:hover { filter: brightness(1.08); }
.lib__file input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.libgrid {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  /* min-content rows keep tiles at their natural height (160px thumb + title)
     instead of compressing to fit, so the grid scrolls when it overflows. */
  grid-auto-rows: min-content;
  gap: 12px; align-content: start;
}
.libgrid__empty { grid-column: 1 / -1; color: var(--text-muted); font-style: italic; font-size: 13px; }
.libtile {
  position: relative; display: flex; flex-direction: column; padding: 0; cursor: pointer;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 9px; overflow: hidden;
  text-align: left; font: inherit; transition: border-color 0.14s, transform 0.08s;
}
.libtile:hover { border-color: var(--accent); }
.libtile:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.libtile__thumb { display: block; height: 160px; flex: 0 0 auto; background: var(--bg-deep); }
.libtile__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.libtile__title {
  padding: 7px 9px; font-size: 12px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.libtile__badge {
  position: absolute; top: 7px; right: 7px; min-width: 19px; height: 19px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center; border-radius: 10px;
  background: var(--brass); color: #1c1409; font-size: 11px; font-weight: 700; font-family: var(--mono);
}

/* Detail pane */
.lib__detail { border-left: 1px solid var(--border); overflow-y: auto; min-height: 0; padding: 16px; }
.libdetail__empty { color: var(--text-muted); font-style: italic; font-size: 13px; padding: 8px 2px; }
.libdetail__preview {
  background: var(--bg-deep); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; display: flex; align-items: center; justify-content: center; max-height: 280px;
}
.libdetail__preview img { width: 100%; max-height: 280px; object-fit: contain; display: block; }
.libdetail__use { width: 100%; margin-top: 12px; }
.libdetail__form { margin-top: 16px; display: flex; flex-direction: column; }
.libdetail__label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-secondary); margin: 12px 0 5px;
}
.libdetail__label span { text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.libdetail__input, .libdetail__select select {
  width: 100%; padding: 9px 11px; border-radius: 7px;
  background: var(--panel-input); border: 1px solid var(--border); color: var(--text-primary); font: inherit; font-size: 13px;
}
.libdetail__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.libdetail__select { margin-top: 0; }
.libdetail__actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.libdetail__status { font-size: 12px; }
.libdetail__status.is-ok { color: var(--accent); }
.libdetail__status.is-err { color: #f08a8a; }
.libdetail__facts {
  margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px;
}
.libdetail__facts div { min-width: 0; }
.libdetail__facts dt {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
}
.libdetail__facts dd { margin: 3px 0 0; font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.libdetail__usage { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.libdetail__usage h4 { margin: 0 0 8px; font-size: 12px; color: var(--text-primary); }
.libdetail__usage ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.libdetail__usage li { font-size: 12px; color: var(--text-secondary); }
.libdetail__kind {
  display: inline-block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brass); margin-right: 6px;
}
.libdetail__unused { font-size: 12px; color: var(--text-secondary); font-style: italic; margin: 0; }
.libdetail__delete { width: 100%; margin-top: 18px; }

/* Editor media panel additions */
.ed__manage { width: 100%; margin-bottom: 14px; }
.ed__slotmeta { margin-bottom: 18px; padding: 0 8px 16px; border-bottom: 1px solid var(--border); }
.ed__slotmeta input[type="text"] {
  width: 100%; padding: 9px 11px; border-radius: 7px; margin-bottom: 4px;
  background: var(--panel-input); border: 1px solid var(--border); color: var(--text-primary); font: inherit; font-size: 13px;
}
.ed__slotmeta input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* Content-language bar — a fixed header above the cream stage stating which
   language's content is being authored, with its FR/EN toggle. Laid out as a
   row; sits in the .cms__center flex column so the stage scrolls below it. */
.stagebar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  background: linear-gradient(90deg, #0A1219, #101D24);
  border-bottom: 1px solid var(--border);
}
.stagebar__label {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.13em;
  font-weight: 600; color: var(--brass);
}

/* Shared FR/EN pill toggle — used by the stage bar and the left-panel
   interface-language switch. */
.stagebar__toggle,
.uilang {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.stagebar__toggle button,
.uilang button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--mono); font-weight: 600; letter-spacing: 0.06em;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}
.stagebar__toggle button { font-size: 12px; padding: 5px 15px; }
.uilang button { font-size: 11px; padding: 3px 10px; }
.stagebar__toggle button:hover,
.uilang button:hover { color: var(--text-primary); }
.stagebar__toggle button.is-active,
.uilang button.is-active { background: var(--accent); color: #08130f; }

/* Right cluster of the stage bar: FR/EN toggle then the self-naming label. */
.stagebar__right { display: inline-flex; align-items: center; gap: 12px; }

/* Content / Map view toggle (left of the stage bar). Same pill language as the
   FR/EN toggle, sized a touch larger since it carries words, not codes. */
.viewtoggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.viewtoggle button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--mono); font-weight: 600; letter-spacing: 0.06em;
  font-size: 12px; padding: 5px 16px;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}
.viewtoggle button:hover { color: var(--text-primary); }
.viewtoggle button.is-active { background: var(--accent); color: #08130f; }

/* Stage views: the content replica scrolls; the map fills the stage. */
.cms__content { min-height: 100%; }
.cms__map { height: 100%; width: 100%; }
.cms__map--missing {
  display: flex; align-items: center; justify-content: center;
  color: var(--page-faint); font-style: italic; padding: 24px; text-align: center;
}

/* Mapbox popup — keep it readable on the light basemap. */
.mapboxgl-popup-content { font-family: var(--sans, sans-serif); font-size: 13px; padding: 8px 12px; }
.mappop__state { color: #5c6773; text-transform: capitalize; font-size: 11px; }


/* ---- KML/KMZ import modal ---------------------------------------------------- */
/* Reuses the lib-modal frame; .imp-modal narrows it — the preview is a table,
   not an image grid. */
.imp-modal { width: min(900px, 94vw); height: min(760px, 88vh); }
#import-modal-body { height: 100%; }
.imp { height: 100%; display: flex; flex-direction: column; }
.imp__body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 20px; overflow: hidden; }
.imp__intro { max-width: 560px; margin: 40px auto 0; text-align: center; }
.imp__help { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0 0 24px; }
.imp__error {
  background: rgba(224, 82, 82, 0.12); border: 1px solid rgba(224, 82, 82, 0.4);
  color: #e88; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin: 0 0 16px;
}
.imp__file { display: inline-flex; }
.imp__preview { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.imp__preview form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.imp__meta { color: var(--text-secondary); font-size: 13px; margin: 0 0 12px; }
.imp__meta strong { color: var(--text-primary); }
.imp__toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex: 0 0 auto; }
.imp__count { color: var(--text-secondary); font-size: 13px; margin-left: auto; }
.imp__count strong { color: var(--text-primary); }
.imp__go:disabled { opacity: 0.45; cursor: not-allowed; }
.imp__tablewrap {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px;
}
.imp__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.imp__table thead th {
  position: sticky; top: 0; background: var(--panel); z-index: 1;
  text-align: left; padding: 10px 12px; color: var(--text-secondary);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.imp__table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.imp__table tbody tr:last-child td { border-bottom: none; }
.imp__table input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
.imp__cell-name { color: var(--text-primary); white-space: nowrap; }
.imp__cell-coords { color: var(--text-secondary); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.imp__cell-desc { color: var(--text-secondary); }
.imp__geom { color: var(--brass); font-size: 11px; margin-left: 6px; }
.imp__row--invalid td { opacity: 0.45; }
.imp__row--invalid .imp__cell-coords { color: #e88; font-family: inherit; white-space: normal; }
.imp__summary { max-width: 560px; margin: 40px auto 0; text-align: center; }
.imp__done { color: var(--text-primary); font-size: 20px; margin: 0 0 10px; }
.imp__skipped { text-align: left; color: var(--text-secondary); font-size: 13px; margin: 16px 0; }
.imp__skipped ul { margin: 8px 0 0; padding-left: 18px; }
.imp__actions { margin-top: 24px; }

/* ── Website editor ──────────────────────────────────────────────────────────
   Reuses the CMS shell (cms/website.html). The centre pane is an iframe of the
   real page rendered in edit mode; the right pane carries a slim publish bar and
   the per-string editor. */
.wt-page-item { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.wt-page-item .site-item__name { padding-right: 8px; }
/* Unpublished-changes dot on a page row. */
.wt-dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brass); box-shadow: 0 0 0 3px rgba(201, 162, 95, 0.18);
}

/* Left title of the stage bar (this editor has no view toggle). */
.stagebar__pagetitle {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.13em;
  font-weight: 600; color: var(--text-secondary);
}

/* The iframe fills the (cream) stage; white so the site's own bg shows through. */
.cms__stage--wt { background: #fff; padding: 0; overflow: hidden; }
.wt-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* Unlike the shipwreck panel (fixed status bar + inner-scrolling #edit-body over
   a pinned snapshots section), the website panel has no pinned footer, so the
   whole aside scrolls — image previews and long reference copy run past the
   viewport. Children keep their natural height instead of being squeezed. */
#wt-edit-panel { overflow-y: auto; }
#wt-edit-panel > * { flex: 0 0 auto; }

/* Publish bar (Alpine-driven): Publish button, dirty state / discard, live-since. */
.statusbar--wt { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.statusbar__publish { padding: 7px 20px; }
.statusbar__wtstate { display: inline-flex; align-items: center; gap: 12px; }
.statusbar__dirty { font-size: 12px; color: var(--brass); font-weight: 600; }
.statusbar__discard { padding: 5px 12px; font-size: 12px; }

/* Field editor: the key shown as a monospace title, other-language reference. */
.ed__title--key { font-family: var(--mono); font-size: 15px; word-break: break-all; }
.ed__wtother {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.ed__wtother-val {
  margin: 4px 0 0; font-size: 13px; color: var(--text-secondary);
  white-space: pre-wrap; line-height: 1.5;
}

/* Website image editor: current-image preview + override state pill. */
.ed__imgpreview {
  margin-top: 14px; display: flex; flex-direction: column; gap: 8px;
}
.ed__imgpreview img {
  width: 100%; max-height: 200px; object-fit: contain; border-radius: 6px;
  background: var(--panel-2, rgba(0,0,0,.04)); border: 1px solid var(--border);
}
.ed__imgstate {
  font-size: 12px; color: var(--text-secondary); letter-spacing: .02em;
}
.ed__imgstate.is-custom { color: var(--brass); }
.ed__imgempty {
  display: flex; align-items: center; justify-content: center; min-height: 90px;
  border: 1px dashed var(--border); border-radius: 6px;
  color: var(--text-secondary); font-size: 12px;
}

/* Back link (image editor opened from a group panel). */
.ed__back {
  background: none; border: none; color: var(--brass); cursor: pointer;
  font-size: 12px; padding: 0; margin-bottom: 8px; letter-spacing: .02em;
}
.ed__back:hover { text-decoration: underline; }

/* Image-group panel: a thumbnail per member (slideshow slides). */
.ed__grouplist { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.ed__groupitem {
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  background: var(--panel-2, rgba(0,0,0,.04)); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; text-align: left; transition: border-color .1s, box-shadow .1s;
}
.ed__groupitem:hover { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(180,140,70,.25); }
.ed__groupitem img { width: 100%; max-height: 120px; object-fit: contain; border-radius: 4px; }
.ed__groupitem-badge { font-size: 11px; color: var(--text-secondary); letter-spacing: .02em; }
.ed__groupitem-badge.is-custom { color: var(--brass); }
