/* ============================================
   Gytp.ir — Premium URL Shortener Theme
   ============================================ */

:root {
    --primary: #14b8a6;
    --primary-light: #2dd4bf;
    --primary-dark: #0d9488;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --violet: #8b5cf6;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;

    --bg: #0a0f1a;
    --bg-elevated: #111827;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-input: rgba(30, 41, 59, 0.6);
    --border: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(20, 184, 166, 0.3);

    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 60px rgba(20, 184, 166, 0.12);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --navbar-bg: rgba(10, 15, 26, 0.8);
    --footer-bg: rgba(10, 15, 26, 0.6);
    --mesh-1: rgba(20, 184, 166, 0.15);
    --mesh-2: rgba(245, 158, 11, 0.1);
    --mesh-3: rgba(139, 92, 246, 0.06);
    --surface-hover: rgba(255, 255, 255, 0.05);
    --input-overlay: rgba(0, 0, 0, 0.25);
    --site-header-height: 58px;
}

[data-theme="light"] {
    --bg: #f1f5f9;
    --bg-elevated: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-input: rgba(255, 255, 255, 0.95);
    --border: rgba(15, 23, 42, 0.1);
    --border-hover: rgba(13, 148, 136, 0.35);

    --text: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 60px rgba(20, 184, 166, 0.1);

    --navbar-bg: rgba(255, 255, 255, 0.85);
    --footer-bg: rgba(255, 255, 255, 0.9);
    --mesh-1: rgba(20, 184, 166, 0.12);
    --mesh-2: rgba(245, 158, 11, 0.08);
    --mesh-3: rgba(139, 92, 246, 0.05);
    --surface-hover: rgba(15, 23, 42, 0.04);
    --input-overlay: rgba(241, 245, 249, 0.9);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    color-scheme: dark;
    scrollbar-gutter: stable;
}
html[data-theme="light"] { color-scheme: light; }

body {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.7;
    overflow-x: hidden;
    padding-top: var(--site-header-height);
    transition: background-color var(--transition), color var(--transition);
}

/* ---- Background ---- */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.mesh-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 10% 20%, var(--mesh-1) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 90% 80%, var(--mesh-2) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 50%, var(--mesh-3) 0%, transparent 50%);
    transition: background var(--transition);
}

.mesh-noise {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Layout ---- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 640px; }
.main-content { flex: 1; }

/* ---- Navbar ---- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    padding: 0.85rem 0;
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    pointer-events: auto;
    touch-action: manipulation;
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.theme-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-icon-sun { display: none; }
.theme-icon-moon { display: flex; }

[data-theme="light"] .theme-icon-sun { display: flex; }
[data-theme="light"] .theme-icon-moon { display: none; }

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover { color: var(--primary-light); }

.logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.logo-sm .logo-mark { width: 30px; height: 30px; border-radius: 8px; }
.logo-sm { font-size: 1.05rem; }

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface-hover); }
.nav-link-accent { color: var(--primary-light) !important; }

.user-link .avatar-sm {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.logout-form { display: inline; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.3rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(20, 184, 166, 0.45);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #d97706);
    color: #1a1a1a;
    font-weight: 700;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--border-hover); background: rgba(30,41,59,0.8); }

.btn-success { background: linear-gradient(135deg, var(--success), #16a34a); color: white; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #dc2626); color: white; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); border-color: var(--border-hover); background: rgba(255,255,255,0.04); }

.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-xs { padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1rem; }
.btn-xl { padding: 1rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    backdrop-filter: blur(16px);
}

.glass-card { position: relative; overflow: hidden; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
}

/* ---- Hero / Homepage ---- */
.hero { padding: 3rem 0 5rem; }

.page-home .hero {
    padding: 1rem 0 1rem;
}

body.page-home .main-content {
    flex: 0 1 auto;
}

body.page-home .network-section {
    margin-top: 0;
    padding: 2rem 0 0.35rem;
}

body.page-home .footer-ads-wrap {
    margin-top: 0;
    padding-top: 0.75rem;
}

.page-home .hero-content {
    margin-bottom: 1.25rem;
}

.page-home .hero-tag {
    margin-bottom: 0.75rem;
}

.page-home .hero-title {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    margin-bottom: 0.5rem;
}

.page-home .shorten-panel {
    margin-bottom: 1rem;
    max-width: 100%;
    background: linear-gradient(180deg, #e8edf4 0%, #dfe6ef 100%);
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow:
        0 8px 28px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

[data-theme="dark"] .page-home .shorten-panel {
    background: linear-gradient(180deg, rgba(22, 32, 50, 0.95) 0%, rgba(15, 23, 38, 0.98) 100%);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow:
        0 10px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.page-home .url-input-with-submit {
    border-width: 2px;
    border-color: #c5ced9;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.page-home .url-input-slug {
    border-width: 2px;
    border-color: #c5ced9;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.page-home .url-input-slug:focus-within,
.page-home .url-input-with-submit:focus-within {
    border-color: #c5ced9;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.page-home .option-chip {
    background: #ffffff;
    border: 2px solid #c5ced9;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.page-home .option-chip:has(input:checked) {
    background: rgba(20, 184, 166, 0.12);
    border-color: rgba(20, 184, 166, 0.45);
}

[data-theme="dark"] .page-home .url-input-with-submit,
[data-theme="dark"] .page-home .url-input-slug,
[data-theme="dark"] .page-home .option-chip {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(148, 163, 184, 0.28);
}

[data-theme="dark"] .page-home .url-input-with-submit:focus-within,
[data-theme="dark"] .page-home .url-input-slug:focus-within {
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: none;
}

/* Top banner ads — 8 slots above hero */
.home-ads-top {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.home-ad-item--top {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
}

.home-ad-item--top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 900px) {
    .home-ads-top {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .home-ads-top {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.4rem;
        padding-bottom: 0.25rem;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
    }

    .home-ad-item--top {
        flex: 0 0 120px;
        aspect-ratio: 3 / 2;
        scroll-snap-align: start;
    }
}

/* Homepage side ads — fixed at screen edges, panel stays centered */
.home-ads {
    display: none;
}

.home-ad-item {
    display: block;
    width: 225px;
    height: 150px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    flex-shrink: 0;
    position: relative;
}

.home-ad-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(139, 92, 246, 0.12));
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

.home-ad-item:hover {
    transform: translateY(-5px) scale(1.015);
    box-shadow: 0 14px 32px rgba(20, 184, 166, 0.22);
    border-color: rgba(20, 184, 166, 0.45);
}

.home-ad-item:hover::after {
    opacity: 1;
}

.home-ad-item img {
    display: block;
    width: 225px;
    height: 150px;
    object-fit: cover;
    transition: transform 0.35s ease, filter 0.28s ease;
}

.home-ad-item:hover img {
    transform: scale(1.04);
    filter: brightness(1.07) saturate(1.12);
}

[data-theme="light"] .home-ad-item {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .home-ad-item {
    background: var(--bg-elevated);
    border-color: var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .home-ad-item:hover {
    box-shadow: 0 14px 32px rgba(13, 148, 136, 0.18);
    border-color: rgba(13, 148, 136, 0.4);
}

@media (min-width: 1200px) {
    .page-home .home-ads {
        display: grid;
        grid-template-columns: repeat(2, 225px);
        gap: 0.65rem;
        position: fixed;
        bottom: 1.25rem;
        z-index: 20;
        max-height: min(480px, calc(100vh - 5rem));
        overflow-y: auto;
        scrollbar-width: thin;
        align-content: end;
    }

    .page-home .home-ads--left {
        left: 1.25rem;
    }

    .page-home .home-ads--right {
        right: 1.25rem;
    }
}

.hero-content { text-align: center; margin-bottom: 2.5rem; }

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.25);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--primary-light);
    margin-bottom: 1.25rem;
}

.tag-dot {
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Shorten Panel */
.shorten-panel {
    max-width: 680px;
    margin: 0 auto 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-glow);
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    text-align: center;
}

.url-input-group {
    display: flex;
    align-items: stretch;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.url-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

.url-input-group.url-input-with-submit:focus-within {
    border-color: #e5e7eb;
    box-shadow: none;
}

.url-input-full .url-field-wrap input {
    padding: 1rem 1.1rem;
    font-size: 1rem;
}

.url-input-with-submit {
    direction: ltr;
    margin-bottom: 0;
    border-color: #e5e7eb;
    background: #ffffff;
    box-shadow: none;
}

[data-theme="dark"] .url-input-with-submit {
    border-color: var(--border);
    background: var(--bg-input);
}

.url-input-with-submit:focus-within {
    border-color: #e5e7eb;
    box-shadow: none;
}

.page-home .url-input-with-submit:focus-within,
.page-home .url-input-group.url-input-with-submit:focus-within {
    border-color: #c5ced9;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.url-input-with-submit .url-field-wrap input {
    background: transparent;
    font-size: 0.95rem;
    font-weight: 400;
    color: #374151;
    text-align: left;
}

.url-input-with-submit .url-field-wrap input:focus {
    outline: none;
    box-shadow: none;
}

.url-input-with-submit .url-field-wrap input:-webkit-autofill,
.url-input-with-submit .url-field-wrap input:-webkit-autofill:hover,
.url-input-with-submit .url-field-wrap input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    -webkit-text-fill-color: #374151;
    transition: background-color 9999s ease-out 0s;
}

[data-theme="dark"] .url-input-with-submit .url-field-wrap input:-webkit-autofill,
[data-theme="dark"] .url-input-with-submit .url-field-wrap input:-webkit-autofill:hover,
[data-theme="dark"] .url-input-with-submit .url-field-wrap input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
    -webkit-text-fill-color: var(--text);
}

.url-input-with-submit .url-field-wrap input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

[data-theme="dark"] .url-input-with-submit .url-field-wrap input {
    color: var(--text);
}

[data-theme="dark"] .url-input-with-submit .url-field-wrap input::placeholder {
    color: var(--text-muted);
}

.url-input-with-submit .shorten-submit-btn {
    width: auto;
    margin: 0;
    flex-shrink: 0;
    border: none;
    border-radius: 0;
    padding: 0 1.35rem;
    min-height: 52px;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: none;
}

.url-input-with-submit .shorten-submit-btn:hover {
    filter: brightness(1.05);
}

.shorten-field-label {
    margin: 0 0 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
}

.shorten-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.65rem;
    align-items: start;
}

.shorten-field-col {
    min-width: 0;
}

.shorten-field-col-main .shorten-submit-btn {
    width: auto;
}

.shorten-field-col .url-input-group {
    margin-bottom: 0;
    min-height: 52px;
}

.shorten-field-col .url-input-group .url-field-wrap,
.shorten-field-col .url-input-group .url-field-wrap input {
    min-height: 52px;
}

.shorten-field-col .field-errors {
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.page-home .shorten-fields-row {
    gap: 1.25rem;
}

@media (max-width: 720px) {
    .shorten-fields-row {
        grid-template-columns: 1fr;
    }
}

.url-input-slug {
    direction: ltr;
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 0;
    box-shadow: none;
}

[data-theme="dark"] .url-input-slug {
    background: var(--bg-input);
    border-color: var(--border);
}

.url-input-slug:focus-within {
    border-color: #d1d5db;
    box-shadow: none;
}

.url-input-slug .url-input-prefix {
    display: flex;
    align-items: center;
    padding: 0 0.35rem 0 1rem;
    color: #9ca3af;
    font-size: 0.95rem;
    font-weight: 400;
    white-space: nowrap;
    flex-shrink: 0;
    border: none;
    background: transparent;
}

.url-input-slug .url-field-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.url-input-slug .url-field-wrap input {
    width: 100%;
    padding: 0 1rem 0 0.25rem;
    font-size: 0.95rem;
    font-weight: 400;
    color: #6b7280;
    text-align: left;
    direction: ltr;
}

.url-input-slug .url-field-wrap input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.url-input-slug .url-field-wrap input:focus {
    color: #374151;
}

[data-theme="dark"] .url-input-slug .url-input-prefix,
[data-theme="dark"] .url-input-slug .url-field-wrap input,
[data-theme="dark"] .url-input-slug .url-field-wrap input::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .url-input-slug .url-field-wrap input:focus {
    color: var(--text);
}

.url-field-wrap { flex: 1; }
.url-field-wrap input {
    width: 100%;
    padding: 0.9rem 1rem;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

.custom-code-row { margin-bottom: 1rem; }
.custom-code-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* Slug input — b2n style single line */
.slug-input-group,
.copy-row {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1rem;
    min-height: 48px;
    transition: var(--transition);
}

[data-theme="dark"] .slug-input-group,
[data-theme="dark"] .copy-row {
    background: var(--bg-input);
    border-color: var(--border);
}

.slug-input-group:focus-within,
.copy-row:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.slug-prefix,
.copy-prefix {
    padding: 0 0.85rem;
    color: #334155;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    height: 100%;
    display: flex;
    align-items: center;
}

[data-theme="dark"] .slug-prefix,
[data-theme="dark"] .copy-prefix {
    color: var(--text-secondary);
    border-right-color: var(--border);
}

.slug-input-group .slug-input,
.slug-input-group input {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1rem;
    background: transparent;
    border: none;
    color: #0f172a;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    direction: ltr;
    text-align: left;
}

[data-theme="dark"] .slug-input-group .slug-input,
[data-theme="dark"] .slug-input-group input {
    color: var(--text);
}

.slug-input-group input::placeholder {
    color: #94a3b8;
}

.copy-row .copy-value {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 0.5rem;
    background: transparent;
    border: none;
    color: #0f172a;
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
}

[data-theme="dark"] .copy-row .copy-value {
    color: var(--primary-light);
}

.copy-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: none;
    border-left: 1px solid rgba(15, 23, 42, 0.08);
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition);
}

[data-theme="dark"] .copy-btn-icon {
    border-left-color: var(--border);
    color: var(--text-muted);
}

.copy-btn-icon:hover {
    background: rgba(20, 184, 166, 0.1);
    color: var(--primary);
}

.copy-row-sm {
    min-height: 40px;
    margin-bottom: 0.5rem;
}

.copy-row-sm .copy-prefix {
    font-size: 0.85rem;
    padding: 0 0.65rem;
}

.copy-row-sm .copy-value {
    font-size: 0.82rem;
    padding: 0.65rem 0.4rem;
}

.copy-row-sm .copy-btn-icon {
    width: 38px;
    height: 38px;
}

.result-links {
    flex: 1;
    min-width: 200px;
}

.result-links > .badge {
    margin-top: 0.5rem;
    margin-left: 0.25rem;
}

.shorten-field-col-slug .form-options-col {
    margin-top: 0.65rem;
    margin-bottom: 0;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
}

.shorten-field-col-slug .form-options-col .option-chip {
    flex: 1;
    justify-content: center;
}

.shorten-field-col-slug .password-field {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.form-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    margin-top: 0.15rem;
    align-items: center;
    justify-content: center;
}

.shorten-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-weight: 700;
    border-radius: 0;
    white-space: nowrap;
}

