/* The look every Jo's app starts from (jodoc's colours): dark by default, light when the phone asks, Settings can pick. */
:root { --ink: #111114; --on-ink: #FFFFFF; --muted: #55555C; --line: #E6E6EB; --ground: #F5F5F7; --card: #FFFFFF; --danger: #B3261E; color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink: #F2F2F5; --on-ink: #111114; --muted: #A5A5AF; --line: #2B2B31; --ground: #0F0F12; --card: #1A1A1F; --danger: #FF8A80; color-scheme: dark; }
}
:root[data-theme="dark"] { --ink: #F2F2F5; --on-ink: #111114; --muted: #A5A5AF; --line: #2B2B31; --ground: #0F0F12; --card: #1A1A1F; --danger: #FF8A80; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif; }
.view { max-width: 560px; margin: 0 auto; padding: 16px 16px 96px; }
.top { display: flex; align-items: center; gap: 8px; } .top h1 { font-size: 24px; margin: 8px 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; } .pad { padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); } .big-n { font-size: 28px; } a { color: inherit; }
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
input[type=email], input[type=password] { font: inherit; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.consent { display: flex; gap: 8px; align-items: flex-start; }
button { font: inherit; color: inherit; cursor: pointer; }
.wide { width: 100%; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-weight: 600; }
.dark { background: var(--ink); color: var(--on-ink); border: 0; } .danger { color: var(--danger); }
.link { background: none; border: 0; text-decoration: underline; padding: 8px 0; }
.back { background: none; border: 0; font-size: 28px; padding: 0 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; } .seg label { flex: 1; text-align: center; padding: 10px; cursor: pointer; }
.seg input:checked + label { background: var(--ink); color: var(--on-ink); }
.group { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.setrow { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; text-decoration: none; }
.group > :last-child { border-bottom: 0; }
.group-title { margin: 10px 4px -4px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; } /* as jocal and jodoc */
.bar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.navbtn { flex: 1; padding: 14px; background: none; border: 0; } .navbtn[aria-current] { font-weight: 700; }

/* First name card in Account (2026-10-18): no gap while there is no "Saved." */
#name-status:empty { display: none; }

/* From jodoc: help button, Help screen, switches, AI this year, the toast. */
[hidden] { display: none !important; }
.top h1 { flex-grow: 1; }
.acct-btn { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--card); color: var(--ink); }
.faq details { display: block; }
.faq summary { cursor: pointer; font-weight: 700; min-height: 24px; }
.faq p { margin: 8px 0 0; }
textarea { font: inherit; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
input[type=time] { font: inherit; color: var(--ink); background: none; border: 0; }
.rowval { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.seg.small label { padding: 8px; font-size: 13px; }
.setrow.switchrow { flex-wrap: nowrap; align-items: center; cursor: pointer; }
.setrow.switchrow > span { flex: 1 1 auto; min-width: 0; }
.switch { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 50px; height: 30px; margin: 0; border-radius: 15px; background: var(--line); position: relative; cursor: pointer; transition: background-color 0.2s ease-out; }
.switch::before { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.switch:checked { background: var(--ink); }
.switch:checked::before { transform: translateX(20px); }
.ai-bar { display: block; flex: none; width: 64px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.ai-bar > i { display: block; height: 100%; background: var(--ink); }
.ai-bar.low > i { background: var(--danger); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 80px); z-index: 3; width: min(440px, calc(100% - 32px)); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 8px 4px 16px; border-radius: 16px; background: var(--ink); color: var(--on-ink); }
.toast .link { color: var(--on-ink); }

/* ===== Jo's food recipes screens ===== */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.view { display: flex; flex-direction: column; gap: 14px; }
.view > * { margin-top: 0; margin-bottom: 0; }
.top h1 { margin: 8px 0; overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 18px; } h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.small { font-size: 13px; } .note { margin: 0 4px; } .center { text-align: center; align-items: center; }
.stack.tight { gap: 8px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sec-head .link { padding: 0 4px; min-height: 44px; }
/* Home: the logo in its theme's colours, the name kept for screen readers */
.wordmark { flex-grow: 1; height: 56px; margin: 4px 0; background: url(wordmark-light.png) no-repeat left center / contain; }
:root[data-theme="dark"] .wordmark { background-image: url(wordmark-dark.png); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wordmark { background-image: url(wordmark-dark.png); } }
.trial-note { display: block; width: 100%; text-align: left; font-weight: 600; color: var(--ink); }
input[type=text], input:not([type]), input[type=url], input[type=search], input[type=number], select { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 44px; min-width: 0; }
.field input, .field select, .field textarea { width: 100%; }
.search { width: 100%; }
.row-form { display: flex; gap: 8px; } .row-form input { flex: 1; }
.pill-dark { min-height: 44px; padding: 0 18px; border: 0; border-radius: 22px; background: var(--ink); color: var(--on-ink); font-weight: 700; flex-shrink: 0; }
.pill-dark:disabled { opacity: .45; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1 1 0; min-width: 0; min-height: 48px; border-radius: 14px; border: 1px solid var(--line); font-weight: 700; padding: 6px 8px; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.btn-row > .dark { border: 0; }
.scan-btn { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.wide.scan-btn { border-radius: 14px; }
.wide:disabled, .btn-row > :disabled { opacity: .45; }
.filebtn { position: relative; cursor: pointer; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chip-x { margin-left: 6px; color: var(--muted); }
.opt-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; flex-wrap: wrap; }
.opt-label { font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; }
.stepper b { min-width: 2.2em; text-align: center; font-size: 20px; }
.pick { min-height: 44px; }
.seg.small label { padding: 8px 4px; font-size: 13px; display: flex; align-items: center; justify-content: center; min-height: 44px; }
.result h3 { font-size: 19px; }
.tobuy, .tag { font-size: 13px; font-weight: 700; }
.tag { margin-left: 8px; padding: 1px 8px; border-radius: 8px; background: var(--ground); border: 1px solid var(--line); white-space: nowrap; }
.warn { margin: 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, #E8A33D 22%, var(--card)); font-size: 14px; font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-align: left; }
.item-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item-name { font-weight: 700; overflow-wrap: anywhere; }
.item-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.item-meta .tag { margin: 0; }
.chev { color: var(--muted); font-size: 22px; line-height: 1; }
.filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.sticky-save { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); z-index: 2; }
@media (max-height: 520px) { .sticky-save { position: static; } }
/* A recipe */
.heart svg { fill: none; } .heart[aria-pressed="true"] svg { fill: #D94A5A; stroke: #D94A5A; }
.ings { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.steps-big { margin: 0; padding-left: 22px; display: grid; gap: 12px; line-height: 1.55; }
#rv-tip, #rv-food { margin: 0; }
#rv-link { margin: 0; }
/* Cook mode: big text, one step, the buttons where a thumb is */
.cook .ck-step { font-size: 26px; line-height: 1.45; font-weight: 600; margin: 8px 0; min-height: 40vh; overflow-wrap: anywhere; }
.ck-nav { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }
.ck-nav > * { min-height: 64px; font-size: 18px; }
/* Meal plan */
.day.today { border-color: var(--ink); }
.day .sec-head b { font-size: 16px; }
.plan-row { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.plan-open { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; padding: 4px 0; min-height: 44px; }
.x { flex-shrink: 0; width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); font-size: 18px; line-height: 1; }
/* Shopping list */
.shop-group { list-style: none; margin: 0; padding: 0; }
.shop-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 14px; border-bottom: 1px solid var(--line); }
.shop-group > :last-child { border-bottom: 0; }
.shop-tick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.shop-tick input { width: 24px; height: 24px; flex-shrink: 0; accent-color: var(--ink); }
.shop-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.shop-row.done .shop-name { text-decoration: line-through; color: var(--muted); }
.shop-row .x { border: 0; background: none; color: var(--muted); }
/* Sheets (add to plan, edit an item) */
.sheet { width: min(520px, calc(100% - 24px)); max-height: calc(100% - 48px); border: 0; border-radius: 20px; padding: 18px; background: var(--card); color: var(--ink); }
.sheet::backdrop { background: rgba(0, 0, 0, .45); }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 38vh; overflow: auto; }
.pick-item { text-align: left; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--ground); font-weight: 600; }
.pick-item[aria-checked="true"] { background: var(--ink); color: var(--on-ink); }
.num-in { width: 4.5em; text-align: center; }
/* Five tabs at 360px: icon over a short word */
.navbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.navbtn[aria-current] { color: var(--ink); }
.toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }
@media (max-width: 370px) { .seg.small label { font-size: 12px; } .row3 { grid-template-columns: 1fr 1fr; } .row3 > :last-child { grid-column: 1 / -1; } }
.scan-btn.danger, .wide.danger { color: var(--danger); }
/* The Library (Kaz, 2026-10-18): the switch's two parts, the label, stars, tips */
.part { display: flex; flex-direction: column; gap: 14px; }
.lib-label { margin: 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; }
.lib-label.ai { background: color-mix(in srgb, #E8A33D 14%, var(--card)); }
.lib-label.down { background: color-mix(in srgb, var(--danger) 16%, var(--card)); }
.lib-label small { display: block; margin-top: 4px; font-weight: 400; color: var(--muted); font-size: 13px; }
.stars { display: flex; gap: 4px; }
.stars button { width: 48px; height: 48px; border: 0; background: none; font-size: 32px; line-height: 1; color: var(--muted); opacity: .55; padding: 0; } /* Kaz, 2026-10-21: an empty star was almost invisible in dark mode (the line colour on the card) */
.stars button.on { color: #E8A33D; opacity: 1; }
.tips li { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.tips li:first-child { border-top: 0; padding-top: 0; }
.tip-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.thumb { min-height: 40px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; }
.thumb[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.report-link { align-self: flex-start; color: var(--muted); }

/* Long words, web links and long emails wrap inside their card instead of running off the screen (Kaz, 2026-10-21). "break-word" only
   breaks a word that cannot fit, so short labels such as Subscription and Light are never split. */
.card, .field, .consent, .lib-label, .warn, .toast { overflow-wrap: break-word; }
.setrow > b, #account-summary, #plan-summary { min-width: 0; overflow-wrap: anywhere; }
.chip { max-width: 100%; height: auto; padding: 8px 14px; overflow-wrap: break-word; text-align: left; }
.stack > *, .view > * { min-width: 0; }
#rv-steps:empty { display: none; }
/* "Email me tips and offers" in Account is a card with its own box: .setrow had taken its background and three sides (Kaz, 2026-10-21) */
.setrow.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
