/* =====================================================================
   Sailing Logbook Builder — CHROME stylesheet
   ---------------------------------------------------------------------
   This file styles only the builder's own UI (steps, drop zones, theme
   gallery, preview frame). The preview iframe is rendered with its own
   theme CSS coming from builder/themes/<theme>.css, so nothing here
   leaks into the generated logbook.
   ===================================================================== */

:root {
  --b-ink:        #0a2233;
  --b-ink-2:      #1f4863;
  --b-ink-soft:   #5a7588;
  --b-paper:      #faf6ef;
  --b-paper-2:    #f3ecde;
  --b-sand:       #ecdfc4;
  --b-sand-soft:  #f6efde;
  --b-rule:       #d8c9b0;
  --b-rule-soft:  #ebdfcc;
  --b-primary:    #0e8aa0;
  --b-primary-d:  #0a6f82;
  --b-brass:      #b07d00;
  --b-coral:      #d97757;
  --b-moss:       #15803d;
  --b-rose:       #c4576f;
  --b-shadow:     0 18px 50px rgba(10, 34, 51, 0.10);
  --b-max:        1240px;
  --b-ease:       cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--b-ink);
  background: var(--b-paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(rgba(10, 34, 51, 0.022) 1px, transparent 1px),
    radial-gradient(rgba(176, 125, 0, 0.022) 1px, transparent 1px);
  background-position: 0 0, 8px 11px;
  background-size: 18px 18px, 18px 18px;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }
code.b-mono, .b-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: rgba(10, 34, 51, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ===================== NAV ===================== */
.b-nav {
  position: sticky; top: 0; z-index: 80;
  background: rgba(250, 246, 239, 0.85);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--b-rule-soft);
}
.b-nav-inner {
  max-width: var(--b-max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
}
.b-brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-weight: 800; letter-spacing: 0.3px; font-size: 15px;
}
.b-brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 2px 6px rgba(10, 34, 51, 0.08); }
.b-brand.small img { width: 22px; height: 22px; border-radius: 6px; }
.b-sep { color: var(--b-rule); margin: 0 4px; }
.b-sub { color: var(--b-ink-soft); font-weight: 600; }
.b-nav-right { display: flex; gap: 22px; }
.b-nav-link { color: var(--b-ink-soft); font-weight: 600; font-size: 14px; }
.b-nav-link:hover { color: var(--b-ink); }
@media (max-width: 680px) {
  .b-sep, .b-sub { display: none; }
  .b-nav-right { gap: 14px; }
  .b-nav-link { font-size: 13px; }
}

/* ===================== SHELL / STEPS ===================== */
.b-shell {
  max-width: var(--b-max);
  margin: 0 auto;
  padding: 56px 24px 96px;
  display: flex; flex-direction: column;
  gap: 64px;
}
@media (max-width: 720px) { .b-shell { padding: 36px 18px 72px; gap: 44px; } }

.b-step {
  background: #fff;
  border: 1px solid var(--b-rule-soft);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 1px 0 rgba(10, 34, 51, 0.03), var(--b-shadow);
  transition: opacity 240ms var(--b-ease), filter 240ms var(--b-ease);
}
@media (max-width: 720px) { .b-step { padding: 24px 20px; border-radius: 16px; } }

.b-step-locked {
  opacity: 0.45; filter: grayscale(0.4);
  pointer-events: none;
}
.b-step-locked .b-step-head h2 { color: var(--b-ink-soft); }

.b-step-head { margin-bottom: 26px; }
.b-step-num {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600; font-style: italic;
  font-size: 13px; letter-spacing: 1px;
  color: var(--b-brass);
  display: inline-block; margin-bottom: 8px;
}
.b-step-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--b-ink);
  margin-bottom: 10px;
}
.b-step-lead {
  color: var(--b-ink-soft);
  font-size: 15.5px;
  max-width: 720px;
}
.b-step-lead strong { color: var(--b-ink); font-weight: 700; }
.b-step-lead em { color: var(--b-ink); font-style: italic; font-weight: 600; }