.option-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.option-chip:has(input:checked) {
    background: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.35);
    color: var(--primary-light);
}

.option-chip input { display: none; }

.chip-icon {
    display: flex;
    align-items: center;
    opacity: 0.7;
}

.password-field { margin-bottom: 1rem; }
.password-field input { width: 100%; }

.advanced-options { margin-bottom: 1.25rem; }
.advanced-options summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.5rem 0;
    user-select: none;
}
.advanced-options summary:hover { color: var(--primary-light); }
.advanced-options[open] summary { margin-bottom: 0.75rem; color: var(--text-secondary); }

.advanced-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Result Panel */
.result-panel {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(20, 184, 166, 0.06);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: var(--radius);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.result-check {
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.15);
    border-radius: 50%;
    color: var(--primary-light);
    flex-shrink: 0;
}

.result-title { font-weight: 700; color: var(--primary-light); }
.result-sub { font-size: 0.85rem; color: var(--text-muted); }

.result-url {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.result-url input {
    flex: 1;
    padding: 0.8rem 1rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(20, 184, 166, 0.25);
    border-radius: var(--radius-sm);
    color: var(--primary-light);
    font-family: monospace;
    font-size: 0.9rem;
}

.result-extras {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.qr-box {
    text-align: center;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius-sm);
}

.qr-box img { display: block; border-radius: 4px; }
.qr-box .btn { margin-top: 0.5rem; }

.result-links { flex: 1; min-width: 200px; }
.result-link-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.result-link-item input {
    flex: 1;
    min-width: 150px;
    padding: 0.5rem 0.75rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.8rem;
}

.result-cta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(20, 184, 166, 0.15);
    text-align: center;
}

.result-cta p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }

/* Shorten Result Page */
.shorten-result-hero {
    padding: 2.5rem 0 4rem;
}

.shorten-result-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 2rem 1.75rem 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glow);
    backdrop-filter: blur(20px);
}

