/* TEAM MIKE // PERFORMANCE OS V2.4 — account cover top offset fix */
/* ========================================================================== 
   TEAM MIKE // PERFORMANCE OS V2
   Mobile-first UI per WebView iOS / Android
   Mantiene le classi e la logica del CSS originale, ma ne ridisegna
   completamente gerarchia, superfici, ritmo, touch feedback e safe-area.
   ========================================================================== */

:root {
  --tm-red: #f40b10;
  --tm-red-strong: #d90005;
  --tm-red-soft: rgba(244, 11, 16, .10);
  --tm-red-glow: rgba(244, 11, 16, .28);

  --tm-black: #08090a;
  --tm-black-2: #101113;
  --tm-graphite: #191b1e;
  --tm-graphite-2: #24272b;

  --tm-white: #ffffff;
  --tm-bg: #f3f4f6;
  --tm-surface: #ffffff;
  --tm-surface-2: #f8f9fa;
  --tm-line: rgba(11, 13, 15, .09);
  --tm-line-dark: rgba(255,255,255,.10);

  --tm-text: #101214;
  --tm-muted: #72777f;
  --tm-muted-2: #9da2aa;
  --tm-success: #18a85b;
  --tm-danger: #e12931;

  --tm-radius-xs: 9px;
  --tm-radius-sm: 12px;
  --tm-radius-md: 16px;
  --tm-radius-lg: 22px;
  --tm-radius-xl: 28px;

  --tm-shadow-soft: 0 8px 30px rgba(7, 10, 13, .07);
  --tm-shadow-card: 0 12px 34px rgba(7, 10, 13, .09), 0 1px 0 rgba(255,255,255,.8) inset;
  --tm-shadow-float: 0 18px 50px rgba(4, 6, 8, .20);
  --tm-shadow-red: 0 12px 28px rgba(244, 11, 16, .22);

  --tm-ease: cubic-bezier(.2,.8,.2,1);
  --tm-ease-spring: cubic-bezier(.22,1,.36,1);

  color-scheme: light;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--tm-bg);
  overscroll-behavior-y: none;
}

