/* ===== Design System — Desafios App ===== */
:root {
  --color-bg:      #FAFAFA;
  --color-text:    #1A1A1A;
  --color-accent:  #C95028;
  --color-muted:   #6B6B6B;
  --color-border:  #E0E0E0;
  --color-success: #2D6A4F;

  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;

  --max-width:    480px;
  --radius:       4px;
  --touch-target: 44px;
  --node-size:    60px;
  --nav-height:   56px;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] { display: none !important; }

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

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ===== Layout ===== */
.app-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-2);
}

/* ===== Loading ===== */
#js-main {
  padding: var(--space-4) 0;
}

.loading {
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* ===== Global Nav ===== */
.global-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-2);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg);
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.challenge-select {
  flex: 1;
  min-width: 0;
  max-width: 280px;
  height: 36px;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  color: inherit;
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0 var(--space-1);
  cursor: pointer;
  appearance: auto;
  opacity: 0.85;
}

.challenge-select:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  opacity: 1;
}

/* ===== Dots indicator ===== */
.nav-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  flex-shrink: 0;
}

.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: transparent;
  cursor: pointer;
  padding: 0;
  opacity: 0.4;
  transition: opacity 0.2s, background-color 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
  /* Expand touch target */
  position: relative;
}

.nav-dot::after {
  content: '';
  position: absolute;
  inset: -8px;
}

.nav-dot--active {
  background: currentColor;
  opacity: 1;
  transform: scale(1.2);
}

/* ===== Carousel ===== */
.carousel-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
  /* height = viewport minus nav */
  min-height: calc(100dvh - var(--nav-height));
}

.carousel-track {
  display: flex;
  will-change: transform;
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  touch-action: pan-y;
}

.carousel-track--dragging {
  transition: none;
}

/* ===== Slide ===== */
.carousel-slide {
  width: 100vw;
  min-width: 100vw;
  min-height: calc(100dvh - var(--nav-height));
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  /* Theme CSS vars are applied inline per slide by JS */
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}

/* ===== Lock overlay ===== */
.slide-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 5;
}

.slide-lock__icon {
  font-size: 2.5rem;
  line-height: 1;
}

.slide-lock__msg {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.slide-lock__sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-style: italic;
  text-align: center;
  max-width: 260px;
}

/* ===== App Header (dentro de cada slide) ===== */
.app-header {
  padding: var(--space-4) 0 var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-3);
}

.header-tagline {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-1);
}

.header-title {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: normal;
  line-height: 1.2;
  margin-bottom: var(--space-2);
}

.header-title .accent {
  color: var(--color-accent);
  font-style: italic;
}

/* ===== Progress ===== */
.progress-count {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: var(--space-1);
}

.progress-bar {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ===== Dia Zero (intro card) ===== */
.dia-zero {
  padding: 0 0 var(--space-2);
}

.dia-zero__btn {
  width: 100%;
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: transparent;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius);
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, color 0.2s;
}

.dia-zero__btn:active,
.dia-zero__btn:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-accent);
  outline: none;
}

.dia-zero__btn--concluido {
  border-style: solid;
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ===== Tracker (serpentina) ===== */
.tracker {
  padding: var(--space-2) 0 var(--space-4);
}

.tracker-row {
  display: flex;
  align-items: center;
}

.tracker-row--rtl {
  flex-direction: row-reverse;
}

/* Nó (círculo do dia) */
.tracker-node {
  width: var(--node-size);
  height: var(--node-size);
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background-color 0.15s;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
}

.tracker-node__label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text);
  line-height: 1;
  text-transform: uppercase;
}

.tracker-node__check {
  font-size: 0.8rem;
  color: #fff;
  line-height: 1;
}

/* Estado: disponível */
.tracker-node--disponivel {
  border-color: var(--color-text);
  border-width: 1.5px;
}

.tracker-node--disponivel:active {
  background: var(--color-border);
}

/* Dia atual */
.tracker-node--current {
  border-color: var(--color-accent);
  border-width: 2px;
}

.tracker-node--current .tracker-node__label {
  color: var(--color-accent);
}

