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

    .al-shell { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

    .al-card {
        background: #ffffff;
        border: 1px solid #d0d8e0;
        border-radius: 10px;
        padding: 1.25rem 1.5rem;
        margin-bottom: 1rem;
        box-shadow: 0 1px 4px rgba(15,25,35,.07);
    }

    .al-section-title {
        font-size: .95rem;
        font-weight: 700;
        color: #0f1923;
        margin: 0 0 1.1rem;
        padding-bottom: .55rem;
        border-bottom: 2px solid #b8d9f0;
    }

    /* ── Dish input ──────────────────────────────────────── */
    .al-dish-row {
        display: flex;
        gap: .75rem;
        align-items: center;
        flex-wrap: wrap;
        padding: .75rem 0;
        border-bottom: 1px solid #e8eef4;
    }

    .al-dish-row:last-child { border-bottom: none; }

    .al-dish-name {
        flex: 0 0 200px;
        padding: .55rem .8rem;
        font-size: .875rem;
        font-weight: 700;
        color: #0f1923;
        border: 1.5px solid #b0bcc8;
        border-radius: 7px;
        background: #ffffff;
        transition: border-color .15s;
    }

    .al-dish-name:focus { outline: none; border-color: #005fa3; }

    .al-allergens {
        display: flex;
        flex-wrap: wrap;
        gap: .35rem;
        flex: 1;
    }

    .al-check {
        display: flex;
        align-items: center;
        gap: .3rem;
        padding: .3rem .6rem;
        background: #f0f4f8;
        border: 1.5px solid #d0d8e0;
        border-radius: 6px;
        cursor: pointer;
        transition: background .12s, border-color .12s;
        user-select: none;
    }

    .al-check input[type="checkbox"] {
        width: 15px;
        height: 15px;
        cursor: pointer;
        accent-color: #b03030;
    }

    .al-check span {
        font-size: .75rem;
        font-weight: 600;
        color: #0f1923;
        white-space: nowrap;
    }

    .al-check:has(input:checked) {
        background: #f5c0c0;
        border-color: #b03030;
    }

    .al-del-btn {
        padding: .4rem .6rem;
        font-size: .8rem;
        font-weight: 700;
        background: #f5c0c0;
        color: #0f1923;
        border: 2px solid #d08080;
        border-radius: 6px;
        cursor: pointer;
        flex-shrink: 0;
        transition: background .15s;
    }

    .al-del-btn:hover { background: #f0a0a0; }

    /* ── Buttons ─────────────────────────────────────────── */
    .al-add-btn {
        padding: .55rem 1.1rem;
        font-size: .85rem;
        font-weight: 700;
        background: #b8d9f0;
        color: #0f1923;
        border: 2px solid #7ec8f0;
        border-radius: 8px;
        cursor: pointer;
        transition: background .15s;
        margin-top: .75rem;
    }

    .al-add-btn:hover { background: #90c5e8; }

    .al-run-btn {
        padding: .75rem 1.5rem;
        font-size: .95rem;
        font-weight: 700;
        background: #b8d9f0;
        color: #0f1923;
        border: 2px solid #7ec8f0;
        border-radius: 10px;
        cursor: pointer;
        transition: background .15s, transform .1s;
        box-shadow: 0 1px 4px rgba(15,25,35,.08);
    }

    .al-run-btn:hover  { background: #90c5e8; }
    .al-run-btn:active { transform: scale(.97); }

    /* ── Results header ──────────────────────────────────── */
    .al-results-header {
        background: #2d3f52;
        border-radius: 16px;
        padding: 1.5rem 1.75rem;
        margin-bottom: 1rem;
        box-shadow: 0 4px 16px rgba(15,25,35,.12);
    }

    .al-results-header h2 { font-size: 1.2rem; font-weight: 800; margin: 0 0 .2rem; color: #ffffff; }
    .al-results-header p  { margin: 0; font-size: .875rem; color: #b8d0e8; }

    /* ── Matrix table ────────────────────────────────────── */
    .al-matrix-wrap { overflow-x: auto; }

    .al-matrix {
        width: 100%;
        border-collapse: collapse;
        font-size: .78rem;
    }

    .al-matrix th {
        background: #2d3f52;
        color: #ffffff;
        padding: .55rem .45rem;
        text-align: center;
        font-size: .7rem;
        font-weight: 700;
        white-space: nowrap;
    }

    .al-matrix th.dish-col {
        text-align: left;
        padding-left: .75rem;
        min-width: 140px;
    }

    .al-matrix th:first-child { border-radius: 8px 0 0 0; }
    .al-matrix th:last-child  { border-radius: 0 8px 0 0; }

    .al-matrix td {
        padding: .5rem .45rem;
        border-bottom: 1px solid #d0d8e0;
        border-right: 1px solid #e8eef4;
        text-align: center;
        vertical-align: middle;
        color: #0f1923;
        font-weight: 600;
    }

    .al-matrix td.dish-name-cell {
        text-align: left;
        padding-left: .75rem;
        font-weight: 700;
        color: #0f1923;
        background: #f0f7fd;
        border-right: 2px solid #b8d9f0;
    }

    .al-matrix tr:last-child td { border-bottom: none; }

    .al-tick { color: #b03030; font-weight: 800; font-size: 1rem; }
    .al-none { color: #b0bcc8; font-size: .7rem; }

    /* ── Legend ──────────────────────────────────────────── */
    .al-legend {
        display: flex;
        gap: 1.5rem;
        flex-wrap: wrap;
        margin-top: .75rem;
        font-size: .8rem;
        font-weight: 600;
        color: #0f1923;
    }

    /* ── Explainer ───────────────────────────────────────── */
    .al-explainer { border: 1px solid #d0d8e0; border-radius: 10px; margin-top: 1.5rem; background: #ffffff; overflow: hidden; }

    .al-explainer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: .9rem 1.25rem;
        background: #ffffff;
        border: none;
        cursor: pointer;
        font-size: .95rem;
        font-weight: 700;
        color: #0f1923;
        text-align: left;
        transition: background .15s;
    }

    .al-explainer-head:hover { background: #f0f4f8; }
    .al-explainer-head svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform .2s; }
    .al-explainer-head[aria-expanded="true"] svg { transform: rotate(180deg); }

    .al-explainer-body { display: none; padding: 1rem 1.25rem 1.25rem; border-top: 1px solid #d0d8e0; }
    .al-explainer-body h3 { font-size: .9rem; font-weight: 700; margin: 1rem 0 .25rem; color: #0f1923; }
    .al-explainer-body h3:first-child { margin-top: 0; }
    .al-explainer-body p  { font-size: .875rem; margin: 0 0 .3rem; line-height: 1.55; color: #0f1923; }

    .hc-disclaimer { margin-top: 1.5rem; padding: .9rem 1.1rem; background: #b8d9f0; border: 1px solid #5da8d8; border-radius: 10px; font-size: .8rem; line-height: 1.5; }
    .hc-disclaimer p { color: #0f1923; margin: 0; font-weight: 600; }

    /* ── Card-scoped overrides ───────────────────────────── */
    .al-card label,
    .al-check span,
    .al-dish-name,
    .al-section-title,
    .al-matrix td,
    .al-legend,
    .al-explainer-body p,
    .al-explainer-body h3,
    .al-explainer-head,
    .hc-disclaimer p { color: #0f1923 !important; }

    .al-results-header h2 { color: #ffffff !important; }
    .al-results-header p  { color: #b8d0e8 !important; }

    @media (max-width: 640px) {
        .al-dish-name { flex: 0 0 100%; }
    }

    @media print {
        nav, header, footer, .al-add-btn, .al-run-btn, .al-del-btn, .al-explainer, .hc-disclaimer, .al-card:first-of-type { display: none !important; }
        .al-results-header { background: #2d3f52 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
        .al-check input { display: none; }
    }