.shorten-result-heading {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.shorten-result-url-row {
    display: flex;
    align-items: stretch;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1rem;
    min-height: 50px;
    transition: var(--transition);
}

.shorten-result-url-row:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.shorten-result-url-input {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1rem;
    background: transparent;
    border: none;
    color: var(--primary-light);
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
}

.shorten-result-copy-btn {
    flex-shrink: 0;
    padding: 0 1.35rem;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

[data-theme="light"] .shorten-result-copy-btn {
    border-right-color: rgba(15, 23, 42, 0.08);
}

.shorten-result-copy-btn:hover {
    filter: brightness(1.08);
}

.shorten-result-copy-btn.copied {
    background: linear-gradient(135deg, var(--success), #16a34a);
}

.shorten-result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.shorten-result-actions .btn {
    width: 100%;
    padding: 0.75rem 0.65rem;
    font-size: 0.88rem;
}

.shorten-result-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.shorten-result-qr-card {
    position: relative;
    padding: 1.5rem 1.25rem 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.shorten-result-qr-label {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    padding: 0.2rem 0.55rem;
    background: rgba(20, 184, 166, 0.12);
    color: var(--primary-light);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.shorten-result-qr-image {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0 1rem;
}

.shorten-result-qr-image img {
    display: block;
    border-radius: 8px;
    background: white;
    padding: 0.5rem;
}

.shorten-result-qr-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.shorten-result-qr-actions .btn {
    width: 100%;
}

/* Features Checklist */
.features-checklist {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.75rem;
    max-width: 100%;
    margin: 0 auto 3rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.page-home .features-checklist {
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    justify-content: space-between;
    width: 100%;
}

.page-home .check-item {
    padding: 0.42rem 0.7rem;
    font-size: 0.8rem;
    gap: 0.45rem;
    border-radius: 50px;
}

.page-home .check-icon {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
}

.features-checklist::-webkit-scrollbar {
    display: none;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.check-icon {
    width: 22px; height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.15);
    color: var(--primary-light);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.page-home .tools-grid {
    gap: 2.85rem;
}

.page-home .tool-card {
    padding: 0.85rem 1rem;
    gap: 0.7rem;
}

.page-home .tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.page-home .tool-card h3 {
    font-size: 0.88rem;
}

.page-home .tool-card p {
    font-size: 0.78rem;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.tool-icon {
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.tool-icon-teal { background: rgba(20, 184, 166, 0.12); color: var(--primary-light); }
.tool-icon-amber { background: rgba(245, 158, 11, 0.12); color: var(--accent); }
.tool-icon-violet { background: rgba(139, 92, 246, 0.12); color: var(--violet); }

.tool-card h3 { font-size: 0.95rem; margin: 0 0 0.2rem; white-space: nowrap; flex-shrink: 0; }
.tool-card p { color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; margin: 0; min-width: 0; }

/* ---- Page Hero (About, Tools) ---- */
.page-hero { padding: 3rem 0 2rem; text-align: center; }
.page-hero-sm { padding: 2.5rem 0 1.5rem; }

.page-hero-inner { max-width: 640px; margin: 0 auto; }

.page-badge {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: 50px;
    font-size: 0.82rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

.page-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.page-lead {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ---- About Page ---- */
.about-section { padding: 2rem 0 4rem; }

.about-intro-card {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    padding: 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.about-intro-icon {
    width: 72px; height: 72px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(20,184,166,0.15), rgba(245,158,11,0.1));
    border-radius: 20px;
    color: var(--primary-light);
}

.about-intro-card h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.about-intro-card p { color: var(--text-muted); line-height: 1.8; }

.features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 720px;
    margin: 0 auto 3rem;
}

.feature-row {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.feature-row:hover { border-color: var(--border-hover); }

.feature-row-icon {
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.1);
    border-radius: 12px;
    color: var(--primary-light);
    flex-shrink: 0;
}

.feature-row h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.feature-row p { color: var(--text-muted); font-size: 0.9rem; }

.about-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* About page — compact layout */
.page-about .about-page {
    padding: 1.75rem 0 2.5rem;
}

.page-about .about-header {
    text-align: center;
    max-width: 560px;
    margin: 0 auto 1.75rem;
}

.page-about .about-header h1 {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.page-about .about-header .page-lead {
    font-size: 0.95rem;
    line-height: 1.65;
}

.page-about .about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

.page-about .about-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
}

.page-about .about-panel-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
}

.page-about .about-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.page-about .about-feature-card {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.7rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: var(--transition);
}

.page-about .about-feature-card:hover {
    border-color: var(--border-hover);
}

.page-about .about-feature-card-wide {
    grid-column: 1 / -1;
}

.page-about .about-feature-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.1);
    border-radius: 10px;
    color: var(--primary-light);
    flex-shrink: 0;
}

.page-about .about-feature-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.page-about .about-feature-card p {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.45;
    margin: 0;
}

.page-about .faq-list-compact {
    gap: 0.45rem;
}

.page-about .faq-list-compact .faq-item summary {
    padding: 0.75rem 0.9rem;
    font-size: 0.84rem;
}

.page-about .faq-list-compact .faq-item p {
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
    line-height: 1.55;
}

@media (max-width: 900px) {
    .page-about .about-grid {
        grid-template-columns: 1fr;
    }

    .page-about .about-features-grid {
        grid-template-columns: 1fr;
    }

    .page-about .about-feature-card-wide {
        grid-column: auto;
    }
}

/* ---- Contact Page ---- */
.page-contact .contact-intro {
    max-width: 680px;
    margin: 0 auto 1.25rem;
    line-height: 1.9;
}

.page-contact .contact-intro a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.page-contact .contact-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.contact-links-section {
    padding: 0 0 1.5rem;
}

.page-contact:has(#terms:target) .page-hero,
.page-contact:has(#terms:target) .faq-section {
    display: none;
}

.page-contact:has(#terms:target) .contact-terms-section {
    padding-top: 0.5rem;
}

.contact-links-bar a[href="#terms"].is-active,
.page-contact:has(#terms:target) .contact-links-bar a[href="#terms"] {
    color: var(--primary-light);
}

.contact-links-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.contact-links-bar a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color var(--transition);
}

.contact-links-bar a:hover {
    color: var(--accent-light);
}

.contact-links-sep {
    color: var(--text-muted);
    opacity: 0.6;
}

.contact-telegram-id {
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 0.85rem;
    opacity: 0.9;
}

.contact-section-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    text-align: center;
}

.contact-terms-section {
    padding: 0 0 2.5rem;
    scroll-margin-top: calc(var(--site-header-height) + 1rem);
}

.contact-terms-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.contact-terms-card p,
.contact-terms-card li {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.8;
}

.contact-terms-card ul {
    margin: 1rem 0;
    padding-right: 1.25rem;
}

.contact-terms-card a {
    color: var(--primary-light);
}

.contact-terms-ads {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ---- FAQ ---- */
.faq-section { padding: 2rem 0 4rem; }

.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.faq-item summary {
    padding: 1.1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    list-style: none;
    transition: var(--transition);
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--primary-light); }
.faq-item[open] summary { border-bottom: 1px solid var(--border); color: var(--primary-light); }
.faq-item p { padding: 1rem 1.5rem; color: var(--text-muted); font-size: 0.92rem; line-height: 1.7; }
.faq-item a { color: var(--primary-light); }

/* ---- Tool Pages ---- */
.tool-section { padding: 1rem 0 4rem; }

.tool-card-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.tool-form .form-group { margin-bottom: 1.25rem; }

.tool-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-overview-sm { grid-template-columns: repeat(2, 1fr); }

.stat-box {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat-box-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-light);
    line-height: 1.2;
}

.stat-box-value.stat-box-sm { font-size: 1rem; color: var(--text-secondary); }

.stat-box-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; display: block; }

/* Public stats page (negareno-style) */
.page-stats-public .main-content { padding-top: 2rem; }

.stats-public-section {
    padding: 2rem 0 4rem;
}

.container-stats {
    max-width: 900px;
}

.stats-lookup-bar {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    direction: rtl;
}

.stats-lookup-input {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1rem;
    font-family: 'Vazirmatn', system-ui, sans-serif;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg-elevated);
    border: 2px solid #e8c547;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.stats-lookup-input:focus {
    border-color: #d4a82a;
    box-shadow: 0 0 0 3px rgba(232, 197, 71, 0.25);
}

.stats-lookup-btn {
    flex-shrink: 0;
    padding: 0.85rem 1.75rem;
    font-family: 'Vazirmatn', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #168a7b;
    border: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
}

.stats-lookup-btn:hover { background: #127a6d; }

.stats-lookup-errors {
    text-align: center;
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: -0.5rem;
}

.stats-public-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stats-public-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 110px;
    padding: 1rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    text-align: center;
}

.stats-public-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}

.stats-public-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

.stats-public-datetime {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 1rem;
    font-weight: 600;
}

.stats-public-url {
    padding: 1rem 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    word-break: break-all;
}

[data-theme="light"] .stats-lookup-input {
    background: #fff;
    border-color: #e8c547;
}

[data-theme="light"] .stats-public-card,
[data-theme="light"] .stats-public-url {
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

@media (max-width: 640px) {
    .stats-public-grid { grid-template-columns: 1fr; }
    .stats-lookup-bar { flex-direction: column; }
    .stats-lookup-input {
        border-radius: var(--radius-sm);
        border-width: 2px;
    }
    .stats-lookup-btn { border-radius: var(--radius-sm); }
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.detail-card h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.url-display {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.check-result { margin-top: 1.5rem; }
.check-result-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }

.utm-result { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.utm-result label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.utm-hint { margin-top: 0.75rem; font-size: 0.85rem; color: var(--text-muted); }
.utm-hint a { color: var(--primary-light); }

.password-panel { text-align: center; }
.password-icon { color: var(--accent); margin-bottom: 1rem; }
.password-panel h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.password-panel > p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select,
.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.form-group-highlight input { padding: 1rem; font-size: 1rem; }

.input-prefix {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.input-prefix:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.input-prefix .prefix {
    padding: 0.8rem 0.75rem;
    background: rgba(0,0,0,0.2);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: monospace;
    border-left: 1px solid var(--border);
    white-space: nowrap;
}

.input-prefix input {
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.input-prefix input:focus { box-shadow: none; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.help-text { display: block; margin-top: 0.35rem; color: var(--text-muted); font-size: 0.82rem; }
.field-errors { color: var(--danger); font-size: 0.82rem; margin-top: 0.35rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.badge-amber { background: rgba(245, 158, 11, 0.12); color: var(--accent); }
.badge-teal { background: rgba(20, 184, 166, 0.12); color: var(--primary-light); }

.code-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.25);
    border-radius: 6px;
    color: var(--primary-light);
    font-family: monospace;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.code-badge:hover { background: rgba(20, 184, 166, 0.18); }
.code-badge-lg { font-size: 1.1rem; padding: 0.4rem 0.9rem; }

/* ---- Auth Pages ---- */
.auth-page { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 140px); }

.auth-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.06), rgba(245, 158, 11, 0.04));
    border-left: 1px solid var(--border);
}

.auth-visual-content { max-width: 400px; }

.auth-visual-icon {
    width: 80px; height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 20px;
    color: white;
    margin-bottom: 1.5rem;
}

.auth-visual h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.75rem; }
.auth-visual p { color: var(--text-muted); margin-bottom: 2rem; }

.auth-features-list { list-style: none; display: flex; flex-direction: column; gap: 0.85rem; }
.auth-features-list li { display: flex; align-items: center; gap: 0.6rem; color: var(--text-secondary); font-size: 0.95rem; }
.auth-features-list svg { color: var(--success); flex-shrink: 0; }

.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card-header { text-align: center; margin-bottom: 2rem; }
.auth-card-header h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.35rem; }
.auth-card-header p { color: var(--text-muted); font-size: 0.95rem; }
.auth-footer { text-align: center; margin-top: 1.75rem; color: var(--text-muted); font-size: 0.9rem; }
.auth-footer a { color: var(--primary-light); font-weight: 600; text-decoration: none; }

/* ---- Dashboard ---- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    align-items: start;
    min-height: calc(100vh - 70px);
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2rem;
    gap: 0;
}

.dashboard-sidebar {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    display: flex;
    flex-direction: column;
    align-self: start;
    width: 260px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .dashboard-sidebar {
    background: #fff;
    border-color: #e8edf3;
}

.sidebar-header { padding: 0.25rem 0.5rem 1rem; }
.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}
.sidebar-header p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
}

.sidebar-link svg {
    color: currentColor;
    flex-shrink: 0;
}

.sidebar-link:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.sidebar-link.active {
    color: var(--primary-dark);
    background: rgba(20, 184, 166, 0.14);
    border-color: rgba(20, 184, 166, 0.28);
    font-weight: 600;
}

[data-theme="dark"] .sidebar-link.active {
    color: var(--primary-light);
    background: rgba(20, 184, 166, 0.16);
    border-color: rgba(45, 212, 191, 0.35);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    margin-top: 0.75rem;
    background: var(--surface-hover);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.sidebar-user .avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
}

.sidebar-user strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
}
.sidebar-user span {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.dashboard-main { padding: 0 2rem 2rem; overflow-x: hidden; }

.page-dashboard .glass-card {
    padding: 1.5rem 1.5rem 1.35rem;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .page-dashboard .glass-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: #e8edf3;
}

.page-dashboard .card-header h2 svg {
    padding: 0.35rem;
    border-radius: 10px;
    background: rgba(20, 184, 166, 0.1);
    color: var(--primary-dark);
}

.page-dashboard .dashboard-no-results {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 2rem 1rem;
}

.dashboard-links-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.dashboard-links-toolbar-start {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.links-list-bulk-delete-form {
    margin: 0;
}

.dashboard-bulk-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), opacity var(--transition);
}

.dashboard-bulk-delete-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.5);
}

.dashboard-bulk-delete-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

[data-theme="light"] .dashboard-links-toolbar {
    border-bottom-color: #e8edf3;
}

.dashboard-select-all {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    user-select: none;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    transition: background var(--transition), color var(--transition);
}

.dashboard-select-all:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.dashboard-select-all input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.dashboard-links-tools {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    justify-content: flex-end;
    min-width: min(100%, 420px);
}

.dashboard-search-wrap {
    position: relative;
    flex: 1;
    max-width: 360px;
}

.dashboard-search-input {
    width: 100%;
    padding: 0.72rem 2.6rem 0.72rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--bg-elevated);
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

[data-theme="light"] .dashboard-search-input {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.dashboard-search-input:focus {
    outline: none;
    border-color: var(--border-hover);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
    background: var(--bg-elevated);
}

[data-theme="light"] .dashboard-search-input:focus {
    background: #fff;
}

.dashboard-search-icon {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.dashboard-sort-wrap {
    position: relative;
    flex-shrink: 0;
}

.dashboard-sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

[data-theme="light"] .dashboard-sort-btn {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.dashboard-sort-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: rgba(20, 184, 166, 0.08);
    transform: translateY(-1px);
}

.dashboard-sort-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 50;
    min-width: 160px;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
}

.dashboard-sort-menu button {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    text-align: right;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.dashboard-sort-menu button:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.dashboard-no-results {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1.5rem 1rem 0.5rem;
}

.data-table .col-check {
    width: 42px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.data-table .col-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.dashboard-create-wrap {
    max-width: 920px;
    margin: 0 auto;
}

.dashboard-create-wrap .shorten-panel {
    margin-bottom: 0;
    max-width: none;
}

.dashboard-create-wrap .dashboard-advanced-options {
    margin-top: 0.85rem;
}

.dashboard-advanced-options {
    margin: 0 0 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    overflow: hidden;
}

.dashboard-advanced-options summary {
    padding: 0.85rem 1rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    list-style: none;
    user-select: none;
}

.dashboard-advanced-options summary::-webkit-details-marker {
    display: none;
}

.dashboard-advanced-options[open] summary {
    border-bottom: 1px solid var(--border);
}

.dashboard-advanced-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-advanced-body .form-group {
    margin: 0;
}

.dashboard-advanced-body label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

@media (max-width: 900px) {
    .dashboard-links-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-links-tools {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .dashboard-search-wrap {
        max-width: none;
        flex: 1;
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
}

.page-header h1 { font-size: 1.75rem; font-weight: 800; }
.page-subtitle { color: var(--text-muted); font-size: 0.95rem; margin-top: 0.25rem; }

.page-header-intro {
    min-width: 0;
}

.page-header-greeting {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.dashboard-logout-card {
    display: inline-flex;
    margin: 0;
}

.dashboard-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.62rem 1rem;
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.dashboard-logout-btn:hover {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.42);
    transform: translateY(-1px);
}

[data-theme="light"] .dashboard-logout-btn {
    background: #fff5f5;
    border-color: #fecaca;
    color: #dc2626;
}

[data-theme="light"] .dashboard-logout-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.breadcrumb a { color: var(--primary-light); text-decoration: none; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-grid-simple {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    transition: var(--transition);
}

.stat-card-simple {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.65rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.stat-card-simple::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0.85;
}

.stat-card-simple:nth-child(2)::before {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.stat-card-simple:nth-child(3)::before {
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.stat-card-simple:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
    border-color: var(--border-hover);
}

.stat-card-simple .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-card-simple .stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.stat-card:hover { transform: translateY(-2px); }
.stat-card-simple:hover { transform: translateY(-3px); }

.stat-icon {
    width: 52px; height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex-shrink: 0;
}

.stat-card-purple .stat-icon { background: rgba(139, 92, 246, 0.12); color: var(--violet); }
.stat-card-cyan .stat-icon { background: rgba(20, 184, 166, 0.12); color: var(--primary-light); }
.stat-card-pink .stat-icon { background: rgba(245, 158, 11, 0.12); color: var(--accent); }

.stat-info .stat-value { display: block; font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
.stat-info .stat-label { color: var(--text-muted); font-size: 0.85rem; }

.stat-value-lg {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Table */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 0.9rem 1rem; text-align: right; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; }
.table-row-hover:hover { background: rgba(255,255,255,0.02); }
.url-cell { font-family: monospace; font-size: 0.82rem; color: var(--text-muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.click-count { font-weight: 700; color: var(--primary-light); }
.date-cell { color: var(--text-muted); font-size: 0.88rem; }

/* Link Detail */
.link-detail-card { margin-bottom: 1.5rem; }

.link-detail-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.link-detail-main { flex: 1; min-width: 250px; }
.link-title { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 1rem; font-weight: 500; }

.link-stat-box {
    text-align: center;
    padding: 1.25rem 2rem;
    background: rgba(20, 184, 166, 0.06);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: var(--radius);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    gap: 0.85rem;
    padding: 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.detail-icon {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 184, 166, 0.1);
    border-radius: 8px;
    color: var(--primary-light);
    flex-shrink: 0;
}

.detail-label { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 0.2rem; }
.detail-value { font-size: 0.92rem; word-break: break-all; }
.url-value { font-family: monospace; font-size: 0.85rem; color: var(--text-secondary); }

.qr-section {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.stats-link-box { flex: 1; min-width: 200px; }

.action-buttons {
    display: flex;
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 160px;
    padding-top: 1rem;
}

.chart-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.chart-bar-wrap {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.chart-bar {
    width: 70%;
    max-width: 40px;
    height: calc(var(--bar-h, 1) * 12px);
    min-height: 4px;
    max-height: 100%;
    background: linear-gradient(to top, var(--primary-dark), var(--primary-light));
    border-radius: 6px 6px 2px 2px;
}

.chart-label { font-size: 0.72rem; color: var(--text-muted); }
.chart-value { font-size: 0.78rem; font-weight: 700; color: var(--primary-light); }

.clicks-list { display: flex; flex-direction: column; gap: 0.5rem; }

.click-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
}

.click-time { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text-secondary); }
.click-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; }
.click-ip { font-family: monospace; font-size: 0.82rem; color: var(--primary-light); }
.click-referer { font-size: 0.78rem; color: var(--text-muted); }

/* Profile */
.profile-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; align-items: start; }
.profile-card-side { text-align: center; }
.profile-avatar-large { width: 100px; height: 100px; margin: 0 auto 1rem; border-radius: 50%; overflow: hidden; border: 3px solid rgba(20, 184, 166, 0.3); }
.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; }

