/* ═══════════════ Open My Links · design system v3 · dark refined ═══════════════ */

:root {
  color-scheme: dark;
  --bg: var(--tg-theme-bg-color, #07070b);
  --bg2: var(--tg-theme-secondary-bg-color, #0e0e16);
  --surface0: #0a0a11;
  --surface1: #13131c;
  --surface2: #1a1a26;
  --surface3: #232332;
  --surface4: #2e2e40;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.07);
  --line2: rgba(255, 255, 255, 0.12);
  --line3: rgba(255, 255, 255, 0.2);
  --text: var(--tg-theme-text-color, #f4f4f8);
  --hint: var(--tg-theme-hint-color, #9a9aab);
  --muted: #6d6d7d;
  --accent: var(--tg-theme-button-color, #6d5ce7);
  --accent2: #8b7cf6;
  --accent3: #b28af2;
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --accent-grad: linear-gradient(135deg, #6d5ce7, #8b7cf6 55%, #b28af2);
  --accent-glow: color-mix(in srgb, var(--accent) 55%, transparent);
  --danger: #ff5c73;
  --danger-soft: rgba(255, 92, 115, 0.12);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.12);
  --warn: #f5b84c;
  --gold: #f5b84c;
  --radius: 18px;
  --radius-s: 13px;
  --radius-xs: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 26px -10px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 18px 46px -14px rgba(0, 0, 0, 0.65);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background:
    radial-gradient(130% 85% at 50% -12%, rgba(109, 92, 231, 0.1), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh; min-height: 100dvh;
  line-height: 1.5;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: 0.1px;
}

/* ── Ambient noise + vignette ── */

body::before {
  content: "";
  position: fixed; inset: 0; z-index: 2000; pointer-events: none;
  opacity: 0.022; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
body.app-mode #app { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); }
body.view-mode #app { padding-bottom: 0; }

/* ─── Icon base ─── */

.ic { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ═══ Layout ═══ */

.screen {
  padding: calc(12px + var(--safe-top)) 14px calc(18px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 12px;
}
.screen > * { animation: rise 0.32s cubic-bezier(.2,.7,.3,1) both; }
.screen > *:nth-child(1){ animation-delay: .02s; }
.screen > *:nth-child(2){ animation-delay: .06s; }
.screen > *:nth-child(3){ animation-delay: .10s; }
.screen > *:nth-child(4){ animation-delay: .14s; }
.screen > *:nth-child(5){ animation-delay: .18s; }
.screen > *:nth-child(6){ animation-delay: .22s; }

/* ═══ Tab bar ═══ */

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  max-width: 480px; margin: 0 auto;
  display: flex; padding: 8px 12px calc(7px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg2) 82%, transparent);
  backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-top: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}
.tabbar .tab {
  flex: 1; border: none; background: transparent; color: var(--hint);
  font-size: 10px; font-weight: 600; font-family: inherit;
  padding: 5px 0 4px; border-radius: 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: color 0.2s ease;
  position: relative;
}
.tabbar .tab .ti { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 26px; border-radius: 10px; transition: transform 0.18s cubic-bezier(.2,.8,.3,1.4), color 0.2s ease, background 0.2s ease; }
.tabbar .tab .ti .ic { color: inherit; }
.tabbar .tab .tl { transition: opacity 0.2s ease; }
.tabbar .tab:active .ti { transform: scale(0.9); }
.tabbar .tab.active { color: var(--accent2); }
.tabbar .tab.active .ti { background: color-mix(in srgb, var(--accent) 18%, transparent); color: #cfc5ff; transform: translateY(-1px); }
.tabbar .tab.active .tl { color: var(--text); font-weight: 700; }
.tabbar .tab.active::after {
  content: ""; width: 16px; height: 3px; border-radius: 999px; margin-top: 1px;
  background: var(--accent-grad); box-shadow: 0 0 10px var(--accent-glow);
}

/* ═══ Cards ═══ */

.card {
  border-radius: var(--radius);
  padding: 16px;
  background:
    linear-gradient(var(--surface1), var(--surface1)) padding-box,
    linear-gradient(170deg, rgba(255,255,255,0.16), rgba(255,255,255,0.03) 40%, rgba(255,255,255,0.07)) border-box;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.card h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--hint); margin-bottom: 10px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.card-title-row h3 { margin-bottom: 0; }

.grad-text {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ═══ Buttons ═══ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 18px; border-radius: 14px; border: none;
  background: var(--accent-grad); color: var(--accent-text);
  font-size: 14px; font-weight: 650; font-family: inherit; cursor: pointer;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 10px 28px -12px var(--accent-glow);
  transition: transform 0.1s ease, box-shadow 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}
.btn:active { transform: scale(0.955); filter: brightness(1.08); }
.btn .ic { color: inherit; }
.btn.ghost {
  background: linear-gradient(var(--surface2), var(--surface2)) padding-box, linear-gradient(170deg, rgba(255,255,255,0.14), rgba(255,255,255,0.02) 45%) border-box;
  border: 1px solid transparent;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), var(--shadow-sm);
}
.btn.soft {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: color-mix(in srgb, var(--accent) 55%, #fff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn.success { background: linear-gradient(135deg, #0f9d5f, #22c55e); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 10px 26px -12px rgba(34,197,94,0.55); }
.btn.danger { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); }
.btn.small { padding: 9px 13px; font-size: 12px; border-radius: 11px; gap: 5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: default; pointer-events: none; box-shadow: none; }

.spin {
  display: inline-block; width: 14px; height: 14px; flex-shrink: 0;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}

/* ═══ Segmented ═══ */

.seg {
  display: flex; gap: 4px; padding: 4px;
  background:
    linear-gradient(var(--surface1), var(--surface1)) padding-box,
    linear-gradient(170deg, rgba(255,255,255,0.14), rgba(255,255,255,0.03) 50%) border-box;
  border: 1px solid transparent;
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}
.seg .btn {
  flex: 1; padding: 10px 6px; font-size: 12.5px; font-weight: 650; border-radius: 11px;
  background: transparent; color: var(--hint); box-shadow: none; gap: 6px;
}
.seg .btn .ic { color: var(--hint); }
.seg .btn.active {
  background: linear-gradient(180deg, var(--surface3), var(--surface2));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 3px 10px rgba(0,0,0,0.35);
}
.seg .btn.active .ic { color: var(--accent2); }

/* ═══ Fields ═══ */

label.field { display: block; margin-bottom: 14px; }
label.field:last-child { margin-bottom: 0; }
label.field .lbl { display: block; font-size: 11px; font-weight: 600; color: var(--hint); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.7px; }
input[type=text], input[type=url], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--surface1); color: var(--text);
  border: 1px solid var(--line2);
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 76px; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent), var(--shadow-sm);
}
input::placeholder, textarea::placeholder { color: var(--hint); opacity: 0.65; }
select { appearance: none; -webkit-appearance: none; background-image: none; }
.counter { display: block; text-align: right; font-size: 10px; color: var(--hint); margin-top: 4px; font-weight: 600; }
.counter.full { color: var(--danger); }

/* ═══ Stats & badges ═══ */

.stat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.stat-pill .ic { color: var(--accent2); }
.stat-pill.vip { background: linear-gradient(90deg, rgba(245,184,76,0.16), rgba(245,184,76,0.08)); border-color: rgba(245,184,76,0.32); color: var(--gold); }

.vip-badge, .badge-active {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 750;
  letter-spacing: 0.6px; text-transform: uppercase;
  background: linear-gradient(90deg, #f59e0b, #fbbf24); color: #3b2300;
  box-shadow: 0 4px 16px -4px rgba(245,158,11,0.5);
}
.vip-badge .ic, .badge-active .ic { color: inherit; }
.badge-sale { font-size: 9.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(234,179,8,0.13); color: var(--warn); border: 1px solid rgba(234,179,8,0.2); }

/* ═══ Home ═══ */

.home-hero {
  position: relative;
  margin: calc(-12px - var(--safe-top)) -14px 0;
  padding: calc(24px + var(--safe-top)) 18px 20px;
  border-radius: 0 0 30px 30px;
  overflow: hidden;
  background:
    radial-gradient(130% 100% at 85% -15%, color-mix(in srgb, var(--accent) 52%, transparent), transparent 55%),
    radial-gradient(120% 90% at -5% 15%, color-mix(in srgb, var(--accent2) 32%, transparent), transparent 52%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 20%, var(--bg)), var(--surface0));
  border-bottom: 1px solid var(--line);
}
.home-hero::after {
  content: ""; position: absolute; inset: auto -20% -70px -20%; height: 130px;
  background: radial-gradient(50% 100% at 50% 0%, var(--accent-glow), transparent);
  filter: blur(14px); pointer-events: none;
  animation: floaty 6s ease-in-out infinite;
}
.hh-top { display: flex; align-items: center; gap: 12px; position: relative; }
.hh-avatar {
  width: 54px; height: 54px; border-radius: 17px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  background:
    linear-gradient(var(--surface2), var(--surface2)) padding-box,
    linear-gradient(150deg, color-mix(in srgb, var(--accent) 70%, transparent), transparent 55%) border-box;
  border: 1px solid transparent;
  overflow: hidden;
  box-shadow: 0 10px 26px -10px rgba(0,0,0,0.6);
}
.hh-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hh-id { flex: 1; min-width: 0; }
.hh-nick { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 7px; letter-spacing: -0.2px; }
.hh-name { color: var(--hint); font-size: 12.5px; margin-top: 2px; }
.hh-bal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 999px; flex-shrink: 0;
  background: rgba(0,0,0,0.28); border: 1px solid var(--line2);
  color: var(--gold); font-size: 12.5px; font-weight: 800; cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.1s ease;
}
.hh-bal .ic { color: var(--gold); }
.hh-bal:active { transform: scale(0.94); }
.hh-bio { margin-top: 12px; font-size: 12.5px; color: var(--hint); white-space: pre-wrap; position: relative; }
.hh-stats { display: flex; gap: 7px; margin-top: 14px; flex-wrap: wrap; position: relative; }

/* ═══ VIP upsell banner ═══ */

.upsell {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 15px; border-radius: 16px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(245,184,76,0.16), transparent 55%),
    linear-gradient(var(--surface1), var(--surface0));
  border: 1px solid rgba(245,184,76,0.28);
  box-shadow: var(--shadow);
}
.upsell-icon {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #3b2300;
  box-shadow: 0 8px 22px -6px rgba(245,158,11,0.55);
}
.upsell-body { flex: 1; min-width: 0; }
.upsell-title { font-size: 13.5px; font-weight: 800; }
.upsell-sub { font-size: 11.5px; color: var(--hint); margin-top: 2px; }
.upsell .btn { flex-shrink: 0; }

/* ═══ Actions ═══ */

.action-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border-radius: 15px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface1), var(--surface0)); color: var(--text); cursor: pointer;
  font-size: 11px; font-weight: 650; font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.action-btn .ai {
  width: 34px; height: 34px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent2);
}
.action-btn .ai .ic { color: inherit; }
.action-btn:active { transform: scale(0.94); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.action-btn:active .ai { background: color-mix(in srgb, var(--accent) 28%, transparent); }

/* ═══ Link plain ═══ */

.link-plain {
  font-size: 12px; color: var(--hint); word-break: break-all;
  padding: 10px 12px; border-radius: 11px; background: var(--surface0);
  border: 1px solid var(--line); margin-bottom: 10px;
}

/* ═══ Shop ═══ */

.shop-tabs { position: sticky; top: calc(6px + var(--safe-top)); z-index: 15; }

.card-sub { font-size: 12px; color: var(--hint); margin: -4px 0 14px; }
.ct-left { min-width: 0; }
.ct-left h3 { margin-bottom: 0; }
.ct-left .card-sub { margin: 2px 0 0; }

.free-note {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 14px; padding: 8px 14px; border-radius: 999px;
  background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
  color: var(--ok); font-size: 12px; font-weight: 700;
}

.nick-input-wrap { display: flex; align-items: center; gap: 6px; }
.nick-prefix { font-size: 18px; font-weight: 700; color: var(--hint); padding-left: 4px; }
.nick-input-wrap input {
  flex: 1; letter-spacing: 0.3px;
  padding: 14px 15px; font-size: 16px; font-weight: 650; border-radius: 13px;
  background: var(--surface0);
}

.price-hint {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding: 12px 2px 2px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--hint);
}
.price-hint .ph-value { font-size: 18px; font-weight: 800; color: var(--warn); display: inline-flex; align-items: center; gap: 5px; }

