/* Fancy Font Generator — design system */
:root {
    --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Outfit", "Source Sans 3", system-ui, sans-serif;
    --primary: #1f5a3f;
    --secondary: #dae8e0;
    --accent: #22c55e;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 28px;
    --shadow-sm: 0 1px 2px rgba(31, 90, 63, 0.06);
    --shadow-md: 0 6px 20px rgba(31, 90, 63, 0.1);
    --shadow-lg: 0 14px 40px rgba(31, 90, 63, 0.14);
    --transition: 0.25s ease;
    --header-height: 68px;
    --container: 1480px;
}

[data-theme="light"] {
    --bg-primary: #f5faf7;
    --bg-secondary: #fafffc;
    --bg-tertiary: #dae8e0;
    --bg-sheen: linear-gradient(180deg, #fafffc 0%, #f5faf7 55%, #eef7f1 100%);
    --text-primary: #143226;
    --text-secondary: #3d5c4c;
    --text-muted: #6b8a78;
    --border-color: #c5d9cc;
    --accent: #22c55e;
    --accent-hover: #16a34a;
    --accent-light: #dcfce7;
    --accent-soft: rgba(34, 197, 94, 0.14);
    --primary: #1f5a3f;
    --success: #16a34a;
    --error: #dc2626;
    --warning: #d97706;
    --hero-bg: linear-gradient(145deg, #1f5a3f 0%, #246b4a 45%, #178f4f 100%);
    --card-hover: #f0faf4;
    --header-bg: rgba(250, 255, 252, 0.92);
}

[data-theme="dark"] {
    --bg-primary: #0e1a14;
    --bg-secondary: #14241c;
    --bg-tertiary: #1c3228;
    --bg-sheen: linear-gradient(180deg, #14241c 0%, #0e1a14 100%);
    --text-primary: #e8f5ee;
    --text-secondary: #a8c4b4;
    --text-muted: #6f8f7e;
    --border-color: #2a4536;
    --accent: #4ade80;
    --accent-hover: #86efac;
    --accent-light: #14532d;
    --accent-soft: rgba(74, 222, 128, 0.16);
    --primary: #86efac;
    --success: #4ade80;
    --error: #f87171;
    --warning: #fbbf24;
    --hero-bg: linear-gradient(145deg, #14532d 0%, #1f5a3f 50%, #0e1a14 100%);
    --card-hover: #1a2e23;
    --header-bg: rgba(20, 36, 28, 0.92);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-soft), transparent),
        var(--bg-sheen);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: clip;
    transition: background-color var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 820px; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* Theme toggle — top-RIGHT of header (inside .header-actions) */
.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.theme-toggle {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), border-color var(--transition), background var(--transition), color var(--transition);
}
.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    color: var(--accent-hover);
    background: var(--accent-soft);
}
.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.theme-icon { pointer-events: none; display: block; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }

/* Header */
.site-header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 1rem;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    min-width: 0;
}
.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.logo:hover { color: var(--primary); }
.logo-mark,
.logo-img {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--primary), #2d7a54);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
}
.logo-img {
    object-fit: cover;
    background: transparent;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 0.2rem;
}
.main-nav a {
    color: var(--text-secondary);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background var(--transition), color var(--transition);
}
.main-nav a:hover,
.main-nav a.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.btn-main-home {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}
.btn-main-home:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.admin-menu { position: relative; }
.admin-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 999px;
    padding: 0.25rem 0.65rem 0.25rem 0.3rem;
    cursor: pointer;
    color: var(--text-color);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
}
.admin-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    object-fit: cover;
    flex-shrink: 0;
}
.admin-avatar-img {
    padding: 0;
    background: transparent;
}
.admin-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    min-width: 160px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.12));
    padding: 0.35rem;
    z-index: 100;
}
.admin-dropdown[hidden] { display: none !important; }
.admin-dropdown a {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
}
.admin-dropdown a:hover { background: var(--accent-soft, rgba(0,0,0,.06)); }

