/* ==========================================================================
   FontCart — FileCart's theme (Bootstrap 5.3, ink navy + cobalt, marigold for
   downloads) plus the specimen, tester and glyph components a font site needs.
   ========================================================================== */

:root {
    --fc-ink: #14213D;
    --fc-ink-2: #23335A;
    --fc-cobalt: #1D4ED8;
    --fc-cobalt-dark: #173EAD;
    --fc-marigold: #FFB627;
    --fc-marigold-dark: #F0A20A;
    --fc-surface: #F4F6F9;
    --fc-paper: #FFFFFF;
    --fc-line: #DCE2EA;
    --fc-line-soft: #EEF1F5;
    --fc-muted: #5B6577;
    --fc-radius: 10px;
    --fc-radius-sm: 6px;
    --fc-font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --fc-display: "Unbounded", "Schibsted Grotesk", system-ui, sans-serif;
    --fc-ink-deep: #0E1830;
    --fc-on-ink: rgba(255,255,255,.72);
    --fc-shadow: 0 1px 2px rgba(20,33,61,.05), 0 8px 24px -16px rgba(20,33,61,.18);
    --fc-band: #14213D;
    --fc-band-2: #23335A;
    --fc-on-accent: #14213D;
    --fc-cobalt-fill: var(--fc-cobalt);
    --fc-cobalt-fill-dark: var(--fc-cobalt-dark);
    --fc-track: #E9EDF3;
    --fc-tint: #EEF2FF;
    --fc-hover: #FAFBFD;
    --fc-header-bg: rgba(255,255,255,.92);
    --header-h: 106px;

    /* Specimens: what a listing card draws and how big */
    --specimen-size: 56px;
    --specimen-ink: var(--fc-ink);
    --specimen-bg: transparent;

    --bs-body-font-family: var(--fc-font);
    --bs-body-color: var(--fc-ink);
    --bs-body-bg: var(--fc-surface);
    --bs-primary: var(--fc-cobalt);
    --bs-primary-rgb: 29, 78, 216;
    --bs-link-color: var(--fc-cobalt);
    --bs-link-color-rgb: 29, 78, 216;
    --bs-link-hover-color: var(--fc-cobalt-dark);
    --bs-link-hover-color-rgb: 23, 62, 173;
    --bs-border-color: var(--fc-line);
    --bs-border-radius: var(--fc-radius-sm);
    --bs-secondary-color: var(--fc-muted);
    --bs-emphasis-color: var(--fc-ink);
    color-scheme: light;
}

html { overflow-x: hidden; scroll-padding-top: calc(var(--header-h) + 1rem); }
@supports (overflow: clip) { html { overflow-x: clip; } }
body { background: var(--fc-surface); font-feature-settings: "ss01"; -webkit-font-smoothing: antialiased; }

h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.01em; color: var(--fc-ink); }
h1, .h1 { font-family: var(--fc-display); font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); line-height: 1.08; letter-spacing: -0.02em; font-weight: 700; }
.display-num { font-family: var(--fc-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: lining-nums; }
h2, .h2 { font-size: 1.375rem; }
h3, .h3 { font-size: 1.125rem; }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.btn:hover, .brand:hover, .page-link:hover { text-decoration: none; }
:focus-visible { outline: 3px solid var(--fc-marigold); outline-offset: 2px; }
.skip-link { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: var(--fc-paper); padding: .5rem 1rem; border-radius: var(--fc-radius-sm); }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: var(--fc-radius-sm); }
.btn-primary {
    --bs-btn-bg: var(--fc-cobalt-fill); --bs-btn-border-color: var(--fc-cobalt-fill);
    --bs-btn-hover-bg: var(--fc-cobalt-fill-dark); --bs-btn-hover-border-color: var(--fc-cobalt-fill-dark);
    --bs-btn-active-bg: var(--fc-cobalt-fill-dark); --bs-btn-active-border-color: var(--fc-cobalt-fill-dark);
}
.btn-ink {
    --bs-btn-color: #fff; --bs-btn-bg: var(--fc-band); --bs-btn-border-color: var(--fc-band);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--fc-band-2); --bs-btn-hover-border-color: var(--fc-band-2);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--fc-band-2); --bs-btn-active-border-color: var(--fc-band-2);
}
/* The one loud colour on the site: anything that downloads or searches. */
.btn-download {
    --bs-btn-color: var(--fc-on-accent); --bs-btn-bg: var(--fc-marigold); --bs-btn-border-color: var(--fc-marigold);
    --bs-btn-hover-color: var(--fc-on-accent); --bs-btn-hover-bg: var(--fc-marigold-dark); --bs-btn-hover-border-color: var(--fc-marigold-dark);
    --bs-btn-active-color: var(--fc-on-accent); --bs-btn-active-bg: var(--fc-marigold-dark); --bs-btn-active-border-color: var(--fc-marigold-dark);
    font-weight: 700;
}
.btn-outline-secondary { --bs-btn-color: var(--fc-ink); --bs-btn-border-color: var(--fc-line); --bs-btn-hover-bg: var(--fc-surface); --bs-btn-hover-color: var(--fc-ink); --bs-btn-hover-border-color: var(--fc-cobalt); --bs-btn-active-bg: var(--fc-tint); --bs-btn-active-color: var(--fc-ink); }
.btn-icon { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border: 1px solid var(--fc-line); border-radius: 8px; color: var(--fc-muted); background: var(--fc-paper); }
.btn-icon:hover { color: var(--fc-cobalt); border-color: var(--fc-cobalt); }