.avatar-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
}

.profile-card-side h2 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.profile-email { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.25rem; }
.profile-meta .meta-item { display: flex; align-items: center; justify-content: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text-muted); }
.profile-form-card h3 { margin-bottom: 1.5rem; font-size: 1.1rem; }

/* Error Page */
.error-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 200px); padding: 2rem 0; }
.error-card { max-width: 480px; text-align: center; padding: 3rem 2rem; }
.error-icon { color: var(--danger); margin-bottom: 1rem; opacity: 0.8; }
.error-code {
    display: inline-block;
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--danger), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.error-card h1 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.error-card p { color: var(--text-muted); margin-bottom: 2rem; }
.error-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* Empty State */
.empty-state { text-align: center; padding: 3rem 2rem; }
.empty-state-sm { padding: 2rem 1rem; }
.empty-icon { color: var(--text-muted); opacity: 0.5; margin-bottom: 1rem; }
.empty-state h2, .empty-state h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; max-width: 320px; margin-left: auto; margin-right: auto; }

/* Toast */
.toast-container {
    position: fixed;
    top: calc(var(--site-header-height) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 90%;
    max-width: 420px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    animation: slideDown 0.4s ease;
    font-size: 0.9rem;
}

.toast-success { border-color: rgba(34, 197, 94, 0.3); }
.toast-error, .toast-danger { border-color: rgba(239, 68, 68, 0.3); }
.toast-warning { border-color: rgba(245, 158, 11, 0.3); }

.toast-close {
    margin-right: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.25rem;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.5s ease; }

/* Footer */
.footer {
    margin-top: auto;
    padding: 3rem 0 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--footer-bg);
    transition: background var(--transition), border-color var(--transition);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand p { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.5rem; }

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-col { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col a { color: var(--text-muted); text-decoration: none; font-size: 0.88rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--primary-light); }

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-sidebar { display: none; }
    .profile-layout { grid-template-columns: 1fr; }
    .form-row, .advanced-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .stats-overview { grid-template-columns: 1fr; }
    .stats-grid-simple { grid-template-columns: 1fr; }
    .stats-public-grid { grid-template-columns: 1fr; }
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--navbar-bg);
        backdrop-filter: blur(20px);
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        gap: 0.25rem;
        margin-right: 0;
    }

    .nav-links.open { display: flex; }
    .nav-link { width: 100%; padding: 0.75rem 1rem; }
    .navbar .container { position: relative; }

    .hero { padding: 2rem 0 3rem; }
    .shorten-panel { padding: 1.5rem; }
    .url-input-group { flex-direction: column; }
    .url-input-group.url-input-slug {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        min-height: 44px;
        overflow-x: auto;
    }
    .url-input-slug .url-input-prefix {
        padding: 0 0.1rem 0 0.65rem;
        font-size: 0.85rem;
        line-height: 1;
    }
    .shorten-field-col .url-input-slug,
    .shorten-field-col .url-input-slug .url-field-wrap,
    .shorten-field-col .url-input-slug .url-field-wrap input {
        min-height: 44px;
    }
    .url-input-slug .url-field-wrap input {
        min-height: 44px;
        height: 44px;
        padding: 0 0.65rem 0 0;
        line-height: 1;
        font-size: 0.85rem;
    }
    .domain-prefix { border-left: none; border-bottom: 1px solid var(--border); justify-content: center; }
    .dashboard-main { padding: 1.25rem; }
    .page-header { flex-direction: column; align-items: stretch; }
    .result-url { flex-direction: column; }
    .card { padding: 1.5rem; }
    .features-checklist { justify-content: flex-start; padding: 0 0.5rem; }
    .tools-grid { grid-template-columns: 1fr; }
    .shorten-result-actions,
    .shorten-result-qr-actions { grid-template-columns: 1fr; }
}

.page-dashboard .footer, .page-auth .footer,
.page-dashboard .site-footer, .page-auth .site-footer { margin-top: 0; }

/* ---- Phone Auth ---- */
.auth-phone-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 180px);
    padding: 2rem 1rem;
}

.auth-phone-card {
    width: 100%;
    max-width: 520px;
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.auth-phone-card h1 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.75rem;
    line-height: 1.7;
}

.auth-phone-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.auth-phone-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.auth-phone-row input,
.auth-phone-row .phone-input,
.auth-phone-row .otp-input {
    flex: 1;
    padding: 0.9rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
    outline: none;
    transition: var(--transition);
}

.auth-phone-row input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.auth-phone-row .btn {
    padding: 0.9rem 1.5rem;
    white-space: nowrap;
    min-width: 110px;
}

.auth-phone-row-otp input {
    letter-spacing: 0.5em;
    font-size: 1.25rem;
    font-weight: 700;
}

.auth-phone-terms {
    margin-top: 1.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.auth-phone-terms a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-phone-terms a:hover {
    text-decoration: underline;
}

.auth-phone-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.my-links-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Links list — premium card rows */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

[data-theme="light"] .links-list {
    background: transparent;
    border-color: transparent;
}

.links-list-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.05rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-elevated);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
}

[data-theme="light"] .links-list-row {
    border-color: #e8edf3;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.links-list-row:last-child {
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .links-list-row:last-child {
    border-bottom-color: #e8edf3;
}

.links-list-row:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background: var(--surface-hover);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .links-list-row:hover {
    background: #fff;
    border-color: rgba(20, 184, 166, 0.22);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(20, 184, 166, 0.08);
}

.links-list-row--inactive {
    opacity: 0.72;
}

.links-list-row--inactive:hover {
    transform: none;
}

.links-list-check {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
}

.links-list-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 4px;
}

