/* My Kitchen · "Ember plates"
   The last stylesheet. Everything here is scoped under #mk (the body) so it wins over the
   four older layers without editing them. One dark theme; no light variant. */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/poppins-400.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/poppins-500.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/poppins-700.woff") format("woff"); }

:root, #mk {
  --e-bg: #151210;
  --e-s1: #201C19;
  --e-s2: #2B2622;
  --e-s3: #2F2925;
  --e-tab: #3A332E;
  --e-text: #F5EFE8;
  --e-soft: #E9E0D7;
  --e-muted: #B9AEA3;
  --e-line: #332D29;
  --e-ember: #FF7B45;
  --e-on-ember: #1A0E08;
  --e-ember-soft: #3A2218;
  --e-ember-text: #FFA57F;
  --e-amount: #FFB999;
  --e-done: #A8502E;
  --e-ice: #CFE8F5;
  --e-ice-shade: #9FCDE5;
  --e-tray: #0D0B09;
  --e-danger: #FF9486;
  --e-danger-soft: #40201B;
  --e-ok: #A9D6B0;
  --e-font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* the older layers read these names */
  --bg: var(--e-bg);
  --surface: var(--e-s1);
  --surface2: var(--e-s2);
  --text: var(--e-text);
  --muted: var(--e-muted);
  --line: var(--e-line);
  --green: var(--e-ember);
  --green2: var(--e-ember-text);
  --greenBright: var(--e-ember);
  --greenSoft: var(--e-ember-soft);
  --accent: var(--e-ember);
  --accent-dark: var(--e-ember-text);
  --accent-soft: var(--e-ember-soft);
  --paper: var(--e-s1);
  --border: var(--e-line);
  --red: var(--e-danger);
  --shadow: 0 18px 44px rgba(0,0,0,.45);
  --radius: 22px;
  --cookbook-serif: var(--e-font);
  color-scheme: dark;
}

html { background: #151210; }
#mk { background: var(--e-bg); color: var(--e-text); font-family: var(--e-font); font-weight: 400; letter-spacing: 0; -webkit-font-smoothing: antialiased; }
#mk *, #mk *::before, #mk *::after { font-family: inherit; letter-spacing: inherit; }
#mk code, #mk pre, #mk textarea.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
#mk h1, #mk h2, #mk h3, #mk h4 { color: var(--e-text); font-weight: 600; letter-spacing: -.01em; }
#mk p { color: inherit; }
#mk a { color: var(--e-ember-text); }
#mk strong, #mk b { font-weight: 600; }
#mk small { color: var(--e-muted); }
#mk hr { border-color: var(--e-line); }
#mk ::selection { background: var(--e-ember); color: var(--e-on-ember); }
#mk .hidden { display: none !important; }
#mk svg.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
#mk .ui-icon { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#mk .ui-icon .dot { fill: currentColor; stroke: none; }
#mk .eyebrow { margin: 0 0 4px; color: var(--e-muted); font-size: .8125rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
#mk :focus-visible { outline: 3px solid var(--e-ember-text); outline-offset: 2px; }
#mk #main:focus, #mk #main:focus-visible, #mk .cook:focus, #mk .cook:focus-visible { outline: none; }
#mk .skip { background: var(--e-ember); color: var(--e-on-ember); }

/* ---------- buttons ---------- */
#mk button { color: inherit; -webkit-tap-highlight-color: transparent; }
#mk .primary, #mk .secondary, #mk .danger, #mk .back {
  min-height: 46px; padding: 0 20px; border: 0; border-radius: 999px; box-shadow: none;
  font-size: .9375rem; font-weight: 600; line-height: 1.2; transition: transform .12s ease, background-color .12s ease;
}
#mk .primary { background: var(--e-ember); color: var(--e-on-ember); }
#mk .primary:hover { background: #FF8B5B; }
#mk .secondary { background: var(--e-s2); color: var(--e-text); }
#mk .secondary:hover { background: var(--e-tab); }
#mk .danger, #mk .subtle-danger { background: var(--e-danger-soft); color: var(--e-danger); }
#mk .secondary.small, #mk .primary.small, #mk button.small { min-height: 44px; padding: 0 16px; font-size: .875rem; }
#mk .primary:active, #mk .secondary:active, #mk .danger:active, #mk .action-tile:active, #mk .reheat-pill:active, #mk .round-btn:active, #mk .icon:active { transform: scale(.97); }
#mk button:disabled, #mk .primary:disabled, #mk .secondary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
#mk .icon, #mk .round-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: var(--e-s2); color: var(--e-text); font-size: 1rem; flex: 0 0 auto;
}
#mk .icon:hover, #mk .round-btn:hover { background: var(--e-tab); }
#mk .back { display: none; }
#mk .card-actions { gap: 8px; }

/* ---------- forms ---------- */
#mk input:not([type=checkbox]):not([type=radio]):not([type=range]), #mk select, #mk textarea {
  min-height: 46px; border: 1px solid var(--e-line); border-radius: 16px; background: var(--e-tray); color: var(--e-text); padding: 10px 14px; font-size: 1rem; box-shadow: none;
}
#mk textarea { border-radius: 18px; line-height: 1.5; }
#mk input::placeholder, #mk textarea::placeholder { color: #8F857B; }
#mk input:focus, #mk select:focus, #mk textarea:focus { border-color: var(--e-ember); outline: none; }
#mk input[type=checkbox], #mk input[type=radio] { accent-color: var(--e-ember); width: 20px; height: 20px; }
#mk label { color: var(--e-text); }
#mk fieldset { border-color: var(--e-line); }
#mk legend { color: var(--e-text); }

/* ---------- top bar ---------- */
#mk .topbar { height: 64px; background: var(--e-bg); border: 0; box-shadow: none; backdrop-filter: none; }
#mk .topbar-inner { padding: 0 16px 0 20px; gap: 10px; }
#mk .brand { color: var(--e-text); text-decoration: none; min-width: 0; margin-right: auto; }
#mk .brand strong { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
#mk .top-actions { gap: 8px; margin-left: auto; }
#mk #menuBtn { display: none; }
/* keeping the screen on only matters while reading a recipe, so the control lives there, as a round button */
#mk .wake-menu { display: none; }
#mk:has(#recipeView:not(.hidden)) .wake-menu { display: block; }
#mk .wake-menu > summary {
  position: relative; display: block; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; overflow: hidden;
  background: var(--e-s2); color: var(--e-muted); font-size: 0; white-space: nowrap; list-style: none; cursor: pointer;
}
#mk .wake-menu > summary::before {
  content: ""; position: absolute; inset: 12px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
#mk .wake-menu > summary::-webkit-details-marker { display: none; }
#mk .wake-menu > summary[data-wake-state=active], #mk .wake-menu > summary[data-wake-state=video] { background: var(--e-ember-soft); color: var(--e-ember-text); }
#mk .wake-menu-panel { top: calc(100% + 8px); right: 0; padding: 14px; border: 1px solid var(--e-line); border-radius: 20px; background: var(--e-s2); color: var(--e-text); box-shadow: var(--shadow); }
#mk .wake-menu-panel [data-wake-status] { color: var(--e-muted); font-size: .8125rem; }
#mk .sync-status {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 999px;
  background: var(--e-s2); color: var(--e-muted); font-size: .8125rem; font-weight: 500; justify-content: center;
}
#mk .sync-status .sync-dot { display: none; }
#mk .sync-status .sync-icon { font-size: 1rem; line-height: 1; color: inherit; }
#mk .sync-status .sync-text { display: none; white-space: nowrap; }
#mk .sync-status.synced, #mk .sync-status.unprotected { width: 44px; padding: 0; color: var(--e-ok); }
/* anything that is not plainly "synced" says so in words, on a phone too */
#mk .sync-status.conflict .sync-text, #mk .sync-status.offline .sync-text, #mk .sync-status.setup .sync-text,
#mk .sync-status.locked .sync-text, #mk .sync-status.error .sync-text, #mk .sync-status.syncing .sync-text, #mk .sync-status.checking .sync-text { display: inline; }
#mk .sync-status.conflict { background: var(--e-ember); color: var(--e-on-ember); font-weight: 600; }

/* ---------- side menu ---------- */
#mk .sidebar { background: var(--e-s1); border: 0; padding: 14px 10px; box-shadow: none; }
#mk .sidebar nav { gap: 2px; }
#mk .nav {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border: 0; border-radius: 16px;
  background: transparent; color: var(--e-soft); font-size: .9375rem; font-weight: 500; text-align: left;
}
#mk .nav:hover { background: var(--e-s2); }
#mk .nav.active { background: var(--e-ember-soft); color: var(--e-ember-text); font-weight: 600; }
#mk .nav .nav-aa { display: inline-flex; width: 22px; justify-content: center; font-weight: 600; font-size: .9375rem; }
#mk .nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--e-ember); color: var(--e-on-ember); font-size: .6875rem; font-weight: 700; line-height: 20px; text-align: center; margin-left: auto; }
#mk .side-note { margin: 12px 4px 0; padding: 12px 14px; border: 0; border-radius: 16px; background: transparent; color: var(--e-muted); font-size: .8125rem; line-height: 1.45; }
#mk .sidebar-backdrop { background: rgba(0,0,0,.55); }

/* ---------- page frame ---------- */
#mk .layout { min-height: calc(100vh - 64px); }
#mk #main { padding: 8px 16px 112px; max-width: 880px; }
#mk .view > .heading { align-items: center; flex-direction: row; flex-wrap: nowrap; gap: 12px; margin: 8px 4px 16px; }
#mk .view > .heading > div { flex: 1 1 auto; min-width: 0; }
#mk .view > .heading .eyebrow { display: none; }
#mk .heading h1 { margin: 0; font-size: 1.5rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
#mk .heading-note { color: var(--e-muted); font-size: .875rem; }
#mk .empty-state, #mk .empty { padding: 28px 20px; border: 0; border-radius: 24px; background: var(--e-s1); color: var(--e-muted); text-align: center; }
#mk .empty-state strong, #mk .empty h2 { display: block; color: var(--e-text); font-size: 1.0625rem; font-weight: 600; margin: 0 0 6px; }
#mk .empty-state p, #mk .empty p { margin: 0; color: var(--e-muted); font-size: .9375rem; }