/* Estado: concluído */
.tracker-node--concluido {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.tracker-node--concluido .tracker-node__label {
  color: #fff;
  font-size: 0.55rem;
}

/* Estado: bloqueado */
.tracker-node--bloqueado {
  border-color: var(--color-border);
  cursor: default;
  opacity: 0.5;
}

/* Presente surpresa: ícone no nó (inline, abaixo do label) */
.tracker-node__gift {
  font-size: 0.7rem;
  line-height: 1;
  color: var(--color-accent);
  pointer-events: none;
}

.tracker-node--concluido .tracker-node__gift {
  color: #fff;
}

.tracker-node--bloqueado .tracker-node__gift {
  color: var(--color-muted);
}

@keyframes gift-bounce {
  0%, 100% { transform: translateY(0); }
  10%      { transform: translateY(-4px); }
  20%      { transform: translateY(-1px); }
  30%      { transform: translateY(-3px); }
  40%      { transform: translateY(0); }
}

/* Bounce em presentes fechados: bloqueado e disponivel */
.tracker-node:not(.tracker-node--concluido) .tracker-node__gift,
.day-gift__icon.fa-gift {
  animation: gift-bounce 1.8s ease-in-out infinite;
}

@keyframes presente-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 80, 40, 0.35); }
  50%       { box-shadow: 0 0 0 7px rgba(201, 80, 40, 0); }
}

.tracker-node--presente {
  animation: presente-pulse 2s ease-in-out infinite;
}

/* Dia zero com presente */
.dia-zero__btn--presente {
  animation: presente-pulse 2s ease-in-out infinite;
}

.dia-zero__gift {
  font-size: 0.85rem;
  color: var(--color-accent);
}

.dia-zero__btn--concluido .dia-zero__gift {
  color: var(--color-accent);
}

/* Conector horizontal */
.tracker-h {
  flex: 1;
  height: 1.5px;
  background: var(--color-border);
}

/* Conector vertical */
.tracker-v {
  height: var(--space-3);
  position: relative;
}

.tracker-v::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: var(--color-border);
}

.tracker-v--right::after {
  right: calc(var(--node-size) / 2 - 1px);
}

.tracker-v--left::after {
  left: calc(var(--node-size) / 2 - 1px);
}

/* ===== Footer ===== */
.app-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-2) 0 var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text,
.footer-author {
  font-size: 0.7rem;
  color: var(--color-muted);
  font-style: italic;
}

/* ===== Day View (overlay fixo) ===== */
.view-day {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}

.day-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  min-height: var(--touch-target);
}

.btn-back {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-accent);
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  display: flex;
  align-items: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.day-header__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.day-header__gift {
  font-size: 1rem;
  color: var(--color-accent);
  margin-left: var(--space-1);
}

.day-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-2) var(--space-6);
}

.day-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: normal;
  line-height: 1.3;
  margin-bottom: var(--space-3);
}

.day-text {
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: var(--space-3);
}

.day-text p + p {
  margin-top: var(--space-2);
}

/* Presente surpresa na view do dia */
.day-gift {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-2);
  background: rgba(201, 80, 40, 0.07);
  border: 1.5px solid rgba(201, 80, 40, 0.25);
  border-radius: var(--radius);
  animation: presente-pulse 2s ease-in-out infinite;
}

.day-gift__icon {
  font-size: 1.2rem;
  color: var(--color-accent);
  flex-shrink: 0;
}

.day-gift__link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.day-gift__link:hover {
  opacity: 0.8;
}

.day-media {
  margin-bottom: var(--space-3);
}

.day-media audio {
  width: 100%;
}

.day-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--radius);
}

.day-video-native {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  display: block;
}

.day-actions {
  margin-top: var(--space-4);
}

.btn-complete {
  width: 100%;
  min-height: var(--touch-target);
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  padding: var(--space-2);
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.btn-complete:active {
  opacity: 0.85;
}

.day-done-msg {
  text-align: center;
  color: var(--color-success);
  font-weight: 600;
  font-size: 0.95rem;
  padding: var(--space-2);
}

/* ===== Modal de instalação PWA ===== */
.install-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-2);
}

.install-modal[hidden] {
  display: none;
}

.install-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.install-modal__box {
  position: relative;
  background: var(--color-bg);
  color: var(--color-text);
  border-radius: 20px 20px 16px 16px;
  padding: var(--space-4) var(--space-3) var(--space-3);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.18);
  animation: install-modal-up 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes install-modal-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.install-modal__close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--color-border);
  border: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.8rem;
  -webkit-tap-highlight-color: transparent;
}

