/* ==========================================================================
   Link-in-bio: public page, dashboard cards / theme swatches, and the editor.
   The page design is driven by --bio-* custom properties set from the saved design.
   ========================================================================== */

/* ---------- Public page ---------- */
body.bio-body { margin: 0; background: transparent; }
.bio-page {
  --bio-radius: 14px;
  --bio-card: color-mix(in srgb, var(--bio-text) 7%, transparent);
  --bio-line: color-mix(in srgb, var(--bio-text) 16%, transparent);
  position: relative; isolation: isolate; min-height: 100vh; color: var(--bio-text);
  font-family: var(--bio-font), ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.bio-bg { position: fixed; inset: 0; z-index: -1; background: var(--bio-bg); }
.bio-wrap { max-width: 640px; margin: 0 auto; padding: 56px 18px 36px; display: flex; flex-direction: column; gap: 12px; }
.bio-page a { color: inherit; }
.bio-page a:hover { text-decoration: none; }

.bio-profile { text-align: center; margin-bottom: 6px; }
.bio-avatar { width: 96px; height: 96px; object-fit: cover; display: block; margin: 0 auto 14px; border-radius: 50%; box-shadow: 0 6px 24px -10px rgba(0, 0, 0, .45); background: var(--bio-card); }
.bio-avatar-rounded .bio-avatar { border-radius: 24px; }
.bio-avatar-square .bio-avatar { border-radius: 6px; }
.bio-name { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.01em; color: var(--bio-text); }
.bio-verified { color: #3b82f6; font-size: .8em; }
.bio-about { margin: 8px auto 0; max-width: 460px; opacity: .85; white-space: pre-line; line-height: 1.55; font-size: 15px; }

.bio-socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.bio-socials a { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; font-size: 19px; transition: transform .15s, background .15s; }
.bio-socials a:hover { transform: translateY(-2px); background: var(--bio-card); }

/* Buttons: base = filled */
.bio-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px;
  padding: 12px 20px; border-radius: var(--bio-radius); border: 2px solid var(--bio-btn-bg); background: var(--bio-btn-bg);
  color: var(--bio-btn-text) !important; font: inherit; font-size: 15.5px; font-weight: 600; text-align: center; cursor: pointer;
  text-decoration: none !important; transition: transform .15s ease, box-shadow .15s ease, filter .15s; box-sizing: border-box;
}
.bio-btn:hover { transform: translateY(-2px); filter: brightness(1.04); }
.bio-btn:active { transform: translateY(0); }
.bio-btn:disabled { opacity: .6; cursor: default; }
.bio-btn > i { font-size: 17px; }
.bio-btn-label { display: flex; flex-direction: column; line-height: 1.3; }
.bio-btn-label small { font-size: 12.5px; font-weight: 500; opacity: .75; }
.bio-btn.has-thumb { padding-left: 64px; padding-right: 64px; }
.bio-btn-thumb { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; object-fit: cover; border-radius: calc(var(--bio-radius) - 5px); }
.bio-btn-emoji { position: absolute; left: 18px; font-size: 22px; }
.bio-shape-pill { --bio-radius: 999px; }
.bio-shape-pill .bio-btn-thumb { border-radius: 50%; }
.bio-shape-square { --bio-radius: 4px; }
.bio-style-outline .bio-btn { background: transparent; color: var(--bio-btn-bg) !important; }
.bio-style-outline .bio-btn:hover { background: color-mix(in srgb, var(--bio-btn-bg) 10%, transparent); }
.bio-style-soft .bio-btn { background: color-mix(in srgb, var(--bio-btn-bg) 16%, transparent); border-color: transparent; color: var(--bio-text) !important; }
.bio-style-shadow .bio-btn { box-shadow: 4px 4px 0 var(--bio-text); border-color: var(--bio-text); }
.bio-style-shadow .bio-btn:hover { box-shadow: 6px 6px 0 var(--bio-text); transform: translate(-2px, -2px); }
.bio-style-frosted .bio-btn {
  background: color-mix(in srgb, var(--bio-btn-bg) 20%, transparent); border: 1px solid color-mix(in srgb, var(--bio-btn-bg) 45%, transparent);
  color: var(--bio-btn-text) !important; -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 8px 28px -14px rgba(0, 0, 0, .45);
}

/* Featured link & cards */
.bio-featured { display: block; overflow: hidden; border-radius: var(--bio-radius); background: var(--bio-btn-bg); color: var(--bio-btn-text) !important; transition: transform .15s; }
.bio-shape-pill .bio-featured, .bio-shape-pill .bio-card, .bio-shape-pill .bio-embed, .bio-shape-pill .bio-image img, .bio-shape-pill .bio-video { border-radius: 22px; }
.bio-featured:hover { transform: translateY(-2px); }
.bio-featured img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.bio-featured-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px 16px; }
.bio-featured-body strong { font-size: 16px; }
.bio-featured-body span { font-size: 14px; opacity: .8; }
.bio-style-outline .bio-featured, .bio-style-soft .bio-featured, .bio-style-frosted .bio-featured { background: var(--bio-card); color: var(--bio-text) !important; border: 1px solid var(--bio-line); }
.bio-card { background: var(--bio-card); border: 1px solid var(--bio-line); border-radius: var(--bio-radius); padding: 16px 18px; }
.bio-shape-square .bio-card { border-radius: 4px; }
.bio-card-title { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.bio-heading { margin: 14px 0 0; color: var(--bio-text); font-weight: 700; letter-spacing: -.01em; }
h2.bio-heading { font-size: 22px; } h3.bio-heading { font-size: 18px; } h4.bio-heading { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.bio-tagline { text-align: center; font-style: italic; opacity: .85; margin: 0; }
.bio-text { line-height: 1.6; font-size: 15px; }
.align-center { text-align: center; } .align-left { text-align: left; } .align-right { text-align: right; }
.bio-divider { width: 100%; border: 0; border-top: 1px solid var(--bio-line); margin: 8px 0; }
.bio-divider-dashed { border-top-style: dashed; }
.bio-divider-dots { border-top: 3px dotted var(--bio-line); width: 60px; margin: 10px auto; }
.bio-divider-space { border: 0; margin: 10px 0; }
.bio-image img, .bio-video { width: 100%; display: block; border-radius: var(--bio-radius); }
.bio-shape-pill .bio-image img { border-radius: 22px; }
.bio-carousel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.bio-carousel figure { flex: 0 0 86%; margin: 0; scroll-snap-align: center; }
.bio-carousel img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; display: block; }
.bio-carousel figcaption { font-size: 13px; opacity: .8; margin-top: 6px; text-align: center; }

.bio-product { padding: 0; overflow: hidden; }
.bio-product img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.bio-product-body { padding: 16px 18px 18px; }
.bio-product-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 6px; font-size: 16px; }
.bio-price { font-weight: 700; white-space: nowrap; }
.bio-product p { opacity: .85; font-size: 14px; margin: 0 0 12px; }