/* ===================== DROP ZONES ===================== */
.b-drop {
  display: block;
  border: 2px dashed var(--b-rule);
  border-radius: 16px;
  background: var(--b-sand-soft);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: background 200ms, border-color 200ms, transform 200ms var(--b-ease);
}
.b-drop:hover { background: var(--b-paper-2); border-color: var(--b-brass); }
.b-drop.is-drag { background: #fcefca; border-color: var(--b-brass); transform: scale(1.01); }
.b-drop-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.b-drop-ico { width: 42px; height: 42px; color: var(--b-brass); }
.b-drop h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600; font-size: 19px;
  color: var(--b-ink);
}
.b-drop p { color: var(--b-ink-soft); font-size: 14px; }
.b-drop.b-drop-photos { padding: 30px 22px; }

/* ===================== "OR" DIVIDER + DEMO BUTTON ===================== */
.b-or {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0 18px;
  color: var(--b-ink-soft);
  font-size: 11px; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase;
}
.b-or-rule { flex: 1; height: 1px; background: var(--b-rule-soft); }
.b-or-word { padding: 0 4px; }

.b-btn-demo {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, #fff 0%, #fefcf6 100%);
  border: 1.5px solid var(--b-brass);
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  color: var(--b-ink);
  position: relative; overflow: hidden;
  transition: transform 200ms var(--b-ease), box-shadow 200ms, background 200ms;
  box-shadow: 0 6px 20px rgba(176, 125, 0, 0.12);
}
.b-btn-demo::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(60% 80% at 50% 0%, rgba(176, 125, 0, 0.08), transparent 60%);
  pointer-events: none;
}
.b-btn-demo:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(176, 125, 0, 0.22);
  background: linear-gradient(135deg, #fffaee 0%, #fef4d8 100%);
}
.b-btn-demo svg { color: var(--b-brass); position: relative; z-index: 1; }
.b-btn-demo span {
  position: relative; z-index: 1;
  font-weight: 800; font-size: 15.5px;
  font-family: 'Fraunces', Georgia, serif; font-style: normal;
}
.b-btn-demo em {
  position: relative; z-index: 1;
  font-style: normal;
  font-size: 12px; color: var(--b-ink-soft);
  font-weight: 600; letter-spacing: 0.2px;
}

