/* ══════════════════════════════════════════════════════════════
   Модуль «Токаев» — SGEO UI Kit (v1.3.0)
   Palette: SGEO blue (#2563EB) + neutral surfaces
   Fonts: Inter (UI + content)
   ══════════════════════════════════════════════════════════════ */

:root {
    /* ── Base surfaces (SGEO UI Kit) ── */
    --bg: #F3F5F7;
    --surface: #FAFBFC;
    --surface-alt: #E8ECF0;
    --surface-warm: #EEF1F4;
    --border: #DCE1E6;
    --border-light: #E8ECF0;

    /* ── Text ── */
    --text: #131822;
    --text-secondary: #2E3440;
    --text-muted: #6B7685;
    --text-faint: #9CA5B0;

    /* ── Accent: SGEO blue ── */
    --accent: #2563EB;
    --accent-hover: #1D4FD0;
    --accent-light: #E5EDFB;
    --accent-subtle: #C6D6F7;

    /* ── Brand (логотип/иконка шанырак — синий, не золотой) ── */
    --gold: #2563EB;
    --gold-light: #E5EDFB;

    /* ── Fonts: Inter everywhere ── */
    --serif: 'Inter', -apple-system, 'Segoe UI', sans-serif;
    --sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'SFMono-Regular', 'Consolas', monospace;

    /* ── Radius: SGEO default ── */
    --radius: 8px;
    --radius-lg: 10px;

    /* ── Shadows ── */
    --shadow-sm: 0 1px 2px hsl(220 25% 10% / 0.04), 0 1px 3px hsl(220 25% 10% / 0.06);
    --shadow: 0 2px 4px hsl(220 25% 10% / 0.06), 0 1px 2px hsl(220 25% 10% / 0.04);
    --shadow-lg: 0 8px 16px hsl(220 25% 10% / 0.08), 0 4px 8px hsl(220 25% 10% / 0.04);
    --shadow-hover: 0 12px 24px hsl(220 25% 10% / 0.10), 0 8px 12px hsl(220 25% 10% / 0.04);

    /* ── Transition ── */
    --transition: 0.15s ease;
}


/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 1.0625rem; /* 17px */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* ── Speaker Switcher ──────────────────────────────────────── */

.speaker-switcher {
    display: flex;
    gap: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    width: fit-content;
    margin: 0 auto 4px;
    border-bottom: 1px solid var(--border-light);
}

.speaker-tab {
    display: inline-flex;
    align-items: center;
    padding: 6px 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-radius: 0;
    transition: all var(--transition);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.speaker-tab:hover {
    color: var(--text-secondary);
}

.speaker-tab.active {
    background: transparent;
    color: var(--accent);
    box-shadow: none;
    border-bottom-color: var(--accent);
}

/* ── Header ────────────────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 250, 247, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.logo-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
}

.logo-text {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1.1;
}

.logo-sub {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-top: 0;
}

.nav-links {
    display: flex;
    gap: 36px;
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
}

.nav-link.active {
    color: var(--text);
    border-bottom-color: var(--accent);
    font-weight: 700;
}

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

.nav-burger span {
    width: 20px;
    height: 1.5px;
    background: var(--text);
    border-radius: 0;
    transition: var(--transition);
}

/* ── Hero ──────────────────────────────────────────────────── */

.hero {
    padding: 28px 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 40%, var(--gold) 100%);
    opacity: 0.7;
}

.hero-content {
    text-align: left;
    max-width: 780px;
    margin: 0;
}

.hero-title {
    font-family: var(--serif);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 10px;
    color: var(--text);
    letter-spacing: -0.015em;
    text-align: left;
    hyphens: none;
}

.hero-subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.7;
    max-width: 600px;
    font-weight: 400;
    text-align: left;
    hyphens: none;
}

.hero-stats {
    display: flex;
    gap: 0;
    margin-top: 12px;
    margin-bottom: 16px;
    border-left: 3px solid var(--accent);
    padding-left: 0;
}