.install-modal__icon {
  font-size: 2rem;
  color: var(--color-accent);
  margin-bottom: var(--space-1);
}

.install-modal__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 var(--space-1);
  color: var(--color-text);
}

.install-modal__subtitle {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin: 0 0 var(--space-3);
  line-height: 1.5;
}

.install-modal__steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.install-modal__step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.install-modal__step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.install-modal__step-body {
  flex: 1;
  padding-top: 4px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text);
}

.install-modal__step-body strong {
  color: var(--color-text);
}

.install-modal__step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--color-border);
  color: var(--color-text);
  font-size: 0.7rem;
  vertical-align: middle;
  margin: 0 2px;
}

@media (min-width: 480px) {
  .install-modal {
    align-items: center;
  }
  .install-modal__box {
    border-radius: 16px;
    animation: install-modal-fade 0.22s ease;
  }
  @keyframes install-modal-fade {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
  }
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--color-text);
  color: #fff;
  font-size: 0.875rem;
  padding: var(--space-1) var(--space-3);
  border-radius: 99px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 100;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Desktop enhancement ===== */
@media (min-width: 480px) {
  .header-title {
    font-size: 2.25rem;
  }
}

/* ===== Auth Screens (Login + Sem Acesso) ===== */
.auth-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-2);
}

.auth-card {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.auth-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: normal;
  line-height: 1.2;
  color: var(--color-text);
}

.auth-title em {
  font-style: italic;
  color: var(--color-accent);
}

.auth-sub {
  font-size: 1rem;
  color: var(--color-muted);
  line-height: 1.6;
  max-width: 380px;
}

.auth-email {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-style: italic;
}

/* Botão Google */
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: 0 var(--space-3);
  background: #fff;
  color: #1A1A1A;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  width: 100%;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
  margin-top: var(--space-2);
}

.btn-google:hover {
  background: #F5F5F5;
  border-color: #BDBDBD;
}

.btn-google__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Botões da tela sem acesso */
.auth-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  padding: 0 var(--space-3);
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.btn-primary:active { opacity: 0.85; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  padding: 0 var(--space-3);
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-body);
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.btn-secondary:hover { background: #F5F5F5; }

.btn-link {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-top: var(--space-2);
  align-self: flex-start;
  -webkit-tap-highlight-color: transparent;
}

.btn-logout-full {
  width: 100%;
  margin-top: 0;
  color: var(--color-muted);
}

/* Botão logout no nav */
.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--color-muted);
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  order: 99;
}

/* Botão notificações push no nav */
.btn-notify {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-muted);
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* Botão instalar PWA no nav */
.btn-install {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-accent);
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Hamburger ===== */
.btn-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: currentColor;
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Nav right group ===== */
.nav-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ===== Avatar ===== */
.btn-avatar {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.avatar-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1.5px solid var(--color-border);
}

.btn-avatar--fallback {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Avatar dropdown ===== */
.avatar-menu {
  position: fixed;
  top: calc(var(--nav-height) + 6px);
  right: var(--space-2);
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 35;
  min-width: 164px;
  overflow: hidden;
}

.avatar-menu__item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 var(--space-2);
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  min-height: var(--touch-target);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.avatar-menu__item:hover,
.avatar-menu__item:active {
  background: rgba(0, 0, 0, 0.05);
}

.avatar-menu__item--danger {
  color: var(--color-accent);
}

.avatar-menu__divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

/* ===== Drawer lateral ===== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.is-visible {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  z-index: 41;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

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

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-2);
  border-bottom: 1px solid var(--color-border);
  min-height: var(--nav-height);
  flex-shrink: 0;
}

.drawer-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.btn-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-muted);
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.drawer-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: var(--space-1) 0;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-2);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--color-text);
  font-family: inherit;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.drawer-item:active,
.drawer-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.drawer-item--active {
  background: rgba(201, 80, 40, 0.06);
}

.drawer-item__icon {
  font-size: 0.875rem;
  width: 24px;
  flex-shrink: 0;
  text-align: center;
  color: var(--color-muted);
}

.drawer-item--active .drawer-item__icon {
  color: var(--color-accent);
}

.drawer-item__text {
  flex: 1;
  min-width: 0;
}

.drawer-item__name {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-item--active .drawer-item__name {
  color: var(--color-accent);
}

.drawer-item__sub {
  display: block;
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 2px;
}
