: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: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: 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: fixed;
  z-index: 120;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #080b0e;
  box-shadow: none;
}

.topbar-menu-head {
  position: relative;
  z-index: 2;
  min-height: calc(64px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(8, 11, 14, .96);
  color: rgba(255, 255, 255, .62);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.topbar-menu-head-inner {
  width: min(100%, 720px);
  min-height: 64px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
}

.topbar-menu-head-inner > strong {
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  letter-spacing: .12em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-menu-head-spacer {
  width: 44px;
  height: 44px;
}

.topbar-menu-close,
.topbar-menu-back {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
}

.topbar-menu-close:hover,
.topbar-menu-back:hover {
  background: rgba(255, 255, 255, .11);
}

.topbar-menu-close svg,
.topbar-menu-back svg {
  width: 21px;
  height: 21px;
}

.topbar-menu-content {
  width: min(100%, 720px);
  min-height: 0;
  margin: 0 auto;
  padding: 18px 16px calc(var(--bottom-nav-total) + 28px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(var(--bottom-nav-total) + 12px);
  scrollbar-gutter: stable;
}

.topbar-menu-content--detail {
  padding-top: 20px;
}

body.topbar-central-open {
  overflow: hidden;
}

body.topbar-central-open .shell {
  border-inline: 0;
}

.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 > .social-story-thumb {
  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 > .social-story-thumb 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 > .social-story-thumb {
  border-color: #444;
}

.social-story.live > .social-story-thumb {
  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: 4px;
  padding: 10px 12px 6px;
}

.social-post-actions button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  flex-shrink: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 0;
  line-height: 1;
  padding: 10px;
  overflow: hidden;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  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.1);
  border-color: rgba(237, 28, 36, 0.3);
}

.social-post-actions .social-action-icon {
  display: block;
  width: 23px;
  height: 23px;
  max-width: none;
  max-height: none;
  flex: 0 0 23px;
  overflow: visible;
  pointer-events: none;
  transform: none;
  vector-effect: non-scaling-stroke;
}

.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: 0;
  margin: 0 12px 8px;
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.chat-tabs button {
  position: relative;
  min-width: 0;
  min-height: 48px;
  padding: 10px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: none;
  transform: none;
}

.chat-tabs button.active {
  color: var(--text);
  background: transparent;
}

.chat-tabs button.active::after { content: ''; position: absolute; bottom: -1px; left: 20%; right: 20%; height: 2px; background: var(--red); }
.chat-tabs button:focus-visible { outline: 2px solid var(--red); outline-offset: -4px; }
@media (hover: hover) { .chat-tabs button:hover { color: var(--text); background: rgba(128,128,128,.06); box-shadow: none; transform: none; } }

.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;
  min-width: 38px;
  min-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;
  line-height: 1;
  overflow: hidden;
  box-sizing: border-box;
  flex-shrink: 0;
}

.notification-avatar > img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}

.notification-avatar > span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.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;
  }
}

/* Dedicated shell for the social publisher: it must stay above the app navigation. */
.social-composer-backdrop.diet-floating {
  z-index: 170;
  place-items: center;
  padding: calc(12px + var(--safe-top)) calc(12px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(12px + var(--safe-left));
}

.social-composer-panel.diet-floating-panel {
  width: min(392px, 100%);
  max-width: calc(100dvw - 32px - var(--safe-left) - var(--safe-right));
  max-height: calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom));
  margin: auto;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-color: rgba(66, 213, 235, 0.28);
  background: #101216;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.58);
}

.social-composer-head.diet-card-head {
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(94, 215, 235, 0.16);
}

.social-composer-head.diet-card-head > div { min-width: 0; }
.social-composer-head.diet-card-head h3 { margin: 3px 0 2px; }
.social-composer-head.diet-card-head small { display: block; max-width: 31ch; }

.social-composer-head .icon-btn {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: -6px -6px 0 0;
}

.social-composer-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 16px 16px;
  scrollbar-gutter: stable;
}

.social-composer-panel .social-fab-grid { padding-bottom: 2px; }

@media (max-height: 680px) {
  .social-composer-head.diet-card-head { padding-top: 13px; padding-bottom: 11px; }
  .social-composer-panel .social-fab-grid button { min-height: 76px; }
}

@media (max-width: 360px) {
  .social-composer-backdrop.diet-floating { padding-inline: 12px; }
  .social-composer-panel.diet-floating-panel {
    max-width: calc(100dvw - 24px - var(--safe-left) - var(--safe-right));
  }
}
.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-main-row:has(> .profile-owner-tools) { grid-template-columns: 92px minmax(0,1fr) auto; }
.profile-owner-tools { display: flex; align-self: start; gap: 4px; }
.profile-owner-tools .profile-body-top-action { width: 40px; height: 40px; padding: 9px; background: transparent; border: 0; border-radius: 4px; box-shadow: none; color: var(--text); }
.profile-owner-tools .profile-body-top-action :is(svg,img) { width: 21px; height: 21px; object-fit: contain; }
.profile-owner-tools .profile-body-top-action:hover { background: rgba(127,127,127,.12); }
.profile-owner-tools .profile-body-top-action:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
@media(max-width:600px) {
  .profile-main-row:has(> .profile-owner-tools) { grid-template-columns: 80px minmax(0,1fr); }
  .profile-main-row > .profile-owner-tools { grid-column: 1 / -1; grid-row: 1; justify-self: end; }
  .profile-main-row:has(> .profile-owner-tools) > .profile-photo-wrap { grid-column: 1; grid-row: 2; }
  .profile-main-row:has(> .profile-owner-tools) > .profile-main-info { grid-column: 2; grid-row: 2; }
  .profile-owner-tools .profile-body-top-action { width: 44px; height: 44px; }
}
.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-health-form .profile-settings-actions > .primary {
  grid-column: 1 / -1;
}

.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-form {
  width: 100%;
}

.auth-intro {
  display: grid;
  gap: 4px;
}

.auth-intro strong { font-size: 16px; }

.auth-intro span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.auth-password-control { position: relative; }

.auth-password-control input { padding-right: 48px; }

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: 2px solid rgba(225, 27, 34, 0.42);
  outline-offset: -2px;
}

.auth-password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-message.auth-message--success {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.1);
  color: #dfffe9;
}

.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;
  touch-action: none;
  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;
}

/* Ficha: três faixas estáveis para impedir colisão entre título, resumo e ações. */
.training-flow .exercise-catalog-line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon title title"
    "icon details actions"
    "icon tags tags";
  align-items: center;
  gap: 7px 10px;
}

.training-flow .exercise-catalog-line > .exercise-type-icon {
  grid-area: icon;
  align-self: stretch;
}

.training-flow .exercise-catalog-line > div:nth-child(2) {
  display: contents;
}

.training-flow .exercise-catalog-line > div:nth-child(2) > strong {
  grid-area: title;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.training-flow .exercise-catalog-line > div:nth-child(2) > small {
  grid-area: details;
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-flow .exercise-catalog-line > div:last-child {
  grid-area: actions;
  min-width: 0;
  justify-self: end;
  align-self: center;
  gap: 6px;
}

.training-flow .exercise-catalog-line .training-strategy-badges {
  grid-area: tags;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
}

.training-flow .exercise-catalog-line .strategy-badge {
  min-width: 0;
  justify-content: center;
  padding: 3px 5px;
  font-size: 8px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

@media (max-width: 360px) {
  .training-flow .exercise-catalog-line {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 6px 8px;
  }

  .training-flow .exercise-catalog-line > .exercise-type-icon {
    width: 38px;
    min-width: 38px;
    height: auto;
    min-height: 100%;
  }

  .training-flow .exercise-catalog-line > div:last-child {
    gap: 4px;
  }

  .training-flow .exercise-catalog-line .pill {
    min-width: 54px;
    padding-inline: 6px;
  }
}
.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-muscle-icon {
  width: 30px;
  height: 30px;
  overflow: visible;
}

.exercise-muscle-body {
  fill: none;
  stroke: rgba(238, 244, 248, 0.58);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.exercise-muscle-highlight {
  fill: #ff334f;
  stroke: rgba(255, 113, 132, 0.5);
  stroke-width: 0.5;
}

.exercise-activity-symbol {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 17px;
  line-height: 1;
}

.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 {
  position: relative;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
}

.exercise-picker-open-btn > span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.exercise-picker-open-btn strong,
.exercise-picker-open-btn small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercise-picker-open-btn i {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(225, 27, 34, 0.58);
  border-radius: 50%;
  background: rgba(225, 27, 34, 0.1);
  color: #fff;
  display: block;
  flex: 0 0 36px;
  font-style: normal;
  font-size: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.exercise-picker-open-btn i::before,
.exercise-picker-open-btn i::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.exercise-picker-open-btn i::before {
  top: 9px;
  left: 9px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.exercise-picker-open-btn i::after {
  top: 21px;
  left: 20px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.exercise-picker-open-btn:hover i,
.exercise-picker-open-btn:focus-visible i {
  border-color: var(--accent, #e11b22);
  background: rgba(225, 27, 34, 0.2);
}

.exercise-picker-open-btn:active i {
  transform: scale(0.94);
}

.exercise-picker.open .exercise-picker-open-btn i::before,
.exercise-picker.open .exercise-picker-open-btn i::after {
  top: 17px;
  left: 9px;
  width: 16px;
  height: 2px;
  border: 0;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
}

.exercise-picker.open .exercise-picker-open-btn i::before {
  transform: rotate(45deg);
}

.exercise-picker.open .exercise-picker-open-btn i::after {
  transform: rotate(-45deg);
}

.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-avatar {
  grid-area: type;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(237, 28, 36, 0.65);
  border-radius: 50%;
  background: rgba(237, 28, 36, 0.08);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
}

.global-search-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }

.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[data-diet-photo-ai] {
  grid-template-areas: "icon title";
  grid-template-rows: 1fr;
}

.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%);
  overflow: hidden;
  contain: paint;
  background:
    linear-gradient(180deg, rgba(30, 143, 211, 0.88) 0%, rgba(8, 94, 164, 0.94) 34%, rgba(3, 48, 91, 0.98) 100%);
  box-shadow:
    inset 0 12px 28px rgba(89, 205, 255, 0.16),
    inset 0 -22px 44px rgba(0, 18, 45, 0.34),
    0 -8px 24px rgba(21, 132, 205, 0.12);
  transition: height 820ms cubic-bezier(0.16, 1, 0.3, 1);
}

.water-fill::before,
.water-fill::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.water-fill::before {
  inset: -16% -24%;
  opacity: 0.2;
  background:
    radial-gradient(ellipse at 16% 18%, rgba(175, 232, 255, 0.68) 0 4%, transparent 14%),
    radial-gradient(ellipse at 68% 34%, rgba(112, 210, 255, 0.44) 0 3%, transparent 13%),
    radial-gradient(ellipse at 42% 78%, rgba(118, 203, 247, 0.3) 0 3%, transparent 15%);
  background-size: 190px 150px, 230px 175px, 260px 190px;
  mix-blend-mode: screen;
  transform: translate3d(-2%, 0, 0) scale(1.04);
  animation: ratlabWaterCaustics 11s ease-in-out infinite alternate;
}

.water-fill::after {
  top: 2px;
  left: 8%;
  right: 8%;
  height: 18px;
  opacity: 0.46;
  background: linear-gradient(90deg, transparent 0%, rgba(202, 242, 255, 0.52) 36%, rgba(255, 255, 255, 0.78) 50%, rgba(179, 231, 255, 0.42) 64%, transparent 100%);
  filter: blur(5px);
  transform: scaleX(0.54);
  animation: ratlabWaterGlint 5.4s ease-in-out infinite alternate;
}

.water-surf {
  position: absolute;
  left: 0;
  display: block;
  width: 200%;
  max-width: none;
  pointer-events: none;
  will-change: transform;
}

.water-surf-back {
  top: -3px;
  height: 36px;
  opacity: 0.58;
  animation: ratlabWaterFlowBack 8.6s linear infinite;
}

.water-surf-back path {
  fill: rgba(55, 167, 225, 0.76);
}

.water-surf-front {
  top: 1px;
  height: 31px;
  opacity: 0.92;
  filter: drop-shadow(0 3px 4px rgba(0, 43, 85, 0.24));
  animation: ratlabWaterFlowFront 6.2s linear infinite;
}

.water-surf-front path {
  fill: rgba(22, 126, 196, 0.9);
}

@keyframes ratlabWaterFlowBack {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@keyframes ratlabWaterFlowFront {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@keyframes ratlabWaterCaustics {
  0% { transform: translate3d(-3%, -1%, 0) scale(1.04); opacity: 0.14; }
  55% { transform: translate3d(2%, 2%, 0) scale(1.08); opacity: 0.24; }
  100% { transform: translate3d(5%, -2%, 0) scale(1.03); opacity: 0.18; }
}

@keyframes ratlabWaterGlint {
  from { transform: translate3d(-16%, 0, 0) scaleX(0.48); opacity: 0.24; }
  to { transform: translate3d(16%, 1px, 0) scaleX(0.7); opacity: 0.52; }
}

.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; }
  .water-fill { transition-duration: 1ms; }
}

.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-detail-section span small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.diet-history-editor {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  width: min(720px, calc(100vw - 24px));
  max-width: 720px;
  max-height: min(820px, calc(100dvh - 24px));
  overflow: hidden;
}

.diet-history-editor-note {
  margin: 10px 0 0;
  border-left: 2px solid var(--red);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 11px;
}

.diet-history-editor-meals {
  display: grid;
  gap: 10px;
  min-height: 0;
  margin-top: 10px;
  padding-right: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.diet-history-editor-meal {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, .2);
  padding: 10px;
}

.diet-history-editor-meal-head {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, .35fr) 40px;
  align-items: end;
  gap: 8px;
}

.diet-history-editor label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.diet-history-editor label > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.diet-history-editor input {
  width: 100%;
  min-width: 0;
  height: 40px;
}

.diet-history-editor .icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
}

.diet-history-editor .destructive {
  border-color: rgba(242, 30, 61, .55);
  color: var(--red);
}

.diet-history-editor-foods {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.diet-history-editor-food {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(76px, .25fr) minmax(76px, .25fr) 40px;
  align-items: end;
  gap: 7px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  padding-top: 8px;
}

.diet-history-editor-food > div {
  min-width: 0;
  align-self: center;
}

.diet-history-editor-food strong,
.diet-history-editor-food small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diet-history-editor-food strong {
  color: #fff;
  font-size: 11px;
}

.diet-history-editor-food small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.diet-history-editor-meal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.diet-history-editor-meal-foot > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.diet-history-food-picker {
  margin-top: 9px;
}

.diet-history-food-results {
  display: grid;
  max-height: 210px;
  margin-top: 6px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.diet-history-food-results button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  border-radius: 0;
  background: #0b1014;
  padding: 8px 10px;
  text-align: left;
}

.diet-history-food-results button:last-child {
  border-bottom: 0;
}

.diet-history-food-results span,
.diet-history-food-results small {
  display: block;
}

.diet-history-food-results span {
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.diet-history-food-results small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.diet-history-food-results strong {
  flex: 0 0 auto;
  color: #fff;
  font-size: 10px;
}

.diet-history-add-meal {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px dashed rgba(242, 30, 61, .6);
  background: rgba(242, 30, 61, .06);
}

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

.diet-history-editor-empty {
  margin: 6px 0;
  font-size: 10px;
}

@media (max-width: 520px) {
  .diet-history-editor {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 12px;
  }

  .diet-history-editor-meal-head {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .diet-history-editor-meal-head > label:first-child {
    grid-column: 1 / -1;
  }

  .diet-history-editor-food {
    grid-template-columns: minmax(0, 1fr) minmax(70px, .7fr) 40px;
  }

  .diet-history-editor-food > div {
    grid-column: 1 / -1;
  }

  .diet-history-editor-food > label:nth-of-type(1) {
    grid-column: 1;
  }

  .diet-history-editor-food > label:nth-of-type(2) {
    grid-column: 2;
  }

  .diet-history-editor-food > button {
    grid-column: 3;
  }

  .diet-history-editor-meal-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .diet-history-editor-meal-foot button {
    width: 100%;
  }
}

.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-resume-banner .training-resume-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.training-resume-banner .training-resume-title b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-resume-banner .training-running-icon {
  width: 18px;
  height: 18px;
  color: #ff4a54;
}

.training-resume-title svg { width:18px; height:18px; flex:none; }
.training-resume-pair { position:sticky; top:calc(70px + var(--safe-top)); z-index:9; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; width:calc(100% - 24px); margin:8px auto 0; }
.training-resume-pair .training-resume-banner { position:static; width:100%; min-width:0; margin:0; min-height:52px; box-sizing:border-box; border-radius:8px; flex-direction:column; align-items:flex-start; justify-content:center; gap:4px; padding:8px 10px; }
.training-resume-pair .training-resume-banner small { text-align:left; overflow-wrap:anywhere; line-height:1.3; }

.training-flow {
  gap: 14px;
}

.training-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.training-step-header > .training-step-title {
  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-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
}

.training-history-toolbar > .history-period-filter {
  margin-left: auto;
}

.training-back {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: #0d0f12;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  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 {
  display: block;
  width: 20px;
  height: 20px;
  max-width: 100%;
  max-height: 100%;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.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;
}

/* Fichas: ações frequentes ficam compactas ao lado do título. */
.training-step-header--with-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: clamp(10px, 2vw, 18px);
  width: 100%;
}

.training-step-header--with-actions > .training-step-title {
  min-width: 0;
}

.training-header-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(40px, 4vw, 44px);
  align-items: center;
  justify-content: end;
  justify-self: end;
  gap: clamp(5px, 0.75vw, 8px);
  width: max-content;
  min-width: 0;
  padding-left: clamp(10px, 1.5vw, 16px);
  border-left: 1px solid rgba(120, 143, 158, 0.28);
}
.training-header-actions .training-header-action,
.training-header-actions .learning-manual-shortcut,
.training-header-actions .pdf-import-trigger-training {
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: clamp(40px, 4vw, 44px);
  height: clamp(40px, 4vw, 44px);
  min-width: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(120, 143, 158, 0.32);
  border-radius: 8px;
  color: var(--text);
  background: rgba(12, 16, 20, 0.92);
  box-shadow: none;
  line-height: 1;
}
.training-header-actions .training-header-action:hover,
.training-header-actions .training-header-action:focus-visible,
.training-header-actions .learning-manual-shortcut:hover,
.training-header-actions .learning-manual-shortcut:focus-visible {
  color: #fff;
  border-color: rgba(225, 27, 34, 0.72);
  background: rgba(225, 27, 34, 0.12);
  outline: none;
}
.training-header-actions .training-header-action-today {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 8px 20px rgba(225, 27, 34, 0.22);
}
.training-header-actions .training-header-action-today:hover,
.training-header-actions .training-header-action-today:focus-visible {
  border-color: #ff5960;
  background: #f12631;
}
.training-header-actions .training-header-action > svg,
.training-header-actions .learning-manual-shortcut > svg,
.training-header-actions .pdf-import-trigger-training > svg {
  display: block;
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
}
.training-header-actions .training-header-action-today > svg {
  fill: currentColor;
  stroke: currentColor;
}
.training-header-actions .training-header-action > span,
.training-header-actions .pdf-import-trigger-training > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
html[data-theme='light'] .training-header-actions .training-header-action,
html[data-theme='light'] .training-header-actions .learning-manual-shortcut,
body.theme-light .training-header-actions .training-header-action,
body.theme-light .training-header-actions .learning-manual-shortcut,
body.theme-light .training-header-actions .pdf-import-trigger-training {
  color: #18222b;
  border-color: rgba(31, 52, 66, 0.28);
  background: rgba(255, 255, 255, 0.96);
}
html[data-theme='light'] .training-header-actions .training-header-action-today,
body.theme-light .training-header-actions .training-header-action-today {
  color: #fff;
  border-color: #d71724;
  background: #d71724;
}
@media (max-width: 430px) {
  .training-step-header--with-actions {
    grid-template-columns: minmax(96px, 1fr) auto;
    column-gap: clamp(6px, 2vw, 10px);
  }

  .training-header-actions {
    grid-auto-columns: clamp(38px, 9vw, 40px);
    gap: clamp(3px, 1vw, 5px);
    padding-left: clamp(5px, 1.5vw, 8px);
  }

  .training-header-actions .training-header-action,
  .training-header-actions .learning-manual-shortcut,
  .training-header-actions .pdf-import-trigger-training {
    width: clamp(38px, 9vw, 40px);
    height: clamp(38px, 9vw, 40px);
    min-width: 38px;
    min-height: 38px;
  }

  .training-header-actions :is(.training-header-action, .learning-manual-shortcut, .pdf-import-trigger-training) > svg {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    flex-basis: 18px;
  }
}

@media (max-width: 350px) {
  .training-step-header--with-actions {
    grid-template-columns: minmax(88px, 1fr) auto;
  }

  .training-step-header--with-actions h1 {
    font-size: 21px;
  }

}
.training-card-list,
.training-exercise-list {
  display: grid;
  gap: 10px;
}

.training-card-list {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  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(68px, 0.3fr) 30px 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-plan-card.is-pdf-plan:not(.is-plan-locked) {
  grid-template-columns: minmax(0, 1fr) minmax(60px, 0.26fr) repeat(3, 30px);
}

.training-plan-card.is-pdf-plan.is-plan-locked {
  grid-template-columns: minmax(0, 1fr) minmax(68px, 0.3fr);
}

.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(68px, 0.3fr) 30px 30px 30px;
}

.division-drag-ghost {
  grid-template-columns: 42px minmax(0, 1fr) 34px 34px;
}

.training-plan-drag,
.training-division-drag {
  touch-action: none;
  user-select: none;
  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,
.training-plan-quick-delete {
  align-self: center;
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.training-pdf-badge {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: end;
  border-radius: 50%;
  font-size: 8px;
  line-height: 1;
}

.training-plan-quick-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #ff7b80;
  border: 1px solid rgba(225, 27, 34, 0.34);
  border-radius: 50%;
  line-height: 1;
}

.training-plan-quick-delete svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.training-plan-quick-delete.is-confirming {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

@media (max-width: 390px) {
  .training-plan-card {
    grid-template-columns: minmax(0, 1fr) minmax(54px, 0.24fr) 28px 28px 28px;
    gap: 5px;
    padding-inline: 12px 10px;
  }

  .training-plan-card.is-pdf-plan:not(.is-plan-locked) {
    grid-template-columns: minmax(0, 1fr) minmax(48px, 0.2fr) repeat(3, 28px);
    gap: 4px;
    padding-inline: 10px 8px;
  }

  .training-plan-card.is-pdf-plan.is-plan-locked {
    grid-template-columns: minmax(0, 1fr) minmax(54px, 0.24fr);
  }

  .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,
  .training-plan-quick-delete,
  .training-pdf-badge {
    width: 28px;
    height: 28px;
    min-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-add-division-trigger {
  width: 100%;
  min-height: 46px;
  margin: 0;
}

.training-division-create-panel {
  width: min(430px, 100%);
  gap: 12px;
  border-style: solid;
  border-color: rgba(225, 27, 34, 0.5);
  padding: 14px;
  overscroll-behavior: contain;
}

.training-division-create-head {
  margin: -2px 0 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.training-division-create-head small {
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.training-division-create-head h3 { margin: 3px 0 0; }

.training-division-create-panel .field {
  display: grid;
  gap: 6px;
}

.training-division-create-panel .field > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.training-division-create-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 8px;
}

.training-division-create-actions button {
  min-height: 44px;
  margin: 0;
}

@media (max-width: 359px) {
  .training-division-create-panel { padding: 11px; gap: 10px; }
  .training-division-create-actions { grid-template-columns: 1fr 1fr; }
}

.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: minmax(96px, 1.35fr) minmax(70px, 1fr) minmax(44px, .65fr);
  align-items: center;
  gap: 0;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(120, 143, 158, .2);
}

.training-exercise-meta span {
  min-width: 0;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: #dce4e8;
  font-size: 9px;
  font-weight: 850;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.training-exercise-meta span + span {
  border-left: 1px solid rgba(120, 143, 158, .2);
}

.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-active-titlebar .training-step-header h1 {
  font-size: 17.5px;
  line-height: 1.12;
}

.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(255, 255, 255, 0.09);
  background: #151515;
  padding: 12px;
}

.training-session-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #0d0d0d;
}

.training-session-stats.has-contextual-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.training-session-stats .session-stat {
  position: relative;
  min-width: 0;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 9px 11px;
}

.training-session-stats .session-stat + .session-stat::before {
  content: '';
  position: absolute;
  inset: 10px auto 10px 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.training-session-stats.has-contextual-metrics .session-stat:nth-child(odd)::before {
  display: none;
}

.training-session-stats.has-contextual-metrics .session-stat:nth-child(n + 3) {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.training-session-stats strong {
  color: #fff;
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-session-stats #session-duration {
  color: var(--red);
}

.training-session-stats small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.training-session-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.training-session-progress-copy strong {
  margin-left: auto;
  color: #fff;
  font-size: 10px;
}

.training-session-hero .progress {
  height: 4px;
  border-radius: 999px;
  background: #090909;
  overflow: hidden;
  margin: 6px 0 11px;
}

.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: 44px minmax(0, 1fr) 44px;
  gap: 8px;
}

.training-session-controls button {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.session-player-btn {
  height: 44px;
  width: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 27, 34, 0.78);
  border-radius: 8px;
  background: #0d0d0d;
  color: #fff;
  box-shadow: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.session-player-btn svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: #fff;
}

.session-player-btn.playing svg {
  width: 19px;
}

.session-player-btn.playing .player-pause {
  rx: 1.2px;
}

.session-player-btn.paused {
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 8px 20px rgba(225, 27, 34, 0.2);
}

.session-player-btn:active {
  transform: scale(0.94);
}

.training-session-controls .primary {
  min-height: 44px;
  border-radius: 8px;
}

.session-discard-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(225, 27, 34, 0.58);
  border-radius: 8px;
  background: rgba(225, 27, 34, 0.08);
  color: #ff5260;
}

.session-discard-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.session-discard-sheet {
  gap: 14px;
}

.session-discard-sheet p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.session-discard-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.session-discard-actions button {
  min-width: 0;
  min-height: 44px;
  white-space: normal;
}

.session-discard-confirm {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

/* Post-workout structural review: selective, explicit and blocking. */
.workout-plan-review-sheet {
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 32px));
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.workout-plan-review-sheet .modal-set-type-head {
  align-items: flex-start;
  margin: 0;
}

.workout-plan-review-sheet .modal-set-type-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workout-plan-review-sheet .modal-set-type-head small,
.workout-plan-review-copy > small {
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workout-plan-review-sheet .modal-set-type-head strong {
  font-size: clamp(15px, 2.4vw, 19px);
  line-height: 1.18;
}

.workout-plan-review-sheet > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.workout-plan-review-all,
.workout-plan-review-item {
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.workout-plan-review-all {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: #e9eef1;
  font-size: 11px;
  font-weight: 800;
}

.workout-plan-review-all input,
.workout-plan-review-item input {
  accent-color: var(--red);
}

.workout-plan-review-all small {
  color: var(--muted);
  font-size: 10px;
}

.workout-plan-review-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}

.workout-plan-review-item {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b0e10;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.workout-plan-review-item > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.workout-plan-review-check {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(126, 147, 159, 0.45);
  border-radius: 6px;
  color: #fff;
}

.workout-plan-review-check::before {
  content: '✓';
  opacity: 0;
  font-size: 13px;
  font-weight: 900;
}

.workout-plan-review-item:has(input:checked) {
  border-color: rgba(225, 27, 34, 0.62);
  background: rgba(225, 27, 34, 0.07);
}

.workout-plan-review-item input:focus-visible + .workout-plan-review-check {
  outline: 2px solid rgba(73, 194, 255, 0.85);
  outline-offset: 2px;
}

.workout-plan-review-item input:checked + .workout-plan-review-check {
  border-color: var(--red);
  background: var(--red);
}

.workout-plan-review-item input:checked + .workout-plan-review-check::before {
  opacity: 1;
}

.workout-plan-review-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.workout-plan-review-copy > strong {
  color: #f5f7f8;
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.workout-plan-review-copy > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.workout-plan-review-actions {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 7px;
}

.workout-plan-review-actions button {
  min-width: 0;
  min-height: 44px;
  padding-inline: 10px;
  white-space: normal;
  line-height: 1.2;
}

.workout-plan-review-actions .primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

@media (max-width: 359px) {
  .training-session-controls {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 6px;
  }

  .session-player-btn,
  .session-discard-button {
    width: 40px;
    min-width: 40px;
    height: 42px;
  }

  .session-discard-actions {
    grid-template-columns: 1fr;
  }

  .workout-plan-review-sheet {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 12px;
  }

  .workout-plan-review-actions {
    grid-template-columns: 1fr 1fr;
  }

  .workout-plan-review-actions .primary {
    grid-column: 1 / -1;
  }
}

.training-set-row.done {
  border-color: rgba(34, 197, 94, 0.26);
  background: rgba(34, 197, 94, 0.035);
}

.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% - 96px);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0;
  text-align: left;
}

.session-exercise-head-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
}

.session-exercise-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  text-align: left;
}

.session-exercise-title-line strong {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.session-exercise-head-copy > .muted {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.session-note-toggle {
  position: absolute;
  top: 0;
  right: 0;
  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;
  z-index: 2;
}

.session-note-toggle .control-icon {
  width: 18px;
  height: 18px;
}

.session-note-toggle > span {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid #11151a;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 950;
}

.session-exercise-card {
  position: relative;
  perspective: 1200px;
}

.session-exercise-card-rotator {
  position: relative;
  display: grid;
  min-width: 0;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform 420ms cubic-bezier(.22, .72, .22, 1);
}

.session-exercise-face {
  grid-area: 1 / 1;
  min-width: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.session-exercise-card-front {
  position: relative;
  transform: rotateY(0deg) translateZ(1px);
  visibility: visible;
  transition: visibility 0s linear 0s;
}

.session-exercise-notes-face {
  position: absolute;
  inset: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
  transform: rotateY(180deg) translateZ(1px);
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 220ms;
}

.session-exercise-card.is-notes-open .session-exercise-card-rotator {
  transform: rotateY(180deg);
}

.session-exercise-card.is-notes-open .session-exercise-card-front {
  visibility: hidden;
  pointer-events: none;
  transition-delay: 220ms;
}

.session-exercise-card.is-notes-open .session-exercise-notes-face {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.session-notes-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.session-notes-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.session-notes-head small {
  color: var(--red);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.session-notes-head strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.2;
}

.session-notes-head > div > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.session-notes-back {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b0e11;
  color: #fff;
}

.session-notes-back .control-icon {
  width: 18px;
  height: 18px;
}

.session-notes-back span {
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.session-note-list {
  min-height: 0;
  max-height: none;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.session-note-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.session-note-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(120, 143, 158, .24);
  border-radius: 8px;
  background: #0a0d10;
}

.session-note-entry-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.session-note-entry p {
  margin: 0;
  color: #f5f7f8;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.session-note-entry time {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.session-note-entry-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.session-note-entry-actions button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #0b0e11;
  color: #dfe8ec;
}

.session-note-entry-actions button.danger {
  border-color: rgba(225, 27, 34, .42);
  background: rgba(225, 27, 34, .08);
  color: #ff5360;
}

.session-note-entry-actions .control-icon {
  width: 16px;
  height: 16px;
}

.session-note-entry.is-editing {
  display: block;
  border-color: rgba(17, 199, 238, .42);
}

.session-note-entry form,
.session-note-composer,
.session-note-entry form label,
.session-note-composer label {
  display: grid;
  gap: 8px;
}

.session-note-entry form label > span,
.session-note-composer label > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.session-note-entry textarea,
.session-note-composer textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
}

.session-note-entry form > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.session-note-entry form button,
.session-note-composer > button {
  min-height: 38px;
}

.session-note-composer {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.session-note-composer > button {
  min-width: 104px;
}

.session-note-empty {
  min-height: 96px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 18px;
  border: 1px dashed rgba(120, 143, 158, .28);
  border-radius: 8px;
  text-align: center;
}

.session-note-empty strong {
  font-size: 13px;
}

.session-note-empty p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 430px) {
  .session-exercise-notes-face {
    gap: 7px;
  }

  .session-notes-head {
    gap: 9px;
  }

  .session-notes-back {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
  }

  .session-notes-back span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .session-note-list {
    max-height: none;
  }

  .session-note-entry {
    gap: 6px;
    padding: 7px 8px;
  }

  .session-note-entry-actions {
    flex-direction: column;
  }

  .session-note-composer > button {
    width: auto;
    min-width: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .session-exercise-card-rotator {
    transition-duration: 1ms;
  }
}

.session-exercise-condensed {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.session-exercise-condensed .session-exercise-copy {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.session-exercise-condensed strong {
  display: block;
  min-width: 0;
  margin: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.session-exercise-condensed small {
  display: block;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.session-exercise-condensed > .session-exercise-count,
.session-exercise-head > .session-exercise-count {
  justify-self: end;
  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-head > .session-exercise-count {
  position: absolute;
  top: 4px;
  right: 44px;
}

.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-set-action-visual {
  width: 80%;
  height: 80%;
  display: grid;
  place-items: center;
  border-radius: inherit;
  pointer-events: none;
}

.session-set-action-visual > svg {
  width: var(--control-icon-small, 16px);
  height: var(--control-icon-small, 16px);
}

.training-set-row .check-chip,
.training-set-row .check-chip.done,
.training-set-row .trash-session-set {
  border-color: transparent;
  background: transparent;
}

.training-set-row .check-chip .session-set-action-visual {
  width: 72%;
  height: 72%;
  border: 1px solid rgba(194, 207, 214, 0.34);
  background: transparent;
  color: #e5edf0;
}

.training-set-row .check-chip.done .session-set-action-visual {
  border-color: rgba(50, 216, 132, 0.72);
  background: rgba(50, 216, 132, 0.12);
  color: #78efad;
}

.training-set-row .check-chip:hover .session-set-action-visual,
.training-set-row .check-chip:focus-visible .session-set-action-visual {
  border-color: rgba(229, 237, 240, 0.72);
  background: rgba(255, 255, 255, 0.045);
}

.training-set-row .session-set-check-icon {
  width: 14px;
  height: 14px;
}
.training-set-row .trash-session-set .session-set-action-visual {
  border: 1px solid rgba(225, 27, 34, 0.48);
  background: rgba(225, 27, 34, 0.08);
}

.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(255, 255, 255, 0.34);
  border-radius: 999px;
  background: linear-gradient(145deg, #121212, #070707);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  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;
}

.session-exercise-head.expanded .session-exercise-thumb {
  position: relative;
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  justify-self: center;
}

.session-exercise-head.expanded .session-exercise-thumb::after {
  content: "";
  position: absolute;
  inset: -7px;
}

.session-exercise-head.expanded .session-exercise-thumb svg {
  width: 15px;
  height: 15px;
}

.exercise-eye-btn.has-media {
  border-color: rgba(255, 255, 255, 0.34);
  background: linear-gradient(145deg, #121212, #070707);
}

.exercise-eye-btn:active {
  transform: scale(1.04);
  border-color: var(--red);
}
.exercise-eye-btn:focus-visible { outline: 2px solid #57dcff; outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .exercise-eye-btn:hover { transform: scale(1.04); border-color: var(--red); }
}

.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: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: manipulation;
}

.exercise-preview-media::-webkit-scrollbar {
  display: none;
}

.exercise-preview-media img {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 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: minmax(92px, 1.35fr) minmax(66px, 1fr) minmax(40px, .65fr);
  }

  .training-exercise-meta span {
    padding-inline: 5px;
    font-size: 8.5px;
  }

  .training-step-header h1 {
    font-size: 22px;
  }

  .training-active-titlebar .training-step-header h1 {
    font-size: 15.4px;
  }

  .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;
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x;
}

.exercise-preview-media-steps img {
  width: auto;
  min-width: 240%;
  max-width: none;
  object-position: left center;
}

@media (min-width: 430px) {
  .exercise-preview-media-steps 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: center;
  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);
  overscroll-behavior: contain;
  touch-action: none;
  backdrop-filter: none;
}

.set-type-session-backdrop .modal-set-type-sheet {
  width: min(100%, 520px);
  max-height: min(76dvh, 560px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(225, 27, 34, 0.35);
  border-radius: 16px;
  background: #101010;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.64);
  touch-action: pan-y;
}

.training-set-row {
  border-left: 2px solid var(--set-color, #ef1b2d);
}

.training-set-row .type-chip {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border-color: color-mix(in srgb, var(--set-color, #ef1b2d) 70%, transparent);
  background: color-mix(in srgb, var(--set-color, #ef1b2d) 12%, #080808);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.training-set-row .type-chip > span {
  pointer-events: none;
}

.training-set-row .type-chip:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.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: auto;
}

.training-free-timer-wrap > .training-free-timer {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.training-free-timer > svg { width: 24px; height: 24px; }
.training-timer-floats {
  position: fixed;
  right: calc(14px + var(--safe-right, 0px));
  bottom: calc(var(--bottom-nav-total, 64px) + 16px);
  z-index: 72;
  width: min(280px, calc(100vw - 28px - var(--safe-left, 0px) - var(--safe-right, 0px)));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  max-height: calc(100dvh - var(--bottom-nav-total, 64px) - 90px);
  pointer-events: none;
}
.training-timer-floats > [data-session-rest-panel-slot]:empty { display: none; }
.training-timer-floats .training-free-timer-panel,
.training-timer-floats .session-rest-float {
  position: relative;
  inset: auto;
  width: 100%;
  box-sizing: border-box;
  pointer-events: auto;
  border-radius: 8px;
}
.training-timer-floats .training-free-timer-panel { overflow-y: auto; min-height: 0; }
.training-timer-floats > [data-session-rest-panel-slot] { flex-shrink: 0; }
.free-timer-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.free-timer-heading strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.free-timer-heading button { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 24px; box-shadow: none; }

.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;
}

/* Timed sets own a centered, blocking counter independent from the workout clock. */
.series-timer-backdrop {
  z-index: 310;
  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, .78);
  overscroll-behavior: contain;
}

.series-timer-sheet {
  width: min(100%, 420px);
  max-height: min(760px, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px));
  overflow-y: auto;
  padding: 16px;
  border-color: rgba(167, 139, 250, .5);
  touch-action: pan-y;
  scrollbar-width: thin;
}

.series-timer-sheet .modal-set-type-head > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.series-timer-sheet .modal-set-type-head small {
  color: #c4b5fd;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.series-timer-sheet .modal-set-type-head strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-timer-sheet > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.series-timer-readout {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 124px;
  padding: 16px;
  border: 1px solid rgba(167, 139, 250, .26);
  border-radius: 12px;
  background: #090b0f;
  font-variant-numeric: tabular-nums;
}

.series-timer-readout small,
.series-timer-readout span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.series-timer-readout strong {
  color: #fff;
  font-size: clamp(38px, 12vw, 56px);
  font-weight: 950;
  line-height: 1;
}

.series-timer-readout.is-running strong {
  color: #c4b5fd;
}

.series-timer-readout b {
  color: #fff;
}

.series-timer-modes,
.series-timer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.series-timer-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.series-timer-wheel {
  margin: 0;
}

.series-timer-wheel:disabled {
  opacity: .56;
}

.series-timer-wheel:disabled select {
  cursor: not-allowed;
}

@media (max-width: 359px) {
  .series-timer-sheet {
    padding: 12px;
  }

  .series-timer-readout {
    min-height: 104px;
  }

  .series-timer-actions button {
    min-width: 0;
    padding-inline: 2px;
  }
}

/* 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-period-filter {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
}
.history-period-filter-trigger {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
  color: #fff;
}
.history-period-filter-trigger > svg {
  width: 19px;
  height: 19px;
}
.history-period-filter-trigger > span {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border: 2px solid #080b0e;
  border-radius: 50%;
  background: var(--red, #e11b22);
}
.history-period-filter-trigger:hover,
.history-period-filter-trigger:focus-visible,
.history-period-filter-trigger[aria-expanded="true"] {
  border-color: rgba(239, 27, 45, .72);
  background: rgba(239, 27, 45, .1);
  outline: none;
}
.history-period-filter-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  background: #0d1015;
  padding: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .42);
}
.history-period-filter-panel > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: start;
  gap: 10px;
}
.history-period-filter-panel > header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.history-period-filter-panel > header strong {
  color: #fff;
  font-size: 13px;
}
.history-period-filter-panel > header small {
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
  line-height: 1.35;
}
.history-period-filter-panel > header button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, .72);
  font-size: 18px;
}
.history-period-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.history-period-options > button {
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 7px;
  background: rgba(255, 255, 255, .025);
  color: #fff;
  padding: 7px 8px;
  text-align: left;
}
.history-period-options > button > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.history-period-options > button strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-period-options > button small {
  color: rgba(255, 255, 255, .5);
  font-size: 9px;
  line-height: 1.2;
}
.history-period-options > button:hover,
.history-period-options > button:focus-visible {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .06);
  outline: none;
}
.history-period-options > button[aria-pressed="true"] {
  border-color: rgba(239, 27, 45, .55);
  background: rgba(239, 27, 45, .1);
}
.history-range-fields {
  display: flex;
  gap: 10px;
}
.history-period-filter-panel .history-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.history-period-filter-panel .history-period-apply {
  grid-column: 1 / -1;
  min-height: 42px;
}
.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;
}
@media (max-width: 360px) {
  .history-period-filter-panel {
    width: min(292px, calc(100vw - 24px));
    padding: 10px;
  }
  .history-period-options {
    grid-template-columns: 1fr;
  }
  .history-period-options > button {
    min-height: 46px;
  }
}
.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 {
  --history-line: #4bd4ff;
  --history-bar: #a91827;
  --history-plot-surface: #080c0f;
  padding: 10px 12px 9px;
  border: 1px solid rgba(122, 151, 166, .16);
  border-radius: 8px;
  background: var(--history-plot-surface);
  overflow: hidden;
}
.history-chart-plot {
  position: relative;
  min-width: 0;
}
.history-chart svg {
  width: 100%;
  height: clamp(128px, 18vw, 168px);
  display: block;
  overflow: visible;
}
.history-grid-line {
  stroke: rgba(151, 177, 189, .12);
  stroke-width: 1;
  stroke-dasharray: 2 7;
  vector-effect: non-scaling-stroke;
}
.history-grid-line--baseline {
  stroke: rgba(151, 177, 189, .24);
  stroke-dasharray: none;
}
.history-bar-track {
  fill: rgba(206, 225, 233, .025);
  stroke: rgba(206, 225, 233, .055);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.history-bar {
  fill: var(--history-bar);
  opacity: .94;
  filter: drop-shadow(0 5px 7px rgba(105, 8, 19, .25));
  transition: opacity 180ms ease, fill 180ms ease, filter 180ms ease;
}
.history-bar-sheen {
  fill: rgba(255, 127, 139, .2);
  pointer-events: none;
}
.history-bar-cap {
  fill: #ff3d4c;
  opacity: .95;
}
.history-bar-group:is(:hover, :focus-visible) .history-bar {
  fill: #c82332;
  opacity: 1;
  filter: drop-shadow(0 7px 9px rgba(149, 13, 29, .34));
}
.history-bar-group:focus-visible {
  outline: none;
}
.history-bar-group:focus-visible .history-bar-track {
  stroke: rgba(75, 212, 255, .62);
  stroke-width: 2;
}
.history-trend-shadow,
.history-trend {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.history-trend-shadow {
  stroke: rgba(0, 9, 13, .82);
  stroke-width: 6.5;
}
.history-trend {
  stroke: var(--history-line);
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 3px rgba(20, 145, 184, .24));
}
.history-trend-halo {
  fill: rgba(75, 212, 255, .16);
}
.history-trend-point {
  fill: var(--history-line);
  stroke: var(--history-plot-surface);
  stroke-width: 1.75;
  vector-effect: non-scaling-stroke;
}
.history-chart-y {
  position: absolute;
  left: 4px;
  z-index: 1;
  padding: 1px 4px;
  background: rgba(9, 13, 16, .82);
  color: rgba(213, 229, 236, .7);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  pointer-events: none;
}
.history-chart-y--max { top: 4px; }
.history-chart-y--zero { bottom: 5px; }
.history-chart-axis {
  position: relative;
  height: 18px;
  margin: 1px 6px 0;
}
.history-chart-axis span {
  position: absolute;
  left: var(--history-axis-position);
  transform: translateX(-50%);
  color: rgba(191, 211, 220, .62);
  font-size: 9px;
  font-weight: 800;
  line-height: 18px;
  text-transform: uppercase;
  white-space: nowrap;
}
.history-chart-axis span:first-child {
  transform: none;
}
.history-chart-axis span:last-child:not(:first-child) {
  transform: translateX(-100%);
}
.history-chart-summary,
.history-chart-key,
.history-chart-key span {
  display: flex;
  align-items: center;
}
.history-chart-summary {
  justify-content: space-between;
  gap: 12px;
  padding-top: 7px;
  border-top: 1px solid rgba(122, 151, 166, .13);
}
.history-chart-key {
  gap: 12px;
}
.history-chart-key span {
  gap: 5px;
  color: rgba(213, 229, 236, .68);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.history-chart-key i {
  display: inline-block;
  flex: 0 0 auto;
}
.history-key-bar {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--history-bar);
}
.history-key-line {
  width: 13px;
  height: 2px;
  border-radius: 2px;
  background: var(--history-line);
}
.history-chart-summary strong {
  color: #e9f4f8;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}
.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;
}
@media (max-width: 430px) {
  .history-chart {
    padding-inline: 8px;
  }
  .history-chart svg {
    height: 132px;
  }
  .history-chart-summary {
    gap: 8px;
  }
  .history-chart-key {
    gap: 8px;
  }
}
.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-ranking-open {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(77, 216, 255, .34);
  border-radius: 8px;
  background: rgba(77, 216, 255, .08);
  color: #a9edff;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}
.history-ranking-summary {
  display: block;
  margin: -1px 0 4px;
  font-size: 11px;
}
.workout-history-ranking-panel {
  width: min(520px, calc(100vw - 24px));
  max-height: min(720px, calc(100dvh - 36px));
  display: flex;
  flex-direction: column;
}
.history-ranking-filter {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.history-ranking-filter > span {
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.history-ranking-filter-trigger {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  color: #fff;
  padding: 7px 12px;
  text-align: left;
}
.history-ranking-filter-trigger > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.history-ranking-filter-trigger small {
  color: rgba(255, 255, 255, .5);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.history-ranking-filter-trigger strong {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-ranking-filter-trigger > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  transition: transform 160ms ease;
}
.history-ranking-filter-trigger[aria-expanded="true"] {
  border-color: rgba(239, 27, 45, .72);
  background: rgba(239, 27, 45, .08);
}
.history-ranking-filter-trigger[aria-expanded="true"] > svg {
  transform: rotate(180deg);
}
.history-ranking-filter-menu {
  max-height: min(248px, 36dvh);
  display: grid;
  gap: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #0a0f13;
  scrollbar-width: thin;
}
.history-ranking-filter-menu button {
  min-height: 44px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, .72);
  text-align: left;
}
.history-ranking-filter-menu button:hover,
.history-ranking-filter-menu button:focus-visible {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}
.history-ranking-filter-menu button[aria-checked="true"] {
  background: rgba(239, 27, 45, .14);
  color: #fff;
}
.history-ranking-option-check {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  color: transparent;
}
.history-ranking-option-check svg {
  width: 13px;
  height: 13px;
}
.history-ranking-filter-menu button[aria-checked="true"] .history-ranking-option-check {
  border-color: #ef1b2d;
  background: #ef1b2d;
  color: #fff;
}
.history-ranking-filter-menu strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-ranking-filter-menu small {
  color: rgba(255, 255, 255, .48);
  font-size: 10px;
  white-space: nowrap;
}
.history-ranking-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 2px 8px;
}
.history-ranking-group {
  padding: 12px 0 2px;
}
.history-ranking-group + .history-ranking-group {
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.history-ranking-group header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 4px;
}
.history-ranking-group header strong { color: #fff; font-size: 13px; }
.history-ranking-group header small { color: rgba(255, 255, 255, .5); font-size: 11px; }
.history-ranking-row { min-height: 48px; }
.history-ranking-empty { margin: 18px 0; text-align: center; font-size: 12px; }
@media (max-width: 420px) {
  .workout-history-ranking-panel { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .history-ranking-open { min-height: 32px; }
}
.workout-history-progression-panel {
  width: min(600px, calc(100vw - 24px));
  max-height: min(720px, calc(100dvh - 36px));
}
.history-progression-modal-filters {
  margin-top: 12px;
}
.history-progression-modal-filters .history-progress-picker-options > button {
  min-height: 48px;
}
.history-progression-modal-filters .history-progress-picker-options > button strong {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  font-size: 13px;
}
@media (max-width: 480px) {
  .history-progress-filters.history-progression-modal-filters {
    grid-template-columns: minmax(0, 1fr);
  }
}
.history-progression-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, auto);
  gap: 10px;
  align-items: end;
  padding: 12px 0;
}
.history-progression-summary div { min-width: 0; }
.history-progression-summary small,
.history-progression-summary strong { display: block; }
.history-progression-summary small { color: rgba(255, 255, 255, .52); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.history-progression-summary strong { color: #fff; font-size: 14px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-line-chart { margin: 2px 0 8px; padding: 10px 0 2px; border-top: 1px solid rgba(255, 255, 255, .08); }
.history-line-chart svg { display: block; width: 100%; height: 210px; overflow: visible; }
.history-line-grid { stroke: rgba(255, 255, 255, .14); stroke-width: 1; }
.history-line-path { fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(240, 31, 57, .35)); }
.history-line-point { fill: #101419; stroke: #ff4155; stroke-width: 2; }
@media (max-width: 420px) {
  .workout-history-progression-panel { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .history-progression-summary { gap: 7px; }
  .history-progression-summary strong { font-size: 12px; }
  .history-line-chart svg { height: 176px; }
}
.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-progress-filters {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  align-items: start;
  gap: 8px;
  margin-bottom: 10px;
}
.history-volume-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 156px) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.history-volume-card-head > strong {
  min-width: 0;
}
.history-progress-filter--compact {
  position: relative;
  display: block;
}
.history-progress-filter--compact .history-progress-picker-trigger {
  min-height: 36px;
  padding: 6px 9px;
}
.history-progress-filter--compact .history-progress-picker-trigger strong {
  font-size: 11px;
}
.history-progress-filter--compact .history-progress-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  width: min(260px, calc(100vw - 64px));
  box-shadow: 0 14px 30px rgba(0, 0, 0, .4);
}
.history-progress-filter,
.history-progress-filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.history-progress-filter > span,
.history-progress-filters label > span {
  color: rgba(255, 255, 255, .58);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.history-progress-picker-trigger {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  color: #fff;
  padding: 9px 11px;
  text-align: left;
}
.history-progress-picker-trigger strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-progress-picker-trigger > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  transition: transform 160ms ease;
}
.history-progress-picker-trigger[aria-expanded="true"] {
  border-color: rgba(239, 27, 45, .72);
  background: rgba(239, 27, 45, .08);
}
.history-progress-picker-trigger:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.history-progress-picker-trigger[aria-expanded="true"] > svg {
  transform: rotate(180deg);
}
.history-progress-picker-menu {
  max-height: min(240px, 34dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #0a0d11;
  padding: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 27, 45, .55) transparent;
}
.history-progress-picker-search {
  position: static;
  flex: 0 0 auto;
  min-height: 42px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  background: #11151b;
  padding: 0 10px;
}
.history-progress-picker-search > svg {
  width: 17px;
  height: 17px;
  color: rgba(255, 255, 255, .55);
}
.history-progress-picker-search > input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.history-progress-picker-search > input::placeholder {
  color: rgba(255, 255, 255, .46);
}
.history-progress-picker-options {
  display: grid;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--red) transparent;
  align-content: start;
  gap: 3px;
}
.history-progress-picker-options > button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  padding: 7px 8px;
  text-align: left;
}
.history-progress-picker-options > button > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.history-progress-picker-options > button strong,
.history-progress-picker-options > button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-progress-picker-options > button strong {
  font-size: 12px;
}
.history-progress-picker-options > button small {
  color: rgba(255, 255, 255, .54);
  font-size: 10px;
}
.history-progress-picker-options > button:hover,
.history-progress-picker-options > button:focus-visible {
  background: rgba(255, 255, 255, .07);
  outline: none;
}
.history-progress-picker-options > button[aria-checked="true"] {
  background: rgba(239, 27, 45, .1);
}
.history-progress-picker-options > button[aria-checked="true"] .history-ranking-option-check {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}
.history-progress-picker-options > button:focus-visible {
  outline: 2px solid var(--cyan, #7ee8ff);
  outline-offset: -2px;
}
.history-progress-picker-options > button[hidden] {
  display: none;
}
.history-progress-picker-empty {
  margin: 4px 2px 1px;
  padding: 14px 8px;
  color: rgba(255, 255, 255, .58);
  font-size: 11px;
  text-align: center;
}
.history-progress-filters .history-exercise-select {
  min-width: 0;
  min-height: 42px;
  margin-bottom: 0;
}
@media (max-width: 380px) {
  .history-volume-card-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .history-volume-card-head > .history-progress-filter--compact {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .history-progress-filter--compact .history-progress-picker-menu {
    right: auto;
    left: 0;
    width: 100%;
  }
  .history-progress-filters {
    grid-template-columns: 1fr;
  }
}
.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-add-set-button.compact {
  width: 100%;
  margin-top: 8px;
  min-height: 38px;
}
@media (max-width: 420px) {
  .session-block-panel { flex-basis: 96%; padding: 10px; }
}

/* ===== 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-avatar > img { width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: inherit; display: block; }
.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 { position: relative; flex: 0 0 40px; width: 40px; height: 40px; box-sizing: border-box; border-radius: 4px; display: grid; place-items: center; color: #ff6269; background: rgba(225,27,34,.09); border: 1px solid rgba(225,27,34,.45); }
.quest-card-icon::after { content: ''; position: absolute; right: 3px; bottom: 3px; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; }
.quest-card-icon svg, .quest-card-icon img { width: 24px; height: 24px; object-fit: contain; }
.quest-card-icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quest-card.done .quest-card-icon { color: #59db9d; border-color: #37855f; background: rgba(46,204,113,.08); }
html[data-theme="light"] .quest-card-icon { color: #ba1826; }
html[data-theme="light"] .quest-card.done .quest-card-icon { color: #186b43; }
.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) minmax(58px,auto) minmax(44px,auto) minmax(62px,auto); 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: 11px; font-weight: 950; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.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-icon img { display: block; width: 44px; height: 44px; object-fit: contain; }
.gamification-celebration { position: fixed; z-index: 120; left: 50%; top: max(82px, env(safe-area-inset-top)); width: min(340px, calc(100vw - 32px)); transform: translateX(-50%); display: grid; gap: 4px; padding: 16px 18px; overflow: hidden; border: 1px solid rgba(255,72,94,.58); border-radius: 8px; background: #11161a; color: #fff; box-shadow: 0 16px 38px rgba(0,0,0,.46); animation: gamification-reveal .5s cubic-bezier(.16,1,.3,1) both; }
.gamification-celebration::before { content: ''; position: absolute; inset: 0 auto 0 -35%; width: 28%; transform: skewX(-18deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent); animation: gamification-scan .8s .12s cubic-bezier(.16,1,.3,1) both; pointer-events: none; }
.gamification-celebration > span { color: #ff435c; font-size: 9px; font-weight: 900; }
.gamification-celebration > strong { font-size: 17px; line-height: 1.15; }
.gamification-celebration > small { color: #aab7bd; font-size: 11px; }
.gamification-celebration.is-season,
.gamification-celebration.is-season-level { border-color: rgba(76,201,240,.62); }
.gamification-celebration.is-season > span,
.gamification-celebration.is-season-level > span { color: #4cc9f0; }
.gamification-celebration.is-leaving { animation: gamification-dismiss .38s ease-in both; }
@keyframes gamification-reveal { from { opacity: 0; transform: translate(-50%, -18px) scale(.96); filter: blur(6px); } to { opacity: 1; transform: translate(-50%, 0) scale(1); filter: blur(0); } }
@keyframes gamification-scan { from { left: -35%; } to { left: 120%; } }
@keyframes gamification-dismiss { to { opacity: 0; transform: translate(-50%, -10px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .gamification-celebration, .gamification-celebration::before, .gamification-celebration.is-leaving { animation: none; } }
.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-next { display: block; min-height: 22px; margin-top: 4px; color: rgba(255,255,255,.72); font-size: 9px; line-height: 1.2; }
.rpg-tier-history { display: flex; justify-content: center; gap: 4px; margin-top: 7px; overflow-x: auto; scrollbar-width: none; }
.rpg-tier-history span { display: grid; place-items: center; flex: 0 0 18px; height: 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; color: rgba(255,255,255,.42); font-size: 8px; font-weight: 900; }
.rpg-tier-history span.obtained { border-color: var(--tier); background: color-mix(in srgb, var(--tier) 22%, transparent); color: #fff; }
.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[data-profile-tab] { display: block; width: 100%; cursor: pointer; color: inherit; font-family: inherit; }
.profile-sticker[data-profile-tab]:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.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-directory-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.club-directory-head > .rpg-subpage-head {
  min-width: 0;
}

.club-create-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(225,27,34,.55);
  border-radius: 8px;
  background: rgba(225,27,34,.12);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.club-create-button span {
  color: var(--red, #e11b22);
  font-size: 22px;
  line-height: 1;
}

.club-directory-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  gap: 8px;
}

.club-directory-controls input,
.club-directory-controls select,
.club-form input,
.club-form select,
.club-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(132,190,212,.24);
  border-radius: 7px;
  background: #090d11;
  color: #fff;
  padding: 10px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.club-directory-controls input:focus,
.club-directory-controls select:focus,
.club-form :is(input, select, textarea):focus {
  outline: 2px solid rgba(225,27,34,.42);
  outline-offset: 1px;
  border-color: var(--red, #e11b22);
}

.club-search {
  position: relative;
}

.club-search input {
  padding-right: 46px;
}

.club-search button {
  position: absolute;
  inset: 0 0 0 auto;
  width: 42px;
  border: 0;
  border-left: 1px solid rgba(132,190,212,.18);
  background: transparent;
  color: #fff;
  font-size: 20px;
}

.club-directory-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.club-directory-tabs::-webkit-scrollbar {
  display: none;
}

.club-directory-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(132,190,212,.2);
  border-radius: 7px;
  background: rgba(255,255,255,.025);
  color: rgba(255,255,255,.66);
  font-size: 11px;
  font-weight: 900;
}

.club-directory-tabs button.active {
  border-color: var(--red, #e11b22);
  background: rgba(225,27,34,.12);
  color: #fff;
}

.club-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}

.club-directory-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(132,190,212,.18);
  border-radius: 8px;
  background: #0d1116;
}

.club-directory-card.is-member {
  border-color: rgba(225,27,34,.38);
}

.club-directory-card-cover {
  min-height: 72px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(225,27,34,.18), rgba(11,21,28,.9) 58%, rgba(132,190,212,.08));
  border-bottom: 1px solid rgba(132,190,212,.12);
}

.club-directory-card-cover span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225,27,34,.65);
  border-radius: 7px;
  background: #0a0c10;
  color: #fff;
  font-size: 21px;
  font-weight: 950;
}

.club-directory-card-cover em {
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.72);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.club-directory-card-body {
  display: grid;
  gap: 11px;
  padding: 13px;
}

.club-directory-card h3 {
  margin: 3px 0 4px;
  color: #fff;
  font-size: 15px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.club-directory-card p {
  min-height: 32px;
  margin: 0;
  color: rgba(255,255,255,.55);
  font-size: 11px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.club-directory-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid rgba(132,190,212,.12);
  color: rgba(255,255,255,.52);
  font-size: 10px;
  font-weight: 850;
}

.club-directory-card-body > button,
.club-directory-more {
  width: 100%;
  min-height: 38px;
}

.club-directory-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  align-items: center;
}

.club-directory-actions button {
  min-height: 42px;
  margin: 0;
}

.club-invite-result,
.club-invite-preview {
  display: grid;
  gap: 14px;
}

.club-invite-result label {
  display: grid;
  gap: 6px;
}

.club-invite-result input {
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}

.club-invite-error {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(244, 24, 66, .48);
  color: #ff9aae;
  background: rgba(244, 24, 66, .08);
}

.club-directory-card-body > button:disabled {
  opacity: .58;
  cursor: default;
}

.club-directory-loading {
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 850;
}

.club-directory-loading i {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255,255,255,.1);
  border-top-color: var(--red, #e11b22);
  border-radius: 50%;
  animation: club-directory-spin .8s linear infinite;
}

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

.club-directory-empty {
  min-height: 180px;
}

.club-modal-backdrop {
  z-index: 760;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  backdrop-filter: blur(8px);
}

.club-modal {
  width: min(100%, 560px);
  max-height: min(820px, calc(100dvh - 24px));
  overflow-y: auto;
  padding: 18px;
}

.club-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(132,190,212,.16);
}

.club-modal-head h2 {
  margin: 3px 0 0;
  font-size: 20px;
}

.club-modal-head .icon-btn {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  font-size: 21px;
}

.club-form {
  display: grid;
  gap: 13px;
  padding-top: 15px;
}

.club-form label {
  display: grid;
  gap: 6px;
}

.club-form label > span {
  color: rgba(255,255,255,.68);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.club-form textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.45;
}

.club-form-grid,
.club-modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.club-form-note {
  margin: 0;
  color: rgba(255,255,255,.48);
  font-size: 10px;
  line-height: 1.45;
}

.club-form > button,
.club-modal-actions button {
  min-height: 42px;
}

.club-create-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: min(720px, calc(100dvh - 24px));
  overflow: hidden;
  padding: 0;
  background: #0d1115;
}

.club-create-modal .club-modal-head {
  padding: 17px 18px 14px;
}

.club-create-modal .club-modal-head h2 {
  margin: 0;
}

.club-create-modal .club-modal-head p {
  margin: 4px 0 0;
  color: #8b9aa4;
  font-size: 10px;
  line-height: 1.4;
}

.club-create-modal .club-modal-head .club-ui-icon {
  width: 18px;
  height: 18px;
}

.club-create-modal .club-form {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
}

.club-create-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 12px 18px 11px;
  list-style: none;
  border-bottom: 1px solid rgba(132,190,212,.12);
}

.club-create-progress li {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #687680;
  font-size: 9px;
}

.club-create-progress li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 7px;
  left: calc(100% - 12px);
  height: 1px;
  background: #2a343b;
}

.club-create-progress span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #344049;
  border-radius: 50%;
  color: #99a7b0;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.club-create-progress b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.club-create-progress .is-active { color: #fff; }
.club-create-progress .is-active span { border-color: #f41842; background: #42101a; color: #fff; }
.club-create-progress .is-complete { color: #9dcbd8; }
.club-create-progress .is-complete span { border-color: #4e8796; background: #10242a; color: #b9e6ef; }

.club-create-step:not([hidden]) {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  padding: 18px;
  scrollbar-width: thin;
  scrollbar-color: #41505a transparent;
}

.club-create-step-head h3 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.25;
}

.club-create-step-head h3:focus { outline: none; }
.club-create-step-head p { margin: 4px 0 0; color: #8b9aa4; font-size: 10px; line-height: 1.45; }

.club-create-media-preview {
  position: relative;
  min-height: 190px;
  padding-bottom: 28px;
}

.club-create-cover-preview {
  position: relative;
  height: 174px;
  overflow: hidden;
  border: 1px solid #34414a;
  border-radius: 8px;
  background: #12181d;
}

.club-create-cover-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,10,12,.04), rgba(7,10,12,.72));
  pointer-events: none;
}

.club-create-cover-preview img,
.club-create-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.club-create-cover-preview > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  color: #73838d;
}

.club-create-cover-preview > span .club-ui-icon { width: 28px; height: 28px; }
.club-create-cover-preview > span b { font-size: 10px; }

.club-create-avatar-preview {
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 16px;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 3px solid #0d1115;
  border-radius: 8px;
  background: #161e24;
  box-shadow: 0 8px 20px rgba(0,0,0,.32);
}

.club-create-avatar-preview > span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #f41842;
}

.club-create-avatar-preview .club-ui-icon { width: 27px; height: 27px; }

.club-create-media-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.club-media-picker {
  min-width: 0;
  cursor: pointer;
}

.club-media-picker > span {
  min-height: 62px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-content: center;
  gap: 2px 8px;
  padding: 9px;
  border: 1px solid #34414a;
  border-radius: 8px;
  background: #11171c;
  color: #dce5ea;
  text-transform: none;
}

.club-media-picker .club-ui-icon { grid-row: 1 / 3; align-self: center; width: 20px; height: 20px; color: #f64d66; }
.club-media-picker b { min-width: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.club-media-picker small { min-width: 0; overflow: hidden; color: #7f8d97; font-size: 8px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.club-media-picker:focus-within > span { outline: 2px solid #7fbdcf; outline-offset: 2px; border-color: #7fbdcf; }

.club-media-clear-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.club-media-clear-actions button {
  min-height: 32px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: #ff7286;
  font-size: 9px;
}

.club-create-summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid rgba(132,190,212,.16);
  border-bottom: 1px solid rgba(132,190,212,.16);
}

.club-create-summary > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #10242a; color: #79d6df; }
.club-create-summary .club-ui-icon { width: 18px; height: 18px; }
.club-create-summary strong,.club-create-summary small { display: block; }
.club-create-summary strong { color: #fff; font-size: 12px; }
.club-create-summary small { margin-top: 3px; color: #8b9aa4; font-size: 9px; line-height: 1.35; }

.club-create-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(132,190,212,.14);
  background: #0d1115;
}

.club-create-actions button { min-height: 44px; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.club-create-actions button[hidden] { display: none; }
.club-create-actions .club-ui-icon { width: 16px; height: 16px; }

@media (max-width: 430px) {
  .club-modal-backdrop:has(.club-create-modal) { align-items: end; padding: 0; }
  .club-create-modal { width: 100%; height: min(700px, calc(100dvh - 8px)); max-height: calc(100dvh - 8px); border-radius: 8px 8px 0 0; }
  .club-create-modal .club-modal-head { padding: 14px 15px 12px; }
  .club-create-progress { padding-inline: 15px; }
  .club-create-step:not([hidden]) { padding: 16px 15px; }
  .club-create-actions { padding-inline: 15px; }
  .club-create-progress li { grid-template-columns: 20px minmax(0, 1fr); gap: 5px; }
  .club-create-progress span { width: 20px; height: 20px; }
}

.club-professional-modal h3 {
  margin: 0;
  font-size: 13px;
}

.club-professional-list {
  display: grid;
  gap: 8px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(132,190,212,.16);
}

.club-professional-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid rgba(132,190,212,.12);
}

.club-professional-list strong,
.club-professional-list small {
  display: block;
}

.club-professional-list small {
  margin-top: 3px;
  color: rgba(255,255,255,.5);
}

.club-professional-list .danger {
  min-height: 36px;
  padding-inline: 11px;
}

.club-professional-permissions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.club-professional-permissions span {
  padding: 3px 6px;
  border: 1px solid rgba(80,196,231,.35);
  border-radius: 999px;
  color: #91e8ff;
  font-size: 9px;
  font-weight: 800;
}

.club-professional-permission-grid {
  display: grid;
  gap: 7px;
}

.club-professional-permission-grid label {
  grid-template-columns: 20px minmax(0,1fr);
  align-items: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(132,190,212,.16);
  border-radius: 6px;
  background: rgba(8,14,18,.55);
}

.club-professional-permission-grid input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--red, #e11b22);
}

.club-professional-permission-grid strong,
.club-professional-permission-grid small {
  display: block;
}

.club-professional-permission-grid small {
  margin-top: 2px;
  color: rgba(255,255,255,.48);
  line-height: 1.35;
}

@media (max-width: 420px) {
  .club-professional-list article {
    align-items: stretch;
    flex-direction: column;
  }

  .club-professional-list .danger {
    width: 100%;
  }
}

.club-feed-workspace {
  width: min(100%, 920px);
  margin-inline: auto;
}

.club-feed-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.club-feed-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.club-feed-head-actions .icon-btn,
.club-feed-head-actions .club-create-button {
  min-height: 42px;
  margin: 0;
}

.club-feed-head-actions .icon-btn {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.club-hub-tools .icon-btn { background: transparent; border: 0; border-radius: 4px; box-shadow: none; color: var(--text); }
.club-hub-tools .icon-btn > :is(svg,img) { width: 21px; height: 21px; object-fit: contain; }
.club-hub-tools .profile-ratlab-icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.club-hub-tools .icon-btn[aria-pressed="true"] { color: var(--red); background: rgba(225,27,34,.08); }
.club-hub-tools .icon-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.club-information { min-width: 0; }
[data-club-public-admission][hidden] { display: none !important; }
.club-information-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 0 20px; border-bottom: 1px solid var(--border); }
.club-information-head h2 { font-size: 18px; margin: 12px 0 0; }
.club-information-head .club-text-action { display: inline-flex; align-items: center; gap: 4px; }
.club-information-commands { display: flex; flex-wrap: wrap; gap: 8px; }
.club-information-details { padding: 24px 0; border-bottom: 1px solid var(--border); }
.club-information-details > div { display: flex; align-items: center; gap: 12px; }
.club-information-details > div > :first-child { width: 56px; height: 56px; flex: 0 0 56px; object-fit: cover; }
.club-information-details dl { display: flex; flex-wrap: wrap; gap: 24px; margin: 24px 0; }
.club-information-details dt { color: var(--muted); font-size: 12px; }
.club-information-details dd { margin: 4px 0 0; }
.club-information-details h3 { font-size: 14px; margin: 20px 0 8px; }
.club-information-details p { white-space: pre-wrap; overflow-wrap: anywhere; }
.club-information-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.club-information-form label { display: grid; gap: 8px; min-width: 0; font-size: 13px; }
.club-information-form .wide { grid-column: 1/-1; }
.club-information-form :is(input,textarea,select) { width: 100%; min-width: 0; box-sizing: border-box; }
@media(max-width:600px) {
  .club-feed-workspace .club-feed-head { grid-template-columns: minmax(0,1fr); }
  .club-hub-tools { justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
  .club-information-head { align-items: flex-start; flex-direction: column; }
  .club-information-form { grid-template-columns: minmax(0,1fr); }
}

.club-feed-live {
  display: none;
  width: min(100%, 680px);
  min-height: 38px;
  margin-inline: auto;
  border: 1px solid rgba(87,220,255,.34);
  background: rgba(87,220,255,.08);
  color: #8ee7ff;
  font-size: 11px;
  font-weight: 900;
}

.club-feed-live.is-visible {
  display: block;
}

.club-feed-list {
  width: min(100%, 680px);
  display: grid;
  gap: 14px;
  margin-inline: auto;
}

.club-feed-post {
  min-width: 0;
  position: relative;
  border: 1px solid transparent;
}

.club-feed-post.is-pinned {
  border-color: rgba(87,220,255,.34);
}

.club-feed-post .social-post {
  margin: 0;
  border-radius: 0;
}

.club-feed-pinned-label {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(87,220,255,.2);
  background: #0b151b;
  color: #8ee7ff;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.club-feed-post-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--line);
  background: #0a0f13;
}

.club-feed-post-tools button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: rgba(7,10,13,.94);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.club-feed-post-tools button.active {
  border-color: rgba(87,220,255,.42);
  color: #8ee7ff;
}

.club-feed-post-tools button.danger {
  border-color: rgba(244,24,66,.38);
  color: #ff839a;
}

.club-feed-preferences form,
.club-feed-moderation form {
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.club-feed-preference-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #0b1015;
}

.club-feed-preference-row strong,
.club-feed-preference-row small {
  display: block;
}

.club-feed-preference-row strong {
  color: #fff;
  font-size: 12px;
}

.club-feed-preference-row small,
.club-feed-moderation p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.club-feed-preference-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--red, #e11b22);
}

.club-join-modal {
  width: min(100%, 430px);
}

.club-challenge-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.club-challenge-tabs,
.club-ranking-periods {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.club-challenge-tabs::-webkit-scrollbar,
.club-ranking-periods::-webkit-scrollbar { display: none; }

.club-challenge-tabs button,
.club-ranking-periods button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #0d1217;
  font-weight: 800;
}

.club-challenge-tabs button.active,
.club-ranking-periods button.active {
  border-color: var(--red, #e11b22);
  color: #fff;
  background: rgba(225,27,34,.13);
}

.club-challenge-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 12px;
}

.club-challenge-card {
  min-width: 0;
  display: grid;
  gap: 11px;
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 3px solid #66717c;
  border-radius: 8px;
  background: #0d1217;
}

.club-challenge-card.status-active { border-left-color: #28c983; }
.club-challenge-card.status-scheduled { border-left-color: #d6a737; }
.club-challenge-card.status-draft { border-left-color: #87919d; }

.club-challenge-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.club-challenge-card h3 {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 16px;
  line-height: 1.15;
}

.club-challenge-card > header > strong {
  white-space: nowrap;
  color: #63d9ff;
  font-size: 13px;
}

.club-challenge-status {
  color: #ff6370;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.club-challenge-card > p {
  min-height: 34px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.club-challenge-facts {
  display: grid;
  gap: 4px;
  color: rgba(255,255,255,.58);
  font-size: 10px;
}

.club-challenge-progress {
  position: relative;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  background: #080d11;
}

.club-challenge-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--challenge-progress, 0%);
  background: rgba(40,201,131,.18);
}

.club-challenge-progress span { position: relative; font-size: 10px; font-weight: 800; }

.club-challenge-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 7px;
}

.club-challenge-actions button { min-height: 38px; margin: 0; }
.club-challenge-empty { min-height: 180px; }

.club-ranking-panel { display: grid; gap: 12px; }
.club-ranking-challenge-select { display: grid; gap: 6px; }
.club-ranking-challenge-select span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.club-ranking-challenge-select select { width: 100%; min-height: 42px; }

.club-challenge-ranking-list article {
  display: grid;
  grid-template-columns: 36px 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  background: rgba(255,255,255,.035);
}
.club-challenge-ranking-list article.is-me { border-color: rgba(99,217,255,.55); background: rgba(99,217,255,.06); }
.club-ranking-position { color: #ff6370; font-weight: 900; text-align: center; }
.club-ranking-avatar { width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: #161c22; font-weight: 900; }
.club-ranking-avatar img { width: 100%; height: 100%; object-fit: cover; }
.club-challenge-ranking-list { display: grid; gap: 7px; }
.club-challenge-ranking-list article div { min-width: 0; }
.club-challenge-ranking-list article strong,
.club-challenge-ranking-list article small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.club-challenge-ranking-list article small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.club-challenge-ranking-list article > b { white-space: nowrap; color: #fff; font-size: 12px; }

.club-validation-list { display: grid; gap: 8px; }
.club-validation-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0d1217;
}
.club-validation-list article div { min-width: 0; }
.club-validation-list article span { display: block; color: var(--muted); font-size: 10px; }
.club-validation-list article p { margin: 0; color: #63d9ff; font-size: 11px; }
.club-validation-list article button { min-height: 36px; margin: 0; }

.club-preview-people { padding: 16px 0 20px; border-bottom: 1px solid var(--border); }
.club-preview-member-count { display: flex; align-items: center; gap: 8px; }
.club-preview-member-count svg { width: 20px; height: 20px; }
.club-preview-people h2 { font-size: 14px; margin: 20px 0 10px; }
.club-preview-managers { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.club-preview-managers button { display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; padding: 4px 0; min-height: 44px; max-width: 100%; color: var(--text); box-shadow: none; }
.club-preview-managers button > :is(img,.club-manager-initial) { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; object-fit: cover; }
.club-manager-initial { display: grid; place-items: center; background: var(--border); }
.club-preview-managers button > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.club-preview-managers small { display: block; color: var(--muted); margin-top: 4px; }
.club-preview-managers button:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.club-challenge-modal { width: min(100%, 640px); }
.diet-floating[data-club-challenge-create-backdrop] { position: fixed; inset: 0; padding: 0; display: block; backdrop-filter: none; }
[data-club-challenge-create-backdrop] > .club-challenge-modal { width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--bg); display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; }
[data-club-challenge-create-backdrop] .club-modal-head { width: 100%; max-width: 960px; margin: 0 auto; padding: max(20px,env(safe-area-inset-top)) 24px 20px; box-sizing: border-box; }
[data-club-challenge-create-backdrop] .club-form { width: 100%; max-width: 960px; margin: 0 auto; padding: 24px 24px max(32px,env(safe-area-inset-bottom)); box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; align-content: start; }
[data-club-challenge-create-backdrop] .club-form :is(input,select,textarea) { min-width: 0; max-width: 100%; box-sizing: border-box; }
@media (max-width: 600px) {
  [data-club-challenge-create-backdrop] .club-modal-head { padding-inline: max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right)); }
  [data-club-challenge-create-backdrop] .club-form { padding-inline: max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right)); }
  [data-club-challenge-create-backdrop] .club-form-grid { grid-template-columns: minmax(0,1fr); }
}
.club-evidence-consent { grid-template-columns: 20px minmax(0, 1fr); align-items: start; }
.club-evidence-consent input { width: 18px; min-height: 18px; margin-top: 2px; }
.club-evidence-consent span { font-size: 11px !important; line-height: 1.45; text-transform: none !important; }
.club-evidence-summary { padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #090e13; }
.club-evidence-summary strong,
.club-evidence-summary span { display: block; }
.club-evidence-summary strong { color: #63d9ff; font-size: 18px; }
.club-evidence-summary span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.club-evidence-summary p { margin: 9px 0 0; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  .club-directory-loading i { animation: none; }
}

.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;
  }

  .club-directory-head {
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: start;
  }

  .club-create-button {
    width: 42px;
    min-height: 42px;
    padding: 0;
  }

  .club-create-button b {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .club-directory-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .club-directory-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .club-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ratpass-node {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .ratpass-node em {
    grid-column: 2;
    justify-self: start;
  }
  .club-directory-actions {
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
    gap: 6px;
  }

  .club-challenge-head {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .club-feed-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .club-feed-head-actions .club-create-button {
    width: 42px;
  }

  .club-challenge-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .club-challenge-card {
    padding: 12px;
  }

  .club-challenge-ranking-list article {
    grid-template-columns: 28px 34px minmax(0, 1fr) auto;
    gap: 7px;
    padding-inline: 7px;
  }

  .club-ranking-avatar {
    width: 34px;
    height: 34px;
  }

  .club-validation-list article {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .club-validation-list article p {
    grid-column: 1;
  }

  .club-validation-list article button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 350px) {
  .club-challenge-ranking-list article {
    grid-template-columns: 26px 32px minmax(0, 1fr);
  }

  .club-challenge-ranking-list article > b {
    grid-column: 3;
    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: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(170px, auto); align-items: center; gap: 10px; min-width: 0; padding: 10px 11px; border-radius: 12px; background: rgba(255,255,255,0.055); border: 1px solid rgba(255,255,255,.075); 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-toggle { display: grid; place-items: center; width: 30px; height: 40px; margin: 0; cursor: pointer; }
.diet-mc-plan-toggle input { width: 19px; height: 19px; margin: 0; 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-plan-qty { display: grid; grid-template-columns: minmax(72px, 88px) auto minmax(74px, auto); align-items: end; justify-content: end; gap: 6px; min-width: 0; }
.diet-mc-plan-qty label { display: grid; gap: 3px; margin: 0; }
.diet-mc-plan-qty label > span,
.diet-mc-option-picker > span { color: #9aa3ad; font-size: 9px; font-weight: 900; line-height: 1; text-transform: uppercase; }
.diet-mc-plan-qty input { width: 100%; min-width: 0; height: 38px; padding: 7px 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: #080808; color: #fff; font-weight: 900; text-align: center; }
.diet-mc-plan-qty input:disabled { color: #7d858f; background: rgba(0,0,0,.22); }
.diet-mc-plan-unit { align-self: end; min-width: 20px; padding-bottom: 11px; color: #aaa; font-size: 0.76rem; font-weight: 800; }
.diet-mc-plan-qty > small { align-self: end; padding-bottom: 11px; color: #aab2bc; font-size: 0.7rem; font-weight: 850; white-space: nowrap; }
.diet-mc-option-section { padding-block: 10px; }
.diet-mc-option-picker { display: grid; grid-template-columns: auto minmax(150px, 1fr); align-items: center; gap: 10px; margin: 0; }
.diet-mc-option-picker select { width: 100%; min-width: 0; height: 40px; margin: 0; padding: 0 34px 0 10px; }
.diet-mc-scope-note { color: #aeb5be; font-size: 0.72rem; font-weight: 750; line-height: 1.35; }
.diet-mc-empty-planned { margin: 0; color: #c7cbd1; font-size: 0.8rem; font-weight: 800; line-height: 1.4; }
.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-plan-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px 9px;
  }

  .diet-mc-plan-qty {
    grid-column: 2;
    grid-template-columns: minmax(74px, 92px) auto minmax(70px, 1fr);
    justify-content: start;
  }

  .diet-mc-option-picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .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); }

/* Full-screen Central RatLab */
.topbar-central-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.topbar-central-health-grid > button {
  min-width: 0;
  min-height: 116px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 4px 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: #11161a;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.topbar-central-health-grid > button:hover {
  border-color: rgba(225, 27, 34, .42);
  background: #151a1f;
}

.topbar-central-health-grid > button > span {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  align-self: center;
  border-radius: 10px;
  background: rgba(225, 27, 34, .14);
  color: #f0444b;
}

.topbar-central-health-grid svg,
.topbar-menu-challenge-mark svg {
  width: 23px;
  height: 23px;
}

.topbar-central-health-grid strong {
  align-self: end;
  font-size: 13px;
}

.topbar-central-health-grid small {
  align-self: start;
  color: #82939e;
  font-size: 10px;
  line-height: 1.4;
}

.topbar-central-challenges {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.topbar-central-challenges > span {
  color: #82939e;
  font-size: 10px;
  font-weight: 800;
}

.topbar-menu-challenge {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: #11161a;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.topbar-menu-challenge:hover {
  border-color: rgba(225, 27, 34, .42);
}

.topbar-menu-challenge-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(225, 27, 34, .14);
  color: #f0444b;
}

.topbar-menu-challenge > span:nth-child(2) {
  min-width: 0;
}

.topbar-menu-challenge small,
.topbar-menu-challenge strong,
.topbar-menu-challenge em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-menu-challenge small {
  color: #f0444b;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.topbar-menu-challenge strong {
  margin-top: 2px;
  font-size: 12px;
}

.topbar-menu-challenge em {
  margin-top: 3px;
  color: #82939e;
  font-size: 9px;
  font-style: normal;
}

.central-view-loading {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #82939e;
  font-size: 11px;
}

.central-women-health {
  display: grid;
  gap: 14px;
}

.central-health-privacy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-left: 3px solid #e11b22;
  background: #11161a;
}

.central-health-privacy > span {
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(225, 27, 34, .16);
  color: #ff6268;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.central-health-privacy strong {
  display: block;
  font-size: 12px;
}

.central-health-privacy p {
  margin: 5px 0 0;
  color: #82939e;
  font-size: 10px;
  line-height: 1.5;
}

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

.central-cycle-summary > div {
  min-width: 0;
  padding: 13px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: #0e1216;
  text-align: center;
}

.central-cycle-summary small,
.central-cycle-summary strong {
  display: block;
}

.central-cycle-summary small {
  overflow: hidden;
  color: #82939e;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.central-cycle-summary strong {
  margin-top: 5px;
  color: #fff;
  font-size: 13px;
  text-transform: capitalize;
}

.central-cycle-settings,
.central-cycle-log {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: #0e1216;
}

.central-cycle-calendar {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: #0e1216;
}

.central-cycle-calendar > header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.central-cycle-calendar > header strong {
  font-size: 13px;
  text-align: center;
  text-transform: capitalize;
}

.central-cycle-calendar > header button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: #171d22;
  color: #fff;
}

.central-cycle-calendar > header svg {
  width: 19px;
  height: 19px;
}

.central-cycle-next {
  display: grid;
  transform: rotate(180deg);
}

.central-cycle-weekdays,
.central-cycle-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.central-cycle-weekdays {
  margin-bottom: 5px;
}

.central-cycle-weekdays span {
  color: #677782;
  font-size: 7px;
  font-weight: 900;
  text-align: center;
}

.central-cycle-days button {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #b8c2c8;
  font-size: 10px;
  cursor: pointer;
}

.central-cycle-days button.outside {
  color: #465159;
}

.central-cycle-days button.estimated {
  background: rgba(225, 27, 34, .1);
  color: #ff7b80;
}

.central-cycle-days button.logged {
  background: rgba(88, 215, 160, .1);
  color: #83e5ba;
}

.central-cycle-days button.period {
  background: rgba(225, 27, 34, .22);
  color: #fff;
}

.central-cycle-days button.today {
  border-color: rgba(255, 255, 255, .46);
}

.central-cycle-days button.selected {
  border-color: #e11b22;
  box-shadow: inset 0 0 0 1px #e11b22;
}

.central-cycle-days button:disabled {
  opacity: .32;
  cursor: default;
}

.central-cycle-days button i {
  position: absolute;
  bottom: 3px;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.central-cycle-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: #82939e;
  font-size: 8px;
}

.central-cycle-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.central-cycle-legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

.central-cycle-legend i.logged { background: rgba(88, 215, 160, .75); }
.central-cycle-legend i.estimated { background: rgba(225, 27, 34, .4); }
.central-cycle-legend i.today { border: 1px solid rgba(255, 255, 255, .7); }

.central-cycle-log > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.central-cycle-log > header small,
.central-cycle-log > header strong {
  display: block;
}

.central-cycle-log > header small {
  color: #e53a41;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.central-cycle-log > header strong {
  margin-top: 3px;
  font-size: 13px;
  text-transform: capitalize;
}

.central-cycle-log > header > span {
  color: #677782;
  font-size: 8px;
}

.central-cycle-log fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.central-cycle-log legend {
  margin-bottom: 7px;
  color: #9bacb6;
  font-size: 9px;
  font-weight: 800;
}

.central-cycle-symptoms {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.central-cycle-symptoms label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.central-cycle-symptoms label span {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: #171d22;
  color: #aab6bd;
  font-size: 9px;
  cursor: pointer;
}

.central-cycle-symptoms label input:checked + span {
  border-color: rgba(225, 27, 34, .7);
  background: rgba(225, 27, 34, .17);
  color: #fff;
}

.central-health-consent {
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
}

.central-health-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.central-health-actions button {
  min-height: 48px;
}

.topbar-menu-content--detail .health-connections {
  max-width: none;
}

@media (max-width: 390px) {
  .topbar-menu-content {
    padding-right: 12px;
    padding-left: 12px;
  }

  .topbar-central-health-grid {
    grid-template-columns: 1fr;
  }

  .topbar-central-health-grid > button {
    min-height: 86px;
  }

  .central-cycle-settings .grid-2,
  .central-cycle-log .grid-2 {
    grid-template-columns: 1fr;
  }

  .central-health-actions {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .topbar-menu-content {
    padding-top: 24px;
  }

  .topbar-menu-level,
  .topbar-menu-section {
    margin-right: auto;
    margin-left: auto;
  }
}

/* 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;
}

/* Perfis visitados usam a mesma composição canônica do perfil pessoal. */
.viewed-profile-topbar {
  padding-top: max(10px, env(safe-area-inset-top));
  min-height: 56px;
}

.viewed-profile-topbar .icon-btn {
  width: 48px;
  height: 48px;
}

.viewed-profile-clean {
  position: relative;
  gap: 13px;
  padding: 14px 16px calc(90px + env(safe-area-inset-bottom));
}

.viewed-profile-clean .profile-main-row {
  position: relative;
  grid-template-columns: 92px minmax(0, 1fr) 48px;
}

.viewed-profile-photo {
  overflow: hidden;
}

.viewed-profile-photo .profile-photo {
  overflow: hidden;
}

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

.viewed-profile-more {
  width: 48px;
  height: 48px;
}

.viewed-profile-more svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: none;
}

.viewed-profile-more svg circle {
  fill: currentColor;
  stroke: none;
}

.viewed-profile-clean .viewed-profile-privacy-pill {
  width: fit-content;
  margin-top: 7px;
}

.viewed-profile-clean .viewed-profile-menu {
  top: 52px;
  right: 0;
}

.viewed-profile-clean .viewed-profile-menu button {
  min-height: 48px;
}

.viewed-profile-clean-actions button {
  min-height: 44px;
}

.viewed-profile-clean-actions .is-following {
  border-color: var(--border);
  background: var(--panel);
}

.viewed-profile-clean .profile-icon-tabs button {
  flex: 1 1 0;
  min-width: 48px;
  min-height: 48px;
}

.profile-icon-tabs button.locked {
  opacity: .34;
}

.viewed-profile-clean .viewed-profile-sections {
  margin-top: 0;
}

.profile-empty-state-icon {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  color: var(--muted);
}

@media (max-width: 390px) {
  .viewed-profile-clean .profile-main-row {
    grid-template-columns: 80px minmax(0, 1fr) 48px;
  }
}

/* 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(900px, calc(100vw - 24px));
  max-height: min(860px, calc(100dvh - 32px));
  overflow: auto;
}

.workout-history-form {
  display: grid;
  gap: 16px;
}

.workout-history-form textarea {
  width: 100%;
  resize: vertical;
}

.workout-history-editable-execution {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(138, 164, 177, .2);
}

.workout-history-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.workout-history-section-head h4,
.workout-history-section-head small {
  display: block;
  margin: 0;
}

.workout-history-section-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.workout-history-section-head button {
  flex: 0 0 auto;
  min-height: 40px;
}

.workout-history-exercise-editor-list {
  display: grid;
  gap: 12px;
}

.workout-history-exercise-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(121, 151, 166, .22);
  border-radius: 8px;
  background: rgba(8, 13, 16, .72);
}

.workout-history-exercise-editor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workout-history-exercise-editor > header strong {
  color: #d9edf5;
  font-size: 11px;
  text-transform: uppercase;
}

.workout-history-exercise-editor > header button,
.workout-history-set-delete {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(239, 27, 45, .48);
  border-radius: 50%;
  background: rgba(122, 13, 24, .18);
  color: #ff5361;
}

.workout-history-exercise-editor > header button .control-icon,
.workout-history-set-delete .control-icon {
  width: 17px;
  height: 17px;
}

.workout-history-exercise-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(160px, .8fr);
  gap: 10px;
}

.workout-history-exercise-fields label,
.workout-history-set-type,
.workout-history-set-field,
.workout-history-sequence-row label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.workout-history-exercise-fields span,
.workout-history-set-type > span,
.workout-history-set-field > span,
.workout-history-sequence-row label > span {
  color: rgba(185, 211, 222, .72);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.workout-history-exercise-fields input,
.workout-history-set-type select,
.workout-history-set-field input,
.workout-history-sequence-row input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(121, 151, 166, .26);
  border-radius: 7px;
  background: #070c0f;
  color: #fff;
  font-weight: 750;
}

.workout-history-set-list {
  display: grid;
  gap: 8px;
}

.workout-history-set-editor {
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(0, 2fr) 40px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(121, 151, 166, .17);
  border-left-color: var(--history-set-color);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
}

.workout-history-set-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  align-items: end;
  gap: 8px;
}

.workout-history-set-delete {
  align-self: end;
}

.workout-history-add-set {
  width: 100%;
  min-height: 40px;
  border-style: dashed;
}

.workout-history-sequence-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
}

.workout-history-sequence-row {
  display: grid;
  grid-template-columns: 32px repeat(3, minmax(76px, 1fr)) 36px;
  align-items: end;
  gap: 7px;
}

.workout-history-sequence-row > b {
  width: 32px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--history-set-color), transparent 30%);
  border-radius: 7px;
  color: var(--history-set-color);
  font-size: 10px;
}

.workout-history-mini-delete {
  width: 36px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(239, 27, 45, .3);
  border-radius: 7px;
  background: rgba(122, 13, 24, .14);
  color: #ff6874;
}

.workout-history-add-step {
  min-height: 38px;
  justify-self: start;
}

.workout-history-editor-summary {
  display: grid;
  grid-template-columns: .6fr .8fr 1.6fr;
  gap: 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, .22);
  background: rgba(74, 15, 22, .2);
  color: var(--muted);
  font-size: 12px;
}

.workout-history-editor-summary > span {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 0 12px;
  border-right: 1px solid rgba(139, 163, 175, .16);
}

.workout-history-editor-summary > span:first-child {
  padding-left: 0;
}

.workout-history-editor-summary > span:last-child {
  padding-right: 0;
  border-right: 0;
}

.workout-history-editor-summary small {
  color: rgba(185, 211, 222, .62);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.workout-history-editor-summary strong {
  color: #fff;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workout-history-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 560px) {
  .workout-history-editor-panel {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }
  .workout-history-section-head {
    align-items: flex-end;
  }
  .workout-history-exercise-editor {
    padding: 10px;
  }
  .workout-history-exercise-fields {
    grid-template-columns: 1fr;
  }
  .workout-history-set-editor {
    grid-template-columns: minmax(0, 1fr) 40px;
  }
  .workout-history-set-type,
  .workout-history-set-metrics {
    grid-column: 1;
  }
  .workout-history-set-delete {
    grid-column: 2;
    grid-row: 1;
  }
  .workout-history-sequence-row {
    grid-template-columns: 30px repeat(2, minmax(64px, 1fr)) 36px;
  }
  .workout-history-sequence-row label:nth-of-type(3) {
    grid-column: 2 / 4;
  }
  .workout-history-editor-summary {
    grid-template-columns: .55fr .8fr 1.45fr;
    padding-inline: 10px;
  }
  .workout-history-editor-summary > span {
    padding-inline: 8px;
  }
  .workout-history-editor-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .workout-history-section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .workout-history-section-head button {
    width: 100%;
  }
  .workout-history-set-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workout-history-sequence-row {
    grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr);
  }
  .workout-history-sequence-row .workout-history-mini-delete {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
  .workout-history-sequence-row label:nth-of-type(3) {
    grid-column: 2 / 4;
  }
  .workout-history-editor-summary {
    grid-template-columns: 1fr 1fr;
  }
  .workout-history-editor-summary > span:nth-child(2) {
    border-right: 0;
  }
  .workout-history-editor-summary > span:last-child {
    grid-column: 1 / -1;
    padding: 10px 0 0;
    margin-top: 10px;
    border-top: 1px solid rgba(139, 163, 175, .16);
  }
}

/* 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: flex;
  gap: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}
.challenges-section-nav::-webkit-scrollbar { display: none; }
.challenges-section-nav button {
  position: relative;
  flex: 1 0 96px;
  min-width: 96px;
  min-height: 48px;
  padding: 14px 12px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}
.challenges-section-nav button::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 5px;
  left: 12px;
  height: 2px;
  background: transparent;
  transform: scaleX(.35);
  transform-origin: center;
  transition: transform 180ms cubic-bezier(.22, 1, .36, 1), background-color 180ms ease;
}
.challenges-section-nav button:hover { color: #fff; }
.challenges-section-nav button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.challenges-section-nav button.active {
  color: #fff;
  background: transparent;
  box-shadow: none;
}
.challenges-section-nav button.active::after { background: #ef233c; transform: scaleX(1); }
.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; }
.screen.community-home {
  --community-gutter: 16px;
  gap: 0;
  padding-block-start: 0;
}
.community-hero {
  position: relative;
  width: calc(100% + (var(--community-gutter) * 2));
  max-width: none;
  height: clamp(218px, 32dvh, 300px);
  margin-inline: calc(var(--community-gutter) * -1);
  overflow: hidden;
  background: #09090b;
  isolation: isolate;
}
.community-hero::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 4, 6, .76) 0, rgba(3, 4, 6, .14) 32%, transparent 55%),
    linear-gradient(0deg, var(--bg) 0, rgba(5, 6, 8, .82) 13%, transparent 50%);
}
.community-hero > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.community-home .challenges-section-nav {
  position: absolute;
  z-index: 2;
  top: 0;
  right: max(10px, env(safe-area-inset-right));
  left: max(10px, env(safe-area-inset-left));
}
.community-tab-stage {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 0;
  margin-top: -26px;
  padding-top: 12px;
  touch-action: pan-y;
}
.community-stack { display: grid; gap: 10px; }
.community-challenge-access { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.community-challenge-access button { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 56px; padding: 10px 8px; border: 1px solid var(--border, #29343d); border-radius: 6px; background: var(--card, #101418); color: var(--text, #f4f7f9); font-size: 13px; cursor: pointer; }
.community-challenge-access button:hover { border-color: #ef2945; }
.community-challenge-access button:focus-visible { outline: 2px solid #7fbdcf; outline-offset: 3px; }
.community-challenge-access svg { width: 20px; height: 20px; flex-shrink: 0; }
.community-challenge-access span { overflow-wrap: anywhere; }
@media (max-width: 480px) { .community-challenge-access button { flex-direction: column; gap: 6px; font-size: 12px; } }
.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-panel.community-challenge-card{
  --community-card-accent:#f04452;
  gap:12px;
  padding:13px;
  border-color:#29343d;
  border-radius:8px;
  background:#0e1216;
  box-shadow:none;
}
.community-challenge-card>header{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:10px;min-width:0}
.community-card-icon{display:grid;place-items:center;width:42px;height:42px;border:1px solid color-mix(in srgb,var(--community-card-accent) 48%,transparent);border-radius:7px;background:color-mix(in srgb,var(--community-card-accent) 10%,#0e1216);color:var(--community-card-accent)}
.community-card-svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.community-challenge-card>header>div{display:grid;gap:3px;min-width:0}
.community-challenge-card h2{margin:0;color:#f6f8fa;font-size:14px;line-height:1.2;letter-spacing:0}
.community-challenge-card>header small{color:#8897a2;font-size:9px}
.community-challenge-card>header>strong{color:var(--community-card-accent);font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
.community-card-content{display:grid;gap:9px;min-width:0;padding-top:10px;border-top:1px solid rgba(255,255,255,.075)}
.community-card-content>strong{font-size:15px}
.community-card-content>span{color:#9ba7af;font-size:10px;line-height:1.4}
.community-card-action{justify-self:start;min-height:44px;padding:0 12px;border:1px solid color-mix(in srgb,var(--community-card-accent) 55%,#29343d);border-radius:6px;background:transparent;color:#f4f7f9;font-size:10px;font-weight:900;cursor:pointer}
.community-card-action:hover{border-color:var(--community-card-accent);color:#fff}
.community-card-action:focus-visible{outline:2px solid #7fbdcf;outline-offset:3px}
.community-progress-summary { container-type:inline-size; gap:12px; }
.community-progress-summary .community-challenge-card { display:grid; grid-template-columns:minmax(0,1fr) 160px; gap:16px 24px; padding:20px; }
.community-progress-summary .community-challenge-card>header { grid-column:1 / -1; gap:12px; }
.community-progress-summary .community-card-content { grid-column:1; padding:0 0 0 52px; border:0; }
.community-progress-summary .community-card-action { grid-column:2; grid-row:2; align-self:end; justify-self:stretch; min-height:44px; padding:10px 12px; font-size:12px; line-height:1.4; white-space:normal; }
.community-progress-summary .community-card-icon { border-radius:6px; background:transparent; }
.community-progress-summary .community-stats { gap:16px; align-items:start; }
.community-progress-summary .community-stats strong { min-width:0; font-size:22px; line-height:1.25; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.community-progress-summary .community-stats small { font-size:11px; line-height:1.4; margin-top:4px; }
.community-progress-summary .community-card-empty { margin:0; line-height:1.5; }
.community-progress-summary .community-general-challenge-list > div { gap:12px; }
.community-progress-summary .community-general-challenge-list > div > span { min-width:0; overflow-wrap:anywhere; }
.community-progress-summary .community-next { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 12px; }
.community-progress-summary .community-next strong { font-size:12px; overflow-wrap:anywhere; }
.community-progress-summary .community-card-empty { color:#aab5bd; font-size:12px; }
.community-progress-summary .community-challenge-card h2 { line-height:1.4; overflow-wrap:anywhere; }
.community-progress-summary .community-club-challenges .community-card-content { grid-column:1 / -1; }
@container(max-width:540px){
  .community-progress-summary .community-challenge-card { grid-template-columns:minmax(0,1fr); padding:16px; gap:16px; }
  .community-progress-summary .community-card-action { grid-column:1; grid-row:auto; justify-self:stretch; }
  .community-progress-summary .community-card-content { padding-left:0; }
}
.community-tasks{--community-card-accent:#f04452}
.community-general-challenges{--community-card-accent:#f2b84b}
.community-performance{--community-card-accent:#64cbe3}
.community-club-challenges{--community-card-accent:#b58ae8}
.community-season{--community-card-accent:#ef8f55}
.community-general-challenge-list{display:grid}
.community-general-challenge-list>div{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:46px;padding:7px 0;border-bottom:1px solid rgba(255,255,255,.07)}
.community-general-challenge-list>div:last-child{border-bottom:0}
.community-general-challenge-list span{display:grid;gap:3px;min-width:0}
.community-general-challenge-list strong{overflow:hidden;color:#f1f4f6;font-size:12px;text-overflow:ellipsis;white-space:nowrap}
.community-general-challenge-list small{color:#8e9ba4;font-size:9px}
.community-general-challenge-list em{flex:0 0 auto;color:#f2b84b;font-size:8px;font-style:normal;font-weight:850;text-transform:uppercase}
.community-card-empty{margin:0;padding:3px 0;color:#8e9ba4;font-size:10px;line-height:1.45}
.community-clubs-hub{
  display:grid;
  gap:14px;
  min-width:0;
  padding:12px 0 28px;
}
.community-clubs-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-width:0;
  padding-bottom:11px;
  border-bottom:1px solid rgba(127,189,207,.22);
}
.community-clubs-head h2{margin:0;color:#f7f9fb;font-size:20px;line-height:1.15;letter-spacing:0}
.community-club-create{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:44px;
  padding:0 13px;
  border:1px solid rgba(244,24,66,.72);
  border-radius:7px;
  background:#181014;
  color:#fff;
  font-size:11px;
  font-weight:900;
  cursor:pointer;
}
.community-club-create .club-ui-icon{width:17px;height:17px;color:#ff3858}
.community-club-create:hover{border-color:#ff3858;background:#211117}
.community-club-create:focus-visible,.community-club-search:focus-visible{outline:2px solid #7fbdcf;outline-offset:2px}
.community-club-search{
  width:100%;
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 44px;
  align-items:center;
  min-height:50px;
  padding:0;
  overflow:hidden;
  border:1px solid #29343e;
  border-radius:7px;
  background:#0b1015;
  color:#9ba9b4;
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.community-club-search:hover,.community-club-search:focus-visible{border-color:#7fbdcf;background:#0d141a;box-shadow:0 8px 20px rgba(0,0,0,.24)}
.community-club-search>span{display:grid;gap:2px;min-width:0}
.community-club-search strong{overflow:hidden;color:#f7f9fb;font-size:13px;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}
.community-club-search small{color:#7f8d97;font-size:9px;line-height:1.2}
.community-club-search>.club-ui-icon{
  display:grid;
  place-items:center;
  justify-self:center;
}
.community-club-search>.club-ui-icon:last-child{grid-column:3;color:#63717b}
.community-club-search .club-ui-icon{width:18px;height:18px}
.community-club-directory{display:grid;gap:9px;min-width:0}
.community-club-directory>header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:28px}
.community-club-directory>header h3{margin:0;color:#e9edf0;font-size:13px;line-height:1.2;letter-spacing:0}
.community-club-directory>header span{color:#7f8d97;font-size:9px;font-weight:850;text-transform:uppercase}
.community-club-list{gap:7px}
.community-clubs-hub .club-list-card{
  grid-template-columns:58px minmax(0,1fr) auto;
  gap:10px;
  padding:9px;
  border-color:#25313a;
  background:#0d1217;
}
.community-clubs-hub .club-list-card:hover{border-color:rgba(244,24,66,.55)}
.community-clubs-hub .club-list-card>.club-media-avatar{border-radius:6px;background:#121a20}
.community-clubs-hub .club-list-description{display:none}
.community-clubs-hub .club-card-action{min-height:40px;border-radius:6px}
.community-clubs-hub .club-member-details span{border-radius:4px;background:rgba(127,189,207,.08)}
.community-club-status{
  display:grid;
  justify-items:start;
  gap:6px;
  min-height:144px;
  padding:22px 0;
  border-top:1px solid #26313a;
  color:#87949e;
}
.community-club-status strong{color:#e9edf0;font-size:13px}
.community-club-status span{font-size:11px;line-height:1.45}
.community-club-status button{min-height:40px;margin-top:6px}
.community-club-status-actions{display:flex;flex-wrap:wrap;gap:8px}
.community-club-status-actions button{margin-top:4px}
.community-club-loading{display:grid;gap:7px;min-height:190px}
.community-club-loading>span{display:grid;grid-template-columns:58px minmax(0,1fr);align-items:center;gap:10px;min-height:78px;padding:9px;border:1px solid #202a32;border-radius:7px;background:#0d1217}
.community-club-loading i{width:58px;aspect-ratio:1;border-radius:6px;background:#182027}
.community-club-loading b{display:block;width:62%;height:9px;border-radius:2px;background:#202a32;box-shadow:0 17px 0 #172027,0 34px 0 #172027}
@media(max-width:360px){
  .community-club-create span{display:none}
  .community-club-create{width:44px;padding:0}
  .community-clubs-hub .club-list-card{grid-template-columns:52px minmax(0,1fr)}
  .community-clubs-hub .club-list-action{grid-column:2;justify-self:start}
  .community-clubs-hub .club-list-action .club-card-action{min-width:72px}
}
.community-club-challenge-list{display:grid}
.community-club-challenge-list button{display:grid;grid-template-columns:34px minmax(0,1fr) 20px;align-items:center;gap:10px;min-height:58px;padding:9px 0;border:0;border-bottom:1px solid rgba(255,255,255,.09);border-radius:0;background:transparent;color:#fff;text-align:left;cursor:pointer}
.community-club-challenge-list button:last-child{border-bottom:0}
.community-club-challenge-list button:focus-visible{outline:2px solid #57d2d0;outline-offset:3px}
.community-club-challenge-list button:hover{color:#ff6872}
.community-club-challenge-icon{display:grid;place-items:center;width:34px;height:34px;color:#ff4653}
.community-club-challenge-svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.community-club-challenge-list button>span:nth-child(2){display:grid;gap:4px;min-width:0}
.community-club-challenge-list strong{overflow:hidden;color:inherit;font-size:13px;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}
.community-club-challenge-list small{color:#9eabb4;font-size:10px}
.community-club-challenge-arrow{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.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-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; }
@media (max-width: 380px) {
  .screen.community-home { --community-gutter: 12px; }
}
@media (min-width: 480px) {
  .screen.community-home { --community-gutter: 20px; }
}
@media (min-width: 640px) {
  .screen.community-home { --community-gutter: 24px; }
}
@media (min-width: 700px) {
  .community-hero { height: clamp(260px, 38dvh, 360px); }
}
@media (prefers-reduced-motion: reduce) {
  .challenges-section-nav button::after { transition: none; }
}
.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; }
}


/* Assistentes de IA: mesma linguagem visual do RatLab, sem alterar os fluxos existentes. */
.diet-ai-card,
.lib-ai-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  margin: 0 0 14px;
  background: linear-gradient(135deg, rgba(180, 20, 35, .17), rgba(30, 20, 28, .94));
  border: 1px solid rgba(239, 38, 51, .46);
  border-radius: 8px;
}

.diet-ai-card > div,
.lib-ai-action > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.diet-ai-card strong,
.lib-ai-action strong {
  color: #fff;
  font-size: 13px;
}

.diet-ai-card small,
.lib-ai-action small {
  color: #b8b3b5;
  font-size: 11px;
  line-height: 1.35;
}

.diet-ai-card .secondary,
.lib-ai-action .primary {
  width: auto;
  min-height: 36px;
  flex: 0 0 auto;
  padding-inline: 12px;
  white-space: nowrap;
}

.lib-ai-action {
  min-height: 72px;
  margin-bottom: 12px;
}

@media (max-width: 420px) {
  .diet-ai-card,
  .lib-ai-action { align-items: flex-start; }
  .diet-ai-card .secondary,
  .lib-ai-action .primary { font-size: 11px; padding-inline: 9px; }
}

/* Professional-managed prescriptions */
.professional-managed-badge{display:inline-flex;align-items:center;min-height:24px;padding:4px 8px;border:1px solid rgba(245,185,74,.45);border-radius:6px;color:#f5c76b;background:rgba(245,185,74,.08);font-size:11px;font-weight:800}
.professional-managed-badge.training-pdf-badge{
  display:inline-grid;
  place-items:center;
  width:30px;
  height:30px;
  min-width:30px;
  min-height:30px;
  padding:0;
  border-radius:50%;
  box-sizing:border-box;
  font-size:8px;
  line-height:1;
  text-align:center;
}
@media (max-width:420px){
  .professional-managed-badge.training-pdf-badge{
    width:28px;
    height:28px;
    min-width:28px;
    min-height:28px;
  }
}
.professional-managed-notice{border-color:rgba(245,185,74,.38);background:#181713}
.professional-managed-notice strong{color:#f5c76b}
.professional-managed-notice p{margin:7px 0 0;color:var(--muted);line-height:1.45}
.professional-managed-hint{color:#c9a85d;font-size:12px;font-weight:700}

/* Shared profile identity and optimized avatar picker */
.profile-photo { overflow: hidden; }
.profile-photo img,
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-identity-editor { display: grid; gap: 12px; }
.profile-avatar-editor { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.035); }
.profile-avatar-preview { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border: 2px solid var(--red); border-radius: 50%; background: var(--panel); color: var(--text); font-size: 20px; font-weight: 900; }
.profile-avatar-editor > div:last-child { display: grid; gap: 5px; min-width: 0; }
.profile-avatar-editor strong { color: var(--text); font-size: 13px; }
.profile-avatar-editor small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.profile-avatar-pick { width: max-content; min-height: 34px; margin-top: 3px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.profile-avatar-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.native-media-preview > small { display: block; padding: 8px 10px; color: var(--muted); }
@media (max-width: 380px) { .profile-avatar-editor { grid-template-columns: 62px minmax(0, 1fr); } .profile-avatar-preview { width: 62px; height: 62px; } }
/* Offline outbox: temporary device work, never a second source of truth. */
.offline-drafts-panel {
  gap: 12px;
}
.offline-drafts-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line, #2c2c2c);
  border-radius: 8px;
  background: var(--panel, #171717);
}
.offline-drafts-summary > div {
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}
.offline-drafts-summary strong,
.offline-drafts-summary small {
  grid-column: 2;
}
.offline-network-dot {
  grid-row: 1 / span 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, .35);
}
.offline-network-dot.online {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, .35);
}
.offline-drafts-summary .primary {
  min-width: 132px;
  width: auto;
}
.offline-drafts-note {
  margin: 0;
  color: var(--muted, #9b9b9b);
  font-size: 12px;
  line-height: 1.5;
}
.offline-drafts-list {
  display: grid;
  gap: 8px;
}
.offline-draft-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line, #2c2c2c);
  border-radius: 8px;
  background: var(--panel, #171717);
}
.offline-draft-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.offline-draft-main strong,
.offline-draft-main small {
  overflow-wrap: anywhere;
}
.offline-draft-domain {
  width: max-content;
  color: #ef4444;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.offline-draft-main small {
  color: var(--muted, #9b9b9b);
}
.offline-draft-error {
  color: #f59e0b !important;
}
.offline-draft-actions {
  display: flex;
  gap: 6px;
}
.offline-draft-actions button {
  width: auto;
  min-height: 36px;
  padding: 0 11px;
}
.offline-drafts-empty {
  padding: 28px 16px;
  border: 1px dashed var(--line, #343434);
  border-radius: 8px;
  text-align: center;
}
.offline-drafts-empty p {
  margin: 6px 0 0;
  color: var(--muted, #9b9b9b);
  font-size: 12px;
}
@media (max-width: 560px) {
  .offline-drafts-summary,
  .offline-draft-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .offline-drafts-summary {
    flex-direction: column;
    align-items: stretch;
  }
  .offline-drafts-summary .primary {
    width: 100%;
  }
  .offline-draft-actions button {
    flex: 1;
  }
}
/* Intelligent workout and diet libraries */
.lib-template-actions,
.diet-library-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.lib-template-actions button,
.diet-library-actions button {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
}
.lib-template-social,
.diet-library-social {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  color: var(--muted, #a1a1aa);
  font-size: 11px;
  font-weight: 700;
}
.lib-match-reasons,
.lib-match-warning {
  display: block;
  margin-top: 8px;
  line-height: 1.4;
}
.lib-match-reasons { color: #86efac; }
.lib-match-warning { color: #fbbf24; }
.profile-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 4px;
}
.profile-health-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border, #2f2f32);
  background: var(--panel-soft, #141416);
  border-radius: 6px;
}
.profile-health-option.high-risk { border-color: rgba(245, 158, 11, .4); }
.profile-health-option input { margin-top: 2px; flex: 0 0 auto; }
.profile-health-option span { min-width: 0; }
.profile-health-option strong,
.profile-health-option small { display: block; }
.profile-health-option strong { font-size: 12px; line-height: 1.25; }
.profile-health-option small { color: var(--muted, #a1a1aa); margin-top: 3px; font-size: 10px; }
.profile-cycle-card,
.profile-health-estimate {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border, #2f2f32);
  background: var(--panel-soft, #141416);
  border-radius: 6px;
}
.profile-health-estimate span,
.profile-health-estimate small { display: block; }
.profile-health-estimate small { color: var(--muted, #a1a1aa); line-height: 1.4; }
.profile-health-consent {
  align-items: flex-start;
  padding: 10px;
  border-left: 3px solid var(--accent, #ef1b2d);
  background: rgba(239, 27, 45, .06);
}
@media (max-width: 560px) {
  .profile-health-grid { grid-template-columns: 1fr; max-height: 250px; }
  .lib-template-actions,
  .diet-library-actions { flex-wrap: wrap; }
  .lib-template-actions button,
  .diet-library-actions button { flex: 1 1 calc(50% - 4px); }
}
.library-result-search {
  display: grid;
  gap: 7px;
  margin: 12px 0 14px;
  min-width: 0;
}

.library-result-search > span {
  color: var(--muted, #a3a3a3);
  font-size: 12px;
  font-weight: 800;
}

.library-result-search input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(239, 35, 47, .38);
  border-radius: 8px;
  background: #0c0c0d;
  color: #fff;
  min-height: 44px;
  padding: 0 13px;
  font: inherit;
}

.library-result-search input:focus {
  outline: none;
  border-color: #ef232f;
  box-shadow: 0 0 0 3px rgba(239, 35, 47, .14);
}

[data-theme="light"] .library-result-search input {
  background: #f3f1ef;
  color: #191718;
  border-color: rgba(165, 28, 38, .28);
}

.exercise-preview-empty {
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: var(--muted, #9ca3af);
  background: #111;
}

.exercise-preview-empty strong {
  color: #fff;
  font-size: 14px;
}

.exercise-preview-description {
  margin: 12px 0 0;
  color: var(--muted, #b3b3b3);
  font-size: 13px;
  line-height: 1.55;
}

html[data-theme="light"] .training-session-hero {
  border-color: #c8d2dc;
  background: #f1f4f7;
}

html[data-theme="light"] .training-session-stats {
  border-color: #c7d1db;
  background: #e5ebf1;
}

html[data-theme="light"] .training-session-stats .session-stat + .session-stat::before {
  background-color: #c7d1db;
}

html[data-theme="light"] .training-session-stats.has-contextual-metrics .session-stat:nth-child(n + 3) {
  border-top-color: #c7d1db;
}

html[data-theme="light"] .training-session-stats strong,
html[data-theme="light"] .training-session-progress-copy strong {
  color: #17222d;
}

html[data-theme="light"] .session-player-btn {
  background: #e5ebf1;
  color: #17222d;
}

html[data-theme="light"] .session-player-btn svg {
  fill: currentColor;
}

html[data-theme="light"] .session-player-btn.paused {
  background: var(--red);
  color: #fff;
}
/* Profile settings information architecture */
.profile-settings-panel {
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 28px));
  height: min(780px, calc(100dvh - 36px - var(--safe-top) - var(--safe-bottom)));
  max-height: calc(100dvh - 36px - var(--safe-top) - var(--safe-bottom));
  overflow: hidden;
  padding: 0;
  border-color: rgba(255,255,255,.12);
  background: #111316;
}

.profile-settings-modal-head {
  flex: 0 0 auto;
  align-items: center;
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: #14171b;
}

.profile-settings-modal-head h3 {
  font-size: 16px;
  letter-spacing: 0;
}

.profile-settings-modal-head .icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  line-height: 1;
}

.profile-settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
}

.profile-settings-nav {
  min-width: 0;
  overflow-y: auto;
  padding: 14px 10px 18px;
  border-right: 1px solid var(--border);
  background: #0c0f13;
  scrollbar-width: thin;
}

.profile-settings-nav-group {
  display: grid;
  gap: 4px;
  margin-bottom: 17px;
}

.profile-settings-nav-group:last-child { margin-bottom: 0; }

.profile-settings-nav-label {
  padding: 0 9px 5px;
  color: #727984;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.profile-settings-nav-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #a9afb8;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.profile-settings-nav-item:hover {
  border-color: rgba(255,255,255,.09);
  background: rgba(255,255,255,.035);
  color: #fff;
}

.profile-settings-nav-item.active {
  border-color: rgba(237,28,36,.48);
  background: rgba(237,28,36,.11);
  color: #fff;
}

.profile-settings-nav-icon,
.profile-settings-section-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.11);
  background: #15191e;
  color: #aeb6c1;
}

.profile-settings-nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
}

.profile-settings-nav-item.active .profile-settings-nav-icon {
  border-color: rgba(237,28,36,.6);
  background: rgba(237,28,36,.13);
  color: #ff4d57;
}

.profile-settings-nav-icon svg { width: 17px; height: 17px; }

.profile-settings-nav-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile-settings-nav-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-settings-nav-copy small {
  display: block;
  overflow: hidden;
  color: #737b87;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-settings-nav-arrow {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  opacity: .42;
}

.profile-settings-nav-item.active .profile-settings-nav-arrow { opacity: .9; }

.profile-settings-content {
  min-width: 0;
  overflow-y: auto;
  padding: 18px 20px 24px;
  scrollbar-width: thin;
}

.profile-settings-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.profile-settings-section-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border-color: rgba(237,28,36,.42);
  color: #ff4d57;
}

.profile-settings-section-icon svg { width: 20px; height: 20px; }
.profile-settings-section-head > div { min-width: 0; }

.profile-settings-section-head small {
  display: block;
  margin: 0 0 2px;
  color: #7e858f;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.profile-settings-section-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
}

.profile-settings-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.profile-settings-content .profile-settings-form { gap: 0; }

.profile-settings-block {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.profile-settings-block-head {
  align-self: start;
  padding-top: 2px;
}

.profile-settings-block-head strong {
  display: block;
  color: var(--text);
  font-size: 11px;
  line-height: 1.3;
}

.profile-settings-block-head small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.profile-settings-block-body {
  display: grid;
  gap: 11px;
  min-width: 0;
}

.profile-settings-content .field input,
.profile-settings-content .field select,
.profile-settings-content .field textarea {
  min-height: 42px;
  border-radius: 7px;
}

.profile-settings-content .field textarea {
  min-height: 84px;
  line-height: 1.45;
}

.profile-settings-block .profile-avatar-editor {
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-settings-block .profile-privacy-card {
  padding: 11px 12px;
  border-color: rgba(237,28,36,.28);
  border-radius: 7px;
  background: rgba(237,28,36,.055);
}

.profile-settings-block .profile-privacy-card p {
  margin-bottom: 0;
  font-size: 9px;
  line-height: 1.45;
}

.profile-settings-check-list {
  display: grid;
  gap: 6px;
}

.profile-settings-check-list .profile-check {
  min-height: 42px;
  border-radius: 7px;
  background: rgba(255,255,255,.025);
}

.profile-settings-savebar {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
}

.profile-settings-savebar .primary { min-width: 170px; }
.profile-settings-content .profile-settings-actions { margin-top: 16px; }

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

.profile-theme-options .theme-option {
  min-height: 78px;
  margin: 0;
  border-radius: 8px;
}

html[data-theme="light"] .profile-settings-panel,
html[data-theme="light"] .profile-settings-modal-head {
  background: #f1f4f7;
}

html[data-theme="light"] .profile-settings-nav {
  border-color: #c9d3dd;
  background: #e7edf3;
}

html[data-theme="light"] .profile-settings-nav-item { color: #52606d; }
html[data-theme="light"] .profile-settings-nav-item:hover { background: #dde5ed; color: #17222d; }
html[data-theme="light"] .profile-settings-nav-item.active { background: #f5e5e7; color: #17222d; }
html[data-theme="light"] .profile-settings-nav-icon,
html[data-theme="light"] .profile-settings-section-icon { background: #f7f9fb; }
html[data-theme="light"] .profile-settings-nav-copy small { color: #6b7784; }
html[data-theme="light"] .profile-settings-check-list .profile-check { background: #e8edf2; }

@media (max-width: 620px) {
  .profile-settings-panel {
    height: min(88dvh, calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom)));
    max-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom));
  }

  .profile-settings-modal-head { padding: 13px 14px; }

  .profile-settings-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .profile-settings-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
  }

  .profile-settings-nav::-webkit-scrollbar { display: none; }
  .profile-settings-nav-group { display: contents; }
  .profile-settings-nav-label { display: none; }

  .profile-settings-nav-item {
    flex: 0 0 112px;
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 44px;
    padding: 6px 7px;
  }

  .profile-settings-nav-icon { width: 28px; height: 28px; }
  .profile-settings-nav-icon svg { width: 15px; height: 15px; }
  .profile-settings-nav-copy small,
  .profile-settings-nav-arrow { display: none; }
  .profile-settings-content { padding: 14px 14px 20px; }
  .profile-settings-section-head { padding-bottom: 13px; }
  .profile-settings-block { grid-template-columns: 1fr; gap: 10px; padding: 15px 0; }
  .profile-settings-block-head { padding: 0; }
  .profile-settings-block-head small { max-width: 46ch; }
  .profile-theme-options { grid-template-columns: 1fr; }
  .profile-settings-savebar .primary { width: 100%; min-width: 0; }
}

@media (max-width: 360px) {
  .profile-settings-modal-head small { max-width: 230px; }
  .profile-settings-nav-item { flex-basis: 104px; }
  .profile-settings-content { padding-right: 12px; padding-left: 12px; }
  .profile-settings-section-icon { width: 36px; height: 36px; }
}
/* Perfil: configurações como tela própria, com foco em uso contínuo no mobile. */
.profile-settings-screen {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100dvh - 70px - var(--safe-top));
  height: calc(100dvh - 70px - var(--safe-top));
  padding: 0 0 calc(var(--bottom-nav-total) + var(--safe-bottom));
  overflow: hidden;
  background: #0e1013;
}

.profile-settings-page-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #14171b;
}

.profile-settings-page-head h1 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
}

.profile-settings-page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.profile-settings-page-head .profile-settings-back {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
}

.profile-settings-page-body {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  background: #111316;
}

.profile-settings-page-body .profile-settings-nav,
.profile-settings-page-body .profile-settings-content {
  min-height: 0;
}

.profile-settings-page-body .profile-settings-nav {
  overscroll-behavior: contain;
}

.profile-settings-page-body .profile-settings-content {
  padding-bottom: 30px;
  overscroll-behavior: contain;
}

.profile-settings-page-body .profile-settings-savebar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 10px;
  padding: 14px 0 2px;
  background: linear-gradient(180deg, rgba(17, 19, 22, 0), #111316 28%);
}

@media (max-width: 620px) {
  .profile-settings-screen {
    min-height: calc(100dvh - 70px - var(--safe-top));
    height: calc(100dvh - 70px - var(--safe-top));
  }

  .profile-settings-page-head {
    min-height: 66px;
    padding: 10px 12px;
  }

  .profile-settings-page-head h1 { font-size: 16px; }
  .profile-settings-page-head p { font-size: 10px; }

  .profile-settings-page-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .profile-settings-page-body .profile-settings-nav {
    position: relative;
    z-index: 1;
    background: #0c0f13;
  }

  .profile-settings-page-body .profile-settings-content {
    padding: 14px 14px 24px;
    background: #111316;
  }

  .profile-settings-page-body .profile-settings-nav-item {
    flex-basis: 122px;
  }
}

html[data-theme="light"] .profile-settings-screen,
html[data-theme="light"] .profile-settings-page-body .profile-settings-content {
  background: var(--bg);
}

html[data-theme="light"] .profile-settings-page-head {
  background: #edf2f6;
  border-color: var(--border);
}

html[data-theme="light"] .profile-settings-page-body {
  background: #edf2f6;
}

html[data-theme="light"] .profile-settings-page-body .profile-settings-savebar {
  background: linear-gradient(180deg, rgba(231, 236, 241, 0), var(--bg) 28%);
}

/* The app can be rendered inside a narrow shell on a wide browser. Base this
   page on its own width so the mobile settings flow remains usable there. */
.profile-settings-screen {
  container-name: profile-settings-page;
  container-type: inline-size;
}

.profile-settings-mobile-back {
  display: none;
}

@container profile-settings-page (max-width: 620px) {
  .profile-settings-page-head {
    min-height: 72px;
    padding: 10px 14px;
  }

  .profile-settings-page-head > div {
    min-width: 0;
  }

  .profile-settings-page-head h1 {
    max-width: 18ch;
    font-size: 18px;
    line-height: 1.05;
  }

  .profile-settings-page-head p {
    margin-top: 3px;
    font-size: 10px;
  }

  .profile-settings-page-body {
    position: relative;
    display: block;
    min-width: 0;
    overflow: hidden;
  }

  .profile-settings-page-body .profile-settings-nav,
  .profile-settings-page-body .profile-settings-content {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    transition: opacity 180ms ease, transform 220ms ease;
  }

  .profile-settings-page-body .profile-settings-nav {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 14px 14px calc(28px + var(--safe-bottom));
    border: 0;
    background: #0c0f13;
  }

  .profile-settings-nav-group,
  .profile-settings-page-body .profile-settings-nav-group {
    display: grid;
    gap: 7px;
    margin: 0 0 20px;
  }

  .profile-settings-page-body .profile-settings-nav-label {
    display: block;
    padding: 0 4px 2px;
    color: #747f8b;
    font-size: 9px;
    line-height: 1.2;
    letter-spacing: 0;
  }

  .profile-settings-page-body .profile-settings-nav-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 20px;
    gap: 11px;
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 64px;
    padding: 9px 10px;
    border: 1px solid #252b33;
    border-radius: 6px;
    background: #12161b;
    text-align: left;
  }

  .profile-settings-page-body .profile-settings-nav-item.active {
    border-color: rgba(235, 31, 45, .7);
    background: linear-gradient(90deg, rgba(235, 31, 45, .15), #14171c 68%);
  }

  .profile-settings-page-body .profile-settings-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 6px;
  }

  .profile-settings-page-body .profile-settings-nav-copy {
    min-width: 0;
  }

  .profile-settings-page-body .profile-settings-nav-copy strong {
    font-size: 13px;
    line-height: 1.2;
  }

  .profile-settings-page-body .profile-settings-nav-copy small,
  .profile-settings-page-body .profile-settings-nav-arrow {
    display: block;
  }

  .profile-settings-page-body .profile-settings-nav-copy small {
    margin-top: 3px;
    overflow: hidden;
    color: #8b949e;
    font-size: 10px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-settings-page-body .profile-settings-nav-arrow {
    width: 18px;
    height: 18px;
    stroke: #66717d;
  }

  .profile-settings-page-body .profile-settings-content {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 14px calc(28px + var(--safe-bottom));
    background: #111316;
  }

  .profile-settings-mobile-back {
    position: sticky;
    top: 0;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-height: 48px;
    margin: 0 0 12px;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid #252b33;
    border-radius: 0;
    background: #111316;
    color: #dce2e8;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
  }

  .profile-settings-mobile-back svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
  }

  .profile-settings-section-head {
    margin-bottom: 8px;
    padding: 0 0 14px;
  }

  .profile-settings-block {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 16px 0;
  }

  .profile-settings-block-head {
    padding-right: 0;
  }

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

  .profile-settings-savebar {
    padding-top: 12px;
  }

  .profile-settings-savebar .primary,
  .profile-settings-actions > button {
    min-height: 48px;
  }

  .profile-settings-screen[data-profile-settings-view="menu"] .profile-settings-nav {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  .profile-settings-screen[data-profile-settings-view="menu"] .profile-settings-content {
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
  }

  .profile-settings-screen[data-profile-settings-view="detail"] .profile-settings-nav {
    opacity: 0;
    transform: translateX(-18%);
    pointer-events: none;
  }

  .profile-settings-screen[data-profile-settings-view="detail"] .profile-settings-content {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  html[data-theme="light"] .profile-settings-page-body .profile-settings-nav,
  html[data-theme="light"] .profile-settings-mobile-back,
  html[data-theme="light"] .profile-settings-page-body .profile-settings-content {
    background: var(--bg);
  }

  html[data-theme="light"] .profile-settings-page-body .profile-settings-nav-item {
    border-color: var(--border);
    background: var(--surface);
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-settings-page-body .profile-settings-nav,
  .profile-settings-page-body .profile-settings-content {
    transition: none;
  }
}

/* RatLab immersive publication and comments */
.social-post-media[role="button"] {
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
}

.social-post-media[role="button"] video {
  pointer-events: none;
}

.social-post-media[role="button"]:focus-visible {
  box-shadow: inset 0 0 0 2px var(--red);
}

.social-post-media-expand {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(6, 7, 9, 0.72);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.social-post-media-expand svg {
  display: block;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.social-reel-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  line-height: 1;
}

.social-reel-back .social-action-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.social-reel-media > img,
.social-reel-media > video {
  object-fit: contain;
}

.social-comments-backdrop.diet-floating {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: stretch center;
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: 0;
  transform: none;
  background: #050608;
  backdrop-filter: none;
  overflow: hidden;
  overscroll-behavior: none;
  isolation: isolate;
}

.social-comments-panel.diet-floating-panel {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  margin: 0;
  padding: var(--safe-top) 0 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #0b0d10;
  box-shadow: none;
  animation: social-comments-enter 240ms cubic-bezier(.22, .8, .22, 1) both;
}

.social-comments-backdrop.is-closing .social-comments-panel {
  animation: social-comments-exit 220ms cubic-bezier(.4, 0, 1, 1) both;
}

.social-comments-panel-head.diet-card-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  margin: 0;
  padding: 6px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.social-comments-panel-head > div {
  min-width: 0;
  text-align: center;
}

.social-comments-panel-head :is(h2, h3) {
  margin: 0;
  color: #f8f8fa;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
}

.social-comments-panel-head small {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-comments-back,
.social-comment-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  line-height: 1;
}

.social-comments-back {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.025);
  color: #fff;
  padding: 0;
}

.social-comments-back .social-action-icon {
  display: block;
  width: 21px;
  height: 21px;
}

.social-comments-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 10px;
  font-weight: 850;
}

.social-comments-panel-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px max(14px, var(--safe-right)) 24px max(14px, var(--safe-left));
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.social-comments-panel-list::-webkit-scrollbar {
  width: 5px;
}

.social-comments-panel-list::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.18);
}

.social-comments-panel-list .social-comments-list {
  display: grid;
  gap: 0;
  min-height: 100%;
  margin: 0;
}

.social-comments-empty {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 7px;
  width: min(100%, 360px);
  margin: auto;
  padding: 32px 20px;
  color: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.social-comments-empty .social-action-icon {
  width: 30px;
  height: 30px;
  margin-bottom: 5px;
  color: #ff4750;
}

.social-comments-empty strong {
  color: #f5f5f7;
  font-size: 15px;
  line-height: 1.3;
}

.social-comments-empty span {
  font-size: 13px;
  line-height: 1.45;
}

.social-comment-thread {
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.social-comment-thread.reply {
  margin-left: clamp(28px, 8vw, 46px);
  padding: 9px 0 0;
  border-bottom: 0;
}

.social-comment-replies {
  display: grid;
  gap: 0;
  margin-top: 4px;
}

.social-comment-replies .social-comment-replies {
  margin-left: 0;
}

.social-comment {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 44px;
  align-items: start;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.social-comment-avatar,
.social-comment-composer-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  aspect-ratio: 1;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgba(225, 27, 34, 0.58);
  border-radius: 50%;
  background: #15171b;
  color: #fff;
  padding: 0;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.social-comment-avatar img,
.social-comment-composer-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.social-comment-avatar span,
.social-comment-composer-avatar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-comment-main {
  display: block;
  min-width: 0;
  padding-top: 1px;
  font-size: 14px;
}

.social-comment-author {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.social-comment-author strong {
  overflow: hidden;
  color: #f5f5f7;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-comment-author time {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  line-height: 1.2;
}

.social-comment-main p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.social-comment-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
}

.social-comment-tools small,
.social-comment-tools button {
  margin: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  padding: 0;
  font-size: 11px;
  font-weight: 800;
}

.social-comment-tools button {
  min-height: 32px;
  color: rgba(255, 255, 255, 0.62);
}

.social-comment-like {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.56);
  padding: 0;
}

.social-comment-like .social-action-icon {
  display: block;
  width: 17px;
  height: 17px;
}

.social-comment-like.active {
  color: var(--red);
}

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

.social-comment-form-floating {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px max(12px, var(--safe-right)) calc(10px + var(--safe-bottom)) max(12px, var(--safe-left));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 13, 16, 0.96);
  backdrop-filter: blur(14px);
}

.social-comment-form-floating input,
.social-reply-form input {
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.1);
  background: #14171b;
  font-size: 16px;
  font-weight: 650;
}

.social-comment-form-floating button,
.social-reply-form button {
  min-width: 64px;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: #ff4750;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 900;
}

@keyframes social-comments-enter {
  from { transform: translateY(100%); opacity: 0.72; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes social-comments-exit {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100%); opacity: 0.74; }
}

@media (max-width: 359px) {
  .social-comments-panel-head.diet-card-head {
    grid-template-columns: 40px minmax(0, 1fr) 30px;
    gap: 6px;
    padding-inline: 8px;
  }

  .social-comments-back {
    width: 40px;
    height: 40px;
  }

  .social-comments-panel-list {
    padding-inline: 10px;
  }

  .social-comment {
    grid-template-columns: 36px minmax(0, 1fr) 40px;
    gap: 8px;
  }

  .social-comment-avatar,
  .social-comment-composer-avatar {
    width: 36px;
    height: 36px;
  }

  .social-comment-form-floating {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 6px;
    padding-inline: 8px;
  }

  .social-comment-form-floating button,
  .social-reply-form button {
    min-width: 54px;
    padding-inline: 2px;
  }
}

@media (min-width: 700px) and (max-width: 1023px) {
  .social-comments-backdrop.diet-floating {
    background: #050608;
  }

  .social-comments-panel.diet-floating-panel {
    width: min(100%, 720px);
    max-width: 720px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
  }

  .social-comments-panel-list {
    padding-inline: 24px;
  }

  .social-comment-form-floating {
    padding-inline: 22px;
  }
}

@media (min-width: 1024px) {
  .social-comments-backdrop.diet-floating {
    place-items: stretch end;
    justify-content: end;
    background: rgba(5, 6, 8, 0.66);
    backdrop-filter: blur(4px);
  }

  .social-comments-panel.diet-floating-panel {
    width: clamp(440px, 36vw, 560px);
    max-width: 560px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -22px 0 60px rgba(0, 0, 0, 0.34);
    animation-name: social-comments-enter-desktop;
  }

  .social-comments-backdrop.is-closing .social-comments-panel {
    animation-name: social-comments-exit-desktop;
  }

  .social-comments-panel-head.diet-card-head {
    min-height: 66px;
    padding-inline: 18px;
  }

  .social-comments-panel-list {
    padding: 14px 22px 32px;
  }

  .social-comment-form-floating {
    padding-inline: 20px;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .social-comments-panel-head.diet-card-head {
    min-height: 52px;
    padding-block: 4px 6px;
  }

  .social-comments-back {
    width: 40px;
    height: 40px;
  }

  .social-comments-panel-list {
    padding-block: 6px 14px;
  }

  .social-comment-thread {
    padding-block: 9px;
  }

  .social-comment-form-floating {
    padding-block: 7px calc(7px + var(--safe-bottom));
  }
}

@keyframes social-comments-enter-desktop {
  from { transform: translateX(100%); opacity: 0.78; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes social-comments-exit-desktop {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0.78; }
}

html.social-comments-active,
html.social-comments-active body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

@media (prefers-reduced-motion: reduce) {
  .social-comments-panel.diet-floating-panel,
  .social-comments-backdrop.is-closing .social-comments-panel {
    animation-duration: 1ms;
  }
}
/* RatLab social feed system */
.social-feed {
  gap: 12px;
}

.social-post {
  --social-accent: #ff3642;
  border-color: rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: #0c0e11;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.social-post--diet { --social-accent: #37c985; }
.social-post--progress { --social-accent: #b47cff; }
.social-post--pr { --social-accent: #f2bd4c; }
.social-post--challenge { --social-accent: #ff6d3d; }
.social-post--lifestyle { --social-accent: #57c9e8; }

.social-post .social-post-head,
.social-reel-overlay .social-post-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 11px;
}

.social-post .social-avatar,
.social-reel-overlay .social-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  aspect-ratio: 1;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--social-accent) 76%, transparent);
  background: #15171b;
  padding: 0;
  line-height: 1;
}

.social-post .social-avatar img,
.social-reel-overlay .social-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.social-post .social-avatar > span,
.social-reel-overlay .social-avatar > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.social-post-author {
  min-width: 0;
}
.social-post-author-line{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;min-width:0}
.social-post-author-line>strong{min-width:0;max-width:100%}
.social-post-header-time{font-size:10px;line-height:1.3;color:var(--muted,#a7abb2);white-space:nowrap}

.social-post .social-post-author strong,
.social-reel-overlay .social-post-author strong {
  display: block;
  overflow: hidden;
  color: #f4f5f7;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-post .social-post-author small,
.social-reel-overlay .social-post-author small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-post-kind {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--social-accent) 38%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--social-accent) 8%, transparent);
  color: color-mix(in srgb, var(--social-accent) 82%, #fff);
  padding: 0 9px;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.social-post .social-post-manage,
.social-reel-overlay .social-post-manage {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  padding: 9px;
}

.social-post .social-post-manage .control-icon,
.social-reel-overlay .social-post-manage .control-icon {
  display: block;
  width: 18px;
  height: 18px;
}

.social-post-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #050607;
}

.social-media-frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050607;
}

.social-media-frame img,
.social-media-frame video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.social-media-play {
  position: absolute;
  inset: 50% auto auto 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(8, 9, 11, 0.76);
  color: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.social-media-play svg {
  display: block;
  width: 25px;
  height: 25px;
  margin-left: 2px;
}

.social-performance-cover {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  background: #090b0e;
  color: #f8f8f9;
  padding: 24px;
}

.social-performance-cover::before,
.social-performance-cover::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.social-performance-cover::before {
  top: 24px;
  right: 24px;
  width: 46px;
  height: 1px;
  background: var(--social-accent);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--social-accent) 42%, transparent);
}

.social-performance-cover::after {
  right: -42px;
  bottom: -42px;
  width: 144px;
  height: 144px;
  border: 1px solid color-mix(in srgb, var(--social-accent) 24%, transparent);
  border-radius: 50%;
}

.social-performance-brand {
  position: relative;
  z-index: 1;
  color: var(--social-accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.social-performance-cover > div {
  position: relative;
  z-index: 1;
}

.social-performance-cover small {
  display: block;
  margin-bottom: 8px;
  color: color-mix(in srgb, var(--social-accent) 82%, #fff);
  font-size: 10px;
  font-weight: 900;
}

.social-performance-cover strong {
  display: block;
  max-width: 13ch;
  font-size: clamp(34px, 11vw, 52px);
  font-weight: 950;
  line-height: 0.98;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.social-performance-cover p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.social-performance-cover .social-performance-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.social-performance-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  padding: 0 10px;
  font-size: 9px;
  font-weight: 850;
}

.social-post-media-expand {
  top: 12px;
  right: 12px;
  bottom: auto;
  width: 32px;
  height: 32px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(6, 7, 9, 0.68);
}

.social-post-actions {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  padding: 5px 8px 0;
}

.social-post-actions button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  justify-self: auto;
  border: 0;
  background: transparent;
  padding: 10px;
  overflow: visible;
}

.social-post-actions button:hover,
.social-post-actions button:focus-visible {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.055);
}

.social-post-actions button.active {
  border-color: transparent;
  background: transparent;
  color: #ff3946;
}

.social-post-actions [data-social-save] {
  margin-left: auto;
}

.social-post-actions .social-action-icon {
  width: 23px;
  height: 23px;
  flex-basis: 23px;
}

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

.social-post-likes {
  display: block;
  margin: 2px 0 0;
  color: #f5f5f6;
  font-size: 11px;
  font-weight: 900;
}

.social-post-caption {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.45;
}

.social-post-caption strong {
  display: inline;
  margin: 0;
  color: #f6f6f7;
  font-size: inherit;
  font-weight: 900;
}

.social-post-caption span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.social-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  margin-top: 5px;
}

.social-post-tags button {
  min-inline-size: 0;
  padding: 0;
  color: color-mix(in srgb, var(--social-accent) 72%, #dfe6ef);
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
  text-align: left;
}

.social-post-tags button:hover,
.social-post-tags button:focus-visible {
  color: var(--social-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.social-comments-count {
  min-height: 32px;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 11px;
  font-weight: 700;
}

.social-post-time {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.32);
  font-size: 9px;
  line-height: 1.3;
}

.social-post-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  padding-top: 10px;
}

.social-post-context > div:first-child {
  min-width: 0;
}

.social-post-context small {
  display: block;
  margin: 0 0 2px;
  color: color-mix(in srgb, var(--social-accent) 76%, #fff);
  font-size: 8px;
  font-weight: 900;
  line-height: 1.2;
}

.social-post-context strong {
  display: block;
  overflow: hidden;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-post-context-metrics {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 5px;
}

.social-post-context-metrics span {
  color: rgba(255, 255, 255, 0.54);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.social-post-context-metrics span + span::before {
  content: "·";
  margin-right: 5px;
  color: rgba(255, 255, 255, 0.22);
}

.social-reel-media .social-media-frame,
.social-reel-media .social-performance-cover {
  width: 100%;
  height: 100%;
}

.social-reel-media .social-media-frame img,
.social-reel-media .social-media-frame video {
  object-fit: contain;
}

.social-reel-overlay .social-post-head {
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  top: 10px;
  right: 10px;
  left: 62px;
  padding: 0;
}

.social-reel-overlay .social-post-kind {
  background: rgba(5, 6, 8, 0.52);
}

.social-reel-copy h2 {
  max-width: 18ch;
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 8vw, 38px);
  font-weight: 950;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.72);
}

.social-reel-copy p {
  max-width: 38ch;
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.4;
}

.social-reel-overlay .social-post-context {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.social-reel-footer time {
  flex-basis: 100%;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
}

html[data-theme="light"] .social-post {
  border-color: #cec7bf;
  background: #f2eee9;
  box-shadow: 0 14px 32px rgba(52, 43, 35, 0.08);
}

html[data-theme="light"] .social-post .social-post-author strong,
html[data-theme="light"] .social-post-likes,
html[data-theme="light"] .social-post-caption strong,
html[data-theme="light"] .social-post-context strong {
  color: #17191d;
}

html[data-theme="light"] .social-post .social-post-author small,
html[data-theme="light"] .social-comments-count,
html[data-theme="light"] .social-post-time,
html[data-theme="light"] .social-post-context-metrics span {
  color: rgba(23, 25, 29, 0.54);
}

html[data-theme="light"] .social-post-caption {
  color: rgba(23, 25, 29, 0.82);
}

html[data-theme="light"] .social-post-actions button {
  color: #1f2228;
}

html[data-theme="light"] .social-post-actions button.active {
  color: #dc2633;
}

html[data-theme="light"] .social-post-context {
  border-top-color: rgba(23, 25, 29, 0.1);
}

html[data-theme="light"] .social-post-context-metrics span + span::before {
  color: rgba(23, 25, 29, 0.24);
}

@media (max-width: 360px) {
  .social-post .social-post-head {
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    gap: 7px;
    padding-inline: 9px;
  }

  .social-post .social-avatar {
    width: 36px;
    height: 36px;
  }

  .social-post-kind {
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .social-performance-cover {
    padding: 20px;
  }

  .social-post-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .social-media-play,
  .social-post-actions button {
    transition: none;
  }
}

/* Contrato de execução por série: descanso local e RIR. */
.session-set-tools { display:flex; align-items:center; gap:4px; min-width:0; }
.session-set-tool { width:38px; min-width:38px; height:38px; padding:3px; display:inline-flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; border:1px solid var(--border); border-radius:8px; background:#0b0d10; color:var(--muted); line-height:1; }
.session-set-tool .control-icon { width:15px; height:15px; display:block; flex:0 0 auto; }
.session-set-tool small { max-width:32px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:8px; font-weight:800; line-height:1; }
.session-set-tool:hover, .session-set-tool:focus-visible { color:#fff; border-color:rgba(240,31,57,.65); background:rgba(240,31,57,.1); }
.session-set-adjustment-sheet { width:min(380px,calc(100vw - 32px)); }
.session-set-adjustment-sheet p { margin:0 0 14px; color:var(--muted); font-size:12px; line-height:1.45; }
.modal-set-adjustment-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:16px; }
.modal-set-adjustment-actions.has-start { grid-template-columns:repeat(3,minmax(0,1fr)); }
.modal-set-adjustment-actions .session-adjustment-start { border-color:rgba(0,200,255,.5); color:#dff8ff; }
.modal-set-adjustment-actions .session-adjustment-start:hover,
.modal-set-adjustment-actions .session-adjustment-start:focus-visible { border-color:var(--cyan); background:rgba(0,200,255,.1); }
.exercise-modal-set-options { display:flex; align-items:stretch; gap:5px; }
.exercise-modal-set-options label { width:48px; display:grid; gap:3px; }
.exercise-modal-set-options span { color:var(--muted); font-size:8px; font-weight:800; text-transform:uppercase; }
.exercise-modal-set-options input { width:100%; min-width:0; height:34px; padding:0 5px; text-align:center; }
.workout-history-detail-section { margin-top:16px; padding-top:14px; border-top:1px solid var(--border); }
.workout-history-detail-section h4 { margin:0 0 10px; font-size:13px; color:#fff; }
.workout-history-exercise-details { display:grid; gap:10px; }
.workout-history-exercise-details section { padding:10px; border:1px solid var(--border); border-radius:8px; background:#0b0d10; }
.workout-history-exercise-details header { display:flex; justify-content:space-between; gap:8px; margin-bottom:8px; }
.workout-history-exercise-details header span { color:var(--muted); font-size:11px; text-align:right; }
.workout-history-exercise-details section > div { display:flex; flex-wrap:wrap; gap:6px; }
.workout-history-set { display:inline-flex; align-items:center; gap:5px; padding:5px 7px; border-radius:6px; background:#12171c; color:#dfe7ec; font-size:11px; }
.workout-history-set b { color:var(--red); } .workout-history-set em { color:#76e5bf; font-style:normal; } .workout-history-set small { color:var(--muted); }
.workout-history-exercise-details .workout-history-exercise-notes { display:grid; gap:6px; width:100%; margin-top:9px; padding-top:9px; border-top:1px solid var(--border); }
.workout-history-exercise-notes > strong { color:var(--cyan); font-size:9px; text-transform:uppercase; }
.workout-history-exercise-notes article { display:grid; gap:3px; padding:7px 8px; border-radius:6px; background:#11161a; }
.workout-history-exercise-notes p { margin:0; color:#e7ecef; font-size:11px; line-height:1.4; white-space:pre-wrap; }
.workout-history-exercise-notes time { color:var(--muted); font-size:9px; font-weight:800; }
/* Diet header compact action layout: keeps primary copy and controls together on narrow screens. */
@media (max-width: 520px) {
  .diet-header-clean {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }

  .diet-header-clean .diet-title-block {
    min-width: 0;
  }

  .diet-header-clean .diet-header-actions {
    display: flex;
    align-items: stretch;
    align-self: start;
    justify-content: flex-end;
    gap: 6px;
    width: auto;
  }

  .diet-header-clean .diet-header-action-btn {
    width: 48px;
    min-width: 48px;
    min-height: 52px;
    padding: 6px 4px;
    border-radius: 10px;
  }

  .diet-header-clean .diet-header-action-btn span,
  .diet-header-clean .diet-header-action-btn svg {
    width: 21px;
    height: 21px;
    font-size: 21px;
  }

  .diet-header-clean .diet-header-action-btn strong {
    font-size: 8px;
    line-height: 1.1;
  }
}

@media (max-width: 359px) {
  .diet-header-clean {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .diet-header-clean .diet-header-actions {
    justify-content: flex-end;
  }
}

/* Nutrition heading actions: compact, touch-safe icon controls beside the title. */
.diet-header-clean {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 10px;
}

.diet-header-clean .diet-title-block {
  min-width: 0;
}

.diet-header-clean .diet-header-actions {
  display: flex;
  align-items: center;
  align-self: start;
  justify-content: flex-end;
  gap: 6px;
  width: auto;
  min-width: 0;
}

.diet-header-clean .diet-plans-menu-wrap {
  flex: 0 0 44px;
  width: 44px;
}

.diet-header-clean .diet-header-action-btn,
.diet-header-clean .diet-header-actions .pdf-import-trigger-compact {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  aspect-ratio: 1;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(120, 143, 158, 0.34);
  border-radius: 8px;
  color: var(--text);
  background: rgba(12, 16, 20, 0.92);
  box-shadow: none;
  line-height: 1;
}

.diet-header-clean .diet-header-action-btn:hover,
.diet-header-clean .diet-header-action-btn:focus-visible,
.diet-header-clean .diet-header-actions .pdf-import-trigger-compact:hover,
.diet-header-clean .diet-header-actions .pdf-import-trigger-compact:focus-visible {
  border-color: var(--red);
  color: #fff;
  background: rgba(225, 27, 34, 0.12);
}

.diet-header-clean .diet-header-action-btn > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: currentColor;
  line-height: 1;
}

.diet-header-clean .diet-header-action-btn svg,
.diet-header-clean .diet-header-actions .pdf-import-trigger-compact > svg {
  display: block;
  width: 21px;
  height: 21px;
  max-width: 21px;
  max-height: 21px;
  flex: 0 0 21px;
  filter: none;
}

.diet-header-clean .diet-header-action-btn strong,
.diet-header-clean .pdf-import-trigger-compact > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html[data-theme='light'] .diet-header-clean .diet-header-action-btn,
body.theme-light .diet-header-clean .diet-header-action-btn {
  color: #18222b;
  border-color: rgba(31, 52, 66, 0.28);
  background: rgba(255, 255, 255, 0.94);
}
.training-exercise-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.training-exercise-card-head > div {
  min-width: 0;
}

.training-exercise-card .training-exercise-preview {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}

.training-exercise-card .training-exercise-preview svg {
  width: 15px;
  height: 15px;
}
/* Rest adjustment wheel: native vertical selectors keep a precise, touch-friendly time control. */
.session-rest-wheel {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b0d10;
}

.session-rest-wheel legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.session-rest-wheel-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.session-rest-wheel label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.session-rest-wheel label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.session-rest-wheel select {
  width: 100%;
  min-height: 116px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #11151a;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: center;
  scroll-snap-type: y mandatory;
}

.session-rest-wheel select:focus-visible {
  border-color: var(--red);
  outline: 2px solid color-mix(in srgb, var(--red) 38%, transparent);
  outline-offset: 2px;
}

.session-rest-wheel option {
  min-height: 32px;
  padding: 6px;
  scroll-snap-align: center;
}

.session-rest-wheel-separator {
  padding-top: 20px;
  color: var(--red);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.session-rest-wheel > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 359px) {
  .session-rest-wheel {
    padding: 10px;
  }

  .session-rest-wheel-columns {
    gap: 6px;
  }

  .session-rest-wheel select {
    min-height: 108px;
    font-size: 15px;
  }
}

/* Countdown timer wheel: shares the alarm-style selector while staying within the compact timer panel. */
.training-free-timer-panel {
  width: min(292px, calc(100vw - 32px));
}

.training-free-timer-panel .free-timer-wheel {
  margin: 10px 0;
  padding: 10px;
}

.training-free-timer-panel .free-timer-wheel select {
  min-height: 104px;
}

.training-free-timer-panel .free-timer-wheel > small {
  font-size: 10px;
}

/* Session-only exercises are execution snapshots: visually distinct without competing with the workout controls. */
.session-extra-exercise-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px dashed rgba(73, 202, 235, 0.42);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(29, 196, 234, 0.08), rgba(255, 255, 255, 0.025));
}
.session-extra-exercise-card small,
.session-extra-exercise-head small,
.session-only-badge {
  color: #67dffb;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
}
.session-extra-exercise-card strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 14px;
}
.session-extra-exercise-card p,
.session-extra-exercise-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.session-extra-exercise-card .secondary {
  min-height: 42px;
  white-space: nowrap;
}
.session-only-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-top: 6px;
  padding: 0 7px;
  border: 1px solid rgba(73, 202, 235, 0.36);
  border-radius: 999px;
  background: rgba(73, 202, 235, 0.1);
}

.session-exercise-title-line .session-only-badge {
  flex: 0 0 auto;
  min-height: 18px;
  margin: 0;
  padding-inline: 6px;
  white-space: nowrap;
}

.session-substituted-badge {
  order: -1;
}

@media (max-width: 430px) {
  .session-exercise-head {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
  }

  .session-exercise-title-line {
    gap: 5px;
  }

  .session-exercise-title-line .session-only-badge {
    min-height: 17px;
    padding-inline: 5px;
    font-size: 8px;
  }
}
.session-extra-exercise-backdrop {
  position: fixed;
  inset: 0;
  z-index: 94;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(18px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}
.session-extra-exercise-sheet {
  width: min(520px, 100%);
  max-height: min(680px, calc(100vh - 36px - var(--safe-top) - var(--safe-bottom)));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(73, 202, 235, 0.4);
  border-radius: 14px;
  background: #111316;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .62);
}
.session-extra-exercise-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.session-extra-exercise-head h3 {
  margin: 5px 0 0;
  color: #fff;
  font-size: 18px;
  line-height: 1.1;
}
.session-extra-exercise-head .icon-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}
.session-extra-exercise-search {
  margin: 12px 14px 8px;
}
.session-extra-exercise-results {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 14px 14px;
  overflow: auto;
}
.session-extra-exercise-result {
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
}
@media (max-width: 390px) {
  .session-extra-exercise-card { grid-template-columns: 1fr; }
  .session-extra-exercise-card .secondary { width: 100%; }
  .session-extra-exercise-result { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .session-extra-exercise-result > button:first-of-type { display: none; }
}
/* Session execution substitutions remain auditable without mutating the prescribed workout. */
.session-replace-exercise-button {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  border: 1px dashed rgba(103, 223, 251, .34);
  border-radius: 10px;
  background: rgba(73, 202, 235, .055);
  color: #b9eef9;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}
.session-replace-exercise-button:hover,
.session-replace-exercise-button:focus-visible {
  border-color: rgba(103, 223, 251, .72);
  background: rgba(73, 202, 235, .12);
  color: #fff;
}
.chat-relationship-tag{display:inline-flex;align-items:center;min-height:16px;margin-left:6px;padding:0 5px;border:1px solid rgba(76,210,240,.45);border-radius:4px;background:rgba(24,87,103,.24);color:#83e9ff;font-size:8px;font-style:normal;font-weight:800;line-height:1;letter-spacing:0;vertical-align:middle;white-space:nowrap}

/* Refeicao concluida: estado compacto, reversivel e consistente com o registro diario. */
.diet-meal-card-compact.is-completed {
  border-left-color: #28c980;
  border-color: rgba(40, 201, 128, 0.34);
  background: linear-gradient(135deg, rgba(40, 201, 128, 0.09), rgba(255, 255, 255, 0.018));
}

.diet-meal-status.is-completed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-color: rgba(40, 201, 128, 0.42);
  color: #70e7ad;
  background: rgba(40, 201, 128, 0.12);
}

.diet-meal-status.is-completed i,
.diet-meal-completed-check {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 16px;
  border-radius: 50%;
  background: #28c980;
}

.diet-meal-status.is-completed i::after,
.diet-meal-completed-check::after {
  content: "";
  width: 6px;
  height: 3px;
  border: solid #07130d;
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}

.diet-meal-card-compact.is-completed .diet-option-list {
  margin-bottom: 0;
}

.diet-meal-card-compact.is-completed .diet-option-consume {
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: rgba(40, 201, 128, 0.28);
  background: rgba(40, 201, 128, 0.07);
}

.diet-option-consume .diet-meal-undo,
.diet-meal-completed-summary .diet-meal-undo {
  min-height: 34px;
  padding: 0 10px;
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}

.diet-option-consume .diet-meal-undo:hover,
.diet-meal-completed-summary .diet-meal-undo:hover {
  border-color: rgba(225, 27, 34, 0.55);
  color: #fff;
  background: rgba(225, 27, 34, 0.09);
}

.diet-meal-completed-summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(40, 201, 128, 0.28);
  border-radius: 8px;
  background: rgba(40, 201, 128, 0.07);
}

.diet-meal-completed-summary strong,
.diet-meal-completed-summary small {
  display: block;
}

.diet-meal-completed-summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

html[data-theme="light"] .diet-meal-card-compact.is-completed {
  background: #edf9f3;
  border-color: #8bcfaf;
}

html[data-theme="light"] .diet-meal-card-compact.is-completed .diet-option-consume,
html[data-theme="light"] .diet-meal-completed-summary {
  background: #f6fcf9;
  border-color: #a9dbc3;
}

@media (max-width: 360px) {
  .diet-meal-completed-summary {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .diet-meal-completed-summary .diet-meal-undo {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 720px) { .home-quick-add { left: auto; right: max(14px, calc(14px + var(--safe-right))); bottom: calc(var(--bottom-nav-total) + 12px); } }

@media (max-width: 720px) { .screen { padding-top: max(12px, calc(12px + var(--safe-top))); padding-bottom: calc(var(--bottom-nav-total) + 30px); scroll-padding-top: calc(64px + var(--safe-top)); scroll-padding-bottom: calc(var(--bottom-nav-total) + 18px); } }

.training-flow .exercise-catalog-line > .exercise-type-icon { align-self: center; justify-self: center; }

/* Edição compacta: métricas, descanso e RIR compartilham altura e eixo vertical. */
.exercise-modal-set-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 112px);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.exercise-modal-set-body .exercise-modal-set-fields {
  gap: 6px;
}

.exercise-modal-set-body .exercise-modal-set-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(44px, 1fr));
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.exercise-modal-set-body .exercise-modal-set-options label {
  width: auto;
  min-width: 0;
  height: 38px;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  align-items: center;
  gap: 2px;
  padding: 0 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #080808;
  box-sizing: border-box;
}

.exercise-modal-set-body .exercise-modal-set-options .exercise-modal-option-icon {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.exercise-modal-set-body .exercise-modal-set-options .exercise-modal-option-icon svg {
  display: block;
  width: 15px;
  height: 15px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.exercise-modal-set-body .exercise-modal-set-options input {
  width: 100%;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.exercise-modal-set-body .exercise-modal-set-options label:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(225, 27, 34, .12);
}

@media (max-width: 430px) {
  .exercise-modal-set-row {
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    gap: 5px;
  }

  .exercise-modal-set-row .set-type-letter {
    width: 38px;
    height: 38px;
  }

  .exercise-modal-set-row .trash-set {
    width: 34px;
    min-width: 34px;
  }

  .exercise-modal-set-body {
    grid-template-columns: minmax(0, 1fr) minmax(88px, 96px);
    gap: 4px;
  }

  .exercise-modal-set-body .exercise-modal-set-fields,
  .exercise-modal-set-body .exercise-modal-set-options {
    gap: 4px;
  }

  .exercise-modal-set-body .exercise-modal-set-options {
    grid-template-columns: repeat(2, minmax(42px, 1fr));
  }

  .exercise-modal-set-body .exercise-modal-set-options label {
    grid-template-columns: 14px minmax(0, 1fr);
    padding-inline: 2px;
  }

  .exercise-modal-set-body .exercise-modal-set-options .exercise-modal-option-icon,
  .exercise-modal-set-body .exercise-modal-set-options .exercise-modal-option-icon svg {
    width: 14px;
    height: 14px;
  }
}

/* Editor de exercícios sequenciais: cartões não devem distribuir altura vazia. */
.block-exercise-tabs {
  align-items: flex-start;
}

.block-exercise-config {
  align-self: flex-start;
  align-content: start;
  min-height: 0;
  box-sizing: border-box;
}

@media (max-width: 520px) {
  .training-block-exercises-section {
    padding: 10px;
    overflow: hidden;
  }

  .training-block-head.compact {
    align-items: flex-start;
    gap: 8px;
  }

  .training-block-head.compact > div {
    min-width: 0;
  }

  .training-block-head.compact span {
    flex: 0 0 auto;
    padding-inline: 8px;
  }

  .strategy-scroll.block-exercise-tabs {
    gap: 8px;
    padding: 2px 1px 10px;
    scroll-padding-inline: 1px;
  }

  .block-exercise-config {
    flex: 0 0 calc(100vw - 52px);
    min-width: calc(100vw - 52px);
    max-width: calc(100vw - 52px);
    padding: 12px;
    gap: 10px;
  }

  .block-exercise-config-head {
    margin-bottom: 0;
  }

  .block-exercise-config-head > div {
    min-width: 0;
  }

  .block-exercise-config-head strong,
  .block-exercise-config-head small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .block-exercise-fields {
    gap: 7px;
  }

  .block-exercise-fields label {
    min-width: 0;
  }

  .block-slot-sets {
    margin-top: 8px;
    padding-top: 8px;
  }

  .block-slot-sets-head {
    align-items: flex-start;
  }

  .block-slot-sets-head small {
    max-width: 46%;
    text-align: right;
    line-height: 1.25;
  }

  .block-slot-set-row {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: end;
    gap: 7px;
  }

  .block-slot-set-fields {
    gap: 6px;
  }
}

@media (max-width: 360px) {
  .block-exercise-config {
    flex-basis: calc(100vw - 40px);
    min-width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    padding: 10px;
  }

  .block-exercise-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .block-exercise-fields .wide {
    grid-column: auto;
  }
}
/* Ações da dieta: três células ópticas idênticas, estáveis desde o primeiro frame. */
.diet-header-clean {
  --diet-header-action-size: 44px;
}

.diet-header-clean .diet-header-actions {
  display: grid;
  grid-template-columns: repeat(3, var(--diet-header-action-size));
  grid-auto-flow: column;
  align-items: center;
  justify-content: end;
  gap: 6px;
}

.diet-header-clean .diet-header-actions > .diet-plans-menu-wrap,
.diet-header-clean .diet-header-actions > .diet-header-action-btn {
  box-sizing: border-box;
  width: var(--diet-header-action-size);
  height: var(--diet-header-action-size);
  min-width: var(--diet-header-action-size);
  min-height: var(--diet-header-action-size);
  aspect-ratio: 1 / 1;
}

.diet-header-clean .diet-header-actions > .diet-plans-menu-wrap {
  display: grid;
  place-items: stretch;
}

.diet-header-clean .diet-header-action-btn,
.diet-header-clean .diet-plans-menu-btn {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  gap: 0;
  border-radius: 10px;
  line-height: 1;
}

.diet-header-clean .diet-header-actions > .diet-plans-menu-wrap > .diet-plans-menu-btn {
  box-sizing: border-box;
  align-self: center;
  width: var(--diet-header-action-size);
  height: var(--diet-header-action-size);
  min-width: var(--diet-header-action-size);
  min-height: var(--diet-header-action-size);
  max-width: var(--diet-header-action-size);
  max-height: var(--diet-header-action-size);
  padding: 0;
}

.diet-header-clean .diet-header-action-btn span,
.diet-header-clean .diet-header-action-btn svg,
.diet-header-clean .diet-plans-menu-btn svg {
  display: block;
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  flex: 0 0 20px;
}

.diet-header-clean .diet-header-action-btn strong {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 360px) {
  .diet-header-clean {
    column-gap: 7px;
  }

  .diet-header-clean .diet-header-actions {
    gap: 4px;
  }
}
/* Story próprio: uma única bolinha com abertura e criação em alvos independentes. */
.social-story--own {
  position: relative;
  width: 76px;
  grid-template-columns: 76px;
  grid-template-rows: 62px auto;
  justify-items: center;
  gap: 6px;
}

.social-story--own .social-story-main {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
}

.social-story--own .social-story-main > .social-story-thumb {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--red);
  border-radius: 50%;
  background: var(--panel);
  position: relative;
  isolation: isolate;
}

.social-story--own .social-story-main > .social-story-thumb .social-story-thumb-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 180ms cubic-bezier(.16, 1, .3, 1);
}

.social-story--own .social-story-main > .social-story-thumb.is-loaded .social-story-thumb-image {
  opacity: 1;
}

.social-story--own .social-story-thumb-loader {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  background: color-mix(in srgb, var(--panel) 82%, var(--border));
  opacity: 1;
  transition: opacity 140ms ease-out, visibility 140ms ease-out;
}

.social-story--own .social-story-thumb-loader::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 28%, rgba(255, 255, 255, .13) 46%, rgba(225, 27, 34, .2) 54%, transparent 72%);
  transform: translateX(-115%);
  animation: social-own-story-loading 1.15s cubic-bezier(.45, 0, .55, 1) infinite;
}

.social-story--own .social-story-main > .social-story-thumb.is-loaded .social-story-thumb-loader {
  visibility: hidden;
  opacity: 0;
}

.social-story--own .social-story-main > .social-story-thumb.is-error .social-story-thumb-image {
  display: none;
}

@keyframes social-own-story-loading {
  to { transform: translateX(115%); }
}

.social-story--own .social-story-main > .social-story-thumb > :is(img, span) {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  box-shadow: none;
}

.social-story--own > small {
  width: 76px;
  justify-self: center;
  text-align: center;
}

.social-story--own.seen .social-story-main > .social-story-thumb {
  border-color: #444;
}

.social-story--own .social-story-add {
  position: absolute;
  right: 0;
  top: 42px;
  z-index: 2;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid #090909;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(225, 27, 34, .34);
  line-height: 1;
}

.social-story--own .social-story-add > span {
  width: auto;
  height: auto;
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  font-size: 17px;
  font-weight: 900;
  line-height: 16px;
}

.social-story--own .social-story-main:active,
.social-story--own .social-story-add:active {
  transform: scale(.94);
}

@media (prefers-reduced-motion: reduce) {
  .social-story--own .social-story-thumb-loader::after {
    animation: none;
    opacity: .35;
    transform: none;
  }

  .social-story--own .social-story-main > .social-story-thumb .social-story-thumb-image,
  .social-story--own .social-story-thumb-loader {
    transition: none;
  }
}
/* Séries avançadas: o formulário mostra apenas um resumo e delega detalhes à caixa bloqueante. */
.exercise-sequence-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 2px;
  padding: 8px 9px;
  border: 1px solid rgba(192, 132, 252, .32);
  border-radius: 9px;
  background: rgba(192, 132, 252, .055);
}
.exercise-sequence-summary-copy { min-width: 0; display: grid; gap: 3px; }
.exercise-sequence-summary-copy strong { overflow: hidden; color: #d8b4fe; font-size: 10px; font-weight: 900; line-height: 1.15; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.exercise-sequence-summary-copy span { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.exercise-sequence-summary-open { width: 38px; height: 38px; min-width: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(192,132,252,.52); border-radius: 9px; background: #110d18; color: #d8b4fe; line-height: 1; }
.exercise-sequence-summary-open .control-icon { width: 17px; height: 17px; }
.exercise-sequence-editor-backdrop { z-index: 270; }
.exercise-sequence-editor-sheet { width: min(440px, calc(100vw - 32px)); max-height: min(660px, calc(100dvh - 32px)); padding: 16px; overflow: auto; }
.exercise-sequence-editor-head { align-items: flex-start; }
.exercise-sequence-editor-head > div { min-width: 0; display: grid; gap: 4px; }
.exercise-sequence-editor-head small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.exercise-sequence-editor-body { display: grid; gap: 12px; min-width: 0; }
.exercise-sequence-editor-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.exercise-sequence-editor-controls label { display: grid; gap: 5px; min-width: 0; }
.exercise-sequence-editor-controls span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .25px; text-transform: uppercase; }
.exercise-sequence-editor-controls input { width: 100%; min-width: 0; height: 38px; padding: 0 9px; box-sizing: border-box; text-align: center; }
.exercise-sequence-editor-body.is-cluster .exercise-sequence-editor-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.exercise-sequence-editor-rows { padding-top: 2px; }
.exercise-sequence-editor-rows .seq-row { min-height: 38px; }
.exercise-sequence-editor-rows .seq-tag, .exercise-sequence-editor-rows .seq-in, .exercise-sequence-editor-rows .seq-del { height: 38px; }
.exercise-sequence-editor-rows .seq-tag { width: 30px; }
.exercise-sequence-editor-rows .seq-del { width: 34px; }
@media (max-width: 390px) {
  .exercise-sequence-editor-sheet { width: calc(100vw - 24px); padding: 13px; }
  .exercise-sequence-editor-body.is-cluster .exercise-sequence-editor-controls { grid-template-columns: 1fr 1fr; }
  .exercise-sequence-editor-body.is-cluster .exercise-sequence-editor-controls label:first-child { grid-column: 1 / -1; }
  .exercise-sequence-editor-rows .seq-row { gap: 4px; }
  .exercise-sequence-editor-rows .seq-tag { width: 27px; }
  .exercise-sequence-editor-rows .seq-del { width: 30px; }
}


/* RatLab fullscreen social reel carousel */
.social-reel-screen {
  position: fixed;
  inset: 0;
  z-index: 170;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: #050608;
}
.social-reel-track {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.social-reel-track::-webkit-scrollbar { display: none; }
.social-reel-track > .social-reel-post {
  flex: 0 0 100%;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.social-reel-screen .social-reel-back {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  z-index: 178;
}
.social-reel-screen .social-reel-overlay {
  padding-top: calc(66px + env(safe-area-inset-top, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  padding-left: max(14px, env(safe-area-inset-left, 0px));
}
.social-reel-screen .social-reel-overlay header {
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  left: calc(64px + env(safe-area-inset-left, 0px));
}
.social-reel-swipe-hint {
  position: fixed;
  right: max(10px, env(safe-area-inset-right, 0px));
  bottom: calc(50% - 26px);
  z-index: 176;
  writing-mode: vertical-rl;
  color: rgba(255,255,255,.48);
  font: 800 9px/1 var(--font-mono, monospace);
  text-transform: uppercase;
  letter-spacing: 0;
  pointer-events: none;
  opacity: 1;
  transition: opacity 180ms ease;
}
.social-reel-screen.has-scrolled .social-reel-swipe-hint { opacity: 0; }
@media (min-width: 760px) {
  .social-reel-track > .social-reel-post { max-width: min(680px, 100vw); margin-inline: calc((100vw - min(680px, 100vw)) / 2); }
}
@media (prefers-reduced-motion: reduce) {
  .social-reel-track { scroll-behavior: auto; }
  .social-reel-swipe-hint { transition: none; }
}

/* Active-set execution bar: one structural grid, with a controlled narrow fallback. */
.session-set-list,
.session-block-set-list {
  display: grid;
  gap: 9px;
}

.training-set-row,
.session-block-set-list .training-set-row {
  --set-control-size: 42px;
  --set-row-gap: 6px;
  display: grid;
  grid-template-columns: 34px minmax(148px, 220px) repeat(4, var(--set-control-size));
  grid-template-areas: "type metrics rest reserve done delete";
  align-items: end;
  justify-content: start;
  gap: var(--set-row-gap);
  min-width: 0;
  max-width: 100%;
  padding: 8px;
  border-radius: 10px;
  overflow: visible;
}

.training-set-row.is-time-series,
.session-block-set-list .training-set-row.is-time-series {
  grid-template-columns: 34px minmax(148px, 220px) repeat(3, var(--set-control-size));
  grid-template-areas: "type metrics rest done delete";
}

.training-set-row .type-chip {
  grid-area: type;
  align-self: end;
  width: 34px;
  min-width: 34px;
  height: var(--set-control-size);
  min-height: var(--set-control-size);
  border-radius: 8px;
}

.training-set-row .session-metric-grid {
  grid-area: metrics;
  display: grid;
  grid-template-columns: minmax(calc(4ch + 20px), 7rem) minmax(calc(3ch + 20px), 5.25rem);
  align-items: end;
  gap: var(--set-row-gap);
  min-width: 0;
}

.training-set-row .session-metric-grid.time,
.training-set-row .session-metric-grid.distance,
.training-set-row .session-metric-grid.steps {
  grid-template-columns: minmax(calc(4ch + 20px), 7rem);
}

.training-set-row .session-metric-grid.treadmill {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.training-set-row .session-metric-field {
  display: grid;
  grid-template-rows: 11px var(--set-control-size);
  align-content: end;
  gap: 4px;
  min-width: 0;
}

.training-set-row .session-metric-field > span {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  line-height: 11px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.training-set-row .session-metric-field input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: var(--set-control-size);
  min-height: var(--set-control-size);
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #090b0d;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.training-set-row .session-metric-field input::placeholder,
.training-set-row .session-metric-field input.is-reference-value {
  color: rgba(194, 207, 214, .48);
  opacity: 1;
}

.training-set-row .session-metric-field input:focus {
  border-color: rgba(240, 31, 57, .78);
  outline: 0;
  box-shadow: 0 0 0 2px rgba(240, 31, 57, .14);
}

.training-set-row .session-metric-field input:disabled {
  cursor: not-allowed;
  opacity: .56;
}

.training-set-row .session-time-trigger {
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 2px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: var(--set-control-size);
  min-height: var(--set-control-size);
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #090b0d;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

.training-set-row .session-time-trigger strong {
  color: inherit;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.training-set-row .session-time-trigger small {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-set-row .session-time-trigger:hover,
.training-set-row .session-time-trigger:focus-visible,
.training-set-row .session-time-trigger.is-bound {
  border-color: rgba(167, 139, 250, .8);
  background: rgba(167, 139, 250, .08);
  outline: 0;
}

.training-set-row .session-time-trigger:focus-visible {
  box-shadow: 0 0 0 2px rgba(167, 139, 250, .16);
}

.training-set-row .session-time-trigger:active {
  background: rgba(167, 139, 250, .14);
}

.training-set-row .session-time-trigger.is-complete {
  border-color: rgba(50, 216, 132, .46);
  color: #78efad;
}

.training-set-row .session-time-trigger.is-complete small {
  color: rgba(120, 239, 173, .72);
}

.training-set-row .session-set-tools {
  display: contents;
}

.training-set-row .session-set-tool {
  align-self: end;
  width: var(--set-control-size);
  min-width: var(--set-control-size);
  height: var(--set-control-size);
  min-height: var(--set-control-size);
  padding: 3px;
  border-radius: 8px;
  text-align: center;
}

.training-set-row .session-set-tool::before { content: none; }
.training-set-row .session-set-tool--rest { grid-area: rest; }
.training-set-row .session-set-tool--rir { grid-area: reserve; }
.training-set-row .session-set-tool .control-icon { width: 15px; height: 15px; }
.training-set-row .session-set-tool--rest small {
  display: block;
  max-width: calc(var(--set-control-size) - 6px);
  overflow: hidden;
  color: #e8f4f7;
  font-size: 8px;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.training-set-row .session-set-tool--rir small { display: none; }

.training-set-row .check-chip,
.training-set-row .trash-session-set {
  align-self: end;
  width: var(--set-control-size);
  min-width: var(--set-control-size);
  height: var(--set-control-size);
  min-height: var(--set-control-size);
  padding: 0;
  border-radius: 50%;
}

.training-set-row .check-chip { grid-area: done; }
.training-set-row .trash-session-set { grid-area: delete; }
.training-set-row .check-chip .session-set-action-visual,
.training-set-row .trash-session-set .session-set-action-visual {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.training-set-row .session-set-check-icon,
.training-set-row .trash-session-set .control-icon {
  width: 16px;
  height: 16px;
  transform: none;
}
.training-set-row .check-chip:active .session-set-action-visual,
.training-set-row .trash-session-set:active .session-set-action-visual {
  transform: scale(.96);
}
.training-set-row > .seq-editor.session { grid-column: 1 / -1; }

/* Séries avançadas: histórico agregado no topo e controles completos por bloco. */
.training-set-row .session-sequence-history {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr);
  gap: var(--set-row-gap);
  min-width: 0;
}

.training-set-row .session-sequence-history > span {
  display: grid;
  grid-template-rows: 11px var(--set-control-size);
  gap: 4px;
  min-width: 0;
}

.training-set-row .session-sequence-history small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  line-height: 11px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.training-set-row .session-sequence-history strong {
  display: grid;
  place-items: center;
  min-width: 0;
  height: var(--set-control-size);
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #090b0d;
  color: rgba(194, 207, 214, .48);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.training-set-row > .seq-editor.session {
  gap: 8px;
  margin-top: 3px;
  padding: 9px;
}

.training-set-row .seq-editor.session .seq-rows {
  gap: 7px;
}

.training-set-row .seq-editor.session .seq-row {
  display: grid;
  grid-template-columns: 28px minmax(58px, 1fr) minmax(50px, .78fr) 42px 32px;
  align-items: end;
  gap: 5px;
  min-width: 0;
}

.training-set-row .seq-editor.session .seq-tag {
  align-self: end;
  width: 28px;
  height: 40px;
}

.training-set-row .seq-editor.session .seq-field {
  display: grid;
  grid-template-rows: 10px 40px;
  gap: 3px;
  min-width: 0;
}

.training-set-row .seq-editor.session .seq-field > span:first-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  font-weight: 900;
  line-height: 10px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.training-set-row .seq-editor.session .seq-in {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding-inline: 5px;
  font-size: 12px;
  font-weight: 900;
}

.training-set-row .seq-editor.session .seq-rest-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 42px;
  min-width: 42px;
  height: 40px;
  padding: 0 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b0d10;
  color: var(--muted);
}

.training-set-row .seq-editor.session .seq-rest-trigger .control-icon {
  width: 14px;
  height: 14px;
}

.training-set-row .seq-editor.session .seq-rest-trigger small {
  color: #e8f4f7;
  font-size: 7px;
  font-weight: 850;
  line-height: 1;
}

.training-set-row .seq-editor.session .seq-rest-trigger:hover,
.training-set-row .seq-editor.session .seq-rest-trigger:focus-visible {
  border-color: rgba(240, 31, 57, .65);
  color: #fff;
  outline: 0;
}

.training-set-row .seq-editor.session .seq-del {
  align-self: end;
  width: 32px;
  height: 40px;
}

@media (max-width: 360px) {
  .training-set-row .seq-editor.session {
    padding-inline: 7px;
  }

  .training-set-row .seq-editor.session .seq-row {
    grid-template-columns: 26px minmax(52px, 1fr) minmax(46px, .74fr) 40px 30px;
    gap: 4px;
  }

  .training-set-row .seq-editor.session .seq-tag {
    width: 26px;
  }

  .training-set-row .seq-editor.session .seq-rest-trigger {
    width: 40px;
    min-width: 40px;
  }

  .training-set-row .seq-editor.session .seq-del {
    width: 30px;
  }
}

@media (max-width: 520px) {
  .training-set-row,
  .session-block-set-list .training-set-row {
    --set-control-size: 40px;
    --set-row-gap: 4px;
    grid-template-columns: 30px minmax(0, 1fr) repeat(4, var(--set-control-size));
    padding: 7px;
  }

  .training-set-row .type-chip {
    width: 30px;
    min-width: 30px;
  }

  .training-set-row.is-time-series,
  .session-block-set-list .training-set-row.is-time-series {
    grid-template-columns: 30px minmax(0, 1fr) repeat(3, var(--set-control-size));
  }

  .training-set-row .session-metric-grid {
    grid-template-columns: minmax(calc(4ch + 16px), 1fr) minmax(calc(3ch + 16px), .78fr);
    gap: 4px;
  }

  .training-set-row .session-metric-grid.time,
  .training-set-row .session-metric-grid.distance,
  .training-set-row .session-metric-grid.steps {
    grid-template-columns: minmax(calc(4ch + 16px), 1fr);
  }

  .training-set-row .session-metric-grid.treadmill {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }

  .training-set-row .session-metric-field > span {
    font-size: 7.5px;
  }

  .training-set-row .session-metric-field input {
    padding-inline: 5px;
  }
}

@media (max-width: 390px) {
  .training-set-row,
  .session-block-set-list .training-set-row {
    grid-template-columns: 30px repeat(4, minmax(40px, 1fr));
    grid-template-areas:
      "type metrics metrics metrics metrics"
      ". rest reserve done delete";
    row-gap: 7px;
  }

  .training-set-row .type-chip {
    align-self: end;
  }

  .training-set-row.is-time-series,
  .session-block-set-list .training-set-row.is-time-series {
    grid-template-columns: 30px repeat(3, minmax(40px, 1fr));
    grid-template-areas:
      "type metrics metrics metrics"
      ". rest done delete";
  }

  .training-set-row .session-set-tool,
  .training-set-row .check-chip,
  .training-set-row .trash-session-set {
    justify-self: center;
  }
}

@media (max-width: 339px) {
  .training-set-row,
  .session-block-set-list .training-set-row {
    --set-control-size: 38px;
    --set-row-gap: 3px;
    grid-template-columns: 28px repeat(4, minmax(38px, 1fr));
    padding: 6px;
  }

  .training-set-row .type-chip {
    width: 28px;
    min-width: 28px;
  }

  .training-set-row .session-metric-field > span {
    font-size: 7px;
  }

  .training-set-row .session-set-tool--rest small {
    font-size: 7px;
  }
}
/* Training division icon editor: local square crop with circular preview. */
.training-letter--image {
  overflow: hidden;
  padding: 0;
  background: #080b0d;
  border-color: rgba(225, 27, 34, 0.82);
}

.training-letter--image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.training-division-photo-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.training-division-photo-select {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0d1114;
  color: #fff;
  text-align: left;
}

.training-division-photo-select:hover,
.training-division-photo-select:focus-visible {
  border-color: rgba(225, 27, 34, 0.76);
  background: rgba(225, 27, 34, 0.07);
}

.training-division-photo-preview {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(225, 27, 34, 0.7);
  border-radius: 50%;
  background: #080b0d;
  color: var(--red);
}

.training-division-photo-preview img,
.training-division-photo-preview svg {
  display: block;
  width: 100%;
  height: 100%;
}

.training-division-photo-preview img { object-fit: cover; }
.training-division-photo-preview svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.training-division-photo-select > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.training-division-photo-select strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-division-photo-select small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.training-division-photo-remove {
  width: 42px;
  min-width: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 27, 34, 0.48);
  border-radius: 8px;
  background: rgba(225, 27, 34, 0.08);
  color: #ff5260;
}

.training-division-photo-remove svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.training-division-photo-sheet {
  width: min(380px, calc(100vw - 28px));
  max-height: min(680px, calc(100dvh - 32px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.training-division-crop-frame {
  width: min(236px, 66vw);
  aspect-ratio: 1;
  justify-self: center;
  overflow: hidden;
  border: 2px solid rgba(225, 27, 34, 0.78);
  border-radius: 50%;
  background: #050607;
  box-shadow: 0 0 0 7px rgba(225, 27, 34, 0.07);
}

.training-division-crop-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.training-division-crop-controls {
  display: grid;
  gap: 10px;
}

.training-division-crop-controls label {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #eef2f4;
  font-size: 11px;
  font-weight: 850;
}

.training-division-crop-controls input[type='range'] {
  width: 100%;
  accent-color: var(--red);
}

.training-division-photo-hint {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.training-division-photo-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
}

.training-division-photo-actions button {
  min-height: 42px;
  margin: 0;
}

html[data-theme='light'] .training-division-photo-select,
html[data-theme='light'] .training-division-photo-preview {
  background: #f8fafb;
  color: #b70e1a;
}

html[data-theme='light'] .training-division-photo-select strong,
html[data-theme='light'] .training-division-crop-controls label {
  color: #121416;
}

@media (max-width: 359px) {
  .training-division-photo-field { grid-template-columns: minmax(0, 1fr) 40px; gap: 6px; }
  .training-division-photo-select { grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding-inline: 7px; }
  .training-division-photo-preview { width: 40px; height: 40px; }
  .training-division-photo-remove { width: 40px; min-width: 40px; }
  .training-division-photo-select small { font-size: 9px; }
  .training-division-crop-frame { width: min(220px, 70vw); }
}
.ratlab-ai-proposal li{margin:4px 0}
.ratlab-ai-proposal li span,.ratlab-ai-proposal li small{display:block}
.ratlab-ai-proposal li small{margin-top:2px;color:#ffc761;font-size:9px}
.top-ratlab-ai {
  color: #ff3147;
}

.top-ratlab-ai .ratlab-ai-bolt-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.modal-set-type-backdrop.ratlab-ai-backdrop {
  z-index: 1250;
  display: block;
  padding: 0;
  overflow: hidden;
  background: #070a0d;
  backdrop-filter: none;
  animation: none;
}

.modal-set-type-sheet.ratlab-ai-sheet {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  overflow: hidden;
  padding: 0;
  gap: 0;
  border: 0;
  border-radius: 0;
  background: #070a0d;
  animation: none;
}

.ratlab-ai-head,
.ratlab-ai-identity,
.ratlab-ai-review-head {
  display: flex;
  align-items: center;
}

.ratlab-ai-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 10px;
  min-height: 72px;
  padding: max(10px, env(safe-area-inset-top)) max(14px, calc((100vw - 1180px) / 2)) 10px;
  border-bottom: 1px solid var(--line);
  background: #090d11;
}

.ratlab-ai-review-head {
  gap: 8px;
}

.ratlab-ai-identity {
  gap: 10px;
  min-width: 0;
}

.ratlab-ai-review-head span {
  color: #ff3147;
  font-size: 10px;
  font-weight: 800;
}

.ratlab-ai-head h2 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ratlab-ai-head small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.ratlab-ai-head small span {
  color: #56d69c;
}

.ratlab-ai-head-button,
.ratlab-ai-compose-button,
.ratlab-ai-inline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: #f4f7fa;
  background: transparent;
}

.ratlab-ai-head-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 50%;
}

.ratlab-ai-head-button:hover,
.ratlab-ai-head-button:focus-visible {
  background: #151b21;
}

.ratlab-ai-icon {
  width: 22px;
  height: 22px;
}

.ratlab-ai-avatar {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  overflow: visible;
  border: 1px solid rgba(255, 49, 71, .72);
  border-radius: 50%;
  color: #fff;
  background: #281116;
  font-size: 11px;
  font-weight: 900;
  isolation: isolate;
}

.ratlab-ai-avatar > img,
.ratlab-ai-avatar > span,
.ratoji-avatar-media {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.ratlab-ai-avatar > span {
  display: grid;
  place-items: center;
}

.ratlab-ai-avatar > i {
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 10px;
  height: 10px;
  border: 2px solid #090d11;
  border-radius: 50%;
  background: #42d392;
}

.ratlab-ai-chat-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  padding: 24px max(18px, calc((100vw - 920px) / 2)) 18px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scroll-padding-bottom: 18px;
}

.ratlab-ai-chat-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.ratlab-ai-chat-message.is-user {
  justify-content: flex-end;
}

.ratlab-ai-chat-bubble {
  min-width: 0;
  max-width: min(76%, 560px);
  padding: 10px 14px;
  border: 0;
  border-radius: 18px 18px 18px 5px;
  background: #171c21;
  overflow-wrap: anywhere;
}

.ratlab-ai-chat-message.is-user .ratlab-ai-chat-bubble {
  border-radius: 18px 18px 5px 18px;
  background: #e91836;
}

.ratlab-ai-message-avatar {
  width: clamp(52px, 13vw, 58px);
  height: clamp(52px, 13vw, 58px);
  margin-bottom: -2px;
  border: 0;
  background: transparent;
  font-size: 10px;
}

.ratlab-ai-message-avatar > i {
  display: none;
}

.ratlab-ai-message-avatar-spacer {
  flex: 0 0 clamp(52px, 13vw, 58px);
  width: clamp(52px, 13vw, 58px);
}

.ratlab-ai-chat-message.is-grouped {
  margin-top: 0;
}

.ratlab-ai-chat-message.is-grouped .ratlab-ai-chat-bubble {
  border-top-left-radius: 7px;
}

.ratoji-avatar-media {
  display: grid;
  place-items: center;
  overflow: visible;
  border-radius: 0;
}

.ratoji-avatar-fallback {
  border: 1px solid rgba(255, 49, 71, .72);
  color: #fff;
  background: radial-gradient(circle at 50% 38%, #3a1820, #160b0e 72%);
}

.ratoji-svg {
  display: block;
  width: 118%;
  height: 118%;
  overflow: visible;
  transform-origin: 50% 82%;
}

.ratoji-svg * {
  transform-box: fill-box;
}

.ratoji-tail path {
  fill: none;
  stroke: #59616a;
  stroke-width: 5;
  stroke-linecap: round;
}

.ratoji-robe { fill: #11161b; stroke: #4b535c; stroke-width: 1.5; }
.ratoji-robe-panel { fill: #090d11; }
.ratoji-robe-lapel { fill: #e91836; }
.ratoji-belt { fill: #2c333a; }
.ratoji-arm { fill: #4c545d; stroke: #262c32; stroke-width: 1.3; }
.ratoji-emblem path:first-child { fill: #e91836; stroke: #ff6b7c; stroke-width: 1; }
.ratoji-emblem path:last-child { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ratoji-ear > circle:first-child { fill: #4b535c; stroke: #252a30; stroke-width: 2; }
.ratoji-ear-inner { fill: #8f3945; stroke: #d85a6c; stroke-width: 1; }
.ratoji-face { fill: #555e67; stroke: #252a30; stroke-width: 2; }
.ratoji-temple-mark { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 1.3; stroke-linecap: round; }
.ratoji-eyebrows path { fill: none; stroke: #15191d; stroke-width: 3.2; stroke-linecap: round; }
.ratoji-eye-open { fill: #f4f7fa; stroke: #191d21; stroke-width: 1.2; transform-origin: center; transition: transform 100ms ease; }
.ratoji-eye-happy { display: none; fill: none; stroke: #f4f7fa; stroke-width: 2.4; stroke-linecap: round; }
.ratoji-pupil { fill: #101419; transition: transform 180ms ease; }
.ratoji-muzzle { fill: #777f87; stroke: #30363d; stroke-width: 1.2; }
.ratoji-nose { fill: #f01e3e; stroke: #801322; stroke-width: 1.2; }
.ratoji-mouth path { fill: none; stroke: #171b20; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ratoji-mouth-open { display: none; fill: #3a1118 !important; stroke: #15191d !important; }
.ratoji-mouth-smile { display: none; stroke: #f4f7fa !important; stroke-width: 2.4 !important; }
.ratoji-whiskers path { fill: none; stroke: #aab0b6; stroke-width: 1.2; stroke-linecap: round; }
.ratoji-thinking-dots { opacity: 0; }
.ratoji-thinking-dots circle { fill: #f01e3e; }
.ratoji-listening-pulse { opacity: 0; transform-origin: center; }
.ratoji-listening-pulse circle { fill: none; stroke: #e91836; stroke-width: 2; }

.ratlab-ai-head-avatar {
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid rgba(255, 49, 71, .82);
  background: #e9e9e9;
  box-shadow: 0 0 0 2px #090d11;
}

.ratlab-ai-head-avatar .ratoji-header-profile-media {
  display: block;
  overflow: hidden;
  border-radius: 50%;
}

.ratlab-ai-head-avatar .ratoji-header-profile-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform: scale(2.12);
  transform-origin: 50% 17%;
}

.ratlab-ai-head-avatar > i,
.ratlab-ai-message-avatar > i {
  display: none;
}

.ratoji-avatar--idle .ratoji-body {
  transform-origin: 50% 100%;
  animation: ratoji-breathe 4.6s ease-in-out infinite;
}

.ratoji-avatar--idle .ratoji-head {
  transform-origin: 50% 78%;
  animation: ratoji-head-idle 6.2s ease-in-out infinite;
}

.ratoji-avatar--idle .ratoji-ear-left { transform-origin: 72% 76%; animation: ratoji-ear-idle 6.8s ease-in-out infinite; }
.ratoji-avatar--idle .ratoji-ear-right { transform-origin: 28% 76%; animation: ratoji-ear-idle 6.8s ease-in-out 90ms infinite reverse; }
.ratoji-avatar.is-blinking .ratoji-eye-open { transform: scaleY(.08); }
.ratoji-avatar.is-blinking .ratoji-pupil { transform: scaleY(.08); }

.ratoji-avatar--thinking .ratoji-head {
  transform-origin: 50% 80%;
  animation: ratoji-think-head 1.8s ease-in-out infinite;
}

.ratoji-avatar--thinking .ratoji-pupil { transform: translate(3px, -2px); }
.ratoji-avatar--thinking .ratoji-brow-right { transform: translateY(-2px) rotate(8deg); transform-origin: center; }
.ratoji-avatar--thinking .ratoji-arm-right { transform: translate(-16px, -20px) rotate(-28deg); transform-origin: 25% 20%; }
.ratoji-avatar--thinking .ratoji-thinking-dots { animation: ratoji-think-dots 1.5s ease-in-out infinite; }

.ratoji-avatar--speaking .ratoji-head { transform-origin: 50% 82%; animation: ratoji-speak-head .72s ease-in-out infinite; }
.ratoji-avatar--speaking .ratoji-mouth-closed { display: none; }
.ratoji-avatar--speaking .ratoji-mouth-open { display: block; transform-origin: center top; animation: ratoji-speak-mouth .36s ease-in-out infinite alternate; }
.ratoji-avatar--speaking .ratoji-brow-left { animation: ratoji-speak-brow .72s ease-in-out infinite; }

.ratoji-avatar--listening .ratoji-listening-pulse { animation: ratoji-listen-pulse 1.5s ease-out infinite; }
.ratoji-avatar--listening .ratoji-head { transform-origin: 50% 82%; animation: ratoji-listen-head 1.5s ease-in-out infinite; }
.ratoji-avatar--listening .ratoji-ear-left { transform: translateY(-3px) rotate(-7deg); transform-origin: 72% 76%; }
.ratoji-avatar--listening .ratoji-ear-right { transform: translateY(-3px) rotate(7deg); transform-origin: 28% 76%; }

.ratoji-avatar--celebrating .ratoji-svg {
  animation: ratoji-celebrate-sequence 3.1s cubic-bezier(.16, 1, .3, 1) both;
}

.ratoji-avatar--celebrating .ratoji-arm-left { transform: translate(8px, -22px) rotate(142deg); transform-origin: 72% 18%; animation: ratoji-celebrate-arm-left 3.1s ease-in-out both; }
.ratoji-avatar--celebrating .ratoji-arm-right { transform: translate(-8px, -22px) rotate(-142deg); transform-origin: 28% 18%; animation: ratoji-celebrate-arm-right 3.1s ease-in-out both; }
.ratoji-avatar--celebrating .ratoji-eye-open,
.ratoji-avatar--celebrating .ratoji-pupil,
.ratoji-avatar--celebrating .ratoji-mouth-closed { display: none; }
.ratoji-avatar--celebrating .ratoji-eye-happy,
.ratoji-avatar--celebrating .ratoji-mouth-smile { display: block; }
.ratoji-avatar--celebrating .ratoji-emblem { animation: ratoji-emblem-glow .62s ease-in-out 3 alternate; }

@keyframes ratoji-breathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.018); }
}

@keyframes ratoji-head-idle {
  0%, 38%, 100% { transform: translateY(0) rotate(0); }
  47% { transform: translateY(-1px) rotate(-1.2deg); }
  57% { transform: translateY(0) rotate(0); }
}

@keyframes ratoji-ear-idle {
  0%, 72%, 100% { transform: rotate(0); }
  78% { transform: rotate(2.5deg); }
  84% { transform: rotate(-1deg); }
}

@keyframes ratoji-think-head {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(-5.5deg) translateY(-1px); }
}

@keyframes ratoji-think-dots {
  0%, 100% { opacity: .24; transform: translateY(1px); }
  50% { opacity: 1; transform: translateY(-2px); }
}

@keyframes ratoji-speak-head {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-1px) rotate(1deg); }
}

@keyframes ratoji-speak-mouth {
  from { transform: scaleY(.45); }
  to { transform: scaleY(1); }
}

@keyframes ratoji-speak-brow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}

@keyframes ratoji-listen-pulse {
  0% { opacity: .5; transform: scale(.72); }
  100% { opacity: 0; transform: scale(1.08); }
}

@keyframes ratoji-listen-head {
  0%, 100% { transform: translateY(1px) scale(1.01); }
  50% { transform: translateY(0) scale(1.025); }
}

@keyframes ratoji-celebrate-sequence {
  0%, 100% { transform: translateY(0) scale(1) rotate(0); }
  8% { transform: translateY(0) scale(1.1) rotate(0); }
  20% { transform: translateY(-12px) scale(1.1) rotate(-2deg); }
  34% { transform: translateY(0) scale(1.06) rotate(2deg); }
  48% { transform: translateY(-7px) scale(1.08) rotate(2deg); }
  68% { transform: translateY(0) scale(1.05) rotate(-1deg); }
  86% { transform: translateY(0) scale(1.02) rotate(0); }
}

@keyframes ratoji-celebrate-arm-left {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  14%, 76% { transform: translate(8px, -22px) rotate(142deg); }
}

@keyframes ratoji-celebrate-arm-right {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  14%, 76% { transform: translate(-8px, -22px) rotate(-142deg); }
}

@keyframes ratoji-emblem-glow {
  from { opacity: .72; transform: scale(1); }
  to { opacity: 1; transform: scale(1.16); }
}

.ratoji-animations-paused .ratoji-svg,
.ratoji-animations-paused .ratoji-svg * {
  animation-play-state: paused !important;
}

.ratoji-celebration-overlay {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 5;
  width: 108px;
  height: 108px;
  pointer-events: none;
}

.ratoji-celebration-avatar {
  position: absolute;
  inset: 9px;
  width: 90px;
  height: 90px;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 10px 24px rgba(255, 30, 57, .28));
}

.ratoji-celebration-avatar > i {
  display: none;
}

.ratoji-confetti,
.ratoji-confetti i {
  position: absolute;
  inset: 0;
}

.ratoji-confetti i {
  --angle: calc(var(--i) * 25.714deg);
  left: 50%;
  top: 50%;
  width: 4px;
  height: 8px;
  border-radius: 1px;
  background: #f31e3d;
  transform: rotate(var(--angle)) translateY(-18px);
  animation: ratoji-confetti 1.4s cubic-bezier(.16, 1, .3, 1) calc(var(--i) * 18ms) 1 both;
}

.ratoji-confetti i:nth-child(3n + 2) { background: #f6f7f8; }
.ratoji-confetti i:nth-child(3n) { background: #d8aa43; }

@keyframes ratoji-confetti {
  0% { opacity: 0; transform: rotate(var(--angle)) translateY(-14px) scale(.6); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--angle)) translateY(-54px) scale(1); }
}

.ratlab-ai-chat-bubble > p,
.ratlab-ai-proposal p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.42;
  white-space: pre-wrap;
}

.ratlab-ai-history-loading,
.ratlab-ai-history-attachment {
  color: var(--muted);
  font-size: 0.72rem;
}

.ratlab-ai-history-loading {
  padding: 0.4rem 0;
  text-align: center;
}

.ratlab-ai-history-attachment {
  display: block;
  margin-bottom: 0.35rem;
}

.ratlab-ai-chat-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.ratlab-ai-chat-images img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
}

.ratlab-ai-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0 36px;
}

.ratlab-ai-starters button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #2b343d;
  border-radius: 18px;
  color: #dce3e9;
  background: #0d1217;
  font-size: 11px;
  font-weight: 750;
}

.ratlab-ai-starters button:hover,
.ratlab-ai-starters button:focus-visible {
  border-color: #ff3147;
  color: #fff;
}

.ratlab-ai-review,
.ratlab-ai-proposal,
.ratlab-ai-missing {
  display: grid;
  gap: 8px;
  margin-top: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0, 0, 0, .2);
}

.ratlab-ai-review-head {
  justify-content: space-between;
}

.ratlab-ai-review-head em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.ratlab-ai-proposal {
  margin-top: 0;
  background: #090d11;
}

.ratlab-ai-proposal > span,
.ratlab-ai-missing strong {
  color: #8edcff;
  font-size: 9px;
  text-transform: uppercase;
}

.ratlab-ai-proposal ul {
  margin: 2px 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 12px;
}

.ratlab-ai-missing {
  margin-top: 0;
  border-color: rgba(255, 184, 72, .35);
}

.ratlab-ai-missing span {
  color: #ffc761;
  font-size: 12px;
}

.ratlab-ai-confirm-message {
  width: 100%;
  min-height: 38px;
}

.ratlab-ai-confirmed {
  color: #76e7ad;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.ratlab-ai-typing {
  display: flex;
  gap: 5px;
  width: 52px;
}

.ratlab-ai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: ratlab-ai-dot 1s infinite ease-in-out;
}

.ratlab-ai-typing i:nth-child(2) { animation-delay: .12s; }
.ratlab-ai-typing i:nth-child(3) { animation-delay: .24s; }

@keyframes ratlab-ai-dot {
  50% { opacity: .25; transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .ratoji-svg,
  .ratoji-svg *,
  .ratoji-confetti i {
    animation: none !important;
    transform: none !important;
  }

  .ratoji-avatar--thinking .ratoji-thinking-dots { opacity: .8; }
  .ratoji-avatar--speaking .ratoji-mouth-closed { display: none; }
  .ratoji-avatar--speaking .ratoji-mouth-open { display: block; }
  .ratoji-avatar--listening .ratoji-listening-pulse { opacity: .24; }
  .ratoji-avatar--celebrating .ratoji-eye-open,
  .ratoji-avatar--celebrating .ratoji-pupil,
  .ratoji-avatar--celebrating .ratoji-mouth-closed { display: none; }
  .ratoji-avatar--celebrating .ratoji-eye-happy,
  .ratoji-avatar--celebrating .ratoji-mouth-smile { display: block; }
}

.ratlab-ai-message.is-error {
  margin: 0 max(18px, calc((100vw - 920px) / 2)) 8px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 49, 71, .45);
  border-radius: 10px;
  color: #ff8d9a;
  background: rgba(255, 49, 71, .08);
  font-size: 12px;
}

.ratlab-ai-composer {
  display: grid;
  gap: 8px;
  padding: 10px max(14px, calc((100vw - 980px) / 2)) max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #090d11;
}

.ratlab-ai-compose-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
  align-items: end;
  gap: 8px;
}

.ratlab-ai-input-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: end;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid #2a343e;
  border-radius: 22px;
  background: #11171d;
}

.ratlab-ai-composer textarea {
  width: 100%;
  min-height: 42px;
  max-height: 116px;
  padding: 11px 4px 10px 14px;
  border: 0;
  color: #f3f6f8;
  background: transparent;
  line-height: 1.35;
  resize: none;
}

.ratlab-ai-composer textarea:focus {
  outline: 0;
  box-shadow: none;
}

.ratlab-ai-input-shell:focus-within {
  border-color: #677684;
}

.ratlab-ai-compose-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 1px solid #2a343e;
  border-radius: 50%;
  background: #11171d;
}

.ratlab-ai-inline-button {
  width: 40px;
  height: 42px;
  color: #aeb8c1;
}

.ratlab-ai-compose-button:hover,
.ratlab-ai-compose-button:focus-visible,
.ratlab-ai-inline-button:hover,
.ratlab-ai-inline-button:focus-visible {
  color: #fff;
  border-color: #596875;
}

.ratlab-ai-compose-button:disabled,
.ratlab-ai-inline-button:disabled {
  opacity: .35;
}

.ratlab-ai-send {
  border-color: #ef1c3d;
  color: #fff;
  background: #ef1c3d;
}

.ratlab-ai-send:disabled {
  border-color: #293039;
  color: #65717b;
  background: #171c21;
}

.ratlab-ai-mic.is-listening {
  border-color: #ff3147;
  color: #fff;
  background: #7e1323;
}

.ratlab-ai-attachment-list {
  display: flex;
  gap: 8px;
  padding-inline: 52px;
  overflow-x: auto;
}

.ratlab-ai-attachment-list > span {
  display: grid;
  grid-template-columns: 40px minmax(0, 110px) 28px;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1015;
}

.ratlab-ai-attachment-list img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
}

.ratlab-ai-attachment-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ratlab-ai-attachment-list button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  color: #ff7180;
  background: transparent;
}

@media (max-width: 600px) {
  .ratlab-ai-chat-bubble {
    max-width: 84%;
  }
}

@media (max-width: 380px) {
  .top-ratlab-ai {
    display: none;
  }

  .ratlab-ai-head {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    padding-inline: 8px;
  }

  .ratlab-ai-chat-log {
    padding-inline: 10px;
  }

  .ratlab-ai-compose-row {
    grid-template-columns: 40px minmax(0, 1fr) 40px 40px;
    gap: 5px;
  }

  .ratlab-ai-compose-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .ratlab-ai-composer {
    padding-inline: 8px;
  }

  .ratlab-ai-attachment-list {
    padding-inline: 45px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ratlab-ai-typing i {
    animation: none;
  }
}

/* Club discovery and public preview */
.club-discovery,
.club-preview-page {
  width: min(100%, 760px);
  margin-inline: auto;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.club-ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.club-discovery-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 6px;
}

.club-discovery-header > .training-back { width: 44px; height: 44px; min-width: 0; padding: 10px; }
.club-discovery-header > .club-search-bar { min-width: 0; margin: 0; }

.club-discovery-header .challenges-subpage-head {
  min-width: 0;
}

.club-header-create,
.club-create-fab {
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 24, 66, .58);
  background: #f41842;
  color: #fff;
  box-shadow: 0 8px 22px rgba(244, 24, 66, .22);
}

.club-header-create {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
}

.club-search-bar {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: #11151a;
  color: rgba(255, 255, 255, .6);
}

.club-search-bar label,
.club-search-bar input {
  min-width: 0;
  width: 100%;
}

.club-search-bar input {
  height: 46px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
}

.club-search-bar input::placeholder {
  color: rgba(255, 255, 255, .38);
}

.club-filter-trigger {
  position: relative;
  width: 44px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .08);
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: #fff;
}

.club-filter-trigger.has-filters {
  color: #ff3858;
}

.club-filter-trigger > span {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  border-radius: 8px;
  background: #f41842;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
}

.club-category-chips,
.club-featured-rail,
.club-new-rail {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.club-category-chips::-webkit-scrollbar,
.club-featured-rail::-webkit-scrollbar,
.club-new-rail::-webkit-scrollbar {
  display: none;
}

.club-category-chips {
  gap: 7px;
  margin-inline: -2px;
  padding: 2px;
}

.club-category-chips button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: #101419;
  color: rgba(255, 255, 255, .66);
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  scroll-snap-align: start;
}

.club-category-chips button.active {
  border-color: #f41842;
  background: #f41842;
  color: #fff;
}

.club-main-tabs {
  position: relative;
  gap: 3px;
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.club-main-tabs button {
  position: relative;
  min-height: 42px;
  padding-inline: 12px;
  border: 0;
  background: transparent;
}

.club-main-tabs button.active {
  border: 0;
  background: transparent;
  color: #fff;
}

.club-main-tabs button.active::after {
  content: '';
  position: absolute;
  right: 10px;
  bottom: -2px;
  left: 10px;
  height: 2px;
  background: #f41842;
}

.club-discovery-content,
.club-discovery-section {
  display: grid;
  gap: 12px;
}

.club-discovery-content {
  gap: 22px;
}

.club-discovery-section > header {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.club-discovery-section > header h2 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
}

.club-discovery-section > header button,
.club-discovery-section > header span {
  border: 0;
  background: transparent;
  color: #7fbdcf;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
}

.club-featured-rail {
  gap: 10px;
  margin-inline: -1px;
  padding: 1px;
}

.club-featured-card {
  flex: 0 0 min(86vw, 330px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 8px;
  background: #101419;
  scroll-snap-align: start;
}

.club-featured-card:focus-visible,
.club-new-card:focus-visible,
.club-list-card:focus-visible {
  outline: 2px solid #f41842;
  outline-offset: 2px;
}

.club-featured-media {
  position: relative;
  height: 142px;
  overflow: hidden;
  background: #171c22;
}

.club-media {
  display: block;
  object-fit: cover;
}

.club-featured-media > .club-media-cover,
.club-preview-cover > .club-media-cover {
  width: 100%;
  height: 100%;
}

.club-media-fallback {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 5px;
  border: 1px solid rgba(244, 24, 66, .28);
  background: #171c22;
  color: #f41842;
}

.club-media-fallback b {
  color: rgba(255, 255, 255, .82);
  font-size: 9px;
  font-weight: 950;
}

.club-highlight-badge,
.club-new-badge,
.club-list-title > span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(244, 24, 66, .58);
  border-radius: 8px;
  background: rgba(244, 24, 66, .15);
  color: #ff7187;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.club-highlight-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #fff;
  background: rgba(9, 12, 15, .84);
}

.club-featured-content {
  display: grid;
  gap: 8px;
  padding: 13px;
}

.club-category-label,
.club-list-category {
  color: #ff3858;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.club-featured-content h3,
.club-new-card h3,
.club-list-card h3 {
  margin: 0;
  color: #fff;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.club-featured-content h3 {
  font-size: 18px;
}

.club-featured-content > p {
  min-height: 34px;
  margin: 0;
  color: rgba(255, 255, 255, .58);
  font-size: 11px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.club-inline-meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: rgba(255, 255, 255, .56);
  font-size: 9px;
  font-weight: 800;
}

.club-inline-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.club-inline-meta .club-ui-icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}

.club-card-action {
  min-height: 38px;
  margin: 0;
  padding-inline: 12px;
  white-space: nowrap;
}

.club-new-rail {
  gap: 8px;
  margin-inline: -1px;
  padding: 1px;
}

.club-new-card {
  position: relative;
  isolation: isolate;
  flex: 0 0 min(78vw, 280px);
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  background: #101419;
  scroll-snap-align: start;
}

.club-new-card > .club-media-avatar,
.club-list-card > .club-media-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
}

.club-new-card h3 {
  margin-top: 4px;
  font-size: 12px;
}

.club-new-card p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, .5);
  font-size: 9px;
}

.club-new-card > .club-card-action {
  min-width: 64px;
  min-height: 36px;
  padding-inline: 8px;
  font-size: 9px;
}

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

.club-list-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  background: #101419;
  overflow: hidden;
}

.club-new-card.has-cover,
.club-list-card.has-cover {
  border-color: rgba(255,255,255,.18);
  background: #080b0e;
}

.club-card-cover {
  position: absolute;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.club-card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7,10,12,.88) 0%, rgba(7,10,12,.78) 48%, rgba(7,10,12,.9) 100%);
}

.club-card-cover > .club-media-cover {
  width: 100%;
  height: 100%;
  opacity: .72;
  filter: saturate(.86) contrast(1.08);
}

.club-new-card.has-cover > .club-media-avatar,
.club-list-card.has-cover > .club-media-avatar {
  border: 1px solid rgba(255,255,255,.34);
  box-shadow: 0 6px 16px rgba(0,0,0,.34);
}

.club-new-card.has-cover p,
.club-list-card.has-cover :is(.club-inline-meta,.club-list-description) {
  color: rgba(255,255,255,.72);
}

.club-list-card.is-member {
  border-color: rgba(127, 189, 207, .28);
}

.club-list-card-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.club-list-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.club-list-title h3 {
  min-width: 0;
  font-size: 13px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.club-list-category,
.club-list-description {
  margin: 0;
}

.club-list-description {
  color: rgba(255, 255, 255, .48);
  font-size: 9px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.club-member-details {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.club-member-details span {
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(127, 189, 207, .1);
  color: #9dcbd8;
  font-size: 8px;
  font-weight: 850;
}

.club-list-action {
  align-self: stretch;
  display: grid;
  align-items: end;
}

.club-list-action .club-card-action {
  min-width: 76px;
}

.club-load-more {
  min-height: 52px;
  display: grid;
  place-items: center;
}

.club-empty-state {
  min-height: 310px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px 16px;
  text-align: center;
}

.club-empty-mascot {
  width: 108px;
  height: 108px;
  overflow: visible;
  border: 0;
  background: transparent;
}

.club-empty-mascot .ratoji-svg {
  width: 108px;
  height: 108px;
}

.club-empty-mascot .ratoji-body {
  transform-origin: 60px 108px;
  transform: scaleY(.86) translateY(10px);
}

.club-empty-state h3,
.club-empty-state p {
  margin: 0;
}

.club-empty-state h3 {
  color: #fff;
  font-size: 17px;
}

.club-empty-state p {
  max-width: 290px;
  color: rgba(255, 255, 255, .54);
  font-size: 11px;
  line-height: 1.5;
}

.club-empty-state > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
}

.club-card-skeleton {
  min-height: 96px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 8px;
  background: #101419;
}

.club-card-skeleton i,
.club-card-skeleton b {
  display: block;
  border-radius: 6px;
  background: #1c2229;
  animation: club-skeleton-pulse 1.3s ease-in-out infinite alternate;
}

.club-card-skeleton i {
  width: 76px;
  height: 76px;
}

.club-card-skeleton span {
  display: grid;
  align-content: center;
  gap: 9px;
}

.club-card-skeleton b {
  height: 9px;
}

.club-card-skeleton b:nth-child(1) { width: 66%; }
.club-card-skeleton b:nth-child(2) { width: 42%; }
.club-card-skeleton b:nth-child(3) { width: 84%; }

@keyframes club-skeleton-pulse {
  to { opacity: .42; }
}

.club-create-fab {
  position: fixed;
  z-index: 35;
  right: max(18px, calc((100vw - 760px) / 2 + 18px));
  bottom: calc(76px + env(safe-area-inset-bottom));
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 50%;
}

.club-filter-backdrop {
  z-index: 790;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.club-filter-sheet {
  width: min(100%, 560px);
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  padding: 17px 16px calc(16px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #0f1318;
}

.club-filter-sheet > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.club-filter-sheet h2 {
  margin: 3px 0 0;
  color: #fff;
  font-size: 20px;
}

.club-filter-sheet form {
  display: grid;
  gap: 12px;
}

.club-filter-sheet label {
  display: grid;
  gap: 6px;
}

.club-filter-sheet label > span {
  color: rgba(255, 255, 255, .56);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.club-filter-sheet select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 8px;
  background: #090d11;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.club-filter-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 8px;
  padding-top: 5px;
}

.club-filter-actions button {
  min-height: 46px;
}

.club-preview-page {
  position: relative;
  display: grid;
  gap: 22px;
  padding-top: 0;
}

.club-preview-topbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255, 255, 255, .72);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
}

.club-preview-topbar.is-overlay {
  position: absolute;
  z-index: 4;
  top: max(8px, env(safe-area-inset-top));
  left: 10px;
}

.club-preview-topbar .training-back {
  background: rgba(8, 11, 14, .82);
  backdrop-filter: blur(7px);
}

.club-preview-cover {
  height: clamp(180px, 30dvh, 280px);
  width: 100%;
  margin-inline: 0;
  overflow: hidden;
  background: #171c22;
}

.club-preview-identity {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: end;
  gap: 13px;
  margin-top: -58px;
  padding-inline: 2px;
}

.club-preview-identity > .club-media-avatar {
  width: 78px;
  height: 78px;
  border: 3px solid #000;
  border-radius: 50%;
  background: #000;
  overflow: hidden;
}

.club-preview-identity h1 {
  margin: 4px 0 5px;
  color: #fff;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.club-preview-identity p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
  font-weight: 800;
}

.club-preview-identity p .club-ui-icon {
  width: 13px;
  height: 13px;
}

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

.club-preview-stats > div {
  min-width: 0;
  min-height: 76px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 3px;
  padding: 8px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.club-preview-stats .club-ui-icon {
  width: 15px;
  height: 15px;
  color: #ff3858;
}

.club-preview-stats strong {
  color: #fff;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.club-preview-stats span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.club-preview-page .club-discovery-section {
  gap: 9px;
}

.club-about-copy {
  max-height: 84px;
  overflow: hidden;
}

.club-about-copy.is-expanded {
  max-height: none;
}

.club-about-copy p,
.club-about-copy dl,
.club-section-empty {
  margin: 0;
  color: rgba(255, 255, 255, .59);
  font-size: 11px;
  line-height: 1.55;
}

.club-about-copy dl {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.club-about-copy dt {
  color: rgba(255, 255, 255, .82);
  font-weight: 900;
}

.club-about-copy dd {
  margin: 0;
}

.club-text-action {
  justify-self: start;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ff526d;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
}

.club-member-preview,
.club-managers,
.club-preview-challenges {
  display: grid;
  gap: 9px;
}

.club-member-avatars {
  display: flex;
  padding-left: 2px;
}

.club-member-avatars > :is(img, span) {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-left: -8px;
  border: 2px solid #080b0e;
  border-radius: 50%;
  object-fit: cover;
  background: #20262d;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.club-member-avatars > :first-child {
  margin-left: 0;
}

.club-managers > span {
  color: rgba(255, 255, 255, .45);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.club-managers > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.club-managers :is(img, i) {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  background: #20262d;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.club-managers p,
.club-managers strong,
.club-managers small {
  display: block;
  margin: 0;
}

.club-managers strong {
  color: #fff;
  font-size: 10px;
}

.club-managers small {
  margin-top: 2px;
  color: rgba(255, 255, 255, .45);
  font-size: 8px;
}

.club-preview-challenges article {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: #101419;
}

.club-preview-challenges article > .club-ui-icon {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(244, 24, 66, .12);
  color: #ff3858;
}

.club-preview-challenges strong,
.club-preview-challenges span {
  display: block;
}

.club-preview-challenges strong {
  color: #fff;
  font-size: 11px;
}

.club-preview-challenges span {
  margin-top: 3px;
  color: rgba(255, 255, 255, .46);
  font-size: 8px;
}

.club-rules-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 24px;
  color: rgba(255, 255, 255, .58);
  font-size: 11px;
  line-height: 1.45;
}

.club-rules-list li::marker {
  color: #f41842;
  font-weight: 900;
}

.club-preview-cta {
  position: sticky;
  z-index: 30;
  bottom: calc(64px + env(safe-area-inset-bottom));
  margin: 2px -4px -18px;
  padding: 10px 4px;
  background: rgba(8, 11, 14, .94);
  backdrop-filter: blur(10px);
}

.club-preview-cta > button,
.club-preview-cta-actions > button:first-child {
  width: 100%;
  min-height: 48px;
}

.club-preview-cta-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 48px;
  gap: 8px;
}

.club-preview-cta-actions > button:not(:first-child) {
  min-width: 48px;
  min-height: 48px;
  padding: 0;
}

@media (max-width: 430px) {
  .club-discovery,
  .club-preview-page {
    gap: 16px;
  }

  .club-list-card {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .club-list-action {
    grid-column: 2;
  }

  .club-list-action .club-card-action {
    width: 100%;
  }

  .club-preview-cover {
    height: clamp(180px, 28dvh, 240px);
    width: 100vw;
    max-width: none;
    margin-inline: calc(50% - 50vw);
  }
}

@media (max-width: 360px) {
  .club-discovery-header .challenges-subpage-head p {
    display: none;
  }

  .club-list-card {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 9px;
  }

  .club-list-title > span {
    display: none;
  }

  .club-featured-card {
    flex-basis: 88vw;
  }

  .club-filter-actions {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .club-featured-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .club-featured-card {
    width: auto;
  }

  .club-list-card {
    grid-template-columns: 82px minmax(0, 1fr) auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .club-card-skeleton i,
  .club-card-skeleton b,
  .club-empty-mascot .ratoji-svg,
  .club-empty-mascot .ratoji-svg * {
    animation: none !important;
  }

  .club-category-chips,
  .club-featured-rail,
  .club-new-rail {
    scroll-behavior: auto;
  }
}

/* Training modules: strength and running */
.training-hub-actions{width:100%;overflow-x:auto;scrollbar-width:none;border-bottom:1px solid rgba(255,255,255,.08)}
.training-hub-actions::-webkit-scrollbar{display:none}
.training-hub-actions .training-header-actions{display:grid;grid-template-columns:repeat(5,minmax(62px,1fr));gap:0;width:100%;min-width:310px;padding:0;border:0}
.training-hub-actions .training-header-actions :is(.training-header-action,.learning-manual-shortcut,.pdf-import-trigger-training){position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:100%;height:64px;min-width:0;min-height:48px;margin:0;padding:8px 4px 7px;border:0;border-radius:0;background:transparent;color:#8fa0ad;box-shadow:none}
.training-hub-actions .training-header-actions :is(.training-header-action,.learning-manual-shortcut,.pdf-import-trigger-training)::after{content:"";position:absolute;right:12px;bottom:0;left:12px;height:2px;background:transparent}
.training-hub-actions .training-header-actions :is(.training-header-action,.learning-manual-shortcut,.pdf-import-trigger-training):is(:hover,:focus-visible,.active){color:#fff;background:rgba(255,255,255,.025);outline:none}
.training-hub-actions .training-header-actions .active::after{background:var(--red)}
.training-hub-actions .training-header-actions :is(.training-header-action,.learning-manual-shortcut,.pdf-import-trigger-training)>svg{display:block;width:20px;height:20px;max-width:20px;max-height:20px;flex:0 0 20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.training-hub-actions .training-header-actions :is(.training-header-action,.learning-manual-shortcut,.pdf-import-trigger-training)>span{position:static;width:auto;height:auto;margin:0;padding:0;overflow:visible;clip:auto;white-space:nowrap;border:0;font-size:9px;font-weight:900;line-height:1;letter-spacing:0}
.training-module-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:4px;width:100%;max-width:640px;box-sizing:border-box;min-width:0;background:#0d1013;border:1px solid rgba(255,255,255,.08);border-radius:8px}
.training-module-switch button{display:grid;grid-template-columns:24px minmax(0,1fr);grid-template-rows:auto auto;column-gap:10px;row-gap:3px;align-items:center;align-content:center;min-width:0;min-height:64px;padding:10px 12px;border:0;border-radius:6px;background:transparent;color:#aab6bf;text-align:left;box-sizing:border-box}
.training-module-switch button svg,.training-module-switch button .training-running-icon{grid-row:1/3;width:24px;height:24px}.training-module-switch button svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.training-running-icon{display:block;flex:0 0 auto;background-color:currentColor;-webkit-mask:url("assets/ratlab-icons/running-module.png") center/contain no-repeat;mask:url("assets/ratlab-icons/running-module.png") center/contain no-repeat}
.training-module-switch button>span:not(.training-running-icon){grid-column:2;font-size:14px;line-height:1.3;font-weight:950;min-width:0;overflow-wrap:anywhere;letter-spacing:0}.training-module-switch button small{grid-column:2;font-size:11px;line-height:1.35;color:#aab6bf;min-width:0;overflow-wrap:anywhere}
.training-module-switch button:focus-visible{outline:2px solid var(--red);outline-offset:-2px}
@media(max-width:480px){.training-module-switch button{grid-template-rows:1fr;min-height:52px;padding:10px;column-gap:8px}.training-module-switch button :is(svg,.training-running-icon){grid-row:1;width:24px;height:24px}.training-module-switch button small{display:none}}
.training-module-switch button.active{background:#1a1e22;color:#fff;box-shadow:0 8px 18px rgba(0,0,0,.22)}.training-module-switch button.active :is(svg,.training-running-icon){color:var(--red)}.training-module-switch button.active small{color:#aab6bf}
.training-create-compact{display:grid;place-items:center;width:44px;height:44px;min-width:44px;padding:0;border:1px solid rgba(225,27,34,.55);border-radius:50%;background:rgba(225,27,34,.12);color:#fff}.training-create-compact svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2}
.running-plan-list,.running-session-list,.running-history-list,.running-editor-sessions{display:grid;gap:10px}.running-plan-card{display:grid;gap:12px;padding:14px;border:1px solid rgba(255,255,255,.09);border-radius:14px;background:#111418;color:#fff;cursor:pointer}.running-plan-card:focus-visible{outline:2px solid var(--red);outline-offset:2px}.running-plan-card-top{display:grid;grid-template-columns:42px minmax(0,1fr) 20px;align-items:center;gap:10px}.running-plan-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:10px;background:#241316;color:#ff5960}.running-plan-mark .training-running-icon{width:24px;height:24px}.running-plan-card-top strong{font-size:14px}.running-plan-card-top small{display:block;margin-top:3px;color:#91a0aa;font-size:9.5px}.running-plan-arrow{font-size:24px;color:#697781}.running-plan-stats{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid rgba(255,255,255,.07);border-bottom:1px solid rgba(255,255,255,.07)}.running-plan-stats span{padding:9px 5px;text-align:center}.running-plan-stats span+span{border-left:1px solid rgba(255,255,255,.07)}.running-plan-stats strong,.running-detail-summary strong,.running-history-summary strong{display:block;font-size:13px;font-variant-numeric:tabular-nums}.running-plan-stats small,.running-detail-summary small,.running-history-summary small{display:block;margin-top:2px;color:#748591;font-size:8px;text-transform:uppercase}.running-plan-card footer{display:flex;align-items:center;justify-content:space-between;color:#8796a0;font-size:9px}.running-plan-card footer div{display:flex;gap:6px}.running-plan-card footer button{display:grid;place-items:center;width:38px;height:38px;padding:0;border:1px solid rgba(255,255,255,.1);border-radius:50%;background:#0b0e11;color:#dce3e8}.running-plan-card footer svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8}
.running-empty{display:grid;justify-items:center;padding:36px 22px;border:1px solid rgba(255,255,255,.08);border-radius:14px;background:#0e1114;text-align:center}.running-empty>.training-running-icon{width:58px;height:58px;margin-bottom:14px;color:#e13a40}.running-empty strong{font-size:16px}.running-empty p{max-width:290px;margin:7px 0 18px;color:#8e9ca6;font-size:11px;line-height:1.5}.running-empty .primary{width:auto;min-height:48px}
.running-editor-form,.running-editor-overview{display:grid;gap:12px}.running-editor-overview,.running-session-editor{padding:14px;border:1px solid rgba(255,255,255,.09);border-radius:14px;background:#111418}.running-session-editor{display:grid;gap:12px}.running-session-editor>header{display:grid;grid-template-columns:32px minmax(0,1fr) minmax(0,1fr) 40px;gap:8px;align-items:end}.running-session-editor>header>span{align-self:center;color:#e13a40;font-size:18px;font-weight:950}.running-session-editor>header>button,.running-block-editor>button{width:40px;height:40px;padding:0;border:1px solid rgba(225,27,34,.3);border-radius:8px;background:#1a1012;color:#ff7176}.running-block-list{display:grid;gap:7px}.running-block-editor{display:grid;grid-template-columns:24px 1.1fr 1fr .7fr 1fr .7fr .65fr 40px;gap:6px;align-items:end;padding:9px;border-radius:10px;background:#0b0e11}.running-block-order{align-self:center;color:#6e7e89;font-size:11px;font-weight:900}.running-block-editor .field label,.running-session-editor .field label{font-size:8px}.running-add-block{min-height:44px;border:1px dashed rgba(225,27,34,.38);border-radius:9px;background:transparent;color:#ff666c;font-size:10px;font-weight:900}.running-add-session,.running-save-plan{min-height:48px}
.running-detail-summary,.running-history-summary{display:grid;grid-template-columns:repeat(3,1fr);padding:4px;border:1px solid rgba(255,255,255,.08);border-radius:12px;background:#0e1114}.running-detail-summary span,.running-history-summary span{padding:10px;text-align:center}.running-session-card{padding:14px;border:1px solid rgba(255,255,255,.09);border-radius:14px;background:#111418}.running-session-card>header{display:grid;grid-template-columns:34px 1fr;gap:9px;align-items:center}.running-session-card>header>span{color:#e13a40;font-size:17px;font-weight:950}.running-session-card header strong{font-size:14px}.running-session-card header small{display:block;margin-top:3px;color:#82919b;font-size:9px}.running-session-card ol{display:grid;gap:0;margin:12px 0;padding:0;list-style:none;border-top:1px solid rgba(255,255,255,.07)}.running-session-card li{display:grid;grid-template-columns:1fr auto;gap:2px 10px;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.07)}.running-session-card li span{font-size:10px}.running-session-card li strong{font-size:11px;font-variant-numeric:tabular-nums}.running-session-card li small{grid-column:1/3;color:#74838e;font-size:9px}.running-session-card .primary{min-height:46px}.running-preflight-hero{display:grid;justify-items:center;padding:24px;text-align:center}.running-preflight-hero svg{width:48px;height:48px;margin-bottom:10px;fill:none;stroke:#ed3d44;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.running-preflight-hero strong{font-size:18px}.running-preflight-hero p{margin:5px 0;color:#8897a1;font-size:10px}.running-mode-options{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.running-mode-options input{position:absolute;opacity:0;pointer-events:none}.running-mode-options label>span{display:grid;justify-items:center;min-height:120px;padding:18px 10px;border:1px solid rgba(255,255,255,.1);border-radius:14px;background:#101318;text-align:center}.running-mode-options svg{width:28px;height:28px;margin-bottom:10px;fill:none;stroke:#8b9aa4;stroke-width:1.7}.running-mode-options strong{font-size:13px}.running-mode-options small{margin-top:4px;color:#74838d;font-size:8.5px;line-height:1.3}.running-mode-options input:checked+span{border-color:#d92b32;background:#211215}.running-mode-options input:checked+span svg{stroke:#f1484f}.running-privacy-note{display:flex;align-items:center;gap:10px;padding:12px;border-radius:10px;background:#0e1518}.running-privacy-note svg{width:24px;height:24px;fill:none;stroke:#54c5c9;stroke-width:1.6}.running-privacy-note strong,.running-privacy-note small{display:block}.running-privacy-note strong{font-size:10px}.running-privacy-note small{margin-top:2px;color:#86a1a4;font-size:8.5px}.running-start-button{min-height:52px}
.running-mode-options label:first-child>span>svg{display:none}.running-mode-options label:first-child>span::before{content:'';display:block;width:32px;height:32px;margin-bottom:10px;background-color:#8b9aa4;-webkit-mask:url("assets/ratlab-icons/running-module.png") center/contain no-repeat;mask:url("assets/ratlab-icons/running-module.png") center/contain no-repeat}.running-mode-options label:first-child>input:checked+span::before{background-color:#f1484f}
.running-mode-options label:last-child>span>svg{display:none}.running-mode-options label:last-child>span::before{content:'';display:block;width:32px;height:32px;margin-bottom:10px;background-color:#8b9aa4;-webkit-mask:url("assets/ratlab-icons/treadmill-mode.png") center/contain no-repeat;mask:url("assets/ratlab-icons/treadmill-mode.png") center/contain no-repeat}.running-mode-options label:last-child>input:checked+span::before{background-color:#f1484f}
.running-mode-options label small{display:none}
.running-preflight-hero>svg{display:none}.running-preflight-hero::before{content:'';display:block;width:48px;height:48px;margin-bottom:10px;background-color:#ed3d44;-webkit-mask:url("assets/ratlab-icons/running-module.png") center/contain no-repeat;mask:url("assets/ratlab-icons/running-module.png") center/contain no-repeat}
.running-preflight-hero>p{display:none}
.running-preflight>.running-privacy-note{display:none}
.running-history-period{display:flex;gap:8px;border-bottom:1px solid #28333b}
.running-history-period button{flex:1;min-height:44px;padding:8px;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:#aebbc4;font-size:12px}
.running-history-period button[aria-pressed="true"]{border-bottom-color:var(--red);color:#fff}
.running-history-totals,.running-history-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0;gap:0}
.running-history-totals{border-bottom:1px solid #28333b;padding-bottom:8px}
.running-history-totals>div,.running-history-metrics>div{min-width:0;padding:12px 8px}
.running-history-totals dt,.running-history-metrics dt{font-size:10px;line-height:1.4;color:#aebbc4;overflow-wrap:anywhere}
.running-history-totals dd,.running-history-metrics dd{margin:5px 0 0;font-size:18px;line-height:1.3;font-weight:700;color:#f5f7fa;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.running-history-totals dd small,.running-history-metrics dd small{display:block;margin-top:2px;font-size:10px;font-weight:400;color:#aebbc4}
.running-history-totals>div:nth-child(4) dd{color:#57d2d0}
.running-history-entries{display:grid;gap:12px}
.running-history-entry{padding:14px;border:1px solid #28333b;border-radius:8px;background:#0e1114;min-width:0}
.running-history-entry>header{display:flex;align-items:center;justify-content:space-between;gap:8px}
.running-history-entry>header>div:first-child{min-width:0}
.running-history-entry h2{margin:5px 0;font-size:15px;line-height:1.3;overflow-wrap:anywhere}
.running-history-entry time,.running-history-entry header span{font-size:11px;color:#aebbc4}
.running-history-actions{display:flex;gap:4px;flex-shrink:0}
.running-history-actions button,.running-history-editor-head button{display:grid;place-items:center;width:44px;height:44px;padding:0;background:transparent;color:#dce5eb;border:1px solid #34424c;border-radius:6px}
.running-history-actions button[data-running-history-delete]{color:#ff7a86}
.running-history-actions svg,.running-history-editor-head svg{width:18px;height:18px}
.running-history-entry>.running-history-metrics{margin-top:12px;border-top:1px solid #28333b}
.running-history-metrics dd{font-size:16px}
.running-history-entry details{border-top:1px solid #28333b}
.running-history-entry summary{padding:12px 0;color:#b6c9d5;cursor:pointer;font-size:12px}
.running-history-editor-head{display:flex;align-items:center;gap:12px}
.running-history-editor-head h1{font-size:22px;margin:0}
.running-history-form{display:grid;gap:16px;padding-bottom:24px;min-width:0}
.running-history-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}
.running-history-form .field{min-width:0;margin:0}
.running-history-form input{min-width:0;width:100%;min-height:44px;box-sizing:border-box;color-scheme:dark}
.running-history-form footer{display:grid;grid-template-columns:1fr 1fr;gap:12px;position:static}
.running-history-form footer button{min-height:48px;white-space:normal}
.running-history-form [role="alert"]{margin:0;color:#ff96a0;font-size:12px}
.running-history :is(button,input,summary):focus-visible{outline:2px solid #57d2d0;outline-offset:3px}
.running-history button:disabled{opacity:.5;cursor:wait}
@media(max-width:360px){.running-history-entry{padding:10px}.running-history-totals>div,.running-history-metrics>div{padding:10px 5px}.running-history-totals dd{font-size:16px}.running-history-entry h2{font-size:14px}}
.running-active>footer:has(.running-discard){width:min(100%,336px);grid-template-columns:48px minmax(0,220px) 48px;justify-self:center;justify-content:center}
.running-active>footer:has(.running-discard) :is(.running-stop,.running-pause,.running-discard){height:48px}
.running-active>footer:has(.running-discard) .running-stop{width:48px}
.running-active>footer:has(.running-discard) .running-pause{width:100%}
.running-active .running-discard{display:grid;place-items:center;width:48px;height:48px;padding:0;border:1px solid #713239;border-radius:50%;background:#180d0f;color:#ff7279}
.running-active .running-discard svg{width:20px;height:20px}
.running-active .running-discard:focus-visible{outline:2px solid #ff7279;outline-offset:3px}
.running-active button:disabled{opacity:.5;cursor:wait}
.running-active{min-height:calc(100dvh - var(--topbar-height,62px) - var(--bottom-nav-height,64px));display:grid;grid-template-rows:auto 1fr auto;padding:0 2px 18px;background:#080a0c}.running-active>header{display:grid;grid-template-columns:44px 1fr 12px;align-items:center;gap:10px;padding:8px 0 14px}.running-active>header button{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:#14181c;color:#fff}.running-active>header svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2}.running-active>header strong,.running-active>header small{display:block}.running-active>header strong{font-size:12px}.running-active>header small{margin-top:3px;color:#82919a;font-size:8.5px}.running-live-dot{width:8px;height:8px;border-radius:50%;background:#ef343c;box-shadow:0 0 0 5px rgba(239,52,60,.12);animation:runningPulse 1.6s ease-in-out infinite}.running-primary-metric{display:grid;justify-items:center;padding:22px 0 18px}.running-primary-metric small{color:#82919b;font-size:9px;text-transform:uppercase}.running-primary-metric strong{margin:6px 0 5px;color:#fff;font-size:64px;line-height:1;font-variant-numeric:tabular-nums}.running-primary-metric span{color:#f14950;font-size:11px;font-weight:900}.running-live-grid{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid rgba(255,255,255,.08);border-bottom:1px solid rgba(255,255,255,.08)}.running-live-grid>div{min-width:0;padding:13px 5px;text-align:center}.running-live-grid>div:nth-child(n+4){border-top:1px solid rgba(255,255,255,.07)}.running-live-grid>div:not(:nth-child(3n+1)){border-left:1px solid rgba(255,255,255,.07)}.running-live-grid small,.running-live-grid strong,.running-live-grid em{display:block}.running-live-grid small{color:#71808b;font-size:8px;text-transform:uppercase}.running-live-grid strong{margin-top:5px;font-size:18px;font-variant-numeric:tabular-nums}.running-live-grid em{margin-top:2px;color:#7e8d97;font-size:8px;font-style:normal}.running-current-block{margin-top:18px;padding:14px;border-radius:12px;background:#111418}.running-current-block header,.running-current-block>div:last-child{display:flex;align-items:center;justify-content:space-between}.running-current-block header span{color:#e73b42;font-size:9px;font-weight:900}.running-current-block header strong{font-size:13px}.running-block-progress{height:4px;margin:12px 0;border-radius:4px;background:#242b31;overflow:hidden}.running-block-progress i{display:block;height:100%;background:#e42d35}.running-current-block>div:last-child span{font-size:12px;font-weight:900}.running-current-block>div:last-child small{color:#7b8a94;font-size:8.5px}.running-active>footer{display:grid;grid-template-columns:64px 1fr;gap:10px;align-items:center;padding-top:18px}.running-stop{display:grid;place-items:center;width:64px;height:64px;border:1px solid rgba(239,52,60,.4);border-radius:50%;background:#180d0f}.running-stop span{width:19px;height:19px;border-radius:4px;background:#ef343c}.running-pause{height:56px;border:0;border-radius:12px;background:#e82e36;color:#fff;font-size:12px;font-weight:950}.running-history-list article{display:grid;grid-template-columns:72px 1fr auto;align-items:center;gap:10px;padding:13px;border-bottom:1px solid rgba(255,255,255,.08)}.running-history-list time{color:#7d8c96;font-size:9px}.running-history-list article strong,.running-history-list article small{display:block}.running-history-list article>div strong{font-size:11px}.running-history-list article small{margin-top:3px;color:#74838d;font-size:8.5px}.running-history-list article>span{text-align:right}.running-history-list article>span strong{font-size:11px;font-variant-numeric:tabular-nums}
.running-route-card{display:grid;gap:8px;margin:0 0 16px}.running-route-card>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-inline:2px}.running-route-card>header strong,.running-route-card>header small{display:block}.running-route-card>header strong{font-size:12px}.running-route-card>header small{margin-top:2px;color:#82919a;font-size:8.5px}.running-route-card>header>span{display:inline-flex;align-items:center;gap:5px;color:#ff6268;font-size:8px;font-weight:900;text-transform:uppercase}.running-route-card>header>span::before{content:'';width:6px;height:6px;border-radius:50%;background:#ef343c;box-shadow:0 0 0 4px rgba(239,52,60,.12)}
.running-route-map{position:relative;height:clamp(190px,28dvh,260px);overflow:hidden;isolation:isolate;border:1px solid #26333c;border-radius:12px;background:#11171b;color:#fff}.running-route-tiles{position:absolute;inset:0;overflow:hidden;background:#161c20}.running-route-tiles img{position:absolute;width:256px;height:256px;max-width:none;opacity:.68;filter:grayscale(.85) invert(.9) hue-rotate(170deg) brightness(.43) contrast(1.28)}.running-route-overlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.running-route-shadow,.running-route-line{fill:none;stroke-linecap:round;stroke-linejoin:round}.running-route-shadow{stroke:rgba(3,6,8,.9);stroke-width:8}.running-route-line{stroke:#f42b43;stroke-width:4}.running-route-accuracy{fill:rgba(74,196,255,.13);stroke:rgba(74,196,255,.32);stroke-width:1}.running-route-start{fill:#fff;stroke:#12171a;stroke-width:3}.running-route-current-ring{fill:rgba(244,43,67,.18);stroke:rgba(255,255,255,.9);stroke-width:2}.running-route-current{fill:#f42b43}.running-route-empty{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;padding:24px;text-align:center;background:#11171b}.running-route-empty[hidden],.running-route-overlay[hidden]{display:none}.running-route-empty>span{width:18px;height:18px;margin-bottom:12px;border:2px solid #54636d;border-top-color:#f42b43;border-radius:50%;animation:runningRouteAcquire 1s linear infinite}.running-route-empty strong{font-size:12px}.running-route-empty small{max-width:250px;margin-top:5px;color:#91a0aa;font-size:9px;line-height:1.45}.running-route-status,.running-route-attribution{position:absolute;z-index:2;bottom:8px;background:rgba(8,12,15,.9);color:#d8e0e5}.running-route-status{left:8px;display:grid;grid-template-columns:7px auto;align-items:center;gap:0 6px;padding:6px 8px;border-radius:7px}.running-route-status>span{grid-row:1/3;width:7px;height:7px;border-radius:50%;background:#7f8d96}.running-route-map[data-gps-quality=good] .running-route-status>span{background:#31d58a}.running-route-map[data-gps-quality=fair] .running-route-status>span{background:#f0b733}.running-route-map[data-gps-quality=degraded] .running-route-status>span{background:#f34a52}.running-route-status strong{font-size:8px}.running-route-status small{color:#9cabb4;font-size:7px}.running-route-attribution{right:8px;padding:5px 7px;border-radius:5px;font-size:7px;text-decoration:none}.running-route-attribution:focus-visible{outline:2px solid #fff;outline-offset:2px}
.health-connections{display:grid;gap:12px}.health-connect-hero{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;border-radius:12px;background:#11161a}.health-connect-hero>div{display:flex;align-items:center;gap:10px}.health-connect-hero svg{width:30px;height:30px;fill:none;stroke:#e53a41;stroke-width:1.7}.health-connect-hero strong,.health-connect-hero small{display:block}.health-connect-hero strong{font-size:13px}.health-connect-hero small{margin-top:3px;color:#82939e;font-size:9px}.health-connect-hero button{width:auto;min-height:44px}.health-connect-copy{margin:0;color:#8797a1;font-size:10px;line-height:1.5}.health-capability-list,.health-permission-list{display:grid;gap:8px;padding:14px;border:1px solid rgba(255,255,255,.08);border-radius:12px}.health-capability-list>strong,.health-permission-list>strong{font-size:12px}.health-provider-row{display:grid;grid-template-columns:38px 1fr auto;align-items:center;gap:9px;padding:9px 0;border-top:1px solid rgba(255,255,255,.07)}.health-provider-logo{display:grid;place-items:center;width:38px;height:38px;border-radius:9px;background:#20262b;color:#cbd5db;font-size:10px;font-weight:950}.health-provider-row strong,.health-provider-row small{display:block}.health-provider-row strong{font-size:10px}.health-provider-row small{margin-top:2px;color:#788892;font-size:8px}.health-provider-row em{color:#697984;font-size:8px;font-style:normal}.health-provider-row em.available{color:#58d7a0}.health-permission-list span,.health-permission-list small{color:#82939e;font-size:9px;line-height:1.45}
@keyframes runningPulse{50%{transform:scale(.78);box-shadow:0 0 0 8px rgba(239,52,60,.05)}}
@keyframes runningRouteAcquire{to{transform:rotate(1turn)}}
@media(max-width:760px){.running-block-editor{grid-template-columns:24px repeat(2,minmax(0,1fr)) 40px}.running-block-editor .field:nth-of-type(n+3){grid-column:auto}.running-repeat{grid-column:2}.running-session-editor>header{grid-template-columns:28px 1fr 40px}.running-session-editor>header .field:nth-of-type(2){grid-column:2}.running-session-editor>header>button{grid-column:3;grid-row:1}.training-plan-card{border-radius:12px;background:#111418}}
@media(max-width:360px){.training-module-switch button{grid-template-columns:26px 1fr;padding-inline:7px}.training-module-switch button :is(svg,.training-running-icon){width:20px;height:20px}.training-module-switch button small{display:none}.running-live-grid{grid-template-columns:repeat(2,1fr)}.running-live-grid>div:nth-child(n+3){border-top:1px solid rgba(255,255,255,.07)}.running-live-grid>div:not(:nth-child(2n+1)){border-left:1px solid rgba(255,255,255,.07)}.running-live-grid>div:nth-child(odd){border-left:0}.running-history-list article{grid-template-columns:58px 1fr}}
@media(prefers-reduced-motion:reduce){.running-live-dot,.running-route-empty>span{animation:none}}
@media(max-width:360px){.running-primary-metric strong{font-size:52px}}

/* Editor modular de corrida */
.running-editor{padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))}
.running-editor-form{display:grid;gap:0}
.running-editor-steps{position:sticky;top:0;z-index:3;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:4px 0 14px;background:#080a0c}
.running-editor-steps::before{content:"";position:absolute;top:19px;left:16.666%;right:16.666%;height:1px;background:#2a3339}
.running-editor-steps button{position:relative;z-index:1;display:grid;justify-items:center;gap:6px;min-width:0;min-height:48px;padding:0;border:0;background:transparent;color:#74838d;font-size:11px;font-weight:800}
.running-editor-steps button>span{display:grid;place-items:center;width:32px;height:32px;border:1px solid #354048;border-radius:50%;background:#0d1114;color:#9eabb3;font-variant-numeric:tabular-nums}
.running-editor-steps button>span svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2}
.running-editor-steps button.active,.running-editor-steps button.complete{color:#f1f5f7}
.running-editor-steps button.active>span{border-color:#ef233c;background:#ef233c;color:#fff;box-shadow:0 6px 18px rgba(239,35,60,.22)}
.running-editor-steps button.complete>span{border-color:#8e202b;background:#211014;color:#ff737f}
.running-editor-stage{display:grid;gap:18px;padding:20px 0 8px;border-top:1px solid rgba(255,255,255,.08)}
.running-editor-stage>header{display:grid;gap:4px}
.running-editor-stage>header h2{margin:0;font-size:21px;line-height:1.15}
.running-editor-stage>header p{margin:0;color:#93a0a8;font-size:12px;line-height:1.55}
.running-editor-stage .field{display:grid;gap:7px;min-width:0}
.running-editor-stage .field>label{font-size:11px;font-weight:850;color:#e7ecef}
.running-editor-stage .field>small{min-height:14px;color:#7f8c95;font-size:10px;line-height:1.35}
.running-editor-stage input,.running-editor-stage select{width:100%;min-width:0;min-height:48px;padding:0 13px;border:1px solid #2a3840;border-radius:9px;background:#0a1014;color:#f5f7f8;font-size:13px;font-weight:700}
.running-editor-stage input:focus,.running-editor-stage select:focus{outline:2px solid rgba(239,35,60,.34);outline-offset:1px;border-color:#ef233c}
.running-session-tabs{display:flex;gap:8px;max-width:100%;padding:2px 0 5px;overflow-x:auto;scrollbar-width:none}
.running-session-tabs::-webkit-scrollbar{display:none}
.running-session-tabs button{display:flex;align-items:center;gap:8px;flex:0 0 auto;min-height:48px;max-width:190px;padding:0 14px;border:1px solid #263239;border-radius:9px;background:#0c1115;color:#9ca8af;font-size:11px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.running-session-tabs button>span{display:grid;place-items:center;flex:0 0 24px;width:24px;height:24px;border-radius:50%;background:#20282d;color:#b7c1c7;font-size:10px}
.running-session-tabs button.active{border-color:#b51d2e;background:#1b1013;color:#fff}
.running-session-tabs button.active>span{background:#ef233c;color:#fff}
.running-session-tabs button.add{width:48px;padding:0;justify-content:center;border-style:dashed;color:#ff6675}
.running-session-tabs button.add svg,.running-add-block svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2}
.running-session-stage{display:grid;gap:18px;padding:16px;border:1px solid rgba(255,255,255,.09);border-radius:12px;background:#101418}
.running-session-stage>header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.running-session-stage>header div{display:grid;gap:3px;min-width:0}
.running-session-stage>header small{color:#ec4a58;font-size:9px;font-weight:900;text-transform:uppercase}
.running-session-stage>header h3{margin:0;overflow:hidden;color:#fff;font-size:17px;text-overflow:ellipsis;white-space:nowrap}
.running-session-stage>header>button{display:grid;place-items:center;width:48px;height:48px;padding:0;border:1px solid #4c2026;border-radius:9px;background:#1d1013;color:#ff6b78}
.running-session-stage>header>button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}
.running-sequence-heading{display:flex;align-items:end;justify-content:space-between;gap:12px;padding-top:4px}
.running-sequence-heading>div{display:grid;gap:3px}
.running-sequence-heading strong{font-size:13px}
.running-sequence-heading small{color:#7f8c95;font-size:10px}
.running-sequence-heading>span{flex:0 0 auto;color:#ec4a58;font-size:9px;font-weight:900;text-transform:uppercase}
.running-block-sequence{display:grid;gap:0;margin:0;padding:0;list-style:none}
.running-block-sequence li{position:relative;display:grid;grid-template-columns:34px minmax(0,1fr) 48px;align-items:center;min-height:64px;border-top:1px solid rgba(255,255,255,.075)}
.running-block-sequence li:last-child{border-bottom:1px solid rgba(255,255,255,.075)}
.running-block-sequence-index{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#20272c;color:#e7ecef;font-size:10px;font-weight:900}
.running-block-sequence li>button:not(.remove){display:grid;gap:3px;min-width:0;min-height:56px;padding:8px 6px;border:0;background:transparent;text-align:left;color:#fff}
.running-block-sequence li>button strong{font-size:12px}
.running-block-sequence li>button small{overflow:hidden;color:#87959e;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.running-block-sequence .remove{display:grid;place-items:center;width:48px;height:48px;padding:0;border:0;background:transparent;color:#a66169}
.running-block-sequence .remove svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2}
.running-add-block{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;border:1px dashed #633039;border-radius:9px;background:#151013;color:#ff6b78;font-size:11px;font-weight:900}
.running-block-stage{display:grid;gap:18px;padding:16px;border-radius:10px;background:#090d10}
.running-block-stage>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,.08)}
.running-block-stage>header div{display:grid;gap:3px}
.running-block-stage>header small{color:#ec4a58;font-size:9px;font-weight:900;text-transform:uppercase}
.running-block-stage>header h3{margin:0;font-size:16px}
.running-block-stage>header button{width:48px;height:48px;border:0;background:transparent;color:#aeb7bc;font-size:22px}
.running-block-stage-grid{display:grid;gap:18px}
.running-block-stage-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.running-block-repeat-field{max-width:50%}
.running-block-stage>.primary{min-height:48px}
.running-editor-footer{position:relative;z-index:1;display:grid;grid-template-columns:1fr 1.35fr;gap:10px;margin:18px 0 0;padding:12px 0 0;border-top:1px solid rgba(255,255,255,.08);background:#080a0c}
.running-editor-footer>button{min-height:50px}
.running-review-plan{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 0;border-bottom:1px solid rgba(255,255,255,.09)}
.running-review-plan>div{display:grid;gap:4px}.running-review-plan strong{font-size:16px}.running-review-plan small{color:#89979f;font-size:11px}
.running-review-plan>button,.running-review-sessions header button{min-width:48px;min-height:48px;padding:0 12px;border:0;background:transparent;color:#ff6675;font-size:11px;font-weight:900}
.running-review-metrics{display:grid;grid-template-columns:repeat(3,1fr);border:1px solid rgba(255,255,255,.09);border-radius:10px;background:#101418}
.running-review-metrics span{display:grid;justify-items:center;gap:3px;padding:14px 6px;border-right:1px solid rgba(255,255,255,.08)}.running-review-metrics span:last-child{border:0}.running-review-metrics strong{font-size:17px}.running-review-metrics small{color:#7f8d95;font-size:9px;text-transform:uppercase}
.running-review-sessions{display:grid;gap:20px}.running-review-sessions article{border-top:1px solid rgba(255,255,255,.1)}.running-review-sessions article>header{display:flex;align-items:center;justify-content:space-between;padding:13px 0}.running-review-sessions article>header div{display:grid;gap:2px}.running-review-sessions article>header span{color:#ec4a58;font-size:9px;font-weight:900;text-transform:uppercase}.running-review-sessions article>header strong{font-size:14px}.running-review-sessions article>header small{color:#839199;font-size:10px}.running-review-sessions ol{display:grid;gap:8px;margin:0;padding:0;list-style:none}.running-review-sessions li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 10px;padding:10px 12px;border-radius:8px;background:#101418}.running-review-sessions li span{font-size:11px;font-weight:800}.running-review-sessions li strong{font-size:11px}.running-review-sessions li small{grid-column:1/-1;color:#7f8c95;font-size:9px}
@media(max-width:420px){.running-editor-stage .grid-2,.running-block-stage-row{grid-template-columns:1fr}.running-block-repeat-field{max-width:none}.running-session-stage{padding:14px 12px}.running-editor-steps button small{font-size:10px}.running-editor-footer{grid-template-columns:1fr 1.2fr}}

/* Destaques permanentes do perfil */
.profile-highlights {
  align-items: start;
  gap: 10px;
  padding: 6px 0 12px;
  scroll-snap-type: x proximity;
}
.profile-highlights button {
  min-width: 68px;
  min-height: 84px;
  scroll-snap-align: start;
}
.profile-highlights .profile-highlight-cover,
.profile-highlights .profile-highlight-add > span {
  width: 64px;
  height: 64px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.2);
  background: #111419;
}
.profile-highlights .profile-highlight-add > span {
  border-style: dashed;
  border-color: rgba(225,27,34,.72);
  color: var(--red, #e11b22);
}
.profile-highlights .profile-highlight-add svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.profile-highlight-cover img,
.profile-highlight-cover video,
.profile-highlight-manage-cover img,
.profile-highlight-manage-cover video {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.profile-highlight-card:focus-visible .profile-highlight-cover {
  outline: 2px solid var(--red, #e11b22);
  outline-offset: 2px;
}
.profile-highlight-fallback {
  width: 100%;
  height: 100%;
  border: 0 !important;
  background: #15191f !important;
}
.profile-highlight-fallback svg {
  width: 26px;
  fill: none;
  stroke: #9ca6b4;
  stroke-width: 1.5;
}
.profile-highlight-settings {
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}
.profile-highlight-new-top svg,
.profile-settings-nav-icon svg,
.profile-highlight-empty > svg,
.profile-highlight-drag svg,
.highlight-story-drag svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.profile-highlight-settings-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 2px;
  border-bottom: 1px solid var(--border);
}
.profile-highlight-settings-summary span { color: var(--muted); font-size: 12px; font-weight: 800; }
.profile-highlight-settings-summary span strong { color: var(--text); font-size: 20px; }
.profile-highlight-settings-summary small { color: var(--muted); font-size: 10px; }
.profile-highlight-manage-list { display: grid; gap: 8px; padding-top: 14px; }
.profile-highlight-manage-row {
  display: grid;
  grid-template-columns: 40px 52px minmax(0, 1fr) auto 40px;
  gap: 10px;
  align-items: center;
  min-height: 70px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101318;
}
.profile-highlight-manage-row.dragging { opacity: .48; border-color: var(--red, #e11b22); }
.profile-highlight-drag,
.highlight-story-drag {
  width: 40px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: grab;
  touch-action: none;
}
.profile-highlight-manage-cover {
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
  background: #171b21;
}
.profile-highlight-manage-row > span:nth-of-type(2) { min-width: 0; display: grid; gap: 3px; }
.profile-highlight-manage-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-highlight-manage-row small { color: var(--muted); font-size: 10px; }
.profile-highlight-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}
.profile-highlight-empty > svg { width: 42px; height: 42px; color: var(--red, #e11b22); }
.profile-highlight-empty p { max-width: 280px; margin: 0 0 8px; }
.profile-highlight-empty.compact { min-height: 150px; }
.profile-highlight-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.82);
}
.profile-highlight-editor {
  width: min(100%, 720px);
  max-height: min(92dvh, 860px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0b0e12;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.profile-highlight-editor > header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(11,14,18,.96);
}
.profile-highlight-editor > header h2,
.profile-highlight-editor > header small { margin: 0; }
.profile-highlight-editor > header small { color: var(--red, #e11b22); font-size: 9px; font-weight: 900; }
.profile-highlight-editor form { display: grid; gap: 16px; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.highlight-editor-section { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.highlight-editor-section-head { display: flex; justify-content: space-between; gap: 12px; }
.highlight-editor-section-head > div { display: grid; gap: 3px; }
.highlight-editor-section-head small,
.highlight-editor-section-head em { color: var(--muted); font-size: 10px; font-style: normal; }
.highlight-selected-list { display: grid; gap: 7px; }
.highlight-selected-story {
  display: grid;
  grid-template-columns: 38px 48px minmax(0, 1fr) auto 40px;
  gap: 8px;
  align-items: center;
  min-height: 62px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #11151a;
}
.highlight-selected-story.dragging { opacity: .5; }
.highlight-selected-story > span { width: 46px; height: 46px; overflow: hidden; border-radius: 6px; }
.highlight-selected-story img,
.highlight-selected-story video,
.highlight-archive-item img,
.highlight-archive-item video { width: 100%; height: 100%; object-fit: cover; }
.highlight-selected-story > div { min-width: 0; display: grid; }
.highlight-selected-story small { color: var(--muted); font-size: 9px; }
.highlight-cover-radio input { position: absolute; opacity: 0; }
.highlight-cover-radio span {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}
.highlight-cover-radio input:checked + span { border-color: var(--red, #e11b22); color: #fff; background: rgba(225,27,34,.15); }
.highlight-archive-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.highlight-archive-item {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #15191f;
}
.highlight-archive-item input { position: absolute; opacity: 0; }
.highlight-archive-item > span { display: block; width: 100%; height: 100%; }
.highlight-archive-item em {
  position: absolute;
  inset: auto 4px 4px;
  padding: 3px 4px;
  border-radius: 4px;
  color: #fff;
  background: rgba(0,0,0,.72);
  font-size: 8px;
  font-style: normal;
  text-align: center;
}
.highlight-archive-item.selected { border-color: var(--red, #e11b22); box-shadow: inset 0 0 0 2px var(--red, #e11b22); }
.profile-highlight-skeleton { height: 220px; border-radius: 8px; background: #15191f; animation: skeletonPulse 1.2s ease-in-out infinite; }
.profile-highlight-viewer-actions { display: flex; gap: 4px; }
.profile-highlight-viewer-actions svg { width: 23px; height: 23px; }
.profile-highlight-viewer-menu {
  position: absolute;
  top: 54px;
  right: 12px;
  z-index: 8;
  min-width: 190px;
  display: grid;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #11151a;
  box-shadow: 0 12px 32px rgba(0,0,0,.42);
}
.profile-highlight-viewer-menu button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  text-align: left;
}
.profile-highlight-viewer-menu button.danger { color: #ff5666; }
.viewed-profile-body > .profile-highlights { padding-inline: 0; }

@media (max-width: 600px) {
  .profile-highlight-editor-backdrop { place-items: stretch; }
  .profile-highlight-editor { width: 100%; max-height: 100dvh; height: 100dvh; border: 0; border-radius: 0; }
  .profile-highlight-manage-row { grid-template-columns: 36px 48px minmax(0, 1fr) 40px; }
  .profile-highlight-manage-row > .secondary { grid-column: 2 / 4; min-height: 38px; }
  .highlight-archive-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .highlight-selected-story { grid-template-columns: 34px 44px minmax(0, 1fr) 40px; }
  .highlight-cover-radio { grid-column: 3 / 4; }
}


.profile-challenges-empty > svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: var(--red, #e11b22);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Nutrition top action rail: five equal, labeled controls. */
.diet-header-clean {
  display: block;
  width: 100%;
  margin: 0 0 4px;
  padding: 0;
}
.diet-header-clean .diet-header-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-flow: initial;
  align-items: stretch;
  width: 100%;
  gap: 0;
  border-bottom: 1px solid rgba(120, 143, 158, 0.2);
}
.diet-header-clean .diet-header-actions > .diet-plans-menu-wrap,
.diet-header-clean .diet-header-actions > .diet-header-action-btn {
  width: 100%;
  height: 64px;
  min-width: 0;
  min-height: 48px;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  flex: none;
}
.diet-header-clean .diet-header-actions > .diet-plans-menu-wrap {
  position: relative;
  display: block;
}
.diet-header-clean .diet-header-action-btn,
.diet-header-clean .diet-header-actions > .diet-plans-menu-wrap > .diet-plans-menu-btn,
.diet-header-clean .diet-header-actions > .pdf-import-trigger-compact {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 64px;
  min-width: 0;
  min-height: 48px;
  max-width: none;
  max-height: none;
  gap: 5px;
  padding: 8px 2px 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8fa0ad;
  box-shadow: none;
}
.diet-header-clean .diet-header-action-btn::after,
.diet-header-clean .pdf-import-trigger-compact::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 2px;
  background: transparent;
}
.diet-header-clean .diet-header-action-btn:is(:hover, :focus-visible),
.diet-header-clean .pdf-import-trigger-compact:is(:hover, :focus-visible) {
  color: #fff;
  background: rgba(255, 255, 255, 0.025);
  outline: none;
}
.diet-header-clean .diet-header-action-btn.active {
  color: #fff;
}
.diet-header-clean .diet-header-action-btn.active::after {
  background: var(--red);
}
.diet-header-clean .diet-header-action-btn > span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: currentColor;
}
.diet-header-clean .diet-header-action-btn svg,
.diet-header-clean .pdf-import-trigger-compact > svg {
  display: block;
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
}
.diet-header-clean .diet-header-action-btn strong {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  clip: auto;
  color: currentColor;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  border: 0;
}
.diet-header-clean .diet-plans-menu {
  top: calc(100% + 8px);
  right: auto;
  left: 0;
  width: min(250px, calc(100vw - 34px));
}
html[data-theme='light'] .diet-header-clean .diet-header-action-btn,
body.theme-light .diet-header-clean .diet-header-action-btn {
  color: #435563;
  border: 0;
  background: transparent;
}
html[data-theme='light'] .diet-header-clean .diet-header-action-btn.active,
body.theme-light .diet-header-clean .diet-header-action-btn.active {
  color: #11181e;
}
/* Unified fitness publication: media first, independent scrolling, stable touch targets. */
.social-composer-backdrop .social-composer-panel.social-unified-composer{box-sizing:border-box;width:min(960px,calc(100vw - 32px));inline-size:min(960px,calc(100vw - 32px));max-width:960px;max-inline-size:960px;max-height:calc(100dvh - 32px);max-block-size:calc(100dvh - 32px);padding:0;display:flex;flex-direction:column;overflow:hidden;border-radius:8px;background:#101214}
.social-unified-composer .social-composer-head{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;flex:none;border-bottom:1px solid #303438}
.social-unified-composer form{min-height:0;display:flex;flex-direction:column;overflow:hidden}
.social-publication-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);overflow:auto;min-height:0}
.social-publication-media,.social-publication-fields{min-width:0;padding:20px;display:flex;flex-direction:column;gap:16px}
.social-publication-fields{border-left:1px solid #303438}
.social-publication-fields .field{display:flex;flex-direction:column;gap:8px;margin:0}
.social-publication-fields :is(input,select,textarea){width:100%;min-width:0;box-sizing:border-box;font-size:16px}
.social-publication-thumbs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.social-publication-thumbs:empty{display:none}
.social-public-attachment>[data-public-view]{display:flex;align-items:center;gap:12px;width:100%;padding:18px 12px;text-align:left;background:transparent;color:inherit;border:0;min-height:48px}
.social-public-attachment>[data-public-view] strong{min-width:0;overflow-wrap:anywhere}
.social-post-actions [data-public-post] svg,.social-reel-actions [data-public-post] svg{width:24px;height:24px}

.consistency-backdrop.diet-floating { position: fixed; inset: 0; z-index: 20100; padding: 16px; display: grid; place-items: center; }
.consistency-panel.diet-floating-panel { width: min(960px,100%); max-width: 100%; max-height: calc(100dvh - 32px); padding: 0; display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; border-radius: 8px; }
.consistency-head { padding: 18px 20px; margin: 0; border-bottom: 1px solid var(--border); }
.consistency-head h2 { margin: 0; font-size: 22px; }
.consistency-head .icon-btn { flex: 0 0 44px; width: 44px; height: 44px; }
.consistency-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 24px; }
.consistency-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.consistency-toolbar label { display: flex; align-items: center; gap: 10px; }
.consistency-toolbar select,.consistency-toolbar button { width: auto; min-height: 44px; }
.consistency-activities { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.consistency-activity { min-width: 0; padding: 0 14px 0 0; border-right: 1px solid var(--border); }
.consistency-activity:last-child { border: 0; padding-right: 0; }
.consistency-activity header { display: flex; align-items: center; gap: 8px; }
.consistency-activity header svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.consistency-activity header .training-running-icon { width: 24px; height: 24px; }
.consistency-toolbar button { border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 6px; padding: 8px 14px; }
.consistency-activity:nth-child(1) header { color: #f15e74; }
.consistency-activity:nth-child(2) header { color: #78c9dc; }
.consistency-activity:nth-child(3) header { color: #8dca9d; }
.consistency-activity h3,.consistency-calendar h3,.consistency-evolution h3 { margin: 0 0 10px; font-size: 17px; }
.consistency-activity strong { font-size: 26px; display: block; margin: 6px 0; }
.consistency-activity small { font-size: 12px; display: block; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.consistency-activity p { font-size: 13px; line-height: 1.5; margin: 8px 0; }
.consistency-activity progress { width: 100%; height: 6px; accent-color: #f33750; }
.consistency-calendar,.consistency-evolution { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.consistency-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 6px; }
.consistency-days>div { display: grid; gap: 3px; min-width: 0; padding: 6px; text-align: center; background: rgba(128,128,128,.06); border-radius: 4px; }
.consistency-days i { display: block; height: 3px; background: var(--border); }
.consistency-days .has-training { background: #f15e74; }
.consistency-days .has-running { background: #78c9dc; }
.consistency-days .has-diet { background: #8dca9d; }
.consistency-legend { display: flex; gap: 16px; font-size: 12px; margin-top: 10px; }
.consistency-legend span { border-left: 4px solid #f15e74; padding-left: 6px; }
.consistency-legend span:nth-child(2) { border-color: #78c9dc; }
.consistency-legend span:nth-child(3) { border-color: #8dca9d; }
.consistency-evolution header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.consistency-evolution header span { color: var(--muted); }
.consistency-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.consistency-metrics h4 { font-size: 14px; margin: 8px 0; }
.consistency-metrics strong { display: block; font-size: 24px; }
.consistency-metrics strong small { font-size: 13px; }
.consistency-metrics p,.consistency-evolution>p { font-size: 13px; }
.consistency-metrics article { min-width: 0; overflow-wrap: anywhere; }
.consistency-footnote,.consistency-evolution>small { font-size: 12px; color: var(--muted); line-height: 1.5; }
html[data-theme="light"] .consistency-activity:nth-child(1) header { color: #ad1836; }
html[data-theme="light"] .consistency-activity:nth-child(2) header { color: #226d7f; }
html[data-theme="light"] .consistency-activity:nth-child(3) header { color: #347345; }
@media(max-width:600px) {
  .consistency-backdrop.diet-floating { padding: 0; }
  .consistency-panel.diet-floating-panel { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .consistency-head { padding: calc(12px + env(safe-area-inset-top,0px)) 16px 12px; }
  .consistency-body { padding: 16px 16px calc(24px + env(safe-area-inset-bottom,0px)); }
  .consistency-activities { grid-template-columns: 1fr; }
  .consistency-activity { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 14px; }
  .consistency-metrics { grid-template-columns: 1fr; gap: 6px; }
  .consistency-metrics article { border-bottom: 1px solid var(--border); }
}

.community-ct-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 0 16px;
}
.community-ct-grid .community-ct-card {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 92px;
  padding: 16px 12px;
  text-align: left;
  color: var(--text);
  background: var(--surface, #111519);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.community-ct-card:first-child { grid-column: 1 / -1; min-height: 76px; }
.community-ct-card strong { min-width: 0; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.community-ct-icon { display: grid; place-items: center; width: 36px; height: 36px; color: #f33750; }
.community-ct-ranking .community-ct-icon { color: #67c5d1; }
.community-ct-tasks .community-ct-icon { color: #87c89b; }
.community-ct-season .community-ct-icon { color: #dabf73; }
.community-ct-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.community-ct-arrow { font-size: 24px; color: var(--muted); }
.community-ct-grid .community-ct-card:hover { border-color: #c7394f; }
.community-ct-grid .community-ct-card:focus-visible { outline: 2px solid #ef3550; outline-offset: 3px; }
html[data-theme="light"] .community-ct-grid .community-ct-card { background: #fff; color: #15191e; }
html[data-theme="light"] .community-ct-icon { color: #bd203b; }
html[data-theme="light"] .community-ct-ranking .community-ct-icon { color: #247381; }
html[data-theme="light"] .community-ct-tasks .community-ct-icon { color: #347a49; }
html[data-theme="light"] .community-ct-season .community-ct-icon { color: #82671c; }
@media (max-width: 379px) {
  .community-ct-grid .community-ct-card { grid-template-columns: 28px minmax(0,1fr); gap: 8px; padding: 12px 10px; }
  .community-ct-icon { width: 28px; height: 28px; }
  .community-ct-arrow { display: none; }
}
@media (min-width: 900px) {
  .community-ct-grid { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .community-ct-grid .community-ct-card { grid-template-columns: 1fr 12px; min-height: 124px; }
  .community-ct-card:first-child { grid-column: auto; }
  .community-ct-icon { grid-column: 1 / -1; }
}

.social-post .social-post-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
}
.social-post .social-post-actions > button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  gap: 5px;
  margin-left: 0;
  padding: 8px 2px;
}
.social-action-count {
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: inherit;
}
.social-post-actions > button > svg,
.social-post-actions > button > img,
.social-reel-actions > button > svg,
.social-reel-actions > button > img {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}
.social-reel-actions > button:has(.social-action-count) {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-width: 76px;
  min-height: 44px;
  padding: 6px 2px;
}
.social-content-page{position:fixed;inset:0;z-index:20100;width:100%;height:100dvh;box-sizing:border-box;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:var(--bg,#101214);color:var(--text,#f4f5f6);padding-inline:env(safe-area-inset-left) env(safe-area-inset-right)}
.social-content-page>header{display:flex;align-items:center;gap:12px;padding:12px 20px;padding-top:max(12px,env(safe-area-inset-top));border-bottom:1px solid var(--border,#303438);min-width:0}
.social-content-page>header>div{display:flex;align-items:center;gap:12px;min-width:0}
.social-content-page h1{font-size:20px;line-height:1.3;margin:0;overflow-wrap:anywhere;letter-spacing:0}
.social-content-page svg,.social-content-page .chat-share-icon{width:24px;height:24px;flex:none;object-fit:contain}
.social-content-page>header>button{width:44px;height:44px;flex:none;border:0;background:transparent;color:inherit}
.social-content-page>main{overflow:auto;overscroll-behavior:contain;min-height:0;padding:20px max(16px,calc((100% - 960px)/2));overflow-wrap:anywhere}
.social-content-page>main>*{min-width:0;max-width:100%;box-sizing:border-box}
.social-content-page>footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px;padding-bottom:max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--border,#303438)}
.social-content-page>footer button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;white-space:normal}
.social-content-page>footer [role=status]{min-width:0;overflow-wrap:anywhere}
body:has(>.social-content-page){overflow:hidden}
body:has(>.social-content-page)>#app :is(.topbar,.bottom-nav){visibility:hidden;pointer-events:none}
@media(max-width:540px){.social-content-page>header{padding-inline:12px}.social-content-page h1{font-size:18px}.social-content-page>footer{flex-direction:column;align-items:stretch;padding-inline:16px}.social-content-page>footer [role=status]:empty{display:none}}
/* Publication is a full-screen workflow; only the current step scrolls. */
.diet-floating.social-composer-backdrop:has(.social-unified-composer){position:fixed;inset:0;width:100%;height:100dvh;max-height:none;padding:0;z-index:10050;transform:none;background:#101214}
.social-composer-backdrop .social-composer-panel.social-unified-composer{position:fixed;inset:0;width:100vw;inline-size:100vw;max-width:none;max-inline-size:none;height:100dvh;max-height:100dvh;max-block-size:100dvh;border:0;border-radius:0;margin:0;transform:none}
.social-unified-composer .social-composer-head{padding-top:max(12px,env(safe-area-inset-top));gap:12px}
.social-unified-composer .social-composer-head h3{flex:1;font-size:20px;margin:0;min-width:0;overflow-wrap:anywhere}
.social-unified-composer .social-composer-head>span{white-space:nowrap;font-size:14px}
.social-unified-composer #social-album-form{flex:1;min-height:0}
.social-unified-composer .social-publication-layout{display:block;flex:1;overscroll-behavior:contain}
.social-unified-composer [hidden]{display:none!important}
.social-unified-composer .social-publication-fields{border:0;width:100%;max-width:760px;margin:auto;box-sizing:border-box}
.social-unified-composer .social-publication-media{max-width:1100px;margin:auto}
.social-device-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr));gap:8px;align-items:stretch}
.social-device-gallery .social-publication-thumbs{display:contents}
.social-device-gallery figure{position:relative;border-radius:0;border:0;display:flex;flex-direction:column}
.social-device-gallery figure :is(img,video){object-fit:cover}
.social-unified-composer .social-device-gallery figcaption{position:static;display:grid;grid-template-columns:minmax(16px,1fr) 44px 44px;min-height:44px;padding:0 4px;background:#202428;color:#fff}
.social-unified-composer .social-device-gallery figcaption button{color:#fff;margin:0}
.social-unified-composer .social-device-gallery figcaption button:disabled{opacity:.4}
.social-device-gallery :is(.social-camera-tile,.social-publication-upload){position:relative;aspect-ratio:1;min-height:0;border:0;border-radius:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;background:#202428;color:#fff;cursor:pointer;text-align:center;font-size:14px}
.social-device-gallery .social-publication-upload{grid-column:2;grid-row:1}
.social-camera-tile input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.social-camera-tile:focus-within{outline:2px solid #fff;outline-offset:-3px}
.social-publication-preview>:is(.social-album,.social-media-frame){height:min(52dvh,520px);min-height:180px;width:100%;margin:0;background:#08090a}
.social-publication-preview .social-media-frame :is(img,video){object-fit:contain}
.social-publication-preview .social-media-play{display:none}
.social-unified-composer .social-publication-footer{padding-bottom:max(14px,env(safe-area-inset-bottom))}
.social-unified-composer .social-device-gallery :is(.social-camera-tile,.social-publication-upload){aspect-ratio:auto;min-height:180px;height:100%;box-sizing:border-box}
body:has(> [data-public-external] .social-unified-composer)>#app :is(.topbar,.bottom-nav){visibility:hidden;pointer-events:none}
body:has(> [data-public-external] .social-unified-composer){overflow:hidden}
.social-composer-backdrop .social-composer-panel.social-unified-composer{animation:none;display:grid;grid-template-rows:auto minmax(0,1fr);padding-inline:max(0px,env(safe-area-inset-left)) max(0px,env(safe-area-inset-right))}
.social-unified-composer .social-composer-head{position:relative;inset:auto;min-height:64px;box-sizing:border-box}
.social-unified-composer #social-album-form{display:grid;grid-template-rows:minmax(0,1fr) auto}
.social-unified-composer .social-publication-layout{overflow:auto;scroll-padding-block:16px}
.social-unified-composer .social-publication-footer{position:relative;inset:auto;background:#101214;min-width:0}
.social-unified-composer .social-publication-footer [role=status]{min-width:0;max-height:72px;overflow:auto}
@media(max-width:380px){.social-device-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.social-unified-composer .social-composer-head{padding-inline:12px}.social-unified-composer .social-composer-head h3{font-size:18px}}
.social-publication-thumbs figure{margin:0;min-width:0;overflow:hidden;border:1px solid #303438;border-radius:6px}
.social-publication-thumbs :is(img,video){width:100%;aspect-ratio:1;object-fit:contain;background:#08090a;display:block}
.social-publication-thumbs figcaption{display:flex;align-items:center;gap:4px;padding:0 4px 0 12px}
.social-publication-thumbs figcaption span{margin-right:auto}
.social-unified-composer :is(button,select){min-height:44px}
.social-publication-thumbs button{width:44px;padding:10px;background:transparent;border:0}
.social-publication-upload{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;min-height:160px;border:1px dashed #d62c43;border-radius:6px;cursor:pointer;color:#f2f4f5;background:#191416}
.social-publication-upload input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}
.social-publication-upload:focus-within{outline:2px solid #fff;outline-offset:3px}
.social-unified-composer svg,.social-public-attachment svg{width:22px;height:22px;flex:none}
.social-unified-composer .social-publication-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 20px;flex:none;border-top:1px solid #303438}
.social-publication-footer [role=status]{font-size:13px;color:#e9b4b9;overflow-wrap:anywhere}
.social-unified-composer .social-publication-footer button{min-width:112px;width:auto;flex:none}
.social-public-attachment{padding:14px 0;border-block:1px solid #303438;min-width:0}
.social-public-attachment summary{display:flex;align-items:center;gap:12px;cursor:pointer;min-height:44px}
.social-public-attachment summary strong{overflow-wrap:anywhere}
.social-public-attachment-body{max-height:420px;overflow:auto;padding:12px 0}
.social-public-attachment-body>button{display:flex;gap:8px;align-items:center;min-height:44px}
.social-public-attachment-body>[role=status]{display:block;font-size:13px;margin-top:8px}
.social-album{width:100%;height:100%;min-width:0;position:relative}
.social-reel-info .social-public-attachment{pointer-events:auto;background:#101214e8;padding:4px 12px;margin-top:8px}
.social-reel-info .social-public-attachment-body{max-height:35dvh}
.social-album-track{display:flex;width:100%;height:100%;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;position:relative;scrollbar-width:thin}
.social-album-slide{position:relative;flex:0 0 100%;width:100%;height:100%;min-width:0;scroll-snap-align:center;scroll-snap-stop:always}
.social-album-dots{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);display:flex;justify-content:center;align-items:center;width:calc(100% - 24px);max-width:240px;height:32px;z-index:3;pointer-events:none}
.social-album-dots button{display:flex;align-items:center;justify-content:center;flex:0 1 24px;min-width:0;height:32px;padding:0;border:0;background:transparent;pointer-events:auto;cursor:pointer}
.social-album-dots button span{display:block;width:7px;height:7px;border-radius:50%;background:#fff;box-shadow:0 1px 4px #000;flex:none}
.social-album-dots button[aria-current="true"] span{background:#fa1742}
.social-album-dots button:focus-visible{outline:2px solid #fff;outline-offset:-2px;border-radius:4px}
@media(max-width:640px){.social-composer-backdrop .social-composer-panel.social-unified-composer{width:100vw;inline-size:100vw;max-width:100vw;max-inline-size:100vw;max-height:100dvh;height:100dvh;border-radius:0}.social-unified-composer .social-composer-head{padding-top:max(12px,env(safe-area-inset-top))}.social-publication-layout{grid-template-columns:minmax(0,1fr)}.social-publication-fields{border-left:0;border-top:1px solid #303438}.social-publication-media,.social-publication-fields{padding:16px}.social-unified-composer .social-publication-footer{padding-bottom:max(14px,env(safe-area-inset-bottom))}}
.exercise-detail-page{min-width:0}
.exercise-detail-header{display:flex;align-items:center;gap:14px}
.exercise-detail-header .icon-btn{width:44px;height:44px;flex:none}
.exercise-detail-header svg{width:22px;height:22px}
.exercise-detail-header h1{font-size:22px;line-height:1.25;margin:0;overflow-wrap:anywhere}
.exercise-detail-header small{color:var(--muted)}
.exercise-detail-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px}
.exercise-detail-demonstration,.exercise-personal-progress{min-width:0}
.exercise-detail-demonstration .exercise-preview-media{width:100%;aspect-ratio:1;max-height:520px}
.exercise-detail-demonstration .exercise-preview-media :is(img,video){width:100%;height:100%;object-fit:contain}
.exercise-personal-progress h2{font-size:18px;margin:24px 0 12px}.exercise-personal-progress h2:first-child{margin-top:0}
.exercise-personal-records{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0;padding:16px 0;border-block:1px solid var(--border)}
.exercise-personal-records dt{font-size:12px;color:var(--muted);line-height:1.4}.exercise-personal-records dd{font-size:18px;font-weight:800;margin:8px 0 0;overflow-wrap:anywhere}
.exercise-personal-ranking{padding-left:24px}.exercise-personal-ranking li{padding:10px 0;border-bottom:1px solid var(--border)}.exercise-personal-ranking strong{float:right}
.exercise-personal-history details{border-bottom:1px solid var(--border);padding:12px 0}.exercise-personal-history summary{min-height:44px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px}.exercise-personal-history summary span{min-width:0;overflow-wrap:anywhere}.exercise-personal-history summary strong{flex:none;font-size:12px}
.exercise-personal-history ul{padding:0;list-style:none}.exercise-personal-history li{display:flex;justify-content:space-between;gap:12px;padding:8px 0;font-size:13px}
@media(max-width:760px){.exercise-detail-layout{grid-template-columns:minmax(0,1fr);gap:24px}.exercise-detail-header h1{font-size:20px}.exercise-personal-records{gap:8px}.exercise-personal-records dd{font-size:16px}}
.session-metric-field input::placeholder { color:#7f8992; opacity:.7; }
.session-metric-field input::-webkit-inner-spin-button,.session-metric-field input::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.session-metric-field input[type="number"] { -moz-appearance:textfield; appearance:textfield; }
.session-extra-page{min-width:0}.session-extra-page h1{font-size:22px;margin:0;line-height:1.3}
.session-extra-filters{display:grid;grid-template-columns:minmax(0,2fr) repeat(2,minmax(0,1fr));gap:12px;padding:12px 0;border-bottom:1px solid var(--border)}
.session-extra-filters label{display:flex;flex-direction:column;gap:7px;min-width:0}.session-extra-filters label>span{font-size:12px;color:var(--muted)}
.session-extra-filters :is(input,select){width:100%;box-sizing:border-box;min-width:0;min-height:44px;font-size:16px;background:#101418;border:1px solid #35414a;border-radius:6px;color:#f1f4f6;padding:10px}
.session-extra-page-results{min-width:0}.session-extra-count{color:var(--muted);font-size:12px}
.session-extra-result{display:grid;grid-template-columns:48px minmax(0,1fr) auto auto auto;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--border);min-height:72px;box-sizing:border-box;content-visibility:auto;contain-intrinsic-size:auto 76px}
.session-extra-static-thumb{display:grid;place-items:center;width:48px;height:48px;overflow:hidden;background:#171c20;border-radius:6px;contain:strict}.session-extra-static-thumb :is(img,svg){width:48px;height:48px;object-fit:contain;display:block}
.session-extra-result>div{min-width:0}.session-extra-result strong{display:block;font-size:14px;line-height:1.3;overflow-wrap:anywhere}.session-extra-result small{display:block;font-size:11px;color:var(--muted);margin-top:4px}
.session-extra-result button,.session-extra-pagination button{min-height:44px;border:1px solid #414a52;background:#101418;color:#f1f4f6;border-radius:6px;padding:8px 12px;font-size:12px}
.session-extra-result :is([data-add-session-extra-exercise],[data-replace-session-exercise]){border-color:#e12b40;color:#ff6576}
@media(max-width:600px){.session-extra-result [data-replace-session-exercise]{grid-column:3}}
.session-extra-pagination{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:20px 0}.session-extra-pagination button:disabled{opacity:.4}
@media(max-width:600px){.session-extra-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.session-extra-query{grid-column:1/-1}.session-extra-result{gap:8px;grid-template-columns:48px minmax(0,1fr) auto}.session-extra-result>div{grid-column:2/-1}.session-extra-result [data-preview-exercise]{grid-column:2}.session-extra-result [data-add-session-extra-exercise]{grid-column:3}.session-extra-result button{padding:8px 10px}.session-extra-page h1{font-size:20px}}
.workout-notes{min-width:0}
.workout-note-list{display:grid;gap:10px;margin:12px 0}
.workout-notes .session-note-entry-copy{min-width:0;overflow-wrap:anywhere}
.workout-notes .session-note-entry-copy p{white-space:pre-wrap}
.workout-notes textarea{width:100%;min-height:80px;box-sizing:border-box;resize:vertical}
.workout-notes .session-note-entry-actions{flex-shrink:0;flex-direction:row}
.workout-notes .session-note-entry-actions button{min-width:44px;min-height:44px;border:0;border-radius:0;background:transparent;box-shadow:none}
.workout-notes .row [hidden]{display:none}
.exercise-modal-sets{container-type:inline-size}
.exercise-modal-sets .exercise-modal-set-row{grid-template-columns:44px minmax(0,1fr) 44px;gap:8px;align-items:start;margin-bottom:16px}
.exercise-modal-sets .exercise-modal-set-row :is(.set-type-letter,.trash-set){width:44px;min-width:44px;height:44px;min-height:44px}
.exercise-modal-sets .exercise-modal-set-body{grid-template-columns:minmax(0,1fr);gap:10px}
.exercise-modal-sets .exercise-modal-set-fields{min-width:0;gap:8px}
.exercise-modal-sets .exercise-modal-set-fields input{height:44px;min-height:44px;width:100%;box-sizing:border-box}
.exercise-modal-sets .exercise-modal-set-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:end}
.exercise-modal-sets .exercise-modal-set-options label{height:auto;min-width:0;grid-template-columns:16px minmax(0,1fr);gap:0 4px;padding:0 4px 0;border-radius:6px}
.exercise-modal-sets .exercise-modal-option-label{grid-column:1 / -1;font-size:11px;line-height:18px;white-space:normal;color:var(--muted);padding-top:3px}
.exercise-modal-sets .exercise-modal-set-options input{height:44px;min-height:44px;font-size:14px;padding:0;width:100%}
.exercise-modal-sets .exercise-modal-set-options .exercise-modal-option-icon{width:16px;height:16px}
@container (min-width:620px){
  .exercise-modal-sets .exercise-modal-set-body{grid-template-columns:minmax(0,1fr) 220px;align-items:end}
  .exercise-modal-sets .exercise-modal-set-row{align-items:end}
}
.session-technique-control{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:8px;align-items:end;margin:12px 0;min-width:0}
.session-technique-control label{display:grid;gap:6px;min-width:0}
.session-technique-control select{width:100%;min-width:0;min-height:44px}
.session-technique-control .exercise-technique-help{width:44px;height:44px}
.session-technique-control.session-technique-inline { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:0 5px; margin:0; color:var(--muted); font-size:12px; line-height:1.4; }
.session-technique-inline label { position:relative; display:inline-flex; align-items:center; min-height:36px; max-width:100%; margin:0; cursor:pointer; }
.session-technique-inline .session-technique-value { color:var(--muted); font-size:12px; font-weight:500; white-space:normal; overflow-wrap:anywhere; }
.session-technique-inline select { position:absolute; inset:0; width:100%; height:100%; min-height:36px; opacity:0; cursor:pointer; }
.session-technique-inline label:focus-within { outline:2px solid #57dcff; outline-offset:2px; border-radius:3px; }
.session-technique-inline .exercise-technique-help { flex:0 0 36px; width:36px; height:36px; min-height:36px; }
.session-technique-inline .session-technique-muscle { font-size:12px; font-weight:500; overflow-wrap:anywhere; }
.technique-explanation[popover]{position:fixed;inset:0;margin:auto;width:min(340px,calc(100vw - 40px));height:fit-content;max-height:calc(100dvh - 40px);overflow:auto;box-sizing:border-box;padding:20px;border:1px solid var(--border);border-radius:8px;background:var(--card,#151515);color:var(--text,#fff);white-space:normal;line-height:1.5;font-size:14px;text-transform:none}
.technique-explanation::backdrop{background:rgb(0 0 0 / .35)}
.technique-explanation p{margin:12px 0}
.technique-explanation button{min-height:44px}
.training-block-exercises-section .strategy-scroll.block-exercise-tabs{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
.training-block-exercises-section .block-exercise-config.strategy-card{flex:0 0 100%;width:100%;min-width:0;max-width:100%;box-sizing:border-box}
.training-block-exercises-section .block-exercise-config :is(.block-exercise-fields,.block-slot-sets,.block-slot-set-fields,.exercise-picker-open-btn){min-width:0;max-width:100%;box-sizing:border-box}
.training-block-exercises-section .block-exercise-fields select{width:100%;min-width:0;max-width:100%}
.block-slot-set-row .block-slot-set-options{grid-column:2;grid-row:2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0}
.block-slot-set-options label{display:grid;gap:4px;min-width:0}
.block-slot-set-options label span{font-size:11px;color:var(--muted)}
.block-slot-set-options input{width:100%;min-width:0;min-height:44px;box-sizing:border-box;text-align:center}
.block-slot-set-row>.trash-set{grid-column:3;grid-row:1}
.block-slot-set-row>.block-slot-set-type{grid-column:1;grid-row:1}
.block-slot-set-row>.block-slot-set-fields{grid-column:2;grid-row:1}
.running-map-controls{position:absolute;z-index:3;top:12px;right:12px;display:flex;gap:4px;max-width:calc(100% - 24px)}
.running-map-controls button{min-width:44px;min-height:44px;padding:6px 10px;background:#17191b;color:#fff;border:1px solid #6d7479;border-radius:6px;font-size:12px}
.running-map-controls button[aria-pressed=true]{border-color:#ff3045;color:#ff6576}
.running-route-card .running-route-map,.running-history-entry .running-route-map{height:360px;max-height:55dvh;border-radius:8px;touch-action:none}
.running-route-card .running-route-status small,.running-history-entry .running-route-status small{font-size:11px}
.running-route-card .running-route-attribution,.running-history-entry .running-route-attribution{font-size:10px}
.running-history-search{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) auto;gap:10px;align-items:end}
.running-history-search label{display:grid;gap:5px;min-width:0}
.running-history-search :is(input,select,button){min-width:0;min-height:44px;width:100%;box-sizing:border-box}
.shell .running-active { padding-bottom: calc(var(--bottom-nav-total) + 100px); }
.running-replace-dialog { width: min(440px, calc(100% - 32px)); margin: auto; padding: 24px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); }
.running-replace-dialog::backdrop { background: rgb(0 0 0 / 70%); }
.running-replace-dialog h2 { margin: 0 0 12px; font-size: 20px; }
.running-replace-dialog p { margin: 0 0 20px; line-height: 1.5; }
.running-replace-dialog > div { display: grid; gap: 12px; }
.running-replace-dialog button { min-height: 48px; white-space: normal; }
.shell .running-active > footer {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-total) + 12px);
  transform: translateX(-50%);
  width: min(calc(100% - 32px - var(--safe-left) - var(--safe-right)), 336px);
  padding: 8px;
  background: var(--bg);
  border-radius: 8px;
  z-index: 74;
}
@media (min-width: 960px) {
  .shell .running-active { padding-bottom: calc(var(--safe-bottom) + 100px); }
  .shell .running-active > footer {
    left: calc(50% + var(--desktop-nav-width, 76px) / 2);
    bottom: calc(var(--safe-bottom) + 16px);
  }
}
.running-active .running-live-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.running-active .running-live-grid>div{min-width:0}
.running-active .running-live-grid strong{font-size:24px;overflow-wrap:anywhere}
@media(min-width:1000px){
 .running-active>main{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:20px;align-items:start}
 .running-active .running-route-card{grid-column:1;grid-row:1 / span 3;min-width:0}
 .running-active .running-route-card .running-route-map{height:540px;max-height:65dvh}
 .running-active>main:has(.running-route-card)>:not(.running-route-card){grid-column:2}
 .running-history-entries{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
}
@media(max-width:480px){
 .running-history-search{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .running-history-search button{grid-column:1 / -1}
 .running-active .running-live-grid strong{font-size:20px}
}
.ai-food-review{display:grid;gap:12px}
.ai-food-review-item{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:8px;border-top:1px solid var(--border);padding-top:12px;min-width:0}
.ai-food-review-item>strong,.ai-food-review-item>small{grid-column:1 / -1;overflow-wrap:anywhere}
.ai-food-review-item label{display:grid;gap:4px;min-width:0}
.ai-food-review-item input{min-width:0;width:100%;min-height:44px;box-sizing:border-box}
.ai-food-review-item button{align-self:end;min-height:44px}
.ai-food-review-item button svg{width:20px;height:20px}
.shell.login.session-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;min-height:100dvh;padding:24px;box-sizing:border-box}
.shell.login.session-loading>.card{width:100%;max-width:480px;margin:0 auto;box-sizing:border-box;align-self:center}
.shell.login.session-loading>.logo{max-width:100%;margin:0 auto;text-align:center}
.chat-reply-preview{grid-column:1 / -1;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;padding:6px 12px;border-bottom:1px solid var(--border)}
.chat-reply-preview button{min-width:44px;min-height:44px}
.chat-reply-reference{display:block;text-align:left;margin-bottom:6px}
.chat-shared-viewer--media>header{display:flex;align-items:center;gap:8px}
.chat-shared-viewer--media>header>div{flex:1;min-width:0}
.chat-shared-viewer--media>header>button{min-width:44px;min-height:44px;flex-shrink:0}
.exercise-type-icon.exercise-plan-thumbnail { position:relative; width:56px; height:56px; min-width:56px; flex:0 0 56px; overflow:hidden; border-radius:6px; background:#e8edf0; }
.exercise-plan-thumbnail > img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.exercise-plan-thumbnail > img[hidden] { display:none; }
.exercise-plan-thumbnail .exercise-anatomy-fallback { display:block; width:100%; height:100%; }
.exercise-plan-thumbnail.has-static-frame .exercise-anatomy-fallback { visibility:hidden; }
.exercise-plan-thumbnail .exercise-anatomy-fallback svg { width:100%; height:100%; display:block; }
.exercise-plan-thumbnail .rl-anatomy-base { fill:#687780; stroke:#34434b; stroke-width:2; }
.exercise-plan-thumbnail .rl-anatomy-region { fill:#9ba8ae; stroke:#40505b; stroke-width:1; }
.exercise-plan-thumbnail .rl-anatomy-region.is-selected { fill:#e5233b; }
.exercise-plan-thumbnail .rl-anatomy-line { fill:none; stroke:#45565e; stroke-width:2; }
.session-extra-static-thumb.exercise-plan-thumbnail{position:relative;background:#e8edf0}

/* Session exercise hierarchy: compact metadata, editorial technique editor and load comparison. */
.session-exercise-card:has(.session-technique-editor:not([hidden])) { z-index: 12; }
.session-exercise-card-front { overflow: visible; }
.session-exercise-head.expanded { grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; }
.session-exercise-head-copy { min-width: 0; }
.session-exercise-head-copy .session-exercise-title-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.session-exercise-head-copy .session-exercise-title-line strong { overflow-wrap: anywhere; }
.session-exercise-load { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; padding: 10px 12px; border: 1px solid rgba(126,232,255,.16); border-radius: 10px; background: #0b1015; }
.session-exercise-load > span:not(.session-exercise-load-x):not(.session-exercise-load-delta) { display: grid; gap: 2px; min-width: 0; }
.session-exercise-load small { color: #91a0aa; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.session-exercise-load strong { color: #f4f8fa; font-size: 15px; line-height: 1.1; }
.session-exercise-load-x { color: #4b5962; font-size: 12px; }
.session-exercise-load-delta { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: #91a0aa; font-size: 11px; font-weight: 850; white-space: nowrap; }
.session-exercise-load-delta span { font-size: 16px; line-height: 1; }
.session-exercise-load-delta:not(.is-neutral) > span { font-size: 11.2px; }
.session-exercise-load-delta.up { color: #64e5a2; }
.session-exercise-load-delta.down { color: #ff6679; }
.session-set-form > .type-chip { touch-action: none; user-select: none; -webkit-touch-callout: none; }
.session-set-form.is-set-dragging { opacity: .35; outline: 1px dashed var(--red); }
.session-set-drag-ghost { position: fixed !important; z-index: 10000; margin: 0 !important; pointer-events: none !important; background: var(--panel); border: 1px solid var(--red); border-radius: 8px; box-shadow: 0 8px 20px #0008; }
.session-technique-control { position: relative; display: block; margin: 4px 0; min-width: 0; }
.workout-notes-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workout-notes-heading h2,.workout-notes-heading h3 { margin: 0; }
.workout-notes-view { display: inline-flex; align-items: center; gap: 6px; padding: 6px; min-height: 44px; border: 0; background: transparent; box-shadow: none; color: var(--text); }
.workout-notes-view svg { width: 18px; height: 18px; }
.workout-notes-page > header { justify-content: flex-start; }
.workout-notes-back { width: 44px; height: 44px; flex: 0 0 44px; padding: 10px; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); }
.workout-notes-back svg { width: 24px; height: 24px; }
.workout-notes-page-content .workout-note-list { margin-top: 0; }
.session-set-adjustment-sheet:has(.session-rir-history) { max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain; }
.session-rir-history { display: grid; gap: 0; }
.session-rir-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.session-rir-entry small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; overflow-wrap: anywhere; }
.session-rir-actions { display: flex; flex: 0 0 auto; }
.session-rir-actions button { display: grid; place-items: center; width: 36px; height: 36px; padding: 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); }
.session-rir-actions svg { width: 18px; height: 18px; }
.session-exercise-head-copy:has(> .session-technique-control) { row-gap: 2px; }
.session-exercise-head-copy > .session-technique-control { margin-top: 0; }
.session-exercise-muscle { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.session-technique-heading { display: grid; grid-template-columns: minmax(0, auto) auto minmax(0, 1fr); align-items: baseline; gap: 6px; min-width: 0; }
.session-technique-heading .session-exercise-muscle { margin: 0; font-size: 12px; }
.session-technique-separator { color: var(--muted); font-size: 12px; }
.session-technique-name { justify-self: start; min-width: 0; min-height: 32px; padding: 4px 0; border: 0; border-radius: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.session-technique-heading .session-technique-name strong { font-size: 12px; white-space: normal; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.session-technique-name:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.session-technique-kicker { color: #8c9aa4; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.session-technique-heading strong { min-width: 0; overflow: hidden; color: #e8edf0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.session-technique-edit-bar { grid-column: 1 / -1; position: relative; min-height: 22px; padding: 5px 0 2px; border: 0; background: transparent; color: #ff4660; text-align: left; font-size: 10px; font-weight: 850; cursor: pointer; overflow: hidden; }
.session-technique-edit-bar::before { content: ''; display: block; height: 2px; margin-bottom: 4px; background: linear-gradient(90deg, #a30e25 0%, #ff2748 38%, #ffd4da 50%, #ff2748 62%, #a30e25 100%); background-size: 220% 100%; box-shadow: 0 0 8px rgba(240,31,57,.35); animation: ratlab-technique-shine 2.8s linear infinite; }
@keyframes ratlab-technique-shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.session-technique-editor[hidden] { display: none; }
.session-technique-editor { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: min(420px, 60dvh); overflow: auto; padding: 12px; border: 1px solid rgba(240,31,57,.55); border-radius: 12px; background: #11171d; box-shadow: 0 16px 38px rgba(0,0,0,.48), 0 0 0 1px rgba(126,232,255,.08); }
.session-technique-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 9px; border-bottom: 1px solid rgba(126,232,255,.12); }
.session-technique-editor-head strong { color: #f3f7f8; font-size: 12px; }
.session-technique-editor-head button { display: grid; place-items: center; min-width: 34px; min-height: 34px; border: 1px solid #39464f; border-radius: 8px; background: #0b1015; color: #f3f7f8; font-size: 17px; }
.session-technique-options { display: grid; gap: 5px; padding-top: 9px; }
.session-technique-option { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 6px; }
.session-technique-info-button { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #42505a; border-radius: 50%; background: #151d23; color: #d9e3e8; font-weight: 900; }
.session-technique-choice { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #c5d0d5; text-align: left; font-size: 12px; }
.session-technique-choice.is-selected { border-color: rgba(240,31,57,.6); background: rgba(240,31,57,.1); color: #fff; }
.session-technique-info-face[hidden], .session-technique-list-face[hidden] { display: none; }
.session-technique-info-face p { margin: 18px 4px 8px; color: #c5d0d5; font-size: 13px; line-height: 1.55; }
@media (prefers-reduced-motion: reduce) { .session-technique-edit-bar::before { animation: none; } }
@media (max-width: 520px) { .session-exercise-load { gap: 7px; padding: 9px; } .session-exercise-load strong { font-size: 13px; } .session-exercise-load-delta { font-size: 10px; } }
/* Active-session history comparison rows. */
.training-session-stats .session-stat { align-items: flex-start; }
.training-session-stats .session-stat-history { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; color: #91a0aa; font-size: 9px; font-weight: 750; line-height: 1.15; white-space: nowrap; }
.training-session-stats .session-stat-history > span { overflow: hidden; text-overflow: ellipsis; }
.training-session-stats .session-stat-history em { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-weight: 900; }
.training-session-stats .session-stat-history em span { font-size: 13px; line-height: 1; }
.training-session-stats .session-stat-history em:is(.up,.down) span { font-size: 9.1px; }
.training-session-stats .session-stat-history em.up { color: #63e3a0; }
.training-session-stats .session-stat-history em.down { color: #ff6578; }
.training-session-stats .session-stat-history em.neutral { color: #91a0aa; }
@media (max-width: 420px) {
  .training-session-stats .session-stat { padding: 8px 9px; }
  .training-session-stats .session-stat-history { display: grid; justify-content: stretch; gap: 3px; font-size: 8px; }
  .training-session-stats .session-stat-history em { justify-content: flex-start; }
}
/* History charts follow the card width at every viewport; axis labels keep the card margins. */
.history-chart,
.history-line-chart { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; margin-inline: 0; }
.history-chart-plot,
.history-chart svg,
.history-line-chart svg { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.history-chart-axis { margin-inline: clamp(4px, 1.5vw, 10px); }
@media (max-width: 430px) {
  .history-chart { padding-inline: clamp(6px, 2.4vw, 10px); }
  .history-chart-summary { flex-wrap: wrap; }
  .history-chart-summary strong { margin-left: auto; }
  .history-chart-legend { gap: 8px; }
  .history-chart-legend span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
.history-chart { margin-bottom: 12px; }
.history-best-exercises-card { margin-bottom: 12px; }

.history-session-share-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; flex: 0 0 30px; border: 1px solid rgba(75,212,255,.2); border-radius: 999px; background: rgba(75,212,255,.06); color: #bfefff; }
.history-session-share-btn svg { width: 15px; height: 15px; }
.history-session-share-btn:hover, .history-session-share-btn:focus-visible { border-color: #4bd4ff; background: rgba(75,212,255,.14); outline: none; }
.history-share-page { min-height:100dvh; width:100%; padding:env(safe-area-inset-top,0px) 16px calc(24px + env(safe-area-inset-bottom,0px)); box-sizing:border-box; background:var(--bg,#090c0f); color:var(--text,#fff); }
.history-share-page * { box-sizing:border-box; letter-spacing:0; }
.history-share-page > header { display:flex; align-items:center; gap:12px; max-width:1080px; margin:auto; min-height:76px; border-bottom:1px solid var(--border); }
.history-share-page h1 { margin:0; font-size:20px; line-height:1.3; }
.history-share-page header button { flex:0 0 44px; width:44px; height:44px; display:grid; place-items:center; border:0; padding:10px; background:transparent; color:inherit; }
.history-share-page svg { width:22px; height:22px; flex-shrink:0; }
.history-share-content { display:grid; grid-template-columns:minmax(0,1fr); gap:24px; max-width:1080px; margin:20px auto 0; }
.history-share-media,.history-share-controls { min-width:0; }
.history-share-format { display:flex; justify-content:center; gap:4px; margin-bottom:16px; }
.history-share-format button { min-height:44px; padding:8px 16px; color:inherit; background:transparent; border:1px solid var(--border); border-radius:6px; }
.history-share-format button[aria-pressed="true"] { border-color:var(--red,#ed1745); background:#ed174525; }
.history-share-image { width:min(100%,280px); aspect-ratio:9/16; margin:auto; background:#080b0e; }
.history-share-image[data-format="post"] { aspect-ratio:4/5; }
.history-share-image img { display:block; width:100%; height:100%; object-fit:contain; }
.history-share-image img[hidden] { display:none; }
.history-share-controls { display:flex; flex-direction:column; gap:10px; }
.history-share-controls h2 { margin:0; font-size:20px; line-height:1.3; overflow-wrap:anywhere; }
.history-share-controls p { margin:0; font-size:13px; line-height:1.5; color:var(--muted,#a6afb9); overflow-wrap:anywhere; }
.history-share-controls [role="status"]:empty { display:none; }
.history-share-controls > button { min-height:44px; width:100%; display:flex; align-items:center; justify-content:center; gap:10px; border-radius:6px; }
.history-share-controls > button[hidden] { display:none; }
.history-share-exports { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding-top:16px; margin-top:6px; border-top:1px solid var(--border); }
.history-share-exports button { min-width:0; min-height:44px; padding:8px 4px; font-size:12px; border-radius:6px; }
.history-share-page button:focus-visible { outline:2px solid #45d5ee; outline-offset:3px; }
.history-share-page button:disabled { opacity:.5; cursor:wait; }
@media (min-width:760px) { .history-share-content { grid-template-columns:minmax(0,1fr) minmax(280px,380px); align-items:center; gap:48px; } .history-share-image { width:min(100%,340px); } }
.running-history-entry-footer{margin-top:14px;padding-top:12px;border-top:1px solid #28333b}
.running-history-entry-footer .primary{width:100%;min-height:42px}
.running-history-share-icon{display:grid;place-items:center;width:44px;height:44px;border:1px solid #28333b;border-radius:10px;background:#12171d;color:#f21d45;font-size:22px;cursor:pointer}
.running-history-view-head{display:flex;align-items:center;gap:12px}
.running-history-view-head>button{display:grid;place-items:center;width:44px;height:44px;border:1px solid #28333b;border-radius:50%;background:#11161b;color:#f3f6f8}
.running-history-view-head h1{margin:2px 0 0}
.running-history-view-head small,.running-history-detail-card small{color:#8f9eaa}
.running-history-view-actions{display:flex;gap:8px;flex-wrap:wrap}
.running-history-view-actions button{min-height:44px;flex:1 1 120px}
.running-history-view-actions .danger{border:1px solid #8c2037;background:#261118;color:#ff6683;border-radius:8px}
.running-history-view-hero{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0}
.running-history-view-hero>div,.running-history-detail-card{border:1px solid #28333b;border-radius:10px;background:#0e1217;padding:14px}
.running-history-view-hero dt,.running-history-detail-grid dt{font-size:11px;color:#8f9eaa}
.running-history-view-hero dd{font-size:20px;font-weight:800;margin:5px 0 0;color:#f5f7f9}
.running-history-view-hero dd small,.running-history-detail-grid dd small{display:block;font-size:11px;color:#8f9eaa;margin-top:2px}
.running-history-detail-card>header{margin-bottom:14px}
.running-history-detail-card h2{margin:4px 0 0;font-size:18px}
.running-history-detail-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0}
.running-history-detail-grid dd{font-weight:700;margin:5px 0 0}
.running-history-route-view{min-height:280px}
.running-history-route-view .running-route-map{min-height:220px;margin-top:12px}
.running-history-share-backdrop{position:fixed;inset:0;z-index:50;display:grid;place-items:end center;padding:16px;background:rgba(0,0,0,.7)}
.running-history-share-sheet{width:min(620px,100%);padding:18px;border:1px solid #3a4650;border-radius:16px 16px 8px 8px;background:#11161c;box-shadow:0 20px 60px #000}
.running-history-share-sheet>header{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.running-history-share-sheet h2{margin:4px 0 0}
.running-history-share-sheet>header button{border:0;background:none;color:#fff;font-size:26px;cursor:pointer}
.running-history-share-sheet p{color:#bdc8d0}
.running-history-share-platforms,.running-history-share-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.running-history-share-platforms a,.running-history-share-platforms button,.running-history-share-actions button{min-height:42px;flex:1 1 120px;text-align:center;text-decoration:none}
@media (max-width:600px){.running-history-view-hero{grid-template-columns:1fr 1fr}.running-history-view-hero>div:last-child{grid-column:1/-1}.running-history-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media print{body>*{display:none!important}#app{display:block!important}.running-history-view{display:block!important}.running-history-view-actions,.running-history-view-head>button,.running-history-share-backdrop{display:none!important}.running-history-route-view{break-inside:avoid}}
.rpg-section-head strong:empty{display:none}

.rpg-section-kicker:empty{display:none}

/* O selo de conclusão não ocupa a coluna das métricas do card. */
.quest-card > .quest-done-badge{top:10px;right:10px;width:26px;height:26px;z-index:1}
.quest-card > .quest-card-body{padding-right:42px}
.workout-weekly-goal { border-block:1px solid var(--border, #424242); padding-block:8px; min-width:0; }
.workout-weekly-goal summary { cursor:pointer; min-height:48px; padding:8px 4px; overflow-wrap:anywhere; }
.workout-weekly-goal summary strong { font-size:16px; }
.workout-weekly-goal summary span { display:block; font-size:14px; margin-top:4px; }
.workout-weekly-goal form { padding:8px 4px; min-width:0; }
.workout-weekly-goal fieldset { display:flex; align-items:end; flex-wrap:wrap; gap:12px; padding:0; margin:0; border:0; min-width:0; }
.workout-weekly-goal label { font-size:14px; min-width:0; }
.workout-weekly-goal .weekly-goal-toggle { display:flex; align-items:center; gap:8px; min-height:48px; }
.workout-weekly-goal input[type=checkbox] { width:22px; height:22px; margin:0; accent-color:var(--accent, #e5233b); }
.workout-weekly-goal .weekly-goal-amount { display:grid; gap:4px; }
.workout-weekly-goal input[type=number] { width:112px; max-width:100%; min-height:48px; font-size:16px; box-sizing:border-box; }
.workout-weekly-goal button { min-height:48px; max-width:100%; white-space:normal; }
.workout-weekly-goal p { font-size:14px; overflow-wrap:anywhere; line-height:1.5; }
.workout-weekly-goal .weekly-goal-status { min-height:21px; margin:8px 0; }
.workout-weekly-goal [hidden] { display:none; }
.workout-weekly-goal :focus-visible { outline:2px solid var(--accent, #e5233b); outline-offset:3px; }
.social-story-actions { flex-wrap: wrap; }
.social-story-reply { display: flex; gap: 8px; flex: 1 1 100%; min-width: 0; }
.social-story-reply input { flex: 1; width: 0; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #39414a; border-radius: 8px; background: #15191e; color: #f5f6f8; font-size: 16px; }
.social-story-reply button { flex: 0 0 auto; min-height: 44px; }
.running-live-blocks { margin-top: 18px; color: #fff; }
.running-live-blocks > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.running-live-blocks h2 { font-size: 16px; margin: 0; }
.running-live-blocks button { min-height: 44px; border: 0; background: transparent; color: inherit; padding: 8px; }
.running-live-blocks > header button { color: #ff5367; font-size: 13px; }
.running-live-blocks ol { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.running-live-blocks li { min-width: 0; border: 1px solid #30363c; border-radius: 8px; background: #111418; padding: 10px 12px; overflow-wrap: anywhere; }
.running-live-blocks li[data-status="active"] { border-color: #ff344f; }
.running-live-blocks li[data-status="completed"] [data-run-block-timer] { color: #74daa5; }
.running-block-heading { display: grid; grid-template-columns: 22px minmax(0,1fr) 44px 44px; gap: 4px; align-items: center; }
.running-block-heading > span { font-size: 12px; color: #aab6bf; }
.running-block-heading > strong { font-size: 14px; }
.running-block-heading button { display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; }
.running-block-heading svg { width: 20px; height: 20px; }
.running-live-blocks button:disabled { opacity: .3; cursor: default; }
.running-live-blocks button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.running-block-grip { touch-action: none; cursor: grab; user-select: none; }
.running-block-grip > span { display: grid; grid-template-columns: repeat(2,3px); gap: 3px; }
.running-block-grip i { width: 3px; height: 3px; background: currentColor; border-radius: 50%; }
.running-live-blocks .is-dragging { opacity: .6; }
.running-live-blocks .is-drop-target { outline: 2px solid #fff; outline-offset: 2px; }
.running-live-blocks li > p { margin: 4px 0; color: #b3bdc5; font-size: 12px; }
.running-live-blocks [data-run-block-timer] { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.running-live-blocks [data-run-block-complete] { margin-top: 6px; color: #ff5367; }
.running-block-editor { width: min(440px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; padding: 20px; background: #111418; color: #fff; border: 1px solid #404a53; border-radius: 8px; overflow: auto; }
.running-block-editor::backdrop { background: rgba(0,0,0,.75); }
.running-block-editor form { display: grid; gap: 12px; }
.running-block-editor h2 { font-size: 20px; margin: 0 0 4px; }
.running-block-editor label { display: grid; gap: 5px; font-size: 13px; min-width: 0; }
.running-block-editor input,.running-block-editor select,.running-block-editor textarea { width: 100%; box-sizing: border-box; min-height: 44px; background: #080a0c; color: #fff; border: 1px solid #56616a; border-radius: 4px; padding: 8px; font: inherit; }
.running-block-editor [data-block-time] { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.running-block-editor [hidden] { display: none; }
.running-block-editor [role="alert"] { color: #ff8795; font-size: 13px; margin: 0; }
.running-block-editor footer { display: flex; gap: 8px; justify-content: flex-end; }
.running-block-editor button { min-height: 44px; }
.running-discard-dialog { max-height: calc(100dvh - 32px); overflow: auto; box-sizing: border-box; }
.running-discard-dialog-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px; color: var(--red); background: rgb(225 27 34 / 10%); border-radius: 8px; }
.running-discard-dialog-icon svg { width: 24px; height: 24px; }
.running-discard-dialog p { color: var(--muted); font-size: 14px; }
.running-discard-dialog button { font-size: 14px; }
.running-discard-dialog :focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.running-active>footer:has(.running-discard) .running-pause { display:grid; place-items:center; width:48px; padding:0; border:1px solid #713239; border-radius:50%; background:#180d0f; color:#ff7279; }
.running-active>footer:has(.running-discard) .running-stop { width:100%; padding:0 16px; border:0; border-radius:8px; background:#e82e36; color:#fff; font-size:14px; font-weight:900; }
.running-playback-symbol { display:block; width:20px; height:20px; box-sizing:border-box; }
.running-playback-symbol.is-pause { width:16px; height:18px; border-left:5px solid currentColor; border-right:5px solid currentColor; }
.running-playback-symbol.is-play { width:0; height:0; margin-left:3px; border-top:10px solid transparent; border-bottom:10px solid transparent; border-left:16px solid currentColor; }
.running-active>footer .running-pause:disabled { opacity:.4; cursor:default; }

.club-list-card:has(.club-card-arrow) { padding-right:58px; }
.club-list-card .club-list-action:has(.club-card-arrow) { position:absolute; right:7px; top:50%; transform:translateY(-50%); display:block; }
.club-list-card .club-list-action .club-card-arrow { display:grid; place-items:center; width:44px; min-width:44px; height:44px; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; color:var(--text); }
.club-list-card .club-card-arrow:hover { color:var(--red); }
.club-list-card .club-card-arrow:focus-visible { outline:2px solid currentColor; outline-offset:2px; }

.club-discovery-header .club-search-bar { height:48px; gap:0; padding:0 0 0 12px; border:1px solid var(--border); background:var(--panel-2); color:var(--text); transition:border-color .15s ease; }
.club-discovery-header .club-search-bar:focus-within { border-color:var(--red); }
.club-discovery-header .club-search-bar label { display:flex; align-items:center; gap:8px; margin:0; }
.club-discovery-header .club-search-bar label>.club-ui-icon { width:18px; height:18px; flex:0 0 18px; opacity:.7; }
.club-discovery-header .club-search-bar input { width:100%; min-width:0; height:46px; padding:0; border:0; border-radius:0; outline:0; box-shadow:none; background:transparent; color:var(--text); font-size:14px; font-weight:500; }
.club-discovery-header .club-search-bar input::placeholder { color:var(--text); opacity:.65; }
.club-discovery-header .club-filter-trigger { color:var(--text); border-left:1px solid var(--border); }
.club-discovery-header .club-filter-trigger.has-filters { color:var(--red); }
.club-discovery-header .club-filter-trigger:focus-visible { outline:2px solid var(--red); outline-offset:-3px; }
@media (max-width:380px) {
  .club-discovery-header .club-search-bar { padding-left:8px; }
  .club-discovery-header .club-search-bar label { gap:4px; }
}

@media (max-width:600px) {
  .session-extra-result { grid-template-columns:48px minmax(0,1fr) auto; }
  .session-extra-result [data-configure-session-exercise] { grid-column:3; }
  .session-extra-result :is([data-add-session-extra-exercise],[data-replace-session-exercise]) { grid-column:2 / -1; }
}
.session-extra-result:has(.session-extra-actions) { grid-template-columns:40px minmax(0,1fr) auto; gap:8px; }
.session-extra-result > .session-extra-copy { grid-column:2; }
.session-extra-result > .session-extra-actions { grid-column:3; display:flex; align-items:center; gap:4px; }
.session-extra-actions button { flex-shrink:0; padding:8px; }
.session-extra-actions [data-preview-exercise] { display:grid; place-items:center; width:40px; height:44px; padding:0; }
.session-extra-actions [data-preview-exercise] svg { width:20px; height:20px; }
.session-extra-copy [data-configure-session-exercise] { min-height:32px; padding:4px 0; border:0; background:transparent; color:var(--muted); box-shadow:none; }
.session-extra-result:has(.session-extra-actions) > .session-extra-static-thumb { width:40px; height:40px; }

.history-share-media-actions { display:flex; align-items:center; gap:12px; }
.history-share-media-actions button { width:44px; height:44px; flex:0 0 44px; padding:10px; display:grid; place-items:center; background:transparent; border:0; border-radius:6px; color:var(--text,#fff); }
.history-share-media-actions button:hover:not(:disabled) { background:rgba(255,255,255,.08); color:#ff405e; }
.history-share-media-actions button svg { width:24px; height:24px; display:block; }

.history-toolbar-actions { display:flex; align-items:center; gap:8px; margin-left:auto; }
.history-goal-trigger { display:grid; place-items:center; width:44px; height:44px; padding:10px; border:0; background:transparent; color:var(--text,#fff); }
.history-goal-trigger svg { width:22px; height:22px; }
.history-goal-trigger:hover,.history-goal-trigger:focus-visible { color:var(--accent,#f21f39); }
.weekly-goal-page .workout-weekly-goal { border:0; padding:0; display:grid; gap:28px; }
.weekly-goal-page h2 { font-size:18px; margin:0 0 10px; }
.weekly-goal-current { padding:20px 0 28px; border-bottom:1px solid var(--border); }
.weekly-goal-current > strong { display:block; font-size:22px; line-height:1.4; overflow-wrap:anywhere; }
.weekly-goal-current progress { display:block; width:100%; height:8px; margin-top:18px; accent-color:var(--accent,#f21f39); }
.weekly-goal-page .workout-weekly-goal form { padding:0; }
.weekly-goal-page .workout-weekly-goal fieldset { display:grid; grid-template-columns:1fr; align-items:center; gap:16px; }
.weekly-goal-page .weekly-goal-amount { max-width:240px; }
.weekly-goal-page .workout-weekly-goal button[type=submit] { width:100%; max-width:320px; }
@media(min-width:760px) { .weekly-goal-page .workout-weekly-goal { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:40px; } .weekly-goal-current { padding:0 32px 0 0; border-bottom:0; border-right:1px solid var(--border); } }

.history-session-card { cursor:pointer; }

.diet-adherence-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.diet-adherence-heading > span {
  min-width: 0;
}

.diet-adherence-heading .diet-adherence-period {
  width: auto;
  max-width: 125px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .3);
  border-radius: 0;
  background-color: transparent;
  color: inherit;
  font-size: 12px;
}


.diet-history-report-tools { display: flex; align-items: center; gap: 8px; }
.diet-history-report-tools .diet-filter-trigger { flex: 1; }
.history-report-trigger { flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; color: inherit; }
.history-report-trigger svg { width: 24px; height: 24px; }
.history-report-trigger:disabled { opacity: .45; cursor: wait; }
.history-report-trigger:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }


.history-pattern-section, .workout-history-layout > .history-pattern-section { min-width: 0; padding: 14px 0; border: 0; border-radius: 0; border-top: 1px solid var(--line, #293239); border-bottom: 1px solid var(--line, #293239); }
.history-pattern-content > div { min-width: 0; }
.history-pattern-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.history-pattern-head h3, .history-pattern-head h4, .history-pattern-times h4 { margin: 0; font-size: 14px; }
.history-pattern-head select { width: auto; max-width: 55%; min-width: 0; min-height: 44px; padding: 4px 20px 4px 4px; border: 0; border-bottom: 1px solid var(--line, #293239); border-radius: 0; background-color: transparent; color: inherit; font-size: 12px; text-overflow: ellipsis; }
.history-pattern-range { font-size: 11px; color: var(--muted); margin: 6px 0 12px; }
.history-pattern-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; margin: 14px 0; }
.history-pattern-summary > strong, .history-pattern-duration-value { font-size: 23px; }
.history-pattern-summary small, .history-pattern-duration-value small { font-size: 11px; font-weight: 400; color: var(--muted); }
.history-weekday-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.history-weekday-bars > div { display: grid; gap: 5px; justify-items: center; min-width: 0; font-size: 12px; }
.history-weekday-bars small { color: var(--muted); font-size: 10px; }
.history-weekday-track { display: flex; align-items: flex-end; height: 64px; width: 12px; background: rgba(128,128,128,.12); }
.history-weekday-track i { display: block; width: 100%; background: var(--red); }
.history-pattern-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 16px 0; font-size: 12px; }
.history-pattern-highlights > div { display: grid; gap: 6px; min-width: 0; }
.history-pattern-highlights span { color: var(--muted); overflow-wrap: anywhere; }
.history-completed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.history-completed-head h3 { margin: 0; font-size: 16px; }
.history-complete-link { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 44px; border: 0; background: transparent; color: var(--text); padding: 4px 0; font-size: 12px; text-align: right; }
.history-complete-link svg { width: 18px; height: 18px; flex: 0 0 18px; }
.history-complete-page .training-step-title h1 { font-size: 24px; }
.history-complete-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.history-complete-filters > * { min-width: 0; }
.history-complete-filters label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.history-complete-search { grid-column: 1 / -1; }
.history-complete-search > div { display: flex; align-items: stretch; gap: 8px; }
.history-complete-filters input { min-width: 0; width: 100%; box-sizing: border-box; min-height: 44px; }
.history-complete-search button { flex: 0 0 44px; width: 44px; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--red); border-radius: 6px; background: transparent; color: var(--text); }
.history-complete-search button svg { width: 20px; height: 20px; }
.history-complete-filters .history-progress-filter--compact { width: 100%; max-width: 100%; }
.history-complete-filters .history-progress-picker-menu { width: 100%; min-width: 0; }
.history-complete-clear { justify-self: start; min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 4px 0; }
.history-complete-results { gap: 12px; }
.history-complete-link:focus-visible, .history-complete-clear:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
@media (min-width: 900px) {
  .history-complete-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .history-complete-search { grid-column: span 2; }
}
.history-pattern-times, .history-pattern-duration { border-top: 1px solid var(--line, #293239); margin-top: 12px; padding-top: 16px; }
.history-pattern-times p { font-size: 12px; }
.history-pattern-time { display: grid; grid-template-columns: 104px minmax(30px, 1fr) 64px; align-items: center; gap: 10px; margin: 12px 0; font-size: 12px; }
.history-pattern-time > div { display: grid; gap: 3px; }
.history-pattern-time small { font-size: 10px; color: var(--muted); }
.history-pattern-time > span { text-align: right; }
.history-pattern-time meter { width: 100%; height: 8px; accent-color: #3eb2a8; }
.history-pattern-time meter::-webkit-meter-bar { background: rgba(128,128,128,.18); border: 0; }
.history-pattern-time meter::-webkit-meter-optimum-value { background: #3eb2a8; }
.history-pattern-time meter::-moz-meter-bar { background: #3eb2a8; }
.history-pattern-hours { font-size: 12px; margin-top: 14px; }
.history-pattern-hours summary { min-height: 36px; cursor: pointer; }
.history-pattern-hours > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding-bottom: 12px; }
.history-pattern-hours span { display: grid; gap: 2px; font-size: 11px; }
.history-pattern-duration-value { display: block; margin-top: 14px; }
@media (min-width: 900px) {
  .history-pattern-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .history-pattern-overview { grid-column: 1; grid-row: 1; }
  .history-pattern-times { grid-column: 2; grid-row: 1 / 3; border: 0; margin: 0; padding-top: 14px; }
  .history-pattern-duration { grid-column: 1; grid-row: 2; }
}


.history-pattern-head > .history-progress-filter--compact { width: 174px; max-width: 55%; flex: 0 1 174px; }
.history-pattern-head > .history-progress-filter--compact .history-progress-picker-trigger { min-height: 44px; }
.history-pattern-head > .history-progress-filter--compact .history-progress-picker-trigger strong { white-space: normal; overflow-wrap: anywhere; }
.history-pattern-head .history-progress-picker-trigger:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.diet-meal-card-compact .diet-meal-heading { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.diet-meal-completion-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.diet-meal-completion-actions .diet-meal-status { white-space: nowrap; }
.diet-meal-completion-actions .diet-meal-undo-icon { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; flex: 0 0 44px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.diet-meal-undo-icon svg { width: 18px; height: 18px; }
.diet-meal-completion-actions .diet-meal-undo-icon:hover { color: var(--red); background: rgba(244,28,58,.08); }
.diet-meal-completion-actions .diet-meal-undo-icon:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }

.running-detail .training-create-compact[data-edit-running-plan]{border:0;border-radius:0;background:transparent;box-shadow:none}
.running-detail .training-create-compact[data-edit-running-plan]:focus-visible{outline:2px solid var(--accent,#ff1744);outline-offset:2px}

.topbar .icon-btn.top-global-search {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  padding: 0;
}
.topbar .icon-btn.top-global-search:focus-visible { outline: 2px solid var(--accent,#ff1744); outline-offset: 2px; }

.topbar .icon-btn.topbar-menu-button{border:0;border-radius:0;background:transparent;box-shadow:none}
.topbar .icon-btn.topbar-menu-button:focus-visible{outline:2px solid var(--accent,#ff1744);outline-offset:2px}

.running-history-inline-exports{border-top:1px solid var(--line);padding-top:16px}
.running-history-inline-exports summary{cursor:pointer;font-weight:700;padding:8px 0}
.running-history-inline-exports .running-history-share-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
.running-history-inline-exports button{min-width:0;white-space:normal}

.running-history > .training-history-toolbar > .training-back{border:0;border-radius:0;background:transparent;box-shadow:none}
.running-history > .training-history-toolbar > .training-back:focus-visible{outline:2px solid var(--accent,#ff1744);outline-offset:2px}

.running-history > .training-history-toolbar{gap:8px}
.running-history .training-history-toolbar > .running-history-search{flex:1;min-width:0;display:grid;grid-template-columns:minmax(0,1fr) 96px;gap:8px;align-items:center;margin:0}
.running-history .training-history-toolbar .running-history-search :is(input,select){height:44px;padding:0 10px;font-size:12px}

.running-history-entry[data-running-history-view]{position:relative;padding-right:44px;cursor:pointer}
.running-history-entry[data-running-history-view]:focus-visible{outline:2px solid var(--accent,#ff1744);outline-offset:2px}
.running-history-entry .running-history-open-arrow{position:absolute;right:14px;top:50%;transform:translateY(-50%);color:#fff;font-size:24px;line-height:1;pointer-events:none}
