* { box-sizing: border-box; }
/* TORVASSE P3 Deep Navy & Sand: CSS variables from palette-final-tokens.json v1.1 (chosen by Neto 17 Nov 2026; UX contrast sign-off).
   Three blocks: light (default), forced dark, and dark when the phone is dark and the user has not forced light.
   Paste into style.css in place of the current :root colour block. Nothing else in this file is needed. */
:root {
  color-scheme: light dark;
  --surface-base: #F5F3EE;
  --surface-raised: #E8E1D2;
  --surface-inverse: #0E1A2E;
  --text-primary: #14213D;
  --text-secondary: #22304F;
  --text-muted: #5A5446;
  --text-on-inverse: #EFE7D6;
  --accent-primary: #1F3A5F;
  --accent-on-primary: #F5F3EE;
  --border-control: #6A6456;
  --border-decorative: #CFC6B2;
  --focus-ring: #1F3A5F;
  --ring-track: #DCD4C2;
  --disabled-text: #8A8475;
  --state-success: #256B5C;
  --state-warning: #7A4F00;
  --state-error: #9B3B2E;
  --state-info: #4B3F7A;
  --series-calories: #14213D;
  --series-protein: #2B5D9B;
  --series-carbs: #8A6A2B;
  --series-fat: #7A3E3E;
  /* legacy names used by the current style.css, mapped to the P3 tokens so existing var(--x) rules keep working */
  --bg: var(--surface-base); --card: var(--surface-raised); --input: var(--surface-base);
  --border: var(--border-decorative); --line: var(--border-decorative); --field-border: var(--border-control);
  --text: var(--text-primary); --muted: var(--text-muted); --btn: var(--ring-track);
  --sel: var(--accent-primary); --sel-text: var(--accent-on-primary);
  --done-bg: var(--state-success); --done-line: var(--state-success); --done-text: var(--surface-base);
  --update: var(--state-warning); --track: var(--ring-track);
  --nutrition-calories: var(--series-calories); --nutrition-protein: var(--series-protein);
  --nutrition-carbs: var(--series-carbs); --nutrition-fat: var(--series-fat);
  --scrim: rgba(14, 26, 46, .72); --accent: var(--accent-primary);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-base: #0E1A2E;
  --surface-raised: #18263F;
  --surface-inverse: #F5F3EE;
  --text-primary: #EFE7D6;
  --text-secondary: #D6CCB6;
  --text-muted: #B4BBC6;
  --text-on-inverse: #14213D;
  --accent-primary: #D8C39A;
  --accent-on-primary: #0E1A2E;
  --border-control: #8C8674;
  --border-decorative: #2A3A58;
  --focus-ring: #E9DCC0;
  --ring-track: #2A3A58;
  --disabled-text: #5F6B80;
  --state-success: #8FD0B0;
  --state-warning: #FFA55C;
  --state-error: #E38B7A;
  --state-info: #A9C4E8;
  --series-calories: #EFE7D6;
  --series-protein: #8FB0D9;
  --series-carbs: #B8875A;
  --series-fat: #D98E8E;
  --scrim: rgba(14, 26, 46, .72);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
  --surface-base: #0E1A2E;
  --surface-raised: #18263F;
  --surface-inverse: #F5F3EE;
  --text-primary: #EFE7D6;
  --text-secondary: #D6CCB6;
  --text-muted: #B4BBC6;
  --text-on-inverse: #14213D;
  --accent-primary: #D8C39A;
  --accent-on-primary: #0E1A2E;
  --border-control: #8C8674;
  --border-decorative: #2A3A58;
  --focus-ring: #E9DCC0;
  --ring-track: #2A3A58;
  --disabled-text: #5F6B80;
  --state-success: #8FD0B0;
  --state-warning: #FFA55C;
  --state-error: #E38B7A;
  --state-info: #A9C4E8;
  --series-calories: #EFE7D6;
  --series-protein: #8FB0D9;
  --series-carbs: #B8875A;
  --series-fat: #D98E8E;
    --scrim: rgba(14, 26, 46, .72);
  }
}
/* Rules: sand (--accent-primary in dark) is never small text on light surfaces; carbs colour is a graphic only (numbers stay --text-primary);
   warning, error, success and info always carry an icon or a word; the ring track and --border-decorative are decoration, never a control edge. */
/* QA (build 110): the names the app's own rules use, mapped to UX's tokens above; the dropdown arrow in the secondary text colour of
   each theme (11.8:1 light, 10.9:1 dark on the field). */
:root {
  accent-color: var(--accent);
  --on-accent: var(--accent-on-primary); --focus: var(--focus-ring); --success: var(--state-success); --warning: var(--state-warning); --error: var(--state-error); --info: var(--state-info);
  --muted-page: var(--text-muted); --disabled: var(--disabled-text); --media-ctl: rgba(14, 26, 46, .78); --media-text: #EFE7D6;
  --dd-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2322304F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] { --dd-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23D6CCB6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --dd-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23D6CCB6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); } }
