/* ============================================================
   FoodLab Participant App — styles
   Colour + component system carried over from the v0.1 wireframe,
   re-worked from a 6-phone gallery into one real full-screen app.
   ============================================================ */

:root {
  /* FoodLab brand palette — HERB green + HARINA cream + spice accents */
  --bg: #F0EADC;            /* HARINA — app background (cream) */
  --ink: #27421D;           /* HERB — primary text + headings (dark green) */
  --ink-soft: #5E6B4F;      /* muted herb-grey for secondary text */
  --ink-light: #939C84;     /* lightest text */
  --card: #FFFFFF;          /* white cards lift off the cream */
  --line: #E2DBC9;          /* soft divider on cream */
  --green: #27421D;         /* HERB — main brand green (nav, accents, highlights) */
  --green-soft: #E3E8D8;    /* soft herb tint */
  --terracotta: #D23F2F;    /* SAFFRON — primary action / alerts */
  --terracotta-soft: #F7E0DB;
  --ochre: #E99D51;         /* TURMERIC */
  --ochre-soft: #FBEEDB;
  --teal: #888F65;          /* CILANTRO (sage) */
  --teal-soft: #E8EADF;
  --plum: #552C25;          /* CINNAMON (warm brown) */
  --plum-soft: #ECE1DE;
  --tick: #43550A;          /* BASIL — done/success */
  --pending: #E99D51;       /* TURMERIC — pending */
  --nav-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #DCDFCF;
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* The whole app sits in a phone-width column, centred on big screens,
   full-bleed on a real phone. */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 460px;
  /* Fixed to the viewport height so .screen scrolls *inside* the shell and the
     absolutely-positioned .bottom-nav stays pinned. On wide screens the media
     query below overrides this with the fixed "phone frame" height. */
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,0.12);
}

/* Scrollable content area; leaves room for the bottom nav. */
.screen {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(16px, env(safe-area-inset-top)) 18px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}
.screen.no-nav { padding-bottom: 32px; }

/* ---------- Buttons / tappable base ---------- */
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
.tap { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform .06s ease, opacity .06s ease; }
.tap:active { transform: scale(0.98); opacity: 0.9; }

/* ---------- App header (Home) ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 20px;
}
.greeting { font-size: 24px; font-weight: 700; line-height: 1.15; }
.greeting span { color: var(--green); }
.greeting .sub { display:block; font-size: 14px; font-weight: 500; color: var(--ink-soft); margin-top: 2px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--terracotta); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.bell {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bell-badge {
  position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 10px; background: var(--terracotta); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
  border: 2px solid var(--bg);
}

/* ---------- Announcements ---------- */
.ann-pinned { margin-bottom: 16px; }
.ann-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; }
.ann-card.pinned { border-left: 4px solid var(--ochre); }
.ann-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ann-pin { font-size: 13px; }
.ann-title { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; }
.ann-time { font-size: 12px; color: var(--ink-light); flex-shrink: 0; }
.ann-msg { font-size: 14px; color: var(--ink); line-height: 1.5; }
.ann-by { font-size: 12px; color: var(--ink-soft); margin-top: 8px; font-weight: 600; }
.ann-seeall { display: block; width: 100%; text-align: center; padding: 10px; font-size: 14px; font-weight: 700; color: var(--green); }
.ann-seeall.solo { display: flex; align-items: center; justify-content: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; color: var(--ink); }

/* ---------- Sub-page header ---------- */
.sub-header { display: flex; align-items: center; gap: 14px; padding: 4px 0 18px; }
.back-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--ink); line-height: 1;
}
.sub-title { font-size: 21px; font-weight: 700; }
/* Embedded-tool header: the back control exits the whole tool (to the Tools home), which is
   easy to mistake for a "back to this tool's home" button — so it carries a label. The title
   truncates rather than pushing the pill off-screen for longer tool names. */
.back-btn.tool-exit { width: auto; height: 38px; border-radius: 999px; padding: 0 15px; gap: 6px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.tool-frame-screen .sub-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Tiles (Home) ---------- */
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile {
  aspect-ratio: 1 / 1; border-radius: 20px; padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff; position: relative; overflow: hidden;
}
.tile.terracotta { background: var(--terracotta); }
.tile.green { background: var(--green); }
.tile.ochre { background: var(--ochre); }
.tile.teal { background: var(--teal); }
.tile.plum { background: var(--plum); }
.tile .icon {
  width: 44px; height: 44px; background: rgba(255,255,255,0.2);
  border-radius: 13px; display: flex; align-items: center; justify-content: center;
}
.tile .label { font-size: 18px; font-weight: 700; line-height: 1.2; }
.tile .sub { font-size: 12.5px; opacity: 0.9; margin-top: 2px; }
.tile .badge {
  position: absolute; top: 12px; right: 12px;
  background: #fff; color: var(--ink); font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 10px;
}

/* ---------- Wide tile ---------- */
.wide-tile {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}
.wide-tile .wide-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--plum-soft); color: var(--plum);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wide-tile .wide-text { flex: 1; min-width: 0; }
.wide-tile .wide-title { font-size: 15px; font-weight: 700; }
.wide-tile .wide-sub { font-size: 13px; color: var(--ink-soft); }
.chev { color: var(--ink-light); font-size: 20px; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 10px; color: var(--ink-light); font-size: 11px; font-weight: 600;
  border-radius: 12px;
}
.nav-item.active { color: var(--green); }
/* Phone: a secondary section (homework/suppliers/etc.) keeps its parent tab (Home)
   lit exactly as before. On desktop this is neutralised — see the min-width:900px block. */
.nav-item.active-parent { color: var(--green); }
.nav-item svg { display: block; }

