/* ForgeFit v5 mobile-first app shell and component layer. */

body {
  background: var(--bg-app);
}

.app-shell {
  display: block;
  min-height: 100dvh;
}

.app-frame {
  min-height: 100dvh;
}

.main,
.app-main {
  width: 100%;
  max-width: var(--max-w-mobile);
  margin: 0 auto;
  padding: var(--space-4) 0 calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-4));
}

.sidebar,
.topbar {
  display: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  min-height: calc(var(--header-h) + var(--safe-top));
  padding-top: calc(var(--space-2) + var(--safe-top));
  padding-bottom: var(--space-2);
  padding-inline: max(var(--space-3), var(--safe-left)) max(var(--space-3), var(--safe-right));
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: var(--space-2);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  position: relative;
  transition: background var(--duration-fast), transform var(--duration-fast);
}

.header-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
}

.header-btn:active {
  background: var(--bg-card-hover);
  transform: scale(0.96);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  position: relative;
}

.header-btn .badge {
  position: absolute;
  top: 7px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
}

.header-badge[data-count="0"],
.header-badge[hidden] {
  display: none;
}

.header-title {
  min-width: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  letter-spacing: 0;
  color: var(--text-primary);
  text-align: center;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-avatar,
.header-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2px solid var(--border-default);
  display: grid;
  place-items: center;
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

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

.header-notif-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  width: min(360px, calc(100vw - 2rem));
  max-height: min(480px, calc(100dvh - var(--header-h) - var(--bottom-nav-h) - 2rem));
  overflow-y: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3);
  z-index: var(--z-modal);
}

.header-notif-dropdown[hidden] {
  display: none;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-bottom-nav);
  min-height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: calc(var(--space-1) + var(--safe-bottom));
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
}

.bottom-nav-item {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  color: var(--text-muted);
  position: relative;
  transition: color var(--duration-fast), transform var(--duration-fast);
}

.bottom-nav-item span {
  display: none;
}

.bottom-nav-item svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.6;
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item.active::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.bottom-nav-item:active,
.bottom-nav-fab:active {
  transform: scale(0.92);
}

.bottom-nav-fab {
  display: none; /* FAB movido para páginas individuais */
}

.drawer-backdrop,
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
  backdrop-filter: blur(4px);
}

.drawer-backdrop {
  z-index: var(--z-drawer);
}

.drawer-backdrop.open,
.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(85vw, 320px);
  z-index: calc(var(--z-drawer) + 1);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  transform: translateX(-100%);
  transition: transform var(--duration-base) var(--ease-out);
  overflow-y: auto;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: var(--space-6) var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
}

.drawer-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.drawer-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  flex: 0 0 auto;
}

.drawer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-name,
.drawer-username {
  display: block;
}

.drawer-name {
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-username {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  text-align: center;
}

.drawer-stats > div {
  display: flex;
  flex-direction: column;
}

.drawer-stats strong {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-stats span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
}

.drawer-nav {
  padding: var(--space-3);
}

.drawer-item {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  position: relative;
  transition: background var(--duration-fast), color var(--duration-fast), transform var(--duration-fast);
}

.drawer-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.drawer-item.active,
.drawer-item:active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.drawer-item:active {
  transform: scale(0.98);
}

.drawer-item-badge {
  margin-left: auto;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.drawer-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-3) 0;
}

.sheet-backdrop {
  z-index: var(--z-modal);
}

.sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--z-modal) + 1);
  background: var(--bg-elevated);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  padding: var(--space-3) max(var(--space-5), var(--safe-right)) calc(var(--space-6) + var(--safe-bottom)) max(var(--space-5), var(--safe-left));
  transform: translateY(100%);
  transition: transform var(--duration-base) var(--ease-out);
  border-top: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

.sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--text-tertiary);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-4);
  opacity: 0.5;
}

.sheet-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.sheet-header h3 {
  margin-bottom: var(--space-1);
}

.sheet-header p {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  margin: 0;
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.sheet-action {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-2);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 650;
  border: 1px solid var(--border-subtle);
  transition: transform var(--duration-fast), background var(--duration-fast);
}

.sheet-action:active {
  transform: scale(0.94);
  background: var(--bg-card-hover);
}

.sheet-action--primary {
  min-height: 56px;
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  grid-column: span 3;
  flex-direction: row;
}

.sheet-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  color: var(--text-primary);
}

.sheet-action--primary .sheet-icon-wrap {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sheet-action svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: none;
  margin-inline: var(--space-3);
}

.card::before {
  display: none;
}

.page-head {
  border-bottom: 0;
  padding: 0 var(--space-4);
  margin: 0 0 var(--space-4);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.page-head h1 {
  font-size: var(--text-2xl);
}

.page-head .subtitle {
  margin-top: var(--space-1);
  color: var(--text-secondary);
}

.grid,
.grid-2,
.grid-3,
.grid-4,
.grid-5 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.metric-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--text-primary);
}

.metric-value .unit,
.metric-sub {
  color: var(--text-secondary);
}

.progress {
  height: 10px;
  border: 0;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
}

.progress > .bar {
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
}

.btn {
  min-height: 48px;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  transition: transform var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast);
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary,
.btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border-color: var(--btn-primary-bg);
}

.btn-ghost,
.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--btn-ghost-border);
}

.btn-sm,
.btn--sm {
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.btn-lg,
.btn--lg {
  min-height: 56px;
  font-size: var(--text-lg);
}

.btn-block,
.btn--block {
  width: 100%;
}

label,
.field-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--text-secondary);
  letter-spacing: 0;
  text-transform: none;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea,
.field-input,
.field-textarea,
.field-select {
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
}

textarea,
.field-textarea {
  min-height: 120px;
  line-height: 1.5;
  resize: vertical;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.tabs,
.feed-tabs {
  width: 100%;
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-1);
  border: 0;
  background: transparent;
}

.tabs > *,
.feed-tabs > * {
  flex: 0 0 auto;
}

.toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-4));
  left: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--duration-base) var(--ease-out);
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast--success { border-left: 4px solid var(--success); }
.toast--error { border-left: 4px solid var(--danger); }
.toast--info { border-left: 4px solid var(--info); }

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-post {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; margin-bottom: var(--space-3); }
.skeleton-text { height: 12px; margin-bottom: var(--space-2); }
.skeleton-image { width: 100%; aspect-ratio: 1; margin: var(--space-3) 0; }

.pull-indicator {
  height: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(0);
  transition: transform var(--duration-base), opacity var(--duration-base);
}

.pull-indicator .spinner {
  width: 24px;
  height: 24px;
  stroke: var(--accent-bright);
  fill: none;
  stroke-width: 2;
}