body,
input,
button {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  margin: 0;
  color: var(--tm-text);
  background: var(--tm-bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
a,
[role="button"] {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(244,11,16,.22);
  outline-offset: 2px;
}

/* ========================================================================== 
   LOGIN / ACCESSO
   ========================================================================== */

.login-bg {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(22px, env(safe-area-inset-top))
    18px
    max(22px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 78% 17%, rgba(244,11,16,.23), transparent 27%),
    radial-gradient(circle at 10% 84%, rgba(244,11,16,.10), transparent 30%),
    linear-gradient(145deg, #050607 0%, #0b0c0e 48%, #111317 100%);
}

.login-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

.login-container {
  width: 100%;
  min-height: calc(100vh - 44px);
  min-height: calc(100dvh - 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}

.login-card {
  width: min(100%, 390px);
  padding: 34px 24px 24px;
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: var(--tm-radius-xl);
  background: rgba(255,255,255,.975);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 28px 80px rgba(0,0,0,.38);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, var(--tm-red) 28%, var(--tm-red) 72%, transparent 100%);
}

.login-logo {
  width: 118px;
  height: 118px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #090a0b;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 12px 32px rgba(0,0,0,.24), 0 0 0 7px rgba(244,11,16,.07);
  position: relative;
}

.login-logo::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 1px solid rgba(244,11,16,.22);
}

.login-logo img {
  width: 104px;
  height: 104px;
  display: block;
  object-fit: contain;
}

.login-title {
  margin: 0 0 7px;
  color: var(--tm-black);
  font-size: clamp(1.75rem, 8vw, 2.15rem);
  line-height: 1;
  font-weight: 850;
  letter-spacing: -1.35px;
  text-transform: uppercase;
}

.login-desc {
  max-width: 290px;
  margin: 0 auto 27px;
  color: var(--tm-muted);
  font-size: .96rem;
  line-height: 1.5;
  font-weight: 480;
}

.login-form {
  width: 100%;
  margin-bottom: 16px;
}

.input-group {
  margin-bottom: 12px;
}

.login-input {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border-radius: var(--tm-radius-md);
  border: 1px solid #dadddf;
  outline: none;
  background: #f5f6f7;
  color: var(--tm-text);
  font-size: 1rem;
  font-weight: 520;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset;
  transition: border-color .18s var(--tm-ease), box-shadow .18s var(--tm-ease), background .18s var(--tm-ease), transform .18s var(--tm-ease);
}

.login-input::placeholder {
  color: #9ca1a8;
  font-weight: 430;
}

.login-input:focus {
  border-color: var(--tm-red);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(244,11,16,.08);
  transform: translateY(-1px);
}

.login-btn {
  width: 100%;
  min-height: 53px;
  padding: 13px 18px;
  margin-top: 7px;
  border: 0;
  border-radius: var(--tm-radius-md);
  background: linear-gradient(180deg, #ff171c 0%, var(--tm-red) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .15px;
  cursor: pointer;
  box-shadow: var(--tm-shadow-red);
  transition: transform .15s var(--tm-ease), box-shadow .15s var(--tm-ease), filter .15s var(--tm-ease);
}

.login-btn:hover,
.login-btn:focus {
  background: linear-gradient(180deg, #ff171c 0%, var(--tm-red-strong) 100%);
  color: #fff;
  filter: saturate(1.05);
}

.login-btn:active {
  transform: scale(.985) translateY(1px);
  box-shadow: 0 7px 18px rgba(244,11,16,.18);
}

.login-links {
  margin-top: 14px;
  color: var(--tm-muted);
  font-size: .91rem;
  opacity: 1;
}

.login-link {
  color: var(--tm-red);
  font-weight: 750;
  text-decoration: none;
  transition: color .15s var(--tm-ease);
}

.login-link:hover {
  color: var(--tm-red-strong);
  text-decoration: none;
}

.login-footer {
  margin-top: 25px;
  padding: 0 12px;
  color: rgba(255,255,255,.50);
  font-size: .79rem;
  line-height: 1.45;
  text-align: center;
  letter-spacing: .2px;
}

.go-to-account-btn {
  width: 100%;
  min-height: 50px;
  margin: 13px auto 0;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--tm-radius-md);
  border: 1px solid var(--tm-line);
  background: var(--tm-black);
  color: #fff;
  font-size: .98rem;
  font-weight: 780;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(0,0,0,.14);
  transition: transform .15s var(--tm-ease), background .15s var(--tm-ease);
}

.go-to-account-btn:hover,
.go-to-account-btn:focus {
  background: var(--tm-graphite);
  color: #fff;
}

.go-to-account-btn:active {
  transform: scale(.985);
}

@media (max-width: 500px) {
  .login-card {
    width: min(100%, 378px);
    padding: 30px 20px 21px;
  }

  .login-footer {
    font-size: .76rem;
  }
}

/* ========================================================================== 
   NUTRIZIONE
   ========================================================================== */

.diet-bg {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, #111315 0 128px, transparent 128px),
    var(--tm-bg);
}

.diet-header {
  position: sticky;
  top: 44px;
  z-index: 9;
  min-height: 62px;
  padding: 8px 16px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,9,10,.94);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.diet-header-title {
  margin-right: 8px;
  color: #fff;
  font-size: 1.06rem;
  line-height: 1.1;
  font-weight: 820;
  letter-spacing: .65px;
  text-transform: uppercase;
}

.diet-header-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  filter: drop-shadow(0 0 9px rgba(244,11,16,.22));
}

.diet-days-scroll {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 14px 14px 12px;
  background: transparent;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.diet-days-scroll::-webkit-scrollbar {
  display: none;
}

.diet-day {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 54px;
  padding: 8px 10px;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  border-radius: 15px;
  border: 1px solid var(--tm-line);
  background: rgba(255,255,255,.92);
  color: #4b5057;
  font-size: .89rem;
  font-weight: 760;
  text-align: center;
  box-shadow: 0 5px 16px rgba(8,10,12,.055);
  cursor: pointer;
  user-select: none;
  transition: transform .14s var(--tm-ease), background .16s var(--tm-ease), color .16s var(--tm-ease), border-color .16s var(--tm-ease);
}

.nf-published-at,
.nf-trainer_info {
  width: 50%;
  min-height: 78px;
  padding: 13px 14px;
  position: relative;
  overflow: hidden;
  border-radius: var(--tm-radius-md);
  border: 1px solid var(--tm-line);
  background: var(--tm-surface);
  color: var(--tm-text);
  font-size: .92rem;
  user-select: none;
  box-shadow: var(--tm-shadow-soft);
  transition: transform .2s var(--tm-ease), border-color .2s var(--tm-ease);
}

.nf-published-at::before,
.nf-trainer_info::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 99px 99px 0;
  background: var(--tm-red);
}

.nf-trainer_info > p,
.nf-published-at > p {
  margin: 0 0 6px;
  color: var(--tm-red);
  font-size: .70rem;
  line-height: 1.2;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.nf-info-valorinutr {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-radius: var(--tm-radius-md);
  border: 1px solid var(--tm-line);
  background: linear-gradient(135deg, var(--tm-black) 0%, #17191c 100%);
  color: #fff;
  font-size: .94rem;
  user-select: none;
  box-shadow: 0 12px 34px rgba(8,10,12,.18);
  transition: transform .18s var(--tm-ease);
}

.nf-sub-title {
  font-size: .74rem;
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: .75px;
  text-transform: uppercase;
}

.nf-sub-title.root-terziary {
  color: var(--tm-red);
}

.nf-sub-title.root-penta {
  color: #fff;
}

.py-1 {
  padding-left: 4px;
  padding-right: 4px;
}

.nf.display-flex.gap-3.py-1 {
  width: calc(100% - 24px);
  max-width: 430px;
  margin-left: auto;
  margin-right: auto;
}

.diet-day.active,
.diet-day:active,
.diet-day:focus {
  color: #fff;
  border-color: var(--tm-red);
  background: linear-gradient(180deg, #ff1a1f 0%, var(--tm-red) 100%);
  box-shadow: 0 9px 22px rgba(244,11,16,.20);
  transform: translateY(-1px);
}

.diet-day:hover {
  background: #fff;
  border-color: rgba(244,11,16,.25);
}

.diet-day.active:hover {
  background: var(--tm-red);
}

.diet-meals-list {
  margin: 10px 0 0;
  padding: 0 12px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.diet-meal-card {
  width: 100%;
  max-width: 430px;
  padding: 17px 17px 15px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--tm-line);
  background: var(--tm-surface);
  box-shadow: var(--tm-shadow-card);
}

.diet-meal-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 4px;
  height: 36px;
  border-radius: 0 6px 6px 0;
  background: var(--tm-red);
}

.diet-meal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 3px;
  padding-left: 4px;
}

.diet-meal-title {
  color: var(--tm-black);
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 840;
  letter-spacing: -.3px;
}

.diet-meal-time {
  padding: 5px 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f0f1f2;
  color: #666b72;
  font-size: .74rem;
  line-height: 1;
  font-weight: 750;
  opacity: 1;
}

.diet-meal-items {
  margin: 2px 0 9px;
  border-top: 1px solid var(--tm-line);
}

.diet-food-row {
  min-height: 43px;
  padding: 10px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--tm-line);
  color: var(--tm-text);
  font-size: .95rem;
}

.diet-food-name {
  min-width: 0;
  font-weight: 560;
  line-height: 1.3;
}

.diet-food-qty {
  flex: 0 0 auto;
  color: var(--tm-red);
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.diet-btn-details {
  width: 100%;
  min-height: 47px;
  margin-top: 3px;
  padding: 11px 14px;
  border: 0;
  border-radius: 13px;
  background: var(--tm-black);
  color: #fff;
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: .15px;
  box-shadow: none;
  cursor: pointer;
  transition: transform .14s var(--tm-ease), background .16s var(--tm-ease), color .16s var(--tm-ease);
}

.diet-btn-details.active {
  background: var(--tm-red);
  color: #fff;
}

@media (min-width: 620px) {
  .diet-btn-details:hover,
  .diet-btn-details:focus,
  .diet-btn-details.active {
    background: var(--tm-red);
    color: #fff;
  }
}

.diet-btn-details:active {
  transform: scale(.987);
}

@media (max-width: 500px) {
  .diet-meal-card {
    padding: 16px 15px 14px;
  }

  .diet-header {
    padding: 8px 14px !important;
  }
}

.diet-meal-note {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height .38s var(--tm-ease), opacity .24s var(--tm-ease), transform .28s var(--tm-ease), margin .24s var(--tm-ease);
}

.diet-meal-note.open {
  max-height: 800px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 9px;
}

.diet-meal-note:not(.open) > .message-alert {
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.message-alert > .no-data {
  font-size: 1rem;
  line-height: 1.45;
}

.display-flex {
  display: flex;
}

.gap-3 {
  gap: 10px;
}

/* ========================================================================== 
   ALLENAMENTO
   ========================================================================== */

.workout-bg {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, #090a0b 0 154px, transparent 154px),
    var(--tm-bg);
}

.workout-header {
  position: sticky;
  top: 44px;
  z-index: 9;
  min-height: 62px;
  padding: 8px 16px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,9,10,.95);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.workout-header-title {
  margin-right: 8px;
  color: #fff;
  font-size: 1.06rem;
  font-weight: 840;
  line-height: 1.1;
  letter-spacing: .65px;
  text-transform: uppercase;
}

.workout-header-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
}

.workout-days-scroll {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 14px 14px 13px;
  background: transparent;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.workout-days-scroll::-webkit-scrollbar {
  display: none;
}

.workout-day {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 54px;
  padding: 8px 10px;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,.10);
  background: #17191c;
  color: #c6c9cd;
  font-size: .89rem;
  font-weight: 760;
  text-align: center;
  box-shadow: 0 5px 16px rgba(0,0,0,.17);
  cursor: pointer;
  user-select: none;
  transition: transform .14s var(--tm-ease), background .16s var(--tm-ease), color .16s var(--tm-ease), border-color .16s var(--tm-ease);
}

.workout-day.active,
.workout-day:active,
.workout-day:focus {
  background: var(--tm-red);
  color: #fff;
  border-color: var(--tm-red);
  box-shadow: var(--tm-shadow-red);
  transform: translateY(-1px);
}

.workout-day:hover {
  background: #222529;
  border-color: rgba(244,11,16,.40);
}

.workout-day.active:hover {
  background: var(--tm-red);
}

.workout-list {
  margin: 7px 0 0;
  padding: 0 12px 42px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.workout-card {
  width: 100%;
  max-width: 430px;
  padding: 18px 17px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  border-radius: 21px;
  border: 1px solid var(--tm-line);
  background: var(--tm-surface);
  box-shadow: var(--tm-shadow-card);
}

.workout-card::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -34px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,11,16,.10), transparent 68%);
  pointer-events: none;
}

.workout-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 2px;
}