@media (max-width: 700px) {
    .admin-menu-label { display: none; }
    .btn-main-home { font-size: 0.72rem; padding: 0.35rem 0.65rem; }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.lang-switcher {
    position: relative;
    z-index: 40;
}
.lang-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 11rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.lang-switcher-btn:hover,
.lang-switcher-btn:focus-visible,
.lang-switcher.is-open .lang-switcher-btn {
    border-color: var(--accent);
}
.lang-switcher-btn .lang-code {
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--accent);
}
.lang-switcher-btn .lang-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lang-switcher-btn .lang-caret {
    font-size: 0.7rem;
    opacity: 0.7;
    transition: transform var(--transition);
}
.lang-switcher.is-open .lang-caret { transform: rotate(180deg); }

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    width: min(18rem, calc(100vw - 1.5rem));
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    padding: 0.55rem;
    display: none;
    flex-direction: column;
    gap: 0.4rem;
}
.lang-switcher.is-open .lang-dropdown {
    display: flex;
}
.lang-dropdown[hidden] {
    display: none !important;
}
.lang-search {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}
.lang-search:focus { border-color: var(--accent); }
.lang-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 16rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.lang-list li { margin: 0; }
.lang-option {
    display: grid;
    grid-template-columns: 2.4rem 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.55rem;
    align-items: center;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
}
.lang-option:hover,
.lang-option.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}
.lang-option-code {
    grid-row: 1 / span 2;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--accent);
}
.lang-option-native {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
}
.lang-option-en {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.2;
}
.lang-option.is-active .lang-option-en,
.lang-option:hover .lang-option-en {
    color: inherit;
    opacity: 0.8;
}
.lang-empty {
    margin: 0;
    padding: 0.6rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* Layout */
.layout-wrapper {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 180px;
    gap: 1.25rem;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1rem 1rem;
}
body.no-left-sidebar .layout-wrapper { grid-template-columns: minmax(0, 1fr) 180px; }
body.no-right-sidebar .layout-wrapper { grid-template-columns: 180px minmax(0, 1fr); }
body.no-left-sidebar.no-right-sidebar .layout-wrapper { grid-template-columns: minmax(0, 1fr); }
.sidebar { padding-top: 1.25rem; min-height: 1px; }
.main-content { min-width: 0; }

/* Ads — stable slots, auto size backgrounds */
.ad-slot { margin: 0.75rem 0; }
.ad-slot.ad-align-center,
.ad-header,
.ad-footer,
.ad-sticky { text-align: center; }
.ad-header { max-width: var(--container); margin: 0.85rem auto 0; padding: 0 1rem; }
.ad-footer { max-width: var(--container); margin: 1rem auto 0; padding: 0 1rem; }
.ad-inline { margin: 1rem auto; max-width: 900px; }
.ad-left_sidebar,
.ad-right_sidebar { position: sticky; top: calc(var(--header-height) + 12px); }
.ad-item {
    display: inline-flex;
    max-width: 100%;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.ad-item:has(.dummy-ad) { background: transparent; }
.ad-popup {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 30, 22, 0.45);
    padding: 1rem;
}
.ad-popup[data-closed="1"] { display: none; }
.ad-floating {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1150;
    max-width: 280px;
}
.ad-sticky {
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.35rem 1rem;
}

.dummy-ad {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    line-height: 1.35;
    width: 100%;
}
.dummy-ad-header,
.dummy-ad-footer {
    min-height: 72px;
    min-width: 0;
    max-width: 100%;
    background: linear-gradient(90deg, #1f5a3f, #3d8b63);
}
.dummy-ad-sidebar {
    min-height: 250px;
    min-width: 0;
    max-width: 100%;
    padding: 1rem;
    background: linear-gradient(160deg, #1f5a3f, #22c55e);
}
.dummy-ad-inline {
    min-height: 90px;
    min-width: 0;
    max-width: 100%;
    background: linear-gradient(90deg, #246b4a, #22c55e);
}
.dummy-ad-popup {
    min-height: 180px;
    min-width: 0;
    width: min(420px, 90vw);
    max-width: 100%;
    background: linear-gradient(145deg, #143226, #1f5a3f);
}
.dummy-ad-floating {
    min-height: 100px;
    min-width: 0;
    max-width: 100%;
    background: linear-gradient(145deg, #178f4f, #22c55e);
}
.dummy-ad-sticky {
    min-height: 48px;
    min-width: 0;
    max-width: 100%;
    background: linear-gradient(90deg, #1f5a3f, #246b4a);
}

/* Hero */
.hero {
    position: relative;
    padding: 3.25rem 0 2.5rem;
    text-align: center;
    background: var(--hero-bg);
    color: #fff;
    margin: 0.75rem 0 1.75rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 40%),
        radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.12), transparent 35%);
    pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1,
.hero-title {
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    font-weight: 750;
    letter-spacing: -0.03em;
    margin-bottom: 0.45rem;
}
.hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.92;
    margin-bottom: 1.75rem;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}
.input-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto 1rem;
}
.text-input {
    width: 100%;
    padding: 1rem 3.2rem 1rem 1.2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.97);
    color: #0f1c2e;
    box-shadow: var(--shadow-lg);
    outline: none;
    transition: box-shadow var(--transition), transform var(--transition);
}
.text-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), var(--shadow-lg);
    transform: translateY(-1px);
}
.char-count {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #64748b;
}
.tools-meta { font-size: 0.9rem; opacity: 0.9; }

