@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap');

/* Light (default) and dark theme tokens */
:root {
    --p-text-size: 25px;
    /* Light theme: warm cream / paper (aligned with CineWeave my-app) */
    --fontlab-body-bg: #f6f3eb;
    --fontlab-body-text: #1d232f;
    --fontlab-header-bg: rgba(246, 243, 235, 0.94);
    --fontlab-header-border: #dfd5c2;
    --font-card-border: #dfd5c2;
    --font-card-border-hover: #e55f44;
    --font-card-shadow-hover: rgba(229, 95, 68, 0.2);
    --font-title-icon: #bd472f;
    --font-title-label: #4a3728;
    --preview-scrollbar-track: #ebe4d6;
    --preview-scrollbar-thumb: #9a8f82;
    --bundled-credit: #5f6776;
    --bundled-credit-border: rgba(95, 103, 118, 0.35);
    --bundled-link: #bd472f;
    --bundled-link-hover: #9a3412;
    --cart-overlay-bg: rgba(15, 23, 42, 0.4);
    --cart-drawer-bg: #fffdf8;
    --cart-drawer-border: #dfd5c2;
    --cart-drawer-shadow: -12px 0 40px rgba(25, 28, 35, 0.12);
    --toast-bg: rgba(255, 253, 248, 0.98);
    --toast-border: rgba(16, 185, 129, 0.35);
    --toast-title: #1d232f;
    --toast-detail: #5f6776;
    --toast-icon-bg: rgba(5, 150, 105, 0.12);
    --toast-icon-color: #059669;
    --scroll-top-bg: rgba(255, 253, 248, 0.96);
    --scroll-top-border: #dfd5c2;
    --scroll-top-bg-hover: #efe6d5;
    --scroll-top-fg: #3d3a35;
    --scroll-top-focus-ring: #fffdf8;
    --modal-backdrop: rgba(15, 23, 42, 0.45);
    --modal-panel-border: #dfd5c2;
    --modal-panel-bg: linear-gradient(180deg, #fffdf8 0%, #f6f3eb 100%);
    --modal-panel-shadow: 0 25px 50px -12px rgba(25, 28, 35, 0.14), 0 0 0 1px rgba(223, 213, 194, 0.9);
    --modal-title: #1d232f;
    --modal-body: #5f6776;
    --modal-btn-secondary-border: #dfd5c2;
    --modal-btn-secondary-bg: #efe6d5;
    --modal-btn-secondary-text: #3d3a35;
    --modal-btn-secondary-hover-bg: #e5dac8;
    --modal-btn-secondary-hover-border: #c9b8a0;
    --modal-focus-ring: #fffdf8;
    --range-track: #dfd5c2;
    --range-thumb: #1f8f5f;
    --preview-display-text: #1d232f;
    --toast-shadow: 0 18px 50px -12px rgba(25, 28, 35, 0.1), 0 0 0 1px rgba(223, 213, 194, 0.65);
    --cart-progress-glow: rgba(5, 150, 105, 0.22);
    --cart-progress-near-glow: rgba(217, 119, 6, 0.28);
    --cart-progress-full-glow: rgba(220, 38, 38, 0.28);
    --modal-danger-border: rgba(225, 29, 72, 0.4);
    --modal-danger-bg: #fff1f2;
    --modal-danger-text: #9f1239;
    --modal-danger-border-hover: #e11d48;
    --modal-danger-bg-hover: #ffe4e6;
    --modal-danger-text-hover: #881337;
    /* Site footer — editorial bar (warm paper) */
    --site-footer-bg: #fffdf8;
    --site-footer-border: #dfd5c2;
    --site-footer-nav-fg: #1d232f;
    --site-footer-social-fg: #1d232f;
    --site-footer-legal-fg: #8a8580;
    --site-footer-slash-fg: #1d232f;
    --site-footer-tagline-fg: #5f6776;
    /* Theme switch — light: restrained neutral track + crisp white knob */
    --theme-switch-track-bg: linear-gradient(180deg, #efe6d5 0%, #e5dac8 100%);
    --theme-switch-track-border: rgba(74, 55, 40, 0.12);
    --theme-switch-track-shadow:
        0 1px 1px rgba(255, 255, 255, 0.75) inset,
        0 -1px 1px rgba(15, 23, 42, 0.04),
        inset 0 2px 4px rgba(15, 23, 42, 0.07);
    --theme-switch-track-shadow-hover:
        0 1px 1px rgba(255, 255, 255, 0.85) inset,
        0 -1px 1px rgba(15, 23, 42, 0.05),
        inset 0 2px 5px rgba(15, 23, 42, 0.08);
    --theme-switch-sun: #bd472f;
    --theme-switch-sun-muted: rgba(189, 71, 47, 0.22);
    --theme-switch-moon: #6b6560;
    --theme-switch-moon-muted: rgba(107, 101, 96, 0.35);
}

html.dark {
    --fontlab-body-bg: #0f172a;
    --fontlab-body-text: #f1f5f9;
    --fontlab-header-bg: rgba(15, 23, 42, 0.9);
    --fontlab-header-border: #1e293b;
    --font-card-border: #1e293b;
    --font-card-border-hover: #38bdf8;
    --font-card-shadow-hover: rgba(56, 189, 248, 0.2);
    --font-title-icon: #38bdf8;
    --font-title-label: #7dd3fc;
    --preview-scrollbar-track: #1e293b;
    --preview-scrollbar-thumb: #475569;
    --bundled-credit: #94a3b8;
    --bundled-credit-border: rgba(51, 65, 85, 0.5);
    --bundled-link: #7dd3fc;
    --bundled-link-hover: #bae6fd;
    --cart-overlay-bg: rgba(15, 23, 42, 0.65);
    --cart-drawer-bg: #0f172a;
    --cart-drawer-border: #334155;
    --cart-drawer-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    --toast-bg: rgba(15, 23, 42, 0.97);
    --toast-title: #f1f5f9;
    --toast-detail: #94a3b8;
    --toast-icon-bg: rgba(6, 78, 59, 0.55);
    --toast-icon-color: #6ee7b7;
    --scroll-top-bg: rgba(30, 41, 59, 0.95);
    --scroll-top-border: #334155;
    --scroll-top-bg-hover: rgba(51, 65, 85, 0.98);
    --scroll-top-fg: #e2e8f0;
    --scroll-top-focus-ring: #0f172a;
    --modal-backdrop: rgba(15, 23, 42, 0.75);
    --modal-panel-border: #334155;
    --modal-panel-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --modal-panel-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(30, 41, 59, 0.6);
    --modal-title: #f1f5f9;
    --modal-body: #94a3b8;
    --modal-btn-secondary-border: #475569;
    --modal-btn-secondary-bg: rgba(30, 41, 59, 0.8);
    --modal-btn-secondary-text: #e2e8f0;
    --modal-btn-secondary-hover-bg: #334155;
    --modal-btn-secondary-hover-border: #64748b;
    --modal-focus-ring: #0f172a;
    --range-track: #334155;
    --range-thumb: #34d399;
    --preview-display-text: #f1f5f9;
    --toast-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(30, 41, 59, 0.8);
    --cart-progress-glow: rgba(52, 211, 153, 0.35);
    --cart-progress-near-glow: rgba(251, 146, 60, 0.45);
    --cart-progress-full-glow: rgba(248, 113, 113, 0.5);
    --modal-danger-border: rgba(244, 63, 94, 0.55);
    --modal-danger-bg: rgba(136, 19, 55, 0.45);
    --modal-danger-text: #fecdd3;
    --modal-danger-border-hover: #f43f5e;
    --modal-danger-bg-hover: rgba(190, 18, 60, 0.55);
    --modal-danger-text-hover: #ffffff;
    --site-footer-bg: #0a0a0a;
    --site-footer-border: #262626;
    --site-footer-nav-fg: #fafafa;
    --site-footer-social-fg: #fafafa;
    --site-footer-legal-fg: #737373;
    --site-footer-slash-fg: #fafafa;
    --site-footer-tagline-fg: #a3a3a3;
    /* Theme switch — dark: deep groove, moon orb reads on slate */
    --theme-switch-track-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --theme-switch-track-border: #334155;
    --theme-switch-track-shadow:
        0 1px 3px rgba(0, 0, 0, 0.45),
        inset 0 2px 7px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(148, 163, 184, 0.1);
    --theme-switch-track-shadow-hover:
        0 2px 5px rgba(0, 0, 0, 0.5),
        inset 0 2px 8px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(148, 163, 184, 0.14);
    --theme-switch-sun: var(--font-title-icon);
    --theme-switch-sun-muted: rgba(56, 189, 248, 0.2);
    --theme-switch-moon: var(--font-title-label);
    --theme-switch-moon-muted: rgba(148, 163, 184, 0.28);
}

/* Pill theme switch (header): knob + sun / moon */
.theme-switch {
    position: relative;
    margin-left: 0.125rem;
    flex-shrink: 0;
    width: 3.75rem;
    height: 1.875rem;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.theme-switch:focus {
    outline: none;
}

html:not(.dark) .theme-switch:focus-visible {
    border-radius: 9999px;
    box-shadow: 0 0 0 2px var(--fontlab-body-bg), 0 0 0 4px rgba(229, 95, 68, 0.45);
}

html.dark .theme-switch:focus-visible {
    box-shadow: 0 0 0 2px var(--fontlab-body-bg), 0 0 0 4px rgba(56, 189, 248, 0.42);
}

.theme-switch__track {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    background: var(--theme-switch-track-bg);
    border: 1px solid var(--theme-switch-track-border);
    box-shadow: var(--theme-switch-track-shadow);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-switch:hover .theme-switch__track {
    box-shadow: var(--theme-switch-track-shadow-hover);
}

.theme-switch__icon {
    position: absolute;
    top: 50%;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--theme-switch-sun);
    transition: color 0.2s ease, opacity 0.2s ease;
}

.theme-switch__icon--sun {
    left: 0.4rem;
}

.theme-switch__icon--moon {
    right: 0.35rem;
    color: var(--theme-switch-moon);
}

.theme-switch__icon svg {
    width: 100%;
    height: 100%;
}

/* Light mode: sun prominent, moon muted */
html:not(.dark) .theme-switch__icon--sun {
    opacity: 1;
    color: var(--theme-switch-sun);
}

html:not(.dark) .theme-switch__icon--moon {
    opacity: 0.4;
    color: var(--theme-switch-moon-muted);
}

/* Dark mode: moon prominent, sun muted */
html.dark .theme-switch__icon--sun {
    opacity: 0.3;
    color: var(--theme-switch-sun-muted);
}

html.dark .theme-switch__icon--moon {
    opacity: 1;
    color: var(--theme-switch-moon);
}

.theme-switch__thumb {
    position: absolute;
    top: 3px;
    z-index: 1;
    width: calc(1.875rem - 6px);
    height: calc(1.875rem - 6px);
    border-radius: 9999px;
    overflow: hidden;
    transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1), right 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.2s ease;
}

/* Light: sun orb — warm amber / gold, matches “day” side */
html:not(.dark) .theme-switch__thumb {
    left: auto;
    right: 3px;
    background:
        radial-gradient(ellipse 58% 52% at 32% 26%, rgba(255, 255, 255, 0.92) 0%, transparent 46%),
        radial-gradient(circle at 48% 52%, #fffbeb 0%, #fef08a 38%, #facc15 78%, #eab308 100%);
    box-shadow:
        0 0 0 1px rgba(234, 179, 8, 0.4),
        0 1px 3px rgba(180, 83, 9, 0.14),
        0 4px 14px rgba(251, 191, 36, 0.28),
        inset 0 2px 5px rgba(255, 255, 255, 0.7),
        inset 0 -2px 6px rgba(217, 119, 6, 0.14);
}

html:not(.dark) .theme-switch:hover .theme-switch__thumb {
    box-shadow:
        0 0 0 1px rgba(234, 179, 8, 0.5),
        0 2px 5px rgba(180, 83, 9, 0.16),
        0 5px 18px rgba(251, 191, 36, 0.36),
        inset 0 2px 5px rgba(255, 255, 255, 0.85),
        inset 0 -2px 6px rgba(217, 119, 6, 0.16);
}

/* Dark: silver moon sphere on dark track */
html.dark .theme-switch__thumb {
    left: 3px;
    right: auto;
    background:
        radial-gradient(ellipse 54% 48% at 28% 22%, rgba(255, 255, 255, 0.95) 0%, transparent 48%),
        radial-gradient(circle at 46% 50%, #ffffff 0%, #e2e8f0 38%, #64748b 88%, #475569 100%);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.45),
        inset 2px 2px 6px rgba(255, 255, 255, 0.4),
        inset -3px -4px 8px rgba(15, 23, 42, 0.35),
        0 2px 5px rgba(0, 0, 0, 0.45),
        0 5px 12px rgba(0, 0, 0, 0.28);
}

html.dark .theme-switch:hover .theme-switch__thumb {
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.5),
        inset 2px 2px 7px rgba(255, 255, 255, 0.45),
        inset -3px -4px 9px rgba(15, 23, 42, 0.38),
        0 3px 7px rgba(0, 0, 0, 0.5),
        0 7px 16px rgba(0, 0, 0, 0.32);
}

.theme-switch__thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(ellipse 42% 38% at 32% 24%, rgba(255, 255, 255, 0.45) 0%, transparent 58%);
    opacity: 0.65;
}

html:not(.dark) .theme-switch__thumb::after {
    opacity: 0.4;
    background: radial-gradient(ellipse 52% 46% at 36% 24%, rgba(255, 255, 255, 0.95) 0%, transparent 50%);
}

html.dark .theme-switch__thumb::after {
    opacity: 0.5;
    background: radial-gradient(ellipse 40% 36% at 30% 22%, rgba(255, 255, 255, 0.35) 0%, transparent 58%);
}

@media (prefers-reduced-motion: reduce) {
    .theme-switch__thumb {
        transition-duration: 0.01ms;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--fontlab-body-bg);
    color: var(--fontlab-body-text);
    overflow-y: scroll;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: -1;
    border-radius: 999px;
    filter: blur(44px);
    opacity: 0;
    transition: opacity 0.26s ease;
}

/* Light: warm atmosphere (CineWeave-style radial washes + soft orbs) */
html:not(.dark) body {
    background:
        radial-gradient(circle at 20% 20%, rgba(238, 152, 89, 0.22) 0%, rgba(238, 152, 89, 0) 38%),
        radial-gradient(circle at 82% 8%, rgba(89, 161, 238, 0.16) 0%, rgba(89, 161, 238, 0) 42%),
        #f6f3eb;
}

html:not(.dark) body::before,
html:not(.dark) body::after {
    opacity: 0.45;
}

html:not(.dark) body::before {
    width: 20rem;
    height: 20rem;
    background: #ffba7c;
    top: -7rem;
    right: -6rem;
}

html:not(.dark) body::after {
    width: 18rem;
    height: 18rem;
    background: #98b2ff;
    bottom: -7rem;
    left: -5rem;
}

/* Mobile: smoothen perceived theme switch (avoid abrupt hard flip) */
@media (max-width: 767px) {
    html.theme-switching-mobile *,
    html.theme-switching-mobile *::before,
    html.theme-switching-mobile *::after {
        transition:
            background-color 0.24s ease,
            color 0.24s ease,
            border-color 0.24s ease,
            fill 0.24s ease,
            stroke 0.24s ease,
            box-shadow 0.24s ease !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after {
        transition-duration: 0.01ms;
    }

    html.theme-switching-mobile *,
    html.theme-switching-mobile *::before,
    html.theme-switching-mobile *::after {
        transition-duration: 0.01ms !important;
    }
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: var(--fontlab-header-bg);
    border-bottom: 1px solid var(--fontlab-header-border);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.site-footer {
    position: relative;
    z-index: 10;
    margin-top: auto;
    border-top: 1px solid var(--site-footer-border);
    background: var(--site-footer-bg);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.site-footer__inner {
    max-width: 90rem;
    margin-left: auto;
    margin-right: auto;
    padding: 2.25rem 1.5rem 2rem;
}

@media (min-width: 768px) {
    .site-footer__inner {
        padding: 2.75rem 3rem 2.25rem;
    }
}

/* Reference-style row: heavy nav · slash · social grid · slash · legal */
.site-footer__strip {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .site-footer__strip {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr);
        align-items: center;
        gap: clamp(0.75rem, 2vw, 1.75rem);
    }

    .site-footer__nav-primary {
        justify-self: start;
    }

    .site-footer__social {
        justify-self: center;
    }

    .site-footer__legal {
        justify-self: end;
    }
}

.site-footer__nav-primary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(0.75rem, 2.5vw, 1.75rem);
    font-family: 'Archivo Black', 'Inter', sans-serif;
    font-size: clamp(1.125rem, 3.5vw, 2rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.site-footer__nav-primary a {
    color: var(--site-footer-nav-fg);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.site-footer__nav-primary a:hover {
    opacity: 0.65;
}

.site-footer__slash {
    display: none;
    flex-shrink: 0;
    align-self: center;
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 4rem);
    line-height: 0.85;
    color: var(--site-footer-slash-fg);
    user-select: none;
}

@media (min-width: 1024px) {
    .site-footer__slash {
        display: block;
        justify-self: center;
    }
}

.site-footer__social {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, auto));
    column-gap: clamp(1.25rem, 4vw, 2.5rem);
    row-gap: 0.4rem;
    justify-content: start;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.35;
    text-transform: uppercase;
}

.site-footer__social a {
    color: var(--site-footer-social-fg);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.site-footer__social a:hover {
    opacity: 0.55;
}

.site-footer__legal {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.45;
    text-transform: uppercase;
    color: var(--site-footer-legal-fg);
}

@media (min-width: 1024px) {
    .site-footer__legal {
        align-items: flex-end;
        text-align: right;
        min-width: 0;
        justify-self: end;
    }
}

.site-footer__legal p {
    margin: 0;
}

.site-footer__tagline {
    margin: 1.75rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--site-footer-border);
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--site-footer-tagline-fg);
}

.site-footer__tagline a {
    color: var(--bundled-link);
    font-weight: 500;
    text-decoration: none;
}

.site-footer__tagline a:hover {
    color: var(--bundled-link-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer__nav-primary a:focus-visible,
.site-footer__social a:focus-visible,
.site-footer__tagline a:focus-visible {
    outline: 2px solid var(--font-title-icon);
    outline-offset: 3px;
    border-radius: 2px;
}

.font-card {
    transition: all 0.2s ease-in-out;
    border: 1px solid var(--font-card-border);
}
.font-card:hover {
    transform: translateY(-3px);
    border-color: var(--font-card-border-hover);
    box-shadow: 0 10px 30px -10px var(--font-card-shadow-hover);
}

.font-card--skeleton {
    pointer-events: none;
}

.font-card--skeleton:hover {
    transform: none;
    border-color: var(--font-card-border);
    box-shadow: none;
}

.skeleton-line,
.skeleton-dot {
    position: relative;
    overflow: hidden;
    background: #efe6d5;
}

.dark .skeleton-line,
.dark .skeleton-dot {
    background: #334155;
}

.skeleton-line::after,
.skeleton-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: fontlabSkeletonShimmer 1.1s ease-in-out infinite;
}

.dark .skeleton-line::after,
.dark .skeleton-dot::after {
    background: linear-gradient(
        90deg,
        rgba(148, 163, 184, 0) 0%,
        rgba(148, 163, 184, 0.32) 50%,
        rgba(148, 163, 184, 0) 100%
    );
}

.skeleton-line {
    height: 1rem;
    border-radius: 999px;
}

.skeleton-line--title {
    width: min(18rem, 65%);
}

.skeleton-line--preview {
    width: min(32rem, 92%);
    height: 2rem;
}

.skeleton-dot {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.65rem;
    flex-shrink: 0;
}

@keyframes fontlabSkeletonShimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Live search: hide non-matching preview cards without removing them from the DOM */
.font-card.font-card--search-hidden {
    display: none !important;
}

/* Search input: hide browser-native clear controls so only our custom clear button shows */
#fontSearchInput {
    -webkit-appearance: none;
    appearance: none;
}

#fontSearchInput::-webkit-search-decoration,
#fontSearchInput::-webkit-search-cancel-button,
#fontSearchInput::-webkit-search-results-button,
#fontSearchInput::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

/* Custom styling for the range slider */
input[type='range']::-webkit-slider-thumb {
    appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--range-thumb);
    cursor: pointer;
    margin-top: -6px;
}

input[type='range']::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--range-track);
    border-radius: 3px;
}

