/* BizTarter Food Costing · M0 Core · shared look (core/ui). Header design APPROVED by Jeff 2026-11-22; colors = the
   sample shades from the Spec (Q8, contrast TESTED by UX). Poppins is bundled (vendor/poppins, OFL 1.1, SHA-256 in
   VENDOR.md, checked by tests/vendor.test.js), so it works offline. */
@font-face { font-family: Poppins; font-style: normal; font-weight: 400; font-display: swap; src: url("../../vendor/poppins/Poppins-Regular.ttf") format("truetype"); }
@font-face { font-family: Poppins; font-style: normal; font-weight: 600; font-display: swap; src: url("../../vendor/poppins/Poppins-SemiBold.ttf") format("truetype"); }
@font-face { font-family: Poppins; font-style: normal; font-weight: 700; font-display: swap; src: url("../../vendor/poppins/Poppins-Bold.ttf") format("truetype"); }
@font-face { font-family: Poppins; font-style: normal; font-weight: 800; font-display: swap; src: url("../../vendor/poppins/Poppins-ExtraBold.ttf") format("truetype"); }
:root {
  --navy: #1B2A4A;
  --navy-light: #2C3F66;
  --copper-dark: #8A5226;   /* copper buttons, small copper text (white on it 6.33:1) */
  --copper: #B87333;        /* lines and decoration only, never behind small text */
  --red: #B91C1C;           /* errors, losses (6.47:1 on white) */
  --red-bg: #FEF2F2;
  --warn-bg: #FFF7ED;
  --ok: #166534;
  --ok-bg: #F0FDF4;
  --info-bg: #EFF6FF;
  --text: #1F2937;
  --muted: #4B5563;
  --line: #D1D5DB;
  --bg: #F3F4F6;
  --card: #FFFFFF;
  --radius: 10px;
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
.m0-app { min-height: 100vh; display: flex; flex-direction: column; }

/* Header (Jeff 2026-11-22, look and sizes from his prototype header, new code). Dark navy gradient.
   Phone: ONE row = logo about 40 px, "Saved ✓" (Spec section 6), small EN/flag pill (44 px tap areas).
   PC: logo + app name | headline + version badge | Saved ✓, Fullscreen, EN/flag pill (prototype size). */
.m0-header { background: linear-gradient(180deg, #1A2438 0%, #27374F 100%); color: #fff; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; padding: 6px 10px; position: relative; flex-wrap: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, .12); }
.m0-top { position: sticky; top: 0; z-index: 5; } /* header + "Not saved" strip stay visible while scrolling */
.m0-brand { display: flex; flex-direction: column; align-items: center; flex: none; }
.m0-logo-full { display: block; height: 40px; width: auto; }
.m0-app-name, .m0-headline-box, .m0-version { display: none; }
.m0-fs-btn { display: none; }
.m0-fs-btn[hidden] { display: none !important; }
.m0-header-right { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; margin-left: auto; min-width: 0; }

/* "Saved ✓" toast (Jeff 2026-11-22): INSIDE the navy header, so it never covers content or buttons.
   Phone: small, centered in the header (in the gap between logo and pill). PC: just left of the right icons.
   Takes no layout space and no taps; fades out after about 2.5 s. */
.m0-toast { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); z-index: 1;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--ok); color: #fff;
  font-size: 12px; font-weight: 600; box-shadow: 0 1px 6px rgba(0, 0, 0, .35);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s, transform .3s, visibility 0s .3s; }
.m0-toast-show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); transition: opacity .3s, transform .3s; }
/* "Not saved" (Jeff 2026-11-22): a strip just BELOW the header, red, with ✕. Never hides by itself. */
/* CR-003: ONE red strip (replaces the old red banner): Spec text, [Back up now], ✕ (44 px tap). */
.m0-error-strip { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 12px; background: var(--red);
  color: #fff; font-size: 14px; font-weight: 600; }
.m0-error-strip[hidden] { display: none; }
.m0-error-text { flex: 1; min-width: 0; }
.m0-error-strip .m0-btn { flex: none; }
.m0-toast-close { background: none; border: 0; color: #fff; font: inherit; font-size: 15px; min-width: 44px;
  min-height: 44px; cursor: pointer; border-radius: 999px; }
.m0-toast-close:focus-visible { outline: 3px solid var(--copper); outline-offset: -4px; }
@media (prefers-reduced-motion: reduce) { .m0-toast, .m0-toast-show { transition: none; } }
/* Language pill (Jeff 2026-11-22): "EN" | Philippine flag; the selected side has a white pill. Visible pill about
   28 x 82 px (Jeff: smaller, balanced next to the logo). Each side is still a 44 x 44 px tap target: the track is
   drawn by ::before and the white pill inside each button (background-clip), so the extra tap area is invisible. */
.m0-lang-pill { display: flex; flex: none; position: relative; }
.m0-lang-pill::before { content: ""; position: absolute; left: 50%; top: 50%; width: 82px; height: 28px;
  transform: translate(-50%, -50%); box-sizing: border-box; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1.5px solid rgba(255, 255, 255, .28); }
.m0-lang-seg { position: relative; width: 44px; height: 44px; padding: 10px 3px; border: 0; border-radius: 999px;
  background: transparent; background-clip: content-box; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .4px; }
.m0-lang-seg[aria-pressed="true"] { background-color: #fff; color: var(--navy); }
.m0-lang-seg:focus-visible { outline: 3px solid var(--copper); outline-offset: 1px; }
.m0-flag { display: block; border-radius: 2px; width: 22px; height: 11px; }
.m0-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Body: nav + content */
.m0-body { flex: 1; display: flex; flex-direction: column; }
.m0-content { flex: 1; padding-bottom: 80px; }
.m0-main { padding: 12px; max-width: 760px; margin: 0 auto; outline: none; }
.m0-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line);
  z-index: 5; padding-bottom: env(safe-area-inset-bottom); }
