/* ==========================================================================
   HarLink Design System & Stylesheet (harlink.ir)
   High-end Dark Glassmorphism, Persian RTL Typography, Micro-animations
   ========================================================================== */

/* ==========================================================================
   HarLink Local Typography & Font Definitions (Vazirmatn)
   100% Offline & Local - No external CDN dependency
   ========================================================================== */

/* Variable Font (Weights 100 to 900) */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn[wght].woff2') format('woff2-variations'),
       url('/fonts/Vazirmatn[wght].woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Static Weights for broad browser support */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Farsi Digits Font (for statistics, numbers, badges) */
@font-face {
  font-family: 'Vazirmatn-FD';
  src: url('/fonts/Vazirmatn-FD-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn-FD';
  src: url('/fonts/Vazirmatn-FD-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn-FD';
  src: url('/fonts/Vazirmatn-FD-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color Palette */
  --bg-primary: #0a0c10;
  --bg-secondary: #12161f;
  --bg-card: rgba(26, 32, 46, 0.65);
  --bg-card-hover: rgba(36, 44, 62, 0.85);
  --bg-input: rgba(18, 22, 31, 0.8);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(102, 252, 241, 0.4);
  --border-glass: rgba(255, 255, 255, 0.12);

  --accent-cyan: #66FCF1;
  --accent-cyan-glow: rgba(102, 252, 241, 0.25);
  --accent-blue: #45B6FE;
  --accent-purple: #8A2BE2;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;

  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-dim: #475569;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px var(--accent-cyan-glow);

  --font-main: 'Vazirmatn', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-numbers: 'Vazirmatn-FD', 'Vazirmatn', sans-serif;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Multi-Theme & Day/Night Mode Definitions */
[data-theme="glass-light"], [data-mode="light"] {
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #FFFFFF;
  --bg-input: #F1F5F9;
  --border-subtle: rgba(0, 0, 0, 0.1);
  --border-highlight: rgba(2, 132, 199, 0.4);
  --border-glass: rgba(0, 0, 0, 0.08);
  --accent-cyan: #0284C7;
  --accent-cyan-glow: rgba(2, 132, 199, 0.2);
  --accent-blue: #2563EB;
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-dim: #94A3B8;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

[data-mode="light"] body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

[data-mode="light"] body::before {
  background: radial-gradient(circle, rgba(2, 132, 199, 0.06) 0%, rgba(138, 43, 226, 0.03) 50%, transparent 70%);
}

[data-mode="light"] body::after {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.05) 0%, rgba(16, 185, 129, 0.03) 50%, transparent 70%);
}

[data-mode="light"] .hero-title {
  background: linear-gradient(135deg, #0F172A 20%, #0284C7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-mode="light"] .admin-card,
[data-mode="light"] .stat-card,
[data-mode="light"] .profile-card,
[data-mode="light"] .modal-content {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
}

[data-mode="light"] .form-input,
[data-mode="light"] .form-select,
[data-mode="light"] .form-textarea {
  background-color: #F8FAFC;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0F172A;
}

[data-mode="light"] .btn-secondary {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #0F172A;
}

[data-mode="light"] .btn-secondary:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
}

[data-mode="light"] .btn-install-pwa {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.1) 0%, rgba(14, 165, 233, 0.15) 100%);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

[data-mode="light"] .btn-install-pwa:hover {
  background: var(--accent-cyan);
  color: #FFFFFF;
}

/* ──── Profile Page Title (gradient text fix) ──── */
[data-mode="light"] .profile-title {
  background: linear-gradient(135deg, #0F172A 40%, #0284C7 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

[data-mode="light"] .profile-desc {
  color: #334155 !important;
}

/* ──── Profile badge, slug, footer ──── */
[data-mode="light"] .profile-badge-slug {
  background: rgba(2, 132, 199, 0.08) !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
  color: #0284C7 !important;
}

[data-mode="light"] .total-views-badge {
  color: #334155 !important;
}

[data-mode="light"] .harlink-signature {
  color: #64748B !important;
}

[data-mode="light"] .harlink-signature span {
  color: #0284C7 !important;
}

/* ──── Bento / Grid Icon Cards ──── */
[data-mode="light"] .bento-icon-card,
[data-mode="light"] .icon-redirect-card {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
}

[data-mode="light"] .bento-icon-card:hover,
[data-mode="light"] .icon-redirect-card:hover {
  background: #FFFFFF !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1), 0 0 20px var(--card-glow, rgba(2, 132, 199, 0.15)) !important;
}

[data-mode="light"] .bento-card-title,
[data-mode="light"] .icon-card-label {
  color: #0F172A !important;
}

[data-mode="light"] .bento-icon-box,
[data-mode="light"] .icon-box {
  background: rgba(248, 250, 252, 0.95) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* ──── Action Link Bars (pill/list view) ──── */
[data-mode="light"] .action-link-bar {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

[data-mode="light"] .action-link-bar:hover {
  background: #FFFFFF !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 18px var(--card-glow, rgba(2, 132, 199, 0.12)) !important;
}

[data-mode="light"] .action-link-title {
  color: #0F172A !important;
}

[data-mode="light"] .action-link-sub {
  color: #64748B !important;
}

[data-mode="light"] .action-link-arrow {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #64748B !important;
}

[data-mode="light"] .action-link-icon-box {
  background: rgba(248, 250, 252, 0.95) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* ──── Layout Toggle Bar ──── */
[data-mode="light"] .layout-toggle-bar {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-mode="light"] .layout-btn {
  color: #334155 !important;
}

[data-mode="light"] .layout-btn:hover {
  color: #0F172A !important;
}

[data-mode="light"] .layout-btn.active {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
}

/* ──── Links Section Title ──── */
[data-mode="light"] .links-section-title {
  color: #334155 !important;
}

[data-mode="light"] .links-section-title::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.1), transparent) !important;
}

/* ──── Super App Box ──── */
[data-mode="light"] .super-app-box {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

[data-mode="light"] .super-app-badge {
  background: rgba(2, 132, 199, 0.1) !important;
  color: #0284C7 !important;
}

[data-mode="light"] .super-app-item {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #0F172A !important;
}

[data-mode="light"] .super-app-item:hover {
  background: rgba(0, 0, 0, 0.07) !important;
  border-color: #0284C7 !important;
}

/* ──── Btn Mini Action (theme toggle, copy, QR circles) ──── */
[data-mode="light"] .btn-mini-action {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #334155 !important;
}

[data-mode="light"] .btn-mini-action:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #0F172A !important;
  border-color: #0284C7 !important;
}

/* ──── Header Bar ──── */
[data-mode="light"] .header-bar {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

/* ──── Admin Panel Cards, Stat Cards, Preset Rows ──── */
[data-mode="light"] .admin-page-section-title {
  color: #0F172A !important;
}

[data-mode="light"] .form-label {
  color: #0F172A !important;
}

[data-mode="light"] .preset-links-row,
[data-mode="light"] .custom-links-row,
[data-mode="light"] .preset-editor-row {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-mode="light"] .preset-row-title {
  color: #0F172A !important;
}

[data-mode="light"] .preset-field-label {
  color: #475569 !important;
}

[data-mode="light"] .preset-row-url {
  color: #64748B !important;
}

/* ──── Icon Picker Modal in Light Mode ──── */
[data-mode="light"] .icon-picker-option {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-mode="light"] .icon-picker-option:hover {
  background: #FFFFFF !important;
}

[data-mode="light"] .icon-picker-title {
  color: #0F172A !important;
}

[data-mode="light"] .icon-picker-box {
  background: rgba(248, 250, 252, 0.95) !important;
}

/* ──── Toast in Light Mode ──── */
[data-mode="light"] .toast {
  background: rgba(15, 23, 42, 0.92) !important;
  color: #F8FAFC !important;
}

/* ──── Verified Badge ──── */
[data-mode="light"] .verified-badge-large {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  border-color: #FFFFFF !important;
}

/* ──── Profile Footer ──── */
[data-mode="light"] .profile-footer {
  border-top-color: rgba(0, 0, 0, 0.08) !important;
}

/* ──── QR Modal ──── */
[data-mode="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.5) !important;
}

[data-mode="light"] .modal-content {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-mode="light"] .modal-header h3 {
  color: #0F172A !important;
}

/* ──── Stat card specific text ──── */
[data-mode="light"] .stat-val {
  color: #0F172A !important;
}

[data-mode="light"] .stat-lbl {
  color: #334155 !important;
}

/* ──── Admin card header text ──── */
[data-mode="light"] .admin-card-header h3,
[data-mode="light"] .admin-card h3 {
  color: #0F172A !important;
}

[data-theme="emerald-gold"] {
  --bg-primary: #051912;
  --bg-secondary: #0A291E;
  --bg-card: rgba(10, 41, 30, 0.75);
  --bg-card-hover: rgba(16, 61, 46, 0.85);
  --accent-cyan: #10B981;
  --accent-cyan-glow: rgba(16, 185, 129, 0.3);
  --accent-blue: #F59E0B;
  --border-highlight: rgba(245, 158, 11, 0.5);
}

[data-theme="royal-purple"] {
  --bg-primary: #0E0720;
  --bg-secondary: #180F33;
  --bg-card: rgba(24, 15, 51, 0.75);
  --bg-card-hover: rgba(36, 22, 74, 0.85);
  --accent-cyan: #A855F7;
  --accent-cyan-glow: rgba(168, 85, 247, 0.3);
  --accent-blue: #EC4899;
  --border-highlight: rgba(168, 85, 247, 0.5);
}

[data-theme="sunset-crimson"] {
  --bg-primary: #18080C;
  --bg-secondary: #280F16;
  --bg-card: rgba(40, 15, 22, 0.75);
  --bg-card-hover: rgba(59, 23, 33, 0.85);
  --accent-cyan: #F43F5E;
  --accent-cyan-glow: rgba(244, 63, 94, 0.3);
  --accent-blue: #FB923C;
  --border-highlight: rgba(244, 63, 94, 0.5);
}

[data-theme="ocean-blue"] {
  --bg-primary: #06111C;
  --bg-secondary: #0D2034;
  --bg-card: rgba(13, 32, 52, 0.75);
  --bg-card-hover: rgba(19, 46, 74, 0.85);
  --accent-cyan: #38BDF8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.3);
  --accent-blue: #3B82F6;
  --border-highlight: rgba(56, 189, 248, 0.5);
}

/* Base & Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--font-main);
  direction: rtl;
  text-align: right;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select, optgroup {
  font-family: var(--font-main);
}

.stat-val, .link-click-stat-badge, #resultsCount {
  font-family: var(--font-numbers);
}

/* Dynamic Ambient Glow Background */
body::before {
  content: '';
  position: fixed;
  top: -15%;
  left: 20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(102, 252, 241, 0.08) 0%, rgba(138, 43, 226, 0.05) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

body::after {
  content: '';
  position: fixed;
  bottom: -10%;
  right: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(69, 182, 254, 0.07) 0%, rgba(16, 185, 129, 0.04) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(90px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1.3;
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

/* Header & Nav */
.header-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

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

.brand-logo-img {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 2px 8px var(--accent-cyan-glow));
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  color: #0A0C10;
  box-shadow: 0 4px 16px rgba(102, 252, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(102, 252, 241, 0.45);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-outline-cyan {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-outline-cyan:hover {
  background: var(--accent-cyan-glow);
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: var(--accent-rose);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Containers */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.container-narrow {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   PAGE 1: LANDING & LIVE SEARCH VIEW
   ========================================================================== */

.hero-search-section {
  padding: 50px 0 30px;
  text-align: center;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(102, 252, 241, 0.1);
  border: 1px solid rgba(102, 252, 241, 0.25);
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #FFFFFF 30%, #66FCF1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  max-width: 580px;
  margin: 0 auto 36px;
  color: var(--text-secondary);
}

/* Search Bar Wrapper */
.search-box-wrapper {
  max-width: 620px;
  margin: 0 auto;
  position: relative;
}

.search-input-container {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 8px 18px;
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-md);
}

.search-input-container:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 28px rgba(102, 252, 241, 0.22);
  transform: translateY(-2px);
}

.search-icon-badge {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  margin-left: 12px;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-primary);
  direction: rtl;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.search-clear-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-secondary);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFF;
}

.search-stats-hint {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.search-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(102, 252, 241, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(102, 252, 241, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(102, 252, 241, 0); }
}

/* Results Grid */
.search-results-section {
  padding: 30px 0 60px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.results-count-badge {
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.result-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-smooth);
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.result-card:hover {
  transform: translateY(-4px);
  border-color: rgba(102, 252, 241, 0.35);
  background: var(--bg-card-hover);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(102, 252, 241, 0.12);
}

.result-card:hover::before {
  opacity: 1;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.verified-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.card-slug {
  font-size: 0.82rem;
  color: var(--accent-blue);
  direction: ltr;
  text-align: right;
  display: inline-block;
  font-family: monospace;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
}

.card-icons-preview {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-mini-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.card-stats-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Empty search state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.5;
  color: var(--accent-cyan);
}

/* ==========================================================================
   PAGE 2: SINGLE SHORT-LINK PROFILE PAGE (/:slug)
   ========================================================================== */

.profile-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 60px;
}

.profile-card {
  width: 100%;
  max-width: 580px;
  background: rgba(14, 18, 27, 0.88);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 32px;
  padding: 38px 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 45px rgba(102, 252, 241, 0.09);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

/* Top Action Bar (Buttons only) */
.profile-top-bar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 18px;
}

.profile-actions-mini {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Centered Shortlink Badge below profile info */
.profile-slug-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
  margin-bottom: 22px;
  width: 100%;
}

.profile-badge-slug {
  background: rgba(102, 252, 241, 0.08);
  border: 1px solid rgba(102, 252, 241, 0.25);
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  direction: ltr;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
  transition: all var(--transition-fast);
}

[data-mode="light"] .profile-badge-slug {
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.28);
  color: #0284C7;
}

.profile-badge-slug:hover {
  background: rgba(102, 252, 241, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px var(--accent-cyan-glow);
}

.btn-mini-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  flex-shrink: 0;
}

.btn-mini-action:hover {
  background: rgba(102, 252, 241, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan-glow);
  transform: translateY(-1px);
}

/* Color accent theme overrides */
[data-accent="cyan"] {
  --accent-cyan: #66FCF1;
  --accent-cyan-glow: rgba(102, 252, 241, 0.3);
}

[data-accent="rose"] {
  --accent-cyan: #F43F5E;
  --accent-cyan-glow: rgba(244, 63, 94, 0.3);
}

[data-accent="violet"] {
  --accent-cyan: #A855F7;
  --accent-cyan-glow: rgba(168, 85, 247, 0.3);
}

[data-accent="amber"] {
  --accent-cyan: #F59E0B;
  --accent-cyan-glow: rgba(245, 158, 11, 0.3);
}

/* Light mode accent overrides */
[data-mode="light"][data-accent="cyan"] {
  --accent-cyan: #0284C7;
  --accent-cyan-glow: rgba(2, 132, 199, 0.2);
}

[data-mode="light"][data-accent="rose"] {
  --accent-cyan: #E11D48;
  --accent-cyan-glow: rgba(225, 29, 72, 0.2);
}

[data-mode="light"][data-accent="violet"] {
  --accent-cyan: #7C3AED;
  --accent-cyan-glow: rgba(124, 58, 237, 0.2);
}

[data-mode="light"][data-accent="amber"] {
  --accent-cyan: #D97706;
  --accent-cyan-glow: rgba(217, 119, 6, 0.2);
}

.btn-mini-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-mini-action:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  transform: scale(1.08);
}

/* Avatar & Profile Info */
.profile-avatar-container {
  position: relative;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 32px rgba(102, 252, 241, 0.35);
  background: var(--bg-secondary);
  transition: transform 0.3s ease;
}

.profile-card:hover .profile-avatar {
  transform: scale(1.04);
}

.verified-badge-large {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: var(--accent-cyan);
  color: #0A0C10;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.profile-title {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.35;
  background: linear-gradient(135deg, #FFFFFF 40%, #66FCF1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.profile-desc {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 440px;
  margin-bottom: 24px;
}

/* Layout Toggle Bar */
.layout-toggle-bar {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.layout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.layout-btn:hover {
  color: #FFFFFF;
}

.layout-btn.active {
  background: var(--accent-cyan);
  color: #0A0C10;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(102, 252, 241, 0.4);
}

/* Single Short Page Section Title */
.links-section-title {
  width: 100%;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-align: right;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.links-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-subtle), transparent);
}

/* Dedicated Preset Harkoja Links Grid (2 Columns, centered odd item) */
.preset-links-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

/* When total count is odd (1, 3, 5, etc.), center the last remaining item across the two columns */
.preset-links-grid > :last-child:nth-child(odd),
.infinite-links-grid > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: calc((100% - 14px) / 2);
}

#previewPresetsGrid > :last-child:nth-child(odd),
#previewCustomGrid.grid-view > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: calc((100% - 10px) / 2);
}

/* High-End Bento Icon Card (Strictly NO text truncation!) */
.bento-icon-card, .icon-redirect-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 18px 12px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  user-select: none;
  min-height: 138px;
}

.bento-icon-card::before, .icon-redirect-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-highlight, var(--accent-cyan));
  opacity: 0.6;
  transition: opacity 0.25s, height 0.25s;
}

.bento-icon-card:hover, .icon-redirect-card:hover {
  transform: translateY(-5px) scale(1.02);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--card-highlight, var(--accent-cyan));
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 25px var(--card-glow, rgba(102, 252, 241, 0.2));
}

.bento-icon-card:hover::before, .icon-redirect-card:hover::before {
  opacity: 1;
  height: 4px;
}

.bento-icon-card:active, .icon-redirect-card:active {
  transform: scale(0.96);
}

.bento-icon-box, .icon-box {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.035) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bento-icon-box svg, .icon-box svg {
  width: 100%;
  height: 100%;
  transition: transform 0.25s ease;
}

.bento-icon-card:hover .bento-icon-box,
.icon-redirect-card:hover .icon-box {
  transform: scale(1.08);
  box-shadow: 0 0 22px var(--card-glow, rgba(102, 252, 241, 0.4)) !important;
}

.bento-card-title, .icon-card-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.45;
  white-space: normal !important;
  word-break: keep-all;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Custom Infinite Links Grid (When in grid view - 2 Columns) */
.infinite-links-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

/* Luxury Action Link Bars (When in pill/bar view) */
.infinite-links-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.action-link-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  user-select: none;
}

.action-link-bar::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--card-highlight, var(--accent-cyan));
  opacity: 0.7;
  transition: width 0.25s, opacity 0.25s;
}

.action-link-bar:hover {
  transform: translateX(-4px) translateY(-2px);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--card-highlight, var(--accent-cyan));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 22px var(--card-glow, rgba(102, 252, 241, 0.15));
}