.btn-row { display: flex; gap: 8px; margin-top: 14px; }

.pricing-table { display: flex; flex-direction: column; }
.price-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 2px; border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 500;
}
.price-row:last-child { border-bottom: none; }
.price-row .pr-stars { font-weight: 750; color: var(--warn); display: inline-flex; align-items: center; gap: 5px; }

/* ═══ Marketplace ═══ */

.listing {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 2px; border-bottom: 1px solid var(--line);
}
.listing:last-child { border-bottom: none; }
.listing-av {
  width: 48px; height: 48px; border-radius: 15px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background:
    linear-gradient(var(--surface2), var(--surface2)) padding-box,
    linear-gradient(150deg, rgba(255,255,255,0.14), transparent 55%) border-box;
  border: 1px solid transparent;
}
.listing-body { flex: 1; min-width: 0; }
.listing-nick { font-weight: 800; font-size: 14.5px; letter-spacing: -0.1px; }
.listing-meta { font-size: 11px; color: var(--hint); margin-top: 3px; display: flex; gap: 9px; align-items: center; }
.listing-meta .ic { color: var(--muted); }
.listing-price { font-size: 12px; font-weight: 700; color: var(--warn); flex-shrink: 0; }

.empty { text-align: center; color: var(--hint); font-size: 12.5px; padding: 22px 12px; }
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; }

