/* ==========================================================================
   MY-Card — Card builder (create personal / business, edit card)
   Two-pane editor: form (left) + sticky live preview (right).
   Prefix: bd-  ·  Composes editorial.css + ed-app.css tokens only.
   ========================================================================== */

.ed .hidden { display: none !important; }

/* ---------- Guest (anonymous onboarding) shell: no sidebar ---------- */
.ed .dash-shell.bd-shell--guest { grid-template-columns: minmax(0, 1fr); }
.ed .bd-shell--guest .dash-topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; }
.ed .bd-shell--guest .dash-menu-toggle { display: none; }
.bd-guestbar { display: flex; align-items: center; gap: 8px; }

/* ---------- Page head ---------- */
.bd-app { gap: 22px; max-width: 1320px; }
.bd-head { padding-bottom: 20px; }
.bd-head .ed-app__title { font-size: clamp(1.9rem, 3.2vw, 2.7rem); }
.bd-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bd-quota { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.bd-quota i, .bd-quota svg { width: 14px; height: 14px; color: var(--accent); }

/* ---------- Two-pane layout ---------- */
.bd-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: clamp(28px, 3.4vw, 56px); align-items: start; }
.bd-main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }

/* ---------- Sticky section nav ---------- */
.bd-nav {
  position: sticky; top: var(--appbar-h, 0px); z-index: 12;
  margin: 0 0 8px; padding: 12px 0 0;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bd-nav__steps { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.bd-nav__steps::-webkit-scrollbar { display: none; }
.bd-nav__step button {
  display: inline-flex; align-items: baseline; gap: 0.45rem;
  padding: 8px 12px 10px; border-radius: 8px 8px 0 0;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap; transition: color 0.2s;
}
.bd-nav__step button:hover { color: var(--ink); }
.bd-nav__n { color: var(--ink-3); opacity: 0.7; }
.bd-nav__step.is-active button { color: var(--ink); }
.bd-nav__step.is-active .bd-nav__n, .bd-nav__step.is-done .bd-nav__n { color: var(--accent); opacity: 1; }
.bd-nav__step.is-done button { color: var(--ink-2); }
.bd-nav__step i, .bd-nav__step svg { width: 12px; height: 12px; align-self: center; }
.bd-nav__bar { position: relative; height: 1px; background: var(--rule); }
.bd-nav__fill { position: absolute; left: 0; top: -0.5px; height: 2px; width: 0; background: var(--accent); transition: width 0.45s var(--ease); }
.ed:lang(bn) .bd-nav__step button { letter-spacing: 0.02em; }

/* ---------- Form + sections ---------- */
.bd-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-width: 0; }
.bd-sec { padding: 34px 0 38px; border-top: 1px solid var(--rule); scroll-margin-top: 72px; display: grid; gap: 22px; }
.bd-sec:first-of-type { border-top: 0; }
.bd-sec__head { display: grid; gap: 8px; }
.bd-sec__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bd-sec__title { font-family: var(--serif); font-weight: 420; font-size: clamp(1.35rem, 2vw, 1.6rem); letter-spacing: -0.015em; line-height: 1.15; color: var(--ink); font-variation-settings: 'opsz' 48; }
.bd-sec__sub { font-size: 0.9rem; color: var(--ink-3); max-width: 60ch; }
.bd-sec__count { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); letter-spacing: 0.06em; }
.ed:lang(bn) .bd-sec__title { letter-spacing: 0; line-height: 1.3; font-weight: 500; }

