/* ============================================================================
   Website builder (platform admin console → Website builder)
   Loaded after dpr-admin.css. Uses the console's tokens (--admin-ink / -muted / -line /
   -indigo); everything here is prefixed wb-.
   ========================================================================== */

/* The website's icons (the builder draws them with the website's own Icon component). */
.wb-main .icon, .wb-palette .icon, .wb-block__icon .icon { display: inline-block; flex-shrink: 0; vertical-align: -0.18em; }

/* ── Status line + tabs ──────────────────────────────────────────────────── */
.wb-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 16px; padding: 11px 16px; border: 1px solid var(--admin-line); border-radius: 12px; background: #fff; color: var(--admin-ink); font-size: 13px; font-weight: 600; }
.wb-status__dot { width: 9px; height: 9px; border-radius: 50%; background: #16A34A; box-shadow: 0 0 0 4px rgba(22, 163, 74, .12); }
.wb-status__dot.is-draft { background: #D97706; box-shadow: 0 0 0 4px rgba(217, 119, 6, .14); }
.wb-status__dot.is-dirty { background: #DC2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .12); }
.wb-status__meta { color: var(--admin-muted); font-weight: 500; }
.wb-status__links { display: flex; gap: 16px; margin-left: auto; font-weight: 600; }
.wb-status__links a { color: var(--admin-indigo); text-decoration: none; }
.wb-status__links a:hover { text-decoration: underline; }
.wb-status__links i { font-size: 13px; }

.wb-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; padding: 5px; border: 1px solid var(--admin-line); border-radius: 13px; background: #fff; width: fit-content; max-width: 100%; }
.wb-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border: 0; border-radius: 9px; background: transparent; color: var(--admin-muted); font-size: 13.5px; font-weight: 600; transition: background .15s, color .15s; }
.wb-tab i { font-size: 17px; }
.wb-tab:hover { color: var(--admin-ink); background: var(--admin-canvas); }
.wb-tab.is-on { color: #fff; background: var(--admin-indigo); box-shadow: 0 6px 14px rgba(79, 70, 229, .25); }

/* ── Layout: editor + docked preview ─────────────────────────────────────── */
.wb-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.wb-split.has-preview { grid-template-columns: minmax(0, 1fr) minmax(360px, 46%); }
.wb-main { min-width: 0; }
.wb-pages { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 20px; align-items: start; }
.wb-pages.is-compact { grid-template-columns: minmax(0, 1fr); gap: 14px; }

.wb-pagelist { position: sticky; top: 96px; max-height: calc(100vh - 116px); overflow-y: auto; padding: 14px; border: 1px solid var(--admin-line); border-radius: 14px; background: #fff; scrollbar-width: thin; }
.wb-pages.is-compact .wb-pagelist { position: static; max-height: none; padding: 10px; }
.wb-pagelist__group { display: flex; align-items: center; justify-content: space-between; margin: 14px 4px 8px; color: var(--admin-muted); font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.wb-pagelist__group:first-child { margin-top: 2px; }
.wb-pagelist__empty { margin: 0 4px 8px; color: var(--admin-muted); font-size: 12.5px; line-height: 1.5; }
.wb-pagerow { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; width: 100%; margin-bottom: 3px; padding: 9px 11px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; transition: background .15s, border-color .15s; }
.wb-pagerow strong { grid-column: 1; overflow: hidden; color: var(--admin-ink); font-size: 13.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.wb-pagerow span { grid-column: 1; overflow: hidden; color: var(--admin-muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.wb-pagerow em { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.wb-pagerow:hover { background: var(--admin-canvas); }
.wb-pagerow.is-on { background: #EEEDFF; border-color: #D9D6FE; }
.wb-pagerow.is-on strong { color: var(--admin-indigo-dark); }

/* ── Cards, fields ───────────────────────────────────────────────────────── */
.wb-card { margin-bottom: 16px; border: 1px solid var(--admin-line); border-radius: 14px; box-shadow: 0 4px 18px rgba(20, 31, 55, .04); }
.wb-card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.wb-card__head h5 { margin: 0 0 2px; color: var(--admin-ink); font-size: 16px; }
.wb-card__head p { margin: 0; color: var(--admin-muted); font-size: 12.5px; overflow-wrap: anywhere; }

.wb-field { display: block; margin: 0; }
.wb-label { display: block; margin-bottom: 5px; color: #4B5565; font-size: 11.5px; font-weight: 650; }
.wb-hint { display: block; margin-top: 5px; color: var(--admin-muted); font-size: 11.5px; line-height: 1.45; }
.wb-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--admin-ink); font-size: 13px; cursor: pointer; }
.wb-check input { width: 16px; height: 16px; accent-color: var(--admin-indigo); }
.wb-switch { display: inline-flex; align-items: center; gap: 9px; margin: 0; color: var(--admin-ink); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.wb-switch input { position: relative; width: 36px; height: 20px; margin: 0; flex-shrink: 0; appearance: none; -webkit-appearance: none; border-radius: 999px; background: #CBD2DE; cursor: pointer; transition: background .15s; }
.wb-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.wb-switch input:checked { background: var(--admin-indigo); }
.wb-switch input:checked::after { transform: translateX(16px); }
.wb-switch input:focus-visible, .wb-check input:focus-visible { outline: 2px solid #A5B4FC; outline-offset: 2px; }
.wb-note { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 14px; padding: 10px 13px; border-radius: 10px; background: #F3F4FF; color: #3B3F73; font-size: 12.5px; line-height: 1.5; }
.wb-note i { margin-top: 2px; font-size: 15px; color: var(--admin-indigo); }
.wb-note--warn { background: #FFF7E6; color: #7A4A06; }
.wb-note--warn i { color: #D97706; }
.wb-code { font-family: ui-monospace, "Cascadia Code", SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; tab-size: 2; }
.wb-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-style: normal; font-weight: 700; letter-spacing: .02em; white-space: nowrap; vertical-align: middle; }
.wb-badge--muted { color: #5B6474; background: #EEF0F4; }
.wb-badge--ok { color: #047857; background: #E3F7EE; }
.wb-badge--warn { color: #92400E; background: #FEF1D7; }

.wb-iconbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #5B6474; font-size: 16px; text-decoration: none; transition: background .15s, color .15s; }
.wb-iconbtn:hover:not(:disabled) { background: var(--admin-canvas); color: var(--admin-ink); border-color: var(--admin-line); }
.wb-iconbtn:disabled { opacity: .35; }
.wb-iconbtn--danger:hover:not(:disabled) { background: #FDECEC; color: #DC2626; border-color: #F8CFCF; }
.wb-linkbtn { display: inline-flex; align-items: center; padding: 3px 4px; border: 0; background: transparent; color: var(--admin-indigo); font-size: 12.5px; font-weight: 650; }
.wb-linkbtn:hover:not(:disabled) { text-decoration: underline; }
.wb-linkbtn:disabled { opacity: .45; }
.wb-add { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 8px; padding: 9px; border: 1.5px dashed #C9CEDA; border-radius: 10px; background: transparent; color: var(--admin-indigo); font-size: 13px; font-weight: 650; transition: background .15s, border-color .15s; }
.wb-add:hover:not(:disabled) { background: #F3F4FF; border-color: var(--admin-indigo); }
.wb-add:disabled { opacity: .5; }

.wb-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.wb-choice { padding: 6px 12px; border: 1px solid var(--admin-line); border-radius: 8px; background: #fff; color: #4B5565; font-size: 12.5px; font-weight: 600; transition: all .15s; }
.wb-choice:hover { border-color: #C7C9F5; color: var(--admin-ink); }
.wb-choice.is-on { border-color: var(--admin-indigo); background: #EEEDFF; color: var(--admin-indigo-dark); }
.wb-more { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--admin-line); }
.wb-more__toggle { display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; color: #4B5565; font-size: 12.5px; font-weight: 650; }
.wb-more__toggle:hover { color: var(--admin-indigo); }
.wb-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--admin-line); }
.wb-group__title { display: block; margin-bottom: 9px; color: var(--admin-ink); font-size: 12.5px; font-weight: 750; }

/* ── Section list ────────────────────────────────────────────────────────── */
.wb-blocks { display: flex; flex-direction: column; }
.wb-insert { position: relative; height: 16px; padding: 0; border: 0; background: transparent; opacity: 0; transition: opacity .15s; }
.wb-insert::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; border-radius: 2px; background: var(--admin-indigo); }
.wb-insert span { position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 2px 11px; border-radius: 999px; background: var(--admin-indigo); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.wb-insert:hover, .wb-insert:focus-visible { opacity: 1; }
.wb-insert--last { height: auto; margin-top: 10px; padding: 12px; border: 1.5px dashed #C9CEDA; border-radius: 12px; opacity: 1; }
.wb-insert--last::before { display: none; }
.wb-insert--last span { background: transparent; color: var(--admin-indigo); font-size: 13px; }
.wb-insert--last:hover { background: #F3F4FF; border-color: var(--admin-indigo); }

.wb-block { border: 1px solid var(--admin-line); border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgba(20, 31, 55, .03); transition: border-color .15s, box-shadow .15s; }
.wb-block:hover { border-color: #D3D6E4; }
.wb-block.is-open { border-color: #BFBDF8; box-shadow: 0 10px 28px rgba(79, 70, 229, .10); }
.wb-block.is-off .wb-block__title, .wb-block.is-off .wb-block__icon { opacity: .5; }
.wb-block--builtin { background: repeating-linear-gradient(135deg, #FAFBFD 0 12px, #F3F5FA 12px 24px); border-style: dashed; border-color: #C9CEDA; }
.wb-block.is-dragging { opacity: .45; }
.wb-block.is-over-above { box-shadow: 0 -3px 0 var(--admin-indigo); }
.wb-block.is-over-below { box-shadow: 0 3px 0 var(--admin-indigo); }
.wb-block__head { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 9px 12px; cursor: pointer; }
.wb-block__icon { display: inline-grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: #EEEDFF; color: var(--admin-indigo); }
.wb-block--builtin .wb-block__icon { background: #E6E9F0; color: #4B5565; }
.wb-block__title { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.wb-block__title strong { color: var(--admin-ink); font-size: 13.5px; }
.wb-block__title span { overflow: hidden; color: var(--admin-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.wb-block__actions { display: flex; gap: 1px; opacity: 0; transition: opacity .15s; }
.wb-block:hover .wb-block__actions, .wb-block.is-open .wb-block__actions, .wb-block__actions:focus-within { opacity: 1; }
.wb-block__chevron { color: #8A93A5; font-size: 15px; }
.wb-block__body { padding: 16px 16px 18px; border-top: 1px solid var(--admin-line); }

/* ── Items of a section ──────────────────────────────────────────────────── */
.wb-item { margin-bottom: 6px; border: 1px solid var(--admin-line); border-radius: 10px; background: #FBFCFE; }
.wb-item.is-dragging { opacity: .45; }
.wb-item.is-over-above { box-shadow: 0 -2px 0 var(--admin-indigo); }
.wb-item.is-over-below { box-shadow: 0 2px 0 var(--admin-indigo); }
.wb-item__head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; }
.wb-item__head > .form-control { flex: 1; min-width: 0; }
.wb-item__value { flex: 0 0 132px !important; }
.wb-item__summary { flex: 1; min-width: 0; overflow: hidden; color: #4B5565; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.wb-item__body { display: grid; gap: 12px; padding: 12px; border-top: 1px solid var(--admin-line); background: #fff; border-radius: 0 0 10px 10px; }

.wb-image { display: flex; gap: 12px; align-items: flex-start; }
.wb-image__thumb { display: grid; place-items: center; width: 92px; height: 68px; flex-shrink: 0; overflow: hidden; border: 1px solid var(--admin-line); border-radius: 10px; background: repeating-conic-gradient(#F1F3F8 0 25%, #fff 0 50%) 0 0 / 16px 16px; color: #A3ABBB; font-size: 22px; }
.wb-image__thumb img { width: 100%; height: 100%; object-fit: contain; }
.wb-image__body { flex: 1; min-width: 0; }

.wb-link .form-control { flex: 1 1 55%; }
.wb-link__pick { flex: 0 1 150px !important; color: #4B5565; }
.wb-button { margin-bottom: 12px; }

.wb-iconpick { position: relative; flex-shrink: 0; }
.wb-iconpick__button { display: grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 1px solid var(--admin-line); border-radius: 8px; background: #fff; color: var(--admin-indigo); }
.wb-iconpick__button:hover { border-color: var(--admin-indigo); }
.wb-iconpick__none { color: #A3ABBB; font-weight: 700; }
.wb-iconpick__shade { position: fixed; inset: 0; z-index: 50; border: 0; background: transparent; cursor: default; }
.wb-iconpick__grid { position: absolute; top: 36px; left: 0; z-index: 51; display: grid; grid-template-columns: repeat(8, 34px); gap: 3px; padding: 9px; border: 1px solid var(--admin-line); border-radius: 12px; background: #fff; box-shadow: 0 18px 40px rgba(20, 31, 55, .18); }
.wb-iconpick__grid button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #3D4657; }
.wb-iconpick__grid button:hover { background: var(--admin-canvas); }
.wb-iconpick__grid button.is-on { border-color: var(--admin-indigo); background: #EEEDFF; color: var(--admin-indigo); }

/* ── Rich text ───────────────────────────────────────────────────────────── */
.wb-rich { border: 1px solid #D5DAE3; border-radius: 10px; background: #fff; overflow: hidden; }
.wb-rich:focus-within { border-color: var(--admin-indigo); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.wb-rich__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--admin-line); background: #F8F9FC; }
.wb-rich__bar button, .wb-rich__file { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; margin: 0; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: #3D4657; font-size: 12.5px; cursor: pointer; }
.wb-rich__bar button:hover, .wb-rich__file:hover { background: #E9ECF4; }
.wb-rich__sep { width: 1px; height: 18px; margin: 0 4px; background: #D5DAE3; }
.wb-rich__box { padding: 12px 14px; overflow-y: auto; max-height: 520px; color: var(--admin-ink); font-size: 14px; line-height: 1.65; outline: 0; }
.wb-rich__box:empty::before { content: "Write here…"; color: #A3ABBB; }
.wb-rich__box h2 { font-size: 19px; margin: 14px 0 6px; }
.wb-rich__box h3 { font-size: 16px; margin: 12px 0 5px; }
.wb-rich__box p { margin: 0 0 9px; }
.wb-rich__box ul, .wb-rich__box ol { margin: 0 0 9px; padding-left: 22px; }
.wb-rich__box blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--admin-indigo); background: #F6F6FF; color: #3B3F73; }
.wb-rich__box a { color: var(--admin-indigo); text-decoration: underline; }
.wb-rich__box img { max-width: 100%; height: auto; border-radius: 8px; }
.wb-rich__box hr { margin: 14px 0; border: 0; border-top: 1px solid #D5DAE3; }

/* ── Menu & footer, design, blog ─────────────────────────────────────────── */
.wb-menuitem { margin-bottom: 8px; padding: 10px; border: 1px solid var(--admin-line); border-radius: 10px; background: #FBFCFE; }
.wb-menuitem__children { margin: 10px 0 4px; padding: 10px 10px 2px; border-left: 3px solid #D9D6FE; border-radius: 0 8px 8px 0; background: #fff; }

.wb-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.wb-preset { display: flex; flex-direction: column; gap: 2px; padding: 9px; border: 1.5px solid var(--admin-line); border-radius: 12px; background: #fff; text-align: left; transition: border-color .15s, box-shadow .15s; }
.wb-preset:hover { border-color: #C7C9F5; box-shadow: 0 8px 20px rgba(20, 31, 55, .07); }
.wb-preset.is-on { border-color: var(--admin-indigo); box-shadow: 0 0 0 3px rgba(79, 70, 229, .13); }
.wb-preset__swatch { display: block; height: 46px; margin-bottom: 7px; border-radius: 8px; }
.wb-preset strong { color: var(--admin-ink); font-size: 13px; }
.wb-preset small { color: var(--admin-muted); font-size: 11.5px; }

.wb-postlist { display: flex; flex-direction: column; gap: 4px; max-height: 620px; overflow-y: auto; }
.wb-postrow { display: flex; flex-direction: column; gap: 3px; padding: 10px 11px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; }
.wb-postrow strong { color: var(--admin-ink); font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.wb-postrow span { color: var(--admin-muted); font-size: 11.5px; }
.wb-postrow:hover { background: var(--admin-canvas); }
.wb-postrow.is-on { background: #EEEDFF; border-color: #D9D6FE; }

/* ── Preview ─────────────────────────────────────────────────────────────── */
.wb-preview { position: sticky; top: 96px; display: flex; flex-direction: column; height: calc(100vh - 116px); min-height: 420px; overflow: hidden; border: 1px solid var(--admin-line); border-radius: 14px; background: #fff; box-shadow: 0 10px 30px rgba(20, 31, 55, .08); }
.wb-preview.is-full { position: fixed; inset: 0; z-index: 1060; height: auto; border: 0; border-radius: 0; }
.wb-preview__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-bottom: 1px solid var(--admin-line); background: #F8F9FC; font-size: 13px; color: var(--admin-ink); }
.wb-preview__bar .wb-choice { display: grid; place-items: center; width: 34px; height: 30px; padding: 0; font-size: 16px; }
.wb-preview__state { color: var(--admin-muted); font-size: 12px; }
.wb-preview__stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #E9ECF2; }
.wb-preview__stage iframe { display: block; border: 0; background: #fff; transform-origin: 0 0; box-shadow: 0 0 0 1px rgba(20, 31, 55, .08); }
.wb-preview__error { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 30px; text-align: center; color: var(--admin-muted); font-size: 13px; }
.wb-preview__error i { font-size: 30px; color: #D97706; }
.wb-preview__error p { max-width: 380px; margin: 0 0 6px; }

/* ── Add-section palette ─────────────────────────────────────────────────── */
.wb-palette h6 { margin: 16px 0 9px; color: var(--admin-muted); font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.wb-palette h6:first-child { margin-top: 0; }
.wb-palette__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 9px; }
.wb-palette__item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px; border: 1px solid var(--admin-line); border-radius: 11px; background: #fff; text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s; }
.wb-palette__item:hover { border-color: var(--admin-indigo); box-shadow: 0 8px 20px rgba(79, 70, 229, .12); transform: translateY(-1px); }
.wb-palette__item.is-on { border-color: var(--admin-indigo); background: #F3F4FF; box-shadow: 0 0 0 3px rgba(79, 70, 229, .13); }
.wb-palette__item strong { display: block; color: var(--admin-ink); font-size: 13.5px; }
.wb-palette__item small { display: block; margin-top: 2px; color: var(--admin-muted); font-size: 12px; line-height: 1.4; }

@media (max-width: 1280px) {
    .wb-split.has-preview { grid-template-columns: minmax(0, 1fr); }
    .wb-split.has-preview .wb-preview:not(.is-full) { position: static; height: 70vh; }
}
@media (max-width: 992px) {
    .wb-pages { grid-template-columns: minmax(0, 1fr); }
    .wb-pagelist { position: static; max-height: 280px; }
    .wb-status__links { margin-left: 0; }
    .wb-block__actions { opacity: 1; }
    .wb-iconpick__grid { grid-template-columns: repeat(6, 34px); }
}
@media (prefers-reduced-motion: reduce) {
    .wb-tab, .wb-block, .wb-insert, .wb-palette__item, .wb-preset, .wb-switch input, .wb-switch input::after { transition: none; }
}

/* ── Fine-tuning ─────────────────────────────────────────────────────────── */
.wb-editor > .wb-field { margin-bottom: 14px; }
.wb-link { flex-wrap: nowrap; }
.wb-link .form-control { flex: 1 1 auto; min-width: 0; }
.wb-link__pick { flex: 0 0 132px !important; max-width: 46%; }