/* ---------- Header ---------- */
.site-header {
    background: var(--fc-header-bg); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--fc-line);
    position: sticky; top: 0; z-index: 1030;
}
.site-bar { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 0; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--fc-ink); flex: 0 0 auto; }
.brand:hover { color: var(--fc-ink); }
.brand-mark {
    display: grid; place-items: center; width: 2.1rem; height: 2.1rem;
    background: var(--fc-marigold); color: var(--fc-on-accent); border-radius: 9px;
    font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.04em;
}
.brand-name { font-family: var(--fc-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.site-search {
    flex: 1; max-width: 640px; display: flex; align-items: center; gap: .6rem;
    background: var(--fc-surface); border: 1px solid var(--fc-line); border-radius: 12px; padding: .3rem .3rem .3rem .9rem;
}
.site-search:focus-within { background: var(--fc-paper); border-color: var(--fc-cobalt); box-shadow: 0 0 0 .2rem rgba(29,78,216,.12); }
.site-search > i { color: var(--fc-muted); }
.site-search input[type=search] { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1rem; font-weight: 500; color: var(--fc-ink); padding: .35rem 0; }
.site-search input::placeholder { color: #8A93A5; text-overflow: ellipsis; }
.site-search .btn { padding: .4rem 1rem; border-radius: 9px; }
.account-nav { display: flex; align-items: center; gap: 1.1rem; font-size: .925rem; margin-left: auto; flex: 0 0 auto; }
.sister-link { display: inline-flex; align-items: center; gap: .45rem; color: var(--fc-ink); font-weight: 600; white-space: nowrap; }
.sister-link i { color: var(--fc-cobalt); }
.sister-link:hover { color: var(--fc-cobalt); text-decoration: none; }

.nav-bar { display: flex; align-items: center; gap: 1rem; padding: 0 0 .55rem; overflow-x: auto; scrollbar-width: none; }
.nav-bar::-webkit-scrollbar { display: none; }
.section-nav { display: flex; gap: 1.25rem; flex: 0 0 auto; font-size: .875rem; }
.section-nav a { color: var(--fc-muted); font-weight: 600; white-space: nowrap; padding: .35rem 0; border-bottom: 2px solid transparent; }
.section-nav a:hover { color: var(--fc-ink); text-decoration: none; }
.section-nav a.active { color: var(--fc-ink); border-bottom-color: var(--fc-marigold); }
.nav-divider { flex: 0 0 1px; height: 1.25rem; background: var(--fc-line); }
.category-pills { display: flex; gap: .25rem; flex: 0 0 auto; }
.platform-pill { display: inline-flex; align-items: center; padding: .3rem .7rem; border-radius: 999px; color: var(--fc-muted); font-weight: 500; font-size: .85rem; white-space: nowrap; }
.platform-pill:hover { color: var(--fc-ink); background: var(--fc-surface); text-decoration: none; }
.platform-pill.is-current { background: var(--fc-band); color: #fff; }

.theme-toggle { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border: 1px solid var(--fc-line); border-radius: 50%; background: transparent; color: var(--fc-ink); }
.theme-toggle:hover { background: var(--fc-surface); }
.theme-toggle .fa-sun, [data-bs-theme=dark] .theme-toggle .fa-moon { display: none; }
[data-bs-theme=dark] .theme-toggle .fa-sun { display: inline-block; }

@media (max-width: 767.98px) {
    .site-bar { flex-wrap: wrap; gap: .6rem 1rem; }
    .site-search { order: 3; flex-basis: 100%; max-width: none; }
}

/* ---------- Main + hero ---------- */
.site-main { padding: 0 0 3rem; min-height: 60vh; }
.page-hero {
    position: relative; isolation: isolate; overflow: hidden;
    padding: 2.25rem 0 2.75rem; margin-bottom: 0;
    background: var(--fc-band); color: #fff;
}
.page-hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 28px 28px; background-position: center top;
    mask-image: linear-gradient(to bottom, transparent, #000 30%, transparent 100%);
}
.page-hero h1, .page-hero h2 { color: #fff; margin-bottom: .5rem; }
.page-hero h1 .hl { color: var(--fc-marigold); }
.page-hero p { color: var(--fc-on-ink); font-size: 1.1rem; max-width: 62ch; margin-bottom: 0; }
.page-hero .breadcrumb { --bs-breadcrumb-divider-color: rgba(255,255,255,.4); }
.page-hero .breadcrumb a { color: rgba(255,255,255,.75); }
.page-hero .breadcrumb a:hover { color: #fff; }
.page-hero .breadcrumb-item.active { color: rgba(255,255,255,.5); }
.page-hero .hero-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1rem; color: var(--fc-on-ink); font-size: .95rem; }
.page-hero .hero-meta i { color: var(--fc-marigold); margin-right: .2rem; }
.page-hero.is-compact { padding-bottom: 5.5rem; }
.page-hero.text-center p { margin-left: auto; margin-right: auto; }
.overlap { position: relative; margin-top: -4rem; z-index: 1; }
.overlap > .data-block { box-shadow: 0 30px 60px -36px rgba(20,33,61,.45), var(--fc-shadow); }
.auth-card { max-width: 520px; margin-left: auto; margin-right: auto; }
.auth-card > section { padding: 1.75rem; }

.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem !important; font-weight: 600; color: var(--fc-marigold) !important; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .75rem !important; }
.hero-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; }
@media (max-width: 767.98px) { .hero-split { grid-template-columns: 1fr; gap: 1.25rem; } }
.hero-stats { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; margin-top: 2rem; }
.hero-split .hero-stats { margin-top: 0; }
.hero-stat .display-num { font-size: 2.1rem; color: #fff; display: block; }
.hero-stat span:last-child { color: var(--fc-on-ink); font-size: .9rem; }
@media (max-width: 575.98px) {
    .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
    .hero-stat .display-num { font-size: 1.55rem; }
    .hero-stat span:last-child { font-size: .8rem; }
}

/* Homepage hero: copy left, showcase right */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
@media (max-width: 991.98px) { .home-hero { grid-template-columns: 1fr; gap: 1.75rem; } }
.home-hero h1 { font-size: clamp(2.2rem, 1.2rem + 3.6vw, 4rem); line-height: 1.02; letter-spacing: -0.035em; margin: .25rem 0 1.1rem; }
.home-hero .lede { font-size: 1.15rem; max-width: 46ch; }

/* Showcase: one glyph pair cycling through the top fonts */
.showcase {
    position: relative; margin: 0; min-height: 300px; display: flex; flex-direction: column;
    background: var(--fc-ink-deep); border: 1px solid rgba(255,255,255,.08); border-radius: 18px;
    box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); overflow: hidden;
}
.showcase::before { /* baseline + x-height guides */
    content: ""; position: absolute; left: 0; right: 0; top: 30%; height: 42%; pointer-events: none;
    border-top: 1px dashed rgba(255,255,255,.08); border-bottom: 1px dashed rgba(255,182,39,.25);
}
.showcase-stage { position: relative; flex: 1; min-height: 260px; }
.showcase-item {
    position: absolute; inset: 0; display: grid; place-items: center; grid-template-rows: 1fr auto; padding: 1rem 1.25rem;
    opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1);
    color: #fff; pointer-events: none;
}
.showcase-item.is-on { opacity: 1; transform: none; pointer-events: auto; }
.showcase-item:hover { text-decoration: none; color: #fff; }
.showcase-glyph { font-size: clamp(6rem, 4rem + 8vw, 10.5rem); line-height: 1; white-space: nowrap; visibility: hidden; }
.showcase-item.is-ready .showcase-glyph { visibility: visible; }
.showcase figcaption { font-size: .9rem; font-weight: 600; color: var(--fc-on-ink); justify-self: start; }
.showcase figcaption::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--fc-marigold); margin-right: .5rem; vertical-align: .1rem; }
.showcase-dots { display: flex; gap: .35rem; justify-content: flex-end; padding: 0 1.25rem 1rem; margin-top: -1.9rem; position: relative; }
.showcase-dots i { width: .45rem; height: .45rem; border-radius: 50%; background: rgba(255,255,255,.2); transition: background .3s, width .3s; }
.showcase-dots i.is-on { background: var(--fc-marigold); width: 1.2rem; border-radius: 99px; }
@media (max-width: 991.98px) { .showcase { min-height: 220px; } .showcase-stage { min-height: 190px; } }

/* Search inside a hero */
.hero-search { display: flex; align-items: center; gap: .6rem; max-width: 640px; margin-top: 1.5rem; background: #fff; border-radius: 14px; padding: .4rem .4rem .4rem 1rem; box-shadow: 0 20px 40px -24px rgba(0,0,0,.6); }
.hero-search i { color: var(--fc-muted); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 1.1rem; font-weight: 500; color: #14213D; background: transparent; padding: .45rem 0; }
.hero-search .btn { padding: .6rem 1.25rem; border-radius: 10px; }

/* A–Z bar and chips */
.letter-bar { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: 1.5rem; }
.letter-bar a { min-width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.07); color: #fff; font-weight: 700; font-size: .9rem; }
.letter-bar a.is-wide { padding: 0 .6rem; }
.letter-bar a:hover { background: rgba(255,255,255,.16); text-decoration: none; }
.letter-bar a.active { background: var(--fc-marigold); color: var(--fc-on-accent); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .85rem; border-radius: 999px; border: 1px solid var(--fc-line); background: var(--fc-paper); color: var(--fc-ink); font-weight: 600; font-size: .875rem; }
.chip:hover { border-color: var(--fc-cobalt); color: var(--fc-cobalt); text-decoration: none; }
.chip.is-current { background: var(--fc-band); border-color: var(--fc-band); color: #fff; }
.page-hero .chip { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); color: #fff; }
.page-hero .chip:hover { border-color: #fff; }
.page-hero .chip.is-current { background: var(--fc-marigold); border-color: var(--fc-marigold); color: var(--fc-on-accent); }

/* ---------- Panels ---------- */
.data-block { background: var(--fc-paper); border: 1px solid var(--fc-line); border-radius: 14px; box-shadow: var(--fc-shadow); margin-bottom: 1.5rem; overflow: hidden; }
@supports (overflow: clip) { .data-block { overflow: clip; } }
.data-block > header { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--fc-line); flex-wrap: wrap; }
.data-block > header h2 { font-size: 1.05rem; margin: 0; }
.data-block > section { padding: 1.1rem 1.25rem; }
.data-block > section.p-0 { padding: 0; }
.data-block > section > :last-child { margin-bottom: 0; }
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state .empty-icon { width: 4rem; height: 4rem; margin: 0 auto 1rem; border-radius: 18px; display: grid; place-items: center; background: var(--fc-surface); color: var(--fc-cobalt); font-size: 1.6rem; }
.empty-state h2 { font-size: 1.15rem; margin-bottom: .4rem; }
.empty-state p { color: var(--fc-muted); max-width: 44ch; margin: 0 auto 1.25rem; }
.an-empty { margin: 0; padding: 1.5rem 1.25rem; color: var(--fc-muted); font-size: .9rem; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2rem 0 1rem; }
.section-title h2 { font-family: var(--fc-display); font-size: clamp(1.25rem, 1rem + .8vw, 1.6rem); letter-spacing: -0.02em; margin: 0; }
.section-title a { font-weight: 600; white-space: nowrap; }
.list-count { color: var(--fc-muted); font-size: .9rem; margin: 1.5rem 0 .75rem; }

.style-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.style-shelf a { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; background: var(--fc-paper); border: 1px solid var(--fc-line); border-radius: 12px; color: var(--fc-ink); font-weight: 600; }
.style-shelf a i { color: var(--fc-muted); font-size: .8rem; transition: transform .15s; }
.style-shelf a:hover { border-color: var(--fc-cobalt); color: var(--fc-cobalt); text-decoration: none; }
.style-shelf a:hover i { color: var(--fc-cobalt); transform: translateX(3px); }

.breadcrumb { font-size: .9rem; margin-bottom: .75rem; }
.form-label { font-weight: 600; font-size: .925rem; }
.form-control:focus { border-color: var(--fc-cobalt); box-shadow: 0 0 0 .2rem rgba(29,78,216,.15); }
.spec-table th { color: var(--fc-muted); font-weight: 500; width: 1%; white-space: nowrap; padding-left: 1.25rem !important; }
.spec-table td { padding-right: 1.25rem !important; overflow-wrap: anywhere; }
.spec-table tr:last-child > * { border-bottom: 0; }

.pager { display: flex; justify-content: center; margin-top: 1.75rem; }
.pagination { --bs-pagination-color: var(--fc-ink); --bs-pagination-bg: var(--fc-paper); --bs-pagination-active-bg: var(--fc-cobalt-fill); --bs-pagination-active-border-color: var(--fc-cobalt-fill); --bs-pagination-border-color: var(--fc-line); --bs-pagination-hover-color: var(--fc-cobalt); --bs-pagination-disabled-bg: var(--fc-paper); flex-wrap: wrap; justify-content: center; }
.page-link { font-weight: 600; min-width: 2.5rem; text-align: center; }

/* ==========================================================================
   Tester bar: sticky under the header, drives every specimen on the page
   ========================================================================== */
.tester-bar {
    position: sticky; top: var(--header-h); z-index: 1020;
    background: var(--fc-header-bg); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--fc-line);
    transition: box-shadow .2s;
}
.tester-bar.is-stuck { box-shadow: 0 10px 24px -18px rgba(20,33,61,.45); }
.tester-inner { display: flex; align-items: center; gap: .75rem 1rem; padding: .7rem 0; flex-wrap: wrap; }
.tester-text {
    flex: 1 1 320px; display: flex; align-items: center; gap: .6rem; margin: 0;
    background: var(--fc-paper); border: 2px solid var(--fc-line); border-radius: 12px; padding: .35rem .5rem .35rem .9rem; cursor: text;
}
.tester-text:focus-within { border-color: var(--fc-marigold); box-shadow: 0 0 0 .25rem rgba(255,182,39,.2); }
.tester-text > i { color: var(--fc-marigold-dark); }
.tester-text input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1.05rem; font-weight: 600; color: var(--fc-ink); padding: .25rem 0; }
.tester-text input::placeholder { color: #8A93A5; font-weight: 500; }
.tester-clear { border: 0; background: var(--fc-surface); color: var(--fc-muted); width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; }
.tester-clear:hover { color: var(--fc-ink); }
.tester-presets { display: flex; gap: .25rem; flex-wrap: wrap; }
.tester-presets button { border: 1px solid var(--fc-line); background: var(--fc-paper); color: var(--fc-muted); font-size: .8rem; font-weight: 600; border-radius: 999px; padding: .3rem .7rem; }
.tester-presets button:hover { color: var(--fc-ink); border-color: var(--fc-cobalt); }
.tester-presets button[aria-pressed="true"] { background: var(--fc-band); border-color: var(--fc-band); color: #fff; }
.tester-size { display: flex; align-items: center; gap: .5rem; margin: 0; color: var(--fc-muted); }
.tester-size input { width: 120px; }
.tester-size output, .tt-range output { font-size: .8rem; font-weight: 700; color: var(--fc-ink); min-width: 3.1em; font-variant-numeric: tabular-nums; }
.tester-toggles { display: flex; align-items: center; gap: .5rem; }
.tester-toggle, .tester-view button, .seg button {
    display: inline-grid; place-items: center; height: 2.1rem; min-width: 2.1rem; padding: 0 .5rem;
    border: 1px solid var(--fc-line); background: var(--fc-paper); color: var(--fc-muted); font-weight: 700; font-size: .85rem;
}
.tester-toggle { border-radius: 8px; }
.tester-view, .seg { display: inline-flex; }
.tester-view button:first-child, .seg button:first-child { border-radius: 8px 0 0 8px; }
.tester-view button:last-child, .seg button:last-child { border-radius: 0 8px 8px 0; }
.tester-view button + button, .seg button + button { margin-left: -1px; }
.tester-toggle:hover, .tester-view button:hover, .seg button:hover { color: var(--fc-ink); }
.tester-toggle[aria-pressed="true"], .tester-view button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--fc-band); border-color: var(--fc-band); color: #fff; position: relative; }
input[type=range] { accent-color: var(--fc-cobalt); }
@media (max-width: 767.98px) {
    .tester-presets { display: none; }
    .tester-text { flex-basis: 100%; }
    .tester-size { flex: 1; }
    .tester-size input { width: 100%; flex: 1; }
}

/* ==========================================================================
   Font cards (listing specimens)
   ========================================================================== */
.font-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin-top: 1.25rem; }
.list-count + .font-list { margin-top: 0; }
.font-list.is-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.font-card {
    position: relative; display: flex; flex-direction: column;
    background: var(--fc-paper); border: 1px solid var(--fc-line); border-radius: 14px; box-shadow: var(--fc-shadow);
    transition: border-color .15s, box-shadow .2s, transform .2s;
}
.font-card:hover { border-color: #B8C4D9; box-shadow: 0 1px 2px rgba(20,33,61,.05), 0 18px 36px -22px rgba(20,33,61,.35); }
.font-card-head { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem .25rem 1.15rem; }
.font-rank { flex: 0 0 auto; font-family: var(--fc-display); font-weight: 700; font-size: 1rem; color: var(--fc-muted); min-width: 1.6rem; text-align: center; }
.font-card:nth-child(-n+3) .font-rank { color: var(--fc-on-accent); background: var(--fc-marigold); border-radius: 8px; padding: .2rem .35rem; }
.font-card-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: .25rem 1rem; flex-wrap: wrap; }
.font-card-title h3 { font-size: 1rem; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.font-card-title h3 a { color: var(--fc-ink); }
.font-card-title h3 a:hover { color: var(--fc-cobalt); }
.font-card-title h3 a::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; } /* whole card is the link */
.font-facts { display: flex; gap: .9rem; color: var(--fc-muted); font-size: .8rem; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.font-facts i { font-size: .7rem; opacity: .75; margin-right: .1rem; }
.font-card-actions { position: relative; z-index: 1; display: flex; gap: .4rem; flex: 0 0 auto; }
.font-card-actions .btn-download { box-shadow: 0 6px 14px -10px rgba(240,162,10,.9); }

.specimen {
    position: relative; display: block; overflow: hidden;
    margin: .25rem .5rem .5rem; padding: .3rem .65rem .6rem; border-radius: 10px;
    color: var(--specimen-ink); background: var(--specimen-bg);
    font-size: var(--specimen-size); line-height: 1.3; min-height: calc(var(--specimen-size) * 1.3 + .9rem);
    pointer-events: none; /* the card link underneath takes the click */
}
.specimen:hover { text-decoration: none; color: var(--specimen-ink); }
.specimen-text { display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; opacity: 0; transition: opacity .35s ease; overflow-wrap: anywhere; }
.specimen::after { /* fade the overflow instead of a hard cut */
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 4rem; pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--specimen-fade, var(--fc-paper)));
    border-radius: 0 10px 10px 0;
}
.specimen.is-ready .specimen-text { opacity: 1; }
.specimen.is-loading::before { /* shimmer bar while the font downloads */
    content: ""; position: absolute; left: .65rem; top: 50%; height: calc(var(--specimen-size) * .5); width: min(60%, 420px); transform: translateY(-50%);
    border-radius: 8px; background: linear-gradient(90deg, var(--fc-track) 0%, var(--fc-line-soft) 50%, var(--fc-track) 100%); background-size: 200% 100%;
    animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.specimen-img { display: block; max-width: 100%; height: calc(var(--specimen-size) * 1.15); width: auto; object-fit: contain; object-position: left center; }
.specimen.is-failed .specimen-text { display: none; }

/* Inverted specimens */
.font-list.is-inverted { --specimen-ink: #fff; --specimen-bg: var(--fc-band); --specimen-fade: var(--fc-band); }
.font-list.is-inverted .specimen.is-loading::before { background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.16), rgba(255,255,255,.08)); background-size: 200% 100%; }

/* Grid view */
.font-list.is-grid .font-card-head { flex-wrap: wrap; }
.font-list.is-grid .specimen { flex: 1; display: flex; align-items: center; min-height: calc(var(--specimen-size) * 2.6 + 1rem); font-size: calc(var(--specimen-size) * .8); }
.font-list.is-grid .specimen-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.15; }
.font-list.is-grid .specimen::after { display: none; }
.font-list.is-grid .font-card-actions .btn-download span { display: none !important; }

