/* Cleaning — feature styles (cleaning-) layered on mds.css.
   One mds-card per trade (COW / Chemical Trade / CPP-DPP matrix) stacked full-width — the
   7-column recipe-steps table needs the room the 2/3-column mds-cards grid doesn't give.
   Tokens come from mds.css. */

.cleaning-layout { display: grid; gap: var(--mds-space-4); }

/* Trade tabs (issue #19): the core .mds-tabs/.mds-tab chassis (mds.css) — no cleaning-specific
   delta needed, the shared chassis already handles the <button>-based tab bar.
   All trade panels render (render parity reads the full DOM); inactive ones hide via CSS. */
.cleaning-tradepanel { display: grid; gap: var(--mds-space-3); }   /* notes dock to their card */
.cleaning-tradepanel--hidden { display: none; }

/* Standard filter chips + grouped "All" view (issue #18, design spec on the issue). */
.cleaning-stdbar { display: flex; gap: var(--mds-space-2); margin-bottom: var(--mds-space-4);
    overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cleaning-stdbar::-webkit-scrollbar { height: 0; }
.cleaning-stdchip { display: inline-flex; align-items: center; gap: var(--mds-space-1-5);
    flex: none; border: 1px solid var(--mds-line); border-radius: 999px; min-height: 36px;
    padding: var(--mds-space-1-5) var(--mds-space-3); background: var(--mds-surface);
    color: var(--mds-muted); font-family: inherit; font-size: var(--mds-text-sm); cursor: pointer; }
.cleaning-stdchip:hover { border-color: var(--mds-accent); }
.cleaning-stdchip.is-active { background: var(--mds-tint); border-color: var(--mds-accent);
    color: var(--mds-accent-ink); font-weight: 600; }
.cleaning-stdchip__count { color: var(--mds-muted); font-size: var(--mds-text-xs); }

/* Group header: the group's CleaningAbilitiesText verbatim (standard name emphasized) + rule
   to the edge — states the standard ONCE for the group; the recipe lines below drop it. */
.cleaning-stdgroup__head { display: flex; align-items: center; gap: var(--mds-space-3);
    margin: var(--mds-space-5) 0 var(--mds-space-2); color: var(--mds-muted); }
.cleaning-stdgroup__head p { margin: 0; }
.cleaning-stdgroup__head strong { color: var(--mds-title); }
.cleaning-stdgroup__head::after { content: ""; flex: 1; min-width: 32px; height: 1px; background: var(--mds-line); }
.cleaning-stdgroup__head:first-child,
.cleaning-stdbar + .cleaning-stdgroup__head { margin-top: 0; }

/* One recipe block inside the Chemical Trade card: title line, optional remarks, steps table.
   space-4 padding = the breathing room of issue #18; the group header already draws a rule,
   so the recipe right below it drops its own separator. */
.cleaning-recipe { padding: var(--mds-space-4) 0; border-top: 1px solid var(--mds-line); }
.cleaning-recipe:first-child { border-top: none; padding-top: 0; }
.cleaning-stdgroup__head + .cleaning-recipe { border-top: none; padding-top: 0; }

.cleaning-recipe__title strong { color: var(--mds-title); margin-right: var(--mds-space-2); }
.cleaning-recipe__standard { color: var(--mds-muted); }

/* Recipe steps, Verwey pattern (issue #6): per step a "① MethodName" head + wrapping
   icon+value chips — no table, so narrow screens wrap instead of crushing columns. */
.cleaning-step { padding: var(--mds-space-2) 0; border-top: 1px dashed var(--mds-line); }
.cleaning-step:first-child { border-top: none; }

.cleaning-step__head { display: flex; align-items: center; gap: var(--mds-space-2); }
.cleaning-step__no {
    flex: none;
    width: 24px;
    height: 24px;
    border: 1px solid var(--mds-accent);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--mds-accent-ink);
    font-size: var(--mds-text-xs);
    font-weight: 600;
}
.cleaning-step__method { font-weight: 600; color: var(--mds-title); font-size: var(--mds-text-sm); }

.cleaning-step__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mds-space-1) var(--mds-space-4);
    margin: var(--mds-space-1) 0 0 calc(24px + var(--mds-space-2));
}
.cleaning-chip { display: inline-flex; align-items: baseline; gap: var(--mds-space-1-5);
    font-size: var(--mds-text-sm); }
.cleaning-chip i { color: var(--mds-muted); font-size: var(--mds-text-sm); }
.cleaning-chip--remark { flex-basis: 100%; }

/* The icon legend, once per card — replaces the old table column headers. */
.cleaning-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mds-space-1) var(--mds-space-3);
    margin-top: var(--mds-space-3);
    padding-top: var(--mds-space-2);
    border-top: 1px solid var(--mds-line);
    font-size: var(--mds-text-xs);
    color: var(--mds-muted);
}
.cleaning-legend__title { font-weight: 600; }
.cleaning-legend__item i { margin-right: 4px; }

.cleaning-recipe__status { margin-top: var(--mds-space-3); }
.cleaning-recipe__status:first-child { margin-top: 0; }
.cleaning-recipe__status p { margin: var(--mds-space-1) 0 0; }

/* One matrix entry in the CPP/DPP card: the "Cleaning to" groups row + the action beneath. */
.cleaning-matrix__entry { padding: var(--mds-space-2) 0; border-top: 1px solid var(--mds-line); }
.cleaning-matrix__entry:first-child { border-top: none; padding-top: 0; }

.cleaning-matrix__action { margin: var(--mds-space-1) 0 0; padding-left: var(--mds-space-5); }
.cleaning-matrix__action li { font-weight: 600; color: var(--mds-title); }

/* Shared recipe-steps component: card/table toggle (explicit, persisted — no hover magic).
   The toolbar carries no mds- class on purpose: invisible to render parity. */
.cleaning-steps__toolbar { display: flex; justify-content: flex-end; }
.cleaning-steps__toggle {
    display: inline-flex; align-items: center; gap: var(--mds-space-1);
    border: 1px solid var(--mds-line); border-radius: var(--mds-radius-sm);
    background: var(--mds-surface); color: var(--mds-muted);
    font-size: var(--mds-text-xs); padding: 2px var(--mds-space-2); cursor: pointer;
}
.cleaning-steps__toggle:hover { color: var(--mds-title); border-color: var(--mds-accent); }
.cleaning-steps__scroll { overflow-x: auto; }