.bd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.bd-full { grid-column: 1 / -1; }
.bd-field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.ed .bd-form .bd-field > label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; font-weight: 520; color: var(--ink-2); }
.bd-field > label i, .bd-field > label svg { width: 15px; height: 15px; color: var(--ink-3); }
.bd-req { color: var(--accent); }
.bd-labelrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bd-count { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-3); font-feature-settings: 'tnum'; white-space: nowrap; }
.bd-count.is-near { color: var(--accent); }
.bd-count.is-over { color: #B3402A; }
html[data-ed-theme="dark"] .bd-count.is-over { color: #E48D78; }
.ed .bd-form .ed-help { font-size: 0.78rem; }
.ed .bd-form .ed-help a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* inputs flagged by client validation */
.ed .bd-form .is-invalid :is(input, textarea, select),
.ed .bd-form :is(input, textarea, select).is-invalid { border-color: #B3402A; box-shadow: 0 0 0 4px color-mix(in oklab, #B3402A 12%, transparent); }
html[data-ed-theme="dark"] .ed .bd-form :is(input, textarea, select).is-invalid { border-color: #E48D78; }
html[data-ed-theme="dark"] .ed-error { color: #E48D78; }
.bd-field .ed-error[data-bd-client-error] { display: block; }

/* date input colour scheme follows the theme */
.ed .bd-form input[type="date"] { color-scheme: light; }
html[data-ed-theme="dark"] .ed .bd-form input[type="date"] { color-scheme: dark; }
.ed .bd-form textarea { resize: vertical; }

/* ---------- Avatar row ---------- */
.bd-avatar { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 18px; align-items: center; padding: 16px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.bd-avatar__thumb { width: 88px; height: 88px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--tint); color: var(--accent); font-family: var(--serif); font-size: 1.7rem; border: 1px solid var(--rule); }
.bd-avatar__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- File inputs (incl. Django ClearableFileInput markup) ---------- */
.bd-file { font-size: 0.82rem; color: var(--ink-3); line-height: 1.9; min-width: 0; overflow-wrap: anywhere; }
.bd-file a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.ed .bd-form .bd-file label { display: inline; font-weight: 450; color: var(--ink-2); }
.bd-file input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; vertical-align: -2px; margin: 0 4px 0 8px; }
.bd-file input[type="file"] { display: block; width: 100%; max-width: 100%; font-family: var(--sans); font-size: 0.84rem; color: var(--ink-3); margin-top: 4px; }
.bd-file input[type="file"]::file-selector-button {
  height: 38px; padding: 0 16px; margin-right: 12px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  font-family: var(--sans); font-size: 0.86rem; font-weight: 520; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.bd-file input[type="file"]::file-selector-button:hover { border-color: var(--ink); }
.bd-file input[type="file"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 999px; }

/* ---------- Phone / WhatsApp country picker (legacy markup, editorial skin) ---------- */
.bd-form .mc-phone-picker { display: flex; gap: 8px; align-items: stretch; }
.bd-form .mc-phone-picker > input { flex: 1; min-width: 0; }
.bd-form .mc-country-trigger {
  height: 46px; min-width: 112px; padding: 0 12px; border-radius: 12px; gap: 8px;
  background: var(--surface); border: 1px solid var(--rule); color: var(--ink);
  font-family: var(--mono); font-size: 0.86rem; font-weight: 500; box-shadow: none;
}
.bd-form .mc-country-trigger:hover, .bd-form .mc-country-trigger:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 12%, transparent); }
.bd-form .mc-country-trigger i, .bd-form .mc-country-trigger svg { width: 14px; height: 14px; color: var(--ink-3); }
.bd-form .mc-country-dial { font-family: var(--mono); }
.bd-form .mc-country-dropdown { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--lift-3); z-index: 60; }
.bd-form .mc-country-search { padding: 10px; border-bottom: 1px solid var(--rule); }
.ed .bd-form .mc-country-search input { height: 40px; border-radius: 10px; background: var(--paper); font-size: 0.9rem; }
.bd-form [data-country-item] { color: var(--ink); font-size: 0.88rem; }
.bd-form [data-country-item]:hover, .bd-form [data-country-item].active { background: var(--tint); color: var(--ink); }
.bd-form [data-country-item] .label small { color: var(--ink-3); font-family: var(--mono); }
.bd-form .mc-country-empty { color: var(--ink-3); }

/* ---------- AI bio ---------- */
.bd-ai { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); background: var(--tint); color: var(--ink); font-size: 0.78rem; font-weight: 520; transition: border-color 0.2s, background 0.2s; }
.bd-ai:hover { border-color: var(--accent); }
.bd-ai i, .bd-ai svg { width: 14px; height: 14px; color: var(--accent); }
.bd-ai:disabled { opacity: 0.6; pointer-events: none; }
.bd-ai__pro { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; color: var(--accent); }
.bd-ai--locked { background: transparent; }
.bd-ai-results { display: grid; gap: 8px; margin-top: 6px; }
.bd-ai-note { padding: 12px; text-align: center; font-size: 0.86rem; color: var(--ink-3); }
.bd-ai-suggestion { text-align: left; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font-size: 0.9rem; line-height: 1.5; transition: border-color 0.2s, transform 0.3s var(--ease); }
.bd-ai-suggestion:hover { border-color: var(--accent); transform: translateY(-1px); }
.bd-ai-suggestion__hint { display: block; margin-top: 6px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }

/* ---------- Public URL block ---------- */
.bd-slug { padding: 20px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); display: grid; gap: 12px; margin: 18px 0 8px; }
.bd-slug--locked { background: transparent; }
.bd-slug__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bd-slug__top .ed-kicker::after { display: none; }
.bd-slug__lede { font-size: 0.88rem; color: var(--ink-2); max-width: 64ch; }
.bd-slug__input { display: flex; align-items: stretch; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); overflow: hidden; transition: border-color 0.2s, box-shadow 0.2s; }
.bd-slug__input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 12%, transparent); }
.bd-slug__prefix { display: inline-flex; align-items: center; padding: 0 12px; font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); border-right: 1px solid var(--rule); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; background: var(--paper-2); }
.ed .bd-form .bd-slug__input input { border: 0; border-radius: 0; background: transparent; box-shadow: none; font-family: var(--mono); flex: 1; min-width: 0; }
.ed .bd-form .bd-slug__input input[readonly] { color: var(--ink-3); cursor: not-allowed; }
.bd-slug__preview { font-size: 0.82rem; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.bd-slug__preview [data-mc-slug-preview-url] { font-family: var(--mono); color: var(--ink); overflow-wrap: anywhere; }

/* ---------- Socials ---------- */
.bd-social .bd-field > label i, .bd-social .bd-field > label svg { color: var(--ink-2); }
.bd-more { border-top: 1px dashed var(--rule); padding-top: 14px; }
.bd-more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); padding: 6px 0; }
.bd-more > summary::-webkit-details-marker { display: none; }
.bd-more > summary i, .bd-more > summary svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
.bd-more[open] > summary i, .bd-more[open] > summary svg { transform: rotate(45deg); }
.bd-more > summary:hover { color: var(--ink); }
.bd-more > .bd-grid { margin-top: 16px; }
.ed:lang(bn) .bd-more > summary { letter-spacing: 0.02em; }