.empty-card {
  padding: 14px; border-radius: 13px; font-size: 12px; margin-bottom: 10px;
  background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 24%, transparent);
  color: var(--ok);
}

/* ═══ Account ═══ */

.wallet-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 18px; border-radius: 20px;
  background:
    radial-gradient(130% 140% at 100% 0%, rgba(245,184,76,0.16), transparent 55%),
    radial-gradient(100% 120% at 0% 100%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 55%),
    linear-gradient(var(--surface1), var(--surface0));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.wallet-icon {
  width: 50px; height: 50px; border-radius: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--warn), #f59e0b);
  color: #3b2300;
  box-shadow: 0 10px 26px -8px rgba(234,179,8,0.55);
}
.wallet-bal { font-size: 25px; font-weight: 800; letter-spacing: -0.5px; display: flex; align-items: center; gap: 7px; }
.wallet-label { font-size: 11px; color: var(--hint); font-weight: 500; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat-box {
  padding: 14px; border-radius: 15px;
  background:
    linear-gradient(var(--surface1), var(--surface0)) padding-box,
    linear-gradient(160deg, rgba(255,255,255,0.12), transparent 50%) border-box;
  border: 1px solid transparent;
  text-align: center; box-shadow: var(--shadow-sm);
}
.stat-box .sb-num { font-size: 20px; font-weight: 800; }
.stat-box .sb-label { font-size: 10.5px; color: var(--hint); font-weight: 550; margin-top: 3px; }

.nick-item {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 2px; border-bottom: 1px solid var(--line);
}
.nick-item:last-child { border-bottom: none; }
.nick-item .ni-av {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background:
    linear-gradient(var(--surface2), var(--surface2)) padding-box,
    linear-gradient(150deg, rgba(255,255,255,0.13), transparent 55%) border-box;
  border: 1px solid transparent;
}
.nick-item .ni-body { flex: 1; min-width: 0; }
.nick-item .ni-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nick-item .ni-meta { font-size: 11px; color: var(--hint); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.nick-item .ni-meta .ic { color: var(--muted); }
.nick-item.active .ni-name { color: var(--ok); }

/* ═══ VIP screen ═══ */

.vip-hero {
  position: relative; overflow: hidden;
  text-align: center;
  margin: calc(-12px - var(--safe-top)) -14px 0;
  padding: calc(32px + var(--safe-top)) 18px 24px;
  border-radius: 0 0 30px 30px;
  background:
    radial-gradient(130% 100% at 50% -25%, rgba(245,184,76,0.3), transparent 55%),
    radial-gradient(100% 90% at 88% 20%, rgba(141,100,245,0.32), transparent 55%),
    radial-gradient(100% 90% at 5% 30%, rgba(139,92,246,0.16), transparent 55%),
    linear-gradient(180deg, #241a06, var(--surface0));
  border-bottom: 1px solid rgba(245,184,76,0.2);
}
.vip-hero.is-vip {
  background:
    radial-gradient(130% 100% at 50% -25%, color-mix(in srgb, var(--ok) 38%, transparent), transparent 55%),
    radial-gradient(100% 90% at 85% 20%, rgba(245,184,76,0.2), transparent 55%),
    linear-gradient(180deg, #071f12, var(--surface0));
}
.vip-hero-glow {
  position: absolute; inset: auto -30% -80px -30%; height: 150px;
  background: radial-gradient(50% 100% at 50% 0%, rgba(245,184,76,0.32), transparent);
  filter: blur(16px); pointer-events: none;
  animation: floaty 7s ease-in-out infinite;
}
.vip-hero-icon {
  width: 68px; height: 68px; margin: 0 auto 15px; border-radius: 21px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #3b2300;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 14px 34px -8px rgba(245,158,11,0.6);
  animation: pop 0.4s cubic-bezier(.2,.9,.3,1.2) both;
  position: relative;
}
.vip-hero h1 { font-size: 23px; font-weight: 800; position: relative; letter-spacing: -0.4px; }
.vip-hero p { margin: 7px auto 0; max-width: 310px; color: var(--hint); font-size: 13px; position: relative; }
.vip-status {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 15px; padding: 8px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,0.28); border: 1px solid var(--line2);
  backdrop-filter: blur(10px); position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}

.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.plan-card {
  display: flex; flex-direction: column;
  padding: 17px; border-radius: 18px;
  background:
    linear-gradient(var(--surface1), var(--surface0)) padding-box,
    linear-gradient(170deg, rgba(255,255,255,0.14), transparent 45%) border-box;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  animation: rise 0.3s ease both;
  transition: transform 0.16s ease, box-shadow 0.2s ease;
}
.plan-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--pc), transparent);
  opacity: 0.9;
  filter: blur(0.2px);
}
.plan-card::after {
  content: ""; position: absolute; top: -30%; right: -30%;
  width: 70%; height: 70%;
  background: radial-gradient(circle, color-mix(in srgb, var(--pc) 22%, transparent), transparent 60%);
  pointer-events: none;
}
.plan-gold { --pc: #f5b84c; }
.plan-diamond { --pc: #a78bfa; }
.plan-lifetime { --pc: #f5d94c; }
.plan-card.plan-wide { grid-column: 1 / -1; }
.plan-card.active {
  border-color: color-mix(in srgb, var(--pc) 60%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pc) 45%, transparent), 0 18px 44px -14px color-mix(in srgb, var(--pc) 45%, transparent);
}
.plan-top { display: flex; align-items: center; gap: 8px; }
.plan-icon {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--pc) 18%, transparent);
  color: var(--pc);
}
.plan-name { font-weight: 800; font-size: 16px; letter-spacing: -0.2px; }
.plan-badge {
  margin-left: auto; font-size: 9px; font-weight: 750; padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
}
.plan-price { display: flex; align-items: baseline; gap: 5px; margin-top: 13px; }
.plan-price .pp-num { font-size: 31px; font-weight: 800; color: var(--pc); line-height: 1; letter-spacing: -0.5px; }
.plan-price .pp-unit { font-size: 11px; color: var(--hint); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.plan-sub { font-size: 11.5px; color: var(--hint); margin-top: 6px; line-height: 1.45; }
.plan-feats { list-style: none; margin: 14px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-feats li { font-size: 12px; display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.pf-check {
  --pc: var(--accent2);
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; margin-top: 0.5px;
  background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 60%, #fff));
  box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--pc) 60%, transparent);
}
.plan-cta { margin-top: auto; }

/* ═══ Compare table ═══ */

.comp { display: flex; flex-direction: column; }
.comp-row {
  display: grid; grid-template-columns: 1.7fr 0.8fr 0.8fr 0.9fr 0.9fr;
  gap: 4px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
  font-size: 12px; text-align: center;
}
.comp-row:last-child { border-bottom: none; }
.comp-row > span:first-child { text-align: left; font-weight: 650; color: var(--text); }
.comp-row.comp-head { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--hint); padding: 7px 4px; }
.comp-row.comp-head > span:first-child { color: var(--hint); }
.comp-row .comp-diamond { color: var(--accent2); font-weight: 800; }
.comp-row .comp-lifetime { color: #f5d94c; font-weight: 800; }
.comp-row .ic { vertical-align: -2px; }

/* ═══ VIP steps & FAQ ═══ */

.vip-steps { margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 9px; }
.vip-steps li { font-size: 13px; color: var(--hint); }
.vip-steps li b { color: var(--text); }
.vip-steps li::marker { color: var(--accent); font-weight: 800; }

.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 13px 2px;
  font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 8px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--accent); font-weight: 800; font-size: 15px;
  transition: transform 0.22s cubic-bezier(.2,.8,.3,1.3), background 0.2s ease;
}
.faq-item summary::after { content: "+"; line-height: 1; }
.faq-item[open] summary::after { transform: rotate(45deg); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.faq-item p { font-size: 12.5px; color: var(--hint); padding: 0 2px 14px; line-height: 1.6; }

/* ═══ Editor ═══ */

.editor-tabs { position: sticky; top: calc(6px + var(--safe-top)); z-index: 15; }

.editor-preview {
  border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.pv-wrap {
  padding: 26px 18px; text-align: center; background: var(--pt-bg); color: var(--pt-text);
  position: relative; overflow: hidden;
  box-shadow: var(--pt-shadow);
  background-size: 200% 200%;
  animation: bgShift 15s ease-in-out infinite;
}
.pv-wrap::before {
  content: ""; position: absolute; inset: 0;
  background: var(--pt-gradient-layer);
  border-radius: 20px;
  pointer-events: none;
  opacity: 0.6;
  animation: gradientShift 10s ease infinite;
}
.pv-avatar-ring {
  width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 27px; padding: 3px;
  background: linear-gradient(150deg, var(--pt-accent), transparent 45%, var(--pt-accent2));
  box-shadow: 0 0 30px var(--pt-glow), 0 0 60px var(--pt-glow2);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  animation: pulseGlow 4s ease-in-out infinite;
}
.pv-avatar {
  width: 78px; height: 78px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  background: var(--pt-card); border: 1px solid var(--pt-border);
  box-shadow: var(--pt-shadow);
  position: relative;
  overflow: hidden;
}
.pv-avatar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
  animation: shine 3s ease-in-out infinite;
}
.pv-nick { font-size: 13px; font-weight: 650; color: var(--pt-accent); letter-spacing: 0.2px; }
.pv-name { font-size: 16px; font-weight: 800; margin-top: 2px; }
.pv-name.ph { opacity: 0.45; font-weight: 550; }
.pv-bio { font-size: 12px; opacity: 0.75; margin-top: 5px; white-space: pre-wrap; position: relative; }
.pv-bio:empty { display: none; }

@keyframes bgShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes gradientShift {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 30px var(--pt-glow), 0 0 60px var(--pt-glow2); }
  50% { box-shadow: 0 0 50px var(--pt-glow), 0 0 100px var(--pt-glow2); }
}
@keyframes shine {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.avatar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ar-av {
  width: 56px; height: 56px; border-radius: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 25px;
  background:
    linear-gradient(var(--surface2), var(--surface2)) padding-box,
    linear-gradient(150deg, rgba(255,255,255,0.14), transparent 55%) border-box;
  border: 1px solid transparent; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ar-av img { width: 100%; height: 100%; object-fit: cover; }
.ar-body { flex: 1; min-width: 0; }
.ar-title { font-size: 13px; font-weight: 650; }
.ar-sub { font-size: 11px; color: var(--hint); margin-top: 2px; }
.ar-actions { display: flex; gap: 6px; margin-top: 8px; }

.divider { height: 1px; background: var(--line); margin: 15px 0; }

.theme-row { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.theme-dots { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; justify-content: center; }
.theme-dot {
  width: 42px; height: 42px; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--sw); border: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), 0 6px 12px rgba(0,0,0,0.3), 0 0 20px var(--pt-glow);
  transition: all 0.3s cubic-bezier(.25,.8,.25,1);
  position: relative;
  overflow: hidden;
}
.theme-dot:hover { transform: scale(1.08); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), 0 6px 12px rgba(0,0,0,0.3), 0 0 30px var(--pt-glow); }
.theme-dot:active { transform: scale(0.92); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), 0 4px 8px rgba(0,0,0,0.3), 0 0 15px var(--pt-glow); }
.theme-dot.sel { transform: scale(1.12) rotate(2deg); box-shadow: inset 0 0 0 3px var(--bg), 0 0 0 5px var(--accent), 0 0 25px var(--pt-glow), 0 10px 30px rgba(0,0,0,0.4); z-index: 2; }
.theme-name { font-size: 13px; font-weight: 650; color: var(--hint); width: 100%; text-align: center; margin-top: 6px; }