/* Photos and video are judged on black in both themes; their controls use the dark tokens (the names are set again here so they use them). */
#photo-viewer, #photo-compare, .anim-frame {
  color-scheme: dark;
  --surface-base: #0E1A2E; --surface-raised: #18263F; --surface-inverse: #F5F3EE; --text-primary: #EFE7D6; --text-secondary: #D6CCB6; --text-muted: #B4BBC6;
  --text-on-inverse: #14213D; --accent-primary: #D8C39A; --accent-on-primary: #0E1A2E; --border-control: #8C8674; --border-decorative: #2A3A58; --focus-ring: #E9DCC0;
  --ring-track: #2A3A58; --disabled-text: #5F6B80; --state-success: #8FD0B0; --state-warning: #FFA55C; --state-error: #E38B7A; --state-info: #A9C4E8;
  --series-calories: #EFE7D6; --series-protein: #8FB0D9; --series-carbs: #B8875A; --series-fat: #D98E8E;
  --bg: var(--surface-base); --card: var(--surface-raised); --input: var(--surface-base); --border: var(--border-decorative); --line: var(--border-decorative);
  --field-border: var(--border-control); --text: var(--text-primary); --muted: var(--text-muted); --btn: var(--ring-track); --sel: var(--accent-primary); --sel-text: var(--accent-on-primary);
  --done-bg: var(--state-success); --done-line: var(--state-success); --done-text: var(--surface-base); --update: var(--state-warning); --track: var(--ring-track);
  --nutrition-calories: var(--series-calories); --nutrition-protein: var(--series-protein); --nutrition-carbs: var(--series-carbs); --nutrition-fat: var(--series-fat); --accent: var(--accent-primary);
  --on-accent: var(--accent-on-primary); --focus: var(--focus-ring); --success: var(--state-success); --warning: var(--state-warning); --error: var(--state-error); --info: var(--state-info);
  --muted-page: var(--text-muted); --disabled: var(--disabled-text); --media-ctl: rgba(14, 26, 46, .78); --media-text: #EFE7D6;
  --scrim: rgba(14, 26, 46, .72); --dd-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23D6CCB6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Fixed 16 px base text; iPhone does not resize the text when the screen turns. */
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, system-ui, Helvetica, Arial, sans-serif; font-size: 16px; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--stack-h, 48px) + 8px); scroll-padding-bottom: calc(var(--bottom-h, 56px) + 8px); }
/* The page ends above the measured bottom bars (navigation, and the workout strip while a session runs), plus 12 px. */
body { padding-bottom: calc(var(--bottom-h, 56px) + 12px); }
h1 { font-size: 20px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 14px 0 8px; }
main { padding: 10px 12px; }
/* Fields (owner request, v98): the painted face is 32 px, the same height as every button face and the workout-day selectors.
   The tap box stays 44 px: 6 px transparent above and below, the face drawn in the padding box (background + 1 px inset outline).
   16 px text, 20 px line, 6 px padding. Radius 8px/14px gives an 8 px round corner on the face. */
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  font: inherit; font-size: 16px; line-height: 20px; width: 100%; min-width: 0; height: 44px; margin: 0;
  padding: 6px 10px; border-style: solid; border-color: transparent; border-width: 6px 0; border-radius: 8px / 14px;
  background-color: var(--input); background-clip: padding-box; box-shadow: inset 0 0 0 1px var(--field-border);
  color: var(--text); -webkit-appearance: none; appearance: none;
}
textarea { height: auto; min-height: 44px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--text); }
input::placeholder { color: var(--muted); opacity: 1; }
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.row.tight > * { flex: 0 0 auto; }
.row + .row { margin-top: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.big { font-size: 26px; font-weight: 700; }
.daybar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }
.set { display: grid; grid-template-columns: 30px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 44px; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.set.done { color: var(--done-line); font-size: 14px; grid-template-columns: 34px 1fr; }
.set.done .det { font-size: 13px; color: var(--muted); }
.set .n { color: var(--muted); }
.set > input:not([type=checkbox]):not([type=radio]):not([type=file]) { padding: 6px 4px; text-align: center; }
.ok { color: var(--done-line); }
.stat { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--border); }
.hidden { display: none !important; }
details { margin-top: 6px; }
summary { cursor: pointer; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--border); }
table td { padding: 8px 4px; }
table td button { min-width: 44px; }
.last-line { font-size: 14px; color: var(--text); margin: 6px 0 4px; }
.last-line b { color: var(--muted); font-weight: 600; }
.legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.legend.on { background: var(--sel); }
.legend.done { background: var(--done-bg); }
/* Build 116 (Neto): Theme, like Language, uses the phone's own menu, which opens next to the ⋯ menu instead of a list from the bottom. */
select.dd, #lang-select, #theme-select { background-image: var(--dd-arrow); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input[type=checkbox], input[type=radio] { -webkit-appearance: checkbox; appearance: auto; width: 22px; height: 22px; min-height: 22px; flex: 0 0 22px; padding: 0; margin: 0; accent-color: var(--sel); }
label.row > input[type=checkbox] { flex: 0 0 22px; }
label.row { gap: 10px; cursor: pointer; font-size: 15px; color: var(--text); min-height: 44px; align-items: center; }
.card > label.row { flex-wrap: nowrap; align-items: flex-start; }
.req { color: var(--error); font-weight: 700; }
@media (max-width: 380px) {
  main { padding: 8px; }
  .card { padding: 10px; }
  .row { flex-wrap: wrap; }
  .row > * { flex: 1 1 100%; }
  .row.tight > * { flex: 0 0 auto; }
  .stat b { text-align: right; }
}
/* Exercise card header: buttons wrap below the name on narrow phones */
.card > .row { flex-wrap: wrap; }
.card > .row > .row.tight { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; }

/* ---- One button system (approved UX review): a real target of at least 44x44 px with a painted 32 px face inside.
   The face is drawn by ::before (6 px transparent above and below); the whole button is the tap area. Primary and secondary
   share the geometry; the sand fill and weight show priority. Text 16px/20px, face padding 5px/10px, 1 px outline, radius 8 px. ---- */
button {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: fit-content; max-width: 100%; min-width: 44px; min-height: 44px; height: auto;
  margin: 0; padding: 12px 11px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); box-shadow: none; cursor: pointer; touch-action: manipulation;
  font: 500 1rem/1.25rem -apple-system, system-ui, Helvetica, Arial, sans-serif;
  white-space: normal; word-break: normal; overflow-wrap: break-word; text-align: center;
}
button::before { content: ''; position: absolute; inset: 6px 0; z-index: -1; border: 1px solid var(--field-border); border-radius: 8px; background: transparent; pointer-events: none; }
button.primary, button.on { color: var(--sel-text); font-weight: 600; }
button.primary::before, button.on::before { background: var(--sel); border-color: var(--sel); }
button.danger { color: var(--on-accent); font-weight: 600; }
button.danger::before { background: var(--error); border-color: var(--error); }
button.done { color: var(--done-text); }
button.done::before { background: var(--done-bg); border-color: var(--done-bg); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; box-shadow: 0 0 0 4px var(--bg); }
/* File pickers drawn as buttons (check-in photos, food photo): the same 44 px target and 32 px painted face as button */
label.filebtn { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 12px 11px; font: 500 1rem/1.25rem -apple-system, system-ui, Helvetica, Arial, sans-serif; color: var(--text); text-align: center; cursor: pointer; }
label.filebtn.wide { display: flex; width: 100%; margin-top: 8px; }
label.filebtn::before { content: ''; position: absolute; inset: 6px 0; z-index: -1; border: 1px solid var(--field-border); border-radius: 8px; pointer-events: none; }
label.filebtn:focus-within::before { box-shadow: inset 0 0 0 2px var(--text); }
label.filebtn > input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
/* In-app option list (owner request, v100, picker.js): a field-style button (32 px face, 44 px target) opens a sheet of options.
   Rows are 44 px or more and long names wrap; the current choice is filled sand. The hidden <select> keeps the value. */
