/* ============================================================
   InsectDiscover — Clean Light Theme
   ============================================================ */

:root {
    --bg: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8faf8;
    --bg-surface: #f5f7f5;
    --border: #e2e5e2;
    --border-light: #ebeeed;
    --text: #111827;
    --text-muted: #4b5563;
    --primary: #059669;
    --primary-hover: #047857;
    --primary-light: #10b981;
    --primary-dim: rgba(5, 150, 105, 0.08);
    --primary-glow: rgba(5, 150, 105, 0.15);
    --secondary: #ea580c;
    --secondary-dim: rgba(234, 88, 12, 0.07);
    --accent: #6366f1;
    --accent-dim: rgba(99, 102, 241, 0.08);
    --danger: #dc2626;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow: 0 4px 16px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.04);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 24px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 14px; border: none; cursor: pointer;
    transition: all var(--transition); text-align: center; font-family: inherit; line-height: 1.4;
}
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 16px 36px; font-size: 16px; border-radius: var(--radius); }
.btn-full { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; box-shadow: 0 4px 16px rgba(5,150,105,0.3); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; color: #fff; }

/* ---- Navbar ---- */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-container {
    display: flex; align-items: center; height: 64px; gap: 24px;
}
.nav-logo {
    font-size: 19px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.nav-logo:hover { color: var(--text); }
.logo-icon { font-size: 22px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
    color: var(--text-muted); font-size: 13.5px; font-weight: 500;
    padding: 6px 12px; border-radius: 8px; transition: all 0.2s;
}
.nav-links a:hover { color: var(--primary); background: var(--primary-dim); }

/* ---- Nav Dropdown ---- */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    color: var(--text-muted); font-size: 13.5px; font-weight: 500;
    padding: 6px 12px; border-radius: 8px; transition: all 0.2s;
    background: none; border: none; cursor: pointer;
    font-family: inherit; display: flex; align-items: center; gap: 4px;
}
.nav-dropdown-toggle:hover { color: var(--primary); background: var(--primary-dim); }
.nav-dropdown-arrow { font-size: 10px; transition: transform 0.2s; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 8px;
    padding-top: 16px;
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    flex-direction: column;
}
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px; height: 12px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-light);
    border-top: 1px solid var(--border-light);
}
.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s;
}
.nav-dropdown-menu a:hover { background: var(--primary-dim); color: var(--primary); }
.nav-dropdown:hover .nav-dropdown-menu { display: flex; }
.nav-dropdown:hover .nav-dropdown-arrow { transform: rotate(180deg); }

/* Mobile dropdown */
@media (max-width: 900px) {
    .nav-dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0 0 0 12px;
        min-width: 0;
        background: transparent;
    }
    .nav-dropdown-menu::before { display: none; }
    .nav-dropdown:hover .nav-dropdown-menu { display: flex; }
}

.nav-search { margin-left: auto; }
.nav-search input {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 8px 16px; font-size: 13px;
    color: var(--text); width: 200px; font-family: inherit;
    transition: border-color 0.2s, width 0.3s;
}
.nav-search input:focus { outline: none; border-color: var(--primary); width: 260px; box-shadow: 0 0 0 3px var(--primary-dim); }
.nav-search input::placeholder { color: var(--text-muted); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none; position: absolute; top: 64px; left: 0; right: 0;
        flex-direction: column; background: var(--bg);
        border-bottom: 1px solid var(--border); padding: 16px 24px; gap: 10px;
        box-shadow: var(--shadow-lg);
    }
    .nav-container.open .nav-links { display: flex; }
    .nav-search { display: none; }
}

/* ---- Flash ---- */
.flash-wrap { padding-top: 16px; }
.flash {
    padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 8px;
    font-size: 14px; border: 1px solid var(--border); background: var(--bg-surface);
}
.flash-error { border-color: #fca5a5; background: #fef2f2; color: var(--danger); }
.flash-success { border-color: #86efac; background: #f0fdf4; color: var(--primary); }
.flash-warning { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.flash-info { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }

/* ---- Page Hero (reusable across pages) ---- */
.page-hero {
    padding: 72px 0 56px; text-align: center;
    background: linear-gradient(160deg, #ecfdf5 0%, #f0fdf4 30%, #f5f7f5 60%, #f0f9ff 100%);
    border-bottom: 1px solid var(--border);
    position: relative; overflow: hidden;
}
.page-hero::before {
    content: ''; position: absolute; top: -40%; right: -15%; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(5,150,105,0.05) 0%, transparent 70%);
    pointer-events: none;
}
.page-hero-compact { padding: 52px 0 40px; }
.page-hero-accent {
    background: linear-gradient(160deg, #ecfdf5 0%, #f0fdf4 40%, #f5f7f5 100%);
    border-bottom: 3px solid var(--order-color, var(--primary));
    text-align: left;
}
.page-hero-title {
    font-size: clamp(34px, 6vw, 52px); font-weight: 800;
    letter-spacing: -1.5px; line-height: 1.08; margin-bottom: 14px;
}
.page-hero-sub {
    font-size: 16px; color: var(--text-muted); max-width: 580px;
    line-height: 1.75;
}
.page-hero:not(.page-hero-accent) .page-hero-sub { margin: 0 auto; }
.hero-stat-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 18px; border-radius: 24px;
    font-size: 13px; font-weight: 600;
    background: rgba(5,150,105,0.1); color: var(--primary);
    border: 1px solid rgba(5,150,105,0.15);
}
.order-hero-new { display: flex; align-items: center; gap: 24px; margin-bottom: 20px; }
.order-hero-emoji-lg {
    font-size: 64px; flex-shrink: 0;
    width: 88px; height: 88px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.7); border-radius: 20px; backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
}
.order-hero-desc {
    font-size: 15px; color: var(--text-muted); line-height: 1.8;
    max-width: 720px;
}

/* ---- Homepage Hero ---- */
.hero-home {
    padding: 100px 0 72px; text-align: center;
    background: linear-gradient(160deg, #ecfdf5 0%, #f0fdf4 20%, #ffffff 55%, #f0f9ff 100%);
    position: relative; overflow: hidden;
}
.hero-home::before {
    content: ''; position: absolute; top: -40%; right: -15%; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(5,150,105,0.07) 0%, transparent 65%);
    pointer-events: none; animation: pulse-glow 8s ease-in-out infinite;
}
.hero-home::after {
    content: ''; position: absolute; bottom: -25%; left: -8%; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(99,102,241,0.04) 0%, transparent 65%);
    pointer-events: none;
}
@keyframes pulse-glow {
    0%,100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 22px; border-radius: 24px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px;
    background: linear-gradient(135deg, var(--primary-dim), rgba(5,150,105,0.12));
    color: var(--primary);
    border: 1px solid var(--primary-glow); margin-bottom: 28px;
    backdrop-filter: blur(4px);
}
.hero-home-title {
    font-size: clamp(48px, 9vw, 84px); font-weight: 800;
    letter-spacing: -3px; line-height: 0.95; margin-bottom: 24px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, var(--primary-hover) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-home-sub {
    font-size: 18px; color: var(--text-muted); max-width: 560px;
    margin: 0 auto 44px; line-height: 1.75;
}
.hero-home-stats {
    display: inline-flex; align-items: center; gap: 0;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.5); border-radius: 20px;
    padding: 0; margin: 0 auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);
}
.hero-home-stat {
    display: flex; flex-direction: column; align-items: center;
    padding: 28px 44px;
}
.hero-home-stat-divider {
    width: 1px; height: 40px; background: var(--border);
}
.hero-home-stat-num {
    font-size: 40px; font-weight: 800; line-height: 1.1;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-home-stat-label {
    font-size: 11px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 1.5px; margin-top: 6px; font-weight: 600;
}

/* ---- Floating Search Card ---- */
.home-search-section {
    margin-top: -28px; position: relative; z-index: 10;
    padding-bottom: 16px;
}
.home-search-card {
    background: rgba(255,255,255,0.95); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 20px; padding: 32px 36px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.02);
    max-width: 800px; margin: 0 auto;
}
.home-search-inner {
    display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.home-search-icon {
    font-size: 28px; width: 52px; height: 52px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-dim), rgba(5,150,105,0.12));
    border-radius: 14px;
}
.home-search-title {
    font-size: 20px; font-weight: 700; margin-bottom: 2px; letter-spacing: -0.3px;
}
.home-search-desc {
    font-size: 14px; color: var(--text-muted);
}
.home-search-form {
    display: flex; gap: 12px;
}
.home-search-autocomplete { flex: 1; }
.home-search-input {
    width: 100%; padding: 16px 22px !important; font-size: 16px !important;
    background: var(--bg-surface) !important; border: 2px solid var(--border) !important;
    border-radius: var(--radius) !important; color: var(--text);
    font-family: inherit; transition: all var(--transition);
}
.home-search-input:focus {
    outline: none !important; border-color: var(--primary) !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px var(--primary-dim) !important;
}
.home-search-input::placeholder { color: #9ca3af; }
.home-search-btn {
    flex-shrink: 0; padding: 16px 32px !important; font-size: 15px !important;
    white-space: nowrap;
}
.home-search-autocomplete .autocomplete-list {
    border-radius: var(--radius) !important;
}

/* ---- Quick Links ---- */
.home-quicklinks { padding: 24px 0 0; }
.quicklinks-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.quicklink-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px; border-radius: var(--radius);
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text); transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}
.quicklink-card:hover {
    border-color: rgba(5,150,105,0.3); color: var(--text);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(5,150,105,0.08);
}
.quicklink-icon {
    font-size: 24px; width: 44px; height: 44px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-surface); border-radius: 12px;
    transition: all var(--transition);
}
.quicklink-card:hover .quicklink-icon { background: var(--primary-dim); }
.quicklink-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.quicklink-card p { font-size: 12px; color: var(--text-muted); }
.quicklink-card div { flex: 1; min-width: 0; }
.quicklink-arrow {
    font-size: 16px; color: var(--text-muted); flex-shrink: 0;
    transition: all 0.2s; opacity: 0; transform: translateX(-4px);
}
.quicklink-card:hover .quicklink-arrow { opacity: 1; transform: translateX(0); color: var(--primary); }