/* —— Home showcase (premium / model look) —— */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.home .main-content {
    padding-top: 0.35rem;
}

body.home .hero-showcase {
    margin: 0.35rem 0 2rem;
    padding: 3.6rem 0 3rem;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: var(--hero-bg);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 22px 50px rgba(31, 90, 63, 0.28),
        0 8px 24px rgba(15, 23, 42, 0.12);
    animation: heroRise 0.7s ease both;
}
[data-theme="dark"] body.home .hero-showcase {
    background: var(--hero-bg);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 22px 50px rgba(0, 0, 0, 0.35);
}

body.home .hero-showcase::before { display: none; }

.hero-glow {
    position: absolute;
    inset: -20% -10% auto;
    height: 70%;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(255, 255, 255, 0.22), transparent 55%),
        radial-gradient(ellipse at 75% 20%, rgba(94, 234, 212, 0.28), transparent 50%);
    pointer-events: none;
    animation: glowDrift 8s ease-in-out infinite alternate;
}
.hero-sheen {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 0%,
        transparent 40%,
        rgba(255, 255, 255, 0.12) 48%,
        transparent 56%,
        transparent 100%
    );
    background-size: 220% 100%;
    animation: sheenSweep 5.5s ease-in-out infinite;
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }

.hero-brand {
    font-family: "Outfit", var(--font);
    font-size: clamp(2.15rem, 5.2vw, 3.35rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 0.65rem;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.18);
    animation: fadeUp 0.6s ease 0.14s both;
}
.hero-kicker {
    font-family: "Outfit", var(--font);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 0.85rem;
    animation: fadeUp 0.55s ease 0.08s both;
}
.hero-showcase .hero-title {
    font-family: "Outfit", var(--font);
    font-size: clamp(2.15rem, 5.2vw, 3.35rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 0.65rem;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.18);
    animation: fadeUp 0.6s ease 0.14s both;
}
.hero-showcase .hero-subtitle {
    font-size: 1.08rem;
    font-weight: 450;
    opacity: 0.94;
    margin-bottom: 1.85rem;
    max-width: 28rem;
    animation: fadeUp 0.6s ease 0.22s both;
}