input[type='range']::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border: 0;
    border-radius: 50%;
    background: var(--range-thumb);
    cursor: pointer;
}

input[type='range']::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--range-track);
    border-radius: 3px;
}

/* Single-line preview: no wrap; scroll horizontally; height fits glyph metrics */
.preview-display-scroll {
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: var(--preview-scrollbar-thumb) var(--preview-scrollbar-track);
    min-height: 2.75rem;
}

.preview-display-scroll::-webkit-scrollbar {
    height: 8px;
}

.preview-display-scroll::-webkit-scrollbar-track {
    background: var(--preview-scrollbar-track);
    border-radius: 4px;
}

.preview-display-scroll::-webkit-scrollbar-thumb {
    background: var(--preview-scrollbar-thumb);
    border-radius: 4px;
}

.preview-display {
    font-size: var(--p-text-size);
    line-height: normal;
    white-space: nowrap;
    display: inline-block;
    min-width: min-content;
    overflow: visible;
    flex-shrink: 0;
    color: var(--preview-display-text);
    transition: color 0.2s ease;
}

/* Font title row: icon + label */
.font-title-icon {
    color: var(--font-title-icon);
    flex-shrink: 0;
}

.font-title-label {
    color: var(--font-title-label);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Credit line above bundled preview grid */
.bundled-fonts-credit {
    letter-spacing: 0.04em;
    color: var(--bundled-credit);
    border-bottom: 1px solid var(--bundled-credit-border);
    padding-bottom: 0.75rem;
}

.bundled-fonts-credit__link {
    color: var(--bundled-link);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.bundled-fonts-credit__link:hover {
    color: var(--bundled-link-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Cart drawer */
.cart-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--cart-overlay-bg);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 201;
    display: flex;
    flex-direction: column;
    height: 100%;
    height: 100dvh;
    width: 100%;
    max-width: 22rem;
    background: var(--cart-drawer-bg);
    border-left: 1px solid var(--cart-drawer-border);
    box-shadow: var(--cart-drawer-shadow);
    transform: translateX(100%);
    transition: transform 0.22s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.cart-drawer.is-open {
    transform: translateX(0);
}

body.cart-drawer-open {
    overflow: hidden;
}

.cart-list {
    min-height: 0;
}

.cart-list:empty {
    display: none;
}

.cart-empty.is-hidden {
    display: none;
}

/* Download confirmation toast */
.toast-root {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    z-index: 300;
    width: min(22rem, calc(100vw - 2rem));
    transform: translateX(-50%);
    pointer-events: none;
}

.toast-card {
    pointer-events: auto;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--toast-border);
    background: var(--toast-bg);
    box-shadow: var(--toast-shadow);
    backdrop-filter: blur(10px);
    animation: toast-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.toast-card.toast-out {
    animation: toast-out 0.28s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(0.5rem) scale(0.98);
    }
}

.toast-card__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: var(--toast-icon-bg);
    color: var(--toast-icon-color);
}

.toast-card__title {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--toast-title);
    line-height: 1.35;
}

