/* Candy X – application styles */
:root {
  --pink: #FF4FA3;
  --pink-2: #D6249F;
  --orange: #FF8A1F;
  --gold: #FFC93C;
  --violet: #8B5CF6;
  --green: #16A34A;
  --red: #E11D48;

  --bg: #FBF8FF;
  --bg-2: #F3EEFB;
  --surface: #FFFFFF;
  --text: #1A0F2E;
  --muted: #6B6380;
  --line: #E9E3F3;
  --input: #FFFFFF;
  --shadow: 0 1px 2px rgba(26, 15, 46, .04), 0 8px 30px rgba(26, 15, 46, .06);
  --radius: 18px;
  --grad: linear-gradient(135deg, var(--pink) 0%, var(--orange) 100%);
  --grad-candy: linear-gradient(135deg, #FF4FA3, #C21E8E);
  --grad-x: linear-gradient(135deg, #FFC93C, #FF7A00);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0719; --bg-2: #150B25; --surface: #1A0F2E; --text: #F4EFFF; --muted: #A79CC4;
    --line: #2E2047; --input: #120A21; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 40px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0719; --bg-2: #150B25; --surface: #1A0F2E; --text: #F4EFFF; --muted: #A79CC4;
  --line: #2E2047; --input: #120A21; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 40px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--pink-2); text-decoration: none; }
:root[data-theme="dark"] a, .is-dark a { color: #FF7DBE; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a { color: #FF7DBE; } }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.text-red { color: var(--red); }
.main { flex: 1; }
.inline { display: inline; margin: 0; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand .mark { width: 40px; height: 40px; flex: none; }
.brand .wm { display: block; height: 19px; width: auto; color: var(--text); flex: none; }
.brand-lg .mark { width: 54px; height: 54px; }
.brand-lg .wm { height: 26px; }
.brand-sm .mark { width: 30px; height: 30px; }
.brand-sm .wm { height: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; padding: 10px 18px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none !important;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease; white-space: nowrap; line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff !important; box-shadow: 0 6px 20px rgba(255, 79, 163, .3); }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(255, 122, 0, .35); }
.btn-ghost { background: var(--surface); color: var(--text) !important; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--pink); }
.btn-danger { background: transparent; color: var(--red) !important; border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.btn-danger:hover { background: var(--red); color: #fff !important; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 14px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--text); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--pink); border-color: var(--pink); text-decoration: none; }
.icon-danger:hover { color: var(--red); border-color: var(--red); }
.armed { background: var(--red) !important; color: #fff !important; border-color: var(--red) !important; }

/* Top bar */
.announce { background: var(--grad); color: #fff; text-align: center; font-size: 14px; font-weight: 600; padding: 8px 16px; }
.topbar { position: sticky; top: 0; z-index: 40; backdrop-filter: saturate(1.4) blur(14px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--pink) 7%, var(--bg)) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 45%, color-mix(in srgb, var(--violet) 9%, var(--bg)) 100%);
  box-shadow: 0 6px 24px rgba(124, 58, 237, .08); }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #FF4D8D, #7C3AED, #FF4D8D); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; padding-bottom: 3px; }
.topbar .brand .mark { width: 44px; height: 44px; }
.topbar .brand .wm { height: 20px; }
.topbar .brand { gap: 10px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav > a:not(.btn), .nav .link-btn { color: var(--muted); font-weight: 600; padding: 8px 12px; border-radius: 10px; transition: background .15s, color .15s; }
.nav > a:not(.btn):hover, .nav .link-btn:hover { color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--pink) 10%, transparent); }
.nav .btn { margin-left: 6px; }
.nav .theme-btn { margin-left: 6px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; }
.theme-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: block; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px; padding: 12px 16px 18px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav > a, .nav form { padding: 8px 4px; }
  .theme-btn { align-self: flex-start; }
}

/* Cards, alerts, forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.alert { border-radius: 12px; padding: 12px 16px; margin: 0 0 12px; font-weight: 600; font-size: 14px; border: 1px solid; }
.alert-success { background: color-mix(in srgb, var(--green) 10%, var(--surface)); border-color: color-mix(in srgb, var(--green) 35%, transparent); color: var(--green); }
.alert-error { background: color-mix(in srgb, var(--red) 9%, var(--surface)); border-color: color-mix(in srgb, var(--red) 35%, transparent); color: var(--red); }
.alert-info { background: color-mix(in srgb, var(--violet) 10%, var(--surface)); border-color: color-mix(in srgb, var(--violet) 35%, transparent); color: var(--violet); }
.flashes { padding-top: 18px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form h3 { margin: 6px 0 0; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--input);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--pink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pink) 18%, transparent); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--pink); }
input[type="color"] { width: 44px; height: 32px; padding: 2px; }
input:disabled { opacity: .6; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
.hint { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.grid-3 .card + .card, .grid-2 .card + .card { margin-top: 0; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.prefix-input { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--input); }
.prefix-input span { display: flex; align-items: center; padding: 0 12px; background: var(--bg-2); color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 14px; }
.prefix-input input { border: 0; border-radius: 0; box-shadow: none !important; min-width: 0; }
.checks { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
/* Cards inside grids must be allowed to shrink, otherwise long labels push them off-screen. */
.grid-2 > *, .grid-3 > *, .stat-cards > * { min-width: 0; }
.meter-list li, .meter-list .t { min-width: 0; }
.meter-list .t > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-list .t > b { flex: none; }

/* Badges */
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); text-transform: none; vertical-align: middle; }
.badge-orange { background: color-mix(in srgb, var(--orange) 14%, var(--surface)); color: #C25E00; border-color: color-mix(in srgb, var(--orange) 35%, transparent); }
.badge-red { background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.badge-green { background: color-mix(in srgb, var(--green) 12%, var(--surface)); color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
:root[data-theme="dark"] .badge-orange { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-orange { color: var(--gold); } }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; text-align: center; }
.hero-glow { position: absolute; inset: -20% -10% auto; height: 620px; pointer-events: none;
  background: radial-gradient(500px 300px at 30% 30%, color-mix(in srgb, var(--pink) 28%, transparent), transparent 70%),
              radial-gradient(520px 320px at 72% 40%, color-mix(in srgb, var(--orange) 22%, transparent), transparent 70%),
              radial-gradient(420px 300px at 50% 0%, color-mix(in srgb, var(--violet) 22%, transparent), transparent 70%); }
.hero-in { position: relative; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); box-shadow: var(--shadow); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); display: inline-block; flex: none; }
.hero h1 { font-size: clamp(36px, 7vw, 66px); line-height: 1.04; letter-spacing: -.035em; margin: 22px 0 18px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 680px; margin: 0 auto 28px; }
.shorten { max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 10px; box-shadow: 0 20px 60px rgba(214, 36, 159, .14); text-align: left; }
.shorten-row { display: flex; gap: 10px; }
.shorten-row input { border: 0; font-size: 16px; padding: 14px; box-shadow: none !important; background: transparent; }
.shorten-extra { display: flex; align-items: center; gap: 6px; padding: 6px 14px 4px; border-top: 1px dashed var(--line); margin-top: 8px; font-size: 14px; }
.shorten-extra input { border: 0; padding: 6px 0; box-shadow: none !important; background: transparent; font-size: 14px; }
.shorten + .alert, .narrow { max-width: 760px; margin: 16px auto 0; text-align: left; }
.result { margin-top: 18px; }
.result-main { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; }
.result-main > div:first-child { min-width: 0; }
.result-url { font-size: 22px; font-weight: 800; }
.result-actions { display: flex; gap: 8px; flex: none; }
.hero-stats { display: flex; justify-content: center; gap: 48px; margin-top: 44px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 26px; font-weight: 800; }
.hero-stats span { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .hero { padding-top: 48px; }
  .shorten-row { flex-direction: column; }
  .result-main { flex-direction: column; align-items: flex-start; }
  .hero-stats { gap: 24px; }
}

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); margin-bottom: 10px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); transition: transform .2s, border-color .2s; }
.feature:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--pink) 45%, transparent); }
.feature p { color: var(--muted); margin: 0; }
.feature-hl { background: linear-gradient(160deg, color-mix(in srgb, var(--orange) 10%, var(--surface)), var(--surface) 60%); border-color: color-mix(in srgb, var(--orange) 40%, transparent); }
.f-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px; color: #fff; }
.f-ico svg { width: 22px; height: 22px; }
.f-pink { background: var(--grad-candy); }
.f-orange { background: var(--grad-x); }
.f-violet { background: linear-gradient(135deg, #A78BFA, #6D28D9); }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }

.split-demo { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.split-demo .lead { margin-left: 0; }
.split-card { padding: 26px; }
.split-url { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); font-weight: 800; margin-bottom: 20px; }
.split-row { margin-bottom: 16px; }
.t { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.bar { height: 10px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--grad); }
.bar .b-pink { background: var(--grad-candy); }
.bar .b-orange { background: var(--grad-x); }
.bar .b-violet { background: linear-gradient(90deg, #A78BFA, #7C3AED); }
@media (max-width: 860px) { .split-demo { grid-template-columns: 1fr; } }

/* Home showcases */
.section-head .lead { margin-top: 8px; }
.showcase { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.showcase .lead { margin-left: 0; }
.mock-card { padding: 24px; }
.mock-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mock-head b { display: inline-flex; align-items: center; gap: 8px; }
.rule { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1.3fr); align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; font-size: 14px; }
.rule-if { font-weight: 700; }
.rule-arrow { color: var(--pink); font-weight: 800; text-align: center; }
.rule-to { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-rest { background: var(--bg-2); border-style: dashed; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.mock-stats div { background: var(--bg-2); border-radius: 12px; padding: 10px 12px; }
.mock-stats span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.mock-stats b { font-size: 20px; }
.mock-bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin-bottom: 14px; }
.mock-bars i { flex: 1; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, #FF4D8D, #7C3AED); }
.mock-feed div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.steps .card + .card { margin-top: 0; }
.step { padding: 26px; }
.step-n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--grad-candy); color: #fff; font-weight: 800; margin-bottom: 14px; }
.step p { margin: 0; }
.faq-wrap { max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--pink); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
@media (max-width: 860px) {
  .showcase { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .showcase > div:not(.card) { text-align: center; }
  .showcase .lead { margin-left: auto; margin-right: auto; }
  .showcase-rev > .card { order: 2; }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
/* Phones: centred feature cards, steps and section text read better on a narrow screen. */
@media (max-width: 640px) {
  .feature, .step { text-align: center; padding: 24px 20px; }
  .feature .f-ico, .step .step-n { margin-left: auto; margin-right: auto; }
  .features { gap: 14px; }
  .section-head { margin-bottom: 28px; }
  .mock-stats b { font-size: 17px; }
  .mock-stats div { padding: 8px 10px; }
  .hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .cta { padding: 36px 20px; }
}
.cta { text-align: center; padding: 48px 24px; background: radial-gradient(500px 220px at 50% 0%, color-mix(in srgb, var(--pink) 16%, transparent), transparent), var(--surface); }

/* Footer – centred, with a candy gradient border */
.footer { position: relative; margin-top: 40px; padding: 20px 0 14px; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pink) 5%, var(--bg)), color-mix(in srgb, var(--violet) 9%, var(--bg))); }
.footer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #FF4D8D, #7C3AED, #FF4D8D); }
.footer-in { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer .brand .mark { width: 32px; height: 32px; }
.footer .brand .wm { height: 14px; }
.footer .brand { gap: 8px; }
.footer-tag { display: none; }
.footer-links { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.footer-links a { color: var(--text); font-weight: 600; font-size: 13px; }
.footer-links a:hover { color: var(--pink-2); text-decoration: none; }
.footer-links span { color: var(--pink); font-size: 9px; }
.copyright { margin: 0; color: var(--muted); font-size: 12px; }

/* App pages */
.page { padding-top: 32px; padding-bottom: 32px; }
.narrow-page { max-width: 820px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; }
.page-head p { margin: 0; }
.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-cards-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat-cards .card + .card { margin-top: 0; }
.stat { padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat strong { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat .small-strong { font-size: 17px; color: var(--pink-2); }
.stat-link:hover { text-decoration: none; border-color: var(--pink); }
@media (max-width: 900px) { .stat-cards, .stat-cards-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { min-width: 0; }
.stat strong, .page-head h1, .link-short, .bio h1 { overflow-wrap: anywhere; }
.stat .small-strong { font-size: 15px; line-height: 1.35; }

/* Mobile polish */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { padding: 0 14px; }
  .page { padding-top: 20px; }
  .page-head { margin-bottom: 16px; gap: 12px; }
  .page-head h1 { font-size: 24px; }
  .page-head .btn { width: 100%; }
  .page-head > .row-gap { width: 100%; }
  .page-head > .row-gap .btn { flex: 1; width: auto; }
  .card { padding: 16px; border-radius: 16px; }
  .stat-cards { gap: 10px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 24px; }
  .stat-link { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
  .list-head { flex-direction: column; align-items: stretch; }
  .search input { min-width: 0; width: 100%; }
  .link-row { padding: 14px; gap: 10px; }
  .link-clicks strong { font-size: 18px; }
  .link-actions { justify-content: space-between; }
  .link-actions .icon-btn { width: 40px; height: 40px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs a { white-space: nowrap; }
  .hero h1 { margin-top: 16px; }
  .hero-stats { gap: 18px 28px; }
  .section { padding: 48px 0; }
  .form-actions .btn { flex: 1; }
  .auth-wrap { padding-top: 28px; }
  .auth-card { padding: 22px; }
  .modal-box { padding: 18px; }
  .chart svg { height: 160px; }
  .dest-stat .t { flex-wrap: wrap; }
  .footer { margin-top: 28px; }
  .topbar-in { height: 70px; }
  .topbar .brand { gap: 10px; }
  .topbar .brand .mark { width: 42px; height: 42px; }
  .topbar .brand .wm { height: 19px; }
}

[hidden] { display: none !important; }
.quick-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.quick-form.card { padding: 14px; }
.shorten.quick-form { padding: 14px; }
.qf-dests { display: flex; flex-direction: column; gap: 8px; }
.qf-row { display: flex; gap: 8px; align-items: center; }
.qf-url { flex: 1; min-width: 0; font-size: 16px; padding: 13px 14px; }
.qf-label { width: 150px; flex: none; }
.qf-weight { width: 92px; flex: none; }
.qf-split-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qf-split-bar .split-preview { flex: 1; min-width: 120px; margin: 0; }
.qf-bottom { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qf-alias { flex: 1; min-width: 220px; }
.qf-more { margin: 0; }
.shorten-note { margin: 8px 14px 4px; }
.custom-lock { display: flex; align-items: center; gap: 10px; margin: 8px 4px 0; padding: 10px 14px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--violet) 45%, var(--line)); background: color-mix(in srgb, var(--violet) 6%, var(--surface)); color: var(--text) !important; text-decoration: none !important; font-size: 14px; transition: border-color .15s, background .15s; }
.custom-lock:hover { border-color: var(--pink); background: color-mix(in srgb, var(--pink) 8%, var(--surface)); }
.cl-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--grad-candy); color: #fff; }
.cl-text { min-width: 0; line-height: 1.4; }
.cl-text i { font-style: normal; color: var(--muted); }
.cl-text u { color: var(--pink-2); font-weight: 700; text-decoration: none; }
@media (max-width: 640px) {
  .qf-row { flex-wrap: wrap; }
  .qf-url { flex-basis: 100%; }
  .qf-label { flex: 1; width: auto; }
  .qf-bottom .btn { flex: 1; }
  .qf-alias { flex-basis: 100%; min-width: 0; }
}

.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.list-head h2 { font-size: 20px; margin: 0; }
.search input { padding: 9px 14px; min-width: 240px; }
.wide-search { margin-bottom: 14px; }
.wide-search input { min-width: 0; }
.empty { text-align: center; padding: 48px 24px; }
.empty img { margin-bottom: 8px; border-radius: 14px; }
.links { display: flex; flex-direction: column; gap: 10px; }
.links .card + .card { margin-top: 0; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 80px auto; align-items: center; gap: 16px; padding: 16px 18px; }
.link-row.is-new { border-color: var(--pink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pink) 15%, transparent); }
.link-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-short { font-weight: 800; font-size: 16px; }
.link-name { font-weight: 600; font-size: 14px; }
.link-clicks { text-align: center; display: flex; flex-direction: column; }
.link-clicks strong { font-size: 20px; font-weight: 800; }
.link-clicks span { font-size: 12px; color: var(--muted); }
.link-actions { display: flex; gap: 6px; }
.link-actions form { margin: 0; }
@media (max-width: 760px) {
  .link-row { grid-template-columns: minmax(0, 1fr) auto; }
  .link-meta { display: none; }
  .link-actions { grid-column: 1 / -1; }
}

/* Link form */
.split-total { font-weight: 800; font-size: 14px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--green) 14%, var(--surface)); color: var(--green); white-space: nowrap; }
.split-total.bad { background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); }
.dests { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.dest { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 96px 36px; gap: 8px; align-items: center; }
.dest-weight { position: relative; }
.dest-weight input { padding-right: 28px; }
.dest-weight span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.split-preview { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin-top: 16px; background: var(--bg-2); }
.split-preview i { display: block; height: 100%; transition: width .2s; }
@media (max-width: 640px) {
  .dest { grid-template-columns: minmax(0, 1fr) 96px 36px; }
  .dest-url { grid-column: 1 / -1; }
}

/* Targeting rules */
.targets { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.target-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1.6fr) 36px; gap: 8px; align-items: center; }
.badge-violet { background: color-mix(in srgb, var(--violet) 12%, var(--surface)); color: var(--violet); border-color: color-mix(in srgb, var(--violet) 30%, transparent); }
.geo-progress { margin: 14px 0; }
.geo-progress .bar { height: 12px; }
@media (max-width: 640px) {
  .target-row { grid-template-columns: 110px minmax(0, 1fr) 36px; }
  .target-row input { grid-column: 1 / -1; grid-row: 2; }
}

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 14px; border: 1px solid transparent; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: var(--shadow); }

/* Stats */
.chart svg { width: 100%; height: 220px; display: block; }
.chart-label { font-size: 11px; fill: var(--muted); font-family: inherit; }
.dest-stats { display: flex; flex-direction: column; gap: 16px; }
.dest-stat .t { font-size: 14px; }
.dest-stat .t .truncate { flex: 1; }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.meter-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.meter-list .bar { height: 7px; }
.meter-list .bar i { background: var(--grad-candy); }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.recent li:last-child { border-bottom: 0; }

/* Live analytics */
.live-title { display: flex; align-items: center; gap: 12px; }
.nav-live, .btn .live-dot { display: inline-flex; align-items: center; gap: 8px; }
.nav-live .live-dot, .btn .live-dot { width: 8px; height: 8px; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: livePulse 1.8s infinite; flex: none; }
.offline .live-dot { background: var(--muted); animation: none; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.live-stat { border-color: color-mix(in srgb, #22C55E 40%, var(--line)); }
.live-graph { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; margin-top: 38px; }
.live-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; height: 170px; font-size: 11px; font-weight: 700; color: var(--muted); min-width: 22px; }
.live-y span { line-height: 1; transform: translateY(-50%); }
.live-y span:last-child { transform: translateY(50%); }
.live-plot { position: relative; height: 170px; }
.live-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.live-grid i { display: block; border-top: 1px dashed var(--line); }
.live-grid i:last-child { border-top: 1px solid var(--line); }
.live-chart { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 3px; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.chart-ticks { position: relative; height: 18px; margin: 8px 0 0 30px; }
.chart-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.chart-ticks span:first-child { transform: none; }
.chart-ticks span:last-child { transform: translateX(-100%); }
.range-tabs a { padding: 8px 12px; }
.bar-col { position: relative; flex: 1; min-width: 0; display: flex; align-items: flex-end; cursor: pointer; }
.bar-col i { display: block; width: 100%; height: 1.5%; border-radius: 4px 4px 1px 1px; background: var(--line); transition: height .4s ease; }
.bar-col i.on { background: linear-gradient(180deg, #FF4D8D, #7C3AED); }
.bar-col.active i.on { filter: brightness(1.12); box-shadow: 0 0 0 2px color-mix(in srgb, var(--violet) 25%, transparent); }
.bar-col.active::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px dashed color-mix(in srgb, var(--violet) 55%, transparent); pointer-events: none; }
.live-tip { position: absolute; transform: translate(-50%, -100%); background: #1A0F2E; color: #fff; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px rgba(26, 15, 46, .25); z-index: 2; }
.live-tip::after { content: ''; position: absolute; left: calc(50% + var(--arrow, 0px)); bottom: -5px; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 0; border-top-color: #1A0F2E; }
:root[data-theme="dark"] .live-tip, :root[data-theme="dark"] .live-tip::after { background: #F4EFFF; color: #1A0F2E; border-top-color: #F4EFFF; }
:root[data-theme="dark"] .live-tip::after { background: none; }
.live-axis { display: flex; justify-content: space-between; margin: 8px 0 0 30px; }
.live-hint { margin: 8px 0 0; min-height: 1.4em; font-weight: 600; }
.top-links-card, .live-grid-2 { margin-top: 16px; }
.live-grid-2 .card + .card { margin-top: 0; }
.top-links { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tl-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text) !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tl-item:hover { border-color: var(--pink); box-shadow: 0 6px 20px rgba(214, 36, 159, .12); transform: translateY(-1px); }
.tl-static { grid-template-columns: 32px minmax(0, 1fr) auto; cursor: default; }
.tl-static:hover { border-color: var(--line); box-shadow: none; transform: none; }
.tl-top.tl-static:hover { border-color: color-mix(in srgb, var(--pink) 35%, var(--line)); }
.tl-top { background: linear-gradient(90deg, color-mix(in srgb, var(--pink) 8%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--pink) 35%, var(--line)); }
.tl-rank { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--bg-2); color: var(--muted); }
.tl-top .tl-rank { background: linear-gradient(135deg, #FF4D8D, #7C3AED); color: #fff; }
.tl-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-name { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-url { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-main .bar { height: 6px; margin-top: 6px; }
.tl-num { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.tl-num b { font-size: 20px; font-weight: 800; }
.tl-num span { font-size: 12px; color: var(--muted); font-weight: 700; }
.tl-edit { font-size: 13px; font-weight: 700; color: var(--pink-2); white-space: nowrap; }
@media (max-width: 640px) {
  .tl-item { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .tl-rank { width: 28px; height: 28px; font-size: 13px; }
  .tl-edit { display: none; }
  .tl-name { font-size: 14px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
}
.live-feed { list-style: none; margin: 8px 0 0; padding: 0; max-height: 560px; overflow-y: auto; }
.live-feed li { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); border-radius: 10px; }
.live-feed li:last-child { border-bottom: 0; }
.live-feed li.fresh { animation: liveIn 2.5s ease; }
@keyframes liveIn { 0% { background: color-mix(in srgb, var(--pink) 22%, transparent); transform: translateY(-6px); } 100% { background: transparent; transform: none; } }
.lf-flag { font-size: 24px; line-height: 1; flex: none; }
.lf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lf-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-right { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.lf-code { font-weight: 700; color: var(--pink-2); font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .live-y, .live-plot { height: 140px; }
  .live-chart { gap: 2px; }
  .live-axis { margin-left: 28px; font-size: 11px; }
  .lf-code { max-width: 110px; }
}

/* Tables (admin) */
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .maxw { max-width: 320px; }
.table .wrap { min-width: 220px; max-width: 420px; }
.table td.truncate { max-width: 220px; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table .actions form { margin: 0; }
.card > .table { margin: 0 -8px; width: calc(100% + 16px); }

/* Modal & toast */
.modal { position: fixed; inset: 0; background: rgba(10, 5, 20, .6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 80; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: 100%; max-width: 380px; text-align: center; }
.modal-x { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 26px; color: var(--muted); cursor: pointer; line-height: 1; }
.qr-wrap { background: #fff; border-radius: 16px; padding: 14px; margin: 10px auto 14px; width: 260px; max-width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.qr-wrap svg, .qr-wrap img { width: 100%; height: 100%; }
.qr-colors { display: flex; justify-content: center; gap: 18px; margin-bottom: 14px; }
.qr-colors label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.modal .row-gap { justify-content: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 90; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Auth */
.auth-body { background: radial-gradient(700px 400px at 20% 0%, color-mix(in srgb, var(--pink) 16%, transparent), transparent 70%), radial-gradient(600px 400px at 90% 100%, color-mix(in srgb, var(--orange) 14%, transparent), transparent 70%), var(--bg); }
.auth-wrap { width: 100%; max-width: 440px; margin: 0 auto; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.auth-card { width: 100%; padding: 30px; }
.auth-card.wide { max-width: 620px; }
.auth-wrap:has(.wide) { max-width: 660px; }
.auth-card h1 { font-size: 26px; }
.forgot-link { align-self: flex-end; margin-top: -6px; font-weight: 600; }
.lock-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); color: #fff; margin-bottom: 14px; }
.center-page { display: grid; place-items: center; min-height: 50vh; }
.error-card { text-align: center; max-width: 460px; padding: 40px 30px; }
.error-card img { border-radius: 16px; margin-bottom: 10px; }

/* Legal */
.prose { max-width: 780px; }
.prose h2 { font-size: 20px; margin-top: 28px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }

/* Bio editor */
.theme-pick { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.theme-opt { flex-direction: row !important; align-items: center; cursor: pointer; }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt span { display: inline-block; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 13px; color: #fff; border: 2px solid transparent; }
.theme-opt input:checked + span { border-color: var(--text); box-shadow: 0 0 0 3px var(--bg); }
.t-candy span { background: linear-gradient(135deg, #FF4FA3, #FF8A1F); }
.t-midnight span { background: linear-gradient(135deg, #1E1B4B, #4C1D95); }
.t-sunset span { background: linear-gradient(135deg, #F97316, #E11D48); }
.t-mint span { background: linear-gradient(135deg, #10B981, #0EA5E9); }
.t-paper span { background: #F5F0E8; color: #2A2118; }
.avatar-edit { display: flex; align-items: center; gap: 20px; margin: 4px 0 8px; }
.avatar-preview { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--grad-candy); color: #fff; font-size: 38px; font-weight: 800; box-shadow: 0 8px 24px rgba(214, 36, 159, .25); border: 3px solid var(--surface); outline: 1px solid var(--line); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.file-btn { cursor: pointer; }
.avatar-link summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.avatar-link input { margin-top: 8px; }
@media (max-width: 560px) {
  .avatar-edit { flex-direction: column; text-align: center; }
  .avatar-actions { align-items: center; width: 100%; }
  .avatar-link { width: 100%; }
}
.bio-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.bio-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 36px; gap: 8px; }
@media (max-width: 560px) { .bio-row { grid-template-columns: minmax(0, 1fr) 36px; } .bio-row input:nth-child(2) { grid-column: 1; } }

/* Public bio page */
.bio-body { min-height: 100vh; display: block; }
.bio { max-width: 560px; margin: 0 auto; padding: 56px 16px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.bio-avatar { width: 104px; height: 104px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-size: 42px; font-weight: 800; margin-bottom: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.2); border: 4px solid rgba(255,255,255,.7); }
.bio-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bio h1 { font-size: 26px; margin-bottom: 6px; }
.bio-text { opacity: .85; max-width: 440px; }
.bio-socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 24px; }
.bio-socials a { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none !important; }
.bio-links { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.bio-btn { display: block; padding: 16px 20px; border-radius: 16px; font-weight: 700; text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.bio-btn:hover { transform: translateY(-2px); }
.bio-foot { margin-top: 40px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; opacity: .75; text-decoration: none !important; }
.bio-foot img { border-radius: 5px; }

.bio-candy { background: linear-gradient(160deg, #FF4FA3 0%, #FF8A1F 100%) fixed; color: #fff; }
.bio-candy .bio-avatar { background: #fff; color: #D6249F; }
.bio-candy .bio-btn { background: rgba(255,255,255,.95); color: #1A0F2E !important; box-shadow: 0 8px 24px rgba(120, 20, 70, .25); }
.bio-candy .bio-socials a, .bio-candy .bio-foot { background: rgba(255,255,255,.2); color: #fff !important; }
.bio-midnight { background: radial-gradient(600px 400px at 50% 0%, #4C1D95, #0B0618 70%) fixed; color: #F4EFFF; }
.bio-midnight .bio-avatar { background: var(--grad); color: #fff; border-color: rgba(255,255,255,.15); }
.bio-midnight .bio-btn { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); color: #fff !important; }
.bio-midnight .bio-btn:hover { border-color: #FF4FA3; }
.bio-midnight .bio-socials a, .bio-midnight .bio-foot { background: rgba(255,255,255,.08); color: #fff !important; }
.bio-sunset { background: linear-gradient(170deg, #F97316 0%, #E11D48 60%, #7C2D92 100%) fixed; color: #fff; }
.bio-sunset .bio-avatar { background: #fff; color: #E11D48; }
.bio-sunset .bio-btn { background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.35); color: #fff !important; }
.bio-sunset .bio-socials a, .bio-sunset .bio-foot { background: rgba(255,255,255,.18); color: #fff !important; }
.bio-mint { background: linear-gradient(160deg, #D1FAE5, #E0F2FE) fixed; color: #064E3B; }
.bio-mint .bio-avatar { background: linear-gradient(135deg, #10B981, #0EA5E9); color: #fff; }
.bio-mint .bio-btn { background: #fff; color: #064E3B !important; box-shadow: 0 6px 18px rgba(6, 78, 59, .12); }
.bio-mint .bio-socials a, .bio-mint .bio-foot { background: rgba(6, 78, 59, .08); color: #065F46 !important; }
.bio-paper { background: #F5F0E8; color: #2A2118; }
.bio-paper .bio-avatar { background: #2A2118; color: #F5F0E8; border-color: #fff; }
.bio-paper .bio-btn { background: #fff; color: #2A2118 !important; border: 2px solid #2A2118; box-shadow: 4px 4px 0 #2A2118; }
.bio-paper .bio-btn:hover { box-shadow: 6px 6px 0 #FF4FA3; }
.bio-paper .bio-socials a, .bio-paper .bio-foot { background: #EAE2D4; color: #2A2118 !important; }


/* ------------------------------------------------------------------
   Mobile hardening (v1.6.2): nothing may push the page sideways.
   ------------------------------------------------------------------ */
html, body { max-width: 100%; overflow-x: clip; }
img, svg, video, canvas, iframe { max-width: 100%; }
.card, .grid-2 > *, .stat-cards > *, .page-head > *, .tabs > * { min-width: 0; }
td, .truncate, .maxw, .muted, .small, p, h1, h2, h3, a { overflow-wrap: anywhere; }
pre, code { white-space: pre-wrap; word-break: break-all; }
.user-filter { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.user-filter h3 { margin: 0 0 4px; }
.user-filter p { margin: 0; }

@media (max-width: 640px) {
  .tabs { flex-wrap: wrap; overflow-x: auto; }
  .page-head { flex-wrap: wrap; gap: 10px; }
  .search, .wide-search, .search input { width: 100%; max-width: 100%; }
  .grid-2 { grid-template-columns: 1fr !important; }

  /* Tables become stacked cards on phones */
  .table-card, .card:has(> .table) { overflow-x: visible; padding-left: 12px; padding-right: 12px; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table { min-width: 0 !important; table-layout: auto; }
  .table thead { display: none; }
  .table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 3px 0 !important; border: 0 !important; text-align: left !important; white-space: normal !important; max-width: none !important; }
  .table td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 84px; margin-right: 8px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
  .table td.actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px !important; }
  .table td.actions form { display: inline-flex; }
  .table td:empty { display: none; }
}
/* v1.6.2 clamp long URLs in mobile tables */
@media (max-width: 640px) {
  .table td.truncate, .table td.maxw { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
/* v1.6.3 admin: one user's links, live-sorted */
.ulinks { display: grid; gap: 12px; margin-top: 4px; }
.ulinks-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--pink) 12%, transparent); color: var(--pink); }
.ulinks .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); display: inline-block; animation: ulpulse 1.4s ease-in-out infinite; }
@keyframes ulpulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
.ulink { display: grid; gap: 10px; padding: 16px 18px; }
.ulink.is-hot { border-color: color-mix(in srgb, var(--pink) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--pink) 25%, transparent), var(--shadow); }
.ulink-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ulink-rank { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 26px; }
.ulink-code { font-weight: 700; font-size: 17px; word-break: break-all; }
.ulink-badges { display: inline-flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.badge-live { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--pink) 14%, transparent); color: var(--pink); font-weight: 700; }
.ulink-title { font-weight: 600; }
.ulink-dest { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ulink-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ulink-stats > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.ulink-stats span { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.ulink-stats strong { display: block; font-size: 18px; margin-top: 2px; }
.ulink.is-hot .ulink-stats > div:first-child { border-color: color-mix(in srgb, var(--pink) 45%, var(--line)); }
.ulink.is-hot .ulink-stats > div:first-child strong { color: var(--pink); }
.ulink-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ulink-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ulink-btns form { display: inline-flex; margin: 0; }
.ulink-del { color: var(--red) !important; }
@media (max-width: 640px) {
  .ulink { padding: 14px; }
  .ulink-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ulink-badges { margin-left: 0; }
  .ulink-actions { flex-direction: column; align-items: stretch; }
  .ulink-btns { justify-content: flex-start; }
}
/* v1.6.4 admin overview + users redesign */
.ax-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.ax-panel { padding: 20px 22px; }
.ax-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ax-panel-head h3 { margin: 0 0 2px; font-size: 19px; }
.ax-panel-head p { margin: 0; }
.ax-toplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ax-top { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); transition: border-color .15s, transform .15s; }
.ax-top:hover { border-color: color-mix(in srgb, var(--pink) 40%, var(--line)); transform: translateY(-1px); }
.ax-top.is-hot { border-color: color-mix(in srgb, var(--pink) 50%, var(--line)); }
.ax-rank { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.ax-rank-top { background: var(--grad); color: #fff; border: 0; }
.ax-top-main { min-width: 0; display: grid; gap: 4px; }
.ax-top-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ax-top-code { font-weight: 800; font-size: 16.5px; word-break: break-all; }
.ax-top-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.ax-top-meta a { font-weight: 600; color: var(--text); }
.ax-dot { opacity: .5; }
.ax-ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; overflow-wrap: normal; }
.ax-bar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 2px; }
.ax-bar span { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.ax-top-nums { text-align: right; display: grid; justify-items: end; line-height: 1.15; }
.ax-top-nums strong { font-size: 20px; font-weight: 800; }
.ax-top-nums span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.ax-top-nums em { font-style: normal; font-size: 12px; color: var(--pink); font-weight: 700; margin-top: 4px; }
.ax-userlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ax-user-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; color: inherit; text-decoration: none; }
.ax-user-row:hover { background: var(--bg-2); }
.ax-avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad); font-size: 15px; }
.ax-avatar-lg { width: 48px; height: 48px; font-size: 19px; }
.ax-user-main { display: grid; min-width: 0; flex: 1; gap: 1px; }
.ax-user-main strong { font-size: 15px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.ax-user-side { display: grid; justify-items: end; text-align: right; flex: 0 0 auto; }
.ax-user-side strong { font-size: 14px; }
.ax-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 14px; }
.ax-sum { padding: 16px 18px; display: grid; gap: 4px; }
.ax-sum span { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.ax-sum strong { font-size: 26px; font-weight: 800; }
.ax-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ax-search { flex: 1 1 280px; margin: 0; max-width: 460px; }
.ax-search input { width: 100%; }
.ax-sort { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); flex-wrap: wrap; }
.ax-sort a { padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.ax-sort a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.ax-users { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.ax-ucard { display: grid; gap: 14px; padding: 18px; align-content: start; }
.ax-ucard.is-banned { opacity: .72; }
.ax-ucard-head { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.ax-ucard-head:hover strong { color: var(--pink); }
.ax-ucard-head strong { font-size: 17px; }
.ax-ucard-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ax-joined { margin-left: auto; }
.ax-ucard-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ax-ucard-stats > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; min-width: 0; }
.ax-ucard-stats span { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.ax-ucard-stats strong { display: block; font-size: 19px; margin-top: 2px; }
.ax-ucard-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.ax-manage { display: inline-flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.ax-manage form { display: inline-flex; margin: 0; }
@media (max-width: 900px) { .ax-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .ax-panel { padding: 16px 14px; }
  .ax-top { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .ax-rank { width: 28px; height: 28px; font-size: 13px; }
  .ax-top-nums { grid-column: 2; justify-items: start; text-align: left; grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 6px; }
  .ax-top-nums strong { font-size: 17px; }
  .ax-top-nums em { margin-top: 0; }
  .ax-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ax-sum strong { font-size: 22px; }
  .ax-users { grid-template-columns: 1fr; }
  .ax-sort { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .ax-manage { margin-left: 0; width: 100%; }
  .ax-panel-head .btn { display: none; }
}
/* v1.6.4b grid cards never inherit stacked-card spacing */
.ax-users > .card, .ax-grid > .card, .ax-summary > .card, .ulinks > .card { margin: 0 !important; }
.ax-manage { width: 100%; justify-content: flex-end; }
/* v1.6.6 link names + owner line */
.ulink-name strong { font-size: 15.5px; font-weight: 700; }
.ulink-name .muted { font-size: 13px; font-style: italic; }
.ulink-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; margin-top: -4px; }
.ulink-owner { font-weight: 600; color: var(--text); white-space: nowrap; }
.ulink-meta strong { color: var(--text); font-weight: 600; }
.ax-search-full { margin: 0 0 14px; max-width: none; }
.ax-search-full input { width: 100%; }
.ax-toolbar .ax-sort + .ax-sort { margin-left: auto; }
.user-filter .ax-ucard-head { flex: 1; min-width: 0; }
.ax-top { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 14px 16px; }
.ax-top-title { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-top-meta { font-size: 12px; }
.ax-top-meta a { font-weight: 500; color: var(--muted); }
@media (max-width: 640px) {
  .ax-toolbar { flex-direction: column; align-items: stretch; }
  .ax-toolbar .ax-sort + .ax-sort { margin-left: 0; }
  .ulink-meta { flex-wrap: wrap; }
  .user-filter { flex-direction: column; align-items: stretch; }
}
/* v1.6.7 mobile polish */
a { overflow-wrap: normal; }
.ulink-code, .ax-top-code, .truncate a, td a { overflow-wrap: anywhere; }
.ax-top-meta a, .ulink-owner { white-space: nowrap; flex: 0 0 auto; }
.ax-sort::-webkit-scrollbar, .admin-tabs::-webkit-scrollbar { display: none; }
@media (max-width: 640px) {
  .tabs.admin-tabs { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-left: -4px; margin-right: -4px; }
  .tabs.admin-tabs a { white-space: nowrap; flex: 0 0 auto; }
  .ax-toolbar > * { flex: 0 0 auto; max-width: none; width: 100%; }
  .ax-sort { flex-wrap: wrap; overflow: visible; width: 100%; }
  .ax-sort a { flex: 1 1 auto; text-align: center; padding: 8px 10px; }
  .ulink-meta { flex-direction: column; align-items: flex-start; gap: 2px; margin-top: -6px; }
  .ulink-meta .ax-dot { display: none; }
  .ulink-meta .ax-ellip { max-width: 100%; }
  .ax-top { align-items: start; }
  .ax-rank { margin-top: 2px; }
  .ax-top-meta { flex-wrap: nowrap; }
  .ax-top-meta .ax-ellip { flex: 1 1 auto; }
  .ax-ucard-badges .ax-joined { margin-left: 0; width: 100%; }
}