:root {
    --bg: #f6f5ef;
    --surface: #ffffff;
    --surface-soft: #faf9f5;
    --border: #e3e2d7;
    --text: #1c2520;
    --text-muted: #55635b;
    --primary: #1f5138;
    --primary-hover: #163d2a;

    /* 5 kategorií */
    --harmful: #b91c1c;
    --harmful-bg: #fef2f2;
    --harmful-border: #fecaca;

    --synthetic: #b45309;
    --synthetic-bg: #fffbeb;
    --synthetic-border: #fde68a;

    --beneficial: #15803d;
    --beneficial-bg: #f0fdf4;
    --beneficial-border: #bbf7d0;

    --neutral: #475569;
    --neutral-bg: #f8fafc;
    --neutral-border: #e2e8f0;

    --allergen: #6d28d9;
    --allergen-bg: #f5f3ff;
    --allergen-border: #ddd6fe;

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 28px rgba(28, 37, 32, 0.05);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    flex-shrink: 0;
    display: flex;
    filter: drop-shadow(0 4px 10px rgba(14, 100, 150, 0.1));
}

.brand-title {
    margin: 0;
    font-size: 1.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.12;
    color: var(--text);
}

.brand-accent {
    color: #0e6496;
}

.brand-subtitle {
    margin: 5px 0 0;
    font-size: 0.92rem;
    color: var(--text-muted);
    max-width: 580px;
}

.header-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    appearance: none;
    background: #eef6fa;
    color: #0b4a6f;
    border: 1px solid #c5e1ee;
    padding: 8px 14px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.nav-btn:hover {
    background: #ddf0f9;
    border-color: #93cde6;
    transform: translateY(-1px);
}

.nav-btn-ghost {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--border);
}

.nav-btn-ghost:hover {
    background: #efeee6;
    border-color: #cbcac0;
}

.cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: -0.15em;
}

.cat-svg,
.oil-drop-svg {
    display: inline-block;
    vertical-align: -0.15em;
    flex-shrink: 0;
}

.legend-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Main */
.main-content {
    padding-top: 28px;
    padding-bottom: 48px;
}

.analyzer-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow);
}

.analyzer-header h2 {
    margin: 0 0 6px;
    font-size: 1.28rem;
}

.analyzer-header p {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

textarea#inci-input {
    width: 100%;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface-soft);
    border: 1.5px solid #cfd5ce;
    border-radius: var(--radius-md);
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea#inci-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 81, 56, 0.14);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.72;
    cursor: wait;
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.alert {
    margin-top: 16px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.93rem;
}

.alert-error {
    background: var(--harmful-bg);
    border: 1px solid var(--harmful-border);
    color: #991b1b;
}