.pull-indicator.spinning .spinner {
  animation: spin 0.8s linear infinite;
}

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

@keyframes heart-pop {
  0% { transform: scale(1); }
  25% { transform: scale(1.4); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.btn-like.liked svg,
.feed-actions .active [data-heart-icon],
.feed-actions button.active span:first-child {
  color: var(--accent-bright);
  animation: heart-pop 0.4s var(--ease-out);
}

.heart-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 80px;
  color: #fff;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5));
  pointer-events: none;
  animation: heart-burst 0.8s var(--ease-out) forwards;
  z-index: 2;
}

@keyframes heart-burst {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-15deg); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.1) rotate(5deg); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 0; }
}

.install-banner {
  position: fixed;
  left: var(--space-4);
  right: var(--space-4);
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-4));
  z-index: var(--z-toast);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 44px;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--brand);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 24px var(--brand-glow);
}

.install-banner-content strong {
  display: block;
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.install-banner p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.install-banner-action {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.install-steps {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.install-steps b {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--brand-bright);
  background: rgba(124, 58, 237, .12);
  font-size: var(--text-xs);
}

.install-dismiss {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: var(--text-2xl);
}

@media (max-width: 430px) {
  .install-banner {
    grid-template-columns: minmax(0, 1fr) 40px;
  }
  .install-banner-action {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .install-banner-action .btn {
    width: 100%;
  }
}

.stepper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
}

.stepper-btn {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--accent-bright);
  font-size: var(--text-2xl);
  font-weight: 800;
  display: grid;
  place-items: center;
}

.stepper-value {
  flex: 1;
  text-align: center;
}

.stepper-number {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stepper-unit {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Dashboard v5 */
.dashboard-legacy {
  display: none;
}

.dashboard-v5 {
  display: grid;
  gap: var(--space-4);
}

.dashboard-v5-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) 0 var(--space-1);
}

.dashboard-v5-hero p {
  margin: 0 0 var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.dashboard-v5-hero h1 {
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  letter-spacing: 0;
  text-transform: none;
}

.metric-card-wide {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.metric-card-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.metric-card-line span {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.metric-card-line strong {
  color: var(--text-primary);
  font-size: var(--text-base);
  text-align: right;
}

.metric-card-wide small {
  display: block;
  margin-top: var(--space-2);
  color: var(--text-tertiary);
}

.mobile-rail {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-inline: calc(var(--space-4) * -1);
  padding: 0 var(--space-4);
}

.rail-card {
  min-width: 132px;
  min-height: 132px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.rail-card span,
.rail-card small {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.rail-card strong {
  color: var(--accent-bright);
  font-family: var(--font-head);
  font-size: var(--text-xl);
  line-height: 1.1;
  word-break: keep-all;
  hyphens: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}

.discipline-card {
  min-height: 220px;
}

.discipline-bars {
  height: 150px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: var(--space-2);
  padding-top: var(--space-4);
}

.discipline-bars > div {
  min-height: 24px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--text-primary);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: var(--space-1);
}

.discipline-bars span {
  writing-mode: vertical-rl;
  color: var(--btn-primary-fg);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

/* Block 3 — discipline list (replaces bars) */
.discipline-list {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-1);
}

.disc-row {
  display: grid;
  grid-template-columns: 52px 1fr 38px;
  align-items: center;
  gap: var(--space-2);
}

.disc-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.disc-track {
  height: 5px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.disc-fill {
  height: 100%;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  min-width: 2px;
}

.disc-pts {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dashboard-streak {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: var(--bg-surface-2);
}

.discipline-mini {
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.calorie-macro-summary {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}

body[data-page="dashboard"] .grid-4.mb-4,
body[data-page="dashboard"] .grid-5.mb-4 {
  display: flex;
  overflow-x: auto;
  gap: var(--space-3);
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-1);
}

body[data-page="dashboard"] .grid-4.mb-4 > .card,
body[data-page="dashboard"] .grid-5.mb-4 > .card {
  min-width: min(78vw, 280px);
  scroll-snap-align: start;
}

/* Feed v5 */
.feed-fab {
  display: none;
}

.feed-layout {
  display: block;
}

.feed-center {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.feed-toolbar {
  position: sticky;
  top: calc(var(--header-h) + var(--safe-top));
  z-index: var(--z-sticky);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  align-items: center;
  margin: 0;
  padding: var(--space-2) var(--space-4);
  background: rgba(10,10,10,0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.feed-toolbar > .btn {
  display: none;
}

.feed-toolbar select {
  width: 44px;
  height: 44px;
  padding: 0;
  color: transparent;
  background-position: center;
  border-radius: var(--radius-full);
}

.feed-tabs {
  padding: 0;
  gap: 0;
}

.feed-tabs button,
.feed-tabs a {
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0;
  position: relative;
}

.feed-tabs button.active,
.feed-tabs a.active {
  color: var(--text-primary);
  background: transparent;
}

.feed-tabs button.active::after,
.feed-tabs a.active::after {
  content: "";
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: 0;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--text-primary);
}

.feed-list {
  display: block;
}

.feed-post {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-base);
  margin-inline: 0;
}

.feed-post-head {
  padding: var(--space-3) var(--space-4);
  gap: var(--space-2);
  flex-direction: row;
  align-items: flex-start;
}

.feed-author {
  gap: var(--space-3);
}

.feed-author .ff-avatar,
.ff-avatar-sm {
  width: 40px;
  height: 40px;
}

.feed-author strong {
  font-size: var(--text-sm);
}

.feed-author small {
  font-size: var(--text-xs);
}

.feed-type,
.level-badge,
.feed-pin {
  display: none;
}

.feed-menu-btn,
.icon-btn {
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  height: 44px;
  border-radius: var(--radius-full);
}

.feed-caption {
  padding: 0 var(--space-4) var(--space-3);
  font-size: var(--text-base);
}

.feed-media {
  border-block: 0;
  background: #050505;
}

.feed-media-item {
  min-height: 0;
  background: #050505;
}

.feed-carousel-arrow {
  width: 38px;
  height: 38px;
}

.feed-carousel-arrow.is-prev { left: 10px; }
.feed-carousel-arrow.is-next { right: 10px; }

.feed-carousel-count {
  top: 10px;
  right: 10px;
}

.feed-carousel-dots {
  bottom: 10px;
}

.feed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-2) var(--space-3);
  gap: var(--space-2);
}

.feed-actions-left {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.feed-actions button,
.feed-actions a {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  text-transform: none;
  color: var(--text-secondary);
}

.feed-actions button:active,
.feed-actions a:active {
  background: var(--bg-card-hover);
  transform: scale(0.96);
}

.feed-author-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.feed-author-name-line {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: nowrap;
}

.feed-author-name-line strong {
  font-size: var(--text-sm);
  font-weight: 700;
}

.feed-verified-badge {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feed-author-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.feed-type-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.feed-action-like,
.feed-action-comment {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-2);
  min-height: 44px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
}

.feed-action-like b,
.feed-action-comment b {
  font-size: var(--text-sm);
}

.feed-action-like.active {
  color: var(--accent);
}

.feed-action-like.active svg {
  fill: var(--accent);
  color: var(--accent);
}

.feed-cta-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: rgba(110, 0, 179, 0.12);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-sm);
  border: 1px solid rgba(110, 0, 179, 0.3);
  text-decoration: none;
  white-space: nowrap;
}

.feed-side {
  display: none;
}

.feed-empty {
  margin: var(--space-4);
}

.composer-backdrop {
  align-items: stretch;
  padding: 0;
  background: var(--bg-base);
  z-index: var(--z-modal);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.composer-panel {
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  border: 0;
  border-radius: 0;
  background: var(--bg-base);
}

.composer-head {
  grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
  min-height: calc(var(--header-h) + var(--safe-top));
  padding: calc(var(--space-2) + var(--safe-top)) var(--space-4) var(--space-2);
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2;
  border-bottom: 1px solid var(--border-subtle);
}

.composer-title small {
  display: none;
}

.composer-kicker {
  display: none;
}

.composer-cancel,
.composer-publish {
  min-height: 44px;
  padding-inline: var(--space-3);
}

.composer-cancel span,
.composer-publish span {
  font-size: var(--text-sm);
}

.composer-cancel svg,
.composer-publish svg {
  display: none;
}

.composer-scroll {
  padding: var(--space-3) var(--space-3) calc(var(--space-6) + var(--safe-bottom));
}

.composer-section {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
}

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

.composer-section-icon {
  width: 38px;
  height: 38px;
}

.segmented {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: var(--space-2);
  margin-inline: calc(var(--space-4) * -1);
  padding-inline: var(--space-4);
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }

.segmented label {
  flex: 0 0 auto;
}

.segmented label span {
  min-height: 42px;
}

.dropzone {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 104px;
  padding: var(--space-3);
}
.dropzone-action { display: none; }

.compose-previews {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.composer-field textarea {
  min-height: 124px;
  resize: none;
}

.composer-visibility {
  grid-template-columns: auto minmax(0, 1fr);
}

.composer-visibility select {
  grid-column: 1 / -1;
  width: 100%;
}

.post-editor-modal {
  width: 100%;
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - var(--space-4));
  border-radius: var(--radius-xl);
}

.post-editor-modal .ff-modal-body {
  padding: var(--space-4);
}

.post-editor-modal .ff-modal-actions {
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + var(--safe-bottom));
}

.post-editor-media {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-editor-add {
  grid-template-columns: auto minmax(0, 1fr);
}

.post-editor-add small {
  grid-column: 2;
  justify-self: start;
}

/* Profile v8 — cover photo layout */
.profile-hero {
  display: block !important;
  border: 0;
  border-radius: 0;
  margin: 0 0 var(--space-4);
  margin-inline: 0;
  padding: 0;
  background: var(--bg-base);
  overflow: visible;
}

/* Cover photo banner */
.profile-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  background: var(--bg-surface-2);
  overflow: hidden;
  flex-shrink: 0;
}

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

.profile-cover-placeholder {
  width: 100%;
  height: 100%;
  background: #1a1a1a;
}

/* Avatar overlapping cover */
.profile-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 0 var(--space-4) var(--space-4);
  position: relative;
}

.profile-avatar-wrap {
  margin-top: -48px;
  margin-bottom: var(--space-2);
  position: relative;
  z-index: 2;
}

.ff-avatar-hero {
  width: 90px;
  height: 90px;
  font-size: var(--text-3xl);
  border: 4px solid var(--bg-app) !important;
  border-radius: var(--radius-full) !important;
  display: block;
}

/* Ensure avatar image fills correctly */
.ff-avatar-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

.profile-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.profile-title-row h1 {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}

.profile-verified {
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
}

.profile-username {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-top: 2px;
}

.profile-location {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

.profile-bio {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
  line-height: 1.5;
}

/* Stats row — 3 cols igual ao screenshot */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  text-align: center;
  margin-top: var(--space-4);
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.profile-stats > * {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3) var(--space-2);
  border-right: 1px solid var(--border-subtle);
  text-decoration: none;
}

.profile-stats > *:last-child {
  border-right: 0;
}

.profile-stats strong {
  display: block;
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-weight: 700;
}

.profile-stats > * > :not(strong) {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* Hide extra stats — só 3 primeiros visíveis */
.profile-stats > *:nth-child(n+4) {
  display: none;
}

/* Action buttons */
.profile-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  width: 100%;
}

.profile-actions .btn {
  flex: 1;
}

.profile-actions .btn-icon-only {
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
}

/* Social links */
.profile-social-links {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

.profile-social-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-decoration: none;
}

.profile-social-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.profile-social-link:hover {
  color: var(--text-primary);
}

/* Profile v9 — foto unica central / orbit */
.profile-hero-orbit {
  margin: 0 var(--space-3) var(--space-4);
  padding: var(--space-6) var(--space-4);
  border-radius: 28px;
}

.profile-hero-orbit .profile-cover {
  display: none;
}

.profile-hero-orbit .profile-main {
  align-items: center;
  padding: 0;
  text-align: center;
}

.profile-hero-orbit .profile-avatar-wrap {
  width: 174px;
  height: 174px;
  margin: 0 0 var(--space-4);
}

.profile-hero-orbit .ff-avatar-hero {
  width: 140px;
  height: 140px;
  border-width: 5px !important;
  font-size: 3rem;
}

.profile-hero-orbit .profile-title-row {
  justify-content: center;
}

.profile-hero-orbit .profile-title-row h1 {
  font-size: clamp(1.65rem, 8vw, 2.35rem);
  text-align: center;
}

.profile-hero-orbit .profile-bio {
  text-align: center;
  margin-top: var(--space-3);
}

.profile-hero-orbit .profile-stats {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: var(--space-4);
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.profile-hero-orbit .profile-stat-card {
  min-height: 66px;
  display: grid;
  padding: 10px 8px;
  border-radius: 16px;
}

.profile-hero-orbit .profile-stat-card strong {
  font-size: 1.04rem;
}

.profile-hero-orbit .profile-stat-card small {
  font-size: 9px;
}

.profile-ranking-portal {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 74px;
  margin-top: var(--space-4);
}

.profile-ranking-arrow {
  display: none;
}

.profile-hero-orbit .profile-actions {
  flex-direction: row;
  width: 100%;
}

.profile-hero-orbit .profile-edit-mini {
  flex: 0 0 46px;
  width: 46px;
}

.profile-hero-orbit .profile-social-links {
  justify-content: center;
}

.profile-view-shell {
  margin-top: var(--space-3);
}

.profile-view-tabs {
  width: auto;
  margin: 0 var(--space-3) var(--space-3);
}

.profile-view-tabs button {
  min-height: 42px;
}

.profile-visibility-live,
.profile-public-display {
  margin-inline: var(--space-3);
  padding: var(--space-3);
  border-radius: 24px;
}

.profile-visibility-live-head,
.profile-public-display-head {
  align-items: flex-start;
}

.profile-public-display-head {
  display: grid;
}

.profile-public-display-head em {
  max-width: none;
  text-align: left;
}

.profile-visibility-live-grid {
  grid-template-columns: 1fr;
}

.profile-visibility-switch {
  min-height: 68px;
}

.profile-performance,
.profile-vault {
  grid-template-columns: 1fr !important;
  gap: var(--space-3);
  margin-inline: var(--space-3);
}

.profile-panel,
.profile-mini-panel,
.profile-posts-panel {
  border-radius: 24px;
}

.profile-panel .flex-between {
  grid-template-columns: auto minmax(0, 1fr);
}

.profile-panel .flex-between > .text-mut {
  grid-column: 1 / -1;
  justify-self: start;
}

.achievement-grid {
  grid-template-columns: 1fr;
}

.profile-tabs {
  margin-inline: 0;
  padding-inline: 6px;
}

.profile-posts-head {
  align-items: flex-start;
}

.profile-person-feed {
  width: 100%;
  gap: var(--space-3);
}

.profile-person-feed .feed-post {
  border-radius: 22px;
  margin-inline: 0;
}

.social-directory,
.ranking-page {
  margin-inline: var(--space-3);
}

.social-directory-head {
  padding: var(--space-4);
  border-radius: 24px;
}

.social-directory-head h1 {
  font-size: clamp(2rem, 10vw, 2.7rem);
}

.social-user-card {
  grid-template-columns: 1fr;
  gap: var(--space-3);
  border-radius: 22px;
}

.social-user-action {
  justify-content: stretch;
}

.social-user-action .btn,
.social-user-action .social-pill {
  width: 100%;
  justify-content: center;
}

.ranking-tabs {
  width: auto;
  margin-inline: 0;
  margin-bottom: var(--space-3);
}

.ranking-podium {
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

.ranking-podium-card,
.ranking-podium-card.rank-1 {
  order: initial;
  min-height: auto;
  grid-template-columns: auto auto minmax(0, 1fr);
  justify-items: start;
  align-content: center;
  text-align: left;
  padding: var(--space-3);
  border-radius: 24px;
}

.ranking-podium-card.rank-1 {
  border-color: rgba(110,0,179,.32);
}

.ranking-medal {
  width: 30px;
  height: 30px;
}

.ranking-podium-avatar,
.rank-1 .ranking-podium-avatar {
  width: 56px;
  height: 56px;
}

.ranking-podium-user {
  min-width: 0;
}

.ranking-podium-points,
.ranking-podium-meta {
  grid-column: 3;
}

.ranking-podium-points {
  font-size: var(--text-base);
}

.ranking-list-card {
  padding: 4px;
  border-radius: 24px;
}

.ranking-list-card .ranking-row {
  grid-template-columns: 34px 42px minmax(0, 1fr);
  min-height: 66px;
  gap: var(--space-2);
  padding: 10px;
  border-radius: 19px;
}

.ranking-list-card .ranking-row .streak-pill,
.ranking-list-card .ranking-row .rank-points,
.ranking-list-card .ranking-row .rank-delta {
  display: none;
}

.nutrition-page {
  margin-inline: var(--space-3);
}

.nutrition-hero {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: 24px;
}

.nutrition-hero h1 {
  font-size: clamp(2rem, 10vw, 2.75rem);
}

.nutrition-day-nav {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nutrition-week-strip {
  overflow-x: auto;
  scrollbar-width: none;
}

.nutrition-week-strip::-webkit-scrollbar {
  display: none;
}

.nutrition-macro-panel {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  padding: var(--space-3) !important;
  border-radius: 24px !important;
}

.nutrition-macro-panel .ff-macro-ring,
.nutrition-macro-panel .ff-macro-ring svg {
  width: 58px;
  height: 58px;
}

.nutrition-macro-panel .ff-macro-ring-value {
  font-size: 12px;
}

.nutrition-macro-panel .ff-macro-ring-sub {
  display: none;
}

.nutrition-builder-card,
.nutrition-food-card,
.nutrition-summary-card,
.nutrition-edit-card,
.nutrition-meal-card,
.nutrition-empty-meals {
  border-radius: 24px !important;
}

.nutrition-builder-card .grid-3,
.nutrition-management-grid,
.nutrition-summary-card .grid-4,
.nutrition-food-card .grid-2 {
  grid-template-columns: 1fr !important;
}

.nutrition-builder-card .flex-between,
.meal-add-form .grid-2 {
  display: grid;
  grid-template-columns: 1fr !important;
}

.nutrition-food-card .table,
.nutrition-builder-card .table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.nutrition-meal-card .ff-meal-card-head {
  padding: var(--space-3);
}

.nutrition-meal-card .ff-meal-items {
  padding-inline: var(--space-3);
}

.nutrition-meal-card .ff-meal-item {
  align-items: flex-start;
}

.search-page {
  margin-inline: max(var(--space-3), var(--safe-left)) max(var(--space-3), var(--safe-right));
}

.search-hero-card {
  grid-template-columns: 58px minmax(0, 1fr) auto !important;
  gap: 10px;
}

.search-hero-copy h1 {
  font-size: clamp(1.85rem, 9vw, 2.55rem);
}

.search-input-row {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 58px;
  border-radius: var(--radius-full);
}

.search-submit-btn {
  min-width: 86px;
  padding-inline: 18px;
}

.search-section-head {
  margin-top: var(--space-3);
}

.search-hashtag-grid {
  grid-template-columns: 1fr;
}

@media (max-width: 767px) {
  body[data-page="buscar"] .app-header {
    display: none;
  }

  body[data-page="buscar"] .app-main {
    padding-top: calc(var(--safe-top) + var(--space-3));
  }

  .search-page {
    min-height: calc(100dvh - var(--bottom-nav-h) - var(--safe-top) - var(--safe-bottom) - var(--space-4));
  }

  .search-hero-card {
    grid-template-columns: 54px minmax(0, 1fr) auto !important;
    gap: 8px;
  }

  .search-close-btn {
    width: 54px;
    height: 54px;
  }

  .search-close-btn svg {
    width: 26px;
    height: 26px;
  }

  .search-input-row {
    min-height: 54px;
    padding-inline: 14px;
  }

  .search-input-row input {
    min-height: 52px;
    font-size: 16px;
  }

  .search-input-icon svg {
    width: 23px;
    height: 23px;
  }

  .search-submit-btn {
    min-width: 80px;
    min-height: 54px;
    padding-inline: 16px;
  }

  .search-empty-state {
    min-height: min(520px, calc(100dvh - 245px));
    padding-top: var(--space-10);
  }

  .search-empty-icon svg {
    width: 72px;
    height: 72px;
  }

  .search-empty-state p {
    max-width: 310px;
  }
}

@media (max-width: 380px) {
  .search-hero-card {
    grid-template-columns: 48px minmax(0, 1fr) 72px !important;
  }

  .search-close-btn {
    width: 48px;
    height: 48px;
  }

  .search-input-row {
    min-height: 48px;
    padding-inline: 12px;
  }

  .search-input-row input {
    min-height: 46px;
  }

  .search-submit-btn {
    min-width: 72px;
    min-height: 48px;
    padding-inline: 12px;
    font-size: 14px;
  }
}

.notif-dropdown,
.header-notif-dropdown {
  right: 0 !important;
  width: min(360px, calc(100vw - 1rem)) !important;
  max-height: min(520px, calc(100dvh - var(--header-h) - var(--bottom-nav-h) - 1rem));
}

.notif-item {
  min-height: 62px;
  grid-template-columns: 38px minmax(0, 1fr) auto !important;
  padding: 9px !important;
}

.notif-avatar,
.notif-item img,
.notif-dot {
  width: 38px !important;
  height: 38px !important;
}

.profile-post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin: 0;
}

.profile-post-tile {
  aspect-ratio: 1;
  border-radius: 16px;
}

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

/* Editar perfil */
.profile-edit-page {
  margin-inline: var(--space-3);
}

.profile-edit-head {
  padding: var(--space-5) var(--space-4);
  border-radius: 26px;
}

.profile-edit-head {
  align-items: stretch;
}

.profile-edit-view {
  width: 100%;
  justify-content: center;
}

.profile-edit-pro {
  grid-template-columns: 1fr !important;
  gap: var(--space-3);
}

.profile-edit-card {
  padding: var(--space-4);
  border-radius: 24px;
}

.profile-edit-avatar {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.profile-edit-upload {
  width: 100%;
  text-align: left;
}

.profile-edit-card .form-row,
.profile-edit-card .grid-5 {
  grid-template-columns: 1fr !important;
}

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

.profile-edit-action {
  width: 100%;
}

/* Comments bottom sheet */
.comments-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0,0,0,0.76);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base);
}

.comments-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.comments-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-modal) + 1);
  width: min(640px, 100%);
  max-width: 100vw;
  height: min(780px, calc(86dvh - var(--safe-bottom)));
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: #0e0e0e;
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  transform: translateY(100%);
  transition: transform var(--duration-base) var(--ease-out), height var(--duration-base) var(--ease-out);
  overflow: hidden;
  box-shadow: 0 -18px 50px rgba(0,0,0,.5);
}

.comments-sheet.open {
  transform: translateY(0);
}

.comments-sheet.expanded {
  height: 100dvh;
  width: min(640px, 100%);
  border-radius: 0;
}

.comments-sheet-head {
  padding: calc(10px + var(--safe-top)) max(var(--space-4), var(--safe-right)) var(--space-3) max(var(--space-4), var(--safe-left));
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
  background: #0e0e0e;
}

.comments-sheet-handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
}

