/* ==========================================================================
   Δίαιτα — styles.css
   Design tokens από specs/dieta/design/wireframes.html
   Mobile-first · 390px σχεδιαστικός κανόνας · κεντραρισμένη στήλη 480px σε desktop
   ========================================================================== */

:root {
  --page: #E9E7DF;
  --app: #F8F7F3;
  --surface: #FFFFFF;
  --line: #EDEAE1;
  --line-strong: #DDD8CA;

  --ink: #22271E;
  --ink-2: #5A6152;
  --ink-3: #656C5D;

  --primary: #4F6B3A;
  --primary-dark: #3D532C;
  --primary-soft: #EEF2E4;
  --primary-tint: #F5F7EF;

  --amber: #B8811F;
  --amber-soft: #FCF3DF;
  --amber-line: #F0DDB0;

  --danger: #C0392B;
  --danger-soft: #FBEBE9;

  --protein: #4F6B3A;
  --carbs: #B8811F;
  --fat: #8A6E4B;
  --water: #3F7183;

  --r-card: 16px;
  --r-btn: 14px;
  --r-field: 12px;
  --r-pill: 999px;

  --gap: 8px;
  --gutter: 16px;
  --shadow: 0 1px 2px rgba(34, 39, 30, .04), 0 4px 12px rgba(34, 39, 30, .05);

  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --f: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--page);
}

body {
  margin: 0;
  font-family: var(--f);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--app);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-dark); }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 99;
  background: var(--surface);
  padding: 12px 16px;
  border-radius: var(--r-btn);
  box-shadow: var(--shadow);
}
.skip-link:focus { left: 12px; }

/* ------------------------------------------------------------------ shell - */

.app-shell {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--app);
}

.view {
  padding: calc(12px + env(safe-area-inset-top, 0px)) var(--gutter) 24px;
  outline: none;
}

body[data-auth="true"] .view {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px);
}

.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 0;
  color: var(--ink-2);
  font-size: 16px;
}

/* ----------------------------------------------------------------- header - */

.scr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}

.scr-head h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.scr-head .sub {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  color: var(--ink-2);
}

.avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid var(--line-strong);
  font-weight: 700;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}
.avatar:hover { background: var(--primary-tint); }

/* ------------------------------------------------------------------ cards - */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

.sec-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 18px 2px 10px;
}
.sec-title .n {
  font-size: 16px;
  font-weight: 400;
  color: var(--ink-3);
}

.hint {
  margin: 8px 0 0;
  font-size: 16px;
  color: var(--ink-2);
}

/* ------------------------------------------------------------- δαχτυλίδι -- */

.ring-card { padding: 18px 16px 14px; }

.ring-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.ring-wrap svg { width: 200px; height: 200px; }

.ring-track { stroke: var(--line); }

.ring-fill {
  stroke: var(--primary);
  transition: stroke-dashoffset .7s cubic-bezier(.22, .61, .36, 1), stroke .3s;
}
.ring-fill.over { stroke: var(--amber); }

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.ring-num {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}

.ring-of {
  font-size: 16px;
  color: var(--ink-2);
}

.ring-left {
  margin-top: 10px;
  text-align: center;
  font-size: 16px;
  color: var(--ink-2);
}
.ring-left b { color: var(--ink); }
.ring-left.over b { color: var(--amber); }

/* ---------------------------------------------------------------- meters -- */

.meter + .meter { margin-top: 14px; }

.meter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 16px;
}
.meter-top .lbl { color: var(--ink-2); }
.meter-top .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.meter-top .u { font-weight: 400; color: var(--ink-3); }

.track {
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--line);
  overflow: hidden;
}

.track > i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--primary);
  transition: width .5s cubic-bezier(.22, .61, .36, 1);
}
.fill-protein { background: var(--protein); }
.fill-water { background: var(--water); }
.fill-meals { background: var(--carbs); }
.fill-amber { background: var(--amber); }

/* ---------------------------------------------------- κάρτες γεύματος ---- */

.meal-big { padding: 14px 16px; }