/* ===================== HELP DETAILS ===================== */
.b-help {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--b-sand-soft);
  border: 1px solid var(--b-rule-soft);
  border-radius: 10px;
  font-size: 14px;
}
.b-help summary {
  cursor: pointer; font-weight: 700; color: var(--b-ink);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.b-help summary::before {
  content: ''; width: 14px; height: 14px;
  background: linear-gradient(currentColor, currentColor) center/10px 1.5px no-repeat,
              linear-gradient(currentColor, currentColor) center/1.5px 10px no-repeat;
  color: var(--b-brass);
  transition: transform 200ms;
}
.b-help[open] summary::before { background: linear-gradient(currentColor, currentColor) center/10px 1.5px no-repeat; }
.b-help ol { margin: 12px 0 4px 22px; color: var(--b-ink-soft); }
.b-help li { margin: 4px 0; }
.b-help em { color: var(--b-ink); font-style: italic; font-weight: 600; }

/* ===================== PHOTO SLOTS ===================== */
.b-photo-slots {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.b-photo-slot {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 12px;
  border: 1.5px dashed var(--b-rule);
  background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 200ms, background 200ms;
  overflow: hidden;
}
.b-photo-slot:hover { border-color: var(--b-brass); background: var(--b-sand-soft); }
.b-photo-slot.filled { border-style: solid; border-color: var(--b-primary); }
.b-photo-slot img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.b-photo-slot .b-photo-tag {
  position: relative; z-index: 1;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--b-ink-soft);
  padding: 4px 8px;
}
.b-photo-slot.filled .b-photo-tag {
  position: absolute; bottom: 0; left: 0; right: 0;
  color: #fff; background: rgba(10, 34, 51, 0.7); text-align: left;
  padding: 6px 10px;
}
.b-photo-slot .b-photo-remove {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(10, 34, 51, 0.7); color: #fff;
  font-weight: 800; font-size: 13px; line-height: 1; cursor: pointer;
  display: none;
}
.b-photo-slot.filled .b-photo-remove { display: block; }
.b-step-skip { margin-top: 18px; text-align: center; }
.b-link {
  background: transparent; border: 0; font: inherit; cursor: pointer;
  color: var(--b-primary); font-weight: 700; padding: 4px 6px;
  border-bottom: 1px dotted var(--b-primary);
}
.b-link:hover { color: var(--b-primary-d); border-color: var(--b-primary-d); }

/* ===================== LAYOUTS PICKER ===================== */
.b-layouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.b-layout-card {
  display: block;
  background: #fff;
  border: 1.5px solid var(--b-rule-soft);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: border-color 200ms, transform 200ms var(--b-ease), box-shadow 200ms;
}
.b-layout-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(10, 34, 51, 0.06); border-color: var(--b-rule); }
.b-layout-card input { position: absolute; opacity: 0; pointer-events: none; }
.b-layout-card:has(input:checked) { border-color: var(--b-primary); box-shadow: 0 0 0 3px rgba(14, 138, 160, 0.18); }
.b-layout-card h3 { font-size: 16px; font-weight: 800; color: var(--b-ink); margin-top: 12px; margin-bottom: 4px; }
.b-layout-card p { font-size: 12.5px; color: var(--b-ink-soft); }
.b-layout-mock {
  aspect-ratio: 16/9; border-radius: 8px;
  background: var(--b-sand-soft); border: 1px solid var(--b-rule-soft);
  position: relative; padding: 8px; display: flex; flex-direction: column; gap: 5px;
}
.b-layout-mock span { background: var(--b-rule); border-radius: 3px; height: 6px; }
.b-layout-mock-tabs { flex-direction: row; padding: 6px; }
.b-layout-mock-tabs span { flex: 1; height: 14px; }
.b-layout-mock-scroll span:nth-child(1) { height: 14px; width: 70%; }
.b-layout-mock-scroll span:nth-child(2) { height: 6px; }
.b-layout-mock-scroll span:nth-child(3) { height: 6px; width: 80%; }
.b-layout-mock-card {
  align-items: center; justify-content: center;
  background: linear-gradient(160deg, #b07d00 0%, #ecdfc4 100%);
  padding: 14px;
}
.b-layout-mock-card span { width: 60%; background: #fff; height: 6px; }

/* ===================== THEME GALLERY ===================== */
.b-theme-tabs {
  display: inline-flex; gap: 4px;
  background: var(--b-sand-soft);
  border: 1px solid var(--b-rule-soft);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}
.b-theme-tab {
  border: 0; background: transparent;
  padding: 8px 18px; border-radius: 999px;
  font-weight: 700; font-size: 13.5px; letter-spacing: 0.2px;
  cursor: pointer; color: var(--b-ink-soft);
  transition: background 180ms, color 180ms;
}
.b-theme-tab:hover { color: var(--b-ink); }
.b-theme-tab.active { background: #fff; color: var(--b-ink); box-shadow: 0 1px 3px rgba(10, 34, 51, 0.08); }

.b-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.b-theme-card {
  cursor: pointer;
  background: #fff;
  border: 1.5px solid var(--b-rule-soft);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 200ms, transform 200ms var(--b-ease), box-shadow 200ms;
  display: flex; flex-direction: column;
}
.b-theme-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(10, 34, 51, 0.08); border-color: var(--b-rule); }
.b-theme-card.active { border-color: var(--b-primary); box-shadow: 0 0 0 3px rgba(14, 138, 160, 0.18); }
.b-theme-thumb {
  aspect-ratio: 4/3;
  position: relative;
  /* Each theme injects its own gradient/pattern via inline style */
  background: linear-gradient(165deg, #0a2233, #1f4863);
  overflow: hidden;
}
.b-theme-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.16), transparent 60%);
  pointer-events: none;
}
.b-theme-thumb .b-theme-thumb-label {
  position: absolute; left: 10px; bottom: 8px;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600; font-style: italic;
  color: #fff;
  font-size: 13px; letter-spacing: 0.3px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
  z-index: 2;
}
.b-theme-meta { padding: 10px 12px 14px; }
.b-theme-meta h3 { font-size: 14.5px; font-weight: 800; color: var(--b-ink); }
.b-theme-meta p { font-size: 12px; color: var(--b-ink-soft); margin-top: 2px; }