/* ---------- bottom navigation (phones) ---------- */
@media (max-width: 760px) {
  #mk .mobile-app-nav {
    left: 16px; right: 16px; bottom: max(14px, var(--safe-bottom)); height: 64px; padding: 6px; gap: 0;
    border: 0; border-radius: 34px; background: var(--e-s2); box-shadow: 0 10px 30px rgba(0,0,0,.5); backdrop-filter: none;
  }
  #mk .mobile-nav-item { gap: 1px; border-radius: 26px; color: #D8CEC4; padding: 0 2px; }
  #mk .mobile-nav-item > small { color: inherit; font-size: .65625rem; font-weight: 500; }
  #mk .mobile-nav-item.active { background: var(--e-ember); color: var(--e-on-ember); }
  #mk .mobile-nav-item.active > small { font-weight: 600; }
  #mk .mobile-nav-item .nav-badge { position: absolute; top: 3px; left: calc(50% + 5px); right: auto; margin: 0; min-width: 18px; height: 18px; line-height: 18px; font-size: .625rem; border: 2px solid var(--e-s2); box-sizing: content-box; }
  #mk .mobile-nav-item.active .nav-badge { background: var(--e-on-ember); color: var(--e-ember); border-color: var(--e-ember); }
  #mk .sidebar { top: auto; left: 16px; right: 16px; bottom: calc(max(14px, var(--safe-bottom)) + 74px); width: auto; max-height: min(70vh, 560px); overflow: auto; border-radius: 28px; box-shadow: var(--shadow); transform: translateY(24px); opacity: 0; pointer-events: none; transition: transform .18s ease, opacity .18s ease; }
  #mk .sidebar.open { transform: none; opacity: 1; pointer-events: auto; }
  #mk .sidebar-backdrop { top: 0; bottom: 0; }
  #mk .toast { bottom: calc(max(14px, var(--safe-bottom)) + 78px); }
}
@media (min-width: 761px) and (max-width: 1000px) { #mk #menuBtn { display: inline-flex; } }
@media (min-width: 761px) { #mk #main { padding-bottom: 48px; } }

/* ---------- toast ---------- */
#mk .toast { border: 0; border-radius: 18px; background: var(--e-text); color: var(--e-bg); font-size: .9375rem; font-weight: 500; box-shadow: var(--shadow); }

/* =====================================================================
   HOME
   ===================================================================== */
#mk .home-outcomes { display: grid; gap: 14px; margin: 0 0 22px; grid-template-columns: minmax(0,1fr); }
#mk .home-helper { margin: 0; padding: 16px 18px; border-radius: 22px; background: var(--e-s1); color: var(--e-muted); font-size: .875rem; line-height: 1.5; }
#mk .home-helper strong { color: var(--e-text); }
#mk .plate { display: block; border-radius: 50%; object-fit: cover; box-sizing: border-box; background: var(--e-s2); border: 4px solid var(--e-s2); flex: 0 0 auto; }
#mk .plate-blank { display: grid; place-items: center; font-size: 1.6em; }

#mk .freezer-cards { display: grid; gap: 12px; grid-template-columns: minmax(0,1fr); }
#mk .freezer-card { position: relative; overflow: hidden; border-radius: 32px; background: var(--e-s1); }
#mk .freezer-copy { position: relative; display: flex; flex-direction: column; min-width: 0; }
#mk .freezer-count { color: var(--e-ember); font-weight: 700; font-variant-numeric: tabular-nums; line-height: .98; letter-spacing: -.02em; }
#mk .freezer-copy strong { font-weight: 600; line-height: 1.25; color: var(--e-text); }
#mk .freezer-copy > span { color: var(--e-muted); }
#mk .mini-tray-wrap { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
#mk .mini-tray { display: grid; grid-template-columns: repeat(4, 26px); gap: 4px; padding: 5px; border-radius: 10px; background: var(--e-tray); }
#mk .mini-tray.wide { grid-template-columns: repeat(6, 17px); }
#mk .mini-tray i { display: block; height: 15px; border-radius: 4px; background: var(--e-ice); box-shadow: inset 0 -3px 0 var(--e-ice-shade); }
#mk .mini-tray-more { color: var(--e-muted); font-size: .8125rem; font-weight: 500; }
#mk .reheat-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  background: var(--e-ember); color: var(--e-on-ember); font-weight: 600; white-space: nowrap; transition: transform .12s ease;
}
#mk .reheat-pill .ui-icon { width: 20px; height: 20px; stroke-width: 2.2; }

/* one recipe frozen: the large card */
#mk .freezer-cards.solo .freezer-card { min-height: 306px; padding: 20px 22px 22px; display: flex; flex-direction: column; justify-content: space-between; }
#mk .freezer-cards.solo .freezer-plate { position: absolute; right: -66px; top: 33px; width: 240px; height: 240px; border: 6px solid var(--e-s3); }
#mk .freezer-cards.solo .freezer-copy { width: 170px; }
#mk .freezer-cards.solo .freezer-count { font-size: 6rem; }
#mk .freezer-cards.solo .freezer-copy strong { font-size: 1.3125rem; }
#mk .freezer-cards.solo .freezer-copy > span { font-size: .875rem; }
#mk .freezer-cards.solo .reheat-pill { align-self: flex-start; height: 54px; padding: 0 26px 0 22px; font-size: 1rem; margin-top: 18px; position: relative; }

/* two recipes frozen: the cards shrink and share the row */
#mk .freezer-cards.pair { grid-template-columns: repeat(2, minmax(0,1fr)); }
#mk .freezer-cards.pair .freezer-card { min-height: 214px; padding: 16px 14px 14px 16px; border-radius: 28px; display: flex; flex-direction: column; justify-content: space-between; }
#mk .freezer-cards.pair .freezer-plate { position: absolute; right: -30px; top: -26px; width: 104px; height: 104px; border: 4px solid var(--e-s3); }
#mk .freezer-cards.pair .freezer-count { font-size: 3.5rem; margin-top: 2px; }
#mk .freezer-cards.pair .freezer-copy strong { font-size: .9375rem; margin-top: 2px; }
#mk .freezer-cards.pair .freezer-copy > span { font-size: .8125rem; }
#mk .freezer-cards.pair .mini-tray { grid-template-columns: repeat(8, 9px); gap: 3px; padding: 4px; border-radius: 7px; }
#mk .freezer-cards.pair .mini-tray i { height: 9px; border-radius: 2.5px; box-shadow: inset 0 -2px 0 var(--e-ice-shade); }
#mk .freezer-cards.pair .mini-tray-wrap { margin-top: 8px; }
#mk .freezer-cards.pair .reheat-pill { height: 46px; width: 100%; font-size: .9375rem; margin-top: 12px; position: relative; }

/* three or more: compact rows */
#mk .freezer-cards.many .freezer-card { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 26px; }
#mk .freezer-cards.many .freezer-plate { width: 52px; height: 52px; border: 3px solid var(--e-s3); }
#mk .freezer-cards.many .freezer-copy { display: grid; grid-template-columns: auto minmax(0,1fr); column-gap: 8px; align-items: baseline; }
#mk .freezer-cards.many .freezer-count { font-size: 1.75rem; line-height: 1.1; }
#mk .freezer-cards.many .freezer-copy strong { font-size: .9375rem; }
#mk .freezer-cards.many .freezer-copy > span:not(.mini-tray-wrap) { display: none; }
#mk .freezer-cards.many .mini-tray-wrap { grid-column: 1 / -1; margin-top: 4px; }
#mk .freezer-cards.many .mini-tray { grid-template-columns: repeat(8, 8px); gap: 3px; padding: 0; background: transparent; }
#mk .freezer-cards.many .mini-tray i { height: 8px; border-radius: 2.5px; background: transparent; border: 1.5px solid var(--e-ice-shade); box-shadow: none; box-sizing: border-box; }
#mk .freezer-cards.many .reheat-pill { height: 46px; padding: 0 18px; font-size: .9375rem; background: var(--e-ember-soft); color: var(--e-ember-text); }

#mk .home-resume { display: grid; gap: 8px; }
#mk .home-outcome-row {
  display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 10px 10px 10px 12px;
  border: 0; border-radius: 26px; background: var(--e-s1); color: var(--e-text); text-align: left;
}
#mk .home-outcome-row .row-plate { width: 48px; height: 48px; border: 3px solid var(--e-s3); }
#mk .home-outcome-row .row-copy { display: flex; flex-direction: column; min-width: 0; }
#mk .home-outcome-row strong { font-size: .9375rem; font-weight: 600; color: var(--e-text); }
#mk .home-outcome-row small { font-size: .8125rem; color: var(--e-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mk .home-outcome-row > b { display: inline-flex; align-items: center; height: 46px; padding: 0 20px; border-radius: 999px; background: var(--e-ember-soft); color: var(--e-ember-text); font-size: .9375rem; font-weight: 600; }

#mk .home-heading { margin: 0 4px 12px; }
#mk .home-heading h1 { font-size: 1rem; font-weight: 600; letter-spacing: 0; }
#mk .home-heading-actions { display: flex; gap: 8px; flex: 0 0 auto; }
#mk .home-heading-actions .round-btn { width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
#mk .home-heading-actions .ui-icon { width: 19px; height: 19px; }
#mk #homeView.few-recipes:not(.search-open) .searchbar, #mk #homeView.few-recipes:not(.search-open) #chips, #mk #homeView.few-recipes:not(.search-open) #filterPanel { display: none !important; }
#mk .searchbar { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; margin: 0 0 12px; }
#mk .search { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--e-s1); color: var(--e-muted); }
#mk .search input { flex: 1; min-height: 44px; border: 0 !important; background: transparent !important; padding: 0 !important; }
#mk .search .ui-icon { width: 19px; height: 19px; }
#mk .searchbar select, #mk .searchbar .filter-btn { min-height: 44px; }
#mk .filter-panel { border: 0; border-radius: 22px; background: var(--e-s1); padding: 14px; }
#mk .chips { gap: 8px; margin-bottom: 14px; }
#mk .chip { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--e-s1); color: var(--e-muted); font-size: .875rem; font-weight: 500; }
#mk .chip.active { background: var(--e-tab); color: var(--e-text); font-weight: 600; }
#mk .count-pill { background: var(--e-ember); color: var(--e-on-ember); }

