:root {
    /* The ground is a warm terracotta wash: barely tinted at the top so the sticky
       white header still reads as white, deepening towards the foot of the screen.
       --bg is the flat fallback wherever the gradient cannot be painted. */
    --bg: #f9f1ec;
    --bg-top: #fdf8f5;
    --bg-bottom: #f1dccf;

    --surface: #ffffff;
    /* Warmed to match: the old green-grey neutrals turned muddy against terracotta. */
    --surface-alt: #f7f0ea;
    --border: #e7dbd2;
    --text: #1d2620;
    --text-muted: #66756c;
    --accent: #2f7d55;
    --accent-soft: #e4f1ea;
    --warn: #9a5b12;
    --warn-soft: #fdf1e0;
    --protein: #2f7d55;
    --carb: #b7791f;
    --fat: #7c5cbf;
    --fiber: #2a6f97;

    /* Sampled from the logo: the wordmark green and the warm tone in the S. Used for
       brand chrome only — the functional greens above still mean "protein". */
    --brand-dark: #303c30;
    --brand-warm: #d8480c;
}

body {
    background-color: var(--bg);
    background-image: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    background-repeat: no-repeat;
    /* Anchored to the viewport rather than the document, so a long page keeps the
       same wash from top to bottom instead of stretching it over its whole height. */
    background-attachment: fixed;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ------------------------------------------------------------------ chrome */

.app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .75rem 0;
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: .8rem;
    letter-spacing: .02em;
}

.app-nav {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
}

.app-nav a {
    padding: .4rem .8rem;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .93rem;
    font-weight: 500;
}

.app-nav a:hover { background: var(--surface-alt); color: var(--text); }
.app-nav a.active { background: var(--accent-soft); color: var(--accent); }

main { flex: 1 0 auto; }

.app-footer {
    margin-top: 3rem;
    padding: 1.5rem 0 2rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: .85rem;
}

/* ------------------------------------------------------------------- cards */

.card-plain {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.section-title {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: .6rem;
}

/* ------------------------------------------------------------------ targets */

.target-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: .75rem;
}

.target {
    background: var(--surface-alt);
    border-radius: 10px;
    padding: .75rem .9rem;
}

.target .value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.target .label { font-size: .78rem; color: var(--text-muted); }
.target .sub { font-size: .72rem; color: var(--text-muted); }

.target.protein { border-left: 3px solid var(--protein); }
.target.energy { border-left: 3px solid var(--carb); }
.target.fiber { border-left: 3px solid var(--fiber); }
.target.fat { border-left: 3px solid var(--fat); }
.target.water { border-left: 3px solid #3b8ea5; }

/* --------------------------------------------------------------- week grid */

.week-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(7, minmax(190px, 1fr));
    overflow-x: auto;
    padding-bottom: .5rem;
}

