/*
 * Relish Round-2 operator-console vocabulary.
 * Cross-cutting primitives shared by every admin workspace so the console reads as
 * one system: page header, KPI tiles, card frame, chips (incl. dietary severity),
 * buttons, status dots, avatars, drag affordances. Screen-specific layout (kanban
 * lanes, dual-list, swatch grids) lives in each page's scoped .razor.css.
 *
 * Everything references --relish-* tokens only (relish-tokens.css); per-tenant
 * branding flows through automatically. Loaded globally, so classes are prefixed
 * r2- to stay out of the way of Bootstrap and the token-only round-1 screens.
 */

/* ---------------------------------------------------------------- page header */
.r2-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--relish-space-4);
    margin-bottom: var(--relish-space-5);
    flex-wrap: wrap;
}
.r2-head__titles { min-width: 0; }
.r2-title {
    font-family: var(--relish-font-display);
    font-size: var(--relish-fs-28);
    font-weight: 500;
    line-height: 1.15;
    color: var(--relish-ink);
    margin: 0;
}
.r2-sub {
    margin: 6px 0 0;
    font-size: var(--relish-fs-14);
    color: var(--relish-ink-soft);
    line-height: 1.4;
}
.r2-sub strong { color: var(--relish-ink); font-weight: 600; }
.r2-head__actions { display: flex; align-items: center; gap: var(--relish-space-2); flex-shrink: 0; }

/* section label above a block */
.r2-eyebrow {
    font-size: var(--relish-fs-12);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 600;
    color: var(--relish-ink-faint);
}

/* ---------------------------------------------------------------- card frame */
.r2-card {
    background: var(--relish-surface);
    border: 1px solid var(--relish-border);
    border-radius: var(--relish-radius-card);
    box-shadow: var(--relish-elevation-1);
}
.r2-card--pad { padding: var(--relish-space-5); }
.r2-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--relish-space-3);
    padding: var(--relish-space-4) var(--relish-space-5);
    border-bottom: 1px solid var(--relish-border);
}
.r2-card__title {
    font-size: var(--relish-fs-15);
    font-weight: 600;
    color: var(--relish-ink);
    margin: 0;
}
.r2-card__meta { font-size: var(--relish-fs-13); color: var(--relish-ink-faint); }

/* ---------------------------------------------------------------- KPI tiles */
.r2-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--relish-space-4);
    margin-bottom: var(--relish-space-5);
}
.r2-kpi {
    background: var(--relish-card);
    border: 1px solid var(--relish-border);
    border-radius: var(--relish-radius-card);
    padding: 15px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.r2-kpi__label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--relish-ink-faint);
}
.r2-kpi__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.r2-kpi__val {
    font-family: var(--relish-font-display);
    font-size: 30px;
    line-height: 1;
    color: var(--relish-ink);
}
.r2-kpi__delta { font-size: 11px; font-weight: 600; }
.r2-kpi__spark { margin-top: 2px; display: block; }
.is-herb { color: var(--relish-herb); }
.is-gold { color: var(--relish-gold); }
.is-coral { color: var(--relish-coral); }
.is-danger { color: var(--relish-danger); }
.is-success { color: var(--relish-success); }
.is-info { color: var(--relish-info); }
.bg-herb { background: var(--relish-herb); }
.bg-gold { background: var(--relish-gold); }
.bg-coral { background: var(--relish-coral); }
.bg-danger { background: var(--relish-danger); }
.bg-success { background: var(--relish-success); }
.bg-info { background: var(--relish-info); }
.bg-faint { background: var(--relish-ink-faint); }