#mk #recipeGrid.grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px 10px; }
#mk .plate-card { min-width: 0; }
#mk .plate-open { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 0; border: 0; background: transparent; color: var(--e-text); text-align: center; }
#mk .plate-open .card-plate { width: 100%; max-width: 132px; height: auto; aspect-ratio: 1; margin-bottom: 8px; }
#mk .plate-open strong { font-size: .875rem; font-weight: 600; line-height: 1.25; }
#mk .plate-open small { font-size: .78125rem; color: var(--e-muted); }
#mk .plate-open small.has-stock { color: var(--e-ember-text); }
@media (min-width: 620px) { #mk #recipeGrid.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }

/* =====================================================================
   RECIPE
   ===================================================================== */
#mk #recipeDetail { background: transparent; border: 0; box-shadow: none; padding: 0; }
#mk .rx-top { display: grid; gap: 12px; grid-template-columns: minmax(0,1fr); }
#mk .rx-top > * { order: 0; margin-top: 0; margin-bottom: 0; }
#mk .rx-note { border-radius: 18px; background: transparent; color: var(--e-muted); font-size: .8125rem; line-height: 1.5; }
#mk .rx-note > summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--e-ember-text); font-size: .8125rem; font-weight: 500; cursor: pointer; list-style: none; }
#mk .rx-note > summary::-webkit-details-marker { display: none; }
#mk .rx-note > p { margin: 0 4px 4px; color: var(--e-muted); }
#mk .rx-hero { position: relative; height: 196px; margin: -72px -16px 0; overflow: hidden; }
#mk .rx-hero .rx-plate { position: absolute; right: -64px; top: -58px; width: 250px; height: 250px; border: 6px solid var(--e-s2); }
#mk .rx-hero .plate-blank { font-size: 5rem; }
#mk .rx-hero-actions { position: absolute; left: 16px; top: 14px; display: flex; gap: 8px; }
#mk .rx-fav.on { background: var(--e-ember-soft); color: var(--e-ember-text); }
#mk .rx-fav.on .ui-icon { fill: currentColor; }
#mk .rx-hero h1 { position: absolute; left: 20px; bottom: 2px; width: min(52%, 300px); margin: 0; font-size: 1.4375rem; font-weight: 600; line-height: 1.16; letter-spacing: -.02em; overflow-wrap: break-word; }
#mk .rx-desc { margin: 0; padding: 0 4px; color: var(--e-muted); font-size: .875rem; line-height: 1.45; }
/* the top bar gives way to the plate on a recipe */
#mk:has(#recipeView:not(.hidden)) .topbar { background: transparent; pointer-events: none; }
#mk:has(#recipeView:not(.hidden)) .topbar .brand { visibility: hidden; }
#mk:has(#recipeView:not(.hidden)) .topbar .top-actions { pointer-events: auto; }
#mk:has(#recipeView:not(.hidden)) .topbar .sync-status { display: none; }

#mk .rx-actions { display: grid; gap: 10px; grid-template-columns: minmax(0,1fr); }
#mk .action-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 8px; }
#mk .action-tile {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 122px; min-width: 0; padding: 12px;
  border: 0; border-radius: 24px; background: var(--e-s1); color: var(--e-text); text-align: left; transition: transform .12s ease;
}
#mk .action-tile .tile-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--e-ember-soft); color: var(--e-ember-text); }
#mk .action-tile .tile-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
#mk .action-tile strong { font-size: .84375rem; font-weight: 600; line-height: 1.2; color: inherit; }
#mk .action-tile small { font-size: .78125rem; color: var(--e-muted); line-height: 1.3; }
#mk .action-tile.has-stock small { color: var(--e-ember-text); }
#mk .action-tile.primary { background: var(--e-ember); color: var(--e-on-ember); }
#mk .action-tile.primary .tile-icon { background: rgba(26,14,8,.16); color: var(--e-on-ember); }
#mk .action-tile.primary small { color: var(--e-on-ember); font-weight: 500; }
#mk .rx-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; padding: 0; border: 0; background: transparent; }
#mk .rx-tools .secondary { min-height: 44px; padding: 0 16px; font-size: .8125rem; font-weight: 500; background: var(--e-s1); color: var(--e-soft); }
#mk .action-wrap { position: relative; }
#mk .action-menu { min-width: 250px; padding: 8px; border: 1px solid var(--e-line); border-radius: 20px; background: var(--e-s2); box-shadow: var(--shadow); z-index: 30; }
#mk .action-menu button { display: block; width: 100%; min-height: 46px; padding: 0 14px; border: 0; border-radius: 14px; background: transparent; color: var(--e-text); font-size: .9375rem; font-weight: 500; text-align: left; }
#mk .action-menu button:hover { background: var(--e-tab); }
#mk .action-menu button.danger { color: var(--e-danger); background: transparent; }

#mk .workflow-resume-banner, #mk .production-resume, #mk .resume-cooking {
  display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; padding: 16px; border: 0; border-radius: 24px; background: var(--e-ember-soft); color: var(--e-text); box-shadow: none;
}
#mk .workflow-resume-banner .resume-kicker { color: var(--e-ember-text); font-size: .8125rem; font-weight: 500; text-transform: none; letter-spacing: 0; }
#mk .workflow-resume-banner strong, #mk .production-resume h3 { display: block; font-size: 1.0625rem; font-weight: 600; color: var(--e-text); margin: 0; }
#mk .workflow-resume-banner small, #mk .production-resume p { display: block; color: var(--e-soft); font-size: .8125rem; margin: 2px 0 0; }
#mk .workflow-resume-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#mk .workflow-resume-actions .secondary { background: rgba(245,239,232,.1); }
#mk .resume-plan-menu > summary { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(245,239,232,.1); color: var(--e-text); list-style: none; cursor: pointer; }
#mk .resume-plan-menu > summary::-webkit-details-marker { display: none; }
#mk .resume-plan-menu > div { padding: 8px; border: 1px solid var(--e-line); border-radius: 18px; background: var(--e-s2); box-shadow: var(--shadow); }
#mk .resume-plan-menu > div button { display: block; width: 100%; min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: var(--e-text); text-align: left; font-weight: 500; }
#mk .resume-plan-menu > div button.danger { color: var(--e-danger); }

/* choices that are not the bowl builder (heat, method, batch size) */
#mk .variant-box { display: grid; gap: 12px; padding: 14px 16px; border: 0; border-radius: 22px; background: var(--e-s1); }
#mk .variant-box label, #mk .variant-box .variant-label, #mk .variant-group > span { color: var(--e-muted); font-size: .8125rem; font-weight: 500; text-transform: none; letter-spacing: 0; }
#mk .variant-btn, #mk .scale-btn, #mk .variable-btn, #mk .phase-filter {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--e-s2); color: var(--e-soft); font-size: .875rem; font-weight: 500;
}
#mk .variant-btn.active, #mk .scale-btn.active, #mk .variable-btn.active, #mk .phase-filter.active,
#mk .variant-btn[aria-pressed=true], #mk .scale-btn[aria-pressed=true], #mk .variable-btn[aria-pressed=true], #mk .phase-filter[aria-pressed=true] { background: var(--e-ember-soft); color: var(--e-ember-text); font-weight: 600; }
#mk .variant-note, #mk .variant-warning, #mk .recipe-time-note { margin: 0; padding: 12px 14px; border: 0; border-radius: 16px; background: var(--e-s2); color: var(--e-soft); font-size: .8125rem; line-height: 1.5; }
#mk .variant-warning { background: var(--e-ember-soft); color: var(--e-amount); }
#mk .variant-warning strong { color: var(--e-text); }

/* "Your bowl" */
#mk .composition-disclosure { border: 0; border-radius: 22px; background: var(--e-s1); overflow: hidden; margin: 0; }
#mk .composition-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; list-style: none; cursor: pointer; }
#mk .composition-disclosure > summary::-webkit-details-marker { display: none; }
#mk .bowl-summary { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
#mk .bowl-summary small { font-size: .875rem; font-weight: 600; color: var(--e-text); }
#mk .bowl-summary strong { font-size: .8125rem; font-weight: 400; color: var(--e-muted); line-height: 1.4; }
#mk .bowl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
#mk .bowl-row .selection-art { width: 34px; height: 34px; }
#mk .bowl-row-more { color: var(--e-muted); font-size: .8125rem; font-weight: 500; margin-left: 4px; }
#mk .composition-cue { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 999px; background: var(--e-ember-soft); color: var(--e-ember-text); font-size: .875rem; font-weight: 600; flex: 0 0 auto; }
#mk .composition-cue::after { content: none; }
#mk .composition-disclosure .cue-open, #mk .composition-disclosure[open] .cue-closed { display: none; }
#mk .composition-disclosure[open] .cue-open { display: inline; }
#mk .serving-plan, #mk .meal-finish-bar { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 4px 16px 16px; margin: 0; }
#mk section.serving-plan.meal-finish-bar:not(.composition-plan) { border-radius: 22px; background: var(--e-s1); padding: 16px; }
#mk .serving-plan-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
#mk .serving-plan-head h3 { margin: 0; font-size: 1rem; font-weight: 600; }
#mk .serving-plan-head p:not(.eyebrow) { margin: 4px 0 0; color: var(--e-muted); font-size: .8125rem; line-height: 1.45; }
#mk .composition-groups { display: grid; gap: 16px; }
#mk .choice-group { margin: 0; padding: 0; border: 0; min-width: 0; }
#mk .choice-group legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 0; margin-bottom: 8px; }
#mk .choice-group legend strong { font-size: .875rem; font-weight: 600; }
#mk .choice-group legend small { font-size: .8125rem; color: var(--e-muted); }
#mk .serving-chips { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
#mk .serving-chip {
  display: grid; grid-template-columns: 34px minmax(0,1fr) 18px; align-items: center; gap: 8px; width: 100%; min-height: 54px; padding: 8px 10px;
  border: 1.5px solid transparent; border-radius: 18px; background: var(--e-s2); color: var(--e-text); text-align: left; box-shadow: none;
}
#mk .serving-chip:not(.has-selection-art) { grid-template-columns: minmax(0,1fr) 18px; padding-left: 14px; }
#mk .serving-chip .selection-art { width: 34px; height: 34px; grid-column: 1; grid-row: 1; }
#mk .serving-chip-copy { display: flex; flex-direction: column; min-width: 0; grid-row: 1; }
#mk .serving-chip.has-selection-art .serving-chip-copy { grid-column: 2; }
#mk .serving-chip-copy strong { font-size: .8125rem; font-weight: 500; line-height: 1.25; color: inherit; }
#mk .serving-chip-copy small { font-size: .75rem; color: var(--e-muted); }
#mk .serving-chip-state { grid-column: -2; grid-row: 1; justify-self: end; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #6E645B; font-size: 0; background: transparent; color: transparent; box-sizing: border-box; }
#mk .serving-chip:not(.off) { background: var(--e-ember-soft); border-color: var(--e-ember); }
#mk .serving-chip:not(.off) .serving-chip-state { border-color: var(--e-ember); background: var(--e-ember); box-shadow: inset 0 0 0 3px var(--e-ember-soft); }
#mk .serving-chip.off { color: var(--e-soft); }
#mk .serving-chip.off .selection-art { opacity: .55; }
#mk .serving-chip.locked { opacity: 1; }
#mk .serving-choice-with-recipe { display: grid; gap: 4px; min-width: 0; }
#mk .component-recipe-link { min-height: 44px; padding: 0 12px; border: 0; border-radius: 14px; background: transparent; color: var(--e-ember-text); font-size: .8125rem; font-weight: 500; text-align: left; }

