/* ============================================
   Terraform3D — Shared Styles
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }

/* ============================================
   ACCESSIBILITY — WCAG 2.2 AA
   ============================================ */

/* Skip link — hidden until focused */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  z-index: 9999;
  background: #2969b5;
  color: #fff;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.1s;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Focus-visible ring for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #2969b5;
  outline-offset: 2px;
}

/* Suppress focus ring only when using mouse */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================
   PROFILE THEMES
   ============================================ */

body[data-theme="gradient"] {
  --bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --card-bg: rgba(255,255,255,0.15);
  --card-hover: rgba(255,255,255,0.28);
  --card-border: rgba(255,255,255,0.25);
  --text: #ffffff;
  --subtext: rgba(255,255,255,0.78);
  --shadow: 0 8px 32px rgba(102,126,234,0.3);
  --avatar-border: rgba(255,255,255,0.5);
}

body[data-theme="ocean"] {
  --bg: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --card-bg: rgba(255,255,255,0.08);
  --card-hover: rgba(255,255,255,0.16);
  --card-border: rgba(255,255,255,0.12);
  --text: #ffffff;
  --subtext: rgba(255,255,255,0.65);
  --shadow: 0 8px 32px rgba(15,52,96,0.5);
  --avatar-border: rgba(100,180,255,0.5);
}

body[data-theme="sunset"] {
  --bg: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --card-bg: rgba(255,255,255,0.2);
  --card-hover: rgba(255,255,255,0.32);
  --card-border: rgba(255,255,255,0.3);
  --text: #ffffff;
  --subtext: rgba(255,255,255,0.85);
  --shadow: 0 8px 32px rgba(245,87,108,0.35);
  --avatar-border: rgba(255,255,255,0.6);
}

