/* =================================================================
   AREA199 · Performance Science — portale atleta
   Tesi: "lab-grade training" — precisione clinica + identità atletica.
   Display: Saira · Body: Inter · Dati: IBM Plex Mono (readout strumento)
   ================================================================= */

:root {
  /* palette — light */
  --paper: #ebeef3;
  --paper-2: #e2e7ef;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --ink: #11151d;
  --ink-2: #2b323d;
  --mute: #59636f;
  --line: #dce2ea;
  --line-2: #e9edf3;

  --red: #e30613;
  --red-ink: #c20510;
  --red-soft: #ffe6e8;

  --live: #12a150;
  --live-soft: #d9f5e6;
  --steel: #2e4b6b;
  --steel-soft: #e6edf6;

  /* type */
  --f-display: "Saira", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* radius / shadow */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow-1: 0 1px 2px rgba(17, 21, 29, 0.04), 0 8px 24px rgba(17, 21, 29, 0.06);
  --shadow-2: 0 18px 50px rgba(17, 21, 29, 0.12);

  --maxw: 1080px;
  --pad: clamp(1rem, 4vw, 2rem);
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #0c0f15;
  --paper-2: #0a0d12;
  --surface: #151a23;
  --surface-2: #1b212c;
  --ink: #eef2f7;
  --ink-2: #c5cdd8;
  --mute: #8b96a4;
  --line: #283040;
  --line-2: #222a37;

  --red: #ff3b48;
  --red-ink: #ff6670;
  --red-soft: #3a1418;

  --live: #2fd07f;
  --live-soft: #10301f;
  --steel: #7aa3d6;
  --steel-soft: #16263b;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 22px 60px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

a {
  color: var(--red-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input {
  font-family: inherit;
}

:focus-visible {
  outline: 2.5px solid var(--steel);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----- shared atoms ------------------------------------------------ */
.eyebrow {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

.logo {
  font-family: var(--f-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  white-space: nowrap;
}
.logo b {
  color: var(--red);
  font-weight: 900;
}
.logo--xl { font-size: clamp(2.6rem, 9vw, 4.4rem); }
.logo--sm { font-size: 1.35rem; }
.logo--mute { color: var(--mute); }
.logo--mute b { color: var(--mute); }

.dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-block;
}
.dot--live {
  background: var(--live);
  box-shadow: 0 0 0 4px var(--live-soft);
}
.dot--steel {
  background: var(--steel);
  box-shadow: 0 0 0 3px var(--steel-soft);
}

/* views */
.view { display: none; }
.view.is-active { display: block; }

/* =================================================================
   LOGIN
   ================================================================= */
#view-login.is-active {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
}
.login-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  width: 100%;
  min-height: 100dvh;
}

.login-aside {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(227, 6, 19, 0.12), transparent 55%),
    var(--ink);
  color: #fff;
}
[data-theme="dark"] .login-aside {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 59, 72, 0.16), transparent 55%),
    #05070b;
}
.login-aside .logo { color: #fff; }
.login-aside__mark { position: relative; z-index: 1; }
.logo-sub {
  margin: 0.6rem 0 0;
  font-family: var(--f-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.62);
}
.logo-sub i { color: var(--red); font-style: normal; }

.login-aside__readout {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}
.login-aside__readout li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.login-aside__readout span {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.5);
}
.login-aside__readout b {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.login-aside__ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    rgba(255, 255, 255, 0.05) 0 1px,
    transparent 1px 40px
  );
  mask-image: linear-gradient(to bottom, transparent, #000 60%);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  padding: clamp(1.6rem, 5vw, 3.5rem);
  background: var(--surface);
}
.login-panel__logo { display: none; }
.login-panel__head h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0.3rem 0 0.4rem;
}
.login-panel__hint {
  margin: 0;
  color: var(--mute);
  font-size: 0.95rem;
}

