:root {
  --red: #e11b22;
  --green: #22c55e;
  --yellow: #f59e0b;
  --bg: #0d0d0d;
  --panel: #1a1a1a;
  --panel-2: #101010;
  --border: #2a2a2a;
  --text: #f7f7f7;
  --muted: #888;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --app-max-width: 430px;
  --bottom-nav-base: 61px;
  --bottom-nav-total: calc(var(--bottom-nav-base) + var(--safe-bottom));
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html {
  width: 100%;
  min-height: 100%;
  background: #050505;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: #050505;
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  overflow-x: hidden;
  padding: 0 var(--safe-right) 0 var(--safe-left);
}

.auth-screen {
  width: min(100%, var(--app-max-width));
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 28px 18px;
  background: var(--bg);
}

.app-fatal-error {
  width: min(100%, var(--app-max-width));
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 28px 18px;
  background: var(--bg);
  color: var(--text);
}

.app-fatal-error pre {
  max-height: 48dvh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(100%, var(--app-max-width));
  max-width: var(--app-max-width);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  border-left: 1px solid #151515;
  border-right: 1px solid #151515;
  overflow-x: hidden;
}

.screen {
  padding: 16px clamp(12px, 4vw, 16px) calc(var(--bottom-nav-total) + 30px);
  max-width: 100%;
  overflow-x: hidden;
}

.screen > * {
  max-width: 100%;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: calc(70px + var(--safe-top));
  padding: calc(8px + var(--safe-top)) 10px 8px 8px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  overflow: visible;
}

.brand {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 auto;
  height: 52px;
  min-width: 0;
  overflow: visible;
}

.brand-logo {
  display: block;
  width: 172px;
  max-width: 42vw;
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
  transform: translate(2px, 4px) scale(1.8);
  transform-origin: left center;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  padding: 6px 8px;
}

.rat-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.rat-icon-btn {
  width: 45px;
  height: 45px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
}

.top-rat-icon {
  width: 29px;
  height: 29px;
  border-radius: 9px;
}

.top-clean-btn {
  position: relative;
  background: transparent;
  border: 0;
}

.top-global-search {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  padding: 0;
}

.topbar-menu-button {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(225, 27, 34, .32);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(225, 27, 34, .14), rgba(255, 255, 255, .035));
  color: #fff;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025);
}

.topbar-menu-button.open,
.topbar-menu-button:active {
  border-color: rgba(225, 27, 34, .72);
  background: rgba(225, 27, 34, .2);
}

.top-menu-lines {
  width: 17px;
  display: grid;
  gap: 4px;
}

.top-menu-lines i {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 8px rgba(255, 255, 255, .12);
}

.topbar-menu-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 10px rgba(225, 27, 34, .65);
}

.topbar-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 11;
  background: transparent;
}

.topbar-menu-panel {
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  right: 10px;
  width: min(316px, calc(100% - 20px));
  max-width: calc(100vw - 28px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 78px);
  overflow-y: auto;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(30, 30, 30, .98), rgba(11, 11, 11, .98));
  border: 1px solid rgba(225, 27, 34, .38);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .58), inset 0 0 0 1px rgba(255, 255, 255, .035);
}

.topbar-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, .62);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.topbar-menu-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.topbar-menu-xp .top-level-chip {
  width: 100%;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "level bar missing";
  min-height: 48px;
  border-radius: 14px;
  padding: 10px 12px;
}

.topbar-menu-xp .top-level-chip strong {
  font-size: 13px;
}

.topbar-menu-xp .top-level-chip em {
  font-size: 10px;
}

.topbar-menu-section {
  width: 100%;
  margin-top: 12px;
}

.topbar-menu-section-label {
  display: block;
  margin: 0 4px 6px;
  color: rgba(255, 255, 255, .42);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.topbar-menu-list,
.topbar-menu-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.topbar-menu-list {
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid rgba(255, 255, 255, .06);
}

.topbar-menu-item {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 13px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}

.topbar-menu-list .topbar-menu-item {
  border-color: transparent;
  background: transparent;
}

.topbar-menu-item:hover {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .12);
}

.topbar-menu-item:active {
  background: rgba(255, 255, 255, .1);
}

.topbar-menu-item-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(225, 27, 34, .14);
}

.topbar-menu-item-text {
  min-width: 0;
}

.topbar-menu-item-text strong,
.topbar-menu-item-text small {
  display: block;
}

.topbar-menu-item-text strong {
  font-size: 12.5px;
  font-weight: 800;
}

.topbar-menu-item-text small {
  margin-top: 2px;
  color: rgba(255, 255, 255, .54);
  font-size: 10.5px;
}

.topbar-menu-count {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.topbar-menu-chevron {
  color: rgba(255, 255, 255, .32);
  font-size: 18px;
  font-weight: 700;
  padding-right: 4px;
}

.top-menu-icon {
  width: 24px;
  height: 24px;
}

.top-menu-at {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(225, 27, 34, .44);
  color: #fff;
  font-size: 16px;
  font-weight: 950;
}

.global-search-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-badge,
.top-mention-badge {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.top-badge {
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
}

.top-mention-badge {
  right: -2px;
  bottom: 1px;
  width: 16px;
  height: 16px;
  font-size: 9px;
}

.top-white-icon {
  width: 33px;
  height: 33px;
  opacity: 0.95;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.08));
}

.logout-btn {
  min-height: 30px;
  border: 1px solid rgba(225, 27, 34, 0.55);
  border-radius: 9px;
  background: rgba(225, 27, 34, 0.12);
  color: #fff;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
}

.login {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: calc(24px + var(--safe-top)) 16px 32px;
}

.logo {
  display: grid;
  place-items: center;
  min-height: 96px;
}

.login-logo {
  width: 180px;
  max-width: 64vw;
  object-fit: contain;
}

.auth-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(225, 27, 34, 0.28);
  background: linear-gradient(180deg, #181818, #101010);
}

.auth-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 2px;
}

.auth-tabs button,
.auth-link-btn {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 900;
}

.auth-tabs button {
  border: 1px solid var(--border);
  background: #0b0b0b;
  color: var(--muted);
}

.auth-tabs button.active {
  border-color: rgba(225, 27, 34, 0.72);
  background: rgba(225, 27, 34, 0.18);
  color: #fff;
}

.auth-link-btn {
  border: 0;
  background: transparent;
  color: #d7d7d7;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-grid .full,
.auth-card .full {
  grid-column: 1 / -1;
}

.field-error {
  display: block;
  margin-top: 5px;
  color: #ff696f;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.auth-message {
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.1);
  color: #dfffe9;
  padding: 10px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.auth-message.warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #ffe8bd;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, var(--app-max-width));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 7px 0 calc(9px + var(--safe-bottom));
  min-height: var(--bottom-nav-total);
  z-index: 75;
}

.bottom-nav button {
  position: relative;
  background: transparent;
  border: 0;
  color: white;
  font-size: 24px;
  display: grid;
  place-items: center;
  min-height: 45px;
  line-height: 1;
  opacity: 0.72;
}

.bottom-nav button.active {
  color: white;
  font-weight: 700;
  opacity: 1;
}

.bottom-nav-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: 24px;
  filter: grayscale(0.25);
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.bottom-nav-home-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 0;
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.bottom-nav-app-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.08));
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.bottom-nav button.active .bottom-nav-icon,
.bottom-nav button.active .bottom-nav-home-icon,
.bottom-nav button.active .bottom-nav-app-icon {
  transform: translateY(-1px) scale(1.08);
  filter: drop-shadow(0 0 8px rgba(225, 27, 34, 0.38));
  opacity: 1;
}

.bottom-nav button.active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--red);
}

.topbar > div,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.top-messages {
  position: relative;
}

.top-messages .top-white-icon {
  width: 24px;
  height: 24px;
}

.top-streak {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 48px;
  color: white;
  font-size: 14px;
  font-weight: 900;
  padding-inline: 3px;
}

.top-streak .top-white-icon {
  width: 27px;
  height: 27px;
}

.top-level-chip {
  display: grid;
  grid-template-columns: auto 44px;
  grid-template-areas:
    "level missing"
    "bar bar";
  align-items: center;
  gap: 2px 6px;
  width: 92px;
  min-height: 36px;
  border: 1px solid rgba(225, 27, 34, .42);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(225, 27, 34, .18), rgba(255, 255, 255, .035));
  color: #fff;
  padding: 5px 7px;
}

.top-level-chip strong {
  grid-area: level;
  font-size: 11px;
  line-height: 1;
}

.top-level-chip > span {
  grid-area: bar;
}

.top-level-chip em {
  grid-area: missing;
  color: rgba(255, 255, 255, .62);
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.rpg-xp-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}

.rpg-xp-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e11b22, #ff4b55, #ffffff);
  box-shadow: 0 0 10px rgba(225, 27, 34, .35);
}

.notification-item {
  align-items: flex-start;
  justify-content: flex-start;
}

.notification-item img {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
}

.notification-item p {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.35;
}

.login {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: calc(24px + var(--safe-top)) calc(24px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(24px + var(--safe-left));
}

.logo {
  text-align: center;
}

.login-logo {
  display: block;
  width: min(100%, 320px);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.rat-logo {
  display: block;
  width: min(100%, 250px);
  height: auto;
  object-fit: contain;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.hero-card {
  border: 2px solid var(--red);
  text-align: center;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.field select:focus,
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(225, 27, 34, 0.58);
  box-shadow: 0 0 0 3px rgba(225, 27, 34, 0.12);
}

.field textarea {
  min-height: 72px;
  resize: vertical;
}

.primary {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  background: var(--red);
  color: white;
  font-weight: 800;
  font-size: 12px;
}

.secondary {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

.rat-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.rat-header h1 {
  color: var(--red);
  margin: 0;
  font-size: 24px;
  font-weight: 950;
}

.muted {
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.tabs button {
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
}

.tabs button.active {
  background: var(--red);
  border-color: var(--red);
  color: white;
  font-weight: 800;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  text-align: center;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  color: var(--red);
  font-size: 24px;
  margin-top: 4px;
}

.home-screen {
  position: relative;
}

.home-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.home-tabs button {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  font-weight: 900;
  padding: 5px;
  overflow: hidden;
}

.home-tabs button.active {
  border-color: transparent;
  background: rgba(225, 27, 34, 0.12);
  color: var(--red);
}

.home-tab-icon {
  width: 30px;
  height: 30px;
  border-radius: 0;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.08));
  transition: transform 0.18s ease, filter 0.18s ease;
}

.home-tabs button.active .home-tab-icon {
  transform: scale(1.08);
  filter: drop-shadow(0 0 8px rgba(225, 27, 34, 0.35));
}

.home-white-icon {
  opacity: 0.95;
}

.home-today-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.home-mini-card,
.home-goals-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  min-width: 0;
}

.home-mini-card strong,
.home-goals-card strong {
  color: var(--text);
  font-size: 14px;
}

.home-mini-card p,
.home-goals-card p {
  margin: 6px 0;
  font-size: 12px;
  line-height: 1.35;
}

.home-mini-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.home-goal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.home-goal-grid .stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 9px 6px;
}

.home-goal-grid .stat strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.home-level-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.home-level-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #ffcf5a);
}

.home-feed {
  padding-bottom: calc(var(--bottom-nav-total) + 20px);
}

.home-post {
  margin-bottom: 12px;
}

.home-quick-add {
  position: fixed;
  left: calc(50% + 145px);
  bottom: calc(var(--bottom-nav-total) + 18px);
  z-index: 65;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: white;
  box-shadow: 0 12px 35px rgba(225, 27, 34, 0.35);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
}

.quick-add-icon {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  clip-path: circle(50% at 50% 50%);
}

.quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}

.quick-action-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.home-streak-big {
  color: #ffcf5a;
  font-size: 48px;
  font-weight: 950;
  text-align: center;
}

.home-meal-list {
  display: grid;
  gap: 8px;
}

.home-meal-choice {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px;
}

.home-meal-choice.near {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(225, 27, 34, 0.14);
}

.home-meal-choice span {
  display: grid;
  gap: 3px;
}

.home-meal-choice small {
  color: var(--muted);
  font-size: 11px;
}

.home-groups-panel {
  gap: 12px;
}

.home-group-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  padding: 0 15px;
  font-size: 12px;
  font-weight: 700;
}

.home-group-search input:focus {
  outline: none;
  border-color: rgba(225, 27, 34, 0.6);
  box-shadow: 0 0 0 3px rgba(225, 27, 34, 0.12);
}

.home-group-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}

.home-group-chip {
  flex: 0 0 76px;
  display: grid;
  justify-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 6px 4px;
}

.home-group-chip span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  font-size: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.home-group-chip small {
  width: 100%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.home-group-chip.active span {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 27, 34, 0.16);
}

.home-group-chip.active small {
  color: var(--text);
}

.home-group-selected {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 11px 12px;
}

.home-group-selected strong {
  display: inline-block;
  margin-right: 6px;
}

.home-group-selected small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.home-group-no-results {
  flex: 0 0 100%;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
  text-align: center;
  font-size: 12px;
}

.social-home,
.social-ratos,
.social-profile {
  gap: 12px;
}

.social-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  padding: 0 15px;
  font-size: 12px;
  font-weight: 700;
}

.social-stories {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.social-stories::-webkit-scrollbar {
  display: none;
}

.social-story {
  flex: 0 0 68px;
  display: grid;
  justify-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
}

.social-story span {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 999px;
  background: var(--panel);
  color: var(--red);
  font-size: 24px;
  font-weight: 950;
  overflow: hidden;
}

.social-story span img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-story small {
  width: 68px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-story.seen span {
  border-color: #444;
}

.social-story.live span {
  animation: ratPulse 1.4s infinite;
}

@keyframes ratPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 27, 34, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(225, 27, 34, 0.05); }
}

.social-feed-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.social-feed-tabs::-webkit-scrollbar {
  display: none;
}

.social-feed-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 900;
}

.social-feed-tabs button.active {
  border-color: var(--red);
  background: rgba(225, 27, 34, 0.14);
  color: var(--text);
}

.social-feed {
  display: grid;
  gap: 14px;
  padding-bottom: 78px;
}

.social-post {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.social-post header {
  display: grid;
  grid-template-columns: 42px 1fr auto auto;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
}

.social-avatar {
  width: 40px;
  height: 40px;
  border: 1px solid var(--red);
  border-radius: 999px;
  background: #111;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
}

.social-post header strong {
  display: block;
  font-size: 13px;
}

.social-post header small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.social-post-manage {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: -2px;
  line-height: 1;
  padding-right: 4px;
}

.social-post-manage:hover,
.social-post-manage:focus-visible {
  border-color: rgba(237, 28, 36, 0.48);
  background: rgba(237, 28, 36, 0.13);
  color: #fff;
  outline: none;
}

.social-post-media {
  background: #060606;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.social-post-media img,
.social-post-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-video {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--red);
  font-size: 26px;
  font-weight: 950;
}

.social-post-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 12px 0;
}

.social-post-meta span {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 7px 5px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.social-post-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: clamp(8px, 3vw, 18px);
  padding: 11px 14px 6px;
}

.social-post-actions button {
  width: 100%;
  min-width: 42px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 0;
  line-height: 1;
  padding: 0 3px;
  overflow: visible;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.social-post-actions button:hover,
.social-post-actions button:focus-visible {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.social-post-actions button:active {
  transform: scale(.94);
}

.social-post-actions button.active {
  color: var(--red);
  background: rgba(237, 28, 36, 0.08);
  border-color: rgba(237, 28, 36, 0.24);
}

.social-post-actions svg {
  display: block;
  width: 22px;
  height: 22px;
  overflow: visible;
  filter: drop-shadow(0 0 0 transparent);
}

.social-post-actions button:first-child svg {
  width: 21px;
  height: 21px;
}

.social-post-actions button:nth-child(3) svg {
  width: 24px;
  height: 24px;
  transform: translateX(1px) rotate(-2deg);
}

.social-post-actions button:last-child svg {
  width: 22px;
  height: 22px;
}

.social-post-bottom {
  padding: 0 12px 13px;
}

.social-post-bottom strong,
.social-post-bottom p,
.social-post-bottom small {
  display: block;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.social-post-bottom small {
  color: var(--muted);
  font-size: 11px;
}

.social-comments-count {
  width: fit-content;
  min-height: 24px;
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  padding: 0;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.social-comments-count:hover,
.social-comments-count:focus-visible {
  color: #fff;
  text-decoration: underline;
  outline: none;
}

.social-comments {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background:
    radial-gradient(circle at right top, rgba(225, 27, 34, 0.08), transparent 42%),
    rgba(0, 0, 0, 0.22);
}

.social-comments-toggle {
  width: auto;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.68);
  padding: 0 11px;
  font-size: 11px;
  font-weight: 900;
}

.social-comments-list {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.social-comments-backdrop {
  align-items: flex-end;
  padding: 16px;
}

.social-comments-panel {
  width: min(100%, 430px);
  max-height: min(76vh, 620px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(225, 27, 34, 0.42);
  background:
    radial-gradient(circle at 14% 0%, rgba(225, 27, 34, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(24, 24, 24, 0.98), rgba(9, 9, 9, 0.98));
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.58);
}

.social-comments-panel-head {
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.social-comments-panel-head h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}

.social-comments-panel-head small {
  display: -webkit-box;
  max-width: 250px;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.social-comments-panel-list {
  min-height: 110px;
  overflow-y: auto;
  padding-right: 2px;
}

.social-post-edit-backdrop {
  align-items: center;
  padding: 18px;
}

.social-post-edit-panel {
  width: min(100%, 520px);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  padding: 15px;
  border: 1px solid rgba(225, 27, 34, 0.46);
  background:
    radial-gradient(circle at 16% 0%, rgba(225, 27, 34, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(24, 24, 24, 0.99), rgba(9, 9, 9, 0.99));
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.62);
}

.social-post-edit-head {
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.social-post-edit-head strong {
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}

.social-post-edit-head p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
}

.social-post-edit-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.social-post-edit-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.social-post-edit-actions .danger {
  min-height: 42px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.09);
  color: #fecaca;
  font-weight: 950;
}

.social-post-edit-actions .secondary {
  min-height: 42px;
}

.profile-archive-vault {
  border-color: rgba(225, 27, 34, 0.28);
  background:
    radial-gradient(circle at 0% 0%, rgba(225, 27, 34, 0.14), transparent 32%),
    var(--panel);
}

.profile-archive-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.profile-archive-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.profile-archive-item > button:first-child {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(225, 27, 34, 0.35);
  border-radius: 10px;
  background: #080808;
  color: var(--red);
  font-size: 20px;
}

.profile-archive-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-archive-item strong,
.profile-archive-item small,
.profile-archive-item em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-archive-item strong {
  color: #fff;
  font-size: 12px;
}

.profile-archive-item small,
.profile-archive-item em {
  color: rgba(255, 255, 255, 0.54);
  font-size: 10px;
  font-style: normal;
  margin-top: 2px;
}

@media (max-width: 520px) {
  .social-post-edit-actions {
    grid-template-columns: 1fr;
  }

  .profile-archive-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .profile-archive-item .pill {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.social-comment-form-floating {
  margin-top: 0;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.social-comment {
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.social-comment.reply {
  margin-left: 22px;
  padding-left: 10px;
  border-left: 2px solid rgba(225, 27, 34, 0.34);
}

.social-comment-main {
  display: grid;
  grid-template-columns: auto 1fr 28px;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.social-comment-main strong {
  font-size: 12px;
  font-weight: 950;
  color: #fff;
}

.social-comment-main span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.social-comment-main button,
.social-comment-tools button {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
}

.social-comment-main button.active {
  color: var(--red);
  background: rgba(225, 27, 34, 0.1);
  border-color: rgba(225, 27, 34, 0.2);
}

.social-comment-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
}

.social-comment-tools small {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 800;
}

.social-comment-form,
.social-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-top: 10px;
}

.social-comment-form input,
.social-reply-form input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: #0b0b0b;
  color: #fff;
  caret-color: var(--red);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 800;
  outline: none;
}

.social-comment-form input::placeholder,
.social-reply-form input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.social-comment-form input:focus,
.social-reply-form input:focus {
  border-color: rgba(225, 27, 34, 0.7);
  box-shadow: 0 0 0 3px rgba(225, 27, 34, 0.14);
}

.social-comment-form button,
.social-reply-form button {
  width: auto;
  min-width: 74px;
  min-height: 38px;
  border: 1px solid rgba(225, 27, 34, 0.62);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--red), #b8131a);
  color: #fff;
  padding: 0 13px;
  font-size: 11px;
  font-weight: 950;
}

.social-share-sheet {
  max-height: min(520px, 86vh);
}

.social-share-list {
  display: grid;
  gap: 8px;
}

.social-share-list button {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.social-share-list span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0a0a0a;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.social-share-list strong,
.social-share-list small {
  display: block;
}

.social-share-list small {
  color: var(--muted);
  margin-top: 2px;
  font-size: 11px;
}

.social-reel-screen {
  position: relative;
  min-height: calc(100vh - 142px);
  padding: 0;
  overflow: hidden;
  background: #050505;
}

.social-reel-back {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 20px;
  font-weight: 950;
  backdrop-filter: blur(12px);
}

.social-reel-post {
  position: relative;
  min-height: calc(100vh - 142px);
  overflow: hidden;
  background: #000;
}

.social-reel-media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
}

.social-reel-media > img,
.social-reel-media > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-reel-art {
  width: 100%;
  min-height: 100%;
  border-radius: 0;
}

.social-reel-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding: 66px 14px calc(22px + var(--safe-bottom));
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.62), transparent 26%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.82), transparent 58%);
  pointer-events: none;
}

.social-reel-overlay > * {
  pointer-events: auto;
}

.social-reel-overlay header {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 64px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}

.social-reel-overlay header > div {
  min-width: 0;
}

.social-reel-overlay header strong,
.social-reel-overlay header small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-reel-title h2 {
  max-width: 92%;
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 12vw, 58px);
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.72);
}

.social-reel-title p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.35;
}

.social-reel-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.social-reel-actions {
  justify-content: space-between;
  padding: 6px 2px;
}

.social-reel-actions button {
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

.social-reel-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: #fff;
  font-size: 12px;
}

.social-reel-footer button {
  width: auto;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  padding: 0;
  font-size: 12px;
  font-weight: 900;
}

.social-reel-footer small {
  flex-basis: 100%;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.chat-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: min(100%, var(--app-max-width));
  margin: 0 auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  background: #070707;
  color: #fff;
  overflow: hidden;
}

.chat-header {
  min-height: calc(64px + var(--safe-top));
  display: grid;
  grid-template-columns: 38px 44px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: calc(10px + var(--safe-top)) 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 18, 18, 0.98);
}

.chat-header.thread {
  grid-template-columns: 34px 38px 1fr auto;
}

.chat-header.thread + .chat-thread {
  grid-row: 2 / 5;
}

.chat-header > button,
.chat-header nav button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.chat-header img {
  width: 52px;
  height: 28px;
  object-fit: contain;
}

.chat-header strong {
  display: block;
  font-size: 16px;
}

.chat-header small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.chat-header nav {
  display: flex;
  gap: 4px;
}

.chat-search {
  padding: 10px 12px 8px;
  background: #070707;
}

.chat-search input {
  width: 100%;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #151515;
  color: #fff;
  padding: 0 14px;
  font-size: 13px;
}

.chat-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 12px 10px;
  background: #070707;
}

.chat-tabs button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #141414;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.chat-tabs button.active {
  color: #fff;
  border-color: rgba(225, 27, 34, 0.55);
  background: rgba(225, 27, 34, 0.12);
}

.chat-list {
  overflow-y: auto;
  padding: 2px 8px 18px;
}

.chat-row {
  width: 100%;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #fff;
  padding: 10px 6px;
  text-align: left;
}

.chat-row:active {
  background: rgba(255, 255, 255, 0.05);
}

.chat-avatar,
.chat-mini-avatar {
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(225, 27, 34, 0.55);
  background: #101010;
  color: #fff;
  font-weight: 950;
}

.chat-avatar {
  width: 48px;
  height: 48px;
  font-size: 13px;
}

.chat-avatar.small {
  width: 36px;
  height: 36px;
}

.chat-mini-avatar {
  width: 24px;
  height: 24px;
  align-self: end;
  font-size: 9px;
}

.chat-row-main strong {
  display: block;
  font-size: 14px;
  color: #f5f5f5;
}

.chat-row-main small {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.chat-row.unread .chat-row-main strong,
.chat-row.unread .chat-row-main small {
  color: #fff;
  font-weight: 900;
}

.chat-row-side {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.chat-row-badges {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.chat-row-side small {
  color: var(--muted);
  font-size: 10px;
}

.chat-row-side em,
.chat-row-side i {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  padding: 0 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.chat-row-side i {
  min-width: 20px;
  background: rgba(225, 27, 34, .18);
  border: 1px solid rgba(225, 27, 34, .58);
}

.chat-thread {
  grid-row: 2 / 4;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 14px 10px calc(86px + var(--safe-bottom));
  background: radial-gradient(circle at top, rgba(225,27,34,.06), transparent 32%), #070707;
}

.chat-message {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 7px;
  max-width: 88%;
  margin-bottom: 4px;
}

.chat-message.mine {
  align-self: end;
  grid-template-columns: minmax(0, 1fr);
}

.chat-message.theirs {
  align-self: start;
}

.chat-message.grouped .chat-mini-avatar {
  visibility: hidden;
}

.chat-bubble {
  position: relative;
  border-radius: 18px;
  padding: 9px 11px 8px;
  background: #1b1b1b;
  color: #fff;
}

.chat-message.mine .chat-bubble {
  background: rgba(225, 27, 34, 0.42);
  border: 1px solid rgba(225, 27, 34, 0.25);
}

.chat-bubble p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.chat-bubble strong {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  color: #fff;
}

.chat-bubble small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  text-align: right;
}

.chat-bubble button {
  width: auto;
  min-height: 28px;
  margin-top: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
}

.chat-post-link-card {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100% !important;
  min-width: 210px;
  min-height: 58px !important;
  margin-top: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 15px !important;
  background:
    radial-gradient(circle at 15% 0%, rgba(225, 27, 34, 0.2), transparent 38%),
    rgba(0, 0, 0, 0.34) !important;
  color: #fff !important;
  padding: 8px !important;
  text-align: left;
}

.chat-post-link-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(225, 27, 34, 0.5);
  border-radius: 11px;
  background: rgba(225, 27, 34, 0.12);
  font-size: 15px;
}

.chat-post-link-copy {
  min-width: 0;
}

.chat-post-link-copy strong {
  display: block;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-post-link-copy small {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.56);
  text-align: left;
}

.chat-post-link-card em {
  align-self: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.76);
  padding: 5px 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.chat-reactions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: fit-content;
  margin-top: 7px;
  margin-bottom: -2px;
  border-radius: 999px;
  background: #111;
  border: 1px solid rgba(255,255,255,.1);
  padding: 2px 7px;
  font-size: 12px;
  line-height: 1.2;
}

.chat-message.mine .chat-reactions {
  margin-left: auto;
}

.chat-react-trigger {
  position: absolute;
  left: calc(100% + 5px);
  top: 50%;
  transform: translateY(-50%);
  width: 24px !important;
  height: 24px;
  min-height: 24px !important;
  display: grid;
  place-items: center;
  margin: 0 !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  background: #111 !important;
  color: rgba(255,255,255,.72) !important;
  padding: 0 !important;
  font-size: 14px !important;
  opacity: .78;
}

.chat-react-trigger:active {
  transform: translateY(-50%) scale(.94);
}

.chat-reaction-picker {
  position: absolute;
  left: 8px;
  bottom: calc(100% + 8px);
  z-index: 4;
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(18,18,18,.98);
  box-shadow: 0 10px 30px rgba(0,0,0,.42);
}

.chat-reaction-picker button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 17px;
}

.chat-reaction-picker button:active {
  transform: scale(.9);
}

.chat-compose {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(8px + var(--safe-bottom));
  display: grid;
  grid-template-columns: 34px 34px 34px 1fr 38px;
  gap: 5px;
  align-items: center;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.96);
}

.chat-compose button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 16px;
}

.chat-compose input {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0 8px;
  font-size: 13px;
}

.chat-compose .send {
  background: var(--red);
  font-size: 17px;
}

.notifications-fullscreen {
  grid-template-rows: auto 1fr;
}

.notification-list {
  overflow-y: auto;
  padding: 12px;
}