/* ===================== PREVIEW ===================== */
.b-preview-wrap {
  background: #fff;
  border: 1px solid var(--b-rule-soft);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(10, 34, 51, 0.08);
}
.b-preview-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--b-sand-soft);
  border-bottom: 1px solid var(--b-rule-soft);
}
.b-toolbar-spacer { flex: 1; }
.b-preview {
  width: 100%;
  border: 0;
  display: block;
  background: #fff;
  height: 78vh; min-height: 560px;
}
.b-preview.b-preview-card { height: 1350px; max-height: 78vh; }

.b-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; cursor: pointer;
  padding: 11px 18px; border-radius: 999px;
  font-weight: 800; font-size: 13.5px; letter-spacing: 0.2px;
  transition: transform 180ms var(--b-ease), background 180ms, box-shadow 200ms;
  font-family: inherit;
}
.b-btn:hover { transform: translateY(-1px); }
.b-btn-primary {
  background: var(--b-ink); color: var(--b-paper);
  box-shadow: 0 8px 20px rgba(10, 34, 51, 0.22);
}
.b-btn-primary:hover { background: #06192a; }
.b-btn-secondary {
  background: var(--b-brass); color: #fff;
  box-shadow: 0 8px 20px rgba(176, 125, 0, 0.32);
}
.b-btn-secondary:hover { background: #8e6500; }
.b-btn-pdf {
  background: #fff; color: var(--b-ink);
  border: 1.5px solid var(--b-ink);
  box-shadow: 0 4px 12px rgba(10, 34, 51, 0.08);
}
.b-btn-pdf:hover { background: var(--b-ink); color: var(--b-paper); }
.b-btn-pdf::before {
  content: ''; width: 14px; height: 16px;
  background:
    linear-gradient(currentColor, currentColor) center/8px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center/8px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center/8px 1.5px no-repeat;
  background-position: center 5px, center 8px, center 11px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  margin-right: 2px;
}
.b-btn-ghost {
  background: rgba(10, 34, 51, 0.06); color: var(--b-ink);
}
.b-btn-ghost:hover { background: rgba(10, 34, 51, 0.12); }

/* ===================== FOOTER ===================== */
.b-foot {
  border-top: 1px solid var(--b-rule-soft);
  background: var(--b-paper);
}
.b-foot-inner {
  max-width: var(--b-max);
  margin: 0 auto;
  padding: 26px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--b-ink-soft);
}
.b-foot-tag { font-family: 'Fraunces', Georgia, serif; font-style: italic; }
.b-foot-ver {
  background: var(--b-sand-soft);
  border: 1px solid var(--b-rule-soft);
  border-radius: 6px;
  padding: 4px 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--b-brass);
}

