/* אקי — the account: sign-in, today, settings. Same world as the landing page
   (landing.css): white, WhatsApp's two greens, near-black ink, Secular One for
   Aki's voice and headings, Assistant for everything else and every figure.
   A plane is a white card with a hairline; a panel's head is the green band
   the landing page's target card wears. */

@font-face {
  font-family: 'Secular One';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/secular-one-400-hebrew.woff2') format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: 'Secular One';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/secular-one-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Assistant';
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/assistant-hebrew.woff2') format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: 'Assistant';
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/assistant-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  --paper: #ffffff;
  --ink: #0b1410;
  --green: #00a884;
  --green-deep: #008069;
  --hair: rgba(0, 128, 105, 0.22);
  --rule: rgba(0, 128, 105, 0.12);
  --wash: rgba(0, 168, 132, 0.08);
  --display: "Secular One", sans-serif;
  --data: "Assistant", -apple-system, "Segoe UI", sans-serif;
  --maxw: 1104px;
  --gut: clamp(16px, 4vw, 48px);
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--green-deep) var(--paper); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--green-deep); border-radius: 10px; border: 2px solid var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--data);
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

::selection { background: var(--green); color: var(--ink); }
:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 3px; border-radius: 4px; }
input, textarea { caret-color: var(--green-deep); }
h1, h2, h3, p { margin: 0; }
a { color: var(--green-deep); font-weight: 600; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }

.title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.875rem, 4.4vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.label { font-size: 0.8125rem; font-weight: 700; color: var(--green-deep); }
.note { font-size: 0.9375rem; color: var(--green-deep); max-width: 62ch; }

/* ── actions ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  font: inherit;
  font-weight: 800;
  font-size: 1.0625rem;
  line-height: 1;
  text-decoration: none;
  color: var(--paper);
  background: var(--green-deep);
  border: 2px solid var(--green-deep);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 120ms ease-out, color 120ms ease-out, border-color 120ms ease-out;
}
.btn:hover { background: var(--green); border-color: var(--green); color: var(--ink); }
.btn:disabled { background: var(--paper); color: var(--green-deep); border-color: var(--hair); cursor: default; }
.btn--block { width: 100%; }
.btn--ghost { background: var(--paper); color: var(--green-deep); }
.btn--ghost:hover { background: var(--green-deep); border-color: var(--green-deep); color: var(--paper); }

.linkbtn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--green-deep);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkbtn:hover { color: var(--ink); }

/* ── top bar ───────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  /* Lined up with the 760px column the app pages sit in. */
  padding-inline: max(var(--gut), calc((100% - 760px) / 2 + var(--gut)));
  border-bottom: 1px solid var(--hair);
  background: var(--paper);
}
.topbar nav { display: flex; gap: 6px; margin-inline-end: auto; overflow-x: auto; }
/* Four tabs fill a phone; if they ever overflow they scroll, without a bar under them. */
.topbar nav { scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar__ident { font-family: var(--display); font-size: 1.625rem; line-height: 1; color: var(--green-deep); text-decoration: none; font-weight: 400; }
.topbar__ident:hover { color: var(--green-deep); }

.tab {
  border: 0;
  border-radius: 999px;
  background: none;
  padding: 8px 16px;
  color: var(--green-deep);
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.tab:hover { background: var(--wash); }
.tab.is-on { background: var(--green-deep); color: var(--paper); }
#logout { white-space: nowrap; }

/* The app templates carry no .wrap of their own. */
#app.app, #app.auth {
  display: block;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-block: 32px 64px;
  padding-inline: var(--gut);
}
#app.app { max-width: 760px; }
#app.auth { max-width: 480px; padding-top: 0; }

/* ── sign-in ───────────────────────────────────────────────────────────── */

.auth__top { display: flex; align-items: center; min-height: 64px; margin-bottom: 28px; border-bottom: 1px solid var(--hair); }
.auth__hello { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.auth__face { flex: none; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--green); }
.auth__title { font-family: var(--display); font-weight: 400; font-size: clamp(1.625rem, 6vw, 2.125rem); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.auth__back { margin-top: 18px; }

/* ── panels ────────────────────────────────────────────────────────────── */

.panel {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 12px 20px;
  background: var(--green);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.3;
}
.panel__body { padding: 20px; }
.panel__body > * + * { margin-top: 20px; }
.zone { border-color: var(--ink); }
.zone .panel__head { background: var(--ink); color: var(--paper); }

.railhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--display);
  font-size: 1.375rem;
  line-height: 1.2;
  color: var(--ink);
}
.railhead .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: none; }

