/* ==========================================================================
   Events Split View
   ========================================================================== */
.events-split-view {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    min-height: 520px;
}

/* Price comparison, two labelled columns.
   The container this replaces had a fill, a border and a rounded corner, which
   is the exact recipe for a disabled text input - so it read as one, despite
   nothing in it being editable. A hairline divider separates the figures from
   the name without claiming to be a control. */
.proc-price-cols {
    /* Two equal halves rather than content-sized, so the labels sit at the
       same place on every row regardless of how long the figures are. */
    /* `minmax(0, 1fr)`, not `1fr`: the latter is `minmax(auto, 1fr)`, so a
       long figure still stretches its own track and the two halves stop being
       halves. Measured 44/71 against 53/62 before this. */
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center; gap: 14px;
    padding-right: 16px; border-right: 1px solid var(--border-color);
}
.proc-price-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
/* Right-aligned so the decimal points line up down each column; tabular
   figures alone equalise digit width, not digit count. */
.proc-price-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; text-align: right; }
/* Tabular figures so the two columns line up on the decimal rather than
   drifting with the digits. */
.proc-price-val {
    font-size: 14.5px; font-weight: 700; color: var(--text-secondary);
    font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right;
}
.proc-price-val.was { color: var(--text-muted); text-decoration: line-through; }
.proc-price-val.good { color: #047857; }
.proc-price-val.bad { color: var(--danger-color, #dc2626); }

@media (max-width: 900px) {
    /* Narrower tracks rather than content-sized ones, so the alignment holds
       at every width instead of only the widest. */
    .proc-radar-row { grid-template-columns: minmax(0, 1fr) 160px 112px; gap: 12px; }
    .proc-price-cols { gap: 10px; padding-right: 12px; }
    .proc-price-label { font-size: 10.5px; }
    .proc-price-val { font-size: 13.5px; }
}

@media (max-width: 620px) {
    /* Below this the three tracks cannot coexist, so the row stacks and the
       divider goes with it - a vertical rule beside nothing is just a line. */
    .proc-radar-row { grid-template-columns: 1fr; gap: 10px; }
    .proc-price-cols { border-right: none; padding-right: 0; justify-items: start; }
    .proc-price-label, .proc-price-val { text-align: right; }
}

.analysis-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
    overflow: hidden;
}

/* Event Group Checkbox Chips & Badges */
.event-group-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.event-group-chip .eg-checkbox {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1.5px solid var(--border-color, rgba(255, 255, 255, 0.25));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input, rgba(255, 255, 255, 0.05));
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.event-group-chip .eg-checkbox svg {
    display: none;
    color: #ffffff;
}
.event-group-chip .eg-checkbox.checked {
    background: var(--primary-color, #3b82f6);
    border-color: var(--primary-color, #3b82f6);
}
.event-group-chip .eg-checkbox.checked svg {
    display: block;
}
.event-group-chip.inactive {
    opacity: 0.55;
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-muted);
}
.event-group-chip.inactive:hover {
    opacity: 0.85;
    background: var(--bg-input);
    color: var(--text-primary);
}
.event-group-chip.active {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.4);
    color: var(--text-primary);
}
.dark-theme .event-group-chip.active {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.45);
    color: #f1f5f9;
}
.event-group-chip .eg-chip-count {
    font-size: 11px;
    opacity: 0.8;
    font-variant-numeric: tabular-nums;
}
.event-group-badge {
    transition: transform 0.15s ease;
}
.event-inbox-card:hover .event-group-badge {
    transform: scale(1.03);
}

@media (max-width: 768px) {
    .proc-cat-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .proc-cat-tile {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        min-height: 56px;
        padding: 12px 16px;
        gap: 16px;
    }
    .proc-cat-icon {
        flex: 0 0 auto;
    }
    .proc-cat-icon svg {
        width: 20px !important;
        height: 20px !important;
    }
    .proc-cat-label {
        font-size: 15px;
        text-align: right;
    }
}


/* UNIT MIGRATION -----------------------------------------------------------
   The one-time screen that moves every product off a free-text unit.

   NOT opened with a `/* ===` banner on purpose. split-css.mjs treats those as
   cut points, and adding one here re-partitioned the file, renamed a part and
   left index.html linking a stylesheet that no longer existed. A section that
   must not move a cut point uses this comment style instead.

   Laid out as one block per product rather than a table row: each of the three
   choices carries a price basis AND the resulting dish cost, which is three
   lines per option. A table would truncate them or scroll sideways, and the
   whole value of this screen is that the consequence of a choice is readable
   before it is made. */
.dup-page-body { max-width: 1400px; }
.dup-page-body .dup-compare { overflow-x: auto; }
.dup-page-body .dup-compare table { width: 100%; min-width: 640px; }
.vat-panel {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 16px;
    background: var(--bg-surface);
}
.vat-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.vat-panel-head h4 { margin: 0; font-size: 15px; }
.vat-sub { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.vat-periods { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.vat-period {
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-solid);
    color: var(--text-muted);
    cursor: pointer;
}
.vat-period.is-on { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.vat-figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 8px; }
.vat-figure {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
}
.vat-figure-primary { border-color: rgba(139, 92, 246, 0.45); background: rgba(139, 92, 246, 0.1); }
.vat-figure-label { font-size: 11px; color: var(--text-muted); }
.vat-figure-value { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.vat-coverage { margin: 0; font-size: 11px; color: var(--text-muted); }
.vat-excluded {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.1);
}
.vat-excluded p { margin: 4px 0 8px; font-size: 12px; color: var(--text-muted); line-height: 1.55; }
.vat-excluded ul { margin: 0; padding-inline-start: 16px; font-size: 12px; }
.vat-excluded li { margin-bottom: 4px; color: var(--text-muted); }
.vat-excluded-link {
    font: inherit;
    font-weight: 600;
    color: var(--text-primary);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    margin-inline-end: 6px;
}
.vat-supplier-table { width: 100%; margin-top: 14px; font-size: 12px; border-collapse: collapse; }
.vat-supplier-table th, .vat-supplier-table td { padding: 6px 8px; text-align: start; border-bottom: 1px solid var(--border-color); }
.vat-supplier-table td:not(:first-child) { font-variant-numeric: tabular-nums; }
.receipt-hint-excluded { color: #d97706; }
@media (max-width: 640px) {
    .vat-figures { grid-template-columns: 1fr; }
}
/* ══════════════════════════════════════════════════════════════════════
   INVENTORY CATEGORY CUSTOM DROPDOWN (Luxury Glassmorphism & Fast RTL)
   ══════════════════════════════════════════════════════════════════════ */
.inv-cat-dropdown-wrap {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    z-index: 5;
}
.inv-cat-dropdown-wrap.is-open {
    z-index: 1000;
}

/* Category Pill Button Trigger */
.inv-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    min-height: 28px;
    border-radius: 9999px;
    background: var(--bg-input, rgba(255, 255, 255, 0.05));
    color: var(--text-primary, #f1f5f9);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.inv-cat-pill:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.08));
    border-color: rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.inv-cat-dropdown-wrap.is-open .inv-cat-pill,
.inv-cat-pill:focus-visible {
    outline: none;
    border-color: #3b82f6;
    background: var(--bg-hover, rgba(255, 255, 255, 0.1));
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.inv-cat-pill.is-uncategorized {
    border-color: rgba(148, 163, 184, 0.4);
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.08);
}
.dark-theme .inv-cat-pill.is-uncategorized {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.35);
}
.inv-cat-pill.is-uncategorized:hover {
    border-color: rgba(148, 163, 184, 0.65);
    background: rgba(148, 163, 184, 0.18);
}

.inv-cat-pill.is-produce {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.45);
}
.dark-theme .inv-cat-pill.is-produce {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
}
.inv-cat-pill.is-produce:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.7);
}

