:root {
  --bg: #eef3f6;
  --surface: #ffffff;
  --surface-strong: #f8fbfd;
  --ink: #0c1b24;
  --muted: #466171;
  --line: #b6c9d4;
  --accent: #28a0ba;
  --accent-strong: #1d8197;
  --warm: #28a0ba;
  --shadow: 0 8px 24px rgba(12, 27, 36, 0.08);
  --radius: 0px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Avenir Next", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7fbfd 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(12, 27, 36, 0.95);
  border-bottom: 2px solid var(--accent);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: #fff;
}

.brand-logo {
  width: 52px;
  height: 52px;
  display: block;
}

.brand-text {
  display: inline-block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: #dff6fb;
}

.site-nav a,
.site-nav .link-button {
  color: inherit;
}

.link-button,
.button {
  border: none;
  border-radius: 0;
  padding: 0.85rem 1.2rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background 0.18s ease;
}

.button:hover,
.link-button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.button-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.25rem;
}

.page-shell-wide {
  max-width: none;
  padding: 0 1rem 1rem;
}

.page-shell-editor {
  max-width: none;
  padding: 0;
  overflow: hidden;
}

/* ── Compact editor header ────────────────────────────── */
.site-header-editor {
  padding: 0 1rem;
  height: 40px;
}

.site-header-editor .brand-logo {
  width: 28px;
  height: 28px;
}

.site-header-editor .brand-text {
  font-size: 0.85rem;
}

.site-header-editor .site-nav {
  font-size: 0.85rem;
  gap: 0.75rem;
}

.hero,
.map-page-header,
.card,
.map-stage-card,
.info-panel,
.editor-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero,
.map-page-header {
  padding: 2rem;
  margin-bottom: 1.2rem;
  border-left: 6px solid var(--accent);
}

.hero h1,
.map-page-header h1,
.auth-card h1 {
  margin: 0.35rem 0 0.65rem;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.eyebrow,
.card-kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.76rem;
  color: var(--warm);
  font-weight: 700;
}

.lede {
  max-width: 60ch;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card,
.auth-card,
.editor-panel,
.info-panel {
  padding: 1.25rem;
}

.button-row,
.map-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.map-shell,
.editor-shell,
.import-layout,
.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 380px);
  gap: 1rem;
  align-items: start;
}

/* ── Full-viewport editor app shell ───────────────────── */

.editor-app {
  display: grid;
  grid-template-columns: 260px 1fr 52px;
  height: calc(100vh - 40px);
  overflow: hidden;
}

.editor-app.panel-collapsed {
  grid-template-columns: 0px 1fr 52px;
}

.editor-app.panel-collapsed .editor-left-panel {
  width: 0;
  padding: 0;
  overflow: hidden;
  border-right: none;
}

/* ── Left panel ───────────────────────────────────────── */

.editor-left-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: hidden;
  min-height: 0;
  transition: width 0.2s ease;
}