.comments-sheet-titlebar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
}

.comments-sheet-titlebar h3 {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.comments-sheet-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

.comments-sheet-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px var(--space-4) var(--space-6);
  scrollbar-width: thin;
}

.comment-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: var(--space-3);
  padding: 14px 0;
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
}

.comment-item > .ff-avatar {
  width: 42px;
  height: 42px;
}

.comment-item.is-reply {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 11px 0 4px;
}

.comment-item.is-reply > .ff-avatar {
  width: 34px;
  height: 34px;
}

.comment-list > .comment-item.is-reply {
  margin-left: 52px;
}

.comment-content,
.comment-copy {
  min-width: 0;
}

.comment-main-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.comment-copy {
  flex: 1;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.comment-meta strong {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 750;
}

.comment-text {
  margin-top: 3px;
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.comment-like {
  flex: 0 0 32px;
  min-width: 32px;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.comment-like b {
  min-height: 12px;
  font-size: 10px;
  font-weight: 600;
}

.comment-like.active {
  color: var(--accent);
}

.comment-like.active svg {
  fill: currentColor;
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: 5px;
}

.comment-actions button {
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 650;
  cursor: pointer;
}

.comment-actions button:hover,
.comments-sheet-close:hover,
.comments-reply-context button:hover {
  color: var(--text-primary);
}

.comment-thread {
  margin-top: 2px;
}

.comment-replies-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
}

.comment-replies-toggle > span {
  display: block;
  width: 28px;
  height: 1px;
  background: var(--border-strong);
}

.comment-replies-toggle b {
  font-weight: 650;
}

.comment-replies-toggle:disabled {
  opacity: .6;
}

.comment-replies {
  position: relative;
}

.comment-replies::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 8px;
  width: 1px;
  background: var(--border-subtle);
}

.comments-empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-primary);
  text-align: center;
}