/* ===================== CUSTOMIZE PANEL ===================== */
.b-customize {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 22px;
}
@media (min-width: 720px) { .b-customize { grid-template-columns: 1.4fr 1fr; } }
.b-customize-block {
  background: var(--b-sand-soft);
  border: 1px solid var(--b-rule-soft);
  border-radius: 14px;
  padding: 18px 20px;
}
.b-customize-title {
  font-size: 11.5px; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--b-brass);
  margin-bottom: 12px;
}
.b-checks {
  display: grid; gap: 8px;
}
.b-check {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--b-rule-soft);
  border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--b-ink);
  cursor: pointer;
  transition: border-color 180ms, background 180ms;
}
.b-check:hover { border-color: var(--b-brass); background: #fffaee; }
.b-check input { accent-color: var(--b-primary); cursor: pointer; flex-shrink: 0; }
.b-check input:disabled { cursor: not-allowed; opacity: 0.5; }
.b-check input:disabled + span { color: var(--b-ink-soft); }
.b-check span { flex: 1; }
.b-check em {
  font-style: normal;
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--b-brass);
  background: var(--b-sand-soft);
  padding: 3px 7px; border-radius: 999px;
}
.b-customize-hint {
  font-size: 12px; color: var(--b-ink-soft);
  margin-top: 10px; line-height: 1.45;
}

/* ----- Map background picker ----- */
.b-customize-map { position: relative; }
.b-map-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 540px) { .b-map-options { grid-template-columns: repeat(4, 1fr); } }
.b-map-opt {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch;
  padding: 6px 6px 8px;
  background: #fff;
  border: 1.5px solid var(--b-rule-soft);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 180ms, transform 180ms var(--b-ease), box-shadow 180ms;
}
.b-map-opt:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(10, 34, 51, 0.08); border-color: var(--b-rule); }
.b-map-opt input { position: absolute; opacity: 0; pointer-events: none; }
.b-map-opt:has(input:checked) { border-color: var(--b-primary); box-shadow: 0 0 0 2.5px rgba(14, 138, 160, 0.16); }
.b-map-thumb {
  aspect-ratio: 16/10;
  border-radius: 6px;
  border: 1px solid var(--b-rule-soft);
  display: block;
  position: relative;
  overflow: hidden;
}
.b-map-meta { padding: 6px 4px 0; }
.b-map-meta strong { display: block; font-size: 12px; font-weight: 800; color: var(--b-ink); }
.b-map-meta em { display: block; font-style: normal; font-size: 11px; color: var(--b-ink-soft); margin-top: 1px; }