.hero-input-panel {
    max-width: 640px;
    margin: 0 auto;
    padding: 1.15rem 1.15rem 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 16px 40px rgba(0, 0, 0, 0.12);
    animation: fadeUp 0.65s ease 0.3s both;
}
.hero-showcase .input-wrapper {
    max-width: none;
    margin: 0 0 0.85rem;
}
.hero-showcase .text-input {
    padding: 1.15rem 1.35rem;
    font-size: 1.15rem;
    font-weight: 500;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 10px 28px rgba(15, 23, 42, 0.14);
    resize: vertical;
    min-height: 5.5rem;
    line-height: 1.45;
    font-family: inherit;
}
.hero-showcase .input-stats {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.85);
}
.hero-showcase .char-count { display: none; }
.hero-showcase .text-input:focus {
    transform: translateY(-2px);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.4),
        0 14px 32px rgba(15, 23, 42, 0.16);
}
.hero-showcase .char-count {
    right: 1.15rem;
    font-weight: 600;
    color: #64748b;
}
.tools-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.tools-meta-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5eead4;
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.28);
    animation: pulseDot 1.8s ease-in-out infinite;
}

body.home .section-head {
    text-align: center;
    margin-bottom: 1.35rem;
}
body.home .section-title {
    font-family: "Outfit", var(--font);
    font-size: clamp(1.35rem, 2.5vw, 1.7rem);
    font-weight: 750;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}
body.home .section-lead {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 28rem;
    margin: 0 auto;
}

.filters-bar-glossy {
    padding: 0.85rem;
    border-radius: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.65) inset,
        var(--shadow-sm);
    margin-bottom: 1.5rem;
}
[data-theme="dark"] .filters-bar-glossy {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, var(--shadow-sm);
}
.filters-bar-glossy .search-input,
.filters-bar-glossy .category-select {
    box-shadow: none;
}

.styles-grid-showcase {
    gap: 1.1rem;
}
.styles-grid-showcase .style-card {
    position: relative;
    border-radius: 16px;
    padding: 1.15rem 1.2rem 1.1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, transparent 42%),
        var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        var(--shadow-sm);
    overflow: hidden;
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        border-color var(--transition),
        box-shadow 0.28s ease,
        background var(--transition);
}
[data-theme="dark"] .styles-grid-showcase .style-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 40%),
        var(--bg-secondary);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, var(--shadow-sm);
}
.styles-grid-showcase .style-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: skewX(-18deg);
    opacity: 0;
    transition: left 0.55s ease, opacity 0.35s ease;
    pointer-events: none;
}
.styles-grid-showcase .style-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.75) inset,
        0 16px 36px rgba(13, 148, 136, 0.14),
        var(--shadow-md);
}
.styles-grid-showcase .style-card:hover::after {
    left: 120%;
    opacity: 1;
}
.styles-grid-showcase .style-output {
    font-size: 1.28rem;
    min-height: 2.2rem;
    letter-spacing: 0.01em;
}
.styles-grid-showcase .copy-btn {
    border-radius: 10px;
    font-weight: 650;
}
.styles-grid-showcase .copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px var(--accent-soft);
}

.btn-glossy {
    min-width: 200px;
    border-radius: 999px;
    padding: 0.8rem 1.6rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.55) inset,
        var(--shadow-sm);
}
.btn-glossy:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