body[data-theme="forest"] {
  --bg: linear-gradient(135deg, #134e5e 0%, #71b280 100%);
  --card-bg: rgba(255,255,255,0.15);
  --card-hover: rgba(255,255,255,0.26);
  --card-border: rgba(255,255,255,0.2);
  --text: #ffffff;
  --subtext: rgba(255,255,255,0.78);
  --shadow: 0 8px 32px rgba(19,78,94,0.4);
  --avatar-border: rgba(255,255,255,0.5);
}

body[data-theme="midnight"] {
  --bg: #0a0a0f;
  --card-bg: #16161e;
  --card-hover: #1e1e28;
  --card-border: #2a2a38;
  --text: #ffffff;
  --subtext: #8888aa;
  --shadow: 0 4px 20px rgba(0,0,0,0.6);
  --avatar-border: rgba(100,100,200,0.4);
}

body[data-theme="minimal"] {
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --card-hover: #f8f9fb;
  --card-border: #e2e5ea;
  --text: #1a1a2e;
  --subtext: #6b7280;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --avatar-border: rgba(0,0,0,0.15);
}

body[data-theme="rose"] {
  --bg: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  --card-bg: rgba(255,255,255,0.5);
  --card-hover: rgba(255,255,255,0.7);
  --card-border: rgba(255,255,255,0.6);
  --text: #4a2040;
  --subtext: rgba(74,32,64,0.7);
  --shadow: 0 8px 32px rgba(252,182,159,0.4);
  --avatar-border: rgba(255,255,255,0.7);
}

body[data-theme="crimson"] {
  --bg: linear-gradient(160deg, #1a0000 0%, #5c0000 55%, #8b1a1a 100%);
  --card-bg: rgba(220,20,20,0.12);
  --card-hover: rgba(220,20,20,0.22);
  --card-border: rgba(220,50,50,0.3);
  --text: #ffffff;
  --subtext: rgba(255,180,180,0.8);
  --shadow: 0 8px 32px rgba(180,0,0,0.5);
  --avatar-border: rgba(220,50,50,0.6);
}

body[data-theme="neon"] {
  --bg: #05050f;
  --card-bg: rgba(0,255,200,0.07);
  --card-hover: rgba(0,255,200,0.14);
  --card-border: rgba(0,255,200,0.2);
  --text: #00ffc8;
  --subtext: rgba(0,210,170,0.72);
  --shadow: 0 8px 32px rgba(0,200,160,0.2);
  --avatar-border: rgba(0,255,200,0.55);
}

body[data-theme="aurora"] {
  --bg: linear-gradient(160deg, #050a1e 0%, #0c2040 40%, #061f15 100%);
  --card-bg: rgba(80,220,150,0.08);
  --card-hover: rgba(80,220,150,0.15);
  --card-border: rgba(80,200,140,0.18);
  --text: #ffffff;
  --subtext: rgba(160,255,200,0.72);
  --shadow: 0 8px 32px rgba(0,130,100,0.3);
  --avatar-border: rgba(80,255,180,0.45);
}

body[data-theme="gold"] {
  --bg: linear-gradient(135deg, #0c0900 0%, #1e1500 55%, #2d1f00 100%);
  --card-bg: rgba(255,195,0,0.09);
  --card-hover: rgba(255,195,0,0.16);
  --card-border: rgba(200,155,0,0.25);
  --text: #ffd700;
  --subtext: rgba(255,205,80,0.72);
  --shadow: 0 8px 32px rgba(180,140,0,0.3);
  --avatar-border: rgba(255,195,0,0.55);
}

body[data-theme="violet"] {
  --bg: linear-gradient(135deg, #0d0015 0%, #1a0030 55%, #2d0055 100%);
  --card-bg: rgba(150,50,255,0.1);
  --card-hover: rgba(150,50,255,0.18);
  --card-border: rgba(140,50,230,0.22);
  --text: #ffffff;
  --subtext: rgba(200,160,255,0.75);
  --shadow: 0 8px 32px rgba(100,0,200,0.4);
  --avatar-border: rgba(180,100,255,0.5);
}

body[data-theme="ember"] {
  --bg: linear-gradient(135deg, #100500 0%, #2e0f00 55%, #4c1c00 100%);
  --card-bg: rgba(255,90,0,0.1);
  --card-hover: rgba(255,90,0,0.18);
  --card-border: rgba(220,90,0,0.22);
  --text: #ffffff;
  --subtext: rgba(255,170,100,0.8);
  --shadow: 0 8px 32px rgba(200,70,0,0.4);
  --avatar-border: rgba(255,110,30,0.55);
}

body[data-theme="slate"] {
  --bg: linear-gradient(135deg, #1a1f2e 0%, #242d3d 60%, #1c2a3a 100%);
  --card-bg: rgba(100,130,180,0.1);
  --card-hover: rgba(100,130,180,0.18);
  --card-border: rgba(100,130,180,0.2);
  --text: #e2e8f0;
  --subtext: rgba(160,190,220,0.72);
  --shadow: 0 8px 32px rgba(30,60,100,0.5);
  --avatar-border: rgba(120,160,200,0.45);
}

body[data-theme="dusk"] {
  --bg: linear-gradient(135deg, #1e0a4a 0%, #5c208a 50%, #c44a20 100%);
  --card-bg: rgba(255,255,255,0.1);
  --card-hover: rgba(255,255,255,0.18);
  --card-border: rgba(255,255,255,0.2);
  --text: #ffffff;
  --subtext: rgba(255,210,190,0.8);
  --shadow: 0 8px 32px rgba(100,30,100,0.35);
  --avatar-border: rgba(255,180,120,0.5);
}

body[data-theme="arctic"] {
  --bg: linear-gradient(135deg, #e8f4fc 0%, #c4e0f0 50%, #aad4ea 100%);
  --card-bg: rgba(255,255,255,0.65);
  --card-hover: rgba(255,255,255,0.85);
  --card-border: rgba(120,180,220,0.35);
  --text: #0a2838;
  --subtext: rgba(20,80,110,0.68);
  --shadow: 0 8px 32px rgba(80,160,210,0.2);
  --avatar-border: rgba(100,170,220,0.5);
}

body[data-theme="carbon"] {
  --bg: #111111;
  --card-bg: #1c1c1c;
  --card-hover: #242424;
  --card-border: #333333;
  --text: #f5f5f5;
  --subtext: #888888;
  --shadow: 0 4px 20px rgba(0,0,0,0.8);
  --avatar-border: rgba(255,255,255,0.2);
}

body[data-theme="sage"] {
  --bg: linear-gradient(135deg, #f0f4ee 0%, #d8e8d0 100%);
  --card-bg: rgba(255,255,255,0.6);
  --card-hover: rgba(255,255,255,0.8);
  --card-border: rgba(100,150,80,0.25);
  --text: #233d18;
  --subtext: rgba(50,90,35,0.7);
  --shadow: 0 8px 32px rgba(70,120,50,0.15);
  --avatar-border: rgba(100,150,80,0.4);
}

body[data-theme="candy"] {
  --bg: linear-gradient(135deg, #ff6eb4 0%, #00d4ff 100%);
  --card-bg: rgba(255,255,255,0.25);
  --card-hover: rgba(255,255,255,0.38);
  --card-border: rgba(255,255,255,0.35);
  --text: #ffffff;
  --subtext: rgba(255,255,255,0.82);
  --shadow: 0 8px 32px rgba(255,100,180,0.3);
  --avatar-border: rgba(255,255,255,0.6);
}

body[data-theme="copper"] {
  --bg: linear-gradient(135deg, #0e0700 0%, #2a1000 50%, #3d1800 100%);
  --card-bg: rgba(180,80,0,0.1);
  --card-hover: rgba(180,80,0,0.18);
  --card-border: rgba(180,90,20,0.25);
  --text: #cc7832;
  --subtext: rgba(180,120,60,0.8);
  --shadow: 0 8px 32px rgba(120,60,0,0.5);
  --avatar-border: rgba(180,90,20,0.5);
}

body[data-theme="coral"] {
  --bg: linear-gradient(135deg, #ff6b35 0%, #f7c59f 100%);
  --card-bg: rgba(255,255,255,0.22);
  --card-hover: rgba(255,255,255,0.35);
  --card-border: rgba(255,255,255,0.3);
  --text: #ffffff;
  --subtext: rgba(255,255,255,0.82);
  --shadow: 0 8px 32px rgba(255,107,53,0.35);
  --avatar-border: rgba(255,255,255,0.55);
}

body[data-theme="lavender"] {
  --bg: linear-gradient(135deg, #ede7f6 0%, #d1c4e9 100%);
  --card-bg: rgba(255,255,255,0.6);
  --card-hover: rgba(255,255,255,0.8);
  --card-border: rgba(180,140,220,0.3);
  --text: #3d1a5e;
  --subtext: rgba(80,40,120,0.65);
  --shadow: 0 8px 32px rgba(130,90,200,0.15);
  --avatar-border: rgba(160,110,210,0.45);
}

body[data-theme="mint"] {
  --bg: linear-gradient(135deg, #e8f8f5 0%, #b2dfdb 100%);
  --card-bg: rgba(255,255,255,0.6);
  --card-hover: rgba(255,255,255,0.8);
  --card-border: rgba(0,150,120,0.2);
  --text: #004d40;
  --subtext: rgba(0,100,84,0.65);
  --shadow: 0 8px 32px rgba(0,128,100,0.12);
  --avatar-border: rgba(0,150,120,0.35);
}

body[data-theme="nordic"] {
  --bg: linear-gradient(135deg, #2d3142 0%, #3a4060 50%, #2c3555 100%);
  --card-bg: rgba(255,255,255,0.08);
  --card-hover: rgba(255,255,255,0.14);
  --card-border: rgba(200,220,255,0.12);
  --text: #eceff4;
  --subtext: rgba(200,210,230,0.72);
  --shadow: 0 8px 32px rgba(20,30,60,0.5);
  --avatar-border: rgba(150,180,230,0.4);
}

body[data-theme="sakura"] {
  --bg: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 50%, #fce4ec 100%);
  --card-bg: rgba(255,255,255,0.55);
  --card-hover: rgba(255,255,255,0.75);
  --card-border: rgba(240,130,160,0.25);
  --text: #880e4f;
  --subtext: rgba(136,14,79,0.65);
  --shadow: 0 8px 32px rgba(240,100,140,0.2);
  --avatar-border: rgba(240,130,160,0.5);
}

body[data-theme="storm"] {
  --bg: linear-gradient(135deg, #0d1b2a 0%, #1b3a4b 50%, #0d1b2a 100%);
  --card-bg: rgba(100,160,200,0.08);
  --card-hover: rgba(100,160,200,0.15);
  --card-border: rgba(100,160,200,0.14);
  --text: #e0f0ff;
  --subtext: rgba(160,210,240,0.72);
  --shadow: 0 8px 32px rgba(0,40,80,0.6);
  --avatar-border: rgba(100,160,220,0.45);
}

body[data-theme="terra"] {
  --bg: linear-gradient(135deg, #3e1c00 0%, #6d3a1f 50%, #a0522d 100%);
  --card-bg: rgba(220,120,60,0.12);
  --card-hover: rgba(220,120,60,0.2);
  --card-border: rgba(200,100,40,0.25);
  --text: #ffd5a8;
  --subtext: rgba(240,180,120,0.75);
  --shadow: 0 8px 32px rgba(80,30,0,0.5);
  --avatar-border: rgba(220,120,60,0.5);
}

body[data-theme="winter"] {
  --bg: linear-gradient(135deg, #f0f4f8 0%, #dde8f0 50%, #c8dce8 100%);
  --card-bg: rgba(255,255,255,0.65);
  --card-hover: rgba(255,255,255,0.85);
  --card-border: rgba(140,180,210,0.3);
  --text: #0a2030;
  --subtext: rgba(30,70,100,0.65);
  --shadow: 0 8px 32px rgba(100,160,200,0.15);
  --avatar-border: rgba(120,170,210,0.4);
}

body[data-theme="space"] {
  --bg: linear-gradient(160deg, #020010 0%, #0a0020 40%, #050018 100%);
  --card-bg: rgba(120,80,255,0.07);
  --card-hover: rgba(120,80,255,0.14);
  --card-border: rgba(120,80,255,0.15);
  --text: #e8e0ff;
  --subtext: rgba(180,160,255,0.72);
  --shadow: 0 8px 32px rgba(60,0,160,0.4);
  --avatar-border: rgba(140,100,255,0.5);
}

body[data-theme="peach"] {
  --bg: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  --card-bg: rgba(255,255,255,0.6);
  --card-hover: rgba(255,255,255,0.8);
  --card-border: rgba(255,160,60,0.25);
  --text: #4a2000;
  --subtext: rgba(100,50,0,0.65);
  --shadow: 0 8px 32px rgba(255,140,40,0.15);
  --avatar-border: rgba(255,160,60,0.45);
}

body[data-theme="cobalt"] {
  --bg: linear-gradient(135deg, #000428 0%, #004e92 100%);
  --card-bg: rgba(0,100,200,0.12);
  --card-hover: rgba(0,100,200,0.2);
  --card-border: rgba(0,120,220,0.22);
  --text: #ffffff;
  --subtext: rgba(140,200,255,0.78);
  --shadow: 0 8px 32px rgba(0,60,160,0.5);
  --avatar-border: rgba(80,160,255,0.55);
}

body[data-theme="jungle"] {
  --bg: linear-gradient(135deg, #020d06 0%, #0a2010 50%, #0f3018 100%);
  --card-bg: rgba(30,160,60,0.08);
  --card-hover: rgba(30,160,60,0.15);
  --card-border: rgba(30,150,60,0.18);
  --text: #d4f5d4;
  --subtext: rgba(130,220,140,0.72);
  --shadow: 0 8px 32px rgba(0,60,20,0.6);
  --avatar-border: rgba(40,180,70,0.5);
}

body[data-theme="lava"] {
  --bg: linear-gradient(160deg, #0a0000 0%, #200000 40%, #1a0400 100%);
  --card-bg: rgba(200,30,0,0.08);
  --card-hover: rgba(200,30,0,0.15);
  --card-border: rgba(180,30,0,0.2);
  --text: #ff8a65;
  --subtext: rgba(255,120,80,0.75);
  --shadow: 0 8px 32px rgba(160,0,0,0.5);
  --avatar-border: rgba(220,60,20,0.55);
}

/* Background image on public profile */
.profile-page.has-bg-image {
  position: relative;
  background-size: cover !important;
  background-position: center center !important;
  background-attachment: scroll !important;
}

.profile-bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 0;
  pointer-events: none;
}

.profile-page.has-bg-image .profile-container {
  position: relative;
  z-index: 1;
}

/* ============================================
   PROFILE PAGE
   ============================================ */

.profile-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 80px;
}

.profile-container {
  width: 100%;
  max-width: 480px;
}

/* Avatar */
.avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--avatar-border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.avatar-initials {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 3px solid var(--avatar-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 700;
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.profile-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.profile-username {
  font-size: 14px;
  color: var(--subtext);
  text-align: center;
  margin-bottom: 10px;
}

.profile-bio {
  font-size: 15px;
  color: var(--subtext);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* Links */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 15px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.link-item:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.link-item:active {
  transform: translateY(0);
}

.link-icon {
  font-size: 20px;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}

.link-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-arrow {
  font-size: 16px;
  opacity: 0.5;
  flex-shrink: 0;
}

/* Section headings inside link list (public profile) */
.link-heading {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtext);
  padding: 18px 4px 6px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 4px;
}

/* vCard */
.vcard-section {
  margin-top: 20px;
}

.vcard-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255,255,255,0.92);
  color: #333;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.vcard-btn:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* QR Code */
.qr-section {
  margin-top: 12px;
  width: 100%;
}

.qr-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 15px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  font-family: inherit;
}

.qr-toggle-btn:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.qr-toggle-btn:active {
  transform: translateY(0);
}

.qr-toggle-btn:focus-visible {
  outline: 2px solid #2969b5;
  outline-offset: 2px;
}

/* QR modal */
.qr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.qr-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.qr-modal-sheet {
  width: 100%;
  max-width: 280px;
  background: #16161e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 20px;
  transform: scale(0.93) translateY(10px);
  opacity: 0;
  transition: transform 0.24s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.qr-modal-overlay.open .qr-modal-sheet {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.qr-modal-handle {
  display: none;
}

.qr-modal-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qr-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #e4e4f0;
}

.qr-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #a0a0c0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s;
}

.qr-modal-close:hover { background: rgba(255,255,255,0.2); }

.qr-modal-close:focus-visible {
  outline: 2px solid #2969b5;
  outline-offset: 2px;
}

.qr-canvas-wrap {
  background: #ffffff;
  padding: 10px;
  border-radius: 10px;
  line-height: 0;
}

.qr-modal-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.qr-modal-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: #e4e4f0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.qr-modal-btn:hover { background: rgba(255,255,255,0.15); }

.qr-modal-btn:focus-visible {
  outline: 2px solid #2969b5;
  outline-offset: 2px;
}

/* Footer CTA */
.profile-footer-cta {
  margin-top: 48px;
  text-align: center;
}

.profile-cta-card {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg, rgba(255,255,255,0.1));
  border: 1px solid var(--card-border, rgba(255,255,255,0.2));
  border-radius: 16px;
  padding: 14px 20px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.profile-cta-card:hover {
  background: var(--card-hover, rgba(255,255,255,0.18));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.profile-cta-logo {
  height: 48px;
  width: auto;
  border-radius: 6px;
  flex-shrink: 0;
}

.profile-cta-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.profile-cta-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text, #fff);
  letter-spacing: -0.02em;
  line-height: 1;
}

.profile-cta-accent {
  color: #2969b5;
}

.profile-cta-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--subtext, rgba(255,255,255,0.7));
}

/* 404 / Error state */
.not-found {
  text-align: center;
  padding: 60px 20px;
}

.not-found h1 {
  font-size: 80px;
  margin-bottom: 12px;
  color: var(--text);
}

.not-found p {
  color: var(--subtext);
  font-size: 16px;
  margin-bottom: 24px;
}

/* ============================================
   CREATE PAGE
   ============================================ */

.create-page {
  min-height: 100vh;
  background: #0d0d14;
  color: #e4e4f0;
}

/* Top bar */
.create-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,20,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #1e1e2e;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.create-topbar .logo {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.btn-secondary {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
  border: 1px solid #2a2a3a;
  background: transparent;
  transition: all 0.18s;
}

.btn-secondary:hover {
  color: #e4e4f0;
  border-color: #4a4a6a;
}

.btn-primary {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border: none;
  transition: all 0.18s;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Layout */
.create-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: calc(100vh - 56px);
}

@media (min-width: 900px) {
  .create-layout { grid-template-columns: 1fr 380px; }
}

/* Form panel */
.form-panel {
  padding: 24px 16px 80px;
  overflow-y: auto;
  border-right: 1px solid #1e1e2e;
}

@media (min-width: 600px) {
  .form-panel { padding: 32px 32px 80px; }
}

/* Preview panel — hidden on mobile, shown on desktop */
.preview-panel {
  display: none;
}

@media (min-width: 900px) {
  .preview-panel { display: flex; }
}

.form-section {
  margin-bottom: 36px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: #16161e;
  border: 1px solid #2a2a3a;
  color: #e4e4f0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.form-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-input::placeholder {
  color: #7a7a95;
}

.input-label {
  display: block;
  font-size: 13px;
  color: #8b8ba0;
  margin-bottom: 8px;
}

.theme-dropdown {
  width: 100%;
  background: #16161e;
  border: 1px solid #2a2a3a;
  color: #e4e4f0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.18s;
}

.theme-dropdown:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.theme-dropdown optgroup {
  color: #8b8ba0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.theme-dropdown option {
  background: #16161e;
  color: #e4e4f0;
  font-size: 14px;
  padding: 6px 0;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.char-count {
  font-size: 12px;
  color: #7a7a95;
  text-align: right;
  margin-top: 4px;
}

/* Username row */
.username-row {
  display: flex;
  align-items: center;
  gap: 0;
  background: #16161e;
  border: 1px solid #2a2a3a;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.username-row:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.username-prefix {
  padding: 10px 8px;
  font-size: 11px;
  color: #6366f1;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(99,102,241,0.08);
  border-right: 1px solid #2a2a3a;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .username-prefix {
    padding: 10px 12px;
    font-size: 13px;
  }
}

.username-row input {
  flex: 1;
  background: transparent;
  border: none;
  color: #e4e4f0;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
}

.username-row input:focus {
  outline: none;
}

/* Theme picker */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.theme-option {
  position: relative;
  cursor: pointer;
}

.theme-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-swatch {
  border-radius: 10px;
  height: 52px;
  border: 2px solid transparent;
  transition: all 0.18s;
  display: flex;
  align-items: flex-end;
  padding: 6px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  overflow: hidden;
}

.theme-option input:checked + .theme-swatch {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.3);
}

.swatch-gradient { background: linear-gradient(135deg, #667eea, #764ba2); }
.swatch-ocean    { background: linear-gradient(135deg, #1a1a2e, #0f3460); }
.swatch-sunset   { background: linear-gradient(135deg, #f093fb, #f5576c); }
.swatch-forest   { background: linear-gradient(135deg, #134e5e, #71b280); }

.swatch-midnight {
  background: #0a0a0f;
  border: 2px solid #2a2a38;
}

.swatch-minimal {
  background: linear-gradient(135deg, #f4f5f7, #e2e5ea);
  color: rgba(0,0,0,0.5);
  text-shadow: none;
}

.swatch-rose {
  background: linear-gradient(135deg, #ffecd2, #fcb69f);
  color: rgba(74,32,64,0.8);
  text-shadow: none;
}

.swatch-crimson {
  background: linear-gradient(135deg, #7b0000, #dc2626);
  border: 1px solid rgba(220,38,38,0.5);
}

/* Links section */
.links-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-editor-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #16161e;
  border: 1px solid #2a2a3a;
  border-radius: 12px;
  padding: 10px 12px;
  transition: border-color 0.18s, opacity 0.15s;
}

.link-style-bar {
  flex-basis: 100%;
  display: none;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-wrap: wrap;
}

.style-toggle-btn {
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid rgba(255,255,255,0.08);
  background: none;
  color: #6b7280;
  transition: all 0.12s;
  flex-shrink: 0;
  line-height: 1;
}
.style-toggle-btn:hover {
  background: rgba(99,102,241,0.1);
  color: #818cf8;
  border-color: rgba(99,102,241,0.3);
}

.drag-handle {
  cursor: grab;
  color: rgba(139,139,170,0.35);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  user-select: none;
  flex-shrink: 0;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }

.link-editor-item.dragging { opacity: 0.3; }
.link-editor-item.drag-over-top    { border-top: 2px solid #6366f1; }
.link-editor-item.drag-over-bottom { border-bottom: 2px solid #6366f1; }

.link-editor-item:hover {
  border-color: #3a3a5a;
}

.link-editor-item .icon-picker-btn {
  background: #1e1e2e;
  border: 1px solid #2a2a3a;
  color: #e4e4f0;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  width: 50px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}

.link-editor-item .icon-picker-btn:hover { border-color: #6366f1; color: #818cf8; }
.link-editor-item .icon-picker-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }

/* Icon picker popup (create page) */
.create-icon-picker {
  display: none;
  position: absolute;
  background: #16161e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px;
  z-index: 400;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.create-icon-picker .icon-picker-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 4px; }
.create-icon-picker .icon-opt {
  background: none;
  border: 1px solid transparent;
  color: #9ca3af;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  font-family: inherit;
}
.create-icon-picker .icon-opt:hover { background: rgba(99,102,241,0.15); color: #fff; border-color: rgba(99,102,241,0.3); }
.create-icon-picker .icon-opt.selected { background: rgba(99,102,241,0.2); color: #818cf8; border-color: rgba(99,102,241,0.5); }

.link-editor-item .link-label-input,
.link-editor-item .link-url-input {
  background: transparent;
  border: none;
  color: #e4e4f0;
  font-size: 13px;
  padding: 4px 0;
  min-width: 0;
}

.link-editor-item .link-label-input:focus,
.link-editor-item .link-url-input:focus {
  outline: none;
}

.link-editor-item .link-label-input {
  width: 110px;
  flex-shrink: 0;
  font-weight: 600;
  border-right: 1px solid #2a2a3a;
  padding-right: 10px;
  margin-right: 4px;
}

.link-editor-item .link-url-input {
  flex: 1;
  color: #8b8baa;
}

.delete-link-btn {
  color: #4a4a6a;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.18s, background 0.18s;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}

.delete-link-btn:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.1);
}

.add-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px dashed #2a2a3a;
  color: #6366f1;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.18s;
  background: transparent;
  margin-top: 4px;
}

.add-link-btn:hover {
  border-color: #6366f1;
  background: rgba(99,102,241,0.06);
}

.add-heading-btn {
  border-color: rgba(139,139,170,0.3);
  color: #8b8baa;
}

.add-heading-btn:hover {
  border-color: #8b8baa;
  background: rgba(139,139,170,0.06);
}

/* Heading-type link in editor */
.link-editor-heading {
  background: rgba(139,139,170,0.06);
  border-color: rgba(139,139,170,0.25);
}

.link-editor-heading .link-label-input {
  flex: 1;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b8baa;
}

.heading-tag {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(139,139,170,0.15);
  color: #8b8baa;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 2px;
}

/* Heading in phone preview */
.mini-heading {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 4px 3px;
  border-bottom: 1px solid;
  margin-bottom: 2px;
  opacity: 0.7;
}

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #1e1e2e;
  margin-bottom: 16px;
}

.toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: #e4e4f0;
}

.toggle-desc {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #2a2a3a;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: #6366f1;
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.vcard-fields {
  display: none;
}

.vcard-fields.visible {
  display: block;
}

.qr-fields {
  display: none;
}

.qr-fields.visible {
  display: block;
}

/* ---- CREATE PAGE — LIGHT MODE ---- */
[data-theme="light"] .create-page {
  background: #eef1f8;
  color: #1a1a2e;
}
[data-theme="light"] .create-topbar {
  background: rgba(255,255,255,0.97);
  border-color: rgba(0,0,0,0.09);
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
}
[data-theme="light"] .form-panel {
  border-color: rgba(0,0,0,0.09);
}
[data-theme="light"] .form-section {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.05);
}
[data-theme="light"] .form-label,
[data-theme="light"] .input-label {
  color: #3d4f70;
}
[data-theme="light"] .form-input,
[data-theme="light"] .theme-dropdown {
  background: #f4f7fc;
  border-color: #b8c8da;
  color: #1a1a2e;
}
[data-theme="light"] .form-input:focus,
[data-theme="light"] .theme-dropdown:focus {
  background: #ffffff;
  border-color: #6366f1;
}
[data-theme="light"] .form-input::placeholder { color: #94a3b8; }
[data-theme="light"] .theme-dropdown optgroup { color: #546080; }
[data-theme="light"] .theme-dropdown option {
  background: #ffffff;
  color: #1a1a2e;
}
[data-theme="light"] .char-count { color: #94a3b8; }
[data-theme="light"] .username-row {
  background: #f4f7fc;
  border-color: #b8c8da;
}
[data-theme="light"] .username-prefix {
  background: rgba(99,102,241,0.07);
  border-color: #b8c8da;
}
[data-theme="light"] .username-row input { color: #1a1a2e; }
[data-theme="light"] .btn-secondary {
  color: #3d4f70;
  border-color: #b8c8da;
  background: #f4f7fc;
}
[data-theme="light"] .btn-secondary:hover {
  color: #1a1a2e;
  border-color: #7a9ac0;
  background: #eef1f8;
}
[data-theme="light"] .section-title { color: #4f52c8; }
[data-theme="light"] .link-editor-item {
  background: #f4f7fc;
  border-color: #b8c8da;
}
[data-theme="light"] .link-editor-item:hover { border-color: #7a9ac0; }
[data-theme="light"] .link-editor-item .icon-picker-btn {
  background: #eef1f8;
  border-color: #b8c8da;
  color: #1a1a2e;
}
[data-theme="light"] .link-editor-item .link-label-input,
[data-theme="light"] .link-editor-item .link-url-input { color: #1a1a2e; }
[data-theme="light"] .link-editor-item .link-label-input { border-color: #b8c8da; }
[data-theme="light"] .link-editor-item .link-url-input { color: #546080; }
[data-theme="light"] .link-style-bar { border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .style-toggle-btn {
  border-color: #b8c8da;
  color: #546080;
}
[data-theme="light"] .delete-link-btn { color: #94a3b8; }
[data-theme="light"] .add-link-btn { border-color: #b8c8da; }
[data-theme="light"] .link-editor-heading {
  background: rgba(0,0,0,0.03);
  border-color: #b8c8da;
}
[data-theme="light"] .link-editor-heading .link-label-input { color: #546080; }
[data-theme="light"] .heading-tag {
  background: rgba(0,0,0,0.07);
  color: #546080;
}
[data-theme="light"] .add-heading-btn {
  border-color: #b8c8da;
  color: #546080;
}
[data-theme="light"] .toggle-row { border-color: #b8c8da; }
[data-theme="light"] .toggle-label { color: #1a1a2e; }
[data-theme="light"] .toggle-desc { color: #546080; }
[data-theme="light"] .toggle-slider { background: #b8c8da; }
[data-theme="light"] .avatar-drop-zone { border-color: #b8c8da; }
[data-theme="light"] .drop-text { color: #546080; }
[data-theme="light"] .avatar-preview-img {
  background: #e0e8f4;
  border-color: #b8c8da;
}
[data-theme="light"] .preview-panel { background: #dde4f0; }
[data-theme="light"] .preview-label { color: #546080; }
[data-theme="light"] .phone-frame {
  background: #c8d2e0;
  border-color: #b0bccf;
  box-shadow: 0 0 0 1px #a0afc4, 0 30px 80px rgba(0,0,0,0.16), inset 0 0 0 1px rgba(255,255,255,0.5);
}
[data-theme="light"] .phone-notch {
  background: #c8d2e0;
  box-shadow: 0 2px 0 #b0bccf;
}
[data-theme="light"] .share-url-row {
  background: rgba(0,0,0,0.06);
  border-radius: 10px;
  padding: 4px 10px;
}
[data-theme="light"] .share-url-text { color: #3d4f70; }
[data-theme="light"] .copy-url-btn {
  background: #ffffff;
  border-color: #b8c8da;
  color: #1a1a2e;
}
[data-theme="light"] .copy-url-btn:hover {
  background: #f4f7fc;
  color: #1a1a2e;
}
[data-theme="light"] .toast {
  background: #ffffff;
  border-color: #b8c8da;
  color: #1a1a2e;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
[data-theme="light"] .crop-modal-inner {
  background: #ffffff;
  border-color: #b8c8da;
}
[data-theme="light"] .crop-modal-header h3 { color: #1a1a2e; }
[data-theme="light"] .crop-close { color: #546080; }
[data-theme="light"] .crop-close:hover { color: #1a1a2e; }
[data-theme="light"] .crop-hint { color: #94a3b8; }
[data-theme="light"] .crop-stage { background: #dde4f0; }
[data-theme="light"] .create-icon-picker {
  background: #ffffff;
  border-color: #b8c8da;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
[data-theme="light"] .create-icon-picker .icon-opt { color: #3d4f70; }

/* ---- CROP MODAL ---- */
.crop-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 600;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.crop-modal.open { display: flex; }

.crop-modal-inner {
  background: #0e0e18;
  border: 1px solid #2a2a3a;
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
}

.crop-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.crop-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #e4e4f0;
}
.crop-close {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.18s;
}
.crop-close:hover { color: #e4e4f0; }

.crop-hint {
  font-size: 12px;
  color: #7a7a95;
  margin-bottom: 14px;
}

.crop-stage {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 12px;
  overflow: hidden;
  background: #080810;
}

#crop-canvas {
  display: block;
  cursor: grab;
  touch-action: none;
}
#crop-canvas.grabbing { cursor: grabbing; }

.crop-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 14px;
}
.crop-controls input[type="range"] {
  flex: 1;
  accent-color: #6366f1;
  cursor: pointer;
}

.crop-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Avatar drop zone */
.avatar-drop-zone {
  border: 2px dashed #2a2a3a;
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
}
.avatar-drop-zone:hover,
.avatar-drop-zone:focus,
.avatar-drop-zone.drag-over {
  border-color: #6366f1;
  background: rgba(99,102,241,0.06);
  outline: none;
}
.avatar-drop-zone:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}
.avatar-drop-zone.drag-over {
  border-style: solid;
}
.drop-icon { font-size: 16px; flex-shrink: 0; }
.drop-text { font-size: 13px; color: #6b7280; }
.drop-browse { color: #6366f1; font-weight: 600; text-decoration: underline; }
.drop-success { font-size: 13px; color: #4ade80; font-weight: 600; }

/* Avatar preview */
.avatar-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.avatar-preview-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e1e2e;
  border: 2px solid #2a2a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #6366f1;
  flex-shrink: 0;
  overflow: hidden;
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e1e2e;
  border: 1px solid #2a2a3a;
  color: #e4e4f0;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: #22c55e;
  color: #4ade80;
}

.toast.error {
  border-color: #ef4444;
  color: #f87171;
}

/* Preview panel */
.preview-panel {
  background: #080810;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.preview-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a7a95;
  font-weight: 700;
  margin-bottom: 24px;
}

/* Phone frame */
.phone-frame {
  width: 260px;
  height: 520px;
  background: #111118;
  border-radius: 36px;
  border: 6px solid #1e1e28;
  box-shadow:
    0 0 0 1px #2a2a38,
    0 30px 80px rgba(0,0,0,0.8),
    inset 0 0 0 1px rgba(255,255,255,0.03);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #111118;
  border-radius: 0 0 16px 16px;
  z-index: 10;
  box-shadow: 0 2px 0 #1e1e28;
}

.phone-screen {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 14px 20px;
  scrollbar-width: none;
}

.phone-screen::-webkit-scrollbar {
  display: none;
}

/* Mini profile inside phone */
.mini-profile {
  text-align: center;
}

.mini-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.mini-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--card-bg, rgba(255,255,255,0.15));
  border: 2px solid var(--avatar-border, rgba(255,255,255,0.4));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #fff);
}

.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.mini-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text, #fff);
  margin-bottom: 3px;
}

.mini-bio {
  font-size: 10px;
  color: var(--subtext, rgba(255,255,255,0.7));
  margin-bottom: 14px;
  line-height: 1.4;
}

.mini-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg, rgba(255,255,255,0.15));
  border: 1px solid var(--card-border, rgba(255,255,255,0.2));
  color: var(--text, #fff);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  text-align: left;
}

.mini-link-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.mini-link-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-url-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #111118;
  border: 1px solid #1e1e28;
  border-radius: 10px;
  padding: 8px 12px;
  width: 260px;
}

.share-url-text {
  flex: 1;
  font-size: 12px;
  color: #6366f1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-url-btn {
  font-size: 12px;
  font-weight: 700;
  color: #9ca3af;
  padding: 4px 8px;
  border-radius: 6px;
  background: #1e1e2e;
  transition: all 0.18s;
  flex-shrink: 0;
}

.copy-url-btn:hover {
  color: #e4e4f0;
  background: #2a2a3a;
}