#mk .rx-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 2px 4px; }
#mk .rx-facts .fact { display: flex; align-items: baseline; gap: 6px; }
#mk .rx-facts strong { font-size: 1rem; font-weight: 600; }
#mk .rx-facts span { font-size: .8125rem; color: var(--e-muted); }
#mk .taste-launcher { border: 0; border-radius: 22px; background: var(--e-s1); padding: 14px 16px; }

/* tabs */
#mk .tabs { position: sticky; top: 8px; z-index: 20; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 1.2fr; gap: 0; margin: 12px 0 14px; padding: 4px; border: 0; border-radius: 26px; background: var(--e-s1); box-shadow: 0 8px 20px rgba(0,0,0,.35); overflow: visible; }
#mk .tab { min-width: 0; min-height: 44px; padding: 0 4px; border: 0; border-radius: 22px; background: transparent; color: var(--e-muted); font-size: .78125rem; font-weight: 500; white-space: nowrap; box-shadow: none; }
#mk .tab::after, #mk .tab::before { content: none; }
#mk .tab.active { background: var(--e-tab); color: var(--e-text); font-weight: 600; }
#mk .tab .tab-label-short { display: none; }
#mk .tab .tab-label-full { display: inline; }
#mk .panel { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0 2px; }
@media (min-width: 761px) { #mk .tabs { top: 72px; } #mk .tab { font-size: .875rem; } }

/* ingredients: the amount comes first, in a chip */
#mk .ingredient-line, #mk .ingredient-card-line {
  display: grid; grid-template-columns: auto 82px minmax(0,1fr); align-items: center; gap: 12px; padding: 9px 0; border: 0; border-bottom: 1px solid var(--e-line); background: transparent; border-radius: 0;
}
#mk .ingredient-card-line { grid-template-columns: 82px minmax(0,1fr); }
#mk .ingredient-line:last-child, #mk .ingredient-card-line:last-child { border-bottom: 0; }
#mk .ingredient-amount, #mk .ingredient-card-line > strong, #mk .step-amt > span:first-child, #mk .cook-amt > span:first-child {
  display: block; box-sizing: border-box; padding: 4px 6px; border-radius: 12px; background: var(--e-ember-soft); color: var(--e-amount);
  font-size: .9375rem; font-weight: 600; line-height: 1.25; text-align: center; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
#mk .ingredient-name-wrap, #mk .ingredient-card-line > span { font-size: .9375rem; color: var(--e-text); min-width: 0; }
#mk .ingredient-card-line > span b { font-weight: 400; }
#mk .ingredient-card-line > span small { display: block; color: var(--e-muted); font-size: .8125rem; }
#mk .ingredient-line.checked .ingredient-name-wrap { color: var(--e-muted); text-decoration: line-through; }
#mk .ingredient-line.checked .ingredient-amount { opacity: .5; }
#mk .ingredient-group > h3, #mk .ingredient-run-section > header h3 { margin: 18px 0 6px; font-size: .9375rem; font-weight: 600; }
#mk .phase-badge { padding: 2px 8px; border-radius: 8px; background: var(--e-s2); color: var(--e-muted); font-size: .6875rem; font-weight: 500; text-transform: none; letter-spacing: 0; }
#mk .phase-badge.fresh { background: #23301F; color: var(--e-ok); }
#mk .ingredient-run-summary, #mk .ingredient-scale-card, #mk .ingredient-scope-bar, #mk .panel-actions { border: 0; border-radius: 22px; background: var(--e-s1); padding: 14px 16px; box-shadow: none; }
#mk .ingredient-scope-bar, #mk .panel-actions { background: transparent; padding: 0; }
#mk .ingredient-scope-tabs, #mk .phase-filters { display: flex; flex-wrap: wrap; gap: 8px; border: 0; background: transparent; padding: 0; }
#mk .ingredient-component-card, #mk .ingredient-stocked-card { border: 0; border-radius: 22px; background: var(--e-s1); box-shadow: none; overflow: hidden; }
#mk .ingredient-component-card > summary { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; list-style: none; cursor: pointer; }
#mk .ingredient-component-card > summary::-webkit-details-marker { display: none; }
#mk .ingredient-component-card .selection-art, #mk .ingredient-stocked-card .selection-art { width: 40px; height: 40px; }
#mk .ingredient-component-title { font-size: .9375rem; font-weight: 600; color: var(--e-text); }
#mk .ingredient-component-count { color: var(--e-muted); font-size: .8125rem; }
#mk .ingredient-component-body { padding: 0 16px 10px; }
#mk .ingredient-run-metrics > div, #mk .ingredient-run-metrics > span { background: var(--e-s2); border: 0; border-radius: 14px; }
#mk .check-summary { color: var(--e-muted); font-size: .8125rem; }

/* prep, cook, store, nutrition panels */
#mk .prep-header, #mk .prep-card, #mk .later-prep, #mk .instruction, #mk .storage-card, #mk .later-flow-card, #mk .storage-reference, #mk .nutrition-wrap, #mk .guide-card, #mk .store-actions {
  border: 0; border-radius: 22px; background: var(--e-s1); box-shadow: none; color: var(--e-text);
}
#mk .store-actions { background: transparent; padding: 0; }
#mk .store-action { border: 0; border-radius: 22px; background: var(--e-s1); color: var(--e-text); min-height: 64px; padding: 12px 16px; text-align: left; }
#mk .store-action.primary { background: var(--e-ember); color: var(--e-on-ember); }
#mk .store-action small { color: inherit; opacity: .8; }
#mk .instruction { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 12px; padding: 16px; margin-bottom: 10px; }
#mk .instruction .num, #mk .component-recipe-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--e-ember-soft); color: var(--e-ember-text); font-size: .9375rem; font-weight: 600; }
#mk .instruction h3 { margin: 4px 0 8px; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
#mk .cook-action { margin: 0 0 8px; color: var(--e-soft); font-size: 1rem; line-height: 1.5; }
#mk .instruction-key { color: var(--e-text); font-weight: 600; background: none; text-decoration: none; }
#mk .amounts { display: grid; gap: 0; margin-top: 10px; padding: 4px 12px; border-radius: 18px; background: var(--e-bg); }
#mk .step-amt { display: grid; grid-template-columns: 82px minmax(0,1fr); align-items: center; gap: 12px; padding: 7px 0; border: 0; border-bottom: 1px solid var(--e-line); background: transparent; border-radius: 0; }
#mk .step-amt:last-child { border-bottom: 0; }
#mk .step-amt > span:last-child { font-size: .9375rem; color: var(--e-text); }
#mk .prep-check { color: var(--e-text); }
#mk details > summary { color: var(--e-text); }

/* =====================================================================
   COOKING MODE and GUIDED PREP
   ===================================================================== */
#mk dialog { color: var(--e-text); }
#mk dialog::backdrop { background: rgba(8,6,5,.72); }
#mk .modal { background: var(--e-bg); border: 0; }
#mk .cook { background: var(--e-bg); color: var(--e-text); border: 0; }
#mk .cook > header, #mk .cook > .cook-head { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 16px 6px; border: 0; background: transparent; }
#mk .cook > header .icon { width: 46px; height: 46px; min-width: 46px; background: var(--e-s2); color: var(--e-text); border-radius: 50%; }
#mk .cook-head-copy { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 0; text-align: center; }
#mk .cook-head-copy .eyebrow { display: block; margin: 0; }
#mk .cook-step-label { min-height: 28px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--e-text); font-size: .9375rem; font-weight: 600; }
#mk .cook-head-copy h2 { margin: 0; max-width: 100%; color: var(--e-muted); font-size: .75rem; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0; }
#mk .cook-meta { display: none; }
#mk .prep-guide .cook-head-copy h2 { color: var(--e-text); font-size: .9375rem; font-weight: 600; white-space: normal; }
#mk .cook .wake-control { display: flex; align-items: center; justify-content: flex-end; gap: 0; padding: 0; margin: 0; border: 0; background: transparent; min-width: 46px; }
#mk .cook .wake-control [data-wake-toggle] {
  position: relative; width: 46px; min-width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 50%; background: var(--e-s2); color: var(--e-muted); font-size: 0; overflow: hidden;
}
#mk .cook .wake-control [data-wake-toggle]::before {
  content: ""; position: absolute; inset: 13px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