/* ── the day's meters ──────────────────────────────────────────────────── */

.meters { margin-bottom: 28px; border-top: 1px solid var(--hair); }
.meter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px 24px;
  padding-block: 18px;
  border-bottom: 1px solid var(--rule);
}
.meter__name { font-size: 0.9375rem; font-weight: 700; color: var(--green-deep); }
.meter__value { text-align: end; font-size: 1.75rem; font-weight: 800; line-height: 1; }
.meter__value .fignum { direction: ltr; unicode-bidi: isolate; }
.meter__value .of { margin-inline-start: 0.45em; font-size: 0.9375rem; font-weight: 700; color: var(--green-deep); }
.bar { grid-column: 1 / -1; position: relative; height: 8px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.bar::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--fill, 0%); border-radius: 4px; background: var(--green); }
/* Past target the line is full and deepens: the same whether going past is good or not. */
.meter.is-over .bar::after { background: var(--green-deep); }
.bar.is-inked::after { animation: fill 720ms var(--ease) both; }
@keyframes fill { from { width: 0; } }

/* ── rows ──────────────────────────────────────────────────────────────── */

.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
}
.rows li:first-child { border-top: 1px solid var(--rule); }
.rows:empty { display: none; }
.muted { font-size: 0.9375rem; font-weight: 700; color: var(--green-deep); direction: ltr; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }

.empty {
  border: 1.5px dashed var(--hair);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: var(--green-deep);
  font-weight: 600;
}

/* ── the diary's period: day / week / month / year, and the arrows ─────── */

.period {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--hair);
  border-radius: 999px;
}
.period button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--green-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.period button:hover { background: var(--wash); }
.period button.is-on { background: var(--green-deep); color: var(--paper); }

.pager { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.pager__mid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.pager__today {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--green-deep);
  border-radius: 999px;
  background: var(--paper);
  color: var(--green-deep);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.pager__today:hover { background: var(--green-deep); color: var(--paper); }
.pager__label {
  flex: 1;
  text-align: center;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.2;
}
/* Drawn chevrons, not ‹ ›: those are mirrored in Hebrew text, so both ended up
   pointing inward, and they sat on the text baseline, low in the circle. On
   this page the earlier period is on the right, so its arrow points right. */
.pager__btn {
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  width: 44px;
  height: 44px;
  border: 2px solid var(--hair);
  border-radius: 50%;
  background: var(--paper);
  color: var(--green-deep);
  cursor: pointer;
  transition: border-color 120ms ease-out, background 120ms ease-out;
}
.pager__btn svg { display: block; }
.pager__btn:hover:not(:disabled) { border-color: var(--green-deep); background: var(--wash); }
.pager__btn:disabled { opacity: 0.3; cursor: default; }
#period-note { margin: -16px 0 28px; }

/* ── calories per day: one bar each, the target as a line across ──────── */

.chart__plot {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 180px;
  padding-top: 22px;
}
.chart--month { gap: 2px; }
.chart__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.chart__track { position: relative; flex: 1; }
.chart__bar {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: var(--h, 0%);
  border-radius: 4px 4px 2px 2px;
  background: var(--green);
}
.chart--month .chart__bar { border-radius: 2px; }
.chart__bar.is-over { background: var(--green-deep); }
.chart__bar.is-empty { height: 3px; background: var(--rule); }
.chart__col.is-future .chart__bar { display: none; }
.chart__label {
  height: 14px;
  line-height: 14px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green-deep);
  white-space: nowrap;
}
.chart__target {
  position: absolute;
  inset-inline: 0;
  /* The bars sit above their labels: 14px of label and a 6px gap below the
     track, 22px of headroom above it. --y is the target's share of the track. */
  bottom: calc((100% - 42px) * var(--y) + 20px);
  border-top: 1.5px dashed var(--ink);
  z-index: 1;
  pointer-events: none;
}
.chart__target span {
  position: absolute;
  inset-inline-end: 0;
  bottom: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  padding-inline-start: 6px;
}

/* ── the menu: a week of days, a day of dishes ───────────────────────── */

