/* ─────────────────────────────────────────────────────────────
   Tenant landing-page renderer (Features/Public/Sections).
   Global on purpose: the section markup is split across ~18 Blazor
   components that share these classes, and the same CSS must style
   both the public /biz page and the builder's live preview canvas.
   Ported from SectionRenderer.tsx (Tailwind → "ld-*" classes).
   ───────────────────────────────────────────────────────────── */

.ld-page {
    min-height: 100%;
    /* Container queries: the nav collapse keys off the PAGE's width, not the
       viewport — inside the builder's narrow preview canvas (and any embed)
       the burger appears instead of the nav flex-squeezing to zero width.
       width:100% is load-bearing: inline-size containment removes intrinsic
       sizing, so as a flex item the page would otherwise collapse to ~0. */
    container-type: inline-size;
    container-name: ld-page;
    width: 100%;
    --ld-accent: #7c5cff;
    --ld-radius: 12px;
    --ld-radius-lg: 16px;
    --ld-density: 1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* ── Page backgrounds (PageTheme.pageBg) ── */
.ld-bg-auto {
    background:
        radial-gradient(900px 600px at 10% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
        radial-gradient(900px 600px at 100% 0%, rgba(25, 211, 197, 0.10), transparent 60%),
        linear-gradient(180deg, #0a0b10 0%, #0c0e17 100%);
    color: #fff;
}
.ld-bg-dark { background: #050608; color: #fff; }
.ld-bg-light { background: #ffffff; color: #0f172a; }
.ld-bg-softlight { background: linear-gradient(135deg, #f8fafc, #e2e8f0); color: #0f172a; }
.ld-bg-softdark { background: linear-gradient(135deg, #0f172a, #020617); color: #fff; }

/* ── Text tone (light page vs dark page / forced-dark band) ── */
.ld-tone-dark {
    --ld-text: #ffffff;
    --ld-muted: #d1d5db;
    --ld-subtle: #9ca3af;
    --ld-card-bg: rgba(255, 255, 255, 0.03);
    --ld-card-bg-hover: rgba(255, 255, 255, 0.06);
    --ld-card-border: rgba(255, 255, 255, 0.1);
    --ld-input-bg: rgba(0, 0, 0, 0.3);
    --ld-input-border: rgba(255, 255, 255, 0.15);
    color: var(--ld-text);
}
.ld-tone-light {
    --ld-text: #0f172a;
    --ld-muted: #475569;
    --ld-subtle: #64748b;
    --ld-card-bg: #ffffff;
    --ld-card-bg-hover: #f8fafc;
    --ld-card-border: #e2e8f0;
    --ld-input-bg: #ffffff;
    --ld-input-border: #cbd5e1;
    color: var(--ld-text);
}

/* ── Corner style (PageTheme.radius) ── */
.ld-radius-sharp { --ld-radius: 2px; --ld-radius-lg: 4px; }
.ld-radius-soft { --ld-radius: 12px; --ld-radius-lg: 16px; }
.ld-radius-round { --ld-radius: 20px; --ld-radius-lg: 28px; }

/* ── Fonts (theme or per-section override) ── */
.ld-font-sans { font-family: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.ld-font-serif { font-family: Georgia, "Times New Roman", serif; }
.ld-font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ld-font-rounded { font-family: "SF Pro Rounded", "Nunito", "Comic Sans MS", -apple-system, sans-serif; }

/* ── Section container ── */
.ld-section {
    margin: 0 auto;
    padding: calc(48px * var(--ld-density)) 24px;
    box-sizing: border-box;
}
.ld-w-narrow { max-width: 768px; }
.ld-w-default { max-width: 1024px; }
.ld-w-wide { max-width: 1280px; }
.ld-w-full { max-width: none; }
.ld-pad-tight { padding-top: calc(20px * var(--ld-density)); padding-bottom: calc(20px * var(--ld-density)); }
.ld-pad-loose { padding-top: calc(80px * var(--ld-density)); padding-bottom: calc(80px * var(--ld-density)); }
.ld-density-compact { --ld-density: 0.65; }
.ld-density-spacious { --ld-density: 1.4; }
.ld-align-center { text-align: center; }
.ld-align-right { text-align: right; }

/* ── Type helpers ── */
.ld-eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ld-subtle);
    margin: 0 0 12px;
    font-weight: 600;
}
.ld-muted { color: var(--ld-muted); }
.ld-subtle { color: var(--ld-subtle); }
.ld-h-sm { font-size: clamp(18px, 2.5vw, 22px); }
.ld-h-md { font-size: clamp(24px, 3.5vw, 30px); }
.ld-h-lg { font-size: clamp(30px, 5vw, 48px); }
.ld-h-xl { font-size: clamp(36px, 6vw, 60px); }
.ld-heading { font-weight: 700; line-height: 1.15; margin: 0 0 12px; }

/* ── Cards ── */
.ld-card {
    background: var(--ld-card-bg);
    border: 1px solid var(--ld-card-border);
    border-radius: var(--ld-radius);
    padding: 20px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.ld-card-hover:hover { background: var(--ld-card-bg-hover); border-color: rgba(148, 163, 184, 0.4); }

/* ── Buttons ── */
.ld-btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: var(--ld-radius);
    background: var(--ld-accent);
    color: #0a0b10;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease;
}
.ld-btn:hover { transform: scale(1.02); }
.ld-btn:active { transform: scale(0.98); }
.ld-btn:disabled { opacity: 0.5; cursor: default; }
.ld-btn-ghost {
    background: transparent;
    color: var(--ld-text);
    border: 1px solid var(--ld-card-border);
    font-weight: 600;
}
.ld-btn-ghost:hover { background: var(--ld-card-bg-hover); }

/* ── Header / footer chrome ── */
.ld-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(10, 11, 16, 0.8);
    backdrop-filter: blur(10px);
    z-index: 30;
}
.ld-tone-light-page .ld-header { background: rgba(255, 255, 255, 0.85); }
.ld-header-sticky { position: sticky; top: 0; }
.ld-header-inner {
    max-width: 1024px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ld-header-logo { object-fit: contain; display: block; }
.ld-logo-sm { height: 28px; max-width: 140px; }
.ld-logo-md { height: 40px; max-width: 200px; }
.ld-logo-lg { height: 56px; max-width: 260px; }
.ld-logo-xl { height: 80px; max-width: 360px; }
.ld-wordmark { font-weight: 800; color: var(--ld-accent); }
.ld-wordmark-sm { font-size: 14px; }
.ld-wordmark-md { font-size: 16px; }
.ld-wordmark-lg { font-size: 24px; }
.ld-wordmark-xl { font-size: 30px; }
.ld-header-right { display: flex; align-items: center; gap: 12px; }
.ld-header-phone { font-size: 14px; color: var(--ld-muted); text-decoration: none; }
.ld-header-phone:hover { color: var(--ld-text); }
.ld-portal-link {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: var(--ld-radius);
    border: 1px solid var(--ld-card-border);
    color: var(--ld-muted);
    text-decoration: none;
    white-space: nowrap;
}
.ld-portal-link:hover { background: var(--ld-card-bg-hover); }
.ld-footer { border-top: 1px solid rgba(148, 163, 184, 0.12); margin-top: 32px; }
.ld-footer-inner {
    max-width: 1024px;
    margin: 0 auto;
    padding: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--ld-subtle);
}
.ld-footer-inner p { margin: 2px 0; }
.ld-footer-name { font-weight: 700; color: var(--ld-muted); }

/* ── Hero ── */
.ld-hero-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.ld-hero-grid.has-image { grid-template-columns: 3fr 2fr; }
.ld-hero-copy > * + * { margin-top: 16px; }
.ld-hero-title { font-weight: 800; line-height: 1.1; margin: 0; }
.ld-hero-sub { font-size: 18px; color: var(--ld-muted); margin: 0; }
.ld-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
.ld-hero-actions.centered { justify-content: center; }
.ld-hero-img { max-height: 256px; width: 100%; object-fit: contain; border-radius: var(--ld-radius-lg); }
@media (max-width: 640px) {
    .ld-hero-grid.has-image { grid-template-columns: 1fr; }
}

/* ── Services / trust / stats / process grids ── */
.ld-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ld-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ld-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) {
    .ld-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .ld-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .ld-grid-3, .ld-grid-2 { grid-template-columns: 1fr; }
}
.ld-service-icon { font-size: 24px; margin-bottom: 8px; }
.ld-card-title { font-weight: 600; margin: 0 0 4px; }
.ld-card-text { font-size: 14px; color: var(--ld-subtle); margin: 0; }
.ld-badge-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ld-subtle);
    margin: 0;
}
.ld-badge-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 17px;
    font-weight: 600;
    margin: 4px 0 0;
    word-break: break-all;
}
.ld-stat { text-align: center; }
.ld-stat-number { font-size: 30px; font-weight: 700; color: var(--ld-accent); margin: 0; }
.ld-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ld-subtle);
    margin: 4px 0 0;
}
.ld-process { list-style: none; margin: 0; padding: 0; }
.ld-step-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 12px;
}