.mb-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.meal-ico {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

.mb-slot { flex: 1 1 auto; min-width: 0; }

.mb-slot-t {
  font-size: 16px;
  font-weight: 700;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 16px;
  padding: 2px 10px 2px 8px;
  border-radius: var(--r-pill);
}
.status svg { width: 16px; height: 16px; }
.status.done { background: var(--primary-soft); color: var(--primary-dark); }
.status.pend { background: var(--amber-soft); color: #7A5510; }

.mb-kcal {
  flex: 0 0 auto;
  text-align: right;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mb-kcal .u {
  display: block;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink-3);
}

.mb-dish {
  margin-top: 10px;
  font-size: 16px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.macro .m-l {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: var(--ink-2);
}
.macro .m-l i {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  flex: 0 0 auto;
}
.macro .m-v {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.macro .m-v .u { font-weight: 400; color: var(--ink-3); }

.mb-foot {
  margin-top: 10px;
  font-size: 16px;
  color: var(--ink-2);
}

.logged-list {
  margin-top: 10px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 8px;
}

.logged-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 0;
}

.logged-row .lr-n {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.logged-row .lr-k {
  font-size: 16px;
  color: var(--ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- buttons - */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: var(--r-btn);
  border: 1.5px solid transparent;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 17px;
  font-weight: 650;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--primary-dark); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
  font-weight: 600;
}
.btn-ghost:hover:not([disabled]) { background: var(--primary-tint); }

.btn-quiet {
  background: transparent;
  color: var(--ink-2);
  min-height: 44px;
  font-size: 16px;
  font-weight: 500;
}
.btn-quiet:hover { background: var(--line); }

.btn-sm { min-height: 44px; font-size: 16px; padding: 8px 14px; width: auto; }

.btn-ico { width: 20px; height: 20px; flex: 0 0 auto; }

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.btn-row > * { flex: 1 1 0; }

.btn-danger-quiet {
  background: transparent;
  color: var(--danger);
  border-color: transparent;
  min-height: 44px;
  width: auto;
  padding: 6px 10px;
  font-size: 16px;
  border-radius: var(--r-field);
}
.btn-danger-quiet:hover { background: var(--danger-soft); }

.icon-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r-field);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--line); color: var(--danger); }
.icon-btn svg { width: 20px; height: 20px; }

/* ----------------------------------------------------------------- fields - */

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

.field > label,
.field-label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.field > label .opt,
.field-label .opt {
  font-weight: 400;
  color: var(--ink-3);
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 14px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-field);
}
.input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.input-wrap input,
.input-wrap select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
}
.input-wrap input:focus, .input-wrap select:focus { outline: none; }
.input-wrap .unit {
  flex: 0 0 auto;
  font-size: 16px;
  color: var(--ink-3);
}

select.input-wrap,
select.plain {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  font-size: 16px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-field);
}

textarea.plain {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  font-size: 16px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-field);
  resize: vertical;
}
textarea.plain:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

/* segmented control */
.seg {
  display: flex;
  gap: 6px;
  background: var(--primary-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  padding: 4px;
}

.seg button {
  flex: 1 1 0;
  min-height: 44px;
  padding: 6px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: 0 1px 2px rgba(34, 39, 30, .1);
}
.seg button small { display: block; font-size: 16px; font-weight: 400; color: var(--ink-3); }
.seg button[aria-pressed="true"] small { color: var(--ink-2); }

/* radios */
.radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-field);
  background: var(--surface);
  cursor: pointer;
}
.radio + .radio { margin-top: 8px; }
.radio[aria-checked="true"] { border-color: var(--primary); background: var(--primary-tint); }

.radio .mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: var(--r-pill);
  border: 2px solid var(--line-strong);
  background: var(--surface);
  position: relative;
}
.radio[aria-checked="true"] .mark { border-color: var(--primary); }
.radio[aria-checked="true"] .mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: var(--r-pill);
  background: var(--primary);
}
.radio .rt { font-size: 16px; font-weight: 600; }
.radio .rd { display: block; font-size: 16px; color: var(--ink-2); }

/* ---------------------------------------------------------------- results - */

.result-hero {
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-card);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.result-hero .h-lbl { font-size: 16px; opacity: .9; }
.result-hero .h-val {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 4px;
}
.result-hero .h-val b {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}
.result-hero .h-val span { font-size: 16px; opacity: .92; }
.result-hero .h-note { font-size: 16px; opacity: .92; }