.m0-nav-item { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: none; border: 0; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.m0-nav-icon { font-size: 20px; line-height: 1; }
.m0-nav-active { color: var(--navy); font-weight: 700; box-shadow: inset 0 3px 0 var(--copper); }

/* Banners (Sample band on top, then ONE banner) */
.m0-banners:empty { display: none; }
.m0-sample-band { background: var(--copper-dark); color: #fff; padding: 8px 12px; }
.m0-sample-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m0-sample-note { font-size: 13px; }
.m0-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.m0-banner-red { background: var(--red); color: #fff; font-weight: 600; }
.m0-banner-warn { background: var(--warn-bg); border-left: 5px solid var(--copper); }
.m0-banner-info { background: var(--info-bg); }
.m0-banner-actions { display: flex; gap: 8px; margin-left: auto; }

/* Screens and cards */
.m0-title { font-size: 22px; color: var(--navy); margin: 8px 0 12px; }
.m0-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 14px; margin-bottom: 12px; }
.m0-card-title { font-size: 17px; margin: 0 0 6px; color: var(--navy); }
.m0-back { background: none; border: 0; color: var(--navy); font: inherit; font-weight: 600; min-height: 44px; padding: 0; cursor: pointer; }
.m0-step { color: var(--copper-dark); font-weight: 600; margin: 0 0 8px; }
.m0-muted { color: var(--muted); font-size: 14px; }
.m0-privacy { font-size: 14px; margin-top: 0; }

/* Fields */
.m0-field { margin: 0 0 14px; border: 0; padding: 0; }
.m0-label-row { display: flex; align-items: center; gap: 4px; font-weight: 600; margin-bottom: 4px; padding: 0; }
.m0-switch-row { justify-content: flex-start; }
.m0-switch-row .m0-switch { margin-left: auto; }
.m0-input, .m0-file { width: 100%; font: inherit; font-size: 16px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--text); }
.m0-input:focus, .m0-file:focus { outline: 3px solid var(--copper); outline-offset: 1px; }
.m0-input-short { width: 90px; }
.m0-input-row { display: flex; align-items: center; gap: 6px; }
.m0-input-row .m0-input:not(.m0-input-short) { flex: 1; }
.m0-unit { color: var(--muted); }
.m0-note { font-size: 13px; color: var(--muted); margin-top: 4px; }
.m0-has-error .m0-input, .m0-has-error .m0-file { border: 2px solid var(--red); }
.m0-error { color: var(--red); font-size: 14px; margin-top: 4px; font-weight: 600; }
.m0-error:empty { display: none; }
.m0-help-btn { background: none; border: 0; color: var(--navy); font-size: 20px; min-width: 44px; min-height: 44px; cursor: pointer; }
.m0-eye { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 18px; }
.m0-eye[aria-pressed="true"] { background: var(--info-bg); }
.m0-radios { display: block; }
.m0-radio { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; min-height: 44px; }
.m0-radio input, .m0-tick input { width: 22px; height: 22px; accent-color: var(--navy); }
.m0-tick { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 8px 0; font-weight: 600; }

/* On/Off switch */
.m0-switch { appearance: none; width: 52px; height: 30px; border-radius: 15px; background: #9CA3AF; position: relative; cursor: pointer;
  margin: 7px 0; flex: none; transition: background .15s; }
.m0-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.m0-switch:checked { background: var(--navy); }
.m0-switch:checked::after { left: 25px; }
.m0-switch:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }

/* Buttons */
.m0-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.m0-btn { font: inherit; font-size: 15px; font-weight: 600; min-height: 44px; padding: 8px 16px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.m0-btn:disabled { opacity: .45; cursor: not-allowed; }
.m0-btn-primary { background: var(--navy); color: #fff; }
.m0-btn-secondary { background: var(--copper-dark); color: #fff; }
.m0-btn-danger { background: var(--red); color: #fff; }
.m0-btn-ghost { background: #fff; color: var(--navy); border-color: var(--navy); }
.m0-btn-light { background: #fff; color: var(--navy); }
.m0-btn-wide { width: 100%; margin: 6px 0; }

/* Messages */
.m0-msg { border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.m0-msg-line { margin-top: 4px; }
.m0-msg-error { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); font-weight: 600; }
.m0-msg-warn { background: var(--warn-bg); border-left: 5px solid var(--copper); }
.m0-msg-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); font-weight: 600; word-break: break-word; }
.m0-msg-info { background: var(--info-bg); }
.m0-hint-from { margin: 6px 0 12px; }
.m0-hint-text { background: var(--bg); border-radius: 6px; padding: 6px 10px; white-space: pre-wrap; word-break: break-word; }
.m0-badge-estimate { display: inline-block; font-size: 12px; font-weight: 600; color: var(--copper-dark); border: 1px solid var(--copper-dark); border-radius: 10px; padding: 0 8px; }

/* Restore step 2: compare */
.m0-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m0-compare-col { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.m0-compare-col h3 { margin: 0 0 4px; font-size: 15px; color: var(--navy); }
.m0-compare-col p { margin: 0; }

/* Dialogs: bottom sheet on phone, small box on PC */
.m0-dialog { border: 0; border-radius: 14px 14px 0 0; padding: 16px; width: 100%; max-width: 100%; margin: auto 0 0 0; color: var(--text); }
.m0-dialog::backdrop { background: rgba(17, 24, 39, .55); }
.m0-dialog-title { font-size: 18px; margin: 0 0 8px; color: var(--navy); }
.m0-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* PC */
@media (min-width: 900px) {
  /* Header (Jeff 2026-11-22, second PC round): logo 30% smaller and close to the left edge (10 px), version badge
     under the logo; headline 30% smaller with "Food Costing" under it; Fullscreen = icon only; the pill has proper
     right padding; free space on the right for more icons later. */
  .m0-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; padding: 8px 20px 8px 10px; }
  .m0-brand { justify-self: start; align-items: flex-start; gap: 4px; }
  .m0-logo-full { height: 53px; }
  /* Version badge (Jeff 2026-11-22, design APPROVED): 8 px text, centered under the "T" of BizTarter
     (the T's center is at 57.7% of the logo width: x 224-272 of the 430 px logo file, measured). */
  .m0-version { display: inline-block; margin-left: 57.7%; transform: translateX(-50%); font-size: 8px; font-weight: 800;
    letter-spacing: .35px; line-height: 1.3; white-space: nowrap; text-transform: uppercase; color: #F0C27B;
    border: 1px solid rgba(240, 194, 123, .55); background: rgba(0, 0, 0, .2); border-radius: 4px; padding: 1px 6px; }
  .m0-headline-box { display: flex; flex-direction: column; align-items: center; gap: 2px; justify-self: center;
    grid-column: 2; min-width: 0; }
  .m0-headline { font-size: 15px; font-weight: 800; letter-spacing: .2px; text-align: center; }
  .m0-app-name { display: block; font-size: 15px; font-weight: 700; color: #F0C27B; }
  .m0-header-right { gap: 10px; justify-self: end; grid-column: 3; }
  .m0-fs-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
    border-radius: 10px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); color: #fff;
    cursor: pointer; }
  .m0-fs-btn:hover { background: rgba(255, 255, 255, .12); }
  .m0-fs-btn:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }
  .m0-lang-pill::before { width: 104px; height: 40px; }
  .m0-lang-seg { width: 52px; height: 44px; padding: 6px 5px; font-size: 13px; letter-spacing: .5px; }
  .m0-flag { width: 28px; height: 14px; }
  .m0-header-right { position: relative; }
  .m0-toast { left: auto; right: calc(100% + 10px); transform: translateY(-50%) scale(.9); font-size: 13px; padding: 5px 12px; }
  .m0-toast-show { transform: translateY(-50%) scale(1); }
}
@media (min-width: 900px) {
  .m0-body { flex-direction: row; }
  .m0-nav { position: static; flex-direction: column; width: 200px; border-top: 0; border-right: 1px solid var(--line); padding: 12px 0; }
  .m0-nav-item { flex: none; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 0 18px; font-size: 15px; min-height: 48px; }
  .m0-nav-active { box-shadow: inset 4px 0 0 var(--copper); background: var(--bg); }
  .m0-content { padding-bottom: 0; }
  .m0-main { padding: 20px; }
  .m0-dialog { border-radius: 14px; max-width: 440px; margin: auto; }
}