select.pick-native { display: none !important; }
button.pick-face { display: flex; width: 100%; justify-content: flex-start; text-align: left; padding: 12px 36px 12px 10px; font-weight: 400; }
button.pick-face::before { background: var(--input) var(--dd-arrow) no-repeat right 12px center; }
button.pick-face.pick-placeholder { color: var(--muted); }
button.pick-face:focus-visible { outline: none; box-shadow: none; }
button.pick-face:focus-visible::before { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.pick-val { min-width: 0; overflow-wrap: anywhere; }
html.picker-open, html.picker-open body { overflow: hidden; }
#picker { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.picker-back { position: absolute; inset: 0; background: var(--scrim); }
.picker-sheet { position: relative; display: flex; flex-direction: column; width: min(560px, 100%); max-height: min(85vh, 640px); background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.picker-head { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 2px max(8px, env(safe-area-inset-right)) 2px 16px; border-bottom: 1px solid var(--line); }
#picker-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 17px; line-height: 22px; overflow-wrap: anywhere; }
#picker-close { flex: 0 0 auto; }
.picker-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px 12px; }
.picker-opt { display: flex; align-items: center; min-height: 44px; padding: 12px; border-radius: 8px; font-size: 16px; line-height: 20px; color: var(--text); cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
.picker-opt + .picker-opt { margin-top: 2px; }
.picker-opt[aria-selected="true"] { background: var(--sel); color: var(--sel-text); font-weight: 600; }
.picker-opt[aria-disabled="true"] { color: var(--muted); cursor: default; }
.picker-opt:focus { outline: none; }
.picker-opt:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.picker-opt[aria-selected="true"]:focus-visible { outline-color: var(--sel-text); }
.picker-text { flex: 1 1 auto; min-width: 0; }
.picker-group { padding: 10px 12px 4px; font-size: 13px; line-height: 18px; color: var(--muted); }
@media (hover: hover) { .picker-opt:not([aria-selected="true"]):not([aria-disabled="true"]):hover { background: var(--btn); } }
.row > button, .row.tight > button, .btn-group > button, .daybar button, .card > .row > .row.tight > button { flex: 0 0 auto; }
/* Cards that are buttons (Home tiles, exercise choices) keep their card look, without a painted face. */
.modules { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.modules > .module { width: 100%; }
.module { justify-content: flex-start; text-align: left; padding: 12px; min-height: 48px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 15px; font-weight: 600; }
.swap-opt { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-top: 8px; color: var(--text); min-height: 44px; }
.swap-opt .muted { margin-top: 2px; }
.module::before, .swap-opt::before, nav#tabs button::before { display: none; }
a.small { display: inline-block; padding: 7px 9px; border-radius: 10px; background: var(--btn); color: var(--text); text-decoration: none; font-size: 14px; min-height: 36px; line-height: 22px; }

/* ---- Toolbar (approved): one sticky bar, at least 48 px plus the top safe area: [Back] area title [menu] ---- */
header#toolbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 48px;
  padding: calc(1px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 1px max(12px, env(safe-area-inset-left));
  background: var(--bg); border-bottom: 1px solid var(--border);
}
#sticky-back { order: 1; flex: 0 0 auto; }
#title-wrap { order: 2; flex: 1 1 0; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
#area-title { flex: 0 1 auto; min-width: 0; margin: 0; font-size: 17px; line-height: 22px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
/* Home (owner request, build 102): the display version right after the app name, smaller and muted (AA on the toolbar).
   When space runs out the name ends with an ellipsis; the version and the menu are never cut. */
#app-ver { flex: 0 0 auto; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--muted); white-space: nowrap; }
#title-wrap.with-ver #area-title, #title-wrap.has-chip #area-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#title-wrap.has-chip { align-items: center; }
#menu-btn { order: 3; flex: 0 0 auto; margin-left: auto; font-size: 20px; letter-spacing: 1px; }
/* Very narrow (for example 200% zoom): Back and the menu share the first line; the title takes its own line below. */
@media (max-width: 300px) {
  #menu-btn { order: 2; }
  #title-wrap { order: 3; flex: 1 1 100%; padding-bottom: 4px; }
}
#menu-panel { position: absolute; top: 100%; right: max(12px, env(safe-area-inset-right)); z-index: 30; width: min(280px, calc(100vw - 24px)); background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: 0 8px 24px var(--scrim); }
/* Menu rows (redesign Nov 2026): Language, Cloud backup status, Backup account…, Version, Log out — list rows, not button faces. */
#menu-panel { padding: 4px 14px; }
.menu-row, .menu-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.menu-row > label { margin: 0; font-size: 16px; color: var(--text); }
.menu-row #lang-select, .menu-row #theme-select { width: auto; max-width: 60%; }
#menu-sync { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; line-height: 20px; color: var(--muted); text-align: right; }
#menu-sync .hi { width: 18px; height: 18px; }
#menu-sync > span[aria-hidden] { display: inline-flex; align-items: center; gap: 6px; }
#menu-version { font-size: 16px; color: var(--text); }
#menu-version-num { color: var(--muted); }
button.menu-item { width: 100%; max-width: none; padding: 12px 0; border-radius: 0; font-weight: 400; text-align: left; }
button.menu-item:last-child { border-bottom: 0; }
button.menu-item::before, .today-row::before, .home-tile::before, .ci-row::before, .ci-head-btn::before, .linklike::before { display: none; }
button.menu-item .chev { width: 20px; height: 20px; color: var(--muted); }

/* Notices in the page (not sticky): update banner, and the messages that need attention (offline, not saved yet, coaches...) */
#notices { padding: 0 12px; }
#notices > :not(.hidden) { margin-top: 10px; }
#status-bar { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 14px; line-height: 1.4; }
#status-bar div + div { margin-top: 4px; }

/* ---- Bottom: the workout strip (only during a session) above the five-destination navigation ---- */
#bottom-stack { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--bg); }
#session-strip { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 1px max(12px, env(safe-area-inset-right)) 1px max(12px, env(safe-area-inset-left)); background: var(--card); border-top: 1px solid var(--border); }
.ss-text { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 18px; color: var(--text); }
.ss-line b { color: var(--sel); font-weight: 700; font-variant-numeric: tabular-nums; }
.ss-actions { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
nav#tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: 56px; padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); border-top: 1px solid var(--border); background: var(--bg); }
nav#tabs button { display: flex; flex-direction: column; justify-content: center; gap: 2px; width: 100%; min-width: 0; min-height: 55px; padding: 4px 2px; border-radius: 0; color: var(--muted); font-size: 13px; line-height: 16px; font-weight: 500; }
nav#tabs button svg { width: 20px; height: 20px; flex: 0 0 20px; }
nav#tabs .tab-label { display: block; max-width: 100%; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
nav#tabs button.current { color: var(--sel); font-weight: 600; }
nav#tabs button.current .tab-label { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
/* The on-screen keyboard is open: the bottom bars step aside so the field being typed in stays visible. */
body.kb-open #bottom-stack, body.kb-open #toast { display: none; }

/* A short message ("Saved to the cloud."), shown once above the bottom bars */
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-h, 56px) + 12px); z-index: 25; max-width: calc(100vw - 32px); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: 14px; line-height: 1.4; box-shadow: 0 6px 18px var(--scrim); }

/* ---- Modal: one sticky header (title and Close) inside the box ---- */
#modal { position: fixed; inset: 0; background: var(--scrim); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 14px; }
#modal .box { background: var(--bg); border-radius: 14px; padding: 0 12px 12px; width: 100%; max-width: 640px; max-height: 92vh; max-height: 92dvh; overflow: auto; }
.modal-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; min-height: 48px; margin: 0 -12px 8px; padding: 2px 12px; background: var(--bg); border-bottom: 1px solid var(--border); }
#modal-title { flex: 1 1 auto; min-width: 0; }
#modal-title h2 { margin: 0 !important; font-size: 17px; line-height: 22px; font-weight: 600; }
#modal-close { flex: 0 0 auto; margin-left: auto; }
#modal video { width: 100%; border-radius: 10px; background: #000; }
#modal video, #cam { max-height: 62vh; object-fit: cover; }

/* ---- Exercise details arrow ---- */
details.exinfo { margin-top: 6px; }
details.exinfo summary { color: var(--muted); font-size: 14px; list-style: none; cursor: pointer; }
details.exinfo summary::-webkit-details-marker { display: none; }
details.exinfo .arrow { display: inline-block; transition: transform .15s; color: var(--sel); }
details.exinfo[open] .arrow { transform: rotate(180deg); }
details.exinfo div { font-size: 14px; margin: 6px 0 2px; }
details.exinfo ul { margin: 4px 0 0 18px; padding: 0; font-size: 14px; color: var(--text); }
details.cardio-list > summary { display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: 16px; color: var(--text); font-weight: 600; }
details.cardio-list .arrow { font-size: 20px; line-height: 1; }
/* Superset: a heading line, then the paired exercises inside one coloured edge */
.superset-head { color: var(--sel); font-weight: 600; font-size: 14px; margin: 10px 2px 6px; }
.superset { border-left: 3px solid var(--sel); padding-left: 8px; margin-bottom: 12px; }
.superset > .card { margin-bottom: 8px; }

/* ---- Login screen ---- */
.login-screen { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; align-items: center; align-items: safe center; justify-content: center; padding: 16px; overflow-y: auto; }   /* UX (palette and logo build): the new-user form fits 320 x 568 with the logo block; scrolls, never cut at the top */
.login-card { width: 100%; max-width: 380px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; padding: 0; border: 0; margin: 0; }
/* Logged out: nothing of the app is shown behind the login card */
body.locked > header, body.locked > main, body.locked > #notices, body.locked > #bottom-stack, body.locked > #toast { display: none !important; }

/* Swipe hint for the medicine rows: a neutral right-edge marker, and one peek on the first row. */
.swipe-hint { position: absolute; right: 8px; top: 50%; width: 3px; height: 24px; border-radius: 2px; background: var(--muted-page); opacity: 1; transform: translateY(-50%); pointer-events: none; z-index: 1; }
.swipe-row.peek .swipe-face { animation: swipe-peek 900ms ease-in-out 600ms 1; }
.swipe-row.peek .swipe-under { background: var(--card) !important; color: var(--text) !important; }
.swipe-row.compact .swipe-hint { height: 18px; }
@keyframes swipe-peek { 0%,100% { transform: translateX(0); } 35%,65% { transform: translateX(-20%); } }
@media (prefers-reduced-motion: reduce) { .swipe-row.peek .swipe-face { animation: none; } }