@keyframes heroRise {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes sheenSweep {
    0%, 40% { background-position: 120% 0; }
    70%, 100% { background-position: -40% 0; }
}
@keyframes glowDrift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(2%, 3%, 0); }
}
@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-showcase,
    .hero-kicker,
    .hero-brand,
    .hero-showcase .hero-title,
    .hero-showcase .hero-subtitle,
    .hero-input-panel,
    .hero-glow,
    .hero-sheen,
    .tools-meta-dot {
        animation: none !important;
    }
    .styles-grid-showcase .style-card::after { display: none; }
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1.35rem;
    flex-wrap: wrap;
}
.search-input,
.category-select {
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input { flex: 1; min-width: min(200px, 100%); }
.search-input:focus,
.category-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Styles grid — min() keeps cards inside narrow viewports */
.styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 1rem;
}
.style-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.style-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    background: var(--card-hover);
    transform: translateY(-2px);
}
.style-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
    gap: 0.5rem;
}
.style-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.style-category {
    font-size: 0.68rem;
    padding: 0.18rem 0.55rem;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    font-weight: 600;
}
.style-output {
    font-size: 1.2rem;
    word-break: break-word;
    min-height: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.45;
}
.copy-btn {
    width: 100%;
    padding: 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.copy-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.copy-btn.copied {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.load-more-wrap { text-align: center; padding: 2rem 0 1rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 16px var(--accent-soft);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Pages */
.page-section {
    padding: 2rem 0 2.75rem;
}
.page-section .container,
.page-section .container-narrow {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-sm);
}
.page-section h1 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    letter-spacing: -0.02em;
    margin-bottom: 0.85rem;
}
.section-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}
.page-content { line-height: 1.8; }
.page-content h2,
.page-content h3,
.page-content h4 {
    margin: 1.4rem 0 0.65rem;
    color: var(--text-color);
}
.page-content h2 { font-size: 1.3rem; }
.page-content h3 { font-size: 1.15rem; }
.page-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}
.page-content ul,
.page-content ol {
    margin: 0.85rem 0 1.1rem;
    padding-left: 1.6em;
    color: var(--text-secondary);
}
.page-content li {
    margin: 0.35rem 0;
    padding-left: 0.15em;
}
.page-content li > p {
    margin: 0;
}
.page-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm, 8px);
}
.page-content img.align-left {
    float: left;
    margin: 0.35rem 1rem 0.85rem 0;
}
.page-content img.align-right {
    float: right;
    margin: 0.35rem 0 0.85rem 1rem;
}
.page-content img.align-center {
    display: block;
    float: none;
    margin: 1rem auto;
}
.page-content blockquote {
    margin: 1rem 0;
    padding: 0.65rem 1rem;
    border-left: 3px solid var(--primary);
    color: var(--text-secondary);
    background: var(--bg-tertiary, var(--bg-secondary));
    border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
}
.page-content::after {
    content: '';
    display: table;
    clear: both;
}
.feature-image {
    margin: 0 0 1.25rem;
}
.feature-image img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-color);
}
/* Quill alignment / indent classes in published HTML */
.page-content .ql-align-center { text-align: center; }
.page-content .ql-align-right { text-align: right; }
.page-content .ql-align-left { text-align: left; }
.page-content .ql-align-justify { text-align: justify; }
.page-content .ql-indent-1 { padding-left: 3em; }
.page-content .ql-indent-2 { padding-left: 6em; }
.page-content .ql-indent-3 { padding-left: 9em; }
.page-content .ql-indent-4 { padding-left: 12em; }
.page-content .ql-indent-5 { padding-left: 15em; }
.page-content .ql-indent-6 { padding-left: 18em; }
.page-content .ql-indent-7 { padding-left: 21em; }
.page-content .ql-indent-8 { padding-left: 24em; }

/* Blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}
.blog-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.blog-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.blog-card-body { padding: 1.35rem; }
.blog-card time { font-size: 0.8rem; color: var(--text-muted); }
.blog-card h2 { font-size: 1.1rem; margin: 0.45rem 0; }
.blog-card h2 a { color: var(--text-primary); }
.blog-card h2 a:hover { color: var(--accent); }
.blog-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.9rem;
}
.read-more { font-weight: 600; font-size: 0.9rem; }

.blog-article-header { margin-bottom: 1.75rem; }
.blog-article-header time { color: var(--text-muted); font-size: 0.9rem; }
.blog-article-header h1 { margin-top: 0.45rem; }
.blog-article-footer {
    margin-top: 2rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--border-color);
}

.pagination {
    display: flex;
    gap: 0.45rem;
    justify-content: center;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}
.pagination a {
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}
.pagination a.active,
.pagination a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Forms */
.contact-form { max-width: 560px; }
.form-group { margin-bottom: 1.15rem; }
.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.alert {
    padding: 0.95rem 1.15rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.35rem;
    font-weight: 500;
}
.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
[data-theme="dark"] .alert-success {
    background: #064e3b;
    color: #6ee7b7;
}
[data-theme="dark"] .alert-error {
    background: #7f1d1d;
    color: #fca5a5;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem;
}

/* Footer */
.site-footer {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--secondary) 140%);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.35rem;
    margin-top: 2rem;
}
[data-theme="dark"] .site-footer {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #101c16 140%);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.75rem;
}
.footer-col h4,
.footer-col h5 {
    font-family: var(--font-display);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
    color: var(--primary);
}
.footer-col h5 {
    margin-top: 1.1rem;
    font-size: 0.75rem;
}
.footer-about p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
}
.footer-links ul,
.social-links { list-style: none; }
.footer-links li,
.social-links li { margin-bottom: 0.4rem; }
.footer-links a,
.social-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.footer-links a:hover,
.social-links a:hover { color: var(--accent-hover); }
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
}
.social-links-icons {
    gap: 0.55rem;
    margin-top: 0.85rem;
    padding: 0;
}
.social-links-icons li { margin: 0; }
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--primary);
    transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.social-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}
.social-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}
.footer-bottom {
    text-align: center;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Loading */
.loading-spinner {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
}
.loading-spinner::after {
    content: "";
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 1100px) {
    .layout-wrapper {
        /* minmax(0,1fr) prevents grid min-content from forcing horizontal scroll */
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .sidebar {
        padding-top: 0;
        order: 2;
        min-width: 0;
        max-width: 100%;
    }
    .main-content { order: 1; min-width: 0; max-width: 100%; }
    .ad-left_sidebar,
    .ad-right_sidebar { position: static; }
    .dummy-ad-sidebar {
        min-height: 90px;
        flex-direction: row;
        gap: 0.35rem;
    }
    .dummy-ad-sidebar br { display: none; }
}

@media (max-width: 768px) {
    .logo { font-size: 0.98rem; }
    .theme-toggle {
        width: 36px;
        height: 36px;
    }
    .header-inner { padding-right: 0; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        padding: 0.85rem 1rem;
        transform: translateY(-120%);
        opacity: 0;
        pointer-events: none;
        transition: transform var(--transition), opacity var(--transition);
        z-index: 99;
        box-shadow: var(--shadow-md);
    }
    .main-nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .main-nav ul { flex-direction: column; }
    .main-nav a { border-radius: var(--radius-sm); }
    .nav-toggle { display: flex; }
    .styles-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
    .hero {
        padding: 2.1rem 0 1.7rem;
        margin: 0.5rem 0 1.25rem;
        border-radius: var(--radius-lg);
    }
    body.home .hero-showcase {
        padding: 2.4rem 0 2rem;
        margin: 0.25rem 0 1.5rem;
        border-radius: 20px;
    }
    body.home .hero-input-panel {
        padding: 0.9rem;
        border-radius: 18px;
    }
    body.home .hero-showcase .text-input {
        padding: 1rem 1.1rem;
        font-size: 1.05rem;
    }
    .page-section .container,
    .page-section .container-narrow {
        padding: 1.4rem 1.15rem;
    }
    .dummy-ad-header,
    .dummy-ad-footer { min-height: 60px; font-size: 0.72rem; }
    .ad-floating { right: 0.5rem; bottom: 0.5rem; max-width: 200px; }
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%) translateY(12px);
    z-index: 1300;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.blog-author {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.filters-bar-glossy {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}
.random-font-result {
    margin: 1rem 0 1.5rem;
}
.random-font-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.random-font-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.style-card.is-random {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Glitch / Zalgo tool page */
.hero-tool {
    padding: 2.5rem 0 1.5rem;
}
.glitch-tool-section {
    padding-top: 0.5rem;
}
.glitch-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.35rem;
    box-shadow: var(--shadow-sm);
}
.glitch-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 1.25rem;
}
.glitch-intensity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.glitch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.glitch-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}
.glitch-level.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.glitch-output-wrap {
    margin-top: 0.5rem;
}
.glitch-output {
    min-height: 7rem;
    margin-top: 0.45rem;
    padding: 1rem 1.15rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary, var(--bg-primary));
    font-size: 1.35rem;
    line-height: 1.7;
    word-break: break-word;
    white-space: pre-wrap;
}
.glitch-about {
    margin-top: 2rem;
    max-width: 42rem;
}
.glitch-about h2 {
    font-size: 1.25rem;
    margin-bottom: 0.65rem;
}
.glitch-about p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