#mk .cook .wake-control [data-wake-toggle][aria-pressed=true] { background: var(--e-ember-soft); color: var(--e-ember-text); }
#mk .cook .wake-control [data-wake-status] { display: none; }
#mk .cook .wake-control [data-wake-retry] { position: absolute; right: 16px; top: 64px; z-index: 3; }
#mk .cook .progress { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#mk .prep-guide .progress { position: static; width: auto; height: 7px; opacity: 1; margin: 4px 16px 0; border: 0; border-radius: 4px; background: var(--e-s3); overflow: hidden; appearance: none; -webkit-appearance: none; }
#mk .prep-guide .progress::-webkit-progress-bar { background: var(--e-s3); }
#mk .prep-guide .progress::-webkit-progress-value { background: var(--e-ember); border-radius: 4px; }
#mk .prep-guide .progress::-moz-progress-bar { background: var(--e-ember); }
#mk .cook-segments { display: flex; gap: 3px; padding: 4px 16px 0; }
#mk .cook-segments[hidden] { display: none; }
#mk .cook-segments i { flex: 1 1 0; height: 7px; min-width: 2px; border-radius: 4px; background: var(--e-s3); transition: background-color .18s ease; }
#mk .cook-segments i.done { background: var(--e-done); }
#mk .cook-segments i.current { background: var(--e-ember); }
#mk .cook > main { padding: 14px 20px 12px; background: transparent; }
#mk .cook-plan { border: 0; border-radius: 18px; background: var(--e-s1); margin: 0 0 12px; }
#mk .cook-workspace { display: block; }
#mk .cook-focus-card { display: flex; flex-direction: column; gap: 14px; padding: 0; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
#mk .cook-workspace:not(.complete) #cookCount { display: none; }
#mk #cookCount { color: var(--e-ember); font-size: 1.75rem; font-weight: 700; background: none; border: 0; width: auto; height: auto; text-align: left; }
#mk #cookStepTitle, #mk .cook h3 { margin: 0; font-size: 1.6875rem; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
#mk #cookText { counter-reset: line; display: flex; flex-direction: column; gap: 9px; }
#mk #cookText > .cook-action { position: relative; margin: 0; padding-left: 26px; color: var(--e-soft); font-size: 1.125rem; line-height: 1.4; counter-increment: line; }
#mk #cookText > .cook-action::before { content: counter(line); position: absolute; left: 0; top: 0; color: var(--e-ember); font-weight: 600; }
#mk #cookText > .cook-action:only-child { padding-left: 0; }
#mk #cookText > .cook-action:only-child::before { content: none; }
#mk #cookText .instruction-key { font-weight: 600; color: var(--e-text); }
#mk .cook-amounts-panel { margin: 0 -6px; padding: 5px 12px; border: 0; border-radius: 24px; background: var(--e-s1); }
#mk .cook-amounts-panel.empty { display: none; }
#mk .cook-amounts-panel > .eyebrow { display: none; }
#mk .cook-amounts { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; }
#mk .cook-amt { display: grid; grid-template-columns: 84px minmax(0,1fr); align-items: center; gap: 12px; padding: 6px 0; border: 0; border-bottom: 1px solid var(--e-line); background: transparent; border-radius: 0; }
#mk .cook-amt:last-child { border-bottom: 0; }
#mk .cook-amt > span:first-child { font-size: 1rem; }
#mk .cook-amt > span:nth-child(2) { font-size: 1rem; color: var(--e-text); }
#mk .cook-amt .component-recipe-link { grid-column: 1 / -1; }
#mk .cook-next-preview { display: none; }
#mk .cook-step-nav { display: none; }
#mk .cook-workspace.show-steps .cook-step-nav { display: grid; gap: 4px; margin: 0 -6px 14px; padding: 8px; border-radius: 22px; background: var(--e-s1); max-height: 46vh; overflow: auto; }
#mk .cook-step-nav button { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 10px; border: 0; border-radius: 14px; background: transparent; color: var(--e-soft); text-align: left; }
#mk .cook-step-nav button span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--e-s3); color: var(--e-muted); font-size: .8125rem; font-weight: 600; }
#mk .cook-step-nav button b { font-size: .875rem; font-weight: 500; white-space: normal; }
#mk .cook-step-nav button.done span { background: var(--e-done); color: var(--e-text); }
#mk .cook-step-nav button.current { background: var(--e-ember-soft); color: var(--e-text); }
#mk .cook-step-nav button.current span { background: var(--e-ember); color: var(--e-on-ember); }
#mk .cook > footer { display: flex; align-items: center; gap: 10px; padding: 12px 16px max(20px, var(--safe-bottom)); border: 0; background: var(--e-bg); }
#mk .cook > footer .secondary, #mk .cook > footer .primary { min-height: 62px; border-radius: 31px; }
#mk #prevBtn { width: 62px; min-width: 62px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--e-s2); flex: 0 0 auto; }
#mk #prevBtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#mk #prevBtn .ui-icon { width: 24px; height: 24px; stroke-width: 2.2; }
#mk #backToPrep { flex: 0 0 auto; padding: 0 20px; }
#mk #nextBtn { flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding: 0 28px; font-size: 1.125rem; font-weight: 600; line-height: 1.2; text-align: left; min-width: 0; }
#mk #nextBtn::after { content: attr(data-hint); display: block; max-width: 100%; font-size: .84375rem; font-weight: 500; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mk #nextBtn[data-hint=""]::after, #mk #nextBtn:not([data-hint])::after { content: none; }
#mk .completion-status { display: flex; align-items: center; gap: 14px; padding: 16px; border: 0; border-radius: 24px; background: var(--e-s1); }
#mk .completion-check { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--e-ember); color: var(--e-on-ember); flex: 0 0 auto; }
#mk .completion-status strong { display: block; font-size: 1.0625rem; }
#mk .completion-status span { color: var(--e-muted); font-size: .9375rem; }
#mk .completion-inventory { display: grid; gap: 4px; padding: 14px 16px; border: 0; border-radius: 24px; background: var(--e-s1); color: var(--e-soft); font-size: .9375rem; }
#mk .completion-inventory strong { color: var(--e-text); }
#mk .prep-guide > main { padding: 14px 20px 12px; }
#mk .prep-guide > footer { display: flex; gap: 10px; padding: 12px 16px max(20px, var(--safe-bottom)); }

/* =====================================================================
   DIALOGS and SHEETS
   ===================================================================== */
#mk .app-dialog { border: 0; border-radius: 28px; background: var(--e-s1); color: var(--e-text); box-shadow: var(--shadow); }
#mk .app-dialog h2 { font-size: 1.25rem; font-weight: 600; line-height: 1.25; }
#mk .dialog-body, #mk .app-dialog p { color: var(--e-soft); }
#mk .dialog-actions { gap: 8px; border: 0; background: transparent; }
#mk .card-head, #mk .dialog-head { border: 0; }
@media (max-width: 760px) {
  #mk .app-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 28px 28px 0 0; max-height: 92dvh; }
  #mk .app-dialog[open] { animation: ember-sheet .2s ease; }
}
@keyframes ember-sheet { from { transform: translateY(28px); opacity: .6; } to { transform: none; opacity: 1; } }
#mk .count-sheet-row { border: 0; border-radius: 20px; background: var(--e-s2); }
#mk .sheet-error { color: var(--e-danger); }

/* =====================================================================
   LISTS: shopping, fridge, freezer, equipment
   ===================================================================== */
#mk .inventory-card, #mk .freezer-food-group, #mk .freezer-builder, #mk .cookware-card, #mk .shopping-section, #mk .shopping-family, #mk .fridge-group, #mk .conflict-card, #mk .import-card, #mk .backup-card, #mk .about-card, #mk .card, #mk .notice {
  border: 0; border-radius: 22px; background: var(--e-s1); color: var(--e-text); box-shadow: none;
}
#mk .section-heading h2 { font-size: 1rem; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  #mk *, #mk *::before, #mk *::after { animation: none !important; transition: none !important; }
}

/* ---------- global clean-up of the older layers' label styling ---------- */
#mk *, #mk *::before, #mk *::after { text-transform: none; }

/* ---------- Ingredients tab ---------- */
#mk .ingredient-run-summary { display: grid; gap: 14px; margin: 0 0 12px; }
#mk .ingredient-run-heading { display: grid; gap: 12px; }
#mk .ingredient-run-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
#mk .ingredient-run-heading p:last-child, #mk .ingredient-run-heading p:not(.eyebrow) { margin: 2px 0 0; color: var(--e-muted); font-size: .8125rem; }
#mk .ingredient-target-options { display: flex; gap: 8px; width: 100%; }
#mk .ingredient-target-options button { flex: 1; min-width: 46px; height: 46px; border: 0; border-radius: 999px; background: var(--e-s2); color: var(--e-soft); font-size: .9375rem; font-weight: 600; }
#mk .ingredient-target-options button.active { background: var(--e-ember-soft); color: var(--e-ember-text); border: 0; }
#mk .ingredient-run-metrics { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin: 0; }
#mk .ingredient-run-metrics > div { display: grid; gap: 2px; align-content: start; min-height: 0; padding: 10px 12px; border: 0; border-radius: 16px; background: var(--e-s2); }
#mk .ingredient-run-metrics span { color: var(--e-muted); font-size: .75rem; font-weight: 500; }
#mk .ingredient-run-metrics strong { font-size: .875rem; font-weight: 600; line-height: 1.3; }
#mk .ingredient-run-actions { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; margin: 0; }
#mk .ingredient-scope-bar { margin: 0 0 12px; }
#mk .ingredient-scope-tabs .phase-filter, #mk .phase-filters .phase-filter { flex: 1 1 auto; border: 0; line-height: 1.2; padding: 0 14px; font-size: .8125rem; }
#mk .ingredient-run-section { padding: 0; margin: 0 0 14px; border: 0; background: transparent; }
#mk .ingredient-run-section + .ingredient-run-section { border: 0; }
#mk .ingredient-run-section > header { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 0 4px 10px; }
#mk .ingredient-run-section > header h2 { margin: 0; font-size: 1.0625rem; font-weight: 600; }
#mk .ingredient-run-section > header > span { max-width: none; color: var(--e-muted); font-size: .8125rem; line-height: 1.4; text-align: left; }
#mk .ingredient-component-card { margin: 0 0 8px; }
#mk .ingredient-component-card[open] { background: var(--e-s1); }
#mk .ingredient-component-card > summary::after { content: ""; grid-column: 3; grid-row: 1; width: 9px; height: 9px; margin-right: 6px; border-right: 2px solid var(--e-muted); border-bottom: 2px solid var(--e-muted); transform: rotate(-45deg); transition: transform .15s ease; }
#mk .ingredient-component-card[open] > summary::after { transform: rotate(45deg); }
#mk .ingredient-component-title { display: grid; gap: 1px; }
#mk .ingredient-component-kicker { color: var(--e-ember-text); font-size: .75rem; font-weight: 500; }
#mk .ingredient-component-title > strong { font-size: .9375rem; font-weight: 600; line-height: 1.25; }
#mk .ingredient-component-title > small { color: var(--e-muted); font-size: .78125rem; line-height: 1.35; white-space: normal; }
#mk .ingredient-component-count { display: none; }
#mk .ingredient-context-empty { display: grid; gap: 4px; padding: 16px 18px; border: 0; border-radius: 22px; background: var(--e-s1); }
#mk .ingredient-context-empty strong { font-size: .9375rem; font-weight: 600; }
#mk .ingredient-context-empty span { color: var(--e-muted); font-size: .8125rem; line-height: 1.45; }
#mk .ingredient-stocked-group { margin: 8px 0 0; border: 0; border-radius: 22px; background: var(--e-s1); }
#mk .ingredient-stocked-group > summary { display: flex; align-items: center; min-height: 48px; padding: 0 16px; color: var(--e-muted); font-size: .8125rem; font-weight: 500; cursor: pointer; }
#mk .ingredient-stocked-group > div { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; padding: 0 10px 10px; }
#mk .ingredient-stocked-card { display: grid; grid-template-columns: 40px minmax(0,1fr); align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: var(--e-s2); }
#mk .ingredient-stocked-card span { display: grid; gap: 1px; }
#mk .ingredient-stocked-card strong { font-size: .875rem; font-weight: 600; }
#mk .ingredient-stocked-card small { color: var(--e-muted); font-size: .78125rem; line-height: 1.35; }
#mk .generic-selection-art { border-radius: 50%; background: var(--e-s3); }
#mk .bowl-summary small { letter-spacing: 0; }
#mk .bowl-row .selection-art { width: 30px; height: 30px; }
#mk .bowl-row { gap: 2px; }
@media (max-width: 760px) {
  #mk .mobile-nav-item .nav-badge { top: 4px; left: calc(50% + 6px); min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; font-size: .625rem; }
}