.action-link-bar:hover::before {
  width: 6px;
  opacity: 1;
}

.action-link-bar:active {
  transform: scale(0.98);
}

.action-link-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.action-link-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(255, 255, 255, 0.035) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.action-link-bar:hover .action-link-icon-box {
  transform: scale(1.08);
}

.action-link-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
  flex: 1;
  min-width: 0;
}

.action-link-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #FFFFFF;
  white-space: normal;
  word-break: keep-all;
  line-height: 1.35;
}

.action-link-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  direction: ltr;
  text-align: right;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-link-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-right: 8px;
}

.action-link-bar:hover .action-link-arrow {
  background: var(--card-highlight, var(--accent-cyan));
  color: #0A0C10;
  transform: translateX(-4px);
}

.icon-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-row-arrow {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.icon-redirect-row:hover .icon-row-arrow {
  color: var(--accent-cyan);
  transform: translateX(-4px);
}

/* Total Link Usage & Harkoja Brand Footer */
.profile-footer {
  width: 100%;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.total-views-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.harlink-signature,
.harkojalink-signature {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.harlink-signature span,
.harkojalink-signature span {
  color: var(--accent-cyan);
  font-weight: 700;
}

/* ==========================================================================
   PAGE 3: ADMIN DASHBOARD & MANAGEMENT (/admin & /admin/:slug)
   ========================================================================== */

.admin-layout {
  padding: 40px 0 80px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 16px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.tab-btn.active {
  background: rgba(102, 252, 241, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(102, 252, 241, 0.25);
}

/* Stats Overview Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(102, 252, 241, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-val {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-lbl {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Forms & Admin Cards */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

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

/* Custom Gradient Builder */
.custom-gradient-builder {
  margin-top: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.gradient-colors-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.gradient-color-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.gradient-color-pick label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.color-input-box {
  width: 52px;
  height: 52px;
  border: 2px solid var(--border-subtle);
  border-radius: 14px;
  cursor: pointer;
  padding: 2px;
  background: transparent;
  transition: all 0.2s ease;
}

.color-input-box:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.08);
}

.color-input-box::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-box::-webkit-color-swatch {
  border: none;
  border-radius: 10px;
}

.gradient-preview-strip {
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #66FCF1, #45B6FE, #A855F7, #F43F5E);
  transition: background 0.3s ease;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-main);
  font-size: 0.92rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(102, 252, 241, 0.15);
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg-input, #0D1117);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366FCF1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: left 14px center !important;
  background-size: 16px 16px !important;
  padding-left: 40px !important;
  padding-right: 14px !important;
  direction: rtl;
  text-align: right;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-secondary, #121620);
  color: var(--text-primary, #FFFFFF);
  padding: 8px 12px;
}

[data-mode="light"] .form-select {
  background-color: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230284C7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 14px center !important;
  background-size: 16px 16px !important;
  padding-left: 40px !important;
  padding-right: 14px !important;
}

[data-mode="light"] .form-select option {
  background: #FFFFFF;
  color: #0F172A;
}

.form-input-slug {
  direction: ltr;
  text-align: left;
  font-family: monospace;
}

.input-with-prefix {
  display: flex;
  direction: ltr;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.input-prefix {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.9rem;
  border-right: 1px solid var(--border-subtle);
}

.input-with-prefix input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: monospace;
  font-size: 0.95rem;
}

/* Preset Links Section */
.preset-links-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.preset-editor-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: var(--transition-fast);
}

.preset-row-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  flex-shrink: 0;
  margin-top: 24px;
}

.preset-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preset-row-fields {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr);
  gap: 12px;
  align-items: flex-start;
}

.preset-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preset-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.preset-row-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

@media (max-width: 680px) {
  .preset-editor-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .preset-row-icon {
    margin-top: 0;
    align-self: flex-start;
  }

  .preset-row-fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Infinite Custom Links Manager */
.custom-link-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  transition: var(--transition-fast);
}

.custom-link-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.custom-link-drag {
  cursor: grab;
  color: var(--text-muted);
}

.link-click-stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 80px;
}