.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 20px; }
.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 64px;
  padding: 8px 0 6px;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--green-deep);
  font: inherit;
  cursor: pointer;
  transition: background 120ms ease-out, border-color 120ms ease-out;
}
.day:hover { background: var(--wash); }
.day__name { font-size: 0.8125rem; font-weight: 700; }
.day__num { font-size: 1.25rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.day__dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.day.has-meals .day__dot { background: var(--green); }
.day.is-today { border-color: var(--green-deep); border-width: 2px; }
.day.is-on { background: var(--green-deep); border-color: var(--green-deep); color: var(--paper); }
.day.is-on .day__num { color: var(--paper); }
.day.is-on .day__dot { background: var(--paper); }

.dishes { list-style: none; margin: 0; padding: 0; }
.dish { border-bottom: 1px solid var(--rule); }
.dish:first-child { border-top: 1px solid var(--rule); }
.dish__row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 16px;
  width: 100%;
  padding: 14px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.dish__row:hover .dish__what { color: var(--green-deep); }
.dish__when { font-size: 0.9375rem; font-weight: 800; color: var(--green-deep); }
.dish__what { font-weight: 600; line-height: 1.4; }
.dish__kind { display: block; font-size: 0.8125rem; font-weight: 700; color: var(--green-deep); }
.dish__kcal { font-size: 0.9375rem; font-weight: 700; color: var(--green-deep); white-space: nowrap; }
.dish__row[aria-expanded="true"] .dish__kcal::after { content: " ▴"; }
.dish__row[aria-expanded="false"] .dish__kcal::after { content: " ▾"; }
.dish.is-skipped .dish__what { text-decoration: line-through; color: var(--green-deep); }
.dish.is-eaten .dish__when::after { content: " ✓"; }
.dish__facts { padding: 0 0 16px; }
.dish__facts dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
.dish__facts dl > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--wash); }
.dish__facts dt { font-size: 0.8125rem; font-weight: 700; color: var(--green-deep); }
.dish__facts dd { margin: 2px 0 0; font-size: 1.125rem; font-weight: 800; }
.dish__facts .note { margin-top: 10px; }
#menu-day-sum b { font-weight: 800; color: var(--ink); }
.dish__items { list-style: none; margin: 12px 0 0; padding: 0; }
.dish__items li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 0.9375rem; border-top: 1px solid var(--rule); }
#meals + #workouts { margin-top: 0; }
@media (max-width: 479px) {
  .days { gap: 4px; }
  .dish__row { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .dish__kcal { grid-column: 2; }
  .dish__facts dl { grid-template-columns: repeat(2, 1fr); }
}

/* ── forms ─────────────────────────────────────────────────────────────── */

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--green-deep);
}
label + .note { margin-top: 8px; }
form > * + label { margin-top: 20px; }
#zone-field { margin-top: 20px; }
input + .note { margin-top: 8px; }

input[type="text"], input[type="tel"], input[type="time"], input[type="number"], input[type="date"], select {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 2px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  transition: border-color 120ms ease-out;
}
input[type="text"]:focus, input[type="tel"]:focus, input[type="time"]:focus, input[type="number"]:focus, input[type="date"]:focus, select:focus { outline: none; border-color: var(--green-deep); }

/* The things I track: one block per measure, its values newest first, and a
   line of the trend running the way the calorie chart does (newest on the left). */
.measure { padding-block: 16px; border-top: 1px solid var(--rule); }
.measure:last-child { border-bottom: 1px solid var(--rule); }
.measure__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.measure__name { font-family: var(--display); font-size: 1.125rem; }
.measure__latest { font-family: var(--data); font-weight: 800; font-size: 1.25rem; color: var(--ink); direction: ltr; unicode-bidi: isolate; }
.measure__latest small { font-size: 0.8125rem; font-weight: 700; color: var(--green-deep); margin-inline-start: 4px; }
.measure__spark { display: block; width: 100%; height: 40px; margin-top: 10px; overflow: visible; }
.measure__spark polyline { fill: none; stroke: var(--green-deep); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.measure__spark circle { fill: var(--green-deep); }
.measure .rows { margin-top: 10px; }
.measure .rows li { padding-block: 8px; }
.measure__val { font-family: var(--data); font-weight: 800; direction: ltr; }
.measure__when { font-size: 0.9375rem; font-weight: 700; color: var(--green-deep); }
.measure__add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 12px; }
.measure__foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; }
.measure-new { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; margin-top: 16px; }
@media (max-width: 520px) {
  .measure__add, .measure-new { grid-template-columns: 1fr 1fr; }
  .measure__add .btn, .measure-new .btn { grid-column: 1 / -1; }
}
input::placeholder { color: var(--green-deep); opacity: 0.6; font-weight: 500; }
input:disabled { color: var(--green-deep); font-weight: 500; background: var(--wash); border-color: transparent; }
input[type="checkbox"] { accent-color: var(--green-deep); width: 20px; height: 20px; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
}
.consent input { flex: none; margin-top: 2px; }