.notification-list section {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.notification-list h3 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.notification-row {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr 36px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  background: transparent;
  color: #d6d6d6;
  padding: 10px;
  text-align: left;
}

.notification-row.unread {
  background: rgba(225, 27, 34, .08);
  border-color: rgba(225, 27, 34, .2);
  color: #fff;
}

.notification-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(225, 27, 34, .5);
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.notification-row strong,
.notification-row small {
  display: block;
}

.notification-row strong {
  font-size: 12px;
  line-height: 1.35;
}

.notification-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.notification-row em {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2a2a2a, #090909);
  border: 1px solid rgba(255,255,255,.08);
}

@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --bottom-nav-base: 48px;
  }

  .topbar {
    min-height: calc(54px + var(--safe-top));
    padding-top: calc(5px + var(--safe-top));
    padding-bottom: 5px;
  }

  .brand {
    height: 42px;
  }

  .brand-logo {
    max-height: 42px;
    transform: translate(2px, 2px) scale(1.35);
  }

  .screen {
    padding-top: 10px;
    padding-bottom: calc(var(--bottom-nav-total) + 18px);
  }

  .bottom-nav {
    padding-top: 3px;
    padding-bottom: calc(4px + var(--safe-bottom));
  }

  .bottom-nav button {
    min-height: 38px;
  }

  .bottom-nav-app-icon,
  .bottom-nav-home-icon {
    width: 25px;
    height: 25px;
  }

  .home-quick-add {
    width: 50px;
    height: 50px;
    left: auto;
    right: calc(14px + var(--safe-right));
    bottom: calc(var(--bottom-nav-total) + 12px);
  }

  .quick-add-icon {
    width: 50px;
    height: 50px;
  }

  .social-post-media {
    max-height: 62dvh;
  }
}

.social-fab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.social-fab-grid button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 86px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #191919, #111);
  color: var(--text);
  padding: 12px 8px 10px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.social-fab-grid button:hover,
.social-fab-grid button:focus-visible {
  border-color: rgba(225, 27, 34, 0.7);
  background: linear-gradient(180deg, #221113, #111);
  transform: translateY(-1px);
}

.social-fab-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #e11b22;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 18px rgba(225, 27, 34, 0.18);
}

.social-fab-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.social-story-viewer {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  place-items: center;
  padding: calc(14px + var(--safe-top)) calc(14px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(14px + var(--safe-left));
}

.social-story-frame {
  width: min(390px, 100%);
  height: min(760px, 92vh);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #080808;
  overflow: hidden;
  position: relative;
}

.social-story-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: linear-gradient(rgba(0,0,0,.75), transparent);
}

.social-story-top button {
  border: 0;
  background: transparent;
  color: white;
  font-size: 24px;
}

.social-story-media {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.social-story-media img,
.social-story-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-story-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.88) 25%);
}

.profile-hero {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
}

.premium-profile-head {
  grid-template-columns: 82px 1fr;
}

.profile-avatar {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 26px;
  font-weight: 950;
}

.profile-hero h2 {
  margin: 0 0 5px;
}

.profile-display-name {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12px;
}

.profile-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-actions button {
  min-height: 34px;
  padding: 8px 6px;
  font-size: 11px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.profile-stats .stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 9px 6px;
}

.profile-stats .stat strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.profile-grid button,
.profile-grid div {
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--red);
  font-size: 26px;
  font-weight: 900;
  overflow: hidden;
}

.profile-grid button {
  padding: 0;
}

.profile-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-clean {
  display: grid;
  gap: 13px;
  padding-top: 14px;
}

.profile-main-row {
  display: grid;
  grid-template-columns: 92px 1fr 38px;
  align-items: center;
  gap: 14px;
}

.profile-photo-wrap {
  position: relative;
  width: 88px;
  height: 88px;
}

.profile-photo {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 26px;
  font-weight: 950;
}

.profile-photo-wrap button {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 26px;
  height: 26px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

.profile-main-info h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.1;
}

.profile-main-info small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-main-info p {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.profile-main-info em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.25;
}

.profile-body-top-action {
  width: 38px;
  height: 38px;
  align-self: start;
  border: 1px solid rgba(225, 27, 34, .55);
  border-radius: 999px;
  background: radial-gradient(circle at 50% 18%, rgba(225, 27, 34, .34), rgba(12, 12, 12, .96) 62%);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 10px 24px rgba(225, 27, 34, .16);
}

.profile-body-top-action svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-simple-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
}

.profile-simple-stats div {
  padding: 4px;
}

.profile-simple-stats button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px;
  text-align: center;
}

.profile-simple-stats strong,
.profile-simple-stats button strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
}

.profile-simple-stats span,
.profile-simple-stats button span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profile-bio {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.profile-clean-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  gap: 7px;
}

.profile-clean-actions button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 8px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-clean-actions button.wide {
  background: linear-gradient(135deg, rgba(225, 27, 34, .18), rgba(255,255,255,.04));
  border-color: rgba(225, 27, 34, .42);
}

.profile-highlights {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: none;
}

.profile-highlights::-webkit-scrollbar,
.profile-icon-tabs::-webkit-scrollbar {
  display: none;
}

.profile-highlights button {
  flex: 0 0 66px;
  display: grid;
  justify-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
}

.profile-highlights span {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 27, 34, 0.62);
  border-radius: 999px;
  background: var(--panel);
}

.profile-highlights img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
}

.profile-highlights .profile-ratlab-icon {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--red, #e11b22);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(225, 27, 34, .28));
}

.profile-highlights button:hover .profile-ratlab-icon,
.profile-highlights button:focus-visible .profile-ratlab-icon {
  stroke: #fff;
  filter: drop-shadow(0 0 7px rgba(225, 27, 34, .6));
}

.profile-highlights small {
  width: 66px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-icon-tabs {
  display: flex;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.profile-icon-tabs button {
  flex: 0 0 58px;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  opacity: 0.64;
}

.profile-icon-tabs button.active {
  opacity: 1;
}

.profile-icon-tabs button.active::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--red);
}

.profile-icon-tabs img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.profile-icon-tabs .profile-tab-svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #f5f5f5;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.5));
}

.profile-tab-content {
  min-height: 220px;
}

.profile-settings-panel {
  width: min(560px, calc(100vw - 28px));
  max-height: min(82vh, 760px);
  overflow: auto;
}

.profile-follow-panel {
  width: min(520px, calc(100vw - 28px));
  max-height: min(78vh, 720px);
  overflow: auto;
}

.profile-follow-tools {
  display: grid;
  grid-template-columns: minmax(0,1fr) 136px;
  gap: 8px;
  margin: 10px 0 12px;
}

.profile-follow-tools input,
.profile-follow-tools select {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(225,27,34,.35);
  background: #090909;
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.profile-follow-list {
  display: grid;
  gap: 8px;
}

.profile-follow-row {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.profile-follow-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(225,27,34,.55);
  background: rgba(225,27,34,.12);
  color: #fff;
  font-weight: 950;
}

.profile-follow-row strong {
  display: block;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-follow-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-follow-row .pill {
  min-height: 28px;
  padding: 0 10px;
}

.profile-follow-row .pill.danger {
  border-color: rgba(225,27,34,.55);
  color: #fff;
  background: rgba(225,27,34,.16);
}

.profile-settings-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0 12px;
}

.profile-settings-tabs button {
  min-height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
}

.profile-settings-tabs button.active {
  border-color: var(--red);
  background: rgba(225,27,34,.16);
  color: #fff;
}

.profile-settings-form {
  display: grid;
  gap: 10px;
}

.profile-settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.profile-check {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}

.profile-privacy-card,
.profile-mini-card,
.profile-method-alert {
  padding: 11px;
  border: 1px solid rgba(225,27,34,.25);
  border-radius: 11px;
  background: rgba(225,27,34,.08);
}

.profile-privacy-card strong,
.profile-mini-card strong {
  display: block;
  color: #fff;
  font-size: 13px;
}

.profile-privacy-card p,
.profile-mini-card p,
.profile-method-alert {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.profile-social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.profile-request-row:first-of-type {
  border-top: 0;
}

.profile-form-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}

.profile-form-section > strong {
  color: #fff;
  font-size: 13px;
}

.profile-details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,.025);
}

.profile-details summary {
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.profile-body-checkin-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border-color: rgba(225, 27, 34, .32);
  background:
    radial-gradient(circle at 95% 10%, rgba(225, 27, 34, .18), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
}

.profile-body-checkin-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-body-checkin-copy strong {
  color: #fff;
  font-size: 17px;
  line-height: 1.05;
}

.profile-body-checkin-copy p,
.profile-body-checkin-copy small {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.profile-body-checkin-button {
  display: inline-grid;
  place-items: center;
  gap: 5px;
  min-width: 118px;
  min-height: 58px;
  border: 1px solid rgba(225, 27, 34, .72);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), #8f1016);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 14px 34px rgba(225, 27, 34, .22);
}

.profile-body-checkin-button span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-size: 19px;
  line-height: 1;
}

.profile-body-checkin-page {
  padding-bottom: 110px;
}

.profile-body-checkin-form {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(225, 27, 34, .3);
  border-radius: 18px;
  background:
    radial-gradient(circle at 15% 0%, rgba(225, 27, 34, .18), transparent 30%),
    linear-gradient(180deg, #1c1c1c, #101010);
}

.body-checkin-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.body-checkin-step {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 52px;
  padding: 7px 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.body-checkin-step span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.26);
  color: #fff;
  font-size: 11px;
}

.body-checkin-step.active {
  border-color: var(--red);
  background: rgba(225, 27, 34, .15);
  color: #fff;
}

.body-checkin-step.done {
  border-color: rgba(34,197,94,.32);
  color: #d1fae5;
}

.body-checkin-step.done span {
  border-color: rgba(34,197,94,.52);
  background: rgba(34,197,94,.16);
}

.body-checkin-pane {
  display: none;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}

.body-checkin-pane.active {
  display: grid;
  animation: bodyCheckinIn .18s ease;
}

.body-checkin-pane-head {
  display: grid;
  gap: 4px;
}

.body-checkin-pane-head span {
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.body-checkin-pane-head strong {
  color: #fff;
  font-size: 20px;
  line-height: 1.05;
}

.body-checkin-pane-head p,
.body-checkin-review span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.body-checkin-measures {
  max-height: min(52vh, 430px);
  overflow: auto;
}

.body-checkin-review {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(225,27,34,.28);
  border-radius: 13px;
  background: rgba(225,27,34,.08);
}

.body-checkin-review strong {
  color: #fff;
  font-size: 13px;
}

.body-checkin-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 9px;
}

@keyframes bodyCheckinIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

:root {
  --body-positive: #22c55e;
  --body-stable: #facc15;
  --body-warning: #f59e0b;
  --body-negative: #ef4444;
  --body-empty: #374151;
}

.rl-body-card {
  background: linear-gradient(180deg, #181818, #101010);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  padding: 18px;
  color: #fff;
  overflow: hidden;
}

.rl-body-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.rl-body-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.rl-body-header p {
  margin: 6px 0 0;
  color: #a1a1aa;
  font-size: 13px;
}

.rl-body-pill {
  border: 1px solid rgba(239, 68, 68, .35);
  background: rgba(239, 68, 68, .08);
  color: #fca5a5;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
}

.rl-body-content {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, .9fr);
  gap: 16px;
  align-items: center;
}

.rl-body-svg-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 420px;
  background: radial-gradient(circle at center, rgba(239, 68, 68, .08), transparent 62%);
  border-radius: 16px;
}

.rl-body-svg {
  width: 100%;
  max-width: 245px;
  height: auto;
}

.rl-body-svg [data-part] {
  cursor: pointer;
  opacity: .86;
  transition: transform .18s ease, opacity .18s ease, filter .18s ease, stroke .18s ease;
  transform-origin: center;
}

.rl-body-svg [data-part]:hover,
.rl-body-svg [data-part].is-selected {
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, .55));
  stroke: #ef4444 !important;
  stroke-width: 2.3 !important;
}

.rl-body-info {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  padding: 16px;
}

.rl-body-info-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: #ef4444;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.rl-body-info h4 {
  margin: 0 0 12px;
  font-size: 18px;
}

.rl-body-info p {
  margin: 0;
  color: #a1a1aa;
  font-size: 13px;
  line-height: 1.4;
}

.rl-body-metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.rl-body-metric:last-child {
  border-bottom: 0;
}

.rl-body-metric span {
  color: #a1a1aa;
  font-size: 12px;
}

.rl-body-metric strong {
  color: #fff;
  font-size: 13px;
}

.rl-body-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.rl-body-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #bdbdc3;
  font-size: 11px;
}

.rl-body-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 10px currentColor;
}

@media (max-width: 560px) {
  .rl-body-content {
    grid-template-columns: 1fr;
  }

  .rl-body-svg-wrap {
    min-height: 390px;
  }

  .rl-body-legend {
    grid-template-columns: 1fr 1fr;
  }
}

.body-evolution-map {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 126px;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  overflow: hidden;
}

.body-map-svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  justify-self: center;
  display: block;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.38));
}

.body-map-svg .body-outline path {
  fill: #161a20;
  stroke: rgba(255,255,255,.16);
  stroke-width: 2.4;
}

.body-map-svg .body-region {
  cursor: pointer;
  stroke: rgba(255,255,255,.22);
  stroke-width: 1.5;
  stroke-linejoin: round;
  transition: fill .18s ease, stroke .18s ease, filter .18s ease, opacity .18s ease;
}

.body-map-svg .body-region.positive {
  fill: rgba(34, 197, 94, .74);
  filter: drop-shadow(0 0 5px rgba(34,197,94,.45));
}

.body-map-svg .body-region.stable {
  fill: rgba(250, 204, 21, .44);
}

.body-map-svg .body-region.warning {
  fill: rgba(245, 158, 11, .68);
}

.body-map-svg .body-region.negative {
  fill: rgba(239, 68, 68, .76);
}

.body-map-svg .body-region.empty {
  fill: var(--body-empty);
  opacity: .78;
}

.body-map-svg .body-region:hover,
.body-map-svg .body-region.selected {
  stroke: var(--red);
  stroke-width: 3;
  filter: drop-shadow(0 0 9px rgba(225,27,34,.65));
}

.profile-body-legend {
  display: grid;
  gap: 8px;
}

.profile-body-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
}

.profile-body-legend i {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255,210,70,.55);
}

.profile-body-legend i.positive { background: var(--body-positive); }
.profile-body-legend i.stable { background: var(--body-stable); }
.profile-body-legend i.warning { background: var(--body-warning); }
.profile-body-legend i.negative { background: var(--body-negative); }
.profile-body-legend i.empty { background: var(--body-empty); }

.body-map-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.body-map-detail strong {
  grid-column: 1 / -1;
  color: #fff;
  font-size: 14px;
}

.body-map-detail span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.body-map-detail.positive { border-color: rgba(34,197,94,.42); }
.body-map-detail.stable { border-color: rgba(250,204,21,.34); }
.body-map-detail.warning { border-color: rgba(245,158,11,.42); }
.body-map-detail.negative { border-color: rgba(239,68,68,.42); }

@media (max-width: 390px) {
  .body-evolution-map {
    grid-template-columns: 1fr;
  }

  .profile-body-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.profile-clean-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  background: #050505;
}

.profile-clean-grid button {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  background: #101010;
  padding: 0;
  overflow: hidden;
}

.profile-clean-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-clean-grid span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--red);
  font-size: 28px;
}

.profile-clean-grid em {
  position: absolute;
  right: 5px;
  top: 4px;
  color: white;
  font-style: normal;
  font-size: 14px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.9);
}

.profile-empty-state {
  min-height: 260px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 28px 20px;
}

.profile-empty-state div {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 30px;
}

.profile-empty-state strong {
  color: var(--text);
  font-size: 15px;
}