.links-list-pin {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    opacity: 0.28;
    flex-shrink: 0;
    transition: opacity var(--transition), color var(--transition);
}

.links-list-row:hover .links-list-pin {
    opacity: 0.5;
}

.links-list-short {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    min-width: 0;
}

.links-list-short-url {
    font-weight: 700;
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 0.86rem;
    white-space: nowrap;
    transition: var(--transition);
    padding: 0.38rem 0.7rem;
    border-radius: 9px;
    background: rgba(20, 184, 166, 0.09);
    border: 1px solid rgba(20, 184, 166, 0.16);
    letter-spacing: -0.01em;
}

[data-theme="light"] .links-list-short-url {
    color: #0f766e;
    background: rgba(20, 184, 166, 0.08);
}

.links-list-short-url:hover {
    color: var(--primary-dark);
    background: rgba(20, 184, 166, 0.14);
    border-color: rgba(20, 184, 166, 0.28);
    transform: translateY(-1px);
}

.links-list-actions-inline {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}

.links-list-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    background: var(--surface-hover);
    color: var(--text-muted);
    border-radius: 9px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    flex-shrink: 0;
}

[data-theme="light"] .links-list-action {
    background: #f1f5f9;
    color: #64748b;
}

.links-list-action:hover {
    background: rgba(20, 184, 166, 0.12);
    border-color: rgba(20, 184, 166, 0.2);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.links-list-action.copied {
    color: var(--success);
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.2);
}

.links-list-stats {
    flex-shrink: 0;
    min-width: 96px;
}

.links-list-stats a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
    padding: 0.35rem 0.65rem;
    border-radius: 50px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

[data-theme="light"] .links-list-stats a {
    background: #f8fafc;
    border-color: #e8edf3;
    color: #475569;
}

.links-list-stats a:hover {
    color: var(--text);
    background: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.18);
}

.links-list-stats a svg {
    opacity: 0.75;
}

.links-list-dest {
    flex: 1;
    min-width: 80px;
    font-size: 0.82rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    transition: color var(--transition);
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
}

.links-list-dest:hover {
    color: var(--text-secondary);
    background: var(--surface-hover);
}

.links-list-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    flex-shrink: 0;
    min-width: 68px;
    padding-inline-start: 0.35rem;
}

.links-list-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: 50px;
    letter-spacing: 0.01em;
}

.links-list-status--active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(34, 197, 94, 0.08));
    color: #16a34a;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.22);
}

.links-list-status--inactive {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(239, 68, 68, 0.06));
    color: #dc2626;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.2);
}

.links-list-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.links-list-edit {
    margin-inline-start: 0.15rem;
}

.links-list-delete-form {
    display: inline-flex;
    margin: 0;
}

.links-list-delete:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: var(--danger);
}

.links-list-edit:hover {
    background: rgba(20, 184, 166, 0.12);
    color: var(--primary-dark);
}

.links-list--teal .links-list-short-url {
    background: rgba(20, 184, 166, 0.09);
    border-color: rgba(20, 184, 166, 0.16);
    color: #0f766e;
}

.links-list--teal .links-list-short-url:hover,
.links-list--teal .links-list-stats a:hover {
    color: var(--primary-dark);
}

.links-list--teal .links-list-stats a:hover svg {
    color: var(--primary);
}

.links-list--teal .links-list-check input {
    accent-color: var(--primary);
}

.links-list--teal .links-list-action:hover,
.links-list--teal .links-list-edit:hover {
    background: rgba(20, 184, 166, 0.12);
    border-color: rgba(20, 184, 166, 0.2);
    color: var(--primary-dark);
}

.links-list--teal .links-list-delete:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: var(--danger);
}

.links-list--violet .links-list-short-url {
    background: rgba(139, 92, 246, 0.09);
    border-color: rgba(139, 92, 246, 0.18);
    color: #7c3aed;
}

.links-list--violet .links-list-short-url:hover {
    color: #6d28d9;
    background: rgba(139, 92, 246, 0.14);
    border-color: rgba(139, 92, 246, 0.28);
}

.links-list--violet .links-list-action:hover,
.links-list--violet .links-list-edit:hover,
.links-list--violet .links-list-stats a:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
    color: #7c3aed;
}

.links-list--violet .links-list-delete:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: var(--danger);
}

.links-list--violet .links-list-check input {
    accent-color: #8b5cf6;
}

.links-list--violet .dashboard-search-input:focus {
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

[data-theme="light"] .links-list--violet .links-list-row:hover {
    border-color: rgba(139, 92, 246, 0.22);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(139, 92, 246, 0.08);
}


.my-links-actions {
    display: flex;
    gap: 0.5rem;
}

/* My Links table — same layout as dashboard, violet accent theme */
.page-my-links .my-links-table-card {
    padding: 1.25rem 1.25rem 0.5rem;
}

.page-my-links .my-links-table-card .code-badge {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.28);
    color: #a78bfa;
}

[data-theme="light"] .page-my-links .my-links-table-card .code-badge {
    color: #7c3aed;
}

.page-my-links .my-links-table-card .code-badge:hover {
    background: rgba(139, 92, 246, 0.16);
}

.page-my-links .my-links-table-card .click-count {
    color: #a78bfa;
}

[data-theme="light"] .page-my-links .my-links-table-card .click-count {
    color: #7c3aed;
}

.page-my-links .my-links-table-card .dashboard-select-all input,
.page-my-links .my-links-table-card .col-check input {
    accent-color: #8b5cf6;
}