.comments-empty span {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.comments-reply-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 9px var(--space-4) 5px;
  background: #0e0e0e;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.comments-reply-context[hidden] {
  display: none;
}

.comments-reply-context strong {
  color: var(--text-primary);
}

.comments-reply-context button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.comments-sheet-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  align-items: center;
  padding: 10px var(--space-4) calc(10px + var(--safe-bottom));
  border-top: 1px solid var(--border-subtle);
  background: #0e0e0e;
}

.comments-sheet-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 17px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 16px;
}

.comments-sheet-form input:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.comments-submit {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform var(--duration-fast), background var(--duration-fast);
}

.comments-submit:hover {
  background: var(--accent-hover);
}

.comments-submit:active {
  transform: scale(.94);
}

@media (min-width: 769px) {
  .comments-sheet {
    bottom: 24px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
  }
}

/* =====================================================================
   FitFolio UI v8 — calendar strip, stats rows, workout cards, macros
   ===================================================================== */

/* --- Weekly calendar strip --- */
.ff-week-strip {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-2) 0 var(--space-1);
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-inline: calc(var(--space-4) * -1);
  padding-inline: var(--space-4);
  scroll-snap-type: x mandatory;
}
.ff-week-strip::-webkit-scrollbar { display: none; }

.ff-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 40px;
  scroll-snap-align: center;
  cursor: pointer;
  text-decoration: none;
}

