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

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

    .me-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);
    }

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

    /* ── Table ───────────────────────────────────────────── */
    .me-table {
        width: 100%;
        border-collapse: collapse;
        font-size: .875rem;
        margin-bottom: .85rem;
    }

    .me-table th {
        background: #2d3f52;
        color: #ffffff;
        padding: .6rem .7rem;
        text-align: left;
        font-size: .78rem;
        font-weight: 700;
        white-space: nowrap;
    }

    .me-table th:first-child { border-radius: 8px 0 0 0; }
    .me-table th:last-child  { border-radius: 0 8px 0 0; }

    .me-table td {
        padding: .45rem .55rem;
        border-bottom: 1px solid #d0d8e0;
        vertical-align: middle;
        color: #0f1923;
    }

    .me-table tr:last-child td { border-bottom: none; }
    .me-table tr:nth-child(even) td { background: #f0f4f8; }

    .me-table input {
        padding: .4rem .55rem;
        font-size: .82rem;
        border: 1.5px solid #b0bcc8;
        border-radius: 6px;
        background: #ffffff;
        color: #0f1923;
        width: 100%;
        transition: border-color .15s;
    }

    .me-table input:focus { outline: none; border-color: #005fa3; }

    .col-name { min-width: 140px; }
    .col-gp   { width: 90px; }
    .col-sold { width: 90px; }
    .col-del  { width: 38px; text-align: center; }

    /* ── Buttons ─────────────────────────────────────────── */
    .me-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;
    }

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

    .me-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);
    }

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

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

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

    /* ── Results header ──────────────────────────────────── */
    .me-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);
    }

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

    /* ── Category cards ──────────────────────────────────── */
    .me-categories {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .me-cat {
        border-radius: 10px;
        padding: 1rem 1.25rem;
        border: 1px solid #d0d8e0;
        background: #ffffff;
    }

    .me-cat.star   { border-top: 4px solid #3d9a5a; background: #f0faf4; }
    .me-cat.horse  { border-top: 4px solid #5da8d8; background: #f0f7fd; }
    .me-cat.puzzle { border-top: 4px solid #b07800; background: #fffbf0; }
    .me-cat.dog    { border-top: 4px solid #b03030; background: #fff5f5; }

    .me-cat-title {
        font-size: .9rem;
        font-weight: 700;
        margin: 0 0 .5rem;
        color: #0f1923;
    }

    .me-cat-desc {
        font-size: .78rem;
        font-weight: 600;
        color: #0f1923;
        margin: 0 0 .6rem;
        line-height: 1.4;
    }

    .me-dish-pill {
        display: inline-block;
        margin: .2rem .2rem 0 0;
        padding: .2rem .65rem;
        font-size: .78rem;
        font-weight: 700;
        border-radius: 999px;
        color: #0f1923;
        background: #ffffff;
        border: 1.5px solid #b0bcc8;
    }

    /* ── Results table ───────────────────────────────────── */
    .me-res-table {
        width: 100%;
        border-collapse: collapse;
        font-size: .85rem;
        margin-top: .5rem;
    }

    .me-res-table th {
        background: #2d3f52;
        color: #ffffff;
        padding: .55rem .7rem;
        text-align: left;
        font-size: .78rem;
        font-weight: 700;
    }

    .me-res-table th:first-child { border-radius: 6px 0 0 0; }
    .me-res-table th:last-child  { border-radius: 0 6px 0 0; }

    .me-res-table td {
        padding: .5rem .7rem;
        border-bottom: 1px solid #d0d8e0;
        color: #0f1923;
        font-weight: 600;
    }

    .me-res-table tr:last-child td { border-bottom: none; }
    .me-res-table tr:nth-child(even) td { background: #f0f4f8; }

    .cat-badge {
        display: inline-block;
        font-size: .72rem;
        font-weight: 700;
        padding: .15rem .55rem;
        border-radius: 999px;
        color: #0f1923;
    }

    .cat-badge.star   { background: #a8d8b8; border: 1px solid #3d9a5a; }
    .cat-badge.horse  { background: #b8d9f0; border: 1px solid #5da8d8; }
    .cat-badge.puzzle { background: #f0d080; border: 1px solid #b07800; }
    .cat-badge.dog    { background: #f5c0c0; border: 1px solid #b03030; }

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

    .me-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;
    }

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

    .me-explainer-body {
        display: none;
        padding: 1rem 1.25rem 1.25rem;
        border-top: 1px solid #d0d8e0;
    }

    .me-explainer-body h3 { font-size: .9rem; font-weight: 700; margin: 1rem 0 .25rem; color: #0f1923; }
    .me-explainer-body h3:first-child { margin-top: 0; }
    .me-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 ───────────────────────────── */
    .me-card label,
    .me-card .me-section-title,
    .me-table td,
    .me-table input,
    .me-cat-title,
    .me-cat-desc,
    .me-dish-pill,
    .me-res-table td,
    .me-explainer-body p,
    .me-explainer-body h3,
    .me-explainer-head,
    .hc-disclaimer p { color: #0f1923 !important; }

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

    @media (max-width: 600px) {
        .me-categories { grid-template-columns: 1fr; }
        .col-sold { display: none; }
    }

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