.quota { margin-bottom: 4px; }
.quota-top { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; font-weight: 650; margin-bottom: 6px; }
.quota-top .ic { color: var(--accent2); vertical-align: -2px; }
.q-pill { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.q-pill.full { background: var(--danger-soft); color: var(--danger); }
.quota-bar { height: 6px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.quota-fill {
  height: 100%; border-radius: 999px;
  background: var(--accent-grad);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.4s cubic-bezier(.2,.8,.3,1);
}
.quota-fill.full { background: linear-gradient(135deg, #ff5c73, #f87171); box-shadow: 0 0 12px rgba(255,92,115,0.5); }

.icon-grid { max-height: 210px; overflow-y: auto; }
.icon-row { display: flex; flex-wrap: wrap; gap: 7px; }
.icon-cell {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--surface1); border: 1px solid var(--line); cursor: pointer;
  transition: border-color 0.13s ease, transform 0.08s ease, box-shadow 0.13s ease;
}
.icon-cell:active { transform: scale(0.92); }
.icon-cell.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }

.sec-card {
  border-radius: 15px; margin-bottom: 10px; overflow: hidden;
  background:
    linear-gradient(var(--surface1), var(--surface0)) padding-box,
    linear-gradient(170deg, rgba(255,255,255,0.12), transparent 45%) border-box;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  animation: rise 0.24s ease both;
}
.sec-head { display: flex; align-items: center; gap: 7px; padding: 11px 12px; }
.sec-head .sicon {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent2);
}
.sec-head .sicon .ic { color: inherit; }
.sec-head .sname { font-weight: 700; flex: 1; font-size: 13.5px; }
.sec-head .icon-btn, .link-row .icon-btn {
  border: none; background: transparent; color: var(--hint); cursor: pointer;
  width: 28px; height: 28px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.sec-head .icon-btn:active, .link-row .icon-btn:active { background: var(--surface3); color: var(--text); }
.sec-head .icon-btn:disabled, .link-row .icon-btn:disabled { opacity: 0.18; cursor: default; }
.sec-head .icon-btn .ic, .link-row .icon-btn .ic { color: inherit; }
.sec-links { border-top: 1px solid var(--line); }

.link-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.link-row:last-child { border-bottom: none; }
.link-row .licon { font-size: 17px; flex-shrink: 0; }
.link-row .lbody { flex: 1; min-width: 0; }
.link-row .lt { font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-row .lu { font-size: 10.5px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-row .icon-btn.del { color: var(--danger); }
.link-row .icon-btn.del:active { background: var(--danger-soft); }

/* ═══ Profilo pubblico · v3 ═══ */

.profile-theme {
  --pt-bg: #0b0b12;
  --pt-accent: #a78bfa;
  --pt-accent2: #7c3aed;
  --pt-text: #f5f5f7;
  --pt-text2: rgba(245,245,247,0.58);
  --pt-card: rgba(255,255,255,0.05);
  --pt-card-hover: rgba(255,255,255,0.09);
  --pt-border: rgba(255,255,255,0.1);
  --pt-glow: rgba(167,139,250,0.3);
}
.profile-theme.minimal {
  --pt-bg: #f6f7f9;
  --pt-accent: #5b5bf0;
  --pt-accent2: #7c6cf0;
  --pt-text: #14151a;
  --pt-text2: rgba(20,21,26,0.55);
  --pt-card: rgba(20,21,26,0.04);
  --pt-card-hover: rgba(20,21,26,0.07);
  --pt-border: rgba(20,21,26,0.09);
  --pt-glow: rgba(91,91,240,0.18);
}
.profile-theme.neon {
  --pt-bg: #07090e;
  --pt-accent: #00f0ff;
  --pt-accent2: #7c3aed;
  --pt-text: #eafcff;
  --pt-text2: rgba(234,252,255,0.55);
  --pt-card: rgba(0,240,255,0.05);
  --pt-card-hover: rgba(0,240,255,0.1);
  --pt-border: rgba(0,240,255,0.14);
  --pt-glow: rgba(0,240,255,0.22);
}
.profile-theme.gold {
  --pt-bg: #191307;
  --pt-accent: #fbbf24;
  --pt-accent2: #d97706;
  --pt-text: #fdf9e9;
  --pt-text2: rgba(253,249,233,0.55);
  --pt-card: rgba(251,191,36,0.05);
  --pt-card-hover: rgba(251,191,36,0.1);
  --pt-border: rgba(251,191,36,0.15);
  --pt-glow: rgba(251,191,36,0.2);
}
.profile-theme.ocean {
  --pt-bg: #051c26;
  --pt-accent: #5eead4;
  --pt-accent2: #0891b2;
  --pt-text: #ecfeff;
  --pt-text2: rgba(236,254,255,0.55);
  --pt-card: rgba(94,234,212,0.05);
  --pt-card-hover: rgba(94,234,212,0.1);
  --pt-border: rgba(94,234,212,0.15);
  --pt-glow: rgba(94,234,212,0.18);
}

.page {
  min-height: 100vh; min-height: 100dvh;
  background: var(--pt-bg);
  color: var(--pt-text);
  display: flex; flex-direction: column; align-items: center;
  position: relative; overflow: hidden;
  animation: rise 0.3s ease both;
  background-size: 400% 400%;
  animation: bgCycle 20s ease infinite;
}
.page-glow {
  position: absolute; top: -170px; left: 50%; transform: translateX(-50%);
  width: 540px; height: 540px; border-radius: 50%;
  background: radial-gradient(circle, var(--pt-glow), transparent 60%);
  filter: blur(46px); pointer-events: none; opacity: 0.7;
  animation: glowPulse 3s ease-in-out infinite;
}
.page-body {
  backdrop-filter: blur(20px);
  background: var(--pt-card);
  border-radius: 20px;
  padding: 20px;
}
@keyframes bgCycle {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.9; transform: translateX(-50%) scale(1.05); }
}
.page-head {
  width: 100%;
  padding: calc(58px + var(--safe-top)) 28px 26px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.page-avatar {
  width: 96px; height: 96px; border-radius: 30px;
  background: var(--pt-card);
  border: 1px solid var(--pt-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; overflow: hidden;
  box-shadow: inset 0 1px 0 var(--pt-border), 0 18px 44px -18px rgba(0,0,0,0.5);
  animation: pop 0.4s cubic-bezier(.2,.9,.3,1.2) both;
  position: relative;
}
.page-avatar::after {
  content: ""; position: absolute; inset: 0; border-radius: 30px;
  background: linear-gradient(150deg, var(--pt-accent), transparent 40%, var(--pt-accent2));
  opacity: 0.14; pointer-events: none;
}
.page-avatar img { width: 100%; height: 100%; object-fit: cover; }
.page-vip {
  margin-top: 15px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase;
  background: var(--pt-card); border: 1px solid var(--pt-border);
  color: var(--pt-accent);
  backdrop-filter: blur(8px);
  animation: rise 0.34s ease both;
}
.page-nick { margin-top: 18px; font-size: 26px; font-weight: 800; letter-spacing: -0.4px; }
.page-name { margin-top: 4px; font-size: 14px; color: var(--pt-text2); }
.page-bio {
  margin-top: 14px; font-size: 13.5px; line-height: 1.55;
  color: var(--pt-text2); max-width: 330px; white-space: pre-wrap;
}
.page-stats {
  margin-top: 18px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--pt-text2);
}
.page-stats .stat { font-weight: 650; display: inline-flex; align-items: center; gap: 5px; }
.page-stats .stat .ic { color: var(--pt-accent); }
.page-stats .stat.vip { color: var(--pt-accent); }
.page-stats .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--pt-text2); opacity: 0.55; }

.page-body { flex: 1; width: 100%; max-width: 480px; padding: 6px 22px 30px; position: relative; }
.page-title-block { margin-bottom: 4px; }
.page-title { font-size: 17px; font-weight: 800; letter-spacing: -0.2px; }
.page-desc { margin-top: 3px; font-size: 13px; color: var(--pt-text2); white-space: pre-wrap; }

.sec-title {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--pt-text2);
}
.sec-title .sname { color: var(--pt-text); font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.sec-title .sname .ic { color: var(--pt-accent); }
.sec-title .line { flex: 1; height: 1px; background: var(--pt-border); }

.links-wrap { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.links-wrap.col-1 .plink { width: 100%; }
.links-wrap.col-2 .plink { width: calc(50% - 5px); }

.plink {
  display: flex; flex-direction: column;
  border-radius: 16px;
  background: var(--pt-card);
  border: 1px solid var(--pt-border);
  overflow: hidden;
  color: inherit;
  cursor: pointer;
  backdrop-filter: blur(10px);
  animation: rise 0.3s ease both;
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.plink-main {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 14px;
  background: transparent; border: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.plink-main:active { transform: scale(0.985); background: var(--pt-card-hover); }
.plink .icon {
  width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--pt-card-hover);
}
.plink .lbody { min-width: 0; flex: 1; }
.plink .ltitle { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.plink .reveal-hint {
  width: 26px; height: 26px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 11px; color: var(--pt-text2);
  transition: transform 0.24s cubic-bezier(.2,.8,.3,1.2), background 0.2s ease;
}
.plink.revealed .reveal-hint { transform: rotate(180deg); color: var(--pt-accent); background: var(--pt-card-hover); }
.plink .lurl[hidden] { display: none; }
.plink .lurl {
  display: flex; flex-direction: column; gap: 9px;
  padding: 11px 14px 13px;
  border-top: 1px solid var(--pt-border);
  background: var(--pt-card-hover);
  animation: reveal 0.22s ease both;
}
.plink .lurl-text { font-size: 11px; color: var(--pt-text2); word-break: break-all; line-height: 1.4; }
.plink .lurl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plink .lurl-actions button {
  font: inherit; font-size: 11.5px; font-weight: 700;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--pt-border);
  background: transparent; color: var(--pt-text);
  display: inline-flex; align-items: center; gap: 5px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.plink .lurl-actions button:active { transform: scale(0.96); }
.plink .lurl-actions .lurl-open { background: var(--pt-accent); border-color: transparent; color: #fff; }
.plink .lurl-actions .ic { color: inherit; }
@media (hover: hover) {
  .plink:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--pt-accent) 45%, transparent); box-shadow: 0 12px 32px -14px rgba(0,0,0,0.45); }
}

.actrow { display: flex; gap: 10px; margin-top: 26px; justify-content: center; width: 100%; max-width: 480px; padding: 0 22px; }
.actrow .btn {
  font-size: 12.5px; padding: 13px 22px; border-radius: 999px; font-weight: 700;
  background: var(--pt-card); color: var(--pt-text);
  border: 1px solid var(--pt-border); text-decoration: none;
}
.actrow .btn.primary {
  background: linear-gradient(135deg, var(--pt-accent), var(--pt-accent2));
  border-color: transparent; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 12px 28px -12px var(--pt-glow);
}
.actrow .btn:active { transform: scale(0.96); opacity: 0.92; }

.page-foot {
  padding: 22px 24px calc(20px + var(--safe-bottom));
  text-align: center; font-size: 12px; color: var(--pt-text2);
  white-space: pre-wrap; width: 100%; max-width: 480px;
}
.page-madeby {
  padding: 18px 0 calc(26px + var(--safe-bottom));
  text-align: center; font-size: 11px; color: var(--pt-text2);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: 100%; max-width: 480px;
}
.page-madeby .btn {
  font-size: 12.5px; padding: 13px 26px; border-radius: 999px; font-weight: 800;
  background: var(--pt-card); color: var(--pt-text);
  border: 1px solid var(--pt-border); text-decoration: none;
}
.page-madeby small { opacity: 0.7; }

.backfab {
  position: fixed; top: calc(10px + var(--safe-top)); left: 10px; z-index: 25;
  width: 40px; height: 40px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); color: #fff;
  border: 1px solid rgba(255,255,255,0.18); cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: pop 0.22s ease both;
}
.backfab .ic { color: inherit; }
.backfab:active { transform: scale(0.92); }

/* ═══ Onboarding ═══ */

.onboard { text-align: center; padding: 34px 8px 8px; }
.onboard-logo {
  width: 80px; height: 80px; margin: 0 auto 18px; border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-grad);
  color: var(--accent-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 16px 40px -10px var(--accent-glow);
  animation: pop 0.4s cubic-bezier(.2,.9,.3,1.2) both, pulse-glow 2.8s ease-in-out infinite;
}
.onboard h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; }
.onboard-sub { margin: 8px auto 0; max-width: 300px; color: var(--hint); font-size: 13px; }
.onboard-steps { margin: 24px auto 22px; display: flex; flex-direction: column; gap: 10px; max-width: 280px; text-align: left; }
.step { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 550; }
.step span {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent2); font-size: 11px; font-weight: 800;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ═══ Modal & toast ═══ */

#modal {
  border: none; border-radius: 24px; padding: 0; width: min(92vw, 430px);
  max-height: 85vh; margin: auto;
  background: var(--bg2); color: var(--text); overflow: hidden;
  animation: sheetUp 0.28s cubic-bezier(.2,.85,.3,1.1) both;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.8);
}
#modal::backdrop { background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); animation: fade 0.2s ease both; }
.modal-content { padding: 20px; max-height: calc(85vh - 10px); overflow-y: auto; }
.modal-content h3 { margin-bottom: 15px; font-size: 16px; letter-spacing: -0.2px; display: flex; align-items: center; gap: 8px; }
.modal-content h3 .ic { color: var(--accent2); }
.modal-foot { display: flex; gap: 8px; margin-top: 18px; }
.modal-foot .btn { flex: 1; }