.profile-empty-state p {
  max-width: 250px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.profile-empty-state button {
  width: auto;
  padding-inline: 18px;
  margin-top: 4px;
}

.profile-camera-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.profile-camera-options button {
  min-height: 86px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 10px;
  font-size: 22px;
}

.profile-camera-options span {
  font-size: 11px;
  font-weight: 900;
}

.profile-permission-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.native-media-field {
  gap: 8px;
}

.native-media-field input[type="file"] {
  padding: 12px;
  color: #f8f8f8;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: #0f0f0f;
  cursor: pointer;
}

.auth-option {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.auth-message {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(225, 27, 34, 0.36);
  border-radius: 8px;
  background: rgba(225, 27, 34, 0.12);
  color: #ffb3b6;
  font-size: 12px;
  line-height: 1.35;
}

.auth-secondary,
.auth-link {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.auth-secondary {
  margin-top: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.auth-link {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.native-media-field input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  margin-right: 10px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.native-media-field small {
  color: var(--muted);
  font-size: 11px;
}

.native-media-preview {
  display: none;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #050505;
}

.native-media-preview:not(:empty) {
  display: block;
}

.native-media-preview img,
.native-media-preview video {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}

@media (max-width: 390px) {
  .profile-clean-actions {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .95fr);
    gap: 6px;
  }

  .profile-main-row {
    grid-template-columns: 82px 1fr 36px;
    gap: 10px;
  }

  .profile-photo,
  .profile-photo-wrap {
    width: 80px;
    height: 80px;
  }

  .profile-body-top-action {
    width: 36px;
    height: 36px;
  }

  .profile-clean-actions button {
    font-size: 9px;
    padding-inline: 6px;
  }
}

.profile-grid em {
  position: absolute;
  right: 6px;
  top: 5px;
  font-style: normal;
  font-size: 15px;
  text-shadow: 0 1px 6px rgba(0,0,0,.8);
}

.profile-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 11px 12px;
}

.profile-section-head select {
  width: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 8px;
  font-size: 11px;
}

.profile-template-card p {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.35;
}

.profile-section-head-split {
  align-items: stretch;
}

.profile-section-head-split > div:first-child {
  min-width: 0;
}

.profile-section-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.profile-section-actions button {
  width: auto;
  min-width: 86px;
  padding: 9px 11px;
  font-size: 11px;
}

.profile-shared-card {
  border-color: rgba(239, 68, 68, .22);
  background:
    radial-gradient(circle at right top, rgba(239, 68, 68, .14), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
}

.profile-share-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profile-shared-empty {
  padding: 16px;
  border-style: dashed;
  background: rgba(255,255,255,.025);
}

.pill.danger {
  border-color: rgba(239, 68, 68, .55);
  color: #fecaca;
  background: rgba(239, 68, 68, .12);
}

.profile-chart {
  height: 120px;
  display: flex;
  align-items: end;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
}

.profile-chart span {
  flex: 1;
  min-height: 12px;
  border-radius: 999px 999px 3px 3px;
  background: linear-gradient(180deg, var(--red), rgba(225, 27, 34, 0.28));
}

.profile-badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.profile-badges span {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

@media (max-width: 390px) {
  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-actions,
  .profile-badges {
    grid-template-columns: 1fr;
  }
}

.stack {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.mini-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.mini-tabs button {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 6px;
  font-size: 11px;
  font-weight: 700;
}

.mini-tabs button.active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #2a2a2a;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  background: var(--red);
}

.list-item {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.list-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.edit-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  font-size: 15px;
}

.session-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.session-summary div {
  padding: 14px 8px;
  text-align: center;
  background: #050505;
}

.session-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.session-summary strong {
  display: block;
  margin-top: 6px;
  color: #4da3ff;
  font-size: 18px;
}

.session-top {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
}

.session-top-title {
  min-width: 0;
  text-align: center;
}

.session-top-title strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-top-title span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.exercise-line {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  text-align: left;
}

.exercise-thumb {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: #f2f2f2;
  color: #111;
  display: grid;
  place-items: center;
  font-size: 24px;
}

.set-table {
  display: grid;
  gap: 8px;
}

.set-row {
  display: grid;
  grid-template-columns: 46px 1fr 1fr 1fr 46px;
  gap: 8px;
  align-items: center;
}

.set-row.time-mode,
.set-row.distance-mode,
.set-row.steps-mode {
  grid-template-columns: 46px 1fr 1fr 46px;
}

.set-row.header {
  color: var(--muted);
  font-size: 11px;
}

.set-row input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: #111;
  color: var(--text);
  padding: 9px 7px;
  text-align: center;
}

.type-chip {
  border: 0;
  background: transparent;
  color: #4da3ff;
  font-weight: 900;
  font-size: 16px;
}

.type-chip.static {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b0b0b;
}

.set-type-control {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.check-chip {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #33313b;
  color: #fff;
  font-size: 18px;
}

.check-chip.done {
  background: var(--green);
}

.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.58);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}

.bottom-sheet-panel {
  width: min(100%, var(--app-max-width));
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px);
  overflow: auto;
  background: #1d1b21;
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 18px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.type-option {
  border: 1px solid #333;
  border-radius: 8px;
  background: #211f25;
  color: var(--text);
  padding: 14px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
}

.draggable-exercise {
  border-top: 1px solid var(--border);
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  border-radius: 8px;
}

.draggable-exercise.dragging {
  opacity: 0.94;
  transform: scale(1.025) translateY(-2px);
  border-color: var(--red);
  background: #191919;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(225, 27, 34, 0.45);
  position: relative;
  z-index: 5;
}

.draggable-exercise.drop-target {
  background: #211313;
  box-shadow: inset 0 0 0 1px rgba(225, 27, 34, 0.65);
}

.draggable-exercise.drop-target:not(.dragging) {
  transform: translateY(4px);
}

.draggable-exercise.reordered {
  animation: settleItem 0.24s ease;
}

.drag-handle {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111;
  color: var(--muted);
  padding: 8px 10px;
  cursor: grab;
  line-height: 1;
  touch-action: none;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

@keyframes settleItem {
  0% {
    transform: scale(1.02);
    background: #211313;
  }
  100% {
    transform: scale(1);
    background: transparent;
  }
}

.exercise-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(16px + var(--safe-left));
}

.exercise-editor-panel {
  width: min(100%, var(--app-max-width));
  max-height: calc(100dvh - 36px - var(--safe-top) - var(--safe-bottom));
  overflow: auto;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.68);
}

.exercise-set-editor {
  margin-top: 12px;
}

.exercise-set-editor .add-set-button {
  width: 100%;
  border-radius: 999px;
  margin: 6px 0 18px;
}

.exercise-set-editor .set-row {
  position: relative;
}

.exercise-set-editor .set-row.pending-remove {
  grid-template-columns: 1fr auto auto;
  background: #1b1111;
  border: 1px solid rgba(225, 27, 34, 0.5);
  border-radius: 8px;
  padding: 8px;
}

.remove-confirm-text {
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
}

.compact-danger,
.compact-safe {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-weight: 800;
}

.compact-danger {
  background: var(--red);
}

.compact-safe {
  background: #151515;
}

.trash-set {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #121212;
  color: #ff5a5a;
  display: grid;
  place-items: center;
  font-size: 15px;
}

.trash-set:hover {
  border-color: rgba(225, 27, 34, 0.55);
  background: #1b1111;
}

.modal-actions {
  margin-top: 4px;
}

.reel {
  min-height: 430px;
  display: grid;
  align-content: space-between;
}

.media-box {
  min-height: 180px;
  border-radius: 8px;
  border: 1px solid #333;
  background: linear-gradient(145deg, #111, #24090a);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
}

.media-box img,
.media-box video {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
}

.toast {
  position: fixed;
  top: calc(62px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(360px, calc(100% - 32px));
  background: var(--green);
  color: white;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.danger-zone {
  border-color: #3d1b1b;
  background: #180d0d;
}

.exercise-catalog-line {
  align-items: center;
  gap: 10px;
}

.exercise-catalog-line > div:last-child {
  flex-shrink: 0;
  gap: 8px;
}

.exercise-catalog-line .pill {
  min-width: 60px;
  text-align: center;
}

.exercise-type-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(225, 27, 34, 0.35);
  background: linear-gradient(145deg, #181818, #260d0f);
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  font-size: 20px;
  font-weight: 900;
}

.exercise-modal-form select[data-exercise-draft-type],
.exercise-modal-form select[data-exercise-draft-target],
.exercise-modal-form input[data-exercise-draft-name] {
  min-height: 42px;
}

.exercise-picker {
  position: relative;
  font-size: 13px;
}

.exercise-picker-trigger {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.exercise-picker.open .exercise-picker-trigger {
  border-color: rgba(225, 27, 34, 0.55);
  box-shadow: 0 0 0 3px rgba(225, 27, 34, 0.12);
}

.exercise-picker-trigger input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px;
  outline: none;
  font-size: 12px;
  font-weight: 600;
}

.exercise-picker-trigger button {
  width: 42px;
  align-self: stretch;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: background-color 0.18s ease;
}

.exercise-picker-trigger button span {
  width: 18px;
  height: 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position:
    3px 50%,
    9px 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.exercise-picker.open .exercise-picker-arrow {
  background: rgba(255, 255, 255, 0.04);
}

.exercise-picker.open .exercise-picker-arrow span {
  transform: rotate(180deg);
}

.exercise-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 130;
  border: 1px solid #343434;
  border-radius: 10px;
  background: #1f1f1f;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.46);
  padding: 10px;
  overflow: hidden;
}

.exercise-picker-search,
.exercise-custom-box input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111;
  color: var(--text);
  padding: 10px;
  margin-bottom: 8px;
}

.exercise-picker-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: none;
}

.exercise-picker-list button {
  border: 0;
  border-radius: 8px;
  background: #303030;
  color: var(--text);
  padding: 11px;
  text-align: left;
  font-size: 13px;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.exercise-picker-list button:hover {
  background: #3b3b3b;
  transform: translateY(-1px);
}

.exercise-picker-list small {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 11px;
  opacity: 0.86;
}

.add-exercise-inside {
  width: 100%;
  margin-top: 8px;
}

.exercise-custom-box {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.exercise-custom-row {
  display: grid;
  grid-template-columns: 1fr 38px 42px;
  gap: 8px;
  align-items: center;
}

.exercise-technique-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  position: relative;
}

.exercise-technique-help {
  position: relative;
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-grid;
  place-items: center;
  cursor: help;
  z-index: 4;
}

.exercise-technique-help > span {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(225, 27, 34, 0.72);
  border-radius: 999px;
  background: rgba(225, 27, 34, 0.14);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.exercise-technique-help em {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: min(280px, calc(100vw - 58px));
  transform: translate(-50%, 5px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(225, 27, 34, 0.42);
  border-radius: 11px;
  background: #151515;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.52);
  color: rgba(255, 255, 255, 0.82);
  padding: 10px 11px;
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.38;
  text-transform: none;
  letter-spacing: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.exercise-technique-help em strong {
  display: block;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  margin-bottom: 4px;
}

.exercise-technique-help:hover em,
.exercise-technique-help:focus em,
.exercise-technique-help:focus-within em {
  opacity: 1;
  transform: translate(-50%, 0);
}

.exercise-picker-open-btn {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(225, 27, 34, 0.12), rgba(18, 18, 18, 0.94));
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.exercise-picker.open .exercise-picker-open-btn,
.exercise-picker-open-btn:focus-visible {
  border-color: rgba(225, 27, 34, 0.72);
  box-shadow: 0 0 0 3px rgba(225, 27, 34, 0.14);
  outline: none;
}

.exercise-picker-open-btn strong {
  display: block;
  color: #fff;
  font-size: 13px;
  line-height: 1.1;
}

.exercise-picker-open-btn small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.exercise-picker-open-btn i {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(225, 27, 34, 0.48);
  border-radius: 999px;
  background: rgba(225, 27, 34, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  font-style: normal;
  font-size: 17px;
  font-weight: 900;
}

.exercise-picker-floating {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: calc(14px + var(--safe-top)) calc(14px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(14px + var(--safe-left));
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(7px);
}

.exercise-picker-panel {
  width: min(520px, 100%);
  max-height: calc(100dvh - 34px - var(--safe-top) - var(--safe-bottom));
  border: 1px solid rgba(225, 27, 34, 0.38);
  border-radius: 16px;
  background: linear-gradient(180deg, #191919, #0f0f0f);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.62);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.exercise-picker-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.exercise-picker-panel-head strong {
  display: block;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.exercise-picker-panel-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.exercise-picker-search-shell {
  margin: 12px 14px 10px;
  min-height: 46px;
  border: 1px solid rgba(225, 27, 34, 0.38);
  border-radius: 12px;
  background: #090909;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.exercise-picker-search-shell span {
  color: var(--red);
  font-size: 15px;
  font-weight: 900;
}

.exercise-picker-search-shell input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  outline: none;
  font-size: 13px;
  font-weight: 800;
}

.exercise-picker-results {
  flex: 1;
  overflow: auto;
  padding: 0 14px 12px;
  scrollbar-width: thin;
}

.exercise-picker-result {
  cursor: pointer;
  background: linear-gradient(135deg, #171717, #111);
  transition: border-color 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.exercise-picker-result:hover,
.exercise-picker-result.is-selected {
  border-color: rgba(225, 27, 34, 0.64);
  background: linear-gradient(135deg, rgba(225, 27, 34, 0.16), #111);
  transform: translateY(-1px);
}

.exercise-picker-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(15, 15, 15, 0.94), #0b0b0b);
}

.exercise-picker-footer .add-exercise-inside {
  margin-top: 0;
  min-height: 44px;
  border-color: rgba(225, 27, 34, 0.42);
  background: rgba(225, 27, 34, 0.1);
  color: #fff;
}

.exercise-empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
}

.exercise-empty-state strong,
.exercise-empty-state small {
  display: block;
}

.exercise-empty-state small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 560px) {
  .exercise-picker-floating {
    place-items: end center;
    padding: calc(12px + var(--safe-top)) calc(10px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(10px + var(--safe-left));
  }

  .exercise-picker-panel {
    max-height: min(78dvh, 680px);
    border-radius: 18px 18px 12px 12px;
  }
}

.today-done-note {
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
}

.today-workout-card {
  border-color: rgba(225, 27, 34, 0.38);
}

.metric-bar {
  height: 7px;
  border-radius: 999px;
  background: #101010;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 6px;
}

.metric-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #ff8a3d);
}

.metric-insight {
  margin: 0;
  border: 1px solid rgba(225, 27, 34, 0.22);
  background: rgba(225, 27, 34, 0.08);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.exercise-custom-row input {
  margin-bottom: 0;
}

.confirm-custom-exercise {
  width: 42px;
  height: 38px;
  border-radius: 999px;
  padding: 0;
}

.ratlab-social-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 2px 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.ratlab-social-header h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0;
}

.ratlab-social-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.ratlab-header-actions {
  display: flex;
  gap: 8px;
}

.ratlab-header-actions button,
.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  display: grid;
  place-items: center;
  font-weight: 800;
  line-height: 1;
}

.ratlab-header-actions button:first-child {
  font-size: 20px;
}

.ratlab-tabs.tabs {
  gap: 8px;
  margin-bottom: 14px;
}

.ratlab-tabs.tabs button {
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  padding: 8px 13px;
}

.ratlab-tabs.tabs button.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.ratlab-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ratlab-stories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.ratlab-stories button {
  min-width: 58px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
}

.ratlab-stories button > span {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  padding: 2px;
  background: var(--border);
  display: grid;
  place-items: center;
}

.ratlab-stories button.active > span {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
}

.ratlab-stories button > span > span {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.ratlab-stories small {
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.ratlab-post,
.ratlab-empty-feed {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.ratlab-post header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
}

.ratlab-post-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ratlab-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.ratlab-post-author strong,
.ratlab-post-body strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.ratlab-post-author small,
.ratlab-post-body small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.ratlab-post-media {
  aspect-ratio: 1 / 1;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(160deg, #080808, #1f1f1f);
  display: grid;
  place-items: center;
  padding: 24px;
}

.ratlab-post-media .media-box {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.ratlab-post-media img,
.ratlab-post-media video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
}

.ratlab-workout-art {
  text-align: center;
}

.ratlab-workout-art small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ratlab-workout-art strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 58px;
  line-height: 1;
}

.ratlab-workout-art p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.ratlab-workout-art div {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ratlab-workout-art span {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.ratlab-post-body {
  padding: 10px 12px 14px;
}

.ratlab-post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ratlab-post-actions div {
  display: flex;
  gap: 12px;
}

.ratlab-post-actions button {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.ratlab-post-body p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.ratlab-post-body .pill-row {
  margin-top: 10px;
}

.ratlab-feed-nav {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 10px;
}

.ratlab-feed-nav button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 17px;
}

.ratlab-feed-nav button:disabled {
  opacity: 0.45;
}

.ratlab-feed-nav div {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.ratlab-feed-nav span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  transition: all 0.2s;
}

.ratlab-feed-nav span.active {
  width: 16px;
  background: var(--red);
}

.ratlab-empty-feed {
  padding: 38px 20px;
  text-align: center;
  color: var(--muted);
}

.ratlab-empty-feed div {
  width: 62px;
  height: 62px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-size: 28px;
}

.ratlab-empty-feed strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.ratlab-empty-feed p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.diet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  min-width: 0;
  flex-wrap: wrap;
}

.diet-header-clean {
  align-items: flex-start;
  padding: 2px 0 4px;
}

.diet-title-block {
  flex: 1 1 160px;
}

.diet-title-block h1 {
  margin: 0;
  font-size: 30px;
  line-height: 0.98;
}

.diet-title-block p {
  margin-top: 8px;
  font-size: 13px;
}

.diet-header-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.diet-header-title-row > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.diet-header h2 {
  margin: 0;
}

.diet-header > div:first-child {
  min-width: 0;
}

.diet-header .btn {
  flex: 0 0 auto;
  padding-inline: 12px;
}

.diet-header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
}

.diet-header-actions button {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  white-space: nowrap;
  font-size: 11px;
}

.diet-header-action-btn {
  width: 72px;
  min-height: 66px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px 7px;
  border: 1px solid rgba(225, 27, 34, 0.72);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(225, 27, 34, 0.22), rgba(225, 27, 34, 0.08) 48%, rgba(10, 10, 10, 0.96));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 12px 24px rgba(225, 27, 34, 0.14);
}

.diet-header-action-btn span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  font-size: 25px;
  line-height: 1;
}

.diet-header-action-btn svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, .2));
}

.diet-learn-btn .diet-learn-icon {
  width: 30px;
  height: 30px;
  stroke-width: 1.8;
}

.diet-header-action-btn strong {
  display: block;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
}

.diet-header-action-btn:active {
  transform: translateY(1px);
}

.diet-mode-tabs {
  margin-top: -4px;
  margin-bottom: 4px;
}

.diet-mode-tabs button {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 11px;
}

.diet-subtabs {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  gap: 5px;
}

.diet-subtabs button {
  min-height: 32px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 900;
}

.diet-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.diet-status.good {
  border-color: rgba(28, 185, 111, 0.45);
  background: rgba(28, 185, 111, 0.12);
  color: #5ee39a;
}

.diet-status.warn {
  border-color: rgba(245, 177, 66, 0.45);
  background: rgba(245, 177, 66, 0.12);
  color: #f5c66b;
}

.diet-status.bad {
  border-color: rgba(239, 35, 48, 0.5);
  background: rgba(239, 35, 48, 0.12);
  color: #ff6b74;
}

.diet-status.empty {
  border-color: var(--border);
  color: var(--muted);
}

.diet-plan-form,
.off-plan-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  overflow: hidden;
}

.diet-plan-form .form-grid,
.off-plan-form .form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}

.diet-plan-form .form-grid .full,
.off-plan-form .form-grid .full {
  grid-column: 1 / -1;
}

.diet-plan-wizard {
  width: min(560px, 100%);
  padding: 14px;
  border-color: rgba(225, 27, 34, 0.36);
  background: linear-gradient(160deg, #181818, #111 58%, rgba(225, 27, 34, 0.08));
}

.diet-wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 4px 0 14px;
}

.diet-wizard-steps button {
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  padding: 7px 5px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.diet-wizard-steps span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0 auto 4px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 10px;
}

.diet-wizard-steps button.active {
  border-color: rgba(225, 27, 34, 0.72);
  background: rgba(225, 27, 34, 0.16);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(225, 27, 34, 0.16);
}

.diet-wizard-steps button.done {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.diet-wizard-pane {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
  animation: dietWizardIn 0.18s ease-out;
}

.diet-wizard-pane h3 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 18px;
}

.diet-section-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.diet-section-title h3,
.diet-section-title span {
  margin: 0;
}

.diet-editor-title-inline {
  margin: 0 0 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.diet-info-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  outline: 0;
  cursor: help;
}

.diet-info-tip > span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(225, 27, 34, 0.66);
  border-radius: 999px;
  background: rgba(225, 27, 34, 0.12);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.diet-info-tip em {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(270px, calc(100vw - 56px));
  transform: translate(-50%, -4px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(225, 27, 34, 0.36);
  border-radius: 10px;
  background: #161616;
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.82);
  padding: 10px 11px;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.35;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.diet-info-tip:hover em,
.diet-info-tip:focus em,
.diet-info-tip:focus-within em {
  opacity: 1;
  transform: translate(-50%, 0);
}

.diet-plan-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.diet-plan-type-grid button {
  min-height: 94px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #121212;
  color: #fff;
  padding: 12px;
  text-align: left;
}

.diet-plan-type-grid button.active {
  border-color: rgba(225, 27, 34, 0.8);
  background: linear-gradient(145deg, rgba(225, 27, 34, 0.22), rgba(255, 255, 255, 0.035));
}

.diet-plan-type-grid strong {
  display: block;
  font-size: 15px;
}

.diet-plan-type-grid small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.diet-current-division {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101010;
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
}

.diet-division-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
}

.diet-division-tabs button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.diet-division-tabs button.active {
  border-color: rgba(225, 27, 34, 0.72);
  background: rgba(225, 27, 34, 0.16);
  color: #fff;
}

.diet-meal-sequence {
  display: grid;
  gap: 8px;
}

.diet-sequence-meal {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 110px 36px;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  padding: 9px;
}

.diet-sequence-meal > span {
  align-self: center;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(225, 27, 34, 0.58);
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.diet-wizard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr;
  gap: 8px;
  margin-top: 12px;
}

.diet-wizard-actions button {
  min-height: 42px;
}

@keyframes dietWizardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .diet-wizard-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .diet-wizard-steps button {
    min-height: 42px;
    font-size: 8px;
    padding-inline: 2px;
  }

  .diet-plan-type-grid,
  .diet-wizard-actions {
    grid-template-columns: 1fr;
  }

  .diet-division-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .diet-sequence-meal {
    grid-template-columns: 30px minmax(0, 1fr) 36px;
  }

  .diet-sequence-meal .field:nth-of-type(2) {
    grid-column: 2 / -1;
  }
}

.diet-meal-card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.diet-builder-day {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  overflow: hidden;
}

.diet-day-tabs {
  margin-top: 12px;
}

.diet-builder-meal {
  background: #111;
}

.diet-meal-editor {
  position: relative;
}

.diet-option-box {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0;
  overflow: hidden;
}

.diet-option-tabs-shell {
  display: grid;
  gap: 10px;
}

.diet-option-tabs-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 0;
  background: #171717;
}

.diet-option-tabs {
  display: flex;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.diet-option-tabs::-webkit-scrollbar {
  display: none;
}

.diet-option-tabs button,
.diet-option-add-tab {
  min-height: 36px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.diet-option-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 0 12px;
}

.diet-option-tabs button span {
  pointer-events: none;
}

.diet-option-tabs button i {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 950;
}

.diet-option-tabs button.active {
  border-color: rgba(225, 27, 34, 0.72);
  background: rgba(225, 27, 34, 0.18);
  color: #fff;
}

.diet-option-add-tab {
  flex: 0 0 36px;
  width: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.diet-option-remove-tab {
  border: 1px solid rgba(225, 27, 34, 0.5);
  background: rgba(225, 27, 34, 0.12);
  color: #fff;
}

.diet-option-box-tabbed {
  margin-top: 0;
}

.diet-option-static-title {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.diet-option-confirm {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
}

.diet-option-confirm-card {
  width: min(360px, 100%);
  border: 1px solid rgba(225, 27, 34, 0.4);
  border-radius: 12px;
  background: #171717;
  padding: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

.diet-option-confirm-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.diet-option-confirm-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.diet-option-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.primary.danger {
  background: #e11b22;
}

.diet-editor-total-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(225, 27, 34, 0.32);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(225, 27, 34, 0.12), rgba(255, 255, 255, 0.035));
}

.diet-editor-total-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.diet-editor-total-card strong {
  color: #fff;
}

.diet-editor-total-card small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.diet-editor-total-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.diet-editor-total-grid span {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 8px 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.diet-editor-total-grid strong {
  font-size: 15px;
  line-height: 1;
}

.diet-editor-total-grid small {
  font-size: 9px;
  text-transform: uppercase;
}

.inline-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 4px 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.diet-food-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, 0.45fr);
  gap: 7px;
  align-items: center;
  margin-bottom: 8px;
  max-width: 100%;
}

.diet-food-row input,
.diet-food-row select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.diet-clock-picker {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #0f0f0f;
  padding: 4px 8px;
}

.diet-clock-picker select {
  width: 100%;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.diet-clock-picker span {
  color: var(--red);
  font-size: 18px;
  font-weight: 900;
}

.diet-sequence-meal select,
.diet-builder-meal select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0f0f0f;
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.diet-food-row-final {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.diet-food-select-button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(225, 27, 34, 0.35);
  border-radius: 9px;
  background: rgba(225, 27, 34, 0.1);
  color: #fff;
  padding: 7px 9px;
  text-align: left;
}

.diet-food-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px 34px;
  gap: 8px;
  align-items: center;
}

.diet-food-macro-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.diet-suffix-field {
  min-width: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0f0f0f;
  padding: 0 8px;
}

.diet-suffix-field input,
.diet-suffix-field select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  padding: 0;
  font-size: 13px;
  font-weight: 900;
}

.diet-suffix-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.diet-quantity-field {
  grid-template-columns: minmax(46px, 0.7fr) minmax(70px, 1fr);
}

.diet-quantity-field select {
  color: var(--muted);
  font-size: 11px;
}

.diet-food-select-button strong,
.diet-food-select-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diet-food-select-button strong {
  font-size: 12px;
}

.diet-food-select-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.diet-food-picker-backdrop {
  z-index: 110;
}

.diet-food-picker-panel {
  position: relative;
  width: min(560px, calc(100dvw - 28px));
  background: #151515;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.diet-food-search {
  flex: 0 0 auto;
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(225, 27, 34, 0.35);
  border-radius: 10px;
  background: #0f0f0f;
  color: #fff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  caret-color: #fff;
}

.diet-food-mode-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 10px;
}

.diet-food-mode-tabs button {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.diet-food-mode-tabs button.active {
  border-color: rgba(225, 27, 34, 0.72);
  background: linear-gradient(180deg, rgba(225, 27, 34, 0.24), rgba(225, 27, 34, 0.1));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.diet-food-picker-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: none;
}

.diet-food-picker-list::-webkit-scrollbar {
  display: none;
}

.diet-food-picker-panel > .diet-card-head {
  flex: 0 0 auto;
}

.diet-food-picker-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  padding: 10px;
  text-align: left;
}

.diet-food-pick-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.diet-food-picker-item strong,
.diet-food-picker-item small {
  display: block;
}

.diet-food-picker-item strong {
  font-size: 13px;
}

.diet-food-picker-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.diet-food-picker-macros {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.diet-food-picker-macros span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 900;
}

.diet-substitute-trigger {
  min-height: 34px;
  border: 1px solid rgba(225, 27, 34, 0.42);
  border-radius: 8px;
  background: rgba(225, 27, 34, 0.1);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.diet-substitute-floating {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(4px);
}

.diet-substitute-panel {
  width: min(500px, 100%);
  max-height: min(620px, calc(100dvh - 90px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(225, 27, 34, 0.38);
  border-radius: 12px;
  background: #171717;
  padding: 14px;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.55);
}

.diet-substitute-source {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(225, 27, 34, 0.1);
}

.diet-substitute-source span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.diet-substitute-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  margin-top: 10px;
  scrollbar-width: none;
}

.diet-substitute-list::-webkit-scrollbar {
  display: none;
}

.diet-substitute-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.diet-substitute-item strong,
.diet-substitute-item small {
  display: block;
}

.diet-substitute-item small,
.diet-substitute-item > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.diet-floating {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: calc(18px + var(--safe-top)) calc(18px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(18px + var(--safe-left));
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(5px);
}

.diet-floating-panel {
  width: min(520px, 100%);
  max-width: calc(100dvw - 28px - var(--safe-left) - var(--safe-right));
  max-height: min(760px, calc(100dvh - 36px - var(--safe-top) - var(--safe-bottom)));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #171717;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.42);
  padding: 14px;
}

.diet-plans-panel {
  border-color: rgba(237, 28, 36, 0.42);
  background:
    radial-gradient(circle at 18% 0%, rgba(237, 28, 36, 0.18), transparent 35%),
    linear-gradient(180deg, #1b1b1b, #101010);
}

.diet-plans-head {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.diet-plans-head span {
  display: inline-flex;
  margin-bottom: 4px;
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.diet-plan-library {
  display: grid;
  gap: 10px;
}

.diet-plan-card {
  display: grid;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.diet-plan-card.active {
  border-color: rgba(237, 28, 36, 0.55);
  background:
    linear-gradient(135deg, rgba(237, 28, 36, 0.18), rgba(255, 255, 255, 0.035)),
    #151515;
}

.diet-plan-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.diet-plan-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--red);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.diet-plan-card-main strong {
  display: block;
  color: #fff;
  font-size: 15px;
  line-height: 1.15;
}

.diet-plan-card-main p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.diet-plan-status {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 8px;
  color: #d8d8d8;
  background: rgba(0, 0, 0, 0.24);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.diet-plan-card.active .diet-plan-status {
  border-color: rgba(237, 28, 36, 0.46);
  color: #fff;
  background: rgba(237, 28, 36, 0.16);
}

.diet-plan-metrics {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
}

.diet-plan-metrics span {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 3px;
  padding: 6px 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.diet-plan-metrics b {
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diet-plan-metrics small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.diet-plan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.diet-plan-actions button {
  min-height: 34px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.diet-search-panel {
  width: min(560px, 100%);
}

.global-search-panel {
  width: min(560px, 100%);
  border-color: rgba(237, 28, 36, 0.42);
  background:
    radial-gradient(circle at 18% 0%, rgba(237, 28, 36, 0.18), transparent 34%),
    linear-gradient(180deg, #1a1a1a, #101010);
}

.global-search-head {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.global-search-head span {
  display: inline-flex;
  margin-bottom: 4px;
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.global-search-box {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid rgba(237, 28, 36, 0.36);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.34);
  color: #fff;
  padding: 0 12px;
}

.global-search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.global-search-box input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.global-search-results {
  display: grid;
  gap: 12px;
  margin-top: 13px;
}

.global-search-group {
  display: grid;
  gap: 7px;
}

.global-search-group h4 {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.global-search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.global-search-result > button:first-child {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "type title"
    "type meta";
  column-gap: 9px;
  align-items: center;
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  padding: 9px;
  text-align: left;
}

.global-search-result > button:first-child:active,
.global-search-result > button:first-child:hover {
  border-color: rgba(237, 28, 36, 0.5);
  background: rgba(237, 28, 36, 0.12);
}

.global-search-type {
  grid-area: type;
  min-width: 56px;
  border: 1px solid rgba(237, 28, 36, 0.34);
  border-radius: 999px;
  color: #f4b4b4;
  background: rgba(237, 28, 36, 0.08);
  padding: 5px 7px;
  font-size: 9px;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.global-search-result strong {
  grid-area: title;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-result small {
  grid-area: meta;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-follow {
  min-width: 64px;
  border: 1px solid rgba(237, 28, 36, 0.48);
  border-radius: 10px;
  background: rgba(237, 28, 36, 0.16);
  color: #fff;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 950;
}

.diet-search-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0 12px;
}

.diet-search-steps button {
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #202020;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 6px 3px;
}

.diet-search-steps button span {
  width: 20px;
  height: 20px;
  border: 1px solid currentColor;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 10px;
}

.diet-search-steps button.active {
  border-color: var(--red);
  background: linear-gradient(135deg, rgba(237, 28, 36, 0.28), rgba(255, 255, 255, 0.03));
  color: #fff;
}

.diet-search-steps button.done {
  color: rgba(255, 255, 255, 0.76);
}

.diet-search-pane {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #1f1f1f;
  padding: 12px;
}

.diet-search-pane h3 {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.diet-help-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--red);
  background: rgba(237, 28, 36, 0.16);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.diet-search-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.diet-search-goals,
.diet-search-restrictions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.diet-search-choice-grid button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111;
  color: var(--text);
  min-height: 44px;
  padding: 8px;
  font-weight: 850;
  font-size: 12px;
}

.diet-search-choice-grid button.active {
  border-color: var(--red);
  background: linear-gradient(135deg, rgba(237, 28, 36, 0.28), rgba(255, 255, 255, 0.04));
}

.diet-target-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.diet-target-preview strong,
.diet-target-preview span {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111;
  padding: 9px 8px;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
}

.diet-target-preview.water {
  grid-template-columns: 1fr 1fr;
}

.diet-search-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.diet-search-pref-group {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #141414;
  padding: 9px;
  margin-bottom: 9px;
}

.diet-search-pref-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.diet-search-pref-head strong {
  font-size: 12px;
}

.diet-search-pref-head button {
  width: auto;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 11px;
}

.diet-search-pref-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.diet-search-pref-chips button {
  width: auto;
  border: 1px solid rgba(237, 28, 36, 0.55);
  border-radius: 999px;
  background: rgba(237, 28, 36, 0.11);
  color: #fff;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
}

.diet-search-pref-chips small {
  color: var(--muted);
  font-size: 11px;
}

.diet-search-drink-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.diet-search-drink-grid button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101010;
  color: rgba(255, 255, 255, 0.86);
  min-height: 36px;
  padding: 7px;
  font-size: 11px;
  font-weight: 900;
}

.diet-search-drink-grid button.active {
  border-color: var(--red);
  background: linear-gradient(135deg, rgba(237, 28, 36, 0.28), rgba(255, 255, 255, 0.04));
  color: #fff;
}

.diet-search-pref-panel {
  width: min(560px, 100%);
  padding: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #151515;
}

.diet-search-pref-panel > .diet-card-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #151515;
  margin-bottom: 8px;
}

.diet-search-pref-segment {
  position: sticky;
  top: 49px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  background: #151515;
}

.diet-search-pref-segment button {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #202020;
  color: rgba(255, 255, 255, 0.72);
  min-height: 38px;
  padding: 8px;
  font-size: 12px;
  font-weight: 900;
}

.diet-search-pref-segment button.active {
  border-color: var(--red);
  background: linear-gradient(135deg, rgba(237, 28, 36, 0.30), rgba(255, 255, 255, 0.035));
  color: #fff;
}

.diet-search-pref-search {
  position: sticky;
  top: 95px;
  z-index: 2;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  border: 1px solid rgba(237, 28, 36, 0.46);
  border-radius: 9px;
  background: #090909;
  margin-bottom: 10px;
  min-height: 40px;
}

.diet-search-pref-search span {
  display: grid;
  place-items: center;
  color: var(--red);
  font-weight: 900;
}

.diet-search-pref-input {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  min-height: 38px;
  padding: 0 10px 0 0;
  font-size: 13px;
  font-weight: 800;
}

.diet-search-pref-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: min(560px, 62dvh);
  padding-right: 2px;
}

.diet-search-pref-list::-webkit-scrollbar {
  display: none;
}

.diet-search-pref-panel .diet-search-pref-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "info kcal"
    "macros macros";
  gap: 8px 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  color: #fff;
  padding: 10px;
  text-align: left;
  min-height: 76px;
  width: 100%;
  font-family: inherit;
}

.diet-search-pref-panel .diet-search-pref-item:active,
.diet-search-pref-panel .diet-search-pref-item:hover {
  border-color: rgba(237, 28, 36, 0.7);
  background: linear-gradient(135deg, rgba(237, 28, 36, 0.16), rgba(255, 255, 255, 0.03));
}

.diet-search-pref-panel .diet-search-pref-info {
  grid-area: info;
  min-width: 0;
}

.diet-search-pref-panel .diet-search-pref-info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.2;
}

.diet-search-pref-panel .diet-search-pref-info small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 850;
}

.diet-search-pref-panel .diet-search-pref-kcal {
  grid-area: kcal;
  min-width: 54px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: #0d0d0d;
  padding: 6px 8px;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: 950;
}

.diet-search-pref-panel .diet-search-pref-kcal small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  line-height: 1;
  text-transform: uppercase;
}

.diet-search-pref-panel .diet-search-pref-macros {
  grid-area: macros;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.diet-search-pref-panel .diet-search-pref-macros i {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  padding: 5px 4px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.diet-search-preview-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.diet-search-preview-meal {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111;
  padding: 9px;
}

.diet-search-preview-meal strong,
.diet-search-preview-meal small {
  display: block;
}

.diet-search-preview-meal small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.diet-search-preview-meal p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 520px) {
  .diet-search-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .diet-search-goals,
  .diet-search-restrictions,
  .diet-target-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.diet-meal-card header,
.diet-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.diet-meal-card h4,
.diet-card-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.diet-meal-card small,
.diet-card-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.diet-meal-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.diet-meal-actions .btn,
.diet-meal-card .btn {
  min-height: 36px;
}

.diet-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.diet-day {
  min-height: 76px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  padding: 9px;
}

.diet-day strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 12px;
}

.diet-day small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.diet-day.good {
  border-color: rgba(28, 185, 111, 0.45);
}

.diet-day.warn {
  border-color: rgba(245, 177, 66, 0.45);
}

.diet-day.bad {
  border-color: rgba(239, 35, 48, 0.45);
}

.diet-day.empty {
  opacity: 0.75;
}

.diet-feedback {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.diet-feedback div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.diet-dashboard {
  gap: 12px;
}

.diet-date-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px auto;
  gap: 8px;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  padding: 8px;
}

.diet-date-control button,
.diet-date-control label {
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
}

.diet-date-control button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.diet-date-control button:disabled {
  opacity: 0.35;
  cursor: default;
}

.diet-date-control label {
  display: grid;
  grid-template-columns: minmax(70px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

.diet-date-control span {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.diet-date-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  color-scheme: dark;
  font-size: 12px;
  font-weight: 800;
  outline: 0;
}

.diet-date-control input::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.9) grayscale(1);
  opacity: 1;
  cursor: pointer;
}

.diet-date-control .diet-date-today {
  padding: 0 12px;
  color: var(--red);
  font-size: 12px;
}

@media (max-width: 420px) {
  .diet-date-control {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
  }

  .diet-date-control .diet-date-today {
    grid-column: 1 / -1;
  }
}

.diet-active-card {
  border: 1px solid rgba(225, 27, 34, 0.38);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(225, 27, 34, 0.16), rgba(18, 18, 18, 0.98) 45%, rgba(255, 255, 255, 0.035));
  padding: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.diet-today-card {
  border: 1px solid rgba(225, 27, 34, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(225, 27, 34, 0.14), rgba(255, 255, 255, 0.03) 34%, rgba(0, 0, 0, 0.28)),
    var(--panel);
  padding: 12px;
}

.diet-today-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.diet-today-main h2 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1.05;
}

.diet-today-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.diet-today-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.diet-today-mini button {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: #fff;
  padding: 9px 8px;
  text-align: left;
}

.diet-today-mini small,
.diet-today-mini span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  font-weight: 900;
  text-transform: uppercase;
  white-space: normal;
}

.diet-today-mini strong {
  display: block;
  margin: 4px 0 2px;
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

.diet-today-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.diet-today-actions button {
  min-height: 38px;
  font-size: 11px;
}

.diet-active-top,
.diet-meal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.diet-kicker {
  display: inline-flex;
  margin-bottom: 4px;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.diet-active-card h2 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1.05;
}

.diet-active-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.diet-target-grid,
.diet-comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.diet-target-grid div,
.diet-comparison-grid div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  padding: 9px;
}

.diet-target-grid small,
.diet-comparison-grid span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.diet-target-grid strong,
.diet-comparison-grid strong {
  display: inline-block;
  margin-top: 4px;
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.diet-target-grid span {
  margin-left: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.diet-active-consumed {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.diet-active-consumed span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.diet-progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.diet-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #fff);
}

.diet-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.diet-quick-actions button {
  min-height: 40px;
  padding-inline: 8px;
  font-size: 11px;
}

.diet-quick-fab {
  position: fixed;
  right: max(calc(18px + var(--safe-right)), calc((100vw - var(--app-max-width)) / 2 + 18px + var(--safe-right)));
  bottom: calc(84px + var(--safe-bottom));
  z-index: 70;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.diet-quick-fab-main {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(225, 27, 34, 0.72);
  border-radius: 999px;
  background: #e11b22;
  color: #fff;
  box-shadow: 0 14px 38px rgba(225, 27, 34, 0.36), 0 12px 60px rgba(0, 0, 0, 0.45);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.diet-quick-fab.open .diet-quick-fab-main {
  transform: rotate(45deg);
}

.diet-quick-fab-menu {
  display: grid;
  gap: 8px;
  width: min(230px, calc(100vw - 44px));
}

.diet-quick-fab-menu button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-areas: "icon title" "icon sub";
  column-gap: 9px;
  align-items: center;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(18, 18, 18, 0.96);
  color: #fff;
  padding: 8px 10px;
  text-align: left;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.36);
}

.diet-quick-fab-menu button span {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(225, 27, 34, 0.18);
  color: #fff;
  font-weight: 950;
}

.diet-quick-fab-menu button strong {
  grid-area: title;
  font-size: 12px;
  font-weight: 950;
}

.diet-quick-fab-menu button small {
  grid-area: sub;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.diet-quick-water-control {
  display: grid;
  gap: 8px;
  min-height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(18, 18, 18, 0.96);
  color: #fff;
  padding: 10px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.36);
}

.diet-quick-water-control > div:first-child {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 9px;
}

.diet-quick-water-control > div:first-child span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(225, 27, 34, 0.18);
  font-weight: 950;
}

.diet-quick-water-control strong {
  font-size: 12px;
  font-weight: 950;
}

.diet-quick-water-control small {
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.diet-quick-water-control input[type="range"] {
  width: 100%;
  height: 18px;
  accent-color: var(--red);
  cursor: pointer;
}

.diet-quick-water-control input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(225, 27, 34, 0.9), rgba(255, 255, 255, 0.18));
}

.diet-quick-water-control input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(225, 27, 34, 0.18);
  -webkit-appearance: none;
}

.diet-quick-water-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.diet-quick-water-control button {
  display: block;
  min-height: 34px;
  border: 1px solid rgba(225, 27, 34, 0.55);
  border-radius: 8px;
  background: rgba(225, 27, 34, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  text-align: center;
}

.diet-macro-grid .stat {
  min-height: 82px;
}

.water-tracker-card {
  border-color: rgba(120, 190, 235, 0.22);
}

/* ===== Hidratação: água preenche o card inteiro, atrás do conteúdo ===== */
.water-tracker-filled {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.water-tracker-filled > *:not(.water-bg) {
  position: relative;
  z-index: 1;
}

.water-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.water-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--water-level, 0%);
  /* água mais escura */
  background: linear-gradient(180deg, #0b4a86 0%, #073a6b 45%, #04274d 100%);
  box-shadow: inset 0 8px 24px rgba(0, 0, 0, 0.32);
  transition: height 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.water-fill::before,
.water-fill::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  background-repeat: repeat-x;
  background-position: 0 0;
  will-change: background-position;
}

.water-fill::before {
  top: -25px;
  height: 42px;
  opacity: 0.78;
  background-image:
    radial-gradient(46px 24px at 23px 24px, rgba(13, 83, 145, 0.96) 48%, transparent 51%),
    radial-gradient(46px 24px at 69px 20px, rgba(13, 83, 145, 0.74) 48%, transparent 51%);
  background-size: 92px 42px;
  animation: ratlabWaterBgFlow 6.8s linear infinite;
}

.water-fill::after {
  top: -18px;
  height: 34px;
  opacity: 0.92;
  background-image:
    radial-gradient(38px 18px at 19px 18px, rgba(25, 111, 184, 0.96) 48%, transparent 52%),
    radial-gradient(38px 18px at 57px 15px, rgba(25, 111, 184, 0.72) 48%, transparent 52%);
  background-size: 76px 34px;
  animation: ratlabWaterBgFlowReverse 4.6s linear infinite;
}

.water-surf {
  display: none;
}

.water-surf-back {
  height: 30px;
  top: -20px;
  animation: ratlabWaterFlow 7s linear infinite;
}
.water-surf-back path { fill: #0b4a86; opacity: 0.6; }

.water-surf-front {
  animation: ratlabWaterFlow 4.5s linear infinite;
}
.water-surf-front path { fill: #0d5391; opacity: 0.92; }

@keyframes ratlabWaterFlow {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes ratlabWaterBgFlow {
  from { background-position-x: 0; }
  to { background-position-x: 92px; }
}

@keyframes ratlabWaterBgFlowReverse {
  from { background-position-x: 0; }
  to { background-position-x: -76px; }
}

.water-big-percent {
  text-align: center;
  font-size: 40px;
  font-weight: 950;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  margin: 8px 0 4px;
}

.water-tracker-simple {
  padding: 12px;
}

.water-tracker-simple .diet-card-head {
  margin-bottom: 8px;
}

.water-simple-meter {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0 2px;
}

.water-simple-meter strong {
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.water-simple-meter span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.water-tracker-simple .water-quick-buttons {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.water-tracker-simple .water-quick-buttons button {
  min-height: 32px;
}

.water-tracker-simple .water-custom-form {
  grid-template-columns: minmax(0, 1fr) 92px;
}

.diet-targets-panel,
.diet-consumption-panel {
  width: min(520px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 70px));
  overflow: auto;
}

.diet-targets-list,
.diet-consumption-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.diet-targets-list div,
.diet-consumption-list div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  padding: 10px;
}

.diet-targets-list span,
.diet-consumption-list small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.diet-targets-list strong,
.diet-consumption-list strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 14px;
}

.diet-targets-list small,
.diet-consumption-list span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 800;
}

.diet-targets-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(225, 27, 34, 0.36);
  border-radius: 8px;
  background: rgba(225, 27, 34, 0.08);
  padding: 10px;
  color: #fff;
  font-weight: 900;
}

@media (prefers-reduced-motion: reduce) {
  .water-surf-back, .water-surf-front, .water-fill::before, .water-fill::after { animation: none; }
}

.diet-water-period .diet-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
}
.diet-water-period .diet-check-row input { width: 18px; height: 18px; accent-color: var(--red, #e11b22); }
.diet-water-period small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.water-quick-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.water-quick-buttons button,
.water-custom-form button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.water-custom-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  margin-top: 8px;
}

.water-custom-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f0f0f;
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.water-week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.water-week-row span {
  min-height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.water-week-row span.hit {
  border-color: rgba(28, 185, 111, 0.48);
  color: #5ee39a;
  background: rgba(28, 185, 111, 0.12);
}

.diet-option-list {
  display: grid;
  gap: 6px;
  margin: 7px 0;
}

.diet-option-consume {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 7px 8px;
}

.diet-meal-card-compact {
  position: relative;
  padding: 9px 10px;
  border-left: 3px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
}

.diet-meal-card-compact .diet-meal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.diet-meal-card-compact .diet-meal-head strong {
  display: block;
  font-size: 14px;
  line-height: 1.1;
}

.diet-meal-card-compact .diet-meal-head p {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.1;
}

.diet-meal-state {
  min-width: 50px;
  justify-content: center;
  padding: 5px 8px;
  font-size: 9px;
  text-transform: uppercase;
}

.diet-option-consume .diet-option-summary {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.diet-option-consume .diet-option-summary strong {
  display: block;
  font-size: 11px;
  line-height: 1.05;
}

.diet-option-consume .diet-option-summary small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diet-option-consume.expanded {
  grid-template-columns: minmax(0, 1fr) 82px;
}

.diet-option-foods-inline {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.diet-option-foods-inline span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.diet-option-foods-inline strong {
  max-width: 58%;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diet-meal-actions-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.diet-meal-actions-row .pill {
  width: 100%;
  justify-content: center;
  min-height: 24px;
  padding: 5px 6px;
  border-radius: 999px;
  font-size: 9px;
}

.diet-meal-actions-row .pill.active {
  color: #fff;
  border-color: rgba(225, 27, 34, 0.7);
  background: rgba(225, 27, 34, 0.28);
}

.diet-meal-actions-row .pill:disabled,
.diet-consume-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.diet-consume-btn {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 10px;
}

.diet-meal-balance {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.diet-meal-card-compact.meal-good {
  border-left-color: #1cb96f;
  background: linear-gradient(135deg, rgba(28, 185, 111, 0.16), rgba(28, 185, 111, 0.04));
}

.diet-meal-card-compact.meal-near {
  border-left-color: #f6c945;
  background: linear-gradient(135deg, rgba(246, 201, 69, 0.15), rgba(246, 201, 69, 0.035));
}

.diet-meal-card-compact.meal-warn {
  border-left-color: #fb923c;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.16), rgba(251, 146, 60, 0.035));
}

.diet-meal-card-compact.meal-bad,
.diet-meal-card-compact.meal-missed {
  border-left-color: #ef1b2d;
  background: linear-gradient(135deg, rgba(239, 27, 45, 0.16), rgba(239, 27, 45, 0.035));
}

.diet-meal-card-compact.meal-pending {
  border-left-color: rgba(255, 255, 255, 0.14);
}

.meal-good .diet-meal-state {
  border-color: rgba(28, 185, 111, 0.48);
  color: #5ee39a;
  background: rgba(28, 185, 111, 0.12);
}

.meal-near .diet-meal-state {
  border-color: rgba(246, 201, 69, 0.5);
  color: #f8d96a;
  background: rgba(246, 201, 69, 0.12);
}

.meal-warn .diet-meal-state {
  border-color: rgba(251, 146, 60, 0.5);
  color: #fdba74;
  background: rgba(251, 146, 60, 0.12);
}

.meal-bad .diet-meal-state,
.meal-missed .diet-meal-state {
  border-color: rgba(239, 27, 45, 0.5);
  color: #ff8a92;
  background: rgba(239, 27, 45, 0.12);
}

.diet-partial-panel {
  max-width: 430px;
}

.diet-partial-options {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}

.diet-partial-options::-webkit-scrollbar {
  display: none;
}

.diet-partial-options button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111;
  color: var(--muted);
  padding: 0 12px;
  font-size: 11px;
  font-weight: 900;
}

.diet-partial-options button.active {
  border-color: var(--red);
  color: #fff;
  background: rgba(225, 27, 34, 0.16);
}

.diet-partial-food-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.diet-partial-food {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 9px;
}

.diet-partial-food input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}

.diet-partial-food strong,
.diet-partial-food small {
  display: block;
}

.diet-partial-food strong {
  font-size: 12px;
}

.diet-partial-food small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.diet-partial-extra {
  border: 1px solid rgba(225, 27, 34, 0.28);
  border-radius: 8px;
  background: rgba(225, 27, 34, 0.06);
  padding: 10px;
}

.diet-partial-extra > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.diet-day-water-field {
  margin: 10px 0;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.06);
  padding: 10px;
}

.diet-month-card {
  overflow: visible;
}

.diet-month-weekdays,
.diet-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.diet-month-weekdays {
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.diet-month-grid {
  margin-top: 8px;
}

.diet-month-blank {
  min-height: 36px;
}

.diet-month-day {
  position: relative;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #111;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.diet-month-day span {
  position: absolute;
  right: 7px;
  bottom: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b7280;
}

.diet-month-day.good span { background: #22c55e; }
.diet-month-day.partial span { background: #f59e0b; }
.diet-month-day.bad span { background: #ef4444; }
.diet-month-day.future { color: #757575; }

.diet-month-day em {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 4;
  display: none;
  width: 150px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #0d0d0d;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  line-height: 1.35;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

.diet-month-day:hover em,
.diet-month-day:focus-visible em {
  display: block;
}

.diet-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.diet-report-grid div,
.diet-history-day {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111;
  padding: 10px;
}

.diet-report-grid small,
.diet-history-day small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.diet-report-grid strong {
  display: inline-block;
  margin-top: 4px;
  color: #fff;
  font-size: 17px;
}

.diet-report-grid span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.diet-history-day {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.diet-history-day > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.diet-history-day span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 7px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.diet-advanced-report .card {
  overflow: hidden;
}

.diet-history-custom-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.diet-history-custom-range label,
.diet-report-filters .field {
  min-width: 0;
}

.diet-history-custom-range label {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.diet-history-custom-range span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.diet-history-custom-range input,
.diet-report-filters input,
.diet-report-filters select,
.diet-month-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #080808;
  color: #fff;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 800;
}

.diet-history-checks > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.diet-history-checks button {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .72);
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 900;
}

.diet-history-checks button.active {
  border-color: rgba(225, 27, 34, .78);
  color: #fff;
  background: rgba(225, 27, 34, .18);
}

.diet-report-hero {
  border-color: rgba(225, 27, 34, .32);
  background: linear-gradient(145deg, rgba(225, 27, 34, .12), rgba(17, 17, 17, .98) 44%, rgba(255, 255, 255, .025));
}

.diet-report-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.diet-report-panels {
  gap: 10px;
}

.diet-analytics-chart {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: #090909;
  padding: 8px;
}

.diet-line-chart svg {
  width: 100%;
  height: 130px;
  display: block;
}

.diet-line-chart path {
  stroke: rgba(255, 255, 255, .12);
  stroke-width: 1;
  fill: none;
}

.diet-line-chart polyline {
  stroke: var(--red);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(225, 27, 34, .35));
}

.diet-line-chart circle {
  fill: #fff;
  stroke: var(--red);
  stroke-width: 1.5;
}

.diet-report-bars {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.diet-report-bar-row {
  display: grid;
  grid-template-columns: minmax(72px, .8fr) minmax(0, 1.4fr) 44px;
  gap: 8px;
  align-items: center;
}

.diet-report-bar-row span {
  min-width: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diet-report-bar-row div {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.diet-report-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #ffb020, #2ecc71);
}

.diet-report-bar-row strong {
  color: #fff;
  font-size: 11px;
  text-align: right;
}

.diet-donut-wrap {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.diet-donut {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}

.diet-donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: #111;
}

.diet-donut span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.diet-donut-legend {
  display: grid;
  gap: 6px;
}

.diet-donut-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .74);
  font-size: 10px;
  font-weight: 800;
}

.diet-donut-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.diet-ranking-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.diet-ranking-list > div {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101010;
  padding: 8px;
}

.diet-ranking-list.compact > div {
  grid-template-columns: 26px minmax(0, 1fr);
}

.diet-ranking-list strong,
.diet-ranking-list small {
  display: block;
}

.diet-ranking-list strong {
  color: #fff;
  font-size: 12px;
}

.diet-ranking-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.diet-ranking-list em {
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.diet-history-day {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.diet-history-detail-panel {
  max-width: 540px;
}

.diet-detail-section {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.diet-detail-section > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(0, 0, 0, .22);
  padding: 8px;
}

.diet-detail-section span {
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  font-weight: 800;
}

.diet-detail-section strong {
  color: #fff;
  font-size: 12px;
}

.diet-month-day.empty {
  border-color: rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}

.diet-month-day.empty span {
  background: rgba(255, 255, 255, .16);
}

@media (max-width: 520px) {
  .diet-report-panels.grid-2,
  .diet-history-custom-range {
    grid-template-columns: 1fr;
  }

  .diet-donut-wrap {
    grid-template-columns: 1fr;
  }

  .diet-report-bar-row {
    grid-template-columns: 68px minmax(0, 1fr) 38px;
  }
}

.diet-option-consume.selected {
  border-color: rgba(28, 185, 111, 0.5);
  background: rgba(28, 185, 111, 0.1);
}

.diet-option-consume strong,
.diet-option-consume small {
  display: block;
}

.diet-option-consume strong {
  color: #fff;
  font-size: 11px;
}

.diet-history-premium {
  gap: 12px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.diet-history-premium *,
.diet-history-premium *::before,
.diet-history-premium *::after {
  min-width: 0;
}

.diet-history-premium-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
}

.diet-period-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
}

.diet-period-selector button,
.diet-filter-trigger,
.diet-chart-switch button {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .78);
  min-height: 34px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 900;
}

.diet-period-selector button.active,
.diet-chart-switch button.active {
  border-color: rgba(225, 27, 34, .85);
  background: var(--red);
  color: #fff;
}

.diet-filter-trigger {
  border-color: rgba(255, 255, 255, .16);
  color: #fff;
  width: 100%;
}

.diet-adherence-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, .08), transparent 38%), linear-gradient(145deg, rgba(20, 20, 20, .98), rgba(12, 12, 12, .98));
  padding: 15px;
  overflow: hidden;
}

.diet-adherence-card > div:first-child {
  display: grid;
  align-content: center;
  gap: 4px;
}

.diet-adherence-card span,
.diet-score-main span,
.diet-mini-kpis span {
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.diet-adherence-card > div:first-child strong {
  color: #fff;
  font-size: clamp(42px, 14vw, 64px);
  line-height: .92;
  letter-spacing: 0;
}

.diet-adherence-card em,
.diet-score-main em {
  width: max-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.diet-adherence-card.excellent,
.diet-adherence-card.good {
  border-color: rgba(34, 197, 94, .38);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .12);
}

.diet-adherence-card.ok {
  border-color: rgba(250, 204, 21, .32);
}

.diet-adherence-card.warn,
.diet-adherence-card.bad {
  border-color: rgba(245, 158, 11, .32);
}

.diet-adherence-meta {
  display: grid;
  gap: 7px;
}

.diet-adherence-meta p {
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 800;
}

.diet-adherence-meta p.positive {
  color: #86efac;
}

.diet-adherence-meta p.negative {
  color: #fca5a5;
}

.diet-adherence-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
  padding: 8px 9px;
}

.diet-adherence-meta div strong {
  color: #fff;
  font-size: 11px;
  text-align: right;
}

.diet-main-chart-card,
.diet-nutrition-score-card,
.diet-diagnostic-card,
.diet-meal-adherence-card,
.diet-water-performance-card,
.diet-offplan-summary-card,
.diet-supplement-summary-card,
.diet-heatmap-card {
  border-color: rgba(255, 255, 255, .09);
  background: linear-gradient(180deg, rgba(28, 28, 28, .96), rgba(14, 14, 14, .98));
}

.diet-chart-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
}

.diet-premium-chart {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: #090909;
  padding: 10px;
}

.diet-chart-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.diet-chart-title strong {
  color: #fff;
  font-size: 13px;
}

.diet-chart-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.diet-premium-chart svg {
  display: block;
  width: 100%;
  height: 110px;
}

.diet-premium-chart .grid {
  fill: none;
  stroke: rgba(255, 255, 255, .13);
}

.diet-premium-chart polyline {
  fill: none;
  stroke: #e11b22;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diet-premium-chart circle {
  fill: #fff;
  stroke: #e11b22;
  stroke-width: 1.5;
}

.diet-nutrition-score-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
}

.diet-score-main {
  display: grid;
  gap: 4px;
}

.diet-score-main strong {
  color: #fff;
  font-size: 42px;
  line-height: 1;
}

.diet-score-components {
  display: grid;
  gap: 7px;
}

.diet-score-components div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
}

.diet-score-components span,
.diet-score-components strong {
  color: rgba(255, 255, 255, .78);
  font-size: 10px;
  font-weight: 900;
}

.diet-score-components strong {
  text-align: right;
}

.diet-score-components i,
.diet-premium-bar-row div {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.diet-score-components b,
.diet-premium-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef4444, #facc15, #22c55e);
}

.diet-diagnosis-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.diet-diagnosis-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  padding: 9px;
}

.diet-diagnosis-item span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.diet-diagnosis-item.win span {
  background: rgba(34, 197, 94, .22);
  color: #86efac;
}

.diet-diagnosis-item.warn span {
  background: rgba(250, 204, 21, .18);
  color: #fde68a;
}

.diet-diagnosis-item.pattern span {
  background: rgba(255, 255, 255, .09);
  color: #fff;
}

.diet-diagnosis-item p {
  margin: 0;
  color: rgba(255, 255, 255, .76);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
}

.diet-premium-bars {
  display: grid;
  gap: 9px;
  margin-top: 8px;
}

.diet-premium-bar-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.diet-premium-bar-row span,
.diet-premium-bar-row strong {
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.diet-premium-bar-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diet-premium-bar-row.good i,
.diet-premium-bar-row.excellent i {
  background: #22c55e;
}

.diet-premium-bar-row.ok i {
  background: #facc15;
}

.diet-premium-bar-row.warn i {
  background: #f59e0b;
}

.diet-premium-bar-row.bad i {
  background: #ef4444;
}

.diet-premium-compact-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.diet-water-performance-card h3,
.diet-offplan-summary-card h3,
.diet-supplement-summary-card h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 15px;
}

.diet-mini-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.diet-mini-kpis div {
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 10px;
  background: rgba(0, 0, 0, .2);
  padding: 9px;
}

.diet-mini-kpis strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 13px;
}

.diet-offplan-hero {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.diet-offplan-hero strong {
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.diet-offplan-hero span,
.diet-offplan-summary-card p {
  color: rgba(255, 255, 255, .68);
  font-size: 11px;
  font-weight: 800;
}

.diet-supplement-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.diet-supplement-pills span {
  display: grid;
  gap: 2px;
  min-width: 110px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  padding: 9px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.diet-supplement-pills strong {
  color: #fff;
  font-size: 12px;
}

.diet-heatmap {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  grid-auto-rows: 18px;
  gap: 4px;
  margin-top: 8px;
}

.diet-heat-day {
  width: 100%;
  height: 18px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, .1);
  cursor: pointer;
}

.diet-heat-day.good {
  background: #22c55e;
}

.diet-heat-day.mid {
  background: #facc15;
}

.diet-heat-day.bad {
  background: #ef4444;
}

.diet-heat-day.empty {
  background: #2d2d2d;
}

.diet-history-filter-backdrop {
  align-items: flex-end;
}

.diet-history-filter-sheet {
  width: min(540px, 100%);
  max-height: 82vh;
  overflow: auto;
  border-radius: 18px 18px 0 0;
  border-color: rgba(255, 255, 255, .14);
  background: #151515;
}

.diet-history-filter-sheet .form-grid {
  margin-top: 10px;
}

@media (max-width: 560px) {
  .diet-history-premium-head,
  .diet-adherence-card,
  .diet-nutrition-score-card,
  .diet-premium-compact-grid.grid-2 {
    grid-template-columns: 1fr;
  }

  .diet-period-selector {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .diet-filter-trigger {
    width: 100%;
  }

  .diet-chart-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diet-premium-bar-row {
    grid-template-columns: 92px minmax(0, 1fr) 34px;
  }

  .diet-heatmap {
    grid-template-columns: repeat(12, 1fr);
  }
}

.diet-option-consume small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
}

.diet-option-consume button {
  min-height: 30px;
  border: 1px solid rgba(225, 27, 34, 0.45);
  border-radius: 8px;
  background: rgba(225, 27, 34, 0.14);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.supplement-log-panel .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.supplement-log-panel .field.full {
  grid-column: 1 / -1;
}

.macro-chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.macro-chip-row span,
.extra-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 900;
}

.extra-badge {
  border-color: rgba(225, 27, 34, 0.45);
  background: rgba(225, 27, 34, 0.12);
  color: #fff;
}

.extra-food-item,
.recipe-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
}

.extra-food-item strong,
.recipe-card strong {
  display: block;
  color: #fff;
  font-size: 13px;
}

.extra-food-item small,
.recipe-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}

.recipe-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(62px, 1fr));
  gap: 6px;
}

.recipe-actions button {
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  color: #fff;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 900;
}

.recipe-actions button:first-child {
  border-color: rgba(225, 27, 34, 0.45);
  background: rgba(225, 27, 34, 0.16);
}

.extra-food-panel .form-grid,
.recipe-builder-panel .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.extra-food-panel .field.full,
.recipe-builder-panel .field.full {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 900;
}

.check-row input {
  accent-color: var(--red);
}

.recipe-total-card {
  border: 1px solid rgba(225, 27, 34, 0.35);
  border-radius: 10px;
  background: rgba(225, 27, 34, 0.1);
  padding: 12px;
  margin: 12px 0;
}

.recipe-total-card strong {
  display: block;
  color: #fff;
  font-size: 17px;
}

.recipe-total-card small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.recipe-ingredient-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 92px 58px 62px 36px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
}

.recipe-ingredient-row input,
.recipe-ingredient-row select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #0f0f0f;
  color: #fff;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.recipe-ingredient-row span {
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.diet-mini-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 32px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.diet-mini-check input {
  width: 12px;
  height: 12px;
  min-height: 0;
  accent-color: var(--primary);
}

.recipe-save-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

@media (max-width: 520px) {
  .extra-food-item,
  .recipe-card {
    grid-template-columns: 1fr;
  }

  .recipe-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .recipe-actions button {
    padding: 0 4px;
    font-size: 9px;
  }

  .recipe-ingredient-row {
    grid-template-columns: minmax(0, 1fr) 66px;
  }

  .recipe-ingredient-row select,
  .recipe-ingredient-row span,
  .recipe-ingredient-row .icon-btn {
    grid-column: span 1;
  }

  .recipe-save-options,
  .extra-food-panel .form-grid,
  .recipe-builder-panel .form-grid {
    grid-template-columns: 1fr;
  }
}

.training-resume-banner {
  position: sticky;
  top: calc(70px + var(--safe-top));
  z-index: 9;
  width: calc(100% - 24px);
  margin: 8px auto 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(225, 27, 34, 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(225, 27, 34, 0.18), rgba(18, 18, 18, 0.96));
  color: var(--text);
  padding: 8px 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.training-resume-banner span {
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.training-resume-banner small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}

.training-flow {
  gap: 14px;
}

.training-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.training-step-header > div {
  min-width: 0;
  flex: 1 1 auto;
}

.training-step-header h1 {
  margin: 0;
  color: #fff;
  font-size: 25px;
  line-height: 1.05;
}

.training-step-header p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.training-back {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.11), transparent 54%),
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.025)),
    #080808;
  color: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.045),
    0 10px 22px rgba(0, 0, 0, 0.34);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.training-back svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.48));
  transform: translateX(-2px);
}