/* In-app dialog for confirmations: the app's own look, not the browser's box. */
.app-dialog-back { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 90; }   /* above the photo viewer (80) */
.app-dialog { width: 100%; max-width: 340px; margin: 0; }

/* Weekday picker (questionnaire): seven days in two rows of equal columns. A chosen day takes the sand fill. */
.wd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 6px 0 4px; }
.wd { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 12px 4px; border: 0; color: inherit; font-size: 15px; line-height: 20px; text-align: center; cursor: pointer; user-select: none; margin: 0; }
.wd::before { content: ''; position: absolute; inset: 6px 0; z-index: -1; border: 1px solid var(--field-border); border-radius: 8px; pointer-events: none; }
.wd input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.wd:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.wd.on { color: var(--sel-text); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
.wd.on::before { background: var(--sel); border-color: var(--sel); }
/* Questionnaire: short answers share a row in two equal columns; long questions take the full width. */
.qform { margin-top: 16px; }
.quiz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.qf { min-width: 0; }
.qf-full { grid-column: 1 / -1; }
.quiz-links, .quiz-options, .quiz-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-links { margin-bottom: 14px; }
.quiz-links a, .quiz-options button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 6px 12px; border: 1px solid var(--field-border); border-radius: 9px;
  background: var(--input); color: var(--text); text-align: center;
}
.quiz-options button[aria-pressed="true"] { background: var(--sel); color: var(--sel-text); border-color: var(--sel); }
.quiz-links a:focus-visible, .quiz-options button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.quiz-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.quiz-section h3 { margin: 0 0 6px; scroll-margin-top: 120px; }
.quiz-options { margin: 6px 0; }
.quiz-options button { flex: 1 1 auto; }
.quiz-options button::before { display: none; }
.qf select[hidden] { display: none; }
.quiz-multi { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(138px, 100%), 1fr)); gap: 4px 8px; }
.quiz-multi label { min-height: 44px !important; }
#quiz-progress { width: 100%; accent-color: var(--accent); }
.quiz-week:not(:empty) { margin: 10px 0 0; padding: 9px 12px; background: var(--input); border-left: 3px solid var(--accent); }
.quiz-actions { margin-top: 14px; }
.signup-notice { margin: 12px 0 16px; padding: 10px 12px; border: 1px solid var(--field-border); border-radius: 9px; }
.signup-notice details, .cloud-signup { margin: 10px 0; }
.signup-check { display: flex; align-items: center; min-height: 44px; gap: 10px; }
.signup-check input { width: auto; flex: none; }
.backup-recovery { width: min(calc(100% - 32px), 420px); max-height: calc(100% - 32px); margin: auto; background: var(--card); color: var(--text); }
.backup-recovery::backdrop { background: var(--scrim); }

/* In-page Back buttons are replaced by the toolbar Back */
body.sticky-back-on button[data-home="menu"] { display: none !important; }

/* Very narrow (for example 200% zoom): the short questionnaire answers take the full width, and the set entry row uses two lines
   (number, kg, reps / RIR, OK), so no value or placeholder is cut off. */
@media (max-width: 300px) {
  .quiz-grid { grid-template-columns: minmax(0, 1fr); }
  .set:not(.done) { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); row-gap: 4px; }
  .set:not(.done) > input:nth-of-type(3) { grid-column: 2; }
  main { padding: 8px 6px; }
  .card { padding: 10px 8px; }
  select.dd, #lang-select, #theme-select { padding-right: 28px; background-position: right 8px center; }
}
/* ---- Redesign (Neto, Nov 2026; Shared/ui-home-redesign-2026-11-15.md) ---- */
.hi { width: 24px; height: 24px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Title button: the whole title row checks for an update; the chip "v1.1 ⟳" has the 32 px face. */
#title-wrap.with-ver { align-items: center; cursor: pointer; min-height: 44px; }
#app-title-btn { flex: 0 0 auto; gap: 6px; padding: 12px 10px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); }
#app-title-btn .hi { width: 16px; height: 16px; }
#app-title-btn:active::before, #title-wrap.with-ver:active #app-title-btn::before { background: var(--btn); }
#app-title-btn:active, #title-wrap.with-ver:active #app-title-btn { color: var(--text); }
#app-title-btn.busy .spin-icon { animation: hspin 1s linear infinite; }
@keyframes hspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #app-title-btn.busy .spin-icon { animation: none; } }
@media (max-width: 300px) { #title-wrap { flex-wrap: wrap; row-gap: 0; } }   /* UX (palette and logo build): the header may wrap below 300 px, so the update chip is never cut off (195 px zoom) */
#title-msg { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--field-border); border-radius: 12px; padding: 12px 14px; font-size: 16px; line-height: 22px; }
#title-msg.hidden { display: none; }
#title-msg .update-card { flex: 1; }
#title-msg .update-card b { font-size: 17px; }
#backup-off { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; background: var(--card); border: 1px solid var(--field-border); border-radius: 12px; padding: 8px 12px; font-size: 14px; line-height: 20px; }
#backup-off.hidden { display: none; }
#backup-off > span:first-child { display: flex; gap: 8px; align-items: flex-start; flex: 1 1 200px; }
#backup-off .hi { width: 20px; height: 20px; }
/* Home */
.greeting { margin: 4px 2px 12px; }
.greeting .hello { font-size: 22px; line-height: 28px; margin: 0; }
.greeting .muted { font-size: 14px; }
.hero { border-color: var(--sel); padding: 14px 16px; }
.hero-kicker { font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sel); }
.hero-title { display: flex; align-items: center; gap: 8px; font-size: 20px; line-height: 26px; font-weight: 700; margin: 4px 0 2px; }
.hero > .muted { font-size: 14px; }
button.hero-btn { width: 100%; max-width: none; min-height: 60px; margin-top: 10px; font-size: 17px; }
button.hero-btn .play { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.today-card { padding: 2px 16px; }
button.today-row, button.ci-row { display: flex; width: 100%; max-width: none; align-items: center; justify-content: flex-start; gap: 12px; min-height: 52px; padding: 10px 0; text-align: left; font-weight: 400; border-radius: 0; }
.today-row + .today-row { border-top: 1px solid var(--border); }
.tr-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-text b { font-size: 16px; line-height: 20px; }
.tr-text .muted { font-size: 14px; line-height: 18px; }
.tr-status { flex: 0 0 auto; font-size: 14px; color: var(--done-bg); }
.chev { width: 20px; height: 20px; color: var(--muted); }
.tr-bar { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--btn); overflow: hidden; }
.tr-bar > span { display: block; height: 100%; background: var(--sel); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
button.home-tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; width: 100%; max-width: none; min-height: 88px; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; text-align: left; }
.home-tile .hi { color: var(--sel); margin-bottom: 4px; }
.home-tile b { font-size: 15px; line-height: 20px; font-weight: 600; }
.home-tile .muted { font-size: 13px; line-height: 18px; }
.cloud-line { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--muted); margin: 4px 0 16px; text-align: center; }
.cloud-line .hi { width: 16px; height: 16px; }
@media (max-width: 300px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
/* Workout: check-in card and rest day */
button.ci-row.card { min-height: 56px; padding: 10px 16px; border-radius: 14px; }
.ci-card .ci-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
button.ci-head-btn { flex: 1 1 auto; justify-content: flex-start; gap: 10px; padding: 12px 0; font-size: 17px; text-align: left; max-width: none; }
.date-chip { flex: 0 0 auto; border: 1px solid var(--field-border); border-radius: 999px; padding: 3px 12px; font-size: 14px; color: var(--muted); }
button.linklike { display: inline-flex; min-height: 44px; padding: 12px 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; font-weight: 400; }
.ci-food, .food-ci { margin-top: 6px; }
.ci-food button.linklike, .food-ci button.linklike { min-height: 44px; padding: 12px 0; margin: -12px 0; font-size: inherit; line-height: inherit; vertical-align: baseline; }
.ci-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rest-hero .hero-title .hi { width: 26px; height: 26px; }
.hist-ci summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; }
/* Narrow screens and 200% zoom: rows keep their text whole (the icon steps aside, the status goes under the title);
   menu rows put the label above the field. */