.workout-card-title {
  color: var(--tm-black);
  font-size: 1.08rem;
  line-height: 1.25;
  font-weight: 860;
  letter-spacing: -.35px;
}

.workout-card-title::before {
  content: "WORKOUT";
  display: block;
  margin-bottom: 4px;
  color: var(--tm-red);
  font-size: .63rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 1.1px;
}

.workout-card-time {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--tm-black);
  color: #fff;
  font-size: .72rem;
  line-height: 1;
  font-weight: 780;
  opacity: 1;
}

.workout-meta {
  min-height: 40px;
  margin-bottom: 3px;
  padding: 10px 11px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-radius: 12px;
  background: #f4f5f6;
  color: #5d6269;
  font-size: .83rem;
  font-weight: 680;
  opacity: 1;
}

.workout-exercises {
  margin-bottom: 7px;
  border-top: 1px solid var(--tm-line);
}

.exercise-row {
  min-height: 46px;
  padding: 10px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--tm-line);
  color: var(--tm-text);
  font-size: .94rem;
}

.exercise-name {
  min-width: 0;
  font-weight: 590;
  line-height: 1.25;
}

.exercise-sets {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 9px;
  background: var(--tm-red-soft);
  color: var(--tm-red-strong);
  font-size: .78rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.workout-btn-details {
  width: 100%;
  min-height: 50px;
  margin-top: 2px;
  padding: 12px 14px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, #ff171c 0%, var(--tm-red) 100%);
  color: #fff;
  font-size: .94rem;
  font-weight: 850;
  letter-spacing: .2px;
  box-shadow: 0 10px 24px rgba(244,11,16,.18);
  cursor: pointer;
  transition: transform .14s var(--tm-ease), filter .16s var(--tm-ease), box-shadow .16s var(--tm-ease);
}

.workout-btn-details:hover,
.workout-btn-details:focus {
  background: linear-gradient(180deg, #ff171c 0%, var(--tm-red-strong) 100%);
  color: #fff;
  filter: saturate(1.05);
}

.workout-btn-details:active {
  transform: scale(.987);
  box-shadow: 0 6px 16px rgba(244,11,16,.16);
}

@media (max-width: 500px) {
  .workout-card {
    padding: 17px 15px 15px;
  }

  .workout-header {
    padding: 8px 14px !important;
  }
}

/* ========================================================================== 
   CHAT
   ========================================================================== */

.chat-bg {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(244,11,16,.055), transparent 26%),
    #eef0f2;
}

.chat-header {
  position: sticky;
  top: 0;
  z-index: 9;
  min-height: 68px;
  padding:
    max(9px, env(safe-area-inset-top))
    14px
    9px !important;
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(8,9,10,.96);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 25px rgba(0,0,0,.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.chat-header-avatar {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  margin-right: 1px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1c1f;
  border: 2px solid rgba(244,11,16,.75);
  box-shadow: 0 0 0 3px rgba(244,11,16,.09);
}

.chat-header-title {
  color: #fff;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 820;
  letter-spacing: -.15px;
}

.chat-header-subtitle {
  margin-top: 3px;
  color: #aeb3ba;
  font-size: .78rem;
  line-height: 1.2;
  font-weight: 600;
  opacity: 1;
}

.chat-header-subtitle::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 50%;
  background: var(--tm-success);
  box-shadow: 0 0 0 3px rgba(24,168,91,.12);
  vertical-align: 1px;
}

.chat-messages-area {
  max-height: calc(100vh - 142px);
  max-height: calc(100dvh - 142px);
  padding: 18px 0 calc(94px + env(safe-area-inset-bottom));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 11px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.chat-message {
  max-width: 100%;
  margin: 0 12px;
  display: flex;
  align-items: flex-end;
}

.my-message {
  justify-content: flex-end;
}

.my-message .chat-bubble {
  max-width: min(80vw, 340px);
  align-items: flex-end;
  border: 0;
  border-bottom-right-radius: 6px !important;
  background: linear-gradient(145deg, #ff171c 0%, #e6060b 100%);
  color: #fff;
  box-shadow: 0 8px 19px rgba(244,11,16,.16);
}

.my-message .chat-time {
  color: rgba(255,255,255,.72);
}

.trainer-message {
  justify-content: flex-start;
}

.nutr-message {
  justify-content: flex-start;
}

.trainer-message .chat-bubble,
.nutr-message .chat-bubble {
  max-width: min(80vw, 340px);
  align-items: flex-start;
  border: 1px solid rgba(8,10,12,.07);
  background: rgba(255,255,255,.96);
  color: var(--tm-text);
  box-shadow: 0 7px 18px rgba(8,10,12,.065);
}

.trainer-message .chat-bubble {
  border-left: 3px solid var(--tm-red);
}

.nutr-message .chat-bubble {
  border-left: 3px solid var(--tm-black);
}

.chat-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  margin-right: 7px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(8,10,12,.08);
}

.chat-bubble {
  max-width: min(82vw, 350px);
  margin-bottom: 1px;
  padding: 10px 13px 7px;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 17px 17px 17px 6px;
  font-size: .95rem;
  line-height: 1.42;
  font-weight: 500;
}

.chat-time {
  margin-top: 5px;
  align-self: flex-end;
  color: #8b9097;
  font-size: .68rem;
  line-height: 1;
  font-weight: 600;
  opacity: 1;
  font-variant-numeric: tabular-nums;
}

.chat-input-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  margin-bottom: 0;
  padding: 9px 10px max(9px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(255,255,255,.94);
  border-top: 1px solid rgba(8,10,12,.07);
  box-shadow: 0 -8px 28px rgba(8,10,12,.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.chat-input {
  flex: 1;
  min-height: 47px;
  padding: 12px 14px;
  border: 1px solid #d8dade;
  border-radius: 16px;
  outline: none;
  background: #f3f4f5;
  color: var(--tm-text);
  font-size: .96rem;
  line-height: 1.3;
  transition: border-color .16s var(--tm-ease), background .16s var(--tm-ease), box-shadow .16s var(--tm-ease);
}

.chat-input:focus {
  border-color: rgba(244,11,16,.55);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(244,11,16,.07);
}

.chat-send-btn {
  width: 47px;
  height: 47px;
  flex: 0 0 47px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 15px;
  background: var(--tm-red);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(244,11,16,.20);
  transition: transform .14s var(--tm-ease), background .14s var(--tm-ease);
}

.chat-send-btn:hover,
.chat-send-btn:focus {
  background: var(--tm-red-strong);
}

.chat-send-btn:active {
  transform: scale(.94);
}

.chat-send-btn svg {
  display: block;
  fill: #fff;
}

@media (max-width: 500px) {
  .chat-header {
    padding: max(9px, env(safe-area-inset-top)) 12px 9px !important;
  }

  .chat-messages-area {
    padding-top: 13px;
  }

  .chat-bubble {
    font-size: .93rem;
  }
}

/* ========================================================================== 
   ACCOUNT UTENTE
   ========================================================================== */

.account-bg {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, #090a0b 0 226px, transparent 226px),
    var(--tm-bg);
}

.account-header {
  position: sticky;
  top: 0;
  z-index: 9;
  min-height: 56px;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,9,10,.95);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.account-header-title {
  margin-right: 7px;
  color: #fff;
  font-size: 1rem;
  font-weight: 830;
  letter-spacing: .65px;
  text-transform: uppercase;
}

.account-header-icon {
  width: 23px;
  height: 23px;
  display: inline-block;
}

.account-profile-card {
  width: calc(100% - 24px);
  max-width: 430px;
  margin: 18px auto 15px;
  padding: 98px 18px 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.11);
  background: #fff;
  box-shadow: 0 18px 42px rgba(5,7,9,.16);
}

.account-profile-cover {
  width: 100%;
  max-width: 100%;
  height: 126px;
  display: block;
  position: absolute;
  top: 100px;
  left: 0;
  right: 0;
  bottom: auto;
  border-radius: 0;
  overflow: hidden;
  object-fit: cover;
  background:
    linear-gradient(120deg, rgba(244,11,16,.95), rgba(148,0,4,.78)),
    linear-gradient(135deg, #111315, #050607);
}

.account-profile-cover::after {
  content: "TEAM MIKE";
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: rgba(255,255,255,.22);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.account-avatar-area {
  width: 102px;
  height: 102px;
  margin-bottom: 5px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.account-avatar {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  object-fit: cover;
  background: #e9ebed;
  border: 4px solid #fff;
  box-shadow: 0 9px 24px rgba(0,0,0,.20);
}

.account-avatar-edit {
  position: absolute;
  right: 4px;
  bottom: 3px;
}

.account-avatar-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--tm-red);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(244,11,16,.24);
  transition: transform .14s var(--tm-ease), background .14s var(--tm-ease);
}

.account-avatar-btn:hover,
.account-avatar-btn:focus {
  background: var(--tm-red-strong);
  border-color: #fff;
}

.account-avatar-btn:active {
  transform: scale(.92);
}

.account-profile-info {
  width: 100%;
  text-align: center;
}

.account-username {
  margin-bottom: 3px;
  color: var(--tm-red);
  font-size: .74rem;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.account-fullname {
  margin-bottom: 3px;
  color: var(--tm-black);
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: 860;
  letter-spacing: -.35px;
}

.account-mail {
  margin-bottom: 13px;
  color: var(--tm-muted);
  font-size: .88rem;
  opacity: 1;
}

.account-info-row {
  width: 100%;
  margin-bottom: 2px;
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--tm-line);
  color: var(--tm-text);
  font-size: .89rem;
  font-weight: 650;
  text-align: left;
}

.account-info-row span {
  color: var(--tm-muted);
  font-weight: 520;
  opacity: 1;
}

.account-edit-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  padding: 11px 14px;
  border: 0;
  border-radius: 13px;
  background: var(--tm-black);
  color: #fff;
  font-size: .93rem;
  font-weight: 820;
  cursor: pointer;
  box-shadow: none;
  transition: transform .14s var(--tm-ease), background .14s var(--tm-ease);
}

.account-edit-btn:hover,
.account-edit-btn:focus {
  background: var(--tm-red);
  color: #fff;
}

.account-edit-btn:active {
  transform: scale(.987);
}

.account-actions-list {
  width: calc(100% - 24px);
  max-width: 430px;
  margin: 0 auto;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--tm-line);
  border-radius: 19px;
  background: #fff;
  box-shadow: var(--tm-shadow-soft);
}

.account-action {
  min-height: 54px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  border: 0;
  border-bottom: 1px solid var(--tm-line);
  border-radius: 0;
  background: transparent;
  color: var(--tm-text);
  font-size: .94rem;
  font-weight: 680;
  text-decoration: none;
  box-shadow: none;
  transition: background .14s var(--tm-ease), color .14s var(--tm-ease), transform .14s var(--tm-ease);
}

.account-action::after {
  content: "›";
  margin-left: auto;
  color: #a8adb4;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 400;
}

.account-action:last-child {
  border-bottom: 0;
}

.account-action:hover,
.account-action:focus {
  background: #f5f6f7;
  color: var(--tm-text);
  border: 0;
  border-bottom: 1px solid var(--tm-line);
}

.account-action:active {
  background: #eceef0;
  transform: scale(.995);
}

.account-action .action-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f0f1f2;
  color: var(--tm-black);
}

.account-action.logout {
  margin-top: 4px;
  border-bottom: 0;
  border-radius: 13px;
  background: rgba(225,41,49,.06);
  color: var(--tm-danger);
}

.account-action.logout::after {
  color: rgba(225,41,49,.45);
}

.account-action.logout:hover,
.account-action.logout:focus {
  background: rgba(225,41,49,.10);
  color: var(--tm-danger);
  border: 0;
}

@media (max-width: 500px) {
  .account-header {
    padding: max(8px, env(safe-area-inset-top)) 12px 8px !important;
  }

  .account-profile-card {
    padding: 96px 15px 15px;
  }

  .account-actions-list {
    width: calc(100% - 24px);
  }
}

/* ========================================================================== 
   NON AUTENTICATO
   ========================================================================== */

.not-logged-bg {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding:
    max(24px, env(safe-area-inset-top))
    16px
    max(24px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 18%, rgba(244,11,16,.20), transparent 30%),
    linear-gradient(145deg, #060708, #121417);
}

.not-logged-container {
  width: min(100%, 380px);
  margin: auto;
  padding: 31px 22px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 25px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 26px 70px rgba(0,0,0,.34);
}

.not-logged-icon {
  width: 70px;
  height: 70px;
  margin-bottom: 2px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--tm-black);
  color: var(--tm-red);
  box-shadow: 0 10px 28px rgba(0,0,0,.20), 0 0 0 6px rgba(244,11,16,.065);
}

.not-logged-title {
  margin-bottom: 1px;
  color: var(--tm-black);
  font-size: 1.18rem;
  line-height: 1.2;
  font-weight: 860;
  letter-spacing: -.25px;
}

.not-logged-text {
  margin: 0 0 7px;
  color: var(--tm-muted);
  font-size: .95rem;
  line-height: 1.55;
  opacity: 1;
}

.not-logged-btn {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: var(--tm-red);
  color: #fff;
  font-size: .95rem;
  font-weight: 830;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--tm-shadow-red);
  transition: transform .14s var(--tm-ease), background .14s var(--tm-ease);
}

.not-logged-btn:hover,
.not-logged-btn:focus {
  background: var(--tm-red-strong);
  color: #fff;
}

.not-logged-btn:active {
  transform: scale(.985);
}

@media (max-width: 500px) {
  .not-logged-container {
    padding: 28px 18px 20px;
  }
}

/* ========================================================================== 
   TOP APP BAR
   ========================================================================== */

header.header-mobile-sticky-top {
  height: 44px;
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(8,9,10,.98);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 5px 18px rgba(0,0,0,.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

header.header-mobile-sticky-top .d-flex-global {
  height: 44px;
  padding: 5px 12px;
  display: flex;
  position: relative;
  justify-content: space-between;
  align-items: center;
}

header.header-mobile-sticky-top .d-flex-global>img.logo-icon-app {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.22));
}

header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu {
  width: 28px;
  height: 28px;
  padding: 3px;
  box-sizing: content-box;
  overflow: visible;

  /* L'hamburger è disegnato tramite FILL: il bianco viene applicato
     direttamente allo SVG e viene ereditato dagli elementi interni. */
  color: #ffffff !important;
  fill: #ffffff !important;

  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  opacity: 1 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .14s var(--tm-ease), border-color .14s var(--tm-ease), opacity .14s var(--tm-ease), transform .14s var(--tm-ease);
}

/*
 * IMPORTANTE:
 * Il toggle menu usa FILL, non STROKE.
 * Questi selettori sovrascrivono anche eventuali fill scuri dichiarati
 * direttamente nei singoli elementi dell'SVG.
 */
header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu path,
header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu rect,
header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu circle,
header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu polygon,
header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu ellipse,
header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu use {
  fill: #ffffff !important;
}

/* Anche i gruppi SVG ereditano esplicitamente il bianco. */
header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu g {
  fill: #ffffff !important;
}

/* Mantiene trasparenti soltanto gli elementi volutamente privi di fill. */
header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu [fill="none"] {
  fill: none !important;
}

header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu:hover {
  fill: #ffffff !important;
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.14);
}