.training-back:hover,
.training-back:focus-visible {
  border-color: rgba(255, 255, 255, 0.44);
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(255, 255, 255, 0.08),
    0 12px 26px rgba(0, 0, 0, 0.42);
}

.training-back:active {
  transform: scale(0.95) translateY(1px);
  border-color: rgba(255, 255, 255, 0.56);
  background:
    radial-gradient(circle at 50% 54%, rgba(255, 255, 255, 0.13), transparent 58%),
    linear-gradient(180deg, #141414, #060606);
}

.training-top-actions,
.training-day-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.training-card-list,
.training-exercise-list {
  display: grid;
  gap: 10px;
}

.training-card-list {
  position: relative;
  contain: layout;
}

.training-plan-card,
.training-division-card,
.training-exercise-card {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #181818, #101010);
  color: var(--text);
  padding: 14px;
  text-align: left;
  box-shadow: none;
}

.training-plan-card,
.training-division-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  position: relative;
}

.training-plan-card {
  grid-template-columns: minmax(0, 1fr) minmax(74px, 0.34fr) 30px 30px;
  gap: 8px;
  min-height: 74px;
  padding: 12px 12px 12px 14px;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  will-change: transform;
}

.training-division-card {
  grid-template-columns: 42px minmax(0, 1fr) 34px 34px;
  position: relative;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.training-plan-card.dragging,
.training-division-card.dragging {
  opacity: 0.18;
  transform: scale(0.985);
  border-color: rgba(225, 27, 34, 0.5);
  background: rgba(225, 27, 34, 0.08);
}

.training-plan-card.reordered,
.training-division-card.reordered {
  animation: trainingCardSettled 0.34s ease;
}

.training-plan-card.drop-target,
.training-division-card.drop-target {
  border-color: var(--red);
  background: rgba(225, 27, 34, 0.13);
  box-shadow: inset 0 0 0 1px rgba(225, 27, 34, 0.42), 0 12px 26px rgba(0, 0, 0, 0.24);
}

.training-plan-card.shift-up,
.training-plan-card.shift-down,
.training-division-card.shift-up,
.training-division-card.shift-down {
  transform: translate3d(0, var(--drag-shift, 0), 0);
}

.plan-drag-ghost,
.division-drag-ghost {
  position: fixed;
  z-index: 1600;
  pointer-events: none;
  margin: 0;
  opacity: 0.98;
  border-color: var(--red);
  background: linear-gradient(180deg, #252525, #151515);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(225, 27, 34, 0.55);
  transform-origin: center;
  transition: box-shadow 0.16s ease, opacity 0.16s ease;
  display: grid;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.plan-drag-ghost {
  grid-template-columns: minmax(0, 1fr) minmax(74px, 0.34fr) 30px 30px;
}

.division-drag-ghost {
  grid-template-columns: 42px minmax(0, 1fr) 34px 34px;
}

.training-plan-drag,
.training-division-drag {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  justify-self: end;
  touch-action: none;
}

.training-plan-drag:active,
.training-division-drag:active {
  cursor: grabbing;
}

body.plan-drag-active,
body.division-drag-active {
  overscroll-behavior: contain;
  touch-action: none;
}

@keyframes trainingCardSettled {
  0% {
    transform: translateY(-6px) scale(1.015);
    border-color: var(--red);
    box-shadow: 0 14px 28px rgba(225, 27, 34, 0.16);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: none;
  }
}

.danger-action {
  border-color: rgba(225, 27, 34, 0.5);
  color: #fff;
  background: rgba(225, 27, 34, 0.12);
}

.danger-action:hover,
.danger-action:focus-visible {
  border-color: rgba(225, 27, 34, 0.85);
  background: rgba(225, 27, 34, 0.22);
}

.training-delete-hint {
  margin: -2px 0 0;
  color: #ff9da1;
  font-size: 11px;
  line-height: 1.35;
}

.training-plan-card strong,
.training-division-card strong,
.training-exercise-card strong {
  display: block;
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
}

.training-plan-card strong {
  font-size: 13px;
  line-height: 1.12;
}

.training-plan-card small,
.training-division-card small,
.training-exercise-card small,
.training-plan-card em,
.training-division-card em {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 3px;
}

.training-plan-card small,
.training-plan-card em,
.training-plan-main,
.training-plan-last {
  min-width: 0;
}

.training-plan-card small,
.training-plan-card em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.training-plan-main {
  display: grid;
  gap: 1px;
}

.training-plan-last {
  text-align: right;
  justify-self: end;
  max-width: 88px;
}

.training-plan-last small {
  font-size: 9.5px;
  margin-top: 0;
}

.training-plan-last strong {
  font-size: 12px;
  margin-top: 3px;
}

.training-plan-edit {
  align-self: center;
  width: 30px;
  height: 30px;
  font-size: 12px;
}

@media (max-width: 390px) {
  .training-plan-card {
    grid-template-columns: minmax(0, 1fr) minmax(62px, 0.28fr) 28px 28px;
    gap: 6px;
    padding-inline: 12px 10px;
  }

  .training-plan-last {
    max-width: 72px;
  }

  .training-plan-card strong {
    font-size: 12.5px;
  }

  .training-plan-card small,
  .training-plan-card em {
    font-size: 9.8px;
  }

  .training-plan-drag,
  .training-plan-edit {
    width: 28px;
    height: 28px;
  }
}

.training-edit-plan-form {
  display: grid;
  gap: 12px;
}

.training-plan-save-action {
  min-height: 44px;
  margin: 2px 0 0;
  box-shadow: 0 12px 26px rgba(225, 27, 34, 0.18);
}

.training-plan-delete-action {
  position: relative;
  width: 100%;
  min-height: 40px;
  margin: 10px 0 0;
  border-style: dashed;
  background: rgba(225, 27, 34, 0.07);
}

.training-plan-delete-action::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.training-edit-day-info {
  flex: 0 0 34px;
}

.training-day-info-form {
  display: grid;
  gap: 12px;
}

.training-day-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  align-items: center;
  margin-top: 2px;
}

.training-day-form-actions button {
  min-height: 42px;
  margin: 0;
}

.training-action-save {
  box-shadow: 0 12px 26px rgba(225, 27, 34, 0.18);
}

.training-day-info-form > .danger-action {
  position: relative;
  width: 100%;
  min-height: 40px;
  margin: 10px 0 0;
  border-style: dashed;
  background: rgba(225, 27, 34, 0.07);
}

.training-day-info-form > .danger-action::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.training-letter {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 27, 34, 0.65);
  border-radius: 999px;
  color: var(--red);
  background: #090909;
  font-size: 18px;
  font-weight: 950;
}

.edit-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-weight: 900;
  justify-self: end;
}