.stat-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 4px 32px;
    text-align: left;
    position: relative;
}

.stat-card + .stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--border);
}

.stat-num {
    display: block;
    font-family: var(--serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1.05;
    margin-bottom: 2px;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums lining-nums;
}

.stat-label {
    font-size: 0.75rem; /* 12px minimum */
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    line-height: 1.3;
}

.hero-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    margin-bottom: 8px;
}

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    font-family: var(--sans);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

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

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

/* ── Sections ──────────────────────────────────────────────── */

.section {
    padding: 28px 0;
}

.section-alt {
    background: var(--bg);
    border-top: 1px solid var(--border-light);
    padding: 24px 0;
}

.section-title {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: left;
    color: var(--text);
    letter-spacing: -0.01em;
    hyphens: none;
}

.section-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    text-align: left;
    margin-bottom: 20px;
    font-weight: 400;
    hyphens: none;
}

.page-title {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.page-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 400;
}

/* ── Theme Grid ────────────────────────────────────────────── */

.theme-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.theme-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px 16px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 0;
}

/* Left accent border instead of top */
.theme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-color, var(--accent));
}

.theme-card:hover {
    border-color: var(--border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: var(--text);
}

.theme-code {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-color, var(--accent));
    letter-spacing: 0.1em;
    margin-bottom: 0;
    text-transform: uppercase;
    font-family: var(--mono);
    flex-shrink: 0;
    width: 18px;
}

.theme-name {
    font-family: var(--serif);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    flex: 1;
    margin: 0;
    text-align: left;
    hyphens: none;
}

.theme-icon {
    font-size: 17px;
    color: var(--accent-color, var(--accent));
    margin-bottom: 10px;
    opacity: 0.8;
}

.theme-count {
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Document Cards ────────────────────────────────────────── */

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.doc-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    transition: all var(--transition);
    display: grid;
    grid-template-rows: auto auto auto;
    color: var(--text);
    position: relative;
}

.doc-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.doc-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.doc-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 700;
    font-family: var(--mono);
}

.doc-date {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.doc-title {
    font-family: var(--serif);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text);
    text-align: left;
    hyphens: none;
}

.doc-venue {
    font-size: 11px;
    color: var(--text-muted);
    text-align: left;
}

.doc-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 4px;
}

/* ── Quotes ────────────────────────────────────────────────── */

.quotes-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 760px;
    margin: 0 auto;
}

.quote-card {
    background: var(--surface);
    border-left: 3px solid var(--accent);
    border-radius: 0;
    padding: 28px 28px 24px;
    box-shadow: var(--shadow-sm);
}

.quote-text {
    font-family: var(--serif);
    font-size: 1.0625rem;
    font-style: normal;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 14px;
}

.quote-text::before { content: '\201C'; }
.quote-text::after { content: '\201D'; }

.quote-source {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-variant: small-caps;
    letter-spacing: 0.03em;
    font-weight: 500;
}

.quote-year {
    font-weight: 700;
    color: var(--accent);
    font-variant: normal;
}

/* ── Filters ───────────────────────────────────────────────── */

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 32px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.filter-chip:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.filter-chip.active {
    background: var(--accent-hover);
    color: #fff;
    border-color: var(--accent-hover);
    font-weight: 600;
}

/* ── Search ────────────────────────────────────────────────── */

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
}

.search-input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text);
    font-family: var(--sans);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder { color: var(--text-faint); }
.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

/* ── Timeline ──────────────────────────────────────────────── */

.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.timeline-year {
    position: relative;
    margin: 36px 0 16px -40px;
    padding-left: 40px;
}

.year-badge {
    display: inline-block;
    background: transparent;
    color: var(--text);
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.5rem;
    padding: 0 0 0 10px;
    border-radius: 0;
    letter-spacing: -0.01em;
    border-left: 3px solid var(--accent);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -29px;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
}