.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.45rem; }
.field__label {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.field__label i { font-style: normal; opacity: 0.7; }
.field input {
  width: 100%;
  height: 3rem;
  padding: 0 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field input::placeholder { color: var(--mute); opacity: 0.6; }
.field input:focus {
  outline: none;
  border-color: var(--steel);
  background: var(--surface);
}
.field__pin { position: relative; display: block; }
.field__pin input { padding-right: 3rem; letter-spacing: 0.3em; }
.field__reveal {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--mute);
}
.field__reveal:hover { color: var(--ink); }

.form__error {
  margin: -0.2rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: var(--r-sm);
  background: var(--red-soft);
  color: var(--red-ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.recover {
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}
.recover summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-2);
  list-style: none;
}
.recover summary::-webkit-details-marker { display: none; }
.recover summary::before {
  content: "?";
  display: inline-grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red-ink);
  font-family: var(--f-mono);
  font-size: 0.85rem;
  font-weight: 700;
}
.recover p {
  margin: 0.7rem 0 0;
  color: var(--mute);
  font-size: 0.92rem;
}

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.85rem;
  padding: 0 1.1rem;
  border: 1.5px solid transparent;
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--block { width: 100%; }
.btn--primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 8px 22px rgba(227, 6, 19, 0.28);
}
.btn--primary:hover { background: var(--red-ink); }
.btn__chev { transition: transform 0.15s ease; }
.btn--primary:hover .btn__chev { transform: translateX(3px); }
.btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--steel); color: var(--steel); }
.btn--dl svg { color: var(--red); }

.iconbtn {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
}
.iconbtn:hover { border-color: var(--steel); color: var(--steel); }
.ic--sun { display: none; }
[data-theme="dark"] .ic--moon { display: none; }
[data-theme="dark"] .ic--sun { display: block; }

/* =================================================================
   APPBAR
   ================================================================= */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem var(--pad);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.appbar__brand { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.appbar__tag {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  padding-left: 0.7rem;
  border-left: 1px solid var(--line);
}
.appbar__actions { display: flex; align-items: center; gap: 0.6rem; }

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 2.6rem;
  padding: 0 0.4rem 0 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.user-pill__name { font-weight: 700; font-size: 0.9rem; }
.user-pill__exit {
  border: 0;
  border-radius: 999px;
  height: 2rem;
  padding: 0 0.85rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 0.82rem;
}
.user-pill__exit:hover { background: var(--red); color: #fff; }

/* =================================================================
   SHELL
   ================================================================= */
.shell {
  width: min(var(--maxw), 100%);
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 2.4rem) var(--pad) 1rem;
  display: grid;
  gap: 1.4rem;
}

/* ---- briefing / hero --------------------------------------------- */
.briefing {
  display: grid;
  gap: 1.1rem;
}
.briefing__status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: start;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--live-soft);
  color: var(--live);
  font-weight: 700;
  font-size: 0.85rem;
}
.briefing__status-exp { color: var(--ink-2); font-weight: 500; }
.briefing__status-exp b { font-family: var(--f-mono); font-weight: 600; }

.briefing__title {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.briefing__title span { color: var(--red); font-weight: 600; padding: 0 0.05em; }

.briefing__grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  align-items: stretch;
}
.coach-note {
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--steel);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.coach-note__by {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
}
.coach-note__text { margin: 0; color: var(--ink-2); }

.vitals {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 0.6rem;
}
.vital {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.vital__k {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--mute);
}
.vital__v {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--ink);
  line-height: 1;
}
.vital__v i { font-size: 0.78rem; font-style: normal; color: var(--mute); margin-left: 0.15rem; }
.vital__v--word { font-family: var(--f-display); font-size: 1.25rem; }

/* =================================================================
   TABS
   ================================================================= */
.tabs {
  position: sticky;
  top: calc(0.7rem + 2.6rem + 0.7rem);
  z-index: 15;
  display: flex;
  gap: 0.3rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 0 auto;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mute);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab__ic { font-size: 1rem; line-height: 1; }