.page-my-links .my-links-table-card .dashboard-search-input:focus {
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

.page-my-links .my-links-table-card .table-row-hover:hover {
    background: rgba(139, 92, 246, 0.05);
}

[data-theme="light"] .page-my-links .my-links-table-card .table-row-hover:hover {
    background: rgba(139, 92, 246, 0.04);
}

.page-my-links .my-links-table-card .dashboard-sort-btn:hover {
    border-color: rgba(139, 92, 246, 0.35);
    color: #a78bfa;
}

.btn-icon-only {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {
    .auth-phone-row {
        flex-direction: column;
    }

    .auth-phone-row .btn {
        width: 100%;
    }
}

/* Legacy aliases */
.gradient-text { background: linear-gradient(135deg, var(--primary-light), var(--accent-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { color: var(--text-muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 2.5rem; }
.shorten-card { max-width: 640px; margin: 0 auto 3rem; text-align: right; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.feature { padding: 2rem; text-align: center; transition: var(--transition); }
.feature:hover { transform: translateY(-4px); border-color: var(--border-hover); }
.feature-icon { width: 60px; height: 60px; margin: 0 auto 1.25rem; display: flex; align-items: center; justify-content: center; border-radius: 16px; }
.feature-icon-purple { background: rgba(139, 92, 246, 0.12); color: var(--violet); }
.feature-icon-cyan { background: rgba(20, 184, 166, 0.12); color: var(--primary-light); }
.feature-icon-pink { background: rgba(245, 158, 11, 0.12); color: var(--accent); }
.feature h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature p { color: var(--text-muted); font-size: 0.9rem; }
.stats-bar { display: flex; justify-content: center; align-items: center; gap: 2rem; margin-bottom: 4rem; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 1.5rem; font-weight: 800; }
.stat-text { font-size: 0.85rem; color: var(--text-muted); }
.stat-divider { width: 1px; height: 40px; background: var(--border); }
.form-card { max-width: 720px; }

/* ============================================
   Network Section (above footer)
   ============================================ */
.network-section {
    margin-top: auto;
    padding: 1rem 0 0.35rem;
}

.network-section .container {
    max-width: 1200px;
}

.network-section-box {
    border: 2px solid rgba(15, 23, 42, 0.14);
    border-radius: 16px;
    padding: 1.35rem 1.5rem 1.1rem;
    background-color: #c8d0dc;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.42) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.42) 1px, transparent 1px),
        linear-gradient(180deg, #d5dce6 0%, #bcc6d4 100%);
    background-size: 20px 20px, 20px 20px, 100% 100%;
    box-shadow:
        0 8px 24px rgba(15, 23, 42, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .network-section-box {
    border-color: rgba(255, 255, 255, 0.12);
    background-color: #141c2b;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, #1a2438 0%, #0f1624 100%);
    background-size: 20px 20px, 20px 20px, 100% 100%;
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.network-bar {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
}

.network-bar-inner {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    align-items: stretch;
    gap: 1.85rem;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding-bottom: 0.15rem;
    direction: ltr;
}

.network-bar-inner::-webkit-scrollbar {
    display: none;
}

.network-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 100px;
    padding: 0.7rem 0.35rem 0.55rem;
    text-decoration: none;
    color: #111827;
    background: linear-gradient(180deg, #ffffff 0%, #eef2f7 100%);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 12px 12px 10px 10px;
    box-shadow:
        0 10px 20px rgba(15, 23, 42, 0.24),
        0 2px 0 rgba(255, 255, 255, 0.85) inset;
    transform: perspective(500px) rotateX(4deg) skewX(-3deg);
    transform-origin: center bottom;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

[data-theme="dark"] .network-card {
    color: #0f172a;
    background: linear-gradient(180deg, #ffffff 0%, #e7edf5 100%);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.45),
        0 2px 0 rgba(255, 255, 255, 0.9) inset;
}

.network-card:hover {
    transform: perspective(500px) rotateX(0deg) skewX(0deg) translateY(-3px);
    box-shadow:
        0 14px 28px rgba(15, 23, 42, 0.28),
        0 2px 0 rgba(255, 255, 255, 0.95) inset;
}

.network-card-accent {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 6px;
    border-radius: 12px 12px 0 0;
    background: var(--card-accent);
}

.network-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.45rem;
    margin-bottom: 0.3rem;
    color: var(--card-accent);
}

.network-card-icon svg {
    display: block;
    width: 32px;
    height: 32px;
}

.network-card-name {
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    letter-spacing: -0.01em;
}

@media (max-width: 900px) {
    .network-bar-inner {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        gap: 1.25rem;
    }

    .network-bar-inner::-webkit-scrollbar {
        display: none;
    }

    .network-card {
        flex: 0 0 112px;
        width: 112px;
        min-height: 90px;
    }

    .network-card-icon svg {
        width: 28px;
        height: 28px;
    }

    .network-card-name {
        font-size: 0.62rem;
    }
}

@media (max-width: 640px) {
    .network-section-box {
        padding: 0.75rem 0.55rem 0.65rem;
        border-radius: 12px;
    }

    .network-bar {
        justify-content: flex-start;
    }

    .network-bar-inner {
        justify-content: flex-start;
        gap: 0.75rem;
        padding-inline: 0.15rem 0.35rem;
        padding-bottom: 0.35rem;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        scroll-snap-type: x proximity;
    }

    .network-card {
        flex: 0 0 92px;
        width: 92px;
        min-height: 84px;
        scroll-snap-align: start;
    }
}

/* ============================================
   Site Header & Horizontal Navigation
   ============================================ */
.site-header {
    --header-bg: #ffffff;
    --header-border: #e8e8e8;
    --header-hover: #f8f9fa;
    --header-active-bg: #fff9e6;
    --header-active-bar: #f5c518;

    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 300;
    display: flex;
    justify-content: center;
    width: 100%;
    height: var(--site-header-height);
    background: var(--header-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .site-header {
    --header-bg: var(--bg-elevated);
    --header-border: var(--border);
    --header-hover: rgba(255, 255, 255, 0.04);
    --header-active-bg: rgba(245, 197, 24, 0.12);
}

.site-header-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    height: var(--site-header-height);
    padding: 0 1rem;
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.site-header-inner::-webkit-scrollbar {
    display: none;
}

.site-header-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
    margin-bottom: 0.65rem;
}

.site-header-logo .logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
}

.site-header-brand {
    display: none;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: auto;
    padding: 0.15rem 0;
}

.site-logo {
    display: block;
    width: auto;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(139, 92, 246, 0.22));
    transition: transform 0.2s ease, filter 0.2s ease;
}

.site-header-brand:hover .site-logo,
.header-nav-brand:hover .site-logo,
.header-nav-drawer-brand:hover .site-logo {
    transform: scale(1.03);
    filter: drop-shadow(0 3px 10px rgba(20, 184, 166, 0.28));
}

.header-nav-drawer-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    padding: 0.15rem 0;
}

.header-nav-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 1.1rem;
    text-decoration: none;
    border-left: 1px solid var(--header-border);
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.header-nav-brand:hover {
    background: var(--header-hover);
}

.header-nav-brand .site-logo {
    height: 46px;
}

.header-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: auto;
    border: 1px solid var(--header-border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}

.header-nav {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    flex-shrink: 0;
    gap: 0;
    width: max-content;
    max-width: none;
    border: 1px solid var(--header-border);
    border-radius: 12px;
    background: var(--header-bg);
    overflow: hidden;
}

.header-nav-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    flex: 0 0 auto;
}

.header-nav-divider {
    width: 1px;
    align-self: stretch;
    background: var(--header-border);
    margin: 0.35rem 0;
    flex-shrink: 0;
}

.header-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row-reverse;
    gap: 0.4rem;
    height: 44px;
    padding: 0 0.8rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.2s;
    position: relative;
    border-left: 1px solid var(--header-border);
    border-bottom: 3px solid transparent;
    flex-shrink: 0;
}

.header-nav > .header-nav-item:first-child {
    border-left: none;
}

.header-nav-item:hover {
    background: var(--header-hover);
}

.header-nav-item.active {
    background: var(--header-active-bg);
    border-bottom-color: var(--header-active-bar);
}

.header-nav-item.active::after {
    display: none;
}

.header-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.header-nav-item.active .header-nav-icon {
    color: var(--text);
}

.header-theme-item {
    cursor: default;
    justify-content: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header-theme-item .header-nav-label.theme-label-dark { display: none; }
[data-theme="dark"] .header-theme-item .header-nav-label.theme-label-light { display: none; }
[data-theme="dark"] .header-theme-item .header-nav-label.theme-label-dark { display: inline; }

.theme-switch {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    border: none;
    background: #e2e8f0;
    position: relative;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.theme-switch.is-light {
    background: #f5c518;
}

.theme-switch-knob {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s;
}

.theme-switch.is-light .theme-switch-knob {
    transform: translateX(-20px);
}

.header-theme-item .header-nav-icon .theme-icon-sun { display: none; }
.header-theme-item .header-nav-icon .theme-icon-moon { display: flex; }
[data-theme="light"] .header-theme-item .header-nav-icon .theme-icon-sun { display: flex; }
[data-theme="light"] .header-theme-item .header-nav-icon .theme-icon-moon { display: none; }

.header-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 290;
}

.header-nav-overlay.open {
    display: block;
}

.header-nav-drawer-top {
    display: none;
}

.header-nav-drawer-footer {
    display: contents;
}

.footer-compact {
    margin-top: auto;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    background: transparent;
}

.footer-compact .footer-bottom {
    padding-top: 0;
    border-top: none;
}

/* ---- Site Footer (Premium) ---- */
.footer-ads-wrap {
    margin-top: auto;
    padding: 1.25rem 0 0.25rem;
}

.footer-ads {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    direction: ltr;
}

.footer-ad-item {
    display: block;
    width: 140px;
    height: auto;
    aspect-ratio: 3 / 2;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    flex-shrink: 0;
}

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

.footer-ad-item:hover {
    transform: translateY(-3px);
    border-color: rgba(20, 184, 166, 0.35);
    box-shadow: 0 10px 24px rgba(20, 184, 166, 0.15);
}

[data-theme="light"] .footer-ad-item {
    background: #fff;
    border-color: #e8edf3;
}

@media (max-width: 640px) {
    .footer-ads {
        justify-content: center;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.35rem;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .footer-ad-item {
        width: 120px;
    }
}

.site-footer {
    position: relative;
    margin-top: auto;
    padding: 1.5rem 0 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--footer-bg);
}

.site-footer-inner {
    position: relative;
    z-index: 1;
}

.site-footer-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-bottom: 1rem;
}

.footer-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.footer-action-pill:hover {
    color: var(--text);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.footer-action-pill svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.footer-action-pill-telegram {
    border-color: rgba(34, 158, 217, 0.35);
    background: linear-gradient(135deg, rgba(34, 158, 217, 0.12), rgba(34, 158, 217, 0.04));
    color: #229ed9;
}

.footer-action-pill-telegram:hover {
    border-color: rgba(34, 158, 217, 0.55);
    color: #1d8ec4;
}

.footer-pill-sub {
    font-size: 0.78rem;
    opacity: 0.85;
    font-weight: 500;
}

.site-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    padding-top: 1.25rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.site-footer-bottom strong {
    color: var(--text-secondary);
    font-weight: 700;
}

.site-footer-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.6;
}

@media (max-width: 640px) {
    .site-footer {
        padding: 1.25rem 0 1rem;
    }

    .site-footer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-action-pill {
        justify-content: center;
    }
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.85rem;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--accent-light);
}

.footer-links-sep {
    color: var(--text-muted);
    opacity: 0.55;
    font-size: 0.85rem;
}

.qr-result {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.qr-result img {
    background: #fff;
    padding: 0.5rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

/* QR modal popup */
.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.qr-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.qr-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 26, 0.65);
    backdrop-filter: blur(4px);
}

[data-theme="light"] .qr-modal-overlay {
    background: rgba(15, 23, 42, 0.45);
}

.qr-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 340px);
    padding: 1.75rem 1.5rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transform: translateY(12px) scale(0.97);
    transition: transform 0.25s ease;
}

.qr-modal.is-open .qr-modal-dialog {
    transform: translateY(0) scale(1);
}

[data-theme="light"] .qr-modal-dialog {
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

.qr-modal-close {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--surface-hover);
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.qr-modal-close:hover {
    color: var(--text);
    background: rgba(239, 68, 68, 0.12);
}

.qr-modal-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background: rgba(20, 184, 166, 0.12);
    color: var(--primary-light);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 0.65rem;
}

.qr-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.qr-modal-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-light);
    margin: 0 0 1rem;
    word-break: break-all;
}

.qr-modal-image {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.qr-modal-image img {
    display: block;
    border-radius: 10px;
    background: #fff;
    padding: 0.5rem;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}

.qr-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

body.qr-modal-open {
    overflow: hidden;
}

.bookmarklet-btn {
    display: inline-block;
    margin: 1rem 0;
    font-size: 1.1rem;
    padding: 0.85rem 2rem;
}

@media (max-width: 1100px) {
    .site-header-inner {
        position: relative;
        justify-content: flex-start;
        overflow-x: visible;
    }

    .site-header-brand {
        display: inline-flex;
    }

    .header-nav-brand {
        display: none;
    }

    .header-nav-toggle {
        display: flex;
        position: relative;
        z-index: 320;
        margin-right: 0;
        margin-left: auto;
    }

    body.header-nav-open .site-header {
        background: transparent;
        box-shadow: none;
    }

    body.header-nav-open .header-nav-toggle {
        display: none;
    }

    body.header-nav-open .site-header-brand {
        visibility: hidden;
    }

    .header-nav-drawer-footer {
        display: flex;
        flex-direction: column;
        margin-top: auto;
        flex-shrink: 0;
        border-top: 1px solid var(--header-border);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--header-bg);
    }

    .header-nav-drawer-footer .header-theme-item {
        display: flex;
        flex-direction: row-reverse;
        justify-content: flex-start;
        border-bottom: none;
    }

    .header-nav-drawer-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        min-height: var(--site-header-height);
        padding: env(safe-area-inset-top, 0px) 1rem 0;
        border-bottom: 1px solid var(--header-border);
        background: var(--header-bg);
    }

    .header-nav-drawer-brand .site-logo {
        height: 42px;
    }

    .site-header-brand .site-logo {
        height: 44px;
    }

    .header-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: 1px solid var(--header-border);
        border-radius: 8px;
        background: transparent;
        color: var(--text);
        cursor: pointer;
        flex-shrink: 0;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: 0;
        display: flex;
        width: min(320px, 88vw);
        margin: 0;
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 0 0 1rem;
        border-radius: 0;
        border: none;
        border-left: 1px solid var(--header-border);
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 310;
    }

    .header-nav.open {
        transform: translateX(0);
    }

    .header-nav-group {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .header-nav > .header-nav-item,
    .header-nav-item {
        height: auto;
        border-left: none;
        border-bottom: 1px solid var(--header-border);
        justify-content: flex-start;
        flex-direction: row-reverse;
        padding: 0.9rem 1rem;
        font-size: 0.92rem;
    }

    .header-nav-divider {
        width: auto;
        height: 1px;
        margin: 0.5rem 1rem;
    }

    .header-nav-item.active {
        border-bottom-color: transparent;
        box-shadow: inset -4px 0 0 var(--header-active-bar);
    }

    .header-nav-item.active::after {
        display: none;
    }

    body.header-nav-open {
        overflow: hidden;
    }
}

.page-qr-tool .page-hero-inner {
    max-width: none;
}

.page-qr-tool .page-lead {
    white-space: nowrap;
    font-size: clamp(0.84rem, 1.35vw, 1.02rem);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .page-qr-tool .page-lead {
        white-space: normal;
        font-size: 0.95rem;
    }
}

/* ---- QR Tool (full generator) ---- */
.page-qr-tool .page-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    margin-bottom: 0.75rem;
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.25);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.qr-tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
    gap: 1.25rem;
    align-items: start;
}