.timeline-content {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: all var(--transition);
}

.timeline-content:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.doc-type-badge {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--accent);
    font-family: var(--mono);
}

.timeline-date {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.timeline-title {
    display: block;
    font-family: var(--serif);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.timeline-title:hover { color: var(--accent); }

.timeline-venue,
.timeline-source {
    font-size: 12px;
    color: var(--text-muted);
}

.timeline-source::before {
    content: '\00b7';
    margin: 0 6px;
}

/* ── Atom Cards ────────────────────────────────────────────── */

.atoms-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.atom-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: all var(--transition);
}

.atom-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.atom-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.atom-block-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: var(--radius);
    letter-spacing: 0.06em;
}

.atom-doc-info {
    font-size: 11px;
    color: var(--text-muted);
}

.atom-quote {
    font-family: var(--serif);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 12px;
    border-left: 2px solid var(--accent);
    padding-left: 16px;
}

.atom-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.atom-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius);
    background: var(--surface-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    font-weight: 500;
    transition: all var(--transition);
}

.atom-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.atom-paraphrase {
    font-size: 12px;
    color: var(--accent);
    margin-top: 8px;
    line-height: 1.6;
    padding-left: 16px;
    border-left: 1px solid var(--accent-subtle);
}

/* ── Pagination ────────────────────────────────────────────── */

.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 36px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--surface);
    transition: all var(--transition);
    font-variant-numeric: tabular-nums;
}

.pagination a:hover,
.pagination .active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Empty State ───────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
    font-size: 1rem;
}

/* ── Footer (institutional) ─────────────────────────────────── */

footer.footer-institutional {
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    margin-top: 48px;
}

/* ── Evolution Timeline ────────────────────────────────────── */

.evolution-timeline {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.evo-year-block {
    position: relative;
}

.evo-year-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: sticky;
    top: 56px;
    z-index: 10;
    background: var(--bg);
    padding: 10px 0;
}

.evo-atoms {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--border-light);
}

/* ── Language Tabs ──────────────────────────────────────────── */

.lang-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 28px;
}

.lang-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--sans);
}

.lang-tab:hover {
    color: var(--text-secondary);
}

.lang-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.lang-tab .lang-badge {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: var(--radius);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.lang-badge--official {
    background: var(--accent-light);
    color: var(--accent);
}

.lang-badge--translation {
    background: var(--gold-light);
    color: var(--gold);
}

.lang-panel {
    display: none;
}

.lang-panel.active {
    display: block;
}

/* Language pills in cards */
.lang-pills {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.lang-pill {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lang-pill--official {
    background: var(--accent-light);
    color: var(--accent);
}

.lang-pill--translation {
    background: var(--gold-light);
    color: var(--gold);
}

/* ── Document Page Overrides ───────────────────────────────── */

.doc-full-text {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 40px;
    line-height: 1.85;
    font-size: 1rem;
}

.doc-full-text h2 {
    font-family: var(--sans);
    font-size: 0.6875rem;
    margin-bottom: 0;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-style: normal;
}

.doc-body p {
    margin-bottom: 1em;
    line-height: 1.85;
    text-align: left;
    hyphens: none;
}

.doc-body p:last-child {
    margin-bottom: 0;
}

/* ── Admin Overrides ───────────────────────────────────────── */

.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--surface); border-right: 1px solid var(--border-light); padding: 22px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar .logo { padding: 0 18px; margin-bottom: 28px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 18px; font-size: 13px; font-weight: 500; color: var(--text-secondary); transition: all var(--transition); border-left: 2px solid transparent; }
.sidebar-link:hover, .sidebar-link.active { background: var(--accent-light); color: var(--accent); border-left-color: var(--accent); }
.sidebar-link .count { margin-left: auto; font-size: 10px; background: var(--surface-alt); padding: 2px 8px; border-radius: var(--radius); color: var(--text-muted); }
.admin-main { padding: 28px 32px; background: var(--bg); }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-header h1 { font-family: var(--serif); font-size: 1.35rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.admin-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 20px; }
.admin-card .value { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.admin-card .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 10px 14px; border-bottom: 2px solid var(--border-light); font-weight: 600; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); font-size: 13px; color: var(--text-secondary); }
tr:hover td { background: var(--surface-warm); }

/* ── Document type badge color variants ──────────────────────── */

:root {
    --badge-statement: #2563EB;  /* SGEO blue */
    --badge-article:   #059669;  /* emerald */
    --badge-interview: #B45309;  /* amber-700 */
    --badge-commentary:#7C3AED;  /* violet */
    --badge-address:   #0891B2;  /* cyan-600 */
}

/* ── Thematic grid balanced layout ───────────────────────────── */

.theme-grid--balanced {
    grid-template-columns: 1fr;
}

.theme-card--cta {
    background: var(--accent-light);
    border-color: var(--accent-subtle);
}

.theme-card--cta .theme-code {
    color: var(--accent);
    font-size: 14px;
}

.theme-card--cta .theme-name {
    color: var(--accent);
}

.theme-card--cta:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.theme-card--cta:hover .theme-code,
.theme-card--cta:hover .theme-name {
    color: #fff;
}

/* ── Document page improvements ──────────────────────────────── */

.doc-fulltext-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-top: 14px;
    border-top: 2px solid var(--accent);
}