.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.res {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.res .r-lbl { font-size: 16px; color: var(--ink-2); }
.res .r-val {
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.res .r-val.sm { font-size: 17px; }
.res .r-sub { font-size: 16px; color: var(--ink-3); margin-top: 2px; }

.foot-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--primary-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink-2);
}

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: var(--r-card);
  padding: 12px 14px;
  font-size: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--amber-line);
  background: var(--amber-soft);
  color: #6B4A0D;
}
.notice.info { background: var(--primary-soft); border-color: var(--line-strong); color: var(--primary-dark); }
.notice.error { background: var(--danger-soft); border-color: #EFC9C3; color: #8E2A1F; }
.notice b { display: block; }

/* Σύγκριση στόχων (πλάνο vs σημερινός στόχος) — φαίνεται η διαφορά με χρώμα. */
.goal-compare {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-field);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  font-size: 15px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.goal-compare .gc-plan { color: #8E2A1F; font-weight: 600; }
.goal-compare .gc-now { color: var(--primary-dark); font-weight: 700; }
.goal-compare .gc-sep { color: var(--ink-3); }

.badge-sq {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .6);
  color: inherit;
}
.badge-sq svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ login - */

.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px var(--gutter) calc(24px + var(--safe-b));
}

.login-logo {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  margin: 0 auto 14px;
  display: block;
  box-shadow: var(--shadow);
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -.4px;
}
.login-sub {
  text-align: center;
  color: var(--ink-2);
  font-size: 16px;
  margin: 4px 0 20px;
}

.login-card { padding: 18px 16px; }

.form-error {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-field);
  background: var(--danger-soft);
  color: #8E2A1F;
  font-size: 16px;
}
.form-error.show { display: block; }

/* -------------------------------------------------------------- φωτογραφία - */

.drop {
  display: block;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 12px;
}
.drop:hover { border-color: var(--primary); background: var(--primary-tint); }
.drop .cam { width: 52px; height: 52px; margin: 4px auto 10px; color: var(--primary); }
.drop .d-t { font-size: 17px; font-weight: 650; }
.drop .d-s { font-size: 16px; color: var(--ink-2); margin-top: 2px; }
.drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.preview {
  position: relative;
  margin-bottom: 12px;
  border-radius: var(--r-card);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.preview img { width: 100%; height: auto; max-height: 320px; object-fit: cover; }
.preview .pv-actions {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.result-card .rc-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.result-card .thumb {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--primary-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.result-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.result-card .thumb svg { width: 26px; height: 26px; }
.result-card .rc-dish {
  font-size: 17px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.result-card .rc-slot { font-size: 16px; color: var(--ink-2); }
.result-card .rc-kcal {
  margin-left: auto;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.result-card .rc-kcal .u { display: block; font-size: 16px; font-weight: 400; color: var(--ink-3); text-align: right; }

/* ---------------------------------------------------------------- πλάνο ---- */

.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 2px 12px;
  font-size: 16px;
  color: var(--ink-2);
}

.day-block { margin-bottom: 16px; }

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 8px;
}
.day-head .d-t { font-size: 17px; font-weight: 700; }
.day-head .d-k { font-size: 16px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.day-block.is-today .d-t { color: var(--primary-dark); }
.day-head .d-l {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.today-badge {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--r-pill);
}

.plan-meal {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.plan-meal + .plan-meal { margin-top: 8px; }

.plan-meal .pm-main { flex: 1 1 auto; min-width: 0; }
.plan-meal .pm-slot { font-size: 16px; color: var(--ink-2); }
.plan-meal .pm-dish { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; margin-top: 1px; }
.plan-meal .pm-kcal { font-size: 16px; color: var(--ink-2); margin-top: 3px; font-variant-numeric: tabular-nums; }

.plan-meal .pm-act {
  flex: 0 0 auto;
  align-self: center;
}

/* -------------------------------------------------------------- πρόοδος ---- */

.hero-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-stat .big {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}
.hero-stat .big.up { color: var(--amber); }
.hero-stat .cap { font-size: 16px; color: var(--ink-2); }
.hero-sub { font-size: 16px; color: var(--ink-2); margin-top: 2px; }

.chart-wrap { margin: 14px 0 4px; }
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }

.chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 16px;
  color: var(--ink-2);
  margin-top: 6px;
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--primary);
}

.stat-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.stat .s-l { font-size: 16px; color: var(--ink-2); }
.stat .s-v {
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.stat .s-v .u { font-size: 16px; font-weight: 400; color: var(--ink-3); }
.stat .s-s { font-size: 16px; color: var(--ink-3); margin-top: 2px; }

.suggest {
  border: 1px solid var(--amber-line);
  background: var(--amber-soft);
  border-radius: var(--r-card);
  padding: 14px;
  margin-bottom: 12px;
}
.suggest .sg-t {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: #6B4A0D;
}
.suggest p { font-size: 16px; color: #6B4A0D; margin-top: 6px; }

.weight-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.weight-form .input-wrap { flex: 1 1 auto; }
.weight-form .btn { width: auto; flex: 0 0 auto; padding-inline: 18px; }

/* --------------------------------------------------------------- αγορές ---- */

.shop-count {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 16px;
  margin: 8px 2px 6px;
  color: var(--ink-2);
}
.shop-count .sc-v { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--primary-tint);
  border-bottom: 1px solid var(--line);
}
.group-head .g-i { font-size: 18px; line-height: 1; }
.group-head .g-t { flex: 1 1 auto; font-size: 16px; font-weight: 700; }
.group-head .g-n { font-size: 16px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 16px;
  cursor: pointer;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--primary-tint); }

.item .box {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: transparent;
}
.item[aria-checked="true"] .box {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.item .it-n {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.item[aria-checked="true"] .it-n { color: var(--ink-3); text-decoration: line-through; }

/* ----------------------------------------------------------------- toast --- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--tabbar-h) + var(--safe-b));
  transform: translate(-50%, 12px);
  z-index: 60;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--primary-dark);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(34, 39, 30, .22);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8E2A1F; }

/* ---------------------------------------------------------------- spinner -- */

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  animation: spin .8s linear infinite;
  display: inline-block;
}

.spinner-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--ink-2);
  margin: 12px 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .ring-fill, .track > i, .toast { transition: none; }
  .spinner { animation-duration: 2.4s; }
}

.skeleton {
  height: 88px;
  border-radius: var(--r-card);
  background: linear-gradient(90deg, var(--line) 25%, #F4F2EC 37%, var(--line) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  margin-bottom: 12px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ----------------------------------------------------------------- tabbar -- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 6px var(--safe-b);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  z-index: 50;
}
.tabbar[hidden] { display: none; }

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 6px 2px;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--r-field);
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--primary-dark); }
.tab[aria-current="page"] svg { stroke-width: 2.3; }