/* ── About ── */
.ld-about-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.ld-about-grid.has-image { grid-template-columns: 1fr 1fr; }
.ld-about-body { white-space: pre-wrap; line-height: 1.7; color: var(--ld-muted); margin: 0; }
.ld-about-img { border-radius: var(--ld-radius-lg); object-fit: cover; width: 100%; height: 256px; }
@media (max-width: 640px) {
    .ld-about-grid.has-image { grid-template-columns: 1fr; }
}

/* ── Gallery ── */
.ld-gallery-main {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--ld-radius-lg);
    overflow: hidden;
    border: 1px solid var(--ld-card-border);
    background: var(--ld-card-bg);
    display: block;
    padding: 0;
    cursor: zoom-in;
}
.ld-gallery-main img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
}
.ld-gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
    font-family: ui-monospace, Menlo, monospace;
    pointer-events: none;
}
.ld-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 24px;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.ld-gallery-nav:hover { background: rgba(0, 0, 0, 0.7); }
.ld-gallery-nav.prev { left: 12px; }
.ld-gallery-nav.next { right: 12px; }
.ld-gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.ld-gallery-thumb { border: 0; padding: 0; background: none; border-radius: 8px; overflow: hidden; flex-shrink: 0; cursor: pointer; outline: 2px solid transparent; outline-offset: 2px; }
.ld-gallery-thumb.active { outline-color: var(--ld-accent); }
.ld-gallery-thumb img { width: 80px; height: 56px; object-fit: cover; display: block; }
.ld-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ld-lightbox img { max-height: 85vh; max-width: 90vw; object-fit: contain; border-radius: 8px; }
.ld-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 30px;
    cursor: pointer;
}
.ld-lightbox-close:hover { color: #fff; }
.ld-lightbox .ld-gallery-nav { background: rgba(0, 0, 0, 0.5); }
.ld-lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-family: ui-monospace, Menlo, monospace;
}