/* ---- CTA emoji ---- */
.cta-emoji {
    font-size: 48px; display: block; margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

/* ---- Old hero search (for search page) ---- */
.hero-search {
    display: flex; max-width: 560px; margin: 0 auto 20px; gap: 0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.03);
    border-radius: var(--radius);
}
.hero-search input {
    flex: 1; padding: 16px 24px; font-size: 16px; font-family: inherit;
    background: #fff; border: 2px solid transparent;
    border-radius: var(--radius) 0 0 var(--radius); color: var(--text);
}
.hero-search input:focus { outline: none; border-color: var(--primary); }
.hero-search input::placeholder { color: #9ca3af; }
.hero-search button {
    padding: 16px 32px; background: var(--primary); color: #fff;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-weight: 600; font-size: 15px; cursor: pointer; font-family: inherit;
    transition: all var(--transition);
}
.hero-search button:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(5,150,105,0.3); }

/* ---- Sections ---- */
.section { padding: 72px 0; }
.section-dark { background: linear-gradient(180deg, var(--bg-surface) 0%, #f0f2f0 100%); }
.section-head {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px;
}
.section-head h2 {
    font-size: 26px; font-weight: 700; position: relative;
    padding-left: 18px;
}
.section-head h2::before {
    content: ''; position: absolute; left: 0; top: 3px; bottom: 3px;
    width: 4px; background: linear-gradient(180deg, var(--primary), var(--primary-light)); border-radius: 2px;
}
.section-head-actions { display: flex; align-items: center; gap: 16px; }
.link-arrow {
    font-size: 14px; font-weight: 600;
    padding: 6px 14px; border-radius: 8px;
    transition: all 0.2s;
}
.link-arrow:hover { background: var(--primary-dim); }

.page-title { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 8px; }
.page-sub { color: var(--text-muted); margin-bottom: 32px; font-size: 15px; }
.subsection-title { font-size: 20px; margin: 32px 0 20px; }

/* ---- Cards ---- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.card-grid-sm { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.insect-card {
    display: flex; flex-direction: column;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    transition: all var(--transition); color: var(--text);
    box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.insect-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0); transition: transform 0.4s ease;
    transform-origin: left;
}
.insect-card:hover::before { transform: scaleX(1); }
.insect-card:hover {
    border-color: rgba(5,150,105,0.3);
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(5,150,105,0.1), 0 4px 12px rgba(0,0,0,0.04);
    color: var(--text);
}
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-order, .card-family {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--primary); background: var(--primary-dim);
    padding: 4px 12px; border-radius: 12px;
}
.card-status {
    font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 12px;
}
.status-endangered { background: #fef2f2; color: #dc2626; }
.status-vulnerable { background: #fffbeb; color: #d97706; }
.status-near-threatened { background: #fffbeb; color: #b45309; }
.status-data-deficient { background: #f3f4f6; color: #6b7280; }
.status-extinct { background: #fef2f2; color: #dc2626; }
.status-domesticated { background: #eff6ff; color: #2563eb; }

.card-name { font-size: 17px; font-weight: 600; margin-bottom: 2px; }
.card-sci { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; font-style: italic; }
.card-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 14px; flex: 1; }
.card-meta {
    display: flex; justify-content: space-between; font-size: 12px;
    color: var(--text-muted); padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ---- Order Cards ---- */
.order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.order-grid-full { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.order-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    transition: all var(--transition); color: var(--text);
    border-left: 4px solid var(--order-color, var(--primary));
    box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.order-card::after {
    content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px;
    background: radial-gradient(circle at top right, var(--order-color, var(--primary)), transparent 70%);
    opacity: 0.06; pointer-events: none; transition: opacity var(--transition);
}
.order-card:hover::after { opacity: 0.12; }
.order-card:hover {
    transform: translateY(-5px); color: var(--text);
    box-shadow: 0 16px 40px rgba(0,0,0,0.08);
    border-left-width: 5px;
}
.order-emoji {
    font-size: 36px; display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; margin-bottom: 14px;
    background: var(--bg-surface); border-radius: 14px;
}
.order-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 2px; }
.order-sci { font-size: 13px; color: var(--text-muted); font-style: italic; margin-bottom: 8px; }
.order-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 12px; }
.order-count {
    font-size: 12px; font-weight: 600; color: var(--order-color, var(--primary));
}

/* ---- Order Hero ---- */
.order-hero {
    display: flex; align-items: center; gap: 20px;
    padding: 32px 0; margin-bottom: 24px;
    border-bottom: 2px solid var(--order-color, var(--primary));
}
.order-hero-emoji { font-size: 56px; }
.order-hero h1 { font-size: 32px; font-weight: 700; }
.order-hero-sci { font-size: 16px; color: var(--text-muted); font-style: italic; }
.order-description { max-width: 720px; color: var(--text-muted); line-height: 1.7; margin-bottom: 32px; }

/* ---- Detail Page ---- */
.back-link {
    display: inline-block; font-size: 14px; color: var(--text-muted);
    margin-bottom: 20px;
}
.back-link:hover { color: var(--primary); }

/* Species Hero Banner */
.species-hero {
    background: linear-gradient(160deg, #ecfdf5 0%, #f0fdf4 30%, #f5f7f5 60%, #f0f9ff 100%);
    border-bottom: 3px solid var(--order-color, var(--primary));
    padding: 28px 0 56px;
    position: relative; overflow: hidden;
}
.species-hero::before {
    content: ''; position: absolute; top: -40%; right: -10%; width: 500px; height: 500px;
    background: radial-gradient(circle, var(--order-color, rgba(5,150,105,0.06)) 0%, transparent 70%);
    opacity: 0.15; pointer-events: none;
}
.species-hero-content { padding-top: 16px; }
.species-order-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    background: rgba(255,255,255,0.8); backdrop-filter: blur(8px);
    border: 1px solid rgba(22,163,74,0.15);
    color: var(--order-color, var(--primary));
    margin-bottom: 16px; transition: all 0.2s;
}
.species-order-badge:hover { background: #fff; color: var(--order-color, var(--primary)); box-shadow: var(--shadow-sm); }
.species-title { font-size: 52px; font-weight: 800; letter-spacing: -2px; margin-bottom: 6px; line-height: 1.08; }
.species-sci { font-size: 20px; color: var(--text-muted); margin-bottom: 10px; font-style: italic; }
.species-status { display: inline-block; padding: 5px 14px; border-radius: 14px; font-size: 12px; font-weight: 600; }

/* Breadcrumbs on hero */
.breadcrumbs-light a, .breadcrumbs-light { color: var(--text-muted); }
.breadcrumbs-light a:hover { color: var(--primary); }

/* Quick Facts Bar */
.quick-facts-wrap {
    margin-top: -28px; position: relative; z-index: 10;
    padding-bottom: 8px;
}
.quick-facts {
    display: flex; gap: 0; flex-wrap: wrap;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.03);
}
.quick-fact {
    flex: 1; min-width: 140px; padding: 18px 22px;
    border-right: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px;
}
.quick-fact:last-child { border-right: none; }
.qf-icon {
    font-size: 20px; flex-shrink: 0;
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    background: var(--primary-dim); border-radius: 10px;
}
.qf-label {
    display: block; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 2px;
}
.qf-value { display: block; font-size: 14px; font-weight: 600; }
@media (max-width: 768px) {
    .quick-facts { flex-direction: column; }
    .quick-fact { border-right: none; border-bottom: 1px solid var(--border); }
    .quick-fact:last-child { border-bottom: none; }
    .species-title { font-size: 32px; }
}

.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 40px; }

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