.tab:hover { color: var(--ink); }
.tab.is-active {
  background: var(--ink);
  color: var(--paper);
}

/* =================================================================
   PANELS
   ================================================================= */
.panel { display: none; animation: rise 0.32s ease both; }
.panel.is-active { display: grid; gap: 1.1rem; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.panel__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.panel__title { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; margin-top: 0.2rem; }

/* ---- days -------------------------------------------------------- */
.days {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
  scrollbar-width: none;
}
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 auto;
  display: grid;
  gap: 0.1rem;
  min-width: 4.4rem;
  padding: 0.6rem 0.4rem;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.day:hover { border-color: var(--steel); }
.day b {
  font-family: var(--f-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.day span { font-size: 0.72rem; color: var(--mute); }
.day.is-active {
  border-color: var(--red);
  background: var(--red-soft);
}
.day.is-active b { color: var(--red-ink); }
.day.is-active span { color: var(--red-ink); }

.day-head__title { font-family: var(--f-display); font-size: 1.3rem; font-weight: 700; }
.day-head__sub { margin: 0.2rem 0 0; color: var(--mute); font-size: 0.92rem; }

/* ---- exercise cards ---------------------------------------------- */
.exercises { display: grid; gap: 0.9rem; }
.ex {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.ex__media {
  position: relative;
  border-radius: var(--r-sm);
  overflow: hidden;
  min-height: 118px;
  background:
    linear-gradient(140deg, var(--surface-2), var(--paper-2));
}
.ex__media::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 70% 25%, color-mix(in srgb, var(--red) 30%, transparent), transparent 60%),
    repeating-linear-gradient(45deg, transparent 0 9px, rgba(46, 75, 107, 0.06) 9px 10px);
}
.ex__media span {
  position: absolute;
  left: 0.6rem;
  bottom: 0.55rem;
  z-index: 2;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* immagini esecuzione (free-exercise-db) */
.ex__media--photo {
  cursor: pointer;
  background: #f3f5f8;
}
.ex__media--photo::before { content: none; }
.ex__media--photo.ex__media--noimg::before { content: ""; }
.ex__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.ex__frame--b { opacity: 0; transition: opacity 0.18s ease; }
.ex__media--b .ex__frame--b { opacity: 1; }
.ex__media-tag::before { content: "\25B6  "; color: var(--red-ink); }
.ex__media--photo.is-playing .ex__media-tag::before { content: "\275A\275A  "; }
.ex__media--photo.is-playing .ex__media-tag { color: var(--red-ink); }
.ex__media--noimg .ex__frame { display: none; }
.ex__body { min-width: 0; }
.ex__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}
.ex__name { font-family: var(--f-display); font-size: 1.18rem; font-weight: 700; }
.ex__rpe {
  flex: 0 0 auto;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--steel-soft);
  color: var(--steel);
}
.ex__rpe--hard { background: var(--red-soft); color: var(--red-ink); }

.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.7rem 0;
}
.metric {
  display: grid;
  gap: 0.1rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.metric__label {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.metric__value {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}
.metric__value i { font-style: normal; font-size: 0.7rem; color: var(--mute); margin-left: 0.1rem; }

.ex__desc { margin: 0; color: var(--mute); font-size: 0.92rem; }

.note {
  margin-top: 0.7rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.6rem;
}
.note > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 600;
}
.note > summary::-webkit-details-marker { display: none; }
.note > summary::before { content: "✎"; }
.note[open] > summary::before { content: "▾"; }
.note__row { display: flex; gap: 0.5rem; margin-top: 0.55rem; }
.note__row input {
  flex: 1;
  height: 2.6rem;
  padding: 0 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.92rem;
}
.note__row input:focus { outline: none; border-color: var(--steel); background: var(--surface); }
.note__save {
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--r-sm);
  padding: 0 0.9rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 0.82rem;
}
.note__save:hover { background: var(--steel); color: #fff; }

/* =================================================================
   NUTRIZIONE
   ================================================================= */
.disclaimer {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  background: var(--steel-soft);
  color: var(--steel);
  font-size: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--steel) 22%, transparent);
}
.disclaimer b { color: var(--ink); }
.disclaimer--soft { background: var(--surface-2); color: var(--mute); border-color: var(--line); }