.doc-fulltext-label {
    font-family: var(--sans);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0;
}

.doc-body {
    max-width: 680px;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, background 0.15s ease;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--accent-hover);
}

/* ── Export toolbar ─────────────────────────────────────────── */

.export-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: flex-end;
    padding: 8px 12px;
    background: var(--surface-warm);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.export-btn {
    font-size: 12px;
    padding: 6px 14px;
}

/* ── Context toggle ─────────────────────────────────────────── */

.context-details {
    margin-top: 8px;
}

.context-summary {
    display: inline-block;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    background: transparent;
    transition: all var(--transition);
    user-select: none;
    list-style: none;
}

.context-summary::-webkit-details-marker { display: none; }

.context-summary::before {
    content: '\25B6\0020';
    font-size: 8px;
    vertical-align: 1px;
}

.context-details[open] .context-summary::before {
    content: '\25BC\0020';
}

.context-summary:hover {
    background: var(--surface-warm);
    border-color: var(--border);
    color: var(--text-secondary);
}

.context-body {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.65;
    padding: 10px 14px;
    background: var(--surface-warm);
    border-radius: var(--radius);
    border-left: 2px solid var(--border);
}

/* ── About page styles ──────────────────────────────────────── */

.about-section-sep {
    height: 1px;
    background: var(--border-light);
    margin: 24px 0 20px;
}

.about-usecases {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.about-usecase-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
}

.about-usecase-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sans);
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}

.about-usecase-title {
    font-family: var(--serif);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 5px;
    text-align: left;
    hyphens: none;
}

.about-usecase-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    text-align: left;
    hyphens: none;
}

.about-sections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .about-usecases { grid-template-columns: 1fr; }
    .about-sections-grid { grid-template-columns: 1fr; }
}

.about-section-title {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    text-align: left;
}

.about-section-title--decorated::before {
    content: '\25AA\0020';
    color: var(--accent);
    font-size: 0.75em;
    vertical-align: 1px;
}

.about-person-card {
    padding: 18px 22px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--accent);
    margin-bottom: 14px;
}

.about-numbered-list {
    padding-left: 0;
    list-style: none;
    counter-reset: about-counter;
    margin-bottom: 16px;
}

.about-numbered-list li {
    counter-increment: about-counter;
    padding: 8px 0 8px 36px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    text-align: left;
    hyphens: none;
}

.about-numbered-list li:last-child {
    border-bottom: none;
}