.detail-section { margin-bottom: 36px; }
.detail-section h2 {
    font-size: 22px; font-weight: 700; margin-bottom: 14px;
    padding-bottom: 10px; border-bottom: 2px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.detail-section h2::before {
    content: ''; width: 4px; height: 22px; flex-shrink: 0;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}
.detail-section p { color: var(--text-muted); line-height: 1.85; font-size: 15px; }

/* Fun Fact Card (redesigned) */
.fun-fact-card {
    padding: 28px 32px; margin-bottom: 36px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fff7ed 100%);
    border: 1px solid rgba(234,88,12,0.12);
    border-left: 4px solid var(--secondary);
    border-radius: var(--radius);
    position: relative; overflow: hidden;
}
.fun-fact-card::after {
    content: '💡'; position: absolute; bottom: -8px; right: 12px; font-size: 64px; opacity: 0.06;
    pointer-events: none;
}
.fun-fact-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.fun-fact-card .fun-fact-icon { font-size: 28px; }
.fun-fact-card h3 { font-size: 17px; font-weight: 700; color: var(--secondary); }
.fun-fact-card p { font-size: 15px; color: var(--text); line-height: 1.75; }

/* Legacy fun-fact class for compare page etc */
.fun-fact {
    display: flex; gap: 16px; padding: 24px;
    background: var(--secondary-dim);
    border: 1px solid rgba(234,88,12,0.12);
    border-radius: var(--radius);
}
.fun-fact .fun-fact-icon { font-size: 28px; flex-shrink: 0; }
.fun-fact h3 { font-size: 15px; font-weight: 700; color: var(--secondary); margin-bottom: 6px; }
.fun-fact p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* Map Section (large, in main content) */
.map-section {
    margin-bottom: 36px;
}
.map-section h2 {
    font-size: 22px; font-weight: 700; margin-bottom: 4px;
}
.map-subtitle {
    font-size: 14px; color: var(--text-muted); margin-bottom: 16px;
}
.map-container {
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
}
#species-map {
    height: 400px; width: 100%;
}
@media (max-width: 640px) {
    #species-map { height: 280px; }
}

/* Sidebar */
.taxonomy-card {
    background: linear-gradient(180deg, #f8faf8, var(--bg-surface));
    border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
    position: relative; overflow: hidden;
}
.taxonomy-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}
.taxonomy-card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); margin-bottom: 16px; font-weight: 600; }
.tax-row {
    display: flex; justify-content: space-between; padding: 9px 0;
    border-bottom: 1px solid var(--border); font-size: 14px;
}
.tax-row:last-child { border-bottom: none; }
.tax-label { color: var(--text-muted); }
.tax-value { font-weight: 500; }
.tax-highlight { color: var(--primary); font-weight: 600; }
.tax-row-static .tax-value { color: var(--text-muted); font-weight: 400; font-size: 13px; }

.info-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.info-item {
    display: flex; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.info-item:last-child { border-bottom: none; }
.info-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.info-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 2px; display: block; }
.info-value { font-size: 14px; }

/* Related Species */
.related-section { margin-top: 56px; }
.related-section h2 { font-size: 22px; margin-bottom: 24px; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.related-card-wrap {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column;
}
.related-card-wrap:hover {
    border-color: rgba(5,150,105,0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(5,150,105,0.08);
}
.related-card {
    display: block; padding: 20px 20px 16px; color: var(--text); flex: 1;
}
.related-card:hover { color: var(--text); }
.related-card-badges {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.related-badge-order {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--primary); background: var(--primary-dim);
    padding: 4px 10px; border-radius: 8px;
}
.related-badge-family {
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--text-muted); background: var(--bg-surface);
    padding: 4px 10px; border-radius: 8px;
}
.related-card-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.related-card-sci { font-size: 13px; color: var(--text-muted); font-style: italic; }
.related-compare-btn {
    display: block; text-align: center;
    padding: 10px 16px; font-size: 12px; font-weight: 600;
    color: var(--primary); background: var(--bg-surface);
    border-top: 1px solid var(--border);
    text-transform: uppercase; letter-spacing: 0.8px;
    transition: all 0.2s;
}
.related-compare-btn:hover {
    background: var(--primary); color: #fff;
}
@media (max-width: 640px) {
    .related-grid { grid-template-columns: 1fr; }
}

/* ---- Directory Layout ---- */
.directory-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }

@media (max-width: 768px) {
    .directory-layout { grid-template-columns: 1fr; }
    .filters {
        position: static;
        background: var(--bg);
        padding: 16px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 8px;
    }
}