.training-add-plan-button {
  width: 100%;
  min-height: 48px;
  border: 1px dashed rgba(225, 27, 34, 0.55);
  border-radius: 8px;
  background: rgba(225, 27, 34, 0.08);
  color: #fff;
  font-size: 14px;
  font-weight: 950;
}

/* ===== Dieta: refeições, editor e revisão ===== */
.diet-sequence-meal {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 122px 62px 26px;
  grid-template-areas:
    "num name time edit del"
    "num meta meta edit del";
  align-items: center;
  gap: 7px;
  min-height: 74px;
  padding: 8px;
  border-radius: 9px;
}
.diet-sequence-meal .diet-seq-num {
  grid-area: num;
  align-self: center;
  width: 28px;
  height: 28px;
  font-size: 10px;
}
.diet-sequence-meal .field {
  margin: 0;
  min-width: 0;
}
.diet-sequence-meal .field:not(.diet-seq-time) {
  grid-area: name;
}
.diet-sequence-meal .field label {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0;
}
.diet-sequence-meal .field select,
.diet-sequence-meal .field input {
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
}
.diet-sequence-meal .diet-seq-time {
  grid-area: time;
  min-width: 112px;
}
.diet-seq-macros {
  grid-area: meta;
  margin-top: -2px;
}
.diet-seq-macros small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.diet-seq-edit {
  grid-area: edit;
  width: auto !important;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 11px;
}
.diet-sequence-meal > .icon-btn {
  grid-area: del;
  width: 26px;
  height: 26px;
  min-height: 26px;
  font-size: 14px;
}
.diet-clock-picker {
  display: grid;
  grid-template-columns: 1fr 6px 1fr;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0f0f0f;
}
.diet-clock-picker label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px;
  min-width: 0;
  margin: 0 !important;
  padding: 0 5px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
}
.diet-clock-picker select {
  width: 100%;
  min-height: 28px !important;
  height: 28px !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  color: #fff;
  font-size: 13px !important;
  font-weight: 950 !important;
  text-align: center;
}

.diet-clock-picker select option {
  background: #f7f7f7;
  color: #111;
  font-weight: 850;
}

.diet-clock-picker select option:checked {
  background: #e11b22;
  color: #fff;
}

