/* Builder page: controls use site styles; #preview is themed via data-theme */

.builder { display: grid; grid-template-columns: 320px 1fr; gap: var(--sp-3); align-items: start; }
.builder-panel { background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: var(--sp-3); position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.panel-group + .panel-group { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.panel-group h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.hint { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.75rem; }
.field { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem; }
.field input[type=text] { display: block; width: 100%; margin-top: 0.25rem; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; }
.field input[type=color] { margin-top: 0.25rem; width: 48px; height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0; background: none; vertical-align: middle; }
.link-btn { background: none; border: 0; color: var(--accent-dark); font: inherit; font-size: 0.8125rem; cursor: pointer; margin-left: 0.5rem; text-decoration: underline; }

.theme-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.theme-chip { border: 2px solid var(--line); border-radius: 10px; padding: 0.5rem; background: var(--white); cursor: pointer; text-align: left; font: inherit; font-size: 0.8125rem; font-weight: 600; }
.theme-chip .sw { display: flex; height: 22px; border-radius: 5px; overflow: hidden; margin-bottom: 0.4rem; }
.theme-chip .sw i { flex: 1; }
.theme-chip[aria-checked=true] { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }

.section-list { list-style: none; display: grid; gap: 0.4rem; }
.section-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; font-size: 0.9rem; background: var(--bg); }
.section-list li.off { opacity: 0.55; }
.section-list label { flex: 1; display: flex; gap: 0.5rem; align-items: center; cursor: pointer; }
.section-list button { border: 1px solid var(--line); background: var(--white); border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 0.8rem; }
.section-list button:disabled { opacity: 0.3; cursor: default; }
.panel-group .btn { width: 100%; justify-content: center; margin-bottom: 0.5rem; }

.builder-stage { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--white); box-shadow: var(--shadow-sm); min-width: 0; }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 0.6rem 0.9rem; background: var(--bg-raised); border-bottom: 1px solid var(--line); }
.browser-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.browser-bar em { margin-left: 0.75rem; font-style: normal; font-size: 0.8rem; color: var(--muted); background: var(--white); padding: 0.15rem 0.8rem; border-radius: 999px; }

/* ---------- Preview (theme tokens) ---------- */
.preview { --p-bg:#fff; --p-alt:#f5f7fa; --p-ink:#14233a; --p-muted:#5b6b80; --p-accent:#2b6cb0; --p-on-accent:#fff;
  --p-hero-bg:#1f5f99; --p-hero-ink:#fff; --p-card:#fff; --p-line:#e3e8ef; --p-radius:12px;
  --p-head:'Archivo',system-ui,sans-serif; --p-body:'Work Sans',system-ui,sans-serif; --p-h-case:none; --p-h-weight:800;
  background: var(--p-bg); color: var(--p-ink); font-family: var(--p-body); min-height: 600px;  }
.preview[data-theme=barber] { --p-bg:#0d0d0d; --p-alt:#161616; --p-ink:#f5f5f3; --p-muted:#9a9a9a; --p-accent:#c8a96e; --p-on-accent:#0d0d0d;
  --p-hero-bg:#0d0d0d; --p-hero-ink:#f5f5f3; --p-card:#1a1a1a; --p-line:#262626; --p-radius:3px;
  --p-head:'Bebas Neue',Impact,sans-serif; --p-body:'DM Sans',system-ui,sans-serif; --p-h-case:uppercase; --p-h-weight:400; }
.preview[data-theme=bistro] { --p-bg:#fff8f1; --p-alt:#f8e9da; --p-ink:#2c1a12; --p-muted:#7a5c4c; --p-accent:#c0392b; --p-on-accent:#fff;
  --p-hero-bg:#b53325; --p-hero-ink:#fff; --p-card:#fff; --p-line:#ecd8c4; --p-radius:18px;
  --p-head:'Libre Franklin',system-ui,sans-serif; --p-body:'Source Sans 3',system-ui,sans-serif; --p-h-weight:900; }
.preview[data-theme=minimal] { --p-bg:#fafbfd; --p-alt:#f1f4f9; --p-ink:#171b24; --p-muted:#626a78; --p-accent:#3d72d6; --p-on-accent:#fff;
  --p-hero-bg:#fafbfd; --p-hero-ink:#171b24; --p-card:#fff; --p-line:#e3e7ee; --p-radius:8px;
  --p-head:'Libre Franklin',system-ui,sans-serif; --p-body:'Source Sans 3',system-ui,sans-serif; --p-h-weight:800; }

.preview * { box-sizing: border-box; }
.preview h1,.preview h2,.preview h3 { font-family: var(--p-head); text-transform: var(--p-h-case); font-weight: var(--p-h-weight); color: inherit; line-height: 1.1; margin: 0 0 .6rem; }
.preview p { color: var(--p-muted); font-size: 1rem; margin: 0 0 1rem; }
.preview [contenteditable]:hover { outline: 1px dashed var(--p-accent); outline-offset: 3px; cursor: text; }
.preview [contenteditable]:focus { outline: 2px solid var(--p-accent); outline-offset: 3px; }
.pv-nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; background: var(--p-bg); border-bottom: 1px solid var(--p-line); }
.pv-nav .logo { font-family: var(--p-head); text-transform: var(--p-h-case); font-weight: var(--p-h-weight); font-size: 1.3rem; }
.pv-nav ul { display: flex; gap: 1.1rem; list-style: none; margin: 0; padding: 0; font-size: .85rem; color: var(--p-muted); }
.pv-btn { display: inline-block; background: var(--p-accent); color: var(--p-on-accent); padding: .7rem 1.3rem; border-radius: var(--p-radius); font-weight: 700; font-size: .9rem; border: 2px solid var(--p-accent); }
.pv-btn.ghost { background: transparent; color: inherit; border-color: currentColor; margin-left: .5rem; }
.pv-sec { padding: 3.5rem 1.75rem; }
.pv-sec.alt { background: var(--p-alt); }
.pv-sec h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.pv-hero { background: var(--p-hero-bg); color: var(--p-hero-ink); padding: 5rem 1.75rem; }
.pv-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 14ch; }
.pv-hero p { color: inherit; opacity: .85; max-width: 46ch; font-size: 1.1rem; margin-bottom: 1.5rem; }
.preview[data-theme=barber] .pv-hero h1 { font-size: clamp(3rem, 8vw, 5.5rem); max-width: none; }
.pv-cards { display: grid; gap: 0; margin-top: 1.25rem; border-top: 1px solid var(--p-line); }
.pv-card { padding: 1rem 0; border-bottom: 1px solid var(--p-line); }
.pv-card h3 { font-size: 1.05rem; }
.pv-card p { font-size: .9rem; margin: 0; }
.pv-quote { border-left: 4px solid var(--p-accent); padding-left: 1rem; font-size: 1.2rem; color: var(--p-ink); max-width: 60ch; }
.pv-quote small { display: block; margin-top: .5rem; color: var(--p-muted); font-size: .85rem; }
.pv-contact { text-align: center; }
.pv-contact p { max-width: 50ch; margin-left: auto; margin-right: auto; }
.pv-foot { padding: 1.25rem; text-align: center; font-size: .8rem; color: var(--p-muted); border-top: 1px solid var(--p-line); }
.pv-empty { padding: 3rem; text-align: center; color: var(--p-muted); }

@media (max-width: 900px) {
  .builder { grid-template-columns: 1fr; }
  .builder-panel { position: static; max-height: none; }
  .pv-nav ul { display: none; }
}