@media (max-width: 300px) {
  button.today-row, button.ci-row { flex-wrap: wrap; row-gap: 2px; }
  button.today-row > .hi:first-child, button.ci-row > .hi:first-child { display: none; }
  .tr-text { flex: 1 1 calc(100% - 32px); }
  .tr-status { order: 3; flex: 1 1 100%; }
  button.ci-row.card { padding: 10px 12px; }
  .menu-row { flex-wrap: wrap; row-gap: 4px; padding: 6px 0; }
  .menu-row #lang-select, .menu-row #theme-select { width: 100%; max-width: 100%; }
  .ci-card .ci-head { flex-wrap: wrap; }
}
/* Update available (Neto, build 103; P3, build 110: the palette's warning amber replaces the orange, Neto 17 Nov 2026): --update is
   the warning token, light #7A4F00, dark #FFA55C. Colour is not alone: a dot and the new version show too. */
#app-title-btn.has-update, #app-title-btn.has-update #app-ver { color: var(--update); font-weight: 600; }
#app-title-btn.has-update::before { border-color: var(--update); }
#app-title-btn .upd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--update); flex: 0 0 auto; }
#app-title-btn.has-update:active, #title-wrap.with-ver:active #app-title-btn.has-update { color: var(--update); }
/* Keep panning and pinch zoom without scaling the page on a double tap. */
html, body { touch-action: manipulation; }
/* Exercise animations in the Technique view (build 104, animations.js): card width, muted loop; play/pause button 44 px. */
.anim-box:empty { display: none; }
.anim-card { margin: 0 0 12px; }
.anim-frame { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.anim-media-el { display: block; width: 100%; height: auto; max-height: 52vh; object-fit: contain; }
button.anim-toggle { position: absolute; right: 6px; bottom: 0; color: var(--text); }
button.anim-toggle::before { background: var(--media-ctl); border-color: var(--field-border); }
.anim-card figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: 14px; line-height: 20px; }
.anim-label { border: 1px solid var(--field-border); border-radius: 999px; padding: 1px 10px; font-size: 13px; color: var(--muted); }
.anim-title { color: var(--text); }
.anim-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 14px; }
/* Check-in not done today (Neto, build 104): the same colour as the update chip (P3: the warning amber)
   for the row border and "To do", plus a dot (not colour alone). Done: the normal look with "✓ Done". */
button.ci-row.card.todo { border-color: var(--update); }
.tr-status.todo { display: inline-flex; align-items: center; gap: 6px; color: var(--update); font-weight: 600; }
.todo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--update); flex: 0 0 auto; }
/* Progress photos (Neto, build 104, progress-photos.js): Front and Side rows of up to 3 dates; full-screen viewer. */
.pp-line { margin-bottom: 4px; }
.pp-row { margin-top: 10px; }
.pp-label { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.pp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
button.pp-tile { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; max-width: none; padding: 0; min-height: 44px; }
button.pp-tile::before { display: none; }
.pp-img { display: block; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--btn); border: 1px solid var(--border); }
.pp-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pp-missing { background: repeating-linear-gradient(135deg, var(--btn) 0 8px, var(--card) 8px 16px); }
.pp-date { font-size: 13px; line-height: 18px; color: var(--muted); text-align: center; font-weight: 400; }
#photo-viewer { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: #000; color: var(--media-text); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
#photo-viewer.hidden { display: none; }
.pv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.pv-date { font-size: 16px; font-weight: 600; }
.pv-stage { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 8px; }
.pv-img { display: block; width: 100%; height: 100%; }
.pv-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pv-img.pp-missing { max-width: 360px; max-height: 480px; border-radius: 12px; }
.pv-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; padding: 0 12px 8px; }
/* Photo delete (Neto, build 104): thumbnails show they open (corner icon); the viewer's Delete is apart from Close. */
.pp-tile { position: relative; }
/* Build 114 (Neto): the corner icon sits on the dark media square in both themes, so it uses the media text colour (ivory).
   With --text it was dark navy on dark navy in light mode (1.2–1.9:1); ivory gives 7.0–15.0:1 over any photo. */