.bio-music { padding: 8px 8px 4px; }
.bio-music .bio-card-title { padding: 8px 10px 4px; }
.bio-music-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-top: 1px solid var(--bio-line); font-weight: 600; }
.bio-music-row:first-of-type { border-top: 0; }
.bio-music-row > i { width: 24px; text-align: center; font-size: 19px; }
.bio-music-go { margin-left: auto; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--bio-btn-bg); color: var(--bio-btn-text); }

.bio-faqs details { border-top: 1px solid var(--bio-line); padding: 12px 0; }
.bio-faqs details:first-of-type { border-top: 0; }
.bio-faqs summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.bio-faqs summary::-webkit-details-marker { display: none; }
.bio-faqs summary::after { content: "+"; font-weight: 400; font-size: 20px; line-height: 1; opacity: .7; }
.bio-faqs details[open] summary::after { content: "−"; }
.bio-faqs details > div { padding-top: 8px; opacity: .85; line-height: 1.6; font-size: 14.5px; }

.bio-countdown { text-align: center; }
.bio-units { display: flex; justify-content: center; gap: 10px; }
.bio-units span { display: flex; flex-direction: column; min-width: 62px; padding: 8px 6px; border-radius: 12px; background: var(--bio-card); font-size: 12px; opacity: .9; text-transform: uppercase; letter-spacing: .05em; }
.bio-units strong { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-transform: none; }
.bio-countdown-done { margin: 0; font-weight: 600; }