/* ── Testimonials ── */
.ld-quote-track-wrap { overflow: hidden; }
.ld-quote-track { display: flex; transition: transform 0.45s ease; }
.ld-quote-slide { min-width: 100%; padding: 0 8px; box-sizing: border-box; }
.ld-quote-card { padding: 32px; }
.ld-quote-mark { font-size: 36px; line-height: 1; color: var(--ld-accent); }
.ld-quote-text { font-size: 19px; font-style: italic; color: var(--ld-muted); margin: 8px 0 0; }
.ld-quote-author { font-size: 14px; font-weight: 600; color: var(--ld-accent); margin-top: 16px; }
.ld-quote-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.ld-quote-dot { height: 6px; width: 6px; border-radius: 999px; border: 0; padding: 0; cursor: pointer; transition: width 0.2s ease; background: rgba(148, 163, 184, 0.4); }
.ld-quote-dot.active { width: 24px; background: var(--ld-accent); }
.ld-carousel-wrap { position: relative; }
.ld-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 22px;
    border: 0;
    cursor: pointer;
}
.ld-carousel-nav:hover { background: rgba(0, 0, 0, 0.6); }
.ld-carousel-nav.prev { left: -8px; }
.ld-carousel-nav.next { right: -8px; }

/* ── FAQ ── */
.ld-faq-list > * + * { margin-top: 8px; }
.ld-faq-item { padding: 16px; }
.ld-faq-item summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.ld-faq-item summary::-webkit-details-marker { display: none; }
.ld-faq-plus { color: var(--ld-subtle); transition: transform 0.15s ease; }
.ld-faq-item[open] .ld-faq-plus { transform: rotate(45deg); }
.ld-faq-answer { margin: 8px 0 0; white-space: pre-wrap; color: var(--ld-muted); }