/* ---------- bowl builder chips: drawing, name, and a corner marker ---------- */
#mk .serving-chip { position: relative; grid-template-columns: 30px minmax(0,1fr); gap: 8px; padding: 8px 26px 8px 8px; min-height: 52px; overflow-wrap: normal; word-break: normal; hyphens: none; }
#mk .serving-chip:not(.has-selection-art) { grid-template-columns: minmax(0,1fr); padding-left: 14px; }
#mk .serving-chip .selection-art { width: 30px; height: 30px; }
#mk .serving-chip-state { position: absolute; top: 8px; right: 8px; width: 14px; height: 14px; border-width: 1.5px; }
#mk .serving-chip:not(.off) .serving-chip-state { box-shadow: inset 0 0 0 2.5px var(--e-ember-soft); }
#mk .serving-chip-copy strong { font-size: .8125rem; overflow-wrap: break-word; }
#mk .serving-chip-copy small { font-size: .75rem; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
#mk .serving-choice-with-recipe { border: 0; border-radius: 0; background: transparent; padding: 0; gap: 0; }
#mk .serving-choice-with-recipe .component-recipe-link { min-height: 36px; padding: 0 10px; font-size: .78125rem; }
#mk .serving-plan-head > div { display: none; }
#mk .serving-plan-head { justify-content: flex-end; margin: 0 0 4px; }
#mk .serving-plan-head .secondary { min-height: 44px; font-size: .8125rem; font-weight: 500; background: var(--e-s2); }
#mk section.serving-plan.meal-finish-bar:not(.composition-plan) .serving-plan-head > div { display: block; }
#mk .ingredient-component-card > summary small, #mk .ingredient-component-title > small { color: var(--e-muted); font-weight: 400; font-size: .78125rem; }
#mk .ingredient-scope-tabs, #mk .phase-filters { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
#mk .ingredient-scope-tabs .phase-filter, #mk .phase-filters .phase-filter { padding: 4px 8px; white-space: normal; line-height: 1.15; font-size: .78125rem; }
#mk .taste-launcher .secondary, #mk .taste-launcher button { white-space: nowrap; }

/* ---------- cooking frame layout (replaces the older grid rows) ---------- */
#mk [hidden] { display: none !important; }
#mk .modal { padding: 0; background: var(--e-bg); max-width: none; max-height: none; width: 100vw; height: 100dvh; margin: 0; }
#mk .modal .cook, #mk .modal .prep-guide {
  position: fixed; inset: 0; display: flex; flex-direction: column; width: 100%; max-width: 640px; height: 100dvh; max-height: 100dvh; margin: 0 auto;
  border-radius: 0; box-shadow: none; overflow: hidden; transform: none;
}
#mk .modal .cook > main { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; background: transparent; scrollbar-gutter: auto; }
#mk .modal .cook > header, #mk .modal .cook > footer, #mk .cook-segments, #mk .prep-guide .progress { flex: 0 0 auto; }
#mk .cook > footer { padding: 12px 16px max(20px, var(--safe-bottom)) !important; border: 0; box-shadow: none; justify-content: flex-start; }
#mk .cook > footer button { min-width: 0; }
#mk .cook > footer #backToPrep { margin-left: 0; }
#mk #nextBtn { flex: 1 1 0; overflow: hidden; }
#mk .cook .wake-control [data-wake-retry] { top: 60px; min-height: 44px; }
#mk .cook .wake-control [data-wake-retry] { display: none !important; }
#mk .cook .wake-control [data-wake-toggle][aria-pressed=true] { background: var(--e-s2); color: var(--e-muted); }
#mk .cook .wake-control:has([data-wake-state=active]) [data-wake-toggle][aria-pressed=true],
#mk .cook .wake-control:has([data-wake-state=video]) [data-wake-toggle][aria-pressed=true],
#mk .cook .wake-control:has([data-wake-state=requesting]) [data-wake-toggle][aria-pressed=true] { background: var(--e-ember-soft); color: var(--e-ember-text); }
#mk .cook .wake-control [data-wake-toggle]::before { inset: 12px; }
#mk .cook-step-nav button b { display: block; overflow: visible; text-overflow: clip; }
#mk .cook-step-nav { flex-direction: column; overflow-x: hidden; }
#mk .cook-amt { grid-template-columns: minmax(84px, max-content) minmax(0,1fr); }
#mk .cook-amt > span:first-child { max-width: 46vw; }
#mk .cook-plan > details > summary, #mk .cook-meal-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 14px; font-size: .8125rem; font-weight: 500; color: var(--e-muted); list-style: none; cursor: pointer; }
#mk .cook-meal-details > summary::-webkit-details-marker { display: none; }
#mk .cook .wake-control [data-wake-toggle]::before, #mk .wake-menu > summary::before { width: auto; height: auto; border-radius: 0; box-shadow: none; }
#mk .cook-step-nav button { text-align: left; justify-items: start; }
#mk .cook-step-nav button b { text-align: left; }
#mk .cook-meal-details p { margin: 0 14px 10px; color: var(--e-muted); font-size: .8125rem; font-weight: 400; line-height: 1.45; }
#mk .cook-meal-details p strong { color: var(--e-soft); font-weight: 500; }
#mk .workflow-resume-banner strong { white-space: normal; overflow: visible; }

/* ---------- two-way and three-way switches ---------- */
#mk .reheat-segment { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 4px; padding: 4px; border: 0; border-radius: 999px; background: var(--e-tray); }
#mk .reheat-segment button { min-height: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--e-muted); font-size: .8125rem; font-weight: 500; }
#mk .reheat-segment button[aria-pressed=true], #mk .reheat-segment button.active { background: var(--e-ember-soft); color: var(--e-ember-text); font-weight: 600; }

/* ---------- recipe page: top bar scrolls away with the plate ---------- */
#mk:has(#recipeView:not(.hidden)) .topbar { position: absolute; left: 0; right: 0; top: 0; z-index: 25; }
#mk:has(#recipeView:not(.hidden)) #main { padding-top: 8px; }
#mk .rx-hero { margin-top: -8px; }
#mk .action-menu { z-index: 70; max-height: min(62vh, 520px); overflow: auto; }
#mk .skip { color: var(--e-on-ember); font-weight: 600; border-radius: 0 0 16px 0; }
#mk .skip:not(:focus-visible) { left: -999px; }
#mk .side-note { padding-bottom: 6px; }

/* ---------- Prep tab ---------- */
#mk .prep-header { display: grid; gap: 12px; padding: 16px; margin: 0 0 10px; }
#mk .prep-header h2 { margin: 0; font-size: 1.0625rem; font-weight: 600; }
#mk .prep-header p { margin: 2px 0 0; color: var(--e-muted); font-size: .8125rem; }
#mk .prep-header .card-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; width: 100%; }
#mk .prep-header .card-actions .small { grid-column: 1 / -1; justify-self: start; background: transparent; color: var(--e-ember-text); padding: 0 6px; }
#mk .prep-scope-note, #mk .workflow-note { display: grid; gap: 3px; margin: 0 0 10px; padding: 12px 16px; border: 0; border-radius: 18px; background: var(--e-s2); font-size: .8125rem; line-height: 1.45; }
#mk .prep-scope-note strong, #mk .workflow-note strong { color: var(--e-text); font-size: .875rem; font-weight: 600; }
#mk .prep-scope-note span, #mk .workflow-note span { color: var(--e-muted); }
#mk .prep-card { padding: 16px; margin: 0 0 10px; }
#mk .prep-card.checked { background: var(--e-s1); opacity: .6; }
#mk .prep-check { display: grid; grid-template-columns: 26px 18px minmax(0,1fr); align-items: start; gap: 8px; }
#mk .prep-check input, #mk .ingredient-line.checkable input {
  appearance: none; -webkit-appearance: none; width: 24px; height: 24px; min-height: 24px !important; padding: 0 !important; margin: 1px 0 0;
  border: 2px solid #6E645B !important; border-radius: 8px !important; background: transparent !important; display: grid; place-items: center; cursor: pointer;
}
#mk .prep-check input:checked, #mk .ingredient-line.checkable input:checked { background: var(--e-ember) !important; border-color: var(--e-ember) !important; }
#mk .prep-check input:checked::after, #mk .ingredient-line.checkable input:checked::after { content: ""; width: 11px; height: 6px; border-left: 2.5px solid var(--e-on-ember); border-bottom: 2.5px solid var(--e-on-ember); transform: translateY(-1px) rotate(-45deg); }
#mk .prep-num { color: var(--e-muted); font-size: .875rem; font-weight: 500; line-height: 26px; }
#mk .prep-check strong { font-size: 1rem; font-weight: 600; line-height: 1.3; }
#mk .prep-check p, #mk .prep-check .cook-action { margin: 6px 0 0; color: var(--e-soft); font-size: .9375rem; font-weight: 400; line-height: 1.5; }
#mk .prep-check .instruction-key { font-weight: 600; color: var(--e-text); }
#mk .component-flag, #mk .later-pill { display: inline-flex; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--e-s2); color: var(--e-muted); font-size: .75rem; font-weight: 500; vertical-align: middle; }
#mk .prep-amounts, #mk .advance, #mk .prep-tools { margin: 12px 0 0; }
#mk .advance, #mk .prep-tools { padding: 12px 14px; border: 0; border-radius: 16px; background: var(--e-s2); color: var(--e-muted); font-size: .8125rem; line-height: 1.45; }
#mk .advance strong, #mk .advance-title, #mk .prep-tools-title { color: var(--e-text); font-size: .8125rem; font-weight: 600; }
#mk .prep-tools details { border: 0; border-radius: 12px; background: var(--e-s3); }
#mk .prep-tools summary { min-height: 44px; padding: 0 12px; display: flex; align-items: center; font-weight: 500; font-size: .8125rem; }
#mk .prep-card.component-excluded::after { margin-left: 0; font-size: .8125rem; }
#mk .later-prep { margin: 0 0 10px; padding: 0; }
#mk .later-prep > summary { min-height: 52px; display: flex; align-items: center; padding: 0 16px; color: var(--e-ember-text); font-weight: 600; font-size: .9375rem; cursor: pointer; }
#mk .later-prep > p { padding: 0 16px 12px; margin: 0; color: var(--e-muted); font-size: .8125rem; }
#mk .later-prep .prep-card { background: var(--e-s2); margin: 0 10px 10px; }