/* Stylised thumbnails so we don't ship real tiles in the picker UI itself */
.b-map-thumb-chart {
  background:
    radial-gradient(circle at 20% 30%, rgba(10, 34, 51, 0.04) 1px, transparent 1px) 0 0/8px 8px,
    linear-gradient(160deg, #e9e0c8 0%, #d2c39d 100%);
}
.b-map-thumb-chart::after {
  content: ''; position: absolute; inset: 6px;
  border: 1px solid rgba(10, 34, 51, 0.4);
  background:
    linear-gradient(to right, transparent 49%, rgba(10, 34, 51, 0.15) 49%, rgba(10, 34, 51, 0.15) 51%, transparent 51%),
    linear-gradient(to bottom, transparent 49%, rgba(10, 34, 51, 0.15) 49%, rgba(10, 34, 51, 0.15) 51%, transparent 51%);
}
.b-map-thumb-streets {
  background: linear-gradient(165deg, #f2eee5 0%, #d8e1ea 100%);
}
.b-map-thumb-streets::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to right, transparent 28%, #b86a4a 28%, #b86a4a 30%, transparent 30%),
    linear-gradient(to bottom, transparent 60%, #b86a4a 60%, #b86a4a 62%, transparent 62%),
    radial-gradient(ellipse 40% 30% at 70% 30%, #c2d6bd 0%, transparent 60%);
  opacity: 0.78;
}
.b-map-thumb-satellite {
  background:
    radial-gradient(ellipse 80% 60% at 30% 40%, #3a5d4a 0%, #1d3a48 80%),
    linear-gradient(165deg, #15324a 0%, #0a1e30 100%);
}
.b-map-thumb-satellite::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 22% 30% at 65% 65%, #4a6e58 0%, transparent 70%),
    radial-gradient(ellipse 14% 22% at 35% 25%, #5e7f60 0%, transparent 65%),
    radial-gradient(ellipse 12% 18% at 80% 35%, #4a6650 0%, transparent 70%);
  opacity: 0.78;
}
.b-map-thumb-nautical {
  background: linear-gradient(165deg, #6ba7c0 0%, #1d5777 100%);
}
.b-map-thumb-nautical::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 32% 28% at 30% 60%, rgba(255,255,255,0.16) 0%, transparent 70%),
    radial-gradient(ellipse 22% 18% at 75% 40%, #d0bb86 0%, transparent 70%);
}

/* Loading spinner shown while tiles are fetching */
.b-customize-map.is-loading::after {
  content: ''; position: absolute; top: 12px; right: 12px;
  width: 18px; height: 18px;
  border: 2.5px solid var(--b-rule);
  border-top-color: var(--b-primary);
  border-radius: 50%;
  animation: b-spin 0.9s linear infinite;
}
@keyframes b-spin { to { transform: rotate(360deg); } }
.b-customize-map.is-loading .b-map-opt { pointer-events: none; opacity: 0.7; }

/* ===================== PREVIEW FRAME WRAPPER ===================== */
.b-preview-frame-wrap {
  position: relative;
  background: var(--b-paper-2);
}

/* ===================================================================== */
/* RESPONSIVE — tablet + mobile pass for the builder UI itself           */
/* ===================================================================== */
html, body { overflow-x: clip; }

@media (max-width: 980px) {
  .b-shell { gap: 48px; padding: 44px 20px 80px; }
  .b-step { padding: 28px 22px; border-radius: 16px; }
  .b-step-title { font-size: clamp(22px, 3.4vw, 28px); }
  .b-drop { padding: 36px 18px; }
  .b-layouts { grid-template-columns: 1fr; }
  .b-theme-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .b-preview { height: 70vh; min-height: 460px; }
}

@media (max-width: 700px) {
  .b-shell { gap: 36px; padding: 28px 14px 56px; }
  .b-step { padding: 20px 16px; border-radius: 14px; }
  .b-step-head { margin-bottom: 18px; }
  .b-step-title { font-size: clamp(20px, 6vw, 26px); }
  .b-step-lead { font-size: 14px; }

  .b-drop { padding: 28px 14px; border-radius: 12px; }
  .b-drop-ico { width: 34px; height: 34px; }
  .b-drop h3 { font-size: 16px; }
  .b-drop p { font-size: 13px; }

  .b-help { padding: 12px 14px; font-size: 13px; }
  .b-help ol { margin-left: 18px; }

  .b-photo-slots { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }

  .b-layouts { gap: 10px; }
  .b-layout-card { padding: 14px; }
  .b-layout-card h3 { font-size: 14.5px; }
  .b-layout-card p { font-size: 12px; }

  .b-theme-tabs { width: 100%; justify-content: center; }
  .b-theme-tab { padding: 8px 14px; font-size: 12.5px; flex: 1; }
  .b-theme-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .b-theme-card { border-radius: 10px; }
  .b-theme-meta { padding: 8px 10px 12px; }
  .b-theme-meta h3 { font-size: 13.5px; }
  .b-theme-meta p { font-size: 11.5px; }

  .b-customize-block { padding: 14px 16px; border-radius: 12px; }
  .b-check { padding: 10px 12px; font-size: 13.5px; }
  .b-check em { font-size: 10px; }

  .b-preview-toolbar {
    flex-wrap: wrap; gap: 8px; padding: 10px 12px;
  }
  .b-preview-toolbar .b-toolbar-spacer { display: none; }
  .b-btn { padding: 10px 14px; font-size: 12.5px; flex: 1 1 auto; justify-content: center; }
  .b-btn-primary { flex: 1 1 100%; order: 10; }
  .b-preview { height: 60vh; min-height: 380px; }
}

@media (max-width: 400px) {
  .b-shell { padding: 22px 12px 44px; }
  .b-step { padding: 16px 14px; }
  .b-photo-slots { grid-template-columns: 1fr 1fr; }
  .b-theme-grid { grid-template-columns: 1fr 1fr; }
}