.readout--macro { gap: 0.7rem; }
.metric--big {
  flex: 1 1 9rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r-md);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-1);
}
.metric--big .metric__label { font-size: 0.66rem; }
.metric--big .metric__value { font-size: 1.7rem; }

.accordion {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.accordion summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.95rem 1.1rem;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary i { font-style: normal; font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); font-weight: 500; }
.accordion__ic { color: var(--red); font-size: 0.7rem; }
.accordion summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--f-mono);
  color: var(--mute);
  font-size: 1.2rem;
}
.accordion[open] summary::after { content: "–"; }
.meal-list {
  list-style: none;
  margin: 0;
  padding: 0 1.1rem 1rem;
  display: grid;
  gap: 0.7rem;
}
.meal-list li {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line-2);
}
.meal-list b { font-size: 0.92rem; }
.meal-list span { color: var(--mute); font-size: 0.9rem; }

.protocol {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--r-md);
  background: var(--surface);
}
.protocol p:last-child { margin: 0.5rem 0 0; color: var(--ink-2); }

.supps__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}
.supp {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.supp__top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.supp__name { font-family: var(--f-display); font-weight: 700; font-size: 1.02rem; }
.supp__dose { font-family: var(--f-mono); font-size: 0.78rem; font-weight: 600; color: var(--red-ink); }
.supp__timing {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
}
.supp__why { margin: 0.1rem 0 0; color: var(--mute); font-size: 0.86rem; }

/* =================================================================
   ANDAMENTI
   ================================================================= */
.trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}
.trend-card {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.trend-card__head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.8rem; }
.trend-card__delta { font-family: var(--f-mono); font-weight: 700; font-size: 0.82rem; padding: 0.2rem 0.5rem; border-radius: 999px; }
.trend-card__delta--down { background: var(--live-soft); color: var(--live); }
.chart { position: relative; }
.chart__svg { width: 100%; height: 120px; display: block; overflow: visible; }
.chart__line { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart__area { fill: color-mix(in srgb, var(--red) 12%, transparent); stroke: none; }
.chart__axis { display: flex; justify-content: space-between; margin-top: 0.4rem; font-family: var(--f-mono); font-size: 0.7rem; color: var(--mute); }

.empty {
  display: grid;
  place-items: center;
  gap: 0.3rem;
  text-align: center;
  padding: 1.6rem 1rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.empty__ic { font-size: 1.6rem; color: var(--steel); opacity: 0.7; }
.empty__title { margin: 0; font-weight: 700; }
.empty__hint { margin: 0; color: var(--mute); font-size: 0.88rem; max-width: 32ch; }

/* =================================================================
   FOOTER + TOAST
   ================================================================= */
.foot {
  width: min(var(--maxw), 100%);
  margin: 0 auto;
  padding: 1.4rem var(--pad) 2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--mute);
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}
.foot .logo { font-size: 1rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%) translateY(1.5rem);
  z-index: 50;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 860px) {
  .login-grid { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-panel__logo { display: block; margin-bottom: 0.4rem; }
  .login-panel { justify-content: flex-start; padding-top: 2.4rem; min-height: 100dvh; }

  .briefing__grid { grid-template-columns: 1fr; }
  .vitals { grid-template-rows: none; grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .appbar__tag { display: none; }
  .user-pill__name { display: none; }
  .user-pill { padding-left: 0.55rem; }

  .ex { grid-template-columns: 1fr; }
  .ex__media { min-height: 150px; }

  .vital { padding: 0.6rem 0.7rem; }
  .vital__v { font-size: 1.25rem; }

  .panel__head { align-items: stretch; }
  .btn--dl { width: 100%; }
}

/* =================================================================
   MOTION / PRINT
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