.diet-clock-picker span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
}
.diet-clock-picker i {
  color: var(--red);
  font-style: normal;
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

@media (max-width: 520px) {
  .diet-sequence-meal {
    grid-template-columns: 28px minmax(0, 1fr) 94px 26px;
    grid-template-areas:
      "num name time del"
      "num meta edit del";
    gap: 6px;
    min-height: 76px;
  }

  .diet-seq-edit {
    justify-self: start;
    min-height: 28px;
    padding-inline: 9px;
    font-size: 10px;
  }

  .diet-sequence-meal .diet-seq-time {
    min-width: 92px;
  }

  .diet-clock-picker {
    grid-template-columns: 1fr 4px 1fr;
    gap: 3px;
  }

  .diet-clock-picker label {
    padding-inline: 3px;
  }

  .diet-clock-picker select {
    font-size: 12px !important;
  }

  .diet-clock-picker span {
    display: none;
  }
}
.diet-option-macros {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(225, 27, 34, .1);
  border: 1px solid rgba(225, 27, 34, .25);
}
.diet-option-macros strong { font-size: 14px; color: #fff; }
.diet-option-macros span { font-size: 12px; font-weight: 800; color: rgba(255,255,255,.75); }
.diet-meal-editor-title { display: flex; align-items: center; gap: 10px; }
.diet-meal-editor-title .training-back { flex: 0 0 auto; }
.diet-editor-hint { font-size: 12px; margin: 0 0 10px; }
.diet-review-list { display: grid; gap: 10px; }
.diet-review-meal {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,.18);
  padding: 11px;
}
.diet-review-meal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.diet-review-meal-head strong { font-size: 14px; }
.diet-review-meal-head span { color: var(--red, #e11b22); font-weight: 900; font-size: 13px; }
.diet-review-options { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.diet-review-opt {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.8);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
}
.diet-review-opt.active { border-color: var(--red, #e11b22); background: rgba(225,27,34,.16); color: #fff; }
.diet-review-foods { display: grid; gap: 3px; margin: 6px 0; }
.diet-review-food { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.diet-review-food small { color: var(--muted); }
.diet-review-macros { display: flex; gap: 10px; }
.diet-review-macros span { font-size: 11px; font-weight: 800; color: rgba(255,255,255,.6); }
.diet-review-total {
  margin-top: 12px;
  border: 1px solid rgba(225,27,34,.4);
  border-radius: 12px;
  background: rgba(225,27,34,.12);
  padding: 12px;
}
.diet-review-total-head { display: flex; justify-content: space-between; align-items: baseline; }
.diet-review-total-head strong { font-size: 15px; }
.diet-review-total-head span { font-size: 17px; font-weight: 950; color: #fff; }
.diet-review-total-macros { display: flex; gap: 12px; margin-top: 6px; }
.diet-review-total-macros span { font-size: 12px; font-weight: 800; color: rgba(255,255,255,.8); }

/* ===== Biblioteca de Fichas (wizard) ===== */
.lib-search-btn {
  grid-column: 1 / -1;
  background: rgba(225, 27, 34, 0.16) !important;
  border-color: rgba(225, 27, 34, 0.5) !important;
  font-weight: 900;
}
.lib-wizard-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.lib-wizard-head h1 { font-size: 19px; margin: 0; }
.lib-wizard-head p { margin: 2px 0 0; font-size: 12px; }
.lib-step-badge {
  font-size: 11px;
  font-weight: 900;
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, .5);
  border-radius: 999px;
  padding: 4px 10px;
}
.lib-cardio-modalities { display: grid; gap: 8px; }
.lib-cardio-frequency { grid-template-columns: repeat(3, 1fr) !important; }
.lib-cardio-frequency .lib-chip {
  min-height: 44px;
  display: grid;
  place-items: center;
  gap: 2px;
}
.lib-cardio-frequency .lib-chip small {
  display: block;
  font-size: 9px;
  line-height: 1;
  color: var(--muted);
}
.lib-sub-label {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--muted);
}
.lib-options { display: grid; gap: 10px; }
.lib-options.two { grid-template-columns: repeat(2, 1fr); }
.lib-options.chips { grid-template-columns: repeat(2, 1fr); }
.lib-option {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: #fff;
}
.lib-option strong { font-size: 15px; }
.lib-option small { font-size: 11px; color: var(--muted); }
.lib-option.active {
  border-color: var(--red, #e11b22);
  background: rgba(225, 27, 34, .14);
}
.lib-chip {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.lib-chip.big { display: grid; gap: 2px; font-size: 18px; }
.lib-chip.big small { font-size: 10px; color: var(--muted); font-weight: 900; }
.lib-chip.active {
  border-color: var(--red, #e11b22);
  background: rgba(225, 27, 34, .16);
}
.lib-template-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.03);
}
.lib-template-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lib-template-top strong { font-size: 15px; }
.lib-diff {
  font-size: 10px; font-weight: 900; text-transform: uppercase;
  color: #c084fc; border: 1px solid rgba(192,132,252,.5);
  border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.lib-template-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.lib-template-meta span {
  font-size: 11px; font-weight: 800; color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.05); border-radius: 999px; padding: 4px 9px;
}
.lib-template-strat { font-size: 11px; color: var(--muted); }
.lib-preview-note {
  font-size: 12px; color: var(--muted);
  border: 1px dashed rgba(255,255,255,.14); border-radius: 10px; padding: 9px;
}
.lib-preview-day { display: grid; gap: 8px; }
.lib-preview-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lib-preview-day-head strong { font-size: 14px; }
.lib-preview-day-head small { font-size: 11px; color: var(--muted); }
.lib-preview-ex {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06);
}
.lib-preview-ex:last-child { border-bottom: 0; }
.lib-preview-ex strong { font-size: 13px; }
.lib-preview-ex small { display: block; margin-top: 2px; }

.training-config-card,
.training-confirm-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.training-form-hint {
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.training-inline-form {
  display: grid;
  gap: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.training-inline-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0d0d0d;
  color: #fff;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
}

.training-flow .exercise-line,
.training-flow .exercise-line * {
  min-width: 0;
}

.training-flow .exercise-line .muted,
.training-flow .exercise-line small,
.training-flow .exercise-line span {
  white-space: nowrap;
}

.training-exercise-card {
  display: grid;
  gap: 11px;
}

.training-exercise-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.training-exercise-meta span {
  min-height: 35px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0d0d0d;
  color: #f1f1f1;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  line-height: 1.2;
  padding: 5px;
}

.training-create-fab {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  font-size: 30px;
  line-height: 1;
}

.active-session-screen {
  padding-bottom: calc(var(--bottom-nav-total) + 42px);
}

.training-active-titlebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.training-free-timer {
  min-width: 88px;
  min-height: 50px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1px solid rgba(225, 27, 34, 0.42);
  border-radius: 12px;
  background: linear-gradient(180deg, #171717, #070707);
  color: #fff;
  padding: 6px 9px;
}

.training-free-timer small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.training-free-timer strong {
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.training-free-timer.running {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(225, 27, 34, 0.12);
}

.training-free-timer.running strong {
  color: var(--red);
}

.training-session-hero {
  border-color: rgba(225, 27, 34, 0.35);
  background: linear-gradient(180deg, #1d1d1d, #111);
}

.training-session-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.training-session-stats div {
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0d0d0d;
  padding: 8px 5px;
}

.training-session-stats strong {
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.training-session-stats #session-duration {
  color: var(--red);
}

.training-session-stats small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.training-session-hero .progress {
  height: 8px;
  border-radius: 999px;
  background: #090909;
  overflow: hidden;
  margin: 14px 0;
}

.training-session-hero .progress span {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--red);
}

.training-session-controls {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
}

.training-session-controls button {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.session-player-btn {
  height: 52px;
  width: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 27, 34, 0.78);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 45%, rgba(225, 27, 34, 0.12), transparent 58%),
    linear-gradient(180deg, #111, #050505);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 0 22px rgba(225, 27, 34, 0.14);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.session-player-btn svg {
  width: 27px;
  height: 27px;
  display: block;
  fill: #fff;
}

.session-player-btn.playing svg {
  width: 25px;
}

.session-player-btn.playing .player-pause {
  rx: 1.2px;
}

.session-player-btn.paused {
  border-color: var(--red);
  background: linear-gradient(180deg, #f1242b, #b91218);
  box-shadow: 0 0 0 1px rgba(225, 27, 34, 0.26), 0 12px 28px rgba(225, 27, 34, 0.24);
}

.session-player-btn:active {
  transform: scale(0.94);
}

.training-set-row {
  grid-template-columns: 34px minmax(46px, 0.45fr) minmax(0, 1fr) 34px 34px;
  align-items: center;
  gap: 8px;
}

.training-set-row.done {
  border-color: rgba(34, 197, 94, 0.26);
  background: rgba(34, 197, 94, 0.035);
}

.previous-set-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.time-mode .session-metric-grid,
.distance-mode .session-metric-grid,
.steps-mode .session-metric-grid {
  grid-template-columns: 1fr;
}

.session-metric-grid.treadmill {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.exercise-modal-set-fields.treadmill {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.session-metric-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.session-metric-field span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.session-metric-field input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #090909;
  color: #fff;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.session-exercise-head {
  width: calc(100% - 44px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0;
  text-align: left;
}

.session-note-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #0d0d0d;
  color: #fff;
}

.session-exercise-card {
  position: relative;
}

.session-exercise-condensed {
  width: 100%;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.session-exercise-condensed strong {
  display: block;
  color: #fff;
  font-size: 15px;
}

.session-exercise-condensed small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.session-exercise-condensed span,
.session-exercise-head > span {
  min-width: 44px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #fff;
  background: #0b0b0b;
  font-size: 11px;
  font-weight: 950;
}

.session-exercise-note textarea {
  min-height: 76px;
}

.session-add-set-button {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border-radius: 999px;
}

.trash-session-set {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 27, 34, 0.35);
  border-radius: 999px;
  background: rgba(225, 27, 34, 0.08);
  color: #fff;
  font-size: 13px;
}

.session-rest-float {
  position: fixed;
  right: calc(14px + var(--safe-right));
  bottom: calc(var(--bottom-nav-total) + 16px);
  z-index: 72;
  width: min(245px, calc(100% - 28px - var(--safe-left) - var(--safe-right)));
  border: 1px solid rgba(225, 27, 34, 0.48);
  border-radius: 14px;
  background: rgba(14, 14, 14, 0.96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.52);
  padding: 11px;
  overflow: hidden;
}

.session-rest-float > div:first-child {
  display: grid;
  gap: 2px;
}

.session-rest-float small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.session-rest-float strong {
  color: var(--red);
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
}

.session-rest-float span {
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-rest-actions {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 7px;
  margin-top: 9px;
}

.session-rest-actions button {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #090909;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.session-rest-float em {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--value);
  height: 3px;
  background: var(--red);
}

.exercise-thumb {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 27, 34, 0.45);
  border-radius: 8px;
  background: #090909;
  overflow: hidden;
}

.exercise-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.exercise-preview-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.exercise-thumb.fallback strong {
  font-size: 20px;
  color: var(--red);
}.exercise-thumb.fallback.loading {
  position: relative;
}

.exercise-thumb.fallback.loading::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--red);
  border-radius: inherit;
  animation: ratlab-spin 0.9s linear infinite;
}

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


.exercise-line-thumb {
  width: 48px;
  height: 48px;
}

.picker-thumb {
  width: 54px;
  height: 54px;
}

.session-exercise-thumb {
  width: 42px;
  height: 42px;
}
.exercise-eye-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 27, 34, 0.62);
  border-radius: 999px;
  background: linear-gradient(145deg, #121212, #070707);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 18px rgba(225, 27, 34, 0.12);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.exercise-eye-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.exercise-eye-btn.has-media {
  border-color: rgba(255, 255, 255, 0.34);
  background: radial-gradient(circle at 50% 50%, rgba(225, 27, 34, 0.2), #090909 58%);
}

.exercise-eye-btn:hover,
.exercise-eye-btn:focus-visible {
  transform: scale(1.04);
  border-color: var(--red);
  outline: none;
}

.visual-exercise-list {
  display: grid;
  gap: 9px;
}

.visual-exercise-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111;
  padding: 8px;
}

.visual-exercise-card strong {
  display: block;
  color: #fff;
  font-size: 13px;
}

.visual-exercise-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.visual-exercise-card button,
.exercise-view-btn,
.exercise-move-btn {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #0b0b0b;
  color: #fff;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
}

.visual-exercise-card button:last-child,
.exercise-move-btn {
  border-color: rgba(225, 27, 34, 0.55);
  background: rgba(225, 27, 34, 0.12);
}

.exercise-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: calc(16px + var(--safe-top)) calc(14px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(14px + var(--safe-left));
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.exercise-preview-panel {
  width: min(440px, 100%);
  max-height: calc(100dvh - 34px - var(--safe-top) - var(--safe-bottom));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #171717;
  padding: 14px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

.exercise-preview-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #080808;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
}

.exercise-preview-media::-webkit-scrollbar {
  display: none;
}

.exercise-preview-media img {
  width: auto;
  min-width: 220%;
  max-width: none;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.exercise-preview-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.preview-fallback-thumb {
  width: 88px;
  height: 88px;
  border-radius: 16px;
}

.exercise-preview-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.exercise-preview-info div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101010;
  padding: 9px;
}

.exercise-preview-info strong,
.exercise-preview-info span {
  display: block;
}

.exercise-preview-info strong {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.exercise-preview-info span {
  margin-top: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.exercise-preview-steps {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.exercise-preview-steps p {
  margin: 0;
  color: #d8d8d8;
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .diet-header {
    align-items: stretch;
    flex-direction: column;
  }

  .diet-header-actions {
    justify-content: stretch;
  }

  .diet-header-actions button {
    flex: 1 1 150px;
  }

  .diet-header-clean {
    gap: 10px;
  }

  .diet-header-clean .diet-header-actions {
    display: grid;
    grid-template-columns: repeat(2, 68px);
    width: auto;
    justify-content: end;
  }

  .diet-header-clean .diet-header-actions button {
    flex: none;
    min-height: 62px;
    padding: 7px 6px;
  }

  .diet-plan-form .form-grid,
  .off-plan-form .form-grid,
  .diet-meal-actions {
    grid-template-columns: 1fr;
  }

  .diet-food-row {
    grid-template-columns: 1fr 80px;
  }

  .diet-food-row-main,
  .diet-food-macro-grid {
    grid-template-columns: 1fr;
  }

  .diet-food-row select,
  .diet-food-row .icon-btn {
    grid-column: span 1;
  }

  .diet-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .training-exercise-meta {
    grid-template-columns: 1fr;
  }

  .training-step-header h1 {
    font-size: 22px;
  }

  .training-set-row {
    grid-template-columns: 32px minmax(0, 1fr) 32px 32px;
  }

  .training-set-row .previous-set-label {
    display: none;
  }

  .training-session-hero .row:last-child {
    grid-template-columns: 1fr;
  }
}







/* Training exercise modal sets: compact horizontal layout */
.exercise-modal-sets {
  display: grid;
  gap: 8px;
  margin: 8px 0 10px;
}

.exercise-modal-sets > label {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.exercise-modal-set-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.exercise-modal-set-row .set-type-letter {
  width: 42px;
  height: 38px;
  border: 1px solid rgba(225, 27, 34, 0.45);
  border-radius: 10px;
  background: #111;
  color: var(--red);
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
}

.exercise-modal-set-row input {
  width: 100%;
  min-width: 0;
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #080808;
  color: #fff;
  font-weight: 800;
  text-align: center;
  box-sizing: border-box;
}

.exercise-modal-set-row input::placeholder {
  color: #777;
  font-weight: 700;
  text-align: center;
}

.exercise-modal-set-row input::-webkit-outer-spin-button,
.exercise-modal-set-row input::-webkit-inner-spin-button,
.block-slot-set-fields input::-webkit-outer-spin-button,
.block-slot-set-fields input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.exercise-modal-set-row input[type="number"],
.block-slot-set-fields input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.exercise-modal-set-row .trash-set {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--red);
}

/* Editor compacto de sequência (pirâmide/drop-set e cluster/rest-pause) */
.seq-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(192, 132, 252, .26);
  border-radius: 10px;
  background: rgba(192, 132, 252, .05);
}

.seq-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.seq-editor-head strong {
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.seq-load {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.seq-load span {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--muted);
}

.seq-load input {
  width: 56px;
  height: 26px;
  padding: 0 7px;
  font-size: 12px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.12);
  background: #0c0c0c;
  color: #fff;
}

.seq-rows {
  display: grid;
  gap: 4px;
}

.seq-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.seq-tag {
  flex: 0 0 auto;
  width: 24px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid rgba(192, 132, 252, .55);
  color: #c084fc;
  font-size: 10px;
  font-weight: 900;
}

.seq-in {
  flex: 1 1 0;
  min-width: 0;
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
  text-align: center;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.1);
  background: #0c0c0c;
  color: #fff;
}

.seq-in::placeholder {
  color: rgba(255,255,255,.3);
  font-size: 10px;
}

.seq-del {
  flex: 0 0 auto;
  width: 24px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.1);
  background: #0c0c0c;
  color: rgba(255,255,255,.6);
  font-size: 14px;
  line-height: 1;
}

.seq-del:disabled {
  opacity: .3;
}

.seq-add {
  justify-self: start;
  min-height: 0;
  height: 26px;
  padding: 0 12px;
  margin: 1px 0 0;
  font-size: 11px;
  font-weight: 800;
  border-radius: 7px;
  border: 1px dashed rgba(192, 132, 252, .45);
  background: transparent;
  color: #c084fc;
}

.exercise-modal-set-fields.cluster-head {
  display: flex;
  align-items: center;
}

.cluster-tag {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, .5);
  border-radius: 999px;
  padding: 4px 10px;
}

.training-set-row .seq-editor.session {
  margin-top: 4px;
}

.exercise-modal-sets .add-exercise-inside {
  margin-top: 4px;
}

.modal-set-type-sheet {
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid rgba(225, 27, 34, 0.28);
  border-radius: 10px;
  background: #111;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.modal-set-type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.modal-set-type-head strong {
  color: #fff;
  font-size: 13px;
}

.modal-set-type-head button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0b0b0b;
  color: #fff;
}

.modal-set-type-list {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: none;
}

.modal-set-type-list::-webkit-scrollbar {
  display: none;
}

.modal-set-type-option {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0a0a0a;
  text-align: left;
}

.modal-set-type-option span {
  grid-row: 1 / span 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(225, 27, 34, 0.35);
  color: var(--red);
  font-weight: 900;
  font-size: 11px;
}

.modal-set-type-option strong {
  color: #fff;
  font-size: 12px;
}

.modal-set-type-option small {
  color: var(--muted);
  font-size: 10px;
}

.modal-set-type-option.active {
  border-color: var(--red);
  background: rgba(225, 27, 34, 0.1);
}

/* Training exercise modal set type picker */
.modal-set-type-backdrop {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(5px);
  animation: modalSetTypeBackdropIn 160ms ease both;
}

.modal-set-type-sheet {
  width: min(390px, calc(100vw - 36px));
  max-height: min(600px, 78vh);
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(225, 27, 34, 0.35);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    #101010;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  display: grid;
  gap: 12px;
  overflow: hidden;
  animation: modalSetTypeFloatIn 180ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.modal-set-type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-set-type-head strong {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.modal-set-type-head button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0a0a0a;
  color: #fff;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.modal-set-type-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: min(440px, 58vh);
  overflow-y: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.modal-set-type-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.modal-set-type-list::-webkit-scrollbar-thumb {
  background: transparent;
}

.modal-set-type-option {
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #090909;
  color: #fff;
  padding: 8px;
}

.modal-set-type-option span {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(225, 27, 34, 0.5);
  display: grid;
  place-items: center;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.modal-set-type-option strong {
  font-size: 12px;
  line-height: 1.1;
}

.modal-set-type-option small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.15;
}

.modal-set-type-option.active {
  border-color: var(--red);
  background: rgba(225, 27, 34, 0.12);
}

@media (max-width: 380px) {
  .modal-set-type-list {
    grid-template-columns: 1fr;
  }
}

@keyframes modalSetTypeBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSetTypeFloatIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Exercise preview: horizontal execution images */
.exercise-preview-media-steps {
  background: #f5f5f5;
}

.exercise-preview-media-steps img {
  min-width: 240%;
}

@media (min-width: 430px) {
  .exercise-preview-media img {
    min-width: 220%;
  }
}


/* RatLab set stimulus colors and fields */
.exercise-modal-set-row {
  grid-template-columns: 42px minmax(0, 1fr) 38px;
}

.exercise-modal-set-row .set-type-letter {
  border-color: color-mix(in srgb, var(--set-color, #ef1b2d) 72%, transparent);
  color: var(--set-color, #ef1b2d);
  background: color-mix(in srgb, var(--set-color, #ef1b2d) 12%, #090909);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--set-color, #ef1b2d) 18%, transparent);
}

.exercise-modal-set-row .set-type-letter span {
  display: block;
  line-height: 1;
}

.exercise-modal-set-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.exercise-modal-set-fields.time,
.exercise-modal-set-fields.distance,
.exercise-modal-set-fields.steps {
  grid-template-columns: minmax(0, 1fr) auto;
}

.modal-set-unit {
  min-width: 46px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--set-color, #ef1b2d) 45%, transparent);
  border-radius: 8px;
  color: var(--set-color, #ef1b2d);
  background: #090909;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.modal-set-type-option:nth-child(1) { --set-color: #ef1b2d; }
.modal-set-type-option:nth-child(2) { --set-color: #f6c945; }
.modal-set-type-option:nth-child(3) { --set-color: #9aa4b2; }
.modal-set-type-option:nth-child(4) { --set-color: #ff3b45; }
.modal-set-type-option:nth-child(5) { --set-color: #a78bfa; }
.modal-set-type-option:nth-child(6) { --set-color: #38bdf8; }
.modal-set-type-option:nth-child(7) { --set-color: #35d07f; }
.modal-set-type-option:nth-child(8) { --set-color: #fb7185; }
.modal-set-type-option:nth-child(9) { --set-color: #f97316; }
.modal-set-type-option:nth-child(10) { --set-color: #22d3ee; }

.modal-set-type-option span {
  border-color: color-mix(in srgb, var(--set-color, #ef1b2d) 65%, transparent);
  color: var(--set-color, #ef1b2d);
  background: color-mix(in srgb, var(--set-color, #ef1b2d) 12%, #080808);
}

.modal-set-type-option.active {
  border-color: var(--set-color, #ef1b2d);
  background: color-mix(in srgb, var(--set-color, #ef1b2d) 15%, #101010);
}

.set-type-session-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: calc(16px + var(--safe-top)) calc(14px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(14px + var(--safe-left));
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(5px);
}

.set-type-session-sheet {
  width: min(100%, 520px);
  max-height: min(76vh, 560px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(225, 27, 34, 0.35);
  border-radius: 16px 16px 10px 10px;
  background: #101010;
  box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.58);
}

.training-set-row {
  border-left: 2px solid var(--set-color, #ef1b2d);
}

.training-set-row .type-chip {
  border-color: color-mix(in srgb, var(--set-color, #ef1b2d) 70%, transparent);
  background: color-mix(in srgb, var(--set-color, #ef1b2d) 12%, #080808);
}

.session-metric-grid.time,
.session-metric-grid.distance,
.session-metric-grid.steps {
  grid-template-columns: 1fr;
}


/* RatLab advanced training strategies */
.strategy-scroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px 2px 8px; }
.strategy-scroll::-webkit-scrollbar { display: none; }
.strategy-card { scroll-snap-align: start; }
.training-block-section { border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.025); border-radius: 14px; padding: 12px; margin: 10px 0 12px; }
.training-block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.training-block-head label { display: block; color: #f3f3f3; font-weight: 900; text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
.training-block-head small { display: block; color: rgba(255,255,255,.55); font-size: 11px; margin-top: 3px; }
.training-block-head span { color: #fff; border: 1px solid rgba(225,27,34,.55); background: rgba(225,27,34,.14); border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.training-block-card { min-width: 78%; max-width: 78%; border: 1px solid rgba(255,255,255,.1); background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)); border-radius: 12px; padding: 12px; display: grid; grid-template-columns: 38px 1fr; grid-template-areas: "icon title" "icon desc" "icon ex"; gap: 3px 10px; cursor: pointer; }
.training-block-card input { display: none; }
.training-block-card.active { border-color: rgba(225,27,34,.9); box-shadow: 0 0 0 1px rgba(225,27,34,.22), 0 12px 28px rgba(225,27,34,.12); background: linear-gradient(180deg, rgba(225,27,34,.18), rgba(255,255,255,.035)); }
.training-block-icon { grid-area: icon; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: #080808; border: 1px solid rgba(225,27,34,.65); color: #fff; font-weight: 950; font-size: 12px; }
.training-block-card strong { grid-area: title; color: #fff; font-size: 14px; }
.training-block-card small { grid-area: desc; color: rgba(255,255,255,.7); font-size: 11px; line-height: 1.25; }
.training-block-card em { grid-area: ex; color: rgba(255,255,255,.44); font-size: 10px; font-style: normal; margin-top: 3px; }
.strategy-advanced-fields label { font-size: 10px; }
.training-strategy-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.strategy-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 950; letter-spacing: .04em; border: 1px solid rgba(255,255,255,.1); color: #fff; background: rgba(255,255,255,.055); }
.strategy-badge.structure { border-color: rgba(225,27,34,.7); background: rgba(225,27,34,.17); }
.strategy-badge.intensity { border-color: rgba(249,115,22,.7); background: rgba(249,115,22,.15); }
.strategy-badge.counting { border-color: rgba(56,189,248,.5); background: rgba(56,189,248,.11); color: #dff7ff; }
@media (min-width: 560px) { .training-block-card { min-width: 58%; max-width: 58%; } }


/* RatLab block exercise tabs */
.training-block-exercises-section {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.025);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0 12px;
}
.training-block-head.compact { margin-bottom: 8px; }
.block-exercise-tabs {
  padding: 2px 0 6px;
  scroll-padding-inline: 0;
}
.block-exercise-carousel-nav {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 2px 0 0;
}
.block-exercise-carousel-nav[hidden] {
  display: none;
}
.block-exercise-nav-arrow {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.12), rgba(255,255,255,.035) 54%, rgba(0,0,0,.28)),
    #0b0b0b;
  color: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.34), inset 0 0 0 1px rgba(255,255,255,.035);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
.block-exercise-nav-arrow[hidden] {
  display: none;
}
.block-exercise-nav-arrow:active {
  transform: scale(.94);
  border-color: rgba(255,255,255,.36);
  background: rgba(255,255,255,.1);
}
.block-exercise-nav-arrow span {
  width: 11px;
  height: 11px;
  display: block;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}
.block-exercise-nav-arrow.prev span {
  transform: translateX(2px) rotate(-135deg);
}
.block-exercise-nav-arrow.next span {
  transform: translateX(-2px) rotate(45deg);
}
.block-exercise-config {
  flex: 0 0 100%;
  min-width: 100%;
  max-width: 100%;
  display: grid;
  gap: 9px;
  border-color: rgba(225,27,34,.28);
  background: linear-gradient(180deg, rgba(225,27,34,.09), rgba(255,255,255,.025));
}
.block-exercise-config strong {
  color: #fff;
  font-size: 14px;
  letter-spacing: .01em;
}
.block-exercise-config label {
  display: grid;
  gap: 5px;
  color: rgba(255,255,255,.58);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.block-exercise-config select {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: #090909;
  color: #fff;
  padding: 0 10px;
  font-weight: 800;
}
.training-block-card { user-select: none; }
.training-block-card:active { transform: scale(.985); }
@media (min-width: 560px) {
  .block-exercise-config {
    flex-basis: 100%;
    min-width: 100%;
    max-width: 100%;
  }
}

.training-free-timer-wrap {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
  z-index: 25;
}

.training-free-timer-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(250px, calc(100vw - 36px));
  padding: 10px;
  border: 1px solid rgba(225, 27, 34, 0.34);
  border-radius: 16px;
  background: rgba(16, 16, 16, 0.98);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.45);
}

.free-timer-modes,
.free-timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.free-timer-modes button,
.free-timer-actions button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #0b0b0b;
  color: #fff;
  font-weight: 900;
}

.free-timer-modes button.active,
.free-timer-play {
  border-color: var(--red);
  background: rgba(225, 27, 34, 0.16);
}

.free-timer-play {
  color: #fff;
  font-size: 17px;
  letter-spacing: 0;
}

.free-timer-reset {
  color: var(--muted);
}

.free-timer-duration {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 9px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.free-timer-duration input {
  min-width: 0;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #070707;
  color: #fff;
  text-align: center;
  font-weight: 950;
}

/* Keep the RatLab logo visually large while clipping its right-side hit/paint box
   so it cannot overlap streak, notification and chat actions. */
.brand {
  overflow: hidden;
  max-width: min(160px, 38vw);
  flex: 0 1 min(160px, 38vw);
}

@media (max-width: 520px) {
  .brand {
    max-width: min(122px, 31vw);
    flex-basis: min(122px, 31vw);
  }

  .brand-logo {
    width: 172px;
    max-width: none;
    transform: translate(-7px, 4px) scale(1.8);
  }
}

/* Sequential exercise cards */
.block-exercise-config {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  border: 1px solid rgba(225,27,34,.26);
}

.block-exercise-config-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.block-exercise-config-head > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225,27,34,.65);
  border-radius: 12px;
  background: rgba(225,27,34,.12);
  color: #fff;
  font-weight: 950;
}

.block-exercise-config-head strong {
  display: block;
  color: #fff;
  font-size: 15px;
}

.block-exercise-config-head small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.block-exercise-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.block-exercise-fields .wide {
  grid-column: 1 / -1;
}

.block-slot-sets {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.block-slot-sets-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.block-slot-sets-head strong {
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
}

.block-slot-sets-head small {
  color: var(--muted);
  font-size: 10px;
}

.block-slot-set-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
}

.block-slot-remove-set {
  width: 34px;
  height: 34px;
  min-width: 34px;
}

.block-slot-add-set {
  margin-top: 2px;
}

.session-sequence-rounds {
  display: flex;
  gap: 12px;
}

.session-sequence-round {
  border-color: rgba(255, 255, 255, 0.1);
}

.session-sequence-round.done {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.06);
}

.sequence-round-head em {
  min-width: 42px;
  text-align: center;
}

.sequence-round-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
}

.sequence-round-flow span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: #070707;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 950;
}

.sequence-round-flow span.done {
  border-color: rgba(34, 197, 94, 0.65);
  background: rgba(34, 197, 94, 0.16);
  color: #fff;
}

.sequence-round-flow b {
  flex: 1 1 16px;
  height: 2px;
  min-width: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(239, 27, 45, 0.7), rgba(255, 255, 255, 0.16));
}

.sequence-round-exercise {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.sequence-round-exercise-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.sequence-round-exercise-head strong,
.sequence-round-exercise-head span,
.sequence-round-exercise-head small {
  display: block;
}

.block-slot-set-type {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--set-color, #ef1b2d) 70%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--set-color, #ef1b2d) 12%, #070707);
  color: var(--set-color, #ef1b2d);
  font-weight: 950;
  font-size: 12px;
}

.block-slot-set-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.block-slot-set-fields.time,
.block-slot-set-fields.distance,
.block-slot-set-fields.steps {
  grid-template-columns: minmax(0, 1fr);
}

.block-slot-set-fields label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.block-slot-set-fields input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: #070707;
  color: #fff;
  text-align: center;
  font-weight: 950;
}

/* Clock style for free workout timer */
.training-free-timer-panel .clock-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clock-actions button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 48px;
  padding: 6px 4px;
}

.clock-actions button span {
  display: block;
  color: #fff;
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
}

.clock-actions button small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.free-timer-restart {
  border-color: rgba(255, 255, 255, 0.16) !important;
  background: rgba(255, 255, 255, 0.045) !important;
}

.free-timer-reset span {
  color: var(--red) !important;
}

/* Active workout strategy blocks */
.session-strategy-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 6px 0 10px;
  padding: 5px 10px;
  border: 1px solid rgba(239, 27, 45, 0.65);
  border-radius: 999px;
  color: #fff;
  background: rgba(239, 27, 45, 0.16);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.session-sequential-card {
  overflow: hidden;
}
.session-sequence-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 4px 0 12px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  font-weight: 800;
}
.session-sequence-summary span {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255,255,255,.045);
}
.session-block-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding: 2px 2px 8px;
  margin-inline: -2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.session-block-track::-webkit-scrollbar {
  display: none;
}
.session-block-panel {
  scroll-snap-align: start;
  flex: 0 0 min(96%, 390px);
  border: 1px solid rgba(239, 27, 45, .38);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(239,27,45,.10), rgba(255,255,255,.035));
  padding: 12px;
}
.session-block-panel.done {
  border-color: rgba(46, 204, 113, .55);
  background: linear-gradient(180deg, rgba(46,204,113,.10), rgba(255,255,255,.035));
}
.session-block-panel-empty p {
  margin: 4px 0 0;
  font-size: 12px;
}
.session-global-series {
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  padding: 10px 10px 4px;
  margin-bottom: 10px;
}
.session-global-series.done {
  border-color: rgba(46, 204, 113, .5);
}
.session-global-series-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 2px 8px;
}
.session-global-series-head strong {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.session-global-series-head span {
  font-size: 11px;
  font-weight: 900;
  color: rgba(255, 255, 255, .55);
  text-transform: uppercase;
}
.session-global-series.done .session-global-series-head span {
  color: rgba(46, 204, 113, .85);
}
.history-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.history-filters button {
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .75);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 800;
}
.history-filters button.active {
  border-color: var(--red, #e11b22);
  background: rgba(225, 27, 34, .16);
  color: #fff;
}
.history-range-fields {
  display: flex;
  gap: 10px;
}
.history-range-fields label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}
.history-range-fields input {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  color: #fff;
  padding: 8px 10px;
  font-size: 13px;
  color-scheme: dark;
}
.history-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.history-stats-grid.compact {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 10px;
}
.history-stats-grid div {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}
.history-stats-grid strong {
  display: block;
  font-size: 15px;
}
.history-stats-grid small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}
.history-chart svg {
  width: 100%;
  height: 110px;
  display: block;
}
.history-bar {
  fill: rgba(225, 27, 34, .55);
}
.history-trend {
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: .75;
}
.history-chart-legend {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
  margin-top: 4px;
}
.history-delta {
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}
.history-delta.up {
  color: #2ecc71;
  background: rgba(46, 204, 113, .14);
}
.history-delta.down {
  color: #ff5a5f;
  background: rgba(255, 90, 95, .14);
}
.history-delta.neutral {
  color: rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .07);
}
.history-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.history-progress-row:last-child {
  border-bottom: 0;
}
.history-progress-row > div {
  flex: 1;
  min-width: 0;
}
.history-progress-row strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-progress-row small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
}
.history-progress-row em {
  font-style: normal;
  font-weight: 900;
  font-size: 13px;
}
.history-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(225, 27, 34, .18);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.history-exercise-select {
  width: 100%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  color: #fff;
  padding: 9px 10px;
  font-size: 13px;
  margin-bottom: 10px;
}
.history-session-extra {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 9px;
  font-size: 11px;
  color: rgba(255, 255, 255, .7);
}
.session-block-panel-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.session-block-panel-head div {
  min-width: 0;
}
.session-block-panel-head small,
.session-block-panel-head span {
  display: block;
  color: rgba(255,255,255,.55);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.session-block-panel-head strong {
  display: block;
  color: #fff;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-block-panel-head em {
  font-style: normal;
  border-radius: 999px;
  padding: 5px 9px;
  background: #050505;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.session-block-set-list .training-set-row {
  grid-template-columns: 34px minmax(38px, .5fr) minmax(0, 1.3fr) 42px 36px;
}
.session-add-set-button.compact {
  width: 100%;
  margin-top: 8px;
  min-height: 38px;
}
@media (max-width: 420px) {
  .session-block-panel { flex-basis: 96%; padding: 10px; }
  .session-block-set-list .training-set-row { grid-template-columns: 32px minmax(28px, .4fr) minmax(0, 1fr) 40px 34px; }
}

/* ===== Ratos: progressão, metas e rankings ===== */
.social-ratos {
  gap: 12px;
}

.rat-progress-card {
  border-color: rgba(225, 27, 34, .36);
  background:
    linear-gradient(145deg, rgba(225, 27, 34, .16), rgba(10, 10, 10, .98) 46%),
    #101010;
}

.rat-progress-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.rat-progress-main small {
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.rat-progress-main h2 {
  margin: 3px 0 0;
  color: #fff;
  font-size: 38px;
  line-height: .95;
}

.rat-progress-main strong {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, .9);
  font-size: 14px;
}

.rat-progress-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.rat-league-badge {
  display: grid;
  place-items: center;
  min-width: 86px;
  min-height: 86px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(225, 27, 34, .16) 48%, rgba(0, 0, 0, .3));
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.rat-progress-card > .rpg-xp-bar {
  margin-top: 12px;
  height: 9px;
}

.rat-rpg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.rat-score-card,
.quest-card,
.guild-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #111;
}

.rat-score-parts {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.rat-score-parts div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
}

.rat-score-parts span,
.rat-score-parts em {
  color: rgba(255, 255, 255, .74);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.rat-score-parts i {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.rat-score-parts b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #ffb020, #2ecc71);
}

.quest-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.quest-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  padding: 10px;
}

.quest-card small,
.quest-card p,
.guild-card small,
.guild-card p {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.quest-card strong,
.guild-card strong {
  display: block;
  margin: 3px 0;
  color: #fff;
  font-size: 13px;
}

.guild-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.guild-card > div {
  min-width: 0;
}

.guild-card strong,
.guild-card small,
.guild-card p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-card > span {
  min-width: 72px;
  text-align: center;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.05);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.quest-card > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(225, 27, 34, .5);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
}

.quest-card .rpg-xp-bar {
  grid-column: 1 / -1;
  height: 7px;
}

.quest-card.done {
  border-color: rgba(46, 204, 113, .42);
  background: rgba(46, 204, 113, .08);
}

.achievement-grid,
.trophy-case {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.achievement-grid div,
.trophy-case div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: #101010;
  padding: 10px;
  opacity: .58;
}

.achievement-grid div.unlocked,
.trophy-case div.unlocked {
  opacity: 1;
  border-color: rgba(225, 27, 34, .42);
  background: linear-gradient(145deg, rgba(225, 27, 34, .12), #101010);
}

.achievement-grid strong,
.achievement-grid small,
.achievement-grid span,
.trophy-case strong,
.trophy-case small {
  display: block;
}

.achievement-grid strong,
.trophy-case strong {
  color: #fff;
  font-size: 12px;
}

.achievement-grid small,
.trophy-case small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.achievement-grid span {
  margin-top: 8px;
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
}

.trophy-case b {
  display: block;
  font-size: 20px;
  margin-bottom: 5px;
}

.guild-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.guild-card > span {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: 6px 8px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.ranking-board {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ranking-board div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 44px 64px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #101010;
  padding: 10px;
}

.ranking-board span,
.ranking-board em,
.ranking-board small {
  font-style: normal;
  font-weight: 950;
}

.ranking-board span {
  color: var(--red);
}

.ranking-board strong {
  color: #fff;
  font-size: 13px;
}

.ranking-board em {
  color: #fff;
  text-align: right;
}

.ranking-board small {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

@media (max-width: 420px) {
  .top-level-chip {
    width: 78px;
  }

  .top-level-chip em {
    display: none;
  }

  .achievement-grid,
  .trophy-case {
    grid-template-columns: 1fr;
  }

  .ranking-board div {
    grid-template-columns: 30px minmax(0, 1fr) 38px;
  }

  .ranking-board small {
    display: none;
  }
}

/* ============ GUIA RATOS — RPG FITNESS ============ */
.rpg-home { gap: 12px; }
.rpg-home .rpg-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rpg-section-kicker { display: block; font-size: 10px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; color: rgba(225,27,34,.85); }
.rpg-section-head strong { font-size: 16px; }

/* Hero */
.rpg-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(225,27,34,.35);
  background: linear-gradient(160deg, #15060a 0%, #0a0a0c 60%, #07070a 100%);
  box-shadow: 0 10px 32px rgba(0,0,0,.5), inset 0 0 40px rgba(225,27,34,.06);
}
.rpg-hero-glow { position: absolute; top: -60px; right: -40px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(225,27,34,.30), transparent 65%); filter: blur(8px); pointer-events: none; }
.rpg-hero-top { display: flex; gap: 14px; align-items: center; position: relative; z-index: 1; }
.rpg-hero-avatar {
  position: relative; flex: 0 0 auto; width: 70px; height: 70px; border-radius: 16px;
  display: grid; place-items: center; font-size: 36px;
  background: radial-gradient(circle at 30% 25%, rgba(225,27,34,.25), rgba(0,0,0,.6));
  border: 2px solid rgba(225,27,34,.55); box-shadow: 0 0 18px rgba(225,27,34,.3);
}
.rpg-hero-lv { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 950; padding: 2px 8px; border-radius: 999px; background: var(--red,#e11b22); color: #fff; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.rpg-hero-id h2 { margin: 0; font-size: 21px; }
.rpg-hero-class { font-size: 12px; font-weight: 800; color: rgba(255,255,255,.7); margin: 2px 0 7px; }
.rpg-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.rpg-tag { font-size: 10px; font-weight: 900; padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: rgba(255,255,255,.82); }
.rpg-tag.league { border-color: rgba(120,190,235,.4); color: #9fd0f0; }
.rpg-tag.streak.on { border-color: rgba(255,140,40,.5); color: #ffb061; }
.rpg-xp-block { margin-top: 14px; position: relative; z-index: 1; }
.rpg-xp-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; color: rgba(255,255,255,.7); margin-bottom: 5px; }
.rpg-xp-head strong { font-size: 12px; color: #fff; }
.rpg-xp-bar { height: 9px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.rpg-xp-bar.big { height: 15px; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.rpg-xp-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff5a3c, #e11b22); box-shadow: 0 0 12px rgba(225,27,34,.7); transition: width 600ms cubic-bezier(.22,1,.36,1); }
.rpg-next-unlock { margin-top: 7px; font-size: 11px; color: rgba(255,255,255,.72); }
.rpg-next-unlock strong { color: #fff; }
.rpg-hero-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.rpg-hero-stats div { text-align: center; padding: 8px 4px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); }
.rpg-hero-stats b { display: block; font-size: 17px; color: #fff; }
.rpg-hero-stats small { font-size: 9px; font-weight: 900; text-transform: uppercase; color: rgba(255,255,255,.5); }

/* Quests */
.rpg-main-quests { border-color: rgba(225,27,34,.22); }
.quest-list { display: grid; gap: 9px; }
.quest-card { position: relative; display: flex; gap: 11px; padding: 11px; border-radius: 13px; border: 1px solid rgba(255,255,255,.1); background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.15)); }
.quest-card.done { border-color: rgba(46,204,113,.45); background: linear-gradient(180deg, rgba(46,204,113,.08), rgba(0,0,0,.12)); }
.quest-card-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: rgba(225,27,34,.12); border: 1px solid rgba(225,27,34,.3); }
.quest-card-body { flex: 1; min-width: 0; }
.quest-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.quest-card-head strong { font-size: 14px; }
.quest-xp { flex: 0 0 auto; font-size: 11px; font-weight: 950; color: #ffb061; }
.quest-flavor { margin: 3px 0 6px; font-size: 11px; font-style: italic; color: rgba(255,255,255,.55); }
.quest-card-foot { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.quest-card-foot small { font-size: 10px; color: rgba(255,255,255,.5); font-weight: 800; }
.quest-card-foot em { font-style: normal; font-size: 11px; font-weight: 900; color: #fff; }
.quest-done-badge { position: absolute; top: 9px; right: 10px; width: 20px; height: 20px; border-radius: 50%; background: #2ecc71; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.rpg-see-all { width: 100%; margin-top: 10px; min-height: 38px; border-radius: 9px; border: 1px dashed rgba(225,27,34,.5); background: rgba(225,27,34,.08); color: #fff; font-weight: 900; font-size: 12px; }

/* Rankings */
.rpg-rank-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.rpg-rank-tabs button { flex: 1; min-height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: rgba(255,255,255,.75); font-size: 12px; font-weight: 800; }
.rpg-rank-tabs button.active { border-color: var(--red,#e11b22); background: rgba(225,27,34,.16); color: #fff; }
.rpg-podium { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; align-items: stretch; margin-bottom: 10px; }
.rpg-podium-spot { min-width: 0; min-height: 86px; display: grid; grid-template-rows: auto minmax(16px, auto) 1fr; justify-items: center; align-content: start; text-align: center; padding: 9px 5px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); }
.rpg-podium-spot.place-1 { background: linear-gradient(180deg, rgba(255,210,70,.18), rgba(0,0,0,.1)); border-color: rgba(255,210,70,.55); box-shadow: 0 0 16px rgba(255,210,70,.25); padding-top: 9px; }
.rpg-podium-spot.place-2 { border-color: rgba(200,200,210,.4); }
.rpg-podium-spot.place-3 { border-color: rgba(205,127,50,.45); }
.rpg-podium-spot.me { outline: 2px solid rgba(225,27,34,.6); }
.rpg-podium-rank { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.4); color: #fff; font-size: 10px; font-weight: 950; margin-bottom: 4px; }
.rpg-podium-spot.place-1 .rpg-podium-rank { background: #ffd246; color: #1a1a1a; }
.rpg-podium-spot strong { display: block; width: 100%; min-width: 0; font-size: 10px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpg-podium-score { align-self: end; display: grid; gap: 0; justify-items: center; margin-top: 4px; }
.rpg-podium-spot em { display: block; font-style: normal; font-size: 17px; line-height: 1; font-weight: 950; color: #fff; }
.rpg-podium-spot small { display: block; max-width: 100%; font-size: 7px; line-height: 1; color: rgba(255,255,255,.58); text-transform: uppercase; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.rpg-rank-list { display: grid; gap: 6px; max-height: 190px; overflow: auto; padding-right: 1px; scrollbar-width: none; }
.rpg-rank-list::-webkit-scrollbar { display: none; }
.rpg-rank-list > div { display: grid; grid-template-columns: 34px minmax(0,1fr) 52px 24px 34px; align-items: center; gap: 6px; padding: 8px 9px; border-radius: 9px; background: rgba(255,255,255,.035); }
.rpg-rank-list > div.me { background: rgba(225,27,34,.12); border: 1px solid rgba(225,27,34,.3); }
.rpg-rank-list > div > span { font-weight: 900; color: rgba(255,255,255,.6); font-size: 11px; }
.rpg-rank-list > div strong { min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpg-rank-list > div small { font-size: 8px; text-transform: uppercase; color: rgba(255,255,255,.48); font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpg-rank-list em { justify-self: end; font-style: normal; font-size: 15px; font-weight: 950; color: #fff; }
.rank-up { color: #2ecc71; font-size: 11px; font-weight: 900; }
.rank-down { color: #ff5a5f; font-size: 11px; font-weight: 900; }
.rank-flat { color: rgba(255,255,255,.4); font-size: 11px; }
.rpg-score-explain { margin-top: 12px; }
.rpg-score-explain summary { cursor: pointer; font-size: 12px; font-weight: 800; color: rgba(255,255,255,.75); }
.rpg-score-weights { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rpg-score-weights span { font-size: 11px; font-weight: 800; color: rgba(255,255,255,.65); background: rgba(255,255,255,.05); border-radius: 999px; padding: 4px 9px; }
.rpg-score-weights b { color: #fff; }

/* Season */
.rpg-reward-track { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 12px; }
.rpg-reward-track div { text-align: center; padding: 9px 4px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px dashed rgba(255,255,255,.16); }
.rpg-reward-track div.claimed { border-style: solid; border-color: rgba(255,210,70,.5); background: rgba(255,210,70,.1); box-shadow: 0 0 12px rgba(255,210,70,.2); }
.rpg-reward-track b { display: block; font-size: 12px; color: #ffd246; }
.rpg-reward-track small { font-size: 9px; color: rgba(255,255,255,.6); font-weight: 800; }

/* ===== Ratos: subpáginas, missões, conquistas/stickers ===== */
.rpg-subpage-head { display: flex; align-items: center; gap: 10px; }
.rpg-subpage-head .training-back { flex: 0 0 auto; }
.rpg-subpage-head > div { flex: 1; min-width: 0; }
.rpg-subpage-head strong { display: block; font-size: 17px; }

.rpg-mission-tabs, .rpg-rank-tabs { display: flex; gap: 6px; }
.rpg-mission-tabs button { flex: 1; min-height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: rgba(255,255,255,.78); font-size: 12px; font-weight: 800; }
.rpg-mission-tabs button.active { border-color: var(--red,#e11b22); background: rgba(225,27,34,.16); color: #fff; }

/* Trilha de níveis */
.rpg-level-track { display: grid; gap: 8px; position: relative; }
.rpg-level-node { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 11px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); opacity: .6; }
.rpg-level-node.reached { opacity: 1; border-color: rgba(46,204,113,.35); }
.rpg-level-node.current { opacity: 1; border-color: rgba(225,27,34,.55); box-shadow: 0 0 16px rgba(225,27,34,.2); grid-template-columns: 36px 1fr; }
.rpg-level-node.current .rpg-xp-bar { grid-column: 1 / -1; margin-top: 2px; }
.rpg-level-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 950; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.18); color: #fff; }
.rpg-level-node.reached .rpg-level-dot { background: #2ecc71; border-color: #2ecc71; color: #06210f; }
.rpg-level-node.current .rpg-level-dot { background: var(--red,#e11b22); border-color: var(--red,#e11b22); }
.rpg-level-node strong { display: block; font-size: 13px; }
.rpg-level-node small { font-size: 11px; color: rgba(255,255,255,.6); }

/* Stickers de conquista */
.rpg-sticker-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rpg-sticker-grid.teaser { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rpg-sticker { text-align: center; padding: 12px 8px; border-radius: 14px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); }
.rpg-sticker.unlocked { border-color: var(--tier); background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--tier) 14%, transparent), rgba(0,0,0,.1)); }
.rpg-sticker.maxed { box-shadow: 0 0 18px var(--tier-glow); }
.rpg-sticker-medal { position: relative; width: 56px; height: 56px; margin: 0 auto 8px; display: grid; place-items: center; }
.rpg-sticker-icon { font-size: 30px; filter: grayscale(1) brightness(.5); }
.rpg-sticker.unlocked .rpg-sticker-icon { filter: none; }
.rpg-sticker-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--tier); box-shadow: 0 0 14px var(--tier-glow), inset 0 0 10px var(--tier-glow); }
.rpg-sticker.maxed .rpg-sticker-ring { border-style: double; border-width: 5px; }
.rpg-sticker strong { display: block; font-size: 12px; }
.rpg-sticker-tier { display: block; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; color: var(--tier, rgba(255,255,255,.5)); margin-top: 2px; }
.rpg-sticker.locked .rpg-sticker-tier { color: rgba(255,255,255,.4); }
.rpg-sticker .rpg-xp-bar { margin-top: 8px; height: 7px; }
.rpg-sticker .rpg-xp-bar span { background: var(--tier, #e11b22); box-shadow: none; }
.rpg-sticker-prog { display: block; font-size: 9px; color: rgba(255,255,255,.5); margin-top: 5px; font-weight: 800; }
.rpg-sticker-pin { width: 100%; margin-top: 8px; min-height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); color: rgba(255,255,255,.8); font-size: 11px; font-weight: 900; }
.rpg-sticker-pin.on { border-color: var(--tier); background: color-mix(in srgb, var(--tier) 20%, transparent); color: #fff; }

/* Stickers no perfil */
.profile-stickers .profile-sticker-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-top: 10px; overflow: hidden; }
.profile-stickers-compact .profile-sticker-row { margin-top: 0; }
.profile-sticker { min-width: 0; text-align: center; padding: 7px 3px; border-radius: 12px; border: 1px solid var(--tier); background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--tier) 16%, transparent), rgba(0,0,0,.15)); box-shadow: 0 0 12px var(--tier-glow); }
.profile-sticker .rpg-sticker-icon { display: block; font-size: 21px; line-height: 1; filter: none; }
.profile-sticker strong { display: block; margin-top: 5px; font-size: 8px; line-height: 1.08; font-weight: 950; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-sticker small { display: block; font-size: 7px; line-height: 1; font-weight: 900; text-transform: uppercase; color: var(--tier); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ GUIA APRENDER ============ */
.learning-screen { gap: 12px; }
.learning-head { display: flex; align-items: center; gap: 10px; }
.learning-head .training-back { flex: 0 0 auto; }
.learning-head .rpg-section-kicker { color: rgba(225,27,34,.85); }
.learning-head h1 { margin: 2px 0 0; font-size: 24px; }

/* Card RatLab Academy dentro da guia Ratos */
.rpg-academy-card { display: flex; align-items: center; gap: 12px; cursor: pointer; border: 1px solid rgba(225,27,34,.3); background: linear-gradient(160deg, rgba(225,27,34,.1), rgba(255,255,255,.02)); }
.rpg-academy-icon { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; font-size: 26px; background: rgba(225,27,34,.16); border: 1px solid rgba(225,27,34,.4); }
.rpg-academy-body { flex: 1; min-width: 0; }
.rpg-academy-body strong { display: block; font-size: 16px; }
.rpg-academy-body p { margin: 2px 0 6px; font-size: 12px; }
.rpg-academy-meta { display: flex; gap: 10px; }
.rpg-academy-meta span { font-size: 11px; font-weight: 800; color: rgba(255,255,255,.7); background: rgba(255,255,255,.05); border-radius: 999px; padding: 3px 9px; }
.rpg-academy-go { flex: 0 0 auto; font-size: 26px; color: rgba(255,255,255,.4); font-weight: 700; }

/* ============ GUIA DESAFIOS ============ */
.challenges-home,
.challenges-progress,
.challenges-achievements,
.challenges-clubs,
.challenges-ratpass {
  gap: 12px;
}

.challenges-head {
  padding: 8px 0 2px;
}

.challenges-head h1 {
  margin: 2px 0 4px;
  font-size: 31px;
  line-height: 1;
  letter-spacing: 0;
}

.challenges-head p,
.challenges-subpage-head p {
  margin: 3px 0 0;
  color: rgba(255,255,255,.58);
  font-size: 13px;
  line-height: 1.25;
}

.challenges-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.challenges-main-grid-secondary .challenge-main-card {
  min-height: 94px;
  padding: 11px 12px;
}

.challenges-home > .rpg-hero {
  margin-top: 2px;
}

.challenge-main-card {
  min-width: 0;
  min-height: 104px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background:
    radial-gradient(circle at top right, rgba(225,27,34,.18), transparent 42%),
    linear-gradient(160deg, rgba(255,255,255,.045), rgba(0,0,0,.12));
  color: #fff;
}

.challenge-card-progresso {
  border-color: rgba(59, 130, 246, .34);
  background:
    radial-gradient(circle at 10% 50%, rgba(59, 130, 246, .22), transparent 36%),
    linear-gradient(100deg, rgba(15, 46, 85, .98), rgba(16, 18, 22, .96));
}

.challenge-card-conquistas-hub {
  border-color: rgba(245, 158, 11, .34);
  background:
    radial-gradient(circle at 12% 50%, rgba(245, 158, 11, .24), transparent 36%),
    linear-gradient(100deg, rgba(58, 34, 10, .98), rgba(18, 16, 15, .96));
}

.challenge-card-clubes {
  border-color: rgba(168, 85, 247, .34);
  background:
    radial-gradient(circle at 12% 50%, rgba(168, 85, 247, .24), transparent 36%),
    linear-gradient(100deg, rgba(45, 24, 70, .98), rgba(17, 16, 20, .96));
}

.challenge-card-ratpass {
  border-color: rgba(244, 63, 94, .36);
  background:
    radial-gradient(circle at 12% 50%, rgba(244, 63, 94, .24), transparent 36%),
    linear-gradient(100deg, rgba(62, 15, 28, .98), rgba(17, 15, 17, .96));
}

.challenge-main-card:active {
  transform: translateY(1px);
}

.challenge-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid rgba(225,27,34,.42);
  background: rgba(225,27,34,.12);
  font-size: 22px;
}

.challenge-card-body {
  min-width: 0;
}

.challenge-card-body strong {
  display: block;
  font-size: 15px;
  line-height: 1.08;
}

.challenge-card-body p {
  margin: 5px 0 3px;
  color: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.challenge-card-body small {
  display: block;
  color: rgba(255,255,255,.45);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.challenge-card-progress {
  height: 7px;
  margin-top: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}

.challenge-card-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef4444, #ffb020);
  box-shadow: 0 0 12px rgba(239,68,68,.55);
}

.challenge-main-card em {
  justify-self: end;
  align-self: center;
  font-style: normal;
  font-size: 11px;
  font-weight: 950;
  color: #fff;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(225,27,34,.22);
  border: 1px solid rgba(225,27,34,.42);
}

.challenge-academy {
  border-color: rgba(255,210,70,.24);
  background:
    linear-gradient(145deg, rgba(255,210,70,.08), rgba(225,27,34,.06)),
    #111;
}

.academy-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.academy-mini-grid button {
  min-height: 116px;
  text-align: left;
  padding: 12px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.22);
  color: #fff;
}

.academy-mini-grid span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(225,27,34,.14);
  border: 1px solid rgba(225,27,34,.35);
  font-size: 20px;
}

.academy-mini-grid strong,
.academy-mini-grid small {
  display: block;
}

.academy-mini-grid strong {
  font-size: 14px;
}

.academy-mini-grid small {
  margin-top: 4px;
  color: rgba(255,255,255,.55);
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 800;
}

.challenge-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.challenge-summary-grid.compact {
  margin-top: 12px;
}

.challenge-summary-card .stat {
  margin: 0;
}

.challenge-mini-summary {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.challenge-mini-summary strong {
  color: rgba(255,255,255,.62);
  font-size: 10px;
  text-transform: uppercase;
}

.challenge-mini-summary b {
  display: block;
  color: var(--red,#e11b22);
  font-size: 24px;
  line-height: 1;
}

.challenge-mini-summary small {
  color: rgba(255,255,255,.56);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 800;
}

.club-stories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
}

.club-stories::-webkit-scrollbar {
  display: none;
}

.club-story {
  flex: 0 0 76px;
  display: grid;
  justify-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.75);
}

.club-story span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.14);
  background: linear-gradient(145deg, rgba(225,27,34,.16), rgba(255,255,255,.04));
  color: #fff;
  font-size: 22px;
  font-weight: 950;
}

.club-story.active span {
  border-color: var(--red,#e11b22);
  box-shadow: 0 0 16px rgba(225,27,34,.35);
}

.club-story small {
  max-width: 72px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 900;
}

.club-dashboard {
  border-color: rgba(225,27,34,.28);
  background: linear-gradient(150deg, rgba(225,27,34,.1), rgba(255,255,255,.03));
}

.club-dashboard-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.club-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px solid rgba(225,27,34,.5);
  background: rgba(225,27,34,.12);
  color: #fff;
  font-size: 24px;
  font-weight: 950;
}

.club-dashboard h2 {
  margin: 1px 0 2px;
  font-size: 19px;
}

.club-dashboard p {
  margin: 0;
  color: rgba(255,255,255,.58);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 800;
}

.club-ranking-list {
  display: grid;
  gap: 7px;
}

.club-ranking-list div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 54px;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}

.club-ranking-list div.me {
  border-color: rgba(225,27,34,.42);
  background: rgba(225,27,34,.1);
}

.club-ranking-list span,
.club-ranking-list small {
  color: rgba(255,255,255,.6);
  font-size: 11px;
  font-weight: 950;
}

.club-ranking-list strong {
  min-width: 0;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.club-ranking-list small {
  text-align: right;
}

.ratpass-roadmap {
  border-color: rgba(255,210,70,.22);
}

.ratpass-track {
  display: grid;
  gap: 9px;
}

.ratpass-node {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
  opacity: .68;
}

.ratpass-node span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0,0,0,.34);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.ratpass-node.done,
.ratpass-node.current {
  opacity: 1;
}

.ratpass-node.done {
  border-color: rgba(46,204,113,.38);
  background: rgba(46,204,113,.08);
}

.ratpass-node.done span {
  background: #22c55e;
  color: #052e16;
}

.ratpass-node.current {
  border-color: rgba(225,27,34,.5);
  box-shadow: 0 0 18px rgba(225,27,34,.18);
}

.ratpass-node.current span {
  background: var(--red,#e11b22);
  border-color: var(--red,#e11b22);
}

.ratpass-node strong,
.ratpass-node p,
.ratpass-node small {
  display: block;
}

.ratpass-node strong {
  color: #fff;
  font-size: 13px;
}

.ratpass-node p {
  margin: 2px 0;
  color: rgba(255,255,255,.62);
  font-size: 11px;
  font-weight: 800;
}

.ratpass-node small,
.ratpass-node em {
  color: rgba(255,255,255,.48);
  font-size: 10px;
  font-weight: 900;
  font-style: normal;
}

.ratpass-node em {
  justify-self: end;
  text-transform: uppercase;
}

@media (max-width: 420px) {
  .challenges-main-grid,
  .academy-mini-grid,
  .challenge-summary-grid {
    grid-template-columns: 1fr;
  }

  .challenge-main-card {
    min-height: 126px;
  }

  .club-dashboard-head {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .club-dashboard-head > .pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .ratpass-node {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .ratpass-node em {
    grid-column: 2;
    justify-self: start;
  }
}
.learning-main-tabs button { font-weight: 800; }
.learning-search { width: 100%; min-height: 42px; border-radius: 11px; border: 1px solid rgba(255,255,255,.12); background: #0e0e10; color: #fff; padding: 0 14px; font-size: 13px; }
.learning-cats { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.learning-cats::-webkit-scrollbar { display: none; }
.learning-cats button { flex: 0 0 auto; padding: 7px 13px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: rgba(255,255,255,.75); font-size: 12px; font-weight: 800; white-space: nowrap; }
.learning-cats button.active { border-color: var(--red,#e11b22); background: rgba(225,27,34,.16); color: #fff; }
.learning-feed-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.learning-sort { display: flex; gap: 6px; }
.learning-sort button { padding: 6px 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); color: rgba(255,255,255,.7); font-size: 11px; font-weight: 800; }
.learning-sort button.active { border-color: var(--red,#e11b22); color: #fff; }
.learning-saved-toggle { padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: rgba(255,255,255,.75); font-size: 11px; font-weight: 900; }
.learning-saved-toggle.on { border-color: #ffd246; color: #ffd246; }

.learning-post-card { display: grid; gap: 8px; cursor: pointer; }
.learning-post-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.learning-post-card h3 { margin: 0; font-size: 15px; }
.learning-post-excerpt { margin: 0; font-size: 12.5px; color: rgba(255,255,255,.7); }
.learning-type-chip { flex: 0 0 auto; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; color: #9fd0f0; border: 1px solid rgba(120,190,235,.4); border-radius: 999px; padding: 3px 8px; }
.learning-cat-chip { font-size: 10px; font-weight: 800; color: rgba(255,255,255,.6); background: rgba(255,255,255,.05); border-radius: 999px; padding: 4px 9px; }
.learning-post-foot { display: flex; justify-content: space-between; align-items: center; }
.learning-save-btn { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: rgba(255,255,255,.8); border-radius: 8px; padding: 5px 10px; font-size: 11px; font-weight: 800; }
.learning-save-btn.on { border-color: #ffd246; color: #ffd246; }

/* Autor / trust badge */
.learning-author { display: flex; align-items: center; gap: 9px; }
.learning-author-avatar { position: relative; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; background: #333; border: 2px solid rgba(255,255,255,.15); }
.learning-author-avatar.official { background: linear-gradient(135deg,#e11b22,#7a0d12); border-color: #ffd246; }
.learning-author-avatar.admin { background: linear-gradient(135deg,#444,#111); border-color: #9fd0f0; }
.learning-author-avatar.verified { background: linear-gradient(135deg,#0d5391,#062a4d); border-color: #6fe0ff; }
.learning-author-avatar.unverified { background: #2a2a30; border-color: rgba(255,255,255,.25); }
.learning-author-avatar.community { background: #232327; border-color: rgba(255,255,255,.15); }
.learning-verified-check { position: absolute; bottom: -3px; right: -3px; width: 16px; height: 16px; border-radius: 50%; background: #2ecc71; color: #06210f; font-size: 10px; font-weight: 950; display: grid; place-items: center; border: 2px solid #0a0a0c; }
.learning-author-avatar.verified .learning-verified-check { background: #6fe0ff; color: #04243a; }
.learning-author-avatar.official .learning-verified-check { background: #ffd246; color: #2a1c00; }
.learning-author-info { min-width: 0; display: grid; gap: 1px; }
.learning-author-info strong { font-size: 13px; }
.learning-author-info small { font-size: 11px; color: rgba(255,255,255,.6); }
.learning-trust-tag { font-size: 8.5px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; margin-top: 2px; }
.learning-trust-tag.official { color: #ffd246; }
.learning-trust-tag.admin { color: #9fd0f0; }
.learning-trust-tag.verified { color: #6fe0ff; }
.learning-trust-tag.unverified { color: rgba(255,255,255,.55); }
.learning-trust-tag.community { color: rgba(255,255,255,.45); }
.learning-community-disclaimer { margin: 4px 0 0; font-size: 10.5px; font-style: italic; color: rgba(255,255,255,.5); border-left: 2px solid rgba(255,255,255,.2); padding-left: 8px; }
.learning-health-warning { font-size: 11.5px; color: #ffb061; background: rgba(255,140,40,.1); border: 1px solid rgba(255,140,40,.3); border-radius: 10px; padding: 9px 11px; margin: 10px 0; }
.learning-post-body { font-size: 14px; line-height: 1.6; color: rgba(255,255,255,.85); margin: 12px 0; }
.learning-note-placeholder { margin-top: 12px; font-size: 11px; color: rgba(255,255,255,.5); border: 1px dashed rgba(255,255,255,.16); border-radius: 10px; padding: 10px; }

/* Manuais */
.learning-manual-card { display: flex; gap: 12px; cursor: pointer; align-items: center; }
.learning-manual-cover { flex: 0 0 auto; width: 64px; height: 80px; border-radius: 10px; display: grid; place-items: center; font-size: 34px; background: linear-gradient(160deg,#1a0a0d,#0a0a0c); border: 1px solid rgba(225,27,34,.4); box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.learning-manual-meta { min-width: 0; display: grid; gap: 3px; }
.learning-manual-meta strong { font-size: 15px; }
.learning-manual-meta p { margin: 0; font-size: 12px; }
.learning-manual-progress { display: grid; gap: 4px; margin-top: 4px; }
.learning-manual-progress small { font-size: 10px; color: rgba(255,255,255,.55); font-weight: 800; }

.manual-toc strong { display: block; margin-bottom: 8px; }
.manual-chapter { margin-bottom: 10px; }
.manual-chapter > small { display: block; font-size: 10px; font-weight: 900; text-transform: uppercase; color: rgba(225,27,34,.8); margin-bottom: 5px; }
.manual-lesson-link { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: rgba(255,255,255,.03); color: rgba(255,255,255,.78); font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.manual-lesson-link.active { border-color: var(--red,#e11b22); background: rgba(225,27,34,.12); color: #fff; }
.manual-lesson-link.done { color: #2ecc71; }
.manual-lesson h3 { margin: 4px 0 10px; font-size: 18px; }
.manual-block { font-size: 14px; line-height: 1.6; margin: 0 0 10px; }
.manual-block.text { color: rgba(255,255,255,.85); }
.manual-block.tip { color: #ffd87f; background: rgba(255,210,70,.08); border: 1px solid rgba(255,210,70,.25); border-radius: 10px; padding: 10px 12px; }
.manual-block.alert { color: #ff9a7a; background: rgba(255,90,60,.1); border: 1px solid rgba(255,90,60,.3); border-radius: 10px; padding: 10px 12px; }
.manual-block.checklist { padding-left: 20px; color: rgba(255,255,255,.85); }
.manual-block.checklist li { margin-bottom: 5px; }
.manual-lesson-nav { display: flex; gap: 8px; margin-top: 14px; }
.manual-lesson-nav button { flex: 1; }
.manual-summary-return {
  width: 100%;
  min-height: 42px;
  border-color: rgba(225, 27, 34, .35);
  background: rgba(225, 27, 34, .08);
  color: #fff;
  font-weight: 950;
}
.nutrition-reader-page .nutrition-subject-reader {
  margin-top: 0;
}
.learning-manual-shortcut { color: #fff; }
.learning-manual-shortcut svg { width: 20px; height: 20px; }

.nutrition-library-screen { padding-bottom: 96px; }
.nutrition-library-screen .rpg-subpage-head small { display: block; margin-top: 2px; color: rgba(255,255,255,.58); font-size: 12px; font-weight: 700; }
.nutrition-progress-hero { display: grid; gap: 12px; background: radial-gradient(circle at 12% 0%, rgba(225,27,34,.22), transparent 38%), linear-gradient(145deg, rgba(36,16,18,.96), rgba(15,15,17,.98)); border-color: rgba(225,27,34,.38); }
.nutrition-progress-hero > div:first-child { display: grid; gap: 3px; }
.nutrition-progress-hero span { color: rgba(255,255,255,.62); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.nutrition-progress-hero strong { font-size: 44px; line-height: 1; color: #fff; letter-spacing: 0; }
.nutrition-progress-hero small { color: rgba(255,255,255,.72); font-size: 12px; font-weight: 800; }
.nutrition-progress-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nutrition-progress-grid span { background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 9px; text-transform: none; letter-spacing: 0; color: rgba(255,255,255,.62); }
.nutrition-progress-grid b { display: block; margin-top: 2px; color: #fff; font-size: 13px; }
.nutrition-disclaimer { color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.45; border-color: rgba(255,210,70,.26); background: linear-gradient(135deg, rgba(255,210,70,.08), rgba(255,255,255,.03)); }
.continue-study-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.continue-study-card > div { min-width: 0; display: grid; gap: 3px; }
.continue-study-card strong { font-size: 14px; line-height: 1.25; }
.continue-study-card small { color: rgba(255,255,255,.58); font-size: 11px; font-weight: 800; }

.nutrition-library-toc { display: grid; gap: 12px; }
.manual-search-row { display: grid; }
.manual-search { min-height: 44px; border-color: rgba(225,27,34,.36); background: #09090a; }
.manual-filter-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.manual-filter-row::-webkit-scrollbar { display: none; }
.manual-filter-row button { flex: 0 0 auto; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: 8px 11px; background: rgba(255,255,255,.04); color: rgba(255,255,255,.74); font-size: 11px; font-weight: 900; }
.manual-filter-row button.active { border-color: rgba(225,27,34,.85); background: rgba(225,27,34,.18); color: #fff; }
.manual-filter-row.tag-row button.active { border-color: rgba(255,210,70,.75); background: rgba(255,210,70,.12); color: #ffe49a; }

.manual-chapter-card { border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.025); overflow: hidden; }
.manual-chapter-card.done { border-color: rgba(47,191,113,.32); background: rgba(47,191,113,.045); }
.manual-chapter-toggle,
.manual-topic-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; border: 0; color: inherit; background: transparent; cursor: pointer; }
.manual-chapter-toggle { padding: 12px; }
.manual-chapter-toggle span,
.manual-topic-toggle span { min-width: 0; display: grid; gap: 3px; }
.manual-chapter-toggle strong { font-size: 13px; line-height: 1.25; color: #fff; }
.manual-chapter-toggle small,
.manual-topic-toggle small { font-size: 10.5px; color: rgba(255,255,255,.56); font-weight: 800; }
.manual-chapter-toggle em { flex: 0 0 auto; font-style: normal; font-size: 12px; color: #ff3c45; font-weight: 950; }
.manual-mini-bar { height: 5px; background: rgba(255,255,255,.07); overflow: hidden; }
.manual-mini-bar span { display: block; height: 100%; background: linear-gradient(90deg, #e11b22, #ffd246); border-radius: 999px; }
.manual-mini-bar.small { height: 4px; }
.manual-topic-list { display: grid; gap: 8px; padding: 10px; }
.manual-topic-card { border: 1px solid rgba(255,255,255,.075); border-radius: 12px; background: rgba(0,0,0,.22); overflow: hidden; }
.manual-topic-card.done { border-color: rgba(47,191,113,.28); }
.manual-topic-toggle { padding: 10px; }
.manual-topic-toggle span { font-size: 12.5px; font-weight: 950; }
.manual-topic-toggle em { font-style: normal; color: rgba(255,255,255,.52); font-weight: 950; }
.manual-subject-list { display: grid; gap: 6px; padding: 8px; }
.manual-lesson-link.subject-link { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; margin: 0; padding: 10px; border-radius: 10px; }
.manual-lesson-link.subject-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manual-lesson-link.subject-link small { color: rgba(255,255,255,.48); font-size: 10px; font-weight: 900; white-space: nowrap; }

.nutrition-subject-reader { display: grid; gap: 14px; background: linear-gradient(180deg, rgba(24,24,26,.98), rgba(13,13,14,.98)); }
.nutrition-reader-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.07); }
.nutrition-reader-top > div { min-width: 0; }
.nutrition-reader-top h3 { margin: 4px 0 5px; font-size: 23px; line-height: 1.05; letter-spacing: 0; }
.nutrition-reader-top p { margin: 0; color: rgba(255,255,255,.6); font-size: 12px; }
.reading-progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.reading-progress span { display: block; height: 100%; background: linear-gradient(90deg, #e11b22, #ffd246); border-radius: 999px; }
.nutrition-subject-reader .manual-block { margin: 0; }
.nutrition-subject-reader .manual-block h4,
.manual-summary h4 { margin: 0 0 7px; color: #fff; font-size: 14px; letter-spacing: 0; }
.nutrition-subject-reader .manual-block p,
.nutrition-subject-reader .manual-block li { color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.65; }
.nutrition-subject-reader .manual-block ul { margin: 0; padding-left: 18px; }
.manual-summary { border: 1px solid rgba(225,27,34,.25); background: rgba(225,27,34,.08); border-radius: 14px; padding: 12px; }
.manual-summary p { margin: 0 0 7px; color: rgba(255,255,255,.82); font-size: 13px; line-height: 1.45; }
.manual-summary p:last-child { margin-bottom: 0; }
.manual-note-box { display: grid; gap: 8px; }
.manual-note-box span { color: rgba(255,255,255,.7); font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; }
.manual-note-box textarea { min-height: 96px; resize: vertical; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: #09090a; color: #fff; padding: 12px; font: inherit; line-height: 1.45; }

@media (max-width: 520px) {
  .nutrition-progress-grid { grid-template-columns: 1fr; }
  .continue-study-card,
  .nutrition-reader-top { flex-direction: column; align-items: stretch; }
  .manual-lesson-link.subject-link { grid-template-columns: 1fr; }
  .manual-lesson-link.subject-link span { white-space: normal; }
  .manual-lesson-nav { flex-direction: column; }
}

/* Diet home reorg */
.diet-header-actions { display: flex; align-items: center; gap: 8px; }
.diet-plans-menu-wrap { position: relative; }
.diet-plans-menu-btn svg { width: 27px; height: 27px; }
.diet-plans-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 220px; background: var(--surface, #1b1b1f); border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,0.4); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.diet-plans-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: transparent; border: none; border-radius: 10px; padding: 10px 12px; color: inherit; cursor: pointer; }
.diet-plans-menu button:hover { background: rgba(255,255,255,0.08); }
.diet-plans-menu button strong { font-size: 0.95rem; }
.diet-plans-menu button small { opacity: 0.6; font-size: 0.78rem; }

.diet-extra-counter { display: grid; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px dashed rgba(255,255,255,0.14); }
.diet-extra-counter.has-items { border-style: solid; border-color: rgba(225,27,34,.28); background: linear-gradient(135deg, rgba(225,27,34,.08), rgba(255,255,255,.035)); }
.diet-extra-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.diet-extra-counter strong { display: block; font-size: 0.92rem; }
.diet-extra-counter small { opacity: 0.68; font-size: 0.78rem; line-height: 1.25; }
.diet-extra-badge { min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border-radius: 999px; font-weight: 700; background: var(--accent, #e11b22); color: #fff; }
.diet-extra-list { display: grid; gap: 7px; }
.diet-extra-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.07); }
.diet-extra-row > div { min-width: 0; }
.diet-extra-row span { color: #fff; font-size: 0.75rem; font-weight: 900; white-space: nowrap; }
.diet-extra-more { display: block; color: var(--muted); }

@media (max-width: 420px) {
  .diet-extra-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .diet-extra-row span {
    white-space: normal;
  }
}

.diet-comparison-card .diet-compare-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.diet-compare-row { display: flex; flex-direction: column; gap: 6px; }
.diet-compare-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.diet-compare-top span { font-size: 0.9rem; font-weight: 600; }
.diet-compare-top em { font-size: 0.82rem; opacity: 0.8; font-style: normal; }
.diet-compare-bar { position: relative; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.diet-compare-bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; display: block; }
.diet-compare-bar.good > span { background: #2fbf71; }
.diet-compare-bar.warn > span { background: #f5a623; }
.diet-compare-bar.over > span { background: #e0533d; }
.diet-compare-bar.neutral > span { background: rgba(255,255,255,0.4); }
.diet-compare-delta { font-size: 0.76rem; opacity: 0.7; }

/* Meal consume modal + built meal block */
.diet-meal-built {
  margin-top: 12px;
  margin-bottom: 16px;
  padding: 12px 13px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(47, 191, 113, 0.11), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(47,191,113,0.28);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.diet-meal-built-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.1;
  color: #fff;
  font-weight: 950;
  letter-spacing: 0;
}
.diet-meal-built-head strong {
  min-width: 0;
  color: #fff;
  font-weight: 950;
}
.diet-meal-built-head span {
  flex: 0 0 auto;
  opacity: 0.92;
  color: #d7f6e5;
  font-size: 0.78rem;
  font-weight: 950;
}
.diet-meal-built-item {
  color: rgba(255,255,255,0.78);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
  opacity: 0.9;
}
.diet-meal-built + .diet-meal-actions-row,
.diet-meal-built + .pill-row {
  margin-top: 12px;
}

.diet-meal-consume-panel { max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 14px; max-height: 86vh; overflow-y: auto; border: 1px solid rgba(225,27,34,.42); background: linear-gradient(180deg, #1a1a1a, #101010); box-shadow: 0 24px 70px rgba(0,0,0,.72), 0 0 38px rgba(225,27,34,.12); }
.diet-meal-consume-panel .diet-card-head { padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.diet-meal-consume-panel .diet-card-head h3 { color: #fff; font-size: 18px; line-height: 1.05; }
.diet-meal-consume-panel .diet-card-head small { color: #a8a8a8; font-size: 11px; font-weight: 800; }
.diet-meal-consume-panel .diet-food-search { min-height: 44px; border-color: rgba(225,27,34,.55); background: #090909; box-shadow: inset 0 0 0 1px rgba(255,255,255,.02), 0 0 0 0 rgba(225,27,34,0); transition: border-color .16s ease, box-shadow .16s ease; }
.diet-meal-consume-panel .diet-food-search:focus { border-color: rgba(225,27,34,.95); box-shadow: 0 0 0 3px rgba(225,27,34,.16); outline: none; }
.diet-mc-section { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.035); }
.diet-mc-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: #f0f0f0; opacity: 0.72; }
.diet-mc-plan-item { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 12px; background: rgba(255,255,255,0.055); border: 1px solid rgba(255,255,255,.075); cursor: pointer; transition: border-color .16s ease, background .16s ease, opacity .16s ease; }
.diet-mc-plan-item:not(.off) { border-color: rgba(34,197,94,.42); background: linear-gradient(90deg, rgba(34,197,94,.16), rgba(255,255,255,.045)); }
.diet-mc-plan-item.off { opacity: 0.48; }
.diet-mc-plan-item input { width: 19px; height: 19px; flex: 0 0 auto; accent-color: var(--red); }
.diet-mc-plan-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: #fff; font-size: 0.92rem; font-weight: 900; }
.diet-mc-plan-name small { color: #b6b6b6; opacity: 0.8; font-size: 0.74rem; font-weight: 800; line-height: 1.25; }
.diet-mc-extra-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; border-radius: 12px; background: rgba(225,27,34,.075); border: 1px solid rgba(225,27,34,.22); }
.diet-mc-extra-qty { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.diet-mc-extra-qty input { width: 66px; padding: 7px 8px; border-radius: 9px; background: #080808; border: 1px solid rgba(255,255,255,.12); color: #fff; text-align: center; font-weight: 900; }
.diet-mc-extra-qty span { font-size: 0.76rem; color: #aaa; font-weight: 800; }
.diet-mc-results { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.diet-mc-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; padding: 10px 11px; border-radius: 12px; background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,.08); color: inherit; cursor: pointer; }
.diet-mc-result:hover { background: rgba(225,27,34,.12); border-color: rgba(225,27,34,.35); }
.diet-mc-result span:first-child { display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; font-weight: 900; }
.diet-mc-result small { color: #a8a8a8; opacity: 0.85; font-size: 0.74rem; }
.diet-mc-result-kcal { font-size: 0.78rem; color: #fff; font-weight: 950; white-space: nowrap; padding: 5px 8px; border-radius: 999px; background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.1); }
.diet-mc-total { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 6px 10px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(225,27,34,0.18), rgba(255,255,255,.04)); border: 1px solid rgba(225,27,34,0.34); }
.diet-mc-total span { color: #aaa; font-size: 0.78rem; font-weight: 950; text-transform: uppercase; }
.diet-mc-total strong { color: #fff; font-size: 1.25rem; line-height: 1; }
.diet-mc-total small { grid-column: 1 / -1; color: #cfcfcf; opacity: 0.82; font-size: 0.78rem; font-weight: 850; }
.diet-mc-actions { display: flex; gap: 10px; }
.diet-mc-actions button { flex: 1; min-height: 42px; border-radius: 10px; }

@media (max-width: 420px) {
  .diet-mc-extra-item,
  .diet-mc-result {
    align-items: flex-start;
    flex-direction: column;
  }

  .diet-mc-extra-qty {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Topbar menu — missions */
.topbar-menu-mission {
  grid-template-columns: auto 1fr auto;
  align-items: start;
}
.topbar-menu-mission .topbar-menu-item-text { display: flex; flex-direction: column; gap: 3px; }
.topbar-menu-mission-tag {
  align-self: center;
  min-width: 50px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
}
.topbar-menu-mission-tag.day { background: rgba(225, 27, 34, .9); }
.topbar-menu-mission-tag.week { background: rgba(245, 166, 35, .85); color: #1b1b1b; }
.topbar-menu-mission-tag.month { background: rgba(120, 110, 240, .85); }
.topbar-menu-mission-bar {
  display: block;
  height: 5px;
  margin-top: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.topbar-menu-mission-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), #ff7a45);
}
.topbar-menu-mission-xp {
  align-self: center;
  font-size: 11px;
  font-weight: 950;
  color: #ffce54;
  white-space: nowrap;
}
.topbar-menu-all {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid rgba(225, 27, 34, .35);
  border-radius: 12px;
  background: rgba(225, 27, 34, .12);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.topbar-menu-all:hover { background: rgba(225, 27, 34, .2); }

/* Topbar menu — level card + quest links */
.topbar-menu-level {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(225, 27, 34, .4);
  background: linear-gradient(135deg, rgba(225, 27, 34, .22), rgba(255, 122, 69, .08));
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.topbar-menu-level:hover { border-color: rgba(225, 27, 34, .7); }
.topbar-menu-level-badge {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--red), #b3141a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.topbar-menu-level-badge small { font-size: 8px; font-weight: 950; letter-spacing: .1em; opacity: .85; }
.topbar-menu-level-badge strong { font-size: 24px; font-weight: 950; line-height: 1; }
.topbar-menu-level-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.topbar-menu-level-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.topbar-menu-level-top strong { font-size: 14px; font-weight: 900; }
.topbar-menu-level-top em { font-size: 10px; font-style: normal; font-weight: 800; color: #ffce54; }
.topbar-menu-level-sub { font-size: 10.5px; color: rgba(255, 255, 255, .62); }
.topbar-menu-level-bar { height: 7px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; margin-top: 2px; }
.topbar-menu-level-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffce54, #ff7a45); }
.topbar-menu-level-xp { font-size: 9.5px; color: rgba(255, 255, 255, .55); }

.topbar-menu-quests { display: flex; flex-direction: column; gap: 8px; }
.topbar-menu-quest-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.topbar-menu-quest-link .quest-card { width: 100%; transition: border-color .14s ease, transform .12s ease; }
.topbar-menu-quest-link:hover .quest-card { border-color: rgba(225, 27, 34, .55); transform: translateY(-1px); }

/* Diet adherence calendar (replaces heatmap) */
.diet-heatmap-card .diet-month-card {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
}
.diet-cal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.diet-cal-nav {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.diet-cal-nav:hover:not(:disabled) { background: rgba(225, 27, 34, .18); border-color: rgba(225, 27, 34, .4); }
.diet-cal-nav:disabled { opacity: .3; cursor: default; }
.diet-cal-title {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.diet-cal-title strong {
  font-size: 14px;
  font-weight: 900;
  text-transform: capitalize;
}
.diet-cal-title .diet-month-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.diet-cal-day {
  position: relative;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #141414;
  color: #fff;
  cursor: pointer;
  overflow: visible;
}
.diet-cal-num { font-size: 11px; font-weight: 900; opacity: .9; }
.diet-cal-pct { font-size: 9px; font-weight: 800; align-self: flex-end; opacity: .92; }
.diet-cal-day.good { background: rgba(34, 197, 94, .9); border-color: rgba(34, 197, 94, .5); color: #05230f; }
.diet-cal-day.partial { background: rgba(245, 158, 11, .9); border-color: rgba(245, 158, 11, .5); color: #2a1c00; }
.diet-cal-day.bad { background: rgba(239, 68, 68, .9); border-color: rgba(239, 68, 68, .5); color: #2a0606; }
.diet-cal-day.empty { background: #1b1b1b; color: rgba(255, 255, 255, .5); }
.diet-cal-day.future { background: #111; color: rgba(255, 255, 255, .25); cursor: default; }
.diet-cal-day.today { box-shadow: 0 0 0 2px var(--red); }
.diet-cal-day em {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  display: none;
  width: 160px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #0d0d0d;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}
.diet-cal-day:hover em, .diet-cal-day:focus-visible em { display: block; }
.diet-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.diet-cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.diet-cal-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.diet-cal-legend i.g { background: #22c55e; }
.diet-cal-legend i.p { background: #f59e0b; }
.diet-cal-legend i.b { background: #ef4444; }
.diet-cal-legend i.e { background: #1b1b1b; border: 1px solid var(--border); }
.diet-cal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.diet-cal-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.diet-cal-summary-item.count { cursor: default; }
.diet-cal-summary-item small { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.diet-cal-summary-item strong { font-size: 16px; font-weight: 900; }
.diet-cal-summary-item span { font-size: 10px; opacity: .7; }
.diet-cal-summary-item.best { border-color: rgba(34, 197, 94, .45); }
.diet-cal-summary-item.best strong { color: #34d36b; }
.diet-cal-summary-item.worst { border-color: rgba(239, 68, 68, .45); }
.diet-cal-summary-item.worst strong { color: #f87171; }

/* Diet evolution chart (adherence + water, 0-100%) */
.diet-evolution-chart { margin-top: 10px; }
.diet-evo-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.diet-evo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.diet-evo-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.diet-evo-legend .adh i { background: #22c55e; }
.diet-evo-legend .water i { background: #38bdf8; }
.diet-evolution-chart svg { width: 100%; height: auto; display: block; }
.diet-evolution-chart .grid { stroke: rgba(255, 255, 255, .08); stroke-width: 1; }
.diet-evolution-chart .grid-label { fill: rgba(255, 255, 255, .35); font-size: 7px; text-anchor: end; }
.diet-evolution-chart .x-label { fill: rgba(255, 255, 255, .5); font-size: 7px; text-anchor: middle; }
.diet-evo-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.diet-evo-line.adh { stroke: #22c55e; }
.diet-evo-line.water { stroke: #38bdf8; }
.diet-evolution-chart circle.adh { fill: #22c55e; }
.diet-evolution-chart circle.water { fill: #38bdf8; }

/* Viewed profile overlay */
.viewed-profile-screen {
  position: fixed;
  inset: 0 auto 0 50%;
  width: min(100%, var(--app-max-width));
  max-width: var(--app-max-width);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--bg, #0c0c0e);
  overflow-y: auto;
  overflow-x: hidden;
  border-left: 1px solid #151515;
  border-right: 1px solid #151515;
}
.viewed-profile-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 12px;
  background: rgba(12,12,14,.96);
  border-bottom: 1px solid var(--border);
}
.viewed-profile-topbar strong { font-size: 15px; }
.viewed-profile-topbar .icon-btn { font-size: 22px; }
.viewed-profile-body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 16px;
  padding-bottom: 90px;
  overflow-x: hidden;
}

.viewed-profile-body > * {
  max-width: 100%;
  min-width: 0;
}
.viewed-profile-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 60px 20px; text-align: center; }
.viewed-profile-unavailable-icon { font-size: 42px; }
.viewed-profile-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; }
.viewed-profile-avatar {
  width: 84px; height: 84px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(225,27,34,.14);
  border: 2px solid var(--red);
  font-size: 34px; overflow: hidden;
}
.viewed-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.viewed-profile-hero h2 { margin: 6px 0 0; font-size: 20px; }
.viewed-profile-username { color: var(--muted); font-size: 13px; margin: 0; }
.viewed-profile-bio { font-size: 13px; margin: 6px 0 0; max-width: 320px; }
.viewed-profile-privacy-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, .35);
  background: rgba(239, 68, 68, .08);
  color: #fecaca;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.viewed-profile-privacy-pill.public {
  border-color: rgba(34, 197, 94, .28);
  background: rgba(34, 197, 94, .08);
  color: #bbf7d0;
}
.viewed-profile-stats { display: flex; gap: 24px; margin: 14px 0; }
.viewed-profile-stats div { display: flex; flex-direction: column; }
.viewed-profile-stats strong { font-size: 18px; font-weight: 900; }
.viewed-profile-stats span { font-size: 11px; color: var(--muted); }
.viewed-profile-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.viewed-profile-actions button.primary, .viewed-profile-actions button.secondary { width: auto; padding: 9px 18px; }
.viewed-profile-menu {
  position: absolute; top: 100%; right: 8px; z-index: 5;
  min-width: 220px; margin-top: 6px;
  background: var(--surface, #1b1b1f);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5); padding: 6px;
  display: flex; flex-direction: column;
}
.viewed-profile-menu button {
  text-align: left; padding: 11px 12px; border: 0; border-radius: 10px;
  background: transparent; color: #fff; font-size: 13px; cursor: pointer;
}
.viewed-profile-menu button:hover { background: rgba(255,255,255,.06); }
.viewed-profile-menu button.danger { color: #f87171; }
.viewed-profile-public-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin-top: 16px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
}
.viewed-profile-public-summary div {
  min-width: 0;
  border-radius: 10px;
  background: rgba(0,0,0,.2);
  padding: 8px 5px;
  text-align: center;
}
.viewed-profile-public-summary strong {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
}
.viewed-profile-public-summary span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewed-profile-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  margin-top: 14px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.viewed-profile-tabs button {
  min-width: 0;
  min-height: 48px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(255,255,255,.68);
  cursor: pointer;
}
.viewed-profile-tabs button.active {
  color: #fff;
  border-bottom-color: var(--red);
  background: rgba(239, 68, 68, .08);
}
.viewed-profile-tabs button.locked {
  opacity: .44;
}
.viewed-profile-tabs span {
  font-size: 16px;
  line-height: 1;
}
.viewed-profile-tabs small {
  max-width: 100%;
  font-size: 8px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewed-profile-posts {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 22px;
}

.viewed-profile-posts h3 {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 14px;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}
.viewed-profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.viewed-profile-post {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #141414;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: inherit;
}
.viewed-profile-post img { width: 100%; height: 100%; object-fit: cover; }
.viewed-profile-post-art { width: 100%; height: 100%; display: grid; place-items: center; padding: 8px; text-align: center; font-size: 11px; color: rgba(255,255,255,.7); }
.viewed-profile-post-art strong,
.viewed-profile-post-art small {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.viewed-profile-sections {
  width: 100%;
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.viewed-profile-section-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  padding: 12px;
}

.viewed-profile-locked {
  border-style: dashed;
  border-color: rgba(255,255,255,.14);
  background:
    radial-gradient(circle at right top, rgba(239, 68, 68, .12), transparent 45%),
    rgba(255,255,255,.025);
}

.viewed-profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.viewed-profile-share-list {
  display: grid;
  gap: 9px;
}

.viewed-profile-share-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background:
    radial-gradient(circle at right top, rgba(239, 68, 68, .12), transparent 45%),
    rgba(0,0,0,.22);
  padding: 11px;
}

.viewed-profile-share-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.viewed-profile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viewed-profile-achievements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.viewed-profile-achievements div {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  background: rgba(0,0,0,.22);
  padding: 10px;
}

.viewed-profile-achievements strong,
.viewed-profile-achievements span {
  display: block;
  font-size: 11px;
  line-height: 1.25;
}

.viewed-profile-achievements span {
  color: var(--muted);
  margin-top: 4px;
}

.viewed-profile-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.viewed-profile-metric-grid div {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(0,0,0,.22);
  padding: 10px;
}
.viewed-profile-metric-grid small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}
.viewed-profile-metric-grid strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

/* Chat header identity + group members */
.chat-header-id {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.chat-header-id > div { min-width: 0; display: flex; flex-direction: column; }
.chat-header-id strong { font-size: 15px; line-height: 1.1; }
.chat-header-id small { color: var(--muted); font-size: 11px; }
.chat-header-id:hover strong { color: var(--red); }

.chat-members-backdrop {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: flex-end;
  background: rgba(0,0,0,.55);
}
.chat-members-sheet {
  width: 100%;
  max-height: 72%;
  overflow-y: auto;
  padding: 14px;
  background: var(--surface, #161618);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--border);
}
.chat-members-list { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.chat-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.chat-member-row:hover { background: rgba(255,255,255,.08); }
.chat-member-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-member-name strong { font-size: 13px; }
.chat-member-name small { font-size: 11px; color: var(--muted); }
.chat-member-chevron { color: rgba(255,255,255,.35); font-size: 18px; }
.chat-members-open-group { width: 100%; margin-top: 6px; }

/* Share manager (planos/receitas) */
.share-manager-screen {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: flex;
  flex-direction: column;
  background: var(--bg, #0c0c0e);
  overflow-y: auto;
}
.share-manager-body { padding: 16px; padding-bottom: 90px; }
.share-manager-hint { font-size: 12px; margin: 0 0 14px; }
.share-manager-list { display: flex; flex-direction: column; gap: 8px; }
.share-manager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.share-manager-row.on { border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.06); }
.share-manager-name { font-size: 14px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-manager-row button { width: auto; flex: 0 0 auto; padding: 8px 14px; font-size: 12px; }

/* Workout history actions */
.history-session-card {
  position: relative;
  overflow: visible;
}

.history-session-menu-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .05);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.history-session-menu-btn:hover {
  border-color: rgba(239, 68, 68, .55);
  background: rgba(239, 68, 68, .12);
}

.history-session-menu {
  position: absolute;
  top: 44px;
  right: 12px;
  z-index: 8;
  min-width: 150px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(18, 18, 20, .98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .42);
}

.history-session-menu button {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.history-session-menu button:hover {
  background: rgba(255, 255, 255, .07);
}

.history-session-menu button.danger {
  color: #fca5a5;
}

.workout-history-editor-panel {
  width: min(520px, calc(100vw - 24px));
}

.workout-history-form {
  display: grid;
  gap: 12px;
}

.workout-history-form textarea {
  width: 100%;
  resize: vertical;
}

.workout-history-editor-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, .22);
  background: linear-gradient(135deg, rgba(239, 68, 68, .12), rgba(255, 255, 255, .03));
  color: var(--muted);
  font-size: 12px;
}

.workout-history-editor-summary strong {
  color: #fff;
  font-size: 12px;
  text-align: right;
}

.workout-history-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 560px) {
  .workout-history-editor-actions {
    grid-template-columns: 1fr;
  }
}

/* Diet search wizard — estimativa e validação (Fase 1) */
.diet-search-warn { color: #fbbf24; }
.diet-search-estimate-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin: 10px 0; }
.diet-search-estimate { padding: 10px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.diet-search-estimate small { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.diet-search-estimate strong { font-size: 16px; font-weight: 900; }
.diet-search-estimate span { font-size: 10px; color: var(--muted); }
.diet-search-result-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.03); margin-bottom: 8px; }
.diet-search-result-row.ok { border-color: rgba(34,197,94,.45); }
.diet-search-result-row.warn { border-color: rgba(245,158,11,.45); }
.diet-search-result-row.invalid { border-color: rgba(239,68,68,.5); }
.diet-search-result-row strong { font-size: 17px; font-weight: 900; }
.diet-search-result-row small { font-size: 9px; text-transform: uppercase; color: var(--muted); }
.diet-search-result-row span { display: block; }
.diet-search-status { flex: 0 0 auto; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.diet-search-status.ok { background: rgba(34,197,94,.18); color: #34d36b; }
.diet-search-status.warn { background: rgba(245,158,11,.18); color: #fbbf24; }
.diet-search-status.invalid { background: rgba(239,68,68,.2); color: #f87171; }
.diet-search-validation { border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; font-size: 12px; }
.diet-search-validation.error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.35); }
.diet-search-validation.warn { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.3); }
.diet-search-validation p { margin: 3px 0; }
.diet-search-how { margin: 8px 0; font-size: 12px; }
.diet-search-how summary { cursor: pointer; font-weight: 700; color: var(--red); }
.diet-search-how p { margin: 6px 0 0; color: var(--muted); line-height: 1.45; }

/* Tema claro, ativado nas configurações do perfil. */
:root[data-theme="light"] {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --border: #d8dce2;
  --text: #17191d;
  --muted: #5c6470;
}

html[data-theme="light"],
html[data-theme="light"] body {
  background: #e9ecf0;
}

html[data-theme="light"] .shell,
html[data-theme="light"] .auth-screen,
html[data-theme="light"] .app-fatal-error {
  background: var(--bg);
  border-color: #d8dce2;
}

html[data-theme="light"] .topbar,
html[data-theme="light"] .bottom-nav,
html[data-theme="light"] .diet-floating-panel,
html[data-theme="light"] .exercise-editor-panel,
html[data-theme="light"] .card,
html[data-theme="light"] .diet-meal-card,
html[data-theme="light"] .diet-option-consume,
html[data-theme="light"] .profile-privacy-card,
html[data-theme="light"] .profile-settings-panel {
  background-color: #ffffff;
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="light"] .muted,
html[data-theme="light"] small,
html[data-theme="light"] .field label {
  color: var(--muted);
}

html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .secondary {
  background-color: #f7f8fa;
  color: var(--text);
  border-color: var(--border);
}

.theme-option {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
}

.theme-option:has(input:checked) {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(225, 27, 34, .2);
}

.theme-option input { accent-color: var(--red); }

.theme-option span { display: grid; gap: 3px; }

.theme-option small { color: var(--muted); }
/* Tema claro suave: contraste confortável, sem branco puro. */
:root[data-theme="light"] {
  --bg: #e7ecf1;
  --panel: #f1f4f7;
  --panel-2: #e5ebf1;
  --border: #c8d2dc;
  --text: #16212c;
  --muted: #5e6c79;
  --red: #c91924;
  --red-soft: #f4d9dc;
  --shadow: 0 12px 28px rgba(25, 42, 58, .12);
}

html[data-theme="light"],
html[data-theme="light"] body,
html[data-theme="light"] #app {
  background: #dfe6ed;
  color: var(--text);
}

html[data-theme="light"] .shell,
html[data-theme="light"] .screen,
html[data-theme="light"] .auth-screen,
html[data-theme="light"] .app-fatal-error {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="light"] :is(.topbar, .bottom-nav) {
  background: #e0e6ec;
  border-color: #c7d1db;
  color: #1a2631;
}

html[data-theme="light"] :is(.card, .diet-floating-panel, .exercise-editor-panel, .profile-settings-panel, .profile-privacy-card, .diet-meal-card, .diet-option-consume, .topbar-menu, .viewed-profile-topbar) {
  background: #f1f4f7;
  border-color: #c9d3dd;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(26, 40, 54, .10);
}

html[data-theme="light"] :is(.card, .diet-floating-panel, .exercise-editor-panel, .profile-settings-panel, .profile-privacy-card, .diet-meal-card, .diet-option-consume, .topbar-menu, .viewed-profile-topbar) :is(h1, h2, h3, h4, strong, b) {
  color: #17222d;
}

html[data-theme="light"] :is(.muted, small, .field label, .topbar-menu-item-text small, .topbar-menu-level-sub, .topbar-menu-level-xp) {
  color: #5e6c79;
}

html[data-theme="light"] :is(input, select, textarea, .secondary, .icon-btn, .topbar-menu-item) {
  background: #e6ebf0;
  color: #17222d;
  border-color: #c4ced8;
}

html[data-theme="light"] :is(input, select, textarea)::placeholder {
  color: #74818d;
  opacity: 1;
}

html[data-theme="light"] :is(.secondary, .icon-btn, .topbar-menu-item):hover {
  background: #dbe3ea;
  border-color: #acbac7;
}

html[data-theme="light"] :is(.primary, button.primary, .bottom-nav button.active) {
  background-color: var(--red);
  color: #fff;
  border-color: var(--red);
}

html[data-theme="light"] .bottom-nav button:not(.active) {
  color: #526170;
}

html[data-theme="light"] :is(.bottom-nav button.active, .bottom-nav button.active span) {
  color: #fff;
}

html[data-theme="light"] :is(.topbar .icon-btn img, .bottom-nav img, .bottom-nav svg, .bottom-nav-app-icon, .bottom-nav-home-icon) {
  filter: brightness(0) saturate(100%) invert(14%) sepia(13%) saturate(1517%) hue-rotate(166deg) brightness(95%) contrast(90%);
}

html[data-theme="light"] .bottom-nav button.active :is(img, svg, .bottom-nav-app-icon, .bottom-nav-home-icon) {
  filter: brightness(0) invert(1);
}

html[data-theme="light"] :is(.rpg-hero, .diet-today-card, .challenge-main-card, .diet-today-mini, .quest-card, .rpg-hero-stats div) {
  background: #e9eef3;
  border-color: #c6d1dc;
  color: #17222d;
}

html[data-theme="light"] :is(.rpg-hero, .diet-today-card, .challenge-main-card, .quest-card) :is(h1, h2, h3, h4, strong, b, p, small, span) {
  color: inherit;
}

html[data-theme="light"] .rpg-hero-class,
html[data-theme="light"] .rpg-tag,
html[data-theme="light"] .rpg-hero-stats small {
  color: #526170 !important;
  background: #e1e8ef;
  border-color: #c5d0da;
}

html[data-theme="light"] :is(.progress, .rpg-progress, .topbar-menu-level-bar, .diet-progress-track) {
  background: #cbd5de;
}

html[data-theme="light"] :is(.topbar-menu-item:hover, .topbar-menu-item:active) {
  background: #dce5ed;
  border-color: #bcc9d5;
}

html[data-theme="light"] .theme-option {
  background: #e8edf2;
  border-color: #c7d1db;
}

html[data-theme="light"] .theme-option:has(input:checked) {
  background: #f5e5e7;
  border-color: var(--red);
}

html[data-theme="light"] .danger,
html[data-theme="light"] .status-bad {
  color: #ab1722;
}/* Desafios: acabamento visual compacto, sem alterar a estrutura funcional. */
.challenges-home {
  --challenge-gap: 10px;
  gap: var(--challenge-gap);
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  min-width: 0;
  overflow-x: hidden;
}
.challenges-home > .challenges-head { padding: 6px 2px 1px; }
.challenges-head h1 { font-size: 28px; line-height: 1.05; }
.challenges-section-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 3px 0 1px;
}
.challenges-section-nav button {
  min-width: 0;
  min-height: 38px;
  padding: 7px 6px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  color: #b8b8be;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.challenges-section-nav button.active {
  border-color: rgba(239,68,68,.72);
  background: linear-gradient(135deg, rgba(150,24,38,.72), rgba(45,18,23,.94));
  color: #fff;
  box-shadow: 0 5px 14px rgba(180,20,35,.18);
}
.challenges-section-panel { min-width: 0; }
.challenges-section-panel .challenge-main-card.is-hidden,
.challenges-academy-slot.is-hidden { display: none; }
.challenges-section-panel .challenges-main-grid { display: contents; }
.challenges-section-panel .challenge-main-card { margin-bottom: var(--challenge-gap); }
.challenges-section-panel .challenge-main-card:last-child { margin-bottom: 0; }
.challenges-academy-slot { min-width: 0; }
.challenges-academy-slot .challenge-academy { margin-top: 0; }
.community-home { gap: 12px; }
.community-home .challenges-head { padding-top: 4px; }
.community-home .challenges-head h1 { text-transform: uppercase; letter-spacing: .02em; }
.community-stack { display: grid; gap: 10px; }
.community-panel {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(31,31,34,.98), rgba(15,15,17,.98));
  box-shadow: 0 8px 18px rgba(0,0,0,.16);
}
.community-panel strong { font-size: 15px; color: #fff; }
.community-panel > span:not(.rpg-section-kicker) { color: #a7a7ae; font-size: 11px; }
.community-today { border-color: rgba(239,68,68,.38); background: linear-gradient(145deg, rgba(74,23,30,.8), rgba(24,17,19,.98)); }
.community-season { border-color: rgba(245,158,11,.28); }
.community-performance { border-color: rgba(96,165,250,.28); }
.community-clubs { border-color: rgba(168,85,247,.3); }
.community-progress { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(0,0,0,.42); }
.community-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ef4444, #f59e0b); }
.community-next { display: grid; gap: 2px; padding: 9px 0 1px; }
.community-next small { color: #a7a7ae; font-size: 10px; }
.community-next span { color: #f5b44a; font-size: 11px; font-weight: 800; }
.community-action { justify-self: start; min-height: 34px; padding: 7px 12px; border: 1px solid rgba(239,68,68,.62); border-radius: 9px; background: #a61f32; color: #fff; font-size: 11px; font-weight: 900; }
.community-action.secondary { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.16); }
.community-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.community-stats strong { display: grid; gap: 2px; font-size: 20px; color: #fff; }
.community-stats small { color: #9999a1; font-size: 9px; font-weight: 700; }
.community-delta { color: #7dd3a6 !important; font-size: 10px !important; font-weight: 800; }
.community-academy-wrap .challenge-academy { margin-top: 0; }
.challenges-home > .rpg-hero { margin-top: 0; padding: 13px; border-radius: 16px; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.challenges-home .rpg-hero-top { gap: 10px; }
.challenges-home .rpg-hero-avatar { width: 58px; height: 58px; border-radius: 14px; }
.challenges-home .rpg-hero-id h2 { font-size: 19px; line-height: 1.08; }
.challenges-home .rpg-hero-class { margin-top: 3px; font-size: 11px; }
.challenges-home .rpg-hero-tags { gap: 5px; margin-top: 6px; }
.challenges-home .rpg-tag { padding: 4px 7px; font-size: 9px; }
.challenges-home .rpg-xp-block { margin-top: 10px; }
.challenges-home .rpg-xp-bar { height: 11px; margin-top: 6px; }
.challenges-home .rpg-next-unlock { margin-top: 6px; font-size: 10px; }
.challenges-home .rpg-hero-stats { gap: 6px; margin-top: 10px; }
.challenges-home .rpg-hero-stats div { min-width: 0; padding: 6px 3px; border-radius: 8px; }
.challenges-home .rpg-hero-stats b { font-size: 15px; }
.challenges-home .rpg-hero-stats small { font-size: 8px; }
.challenges-main-grid-secondary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--challenge-gap);
  min-width: 0;
}
.challenges-main-grid-secondary .challenge-main-card,
.challenges-home .challenge-main-card {
  min-height: 92px;
  grid-template-columns: 42px minmax(0,1fr) auto;
  gap: 10px;
  padding: 11px;
  border-radius: 13px;
  border-color: rgba(255,255,255,.11);
  box-shadow: 0 7px 16px rgba(0,0,0,.14);
}
.challenges-home .challenge-card-progresso { background: linear-gradient(110deg,rgba(23,58,99,.88),rgba(15,29,48,.96)); }
.challenges-home .challenge-card-conquistas-hub { background: linear-gradient(110deg,rgba(82,27,35,.72),rgba(24,18,19,.96)); }
.challenges-home .challenge-card-clubes { background: linear-gradient(110deg,rgba(50,31,79,.72),rgba(23,18,31,.96)); }
.challenges-home .challenge-card-ratpass { background: linear-gradient(110deg,rgba(92,24,38,.68),rgba(28,17,20,.96)); }
.challenges-home .challenge-card-icon { width: 38px; height: 38px; border-radius: 11px; font-size: 19px; }
.challenges-home .challenge-card-body strong { font-size: 14px; }
.challenges-home .challenge-card-body p { margin-top: 3px; font-size: 10.5px; line-height: 1.25; }
.challenges-home .challenge-card-body small { font-size: 9.5px; }
.challenges-home .challenge-card-progress { height: 6px; margin-top: 7px; background: rgba(0,0,0,.28); border-radius: 999px; }
.challenges-home .challenge-main-card em { min-width: 48px; padding: 6px 9px; text-align: center; font-size: 10px; border-radius: 9px; }
.challenges-home .challenge-main-card > * { min-width: 0; }
.challenges-home .challenge-card-body p,
.challenges-home .challenge-card-body small { overflow-wrap: anywhere; }
.challenges-home .challenge-main-card em { align-self: center; white-space: nowrap; }
.challenges-home .challenge-academy { margin-top: 1px; padding: 13px; border-radius: 14px; background: linear-gradient(135deg,rgba(54,37,19,.56),rgba(24,19,16,.92)); border-color: rgba(245,158,11,.26); }
.challenges-home .academy-head { margin-bottom: 9px; }
.challenges-home .academy-mini-grid { gap: 8px; }
.challenges-home .academy-mini-grid button { min-height: 104px; padding: 10px; border-radius: 11px; background: rgba(15,15,15,.58); }
.challenges-home .academy-mini-grid span { width: 34px; height: 34px; margin-bottom: 8px; border-radius: 10px; font-size: 18px; }
.challenges-home .academy-mini-grid strong { font-size: 13px; }
.challenges-home .academy-mini-grid small { font-size: 10px; line-height: 1.25; }
@media (max-width: 380px) {
  .challenges-home > .rpg-hero { padding: 11px; }
  .challenges-home .rpg-hero-avatar { width: 52px; height: 52px; }
  .challenges-home .rpg-hero-id h2 { font-size: 17px; }
  .challenges-home .challenge-main-card { grid-template-columns: 36px minmax(0,1fr) auto; gap: 8px; padding: 9px; }
  .challenges-home .challenge-card-icon { width: 34px; height: 34px; }
  .challenges-home .challenge-main-card em { min-width: 43px; padding-inline: 6px; }
}