/* ---------- Homework cards ---------- */
.hw-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.hw-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.hw-status { display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.hw-status.todo { background: #FFF1E0; color: var(--pending); }
.hw-status.done { background: var(--green-soft); color: var(--tick); }
.hw-topic { font-size: 11px; font-weight: 700; color: var(--ink-light); text-transform: uppercase; letter-spacing: 0.5px; }
.hw-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.hw-due { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.hw-action { background: var(--green); color: #fff; padding: 12px; border-radius: 12px; text-align: center; font-weight: 700; font-size: 15px; width: 100%; }
.hw-action.done-btn { background: var(--green-soft); color: var(--green); }

/* ---------- Homework uploaded files (photos / documents) ---------- */
.hw-files { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.hw-file { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.hw-file-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: var(--ink); }
.hw-file-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #fff; display: flex; align-items: center; justify-content: center; }
.hw-file-doc { font-size: 22px; border: 1px solid var(--line); }
.hw-file-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-file-del { background: none; color: var(--terracotta); font-weight: 700; font-size: 13px; padding: 8px 10px; flex-shrink: 0; }
.hw-file-del[disabled] { opacity: 0.5; }

/* ---------- Homework "I'm having trouble" (help request) ---------- */
.hw-help { margin-top: 18px; text-align: center; }
.help-link-btn { color: var(--ink-soft); font-weight: 600; font-size: 14px; padding: 10px; text-decoration: underline; }
.hw-help-form { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-top: 6px; text-align: left; }
.hw-help-form .opt { font-weight: 400; color: var(--ink-light); }
.hw-help-form .primary-btn { margin-top: 12px; }
.hw-help-done { background: var(--green-soft); color: var(--tick); border-radius: 12px; padding: 14px; font-weight: 600; font-size: 14px; }

/* ---------- Generic section / form ---------- */
.section { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.section h4 { font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.input, textarea.input, select.input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; font-size: 16px; color: var(--ink); font-family: inherit;
}
textarea.input { min-height: 120px; resize: vertical; }
.help-text { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

/* ---------- Rich text (homework explanation, coursework about) ---------- */
.rich { overflow-wrap: anywhere; word-break: break-word; } /* long URLs wrap instead of overflowing the card */
.rich p { margin: 0 0 10px; }
.rich p:last-child { margin-bottom: 0; }
.rich ul { margin: 0 0 10px; padding-left: 20px; }
.rich li { margin-bottom: 4px; }
.rich a { color: var(--green); font-weight: 600; }
.rich strong { font-weight: 700; }

/* ---------- Homework template/example (staff-provided) ---------- */
.hw-tpl-img { display: block; margin-bottom: 10px; }
.hw-tpl-img:last-child { margin-bottom: 0; }
.hw-tpl-img img { width: 100%; max-height: 320px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); display: block; }

/* ---------- Events (open workshops: skills, guest speakers, site visits) ---------- */
.ev-home { background: #FCF6EC; border: 1px solid var(--ochre); border-radius: 16px; padding: 13px; margin-bottom: 12px; }
.ev-home-mid { display: flex; align-items: center; gap: 10px; }
.ev-home-main { flex: 1; min-width: 0; }
.ev-lbl { font-size: 11px; font-weight: 700; color: #8A5A16; }
.ev-home-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-top: 3px; }
.ev-home-title.big { font-size: 18px; }
.ev-home-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); margin-top: 5px; }
.ev-home-meta svg { width: 15px; height: 15px; color: var(--green); flex-shrink: 0; }
.ev-seeall { text-align: center; color: var(--green); font-weight: 700; font-size: 14px; margin-top: 11px; }
.ev-opens { font-size: 12px; color: var(--ink-soft); text-align: center; margin-top: 6px; }
.ev-loc { color: var(--green); text-decoration: underline; }
.ev-listcard { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 13px; margin-bottom: 12px; }
.ev-row { display: flex; gap: 12px; }
.ev-dateb { flex-shrink: 0; width: 52px; text-align: center; background: var(--green-soft); border-radius: 12px; padding: 8px 0; height: fit-content; }
.ev-dateb .d { font-size: 20px; font-weight: 700; color: var(--green); line-height: 1; }
.ev-dateb .m { font-size: 11px; color: var(--ink-soft); margin-top: 2px; text-transform: uppercase; }
.ev-rmain { flex: 1; min-width: 0; }
.ev-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 8px; }
.ev-title { font-size: 16px; font-weight: 700; color: var(--green); margin-top: 6px; }
.ev-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.ev-row .chev { align-self: center; color: #B8B6A8; font-size: 22px; flex-shrink: 0; }

.primary-btn { background: var(--terracotta); color: #fff; padding: 16px; border-radius: 14px; text-align: center; font-weight: 700; font-size: 17px; width: 100%; box-shadow: 0 2px 8px rgba(196,90,63,0.25); }
.primary-btn[disabled] { opacity: 0.5; box-shadow: none; }
.secondary-btn { background: #fff; color: var(--green); border: 2px solid var(--green); padding: 14px; border-radius: 14px; text-align: center; font-weight: 700; font-size: 16px; width: 100%; }
.link-btn { color: var(--green); font-weight: 700; font-size: 14px; padding: 8px 0; }

/* ---------- Calculator ---------- */
.calc-row { display: grid; grid-template-columns: 1.6fr 0.7fr 0.9fr 30px; gap: 8px; margin-bottom: 8px; align-items: center; }
.calc-row .input { padding: 12px 10px; font-size: 15px; }
.calc-row .del { color: var(--terracotta); font-size: 22px; text-align: center; line-height: 1; }
.calc-result { background: var(--green-soft); border-radius: 14px; padding: 16px; margin-top: 6px; }
.calc-result-label { font-size: 13px; color: var(--green); font-weight: 600; }
.calc-result-value { font-size: 30px; font-weight: 700; color: var(--green); }
.calc-hint { font-size: 13px; color: var(--green); margin-top: 8px; }

/* ---------- Suppliers ---------- */
.supplier-cat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.supplier-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.si-Packaging, .si-Food { background: var(--terracotta-soft); color: var(--terracotta); }
.si-Kitchen { background: var(--green-soft); color: var(--green); }
.si-Cleaning { background: var(--teal-soft); color: var(--teal); }
.si-Ingredients { background: var(--ochre-soft); color: var(--ochre); }
.si-Council { background: var(--plum-soft); color: var(--plum); }
.si-Trades { background: #E2E8EC; color: #3E5C66; }
.si-Signage { background: #E3EEF6; color: #2F6F9F; }
.ask-card { background: var(--ochre-soft); border-radius: 16px; padding: 18px; margin-top: 16px; }
.ask-card .ask-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.ask-card .ask-text { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 14px; }
.supplier-info { flex: 1; min-width: 0; }
.supplier-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.supplier-count, .supplier-sub { font-size: 13px; color: var(--ink-soft); }
.contact-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.contact-actions a { flex: 1; min-width: 110px; text-align: center; padding: 12px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 14px; text-decoration: none; }

/* ---------- Search ---------- */
.search-bar { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: var(--ink-light); }
.search-bar input { border: none; background: none; outline: none; font-size: 16px; flex: 1; color: var(--ink); }

/* ---------- Login ---------- */
.login { display: flex; flex-direction: column; min-height: 100dvh; padding: 0 24px calc(24px + env(safe-area-inset-bottom)); justify-content: center; gap: 8px; }
.login .brand { text-align: center; margin-bottom: 24px; }
.login .brand .brand-logo { display: block; width: 160px; height: auto; margin: 0 auto 18px; }
.login .brand h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.login .brand p { color: var(--ink-soft); margin-top: 6px; }
.login .field-label { margin-top: 14px; }
.login .err { color: var(--terracotta); font-weight: 600; font-size: 14px; min-height: 20px; margin-top: 8px; text-align: center; }
.login .demo-note { margin-top: 18px; font-size: 13px; color: var(--ink-soft); text-align: center; background: var(--ochre-soft); border-radius: 12px; padding: 12px; }

/* ---------- Empty / loading states ---------- */
.empty { text-align: center; color: var(--ink-soft); padding: 48px 16px; }
.empty .big { font-size: 40px; margin-bottom: 12px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600; z-index: 100; max-width: 90%; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.toast.warn { background: var(--terracotta); }

/* ---------- Offline banner ---------- */
.offline-banner { background: var(--ochre); color: #3a2c0a; font-size: 13px; font-weight: 600; text-align: center; padding: 8px; }

/* ---------- Home search (button that opens search screen) ---------- */
.home-search { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--ink-light); font-size: 16px; width: 100%; text-align: left; }

/* ---------- Search screen ---------- */
.search-input-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-input-wrap input { border: none; outline: none; font-size: 16px; flex: 1; background: none; color: var(--ink); }
.search-group-title { font-size: 12px; font-weight: 700; color: var(--ink-light); text-transform: uppercase; letter-spacing: 0.6px; margin: 18px 0 8px; }
.result-row { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.result-row .r-emoji { font-size: 20px; flex-shrink: 0; width: 26px; text-align: center; }
.result-row .r-main { flex: 1; min-width: 0; }
.result-row .r-title { font-size: 15px; font-weight: 700; line-height: 1.2; }
.result-row .r-sub { font-size: 13px; color: var(--ink-soft); }

/* ---------- Filter chips ---------- */
.filter-chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.chip { flex-shrink: 0; padding: 8px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.chip.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- Homework To-do / Done segmented control ---------- */
.hw-seg { display: flex; gap: 6px; background: var(--green-soft); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.hw-seg-btn { flex: 1; padding: 10px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--ink-soft); background: transparent; }
.hw-seg-btn.active { background: #fff; color: var(--green); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.hw-seg-n { font-size: 12px; font-weight: 700; opacity: 0.75; margin-left: 2px; }

/* ---------- Coursework ---------- */
.cw-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; gap: 12px; margin-bottom: 10px; align-items: center; }
.cw-thumb { width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.cw-Video { background: var(--terracotta-soft); }
.cw-Article { background: var(--teal-soft); }
.cw-Link { background: var(--green-soft); }
.cw-Download { background: var(--ochre-soft); }
.cw-info { flex: 1; min-width: 0; }
.cw-title { font-size: 15px; font-weight: 700; line-height: 1.25; margin-bottom: 3px; }
.cw-meta { font-size: 12px; color: var(--ink-soft); }
.cw-featured { border: 2px solid var(--ochre); }

/* ---- Coursework: topic-based home (redesign) ----
   Matches the app's flat language: white cards on cream with a 1px --line
   border and 16px radius (no shadows), the standard .sub-header, tokenised
   colours, and 700 as the heaviest weight. */
/* Resume / "Keep going" hero — mirrors the green .thisweek card on Home */
.cw-hero { background: var(--green); border-radius: 18px; padding: 16px 18px; margin-bottom: 18px; color: #fff; }
.cw-hero-top { display: flex; gap: 14px; align-items: flex-start; }
.cw-hero-text { flex: 1; min-width: 0; }
.cw-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .75; }
.cw-hero-topic { font-size: 19px; font-weight: 700; margin: 3px 0 2px; }
.cw-hero-meta { font-size: 13.5px; opacity: .9; }
.cw-hero-chip { width: 44px; height: 44px; border-radius: 13px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.cw-hero-bar { height: 8px; border-radius: 5px; background: rgba(255,255,255,.2); margin: 14px 0 14px; overflow: hidden; }
.cw-hero-bar > span { display: block; height: 100%; border-radius: 5px; background: var(--ochre); }
.cw-continue { display: inline-flex; align-items: center; background: #fff; color: var(--green); border: none; border-radius: 12px; padding: 10px 16px; font-size: 15px; font-weight: 700; }
/* Section title row */
.cw-section { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 2px 12px; }
.cw-section > span:first-child { font-size: 18px; font-weight: 700; color: var(--ink); }
.cw-section-count { font-size: 14px; font-weight: 700; color: var(--ink-light); }
/* Topic grid */
.cw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cw-topic { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; text-align: left; }
.cw-tile { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: var(--green); flex-shrink: 0; }
.cw-topic-name { font-size: 16px; font-weight: 700; line-height: 1.2; color: var(--ink); margin-top: 12px; min-height: 38px; }
.cw-topic-label { font-size: 12.5px; font-weight: 700; color: var(--ink-light); margin-top: 7px; }
.cw-corner { position: absolute; top: 12px; right: 12px; font-weight: 700; }
.cw-corner.done { width: 22px; height: 22px; border-radius: 50%; background: var(--green-soft); color: var(--tick); font-size: 13px; display: flex; align-items: center; justify-content: center; }
.cw-corner.new, .cw-new-inline { background: var(--terracotta); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 2px 7px; border-radius: 8px; }
.cw-new-inline { display: inline-block; vertical-align: middle; margin-left: 4px; }
/* Progress bar (shared by topic cards + topic-list header) */
.cw-bar { display: block; height: 8px; border-radius: 5px; background: var(--line); margin-top: 6px; overflow: hidden; }
.cw-bar > span { display: block; height: 100%; border-radius: 5px; background: var(--green); }
.cw-bar.done > span { background: var(--tick); }
/* "Extra topics" divider */
.cw-divider { display: flex; align-items: center; gap: 12px; margin: 22px 2px 14px; color: var(--ink-light); font-size: 14px; font-weight: 700; }
.cw-divider::before, .cw-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* One topic's lesson list */
.cw-topic-head { display: flex; align-items: center; gap: 14px; margin: 2px 2px 12px; }
.cw-topic-h-name { font-size: 18px; font-weight: 700; color: var(--ink); }
.cw-topic-h-sub { font-size: 14px; font-weight: 700; color: var(--ink-light); margin-top: 2px; }
.cw-watched { opacity: .75; }
.cw-check { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--line); background: #fff; color: var(--tick); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cw-check.on { background: var(--green-soft); border-color: var(--tick); }
/* "Mark as watched" on the lesson detail — uses the .secondary-btn pattern */
.cw-mark { display: block; width: 100%; margin-top: 8px; padding: 14px; border-radius: 14px; border: 2px solid var(--green); background: #fff; color: var(--green); font-size: 16px; font-weight: 700; }
.cw-mark.on { background: var(--green-soft); border-color: var(--green-soft); color: var(--tick); }

.video-embed { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 16px; overflow: hidden; background: #000; margin-bottom: 16px; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Tools ---------- */
.tool-row { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.tool-icon { width: 50px; height: 50px; border-radius: 14px; background: var(--terracotta-soft); color: var(--terracotta); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-soon { font-size: 11px; font-weight: 700; color: var(--ink-light); background: var(--bg); border: 1px solid var(--line); padding: 3px 8px; border-radius: 8px; }
.tool-frame-screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tool-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---------- Help contacts ---------- */
.help-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 12px; }
.help-card .h-name { font-size: 17px; font-weight: 700; }
.help-card .h-role { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.help-card .h-email { display: inline-block; font-size: 13px; color: var(--green); text-decoration: none; margin: 0 0 14px; word-break: break-word; }

/* ---------- Help FAQ (tap to expand; content from Airtable) ---------- */
.help-head { font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.5px; margin: 4px 0 10px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.faq-item[open] { border-color: var(--green); }
.faq-q { list-style: none; cursor: pointer; padding: 15px 16px; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq-q::-webkit-details-marker { display: none; }
.faq-chev { flex-shrink: 0; font-size: 22px; line-height: 1; color: var(--ink-light); transition: transform 0.15s ease; }
.faq-item[open] .faq-q { color: var(--green); }
.faq-item[open] .faq-chev { transform: rotate(90deg); color: var(--green); }
.faq-a { padding: 0 16px 16px; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
/* Attached file(s) under an answer — e.g. a pricing or terms PDF download. */
.faq-files { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- This week card (Home) ---------- */
.thisweek { display: block; width: 100%; text-align: left; background: var(--green); color: #fff; border: none; border-radius: 18px; padding: 16px 18px; margin-bottom: 16px; }
.thisweek .tw-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.85; }
.thisweek .tw-label svg { width: 16px; height: 16px; }
.thisweek .tw-topic { font-size: 19px; font-weight: 700; margin-top: 6px; }
.thisweek .tw-meta { font-size: 14px; margin-top: 4px; opacity: 0.95; }
.thisweek .tw-loc { font-size: 13px; margin-top: 4px; opacity: 0.85; }
.thisweek .tw-go { font-size: 13px; font-weight: 700; margin-top: 10px; opacity: 0.95; }

/* ---------- Workshops list + detail ---------- */
.ws-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.ws-row.ws-next { border-color: var(--green); border-width: 2px; }
.ws-row.ws-past { opacity: 0.6; }
.ws-wk { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.ws-main { flex: 1; min-width: 0; }
.ws-topic { font-size: 16px; font-weight: 700; color: var(--ink); }
.ws-meta { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.ws-badge { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #fff; background: var(--green); padding: 2px 7px; border-radius: 8px; vertical-align: middle; }
.ws-when { font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }

/* ---------- Mentoring ---------- */
.mentor-name { font-size: 20px; font-weight: 700; color: var(--ink); }
.ms-row { display: flex; align-items: baseline; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.ms-date { flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--green); min-width: 84px; }
.ms-topic { font-size: 14px; color: var(--ink); }

/* ---------- Portfolio / progress ---------- */
.pf-progress { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.pf-bar { height: 12px; background: var(--green-soft); border-radius: 8px; overflow: hidden; }
.pf-fill { height: 100%; background: var(--green); border-radius: 8px; transition: width 0.3s; }
.pf-count { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-top: 8px; }
.pf-done { background: var(--green-soft); color: var(--green); font-weight: 700; text-align: center; border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.pf-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.pf-check { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; }
.pf-check.on { background: var(--green); border-color: var(--green); }
.pf-main { flex: 1; min-width: 0; }
.pf-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.pf-topic { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Community ---------- */
.biz-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.biz-card .supplier-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-tagline { margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--ink); }
.biz-avatar { width: 48px; height: 48px; border-radius: 14px; background: var(--plum); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex-shrink: 0; }
/* Logo-as-avatar: fill the circle / rounded square, cropping to cover (Instagram-style). */
.avatar, .biz-avatar { overflow: hidden; }
.av-img { width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.biz-badge { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--green); background: var(--green-soft); padding: 2px 7px; border-radius: 8px; vertical-align: middle; }
.chev svg { vertical-align: middle; color: var(--plum); }

/* The old @media(min-width:480px) "phone frame" (a floating rounded phone
   mock centred on big screens) was removed here. Real desktop layout now
   lives in the DESKTOP / LAPTOP LAYER at the very end of this file. */

/* ============================================================
   BREAKEVEN CALCULATOR (native tool screen)
   Reuses the app's .section / .input / .field-label / .help-text /
   .primary-btn / .secondary-btn. Everything below is scoped to .be-root
   so the tool's bespoke pieces can never leak into other screens.
   ============================================================ */
.be-root .intro { font-size: 14.5px; color: var(--ink-soft); margin: 2px 2px 14px; line-height: 1.55; }
.be-root .lang-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
/* period selector (Weekly / Monthly / One-off) */
.be-root .be-periods { display: flex; gap: 6px; margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.be-root .be-per { flex: 1; padding: 10px 6px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--ink-soft); text-align: center; line-height: 1.2; }
.be-root .be-per.active { background: var(--green); color: var(--bg); }
.be-root .be-lang { flex: 1; max-width: 70%; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; font-size: 14px; color: var(--ink); font-family: inherit; }
.be-root .info-btn { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--green); font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
/* saved-plan chips */
.be-root .be-plans h4 { margin-bottom: 10px; }
.be-root .be-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.be-root .be-chip { display: inline-flex; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; }
.be-root .be-chip.active { border-color: var(--green); background: var(--green-soft); }
.be-root .be-chip-open { padding: 6px 4px 6px 12px; font-size: 13.5px; font-weight: 600; color: var(--ink); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.be-root .be-chip.active .be-chip-open { color: var(--green); }
.be-root .be-chip-del { padding: 6px 10px 6px 6px; font-size: 16px; line-height: 1; color: var(--ink-light); }
.be-root .be-chip-del:active { color: var(--terracotta); }
.be-root .be-chip-new { padding: 6px 14px; font-size: 13.5px; font-weight: 700; color: var(--green); border: 1.5px dashed var(--line); background: transparent; }
/* name + save */
.be-root .be-saverow { margin-bottom: 10px; }
/* right-to-left (Arabic) */
.be-root[dir="rtl"] .money-field .prefix { left: auto; right: 13px; }
.be-root[dir="rtl"] .money-field .input { padding-left: 14px; padding-right: 28px; }
.be-root[dir="rtl"] .bill-row .money-field .prefix { right: 10px; left: auto; }
.be-root[dir="rtl"] .bill-row .money-field .input { padding-right: 24px; padding-left: 10px; }
.be-root[dir="rtl"] .be-chip-open { padding: 6px 12px 6px 4px; }
.be-root[dir="rtl"] .be-chip-del { padding: 6px 6px 6px 10px; }
/* Arabic script reads smaller than Latin at the same px — bump the text up a
   notch (and give it a touch more line-height) only in the RTL/Arabic view. */
.be-root[dir="rtl"] { line-height: 1.65; }
.be-root[dir="rtl"] .intro { font-size: 16px; }
.be-root[dir="rtl"] .help-text { font-size: 14.5px; }
.be-root[dir="rtl"] .field-label { font-size: 14.5px; }
.be-root[dir="rtl"] .section h4, .be-root[dir="rtl"] .scenario h4 { font-size: 14.5px; }
.be-root[dir="rtl"] .ml-lbl, .be-root[dir="rtl"] .bills-total .lbl, .be-root[dir="rtl"] .s-label, .be-root[dir="rtl"] .c-lbl, .be-root[dir="rtl"] .r-lbl { font-size: 14px; }
.be-root[dir="rtl"] .ml-sub, .be-root[dir="rtl"] .s-help, .be-root[dir="rtl"] .s-sub, .be-root[dir="rtl"] .s-break, .be-root[dir="rtl"] .r-sub { font-size: 13.5px; }
.be-root[dir="rtl"] .unit { font-size: 14px; }
.be-root[dir="rtl"] .be-chip-open, .be-root[dir="rtl"] .be-chip-new { font-size: 14.5px; }
.be-root[dir="rtl"] .be-lang { font-size: 15px; }
.be-root[dir="rtl"] .g-body { font-size: 15px; }
.be-root[dir="rtl"] .guard .g-title { font-size: 16px; }
.be-root[dir="rtl"] .hero .h-label, .be-root[dir="rtl"] .bar-keys { font-size: 13px; }
/* Bengali script also reads small at Latin px — a gentle bump (lighter than
   the Arabic one), keyed to the language class since Bengali is left-to-right. */
.be-root.be-lang-bn { line-height: 1.6; }
.be-root.be-lang-bn .intro { font-size: 15.5px; }
.be-root.be-lang-bn .help-text { font-size: 14px; }
.be-root.be-lang-bn .field-label { font-size: 14px; }
.be-root.be-lang-bn .section h4, .be-root.be-lang-bn .scenario h4 { font-size: 14px; }
.be-root.be-lang-bn .ml-lbl, .be-root.be-lang-bn .bills-total .lbl, .be-root.be-lang-bn .s-label, .be-root.be-lang-bn .c-lbl, .be-root.be-lang-bn .r-lbl { font-size: 13.5px; }
.be-root.be-lang-bn .ml-sub, .be-root.be-lang-bn .s-help, .be-root.be-lang-bn .s-sub, .be-root.be-lang-bn .s-break, .be-root.be-lang-bn .r-sub { font-size: 13px; }
.be-root.be-lang-bn .unit { font-size: 13.5px; }
.be-root.be-lang-bn .be-chip-open, .be-root.be-lang-bn .be-chip-new { font-size: 14px; }
.be-root.be-lang-bn .be-lang { font-size: 14.5px; }
.be-root.be-lang-bn .g-body { font-size: 14.5px; }
.be-root.be-lang-bn .guard .g-title { font-size: 15.5px; }
.be-root .section h4 { display: flex; align-items: center; gap: 7px; }
.be-root .step { width: 22px; height: 22px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.be-root .money-field { position: relative; }
.be-root .money-field .prefix { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 16px; font-weight: 700; color: var(--ink-light); }
.be-root .money-field .input { padding-left: 28px; }
.be-root .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.be-root .bill-row { display: grid; grid-template-columns: 1fr 116px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.be-root .bill-row .input { padding: 12px 10px; font-size: 15px; }
.be-root .bill-row .money-field .input { padding-left: 24px; }
.be-root .bill-row .money-field .prefix { left: 10px; font-size: 15px; }
.be-root .bill-row .del { color: var(--terracotta); font-size: 22px; text-align: center; line-height: 1; background: var(--terracotta-soft); border-radius: 9px; height: 42px; display: flex; align-items: center; justify-content: center; }
.be-root .add-link { color: var(--green); font-weight: 700; font-size: 14px; padding: 6px 0; display: inline-flex; align-items: center; gap: 6px; }
.be-root .bills-total { display: flex; align-items: center; justify-content: space-between; background: var(--green-soft); border-radius: 12px; padding: 12px 14px; margin-top: 6px; }
.be-root .bills-total .lbl { font-size: 13px; font-weight: 700; color: var(--green); }
.be-root .bills-total .val { font-size: 18px; font-weight: 800; color: var(--green); }
.be-root .mini-result { background: var(--green-soft); border-radius: 14px; padding: 14px 16px; margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.be-root .mini-result .ml-lbl { font-size: 13px; font-weight: 700; color: var(--green); }
.be-root .mini-result .ml-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.be-root .mini-result .ml-val { font-size: 26px; font-weight: 800; color: var(--green); }
.be-root .hero { background: var(--green); color: var(--bg); border-radius: 20px; padding: 22px; margin-bottom: 14px; }
.be-root .hero .h-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.be-root .hero .h-value { font-size: 40px; font-weight: 800; line-height: 1.05; margin: 6px 0 2px; }
.be-root .hero .h-money { font-size: 16px; font-weight: 600; opacity: .95; }
.be-root .hero .h-money b { font-weight: 800; }
.be-root .bar-wrap { margin: 16px 0 4px; }
.be-root .bar-track { position: relative; height: 46px; border-radius: 12px; overflow: hidden; display: flex; border: 1px solid rgba(255,255,255,.25); }
.be-root .bar-cover { background: rgba(240,234,220,.22); height: 100%; }
.be-root .bar-profit { background: rgba(240,234,220,.40); height: 100%; flex: 1; }
.be-root .bar-mark { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--bg); }
.be-root .bar-flag { position: absolute; top: -22px; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: var(--bg); white-space: nowrap; }
.be-root .bar-keys { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; opacity: .9; }
.be-root .takeaway { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; font-size: 15px; line-height: 1.55; }
.be-root .takeaway b { color: var(--green); }
.be-root .takeaway .purse { color: var(--terracotta); font-weight: 800; }
/* "play with the number of serves" what-if */
.be-root .scenario { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.be-root .scenario h4 { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.be-root .scn-serves { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px 0 2px; }
.be-root .scn-serves .input { width: 96px; text-align: center; font-weight: 800; font-size: 20px; padding: 12px 8px; }
.be-root .scn-serves .unit { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.be-root .scn-range { width: 100%; margin: 10px 0 14px; accent-color: var(--green); }
.be-root .scn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.be-root .scn-cell { border-radius: 12px; padding: 12px 14px; }
.be-root .scn-cell .c-lbl { font-size: 12px; font-weight: 700; opacity: .92; }
.be-root .scn-cell .c-val { font-size: 22px; font-weight: 800; margin-top: 2px; }
.be-root .scn-in { background: var(--green-soft); color: var(--green); }
.be-root .scn-out { background: var(--terracotta-soft); color: var(--terracotta); }
.be-root .scn-result { border-radius: 14px; padding: 16px; text-align: center; }
.be-root .scn-result .r-lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; opacity: .9; }
.be-root .scn-result .r-val { font-size: 30px; font-weight: 800; margin: 4px 0; }
/* editable "what you keep" — looks like the big number, with a dashed underline to signal it can be changed */
.be-root .scn-result .r-edit { display: inline-flex; align-items: baseline; justify-content: center; gap: 2px; margin: 4px 0; }
.be-root .scn-result .r-prefix { font-size: 24px; font-weight: 800; opacity: .9; }
.be-root .scn-result .r-val-input { width: 4.2em; max-width: 62%; background: transparent; border: none; border-bottom: 2px dashed rgba(255,255,255,.55); color: inherit; font-size: 30px; font-weight: 800; text-align: center; font-family: inherit; padding: 0 2px 2px; -webkit-appearance: none; appearance: none; }
.be-root .scn-result .r-val-input:focus { outline: none; border-bottom-color: #fff; }
.be-root .scn-result .r-val-input::-webkit-outer-spin-button, .be-root .scn-result .r-val-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.be-root .scn-result .r-sub { font-size: 13.5px; line-height: 1.5; }
.be-root .scn-result.profit { background: var(--green); color: var(--bg); }
.be-root .scn-result.loss { background: var(--terracotta); color: #fff; }
.be-root .safety { background: var(--ochre-soft); border: 1px solid #f0d6ad; border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.be-root .safety .s-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.be-root .safety .s-label { font-size: 13px; font-weight: 800; color: #9a5b18; text-transform: uppercase; letter-spacing: .4px; }
.be-root .safety .s-value { font-size: 26px; font-weight: 800; color: #9a5b18; white-space: nowrap; }
.be-root .safety .s-sub { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-top: 6px; }
.be-root .safety .s-stockrow { margin-bottom: 12px; }
.be-root .safety .s-stockrow label { display: block; font-size: 13px; font-weight: 700; color: #9a5b18; margin-bottom: 6px; }
.be-root .safety .s-help { font-size: 12px; color: var(--ink-soft); margin-top: 6px; line-height: 1.45; }
.be-root .safety .money-field .input { background: #fff; border-color: #f0d6ad; }
.be-root .safety .s-break { font-size: 12.5px; font-weight: 700; color: #9a5b18; opacity: .92; margin-top: 4px; }
.be-root .guard { background: var(--terracotta-soft); border: 1px solid #e8b6ad; border-radius: 16px; padding: 16px; margin-bottom: 14px; display: none; }
.be-root .guard.show { display: block; }
.be-root .guard .g-title { font-size: 15px; font-weight: 800; color: var(--terracotta); margin-bottom: 6px; }
.be-root .guard .g-body { font-size: 14px; color: var(--plum); line-height: 1.55; }
.be-root .result-area.hidden { display: none; }
.be-root .be-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.be-root .save-flash { font-size: 13px; font-weight: 700; color: var(--tick); text-align: center; margin-top: 10px; opacity: 0; transition: opacity .4s; min-height: 16px; }
.be-root .save-flash.show { opacity: 1; }
.be-modal-veil { position: fixed; inset: 0; background: rgba(39,66,29,.45); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.be-modal-veil.show { display: flex; }
.be-modal { background: #fff; border-radius: 20px; padding: 22px; max-width: 380px; width: 100%; max-height: 80vh; overflow: auto; }
.be-modal h3 { font-size: 18px; font-weight: 800; color: var(--green); margin-bottom: 10px; }
.be-modal p { font-size: 14px; color: var(--ink); line-height: 1.6; margin-bottom: 12px; }
.be-modal .store { font-size: 13px; color: var(--ink-soft); background: var(--green-soft); border-radius: 12px; padding: 12px; line-height: 1.55; }
.be-modal .ok { background: var(--green); color: #fff; padding: 13px; border-radius: 12px; text-align: center; font-weight: 700; font-size: 15px; margin-top: 14px; width: 100%; }

/* ============================================================
   BREAKEVEN — multi-product ("few") mode: mode toggle, product
   cards, and the static expected-mix summary. Scoped to .be-root
   and built only from the brand vars so it matches the tool above.
   ============================================================ */
/* mode toggle — a segmented control like .be-periods, sat under the Step 2 head */
.be-root .be-toggle { display: flex; gap: 6px; margin: 2px 0 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.be-root .be-tg { flex: 1; padding: 11px 8px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--ink-soft); text-align: center; line-height: 1.25; }
.be-root .be-tg.active { background: var(--green); color: var(--bg); }
.be-root .be-mode-hint { margin: 0 2px 12px; }
/* product cards (name + price/cost + expected qty + live "keeps") */
.be-root .be-prod { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px; margin-bottom: 10px; }
.be-root .be-prod-top { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.be-root .be-prod-top .be-prod-name { flex: 1; padding: 12px 10px; font-size: 15px; }
.be-root .be-prod-del { color: var(--terracotta); background: var(--terracotta-soft); border-radius: 9px; width: 38px; height: 42px; font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.be-root .be-prod .two-col { gap: 10px; margin-bottom: 10px; }
.be-root .be-prod .field-label { font-size: 12.5px; margin-bottom: 4px; }
.be-root .be-prod .money-field .input { padding: 11px 9px 11px 22px; font-size: 15px; }
.be-root .be-prod .money-field .prefix { left: 9px; font-size: 15px; }
.be-root .be-prod-qtyrow { display: flex; align-items: center; gap: 8px; }
.be-root .be-prod-qtyrow .field-label { margin: 0; min-width: 0; }   /* may wrap in long-word languages rather than overflow */
.be-root .be-prod-qtyrow .be-prod-qty { width: 92px; flex-shrink: 0; text-align: center; font-weight: 700; font-size: 16px; padding: 10px 8px; }
/* small "(i)" explainer next to the "how many" label — a mini version of .info-btn */
.be-root .be-q-i { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--green); font-size: 12px; font-weight: 800; line-height: 1; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.be-root .be-prod-keep { font-size: 13px; font-weight: 700; color: var(--green); margin-top: 10px; }
.be-root .be-prod-keep b { font-weight: 800; }
.be-root .be-prod-keep.thin { color: #9a5b18; }          /* thin margin (< $2) — ochre/amber */
.be-root .be-prod-keep.loss { color: var(--terracotta); } /* price not above cost */
/* "few"-mode expected-mix summary reuses the scenario card's grid + result block */
.be-root .be-mixsum { margin-bottom: 14px; }
.be-root .be-mixsum .scn-grid { margin-bottom: 12px; }
/* RTL (Arabic): flip the prefix inside product money-fields; bump small text up */
.be-root[dir="rtl"] .be-prod .money-field .prefix { right: 9px; left: auto; }
.be-root[dir="rtl"] .be-prod .money-field .input { padding-right: 22px; padding-left: 9px; }
.be-root[dir="rtl"] .be-tg, .be-root[dir="rtl"] .be-mode-hint, .be-root[dir="rtl"] .be-prod-keep { font-size: 14.5px; }
/* Bengali bump (LTR), matching the rest of the tool's bn sizing */
.be-root.be-lang-bn .be-tg, .be-root.be-lang-bn .be-mode-hint, .be-root.be-lang-bn .be-prod-keep { font-size: 14px; }


/* ============================================================================
   FoodLab — Tools home-screen grid.  Append to styles.css.
   Uses the existing brand tokens from :root (Harina / Herb / spice -soft tints).
   Pairs with build/foodlab-tools-home.js.
   ========================================================================== */

/* header actions */
.th-head { justify-content: flex-start; }
.th-head .sub-title { flex: 1; }
.th-act { padding: 8px 14px; border-radius: 11px; font-size: 15px; font-weight: 700; flex-shrink: 0; }
.th-edit { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.th-done { background: var(--green); color: #fff; }

.th-hint {
  display: flex; align-items: center; gap: 8px;
  background: var(--green-soft); border-radius: 12px; padding: 10px 13px;
  margin-bottom: 16px; font-size: 13px; font-weight: 600; color: #3a4d2c;
}
.th-hint span { flex: 1; }
.th-list { color: var(--green); font-weight: 700; text-decoration: underline; font-size: 13px; flex-shrink: 0; }

/* grid */
.th-grid { display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 20px; column-gap: 6px; justify-items: center; }
.th-cell { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.th-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; background: none; }
.th-icon {
  position: relative; width: 68px; height: 68px; border-radius: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(39, 66, 29, 0.10);
}
.th-icon svg { width: 34px; height: 34px; }
.th-label { font-size: 12px; font-weight: 600; line-height: 1.15; text-align: center; color: var(--ink); max-width: 88px; height: 28px; overflow: hidden; }

/* tile colours — soft tint behind, full spice colour for the glyph (currentColor) */
.th-terracotta { background: var(--terracotta-soft); color: var(--terracotta); }
.th-green      { background: var(--green-soft);      color: var(--green); }
.th-ochre      { background: var(--ochre-soft);      color: var(--ochre); }
.th-teal       { background: var(--teal-soft);       color: var(--teal); }
.th-plum       { background: var(--plum-soft);       color: var(--plum); }

.th-soon {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: var(--bg);
  font-size: 8.5px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 1.5px 6px; border-radius: 6px;
}

/* add tile */
.th-add .th-addsq {
  width: 68px; height: 68px; border-radius: 19px;
  border: 2px dashed #B9B196; display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
}
.th-add .th-label { color: var(--ink-soft); }

/* edit mode: remove badge + jiggle */
.th-x {
  position: absolute; top: -7px; left: calc(50% - 42px);
  width: 23px; height: 23px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--line); color: var(--plum);
  font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); z-index: 3;
}
.th-edit-on .th-btn { touch-action: none; }
.th-jiggle:nth-child(odd)  .th-icon { animation: thJigA 0.26s ease-in-out infinite; }
.th-jiggle:nth-child(even) .th-icon { animation: thJigB 0.26s ease-in-out infinite; }
@keyframes thJigA { 0%, 100% { transform: rotate(-1.3deg); } 50% { transform: rotate(1.3deg); } }
@keyframes thJigB { 0%, 100% { transform: rotate(1.3deg); } 50% { transform: rotate(-1.3deg); } }

/* drag clone + placeholder */
.th-clone {
  position: fixed; z-index: 60; pointer-events: none; width: 68px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.th-clone .th-icon { transform: scale(1.12); box-shadow: 0 12px 26px rgba(39, 66, 29, 0.30); }
.th-dragging > .th-btn { visibility: hidden; }

/* page dots */
.th-dots { display: flex; justify-content: center; gap: 7px; margin-top: 26px; }
.th-dot { width: 7px; height: 7px; border-radius: 50%; background: #C7C0AC; }
.th-dot.on { background: var(--green); }

/* bottom sheet (Add / Reorder) */
.th-backdrop { position: absolute; inset: 0; background: rgba(39, 66, 29, 0.32); z-index: 10; animation: thFade 0.18s ease; }
.th-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 11;
  background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 8px 18px calc(24px + env(safe-area-inset-bottom));
  max-height: 80%; display: flex; flex-direction: column;
  animation: thRise 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.th-grab { width: 38px; height: 5px; border-radius: 3px; background: #CFC8B4; margin: 6px auto 14px; }
.th-sheethead { display: flex; align-items: center; margin-bottom: 4px; }
.th-sheettitle { flex: 1; font-size: 20px; font-weight: 700; color: var(--ink); }
.th-close { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--ink-soft); font-size: 18px; flex-shrink: 0; }
.th-sheetsub { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.th-sheetbody { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.th-empty { text-align: center; padding: 34px 16px; color: var(--ink-soft); font-size: 14px; }

.th-catrow { display: flex; align-items: center; gap: 13px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; }
.th-mini { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.th-catinfo { flex: 1; min-width: 0; }
.th-catname { font-size: 15px; font-weight: 700; color: var(--ink); }
.th-catdesc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
.th-addbtn { padding: 9px 16px; border-radius: 11px; background: var(--terracotta); color: #fff; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.th-soonpill { padding: 6px 11px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-light); font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* reorder list */
.th-rrow { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 9px 11px; }
.th-rrow .th-mini { width: 40px; height: 40px; border-radius: 11px; }
.th-rname { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.th-sqbtn { width: 38px; height: 38px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); font-size: 17px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.th-sqdel { background: #fff; color: var(--terracotta); }

/* confirm dialog */
.th-modal { position: absolute; inset: 0; background: rgba(39, 66, 29, 0.38); display: flex; align-items: center; justify-content: center; padding: 30px; z-index: 20; animation: thFade 0.16s ease; }
.th-dialog { background: #fff; border-radius: 20px; padding: 22px; width: 100%; max-width: 300px; text-align: center; animation: thPop 0.2s ease; }
.th-dtitle { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.th-dtext { font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; margin-bottom: 18px; }
.th-drow { display: flex; gap: 10px; }
.th-keep { flex: 1; padding: 13px; border-radius: 13px; background: #fff; border: 2px solid var(--green); color: var(--green); font-size: 15px; font-weight: 700; }
.th-put  { flex: 1; padding: 13px; border-radius: 13px; background: var(--terracotta); color: #fff; font-size: 15px; font-weight: 700; }

@keyframes thFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes thRise { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes thPop  { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* "Suggest a tool" — centered pill below the tool grid; routes into the improve-the-app flow */
.th-suggest {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: fit-content; margin: 22px auto 0;
  padding: 12px 20px; border-radius: 13px;
  background: var(--green-soft); border: 1px solid var(--line); color: var(--green);
  font-size: 14px; font-weight: 700;
}
.th-suggest svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Secondary sidebar shortcuts: hidden everywhere by default (so the phone
   bottom-nav is unchanged), revealed only in the desktop sidebar below. */
.nav-more { display: none; }

/* Tool-tile descriptions: hidden by default (phone launcher unchanged),
   shown only on the desktop launcher to make the tiles read as fuller cards. */
.th-desc { display: none; }

/* ============================================================
   DESKTOP / LAPTOP LAYER  —  added on branch "desktop-responsive"
   ------------------------------------------------------------
   Everything below is ADDITIVE and gated at min-width:900px (plus a light
   1300px "true-wide" bump). Nothing here changes the phone layout (<900px),
   which is the experience the majority of participants use.

   Appended at the very END of the file on purpose: an @media block does NOT
   raise specificity, so these desktop overrides must come AFTER all the base
   rules to win by source order (no !important needed).

   Model: <900px = the untouched phone column. >=900px = a real two-pane
   desktop (240px left sidebar + content). Portrait tablets keep the phone
   layout. The old fake "phone frame" @media(min-width:480px) block that used
   to sit ~line 484 was removed.
   ============================================================ */
@media (min-width: 900px) {

  /* ---- Shell fills the viewport (was a centred 460px phone column) ---- */
  body { display: block; padding: 0; background: var(--bg); }
  .app-shell { max-width: 100%; width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; }

  /* Normal screens render a .bottom-nav sibling -> lay the shell out as
     sidebar + content. Gated on :has(.bottom-nav) so the nav-less screens
     (Login, ForgotCode, embedded tools) never get a dead 240px column. */
  .app-shell:has(.bottom-nav) {
    display: grid; grid-template-columns: 240px 1fr; grid-template-rows: 100dvh; overflow: hidden;
  }
  /* Each screen is a single capped, centred content column — every block inside
     simply fills it, so everything lines up in one vertical column (no per-element
     auto-margins, which produced the ragged widths). width:100% + justify-self
     centre it; margin:auto would shrink-wrap a grid item, so we use max-width only.
     Per-screen widths override the 680px default below (higher specificity). */
  .app-shell:has(.bottom-nav) .screen { grid-column: 2; padding: 32px 40px 48px; width: 100%; justify-self: center; max-width: 680px; }
  .app-shell:has(.bottom-nav) .screen.home-screen { max-width: 760px; }
  .app-shell:has(.bottom-nav) .screen.cw-screen   { max-width: 1040px; }
  .app-shell:has(.bottom-nav) .screen.th-screen   { max-width: 760px; }

  /* ---- Bottom tab bar -> left sidebar (same markup, restyled; zero JS) ---- */
  .app-shell:has(.bottom-nav) .bottom-nav {
    grid-column: 1; grid-row: 1;
    position: static; width: 240px; height: 100dvh;
    flex-direction: column; justify-content: flex-start; align-items: stretch;
    gap: 6px; padding: 24px 14px;
    border-top: none; border-right: 1px solid var(--line); background: #fff;
  }
  .nav-item {
    flex-direction: row; justify-content: flex-start; align-items: center;
    gap: 12px; width: 100%; padding: 12px 14px; font-size: 15px; border-radius: 12px;
  }
  .nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
  .nav-item.active { background: var(--green-soft); color: var(--green); }
  /* On the desktop sidebar, only the exact section item highlights — neutralise the
     phone parent-highlight so Home doesn't also look active while in a sub-section. */
  .nav-item.active-parent { background: transparent; color: var(--ink-light); }

  /* Desktop-only secondary shortcuts, stacked under the four main tabs. There's
     plenty of room in the rail, so surface the key sections directly. */
  .app-shell:has(.bottom-nav) .nav-more {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  }
  .nav-more .nav-item { font-size: 14px; color: var(--ink-soft); }
  .nav-more .nav-item svg { width: 20px; height: 20px; }
  .nav-more .nav-item.active { color: var(--green); }   /* active text wins over the muted secondary colour */

  /* ---- Nav-less single-child screens: centre login, full-bleed the tool ---- */
  .app-shell > .login { max-width: 460px; margin: 40px auto; min-height: auto; }
  .app-shell > .screen.no-nav { width: 100%; }
  .tool-frame-screen { max-width: none; }
  .tool-frame { width: 100%; }

  /* ---- Mouse + keyboard affordances (phones only have :active) ---- */
  .tap:hover { opacity: .85; }
  .nav-item:hover { background: var(--green-soft); }
  .tap:focus-visible, .back-btn:focus-visible, .nav-item:focus-visible {
    outline: 2px solid var(--green); outline-offset: 2px;
  }

  /* Blocks fill the screen's capped column (set above), so they align without
     per-element margins. HOME: keep the four spice tiles in one row. */
  .home-screen .tile-grid { grid-template-columns: repeat(4, 1fr); }

  /* ---- COURSEWORK: the showcase — a real multi-column gallery
     (column width set above via .screen.cw-screen) ---- */
  .cw-screen .cw-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .cw-screen .cw-hero { padding: 22px 28px; }
  .cw-screen .cw-hero-chip { width: 52px; height: 52px; }
  .cw-screen .cw-card-list {                 /* lesson list: fluid 1 -> 2+ cols */
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px;
  }
  .cw-screen .cw-card-list .cw-card { margin-bottom: 0; }   /* grid gap handles spacing — avoid a double gap */

  /* Coursework lesson detail (video + article): one comfortable reading/watching column. */
  .app-shell:has(.bottom-nav) .screen.cw-detail { max-width: 820px; }

  /* ---- SUPPLIERS: a wider directory with the category / search results in a
     card grid instead of one tall narrow column. ---- */
  .app-shell:has(.bottom-nav) .screen.sup-screen { max-width: 900px; }
  .sup-screen #sup-results,
  .sup-screen #cat-results {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px; align-items: start;
  }
  .sup-screen #sup-results .supplier-cat,
  .sup-screen #cat-results .supplier-cat { margin-bottom: 0; }   /* grid gap handles spacing */
  .sup-screen #sup-results .empty,
  .sup-screen #cat-results .empty { grid-column: 1 / -1; }        /* no-match state spans the row */
  /* Footer CTA: cap the whole group as ONE column and let its children fill it,
     so the ask-card and both buttons share the same edges. Do NOT centre the
     button with margin:auto — a <button> is inline-level and ignores auto
     margins (that was the misalignment bug). Wrap + fill instead. */
  .sup-screen .sup-cta { max-width: 560px; margin-left: auto; margin-right: auto; }
  .sup-screen .sup-cta > * { width: 100%; }

  /* ---- TOOLS ----
     Launcher column width set above via .screen.th-screen. On desktop the tiny
     68px phone tiles look lost, so scale the GRID tiles up to fill the space.
     Scoped to .th-grid so the drag clone (appended to <body>, uses the base
     68px .th-icon) is untouched — its e.clientX-34 grab offset stays correct
     and reorder keeps working; the ghost is simply a bit smaller than the
     tiles, which is fine. Breakeven and other native tools fill the default
     column. */
  .th-grid { row-gap: 30px; column-gap: 24px; }
  .th-grid .th-icon { width: 104px; height: 104px; border-radius: 28px; }
  .th-grid .th-icon svg { width: 50px; height: 50px; }
  .th-grid .th-add .th-addsq { width: 104px; height: 104px; border-radius: 28px; }
  .th-grid .th-label { font-size: 14px; max-width: 128px; height: auto; }
  .th-grid .th-soon { font-size: 10px; padding: 2px 8px; }
  .th-grid .th-x { left: calc(50% - 60px); }   /* re-anchor edit-mode delete to the bigger tile */
  /* One-line description under each name turns the tiles into fuller cards. */
  .th-grid .th-desc {
    display: block; margin-top: 2px; max-width: 150px;
    font-size: 12px; line-height: 1.3; color: var(--ink-soft); text-align: center;
  }

  /* ---- BREAKEVEN: a two-pane work canvas — inputs left, results + save right.
     The .be-work / .be-col wrappers are plain blocks below 900px, so the phone
     layout stacks in the original order and is unchanged. ---- */
  .app-shell:has(.bottom-nav) .screen.be-screen { max-width: 980px; }
  .be-root .be-work {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 28px; align-items: start;
  }
  .be-root .be-col-out { position: sticky; top: 0; }   /* results stay in view while entering costs */

  /* ---- Reusable house helper: FUTURE native tools inherit desktop for free
     by wrapping their body in .tool-body and using these grid primitives.
     (Not retrofitted to existing tools in this pass.) ---- */
  .tool-body { max-width: 720px; margin: 0 auto; }
  .tool-body .two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .tool-body .two-pane  { display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,420px); gap: 24px; }
  .tool-body .tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
}

/* ---- True-wide screens: only ADD columns, never widen the reading measure ---- */
@media (min-width: 1300px) {
  .cw-screen .cw-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- HOME dashboard: only on genuinely wide screens (>=1150px) split Home into
   two columns — tiles + links (left, wide) and the feed (right). Below 1150px the
   .home-grid / .home-col wrappers stay plain blocks, so Home is the same tidy
   single column at phone AND narrower-laptop widths. Tiles-col is placed in
   column 1 even though it comes second in the DOM (DOM order = feed-first keeps
   the phone stack unchanged). ---- */
@media (min-width: 1150px) {
  .app-shell:has(.bottom-nav) .screen.home-screen { max-width: 1120px; }
  .home-screen .home-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px; align-items: start;
  }
  .home-screen .home-col-tiles { grid-column: 1; grid-row: 1; }
  .home-screen .home-col-feed  { grid-column: 2; grid-row: 1; }

  /* Search jumps to the top of the right rail on the dashboard. Reordering only
     works because the feed column becomes a flex column here; on phone / narrower
     laptops it's a plain block, so the search keeps its original position. */
  .home-screen .home-col-feed { display: flex; flex-direction: column; }
  .home-screen .home-col-feed .home-search { order: -1; margin-bottom: 16px; }
}

/* ============================================================
   WORKSHOP FEEDBACK GATE (blocking one-question overlay)
   Shown on app open when a participant owes feedback on a past workshop. Lives in
   its own DOM node above the SPA. Mobile-first; a slightly larger card on tablet/
   desktop. Matches the app system (white card, --line border, 20px radius, spice
   palette, 700 max weight, terracotta primary action).
   ============================================================ */
body.wsfb-open { overflow: hidden; }
.wsfb-scrim {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(39, 66, 29, 0.55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  animation: wsfbFade 0.18s ease;
}
@keyframes wsfbFade { from { opacity: 0; } to { opacity: 1; } }
.wsfb-card {
  width: 100%; max-width: 460px; background: var(--card);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 22px 20px 20px; box-shadow: 0 12px 40px rgba(39, 66, 29, 0.28);
  animation: wsfbRise 0.2s ease;
}
@keyframes wsfbRise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.wsfb-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--terracotta); margin-bottom: 8px;
}
.wsfb-title { font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.3; margin: 0 0 8px; }
.wsfb-help { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 14px; }
.wsfb-input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; font-size: 16px; color: var(--ink); font-family: inherit;
  min-height: 96px; resize: vertical;
}
.wsfb-input:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.wsfb-err { color: var(--terracotta); font-size: 13px; min-height: 18px; margin-top: 6px; }
.wsfb-send {
  width: 100%; margin-top: 6px; background: var(--terracotta); color: #fff;
  padding: 16px; border: none; border-radius: 14px; font-size: 17px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(196, 90, 63, 0.25); cursor: pointer;
}
.wsfb-send[disabled] { opacity: 0.5; box-shadow: none; }
@media (min-width: 768px) {
  .wsfb-card { max-width: 520px; padding: 28px 26px 24px; }
  .wsfb-title { font-size: 22px; }
}