.fab {
  justify-self: center;
  width: 58px;
  height: 58px;
  margin-top: -18px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(79, 107, 58, .35);
  text-decoration: none;
  border: 3px solid var(--app);
}
.fab svg { width: 28px; height: 28px; }
.fab:hover { background: var(--primary-dark); }
.fab[aria-current="page"] { background: var(--primary-dark); }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--app);
  padding: 32px 24px;
  font-size: 17px;
  text-align: center;
}

/* ------------------------------------------------------------- tablet/desk - */

@media (min-width: 768px) {
  :root { --gutter: 20px; }
  .app-shell, .tabbar { max-width: 480px; }
  body { background: var(--page); }
  .app-shell {
    box-shadow: 0 0 0 1px rgba(34, 39, 30, .06), 0 18px 50px rgba(34, 39, 30, .1);
    min-height: 100vh;
  }
}

/* ------------------------------------------------------ κίνηση (iPhone) --- */

.ring-credit {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.activity-card .act-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.act-ico {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  font-size: 20px;
}

.act-head { flex: 1 1 auto; min-width: 0; }
.act-t { font-size: 18px; font-weight: 700; }
.act-sub { font-size: 14px; color: var(--ink-2); }

.act-kcal {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.act-kcal .u { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }

.act-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.act-stat {
  background: var(--primary-tint);
  border-radius: var(--r-field);
  padding: 10px 8px;
  text-align: center;
}
.act-stat b {
  display: block;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}
.act-stat span { font-size: 13px; color: var(--ink-2); }

.act-note {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-2);
}

.act-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.act-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}
.act-form .seg { margin-bottom: 8px; }

.act-row,
.act-free {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.act-row input,
.act-free input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-field);
}

.act-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.iphone-card .steps {
  margin: 10px 0 0;
  padding-left: 20px;
}
.iphone-card .steps li {
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.5;
}