.confirm-number {
  direction: ltr;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.3;
  padding-block: 12px;
}

.err { color: var(--paper); background: var(--ink); padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 700; }

/* ── the tone dial ─────────────────────────────────────────────────────── */

.tones { display: block; }
.dial__input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.dial__input::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: var(--rule); }
.dial__input::-moz-range-track { height: 8px; border-radius: 4px; background: var(--rule); }
.dial__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--green-deep);
  box-shadow: 0 0 0 1px var(--green-deep);
}
.dial__input::-moz-range-thumb { width: 20px; height: 20px; border: 3px solid var(--paper); border-radius: 50%; background: var(--green-deep); box-shadow: 0 0 0 1px var(--green-deep); }
.dial__input:focus-visible { outline-offset: 4px; }
.dial__legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--green-deep);
}
.dial__legend span { flex: 0 1 auto; text-align: center; }
.dial__legend span:first-child { text-align: start; }
.dial__legend span:last-child { text-align: end; }
.dial__legend span.is-on { color: var(--ink); font-weight: 800; }
#tone-blurb { margin-top: 20px; }
.tone__face { display: flex; justify-content: center; margin-bottom: 20px; }
.avatar { flex: none; border-radius: 50%; object-fit: cover; background: var(--ink); }
.avatar--lg { width: 88px; height: 88px; border: 3px solid var(--green); }
.tone__blurb { font-size: 0.9375rem; color: var(--green-deep); }

/* ── schedules ─────────────────────────────────────────────────────────── */

.sched {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
}
.sched:last-child { border-bottom: 0; }
.sched > input[type="checkbox"] { flex: none; }
/* Fixed so every row's controls start on the same line, whatever the name. */
.sched__name { flex: 0 0 8rem; margin: 0; font-size: 0.9375rem; cursor: pointer; }
.sched .timepick, .sched .daypick { flex: none; width: auto; min-width: 7.5rem; min-height: 46px; }
.sched .cron { flex: 1 1 14rem; width: auto; }
.sched--day .sched__name { flex: 0 1 auto; cursor: default; }
.sched__hint { flex: 1 1 100%; margin: 0; font-size: 0.875rem; color: var(--green-deep); }
@media (max-width: 479px) {
  .sched__name { flex: 1 1 auto; }
  .sched .timepick, .sched .daypick { flex: 1 1 8rem; min-width: 0; }
}

/* ── toast ─────────────────────────────────────────────────────────────── */

#toast {
  position: fixed;
  inset-inline: var(--gut);
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 520px;
  margin-inline: auto;
  z-index: 20;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--green);
  color: var(--ink);
  font-weight: 800;
  text-align: center;
  animation: land 280ms var(--ease) both;
}
#toast.is-err { background: var(--ink); color: var(--paper); }
@keyframes land { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 559px) {
  body { font-size: 16px; }
  .topbar { gap: 10px; }
  .tab { padding: 8px 10px; }
  #app.app { padding-top: 24px; }
  .panel__body { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .bar.is-inked::after { animation: none; }
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* The level picker in settings: three plain rows, the chosen one keylined. */
.levels { display: grid; gap: 8px; }
.level { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--hair, rgba(0,128,105,.22)); cursor: pointer; }
.level:has(input:checked) { border-color: var(--green-deep, #046b45); }
.level input { margin-top: 5px; }
.level .note { display: block; margin: 2px 0 0; }

/* The code step's second chances: resend on the same channel, or WhatsApp. */
.code-again { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; margin-top: 16px; }
.code-again .linkbtn:disabled { color: var(--green-deep); opacity: 0.6; cursor: default; text-decoration: none; }
#code-status { margin-top: 10px; }