.qr-tool-controls {
    padding: 1.5rem 1.65rem;
}

.qr-tool-preview {
    padding: 1.5rem;
    position: sticky;
    top: 5.5rem;
}

.qr-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.35rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}

.qr-tab {
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.qr-tab:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

.qr-tab.active {
    color: var(--primary-dark);
    background: rgba(20, 184, 166, 0.12);
    border-color: rgba(20, 184, 166, 0.3);
}

.qr-panel-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 1.1rem;
    color: var(--text);
}

.qr-tool-form .form-group {
    margin-bottom: 1.15rem;
}

.qr-tool-form label {
    display: block;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.page-qr-tool .qr-tool-form .form-control,
.page-qr-tool .qr-tool-form input.form-control,
.page-qr-tool .qr-tool-form textarea.form-control,
.page-qr-tool .qr-tool-form select.form-control {
    padding: 0.95rem 1.15rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.page-qr-tool .qr-tool-form textarea.form-control {
    line-height: 1.65;
}

.page-qr-tool .qr-inline-check {
    font-size: 0.95rem;
    font-weight: 600;
}

.page-qr-tool .qr-inline-check span {
    font-weight: 600;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.qr-inline-check {
    margin-bottom: 0.85rem;
}

.qr-customize-block {
    margin-top: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    overflow: hidden;
}

.qr-customize-block summary {
    padding: 0.95rem 1.15rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-secondary);
    list-style: none;
    user-select: none;
}

.qr-customize-block summary::-webkit-details-marker {
    display: none;
}

.qr-customize-block[open] summary {
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.qr-customize-body {
    padding: 1.15rem;
}

.qr-color-input {
    width: 100%;
    height: 48px;
    padding: 0.2rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-elevated);
    cursor: pointer;
}

.qr-range {
    width: 100%;
    accent-color: var(--primary);
}

.qr-logo-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.qr-logo-preset {
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.qr-logo-preset:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.qr-style-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: 0.5rem;
    width: 100%;
}

.qr-style-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    min-height: 58px;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.qr-style-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.qr-style-preview svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.qr-style-option svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.qr-style-option:hover {
    border-color: var(--border-hover);
    background: rgba(20, 184, 166, 0.08);
    transform: translateY(-1px);
}

.qr-style-option.active {
    border-color: rgba(20, 184, 166, 0.45);
    background: rgba(20, 184, 166, 0.14);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

[data-theme="light"] .qr-style-option {
    background: #fff;
}

[data-theme="light"] .qr-style-option.active {
    background: rgba(20, 184, 166, 0.1);
}

.qr-tool-note {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.qr-preview-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
}

.qr-empty-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

#qr-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.qr-frame-label {
    margin-top: 0.75rem;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}

@media (max-width: 960px) {
    .qr-tool-layout {
        grid-template-columns: 1fr;
    }

    .qr-tool-preview {
        position: static;
        order: -1;
    }
}

@media (max-width: 640px) {
    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .qr-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.65rem;
        scrollbar-width: thin;
    }

    .qr-tab {
        flex-shrink: 0;
    }
}

/* ============================================
   Mobile Responsive — Comprehensive
   ============================================ */

.dashboard-mobile-nav {
    display: none;
}

@media (max-width: 900px) {
    .dashboard-mobile-nav {
        display: flex;
        gap: 0.4rem;
        margin-bottom: 1rem;
        padding: 0.35rem;
        background: var(--bg-elevated);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    }

    [data-theme="light"] .dashboard-mobile-nav {
        background: #fff;
        border-color: #e8edf3;
    }

    .dashboard-mobile-nav-link {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.62rem 0.4rem;
        border-radius: 10px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 0.78rem;
        font-weight: 600;
        white-space: nowrap;
        transition: background var(--transition), color var(--transition);
    }

    .dashboard-mobile-nav-link svg {
        flex-shrink: 0;
        opacity: 0.75;
    }

    .dashboard-mobile-nav-link:hover {
        color: var(--text);
        background: var(--surface-hover);
    }

    .dashboard-mobile-nav-link.active {
        color: var(--primary-dark);
        background: rgba(20, 184, 166, 0.12);
        font-weight: 700;
    }

    [data-theme="dark"] .dashboard-mobile-nav-link.active {
        color: var(--primary-light);
    }
}

@media (max-width: 640px) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .page-hero {
        padding: 1.75rem 0 1.25rem;
    }

    .page-hero-sm {
        padding: 1.5rem 0 1rem;
    }

    .page-hero h1 {
        font-size: 1.5rem;
        line-height: 1.35;
    }

    .page-lead {
        font-size: 0.92rem;
        line-height: 1.75;
    }

    .hero {
        padding: 1.5rem 0 2rem;
    }

    .page-home .hero-title {
        font-size: 1.65rem;
    }

    .page-home .shorten-panel {
        padding: 1.15rem 1rem;
        margin-bottom: 2rem;
        border-radius: 14px;
    }

    .shorten-panel {
        padding: 1.25rem 1rem;
    }

    .shorten-field-label {
        font-size: 0.82rem;
    }

    .url-input-group.url-input-with-submit {
        flex-direction: column;
    }

    .url-input-with-submit .shorten-submit-btn {
        width: 100%;
        min-height: 46px;
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    }

    .shorten-field-col .url-input-group,
    .shorten-field-col .url-input-group .url-field-wrap,
    .shorten-field-col .url-input-group .url-field-wrap input {
        min-height: 46px;
    }

    .url-field-wrap input,
    .dashboard-search-input,
    .stats-lookup-input,
    .form-control,
    input[type="text"],
    input[type="url"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
    }

    .page-home .features-checklist {
        justify-content: flex-start;
        gap: 0.65rem;
        margin-bottom: 1.25rem;
    }

    .page-home .check-item {
        font-size: 0.74rem;
        padding: 0.38rem 0.6rem;
    }

    .page-home .tools-grid {
        gap: 0.65rem;
    }

    .tool-card {
        padding: 0.85rem;
    }

    .tool-card h3 {
        white-space: normal;
        font-size: 0.88rem;
    }

    .tool-card p {
        font-size: 0.78rem;
    }

    .dashboard-layout {
        padding: 0.65rem max(0.65rem, env(safe-area-inset-right)) 1.25rem max(0.65rem, env(safe-area-inset-left));
    }

    .dashboard-main {
        padding: 0 0 1.25rem;
    }

    .page-dashboard .glass-card,
    .card {
        padding: 1.1rem;
        border-radius: 14px;
    }

    .page-header {
        margin-bottom: 1.25rem;
        gap: 0.75rem;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .page-subtitle {
        font-size: 0.88rem;
    }

    .page-header-greeting {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-logout-btn {
        width: 100%;
        justify-content: center;
    }

    .dashboard-mobile-nav-link {
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.55rem 0.25rem;
        font-size: 0.72rem;
    }

    .dashboard-mobile-nav-link svg {
        width: 20px;
        height: 20px;
    }

    .dashboard-links-toolbar-start {
        width: 100%;
    }

    .dashboard-bulk-delete-btn {
        flex: 1;
    }

    .links-list {
        overflow-x: visible;
        padding-bottom: 0;
    }

    .links-list-row {
        min-width: 0;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 0.6rem;
        padding: 0.8rem;
    }

    .links-list-pin {
        display: none;
    }

    .links-list-check {
        order: 0;
    }

    .links-list-short {
        order: 1;
        flex: 1 1 calc(100% - 2.25rem);
        min-width: 0;
    }

    .links-list-short-url {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.8rem;
    }

    .links-list-stats {
        order: 2;
        min-width: 0;
    }

    .links-list-meta {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.45rem;
        order: 3;
        min-width: 0;
        padding-inline-start: 0;
        margin-right: auto;
    }

    .links-list-dest {
        order: 4;
        flex: 1 1 100%;
        white-space: normal;
        word-break: break-all;
        padding: 0.2rem 0;
        font-size: 0.76rem;
        line-height: 1.45;
    }

    .links-list-edit {
        order: 5;
        margin-inline-start: 0;
    }

    .links-list-delete-form {
        order: 6;
    }

    .link-detail-top {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .link-detail-main {
        min-width: 0;
        width: 100%;
    }

    .link-stat-box {
        width: 100%;
        padding: 1rem;
    }

    .result-url {
        flex-direction: column;
        align-items: stretch;
    }

    .result-url .btn {
        width: 100%;
        justify-content: center;
    }

    .qr-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stats-link-box {
        width: 100%;
        min-width: 0;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn,
    .action-buttons form {
        width: 100%;
    }

    .action-buttons form button {
        width: 100%;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .chart-bars {
        height: 110px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .chart-bar-item {
        min-width: 28px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid-simple,
    .stats-public-grid {
        grid-template-columns: 1fr;
    }

    .stats-overview-sm {
        grid-template-columns: 1fr;
    }

    .stat-card-simple {
        padding: 1.15rem 0.85rem;
    }

    .stat-card-simple .stat-value {
        font-size: 1.4rem;
    }

    .shorten-result-hero {
        padding: 1.5rem 0 2.5rem;
    }

    .shorten-result-card {
        padding: 1.25rem 1rem;
    }

    .shorten-result-url-row {
        flex-direction: column;
        align-items: stretch;
    }

    .shorten-result-copy-btn {
        width: 100%;
        justify-content: center;
        border-radius: 0 0 12px 12px;
    }

    .shorten-result-actions,
    .shorten-result-qr-actions {
        grid-template-columns: 1fr;
    }

    .shorten-result-badges {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-form-side {
        padding: 1.25rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left));
        align-items: flex-start;
    }

    .auth-card-header {
        margin-bottom: 1.5rem;
    }

    .auth-card-header h1 {
        font-size: 1.35rem;
    }

    .contact-links-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        padding: 0.85rem;
    }

    .contact-links-sep {
        display: none;
    }

    .contact-links-bar a {
        display: block;
        padding: 0.65rem 0.75rem;
        border-radius: 8px;
        background: var(--surface-hover);
    }

    .contact-terms-card {
        padding: 1.15rem;
    }

    .page-about .about-header h1 {
        font-size: 1.5rem;
    }

    .page-about .about-panel {
        padding: 1.15rem;
    }

    .page-about .about-feature-card {
        padding: 1rem;
    }

    .about-intro-card {
        padding: 1.5rem 1.15rem;
    }

    .feature-row {
        flex-direction: column;
        padding: 1rem;
    }

    .qr-tool-layout {
        gap: 0.85rem;
    }

    .qr-tool-controls,
    .qr-tool-preview {
        padding: 1rem;
    }

    .qr-preview-wrap {
        min-height: 200px;
        padding: 1rem;
    }

    .qr-tabs {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .site-footer {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .site-footer-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .footer-action-pill {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }

    .network-section-box {
        padding: 0.75rem 0.55rem 0.65rem;
    }

    .error-card {
        padding: 2rem 1.25rem;
    }

    .error-code {
        font-size: 3rem;
    }

    .qr-modal-dialog {
        width: min(100%, calc(100vw - 1.5rem));
        margin: 0.75rem;
    }

    .bookmarklet-btn {
        display: block;
        width: 100%;
        text-align: center;
        font-size: 0.95rem;
        padding: 0.85rem 1rem;
    }

    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 38px;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .clicks-list {
        max-height: none;
    }

    .profile-avatar-large {
        width: 84px;
        height: 84px;
    }

    .my-links-header {
        flex-direction: column;
        align-items: stretch;
    }

    .my-links-actions {
        display: flex;
        width: 100%;
        gap: 0.5rem;
    }

    .my-links-actions .btn {
        flex: 1;
    }

    .auth-phone-section {
        min-height: auto;
        padding: 1.5rem max(1rem, env(safe-area-inset-right)) 2rem max(1rem, env(safe-area-inset-left));
    }

    .auth-phone-card {
        padding: 1.5rem 1.15rem;
    }

    .auth-phone-card h1 {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }

    .page-header .btn {
        width: 100%;
        justify-content: center;
    }

    .breadcrumb {
        flex-wrap: wrap;
    }
}

/* ============================================
   Tablet & Mobile — Unified Responsive Pass
   ============================================ */
@media (max-width: 900px) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .page-hero {
        padding: 1.75rem 0 1.25rem;
    }

    .page-hero-sm {
        padding: 1.5rem 0 1rem;
    }

    .page-hero h1 {
        font-size: clamp(1.35rem, 4vw, 1.75rem);
        line-height: 1.35;
    }

    .page-lead {
        font-size: 0.92rem;
        line-height: 1.75;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 1.5rem;
        gap: 0.75rem;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .page-header-greeting {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .btn {
        width: 100%;
        justify-content: center;
    }

    .dashboard-layout {
        padding: 0.75rem max(0.75rem, env(safe-area-inset-right)) 1.5rem max(0.75rem, env(safe-area-inset-left));
    }

    .dashboard-main {
        padding: 0 0 1.25rem;
    }

    .page-dashboard .glass-card,
    .card {
        padding: 1.15rem;
        border-radius: 14px;
    }

    .dashboard-logout-btn {
        width: 100%;
        justify-content: center;
    }

    .dashboard-mobile-nav-link {
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.55rem 0.25rem;
        font-size: 0.72rem;
    }

    .dashboard-mobile-nav-link svg {
        width: 20px;
        height: 20px;
    }

    .dashboard-links-toolbar-start {
        width: 100%;
    }

    .dashboard-bulk-delete-btn {
        flex: 1;
    }

    /* Links list — card layout on tablet & mobile */
    .links-list {
        overflow-x: visible;
        padding-bottom: 0;
    }

    .links-list-row {
        min-width: 0;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 0.6rem;
        padding: 0.8rem;
    }

    .links-list-pin {
        display: none;
    }

    .links-list-check {
        order: 0;
    }

    .links-list-short {
        order: 1;
        flex: 1 1 calc(100% - 2.25rem);
        min-width: 0;
    }

    .links-list-short-url {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.8rem;
    }

    .links-list-stats {
        order: 2;
        min-width: 0;
    }

    .links-list-meta {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.45rem;
        order: 3;
        min-width: 0;
        padding-inline-start: 0;
        margin-right: auto;
    }

    .links-list-dest {
        order: 4;
        flex: 1 1 100%;
        white-space: normal;
        word-break: break-all;
        padding: 0.2rem 0;
        font-size: 0.76rem;
        line-height: 1.45;
    }

    .links-list-edit {
        order: 5;
        margin-inline-start: 0;
    }

    .links-list-delete-form {
        order: 6;
    }

    .my-links-header {
        flex-direction: column;
        align-items: stretch;
    }

    .my-links-actions {
        display: flex;
        width: 100%;
        gap: 0.5rem;
    }

    .my-links-actions .btn {
        flex: 1;
    }

    /* Tool pages */
    .tool-section {
        padding: 0.5rem 0 2.5rem;
    }

    .tool-card-panel {
        padding: 1.35rem 1.15rem;
    }

    .tool-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tool-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .check-result-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .stats-lookup-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-lookup-input {
        border-radius: var(--radius-sm);
    }

    .stats-lookup-btn {
        width: 100%;
        border-radius: var(--radius-sm);
    }

    .stats-public-grid,
    .stats-grid-simple,
    .stats-overview-sm {
        grid-template-columns: 1fr;
    }

    .stat-card-simple {
        padding: 1.15rem 0.85rem;
    }

    /* Forms & inputs — prevent iOS zoom */
    .url-field-wrap input,
    .dashboard-search-input,
    .stats-lookup-input,
    .form-control,
    input[type="text"],
    input[type="url"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Link detail & analytics */
    .link-detail-top {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .link-detail-main {
        min-width: 0;
        width: 100%;
    }

    .link-stat-box {
        width: 100%;
        padding: 1rem;
    }

    .detail-grid,
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .chart-bars {
        height: 110px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .chart-bar-item {
        min-width: 28px;
    }

    .result-url {
        flex-direction: column;
        align-items: stretch;
    }

    .result-url .btn {
        width: 100%;
        justify-content: center;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn,
    .action-buttons form {
        width: 100%;
    }

    .action-buttons form button {
        width: 100%;
    }

    .qr-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stats-link-box {
        width: 100%;
        min-width: 0;
    }

    /* Shorten form */
    .url-input-group.url-input-with-submit {
        flex-direction: column;
    }

    .url-input-with-submit .shorten-submit-btn {
        width: 100%;
        min-height: 46px;
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    }

    .shorten-field-col .url-input-group,
    .shorten-field-col .url-input-group .url-field-wrap,
    .shorten-field-col .url-input-group .url-field-wrap input {
        min-height: 46px;
    }

    /* Shorten result */
    .shorten-result-url-row {
        flex-direction: column;
        align-items: stretch;
    }

    .shorten-result-copy-btn {
        width: 100%;
        justify-content: center;
        border-radius: 0 0 12px 12px;
    }

    .shorten-result-actions,
    .shorten-result-qr-actions {
        grid-template-columns: 1fr;
    }

    .shorten-result-badges {
        flex-direction: column;
        align-items: stretch;
    }

    /* Contact & about */
    .contact-links-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        padding: 0.85rem;
    }

    .contact-links-sep {
        display: none;
    }

    .contact-links-bar a {
        display: block;
        padding: 0.65rem 0.75rem;
        border-radius: 8px;
        background: var(--surface-hover);
    }

    .contact-terms-card {
        padding: 1.15rem;
    }

    /* QR tool */
    .qr-tool-layout {
        gap: 0.85rem;
    }

    .qr-tool-controls,
    .qr-tool-preview {
        padding: 1rem;
    }

    .qr-preview-wrap {
        min-height: 200px;
        padding: 1rem;
    }

    .qr-tabs {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    /* Auth */
    .auth-form-side {
        padding: 1.25rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left));
        align-items: flex-start;
    }

    .auth-phone-section {
        min-height: auto;
        padding: 1.5rem max(1rem, env(safe-area-inset-right)) 2rem max(1rem, env(safe-area-inset-left));
    }

    .auth-phone-card {
        padding: 1.5rem 1.15rem;
    }

    .auth-phone-actions {
        flex-direction: column;
    }

    .auth-phone-actions .btn {
        width: 100%;
    }

    /* Footer & misc */
    .site-footer {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .site-footer-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .footer-action-pill {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }

    .footer-ads {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.35rem;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .footer-ad-item {
        flex: 0 0 120px;
        width: 120px;
    }

    .error-card {
        padding: 2rem 1.25rem;
    }

    .error-code {
        font-size: 3rem;
    }

    .qr-modal-dialog {
        width: min(100%, calc(100vw - 1.5rem));
        margin: 0.75rem;
    }

    .bookmarklet-btn {
        display: block;
        width: 100%;
        text-align: center;
        font-size: 0.95rem;
        padding: 0.85rem 1rem;
    }

    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 38px;
    }

    .clicks-list {
        max-height: none;
    }

    .breadcrumb {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 1.5rem 0 2rem;
    }

    .page-home .hero-title {
        font-size: 1.65rem;
    }

    .page-home .shorten-panel {
        padding: 1.15rem 1rem;
        margin-bottom: 2rem;
        border-radius: 14px;
    }

    .shorten-panel {
        padding: 1.25rem 1rem;
    }

    .page-home .features-checklist {
        justify-content: flex-start;
        gap: 0.65rem;
        margin-bottom: 1.25rem;
    }

    .page-home .check-item {
        font-size: 0.74rem;
        padding: 0.38rem 0.6rem;
    }

    .page-home .tools-grid {
        gap: 0.65rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .tool-card {
        padding: 0.85rem;
    }

    .tool-card h3 {
        white-space: normal;
        font-size: 0.88rem;
    }

    .tool-card p {
        font-size: 0.78rem;
    }

    .page-about .about-header h1 {
        font-size: 1.5rem;
    }

    .page-about .about-panel {
        padding: 1.15rem;
    }

    .page-about .about-feature-card {
        padding: 1rem;
    }

    .about-intro-card {
        padding: 1.5rem 1.15rem;
    }

    .feature-row {
        flex-direction: column;
        padding: 1rem;
    }

    .shorten-result-hero {
        padding: 1.5rem 0 2.5rem;
    }

    .shorten-result-card {
        padding: 1.25rem 1rem;
    }

    .auth-card-header h1 {
        font-size: 1.35rem;
    }

    .profile-avatar-large {
        width: 84px;
        height: 84px;
    }

    .network-section-box {
        padding: 0.75rem 0.55rem 0.65rem;
    }
}

@media (max-width: 480px) {
    .url-input-group.url-input-slug {
        flex-direction: column;
        align-items: stretch;
        overflow-x: visible;
    }

    .url-input-slug .url-input-prefix {
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid var(--border);
        font-size: 0.8rem;
        justify-content: flex-start;
    }

    .url-input-slug .url-field-wrap input {
        min-height: 44px;
        height: auto;
        padding: 0.65rem 0.75rem;
        font-size: 16px;
    }

    .shorten-field-col .url-input-slug,
    .shorten-field-col .url-input-slug .url-field-wrap,
    .shorten-field-col .url-input-slug .url-field-wrap input {
        min-height: auto;
    }

    .auth-phone-row .btn {
        width: 100%;
    }

    .dashboard-mobile-nav-link span {
        font-size: 0.68rem;
    }
}