/* ── CTA ── */
.ld-cta-card {
    border-radius: var(--ld-radius-lg);
    padding: clamp(32px, 6vw, 48px);
    text-align: center;
    color: #fff;
}
.ld-cta-body { color: rgba(255, 255, 255, 0.8); margin: 8px auto 0; max-width: 560px; }
.ld-cta-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    border-radius: var(--ld-radius);
    background: #fff;
    color: #0a0b10;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: transform 0.12s ease;
}
.ld-cta-btn:hover { transform: scale(1.02); }

/* ── Booking ── */
.ld-booking-card { padding: 24px; }
.ld-booking-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.ld-booking-frame { width: 100%; min-height: 560px; border: 0; border-radius: var(--ld-radius); background: transparent; }
.ld-warn {
    border: 1px solid rgba(234, 179, 8, 0.35);
    background: rgba(234, 179, 8, 0.1);
    border-radius: var(--ld-radius-lg);
    padding: 20px;
    color: #fde68a;
    font-size: 14px;
}
.ld-tone-light .ld-warn { color: #92400e; }

/* ── Contact ── */
.ld-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 640px) { .ld-contact-grid { grid-template-columns: 1fr; } }
.ld-contact-line { font-size: 17px; margin: 0 0 8px; }
.ld-contact-line a { color: inherit; text-decoration: none; }
.ld-contact-line a:hover { text-decoration: underline; }
.ld-portal-cta { display: inline-block; margin-top: 16px; font-size: 14px; text-decoration: underline; color: var(--ld-accent); }

/* ── Contact form ── */
.ld-form { margin-top: 20px; }
.ld-form > * + * { margin-top: 12px; }
.ld-form-label { display: block; }
.ld-form-label span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ld-subtle);
    margin-bottom: 4px;
}
.ld-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--ld-input-bg);
    border: 1px solid var(--ld-input-border);
    border-radius: calc(var(--ld-radius) * 0.6);
    padding: 10px 12px;
    font-size: 14px;
    color: var(--ld-text);
    font-family: inherit;
}
.ld-input:focus { outline: 2px solid var(--ld-accent); outline-offset: 0; }
.ld-form-success {
    margin-top: 20px;
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.1);
    border-radius: var(--ld-radius-lg);
    padding: 20px;
    color: #86efac;
}
.ld-tone-light .ld-form-success { color: #166534; }
.ld-form-error { color: #f87171; font-size: 14px; margin: 8px 0 0; }
.ld-hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

/* ── Map ── */
.ld-map-card { padding: 28px; }
.ld-map-address { font-size: 17px; margin: 0 0 4px; }
.ld-map-note { font-size: 14px; color: var(--ld-muted); margin: 0 0 16px; }

/* ── Video ── */
.ld-video-frame {
    position: relative;
    border-radius: var(--ld-radius-lg);
    overflow: hidden;
    border: 1px solid var(--ld-card-border);
    background: #000;
}
.ld-video-16x9 { aspect-ratio: 16 / 9; }
.ld-video-4x3 { aspect-ratio: 4 / 3; }
.ld-video-1x1 { aspect-ratio: 1 / 1; }
.ld-video-9x16 { aspect-ratio: 9 / 16; max-width: 384px; margin: 0 auto; }
.ld-video-frame iframe,
.ld-video-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
    background: #000;
}
.ld-video-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--ld-subtle);
    font-size: 14px;
}
.ld-video-empty .big { font-size: 30px; margin-bottom: 8px; }