/* ---------- Theme picker: mini physical cards ---------- */
.bd-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 16px; }
.bd-theme { display: grid; gap: 10px; text-align: left; padding: 0; border-radius: 12px; }
.bd-theme__card {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  aspect-ratio: 85.6 / 54; border-radius: 10px; padding: 12px; overflow: hidden;
  background: var(--tbg); box-shadow: var(--lift-1);
  outline: 1px solid var(--rule-2); outline-offset: 0;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), outline-color 0.2s, outline-offset 0.2s;
}
.bd-theme__card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,0.08), transparent 45%, rgba(0,0,0,0.08)); pointer-events: none; }
.bd-theme__top { display: flex; justify-content: space-between; align-items: flex-start; }
.bd-theme__mark { width: 16px; height: 2px; border-radius: 2px; background: var(--taccent); margin-top: 4px; }
.bd-theme__dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--taccent); background: color-mix(in srgb, var(--ttext) 14%, transparent); }
.bd-theme__lines { display: grid; gap: 5px; }
.bd-theme__lines span { display: block; height: 5px; border-radius: 3px; background: var(--ttext); opacity: 0.85; width: 62%; }
.bd-theme__lines span + span { width: 38%; height: 3px; opacity: 0.45; }
.bd-theme__lock { position: absolute; right: 8px; bottom: 8px; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 14, 22, 0.62); color: #F2EEE5; }
.bd-theme__lock i, .bd-theme__lock svg { width: 12px; height: 12px; }
.bd-theme__meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 0 2px; }
.bd-theme__name { font-size: 0.84rem; font-weight: 520; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-theme__pro { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; color: var(--accent); flex-shrink: 0; display: inline-flex; align-items: center; gap: 3px; }
.bd-theme__pro i, .bd-theme__pro svg { width: 10px; height: 10px; }
.bd-theme:hover .bd-theme__card { transform: translateY(-3px); box-shadow: var(--lift-2); }
.bd-theme:focus-visible { outline: none; }
.bd-theme:focus-visible .bd-theme__card { outline: 2px solid var(--brand); outline-offset: 3px; }
.bd-theme.is-selected .bd-theme__card { outline: 2px solid var(--accent); outline-offset: 3px; }
.bd-theme.is-selected .bd-theme__name::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 2px; }
.bd-theme.is-locked .bd-theme__card { filter: saturate(0.75); }
.bd-theme.is-locked .bd-theme__name { color: var(--ink-2); }
.bd-themes__hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.86rem; color: var(--ink-3); }
.bd-themes__hint i, .bd-themes__hint svg { width: 14px; height: 14px; color: var(--accent); }
.bd-themes__hint a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Publish block (guest) ---------- */
.bd-publish ul { display: grid; gap: 8px; }
.bd-publish li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; color: var(--ink-2); }
.bd-publish li i, .bd-publish li svg { width: 16px; height: 16px; color: var(--accent); margin-top: 4px; }