/* ---------- Cook tab ---------- */
#mk .recipe-guides { margin: 0 0 10px; }
#mk .recipe-guide { padding: 16px; border: 0; border-radius: 22px; background: var(--e-s1); }
#mk .recipe-guide-head h2 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; }
#mk .recipe-guide-head p { margin: 0 0 10px; color: var(--e-muted); font-size: .8125rem; line-height: 1.45; }
#mk .guide-map { display: grid; gap: 0; border: 0; background: transparent; }
#mk .guide-map-item { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 12px; padding: 10px 0; border: 0; border-top: 1px solid var(--e-line); background: transparent; border-radius: 0; }
#mk .guide-map-item > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--e-ember-soft); color: var(--e-ember-text); font-size: .8125rem; font-weight: 600; }
#mk .guide-map-item strong, #mk .guide-map-item h3 { display: block; margin: 2px 0 2px; font-size: .875rem; font-weight: 600; }
#mk .guide-map-item p, #mk .guide-map-item div > span { margin: 0; color: var(--e-muted); font-size: .8125rem; line-height: 1.45; }

/* ---------- Store tab ---------- */
#mk .store-panel { display: grid; gap: 10px; padding: 0; border: 0; background: transparent; }
#mk .store-actions { display: grid; gap: 8px; }
#mk .store-action { display: grid; gap: 2px; width: 100%; }
#mk .store-action span { font-size: .9375rem; font-weight: 600; }
#mk .store-action small { font-size: .8125rem; font-weight: 400; line-height: 1.35; }
#mk .store-action.primary small { color: var(--e-on-ember); opacity: .85; }
#mk .store-keyline { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; }
#mk .store-keyline span { padding: 6px 12px; border: 0; border-radius: 999px; background: var(--e-s1); color: var(--e-muted); font-size: .8125rem; font-weight: 500; }
#mk .storage-reference > summary, #mk .later-flow-card > summary { display: grid; grid-template-columns: minmax(0,1fr); gap: 2px; min-height: 60px; padding: 12px 16px; list-style: none; cursor: pointer; }
#mk .storage-reference > summary::-webkit-details-marker, #mk .later-flow-card > summary::-webkit-details-marker { display: none; }
#mk .storage-reference > summary span, #mk .later-flow-card > summary span { font-size: .9375rem; font-weight: 600; }
#mk .storage-reference > summary small, #mk .later-flow-card > summary small { font-size: .8125rem; color: var(--e-muted); }
#mk .storage-grid { display: grid; gap: 8px; padding: 0 10px 10px; }
#mk .storage-card { padding: 14px; background: var(--e-s2); border-radius: 18px; }
#mk .storage-card h3 { margin: 0 0 6px; font-size: .9375rem; font-weight: 600; }
#mk .storage-card p, #mk .storage-card li { color: var(--e-soft); font-size: .875rem; line-height: 1.5; }
#mk .later-flow-intro p { margin: 0; padding: 0 16px 10px; color: var(--e-muted); font-size: .8125rem; }
#mk .later-flow-card .instruction { background: var(--e-s2); margin: 0 10px 10px; }

/* ---------- Nutrition tab ---------- */
#mk .nutrition-wrap { padding: 16px; display: grid; gap: 12px; }
#mk .meal-nutrition { border: 0; border-radius: 18px; background: var(--e-s2); overflow: hidden; }
#mk .meal-nutrition > header { padding: 14px 16px; background: transparent; border: 0; }
#mk .meal-nutrition > header p { margin: 0; color: var(--e-muted); font-size: .8125rem; font-weight: 500; }
#mk .meal-nutrition > header strong { font-size: 1.5rem; font-weight: 600; color: var(--e-text); line-height: 1.2; }
#mk .meal-breakdown > summary { min-height: 48px; display: flex; align-items: center; padding: 0 16px; font-size: .875rem; font-weight: 500; color: var(--e-ember-text); cursor: pointer; }
#mk .nutrition-note { margin: 0; color: var(--e-muted); font-size: .8125rem; line-height: 1.5; }
#mk .composition-disclosure > summary { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px 12px; padding: 10px 12px 14px 18px; }
#mk .bowl-summary { display: contents; }
#mk .bowl-summary small { grid-column: 1; grid-row: 1; }
#mk .composition-cue { grid-column: 2; grid-row: 1; }
#mk .bowl-row { grid-column: 1 / -1; grid-row: 2; gap: 3px; }
#mk .bowl-row .selection-art { width: 34px; height: 34px; }
#mk .bowl-summary strong { grid-column: 1 / -1; grid-row: 3; }
#mk .serving-chip-state { font-size: 0 !important; color: transparent !important; }
#mk .variant-warning, #mk .variant-note { font-weight: 400; }
#mk .variant-warning strong, #mk .variant-note strong { font-weight: 600; }
/* plain ingredient rows: the amount chip grows with its text; a long amount pushes the name to its own line */
#mk .ingredient-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; }
#mk .ingredient-line > input { flex: 0 0 auto; }
#mk .ingredient-line .ingredient-amount { flex: 0 1 auto; min-width: 82px; max-width: calc(100% - 40px); padding: 4px 10px; }
#mk .ingredient-line .ingredient-name-wrap { flex: 1 1 150px; min-width: 0; font-weight: 400; }
#mk .ingredient-name-wrap b, #mk .ingredient-name-wrap strong { font-weight: 400; }
#mk .phase-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 2px; color: var(--e-muted); font-size: .8125rem; font-weight: 400; }
#mk .phase-legend * { font-weight: 400; }
#mk .phase-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-right: 6px; font-weight: 600; font-size: .75rem; }
#mk .ingredient-actions, #mk .panel-actions.ingredient-actions { display: grid; gap: 10px; margin: 10px 0; }
#mk .ingredient-group { margin: 0 0 10px; padding: 6px 16px 8px; border: 0; border-radius: 22px; background: var(--e-s1); }
#mk .ingredient-group > h3 { margin: 10px 0 4px; }
#mk .ingredient-scale-card { display: grid; gap: 10px; margin: 0 0 10px; }
#mk .ingredient-scale-card strong { font-size: 1.125rem; font-weight: 600; }
#mk .ingredient-scale-card p { margin: 0; color: var(--e-muted); font-size: .8125rem; }
#mk .ingredient-scale-card .scale-btn { flex: 1; }
#mk .ingredient-line, #mk .ingredient-line .ingredient-name-wrap, #mk .ingredient-line .ingredient-name-wrap * { font-weight: 400; }
#mk .ingredient-line .ingredient-name-wrap .phase-badge { font-weight: 600; }
#mk .ingredient-line .ingredient-amount { font-weight: 600; }
#mk .toast { left: 16px; right: 16px; width: fit-content; max-width: calc(100% - 32px); margin: 0 auto; padding: 12px 18px; text-align: center; transform: translateY(20px); }
#mk .toast.show { transform: none; }
#mk #importView h2, #mk #backupView h2, #mk #aboutView h2, #mk #conflictsView h2 { font-size: 1.125rem; font-weight: 600; }
#mk #importView p, #mk #backupView p, #mk #aboutView p { font-size: .9375rem; line-height: 1.55; color: var(--e-soft); }
#mk input, #mk select, #mk textarea { font-weight: 400; }
#mk select { font-weight: 500; }

#mk .cook-amounts-more > summary { display: flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--e-ember-text); font-size: .875rem; font-weight: 500; cursor: pointer; list-style: none; }
#mk .cook-amounts-more > summary::-webkit-details-marker { display: none; }
#mk .count-sheet .dialog-head, #mk .app-dialog .dialog-head, #mk .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
#mk .count-sheet .dialog-head > div, #mk .card-head > div { min-width: 0; flex: 1 1 auto; }