.ff-week-day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.ff-week-day-num {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-muted);
  transition: background var(--duration-fast), color var(--duration-fast);
}

.ff-week-day.today .ff-week-day-name { color: var(--text-secondary); }
.ff-week-day.today .ff-week-day-num {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.ff-week-day.has-data .ff-week-day-name { color: var(--text-secondary); }
.ff-week-day.has-data .ff-week-day-num { color: var(--text-primary); }

/* --- Home tabs (Treinos | Refeições) --- */
.ff-home-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0;
  margin-inline: calc(var(--space-4) * -1);
  padding-inline: var(--space-4);
}

.ff-home-tab {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-muted);
  border: 0;
  background: transparent;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--duration-fast);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.ff-home-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.ff-tab-panel { display: none; }
.ff-tab-panel.active { display: block; }

/* --- Stat rows (FitFolio home metrics) --- */
.ff-stats-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: var(--space-4);
  padding-inline: var(--space-4);
}

.ff-stat-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.ff-stat-row:last-child { border-bottom: 0; }

.ff-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-surface-2);
}

.ff-stat-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
  color: var(--accent);
}

/* Todos monocromáticos */
.ff-stat-icon.accent,
.ff-stat-icon.blue,
.ff-stat-icon.green,
.ff-stat-icon.yellow { background: var(--bg-surface-2); color: var(--text-secondary); }