.bio-embed { border-radius: var(--bio-radius); overflow: hidden; background: var(--bio-card); }
.bio-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.bio-embed.ratio-16x9 { aspect-ratio: 16 / 9; }
.bio-embed-light { background: #fff; }
.bio-embed-tiktok { max-width: 340px; margin: 0 auto; width: 100%; }
.bio-html { width: 100%; border: 0; display: block; border-radius: var(--bio-radius); background: transparent; }
.bio-audio audio { width: 100%; }

.bio-form input, .bio-form textarea, .bio-newsletter input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 12px 14px; margin-bottom: 8px; border-radius: 12px;
  border: 1px solid var(--bio-line); background: color-mix(in srgb, #fff 88%, transparent); color: #18181b;
}
.bio-form input:focus, .bio-form textarea:focus { outline: 2px solid var(--bio-btn-bg); outline-offset: 1px; }
.bio-newsletter { display: flex; gap: 8px; }
.bio-newsletter input { margin: 0; flex: 1; min-width: 0; }
.bio-newsletter .bio-btn { width: auto; min-height: 0; padding: 0 18px; }
.bio-form-text { margin: -4px 0 12px; opacity: .85; font-size: 14px; }
.bio-disclaimer { font-size: 12px; opacity: .65; margin: 8px 0 0; }
.bio-form-msg { margin: 10px 0 0; font-weight: 600; font-size: 14px; }
.bio-form-msg.is-error { color: #ef4444; }
.bio-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bio-inline-form { margin: 0; }

.bio-rss { padding: 6px 18px; }
.bio-rss-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-top: 1px solid var(--bio-line); }
.bio-rss-item:first-child { border-top: 0; }
.bio-rss-item span { font-size: 12.5px; opacity: .7; }

.bio-footer { display: flex; justify-content: center; gap: 14px; margin-top: 22px; font-size: 13px; opacity: .7; }
.bio-footer a:hover { opacity: 1; text-decoration: underline; }
.bio-report { opacity: .7; }
.bio-share {
  position: fixed; top: 14px; right: 14px; z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--bio-line);
  background: color-mix(in srgb, var(--bio-bg-solid, #fff) 30%, transparent); color: var(--bio-text); cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 15px;
}
.bio-page .ad-slot { margin: 10px auto 0; }
@media (max-width: 480px) {
  .bio-wrap { padding-top: 64px; }
  .bio-btn.has-thumb { padding-left: 60px; padding-right: 16px; }
}

/* ---------- Dashboard cards & theme swatches ---------- */
.bio-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.bio-card-item { overflow: hidden; display: flex; flex-direction: column; }
.bio-card-item .card-body { flex: 1; }
.bio-card-item + .bio-card-item { margin-top: 0; }
.bio-thumb { position: relative; isolation: isolate; height: 172px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--bio-text); text-decoration: none !important; overflow: hidden; border-bottom: 1px solid var(--border); }
.bio-thumb-bg { position: absolute; inset: 0; z-index: -1; background: var(--bio-bg); }
.bio-thumb-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-weight: 700; background: color-mix(in srgb, var(--bio-text) 14%, transparent); }
.bio-thumb-avatar.bio-avatar-rounded { border-radius: 12px; } .bio-thumb-avatar.bio-avatar-square { border-radius: 4px; }
.bio-thumb-name { font-family: var(--bio-font), system-ui, sans-serif; font-weight: 700; font-size: 14px; max-width: 80%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bio-thumb-btn { width: 62%; height: 14px; border-radius: 6px; background: var(--bio-btn-bg); opacity: .9; }
.bio-thumb-btn.short { width: 44%; }
.bio-theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.bio-theme { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--text-2); }
.bio-theme input { position: absolute; opacity: 0; }
.bio-theme-swatch { position: relative; isolation: isolate; width: 100%; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 2px solid var(--border); transition: border-color .15s, box-shadow .15s; }
.bio-theme-swatch i { width: 64%; height: 11px; border-radius: 4px; background: var(--bio-btn-bg); }
.bio-theme:hover .bio-theme-swatch { border-color: var(--border-strong); }
.bio-theme.active .bio-theme-swatch, .bio-theme:has(input:checked) .bio-theme-swatch { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.bio-theme-name { font-size: 12px; font-weight: 550; }

/* ---------- Editor ---------- */
.bio-editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.bio-editor-preview { position: sticky; top: 76px; }
.phone { width: 100%; max-width: 340px; margin: 0 auto; aspect-ratio: 9 / 18.5; max-height: calc(100vh - 150px); border: 10px solid #18181b; border-radius: 42px; overflow: hidden; background: #fff; box-shadow: var(--shadow-lg); }
.phone iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 1100px) { .bio-editor { grid-template-columns: minmax(0, 1fr); } .bio-editor-preview { position: static; order: -1; } .phone { max-height: 560px; } }
.blk-list { display: flex; flex-direction: column; gap: 8px; }
.blk { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: box-shadow .15s, border-color .15s; }
.blk.is-open { border-color: var(--border-strong); box-shadow: var(--shadow); }
.blk.is-off .blk-t, .blk.is-off .blk-ic { opacity: .45; }
.blk.sortable-ghost { opacity: .4; }
.blk-h { display: flex; align-items: center; gap: 10px; padding: 9px 10px; }
.blk-drag { cursor: grab; color: var(--text-3); padding: 4px 2px; }
.blk-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; font-size: 14px; }
.blk-t { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; }
.blk-t strong { font-size: 13.5px; }
.blk-sum { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk-b { padding: 14px 14px 6px; border-top: 1px solid var(--border); }
.blk-item { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 10px 12px 2px; margin-bottom: 10px; background: var(--surface-2); }
.blk-listfield > .btn { margin-bottom: 8px; }
.blk-schedule { margin: 4px 0 10px; }
.blk-schedule summary { cursor: pointer; font-size: 13px; color: var(--text-2); font-weight: 550; }
.social-row .form-control { flex: 1; min-width: 0; }
.img-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.img-prev { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); display: inline-grid; place-items: center; flex: none; }
.img-prev img { width: 100%; height: 100%; object-fit: cover; }
.is-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft) !important; }
.widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.widget-btn { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-weight: 550; font-size: 13px; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.widget-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