/* ---------- narrow screens and large text ---------- */
#mk .rx-hero h1 { font-size: min(1.4375rem, 6.2vw); overflow-wrap: normal; word-break: normal; width: min(56%, 320px); }
#mk .rx-hero .rx-plate { width: min(250px, 64vw); height: min(250px, 64vw); right: max(-64px, -16vw); top: max(-58px, -15vw); }
@media (max-width: 760px) {
  #mk .mobile-nav-item > small { font-size: 10.5px; }
  #mk .mobile-nav-item .nav-badge { font-size: 10px; }
}
#mk .inventory-grid, #mk .state-grid, #mk .history-list { grid-template-columns: minmax(0,1fr); }
#mk .inventory-card, #mk .freezer-food-group, #mk .freezer-food-group details, #mk .freezer-builder, #mk .cookware-card { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
#mk .inventory-card { padding: 16px; }
#mk .inventory-card h2 { font-size: 1rem; font-weight: 600; line-height: 1.3; }
#mk .inventory-card .remaining { color: var(--e-ember); font-size: 1.75rem; font-weight: 700; line-height: 1; }
#mk .inventory-card .remaining-label { color: var(--e-muted); font-size: .75rem; font-weight: 500; }
#mk .inventory-meta { color: var(--e-muted); font-size: .8125rem; }
#mk .inventory-note, #mk .reheat-brief { color: var(--e-muted); font-size: .8125rem; line-height: 1.45; }
#mk .freezer-food-group { margin: 14px 0; padding: 14px 16px; }
#mk .freezer-food-group > header { flex-wrap: wrap; }
#mk .freezer-food-group > header h2 { font-size: 1rem; font-weight: 600; }
#mk .freezer-food-group summary { min-height: 44px; display: flex; align-items: center; padding: 0; color: var(--e-ember-text); font-size: .8125rem; font-weight: 500; }
#mk .freezer-food-group .inventory-card { background: var(--e-s2); }
#mk .freezer-builder { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; padding: 16px; border: 0; border-radius: 22px; background: var(--e-s1); }
#mk .freezer-builder h2 { margin: 2px 0 4px; font-size: 1.125rem; font-weight: 600; line-height: 1.25; }
#mk .freezer-builder li { padding: 6px 0; border-radius: 0; background: transparent; border-bottom: 1px solid var(--e-line); font-size: .8125rem; }
#mk .freezer-builder li:last-child { border-bottom: 0; }
#mk .freezer-builder li strong { white-space: nowrap; color: var(--e-ember-text); font-weight: 600; }
#mk .freezer-builder li.missing strong { color: var(--e-danger); }
#mk .freezer-builder .card-actions { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
#mk .section-heading { margin: 4px 4px 10px; }
#mk .section-heading .eyebrow { display: none; }
#mk .inventory-card .card-head > div:last-child { flex: 0 0 auto; text-align: right; }
#mk .inventory-card .remaining-label { overflow-wrap: normal; white-space: nowrap; }
#mk .inventory-card .eyebrow { margin: 0 0 2px; font-size: .8125rem; }
#mk .inventory-portion { padding: 10px 12px; border: 0; border-radius: 14px; background: var(--e-bg); font-size: .8125rem; color: var(--e-muted); }
#mk .inventory-portion strong { display: block; color: var(--e-text); font-size: .8125rem; font-weight: 600; }
#mk .reheat-brief { padding: 10px 12px; border: 0; border-radius: 14px; background: var(--e-bg); }
#mk .reheat-brief strong { color: var(--e-text); font-weight: 600; }
#mk .inventory-actions { gap: 8px; margin-top: 12px; }
#mk .freezer-food-group .inventory-card .secondary, #mk .ingredient-run-metrics + .ingredient-run-actions .secondary { background: var(--e-tab); }

/* ---------- checkboxes everywhere ---------- */
#mk input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 24px; height: 24px; min-height: 24px; padding: 0; margin: 0; flex: 0 0 auto;
  border: 2px solid #6E645B; border-radius: 8px; background: transparent; display: inline-grid; place-items: center; cursor: pointer; vertical-align: middle;
}
#mk input[type=checkbox]:checked { background: var(--e-ember); border-color: var(--e-ember); }
#mk input[type=checkbox]:checked::after { content: ""; width: 11px; height: 6px; border-left: 2.5px solid var(--e-on-ember); border-bottom: 2.5px solid var(--e-on-ember); transform: translateY(-1px) rotate(-45deg); }

/* ---------- Shopping ---------- */
#mk .shopping-summary { display: grid; gap: 12px; padding: 16px; border: 0; border-radius: 22px; background: var(--e-s1); margin: 0 0 14px; }
#mk .shopping-summary-copy > strong { display: block; font-size: 1.0625rem; font-weight: 600; }
#mk .shopping-summary-copy > span { display: block; margin-top: 2px; color: var(--e-muted); font-size: .8125rem; line-height: 1.45; }
#mk .shopping-recipe-links { display: grid; gap: 6px; margin-top: 10px; }
#mk .shopping-recipe-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 46px; padding: 0 14px; border: 0; border-radius: 16px; background: var(--e-s2); color: var(--e-text); text-align: left; }
#mk .shopping-recipe-link strong { font-size: .875rem; font-weight: 500; }
#mk .shopping-recipe-link span { color: var(--e-ember-text); font-size: .8125rem; font-weight: 500; white-space: nowrap; }
#mk .shopping-filters { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px; padding: 4px; border: 0; border-radius: 22px; background: var(--e-tray); }
#mk .shopping-filter { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 18px; background: transparent; color: var(--e-muted); font-size: .8125rem; font-weight: 500; box-shadow: none; }
#mk .shopping-filter strong { font-size: .8125rem; font-weight: 600; background: transparent; color: inherit; padding: 0; min-width: 0; }
#mk .shopping-filter.active { background: var(--e-ember-soft); color: var(--e-ember-text); font-weight: 600; }
#mk .shopping-list-menu { border: 0; border-radius: 16px; background: var(--e-s2); }
#mk .shopping-list-menu > summary { display: flex; align-items: center; min-height: 46px; padding: 0 14px; color: var(--e-muted); font-size: .8125rem; font-weight: 500; cursor: pointer; }
#mk .shopping-list-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 10px 10px; }
#mk .shopping-section { padding: 4px 16px 6px; margin: 0 0 12px; }
#mk .shopping-aisle-heading { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0 6px; border: 0; background: transparent; }
#mk .shopping-aisle-heading h2 { margin: 0; font-size: 1rem; font-weight: 600; }
#mk .shopping-aisle-heading span { color: var(--e-muted); font-size: .8125rem; }
#mk .shopping-row {
  display: grid; grid-template-columns: 32px minmax(0,1fr) 44px; grid-template-areas: "check name delete" "check amount coverage"; align-items: center; gap: 6px 10px;
  padding: 12px 0; border: 0; border-top: 1px solid var(--e-line); background: transparent; border-radius: 0;
}
#mk .shopping-row .shopping-check { grid-area: check; align-self: start; display: grid; place-items: center; width: 32px; height: 44px; }
#mk .shopping-row .shopping-name { grid-area: name; display: grid; gap: 2px; min-width: 0; }
#mk .shopping-row .shopping-amount { grid-area: amount; justify-self: start; display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 12px; background: var(--e-ember-soft); color: var(--e-amount); font-size: .9375rem; font-weight: 600; }
#mk .shopping-row .shopping-amount small { color: var(--e-ember-text); font-size: .75rem; font-weight: 500; }
#mk .shopping-row .shopping-coverage { grid-area: coverage; grid-column: 2 / -1; justify-self: end; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--e-s2); color: var(--e-soft); font-size: .8125rem; font-weight: 500; white-space: nowrap; }
#mk .shopping-row .shopping-amount { grid-column: 2; }
#mk .shopping-row .shopping-delete { grid-area: delete; align-self: start; background: transparent; color: var(--e-muted); }
#mk .shopping-item-title { font-size: .9375rem; font-weight: 600; color: var(--e-text); }
#mk .shopping-item-note { color: var(--e-muted); font-size: .8125rem; font-weight: 400; line-height: 1.4; }
#mk .shopping-breakdown > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--e-ember-text); font-size: .8125rem; font-weight: 500; cursor: pointer; }
#mk .shopping-breakdown-body { padding: 10px 12px; border-radius: 14px; background: var(--e-bg); font-size: .8125rem; color: var(--e-soft); }
#mk .shopping-recipe-contribution h3 { margin: 0 0 4px; font-size: .8125rem; font-weight: 600; }
#mk .shopping-row.checked .shopping-item-title { color: var(--e-muted); text-decoration: line-through; }
#mk .shopping-row.checked .shopping-amount { opacity: .5; }
#mk .pantry-toggle { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--e-ember-text); font-size: .8125rem; font-weight: 500; text-decoration: underline; text-align: left; }
#mk .prep-guide > footer { flex-wrap: nowrap; align-items: center; }
#mk .prep-guide > footer .primary { flex: 1 1 0; min-height: 62px; border-radius: 31px; font-size: 1.0625rem; }
#mk .prep-guide > footer .secondary { min-height: 62px; border-radius: 31px; padding: 0 18px; white-space: nowrap; font-size: .875rem; }
#mk #prepGuideContent > * + * { margin-top: 12px; }
#mk .prep-guide h3 { font-size: 1.5rem; }

/* ---------- tap targets ---------- */
#mk .home-heading-actions .round-btn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
#mk .serving-choice-with-recipe .component-recipe-link, #mk .component-recipe-link { min-height: 44px; }
#mk .cook-step-label { min-height: 44px; }
#mk .cook-head-copy h2 { margin-top: -10px; }
#mk .prep-guide .cook-head-copy h2 { margin-top: 0; }
#mk .component-ready-choice button, #mk .component-methods button, #mk .component-availability button { min-height: 44px; }
#mk details > summary { min-height: 44px; }
#mk .production-yield-notes > summary, #mk .tray-layout > summary, #mk .prompt-review > summary, #mk .ingredient-stocked-group > summary { display: flex; align-items: center; min-height: 44px; }
#mk pre { font-size: .75rem; color: var(--e-soft); background: var(--e-tray); border-radius: 14px; }

/* ---------- printing a recipe: plain dark-on-white paper ---------- */
@media print {
  :root, #mk {
    --e-bg: #fff; --e-s1: #fff; --e-s2: #f4f1ee; --e-s3: #ebe6e1; --e-tab: #ebe6e1; --e-text: #151210; --e-soft: #2b2622; --e-muted: #5c544d;
    --e-line: #d9d2cb; --e-ember-soft: #f6e6dd; --e-ember-text: #9a3f17; --e-amount: #7d3110; --e-tray: #fff; --e-ok: #2d6a3a; --e-danger: #a32a1c; --e-danger-soft: #f8e3df;
    color-scheme: light;
  }
  html { background: #fff; }
  #mk { background: #fff; color: #151210; }
  #mk .mobile-app-nav, #mk .rx-hero-actions, #mk .rx-actions, #mk .tabs, #mk .panel, #mk .rx-note, #mk .taste-launcher, #mk .composition-disclosure { display: none !important; }
  #mk .rx-hero { height: auto; margin: 0; overflow: visible; }
  #mk .rx-hero .rx-plate { display: none; }
  #mk .rx-hero h1 { position: static; width: auto; font-size: 22pt; }
  #mk #main { padding: 0; max-width: none; }
}
@media print { #mk .variant-box, #mk .serving-plan, #mk .rx-facts, #mk .workflow-resume-banner { display: none !important; } }