header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu:active {
  fill: #ffffff !important;
  transform: scale(.90);
  opacity: .76;
  background: rgba(244,11,16,.16);
  border-color: rgba(244,11,16,.28);
}

header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu .bar-middle {
  fill: #ffffff !important;
  transform-origin: center;
  transition: transform .26s var(--tm-ease-spring);
}

header.header-mobile-sticky-top .d-flex-global>svg.icon-toggle-menu:hover .bar-middle {
  fill: #ffffff !important;
  transform: scaleX(.68);
}

/* ========================================================================== 
   DRAWER / MINI MENU
   ========================================================================== */

.mini-top-menu {
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 5px;
  list-style: none;
}

.mini-top-menu li {
  width: 100%;
  margin: 0;
  padding: 0;
}

.mini-menu-btn {
  width: 100%;
  min-height: 49px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #d9dce0;
  font-size: .96rem;
  font-weight: 680;
  letter-spacing: -.1px;
  text-decoration: none;
  box-shadow: none;
  transition: background .15s var(--tm-ease), color .15s var(--tm-ease), border-color .15s var(--tm-ease), transform .15s var(--tm-ease);
}

.mini-menu-btn:hover,
.mini-menu-btn:focus,
.mini-top-menu li.active .mini-menu-btn {
  background: rgba(244,11,16,.12);
  color: #fff;
  border-color: rgba(244,11,16,.18);
}