.ff-stat-icon.accent svg,
.ff-stat-icon.blue svg,
.ff-stat-icon.green svg,
.ff-stat-icon.yellow svg { color: var(--text-secondary); }

.ff-stat-info { min-width: 0; }

.ff-stat-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ff-stat-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.ff-stat-right { text-align: right; }

.ff-stat-value {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.ff-stat-progress {
  display: block;
  margin-top: 4px;
}
.ff-stat-progress-bar {
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  overflow: hidden;
  min-width: 60px;
}
.ff-stat-progress-bar > div {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width 0.5s ease;
}

/* --- Workout card FitFolio style --- */
.ff-workout-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-3);
  margin-inline: var(--space-4);
}

.ff-workout-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  padding-bottom: var(--space-2);
}

.ff-workout-card-info { display: flex; align-items: center; gap: var(--space-3); }

.ff-workout-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ff-workout-icon svg { width: 24px; height: 24px; stroke-width: 2; }

/* Treino icons — monocromáticos */
.ff-workout-icon[data-color] { background: var(--bg-surface-2); color: var(--text-secondary); }

.ff-workout-name {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
  display: block;
}

.ff-workout-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.ff-workout-start-btn {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-top: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--accent);
  background: transparent;
  border-radius: 0;
  letter-spacing: 0.02em;
  transition: background var(--duration-fast);
  text-decoration: none;
  padding: var(--space-3);
}

.ff-workout-start-btn:hover { background: rgba(255,255,255,.04); color: var(--accent); }

/* --- Nutrition list view (refeicoes.php) --- */
.ff-macro-circles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: var(--space-4);
}

.ff-macro-circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.ff-macro-ring {
  position: relative;
  width: 64px;
  height: 64px;
}

.ff-macro-ring svg {
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
}

.ff-macro-ring-bg {
  fill: none;
  stroke: var(--bg-surface-2);
  stroke-width: 5;
}

.ff-macro-ring-fill {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.ff-macro-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.ff-macro-ring-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ff-macro-ring-sub {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  display: block;
  margin-top: -2px;
}

/* Cores dos macros */
/* Anéis de macro — monocromáticos */
.ff-ring-kcal .ff-macro-ring-fill,
.ff-ring-prot .ff-macro-ring-fill,
.ff-ring-carb .ff-macro-ring-fill,
.ff-ring-gord .ff-macro-ring-fill,
.ff-ring-agua .ff-macro-ring-fill { stroke: var(--text-primary); }

/* --- Meal cards (refeicoes.php list) --- */
.ff-meal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.ff-meal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.ff-meal-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.ff-meal-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ff-meal-card-icon svg { width: 18px; height: 18px; color: var(--text-secondary); }

.ff-meal-name {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
}

.ff-meal-kcal {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.ff-meal-items { padding: 0 var(--space-4) var(--space-3); }

.ff-meal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border-subtle);
  gap: var(--space-2);
}

.ff-meal-item-name {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 500;
}

.ff-meal-item-qty {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.ff-meal-item-macros {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.ff-macro-tag {
  font-size: 11px;
  font-weight: 700;
}

.ff-macro-tag.p { color: #f87171; }  /* vermelho – proteína */
.ff-macro-tag.c { color: #60a5fa; }  /* azul – carboidrato */
.ff-macro-tag.g { color: var(--brand-bright); }  /* gordura */

/* --- Contadores opcionais das abas do feed --- */
.feed-tabs .ff-feed-count {
  font-size: 10px;
  background: var(--accent);
  color: #fff;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  margin-left: 4px;
  font-weight: 800;
}

/* --- FAB flutuante (botão + nas páginas individuais) --- */
.ff-page-fab {
  position: fixed;
  right: var(--space-5);
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-4));
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(110, 0, 179, 0.4);
  z-index: var(--z-sticky);
  transition: transform var(--duration-fast), box-shadow var(--duration-fast);
  text-decoration: none;
}

.ff-page-fab:active { transform: scale(0.92); }
.ff-page-fab svg { width: 24px; height: 24px; stroke-width: 2.5; color: #fff; }

/* Cover photo edit button */
.profile-cover-edit {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.profile-cover-edit svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

/* --- Streak pill --- */
.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(245, 245, 245, 0.08);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
}

/* Update text-bronze helper */
.text-bronze, .text-accent { color: var(--accent) !important; }

/* Progress bars */
.progress > .bar,
.disc-fill {
  background: var(--accent);
}

/* =====================================================================
   Treino — Detalhe do Treino (estilo FitFolio)
   ===================================================================== */
.ff-workout-detail {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ff-workout-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  gap: var(--space-3);
}

.ff-workout-detail-back {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
  text-decoration: none;
}

.ff-workout-detail-back svg {
  width: 18px;
  height: 18px;
}

.ff-workout-detail-name {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ff-workout-iniciar-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 20px;
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--duration-fast);
  flex-shrink: 0;
}

.ff-workout-iniciar-btn:active {
  background: var(--accent-hover);
}

.ff-workout-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-4) 0 var(--space-2);
  font-size: 2.8rem;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.ff-workout-timer-box {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.ff-workout-timer-sep {
  color: var(--accent);
  font-size: 2rem;
  font-weight: 700;
  margin: 0 2px;
}

.ff-exercise-list {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-2);
}

.ff-exercise-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
}