.about-numbered-list li::before {
    content: counter(about-counter);
    position: absolute;
    left: 0;
    top: 8px;
    width: 22px;
    height: 22px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sans);
    font-variant-numeric: tabular-nums;
}

/* ── Logo shanyrak icon ─────────────────────────────────────── */

.logo-shanyrak {
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* ── Mobile Nav ─────────────────────────────────────────────── */

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    z-index: 98;
    padding: 12px 20px 16px;
    flex-direction: column;
    gap: 2px;
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav-switcher {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 10px;
    padding-bottom: 2px;
}

.mobile-nav-tab {
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition);
}

.mobile-nav-tab:hover {
    color: var(--text-secondary);
}

.mobile-nav-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.mobile-nav-link {
    display: block;
    padding: 9px 4px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    transition: color var(--transition);
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--accent);
}

/* ── Hero Search ─────────────────────────────────────────────── */

.hero-search {
    display: flex;
    align-items: center;
    max-width: 560px;
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
    background: var(--surface);
    margin-top: 8px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.hero-search-input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    font-size: 15px;
    font-family: var(--sans);
    color: var(--text);
    background: transparent;
    border: none;
    outline: none;
    min-width: 0;
    text-align: left;
    hyphens: none;
}

.hero-search-input::placeholder {
    color: var(--text-faint);
}

.hero-search-btn {
    flex-shrink: 0;
    height: 44px;
    padding: 0 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    transition: background var(--transition);
    letter-spacing: 0.02em;
}

.hero-search-btn:hover {
    background: var(--accent-hover);
}

/* ── Responsive ────────────────────────────────────────────── */