.filters {
    position: sticky; top: 80px; align-self: start;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.filters .btn { margin-top: 4px; }
.filter-group { margin-bottom: 16px; }
.filter-group label {
    display: block; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-muted); margin-bottom: 6px;
}
.filter-group input, .filter-group select {
    width: 100%; padding: 9px 12px; font-size: 13px; font-family: inherit;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
}
.filter-group input:focus, .filter-group select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.filter-group select { cursor: pointer; }

/* Pagination */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-top: 40px; flex-wrap: wrap;
}
.page-info { font-size: 14px; color: var(--text-muted); }
.page-num {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 6px;
    font-size: 14px; color: var(--text); border-radius: var(--radius-sm);
    transition: all 0.2s; border: 1px solid transparent;
}
.page-num:hover { background: var(--primary-dim); color: var(--primary); border-color: rgba(22,163,74,0.15); }
.page-num.active {
    font-weight: 700; color: #fff; background: var(--primary);
    pointer-events: none; box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
.page-nav {
    font-size: 14px; font-weight: 600; color: var(--primary);
    padding: 0 8px;
}
.page-nav:hover { color: var(--primary-hover); }

/* ---- Search ---- */
.search-form {
    display: flex; gap: 8px; margin-bottom: 40px; max-width: 600px;
}
.search-form input {
    flex: 1; padding: 12px 16px; font-size: 15px; font-family: inherit;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
}
.search-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }

/* ---- About ---- */
.about-content { max-width: 720px; margin: 0 auto; }
.about-content h1 { font-size: 36px; font-weight: 700; margin-bottom: 24px; }
.about-content p { color: var(--text-muted); line-height: 1.8; margin-bottom: 20px; font-size: 15px; }

.about-features {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
    margin: 40px 0;
}
@media (max-width: 640px) {
    .about-features { grid-template-columns: 1fr; }
}
.about-feature {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px 28px; text-align: center;
    transition: all var(--transition);
    position: relative; overflow: hidden;
}
.about-feature::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0); transition: transform 0.4s ease; transform-origin: center;
}
.about-feature:hover::before { transform: scaleX(1); }
.about-feature:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
    border-color: rgba(5,150,105,0.2);
}
.about-icon {
    font-size: 32px; display: flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary-dim), rgba(5,150,105,0.12));
    border-radius: 16px; transition: all var(--transition);
}
.about-feature:hover .about-icon { transform: scale(1.08); }
.about-feature h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.about-feature p { font-size: 13px; color: var(--text-muted); margin-bottom: 0; line-height: 1.7; }

/* ---- Info Pages (Privacy, Terms, Contact) ---- */
.info-page { max-width: 720px; margin: 0 auto; }
.info-page h1 { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.info-page .page-updated { font-size: 13px; color: var(--text-muted); margin-bottom: 32px; }
.info-page h2 { font-size: 20px; font-weight: 600; margin: 32px 0 12px; }
.info-page p, .info-page li { color: var(--text-muted); line-height: 1.8; font-size: 15px; }
.info-page p { margin-bottom: 16px; }
.info-page ul { margin: 0 0 16px 20px; }
.info-page li { margin-bottom: 6px; }
.info-page a { color: var(--primary); font-weight: 500; }
.contact-card {
    background: linear-gradient(135deg, #f0fdf4, #f5f7f5); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px; margin: 24px 0;
    border-left: 4px solid var(--primary);
}
.contact-card h3 { font-size: 17px; margin-bottom: 16px; }
.contact-item { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 15px; }
.contact-item span:first-child { font-size: 20px; }

/* ---- Auth ---- */
.auth-card {
    max-width: 440px; margin: 0 auto;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 40px 32px;
    box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 24px; margin-bottom: 24px; }

/* ---- Forms (shared) ---- */
.form-group { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 10px 14px; font-size: 14px; font-family: inherit;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.form-group textarea { resize: vertical; }
.form-group select { cursor: pointer; }

/* Admin form grid */
.admin-form { max-width: 860px; }
.form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px;
}
.form-full { grid-column: 1 / -1; }
.form-checkboxes { grid-column: 1 / -1; display: flex; gap: 24px; padding-top: 4px; }
.checkbox-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; cursor: pointer; color: var(--text);
}
.checkbox-label input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer;
}
.form-actions {
    display: flex; gap: 12px; margin-top: 28px; padding-top: 20px;
    border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .section-head-actions { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---- Admin ---- */
.admin-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 32px;
}
.admin-stat {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px; text-align: center;
}
.admin-stat-num { display: block; font-size: 36px; font-weight: 800; color: var(--primary); }
.admin-stat-label { font-size: 13px; color: var(--text-muted); }
.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
    text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border);
    color: var(--text-muted); font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.admin-table tr:hover { background: var(--bg-surface); }