@media (max-width: 575.98px) {
    .font-card-head { padding: .75rem .75rem .2rem .9rem; gap: .6rem; }
    .specimen { font-size: min(var(--specimen-size), 13vw); min-height: calc(min(var(--specimen-size), 13vw) * 1.3 + .9rem); }
}
@media (prefers-reduced-motion: reduce) { .specimen.is-loading::before { animation: none; } }

/* ==========================================================================
   Font page
   ========================================================================== */
.font-hero { padding-bottom: 2.5rem; }
.font-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; }
@media (max-width: 767.98px) { .font-hero-grid { grid-template-columns: 1fr; gap: 1.25rem; } }
.font-title { margin: .25rem 0 .25rem; font-family: var(--fc-display); }
.font-title-live { display: block; font-size: clamp(2.6rem, 1.4rem + 5vw, 5.5rem); line-height: 1.08; letter-spacing: 0; overflow-wrap: anywhere; font-weight: 400; transition: opacity .3s; }
[data-font-page]:not(.font-ready):not(.font-failed):not(.font-unavailable) .font-title-live { opacity: .25; }
.font-title-img { display: block; max-width: 100%; height: clamp(3rem, 2rem + 5vw, 6rem); width: auto; }
.hero-cta { display: flex; flex-direction: column; align-items: stretch; gap: .4rem; min-width: 230px; }
.hero-cta .btn-download { font-size: 1.15rem; padding: .95rem 1.75rem; box-shadow: 0 14px 30px -14px rgba(255,182,39,.8); }
.hero-cta small { color: rgba(255,255,255,.55); text-align: center; }