/* Icon Picker Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

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

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--transition-smooth);
}

.modal-overlay.open .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 12px;
}

.icon-picker-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.icon-picker-option:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--opt-color, var(--accent-cyan));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 18px var(--opt-color, var(--accent-cyan-glow));
  transform: translateY(-3px);
}

.icon-picker-option.selected {
  border-color: var(--opt-color, var(--accent-cyan));
  background: rgba(102, 252, 241, 0.08);
  box-shadow: 0 0 20px var(--opt-color, var(--accent-cyan-glow));
}

.icon-picker-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-picker-option:hover .icon-picker-box {
  transform: scale(1.1);
}

.icon-picker-box svg {
  width: 100%;
  height: 100%;
}

.icon-picker-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  background: var(--bg-card);
  border: 1.5px solid var(--accent-cyan);
  border-radius: var(--radius-full);
  padding: 12px 28px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUpToast 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: auto;
  white-space: nowrap;
}

.toast-container .toast {
  position: static;
  transform: none;
}

.toast-success {
  border-color: #10B981;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.toast-info {
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 24px var(--accent-cyan-glow);
}

.toast-error {
  border-color: var(--accent-rose);
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.3);
}

@keyframes slideUpToast {
  from { transform: translate(-50%, 25px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ==========================================================================
   NEW COMPONENTS: THEME SWITCH, PWA, SUPER APP & LINK MODAL EDITOR
   ========================================================================== */