/* ── Tablet (≤768px) ── */
@media (max-width: 768px) {
    .container { padding: 0 16px; }

    /* Nav */
    .nav-links { display: none; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: var(--surface); padding: 16px 20px; gap: 14px; border-bottom: 1px solid var(--border-light); box-shadow: var(--shadow); z-index: 99; }
    .nav-links.open { display: flex; }
    .nav-burger { display: flex; }
    .nav { height: 48px; }

    /* Speaker switcher */
    .speaker-switcher { margin-bottom: 4px; }
    .speaker-tab { padding: 4px 14px; font-size: 10px; }

    /* Hero — compact */
    .hero { padding: 32px 0 28px; }
    .hero::before { height: 2px; }
    .hero-title { font-size: 1.5rem; margin-bottom: 8px; letter-spacing: 0; }
    .hero-subtitle { font-size: 0.875rem; margin-bottom: 24px; }
    .hero-stats { flex-direction: row; flex-wrap: wrap; margin-bottom: 24px; border-left: 2px solid var(--accent); }
    .stat-card { padding: 4px 16px; flex: 1; min-width: 0; }
    .stat-num { font-size: 1.35rem; }
    .stat-label { font-size: 0.6875rem; letter-spacing: 0.05em; }
    .hero-actions { gap: 8px; }
    .hero-actions .btn { padding: 8px 18px; font-size: 12px; }

    /* Sections — tighter spacing */
    .section { padding: 40px 0; }
    .section-title { font-size: 1.25rem; margin-bottom: 4px; }
    .section-desc { font-size: 0.875rem; margin-bottom: 24px; }
    .page-title { font-size: 1.5rem; margin-bottom: 4px; }
    .page-desc { font-size: 0.875rem; margin-bottom: 16px; }

    /* Theme grid */
    .theme-grid { grid-template-columns: 1fr; gap: 4px; }
    .theme-grid--balanced { grid-template-columns: 1fr; }
    .theme-card { padding: 10px 14px; }
    .theme-name { font-size: 0.8125rem; }

    /* Document cards */
    .docs-grid { grid-template-columns: 1fr; gap: 10px; }
    .doc-card { padding: 16px 18px; }
    .doc-title { font-size: 0.9375rem; }

    /* Quotes */
    .quotes-list { gap: 14px; }
    .quote-card { padding: 18px 20px; }
    .quote-text { font-size: 0.9375rem; line-height: 1.7; }

    /* Filters */
    .filters-bar { gap: 5px; margin-bottom: 16px; }
    .filter-chip { padding: 4px 10px; font-size: 11px; }

    /* Search */
    .search-bar { margin-bottom: 16px; }
    .search-input { padding: 8px 12px; font-size: 13px; }

    /* Timeline — compact */
    .timeline { padding-left: 28px; }
    .timeline::before { left: 10px; }
    .timeline-year { margin: 20px 0 12px -28px; padding-left: 28px; }
    .year-badge { font-size: 1.25rem; }
    .timeline-item { padding-bottom: 14px; }
    .timeline-dot { left: -22px; top: 7px; width: 5px; height: 5px; }
    .timeline-content { padding: 12px 16px; }
    .timeline-title { font-size: 0.875rem; }
    .timeline-meta { gap: 6px; margin-bottom: 4px; }

    /* Atom cards */
    .atom-card { padding: 14px 16px; }
    .atom-header { gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
    .atom-quote { font-size: 0.875rem; line-height: 1.7; padding-left: 12px; }
    .atom-paraphrase { font-size: 11px; padding-left: 12px; }
    .atom-doc-info { font-size: 10px; }

    /* Evolution */
    .evolution-timeline { gap: 32px; }
    .evo-year-header { top: 48px; padding: 6px 0; }
    .evo-atoms { padding-left: 14px; gap: 10px; }

    /* Document page */
    .doc-full-text { padding: 20px; font-size: 0.9375rem; line-height: 1.75; }
    .doc-body p { text-align: left; hyphens: none; line-height: 1.75; margin-bottom: 0.8em; }
    .lang-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .lang-tab { padding: 8px 14px; font-size: 12px; white-space: nowrap; }

    /* Footer */
    footer.footer-institutional { margin-top: 40px; }
    footer.footer-institutional .container { padding: 28px 16px !important; }

    /* Pagination */
    .pagination { gap: 4px; margin-top: 20px; }
    .pagination a, .pagination span { width: 30px; height: 30px; font-size: 12px; }

    /* Empty state */
    .empty-state { padding: 40px 16px; }

    /* Admin */
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
}

/* ── Small phones (≤480px) ── */
@media (max-width: 480px) {
    .container { padding: 0 14px; }

    .hero { padding: 24px 0 20px; }
    .hero-title { font-size: 1.25rem; }
    .hero-subtitle { font-size: 0.8125rem; margin-bottom: 18px; }
    .hero-stats { flex-wrap: wrap; margin-bottom: 18px; }
    .stat-card { flex: 0 0 calc(50% - 1px); padding: 6px 12px; }
    .stat-card + .stat-card::before { display: none; }
    .stat-num { font-size: 1.15rem; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; justify-content: center; }

    .section { padding: 32px 0; }
    .page-title { font-size: 1.25rem; }

    .theme-grid { grid-template-columns: 1fr; gap: 4px; }
    .theme-card { padding: 9px 12px; }
    .theme-name { font-size: 0.75rem; }
    .theme-code { font-size: 9px; margin-bottom: 0; }

    .doc-card { padding: 14px; }
    .doc-title { font-size: 0.875rem; }

    .atom-card { padding: 12px 14px; }
    .atom-quote { font-size: 0.8125rem; }

    .quote-card { padding: 16px 18px; }
    .quote-text { font-size: 0.8125rem; }

    .doc-full-text { padding: 14px; }
    .doc-full-text h2 { font-size: 0.9375rem; }

    footer.footer-institutional { margin-top: 24px; }
    footer.footer-institutional .container { padding: 20px 14px !important; }

    .search-bar { flex-direction: column; gap: 6px; }
    .search-bar .btn { width: 100%; justify-content: center; }
    .hero-search { max-width: 100%; }
    .hero-search-input { font-size: 14px; }
}
