/* Linktree Builder - shared CSS (editor + view) */
:root {
  --bg: #0b0f17;
  --panel: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.1);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);
  --danger: #ff4d4d;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius2: 22px;
  --maxw: 1200px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(
      1200px 900px at 15% -10%,
      rgba(79, 70, 229, 0.35),
      transparent 60%
    ),
    radial-gradient(
      900px 900px at 90% 10%,
      rgba(236, 72, 153, 0.25),
      transparent 55%
    ),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
}

html {
  background:
    radial-gradient(
      1200px 900px at 15% -10%,
      rgba(79, 70, 229, 0.35),
      transparent 60%
    ),
    radial-gradient(
      900px 900px at 90% 10%,
      rgba(236, 72, 153, 0.25),
      transparent 55%
    ),
    var(--bg);
  background-attachment: fixed;
}

a {
  color: inherit;
}

/* ---------- Topbar ---------- */
.topbar {
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(12px);
  background: rgba(0, 0, 0, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #fb7185);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 6px 10px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--muted);
  user-select: none;
}

.muted {
  color: var(--muted);
}
.hint {
  margin: 10px 0 0;
  font-size: 12px;
}
.msg {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.88);
}

/* ---------- Layout ---------- */
.layout {
  max-width: var(--maxw);
  margin: 18px auto;
  padding: 0 16px 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panelHead {
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
}

.panelHead h3 {
  margin: 0;
  font-size: 16px;
}
.panelHead p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 10px;
  padding: 12px 14px 0;
  flex-wrap: wrap;

  position: sticky;
  top: 56px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
}

.tabBtn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
}

.tabBtn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tabBtn.active {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.22);
}

.tabPanel {
  display: none;
}
.tabPanel.active {
  display: block;
}

/* ---------- Forms ---------- */
.card {
  margin: 14px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.18);
}

h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 0;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 6px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  outline: none;
  font-size: 16px;
}

textarea {
  resize: vertical;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 10px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.checkRow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkRow input {
  width: auto;
  margin: 0;
}

/* ---------- Buttons ---------- */
button,
.fileBtn,
a.ghost,
a.primary {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  text-decoration: none;
}

button:hover,
.fileBtn:hover,
a.ghost:hover,
a.primary:hover {
  background: rgba(255, 255, 255, 0.1);
}

button.primary,
a.primary {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.22);
}

button.primary:hover,
a.primary:hover {
  background: rgba(99, 102, 241, 0.3);
}

button.danger {
  border-color: rgba(255, 77, 77, 0.6);
  background: rgba(255, 77, 77, 0.16);
}

button.danger:hover {
  background: rgba(255, 77, 77, 0.24);
}

button.ghost,
.fileBtn.ghost,
a.ghost {
  background: transparent;
}

.fileBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Blocks ---------- */
.blocksHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.blocksList {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blockItem {
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.22);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Accordion head */
.blockHead {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border: 0;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-align: left;
}

.blockHead:hover {
  background: rgba(255, 255, 255, 0.04);
}

.blockHeadLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.blockTag {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 4px 8px;
  flex: 0 0 auto;
}

.blockTitleLine {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.blockTitle {
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blockSub {
  font-size: 12px;
  color: var(--muted);
}

.blockHeadRight {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.iconBtn {
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.dragHandle {
  cursor: grab;
  opacity: 0.9;
}

.chev {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.blockBody {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.blockCollapsed .blockBody {
  display: none;
}
.blockCollapsed .chev {
  transform: rotate(-90deg);
}
.blockCollapsed .blockHead {
  background: rgba(0, 0, 0, 0.12);
}

/* Cleaner collapsed look */
.blockCollapsed .blockTitle { opacity: 0.92; }
.blockCollapsed .blockSub { opacity: 0.6; }
.blockItem:hover .blockHead { filter: brightness(1.05); }

/* Segmented button groups (layout controls) */
.btnGroup {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.segBtn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  touch-action: manipulation;
}

.segBtn:hover { background: rgba(255, 255, 255, 0.1); }
.segBtn.active {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.22);
}

/* Analytics */
.statBox {
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius);
  padding: 12px;
}

.statLabel { font-size: 12px; color: var(--muted); }
.statValue { font-size: 22px; font-weight: 850; margin-top: 6px; }

.miniTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--stroke);
}

.miniTable th,
.miniTable td {
  text-align: left;
  font-size: 13px;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.miniTable th {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.miniTable tr:last-child td { border-bottom: 0; }

.miniUrl {
  max-width: 440px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

/* Backups */
.backupsList { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.backupRow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
}

.backupMeta { min-width: 0; }
.backupTitle { font-weight: 800; }
.backupSub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Drag feedback */
.dragging {
  opacity: 0.65;
  outline: 2px dashed rgba(255, 255, 255, 0.25);
  outline-offset: 4px;
}

/* WYSIWYG area */
.editable {
  margin-top: 10px;
  padding: 10px;
  min-height: 44px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.editable[contenteditable="false"] {
  opacity: 0.75;
}

.rtToolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(0,0,0,.18);
}

.rtToolbar .sep { width: 1px; background: rgba(255,255,255,.12); margin: 0 2px; }

.rtToolbar button {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}

.rtToolbar button:hover { background: rgba(255,255,255,.10); }

/* ---------- Preview ---------- */
.previewHost {
  padding: 18px;
}

.previewPage {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.tree .previewPage {
  border-radius: 0;
}

.previewCanvas {
  position: relative;
  min-height: 690px;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden; /* prevent horizontal scroll caused by bg layers */
  padding: 0;
  color: var(--page-text, #ffffff);
}

/* Live view should always fill at least the viewport height */
.tree .previewCanvas{
  min-height: 100vh;
  min-height: 100dvh;
  max-height: none;
  overflow-y: visible;
}

.previewCanvas .bgLayer {
  position: absolute;
  /* extend a bit so blur doesn't show hard edges, but don't use scale() */
  inset: -22px;
  background-color: var(--page-bg, #0b0f17);
  background-image: var(--page-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(var(--page-bg-blur, 0px)) brightness(var(--page-bg-brightness, 100%));
  transform: none;
  z-index: 0;
  pointer-events: none;
}

.previewCanvas .bgOverlay {
  position: absolute;
  inset: 0;
  background: var(--page-overlay, rgba(0,0,0,.45));
  opacity: var(--page-overlay-enabled, 0);
  transition: opacity .15s ease;
  z-index: 1;
  pointer-events: none;
}

.previewCanvas .previewContent {
  position: relative;
  z-index: 2;
  padding: 18px 16px 20px;
}



.previewBanner {
  height: 140px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
}

.previewBanner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.previewHeader {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

/* When a banner exists we pull the header up to overlap the banner nicely */
.hasBanner .previewHeader{
  margin-top: -30px;
}

.previewAvatar {
  width: 86px;
  height: 86px;
  border-radius: 999px;
  overflow: hidden;
  border: 3px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.25);
}

.previewAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.previewTitle {
  font-weight: 820;
  font-size: 18px;
}
.previewHandle {
  font-size: 13px;
  opacity: 0.85;
  margin-top: -4px;
}
.previewBio {
  font-size: 13px;
  line-height: 1.35;
  max-width: 330px;
  opacity: 0.92;
}

.previewBlocks {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.previewCard {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 16px;
  padding: 12px;
}

.previewCard a {
  color: var(--link-text, inherit);
}

.previewCard a:hover {
  color: var(--link-text-hover, inherit);
}

.previewLink {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: var(--link-pad-y, 14px) var(--link-pad-x, 14px);
  border-radius: var(--link-radius, 16px);
  border: 1px solid var(--link-border, rgba(255, 255, 255, 0.18));
  background: var(--link-bg, rgba(255, 255, 255, 0.06));
  color: var(--link-text, rgba(255, 255, 255, 0.92));
}

.previewLink:hover {
  background: var(--link-bg-hover, rgba(255, 255, 255, 0.1));
  border-color: var(--link-border-hover, var(--link-border));
  color: var(--link-text-hover, var(--link-text));
}

.previewImg {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.previewImg img {
  width: 100%;
  height: auto;
  display: block;
}

.previewSpacer {
  width: 100%;
}

/* ---------- Affiliate / Product Cards ---------- */
.affiliateTitle {
  font-weight: 820;
  margin: 0 0 10px;
}

.productGrid {
  display: grid;
  gap: 10px;
}

.productGrid.cols-1 { grid-template-columns: 1fr; }
.productGrid.cols-2 { grid-template-columns: 1fr 1fr; }

@media (max-width: 520px) {
  .productGrid.cols-2 { grid-template-columns: 1fr; }
}

.productCard {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.productImg { aspect-ratio: 16 / 9; overflow: hidden; }
.productImg img { width: 100%; height: 100%; object-fit: cover; display: block; }

.productBody { padding: 12px; display:flex; flex-direction:column; gap: 8px; }
.productTitle { font-weight: 820; font-size: 13px; line-height: 1.2; }
.productDesc { font-size: 12px; color: rgba(255,255,255,.78); line-height: 1.35; }

.productBtn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--link-border, rgba(255,255,255,.18));
  background: var(--link-bg, rgba(255,255,255,.06));
  color: var(--link-text, rgba(255,255,255,.92));
  user-select: none;
}
.productBtn:hover {
  background: var(--link-bg-hover, rgba(255,255,255,.10));
  border-color: var(--link-border-hover, var(--link-border));
  color: var(--link-text-hover, var(--link-text));
}
.productBtn[disabled] {
  pointer-events: none;
  opacity: .6;
}

/* ---------- Social Icons ---------- */
.socialRow {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.socialIcon {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.socialIcon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.socialIcon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

/* ---------- Brand Buttons (WhatsApp / Telegram) ---------- */
.brandBtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px;
  border-radius: 16px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.brandBtn .left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brandDot {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brandDot svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.brandBtn.whatsapp {
  background: rgba(37, 211, 102, 0.2);
  border-color: rgba(37, 211, 102, 0.35);
}

.brandBtn.whatsapp:hover {
  background: rgba(37, 211, 102, 0.26);
}

.brandBtn.telegram {
  background: rgba(34, 158, 217, 0.2);
  border-color: rgba(34, 158, 217, 0.35);
}

.brandBtn.telegram:hover {
  background: rgba(34, 158, 217, 0.26);
}

/* ---------- Video (privacy click-to-load) ---------- */
.videoShell {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
}

.videoPoster {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.videoPoster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.95;
}

.playBtn {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.videoMeta {
  padding: 12px;
}
.videoMeta .title {
  font-weight: 820;
  font-size: 14px;
}

.videoMeta .note {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.82;
  line-height: 1.3;
}

.videoLoadBtn {
  margin-top: 10px;
  width: 100%;
  border-radius: 14px;
  padding: 10px 12px;
}

/* ---------- Legal Footer + Modal ---------- */
.legalFooter {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  opacity: 0.9;
}

.legalLinks {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.legalLink {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.legalLink:hover {
  background: rgba(255, 255, 255, 0.1);
}

.legalSmall {
  text-align: center;
  opacity: 0.85;
}

/* Modal */
.legalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.legalModal {
  width: 100%;
  max-width: 720px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 14, 22, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: 16px;
}

.legalModalHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.legalModalTitle {
  font-size: 16px;
  font-weight: 820;
}

.legalClose {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.legalClose:hover {
  background: rgba(255, 255, 255, 0.1);
}

.legalContent {
  max-height: 70vh;
  overflow: auto;
  padding: 10px 10px 4px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  line-height: 1.45;
  font-size: 13px;
  white-space: pre-wrap;
}

/* ---------- Layout variants (preview only) ---------- */
.layout-classic .previewBlocks {
  gap: 10px;
}

.layout-compact .previewContent {
  padding: 14px 12px 16px;
}
.layout-compact .previewBlocks {
  gap: 8px;
}
.layout-compact .previewCanvas {
  --link-pad-y: 12px;
  --link-pad-x: 12px;
  --link-radius: 14px;
}
.layout-compact .previewCard {
  border-radius: 14px;
  padding: 10px;
}

.layout-bold .previewTitle {
  font-size: 20px;
}
.layout-bold .previewCanvas {
  --link-pad-y: 16px;
  --link-pad-x: 16px;
  --link-radius: 18px;
}
.layout-bold .previewLink { font-weight: 750; }
.layout-bold .brandBtn {
  padding: 16px 16px;
  border-radius: 18px;
}
.layout-bold .socialIcon {
  width: 52px;
  height: 52px;
}

.layout-minimal .previewCard {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.1);
}
.layout-minimal .previewLink {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
}
.layout-minimal .previewLink:hover {
  background: rgba(255, 255, 255, 0.06);
}

.layout-minimal .previewCanvas {
  --link-bg: transparent;
  --link-border: rgba(255, 255, 255, 0.14);
  --link-bg-hover: rgba(255, 255, 255, 0.06);
}


/* ---------- Color picker (circle) ---------- */
.colorRow{
  display:flex;
  align-items:center;
  gap:10px;
}
.colorDot{
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: transparent;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25) inset;
  cursor: pointer;
  flex: 0 0 auto;
}
.colorDot:hover{ filter: brightness(1.15); }
.colorPick{
  position:absolute;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}

.alphaRow{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:8px;
}
.alphaRow input[type="range"]{
  width: 100%;
}


/* Share button */
.previewHeader{ position: relative; }
.previewActions{
  position:absolute;
  top: 10px;
  right: 10px;
}
.shareBtn{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: 0.15s ease;
}
.shareBtn:hover{ background: rgba(255,255,255,0.10); }

/* ---------- Contact block ---------- */
.contactRow{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}
.contactChip{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  text-decoration:none;
  padding: 12px 14px;
  border-radius: var(--link-radius);
  background: var(--link-bg);
  color: var(--link-text);
  border: 1px solid var(--link-border);
  transition: 0.15s ease;
  flex: 1 1 140px;
  max-width: 100%;
}
.contactChip:hover{
  background: var(--link-bg-hover);
  border-color: var(--link-border-hover);
}
.contactIcon{
  width: 18px;
  height: 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  opacity: 0.95;
}

/* Banner size variants */
.banner-s .previewBanner {
  height: 96px;
}
.banner-m .previewBanner {
  height: 140px;
}
.banner-l .previewBanner {
  height: 190px;
}

/* Avatar size variants */
.avatar-s .previewAvatar {
  width: 70px;
  height: 70px;
}
.avatar-m .previewAvatar {
  width: 86px;
  height: 86px;
}
.avatar-l .previewAvatar {
  width: 104px;
  height: 104px;
}

/* ---------- Editor Login Modal ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 200;
}

.modal {
  width: 100%;
  max-width: 420px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 14, 22, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: 16px;
}

.modal h2 {
  margin: 2px 0 6px;
}

/* ---------- Mobile UX: bottom switch (Editor/Preview) ---------- */
.mobileBar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  z-index: 60;
  gap: 10px;
}

.mobileTab {
  flex: 1;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 750;
}

.mobileTab.active {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.22);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    padding-bottom: 86px;
  }

  .mobileBar {
    display: flex;
  }

  body.mobileModeEditor #previewPanel {
    display: none;
  }
  body.mobileModePreview #editorPanel {
    display: none;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }
  .grid2,
  .grid3 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Public View helpers ---------- */
.viewWrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

/* Under construction */
.ucWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 90px);
  padding: 16px;
}

.ucCard {
  width: 100%;
  max-width: 520px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.ucIcon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 26px;
}

.ucIcon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}