.toast-card__detail {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--toast-detail);
}

/* Back-to-top (shown after scrolling down) */
.scroll-to-top-btn {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--scroll-top-border);
    border-radius: 0.75rem;
    background: var(--scroll-top-bg);
    color: var(--scroll-top-fg);
    box-shadow: 0 10px 30px -8px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease, background 0.15s ease,
        border-color 0.15s ease, color 0.15s ease;
}

html.dark .scroll-to-top-btn {
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.45);
}

.scroll-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    background: var(--scroll-top-bg-hover);
    border-color: var(--scroll-top-border);
    color: var(--fontlab-body-text);
}

.scroll-to-top-btn:focus {
    outline: none;
}

.scroll-to-top-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--scroll-top-focus-ring), 0 0 0 4px rgba(16, 185, 129, 0.55);
}

@media (prefers-reduced-motion: reduce) {
    .scroll-to-top-btn {
        transition-duration: 0.01ms;
    }
}

/* Batched font loading footer */
.font-batch-footer {
    min-height: 1.5rem;
}

/* Cart row: typeface icon next to font name */
.cart-item-title-icon .font-title-icon {
    color: var(--font-title-icon);
}

.cart-summary-track {
    margin-bottom: 0.5rem;
}

.cart-summary-progress {
    background: linear-gradient(90deg, #059669, #34d399);
    box-shadow: 0 0 12px -2px var(--cart-progress-glow);
}

.cart-summary-progress.cart-summary-progress--near-full {
    background: linear-gradient(90deg, #d97706, #fb923c);
    box-shadow: 0 0 14px -2px var(--cart-progress-near-glow);
}

.cart-summary-progress.cart-summary-progress--full {
    background: linear-gradient(90deg, #b91c1c, #f87171);
    box-shadow: 0 0 16px -2px var(--cart-progress-full-glow);
}

/* Themed confirm dialog (replaces window.confirm) */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    background: var(--modal-backdrop);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.confirm-modal-panel {
    width: 100%;
    max-width: 22rem;
    border-radius: 1rem;
    border: 1px solid var(--modal-panel-border);
    background: var(--modal-panel-bg);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--modal-panel-shadow);
    transform: translateY(0.5rem) scale(0.98);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, border-color 0.2s ease;
}

.confirm-modal-overlay.is-open .confirm-modal-panel {
    transform: translateY(0) scale(1);
}

.confirm-modal-title {
    margin: 0 0 0.65rem;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--modal-title);
}

.confirm-modal-body {
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--modal-body);
}

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

.confirm-modal-btn {
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.confirm-modal-btn:focus {
    outline: none;
}

.confirm-modal-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--modal-focus-ring), 0 0 0 4px rgba(16, 185, 129, 0.45);
}

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

.confirm-modal-btn--secondary:hover {
    border-color: var(--modal-btn-secondary-hover-border);
    background: var(--modal-btn-secondary-hover-bg);
    color: var(--modal-title);
}

.confirm-modal-btn--danger {
    border: 1px solid var(--modal-danger-border);
    background: var(--modal-danger-bg);
    color: var(--modal-danger-text);
}

.confirm-modal-btn--danger:hover {
    border-color: var(--modal-danger-border-hover);
    background: var(--modal-danger-bg-hover);
    color: var(--modal-danger-text-hover);
}

@media (prefers-reduced-motion: reduce) {
    .confirm-modal-overlay,
    .confirm-modal-panel {
        transition-duration: 0.01ms;
    }
}

/*----------Header image logo style-----------*/

.header-logo{
    height: 25px;
    display: none;
}