.inv-cat-pill.is-dairy {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.45);
}
.dark-theme .inv-cat-pill.is-dairy {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
}
.inv-cat-pill.is-dairy:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.7);
}

.inv-cat-pill.is-meat {
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.45);
}
.dark-theme .inv-cat-pill.is-meat {
    color: #fb7185;
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.5);
}
.inv-cat-pill.is-meat:hover {
    background: rgba(244, 63, 94, 0.22);
    border-color: rgba(244, 63, 94, 0.7);
}

.inv-cat-pill.is-bakery {
    color: #d97706;
    background: rgba(217, 119, 6, 0.12);
    border-color: rgba(217, 119, 6, 0.45);
}
.dark-theme .inv-cat-pill.is-bakery {
    color: #f59e0b;
    background: rgba(217, 119, 6, 0.16);
    border-color: rgba(217, 119, 6, 0.5);
}
.inv-cat-pill.is-bakery:hover {
    background: rgba(217, 119, 6, 0.24);
    border-color: rgba(217, 119, 6, 0.75);
}

.inv-cat-pill.is-pantry {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.45);
}
.dark-theme .inv-cat-pill.is-pantry {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
}
.inv-cat-pill.is-pantry:hover {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(59, 130, 246, 0.7);
}

.inv-cat-pill.is-beverages {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.45);
}
.dark-theme .inv-cat-pill.is-beverages {
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.5);
}
.inv-cat-pill.is-beverages:hover {
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(139, 92, 246, 0.7);
}

.inv-cat-pill.is-packaging {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.45);
}
.dark-theme .inv-cat-pill.is-packaging {
    color: #22d3ee;
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.5);
}
.inv-cat-pill.is-packaging:hover {
    background: rgba(6, 182, 212, 0.22);
    border-color: rgba(6, 182, 212, 0.7);
}