/* Tools index */
.tools-home-hint {
    margin-top: 0.85rem;
    font-size: 0.95rem;
}
.tools-home-hint a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.tools-home-hint a:hover { color: var(--accent-hover); }
.text-center { text-align: center; }

/* Text to Art */
.artwork-hint {
    margin: 0.45rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.artwork-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem 1rem;
    margin: 1rem 0 1.25rem;
}
.artwork-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 140px;
}
.artwork-actions {
    margin-left: auto;
}
.artwork-output {
    min-height: 10rem;
    margin: 0.45rem 0 0;
    padding: 1rem 1.15rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary, var(--bg-primary));
    font-family: ui-monospace, 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.15;
    white-space: pre;
    overflow-x: auto;
    color: var(--text-color);
}
.artwork-output.is-placeholder {
    color: var(--text-muted);
    font-family: inherit;
    white-space: normal;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .artwork-actions {
        margin-left: 0;
        width: 100%;
    }
    .artwork-actions .btn {
        flex: 1;
    }
}

/* Text to ASCII creator */
.ascii-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.ascii-tab {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-color);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.ascii-tab.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.ascii-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 14px;
    padding: 1.75rem 1rem;
    text-align: center;
    cursor: pointer;
    background: var(--bg-tertiary, var(--bg-primary));
    transition: border-color var(--transition), background var(--transition);
}
.ascii-dropzone:hover,
.ascii-dropzone.is-dragover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--bg-secondary));
}
.ascii-drop-title {
    margin: 0;
    font-weight: 700;
}
.ascii-drop-hint {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.ascii-image-preview-wrap {
    margin-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}
.ascii-image-preview {
    max-width: min(280px, 100%);
    max-height: 160px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    object-fit: contain;
    background: #111;
}
.ascii-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem 1rem;
    margin: 1rem 0 0.75rem;
}
.ascii-width-field {
    min-width: 180px;
    flex: 1 1 180px;
}
.ascii-width-field input[type="range"] {
    width: 100%;
}
.ascii-actions {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.ascii-status {
    min-height: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.ascii-output-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.ascii-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.ascii-output {
    max-height: 28rem;
    overflow: auto;
}

@media (max-width: 720px) {
    .ascii-actions {
        margin-left: 0;
        width: 100%;
    }
    .ascii-actions .btn {
        flex: 1;
    }
}
.tools-filters { margin-bottom: 1.75rem; }
.tools-category-block { margin-bottom: 2rem; }
.tools-category-title {
    font-size: 1.15rem;
    margin: 0 0 0.85rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}
.tools-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
    gap: 0.85rem;
}
.tools-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
    text-decoration: none;
    color: var(--text-color);
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.tools-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    color: var(--text-color);
}
.tools-card-name { font-size: 0.98rem; }
.tools-card-slug {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: ui-monospace, monospace;
}
.tools-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.footer-cat-label {
    margin-top: 0.55rem !important;
    font-size: 0.72rem !important;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted) !important;
    list-style: none;
}
.footer-tool-link { padding-left: 0.15rem; }