/* Theme Toggle Button */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-cyan);
  transform: rotate(20deg);
}

/* PWA Install Button */
.btn-install-pwa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(102, 252, 241, 0.15) 0%, rgba(69, 182, 254, 0.2) 100%);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 0 16px var(--accent-cyan-glow);
}

.btn-install-pwa:hover {
  background: var(--accent-cyan);
  color: #0A0C10;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(102, 252, 241, 0.5);
}

/* Super App Showcase Box */
.super-app-box {
  width: 100%;
  margin-top: 26px;
  background: linear-gradient(135deg, rgba(102, 252, 241, 0.05) 0%, rgba(138, 43, 226, 0.06) 100%);
  border: 1px solid rgba(102, 252, 241, 0.25);
  border-radius: 22px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.super-app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.super-app-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-cyan);
  color: #0A0C10;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.super-app-grid {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.super-app-item {
  flex: 1 1 0;
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.super-app-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px var(--accent-cyan-glow);
  transform: translateY(-2px);
}

/* Custom Uploaded Image in Link Cards */
.link-custom-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* Admin Custom Link Cards List */
.admin-custom-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.admin-custom-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-cyan);
  transform: translateX(-4px);
}

/* Reorder Handle & Buttons */
.admin-card-reorder-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  margin-left: 10px;
  flex-shrink: 0;
  user-select: none;
}