/* ---------- Non-field errors ---------- */
.bd-errors { padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in oklab, #B3402A 35%, transparent); background: color-mix(in oklab, #B3402A 7%, transparent); display: grid; gap: 4px; margin-top: 14px; }

/* ---------- Sticky save bar ---------- */
.bd-savebar {
  position: sticky; bottom: 12px; z-index: 14;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; padding: 10px 10px 10px 18px;
  border: 1px solid var(--rule); border-radius: 999px;
  background: color-mix(in oklab, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--lift-2);
}
.bd-savebar__status { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--ink-3); }
.bd-savebar__status b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.bd-savebar__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rule); flex-shrink: 0; }
.bd-savebar.is-dirty .bd-savebar__dot { background: var(--accent); }
.bd-savebar__state { color: var(--ink); font-weight: 520; }
.bd-savebar__actions { display: flex; gap: 8px; align-items: center; }
.bd-savebar .ed-btn--primary { height: 44px; }
.bd-savebar .ed-btn--sm { height: 40px; }
.bd-only-sheet { display: none; }

/* ---------- Preview column ---------- */
.bd-preview { position: sticky; top: calc(var(--appbar-h, 0px) + 16px); min-width: 0; }
.bd-preview__inner { display: grid; gap: 18px; max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; padding: 4px 2px 8px; }
.bd-preview__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bd-preview__close { display: none; }
.bd-seg button { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.4rem 0.85rem; }
.ed:lang(bn) .bd-seg button { letter-spacing: 0.02em; }
.bd-pane[hidden] { display: none !important; }
.bd-pane { display: grid; gap: 14px; animation: bdFade 0.35s var(--ease) both; }
@keyframes bdFade { from { opacity: 0; transform: translateY(6px); } }