.inv-cat-pill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}
.inv-cat-pill-icon svg {
    width: 14px;
    height: 14px;
}

.inv-cat-pill-label {
    font-size: 11.5px;
    line-height: 1;
}

.inv-cat-pill-chevron {
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.65;
    margin-right: 1px;
}
.inv-cat-dropdown-wrap.is-open .inv-cat-pill-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Category Dropdown Popover Menu */
.inv-cat-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 210px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 14px 34px -4px rgba(0, 0, 0, 0.2), 0 6px 14px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    animation: invCatFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    direction: rtl;
    text-align: right;
}
.dark-theme .inv-cat-menu {
    background: rgba(17, 24, 39, 0.96);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 8px 16px rgba(0, 0, 0, 0.4);
}

@keyframes invCatFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.inv-cat-menu-header {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    padding: 6px 10px 4px 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.dark-theme .inv-cat-menu-header {
    color: #94a3b8;
}

.inv-cat-menu-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.inv-cat-divider {
    height: 1px;
    background: var(--border-color, rgba(255, 255, 255, 0.08));
    margin: 4px 0;
}

.inv-cat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #1e293b;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: right;
}
.dark-theme .inv-cat-item {
    color: #e2e8f0;
}
.inv-cat-item:hover {
    background: rgba(0, 0, 0, 0.05);
}
.dark-theme .inv-cat-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.inv-cat-item.is-selected {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    font-weight: 700;
}
.dark-theme .inv-cat-item.is-selected {
    background: rgba(59, 130, 246, 0.22);
    color: #60a5fa;
}

.inv-cat-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.inv-cat-item:hover .inv-cat-item-icon {
    transform: scale(1.08);
}
.inv-cat-item-icon svg {
    width: 15px;
    height: 15px;
}