.btn-card-move {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-card-move:hover:not([disabled]) {
  background: rgba(102, 252, 241, 0.15);
  border-color: rgba(102, 252, 241, 0.3);
  color: var(--accent-cyan);
}

.btn-card-move[disabled] {
  opacity: 0.18;
  cursor: not-allowed;
  pointer-events: none;
}

.card-drag-handle {
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 2px;
  color: var(--text-muted);
  transition: color 0.15s ease;
  touch-action: none;
}

.card-drag-handle:hover {
  color: var(--accent-cyan);
}

.card-drag-handle:active {
  cursor: grabbing;
}

.admin-custom-card.is-dragging {
  opacity: 0.35 !important;
  border: 2px dashed var(--accent-cyan) !important;
  background: rgba(102, 252, 241, 0.06) !important;
  cursor: grabbing !important;
  transform: scale(0.99) !important;
}

.admin-custom-card.drag-over-top {
  border-top: 3px solid var(--accent-cyan) !important;
  transform: translateY(-2px);
}

.admin-custom-card.drag-over-bottom {
  border-bottom: 3px solid var(--accent-cyan) !important;
  transform: translateY(2px);
}

.custom-links-reorder-hint {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Light mode custom link cards */
[data-mode="light"] .admin-custom-card {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-mode="light"] .admin-custom-card:hover {
  background: #F8FAFC !important;
  border-color: #0284C7 !important;
}

[data-mode="light"] .admin-card-reorder-group {
  color: #64748B;
}

[data-mode="light"] .btn-card-move {
  color: #64748B;
}

[data-mode="light"] .btn-card-move:hover:not([disabled]) {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.25);
  color: #0284C7;
}

[data-mode="light"] .card-drag-handle {
  color: #64748B;
}

[data-mode="light"] .card-drag-handle:hover {
  color: #0284C7;
}

[data-mode="light"] .admin-custom-card.is-dragging {
  border-color: #0284C7 !important;
  background: rgba(2, 132, 199, 0.05) !important;
}

[data-mode="light"] .admin-custom-card.drag-over-top {
  border-top-color: #0284C7 !important;
}

[data-mode="light"] .admin-custom-card.drag-over-bottom {
  border-bottom-color: #0284C7 !important;
}

[data-mode="light"] .custom-links-reorder-hint {
  color: #0284C7 !important;
}

.admin-custom-card-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.admin-custom-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.admin-custom-card-url {
  font-size: 0.75rem;
  color: var(--text-muted);
  direction: ltr;
  text-align: right;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Spacious Link Edit Modal */
.link-edit-modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Admin Workspace Grid Classes */
.admin-workspace-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 28px;
  align-items: start;
}

.admin-grid-2col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}