.pp-hint { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 6px; background: var(--media-ctl); color: var(--media-text); font-size: 14px; line-height: 24px; text-align: center; pointer-events: none; }
button.ci-thumb { flex: 1 1 0; display: flex; flex-direction: column; align-items: stretch; gap: 4px; max-width: none; padding: 0; font-weight: 400; }
button.ci-thumb::before { display: none; }
.ci-thumb-img { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.ci-thumb-img img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.pv-actions { display: flex; justify-content: flex-start; padding: 4px 12px 14px; }
img[data-foodphotoopen] { cursor: pointer; }
/* Food card "Medicines and supplements today" (build 104): two lists, one add form with a Medicine | Supplement switch */
.routine-sub { margin: 14px 0 2px; font-size: .95rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.routine-name { padding: 8px 0 8px 12px; color: var(--text); }
.routine-add { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.routine-add [hidden] { display: none !important; }
.routine-add .seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2px; }
.routine-add details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--muted); }
.routine-msg { min-height: 1.25rem; margin: 6px 0 8px; color: var(--text); font-weight: 500; }
.routine-msg:empty { margin: 0; min-height: 0; }
/* Check-in done (Neto): one slim gray line, "Today's check-in" + "✓ Done"; still a 44 px target */
button.ci-row.card.ci-done { min-height: 44px; padding: 2px 16px; }
.ci-done-title { color: var(--muted); font-weight: 500; }
button.today-row.slim { min-height: 44px; padding: 6px 0; }
/* Progress photos: Compare (two photos of one angle side by side) */
.pp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
#photo-compare { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; overflow-y: auto; background: #000; color: var(--media-text); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
#photo-compare.hidden { display: none; }
html.pc-open, html.pc-open body { overflow: hidden; }
.pc-title { margin: 0; font-size: 17px; line-height: 22px; }
.pc-body { padding: 0 max(12px, env(safe-area-inset-right)) 16px max(12px, env(safe-area-inset-left)); }
.pc-seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.pc-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; }
.pc-col { min-width: 0; }
button.pc-photo { display: block; width: 100%; max-width: none; padding: 0; min-height: 44px; }
button.pc-photo::before { display: none; }
.pc-img { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--btn); border: 1px solid var(--border); }
.pc-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pc-ph { color: var(--text); font-size: 15px; font-weight: 600; background: var(--media-ctl); padding: 4px 8px; border-radius: 6px; }
.pc-col .pick-face, .pc-col select { margin-top: 6px; }
.pc-date { margin-top: 8px; text-align: center; font-weight: 600; }
.pc-diff { margin-top: 12px; text-align: center; font-size: 17px; font-weight: 600; }
.pc-diff.muted { font-weight: 400; font-size: 15px; }
/* Technique (build 105): the demonstrator's sex under the animation (male/female models only), and the own-video row */
.anim-model { flex: 1 1 100%; font-size: 13px; line-height: 18px; color: var(--muted); }
.tech-own { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.tech-own-label { font-weight: 600; }
/* No animation for this profile (strict) or signed out: no empty gap or divider above the own-video row */
.anim-box:empty { display: none; }
.anim-box:empty + #anim-note:empty + .tech-own { margin-top: 0; padding-top: 0; border-top: 0; }
/* Progress photos (build 105): an angle without any photo shows a small muted placeholder tile */
.pp-none { display: flex; flex-direction: column; gap: 4px; }
.pp-none-img { display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; background: transparent; border: 1px dashed var(--field-border); color: var(--muted); font-size: 13px; line-height: 17px; }
.pc-noback { align-self: center; font-size: 13px; }
/* Workout timers (build 105 as approved). Bottom strip: only the Total time row (digits 28 px, Finish). */
#session-strip { flex-direction: column; align-items: stretch; gap: 0; padding: 4px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left)); }
.ss-row { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.ss-row > button { flex: 0 0 auto; }
.ss-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; padding: 2px 0; }
.ss-label { font-size: 13px; line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-digits { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--sel); letter-spacing: 0.01em; min-height: 1.05em; }
.ss-total .ss-digits { font-size: clamp(22px, 7.2vw, 28px); line-height: 1.1; }
/* Rest bar at the top, inside the sticky header (full width under Back/title/menu): dark card; border, digits and the thin
   shrinking bar in the app's accent --sel (P3, build 110: navy in light, sand in dark; Neto, build 106) for the whole rest; Skip on
   the right. The orange --update stays for the update chip and the "To do" check-in rows only. */
#rest-top { order: 9; flex: 1 1 100%; display: flex; align-items: center; gap: 10px; min-width: 0; margin: 2px 0 6px; padding: 4px 6px 6px 12px; background: var(--card); border: 2px solid var(--sel); border-radius: 12px; }
#rest-top.hidden { display: none; }
#rest-top > button { flex: 0 0 auto; }
.rt-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
#rest-top .ss-digits { font-size: clamp(30px, 10.8vw, 42px); line-height: 1.05; color: var(--sel); }
.ss-bar { display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.ss-bar > span { display: block; height: 100%; width: 100%; background: var(--sel); transition: width 1s linear; }
@media (prefers-reduced-motion: reduce) { .ss-bar > span { transition: none; } }
/* Cloud backup is off (Neto, build 105): one slim row, about 48 px at 390 px; the buttons wrap below only on very narrow screens */
#backup-off { gap: 4px 8px; padding: 0 4px 0 12px; min-height: 44px; }
#backup-off > .bo-text { display: flex; align-items: center; gap: 8px; flex: 1 1 150px; min-width: 0; font-size: 14px; line-height: 18px; }
#backup-off > button { flex: 0 0 auto; }
#backup-off .bo-close { min-width: 44px; padding: 0 10px; font-size: 16px; }
.cloud-why { margin: 0 0 10px; }

/* Meal photo (AI), build 107: the card on the Food screen, the result editor, the AI chip and the Undo bar */
#mp-card .mp-pick { margin-top: 8px; }
.mp-err { color: var(--error); font-size: 14px; margin-top: 8px; }
.mp-err:empty { display: none; }
.mp-set { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 8px; }
.mp-check { display: flex; gap: 10px; align-items: center; min-height: 44px; margin: 6px 0 0; font-size: 15px; color: var(--text); }
.mp-wait { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.mp-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; background: var(--btn); display: inline-block; }
.mp-headrow { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.mp-headrow > div { flex: 1 1 180px; min-width: 0; }
#mp-head:focus { outline: none; }   /* the heading takes the focus by script so screen readers start there; it is not a control */
.mp-pulse { display: inline-block; width: 40px; height: 4px; border-radius: 2px; background: var(--sel); margin-top: 8px; animation: mpPulse 1.2s ease-in-out infinite; }
@keyframes mpPulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mp-pulse { animation: none; opacity: .6; } }
.mp-item { border-top: 1px solid var(--border); padding: 10px 0 8px; margin-top: 10px; }
.mp-row1 { display: flex; gap: 8px; align-items: center; }
.mp-row1 .mp-name { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.mp-x { flex: 0 0 44px; min-width: 44px; min-height: 44px; padding: 0; }
.mp-row2 { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: flex-end; margin-top: 6px; }
.mp-amt { flex: 0 1 160px; margin: 0; }
.mp-food { display: block; margin-top: 6px; }
.mp-food select { width: 100%; }
.mp-tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.mp-tag { border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: 12px; color: var(--muted); }
.mp-check-note { color: var(--sel); font-size: 13px; margin-top: 4px; }
.mp-vals { margin-top: 6px; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mp-approx { color: var(--muted); font-size: 12px; }
.mp-juice { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.mp-juice button { min-width: 72px; flex: 0 0 auto; }
.mp-search { margin-top: 8px; }
.mp-res { display: block; width: 100%; text-align: left; margin-top: 6px; }
.mp-total { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 15px; overflow-wrap: anywhere; }
.mp-notes, .mp-med { margin-top: 8px; }
.mp-med2 { margin-top: 6px; font-size: 14px; font-weight: 600; }
.mp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mp-actions > button { flex: 1 1 140px; }
.mp-chip { display: inline-block; font-size: 11px; font-weight: 700; line-height: 16px; padding: 0 6px; border-radius: 6px; background: var(--sel); color: var(--sel-text); margin-right: 6px; vertical-align: 1px; }
#mp-undo { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-h, 56px) + 12px); z-index: 26; display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 4px 6px 4px 14px; font-size: 14px; box-shadow: 0 6px 18px var(--scrim); }
#mp-undo button { min-height: 44px; flex: 0 0 auto; }
body.locked > #mp-undo, body.kb-open #mp-undo { display: none; }
.mp-sources { padding-left: 18px; margin: 10px 0 0; }
.mp-sources li { margin-bottom: 10px; overflow-wrap: anywhere; }
/* ---- Food screen redesign (build 108, Neto; brief and UX spec in Shared/food-screen-redesign). Type in rem so text resizing
   reflows it. Colours only from the app palette (Neto, G): sand, ivory and steel; each macro also has its own ring style
   (solid, dashed, dotted) and icon, so colour is never the only cue. Final icon set and tints: from the UX spec update. ---- */
:root, #photo-viewer, #photo-compare, .anim-frame { --nutrition-calories: var(--series-calories); --nutrition-protein: var(--series-protein); --nutrition-carbs: var(--series-carbs); --nutrition-fat: var(--series-fat); }   /* UX brand tokens: sand, sand 65% + ivory 35%, steel grey, sand 80% + graphite 20% */
.sum { margin-bottom: 12px; }
.sum .card { margin-bottom: 8px; border-radius: 18px; }
.sum-big { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px; }
.sum-text { flex: 1 1 11rem; min-width: 0; }
.sum-num { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .25rem; line-height: 1.15; }
.sum-big .sum-num b { font-size: 2.25rem; font-weight: 700; }
.sum-of { color: var(--muted); font-size: .875rem; }
.sum-label { color: var(--muted); font-size: .875rem; line-height: 1.3; margin: 2px 0 0; font-weight: 500; hyphens: manual; overflow-wrap: normal; }
.sum-mac .sum-label { color: var(--text); font-weight: 600; margin: 0 0 4px; }
.sum-chip { display: inline-block; margin-top: 10px; padding: .25rem .75rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--sel); color: var(--sel); font-size: .875rem; line-height: 1.3; font-weight: 600; }
.sum-chip.over { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); }
.sum-chip.none { color: var(--muted); box-shadow: inset 0 0 0 1px var(--field-border); font-weight: 400; }
.sum-miss, .sum-sub { color: var(--muted); font-size: .8125rem; line-height: 1.3; margin-top: 4px; }
.sum-over { color: var(--text); font-size: .8125rem; line-height: 1.3; font-weight: 600; margin-top: 4px; }
.sum-wait { flex: 1 1 100%; margin: 4px 0 0; color: var(--muted); font-size: .875rem; }
.ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 112px; height: 112px; }
.ring .ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-track { fill: none; stroke: var(--track); }
.ring-bar { fill: none; }
.ring-icon { display: inline-flex; }
/* Centre glyphs (build 109, "Pantry"): 43% of the ring box (48 px in the 112 px calories ring, 30 px in the 70 px rings, 24 px in the
   56 px ones); filled in the nutrient colour; not the .hi outline style. */
.ring .ring-icon { width: 43%; height: 43%; }
.ring .ring-icon .food-glyph { display: block; width: 100%; height: 100%; fill: currentColor; stroke: none; }
.ring-kcal .ring-bar { stroke: var(--nutrition-calories); } .ring-kcal .ring-icon { color: var(--nutrition-calories); }
.ring-prot .ring-bar { stroke: var(--nutrition-protein); } .ring-prot .ring-icon { color: var(--nutrition-protein); }
.ring-carb .ring-bar { stroke: var(--nutrition-carbs); } .ring-carb .ring-icon { color: var(--nutrition-carbs); }
.ring-fat .ring-bar { stroke: var(--nutrition-fat); } .ring-fat .ring-icon { color: var(--nutrition-fat); }
.sum-macs { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(6.5rem, 30%), 1fr)); gap: 8px; }   /* three at 390 px; one when the text is large */
.sum-macs .card { margin-bottom: 0; }
.sum-mac { display: flex; flex-direction: column; align-items: flex-start; padding: 12px; min-width: 0; }
.sum-mac .sum-num b { font-size: 1.375rem; font-weight: 700; }
.sum-mac .ring { width: 70px; height: 70px; margin: 10px auto 0; }
/* 350 px or less, and large text: the three macros stack as compact horizontal cards (complete words before photo geometry) */
@media (max-width: 350px) {
  .sum-macs { grid-template-columns: minmax(0, 1fr); }
  .sum-mac:not(.no-target) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
  .sum-mac:not(.no-target) > .ring { grid-column: 2; grid-row: 1 / span 4; margin: 0; width: 56px; height: 56px; }
}
.sum-p2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 12px; padding: 16px; }
.sum-nut h3 { margin: 0; }
.sum-nut b { display: block; font-size: 1.375rem; margin-top: 4px; }
.sum-nut small { color: var(--muted); font-size: .8125rem; }
.sum-note { grid-column: 1 / -1; margin: 0; }
.sum-pager { display: flex; align-items: center; justify-content: space-between; gap: 4px; flex-wrap: wrap; }
button.sum-nav { font-weight: 400; padding: 12px 6px; }
button.sum-nav::before, button.sum-dot::before { display: none; }
button.sum-nav[aria-disabled="true"] { color: var(--muted); opacity: .55; cursor: default; }
.sum-dots { display: flex; justify-content: center; gap: 0; }
button.sum-dot { min-width: 44px; min-height: 44px; padding: 0; }
button.sum-dot span { width: 10px; height: 10px; border-radius: 5px; background: var(--field-border); }
button.sum-dot[aria-current="true"] span { width: 22px; background: var(--sel); }
.sum-pagename { margin: 0; text-align: center; color: var(--muted); font-size: .875rem; }
/* "Adding to: Meal N" */
.meal-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: 0 0 8px; }
.meal-pick-label { color: var(--muted); font-size: .875rem; }
/* The three add methods: one card, a row each; an open method shows its card under its row */
.add-tools { background: var(--card); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.tool + .tool { border-top: 1px solid var(--border); }
button.tool-head { display: flex; width: 100%; max-width: none; align-items: center; justify-content: flex-start; gap: 12px; min-height: 52px; padding: 10px 14px; text-align: left; font-weight: 400; border-radius: 0; }
button.tool-head::before, button.meal-head::before { display: none; }
button.tool-head > .hi:first-child { color: var(--sel); }
.tool-title { flex: 1 1 auto; min-width: 0; }
.tool-suffix { color: var(--sel); font-size: .875rem; }
button.tool-head[aria-expanded="true"] .chev, button.meal-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.tool-body { padding: 0 2px 4px; }
.tool-body > .card { border: 0; margin: 0; border-radius: 0; background: transparent; padding-top: 4px; }
.tool-body > .card + .card { border-top: 1px solid var(--border); }
.draft-card .destination, .mp-result .destination { color: var(--muted); font-size: .875rem; margin-top: 2px; }
.destination button.linklike { min-height: 44px; padding: 12px 0; margin: -12px 0; font-size: inherit; }
.card-titlerow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-bottom: 4px; }
.card-titlerow .titleblock { flex: 1 1 10rem; min-width: 0; }
button.add-top { flex: 0 0 auto; }
.kind { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin-bottom: 4px; }
.kind-l { color: var(--muted); font-size: .875rem; }
#hand-card .seg { display: flex; flex-wrap: wrap; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0 8px; }
.supp-h { margin: 12px 0 0; font-size: 1rem; }
.supp-will { min-height: 1.25rem; margin: 8px 0 2px; font-weight: 600; }
.supp-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 4px 0; }
.supp-saved-item { display: inline-flex; gap: 0; }
.quick-adds { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: 8px 0 0; }
/* The confirmation line, above the meals */
.added-msg { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 10px; background: var(--card); border: 1px solid var(--sel); border-radius: 12px; padding: 4px 6px 4px 14px; margin: 0 0 12px; font-size: .9375rem; }
/* Meals */
.meals-head { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 2px 6px; }
.meals-head h2 { margin: 0; }
.meal-card { padding: 2px 12px 6px; }
h3.meal-h { margin: 0; font-size: inherit; font-weight: inherit; }
button.meal-head { display: flex; width: 100%; max-width: none; justify-content: space-between; align-items: center; gap: 8px; min-height: 52px; padding: 10px 0; text-align: left; font-weight: 400; }
.meal-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.meal-txt b { font-weight: 600; font-size: 1.0625rem; }
.meal-sum { color: var(--muted); font-size: .875rem; }
.food-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.food-row-text { flex: 1 1 9rem; min-width: 0; overflow-wrap: anywhere; }
.food-name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.food-name .mp-chip { margin: 0; }
button.food-opt { flex: 0 0 auto; margin-left: auto; letter-spacing: .1em; }
/* Build 117 (Neto): the foods from one meal photo are one plate in their meal; "Show foods" opens them under it. */
.plate { border-top: 1px solid var(--border); }
.plate > .food-row.plate-row { border-top: 0; }
.plate-row button.plate-tog { font-size: 15px; }
.plate-tog-line { margin-top: 2px; }
.plate-ico { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 8px; background: var(--btn); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.plate-ico svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.plate-n { font-weight: 400; }
.plate-names { overflow-wrap: anywhere; }
.plate-items { margin: 0 0 6px 18px; padding-left: 12px; border-left: 2px solid var(--border); }
.plate-items .food-row.in-plate { padding: 6px 0; }
.plate-items .food-row.in-plate:first-child { border-top: 0; }
/* The photo result: one line per food (name, amount, kcal); a tap opens its editor under it. */
.mp-headrow .mp-total { margin-top: 4px; padding-top: 0; border-top: 0; }
.mp-count { margin-top: 6px; }
.mp-hint { margin-top: 8px; }
.mp-sum { display: flex; align-items: center; gap: 8px; }
button.mp-sumbtn { flex: 1 1 auto; min-width: 0; max-width: none; min-height: 44px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 6px 2px; text-align: left; font-weight: 400; background: transparent; }
button.mp-sumbtn::before { display: none; }
.mp-sum-name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.mp-sum-meta { font-size: 14px; line-height: 19px; color: var(--muted); }
.mp-need { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.mp-item.mp-folded { padding: 4px 0; margin-top: 4px; }
.mp-body { padding-top: 4px; }
.mp-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mp-upd-note { margin-top: 4px; }
#mp-upd[hidden], #mp-upd-note[hidden] { display: none; }   /* the app's button style would otherwise show a hidden button */
.supp-tag { display: inline-block; font-size: .6875rem; font-weight: 700; line-height: 1rem; padding: 0 6px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--sel); color: var(--sel); vertical-align: 1px; }
.meals-empty h2 { margin: 0 0 4px; }
.meals-empty p { margin: 0; }
.targets-link { text-align: center; margin: 4px 0 12px; }
.credits-link { margin-top: 4px; }
/* The questionnaire keeps medicines and supplements (medical precautions) */
.qprec { margin: 8px 0 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.qprec-h { font-weight: 600; margin-bottom: 4px; }
.qsupp { padding: 6px 0; border-top: 1px solid var(--border); }
.qsupp:first-of-type { border-top: 0; }
.qmed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 8px; border-top: 1px solid var(--border); }
/* Questionnaire medicines as swipe rows (swipe left to delete, the app's standard): 44 px rows, room on the right for the swipe hint */
.qmed-row { border-top: 1px solid var(--border); }
.qmed-row .swipe-face.qmed { border-top: 0; min-height: 44px; padding: 10px 24px 10px 0; box-sizing: border-box; }
/* Home grid with three tiles (build 108): the last one spans the row */
.home-grid > .home-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
.row.row-wrap { flex-wrap: wrap; }
.row.row-wrap > * { flex: 1 1 auto; }
/* History: food by day (build 108) */
.food-hist-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; padding: 6px 0; border-top: 1px solid var(--border); }
.food-hist h2 + .food-hist-row { border-top: 0; }
.food-hist-txt { flex: 1 1 12rem; min-width: 0; }