.mini-top-menu li.active .mini-menu-btn {
  position: relative;
  font-weight: 820;
}

.mini-top-menu li.active .mini-menu-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 0 8px 8px 0;
  background: var(--tm-red);
  box-shadow: 0 0 12px rgba(244,11,16,.45);
}

.mini-menu-btn:active {
  transform: scale(.985);
}

li.bottom-logout {
  width: calc(100% - 24px);
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(14px, env(safe-area-inset-bottom));
  margin: auto;
}

li.bottom-logout a.mini-menu-btn {
  min-height: 50px;
  display: flex;
  justify-content: center;
  column-gap: 7px;
  border: 1px solid rgba(244,11,16,.30);
  background: rgba(244,11,16,.10);
  color: #ff5d61;
  font-size: .88rem;
  font-weight: 850;
  letter-spacing: .75px;
  text-align: center;
  text-transform: uppercase;
}

li.bottom-logout a.mini-menu-btn:active {
  background: var(--tm-red);
  color: #fff;
}

@media (max-width: 500px) {
  .mini-top-menu {
    gap: 4px;
  }

  .mini-menu-btn {
    min-height: 48px;
    padding: 11px 12px;
    font-size: .95rem;
  }
}

.slide-right-panel {
  width: min(86vw, 328px);
  max-width: 328px;
  height: calc(100vh - 44px);
  height: calc(100dvh - 44px);
  position: fixed;
  top: 44px;
  right: min(-90vw, -340px);
  z-index: 9999;
  overflow: hidden;
  border-left: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at 110% 0%, rgba(244,11,16,.20), transparent 28%),
    #0d0f11;
  box-shadow: -24px 0 60px rgba(0,0,0,.34);
  transition: right .34s var(--tm-ease-spring), box-shadow .34s var(--tm-ease-spring);
}