/* ── Custom HTML ── */
.ld-custom-html { overflow-x: auto; }
.ld-custom-html iframe { max-width: 100%; }
.ld-custom-empty {
    border: 1px dashed var(--ld-card-border);
    border-radius: var(--ld-radius);
    padding: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--ld-subtle);
}

/* ── Misc states ── */
.ld-loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: #6b7280; }

/* ─────────────────────────────────────────────────────────────
   Builder-preview overlay (SectionListRenderer editor mode) +
   site-builder chrome (SiteBuilderPage and its editor panels —
   these live in several components, so the classes are global
   like the rest of this sheet).
   ───────────────────────────────────────────────────────────── */
.ld-edit-wrap { position: relative; cursor: pointer; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color 0.12s ease; }
.ld-edit-wrap:hover { outline-color: rgba(124, 92, 255, 0.4); }
.ld-edit-wrap.selected { outline-color: #7c5cff; }
.ld-edit-wrap.hidden-block { opacity: 0.5; }
.ld-edit-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 20;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.12s ease;
    pointer-events: none;
}
.ld-edit-wrap:hover .ld-edit-tag, .ld-edit-wrap.selected .ld-edit-tag { opacity: 1; }
.ld-edit-hidden-note { padding: 24px; font-size: 13px; color: #94a3b8; border: 1px dashed rgba(148, 163, 184, 0.4); margin: 8px; border-radius: 8px; text-align: center; }

/* Left rail — section rows + palette */
.sb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--s5-border, #e2e8f0);
    border-radius: 10px;
    background: var(--s5-surface, #fff);
    cursor: grab;
    user-select: none;
    font-size: 13px;
}
.sb-row:active { cursor: grabbing; }
.sb-row.selected { border-color: #7c5cff; box-shadow: 0 0 0 1px #7c5cff; }
.sb-row.hidden-block { opacity: 0.55; }
.sb-row-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sb-row-grip { color: #94a3b8; font-size: 12px; letter-spacing: -1px; }
.sb-row-btn {
    border: 0;
    background: none;
    padding: 2px 4px;
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    line-height: 1;
}
.sb-row-btn:hover { color: #0f172a; background: rgba(148, 163, 184, 0.15); }
.sb-row-btn.danger:hover { color: #dc2626; }
.sb-drop { height: 6px; border-radius: 3px; margin: 2px 0; transition: height 0.1s ease, background 0.1s ease; }
.sb-drop.active { height: 26px; background: linear-gradient(90deg, transparent, rgba(124, 92, 255, 0.45), transparent); }
.sb-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sb-pal-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border: 1px solid var(--s5-border, #e2e8f0);
    border-radius: 8px;
    background: var(--s5-surface, #fff);
    font-size: 12px;
    cursor: grab;
    user-select: none;
    text-align: left;
}
.sb-pal-item:hover { border-color: #7c5cff; background: rgba(124, 92, 255, 0.06); }

/* Right-panel editor bits */
.sb-tabs { display: flex; border-bottom: 1px solid var(--s5-border, #e2e8f0); }
.sb-tab {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
}
.sb-tab.active { color: #7c5cff; border-bottom-color: #7c5cff; }
.sb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-chip {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--s5-border, #cbd5e1);
    background: var(--s5-surface, #fff);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sb-chip.active { border-color: #7c5cff; background: rgba(124, 92, 255, 0.1); color: #7c5cff; }
.sb-chip-swatch { width: 16px; height: 16px; border-radius: 4px; display: inline-block; border: 1px solid rgba(0, 0, 0, 0.15); }
.sb-field-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin: 14px 0 4px;
    font-weight: 700;
}
.sb-item-card {
    border: 1px solid var(--s5-border, #e2e8f0);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 8px;
    background: var(--s5-surface-muted, #f8fafc);
}
.sb-item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sb-item-idx { font-size: 10px; color: #94a3b8; }
.sb-mini-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--s5-border, #cbd5e1);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    margin-bottom: 6px;
    font-family: inherit;
    background: var(--s5-surface, #fff);
    color: inherit;
}
.sb-mini-input:focus { outline: 2px solid #7c5cff; outline-offset: 0; }
.sb-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; }
.sb-add-btn {
    border: 1px dashed var(--s5-border, #cbd5e1);
    background: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    width: 100%;
}
.sb-add-btn:hover { border-color: #7c5cff; color: #7c5cff; }
.sb-color-row { display: flex; align-items: center; gap: 8px; }
.sb-color-row input[type="color"] { width: 36px; height: 32px; border: 1px solid var(--s5-border, #cbd5e1); border-radius: 6px; padding: 2px; background: none; cursor: pointer; }
.sb-img-preview { width: 100%; max-height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--s5-border, #e2e8f0); display: block; margin-bottom: 6px; }
.sb-note { font-size: 11px; color: #94a3b8; margin: 6px 0 0; }
.sb-warn-note {
    font-size: 11px;
    border: 1px solid rgba(234, 179, 8, 0.4);
    background: rgba(234, 179, 8, 0.08);
    color: #92400e;
    border-radius: 8px;
    padding: 8px 10px;
    margin-top: 8px;
}

/* ── Multi-page: header nav (renders only when the site has subpages) ── */
.ld-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.ld-nav-link {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--ld-radius);
    color: var(--ld-muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.ld-nav-link:hover { color: var(--ld-text); background: var(--ld-card-bg-hover); }
.ld-nav-link.active { color: var(--ld-accent); }
.ld-nav-toggle { display: none; }
.ld-nav-burger { display: none; cursor: pointer; padding: 8px; margin-left: auto; }
.ld-nav-burger span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 3px 0;
    border-radius: 2px;
    background: var(--ld-muted);
}
@container ld-page (max-width: 720px) {
    /* Checkbox-hack collapse — no JS, works pre-hydration. Container query:
       fires for narrow pages (phone viewports AND the builder preview). */
    .ld-header-inner.has-nav { flex-wrap: wrap; }
    .ld-nav-burger { display: block; order: 2; }
    .ld-header-inner.has-nav .ld-header-right { order: 3; }
    .ld-nav {
        display: none;
        order: 4;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 6px 0 10px;
    }
    .ld-nav-toggle:checked ~ .ld-nav { display: flex; }
    .ld-nav-link { padding: 10px 12px; }
}

/* ── Multi-page: footer page links ── */
.ld-footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 14px; margin-bottom: 10px; }
.ld-footer-links .ld-nav-link { font-size: 12px; padding: 2px 4px; }

/* ── Multi-page: friendly in-frame 404 ── */
.ld-notfound { max-width: 560px; margin: 0 auto; padding: 96px 24px; text-align: center; }
.ld-notfound h1 { font-size: 28px; font-weight: 800; margin: 0 0 12px; }
.ld-notfound p { color: var(--ld-muted); margin: 0 0 24px; }

/* ── Site builder: pages bar ── */
.sb-pages-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 0 10px;
}
.sb-pages-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #94a3b8; margin-right: 2px; }
.sb-page-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--s5-border, #e2e8f0);
    background: var(--s5-surface, #fff);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}
.sb-page-chip:hover { border-color: #7c5cff; color: #7c5cff; }
.sb-page-chip.active { border-color: #7c5cff; background: rgba(124, 92, 255, 0.1); color: #7c5cff; }
.sb-page-chip.add { border-style: dashed; }
.sb-page-chip .muted { opacity: 0.6; font-size: 11px; }
.sb-addpage-panel {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border: 1px dashed var(--s5-border, #cbd5e1);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 10px;
}
.sb-page-settings {
    border: 1px solid var(--s5-border, #e2e8f0);
    border-radius: 10px;
    background: var(--s5-surface, #fff);
    padding: 12px;
    margin-bottom: 10px;
    max-width: 560px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.sb-page-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 640px) { .sb-page-settings-grid { grid-template-columns: 1fr; } }
.sb-page-settings-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