.editor-tab-bar {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.editor-tab-btn {
  flex: 1;
  padding: 0.55rem 0.5rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.editor-tab-btn:hover {
  color: var(--ink);
}

.editor-tab-btn.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.editor-tab-close {
  flex: 0 0 auto;
  width: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-tab-close:hover {
  color: var(--ink);
}

.editor-tab-content {
  display: none;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.editor-tab-content.is-active {
  display: block;
}

/* ── Map canvas ───────────────────────────────────────── */

.editor-map-canvas {
  position: relative;
  overflow: hidden;
  background: #e8edf0;
  min-height: 0;
}

.editor-map-canvas .map-stage-editor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* ── Floating status chip ─────────────────────────────── */

.editor-status-chip {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(12, 27, 36, 0.72);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 100px;
  pointer-events: none;
  backdrop-filter: blur(6px);
  user-select: none;
}

.editor-chip-sep {
  opacity: 0.5;
}

/* ── Floating finish-polygon button ───────────────────── */

.editor-floating-action {
  position: absolute;
  top: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 0.5rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(12, 27, 36, 0.22);
}

.editor-floating-action:hover {
  background: var(--accent-strong);
}

.editor-floating-action[hidden] {
  display: none;
}

/* ── Panel expand button (visible when collapsed) ─────── */

.editor-panel-expand-btn {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 10;
  width: 20px;
  height: 48px;
  border: none;
  border-radius: 0 6px 6px 0;
  background: rgba(12, 27, 36, 0.72);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.editor-panel-expand-btn:hover {
  background: rgba(12, 27, 36, 0.88);
}

.editor-panel-expand-btn[hidden] {
  display: none;
}

/* ── Right toolbar ──────────────────────────────────────── */

.editor-right-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0;
  gap: 0.15rem;
  background: rgba(12, 27, 36, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  overflow-x: hidden;
}

.toolbar-btn {
  width: 44px;
  min-height: 36px;
  padding: 0.3rem 0.15rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  transition: background 0.15s, color 0.15s;
  line-height: 1.1;
}

.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.toolbar-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.toolbar-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.toolbar-divider {
  width: 32px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin: 0.3rem 0;
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-btn-save {
  background: var(--accent);
  color: #fff;
  margin-top: 0.25rem;
}

.toolbar-btn-save:hover {
  background: var(--accent-strong);
}

.toolbar-zoom-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.68rem;
  text-align: center;
  width: 44px;
  padding: 0.15rem 0;
  user-select: none;
}

/* ── Left panel internal layout ───────────────────────── */

.editor-panel-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.editor-panel-section {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.editor-panel-section + .editor-panel-section {
  border-top: 1px solid var(--line);
}

.editor-panel-heading {
  display: grid;
  gap: 0.15rem;
}

.editor-panel-heading h3 {
  margin: 0;
}

.editor-tool-stack {
  display: grid;
  gap: 0.65rem;
}

.editor-tool-stack-inline {
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.editor-status-rows {
  display: grid;
  gap: 0.4rem;
}

.editor-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.editor-status-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.editor-bulk-panel {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.editor-empty-panel {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  background: var(--surface-strong);
}

.editor-empty-panel p {
  margin: 0;
  color: var(--muted);
}

/* ── Compact panel typography ─────────────────────────── */

.editor-left-panel {
  font-size: 0.82rem;
}

.editor-left-panel h3 {
  font-size: 0.88rem;
  margin: 0;
}

.editor-left-panel .eyebrow {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.editor-left-panel .helper-text {
  font-size: 0.78rem;
}

.editor-left-panel label > span {
  font-size: 0.76rem;
  font-weight: 600;
}

.editor-left-panel input,
.editor-left-panel select,
.editor-left-panel textarea {
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
}

.editor-left-panel .button-small {
  font-size: 0.75rem;
  padding: 0.4rem 0.65rem;
}

.editor-panel-section {
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
}

.editor-left-panel .editor-form {
  gap: 0.6rem;
}

.editor-left-panel .editor-form label {
  gap: 0.25rem;
}

.editor-left-panel .editor-grid {
  gap: 0.5rem;
}

.editor-left-panel .editor-bulk-panel {
  gap: 0.6rem;
  padding: 0.7rem;
}

.editor-left-panel .editor-empty-panel {
  gap: 0.35rem;
  padding: 0.7rem;
}

.setup-layout {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.setup-section {
  display: grid;
  gap: 0.85rem;
  padding-top: 0.25rem;
}

.setup-section + .setup-section {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.setup-note,
.field-group small {
  color: var(--muted);
}

.helper-text {
  color: var(--muted);
  font-size: 0.92rem;
}

.field-group .helptext {
  color: var(--muted);
  font-size: 0.92rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.upload-panel {
  display: grid;
  gap: 0.75rem;
}

.upload-panel input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.upload-dropzone {
  display: grid;
  place-items: center;
  min-height: 9rem;
  padding: 1rem;
  text-align: center;
  border: 2px dashed var(--accent);
  background: linear-gradient(180deg, rgba(40, 160, 186, 0.08) 0%, rgba(255, 255, 255, 0.98) 100%);
  cursor: pointer;
}

.upload-dropzone.dragover {
  background: rgba(40, 160, 186, 0.14);
}

.upload-dropzone span {
  color: var(--muted);
}

.upload-preview {
  min-height: 10rem;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.upload-preview img {
  display: block;
  width: 100%;
  max-height: 18rem;
  object-fit: contain;
}

.setup-guide {
  position: sticky;
  top: 5.8rem;
}

.errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #b91c1c;
  font-size: 0.92rem;
}

.map-stage-card {
  padding: 1rem;
  max-width: 860px;
}

.map-stage {
  position: relative;
  min-height: 36rem;
  max-height: 42rem;
  overflow: hidden;
  background: linear-gradient(180deg, #eef7fa 0%, #ffffff 100%);
  border: 1px solid var(--line);
}

.map-stage-editor {
  min-height: 0;
  max-height: none;
  height: 100%;
  touch-action: none;
  border: none;
  box-shadow: none;
}

.map-camera {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  will-change: transform;
}

.map-stage-background {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: top left;
  pointer-events: none;
  user-select: none;
}

.map-overlay {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.editor-surface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.editor-surface-hit {
  fill: transparent;
  pointer-events: all;
}

.editor-vector-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.editor-vector-layer .polygon-outline {
  fill: rgba(40, 160, 186, 0.18);
  stroke: var(--accent);
  stroke-width: 0.004;
}

.editor-vector-layer .polygon-preview {
  fill: rgba(40, 160, 186, 0.2);
  stroke: var(--accent);
  stroke-width: 0.004;
  stroke-dasharray: 0.015 0.01;
}

.editor-vector-layer .vertex-handle {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 0.004;
  pointer-events: all;
  cursor: move;
}

.booth-group {
  cursor: pointer;
}

.booth-shape {
  fill: var(--booth-fill);
  fill-opacity: var(--booth-opacity, 0.75);
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 0.003;
}

.booth-selection-outline {
  fill: none;
  stroke: rgba(40, 160, 186, 0.96);
  stroke-width: 0.005;
  stroke-dasharray: 0.015 0.01;
  pointer-events: none;
}

.multi-selection-outline {
  fill: rgba(40, 160, 186, 0.06);
  stroke: rgba(40, 160, 186, 0.96);
  stroke-width: 0.004;
  stroke-dasharray: 0.012 0.01;
  pointer-events: none;
}

.booth-label {
  fill: #fff;
  font-size: 0.018px;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
}

.resize-handle-svg {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 0.003;
  cursor: nwse-resize;
}

.booth-draft-rect {
  fill: rgba(40, 160, 186, 0.22);
  stroke: var(--accent);
  stroke-width: 0.004;
  stroke-dasharray: 0.012 0.01;
  pointer-events: none;
}

/* ── Detection overlay ────────────────────────────────── */

.detection-group {
  cursor: pointer;
}

.detection-rect {
  stroke-width: 0.003;
  transition: fill 0.15s, stroke 0.15s;
}

.detection-pending .detection-rect {
  fill: rgba(250, 204, 21, 0.25);
  stroke: #facc15;
  stroke-dasharray: 0.008 0.006;
}

.detection-pending:hover .detection-rect {
  fill: rgba(250, 204, 21, 0.45);
  stroke: #eab308;
}

.detection-exists .detection-rect {
  fill: rgba(100, 116, 139, 0.18);
  stroke: rgba(100, 116, 139, 0.5);
  stroke-dasharray: 0.006 0.006;
}

.detection-exists {
  cursor: default;
  opacity: 0.5;
}

.detection-accepted .detection-rect {
  fill: rgba(34, 197, 94, 0.25);
  stroke: #22c55e;
}

.detection-accepted {
  cursor: default;
  pointer-events: none;
}

.detection-label {
  fill: #fff;
  font-size: 0.025px;
  font-weight: 700;
  pointer-events: none;
  text-shadow: 0 0 0.004px rgba(0, 0, 0, 0.6);
}

.booth {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(12, 27, 36, 0.14);
}

.booth.selected {
  outline: 3px solid rgba(40, 160, 186, 0.9);
  z-index: 2;
}

/* linked booth indicator in editor SVG */
.booth-group.is-linked .booth-shape {
  stroke-dasharray: 0.012 0.006;
  stroke: #f59e0b;
  stroke-width: 0.004;
}

.booth-link-badge {
  font-size: 0.032px;
  pointer-events: none;
}

/* linked booth label in public info panel */
.booth-group-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.2rem 0 0.5rem;
}

.map-stage.draw-rect-mode,
.map-stage.draw-polygon-mode {
  cursor: crosshair;
}

.map-stage.pan-mode,
.map-stage.is-panning {
  cursor: grab;
}

.map-stage.is-panning {
  cursor: grabbing;
}

#public-map-stage {
  cursor: grab;
  touch-action: none;
}

#public-map-stage.is-panning {
  cursor: grabbing;
}

.booth-draft {
  background: rgba(40, 160, 186, 0.45);
  border-style: dashed;
  pointer-events: none;
}

.resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--accent);
  z-index: 4;
}

.resize-handle-nw {
  left: -7px;
  top: -7px;
  cursor: nwse-resize;
}

.resize-handle-ne {
  right: -7px;
  top: -7px;
  cursor: nesw-resize;
}

.resize-handle-sw {
  left: -7px;
  bottom: -7px;
  cursor: nesw-resize;
}

.resize-handle-se {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}

.empty-stage {
  height: 100%;
  min-height: 28rem;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.search-field,
.editor-form label,
.stacked-form p {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.editor-form,
.stacked-form {
  display: grid;
  gap: 0.9rem;
}

.editor-form-modal {
  gap: 1rem;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.editor-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.editor-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.editor-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.editor-grid-span-2 {
  grid-column: span 2;
}

.button-small {
  padding: 0.65rem 0.8rem;
}

.vendor-results {
  border: 1px solid var(--line);
  background: #fff;
  max-height: 14rem;
  overflow: auto;
}

.vendor-results[hidden] {
  display: none;
}

.vendor-results button {
  width: 100%;
  border: none;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
}

.vendor-results button:first-child {
  border-top: none;
}

.vendor-results button:hover {
  background: rgba(40, 160, 186, 0.08);
}

input,
textarea,
select {
  width: 100%;
  border-radius: 0;
  border: 1px solid var(--line);
  padding: 0.8rem 0.9rem;
  background: rgba(255, 255, 255, 0.98);
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
}

.checkbox-field input {
  width: auto;
}

.messages {
  max-width: 1240px;
  margin: 1rem auto 0;
  padding: 0 1.25rem;
}

.message {
  padding: 0.9rem 1rem;
  border-radius: 0;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
}

.message.success {
  border-color: rgba(20, 83, 45, 0.35);
}

.message.error {
  border-color: rgba(185, 28, 28, 0.35);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.auth-shell {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(480px, 100%);
}

.editor-modal[hidden] {
  display: none;
}

.editor-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

body.modal-picker-open .editor-modal {
  pointer-events: none;
}

.editor-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 27, 36, 0.55);
}

.editor-modal-dialog {
  position: relative;
  margin: 4vh auto;
  width: min(960px, calc(100vw - 2rem));
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 20px 60px rgba(12, 27, 36, 0.25);
  padding: 1.2rem;
}

.editor-modal-dialog-narrow {
  width: min(720px, calc(100vw - 2rem));
}

body.modal-picker-open .editor-modal-backdrop {
  display: none;
}

body.modal-picker-open .editor-modal-dialog {
  opacity: 0;
  pointer-events: none;
}

.editor-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.editor-modal-header h2 {
  margin: 0.2rem 0 0;
}

.editor-modal-actions {
  justify-content: space-between;
}

.type-color-preview-row,
.type-list-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.opacity-slider-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.opacity-slider-row input[type="range"] {
  flex: 1;
  min-width: 0;
}

.type-color-swatch {
  width: 1.4rem;
  height: 1.4rem;
  border: 1px solid var(--line);
  background: #0f766e;
  flex: 0 0 auto;
}

.type-list-wrap {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.editor-subsection-header {
  margin-bottom: 0.75rem;
}

.editor-subsection-header h3 {
  margin: 0.2rem 0 0;
}

.type-list {
  display: grid;
  gap: 0.75rem;
}

.type-list-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.type-list-item p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

body.modal-open {
  overflow: hidden;
}

body.modal-picker-open {
  overflow: auto;
}

.card,
.auth-card,
.editor-panel,
.info-panel,
.map-stage,
.map-stage-card,
.button,
.link-button,
input,
textarea,
select,
.message {
  border-radius: 0;
}

@media (max-width: 980px) {
  .map-shell,
  .editor-shell,
  .import-layout,
  .setup-layout {
    grid-template-columns: 1fr;
  }

  .editor-app {
    grid-template-columns: 200px 1fr 44px;
  }

  .editor-app.panel-collapsed {
    grid-template-columns: 0px 1fr 44px;
  }

  .editor-grid-three,
  .editor-grid-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-stage {
    min-height: 28rem;
    max-height: 34rem;
  }

  .map-stage-editor {
    min-height: 0;
    max-height: none;
  }

  .map-stage-card {
    max-width: 100%;
  }

  .setup-guide {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-header,
  .page-shell {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .hero,
  .map-page-header,
  .card,
  .map-stage-card,
  .info-panel,
  .editor-panel {
    padding: 1rem;
    border-radius: 0;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .brand-text {
    font-size: 0.95rem;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-grid-three,
  .editor-grid-four {
    grid-template-columns: 1fr;
  }

  .editor-grid-span-2 {
    grid-column: auto;
  }

  .editor-modal-dialog {
    width: calc(100vw - 1rem);
    margin: 0.5rem auto;
    max-height: calc(100vh - 1rem);
  }
}