/* Physical ID-1 card, painted with the chosen theme */
.bd-stage { perspective: 1100px; padding: 8px 4px 10px; }
.ed-idcard.bd-idcard {
  position: relative; inset: auto; width: 100%;
  --c-bg: linear-gradient(150deg, #1B2B47 0%, #0D1729 70%); --c-fg: #F2EEE5; --c-mute: color-mix(in srgb, var(--c-fg) 62%, transparent); --c-acc: #D8B878;
  padding: 22px; border-radius: 16px;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s var(--ease), background 0.5s var(--ease);
  box-shadow: var(--lift-3);
}
.bd-idcard::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,0.12) 48%, transparent 62%);
  background-size: 260% 100%; background-position: calc(50% + var(--shx, 0%)) 0;
  transition: background-position 0.6s var(--ease);
}
.bd-idcard > * { position: relative; z-index: 2; }
.bd-idcard .ed-idcard__brand { font-size: 0.82rem; max-width: 70%; min-width: 0; }
.bd-idcard .ed-idcard__brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-idcard .ed-idcard__brand svg { color: var(--c-acc); flex-shrink: 0; }
.bd-idcard .ed-idcard__avatar { width: 52px; height: 52px; font-size: 1.1rem; color: var(--c-fg); border-color: color-mix(in srgb, var(--c-acc) 70%, transparent); background: color-mix(in srgb, var(--c-fg) 10%, transparent); }
.bd-idcard .ed-idcard__name { font-size: 1.65rem; overflow-wrap: anywhere; }
.bd-idcard .ed-idcard__role { font-size: 0.8rem; }
.bd-idcard .ed-idcard__role strong { color: var(--c-acc); }
.bd-idcard .ed-idcard__foot { font-size: 0.66rem; }
.bd-idcard .ed-idcard__foot span:first-child { min-width: 0; }
.bd-idcard__rule { display: block; width: 28px; height: 1px; background: var(--c-acc); margin: 0 0 10px; opacity: 0.8; }
.bd-caption { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.bd-caption span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Profile strength */
.bd-strength { padding: 16px 18px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.bd-strength .ed-meter__bar span { transition: width 0.6s var(--ease); }
.bd-strength__tip { font-size: 0.8rem; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.bd-strength__tip i, .bd-strength__tip svg { width: 13px; height: 13px; color: var(--accent); }
.bd-strength__tip:empty { display: none; }

/* Phone-style public page preview */
.bd-phone { width: 100%; max-width: 330px; justify-self: center; border-radius: 38px; padding: 10px; background: var(--ink); box-shadow: var(--lift-3); }
html[data-ed-theme="dark"] .bd-phone { background: #1d2331; }
.bd-phone__screen { border-radius: 29px; overflow: hidden; background: var(--paper); height: min(600px, calc(100vh - 230px)); min-height: 420px; display: flex; flex-direction: column; }
.bd-phone__status { display: flex; justify-content: space-between; align-items: center; padding: 10px 22px 6px; font-family: var(--mono); font-size: 0.7rem; font-weight: 500; color: var(--pc-fg, #F2EEE5); background: var(--pc-bg); }
.bd-phone__status span:last-child { display: inline-flex; gap: 4px; }
.bd-phone__status i, .bd-phone__status svg { width: 12px; height: 12px; }
.bd-page { flex: 1; overflow-y: auto; scrollbar-width: none; --pc-bg: linear-gradient(150deg, #1B2B47 0%, #0D1729 70%); --pc-fg: #F2EEE5; --pc-acc: #D8B878; transition: box-shadow 0.4s; }
.bd-page::-webkit-scrollbar { display: none; }
.bd-page__cover { height: 96px; background: var(--pc-bg); background-size: 160% 160%; }
.bd-page__sheet { padding: 0 18px 28px; margin-top: -40px; display: grid; gap: 8px; justify-items: start; }
.bd-page__avatar { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface); border: 3px solid var(--paper); box-shadow: var(--lift-1); font-family: var(--serif); font-size: 1.5rem; color: var(--ink); }
.bd-page__avatar img { width: 100%; height: 100%; object-fit: cover; }
.bd-page__name { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; line-height: 1.08; letter-spacing: -0.02em; color: var(--ink); margin-top: 4px; overflow-wrap: anywhere; }
.bd-page__role { font-size: 0.86rem; color: var(--ink-2); line-height: 1.45; }
.bd-page__role strong { color: var(--ink); font-weight: 560; text-decoration: underline; text-decoration-color: var(--pc-acc); text-decoration-thickness: 2px; text-underline-offset: 4px; margin-left: 4px; }
.bd-page__role strong:empty { display: none; }
.bd-page__brand { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); font-size: 0.76rem; color: var(--ink-2); max-width: 100%; }
.bd-page__brandmark { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-size: 0.66rem; flex-shrink: 0; }
.bd-page__brandmark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bd-page__brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-page__label { display: flex; align-items: center; gap: 10px; width: 100%; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-top: 14px; }
.bd-page__label::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.bd-page__about { font-family: var(--serif); font-size: 0.98rem; line-height: 1.55; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.bd-page__block { width: 100%; }
.bd-page__rows { width: 100%; border-top: 1px solid var(--ink); margin-top: 6px; }
.bd-page__rows li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.bd-page__ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--brand); }
.bd-page__ico i, .bd-page__ico svg { width: 14px; height: 14px; }
.bd-page__rows li > span:last-child, .bd-page__rows li > a { font-size: 0.8rem; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.bd-page__socials { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 12px; }
.bd-page__socials .ed-preview-social { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2); }
.bd-page__socials .ed-preview-social i, .bd-page__socials .ed-preview-social svg { width: 15px; height: 15px; }
.bd-page.is-glow { box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--accent) 45%, transparent); }

/* ---------- Guest publish modal (ed-modal skin) ---------- */
.bd-pub .ed-modal__box { max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; }
.bd-pub__fields { display: grid; gap: 16px; }
.bd-pub__fields .ed-input { height: 46px; }
.bd-pub__url { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); overflow-wrap: anywhere; }
.bd-pub__url i, .bd-pub__url svg { width: 13px; height: 13px; color: var(--accent); flex-shrink: 0; }
.bd-pub__slug { color: var(--ink); }
.bd-pub__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.bd-pub__foot a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.ed:lang(bn) .bd-pub .ed-modal__head h2 { letter-spacing: 0; line-height: 1.3; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .bd-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
}

/* Below 1100: preview becomes a bottom sheet opened from the save bar */
@media (max-width: 1100px) {
  .bd-layout { grid-template-columns: minmax(0, 1fr); }
  .bd-only-sheet { display: inline-flex; }
  .bd-preview {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60;
    max-height: 88vh; max-height: 88dvh;
    background: var(--paper); border-top: 1px solid var(--rule); border-radius: 22px 22px 0 0;
    box-shadow: 0 -24px 60px -20px rgba(10, 14, 22, 0.45);
    transform: translateY(105%); visibility: hidden;
    transition: transform 0.45s var(--ease), visibility 0s linear 0.45s;
  }
  .bd-preview.is-open { transform: none; visibility: visible; transition: transform 0.45s var(--ease), visibility 0s; }
  .bd-preview__inner { max-height: inherit; padding: 18px clamp(16px, 4vw, 32px) 28px; max-width: 560px; margin: 0 auto; }
  .bd-preview__inner::before { content: ''; width: 40px; height: 4px; border-radius: 4px; background: var(--rule); justify-self: center; margin-bottom: -6px; }
  .bd-preview__close { display: grid; }
  .bd-phone__screen { height: min(560px, 62vh); }
  .bd-sheet-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(10, 14, 22, 0.38); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  .bd-sheet-scrim.is-open { opacity: 1; pointer-events: auto; }
}
@media (min-width: 1101px) { .bd-sheet-scrim { display: none; } }

@media (max-width: 960px) {
  /* topbar is visible and sticky here */
  .bd-nav { top: 57px; }
  .bd-sec { scroll-margin-top: 120px; }
}
@media (max-width: 720px) {
  .bd-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .bd-sec { padding: 28px 0 30px; }
  .bd-avatar { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .bd-avatar__thumb { width: 64px; height: 64px; font-size: 1.3rem; }
  .bd-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .bd-savebar { border-radius: 18px; padding: 10px; gap: 8px; }
  .bd-savebar__status { flex-basis: 100%; padding: 0 6px; }
  .bd-savebar__actions { width: 100%; }
  .bd-savebar__actions .ed-btn--primary { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .bd-savebar__actions .ed-btn { padding: 0 14px; }
  .bd-savebar__actions .bd-cancel span { display: none; }
  /* sit above the app's bottom tab bar */
  body.has-mnav .bd-savebar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.has-mnav .bd-preview { bottom: calc(64px + env(safe-area-inset-bottom)); max-height: calc(88dvh - 64px); }
  .bd-slug__prefix { font-size: 0.72rem; padding: 0 8px; }
  .bd-pub__actions .ed-btn { flex: 1; }
}
@media (max-width: 400px) {
  .bd-form .mc-country-trigger { min-width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .bd-pane, .bd-nav__fill, .bd-theme__card, .ed-idcard.bd-idcard, .bd-idcard::before, .bd-preview, .bd-more > summary i, .bd-strength .ed-meter__bar span { animation: none !important; transition: none !important; }
}

/* keep focused/invalid fields clear of the sticky nav + save bar */
.bd-form :is(input, select, textarea) { scroll-margin-top: 130px; scroll-margin-bottom: 130px; }

/* Lucide dropped some brand glyphs: hide unreplaced <i> placeholders, fall back to a letter */
.bd-field > label > i:empty { display: none; }
.ed-preview-social > i:empty { display: none; }
.ed-preview-social:has(> i:empty)::before { content: attr(data-l); font-family: var(--mono); font-size: 0.72rem; font-weight: 500; }
.bd-field[hidden] { display: none !important; }

/* ---------- Work card (team) banner + managed fields ---------- */
.ed .bd-work { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; margin-bottom: 18px; border-radius: 18px; border: 1px solid color-mix(in oklab, var(--team) 40%, var(--rule)); background: linear-gradient(120deg, color-mix(in oklab, var(--team) 9%, var(--surface)), var(--surface) 70%); }
.ed .bd-work__logo { width: 48px; height: 48px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: var(--team); color: #fff; font-family: var(--serif); }
.ed .bd-work__logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.ed .bd-work__body { display: grid; gap: 2px; min-width: 0; }
.ed .bd-work__body strong { font-size: 0.95rem; font-weight: 580; }
.ed .bd-work__body span { font-size: 0.84rem; color: var(--ink-2); line-height: 1.45; }
.ed .is-managed { background: var(--paper-2) !important; color: var(--ink-3) !important; cursor: not-allowed; }
@media (max-width: 640px) { .ed .bd-work { grid-template-columns: 40px minmax(0, 1fr); } .ed .bd-work .ed-btn { grid-column: 1 / -1; justify-self: start; } }
.ed .bd-help { font-size: 0.8rem; color: var(--ink-3); line-height: 1.45; }
.ed .bd-opt { font-weight: 400; color: var(--ink-3); }
.ed .bd-check { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--ink-2); cursor: pointer; }
.ed .bd-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.ed .bd-file { display: grid; gap: 8px; }
.ed .bd-file__now { display: flex; align-items: center; gap: 12px; }
.ed .bd-file__now img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; border: 1px solid var(--rule); background: var(--paper-2); }
.ed .bd-file__clear { display: inline-flex !important; align-items: center; gap: 6px; font-size: 0.84rem; color: var(--ink-2); }
.ed .bd-file input[type="file"] { max-width: 100%; font-size: 0.86rem; }