.admin-sidebar-preview {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-page-select-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-page-select {
  width: auto;
  min-width: 200px;
  padding: 6px 12px;
  font-size: 0.88rem;
}

/* ==========================================================================
   ULTRA-RESPONSIVE MOBILE STYLES (STUNNING MOBILE EXPERIENCE)
   ========================================================================== */

/* Tablet & Medium Screens (max-width: 992px) */
@media (max-width: 992px) {
  .admin-workspace-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .admin-sidebar-preview {
    position: static;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 14px;
  }
  
  .stat-val {
    font-size: 1.35rem;
  }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  .admin-grid-2col {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

  .header-bar {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 12, 16, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
  }

  .header-brand .brand-logo-img {
    height: 30px;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
  }

  .admin-page-select-wrapper {
    width: 100%;
    order: 10;
    margin-top: 4px;
  }

  .admin-page-select {
    flex: 1;
    min-width: 0;
  }

  .header-actions .btn, 
  .header-actions .form-select,
  .btn-install-pwa {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .admin-card {
    padding: 20px 16px;
    border-radius: 20px;
    margin-bottom: 18px;
  }

  .admin-custom-card {
    padding: 12px 12px;
  }

  .admin-custom-card-text span:first-child {
    font-size: 0.88rem;
  }

  .admin-custom-card-url {
    font-size: 0.72rem;
  }
}

/* Smartphone Breakpoint (max-width: 640px) - The Ultimate Mobile UX */
@media (max-width: 640px) {
  body {
    -webkit-tap-highlight-color: transparent;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Admin Stats on Mobile: Clean 3-column compact badges */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
  }

  .stat-card {
    padding: 12px 6px !important;
    flex-direction: column !important;
    text-align: center !important;
    gap: 6px !important;
    border-radius: 16px !important;
  }

  .stat-icon-wrapper {
    width: 36px !important;
    height: 36px !important;
    margin: 0 auto;
  }

  .stat-val {
    font-size: 1.25rem !important;
  }

  .stat-lbl {
    font-size: 0.68rem !important;
    line-height: 1.25 !important;
  }

  /* Header Optimization */
  .header-bar {
    padding: 8px 12px;
  }

  .header-brand .brand-logo-img {
    height: 28px;
  }

  .header-actions {
    gap: 6px;
  }

  .theme-toggle-btn {
    width: 36px;
    height: 36px;
  }

  .btn-install-pwa {
    padding: 6px 12px;
    font-size: 0.78rem;
    gap: 5px;
  }

  /* Landing Page Hero Search */
  .hero-search-section {
    padding: 16px 0 24px;
  }

  .hero-title {
    font-size: 1.85rem !important;
    margin-bottom: 8px;
  }

  .hero-subtitle {
    font-size: 0.9rem !important;
    margin-bottom: 22px;
    padding: 0 8px;
  }

  .search-box-wrapper {
    max-width: 100%;
  }

  .search-input-container {
    padding: 4px 6px;
    border-radius: 20px;
    background: rgba(14, 18, 27, 0.95);
    border: 1.5px solid var(--border-subtle);
  }

  .search-input-container:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.25);
  }

  .search-icon-badge {
    width: 38px;
    height: 38px;
  }

  .search-input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    padding: 10px 8px;
    height: 46px;
  }

  .search-stats-hint {
    font-size: 0.75rem;
    padding: 0 4px;
  }

  /* Search Results Grid */
  .results-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .page-card {
    padding: 16px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .page-card-avatar {
    width: 48px;
    height: 48px;
  }

  .page-card-title {
    font-size: 1.05rem;
  }

  .page-card-slug {
    font-size: 0.76rem;
  }

  .page-card-desc {
    font-size: 0.82rem;
    margin-bottom: 12px;
  }

  /* Profile Page (:slug) - Stunning Mobile Bio-Link UI */
  .profile-page-wrapper {
    padding: 12px 8px 40px !important;
    width: 100%;
  }

  .profile-card {
    max-width: 100% !important;
    padding: 24px 14px !important;
    border-radius: 26px !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 30px rgba(102, 252, 241, 0.06) !important;
  }

  .profile-top-bar {
    margin-bottom: 14px;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .profile-slug-container {
    margin-top: 4px;
    margin-bottom: 18px;
  }

  .profile-badge-slug {
    font-size: 0.8rem;
    padding: 5px 14px;
    max-width: 100%;
  }

  .profile-actions-mini {
    gap: 5px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  .btn-mini-action {
    width: 34px;
    height: 34px;
  }

  .profile-avatar-container {
    margin-bottom: 14px;
  }

  .profile-avatar {
    width: 90px !important;
    height: 90px !important;
    border-width: 2.5px !important;
  }

  .verified-badge-large {
    width: 22px;
    height: 22px;
    bottom: 2px;
    right: 2px;
  }

  .profile-title {
    font-size: 1.4rem !important;
    margin-bottom: 6px;
    font-weight: 900;
  }

  .profile-desc {
    font-size: 0.86rem !important;
    line-height: 1.55;
    margin-bottom: 18px;
    padding: 0 6px;
  }

  /* Segmented Layout Switcher */
  .layout-toggle-bar {
    margin-bottom: 18px;
    padding: 3px;
    border-radius: 99px;
  }

  .layout-btn {
    padding: 6px 14px;
    font-size: 0.78rem;
    gap: 5px;
  }

  /* Bento Grid Links (2 Columns, spacious, no clipping) */
  .preset-links-grid, .infinite-links-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 14px;
  }

  .bento-icon-card {
    min-height: 106px !important;
    padding: 14px 8px !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.04);
  }

  .bento-icon-box {
    width: 48px !important;
    height: 48px !important;
    border-radius: 14px !important;
    padding: 8px;
  }

  .bento-card-title {
    font-size: 0.82rem !important;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 6px;
  }

  /* Action Bars (Full-width sleek cards) */
  .infinite-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .action-link-bar {
    padding: 12px 14px !important;
    border-radius: 16px !important;
    margin-bottom: 8px !important;
    gap: 10px;
  }

  .action-link-icon-box {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    padding: 9px;
  }

  .action-link-title {
    font-size: 0.92rem !important;
    font-weight: 800;
  }

  .action-link-sub {
    font-size: 0.72rem !important;
  }

  .action-link-arrow {
    width: 28px !important;
    height: 28px !important;
  }

  /* Super App Box */
  .super-app-box {
    margin-top: 20px !important;
    padding: 16px 12px !important;
    border-radius: 18px !important;
    gap: 10px;
  }

  .super-app-header {
    gap: 6px;
  }

  .super-app-badge {
    font-size: 0.68rem !important;
    padding: 2px 8px !important;
  }

  .super-app-grid {
    gap: 8px !important;
  }

  .super-app-item {
    padding: 9px 12px !important;
    font-size: 0.8rem !important;
    border-radius: var(--radius-full) !important;
  }

  .total-views-badge {
    font-size: 0.76rem !important;
    padding: 8px 14px !important;
    width: 100%;
    justify-content: center;
  }

  /* Admin Panel on Mobile (clean & focused workspace) */
  .admin-phone-mockup-wrapper {
    display: none !important;
  }

  /* Bottom-Sheet Modals for Mobile */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-content, .link-edit-modal-box {
    max-width: 100% !important;
    width: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 28px !important;
    border-top-right-radius: 28px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 20px 18px 30px !important;
    box-shadow: 0 -10px 45px rgba(0, 0, 0, 0.85) !important;
    transform: translateY(100%) !important;
    transition: transform 0.32s cubic-bezier(0.33, 1, 0.68, 1) !important;
  }

  .modal-content::before, .link-edit-modal-box::before {
    content: '';
    display: block;
    width: 44px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 99px;
    margin: 0 auto 12px;
  }

  .modal-overlay.open .modal-content,
  .modal-overlay.open .link-edit-modal-box {
    transform: translateY(0) !important;
  }

  .form-input, .form-textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    padding: 12px 14px;
  }

  .form-select {
    font-size: 16px !important;
    padding: 12px 14px;
    padding-left: 40px !important;
    background-position: left 14px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px 16px !important;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
    padding: 12px !important;
  }
}