/* ---------------------------------------------------------------- chips */
.r2-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    padding: 5px 10px;
    border-radius: var(--relish-radius-pill);
    border: 1px solid var(--relish-border);
    background: var(--relish-surface);
    color: var(--relish-ink-soft);
    white-space: nowrap;
}
.r2-chip--herb { background: var(--relish-herb-wash); color: var(--relish-herb); border-color: #d9e0cf; }
.r2-chip--gold { background: var(--relish-gold-wash); color: #9a6a1f; border-color: #e8d6b3; }
.r2-chip--coral { background: var(--relish-coral-wash); color: var(--relish-coral); border-color: #eccbbe; }
.r2-chip--info { background: var(--relish-info-wash); color: var(--relish-info); border-color: #c8d7e2; }
.r2-chip--neutral { background: #f0ece1; color: var(--relish-ink-soft); border-color: transparent; }
.r2-chip--solid { background: var(--relish-herb); color: #fff; border-color: var(--relish-herb); }
.r2-chip--danger-solid { background: var(--relish-danger); color: #fff; border-color: var(--relish-danger); }
.r2-chip__x { opacity: .55; cursor: pointer; font-size: 11px; }
.r2-chip__x:hover { opacity: 1; }
.r2-chip--add {
    background: transparent;
    border: 1px dashed var(--relish-border);
    color: var(--relish-ink-faint);
    cursor: pointer;
}
.r2-chip--add:hover { border-color: var(--relish-herb); color: var(--relish-herb); }
.r2-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* dietary severity chip — form + color, never color alone */
.r2-sev {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    padding: 5px 10px 5px 8px;
    border-radius: var(--relish-radius-pill);
    border: 1px solid transparent;
}
.r2-sev__badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 4px;
    color: #fff;
}
.r2-sev__who { color: var(--relish-ink-faint); font-size: 11.5px; }
.r2-sev--allergy   { background: var(--relish-coral-wash); color: #8f3a24; border-color: #eccbbe; }
.r2-sev--allergy   .r2-sev__badge { background: var(--relish-danger); }
.r2-sev--intolerance { background: var(--relish-gold-wash); color: #7d551a; border-color: #e8d6b3; }
.r2-sev--intolerance .r2-sev__badge { background: var(--relish-gold); }
.r2-sev--diet      { background: var(--relish-herb-wash); color: var(--relish-herb); border-color: #d9e0cf; }
.r2-sev--diet      .r2-sev__badge { background: var(--relish-herb); }
.r2-sev--dislike   { background: #f0ece1; color: var(--relish-ink-soft); border-color: var(--relish-border); }
.r2-sev--dislike   .r2-sev__badge { background: var(--relish-ink-faint); }

/* ---------------------------------------------------------------- buttons */
.r2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: var(--relish-font-body);
    font-size: var(--relish-fs-14);
    font-weight: 600;
    line-height: 1;
    padding: 9px 15px;
    border-radius: var(--relish-radius-control);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.r2-btn--herb { background: var(--relish-herb); color: #fff; border-color: var(--relish-herb); }
.r2-btn--herb:hover { background: var(--relish-herb-deep); border-color: var(--relish-herb-deep); color: #fff; }
.r2-btn--ghost { background: var(--relish-surface); color: var(--relish-ink); border-color: var(--relish-border); }
.r2-btn--ghost:hover { border-color: var(--relish-herb); color: var(--relish-herb-deep); }
.r2-btn--coral { background: var(--relish-coral); color: #fff; border-color: var(--relish-coral); }
.r2-btn--coral:hover { background: #b8471f; border-color: #b8471f; color: #fff; }
.r2-btn--danger { background: var(--relish-danger); color: #fff; border-color: var(--relish-danger); }
.r2-btn--danger:hover { background: #97281f; border-color: #97281f; color: #fff; }
.r2-btn--sm { padding: 6px 11px; font-size: 12.5px; }
.r2-btn--icon { gap: 6px; }
.r2-btn[disabled] { opacity: .5; cursor: default; }

/* ---------------------------------------------------------------- status */
.r2-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.r2-status__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.r2-status--active  { color: var(--relish-success); }
.r2-status--active  .r2-status__dot { background: var(--relish-success); }
.r2-status--open    { color: var(--relish-success); }
.r2-status--open    .r2-status__dot { background: var(--relish-success); }
.r2-status--blocked { color: var(--relish-danger); }
.r2-status--blocked .r2-status__dot { background: var(--relish-danger); }
.r2-status--draft   { color: var(--relish-ink-faint); }
.r2-status--draft   .r2-status__dot { background: var(--relish-ink-faint); }
.r2-status--closed  { color: var(--relish-info); }
.r2-status--closed  .r2-status__dot { background: var(--relish-info); }

/* ---------------------------------------------------------------- avatar */
.r2-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--relish-coral);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    font-family: var(--relish-font-display);
    flex-shrink: 0;
}
.r2-avatar--sm { width: 28px; height: 28px; font-size: 12px; }

/* ---------------------------------------------------------------- misc */
.r2-grip { color: var(--relish-ink-faint); cursor: grab; font-size: 14px; line-height: 1; user-select: none; }
.r2-count-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 20px; padding: 0 7px;
    border-radius: var(--relish-radius-pill);
    background: var(--relish-herb-wash); color: var(--relish-herb);
    font-size: 12px; font-weight: 600;
}
.r2-ai { color: var(--relish-herb); font-weight: 600; }         /* ✦ AI touchpoint marker */
.r2-safety { color: var(--relish-danger); font-weight: 700; }   /* ▲ allergen safety marker */

/* the herb "Ask Relish" AI card used on the dashboard + elsewhere */
.r2-ai-card {
    background: var(--relish-herb-deep);
    color: #EAF0E2;
    border-radius: var(--relish-radius-card);
    padding: var(--relish-space-5);
}
.r2-ai-card__mark { color: var(--relish-gold); font-weight: 700; }
.r2-ai-card__title { font-family: var(--relish-font-display); font-size: var(--relish-fs-18); margin: 0 0 8px; color: #fff; }
.r2-ai-card__body { font-size: var(--relish-fs-14); line-height: 1.5; color: #d6e0c9; margin: 0; }

/* two-column workspace split used by several screens */
.r2-split { display: grid; gap: var(--relish-space-5); align-items: start; }

/* generic filter bar */
.r2-filterbar {
    display: flex; align-items: center; gap: var(--relish-space-2);
    flex-wrap: wrap; margin-bottom: var(--relish-space-4);
}
.r2-field {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--relish-surface);
    border: 1px solid var(--relish-border);
    border-radius: var(--relish-radius-control);
    padding: 8px 12px;
    font-size: var(--relish-fs-14);
    color: var(--relish-ink-soft);
}
.r2-field input, .r2-field select {
    border: none; background: transparent; outline: none;
    font: inherit; color: var(--relish-ink); min-width: 0;
}
.r2-field--grow { flex: 1; min-width: 220px; }

/* ---------------------------------------------------------------- markdown editor */
/* Reusable rich-text-lite field: Markdown textarea + toolbar + Write/Preview.
   Global (not scoped) because <MarkdownEditor>/<MarkdownView> are shared components. */
.md-editor {
    border: 1px solid var(--relish-border);
    border-radius: var(--relish-radius-card);
    background: var(--relish-surface);
    overflow: hidden;
}
.md-editor:focus-within { border-color: var(--relish-herb); box-shadow: 0 0 0 3px var(--relish-herb-wash); }
.md-toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px;
    background: var(--relish-card);
    border-bottom: 1px solid var(--relish-border);
}
.md-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.md-toolbar__spacer { flex: 1; }
.md-tool {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border: 1px solid transparent; border-radius: var(--relish-radius-control);
    background: transparent; color: var(--relish-ink-soft);
    font-size: 13px; cursor: pointer;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.md-tool:hover { background: var(--relish-herb-wash); color: var(--relish-herb); border-color: #d9e0cf; }
.md-sep { width: 1px; height: 18px; background: var(--relish-border); margin: 0 4px; }
.md-modes { display: inline-flex; border: 1px solid var(--relish-border); border-radius: var(--relish-radius-pill); overflow: hidden; }
.md-mode {
    border: none; background: var(--relish-surface); color: var(--relish-ink-soft);
    font-family: var(--relish-font-body); font-size: 12.5px; font-weight: 600;
    padding: 5px 13px; cursor: pointer;
}
.md-mode.is-on { background: var(--relish-herb); color: #fff; }
.md-textarea {
    display: block; width: 100%; box-sizing: border-box;
    border: none; outline: none; resize: vertical;
    padding: var(--relish-space-4);
    font-family: var(--relish-font-body);
    font-size: var(--relish-fs-15); line-height: 1.55; color: var(--relish-ink);
    background: var(--relish-surface);
}
.md-preview { padding: var(--relish-space-4); min-height: 120px; }
.md-hint { margin: 0; padding: 6px 12px; font-size: 11.5px; color: var(--relish-ink-faint); border-top: 1px solid var(--relish-border); background: var(--relish-card); }
.md-hint code { background: var(--relish-surface); border: 1px solid var(--relish-border); border-radius: 4px; padding: 0 4px; font-size: 11px; }
.md-empty { color: var(--relish-ink-faint); font-size: var(--relish-fs-14); font-style: italic; margin: 0; }

/* Rendered markdown body — shared by editor preview and customer surfaces. */
.md-body { color: var(--relish-ink); font-size: var(--relish-fs-15); line-height: 1.55; }
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }
.md-body p { margin: 0 0 .6em; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 {
    font-family: var(--relish-font-display); font-weight: 600; line-height: 1.2;
    margin: 1em 0 .4em; color: var(--relish-ink);
}
.md-body h1 { font-size: var(--relish-fs-22); }
.md-body h2 { font-size: var(--relish-fs-18); }
.md-body h3, .md-body h4 { font-size: var(--relish-fs-16); }
.md-body ul, .md-body ol { margin: 0 0 .6em; padding-left: 1.4em; }
.md-body li { margin: .2em 0; }
.md-body blockquote {
    margin: 0 0 .6em; padding: 4px 14px;
    border-left: 3px solid var(--relish-herb-light); color: var(--relish-ink-soft);
    background: var(--relish-herb-wash); border-radius: 0 var(--relish-radius-control) var(--relish-radius-control) 0;
}
.md-body a { color: var(--relish-herb); text-decoration: underline; }
.md-body strong { font-weight: 700; }
.md-body code { background: var(--relish-card); border: 1px solid var(--relish-border); border-radius: 4px; padding: 0 4px; font-size: .92em; }

/* ---------------------------------------------------------------- full-screen editor shell */
/* A workspace-takeover editor (replaces the old side sheet on the most important screens). */
.r2-fs {
    position: fixed; inset: 0; z-index: 60;
    display: flex; flex-direction: column;
    background: var(--relish-cream);
}
.r2-fs__bar {
    display: flex; align-items: center; gap: var(--relish-space-3);
    padding: var(--relish-space-3) var(--relish-space-5);
    background: var(--relish-surface);
    border-bottom: 1px solid var(--relish-border);
    box-shadow: 0 1px 2px rgba(38,35,30,.04);
    flex-shrink: 0;
}
.r2-fs__back {
    display: inline-flex; align-items: center; gap: 8px;
    background: transparent; border: 1px solid var(--relish-border);
    border-radius: var(--relish-radius-control);
    padding: 8px 13px; font-size: var(--relish-fs-14); font-weight: 600;
    color: var(--relish-ink); cursor: pointer;
}
.r2-fs__back:hover { border-color: var(--relish-herb); color: var(--relish-herb-deep); }
.r2-fs__heading { min-width: 0; }
.r2-fs__title { font-family: var(--relish-font-display); font-size: var(--relish-fs-18); font-weight: 500; margin: 0; color: var(--relish-ink); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r2-fs__sub { margin: 1px 0 0; font-size: 12px; color: var(--relish-ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r2-fs__bar-spacer { flex: 1; }
.r2-fs__actions { display: flex; align-items: center; gap: var(--relish-space-2); flex-shrink: 0; }
.r2-fs__body { flex: 1; min-height: 0; overflow-y: auto; }
.r2-fs__body--pad { padding: var(--relish-space-6) var(--relish-space-5); }

/* ---------------------------------------------------------------- faceted filter (MealFacetPanel) */
.ff { display: flex; flex-direction: column; gap: var(--relish-space-4); }
.ff__search { width: 100%; box-sizing: border-box; }
.ff__search input { flex: 1; }
.ff__clear {
    border: none; background: var(--relish-herb-wash); color: var(--relish-herb);
    border-radius: var(--relish-radius-pill); font-size: 12px; font-weight: 600;
    padding: 3px 6px 3px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.ff__clear-n { background: var(--relish-herb); color: #fff; border-radius: var(--relish-radius-pill); min-width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; padding: 0 4px; }
.ff__group { display: flex; flex-direction: column; gap: 8px; }
.ff__group-name {
    display: flex; align-items: center; gap: 8px;
    font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
    color: var(--relish-ink-faint);
}
.ff__group-sel { background: var(--relish-herb); color: #fff; border-radius: var(--relish-radius-pill); min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; padding: 0 5px; }
.ff__group-clear { border: none; background: none; color: var(--relish-herb); font-size: 11px; font-weight: 600; cursor: pointer; text-transform: none; letter-spacing: 0; padding: 0; }
.ff__group-clear:hover { text-decoration: underline; }
.ff__group-search {
    display: flex; align-items: center; gap: 7px;
    border: 1px solid var(--relish-border); border-radius: var(--relish-radius-control);
    padding: 5px 10px; color: var(--relish-ink-faint); font-size: 12.5px;
}
.ff__group-search input { border: none; outline: none; background: transparent; font: inherit; color: var(--relish-ink); flex: 1; min-width: 0; }
.ff__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ff__chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--relish-font-body); font-size: 12.5px; font-weight: 500; line-height: 1;
    padding: 6px 10px; border-radius: var(--relish-radius-pill);
    border: 1px solid var(--relish-border); background: var(--relish-surface); color: var(--relish-ink-soft);
    cursor: pointer; transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.ff__chip:hover { border-color: var(--relish-ink-faint); }
.ff__chip .fa-check { font-size: 10px; }
.ff__chip.is-on { background: var(--relish-herb-wash); border-color: #d9e0cf; color: var(--relish-herb); font-weight: 600; }
.ff__chip.is-empty { opacity: .45; }
.ff__n { font-size: 11px; color: var(--relish-ink-faint); font-variant-numeric: tabular-nums; }
.ff__chip.is-on .ff__n { color: var(--relish-herb); }
.ff__more { align-self: flex-start; border: none; background: none; color: var(--relish-herb); font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.ff__more:hover { text-decoration: underline; }

/* "Needs work" todo facet — a checklist with live counts */
.ff__group--todo {
    background: var(--relish-coral-wash);
    border: 1px solid var(--relish-coral);
    border-radius: var(--relish-radius-card);
    padding: 10px;
    gap: 6px;
}
.ff__todo { display: flex; flex-direction: column; gap: 4px; }
.ff__todo-item {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 7px 9px; border-radius: var(--relish-radius-control);
    border: 1px solid transparent; background: transparent; color: var(--relish-ink);
    font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}
.ff__todo-item:hover { background: rgba(255,255,255,.55); }
.ff__todo-item.is-on { background: var(--relish-surface); border-color: var(--relish-coral); font-weight: 600; }
.ff__todo-item.is-empty { opacity: .5; }
.ff__todo-check { color: var(--relish-coral); font-size: 13px; }
.ff__todo-item.is-on .ff__todo-check { color: var(--relish-coral); }
.ff__todo-icon { color: var(--relish-ink-faint); font-size: 12px; width: 14px; text-align: center; }
.ff__todo-label { flex: 1; min-width: 0; }
.ff__todo-n {
    font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px;
    min-width: 20px; text-align: center; color: var(--relish-coral);
    background: var(--relish-surface); border-radius: var(--relish-radius-pill); padding: 1px 6px;
}
.ff__todo-n.is-zero { color: var(--relish-ink-faint); background: transparent; font-weight: 500; }

/* status facet chips carry their state colour */
.ff__chip--status.status-draft.is-on { background: #fff4e0; border-color: #f0c675; color: #8a5a00; }
.ff__chip--status.status-draft.is-on .ff__n { color: #8a5a00; }
.ff__chip--status.status-archived.is-on { background: var(--relish-ink-wash, #eee); border-color: var(--relish-ink-faint); color: var(--relish-ink-soft); }

/* ---------------------------------------------------------------- responsive
 * Shared behaviour so every operator workspace stays usable on a phone (chefs work
 * these screens on iPhones). Screen-specific breakpoints still live in each page's
 * scoped .razor.css; these cover the cross-cutting vocabulary only.
 */

/* Wrap wide data tables so they scroll on their own instead of forcing the whole
 * page to scroll sideways. Markup: <div class="r2-tablewrap"><table>…</table></div>.
 * min-width:0 lets the wrapper shrink inside flex/grid parents so its scroll actually
 * engages instead of the table's min-width propagating up and widening the page. */
.r2-tablewrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 720px) {
    /* KPI strips: four across is unreadable on a phone — drop to two, then one. */
    .r2-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--relish-space-3);
        margin-bottom: var(--relish-space-4);
    }

    /* Page header: title stacks over its actions, which go full-width and wrap so a
     * wide control (a session picker, a search box) never runs off the screen. */
    .r2-head {
        flex-direction: column;
        align-items: stretch;
        gap: var(--relish-space-3);
        margin-bottom: var(--relish-space-4);
    }
    .r2-head__actions {
        width: 100%;
        flex-wrap: wrap;
        flex-shrink: 1;
    }
    .r2-head__actions > * {
        min-width: 0;
    }

    .r2-title {
        font-size: var(--relish-fs-22);
    }

    /* Padded cards ease their inset so content keeps its width on narrow screens. */
    .r2-card--pad {
        padding: var(--relish-space-4);
    }
    .r2-card__head {
        padding: var(--relish-space-3) var(--relish-space-4);
    }

    /*
     * Safety net for the operator console: form controls inside admin pages carry
     * intrinsic widths (a <select>'s longest option, a fixed-width search field) that,
     * inside the column-flex content area, would stretch the whole page wider than the
     * viewport. Cap them to their container so pages only ever scroll vertically.
     * Global rule (not component-scoped) so it reaches page content under @Body.
     */
    .admin__content select,
    .admin__content textarea,
    .admin__content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
        max-width: 100%;
    }
    .admin__content .r2-field,
    .admin__content .r2-field--grow {
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .r2-kpis {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------- phone touch minimum
 * `--relish-touch-min` has been a declared token since the design system was written,
 * and the customer surface honours it in most places. The storyboard conformance harness
 * (designs/ux/storyboard/scripts/audit.mjs) measured what actually renders at 390px and
 * found a long tail of controls a few pixels under it — 38px buttons, 38px nav links, an
 * 18px select — across both surfaces.
 *
 * This raises them to the declared minimum AT PHONE WIDTHS ONLY, and every per-component
 * touch fix in this change is scoped the same way (the admin nav rail uses 720px, matching
 * its own drawer breakpoint). Desktop is genuinely untouched, so no already-reviewed desktop
 * screenshot moves.
 *
 * Deliberately NOT included: checkboxes, radios, range and color inputs. Those render at
 * their native 13–16px and sizing the BOX changes what the control looks like, not just
 * where it can be hit — which is the admin phone layout, a design decision, not this rule's
 * business. They stay reported in AUDIT.md. (A `select` or text input is included because
 * growing it changes only its height, and those are already full-width on a phone.)
 */
@media (max-width: 480px) {
    .btn,
    .r2-btn,
    select,
    textarea,
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) {
        min-height: var(--relish-touch-min);
    }

    /* Icon-only buttons ("✕", "›") are as narrow as their glyph; fields are already wide, so
       the width minimum is buttons only. */
    .btn,
    .r2-btn {
        min-width: var(--relish-touch-min);
    }
}