.slide-right-panel::before {
  content: "TEAM MIKE";
  display: block;
  padding: 22px 16px 15px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: 1.7px;
}

.slide-right-panel::after {
  content: "PERFORMANCE OS";
  position: absolute;
  top: 24px;
  right: 16px;
  color: var(--tm-red);
  font-size: .54rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .9px;
}

.slide-right-panel.opened {
  right: 0;
}

.slide-right-body {
  height: calc(100% - 58px);
  position: relative;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ========================================================================== 
   TOUCH / MOTION ACCESSIBILITY
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
  .login-btn:hover,
  .go-to-account-btn:hover,
  .diet-day:hover,
  .diet-btn-details:hover,
  .workout-day:hover,
  .workout-btn-details:hover,
  .chat-send-btn:hover,
  .account-avatar-btn:hover,
  .account-edit-btn:hover,
  .account-action:hover,
  .not-logged-btn:hover,
  .mini-menu-btn:hover {
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ========================================================================== 
   V2.1 HOTFIX — WEBVIEW WIDTH / DRAWER / ACCOUNT COVER
   ========================================================================== */

/* Prevent any off-canvas UI from enlarging the document width inside WebView. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

/* Fixed elements must stay tied to the visual viewport and never create a
   horizontal scrollable area. The drawer now hides with transform instead of
   a large negative `right` value. */
.slide-right-panel {
  top: 44px;
  right: 0;
  left: auto;
  width: min(86vw, 328px);
  max-width: calc(100vw - 18px);
  height: calc(100vh - 44px);
  height: calc(100dvh - 44px);
  transform: translate3d(calc(100% + 18px), 0, 0);
  will-change: transform;
  contain: layout paint;
  transition: transform .34s var(--tm-ease-spring), box-shadow .34s var(--tm-ease-spring);
}

.slide-right-panel.opened {
  right: 0;
  transform: translate3d(0, 0, 0);
}

.slide-right-panel::before {
  padding-right: 118px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-right-panel::after {
  max-width: 102px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.slide-right-body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.mini-top-menu,
.mini-top-menu li,
.mini-menu-btn {
  min-width: 0;
  max-width: 100%;
}

.mini-menu-btn {
  width: 100%;
}

li.bottom-logout {
  width: auto;
  left: 12px;
  right: 12px;
}

/* ACCOUNT COVER
   Keep the default artwork readable instead of treating it as a photographic
   crop. `contain` is intentional here: logos / branded default covers must be
   visible in their entirety. */
.account-bg {
  background:
    linear-gradient(180deg, #090a0b 0 250px, transparent 250px),
    var(--tm-bg);
}

.account-profile-card {
  margin-top: 20px;
  padding-top: 154px;
  overflow: hidden;
}

.account-profile-cover {
  top: 100px;
  left: 0;
  right: 0;
  bottom: auto;
  width: 100%;
  height: 176px;
  max-width: none;
  border-radius: 0;
  object-fit: contain;
  object-position: center center;
  background-color: #090a0b;
  background-image: none;
}

/* Pseudo-elements don't render on replaced <img> elements; leave branding to
   the actual cover asset so the default cover remains clean and uncropped. */
.account-profile-cover::after {
  content: none;
  display: none;
}

.account-avatar-area {
  z-index: 3;
  margin-top: -4px;
}

@media (max-width: 500px) {
  .slide-right-panel {
    width: min(84vw, 320px);
    max-width: calc(100vw - 14px);
  }

  .account-profile-card {
    width: calc(100% - 24px);
    margin-top: 16px;
    padding-top: 148px;
  }

  .account-profile-cover {
    height: 170px;
  }
}


/* ========================================================================== 
   V3.1 — TRAINING SYSTEM CUSTOMER BRIDGE / WEBVIEW
   Reusa il client Training System reale dentro section=fitness senza duplicare
   logica o dati. Gli override sono confinati a .tm-training-webview.
   ========================================================================== */
.tm-training-webview {
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}
.tm-training-webview .tm-section-header {
  padding: 18px 16px 10px;
  color: #fff;
}
.tm-fitness-nav {
  position: sticky;
  top: 44px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 6px;
  padding: 9px 10px;
  background: rgba(9,10,11,.96);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.tm-fitness-nav a {
  min-width: 0;
  min-height: 42px;
  padding: 9px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #cfd2d6;
  font-size: .78rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.tm-fitness-nav a.active {
  background: var(--tm-red);
  color: #fff;
  box-shadow: 0 7px 18px rgba(244,11,16,.20);
}
.tm-training-bridge {
  width: 100%;
  max-width: 100%;
  min-height: 420px;
  padding: 12px !important;
  margin: 0 !important;
  overflow-x: clip;
  --xtr-accent: var(--tm-red);
}
.tm-training-bridge > #xtrApp { width:100%; min-width:0; }
.tm-training-webview [data-panel="training-system"] .xtr-customer-dashboard,
.tm-training-webview [data-panel="training-system"] .xtr-customer-shell,
.tm-training-webview [data-panel="training-system"] .xtr-calendar-shell,
.tm-training-webview [data-panel="training-system"] .xtr-customer-community-page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
.tm-training-webview [data-panel="training-system"] .xtr-card,
.tm-training-webview [data-panel="training-system"] .xtr-customer-hero-card,
.tm-training-webview [data-panel="training-system"] .xtr-customer-plan-picker,
.tm-training-webview [data-panel="training-system"] .xtr-customer-day {
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(7,10,13,.065);
}
.tm-training-webview [data-panel="training-system"] .xtr-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.tm-training-webview [data-panel="training-system"] .xtr-customer-week-nav,
.tm-training-webview [data-panel="training-system"] .xtr-customer-plan-switcher {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tm-training-webview [data-panel="training-system"] .xtr-customer-week-nav::-webkit-scrollbar,
.tm-training-webview [data-panel="training-system"] .xtr-customer-plan-switcher::-webkit-scrollbar { display:none; }
.tm-training-webview [data-panel="training-system"] .xtr-btn { min-height:44px; touch-action:manipulation; }
.tm-training-webview .xtr-modal,
.tm-training-webview .xtr-submodal { padding-bottom: env(safe-area-inset-bottom); }
@media (max-width: 620px) {
  .tm-training-bridge { padding: 10px !important; }
  .tm-training-webview [data-panel="training-system"] .xtr-grid { grid-template-columns: 1fr; }
  .tm-training-webview [data-panel="training-system"] .xtr-customer-hero-card,
  .tm-training-webview [data-panel="training-system"] .xtr-customer-plan-head,
  .tm-training-webview [data-panel="training-system"] .xtr-customer-day-head { gap:12px; }
  .tm-training-webview [data-panel="training-system"] .xtr-customer-exercise { grid-template-columns: 92px minmax(0,1fr); }
  .tm-training-webview [data-panel="training-system"] .xtr-customer-exercise-media { min-height:92px; }
  .tm-training-webview [data-panel="training-system"] .xtr-calendar-grid { display:none; }
  .tm-training-webview [data-panel="training-system"] .xtr-calendar-agenda-card { margin-top:0; }
  .tm-training-webview [data-panel="training-system"] .xtr-calendar-toolbar { align-items:stretch; }
}
@media (max-width: 390px) {
  .tm-fitness-nav a { font-size:.72rem; padding-inline:3px; }
  .tm-training-webview [data-panel="training-system"] .xtr-customer-exercise { grid-template-columns: 76px minmax(0,1fr); }
}

/* ========================================================================== 
   V3.1.1 HOTFIX — SHELL V3 / CSS SELECTOR ALIGNMENT
   Allinea il markup Refactor V3 di mobile-app-view.php al foglio stile.
   ========================================================================== */

.tm-app {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.tm-app-main {
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - 44px);
  min-height: calc(100dvh - 44px);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

body.tm-app.tm-app--login .tm-app-main {
    padding-bottom: 0!important;
}

/* Topbar V3 */
.tm-app-topbar .tm-app-topbar__inner {
  width: 100%;
  height: 44px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tm-app-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
}

.tm-app-brand .logo-icon-app {
  width: 34px !important;
  height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  flex: 0 0 34px;
  display: block;
  object-fit: contain;
  border-radius: 50%;
}

.tm-app-brand__copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #fff;
  line-height: 1;
}

.tm-app-brand__copy strong {
  font-size: .86rem;
  font-weight: 800;
  letter-spacing: .45px;
}

.tm-app-brand__copy small {
  color: rgba(255,255,255,.72);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .9px;
}

.tm-app-menu-toggle {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 4px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 9px;
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
}

.tm-app-menu-toggle .icon-toggle-menu {
  width: 24px !important;
  height: 24px !important;
  display: block;
  fill: #fff !important;
}
.tm-app-menu-toggle .icon-toggle-menu path { fill: #fff !important; }

.tm-drawer-user {
  margin-bottom: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  color: #fff;
}
.tm-drawer-user img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #202226;
}
.tm-drawer-user span,
.tm-drawer-user strong { display:block; }
.tm-drawer-user span { color:#9ea3aa; font-size:.72rem; }
.tm-drawer-user strong { margin-top:2px; font-size:.92rem; font-weight:750; }

.tm-app-drawer-backdrop {
  position: fixed;
  inset: 44px 0 0;
  z-index: 9998;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(0,0,0,.42);
  transition: opacity .25s var(--tm-ease), visibility .25s var(--tm-ease);
}
body.tm-app-drawer-open .tm-app-drawer-backdrop {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Generic screen headings V3 */
.tm-app-kicker {
  display: inline-block;
  color: var(--tm-red);
  font-size: .68rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 1.05px;
  text-transform: uppercase;
}

.tm-section-header,
.tm-app-screen-head {
  width: min(calc(100% - 24px), 760px);
  margin: 0 auto;
}

.tm-section-header {
  min-height: 108px;
  padding: 24px 4px 16px;
  color: #fff;
}
.tm-section-header--with-icon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tm-section-header h1,
.tm-app-screen-head h1 {
  margin: 5px 0 0;
  font-size: clamp(1.55rem, 7vw, 2.1rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.65px;
}
.tm-section-header__icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(244,11,16,.14);
  color: var(--tm-red);
}
.tm-section-header__icon svg { width:25px; height:25px; fill:currentColor; }

/* Home V3 */
.tm-app-dashboard {
  min-height: calc(100vh - 44px);
  min-height: calc(100dvh - 44px);
  padding: 0 12px 32px;
  background:
    radial-gradient(circle at 94% 6%, rgba(244,11,16,.16), transparent 27%),
    linear-gradient(180deg, #090a0b 0 215px, var(--tm-bg) 215px);
}
.tm-app-screen-head {
  padding: 28px 2px 30px;
  color: #fff;
}
.tm-app-screen-head p {
  margin: 8px 0 0;
  color: rgba(255,255,255,.68);
  font-size: .94rem;
  line-height: 1.45;
}
.tm-home-grid {
  width: min(100%, 760px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 13px;
}
.tm-home-card {
  min-width: 0;
  min-height: 176px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--tm-line);
  border-radius: 20px;
  background: #fff;
  color: var(--tm-text);
  text-decoration: none;
  box-shadow: var(--tm-shadow-card);
}
.tm-home-card--hero {
  grid-column: 1 / -1;
  min-height: 205px;
  background: linear-gradient(135deg, #0b0c0e, #1b1d21);
  color: #fff;
  border-color: rgba(255,255,255,.08);
}
.tm-home-card__icon {
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--tm-red-soft);
  color: var(--tm-red);
}
.tm-home-card--hero .tm-home-card__icon { background:var(--tm-red); color:#fff; }
.tm-home-card__icon svg { width:24px; height:24px; fill:currentColor; }
.tm-home-card > span {
  color: var(--tm-red);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.tm-home-card > strong {
  margin-top: 4px;
  font-size: 1.08rem;
  line-height: 1.18;
  font-weight: 800;
}
.tm-home-card > small {
  margin-top: 7px;
  color: var(--tm-muted);
  font-size: .82rem;
  line-height: 1.42;
}
.tm-home-card--hero > small { max-width:520px; color:rgba(255,255,255,.64); }
.tm-home-card > b {
  margin-top: auto;
  padding-top: 16px;
  color: var(--tm-red);
  font-size: .82rem;
  font-weight: 800;
}

/* Login V3 extra */
.login-brandmark {
  margin-bottom: 16px;
  color: rgba(255,255,255,.12);
  font-size: 4rem;
  line-height: .8;
  font-weight: 900;
  letter-spacing: -4px;
}
.input-group label {
  margin: 0 0 6px 3px;
  display: block;
  color: #5f646b;
  font-size: .78rem;
  font-weight: 700;
  text-align: left;
}

/* Fitness shell V3 */
.tm-workout-view.tm-training-webview {
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
.tm-training-webview .tm-section-header {
  width: min(calc(100% - 24px), 760px);
}

/* Chat V3 details */
.tm-chat-avatar-brand {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: .78rem;
  font-weight: 850;
}
.tm-chat-empty {
  width: min(calc(100% - 28px), 390px);
  margin: auto;
  padding: 34px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-radius: 20px;
  border: 1px solid var(--tm-line);
  background: #fff;
  color: var(--tm-text);
  text-align: center;
  box-shadow: var(--tm-shadow-soft);
}
.tm-chat-empty svg { width:34px; height:34px; fill:var(--tm-red); }
.tm-chat-empty p { margin:0; color:var(--tm-muted); font-size:.9rem; line-height:1.45; }

/* Bottom navigation V3 */
.tm-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0!important;
  z-index: 1000;
  min-height: 62px;
  padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 2px;
  background: rgba(8,9,10,.97);
  border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 -9px 28px rgba(0,0,0,.13);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.tm-bottom-nav > a {
  min-width: 0;
  min-height: 48px;
  padding: 5px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 10px;
  color: #979ca3;
  font-size: .61rem;
  line-height: 1;
  font-weight: 700;
  text-decoration: none;
}
.tm-bottom-nav > a svg {
  width: 21px;
  height: 21px;
  display:block;
  fill: currentColor;
}
.tm-bottom-nav > a.active { color: var(--tm-red); background:rgba(244,11,16,.08); }

@media (max-width: 500px) {
  .tm-app-topbar .tm-app-topbar__inner { padding-inline:10px; }
  .tm-home-grid { grid-template-columns:1fr; }
  .tm-home-card--hero { grid-column:auto; }
  .tm-home-card { min-height:160px; }
  .tm-section-header,
  .tm-app-screen-head { width:100%; }
  .tm-bottom-nav > a { font-size:.58rem; }
}

/* ========================================================================== 
   V3.1.2 HOTFIX — SECTION HEADER / DRAWER ICONS / ACCOUNT PROFILE
   Corregge regressioni responsive della shell senza toccare Training System.
   ========================================================================== */

/* 1) Un solo standard visivo per gli header di sezione */
.tm-app .tm-section-header,
.tm-app .tm-training-webview .tm-section-header {
  width: min(calc(100% - 24px), 760px) !important;
  min-height: 108px !important;
  margin: 0 auto !important;
  padding: 24px 4px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  overflow: visible !important;
  color: #fff !important;
}
.tm-app .tm-section-header > div {
  min-width: 0;
  flex: 1 1 auto;
}
.tm-app .tm-section-header .tm-app-kicker {
  margin: 0 !important;
  display: block !important;
  line-height: 1.15 !important;
}
.tm-app .tm-section-header h1 {
  margin: 6px 0 0 !important;
  padding: 0 0 2px !important;
  max-width: 100%;
  overflow: visible !important;
  color: #fff !important;
  font-size: clamp(1.55rem, 7vw, 2.1rem) !important;
  line-height: 1.08 !important;
  font-weight: 800 !important;
  letter-spacing: -.65px !important;
  white-space: normal;
  text-wrap: balance;
}
.tm-app .tm-section-header__icon {
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 14px !important;
  background: rgba(244,11,16,.14) !important;
  color: var(--tm-red) !important;
}
.tm-app .tm-section-header__icon svg {
  width: 25px !important;
  height: 25px !important;
  display: block !important;
  fill: currentColor !important;
}

/* 2) Drawer: SVG sempre compatti e coerenti con i touch target */
.tm-app .slide-right-panel .mini-menu-btn {
  min-height: 50px !important;
  padding: 11px 13px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  overflow: hidden;
}
.tm-app .slide-right-panel .mini-menu-btn svg {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  flex: 0 0 22px !important;
  display: block !important;
  fill: currentColor !important;
}
.tm-app .slide-right-panel .mini-menu-btn > span {
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.2;
}
.tm-app .slide-right-panel .mini-menu-btn.active,
.tm-app .slide-right-panel .mini-top-menu li.active .mini-menu-btn {
  background: rgba(244,11,16,.12) !important;
  color: #fff !important;
  border-color: rgba(244,11,16,.22) !important;
}
.tm-app .slide-right-panel .mini-menu-btn--logout {
  color: #ff5d61 !important;
}
.tm-app .slide-right-panel .mini-menu-btn--logout svg {
  fill: currentColor !important;
}

/* 3) Profilo: cover in flow + avatar 1:1 reale, senza sovrapposizioni */
.tm-app--account .account-bg {
  background:
    linear-gradient(180deg, #090a0b 0 230px, transparent 230px),
    var(--tm-bg) !important;
}
.tm-app--account .account-profile-cover {
  position: relative !important;
  inset: auto !important;
  width: min(calc(100% - 24px), 430px) !important;
  max-width: 430px !important;
  height: 148px !important;
  margin: 0 auto !important;
  display: block !important;
  overflow: hidden !important;
  border-radius: 24px 24px 0 0 !important;
  background-color: #090a0b !important;
  background-image:
    linear-gradient(120deg, rgba(0,0,0,.18), rgba(244,11,16,.12)),
    var(--tm-profile-cover) !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: cover !important;
  box-shadow: 0 14px 34px rgba(5,7,9,.14);
}
.tm-app--account .account-profile-card {
  width: min(calc(100% - 24px), 430px) !important;
  max-width: 430px !important;
  margin: 0 auto 15px !important;
  padding: 0 18px 17px !important;
  overflow: visible !important;
  border-radius: 0 0 24px 24px !important;
  border-top: 0 !important;
}
.tm-app--account .account-avatar-area {
  width: 102px !important;
  height: 102px !important;
  aspect-ratio: 1 / 1 !important;
  flex: 0 0 102px !important;
  margin: -51px auto 7px !important;
  position: relative !important;
  z-index: 3 !important;
}
.tm-app--account .account-avatar {
  width: 94px !important;
  height: 94px !important;
  min-width: 94px !important;
  min-height: 94px !important;
  max-width: 94px !important;
  max-height: 94px !important;
  aspect-ratio: 1 / 1 !important;
  flex: 0 0 94px !important;
  display: block !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  object-position: center center !important;
}
.tm-app--account .account-avatar-btn {
  position: absolute !important;
  right: 1px !important;
  bottom: 4px !important;
}

@media (max-width: 500px) {
  .tm-app .tm-section-header,
  .tm-app .tm-training-webview .tm-section-header {
    width: calc(100% - 24px) !important;
    min-height: 104px !important;
    padding: 20px 2px 15px !important;
    gap: 12px !important;
  }
  .tm-app .tm-section-header h1 {
    font-size: clamp(1.45rem, 7.2vw, 1.9rem) !important;
  }
  .tm-app .tm-section-header__icon {
    width: 42px !important;
    height: 42px !important;
    flex-basis: 42px !important;
  }
  .tm-app--account .account-profile-cover {
    width: calc(100% - 24px) !important;
    height: 138px !important;
  }
  .tm-app--account .account-profile-card {
    width: calc(100% - 24px) !important;
    padding-inline: 15px !important;
  }
}