/* ---- J4 "Soft top" logo (build 112, chosen by Neto 18 Nov 2026; replaces E1). Placement: UX logo-placement-spec ----
   One colour for the mark and the wordmark: --accent in light (navy). Each SVG has role="img" aria-label="TORVASSE".
   v2.1 (Neto, 18 Nov 2026): on navy the logo is brand white, like the app icon (white mark on navy), so in dark mode it uses
   --surface-inverse (#F5F3EE) instead of sand. Sand stays the accent for buttons and highlights. */
svg.logo { display: block; flex: 0 0 auto; color: var(--accent); overflow: visible; }
:root[data-theme="dark"] svg.logo { color: var(--surface-inverse); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) svg.logo { color: var(--surface-inverse); } }
.login-card .brand { display: flex; flex-direction: column; align-items: center; margin: 0 0 14px; }
.login-card .brand-name { margin: 0; line-height: 0; }
.login-card .brand svg.logo { width: 152.6px; height: 89.5px; margin: 8px auto 4px; }
.login-card .brand-tag { margin: 0; font-size: 15px; line-height: 1.3; color: var(--text-secondary); text-align: center; }
@media (max-width: 339.98px) { .login-card .brand svg.logo { width: 114.5px; height: 67.1px; } .login-card .brand-tag { font-size: 13px; } }
#title-wrap #area-title.brand-title { line-height: 0; overflow: visible; white-space: normal; display: flex; align-items: center; min-height: 32px; }
#area-title.brand-title svg.logo { width: 155.7px; height: 32px; }
@media (max-width: 359.98px) { #area-title.brand-title svg.logo { width: 116.8px; height: 24px; } #title-wrap #area-title.brand-title { min-height: 24px; } }

/* Build 111: consent screens (Compliance's texts; UX consent-build-ux spec): a long page that scrolls, no fixed heights,
   choice rows of 44 px or more with 24 px boxes, the notice above the boxes, placeholders still to be answered underlined. */
.consent-screen { padding: 16px; }
@media (max-width: 339.98px) { .consent-screen { padding: 12px; } }
.consent-screen p, .consent-decline p, .perm-card p, .consent-ask p, .consent-oldcopy p, .consent-restore p { line-height: 1.5; margin: 0 0 12px; }
.consent-h1 { font-size: 24px; line-height: 1.2; margin: 0 0 12px; }
.consent-h1:focus { outline: none; }
.consent-h2 { font-size: 18px; line-height: 1.3; margin: 16px 0 8px; }
.consent-notice { border-left: 4px solid var(--accent); background: var(--surface-raised); padding: 10px 12px; margin: 0 0 12px; border-radius: 4px; line-height: 1.5; }
.consent-box { border: 1px solid var(--field-border); border-radius: 12px; padding: 4px 12px; margin: 0 0 12px; min-width: 0; }
.consent-box legend { padding: 0 4px; color: var(--text-secondary); }
.consent-choice { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 10px 0; cursor: pointer; margin: 0; }
.consent-choice + .consent-choice { border-top: 1px solid var(--field-border); }
.consent-choice input[type=checkbox] { width: 24px; height: 24px; flex: 0 0 24px; margin: 2px 0 0; accent-color: var(--accent); }
.consent-choice input[type=checkbox]:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.consent-badge { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 2px; }
.consent-label { display: block; line-height: 1.5; }
.consent-scope { display: block; font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
.consent-err { display: block; color: var(--state-error); font-weight: 600; margin-top: 6px; }
.consent-continue, .consent-noplan { display: block; width: 100%; min-height: 44px; margin-top: 8px; }
/* Not allowed yet (Continue before both boxes, Restore before the box): an empty face with a dashed outline and the page's
   text colour, readable in both themes; a tap still shows why. The primary face is drawn by ::before, so it is cleared there
   (build 111, orchestrator 90fc9de1: before, the face kept its fill under the page text colour: navy on navy, cream on sand). */
button.primary.consent-wait { color: var(--text); }
button.primary.consent-wait::before { background: transparent; border: 2px dashed var(--field-border); }
.ph { text-decoration: underline dotted; text-underline-offset: 3px; }
.consent-readonly { border: 1px solid var(--field-border); border-radius: 12px; padding: 8px 12px; margin: 0 0 12px; }
.perm-row { padding: 8px 0; border-bottom: 1px solid var(--field-border); }
.perm-row:last-child { border-bottom: 0; }
.perm-state { margin: 2px 0 6px; }
.perm-btn, .perm-delete { width: 100%; min-height: 44px; }
.perm-delete { margin-top: 8px; }
.perm-clear-line { margin-top: 12px; font-size: 14px; }
.consent-result, .consent-pending { margin-top: 8px; font-weight: 600; line-height: 1.4; }
.consent-ask .row, .consent-oldcopy .row, .consent-restore .row { gap: 8px; flex-wrap: wrap; }
/* Build 111, provider switch OFF: the status banner, and Tick A/B shown disabled (readable, not clickable). */
.consent-banner { border: 2px solid var(--state-warning); background: var(--surface-raised); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; line-height: 1.5; font-weight: 600; }
.consent-off { cursor: not-allowed; }
.consent-off .consent-label, .consent-off .consent-badge { color: var(--text-muted); }
.perm-off { margin: 0 0 8px; }

/* Build 111: the credit link in Data sources (Open Food Facts, ODbL): the app's text colour, underlined, visible focus */
.mp-credit a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.mp-credit a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

/* Dark mode, buttons the browser marks disabled (a save in progress, the pain pickers when there is no pain): no fading, which
   left dim text on navy (orchestrator 90fc9de1); an empty face, a dashed outline and muted text: readable (7.8:1 on the card)
   and still clearly unavailable. Light mode keeps its fading. */
:root[data-theme="dark"] button:disabled { opacity: 1; color: var(--muted); }
:root[data-theme="dark"] button:disabled::before { background: transparent; border: 1px dashed var(--field-border); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) button:disabled { opacity: 1; color: var(--muted); }
  :root:not([data-theme="light"]) button:disabled::before { background: transparent; border: 1px dashed var(--field-border); }
}