#toast {
  position: fixed; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px); left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 11px 20px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: all 0.24s cubic-bezier(.2,.8,.3,1.1); z-index: 60;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), var(--shadow-md); max-width: 86vw; text-align: center;
  backdrop-filter: blur(14px);
}
body.view-mode #toast { bottom: calc(22px + var(--safe-bottom)); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok { background: linear-gradient(135deg, #0f9d5f, #22c55e); color: #fff; }
#toast.err { background: linear-gradient(135deg, #dc4b5f, #ff5c73); color: #fff; }
#toast.info { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-text); }

/* ═══ Skeletons ═══ */

.skel-card {
  background:
    linear-gradient(var(--surface1), var(--surface0)) padding-box,
    linear-gradient(170deg, rgba(255,255,255,0.12), transparent 45%) border-box;
  border: 1px solid transparent; border-radius: var(--radius); padding: 16px; margin-bottom: 10px;
}
.skel {
  border-radius: 9px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skel-l { height: 14px; width: 40%; margin-bottom: 10px; }
.skel-m { height: 38px; width: 100%; margin-bottom: 8px; }
.skel-s { height: 12px; width: 70%; margin-bottom: 8px; }
.skel-av { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 12px; }

/* ═══ Animations ═══ */

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: scale(1); } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(28px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes pulse-glow {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 16px 40px -10px var(--accent-glow); }
  50% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 18px 54px -8px color-mix(in srgb, var(--accent) 75%, transparent); }
}
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}