.admin-td-actions { display: flex; gap: 4px; }
.admin-search-form { display: flex; gap: 8px; margin-bottom: 20px; }
.admin-search-form input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.admin-search-form input:focus { outline: none; border-color: var(--primary); }
.pagination .btn-active { background: var(--primary); color: #fff; border-color: var(--primary); pointer-events: none; }

.badge {
    display: inline-block; padding: 2px 10px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
}
.badge-active { background: #f0fdf4; color: var(--primary); }
.badge-inactive { background: #f3f4f6; color: #9ca3af; }
.badge-event { text-transform: none; letter-spacing: 0; }
.badge-login_success { background: #f0fdf4; color: #16a34a; }
.badge-login_failure { background: #fef2f2; color: #dc2626; }
.badge-logout { background: #f3f4f6; color: #6b7280; }
.badge-session_revoke { background: #fef2f2; color: #dc2626; }
.badge-settings_update { background: #eff6ff; color: #2563eb; }
.badge-insect_add, .badge-video_add, .badge-image_add { background: #f0fdf4; color: #16a34a; }
.badge-insect_edit, .badge-video_edit, .badge-image_edit { background: #eff6ff; color: #2563eb; }
.badge-insect_delete, .badge-video_delete, .badge-image_delete { background: #fef2f2; color: #dc2626; }
.badge-insect_toggle, .badge-insect_feature { background: #fffbeb; color: #b45309; }
.badge-sessions_clear, .badge-logs_clear { background: #fef2f2; color: #dc2626; }

/* Seed page */
.seed-info {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
    margin: 20px 0 24px; font-size: 13px; color: var(--text-muted);
}
.seed-item { padding: 6px 0; }

/* ---- CTA ---- */
.cta-section {
    background: linear-gradient(160deg, #ecfdf5 0%, #f0fdf4 40%, #ffffff 70%, #f0f9ff 100%);
    padding: 100px 0;
    position: relative; overflow: hidden;
}
.cta-section::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 100px; height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: 2px;
}
.cta-section::after {
    content: ''; position: absolute; bottom: -20%; right: -5%; width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(5,150,105,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.cta-section h2 { font-size: 32px; font-weight: 800; margin-bottom: 14px; letter-spacing: -0.5px; }
.cta-section p { color: var(--text-muted); margin-bottom: 32px; font-size: 17px; }

/* ---- Error ---- */
.error-hero {
    min-height: 70vh; display: flex; align-items: center;
    background: linear-gradient(160deg, #ecfdf5 0%, #ffffff 50%, #f0f9ff 100%);
    position: relative; overflow: hidden;
}
.error-hero::before {
    content: ''; position: absolute; top: 20%; left: 50%; transform: translateX(-50%);
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(5,150,105,0.05) 0%, transparent 70%);
    pointer-events: none;
}
.error-page { padding: 40px 0; position: relative; }
.error-emoji { font-size: 88px; display: block; margin-bottom: 24px; animation: float 3s ease-in-out infinite; }
@keyframes float {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.error-code {
    font-size: 120px; font-weight: 800; margin-bottom: 8px; letter-spacing: -4px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.error-msg { font-size: 18px; color: var(--text-muted); margin-bottom: 36px; max-width: 420px; margin-left: auto; margin-right: auto; line-height: 1.7; }
.error-actions { display: flex; gap: 14px; justify-content: center; }

/* Empty */
.empty-state {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state .btn { margin-top: 12px; }

/* Rich Empty State */
.empty-state-rich {
    text-align: center; padding: 80px 20px;
    background: var(--bg-surface); border: 1px dashed var(--border);
    border-radius: var(--radius); max-width: 500px; margin: 0 auto;
}
.empty-icon { font-size: 56px; display: block; margin-bottom: 16px; }
.empty-state-rich h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.empty-state-rich p { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin-bottom: 8px; }
.empty-state-rich .btn { margin-top: 16px; }

/* ---- Footer ---- */
.footer {
    border-top: 1px solid var(--border); padding: 64px 0 0; margin-top: 48px;
    background: linear-gradient(180deg, #f8faf8 0%, #f0f2f0 100%);
    position: relative;
}
.footer::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 120px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.footer-top {
    display: flex; justify-content: space-between; gap: 48px;
    padding-bottom: 40px;
}
.footer-brand { max-width: 320px; }
.footer-logo {
    font-size: 19px; font-weight: 700; color: var(--text);
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.footer-logo:hover { color: var(--text); }
.footer-brand p { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.footer-cols { display: flex; gap: 56px; }
.footer-cols > div { min-width: 120px; }
.footer-cols h4 {
    font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text); font-weight: 600; margin-bottom: 14px;
}
.footer-cols a { display: block; font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.footer-cols a:hover { color: var(--primary); }
.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0; border-top: 1px solid var(--border);
    font-size: 13px; color: var(--text-muted);
}
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--primary); }

@media (max-width: 640px) {
    .footer-top { flex-direction: column; gap: 32px; }
    .footer-cols { flex-wrap: wrap; gap: 32px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    .hero-home { padding: 64px 0 48px; }
    .hero-home-title { font-size: 42px; letter-spacing: -1.5px; }
    .hero-home-stats { flex-direction: column; border-radius: 16px; padding: 0; }
    .hero-home-stat { padding: 16px 32px; }
    .hero-home-stat-divider { width: 60px; height: 1px; }
    .hero-home-stat-num { font-size: 32px; }
    .home-search-card { padding: 24px; margin: 0 12px; }
    .home-search-form { flex-direction: column; }
    .home-search-inner { gap: 12px; }
    .home-search-icon { width: 44px; height: 44px; font-size: 22px; }
    .quicklinks-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .quicklink-card { padding: 14px 16px; gap: 10px; }
    .quicklink-icon { width: 36px; height: 36px; font-size: 20px; }
    .quicklink-arrow { display: none; }
    .hero-search { flex-direction: column; }
    .hero-search input { border-radius: var(--radius); border-width: 2px; }
    .hero-search button { border-radius: var(--radius); }
    .detail-hero h1 { font-size: 28px; }
    .card-grid { grid-template-columns: 1fr; }
    .order-grid { grid-template-columns: 1fr; }
    .page-hero { padding: 40px 0 32px; }
    .page-hero-title { font-size: 28px; letter-spacing: -0.5px; }
    .page-hero-sub { font-size: 14px; }
    .order-hero-new { flex-direction: column; gap: 12px; text-align: center; }
    .page-hero-accent { text-align: center; }
    .order-hero-emoji-lg { font-size: 48px; }
    .error-code { font-size: 64px; }
}

/* ---- Videos ---- */

/* Grid cards (homepage) */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.video-card {
    display: block;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); color: var(--text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.video-card:hover {
    border-color: var(--primary); transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1); color: var(--text);
}
.video-thumb {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
    background: #000;
}
.video-thumb img {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; height: 100%; object-fit: cover;
}
.video-play {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(0,0,0,0.5); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; padding-left: 3px;
    transition: all var(--transition);
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255,255,255,0.3);
}
.video-card:hover .video-play {
    background: var(--primary); border-color: var(--primary);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 20px rgba(5,150,105,0.4);
}
.video-title {
    padding: 12px 16px 10px; font-size: 14px; font-weight: 600; line-height: 1.4;
}

/* List layout (videos page) */
.video-list {
    display: flex; flex-direction: column; gap: 12px;
}
.video-list-item {
    display: flex; gap: 16px; align-items: flex-start;
    padding: 12px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text); transition: all 0.2s;
}
.video-list-item:hover {
    border-color: var(--primary); box-shadow: var(--shadow);
    color: var(--text);
}
.video-list-thumb {
    position: relative; flex-shrink: 0;
    width: 200px; border-radius: var(--radius-sm); overflow: hidden;
    background: #000;
}
.video-list-thumb img {
    display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover;
}
.video-list-thumb .video-play {
    width: 36px; height: 36px; font-size: 16px;
}
.video-list-item:hover .video-play { background: var(--primary); }
.video-list-thumb-sm { width: 140px; }
.video-list-item-sm { padding: 8px; gap: 12px; }
.video-list-info { flex: 1; min-width: 0; padding-top: 2px; }
.video-list-title {
    font-size: 15px; font-weight: 600; line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-list-item-sm .video-list-title { font-size: 13px; }
.video-list-desc {
    font-size: 13px; color: var(--text-muted); line-height: 1.5;
    margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-list-date {
    font-size: 12px; color: var(--text-muted);
}

/* Shared */
.video-wrapper {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
    border-radius: var(--radius); background: #000;
}
.video-wrapper iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* Watch page (detail) — YouTube-style layout */
.video-watch-section { padding-top: 24px; }
.video-watch-section > .container { max-width: 1400px; }
.video-watch-layout {
    display: grid; grid-template-columns: 1fr 320px; gap: 24px;
    align-items: start;
}
.video-watch-main { min-width: 0; }
.video-watch-info { padding-top: 16px; }
.video-watch-title { font-size: 22px; font-weight: 700; line-height: 1.3; margin-bottom: 6px; }
.video-watch-date { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.video-watch-desc {
    padding: 16px; background: var(--bg-surface);
    border-radius: var(--radius-sm); margin-top: 4px;
}
.video-watch-desc p {
    color: var(--text-muted); line-height: 1.8; font-size: 14px; white-space: pre-line;
}
.video-watch-sidebar {
    position: sticky; top: 80px;
}
.video-sidebar-heading {
    font-size: 14px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 12px;
}

.admin-add-video-form {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; max-width: 600px;
}
.admin-add-video-form .btn { margin-top: 8px; }

@media (max-width: 900px) {
    .video-watch-layout { grid-template-columns: 1fr; }
    .video-watch-sidebar { position: static; }
}
@media (max-width: 640px) {
    .video-grid { grid-template-columns: 1fr; }
    .video-list-item { flex-direction: column; }
    .video-list-thumb { width: 100%; }
    .video-list-item-sm { flex-direction: row; }
    .video-list-thumb-sm { width: 120px; }
}

/* ---- Images / Gallery ---- */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.image-card {
    display: block;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); color: var(--text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.image-card:hover {
    border-color: var(--primary); transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1); color: var(--text);
}
.image-card:hover .image-thumb img { transform: scale(1.03); }
.image-thumb img { transition: transform 0.4s ease; }
.image-thumb {
    background: var(--bg-surface);
}
.image-thumb img {
    display: block; width: 100%; height: auto;
}
.image-card-title {
    padding: 12px 16px 10px; font-size: 14px; font-weight: 600; line-height: 1.4;
}

/* Image detail page */
.image-detail-section { padding-top: 24px; }
.image-detail-section > .container { max-width: 1400px; }
.image-detail-layout {
    display: grid; grid-template-columns: 1fr 320px; gap: 24px;
    align-items: start;
}
.image-detail-main { min-width: 0; }
.image-detail-frame {
    border-radius: var(--radius); overflow: hidden;
    background: var(--bg-surface); border: 1px solid var(--border);
}
.image-detail-frame img {
    display: block; width: 100%; height: auto;
}
.image-detail-info { padding-top: 16px; }
.image-detail-title { font-size: 22px; font-weight: 700; line-height: 1.3; margin-bottom: 6px; }
.image-detail-date { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.image-detail-desc {
    padding: 16px; background: var(--bg-surface);
    border-radius: var(--radius-sm); margin-top: 4px;
}
.image-detail-desc p {
    color: var(--text-muted); line-height: 1.8; font-size: 14px; white-space: pre-line;
}

/* Image detail sidebar */
.image-detail-sidebar {
    position: sticky; top: 80px;
}
.image-sidebar-heading {
    font-size: 14px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 12px;
}
.image-sidebar-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 8px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text); transition: all 0.2s; margin-bottom: 8px;
}
.image-sidebar-item:hover {
    border-color: var(--primary); box-shadow: var(--shadow);
    color: var(--text);
}
.image-sidebar-thumb {
    flex-shrink: 0; width: 100px; border-radius: var(--radius-sm);
    overflow: hidden; background: var(--bg-surface);
}
.image-sidebar-thumb img {
    display: block; width: 100%; aspect-ratio: 3/2; object-fit: cover;
}
.image-sidebar-info { flex: 1; min-width: 0; padding-top: 2px; }
.image-sidebar-title {
    font-size: 13px; font-weight: 600; line-height: 1.4; margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.image-sidebar-date { font-size: 12px; color: var(--text-muted); }

@media (max-width: 900px) {
    .image-detail-layout { grid-template-columns: 1fr; }
    .image-detail-sidebar { position: static; }
}
@media (max-width: 640px) {
    .image-grid { grid-template-columns: 1fr; }
}

/* ---- Breadcrumbs ---- */
.breadcrumbs {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 14px; color: var(--text-muted); margin-bottom: 20px;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--border); user-select: none; }

/* ---- Quick Facts Bar ---- */
.quick-facts {
    display: flex; gap: 0; flex-wrap: wrap;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 32px; overflow: hidden;
}
.quick-fact {
    flex: 1; min-width: 120px; padding: 16px 20px;
    border-right: 1px solid var(--border); text-align: center;
}
.quick-fact:last-child { border-right: none; }
.qf-label {
    display: block; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 4px;
}
.qf-value { font-size: 14px; font-weight: 600; }
@media (max-width: 640px) {
    .quick-facts { flex-direction: column; }
    .quick-fact { border-right: none; border-bottom: 1px solid var(--border); text-align: left; }
    .quick-fact:last-child { border-bottom: none; }
}

/* ---- Share Buttons ---- */
.share-buttons {
    margin-top: 36px; padding-top: 24px;
    border-top: 1px solid var(--border);
}
.share-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; display: block; }
.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.share-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: 24px;
    font-size: 12px; font-weight: 600; border: 1.5px solid var(--border);
    background: #fff; color: var(--text); cursor: pointer;
    font-family: inherit; transition: all var(--transition);
}
.share-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); transform: translateY(-1px); }
.share-twitter:hover { border-color: #1da1f2; color: #1da1f2; background: rgba(29,161,242,0.06); }
.share-facebook:hover { border-color: #1877f2; color: #1877f2; background: rgba(24,119,242,0.06); }
.share-reddit:hover { border-color: #ff4500; color: #ff4500; background: rgba(255,69,0,0.06); }

/* ---- Cite Section ---- */
.cite-section {
    margin-top: 24px; background: var(--bg-surface);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.cite-section summary {
    padding: 14px 20px; cursor: pointer; font-size: 14px; font-weight: 600;
    color: var(--text-muted); list-style: none;
}
.cite-section summary::-webkit-details-marker { display: none; }
.cite-section summary::before { content: '+ '; }
.cite-section[open] summary::before { content: '- '; }
.cite-content { padding: 0 20px 16px; }
.cite-format { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 12px; }
.cite-format:last-child { margin-bottom: 0; }

/* (map styles moved to .map-section in detail page) */

/* ---- Compare Link on Cards ---- */
.compare-link {
    font-size: 11px; font-weight: 600; color: var(--primary);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.compare-link:hover { color: var(--primary-hover); text-decoration: underline; }

/* ---- Autocomplete ---- */
.autocomplete-wrap { position: relative; }
.autocomplete-input, .compare-pick .autocomplete-input {
    width: 100%; padding: 10px 14px; font-size: 14px; font-family: inherit;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    transition: border-color 0.2s;
}
.autocomplete-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.autocomplete-list {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: rgba(255,255,255,0.98); backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.03);
    z-index: 200; max-height: 320px; overflow-y: auto;
}
.autocomplete-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; font-size: 14px; color: var(--text);
    cursor: pointer; border-bottom: 1px solid var(--border-light);
    transition: all 0.15s;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--primary-dim); color: var(--primary); padding-left: 20px; }
.autocomplete-item em { color: var(--text-muted); font-size: 12px; margin-left: auto; }

/* Nav autocomplete */
.nav-autocomplete { flex: 1; }
.nav-autocomplete .autocomplete-list { border-radius: 0 0 12px 12px; }

/* Hero autocomplete */
.hero-autocomplete { flex: 1; }
.hero-autocomplete .autocomplete-list { border-radius: 0 0 var(--radius) 0; }
.hero-autocomplete .nav-search-input {
    padding: 14px 20px; font-size: 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
}
.hero-autocomplete .nav-search-input:focus { border-color: var(--primary); box-shadow: none; }

/* ---- Compare Selector ---- */
.compare-selector {
    display: flex; align-items: flex-end; gap: 20px;
    max-width: 700px; flex-wrap: wrap;
}
.compare-pick { flex: 1; min-width: 200px; }
.compare-pick label {
    display: block; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-muted); margin-bottom: 6px;
}
.compare-vs {
    font-size: 18px; font-weight: 700; color: var(--text-muted);
    padding-bottom: 10px;
}

/* ---- Compare Table ---- */
.compare-table-wrap { overflow-x: auto; margin-bottom: 40px; }
.compare-table {
    width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
}
.compare-table th {
    text-align: left; padding: 18px 24px;
    background: linear-gradient(135deg, #ecfdf5, #f5f7f5);
    border-bottom: 2px solid var(--border); font-weight: 600; font-size: 15px;
}
.compare-table th:first-child { width: 140px; }
.compare-table td { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tbody tr { transition: background 0.15s; }
.compare-table tbody tr:hover { background: var(--bg-surface); }
.compare-label { font-weight: 600; color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.compare-same { background: #f0fdf4 !important; }
.compare-table th a { color: var(--primary); font-weight: 700; }

/* ---- Compare Descriptions ---- */
.compare-descriptions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
}
.compare-desc-col h2 { font-size: 20px; margin-bottom: 12px; }
.compare-desc-col p { color: var(--text-muted); line-height: 1.8; font-size: 15px; margin-bottom: 16px; }
@media (max-width: 768px) {
    .compare-descriptions { grid-template-columns: 1fr; }
    .compare-selector { flex-direction: column; align-items: stretch; }
    .compare-vs { text-align: center; padding: 0; }
}

/* ============================================================
   Insect of the Day
   ============================================================ */
.iotd-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.iotd-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}
.iotd-badge {
    display: inline-block;
    background: var(--primary-dim);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}
.iotd-content { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 24px; }
.iotd-order {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.iotd-name { font-size: 26px; font-weight: 700; margin: 8px 0 4px; }
.iotd-name a { color: var(--text); }
.iotd-name a:hover { color: var(--primary); }
.iotd-sci { color: var(--text-muted); font-size: 15px; margin-bottom: 12px; }
.iotd-desc { color: var(--text-muted); font-size: 15px; line-height: 1.7; }
.iotd-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.iotd-fact {
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.iotd-fact-icon { font-size: 24px; }
.iotd-fact p { font-size: 15px; line-height: 1.7; color: var(--text-muted); }
@media (max-width: 768px) {
    .iotd-content { grid-template-columns: 1fr; }
}

/* ============================================================
   Did You Know / Facts Grid
   ============================================================ */
.facts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.fact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 28px;
    position: relative;
    transition: var(--transition);
}
.fact-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.fact-icon { font-size: 28px; display: block; margin-bottom: 12px; }
.fact-text { font-size: 15px; line-height: 1.7; color: var(--text-muted); margin-bottom: 12px; }
.fact-source { font-size: 13px; color: var(--primary); font-weight: 500; }
@media (max-width: 768px) { .facts-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Recently Added Badge
   ============================================================ */
.card-new-badge {
    display: inline-block;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   Newsletter Signup
   ============================================================ */
.newsletter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 40px;
    box-shadow: var(--shadow);
}
.newsletter-content { flex: 1; }
.newsletter-icon { font-size: 36px; display: block; margin-bottom: 12px; }
.newsletter-content h2 { font-size: 24px; margin-bottom: 8px; }
.newsletter-content p { color: var(--text-muted); font-size: 15px; }
.newsletter-form { display: flex; gap: 12px; flex-shrink: 0; }
.newsletter-input {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    width: 280px;
    outline: none;
    transition: border-color 0.2s;
}
.newsletter-input:focus { border-color: var(--primary); }
@media (max-width: 768px) {
    .newsletter-card { flex-direction: column; text-align: center; padding: 28px; }
    .newsletter-form { flex-direction: column; width: 100%; }
    .newsletter-input { width: 100%; }
}

/* ============================================================
   CTA Buttons
   ============================================================ */
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   Favorites Button
   ============================================================ */
.fav-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: absolute;
    top: 24px;
    right: 24px;
}
.fav-btn:hover { background: rgba(255,255,255,0.25); }
.fav-heart { font-size: 22px; color: #fff; line-height: 1; }
.fav-btn.fav-active { background: rgba(220, 38, 38, 0.2); border-color: #dc2626; }
.fav-btn.fav-active .fav-heart { color: #dc2626; }
.species-hero-content { position: relative; }
.fav-remove-btn {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}
.fav-remove-btn:hover { background: rgba(220,38,38,0.1); }


/* ============================================================
   Seasonal Activity
   ============================================================ */
.seasonal-bar {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin: 16px 0;
}
.season-month {
    text-align: center;
    padding: 12px 4px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: transform 0.2s;
}
.season-month:hover { transform: scale(1.05); }
.season-month[data-active="high"] { background: var(--primary); color: #fff; }
.season-month[data-active="medium"] { background: var(--primary-dim); color: var(--primary); border: 1px solid var(--primary-glow); }
.season-month[data-active="low"] { background: var(--bg-surface); color: var(--text-muted); }
.season-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.season-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}
.season-high { background: var(--primary); }
.season-medium { background: var(--primary-dim); border: 1px solid var(--primary-glow); }
.season-low { background: var(--bg-surface); border: 1px solid var(--border); }

/* ============================================================
   A-Z Browse
   ============================================================ */
.az-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 16px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    margin-bottom: 32px;
    position: sticky;
    top: 70px;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.az-letter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    transition: var(--transition);
}
.az-letter:hover { background: var(--primary); color: #fff; }
.az-letter small { font-size: 11px; opacity: 0.5; }
.az-section { margin-bottom: 40px; }
.az-heading {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
}
.az-list { display: flex; flex-direction: column; }
.az-item {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text);
    transition: background 0.2s;
}
.az-item:hover { background: var(--bg-surface); }
.az-name { font-weight: 600; font-size: 15px; }
.az-sci { font-size: 14px; color: var(--text-muted); }
.az-order {
    font-size: 12px;
    background: var(--primary-dim);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .az-item { grid-template-columns: 1fr; gap: 4px; }
    .az-order { justify-self: start; }
}

/* ============================================================
   Habitat & Diet Cards
   ============================================================ */
.habitat-filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding: 16px 20px;
    background: var(--bg-surface);
    border-radius: var(--radius);
}
.habitat-filter-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    outline: none;
    background: var(--bg-card);
    transition: border-color 0.2s;
}
.habitat-filter-input:focus { border-color: var(--primary); }
.habitat-filter-count { font-size: 14px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.habitat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.habitat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.habitat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}
.habitat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.habitat-card:hover::before { opacity: 1; }
.habitat-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border-radius: 12px;
    font-size: 24px;
    flex-shrink: 0;
    transition: var(--transition);
}
.habitat-card:hover .habitat-card-icon { background: var(--primary-dim); transform: scale(1.05); }
.habitat-card-body { flex: 1; min-width: 0; }
.habitat-card-body h3 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.habitat-count {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}
.habitat-arrow {
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.2s, color 0.2s;
    flex-shrink: 0;
}
.habitat-card:hover .habitat-arrow { transform: translateX(4px); color: var(--primary); }

/* ============================================================
   Conservation
   ============================================================ */
.conservation-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 48px;
}
.cons-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    border-top: 4px solid var(--border);
}
.cons-stat-card.cons-critically-endangered { border-top-color: #991b1b; }
.cons-stat-card.cons-endangered { border-top-color: #dc2626; }
.cons-stat-card.cons-vulnerable { border-top-color: #ea580c; }
.cons-stat-card.cons-near-threatened { border-top-color: #ca8a04; }
.cons-stat-card.cons-least-concern { border-top-color: var(--primary); }
.cons-stat-card.cons-data-deficient { border-top-color: #6b7280; }
.cons-count { display: block; font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.cons-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.cons-section { margin-bottom: 48px; }
.cons-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.cons-section-head h2 { display: flex; align-items: center; gap: 10px; }
.cons-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
}
.cons-dot-critically-endangered { background: #991b1b; }
.cons-dot-endangered { background: #dc2626; }
.cons-dot-vulnerable { background: #ea580c; }
.cons-dot-near-threatened { background: #ca8a04; }
.cons-dot-least-concern { background: var(--primary); }
.cons-dot-data-deficient { background: #6b7280; }
.cons-section-count { font-size: 14px; color: var(--text-muted); }
.cons-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    color: #991b1b;
    font-size: 14px;
    margin-bottom: 20px;
}
.cons-more { text-align: center; margin-top: 20px; }

/* ============================================================
   Glossary
   ============================================================ */
.glossary-section { margin-bottom: 40px; }
.glossary-list { display: flex; flex-direction: column; gap: 16px; }
.glossary-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
}
.glossary-term { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.glossary-cat {
    display: inline-block;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.glossary-def { color: var(--text-muted); font-size: 15px; line-height: 1.7; }

/* ============================================================
   Quiz
   ============================================================ */
.quiz-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}
.quiz-progress {
    height: 6px;
    background: var(--bg-surface);
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}
.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}
.quiz-score-bar {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.quiz-question { margin-bottom: 24px; }
.quiz-q-text { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.quiz-q-hint { font-size: 15px; color: var(--text-muted); font-style: italic; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.quiz-option {
    padding: 14px 20px;
    background: var(--bg-surface);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    color: var(--text);
}
.quiz-option:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-dim); }
.quiz-option:disabled { cursor: default; }
.quiz-correct { border-color: var(--primary) !important; background: rgba(5,150,105,0.1) !important; color: var(--primary) !important; }
.quiz-wrong { border-color: var(--danger) !important; background: rgba(220,38,38,0.08) !important; color: var(--danger) !important; }
.quiz-feedback {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    margin-bottom: 16px;
}
.quiz-fb-correct { background: rgba(5,150,105,0.08); color: var(--primary); }
.quiz-fb-wrong { background: rgba(220,38,38,0.06); color: var(--danger); }
.quiz-fb-icon { margin-right: 8px; }
.quiz-next { width: 100%; justify-content: center; }
.quiz-results {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.quiz-results-icon { font-size: 64px; display: block; margin-bottom: 20px; }
.quiz-results-score { font-size: 20px; margin: 12px 0; }
.quiz-results-msg { color: var(--text-muted); font-size: 16px; margin-bottom: 24px; }
.quiz-results-actions { display: flex; gap: 16px; justify-content: center; }

/* ============================================================
   Timeline
   ============================================================ */
.timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding-left: 48px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    border-radius: 2px;
}
.timeline-item {
    position: relative;
    margin-bottom: 32px;
    padding-left: 24px;
}
.timeline-marker {
    position: absolute;
    left: -36px;
    top: 8px;
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 3px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.timeline-emoji { font-size: 16px; }
.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.timeline-content:hover { box-shadow: var(--shadow); }
.timeline-date { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.timeline-mya {
    background: var(--primary-dim);
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 20px;
}
.timeline-era { font-size: 13px; color: var(--text-muted); }
.timeline-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.timeline-order { font-size: 14px; color: var(--text-muted); }
.timeline-item-now .timeline-marker { border-color: var(--accent); background: var(--accent); }
.timeline-item-now .timeline-marker .timeline-emoji { filter: brightness(0) invert(1); }

/* ============================================================
   Statistics
   ============================================================ */
.stats-big-numbers {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}
.stats-big {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.stats-big-num {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}
.stats-big-label { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.stats-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.stats-bars { display: flex; flex-direction: column; gap: 12px; }
.stats-bar-row { display: grid; grid-template-columns: 120px 1fr 40px; gap: 12px; align-items: center; }
.stats-bar-label { font-size: 13px; color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-bar-track { height: 24px; background: var(--bg-surface); border-radius: 6px; overflow: hidden; }
.stats-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 6px;
    min-width: 4px;
    transition: width 0.6s ease;
}
.stats-bar-value { font-size: 14px; font-weight: 700; text-align: right; }
.stats-bar-habitat { background: linear-gradient(90deg, #059669, #34d399); }
.stats-bar-region { background: linear-gradient(90deg, #6366f1, #818cf8); }
.stats-bar-diet { background: linear-gradient(90deg, #ea580c, #fb923c); }
.stats-bar-cons-critically-endangered { background: #991b1b; }
.stats-bar-cons-endangered { background: #dc2626; }
.stats-bar-cons-vulnerable { background: #ea580c; }
.stats-bar-cons-near-threatened { background: #ca8a04; }
.stats-bar-cons-least-concern { background: var(--primary); }
.stats-bar-cons-data-deficient { background: #6b7280; }
@media (max-width: 768px) {
    .stats-big-numbers { grid-template-columns: repeat(2, 1fr); }
    .stats-big-numbers .stats-big:last-child { grid-column: span 2; }
    .stats-grid { grid-template-columns: 1fr; }
    .stats-bar-row { grid-template-columns: 80px 1fr 30px; }
}

/* ============================================================
   Admin Tables
   ============================================================ */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.admin-table th, .admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.admin-table th { font-weight: 600; background: var(--bg-surface); }
.admin-form-card {
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 24px;
}

/* ============================================================
   FAQ Section (species detail)
   ============================================================ */
.faq-section { margin-top: 8px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition);
}
.faq-item[open] { border-color: var(--primary); }
.faq-question {
    padding: 16px 20px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-surface);
    transition: background var(--transition);
}
.faq-question:hover { background: var(--primary-dim); }
.faq-question::after {
    content: '+';
    font-size: 18px;
    font-weight: 400;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--transition);
}
.faq-item[open] .faq-question::after {
    content: '\2212';
    color: var(--primary);
}
.faq-question::-webkit-details-marker { display: none; }
.faq-answer {
    padding: 0 20px 16px;
    color: var(--text-muted);
    line-height: 1.7;
}
.faq-answer p { margin: 0; }

/* ============================================================
   SEO Collection Pages
   ============================================================ */
.collection-stats {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
}
.collection-intro {
    max-width: 800px;
    margin-bottom: 32px;
    line-height: 1.75;
    color: var(--text-muted);
}
.collection-intro p { margin-bottom: 12px; }
.collection-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 24px;
}
.collection-tags-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    margin-right: 4px;
}
.collection-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-dim);
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
a.collection-tag:hover {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   Admin Form Section Divider
   ============================================================ */
.form-section-divider {
    grid-column: 1 / -1;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-top: 2px solid var(--border);
    padding-top: 20px;
    margin-top: 8px;
}

/* ============================================================
   Articles
   ============================================================ */

/* -- Listing -- */
.article-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.article-categories .collection-tag.active {
    background: var(--primary);
    color: #fff;
}
.article-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
}
.article-search-form input[type="text"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--bg);
}
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* -- Card -- */
.article-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow var(--transition), transform var(--transition);
}
.article-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    color: var(--text);
}
.article-card-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    background: var(--primary-dim);
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    align-self: flex-start;
}
.article-card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 10px;
}
.article-card-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}
.article-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
    margin-top: auto;
}

/* -- Detail hero -- */
.article-hero {
    background: var(--bg-surface);
    padding: 48px 0 40px;
    border-bottom: 1px solid var(--border-light);
}
.article-hero-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
    align-items: center;
}
.article-meta-author { font-weight: 600; color: var(--text); }
.article-meta-category {
    background: var(--primary-dim);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }

/* -- Detail layout -- */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    padding-top: 40px;
}
@media (max-width: 768px) {
    .article-layout { grid-template-columns: 1fr; gap: 32px; }
}

/* -- Content typography -- */
.article-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text);
}
.article-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 36px 0 16px;
}
.article-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 28px 0 12px;
}
.article-content p {
    margin-bottom: 18px;
}
.article-content ul, .article-content ol {
    margin: 0 0 18px 24px;
}
.article-content li {
    margin-bottom: 6px;
}
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    margin: 24px 0;
    background: var(--bg-surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-muted);
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 20px 0;
}
.article-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* -- Sidebar -- */
.article-sidebar h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}
.article-tags { margin-bottom: 28px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.article-share { margin-bottom: 28px; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* -- Related -- */
.article-related {
    border-top: 1px solid var(--border-light);
    padding-top: 40px;
    margin-top: 48px;
}
.article-related h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
}