/* Category Specific Vibrant Color Accents */
.inv-cat-item-icon.produce { color: #10b981; background: rgba(16, 185, 129, 0.14); }
.inv-cat-item-icon.dairy { color: #f59e0b; background: rgba(245, 158, 11, 0.14); }
.inv-cat-item-icon.meat { color: #f43f5e; background: rgba(244, 63, 94, 0.14); }
.inv-cat-item-icon.bakery { color: #d97706; background: rgba(217, 119, 6, 0.14); }
.inv-cat-item-icon.pantry { color: #3b82f6; background: rgba(59, 130, 246, 0.14); }
.inv-cat-item-icon.beverages { color: #8b5cf6; background: rgba(139, 92, 246, 0.14); }
.inv-cat-item-icon.packaging { color: #06b6d4; background: rgba(6, 182, 212, 0.14); }
.inv-cat-item-icon.none { color: #94a3b8; background: rgba(148, 163, 184, 0.14); }

.inv-cat-item-label {
    flex: 1;
    white-space: nowrap;
}

.inv-cat-check {
    margin-right: auto;
    color: #2563eb;
    flex-shrink: 0;
}
.dark-theme .inv-cat-check {
    color: #60a5fa;
}

.inv-cat-control { display: inline-flex; align-items: center; gap: 5px; }
.cat-select {
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    max-width: 150px;
}
.cat-select:hover { border-color: rgba(139, 92, 246, 0.5); }
.cat-select-unset { border-color: rgba(245, 158, 11, 0.55); color: var(--text-muted); }
.cat-mig-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cat-mig-row .cat-select { font-size: 13px; padding: 6px 12px; max-width: 220px; }
.inv-cat-fixall {
    margin-top: 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    cursor: pointer;
}
.unit-pill {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg-solid);
    vertical-align: middle;
}
/* A product whose unit nobody has set yet.
 *
 * This was a full amber ring at 55% around the whole control. Before the unit
 * migration runs, EVERY row is unset - 189 of 216 on the real inventory - so
 * the table came out ringed in amber from top to bottom. A warning drawn on
 * every row is not a warning, it is a texture, and it was the loudest thing on
 * a screen whose actual subject is numbers.
 *
 * The state is still marked, quietly: a soft amber edge, and the dot before
 * the first option carrying the colour. The count that deserves a manager's
 * attention is the whole-inventory one, and that belongs above the table, not
 * stamped on each line. */
.unit-pill-unset { border-color: rgba(245, 158, 11, 0.30); }
.unit-pill-unset::before {
    content: "";
    align-self: center;
    width: 5px;
    height: 5px;
    margin-inline: 7px -2px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.85);
}
.unit-pill-opt {
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.unit-pill-opt + .unit-pill-opt { border-inline-start: 1px solid var(--border-color); }
.unit-pill-opt:hover { background: rgba(139, 92, 246, 0.12); color: var(--text-primary); }
.unit-pill-opt.is-on { background: #7c3aed; color: #fff; }
.unit-pill-sm .unit-pill-opt { font-size: 11px; padding: 3px 7px; }
.recipe-qty-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
/* The row used to stack up to three things in one cell: the price field, a
 * "מהמלאי" caption under it, and the price basis under that. Two rows in the
 * same table measured 91px and 125px, so the table had no rhythm to follow,
 * and the basis printed the same sentence once per line - six times on a
 * six-line recipe.
 *
 * Everything a row says now sits on one line, and the basis the whole dish
 * shares moved to the column header. A row prints its own basis only when it
 * disagrees with the header, which is the only time the figure is not already
 * on screen. */
.recipe-qty-unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px dashed var(--divider-color);
    border-radius: 999px;
    padding: 3px 9px;
    white-space: nowrap;
}
/* Fixed slots, so a value never moves because of what sits beside it.
 *
 * These cells were centred flex groups, which means the group is centred and
 * therefore the FIELD is not. Measured at 1600px: the quantity field sat at
 * x=832 on a row with a unit pill and x=809 on a row without one, and the
 * price field took four different positions across 37px depending on whether
 * the row carried a "מהמלאי" tag, its own basis, both, or neither.
 *
 * The column of numbers is the thing being read down. Every adornment is
 * secondary to it, and none of them may push it. So each part gets a track of
 * its own, reserved whether or not it is filled, and each is pinned to that
 * track by grid-column rather than by document order - a row with a basis but
 * no tag would otherwise have its basis fall into the tag's slot. */
.recipe-qty-cell,
.recipe-price-cell {
    display: grid;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.recipe-qty-cell { grid-template-columns: var(--row-field-w) var(--row-unit-w); }
.recipe-price-cell {
    grid-template-columns: var(--row-field-w) var(--row-tag-w) var(--row-basis-w);
}
.recipe-qty-cell > input,
.recipe-price-cell > input { grid-column: 1; width: 100%; }
.recipe-qty-cell > .unit-pill,
.recipe-qty-cell > .recipe-qty-unit { grid-column: 2; justify-self: start; }
.recipe-price-cell > .price-from-inv-tag { grid-column: 2; justify-self: start; }
.recipe-price-cell > .recipe-price-basis { grid-column: 3; justify-self: start; }
.price-from-inv-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--success);
    white-space: nowrap;
}
.recipe-price-basis {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}
/* The shared basis, under the column title rather than under every value. */
.col-basis {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-muted);
}

/* Density and separators for the ingredient table only. The global rule is
 * `th, td { padding: 20px 24px }`, which every table in the app shares; this
 * narrows it here, where a row holds one number and was 91px tall. */
.recipe-card th,
.recipe-card td { padding: 11px 14px; }
.recipe-card tbody td { border-bottom: 1px solid var(--divider-color); }
.recipe-card tbody tr:last-child td { border-bottom: 0; }
/* 1.5px of letter-spacing is a heading convention borrowed from uppercase
 * Latin. Hebrew has no uppercase and no ligatures to open up, so it only
 * pushes the letters of מחיר ספק apart. */
.recipe-card thead th { letter-spacing: 0.2px; }
.unit-mig-card { max-width: 780px; width: min(780px, 94vw); }
.unit-mig-auto,
.unit-mig-ask,
.unit-mig-done {
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
}
.unit-mig-auto { border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.08); }
.unit-mig-ask { border-color: rgba(139, 92, 246, 0.35); background: rgba(139, 92, 246, 0.08); }
.unit-mig-auto p,
.unit-mig-ask p,
.unit-mig-done p {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
}
.unit-mig-row {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--bg-surface);
}
.unit-mig-row-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.unit-mig-name { font-size: 15px; color: var(--text-primary); }
.unit-mig-was, .unit-mig-price { font-size: 12px; color: var(--text-muted); }
.unit-mig-price { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.unit-mig-usage { margin: 6px 0 12px; font-size: 12px; color: var(--text-muted); }
.unit-mig-cost-fixed {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-body);
}
.unit-mig-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.unit-mig-opt {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    cursor: pointer;
    text-align: start;
    font: inherit;
    color: var(--text-primary);
    transition: border-color 0.15s, background 0.15s;
}
.unit-mig-opt:hover { border-color: rgba(139, 92, 246, 0.5); }
.unit-mig-opt.is-on { border-color: #7c3aed; background: rgba(139, 92, 246, 0.12); }
.unit-mig-opt-label { font-weight: 700; font-size: 14px; }
.unit-mig-opt-basis { font-size: 11px; color: var(--text-muted); }
.unit-mig-opt-cost { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.unit-mig-consequence { margin: 4px 0 14px; font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.unit-mig-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) {
    .unit-mig-opts { grid-template-columns: 1fr; }
    .unit-mig-price { margin-inline-start: 0; }
}
