:root {
  --bg: #0e0b0c;
  --surface: #161113;
  --surface-2: #21181b;
  --text: #ffffff;
  --muted: #b8aeae;
  --accent: #9e2a2b;
  --border: rgba(255, 255, 255, 0.14);
  --heading-font: 'Cinzel', Georgia, serif;
}

body[data-theme="add_classic"] {
  --bg: #15120e;
  --surface: #1e1913;
  --surface-2: #2a231a;
  --text: #faf5ea;
  --muted: #c8bca4;
  --accent: #d4a359;
  --border: rgba(212, 163, 89, 0.28);
  --heading-font: 'Cinzel', Georgia, serif;
}

body[data-theme="cthulhu_eldritch"] {
  --bg: #0a1311;
  --surface: #111e1b;
  --surface-2: #192b27;
  --text: #f1f6f3;
  --muted: #a6bdb5;
  --accent: #4db6ac;
  --border: rgba(77, 182, 172, 0.28);
  --heading-font: 'Cinzel', Georgia, serif;
}

body[data-theme="classic"] {
  --bg: #111318;
  --surface: #191c24;
  --surface-2: #232833;
  --text: #ffffff;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --border: rgba(255, 255, 255, 0.14);
  --heading-font: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Auth */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
}
.auth-card h1 {
  margin: 0 0 6px;
  font-family: var(--heading-font);
  font-size: 24px;
}
.auth-tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0 14px;
}
.tab {
  flex: 1;
  padding: 8px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.tab.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--accent);
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
}
textarea { resize: vertical; min-height: 80px; }

.btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}
.btn.ghost { background: transparent; }
.btn.danger { color: #fca5a5; border-color: rgba(248, 113, 113, 0.35); }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn.full { width: 100%; }
.error-msg {
  color: #fca5a5;
  font-size: 12px;
  margin-bottom: 10px;
}

/* Main 3-Pane Layout */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.topbar {
  height: 50px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.brand {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 16px;
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-pill {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.workspace-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 220px 1fr 410px;
  overflow: hidden;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  padding: 13px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.sidebar-header h2 { margin: 0; font-size: 13px; font-family: var(--heading-font); }
.workspace-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-item {
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ws-item:hover { border-color: var(--accent); }
.ws-item.active {
  background: var(--surface-2);
  border-color: var(--accent);
}
.ws-item-title { font-weight: 600; font-size: 13px; }
.ws-item-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   CENTER: VISUAL 2D SPATIAL MAP OF MINI SMARTPHONE SHEETS
   ============================================================ */

.grid-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 22px 22px;
}
.pane-header {
  padding: 10px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--bg);
}
.ws-identity {
  min-width: 140px;
}
.pane-header h2 { margin: 0; font-family: var(--heading-font); font-size: 18px; }
.pane-header p { margin: 2px 0 0; }
.game-logo-slot {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
}
.game-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 12%, var(--surface)) 25%,
    color-mix(in srgb, var(--accent) 12%, var(--surface)) 75%,
    transparent
  );
}
.game-logo-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 45%, transparent));
}
.game-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.game-logo-main {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--text);
  text-transform: uppercase;
}
.game-logo-sub {
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 600;
}
.pane-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.pane-actions select { width: auto; margin: 0; }
.zoom-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.zoom-label {
  font-size: 11px;
  color: var(--muted);
  min-width: 38px;
  text-align: center;
}
.grid-hint {
  margin: 0;
  padding: 0 18px 10px;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.grid-canvas {
  --card-w: 224px;
  --card-h: 352px;
  --card-gap: 24px;

  /* Default Sheet Theme Variables (Mascarade Dark — exact Android RpgThemes.kt mirror) */
  --p-bg: #0E0B0C;
  --p-surface: #161113;
  --p-surface-var: #21181B;
  --p-topbar: #171113;
  --p-text: #FFFFFF;
  --p-muted: #D4CACA;
  --p-primary: #FFFFFF;
  --p-accent: #9E2A2B;
  --p-outline: #6B3A3E;
  --p-heading-font: 'Cinzel', Georgia, serif;
  --p-body-font: 'Inter', system-ui, sans-serif;

  flex: 1;
  overflow: auto;
  padding: 26px 28px 48px;
}

/* Sheet Themes & Dark/Light Mode Palettes */
.grid-canvas[data-sheet-theme="masquerade"][data-sheet-mode="light"] {
  --p-bg: #F8F2EA;
  --p-surface: #FDF9F3;
  --p-surface-var: #EDE2D6;
  --p-topbar: #E9DDD0;
  --p-text: #1C1415;
  --p-muted: #4E3839;
  --p-primary: #241416;
  --p-accent: #7A1C1C;
  --p-outline: #9E6B6D;
}
.grid-canvas[data-sheet-theme="add_classic"][data-sheet-mode="dark"] {
  --p-bg: #15120E;
  --p-surface: #1E1913;
  --p-surface-var: #2A231A;
  --p-topbar: #201A13;
  --p-text: #FAF5EA;
  --p-muted: #D9CDB8;
  --p-primary: #E6C27A;
  --p-accent: #D4A359;
  --p-outline: #8A6F42;
  --p-body-font: Georgia, 'Times New Roman', serif;
}
.grid-canvas[data-sheet-theme="add_classic"][data-sheet-mode="light"] {
  --p-bg: #F6EEDB;
  --p-surface: #FCF7E8;
  --p-surface-var: #EBE0C5;
  --p-topbar: #E8DAB9;
  --p-text: #231B12;
  --p-muted: #524331;
  --p-primary: #1E3A5F;
  --p-accent: #8C5A1B;
  --p-outline: #A88954;
  --p-body-font: Georgia, 'Times New Roman', serif;
}
.grid-canvas[data-sheet-theme="cthulhu_eldritch"][data-sheet-mode="dark"] {
  --p-bg: #0A1311;
  --p-surface: #111E1B;
  --p-surface-var: #192B27;
  --p-topbar: #0F1D1A;
  --p-text: #F1F6F3;
  --p-muted: #C4D6CF;
  --p-primary: #80CBC4;
  --p-accent: #4DB6AC;
  --p-outline: #3E6E64;
  --p-body-font: Georgia, 'Times New Roman', serif;
}
.grid-canvas[data-sheet-theme="cthulhu_eldritch"][data-sheet-mode="light"] {
  --p-bg: #F1EFE5;
  --p-surface: #F8F6EE;
  --p-surface-var: #E2E0D3;
  --p-topbar: #E0DDD0;
  --p-text: #151E1B;
  --p-muted: #3A4D46;
  --p-primary: #1B4D3E;
  --p-accent: #1B5E4F;
  --p-outline: #648277;
  --p-body-font: Georgia, 'Times New Roman', serif;
}
.grid-canvas[data-sheet-theme="classic"][data-sheet-mode="dark"] {
  --p-bg: #111318;
  --p-surface: #191C24;
  --p-surface-var: #232833;
  --p-topbar: #161920;
  --p-text: #FFFFFF;
  --p-muted: #CBD5E1;
  --p-primary: #FFFFFF;
  --p-accent: #94A3B8;
  --p-outline: #475569;
  --p-heading-font: 'Inter', system-ui, sans-serif;
}
.grid-canvas[data-sheet-theme="classic"][data-sheet-mode="light"] {
  --p-bg: #F8FAFC;
  --p-surface: #FFFFFF;
  --p-surface-var: #E2E8F0;
  --p-topbar: #E2E8F0;
  --p-text: #0F172A;
  --p-muted: #334155;
  --p-primary: #1E293B;
  --p-accent: #475569;
  --p-outline: #94A3B8;
  --p-heading-font: 'Inter', system-ui, sans-serif;
}

.grid-row {
  display: flex;
  gap: var(--card-gap);
  margin-bottom: var(--card-gap);
}

/* Visual Mobile Sheet Card */
.sheet-card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  flex-shrink: 0;
  border-radius: 20px;
  border: 3px solid #28272b;
  background: var(--p-bg);
  color: var(--p-text);
  font-family: var(--p-body-font);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.sheet-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--p-accent) 70%, #ffffff 30%);
}
.sheet-card.selected {
  border-color: var(--p-accent);
  box-shadow: 0 0 0 2px var(--p-accent), 0 14px 32px rgba(0, 0, 0, 0.65);
}
.sheet-card.cover-card {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--p-accent) 45%, transparent), 0 12px 28px rgba(0, 0, 0, 0.55);
}
.sheet-card.selected.cover-card {
  box-shadow: 0 0 0 2px var(--p-accent), 0 14px 32px rgba(0, 0, 0, 0.65);
}

/* Subtle left barrier indicator for (1, y != 0) where West swipe is blocked */
.sheet-card.west-blocked::before {
  content: '';
  position: absolute;
  left: 0;
  top: 44px;
  bottom: 18px;
  width: 3px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.22) 0px,
    rgba(255, 255, 255, 0.22) 4px,
    transparent 4px,
    transparent 8px
  );
  pointer-events: none;
  z-index: 3;
}

.sheet-card.empty {
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed var(--border);
  box-shadow: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-family: 'Inter', system-ui, sans-serif;
  text-align: center;
  padding: 16px;
}
.sheet-card.empty:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  color: var(--text);
}
.sheet-card.empty.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: #fff;
  transform: scale(1.02);
}
.empty-plus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px dashed currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}
.empty-label {
  font-size: 12px;
  font-weight: 500;
}
.empty-sub {
  font-size: 10px;
  opacity: 0.7;
}

.sheet-card.spacer {
  visibility: hidden;
  pointer-events: none;
}