/* Extra Narrow Phones (max-width: 390px) */
@media (max-width: 390px) {
  .header-actions .btn span,
  .btn-install-pwa span {
    display: none;
  }

  .header-actions .btn,
  .btn-install-pwa {
    padding: 8px;
    border-radius: 50%;
  }

  .profile-badge-slug {
    font-size: 0.82rem;
    padding: 5px 14px;
    max-width: 100%;
  }
}

/* Touch feedback for mobile tactile feel */
@media (hover: none) and (pointer: coarse) {
  .btn:active,
  .bento-icon-card:active,
  .action-link-bar:active,
  .super-app-item:active,
  .page-card:active,
  .admin-custom-card:active {
    transform: scale(0.96) !important;
    transition: transform 0.1s ease !important;
  }
}

/* ==========================================================================
   LUXURY DIGITAL BANK CARD COMPONENT
   ========================================================================== */
.digital-bank-card {
  position: relative;
  background: linear-gradient(135deg, #132238 0%, #1a2f4c 50%, #0d1a29 100%);
  border: 1.5px solid rgba(102, 252, 241, 0.4);
  border-radius: 18px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 14px 34px -8px rgba(0, 0, 0, 0.55), 
              0 0 24px rgba(102, 252, 241, 0.12), 
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  color: #ffffff;
  user-select: none;
}

.digital-bank-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102, 252, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.digital-bank-card::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(69, 182, 254, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.digital-bank-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.bank-brand-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bank-name-text {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.bank-official-badge {
  background: rgba(102, 252, 241, 0.18);
  border: 1px solid rgba(102, 252, 241, 0.45);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}

.bank-chip-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.digital-bank-card-middle {
  margin-bottom: 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(102, 252, 241, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
  cursor: pointer;
}

.digital-bank-card-middle:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(102, 252, 241, 0.2);
}

.card-number-display {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 1.32rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #ffffff;
  direction: ltr;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 10px rgba(102, 252, 241, 0.3);
}

.digital-bank-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}

.card-holder-info {
  display: flex;
  flex-direction: column;
}

.card-holder-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2px;
}

.card-holder-name {
  font-size: 0.94rem;
  font-weight: 800;
  color: #ffffff;
}

.btn-card-copy {
  background: linear-gradient(135deg, rgba(102, 252, 241, 0.18) 0%, rgba(69, 182, 254, 0.18) 100%);
  border: 1.5px solid var(--accent-cyan);
  color: var(--accent-cyan);
  border-radius: 10px;
  padding: 7px 16px;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-card-copy:hover {
  background: var(--accent-cyan);
  color: #0b1522;
  box-shadow: 0 4px 14px rgba(102, 252, 241, 0.4);
  transform: translateY(-1px);
}

.btn-card-copy:active {
  transform: scale(0.96);
}

.btn-card-copy.copied {
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: #ffffff !important;
}

@media (max-width: 480px) {
  .card-number-display {
    font-size: 1.12rem;
    letter-spacing: 2px;
  }
  .digital-bank-card {
    padding: 16px;
  }
}