.font-notice { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1.25rem; padding: .75rem 1rem; border-radius: 12px; background: #FFF6E0; border: 1px solid #F5DFA6; color: #6B4A00; font-size: .9rem; }
.font-notice[hidden] { display: none; }

/* Type tester */
.tester { margin-top: 1.5rem; }
.tt-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding: .8rem 1.25rem; border-bottom: 1px solid var(--fc-line); background: var(--fc-hover); }
.tt-range { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: .8rem; font-weight: 600; color: var(--fc-muted); }
.tt-range input { width: 110px; }
.swatches { display: inline-flex; gap: .35rem; }
.swatch { width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid var(--fc-line); padding: 0; position: relative; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--fc-paper), 0 0 0 4px var(--fc-cobalt); }
.sw-paper { background: linear-gradient(135deg, #fff 50%, #14213D 50%); }
.sw-ink { background: linear-gradient(135deg, #14213D 50%, #fff 50%); }
.sw-marigold { background: linear-gradient(135deg, #FFB627 50%, #14213D 50%); }
.sw-cobalt { background: linear-gradient(135deg, #1D4ED8 50%, #fff 50%); }

.tt-stage { --tt-size: 72px; --tt-track: 0em; --tt-leading: 1.2; position: relative; min-height: 240px; padding: 2rem 1.5rem 2.5rem; background: var(--tt-bg, var(--fc-paper)); color: var(--tt-fg, var(--fc-ink)); transition: background .25s, color .25s; }
.tt-stage[data-theme="ink"] { --tt-bg: #14213D; --tt-fg: #fff; }
.tt-stage[data-theme="marigold"] { --tt-bg: #FFB627; --tt-fg: #14213D; }
.tt-stage[data-theme="cobalt"] { --tt-bg: #1D4ED8; --tt-fg: #fff; }
.tt-canvas { font-size: var(--tt-size); letter-spacing: var(--tt-track); line-height: var(--tt-leading); outline: 0; min-height: 1.2em; overflow-wrap: anywhere; white-space: pre-wrap; caret-color: var(--fc-marigold); }
.tt-canvas:empty::before { content: "Type something…"; opacity: .3; }
.tt-hint { position: absolute; right: 1rem; bottom: .7rem; font-size: .75rem; font-weight: 600; opacity: .45; pointer-events: none; transition: opacity .2s; }
.tt-stage:focus-within .tt-hint { opacity: 0; }
.tt-fallback { display: block; max-width: 100%; height: auto; }

/* Glyph map */
.glyph-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 767.98px) { .glyph-layout { grid-template-columns: 1fr; } }
.glyph-inspector { position: sticky; top: calc(var(--header-h) + 1rem); display: grid; gap: .75rem; }
.glyph-big {
    aspect-ratio: 1; display: grid; place-items: center; border-radius: 14px; font-size: 120px; line-height: 1; overflow: hidden;
    background-color: var(--fc-surface);
    background-image: linear-gradient(var(--fc-line) 1px, transparent 1px), linear-gradient(90deg, var(--fc-line) 1px, transparent 1px);
    background-size: 22px 22px; background-position: center;
    border: 1px solid var(--fc-line);
}
.glyph-inspector dl { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0; }
.glyph-inspector dt { font-size: .72rem; font-weight: 600; color: var(--fc-muted); text-transform: uppercase; letter-spacing: .06em; }
.glyph-inspector dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.glyph-sets h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--fc-muted); margin: 1.1rem 0 .5rem; }
.glyph-sets h3:first-child { margin-top: 0; }
.glyph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; }
.glyph {
    aspect-ratio: 1; display: grid; place-items: center; padding: 0; overflow: hidden;
    border: 1px solid var(--fc-line-soft); border-radius: 8px; background: var(--fc-paper); color: var(--fc-ink);
    font-size: 28px; line-height: 1; transition: transform .12s, border-color .12s, background .12s;
}
.glyph:hover { border-color: var(--fc-cobalt); transform: scale(1.12); position: relative; z-index: 1; background: var(--fc-paper); box-shadow: 0 8px 18px -10px rgba(20,33,61,.4); }
.glyph.is-active { border-color: var(--fc-cobalt); background: var(--fc-tint); }
.glyph.is-missing { opacity: .28; }
.glyph.is-missing:hover { opacity: .6; }
.glyph-fallback { display: block; max-width: 100%; height: auto; margin-bottom: .5rem; }
.font-failed .glyph-grid, .font-failed .glyph-inspector { display: none; }
.font-failed .glyph-layout { grid-template-columns: 1fr; }

/* Waterfall */
.waterfall { list-style: none; margin: 0; padding: 0; }
.waterfall li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); align-items: baseline; gap: 1rem; padding: .6rem 1.25rem; border-bottom: 1px solid var(--fc-line-soft); }
.waterfall li:last-child { border-bottom: 0; }
.wf-size { font-size: .75rem; font-weight: 700; color: var(--fc-muted); text-align: right; font-variant-numeric: tabular-nums; }
.wf-text { font-size: var(--wf); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-fallback { max-width: 100%; height: auto; }
.font-failed .wf-text { display: none; }

/* In use */
.in-use { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: auto auto; gap: .75rem; }
@media (max-width: 575.98px) { .in-use { grid-template-columns: 1fr; } }
.poster { border-radius: 12px; padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem; min-height: 180px; justify-content: center; overflow: hidden; }
.poster-ink { grid-row: span 2; background: var(--fc-band); color: #fff; }
.poster-paper { background: var(--fc-surface); border: 1px solid var(--fc-line); }
.poster-marigold { background: var(--fc-marigold); color: #14213D; align-items: center; text-align: center; }
.poster-kicker { font-size: .7rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--fc-marigold); }
.poster-head { font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem); line-height: 1.05; overflow-wrap: anywhere; }
.poster-head.is-xl { font-size: clamp(3rem, 2rem + 4vw, 5rem); }
.poster-body { font-size: 1.15rem; line-height: 1.4; }
.poster-sub { font-size: .85rem; font-weight: 600; opacity: .75; }
.font-failed .in-use { display: none; }
.font-failed [data-inuse-block] { display: none; }

/* Package */
.pkg-list { list-style: none; margin: 0; padding: 0; }
.pkg-list li { display: flex; align-items: center; gap: .8rem; padding: .65rem 1.25rem; border-bottom: 1px solid var(--fc-line-soft); font-size: .92rem; }
.pkg-list li:last-child { border-bottom: 0; }
.pkg-list i { color: var(--fc-cobalt); width: 1rem; text-align: center; }
.pkg-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.pkg-size { color: var(--fc-muted); font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pkg-list a { font-weight: 600; font-size: .85rem; }

/* Vote */
.liked { display: flex; align-items: center; gap: 1rem; }
.liked-num { font-size: 2.6rem; color: var(--fc-ink); }
.liked-label { font-size: .9rem; color: var(--fc-muted); line-height: 1.35; }
.liked-bar { height: 8px; border-radius: 99px; background: var(--fc-track); overflow: hidden; margin: 1rem 0; }
.liked-bar b { display: block; height: 100%; background: var(--fc-marigold); border-radius: inherit; transition: width .6s cubic-bezier(.2,.7,.2,1); }
.vote-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.vote-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .6rem .5rem; border-radius: 10px; border: 1px solid var(--fc-line); background: var(--fc-paper); color: var(--fc-ink); font-weight: 700; font-size: .9rem; transition: transform .12s, border-color .12s, background .12s; }
.vote-btn:hover:not(:disabled) { border-color: var(--fc-cobalt); color: var(--fc-cobalt); }
.vote-btn:active:not(:disabled) { transform: scale(.97); }
.vote-btn.is-up i { color: #16A34A; }
.vote-btn.is-down i { color: #DC2626; }
.vote-btn:disabled { opacity: .55; cursor: default; }
.vote-btn.is-chosen { opacity: 1; background: var(--fc-tint); border-color: var(--fc-cobalt); animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.06); } }
.vote-note { margin: .75rem 0 0; font-size: .85rem; color: var(--fc-muted); min-height: 1.2em; }

.ad-slot { margin-bottom: 1.5rem; min-height: 0; }
.license-note { font-size: .85rem; color: var(--fc-muted); display: flex; gap: .5rem; }
.license-note i { margin-top: .2rem; color: var(--fc-cobalt); }

/* Readme viewer */
.readme { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.6; color: var(--fc-ink); max-height: 70vh; }
.readme-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.25rem; border-top: 1px solid var(--fc-line); }

/* List toolbar: count, sort, share */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.5rem; margin: 1.5rem 0 .75rem; }
.list-toolbar .list-count { margin: 0; }
.list-toolbar + .font-list { margin-top: 0; }
.section-title + .list-toolbar { margin-top: -.25rem; }
.sort-links { display: flex; align-items: center; gap: .25rem; font-size: .85rem; }
.sort-links span { color: var(--fc-muted); margin-right: .35rem; }
.sort-links a { padding: .3rem .7rem; border-radius: 999px; color: var(--fc-muted); font-weight: 600; }
.sort-links a:hover { color: var(--fc-ink); background: var(--fc-paper); text-decoration: none; }
.sort-links a.active { background: var(--fc-band); color: #fff; }
.list-toolbar .share-row { margin-left: auto; }

/* Share row */
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.share-label { color: var(--fc-muted); font-weight: 500; font-size: .85rem; margin-right: .25rem; }
.share-btn { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%; border: 1px solid var(--fc-line); background: var(--fc-paper); color: var(--fc-ink); font-size: .9rem; transition: border-color .12s, color .12s; }
.share-btn:hover { border-color: var(--fc-cobalt); color: var(--fc-cobalt); text-decoration: none; }
.share-btn.share-native { background: var(--fc-band); border-color: var(--fc-band); color: #fff; }
.share-note { font-size: .85rem; color: #15803D; font-weight: 600; }
[data-bs-theme=dark] .share-note { color: #4ADE80; }
.tt-share { padding: .75rem 1.25rem; border-top: 1px solid var(--fc-line); background: var(--fc-hover); }
.about-font p { margin: 0; color: var(--fc-ink-2); line-height: 1.65; }
@media (max-width: 575.98px) { .list-toolbar .share-row { margin-left: 0; } .share-label { display: none; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--fc-band); color: var(--fc-on-ink); padding: 3.5rem 0 1.5rem; font-size: .925rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2rem; }
@media (max-width: 767.98px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
.brand-footer, .brand-footer:hover { color: #fff; }
.footer-note { color: var(--fc-on-ink); margin: .9rem 0 0; max-width: 34ch; }
.footer-heading { font-size: .9rem; font-weight: 700; margin-bottom: .75rem; color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer nav a { color: var(--fc-on-ink); }
.site-footer nav a:hover { color: #fff; }
.footer-legal { margin: 2.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.5); font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Dark mode: <html data-bs-theme="dark">, set before paint by header.php.
   ========================================================================== */
:root[data-bs-theme=dark] {
    --fc-ink: #E7EBF3;
    --fc-ink-2: #C6CDDB;
    --fc-cobalt: #86A6FF;
    --fc-cobalt-dark: #A9C0FF;
    --fc-cobalt-fill: #3461E6;
    --fc-cobalt-fill-dark: #2A52CC;
    --fc-surface: #0B1120;
    --fc-paper: #131B2E;
    --fc-line: #263149;
    --fc-line-soft: #1D2639;
    --fc-muted: #98A2B6;
    --fc-ink-deep: #0E1628;
    --fc-band: #1A2744;
    --fc-band-2: #26375E;
    --fc-track: #232D44;
    --fc-tint: #1C2A4D;
    --fc-hover: rgba(255,255,255,.03);
    --fc-header-bg: rgba(11,17,32,.88);
    --fc-shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -16px rgba(0,0,0,.7);

    --bs-body-color: var(--fc-ink);
    --bs-body-bg: var(--fc-surface);
    --bs-secondary-bg: #1A2438;
    --bs-tertiary-bg: #151E31;
    --bs-primary: var(--fc-cobalt-fill);
    --bs-primary-rgb: 52, 97, 230;
    --bs-link-color: var(--fc-cobalt);
    --bs-link-color-rgb: 134, 166, 255;
    --bs-link-hover-color: var(--fc-cobalt-dark);
    --bs-link-hover-color-rgb: 169, 192, 255;
    --bs-border-color: var(--fc-line);
    --bs-secondary-color: var(--fc-muted);
    --bs-emphasis-color: #fff;
    color-scheme: dark;
}
[data-bs-theme=dark] .font-card:hover { border-color: #3A4766; }
[data-bs-theme=dark] .font-list.is-inverted { --specimen-ink: #14213D; --specimen-bg: #F4F6F9; --specimen-fade: #F4F6F9; }
[data-bs-theme=dark] .font-list.is-inverted .specimen.is-loading::before { background: linear-gradient(90deg, #E2E7EF, #EEF1F5, #E2E7EF); background-size: 200% 100%; }
[data-bs-theme=dark] .hero-search { background: #131B2E; }
[data-bs-theme=dark] .hero-search input { color: #fff; }
[data-bs-theme=dark] .font-notice { background: #2A2210; border-color: #4A3B14; color: #F5C356; }
[data-bs-theme=dark] .tt-stage[data-theme="ink"] { --tt-bg: #F4F6F9; --tt-fg: #14213D; }
[data-bs-theme=dark] .sw-paper { background: linear-gradient(135deg, #131B2E 50%, #E7EBF3 50%); }
[data-bs-theme=dark] .sw-ink { background: linear-gradient(135deg, #F4F6F9 50%, #14213D 50%); }

/* Fonts nobody has voted on yet */
.badge-new { display: inline-block; padding: .05rem .45rem; border-radius: 999px; background: var(--fc-marigold); color: var(--fc-on-accent); font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.about-font p + p { margin-top: .75rem; }
.about-font .source-line { font-size: .9rem; color: var(--fc-muted); }
.about-font .source-line i { color: var(--fc-cobalt); margin-right: .2rem; }

/* ---------- Admin: font importer ---------- */
.admin-tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--fc-on-accent); background: var(--fc-marigold); border-radius: 6px; padding: .15rem .5rem; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-tile { background: var(--fc-paper); border: 1px solid var(--fc-line); border-radius: 14px; padding: 1.1rem 1.25rem; box-shadow: 0 24px 48px -30px rgba(20,33,61,.5), var(--fc-shadow); }
.stat-tile .display-num { display: block; font-size: 1.9rem; margin-bottom: .25rem; color: var(--fc-ink); }
.stat-tile .display-num.is-sm { font-size: 1.15rem; padding: .45rem 0 .2rem; }
.stat-tile span:last-child { color: var(--fc-muted); font-size: .88rem; }
.import-counts { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .9rem; }
.import-counts b { font-family: var(--fc-display); font-variant-numeric: tabular-nums; }
.import-counts .is-imported b { color: #15803D; }
.import-counts .is-updated b { color: var(--fc-cobalt); }
.import-counts .is-skipped b { color: var(--fc-marigold-dark); }
.import-counts .is-failed b { color: #DC2626; }
.import-log { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.import-log li { padding: .35rem 1.25rem; border-bottom: 1px solid var(--fc-line-soft); overflow-wrap: anywhere; border-left: 3px solid transparent; }
.import-log li.is-imported { border-left-color: #16A34A; }
.import-log li.is-updated { border-left-color: var(--fc-cobalt); }
.import-log li.is-skipped { border-left-color: var(--fc-marigold); color: var(--fc-muted); }
.import-log li.is-failed { border-left-color: #DC2626; color: #B91C1C; }
.import-log li.is-info { font-weight: 700; }
.import-log.is-history { max-height: 360px; }
[data-bs-theme=dark] .import-log li.is-failed { color: #F87171; }
.cron-line { display: flex; gap: .5rem; align-items: flex-start; }
.cron-line code { flex: 1; display: block; padding: .5rem .7rem; background: var(--fc-surface); border: 1px solid var(--fc-line); border-radius: 8px; font-size: .78rem; overflow-wrap: anywhere; color: var(--fc-ink); }
.progress { --bs-progress-bar-bg: var(--fc-cobalt-fill); height: .75rem; border-radius: 99px; }

/* ---------- Admin: dashboard, upload, login ---------- */
.admin-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.admin-action { display: flex; gap: .9rem; align-items: flex-start; padding: 1.1rem 1.25rem; background: var(--fc-paper); border: 1px solid var(--fc-line); border-radius: 14px; box-shadow: var(--fc-shadow); color: var(--fc-muted); font-size: .9rem; transition: border-color .15s, transform .15s; }
.admin-action:hover { border-color: var(--fc-cobalt); transform: translateY(-2px); text-decoration: none; color: var(--fc-muted); }
.admin-action i { flex: 0 0 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 10px; background: var(--fc-surface); color: var(--fc-cobalt); font-size: 1.05rem; }
.admin-action b { display: block; color: var(--fc-ink); font-size: 1rem; margin-bottom: .1rem; }
.admin-specimen { flex: 0 0 auto; width: 160px; height: 34px; object-fit: contain; object-position: left center; background: #fff; border: 1px solid var(--fc-line-soft); border-radius: 6px; padding: 2px 6px; }
[data-bs-theme=dark] .admin-specimen { filter: invert(1) hue-rotate(180deg); border-color: #D8DEE9; }
.admin-specimen.is-large { display: block; width: 100%; max-width: 480px; height: 72px; padding: .5rem; }
.admin-tips { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.admin-tips li { display: flex; gap: .7rem; margin-bottom: .8rem; }
.admin-tips i { color: var(--fc-cobalt); margin-top: .2rem; width: 1rem; text-align: center; }
.admin-login { max-width: 420px; margin-left: auto; margin-right: auto; }
body.is-admin { min-height: 100vh; display: flex; flex-direction: column; }
body.is-admin > .site-main { flex: 1 0 auto; }
.site-footer.is-admin { padding-top: 0; }
.site-footer.is-admin .footer-legal { margin-top: 0; border-top: 0; padding: 1.25rem 0 0; }
@media (max-width: 575.98px) { .admin-specimen { width: 110px; } }

/* ---------- /stats ---------- */
.stats-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.25rem; }
.stats-custom { display: flex; align-items: center; gap: .4rem; color: var(--fc-on-ink); }
.stats-custom input[type=date] { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 8px; padding: .25rem .5rem; font-size: .85rem; color-scheme: dark; }
.stats-live { display: inline-flex; align-items: center; gap: .45rem; color: var(--fc-on-ink); font-size: .9rem; margin-left: auto; }
.stats-live b { color: #fff; font-family: var(--fc-display); }
.live-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 .5rem rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.stats-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; padding: .6rem .9rem; background: var(--fc-paper); border: 1px solid var(--fc-line); border-radius: 12px; box-shadow: var(--fc-shadow); }
.chip.is-filter { background: var(--fc-surface); }
.chip.is-filter b { font-weight: 700; }
.chip.is-filter i { color: var(--fc-muted); font-size: .8rem; }
.kpi-tiles { grid-template-columns: repeat(4, 1fr); margin-bottom: .5rem; }
@media (max-width: 991.98px) { .kpi-tiles { grid-template-columns: repeat(2, 1fr); } }
.kpi-tiles .display-num { font-size: 1.65rem; }
.kpi-delta { display: inline-flex; align-items: center; gap: .15rem; margin-left: .3rem; font-size: .78rem; font-weight: 700; color: var(--fc-muted); white-space: nowrap; }
.kpi-delta i { font-size: .65rem; }
.kpi-delta.is-up { color: #15803D; }
.kpi-delta.is-down { color: #DC2626; }
.kpi-delta.is-new { color: var(--fc-cobalt); }
[data-bs-theme=dark] .kpi-delta.is-up { color: #4ADE80; }
[data-bs-theme=dark] .kpi-delta.is-down { color: #F87171; }
.stats-compare { margin-bottom: 1.25rem; }
.stats-chart { position: relative; height: 300px; }
.stat-tabs { padding: .5rem 1.25rem 0; border-bottom: 1px solid var(--fc-line); gap: 1rem; --bs-nav-link-color: var(--fc-muted); --bs-nav-link-hover-color: var(--fc-ink); --bs-nav-underline-link-active-color: var(--fc-ink); --bs-nav-link-font-size: .875rem; --bs-nav-link-font-weight: 600; }
.stat-tabs .nav-link.active { border-bottom-color: var(--fc-marigold); }
.stat-head, .stat-list li { display: flex; align-items: center; gap: .5rem; padding: 0 1.25rem; }
.stat-head { padding-top: .6rem; padding-bottom: .3rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--fc-muted); }
.stat-head span:first-child { flex: 1; }
.stat-head span:not(:first-child), .stat-num { flex: 0 0 4.6rem; text-align: right; }
.stat-list { list-style: none; margin: 0; padding: 0 0 .5rem; }
.stat-list li { position: relative; min-height: 2.25rem; font-size: .9rem; z-index: 0; }
.stat-list li::before { content: ""; position: absolute; z-index: -1; left: .75rem; top: 3px; bottom: 3px; width: calc((100% - 1.5rem) * var(--bar) / 100); min-width: 3px; background: var(--fc-surface); border-radius: 6px; }
[data-bs-theme=dark] .stat-list li::before { background: #18233A; }
.stat-list li:hover::before { background: rgba(29,78,216,.1); }
.stat-list.is-collapsed li:nth-child(n+11) { display: none; }
.stat-key { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; color: var(--fc-ink); font-weight: 500; }
.stat-key > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.stat-key:hover { color: var(--fc-cobalt); text-decoration: none; }
.stat-key i, .stat-flag, .stat-favicon { flex: 0 0 1rem; width: 1rem; text-align: center; color: var(--fc-cobalt); font-size: .85rem; }
.stat-favicon { height: 1rem; border-radius: 3px; }
.stat-ext { color: var(--fc-muted); font-size: .72rem; opacity: 0; padding: .25rem; }
.stat-list li:hover .stat-ext, .stat-ext:focus { opacity: 1; }
.stat-sub { color: var(--fc-muted); font-size: .75rem; white-space: nowrap; }
.stat-num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--fc-ink); }
.stat-num + .stat-num { color: var(--fc-muted); font-weight: 500; }
.stat-more { margin: 0 .75rem .6rem; }
.stat-note { margin: 0; padding: .5rem 1.25rem 1rem; font-size: .8rem; color: var(--fc-muted); }
@media (max-width: 575.98px) {
    .stat-head span:not(:first-child), .stat-num { flex-basis: 3.6rem; }
    .stats-live { margin-left: 0; }
}