.ff-exercise-row:last-child {
  border-bottom: none;
}

.ff-exercise-check {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.ff-exercise-check.done {
  border-color: var(--accent);
  background: rgba(110, 0, 179, 0.12);
  color: var(--accent);
}

.ff-exercise-check svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.ff-exercise-name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ff-exercise-more {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.ff-exercise-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

.ff-exercise-arrow svg {
  width: 16px;
  height: 16px;
}

.ff-add-exercise-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  font-size: var(--text-sm);
}

.ff-add-exercise-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

/* Workout type bottom sheet options */
.ff-sheet-workout-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-4);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast);
}

.ff-sheet-workout-option:hover,
.ff-sheet-workout-option:active {
  background: var(--bg-surface-2);
}

.ff-sheet-workout-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ff-sheet-workout-icon.primary {
  background: var(--accent);
  border-color: var(--accent);
}

.ff-sheet-workout-icon.primary svg {
  color: #fff;
}

.ff-sheet-workout-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  color: var(--text-secondary);
}

.ff-sheet-workout-label strong {
  display: block;
  font-weight: 700;
  font-size: var(--text-base);
}

.ff-sheet-workout-label span {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Workout logging form section */
.ff-workout-log-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: var(--space-3) 0;
}

.ff-workout-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.ff-workout-set-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.ff-workout-set-row:last-child {
  border-bottom: none;
}

.ff-workout-set-num {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
}

.ff-workout-set-row input {
  text-align: center;
}

/* Meal card checkbox style */
.ff-meal-checkbox {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ff-meal-checkbox.done {
  border-color: var(--accent);
  background: var(--accent);
}

.ff-meal-checkbox svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.ff-meal-checkbox.done svg {
  color: #fff;
}

/* Botao "Iniciar treino" no card */
.ff-workout-start-btn {
  color: var(--accent);
}

.ff-workout-start-btn:hover {
  background: rgba(110, 0, 179, 0.06);
  color: var(--accent);
}

/* Week day selected indicator */
.ff-week-day.selected .ff-week-day-num {
  font-weight: 700;
  color: var(--text-primary);
}

.ff-week-day.has-log .ff-week-day-num::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--accent);
  margin: 2px auto 0;
}

/* Streak pill roxo */
.streak-pill {
  background: rgba(110, 0, 179, 0.1);
  border-color: rgba(110, 0, 179, 0.3);
  color: var(--accent);
}

/* Feed toolbar redesign */
.feed-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
}

.feed-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.feed-tabs button {
  flex: 1;
  padding: var(--space-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: color var(--duration-fast), border-color var(--duration-fast);
  margin-bottom: -1px;
}

.feed-tabs button.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* Perfil — badge PRO */
.ff-pro-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 14px;
  border: 1.5px solid var(--brand);
  box-shadow: 0 0 18px var(--brand-glow);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.ff-pro-badge span.pro {
  color: var(--brand-bright);
}

/* Avatar no bottom nav */
.bottom-nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--brand);
  transition: border-color var(--duration-fast);
}

.bottom-nav-item.active .bottom-nav-avatar {
  border-color: var(--accent);
}

/* Macro rings */
.ff-ring-kcal .ff-macro-ring-fill { stroke: var(--accent); }
.ff-ring-carb .ff-macro-ring-fill { stroke: #60a5fa; }
.ff-ring-prot .ff-macro-ring-fill { stroke: #f87171; }
.ff-ring-gord .ff-macro-ring-fill { stroke: #facc15; }

/* Feed mobile — simplifica toolbar */
@media (max-width: 768px) {
  .feed-toolbar { flex-direction: column; align-items: stretch; gap: 0; margin-bottom: 0; }
  .feed-toolbar > select { display: none; }
  .feed-toolbar > .btn-primary[data-open-composer] { display: none; }
  .feed-tabs { width: 100%; }
  .feed-side { display: none !important; }
  .feed-layout { grid-template-columns: 1fr !important; }
}

/* Workout icon — roxo */
.ff-workout-icon[data-color="purple"] {
  background: rgba(110, 0, 179, 0.12);
  color: var(--accent);
}

/* Timer */
.ff-workout-timer-box {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   Workout Register — redesign visual (FF v8)
   ============================================================ */

/* Painéis (slide from right) */
.ff-panel {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 2);
  background: var(--bg-base);
  transform: translateX(100%);
  transition: transform var(--duration-base) var(--ease-out);
  overflow-y: auto;
  padding-bottom: calc(var(--safe-bottom) + var(--space-6));
  padding-top: calc(var(--header-h) + var(--safe-top));
}
.ff-panel.open { transform: translateX(0); }

.ff-reg-behind { opacity: 0.4; pointer-events: none; }

/* Panel header */
.ff-panel-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3);
  position: sticky;
  top: 0;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  z-index: 2;
  border-bottom: 1px solid var(--border-subtle);
}
.ff-panel-title {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ff-panel-back {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-2);
  border-radius: var(--radius-full);
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

/* Reg header */
.ff-reg-header {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  position: sticky;
  top: calc(var(--header-h) + var(--safe-top));
  z-index: var(--z-sticky);
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.ff-reg-dismiss {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-2);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  text-decoration: none;
}
.ff-reg-title {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ff-reg-iniciar-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast);
}
.ff-reg-iniciar-btn:hover { background: rgba(110,0,179,.1); }
.ff-reg-iniciar-btn:disabled { opacity: 0.6; cursor: default; }
.ff-reg-done {
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: 8px 12px;
}

/* Exercise go button */
.ff-exercise-go {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.ff-exercise-go:active { background: var(--bg-card-hover); }

/* Exercise thumb icon (detail panel) */
.ff-ex-thumb-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

/* Set column headers */
.ff-set-col-headers {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 1fr 44px;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.ff-set-col-headers span {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}

/* Set rows */
.ff-set-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 1fr 44px;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-fast);
}
.ff-set-row.done { background: rgba(110,0,179,.04); }

.ff-set-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-strong);
  background: transparent;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
  flex-shrink: 0;
}
.ff-set-circle.done {
  border-color: var(--accent);
  background: rgba(110,0,179,.15);
  color: var(--accent);
}

.ff-set-pill-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ff-set-pill {
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: center;
  appearance: none;
  -moz-appearance: textfield;
}
.ff-set-pill::-webkit-inner-spin-button,
.ff-set-pill::-webkit-outer-spin-button { -webkit-appearance: none; }
.ff-set-pill:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-glow); }
.ff-set-pill-unit {
  position: absolute;
  right: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
  pointer-events: none;
}