.site-footer,
.sidebar,
.glitch-about {
    content-visibility: auto;
    contain-intrinsic-size: 1px 320px;
}

.ad-floating,
.ad-popup,
.ad-sticky {
    content-visibility: auto;
}

.lang-dropdown[hidden] {
    content-visibility: hidden;
}

@media (max-width: 640px) {
    .glitch-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .glitch-actions .btn {
        flex: 1;
    }
}

/* Cartoon Font */
.cartoon-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem 1rem;
    margin: 1rem 0 1.1rem;
}
.cartoon-actions {
    margin-left: auto;
}
.cartoon-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.65rem;
    margin: 0 0 1.15rem;
}
.cartoon-style-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-tertiary, var(--bg-primary));
    color: var(--text-color);
    font: inherit;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.cartoon-style-card:hover {
    border-color: var(--primary);
}
.cartoon-style-card.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 28%, transparent);
}
.cartoon-style-name {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.cartoon-style-preview {
    font-size: 1.05rem;
    line-height: 1.35;
    word-break: break-word;
    min-height: 1.4em;
}
.cartoon-output {
    font-size: 1.55rem;
    line-height: 1.75;
}
.cartoon-output.is-placeholder {
    color: var(--text-muted);
    font-size: 1rem;
}
@media (max-width: 720px) {
    .cartoon-actions {
        margin-left: 0;
        width: 100%;
    }
    .cartoon-actions .btn {
        flex: 1;
    }
}

/* Devotional Font */
.devo-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.85rem 0 0.25rem;
}
.devo-sample-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary, var(--bg-primary));
    color: var(--text-color);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.devo-sample-btn:hover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, var(--bg-primary));
}

/* Devanagari Fonts */
.deva-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem 1rem;
    margin: 1rem 0 0.75rem;
}
.deva-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
    line-height: 1.45;
}
.deva-selected {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-tertiary, var(--bg-primary));
}
.deva-selected-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}
.deva-selected-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.deva-selected-preview {
    line-height: 1.5;
    word-break: break-word;
    min-height: 1.6em;
}
.deva-selected-preview.is-placeholder {
    color: var(--text-muted);
    font-size: 1rem !important;
    font-weight: 400 !important;
    font-family: inherit !important;
}
.deva-font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 0.85rem;
}
.deva-font-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-tertiary, var(--bg-primary));
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.deva-font-card:hover {
    border-color: var(--primary);
}
.deva-font-card.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 28%, transparent);
}
.deva-font-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.deva-font-name {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
}
.deva-font-cat {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.deva-font-preview {
    min-height: 2.4em;
    line-height: 1.45;
    word-break: break-word;
    color: var(--text-color);
}
.deva-font-card-actions {
    display: flex;
    gap: 0.45rem;
    margin-top: auto;
}
.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
}
@media (max-width: 720px) {
    .deva-toolbar .cartoon-actions {
        margin-left: 0;
        width: 100%;
    }
    .deva-toolbar .cartoon-actions .btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .hero-tool {
        padding: 1.75rem 0 1rem;
    }
    .hero-brand {
        font-size: clamp(1.55rem, 8vw, 2rem);
    }
    .glitch-panel {
        padding: 1rem;
        border-radius: 14px;
    }
    .deva-font-grid {
        grid-template-columns: 1fr;
    }
    .cartoon-style-grid {
        grid-template-columns: 1fr 1fr;
    }
    .devo-samples {
        gap: 0.35rem;
    }
    .devo-sample-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    .text-input-multiline {
        font-size: 1rem;
    }
    .header-actions .btn-main-home {
        display: none;
    }
}