/* Directional Link Connectors Between Neighboring Cards */
.conn-arrow {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  color: var(--p-accent);
  opacity: 0.75;
  font-size: 11px;
  font-weight: 700;
}
.sheet-slot {
  position: relative;
  flex-shrink: 0;
}
.slot-link-e {
  position: absolute;
  right: calc(var(--card-gap) * -1);
  top: 50%;
  width: var(--card-gap);
  height: 2px;
  background: linear-gradient(to right, var(--p-accent), color-mix(in srgb, var(--p-accent) 45%, transparent));
  opacity: 0.55;
  pointer-events: none;
}
.slot-link-e::after {
  content: '';
  position: absolute;
  right: 4px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-top: 2px solid var(--p-accent);
  border-right: 2px solid var(--p-accent);
  transform: rotate(45deg);
}
.slot-link-s {
  position: absolute;
  bottom: calc(var(--card-gap) * -1);
  left: 50%;
  width: 2px;
  height: var(--card-gap);
  background: color-mix(in srgb, var(--p-accent) 55%, transparent);
  opacity: 0.5;
  pointer-events: none;
}

/* Mini Android TopBar inside each Visual Card */
.sheet-topbar {
  height: 28px;
  padding: 0 10px;
  background: var(--p-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.14);
  flex-shrink: 0;
}
.sheet-coord {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--p-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-drag-tag {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  color: var(--p-muted);
  opacity: 0.65;
  cursor: grab;
}

/* Scrollable Sheet Interior inside each Visual Card */
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sheet-body::-webkit-scrollbar { width: 3px; }
.sheet-body::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.25);
  border-radius: 3px;
}

.sheet-gesture-bar {
  height: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--p-bg);
  flex-shrink: 0;
}
.sheet-gesture-bar span {
  width: 58px;
  height: 3px;
  border-radius: 999px;
  background: var(--p-text);
  opacity: 0.22;
}

/* Rendered Android Blocks inside each Card */
.mini-ornament {
  width: 100%;
  height: 10px;
  display: block;
  flex-shrink: 0;
}
.mini-page-title {
  margin: 0;
  font-family: var(--p-heading-font);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  color: var(--p-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.mini-section-title {
  font-family: var(--p-heading-font);
  font-weight: 700;
  font-size: 10.5px;
  color: var(--p-text);
  letter-spacing: 0.02em;
  margin-bottom: 3px;
  padding-bottom: 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--p-outline) 45%, transparent);
}
.mini-text-body {
  font-size: 10.5px;
  line-height: 1.42;
  color: var(--p-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.mini-kv-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  padding: 2.5px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--p-outline) 24%, transparent);
}
.mini-kv-label { color: var(--p-muted); }
.mini-kv-value { color: var(--p-text); font-weight: 500; text-align: right; }

.mini-dot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 0;
}
.mini-dots { display: flex; gap: 3px; }
.mini-dot-pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.2px solid var(--p-primary);
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.mini-dot-pip.filled { background: var(--p-primary); }

.mini-track-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 3.5px;
  margin-top: 2px;
}
.mini-track-cell {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1.2px solid var(--p-outline);
  background: transparent;
  color: var(--p-text);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mini-counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  padding: 2px 0;
}
.mini-counter-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}
.mini-counter-btn {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--p-outline);
  background: var(--p-surface-var);
  color: var(--p-text);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
}
.mini-counter-val {
  font-weight: 700;
  font-size: 11px;
}

.mini-check-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  padding: 2px 0;
  cursor: pointer;
}
.mini-check-row.checked span:last-child {
  text-decoration: line-through;
  opacity: 0.55;
}

.mini-image {
  width: 100%;
  max-height: 135px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.mini-image-caption {
  font-size: 9px;
  color: var(--p-muted);
  text-align: center;
  margin-top: 2px;
}

.mini-link-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.mini-link-chip {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--p-outline);
  background: var(--p-surface-var);
  color: var(--p-text);
  font-size: 9.5px;
  cursor: pointer;
}

/* ============================================================
   RIGHT PANE: KEYBOARD BLOCK EDITOR
   ============================================================ */

.editor-pane {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.editor-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 13px;
}
.editor-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.editor-header {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
}
.page-title-input {
  font-family: var(--heading-font);
  font-size: 17px !important;
  font-weight: 700;
  margin-bottom: 8px;
}
.editor-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.editor-meta-row select { width: auto; margin: 0; flex: 1; }
.badge {
  font-size: 11px;
  padding: 4px 8px;
  background: var(--surface-2);
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.blocks-container {
  flex: 1;
  overflow-y: auto;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.block-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px;
  background: rgba(0, 0, 0, 0.16);
}
.block-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}
.block-actions { display: flex; gap: 4px; }
.kv-row, .dot-row, .check-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.track-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.track-box {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.block-image {
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  display: block;
  margin-bottom: 8px;
}
.add-block-bar {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.upload-btn { display: inline-block; margin: 0; color: var(--text); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  border-radius: 14px;
  padding: 22px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.modal-card h3 { margin: 0 0 12px; font-family: var(--heading-font); }
.modal-logo-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