.ff-set-more {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

/* Add serie button */
.ff-add-serie-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4) var(--space-4);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  text-align: left;
}
.ff-add-serie-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

/* Notes */
.ff-ex-notes {
  width: 100%;
  min-height: 120px;
  padding: var(--space-4);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-base);
  resize: none;
  line-height: 1.5;
}
.ff-ex-notes::placeholder { color: var(--text-muted); }
.ff-ex-notes:focus { outline: none; color: var(--text-primary); }

/* Exercise picker */
.ff-ex-search-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-full);
  margin: var(--space-4);
  color: var(--text-muted);
}
.ff-ex-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: var(--text-base);
  min-height: 0;
  padding: 0;
}
.ff-ex-search-input:focus { outline: none; }
.ff-ex-search-input::placeholder { color: var(--text-muted); }

.ff-ex-filter-label {
  padding: 0 var(--space-4) var(--space-2);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

.ff-ex-filter-tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: 0 var(--space-4) var(--space-3);
  scrollbar-width: none;
  margin-bottom: var(--space-2);
}
.ff-ex-filter-tabs::-webkit-scrollbar { display: none; }

.ff-ex-filter-tab {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}
.ff-ex-filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ff-ex-picker-list {
  padding: 0;
}

.ff-ex-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.ff-ex-list-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-base);
  font-weight: 700;
  font-size: var(--text-lg);
}
.ff-ex-list-thumb--add {
  background: var(--bg-surface-2);
  color: var(--accent);
}
.ff-ex-list-info {
  flex: 1;
  min-width: 0;
}
.ff-ex-list-name {
  display: block;
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
}
.ff-ex-list-group {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}
.ff-ex-list-chips {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}
.ff-ex-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}
.ff-ex-list-add {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--duration-fast);
}
.ff-ex-list-add:active { background: rgba(110,0,179,.15); }

/* ============================================================
   Editor de split — fluxo mobile alinhado ao registro de treino
   ============================================================ */
@media (max-width: 768px) {
  body[data-page="treino"] .feed-fab {
    display: none !important;
  }

  .treino-page-head {
    margin-bottom: var(--space-3);
    padding-inline: var(--space-4);
  }

  .treino-page-head h1 {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: -.02em;
    text-transform: none;
  }

  .treino-page-head .subtitle {
    max-width: 34rem;
    margin-top: 4px;
    font-size: var(--text-sm);
    line-height: 1.45;
  }

  .tabs.treino-tabs {
    width: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 44px;
    gap: 6px;
    margin: 0 var(--space-3) var(--space-3);
    padding: 0;
    overflow: visible;
  }

  .treino-tabs .btn {
    min-width: 0;
    min-height: 46px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    white-space: nowrap;
  }

  .treino-tabs .treino-list-link {
    width: 44px;
    padding: 0;
  }

  .treino-list-link span {
    display: none;
  }

  .split-editor-layout {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .split-day-rail {
    position: sticky;
    top: calc(var(--header-h) + var(--safe-top));
    z-index: calc(var(--z-sticky) + 2);
    width: 100%;
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    margin: 0;
    padding: 10px var(--space-3);
    border-block: 1px solid var(--border-subtle);
    background: rgba(10, 10, 10, .94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--space-3);
  }

  .split-day-rail::-webkit-scrollbar {
    display: none;
  }

  .split-day-card {
    flex: 0 0 112px;
    min-height: 88px;
    justify-content: center;
    scroll-snap-align: start;
    padding: 11px 13px;
    border-radius: var(--radius-md);
  }

  .split-day-card:hover {
    transform: none;
  }

  .split-day-card.active {
    box-shadow: inset 0 -3px 0 var(--accent), 0 0 0 1px var(--accent-glow);
  }

  .split-day-card strong {
    font-size: var(--text-sm);
  }

  .split-editor-workspace {
    display: block;
    padding: var(--space-3);
  }

  .split-editor-form {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .split-editor-header {
    padding: var(--space-4);
    border: 1px solid rgba(110, 0, 179, .22);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(110, 0, 179, .14), var(--bg-surface) 62%);
  }

  .split-editor-header strong {
    font-size: var(--text-lg);
  }

  .split-editor-header > span:last-child > span {
    font-size: var(--text-xs);
  }

  .split-editor-section {
    margin-top: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
  }

  .split-section-title {
    margin-bottom: var(--space-4);
  }

  .split-section-icon {
    width: 36px;
    height: 36px;
  }

  .split-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3) var(--space-2);
  }

  .split-field input,
  .split-field select {
    min-height: 46px;
    padding-inline: 12px;
  }

  .split-input-unit input {
    padding-right: 44px;
  }

  .split-exercises-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-2);
  }

  .split-add-exercise {
    margin-left: 0;
    padding-inline: 11px;
  }

  .exercise-row.split-exercise-card {
    padding: var(--space-3);
    border-radius: var(--radius-lg);
  }

  .split-exercise-card-head {
    margin-bottom: var(--space-3);
  }

  .split-exercise-actions button {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .split-exercise-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3) var(--space-2);
  }

  .split-editor-footer {
    position: sticky;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
    z-index: calc(var(--z-bottom-nav) - 1);
    display: grid;
    grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
    gap: var(--space-2);
    margin: var(--space-3) calc(var(--space-3) * -1) 0;
    padding: 10px var(--space-3);
    border-block: 1px solid var(--border-subtle);
    background: rgba(10,10,10,.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .split-editor-footer .btn {
    min-width: 0;
    width: 100%;
    min-height: 48px;
    border-radius: var(--radius-md);
  }

  .split-rest-card {
    grid-template-columns: auto minmax(0, 1fr);
    margin-top: var(--space-3);
    margin-bottom: var(--space-5);
    padding: var(--space-4);
  }

  .split-rest-card .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .ff-session-hero {
    margin: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }

  .ff-session-controls {
    grid-template-columns: 1fr;
  }

  .ff-session-btn {
    min-height: 52px;
    border-radius: var(--radius-full);
  }

  .ff-action-stack,
  .ff-workout-actions {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .ff-action-stack {
    padding: 0;
  }

  .ff-workout-actions {
    padding: var(--space-3) var(--space-3) calc(var(--space-5) + var(--safe-bottom));
  }

  .ff-action-card,
  .ff-workout-action-card {
    min-height: 76px;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 390px) {
  .treino-tabs .btn {
    font-size: 12px;
  }

  .split-day-card {
    flex-basis: 104px;
  }

  .split-add-exercise {
    width: 40px;
    padding: 0;
    font-size: 0;
  }

  .split-add-exercise svg {
    width: 19px;
    height: 19px;
  }
}