.day-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .75rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.day-head { border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.day-head .name { font-weight: 700; }
.day-head .date { font-size: .78rem; color: var(--text-muted); }

.meal {
    background: var(--surface-alt);
    border-radius: 9px;
    padding: .5rem .6rem;
}

.meal .slot {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    font-weight: 600;
}

.meal .name {
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.25;
    display: block;
    color: var(--text);
    text-decoration: none;
}

.meal .name:hover { color: var(--accent); text-decoration: underline; }

.meal .macros { font-size: .74rem; color: var(--text-muted); margin-top: .2rem; }
.meal .portion { font-size: .72rem; color: var(--accent); font-weight: 600; }

.btn-swap {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: .72rem;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

.btn-swap:hover { color: var(--accent); }

.day-total {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: .5rem;
    font-size: .78rem;
    color: var(--text-muted);
}

.day-total strong { color: var(--text); }

/* ------------------------------------------------------------------- chips */

.chip {
    display: inline-block;
    padding: .12rem .5rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    background: var(--surface-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.chip.gentle { background: #eaf4fb; color: #1f5f86; border-color: #cfe4f2; }
.chip.vegan { background: #e8f5ea; color: #276b33; border-color: #cfe6d4; }
.chip.veg { background: #f0f5e8; color: #4c6b23; border-color: #dee9cc; }
.chip.fish { background: #eaf1fb; color: #29508a; border-color: #d3e0f3; }
.chip.high-protein { background: var(--accent-soft); color: var(--accent); border-color: #cbe4d7; }

/* ----------------------------------------------------------------- notices */

.notice {
    border-radius: 10px;
    padding: .8rem 1rem;
    font-size: .9rem;
    border: 1px solid var(--border);
    background: var(--surface-alt);
}

.notice.warn { background: var(--warn-soft); border-color: #f0dcbd; color: var(--warn); }

.guidance li { margin-bottom: .55rem; }

/* ---------------------------------------------------------------- shopping */

.shop-cat { break-inside: avoid; margin-bottom: 1.5rem; }

.shop-line {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: .35rem 0;
    border-bottom: 1px dashed var(--border);
}

.shop-line .qty { margin-left: auto; color: var(--text-muted); font-size: .88rem; white-space: nowrap; }
.shop-line input { margin-right: .1rem; }

.shop-columns { columns: 2; column-gap: 2rem; }

@media (max-width: 768px) {
    .shop-columns { columns: 1; }
}

/* ------------------------------------------------------------------- print */

.print-sheet { color: #000; background: #fff; }

@media print {
    .app-header, .app-footer, .no-print { display: none !important; }
    body { background: #fff; background-image: none; }
    .print-sheet { font-size: 10.5pt; }
    .week-grid { grid-template-columns: repeat(7, 1fr); overflow: visible; }
    .day-col { break-inside: avoid; border: 1px solid #bbb; }
    .meal { background: #f4f4f4; }
    a { color: #000; text-decoration: none; }
}

/* ---------------------------------------------------------------- language */

.lang-form { margin: 0; }

.lang-select {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: 8px;
    padding: .35rem 1.6rem .35rem .6rem;
    font-size: .88rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2366756c' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .4rem center;
    background-size: 14px;
}

.lang-select:hover { color: var(--text); border-color: var(--text-muted); }



/* ------------------------------------------------------------- local stock */

.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: .15rem .9rem;
}

.stock-item {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .28rem .35rem;
    border-radius: 7px;
    cursor: pointer;
    font-size: .9rem;
}

.stock-item:hover { background: var(--surface-alt); }
.stock-item input { flex: none; }
.stock-name { flex: 1 1 auto; }

/* How many recipes stop working without it — the cost of unticking the box. */
.stock-count {
    flex: none;
    font-size: .72rem;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: 999px;
    padding: .05rem .4rem;
    min-width: 1.5rem;
    text-align: center;
}

.stock-item input:not(:checked) ~ .stock-name {
    color: var(--text-muted);
    text-decoration: line-through;
}

.blocked-list { max-height: 340px; overflow-y: auto; }

.blocked-item {
    padding: .4rem 0;
    border-bottom: 1px dashed var(--border);
}

.blocked-item:last-child { border-bottom: none; }

.row-unavailable { opacity: .55; }

.chip.ai { background: #efe9fb; color: #5b3fa8; border-color: #ded3f4; }

.gen-panel { border-left: 3px solid #7c5cbf; }

.rejection-list {
    max-height: 200px;
    overflow-y: auto;
    font-size: .84rem;
    color: var(--text-muted);
}

.rejection-list div { padding: .25rem 0; border-bottom: 1px dashed var(--border); }
.rejection-list div:last-child { border-bottom: none; }

/* -------------------------------------------------------- product scanning */

.scan-panel { border-left: 3px solid #2a6f97; }

.scan-video {
    width: 100%;
    max-height: 320px;
    background: #000;
    border-radius: 10px;
    object-fit: cover;
}

.coverage-bar {
    height: 8px;
    background: var(--surface-alt);
    border-radius: 999px;
    overflow: hidden;
}

.coverage-bar span {
    display: block;
    height: 100%;
    background: var(--protein);
    border-radius: 999px;
}

.chip.measured { background: var(--accent-soft); color: var(--accent); border-color: #cbe4d7; }

.scan-stage { position: relative; }

/* Shows where to hold the barcode; decoding still uses the whole frame. */
.scan-reticle {
    position: absolute;
    left: 10%;
    right: 10%;
    top: 38%;
    height: 24%;
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28);
    pointer-events: none;
}

/* --------------------------------------------------------------- sign-in */

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: .6rem 1.2rem;
    font-weight: 600;
    color: var(--text);
}

.btn-google:hover { background: var(--surface-alt); border-color: var(--text-muted); }

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    color: var(--text-muted);
}

.btn-signout {
    border: none;
    background: none;
    padding: 0;
    font-size: .85rem;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
}

.btn-signout:hover { color: var(--text); }

.signin-off {
    text-decoration: none;
    border: 1px dashed var(--border);
    border-radius: 999px;
    padding: .2rem .6rem;
}

.signin-off:hover { border-color: var(--text-muted); color: var(--text); }

/* --------------------------------------------------------------- phone layout */

@media (max-width: 640px) {
    /* Seven side-by-side days is a horizontal scroll on a phone. Stacking them makes
       the week a normal vertical read, which is how it gets used away from a desk. */
    .week-grid {
        grid-template-columns: 1fr;
        overflow-x: visible;
    }

    .day-col { padding: .9rem; }

    /* Comfortable tap targets for a list worked through in a shop. */
    .shop-line { padding: .6rem 0; }
    .shop-line input[type="checkbox"] { width: 1.15rem; height: 1.15rem; }

    .stock-grid { grid-template-columns: 1fr; }
    .stock-item { padding: .5rem .35rem; }

    .app-header { padding: .5rem 0; }
    .brand span:last-child { font-size: 1rem; }

    .target-grid { grid-template-columns: repeat(auto-fit, minmax(46%, 1fr)); }

    .scan-video { max-height: 46vh; }

    /* Full-width buttons are easier to hit than a row of small ones. */
    .scan-panel .btn-sm { flex: 1 1 auto; }
}

/* Installed as an app there is no browser chrome, so the header needs to clear the
   status bar on devices that report a safe area. */
@media (display-mode: standalone) {
    .app-header { padding-top: calc(.75rem + env(safe-area-inset-top)); }
    body { padding-bottom: env(safe-area-inset-bottom); }
}


/* ------------------------------------------------------------------ brand mark */

.brand-logo {
    height: 65px;
    width: auto;
    display: block;
}

.brand-mark-lg {
    height: 85px;
    width: auto;
    display: block;
    margin-inline: auto;
}

/* The wordmark is dark green, so the active navigation item picks it up rather than
   sitting at a green that no longer appears in the identity. */
.app-nav a.active { background: var(--surface-alt); color: var(--brand-dark); }

.signin-off:hover { color: var(--brand-dark); }

@media (max-width: 640px) {
    .brand-logo { height: 52px; }
}


/* -------------------------------------------------------------- header layout */

.header-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-collapse {
    width: 100%;
    align-items: center;
    gap: 1rem;
}

/* The three stripes. Hidden from large screens up, where the menu is a row again. */
.nav-toggle {
    margin-left: auto;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--brand-dark);
    border-radius: 2px;
}

.nav-toggle:hover { border-color: var(--text-muted); }

@media (min-width: 992px) {
    .nav-toggle { display: none; }
    .header-collapse { width: auto; margin-left: auto; }
}

/* Below that the menu opens as a stacked list with targets big enough for a thumb. */
@media (max-width: 991.98px) {
    .header-collapse { flex-direction: column; align-items: stretch; gap: 0; }

    .app-nav {
        flex-direction: column;
        width: 100%;
        gap: .15rem;
        margin: .5rem 0 0;
    }

    .app-nav a {
        padding: .75rem .85rem;
        font-size: 1rem;
        border-radius: 9px;
    }

    .header-tools {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        flex-wrap: wrap;
        width: 100%;
        margin-top: .6rem;
        padding-top: .75rem;
        border-top: 1px solid var(--border);
    }

    .user-chip { max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
    .lang-select { padding-block: .5rem; }
}

@media (min-width: 992px) {
    .header-tools { display: flex; align-items: center; gap: 1rem; }
}


/* ------------------------------------------------------------ to-try workflow */

.chip.totry { background: #fdf1e0; color: #9a5b12; border-color: #f0dcbd; }

.recipe-tabs .nav-link {
    color: var(--text-muted);
    border-radius: 9px;
    padding: .45rem .95rem;
}

.recipe-tabs .nav-link.active {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--brand-dark);
    font-weight: 600;
}

.recipe-tabs .badge {
    background: var(--brand-warm);
    color: #fff;
    font-size: .7rem;
    margin-left: .35rem;
}


/* ------------------------------------------------------------ ratings and notes */

.star-picker { display: flex; gap: .15rem; }

.star {
    border: none;
    background: none;
    padding: 0 .1rem;
    font-size: 1.9rem;
    line-height: 1;
    color: var(--border);
    cursor: pointer;
}

.star.on { color: #e0a32e; }

/* Hovering fills the star under the pointer and every one before it, so the
   click target reads the way a star rating is expected to. */
.star-picker:hover .star { color: #e0a32e; }
.star-picker .star:hover ~ .star { color: var(--border); }

.stars-read { color: #e0a32e; letter-spacing: .04em; }

.rating-summary { display: flex; align-items: baseline; gap: .5rem; font-size: .9rem; }

.comment-list { max-height: 26rem; overflow-y: auto; }

.comment {
    padding: .6rem 0;
    border-bottom: 1px dashed var(--border);
}

.comment:last-child { border-bottom: none; }

.comment-body { white-space: pre-wrap; font-size: .92rem; margin-top: .15rem; }


/* ------------------------------------------------------------------------ photos */

.recipe-photo {
    display: block;
    width: 100%;
    border-radius: 10px;
    /* A dish photo is looked at, not studied: a fixed frame keeps the column tidy
       whatever shape the phone took it in. */
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--surface-alt);
}

.recipe-thumb {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 6px;
    object-fit: cover;
    flex: 0 0 auto;
}


/* An ingredient the product register cannot account for. */
.no-data {
    color: #d08b2c;
    font-size: .7rem;
    cursor: help;
}


/* ------------------------------------------------------- weight and forecast */

.weight-chart {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.chart-actual {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linejoin: round;
}

/* Dashed because it has not happened: the eye should not read it as record. */
.chart-predicted {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}

.chart-goal {
    stroke: var(--carb);
    stroke-width: 1;
    stroke-dasharray: 2 4;
}

.chart-point { fill: var(--accent); }

.chart-label {
    fill: var(--text-muted);
    font-size: 10px;
}

.chart-key {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: .6rem;
    font-size: .85rem;
    color: var(--text-muted);
}

.chart-key i {
    display: inline-block;
    width: 1.1rem;
    height: 0;
    margin-right: .3rem;
    vertical-align: middle;
    border-top-width: 2px;
    border-top-style: solid;
}

.chart-key .key-actual { border-color: var(--accent); }
.chart-key .key-predicted { border-top-style: dashed; border-color: var(--text-muted); }
.chart-key .key-goal { border-top-style: dashed; border-color: var(--carb); }


/* ------------------------------------------------------------------- journey */

.journey-head {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    margin-bottom: .5rem;
}

.journey-percent {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
}

.journey-bar {
    position: relative;
    height: 14px;
    border-radius: 7px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    overflow: hidden;
}

.journey-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 7px 0 0 7px;
    transition: width .4s ease;
}

/* Quarter marks, so the bar reads as a route with staging posts. */
.journey-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--surface);
    opacity: .7;
}

.journey-ends {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .3rem;
}

.journey-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
    margin-top: 1rem;
    text-align: center;
}

.journey-stats .value {
    font-size: 1.15rem;
    font-weight: 600;
}

.journey-stats .label {
    font-size: .75rem;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .journey-stats { grid-template-columns: repeat(2, 1fr); }
}

.journey-next {
    padding: .55rem .7rem;
    border-radius: 8px;
    background: var(--accent-soft);
    font-size: .92rem;
}


/* ---------------------------------------------------------------- collections */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: .5rem;
}

.tab {
    padding: .35rem .8rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: .92rem;
    border: 1px solid transparent;
}

.tab:hover { background: var(--surface-alt); color: var(--text); }

.tab.on {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: #cbe4d7;
    font-weight: 600;
}

.tab-count {
    font-size: .78rem;
    opacity: .7;
    margin-left: .15rem;
}

/* Taken out of the cookbook, but still listed so it can be put back. */
.row-excluded { opacity: .45; }


/* An invitation follows the person around the app until they answer it. */
.invite-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .8rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #cbe4d7;
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    background: var(--accent-soft);
}

.invite-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}


/* -------------------------------------------------------------- who gets what */

.portions {
    padding: .6rem .8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-alt);
    margin-bottom: 1rem;
}

.portions-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: .4rem;
}

.portions-people {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.portion-chip {
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: .88rem;
}

.portion-chip .how-much {
    font-weight: 700;
    color: var(--accent);
}

/* The amount for the whole table, beside the one-portion figure. */
.qty-household {
    display: inline-block;
    margin-left: .5rem;
    padding: 0 .35rem;
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}


/* ------------------------------------------------------------------- the plate */

/* Six hues in a fixed order, never cycled: a seventh person shares one last slice
   rather than borrowing a colour already meaning somebody else. Validated for
   colour-vision separation against a white card; the written ratios beside the
   plate are what the lighter fills lean on rather than contrast alone. */
:root {
    --slice-1: #2a78d6;
    --slice-2: #eb6834;
    --slice-3: #1baf7a;
    --slice-4: #eda100;
    --slice-5: #e87ba4;
    --slice-6: #008300;
    --slice-rest: #8b8378;
}

.plate-figure {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
}

.plate {
    width: 168px;
    height: 168px;
    flex: 0 0 auto;
}

/* Porcelain: a rim a shade off the card, and a well the food sits in. */
.plate-rim {
    fill: #f7f2ec;
    stroke: #e2d6c9;
    stroke-width: 1.5;
}

.plate-well {
    fill: #fffdfb;
    stroke: #ece0d4;
    stroke-width: 1;
}

/* The gap between servings is the plate showing through. */
.slice {
    stroke: #fffdfb;
    stroke-width: 2;
    stroke-linejoin: round;
}

.slice-1 { fill: var(--slice-1); }
.slice-2 { fill: var(--slice-2); }
.slice-3 { fill: var(--slice-3); }
.slice-4 { fill: var(--slice-4); }
.slice-5 { fill: var(--slice-5); }
.slice-6 { fill: var(--slice-6); }
.slice-rest { fill: var(--slice-rest); }

.plate-key {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    font-size: .9rem;
}

.plate-key li {
    display: flex;
    align-items: baseline;
    gap: .45rem;
}

.plate-key .swatch {
    width: .7rem;
    height: .7rem;
    border-radius: 3px;
    flex: 0 0 auto;
    align-self: center;
}

.plate-key .how-much {
    font-weight: 700;
    /* Text keeps text colour; the swatch beside it carries the identity. */
    color: var(--text);
}

.swatch-1 { background: var(--slice-1); }
.swatch-2 { background: var(--slice-2); }
.swatch-3 { background: var(--slice-3); }
.swatch-4 { background: var(--slice-4); }
.swatch-5 { background: var(--slice-5); }
.swatch-6 { background: var(--slice-6); }
.swatch-rest { background: var(--slice-rest); }


/* ----------------------------------------------------------------- user menu */

.user-menu .user-chip {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 999px;
    padding: .3rem .7rem;
    cursor: pointer;
    font-size: .88rem;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.user-menu .user-chip:hover { border-color: var(--text-muted); }

.user-menu .user-chip.active {
    background: var(--accent-soft);
    border-color: #cbe4d7;
    color: var(--accent);
    font-weight: 600;
}

.user-name {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu .caret { font-size: .7rem; opacity: .6; }

.user-menu .dropdown-menu {
    border-color: var(--border);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    padding: .3rem;
}

.user-menu .dropdown-item {
    border-radius: 7px;
    font-size: .9rem;
    /* The sign-out is a form button; give it the same shape as the links. */
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
}

.user-menu .dropdown-item.active {
    background: var(--accent-soft);
    color: var(--accent);
}

/* Which account, under the name: a display name does not say which login it is. */
.signed-as {
    display: block;
    font-size: .78rem;
    color: var(--text-muted);
    padding: .1rem .75rem .3rem;
}


/* An item somebody in the household has already picked up. */
.shop-line.bought {
    opacity: .5;
}

.shop-line.bought > span:not(.qty) {
    text-decoration: line-through;
}