.alert-notice {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* Results */
.results-section {
    margin-top: 28px;
}

.verdict-card {
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.verdict-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.verdict-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid rgba(28, 37, 32, 0.08);
}

.verdict-bar {
    height: 10px;
    width: 100%;
    border-radius: 999px;
    background: rgba(28, 37, 32, 0.07);
    overflow: hidden;
    display: flex;
}

.verdict-bar-seg {
    height: 100%;
    transition: width 0.35s ease;
}

.seg-harmful { background: var(--harmful); }
.seg-synthetic { background: #3b3026; }
.seg-beneficial { background: var(--beneficial); }
.seg-neutral { background: #64748b; }
.seg-allergen { background: var(--allergen); }

.verdict-percents {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.83rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(28, 37, 32, 0.1);
    color: var(--text);
}

.vp-chip.is-zero {
    opacity: 0.55;
    font-weight: 500;
}

.vp-chip.vp-harmful:not(.is-zero) { border-color: var(--harmful-border); color: var(--harmful); background: #fff; }
.vp-chip.vp-synthetic:not(.is-zero) { border-color: var(--synthetic-border); color: #78350f; background: #fff; }
.vp-chip.vp-beneficial:not(.is-zero) { border-color: var(--beneficial-border); color: var(--beneficial); background: #fff; }
.vp-chip.vp-neutral:not(.is-zero) { border-color: var(--neutral-border); color: var(--neutral); background: #fff; }
.vp-chip.vp-allergen:not(.is-zero) { border-color: var(--allergen-border); color: var(--allergen); background: #fff; }

.verdict-card.verdict-excellent {
    background: #f0fdf4;
    border-color: #86efac;
}

.verdict-card.verdict-good_with_synthetics {
    background: #fefce8;
    border-color: #fde047;
}

.verdict-card.verdict-conventional {
    background: #fffbeb;
    border-color: #fcd34d;
}

.verdict-card.verdict-avoid {
    background: #fef2f2;
    border-color: #fca5a5;
}

.verdict-main h3 {
    margin: 0 0 4px;
    font-size: 1.25rem;
}

.verdict-main p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.detected-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.detected-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(28, 37, 32, 0.14);
    color: var(--text);
}

.alt-jump-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eaf5ee;
    border: 1px solid #bbf7d0;
}

.alt-jump-link:hover {
    background: #dcfce7;
}

.extra-product-warning {
    margin-top: 10px;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.78);
    border-left: 3px solid var(--harmful);
    font-size: 0.86rem;
    color: #7f1d1d;
}

/* Ověřené bio alternativy */
.alternatives-box {
    margin-top: 20px;
    background: linear-gradient(180deg, #f3faf5 0%, #ffffff 100%);
    border: 1.5px solid #bfe3cb;
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow);
}

.alt-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.alt-title-wrap h3 {
    margin: 0;
    font-size: 1.12rem;
    color: var(--primary);
}

.alt-title-wrap p {
    margin: 3px 0 0;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.alt-type-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.83rem;
    color: var(--text-muted);
    font-weight: 600;
}

.alt-type-picker select {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    background: #fff;
    border: 1px solid #bfd3c6;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}

.alt-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 720px) {
    .alt-cards-grid {
        grid-template-columns: 1fr;
    }
}

.alt-card {
    background: #fff;
    border: 1px solid #d4e8da;
    border-radius: var(--radius-md);
    padding: 15px 16px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.alt-card:hover {
    border-color: #84c59b;
    box-shadow: 0 6px 18px rgba(31, 81, 56, 0.08);
    transform: translateY(-1px);
}

.alt-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.alt-brand {
    font-size: 0.77rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
}

.alt-cert {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
}

.alt-name-btn {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.32;
    cursor: pointer;
    transition: color 0.15s ease;
}

.alt-name-btn:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.alt-mini-graph {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: #f8faf8;
    border: 1px solid #e5efe8;
}

.alt-mini-bar {
    height: 7px;
    width: 100%;
    border-radius: 999px;
    background: rgba(28, 37, 32, 0.07);
    overflow: hidden;
    display: flex;
}

.alt-mini-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.alt-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(28, 37, 32, 0.1);
    color: var(--text);
}

.alt-chip .cat-svg,
.alt-chip .oil-drop-svg {
    width: 13px;
    height: 13px;
}

.alt-chip.is-zero {
    opacity: 0.5;
    font-weight: 500;
}

.alt-chip.ac-harmful:not(.is-zero) { border-color: var(--harmful-border); color: var(--harmful); }
.alt-chip.ac-synthetic:not(.is-zero) { border-color: var(--synthetic-border); color: #78350f; }
.alt-chip.ac-beneficial:not(.is-zero) { border-color: var(--beneficial-border); color: var(--beneficial); }
.alt-chip.ac-neutral:not(.is-zero) { border-color: var(--neutral-border); color: var(--neutral); }
.alt-chip.ac-allergen:not(.is-zero) { border-color: var(--allergen-border); color: var(--allergen); }

.alt-why {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex: 1;
}

.alt-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #eef5f0;
}

.alt-where {
    font-size: 0.77rem;
    color: #3f5748;
}

.alt-inspect-btn {
    appearance: none;
    background: #eaf5ee;
    color: var(--primary);
    border: 1px solid #c6e5d1;
    border-radius: 7px;
    padding: 4px 10px;
    font-family: inherit;
    font-size: 0.77rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.alt-inspect-btn:hover {
    background: #d7eee0;
}

.inspected-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    background: #e6f5ec;
    border: 1px solid #a7dfc0;
    font-size: 0.87rem;
    color: #14432a;
}

.btn-back-original {
    appearance: none;
    background: #fff;
    border: 1px solid #a7dfc0;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-back-original:hover {
    background: #f0fdf4;
}

.alt-tips {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #dcebe1;
}

.alt-tips h4 {
    margin: 0 0 8px;
    font-size: 0.92rem;
    color: var(--primary);
}

.alt-tips ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 5px;
    font-size: 0.87rem;
    color: #2f3e35;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    transition: transform 0.12s ease;
}

.stat-tile:hover {
    transform: translateY(-1px);
}

.stat-tile-label {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stat-tile-count {
    font-size: 1.25rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 999px;
}

.stat-harmful .stat-tile-count { background: var(--harmful-bg); color: var(--harmful); }
.stat-synthetic .stat-tile-count { background: var(--synthetic-bg); color: var(--synthetic); }
.stat-beneficial .stat-tile-count { background: var(--beneficial-bg); color: var(--beneficial); }
.stat-neutral .stat-tile-count { background: var(--neutral-bg); color: var(--neutral); }
.stat-allergen .stat-tile-count { background: var(--allergen-bg); color: var(--allergen); }

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 22px 0 16px;
}

.toolbar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.btn-toggle-all {
    appearance: none;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-toggle-all:hover {
    background: #eef3ef;
    color: var(--primary);
    border-color: #bfd3c6;
}

.view-switch {
    display: inline-flex;
    background: #e9e8df;
    padding: 4px;
    border-radius: 10px;
}

.tab-btn {
    border: none;
    background: transparent;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.tab-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.db-meta {
    font-size: 0.83rem;
    color: var(--text-muted);
}

/* Category sections (collapsible accordion panels) */
.category-section {
    margin-bottom: 14px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.category-section[open] {
    margin-bottom: 22px;
}

.category-header {
    padding: 15px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: filter 0.12s ease;
}

.category-header::-webkit-details-marker {
    display: none;
}

.category-header:hover {
    filter: brightness(0.985);
}

.category-section[open] > .category-header {
    border-bottom: 1px solid var(--border);
}

.category-section.cat-harmful .category-header { background: var(--harmful-bg); }
.category-section.cat-synthetic .category-header { background: var(--synthetic-bg); }
.category-section.cat-beneficial .category-header { background: var(--beneficial-bg); }
.category-section.cat-neutral .category-header { background: var(--neutral-bg); }
.category-section.cat-allergen .category-header { background: var(--allergen-bg); }

.category-section.cat-harmful[open] > .category-header { border-bottom-color: var(--harmful-border); }
.category-section.cat-synthetic[open] > .category-header { border-bottom-color: var(--synthetic-border); }
.category-section.cat-beneficial[open] > .category-header { border-bottom-color: var(--beneficial-border); }
.category-section.cat-neutral[open] > .category-header { border-bottom-color: var(--neutral-border); }
.category-section.cat-allergen[open] > .category-header { border-bottom-color: var(--allergen-border); }

.category-header-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cat-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    color: var(--text-muted);
    transition: transform 0.2s ease, background 0.15s ease;
    flex-shrink: 0;
}

.category-section[open] .cat-chevron {
    transform: rotate(180deg);
    background: #fff;
}

.category-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.cat-harmful .category-title { color: var(--harmful); }
.cat-synthetic .category-title { color: var(--synthetic); }
.cat-beneficial .category-title { color: var(--beneficial); }
.cat-neutral .category-title { color: var(--neutral); }
.cat-allergen .category-title { color: var(--allergen); }

.category-desc {
    margin: 4px 0 0;
    font-size: 0.86rem;
    color: var(--text-muted);
    width: 100%;
}

.category-count-badge {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
}

.ingredients-list {
    padding: 12px 16px;
    display: grid;
    gap: 12px;
}

/* Ingredient Card */
.ingredient-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    background: #fff;
    border-left-width: 5px;
}

.ingredient-card.border-harmful { border-left-color: var(--harmful); }
.ingredient-card.border-synthetic { border-left-color: var(--synthetic); }
.ingredient-card.border-beneficial { border-left-color: var(--beneficial); }
.ingredient-card.border-neutral { border-left-color: var(--neutral); }
.ingredient-card.border-allergen { border-left-color: var(--allergen); }

.ing-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.ing-names {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.ing-pos {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    background: #f1f0e9;
    padding: 2px 7px;
    border-radius: 6px;
}

.ing-pos.top-five {
    background: #e6efe9;
    color: var(--primary);
}

.ing-cz {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.ing-inci {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--surface-soft);
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid var(--border);
}

.ing-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.origin-natural { background: #dcfce7; color: #166534; }
.origin-natural_derived { background: #ecfccb; color: #3f6212; }
.origin-mineral { background: #e0f2fe; color: #075985; }
.origin-synthetic { background: #fef3c7; color: #92400e; }

.badge-bio {
    background: #15803d;
    color: #fff;
}

.badge-ai {
    background: #eef2ff;
    color: #4338ca;
}

.ing-details-grid {
    display: grid;
    gap: 7px;
    font-size: 0.92rem;
}

.ing-row strong {
    color: #2f3e35;
}

.ing-cosing {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Unrecognized box */
.unrecognized-box {
    margin-top: 20px;
    background: #fff;
    border: 1px dashed #cbd5ce;
    border-radius: var(--radius-md);
    padding: 16px 20px;
}

.unrecognized-box h4 {
    margin: 0 0 8px;
    font-size: 0.98rem;
}

.unrecognized-box ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Legend */
.legend-box {
    margin-top: 38px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.legend-box h3 {
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.legend-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.legend-item p {
    margin: 3px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.dot-harmful { background: var(--harmful); }
.dot-synthetic { background: var(--synthetic); }
.dot-beneficial { background: var(--beneficial); }
.dot-neutral { background: var(--neutral); }
.dot-allergen { background: var(--allergen); }

.certs-explainer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.certs-explainer h4 {
    margin: 0 0 12px;
    font-size: 0.98rem;
    color: var(--primary);
}

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

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

.cert-card {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.cert-card p {
    margin: 7px 0 0;
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 26px 0 40px;
    font-size: 0.84rem;
    color: var(--text-muted);
    text-align: center;
}

.footer-disclaimer {
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.6;
}

.footer-credit-wrap {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.footer-credit {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #0e6496;
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.015em;
}

.credit-heart {
    font-size: 0.94rem;
    line-height: 1;
}

.credit-sep {
    color: #7dd3fc;
}

.credit-copy {
    color: #0e6496;
}

.footer-author {
    color: #0284c7;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(2, 132, 199, 0.45);
    padding-bottom: 1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.footer-author:hover {
    color: #0b3b5c;
    border-bottom-color: #0b3b5c;
}

/* Modální překryvná okna (Jak to funguje? / O projektu) */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(20, 30, 26, 0.52);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.16s ease-out;
}

.modal-backdrop[hidden] {
    display: none;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    width: 100%;
    max-width: 600px;
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(15, 25, 20, 0.25);
    animation: modalPop 0.18s ease-out;
}

.modal-dialog-wide {
    max-width: 700px;
}

.modal-header-controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.modal-pager {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    padding: 3px 6px;
    border-radius: 999px;
}

.pager-btn {
    appearance: none;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.pager-btn:hover:not(:disabled) {
    background: #eaf5ee;
    border-color: #9ed4b3;
}

.pager-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.pager-status {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    min-width: 34px;
    text-align: center;
}

.modal-legend-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

@keyframes modalPop {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.22rem;
    color: var(--primary);
}

.modal-close {
    appearance: none;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.modal-close:hover {
    background: #ecebe2;
    color: var(--text);
}

.modal-body {
    padding: 20px 22px 24px;
    font-size: 0.93rem;
}

.how-steps {
    margin: 0;
    padding-left: 22px;
    display: grid;
    gap: 14px;
}

.how-steps li::marker {
    font-weight: 700;
    color: var(--text);
}

.how-steps li > strong {
    display: block;
    color: var(--text);
    margin-bottom: 3px;
}

.how-steps li p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.about-content p {
    margin: 0 0 14px;
    color: var(--text-muted);
    line-height: 1.65;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.about-content strong {
    color: var(--text);
}

.about-contact {
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text) !important;
}

@media (max-width: 640px) {
    .analyzer-box { padding: 18px; }
    .verdict-top { flex-direction: column; align-items: flex-start; }
    .purity-meter { text-align: left; }
}
