@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ================= VARIABLES & RESET ================= */
:root {
  --absolute-white: #FFFFFF;
  /* Design System - Dark Mode (Default) */
  --bg-primary: #000000;
  --bg-secondary: #000000;
  --card-bg: #1C1C1E;
  --card-gradient: linear-gradient(135deg, #242426 0%, #151517 30%, #151517 100%);
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.3);
  --border-color: #2C2C2C;
  --border-light: rgba(255, 255, 255, 0.1);
  --separator-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --shadow-glow: rgba(0, 0, 0, 0.5);
  
  /* Brand/Accent Colors */
  --primary: #0A84FF;
  --danger: #FF453A;
  --success: #32D74B;
  --accent: #B39DDB;

  /* Legacy Mapping */
  --bg-dark: var(--bg-primary);
  --bg-darker: var(--bg-secondary);
  --text-main: var(--text-primary);
  --text-dim: var(--text-secondary);
  --text-white: #FFFFFF;
}

body.light-theme {
  --absolute-white: #FFFFFF;
  --bg-primary: #F2F2F7;
  --bg-secondary: #FFFFFF;
  --card-bg: #FFFFFF;
  --card-gradient: #FFFFFF;
  --text-primary: #000000;
  --text-secondary: rgba(60, 60, 67, 0.6);
  --text-tertiary: rgba(60, 60, 67, 0.3);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.08);
  --separator-color: rgba(60, 60, 67, 0.12);
  --shadow-color: rgba(0, 0, 0, 0.05);
  --shadow-glow: rgba(0, 0, 0, 0.08);
  --text-white: #000000;
  
  /* Legacy Mappings Fix */
  --bg-dark: var(--bg-primary);
  --bg-darker: var(--bg-secondary);
  --text-main: var(--text-primary);
  --text-dim: var(--text-secondary);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  background-color: var(--bg-primary);
  margin: 0 !important;
  padding: 0 !important;
  font-family: 'Inter', sans-serif;
}

input,
textarea,
button,
select {
  font-family: inherit;
  -webkit-user-select: text;
  user-select: text;
}

body {
  background-color: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text-main);
}

/* ================= WEB RESPONSIVE LAYOUT ================= */
.mobile-frame {
  width: 100%;
  max-width: 600px; /* Limits width on large monitors for readability */
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-dark);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  margin: 0 auto;
}

#screens-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.screen {
  background-color: var(--bg-primary);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  padding-bottom: 20px;
  /* Remove padding-top for sticky header to touch the real top */
  padding-top: 0 !important;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  z-index: 10;
}

/* ================= HOME/DETAIL SCREEN ================= */
#screen-home,
#screen-detail {
  padding: 0 20px 20px;
  gap: 20px;
}

/* Reset de margens para garantir que o gap de 20px seja uniforme para todos os cards */
#screen-detail > div, 
#screen-detail > button, 
#screen-detail > .motives-section, 
#screen-detail > .economy-section,
#screen-detail > .motivo-banner {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.header h1 {
  font-size: 35px;
  font-weight: 800;
}
.header p {
  color: var(--text-dim);
  font-size: 21px;
  margin-top: 5px;
}

/* ================= PROFILE SECTION ================= */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0 10px;
  gap: 12px;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  background-color: #2c2c2e;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8e8e93;
  border: none;
}
.profile-avatar i {
  width: 40px;
  height: 40px;
}
.profile-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

/* ================= DETAIL SCREEN NEW STYLES ================= */
.goal-container {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  margin-top: 0;
}
.goal-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 700;
}
.goal-header span:first-child {
  color: var(--text-primary);
}
.goal-header span:last-child {
  color: var(--primary);
}

.progress-bar-bg {
  height: 12px;
  background: var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: 6px;
  transition: width 0.5s ease;
}
.goal-stats {
  text-align: left;
  font-size: 16px;
  color: var(--text-primary);
}
#progress-percent strong {
  font-size: 20px;
  font-weight: 800;
  margin-right: 2px;
}

.calendar-container {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  margin-top: 0;
}
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.calendar-header h3 {
  font-size: 18px;
  font-weight: 700;
}
.calendar-header button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 800;
  margin-bottom: 10px;
}
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  overflow: hidden;
}
.calendar-day {
  position: relative;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px; /* For hover state */
  transition: background-color 0.2s;
}
.calendar-day:hover {
  background: var(--border-light);
}
.calendar-day.empty {
  cursor: default;
}

.calendar-day span {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 14px; /* Círculo perfeito */
}

/* Base states */
.calendar-day.selected span,
.calendar-day.streak-day span {
  background-color: var(--primary);
  color: white;
  font-weight: bold;
}
.calendar-day.today span {
  border: 1px solid var(--primary);
  color: var(--primary);
}
.calendar-day.streak-day.today span {
  border: none;
  background-color: var(--primary);
  color: white;
}

/* Connecting Line (Corrente de dias) */
.calendar-day.streak-day::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -2.5px; /* Conecta com a célula anterior pelo gap de 5px */
  width: calc(100% + 5px); /* Cobre toda a célula e o próximo gap */
  height: 4px;
  background-color: rgba(10, 132, 255, 0.3); /* Azul com opacidade */
  transform: translateY(-50%);
  z-index: 1;
}

/* Primeiro dia da sequência */
.calendar-day.streak-start::before {
  left: 50%;
  width: calc(50% + 2.5px);
}

/* Último dia da sequência (Hoje) */
.calendar-day.streak-end::before {
  left: -2.5px;
  width: calc(50% + 2.5px);
}

/* Se a sequência for de apenas 1 dia */
.calendar-day.streak-start.streak-end::before {
  display: none;
}
.calendar-description {
  font-size: 15px;
  color: #8e8e93;
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
  font-style: normal;
}

.time-stats-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 0;
}
.time-stat .label {
  display: block;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 5px;
}
.time-stat .value {
  font-size: 20px;
  font-weight: 700;
}
.time-stat .value.big {
  font-size: 26px;
  color: var(--primary);
}

/* ================= ECONOMY SELECTOR (Segmented Control) ================= */
.economy-section {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.segmented-control {
  background-color: var(--border-color);
  border-radius: 12px;
  padding: 3px;
  display: flex;
  position: relative;
  user-select: none;
}

.segment-item {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 1;
  transition: color 0.3s ease;
}

.segment-item.active {
  color: var(--bg-primary);
}

.segment-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background-color: var(--text-primary);
  border-radius: 10px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.economy-results {
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-item {
  display: none; /* Hidden by default */
  justify-content: space-between;
  align-items: center;
  background: var(--border-light);
  padding: 15px;
  border-radius: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.result-item:hover {
  background-color: var(--border-light);
}

.result-item:focus, .result-item:active {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.result-item.active {
  display: flex;
}

.res-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-item .res-label {
  font-size: 14px;
  color: var(--text-dim);
}

.result-item .res-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
}

.edit-icon {
  color: var(--text-dim);
  width: 18px !important;
  height: 18px !important;
  opacity: 0.5;
}

.result-item:hover .edit-icon {
  color: var(--primary);
  opacity: 1;
}

.goals-btn {
  min-height: 44px;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
  width: 100%;
  box-sizing: border-box;
  background: var(--border-light);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.goals-btn:active {
  transform: scale(0.96);
  opacity: 0.85;
}

.goals-btn i {
  color: var(--primary);
}

.streak-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
}
.streak-card h3 {
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.streak-card .number {
  font-size: 87px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.streak-card .days {
  font-size: 30px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 15px;
}
.streak-card .details {
  color: var(--text-dim);
  font-size: 19px;
}

.stats-row {
  display: flex;
  gap: 15px;
}
.stat-box {
  flex: 1;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 15px;
}
.stat-box .label {
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 5px;
}
.stat-box .value {
  font-size: 21px;
  font-weight: 600;
}

.ai-message {
  background-color: rgba(179, 157, 219, 0.1);
  border-left: 3px solid var(--accent);
  padding: 20px;
  border-radius: 15px;
}
.ai-message .label {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.ai-message p {
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: #e0e0e0;
}

/* ================= VICIOS & ADD & DETAIL SCREENS ================= */
#screen-vicios,
#screen-add {
  padding: 40px 20px 20px;
  gap: 20px;
}

.vicios-list {
  display: flex;
  flex-direction: column;
  padding-top: 10px;
  padding-bottom: 0;
}

.vicios-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px 20px;
}
.empty-subtitle {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.4;
  max-width: 250px;
}

/* ================= SEÇÃO ADICIONAR VÍCIO ================= */
#screen-vicios.is-empty {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#screen-vicios.is-empty .vicios-list {
  display: none;
}

#screen-vicios.is-empty .add-addiction-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 100px; /* Offset para o header/nome */
}

#screen-vicios.is-empty .add-addiction-container .vicio-card-new {
  width: 100%;
  margin-top: 0;
}

.add-vicio-card {
  width: 100%;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 18px 16px;
  gap: 14px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  box-shadow: none;
  outline: none;
  user-select: none;
}

.add-vicio-card:hover {
  border-color: var(--primary);
  background-color: rgba(10, 132, 255, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.add-vicio-card:active {
  transform: scale(0.96);
  opacity: 0.85;
}

.add-vicio-icon {
  background-color: var(--border-light) !important;
  color: var(--text-dim) !important;
  flex-shrink: 0;
}

.add-vicio-label {
  font-size: 19px;
  font-weight: 400;
  color: var(--text-main);
  opacity: 0.85;
  line-height: 1.3;
}

/* ================= NOVO CARD DE VÍCIO (ESTILO APPLE) ================= */
.vicio-card-new {
  background-color: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s;
  position: relative;
  margin-bottom: 12px;
}

.vicio-card-new:active {
  transform: scale(0.97);
  background-color: #2C2C2E;
}

/* Indicador de Nível (Diamante) */
.level-indicator-new {
  padding: 16px 16px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
  margin-bottom: -4px; /* Aumentado o espaço para os demais elementos */
}

.diamond-icon-wrapper {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.level-name-text {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary); /* Texto Neutro */
}

.diamond-icon-wrapper svg {
  width: 100%;
  height: 100%;
}

/* Cores APENAS dos Diamantes */
.level-diamond-none .diamond-icon-wrapper { color: #8E8E93; }
.level-diamond-bronze .diamond-icon-wrapper { color: #D9A06C; }
.level-diamond-silver .diamond-icon-wrapper { color: #757575; }
.level-diamond-gold .diamond-icon-wrapper { color: #FFD60A; }
.level-diamond-legendary .diamond-icon-wrapper { color: #6D28D9; }
.level-diamond-diamond .diamond-icon-wrapper { color: #0EA5E9; }

/* Cores do texto de nível (mesma paleta do ícone) */
.level-diamond-none .level-name-text      { color: #8E8E93; }
.level-diamond-bronze .level-name-text    { color: #D9A06C; }
.level-diamond-silver .level-name-text    { color: #757575; }
.level-diamond-gold .level-name-text      { color: #FFD60A; }
.level-diamond-legendary .level-name-text { color: #6D28D9; }
.level-diamond-diamond .level-name-text   { color: #0EA5E9; }

/* Corpo do Card */
.vicio-card-body {
  display: flex;
  align-items: center;
  padding: 24px 44px 20px 16px;
  gap: 16px;
}

/* Ícone do vício (Círculo sutil) */
.vicio-icon-circle-new {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #2C2C2E;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vicio-icon-circle-new i, .vicio-icon-circle-new svg {
  width: 22px;
  height: 22px;
}

/* Cores dos ícones baseadas no nível (Leve destaque) */
.icon-level-none { color: #8E8E93; }
.icon-level-bronze { color: #D9A06C; }
.icon-level-silver { color: #757575; }
.icon-level-gold { color: #FFD60A; }
.icon-level-legendary { color: #6D28D9; }
.icon-level-diamond { color: #0EA5E9; }

/* Informações do Vício */
.vicio-info-new {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vicio-info-new h3 {
  font-weight: 600;
  font-size: 21px;
  color: var(--text-primary);
  margin: 0;
}

.days-clean-text-new {
  font-size: 19px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.record-subtext-new {
  font-size: 16px;
  color: var(--text-tertiary);
  margin: 0;
}

.card-economy-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0;
}

.econ-row {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.econ-label {
  color: var(--text-tertiary);
}

.econ-val {
  color: var(--text-primary);
  font-weight: 500;
}

.chevron-new {
  color: var(--text-tertiary);
  width: 18px;
  height: 18px;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

/* Corpo do Card */
.vicio-card-body {
  display: flex;
  align-items: center;
  padding: 18px 44px 18px 16px; /* Aumentado o padding da direita para a flecha */
  gap: 14px;
}

/* Ícone do vício */
.vicio-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vicio-icon-circle i {
  width: 24px;
  height: 24px;
}

/* Cor do ícone por nível atual */
.level-icon-none {
  background-color: rgba(142, 142, 147, 0.15);
  color: #8E8E93;
}
.level-icon-bronze {
  background-color: rgba(217, 160, 108, 0.15);
  color: #D9A06C;
}
.level-icon-silver {
  background-color: rgba(117, 117, 117, 0.15);
  color: #757575;
}
.level-icon-gold {
  background-color: rgba(255, 214, 10, 0.15);
  color: #ffd60a;
}
.level-icon-legendary {
  background-color: rgba(109, 40, 217, 0.15);
  color: #6D28D9;
}
.level-icon-diamond {
  background-color: rgba(14, 165, 233, 0.15);
  color: #0EA5E9;
}

/* Light theme overrides */
.light-theme .level-icon-none {
  background-color: rgba(142, 142, 147, 0.12);
  color: #8E8E93;
}
.light-theme .level-icon-bronze {
  background-color: rgba(217, 160, 108, 0.12);
  color: #D9A06C;
}
.light-theme .level-icon-silver {
  background-color: rgba(117, 117, 117, 0.12);
  color: #757575;
}
.light-theme .level-icon-gold {
  background-color: rgba(255, 214, 10, 0.12);
  color: #FFD60A;
}
.light-theme .level-icon-legendary {
  background-color: rgba(109, 40, 217, 0.12);
  color: #6D28D9;
}
.light-theme .level-icon-diamond {
  background-color: rgba(14, 165, 233, 0.12);
  color: #0EA5E9;
}

/* Informações do card */
.vicio-info {
  flex: 1;
  min-width: 0;
}
.vicio-info h3 {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}
.days-clean-text {
  font-size: 18px;
  color: var(--text-dim);
  font-weight: 400;
  margin-bottom: 0;
}
.days-clean-text strong {
  color: var(--text-main);
  font-weight: 700;
  font-size: 20px;
}

/* Economia dentro do card */
.card-economy-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
}
.econ-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 16px;
  line-height: 1.4;
}
.econ-label {
  color: var(--text-dim);
  font-weight: 400;
  opacity: 0.8;
}
.econ-val {
  color: var(--text-main);
  font-weight: 600;
}

/* Chevron */
.chevron {
  color: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

/* ================= RELAPSE SYSTEM STYLES ================= */

/* Dia de recaída no calendário */
.calendar-day.relapse-day span {
  background-color: #ff453a;
  color: white;
  font-weight: bold;
}
.calendar-day.relapse-day::before {
  display: none;
}

/* Card de stats de recaída (tela de detalhe) */
.relapse-stats-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 18px 20px;
  margin-top: 0;
}
.rstat-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.rstat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.rstat-divider {
  width: 1px;
  height: 36px;
  background-color: var(--border-color);
}
.rstat-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.rstat-val {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
}

/* Sub-label de economia (desde última recaída) */
.res-sublabel {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 3px;
}

/* Badge de recaídas/recorde no card da lista */
.card-relapse-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.record-level-badge {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
}
.record-level-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: -2px;
  margin-left: 2px;
  margin-right: 2px;
}
.record-level-icon svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.2px;
}
.card-relapse-count {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 400;
}

/* Cores do texto por nível (record-level-badge) */
.level-text-diamond {
  color: #0EA5E9;
}
.level-text-legendary {
  color: #A855F7;
}
.level-text-gold {
  color: #FFD60A;
}
.level-text-silver {
  color: #757575;
}
.level-text-bronze {
  color: #D9A06C;
}
.level-text-none {
  color: #8E8E93;
}

/* Botões do modal de ação do calendário */
.cal-action-lightbox {
  text-align: center;
}
.cal-modal-date {
  color: var(--text-dim);
  font-size: 17px;
  margin: 4px 0 0;
}
.cal-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 22px 0 18px;
}
.cal-btn-start,
.cal-btn-relapse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  font-size: 19px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  transition:
    opacity 0.2s,
    transform 0.15s;
}
.cal-btn-start:active,
.cal-btn-relapse:active {
  transform: scale(0.97);
}
.cal-btn-start {
  background-color: rgba(10, 132, 255, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}
.cal-btn-start i {
  width: 20px;
  height: 20px;
}
.cal-btn-relapse {
  background-color: rgba(255, 69, 58, 0.1);
  border-color: #ff453a;
  color: #ff453a;
}
.cal-btn-relapse i {
  width: 20px;
  height: 20px;
}

/* Modal motivacional (iOS Style) */
.motivation-stats {
  background: var(--border-light);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 85%;
  margin: 20px 0;
}
.motivation-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.motivation-stat-label {
  font-size: 17px;
  color: var(--text-secondary);
}
.motivation-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.motivation-divider {
  height: 0.5px;
  background-color: var(--border-light);
  width: 100%;
}

#screen-add {
  background-color: var(--bg-primary);
}

#screen-add .header h2 {
  font-size: 26px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  text-align: left;
  padding: 0 16px;
  margin-top: 20px;
}

.ios-search-container {
  padding: 10px 16px;
  background: var(--bg-primary);
  position: sticky;
  top: 60px; /* Abaixo do header */
  z-index: 10;
}

.ios-search-bar {
  display: flex;
  align-items: center;
  background-color: var(--card-bg);
  border-radius: 10px;
  padding: 8px 12px;
  height: 38px;
  transition: all 0.3s;
}

.ios-search-bar .search-icon {
  color: var(--text-tertiary);
  width: 18px;
  height: 18px;
  margin-right: 8px;
}

.ios-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 19px;
  outline: none;
}

.ios-search-bar input::placeholder {
  color: var(--text-tertiary);
}

.clear-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: all 0.2s;
}

.clear-btn.visible {
  visibility: visible;
  opacity: 1;
}

.clear-btn i {
  width: 18px;
  height: 18px;
}

.catalog-list {
  display: flex;
  flex-direction: column;
  padding: 10px 16px 120px;
}

.catalog-item {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--border-light);
  cursor: pointer;
  transition: opacity 0.2s;
}



.catalog-item:active {
  opacity: 0.6;
}

.catalog-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  color: #0A84FF;
  background: none !important; /* REMOVER FUNDO */
  border-radius: 0 !important;
}

.catalog-icon i, .catalog-icon svg {
  width: 28px;
  height: 28px;
}

.catalog-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.catalog-info h3 {
  font-weight: 600;
  font-size: 19px;
  color: var(--text-primary);
  margin: 0;
}

.catalog-info p {
  font-size: 15px;
  color: var(--text-tertiary);
  margin: 0;
}

.catalog-item .crisis-chevron {
  color: #0A84FF;
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 20px 0;
}
.back-btn {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 10px 0;
  display: flex;
  align-items: center;
}
#detail-title {
  font-size: 26px;
  font-weight: bold;
}

/* ================= CHAT SCREEN ================= */
#screen-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: 0;
  background-color: var(--bg-primary);
}
#screen-chat .fullscreen-header h2 {
  font-size: 26px;
  font-weight: bold;
}
.chat-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  text-align: center;
}
.chat-area {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.message-bubble {
  max-width: 80%;
  padding: 15px;
  border-radius: 20px;
  font-size: 20px;
  line-height: 1.4;
  margin: 0 16px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}
.user-bubble {
  background-color: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}
.ai-bubble {
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.chat-input-container {
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-input-container input {
  flex: 1;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 10px 16px;
  border-radius: 20px;
  outline: none;
  font-size: 19px;
}
.chat-input-container input::placeholder {
  color: #8E8E93;
}
.send-btn {
  background-color: #0A84FF;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
}
.send-btn i {
  width: 20px;
  height: 20px;
  color: var(--text-primary);
}
.send-btn:active {
  opacity: 0.7;
}

/* ================= CRISIS MODAL ================= */
.modal {
  position: absolute;
  top: 100%; /* Hidden by default */
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-darker);
  z-index: 100;
  transition: top 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
}
.modal.open {
  top: 0;
}

.modal-header {
  display: flex;
  justify-content: flex-end;
  padding: 20px;
}
.close-btn {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.close-btn:active {
  opacity: 0.6;
}

.close-btn i {
  width: 24px;
  height: 24px;
}

/* ================= DELETE LIGHTBOX STYLES ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200000;
  backdrop-filter: blur(5px);
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.delete-lightbox {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 25px;
  padding: 30px;
  width: 100%;
  max-width: 350px;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.delete-lightbox h3 {
  font-size: 26px;
  margin-bottom: 12px;
}
.delete-lightbox p {
  font-size: 19px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 25px;
}

.delete-actions {
  display: flex;
  gap: 15px;
}
.delete-actions button {
  flex: 1;
  min-height: 44px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.delete-actions button:active {
  transform: scale(0.96);
  opacity: 0.85;
}

.confirm-no {
  background: var(--border-light);
  color: var(--text-primary);
  border: 1px solid var(--border-light) !important;
}
.confirm-yes {
  background-color: var(--danger);
  color: white;
}
.confirm-blue {
  background-color: #0A84FF;
  color: white;
}

/* --- iOS Wheel Picker Modal --- */
.ios-picker-modal {
  background: var(--card-gradient);
  border: 0.5px solid var(--border-light);
  border-radius: 22px;
  width: 90%;
  max-width: 320px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  margin: 10px auto;
}

.modal-title {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
  padding: 0 20px;
  line-height: 1.3;
}

.modal-subtitle, .ios-text-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 6px;
  padding: 0 20px;
  line-height: 1.3;
}

.picker-container-ios, .wheel-picker-container {
  position: relative;
  width: 100%;
  height: 180px;
  margin: 10px 0 20px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 0 16px; /* Garante espaço interno para a faixa */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
}

.picker-highlight {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 16px;
  right: 16px;
  height: 40px;
  border-radius: 12px;
  background: var(--border-light);
  border-top: 0.5px solid var(--border-light);
  border-bottom: 0.5px solid var(--border-light);
  pointer-events: none;
  z-index: 1;
}

.wheel-picker, .picker, .time-column {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden; /* Trava eixo X */
  touch-action: pan-y; /* Permite apenas movimento vertical */
  -webkit-overflow-scrolling: touch; /* Inércia iOS */
  scroll-snap-type: y mandatory;
  padding: 70px 0; /* Padding para centralizar itens */
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-picker::-webkit-scrollbar, .picker::-webkit-scrollbar, .time-column::-webkit-scrollbar {
  display: none;
}

.picker-item, .time-item {
  width: 100%; /* Ocupa largura total para travar centro */
  height: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-tertiary);
  scroll-snap-align: center;
  transition: all 0.2s;
  cursor: pointer;
  text-align: center;
  user-select: none;
}

.picker-item.active, .time-item.active {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 600;
  transform: scale(1.05);
}

.wheel-picker-container {
  position: relative;
  width: 100%;
  height: 180px;
  margin: 5px 0 20px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.wheel-picker-container::before,
.wheel-picker-container::after {
  content: none; /* Removido para não quebrar o gradiente do modal */
}

.picker {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  padding: 70px 0; /* Padding for centering top/bottom items */
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.4) 15%,
    rgba(0,0,0,1) 40%,
    rgba(0,0,0,1) 60%,
    rgba(0,0,0,0.4) 85%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.4) 15%,
    rgba(0,0,0,1) 40%,
    rgba(0,0,0,1) 60%,
    rgba(0,0,0,0.4) 85%,
    transparent 100%
  );
}

.picker::-webkit-scrollbar {
  display: none;
}

.picker-item {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-primary);
  opacity: 0.3;
  scroll-snap-align: center;
  transition: all 0.2s ease;
}

.picker-item.active {
  opacity: 1;
  font-size: 26px;
  font-weight: 600;
  transform: scale(1.05);
}

.picker-highlight {
  position: absolute;
  top: 50%;
  left: 20px;
  right: 20px;
  transform: translateY(-50%);
  height: 40px;
  background: var(--border-light);
  border-radius: 10px;
  pointer-events: none;
}

.modal-footer-hint {
  font-size: 15px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.modal-actions-ios {
  display: flex;
  width: 100%;
  border-top: 0.5px solid var(--border-light);
  height: 50px;
}

.ios-action-divider {
  width: 0.5px;
  background: var(--border-light);
}

.ios-cancel-btn, .ios-confirm-btn {
  flex: 1;
  background: none;
  border: none;
  font-size: 19px;
  cursor: pointer;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-cancel-btn {
  color: #FF3B30;
  font-weight: 400;
}

.ios-confirm-btn {
  color: #0A84FF;
  font-weight: 600;
}

.ios-cancel-btn:active, .ios-confirm-btn:active {
  background: var(--border-light);
}

/* --- iOS Settings Screen --- */
.settings-screen-body {
  padding-bottom: 100px;
}

.settings-section-title {
  color: var(--text-tertiary);
  font-size: 15px;
  margin: 24px 16px 8px 32px;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.settings-group {
  background: var(--card-bg);
  border-radius: 12px;
  margin: 0 16px;
  overflow: hidden;
}

.settings-item-ios {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 19px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s ease;
  position: relative;
}

.settings-item-ios:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 48px;
  left: 48px; /* Space for icon */
  height: 0.5px;
  background: var(--border-light);
}

.no-separator::after { display: none !important; }

.settings-item-ios:active {
  background: var(--border-light);
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-icon {
  width: 20px;
  height: 20px;
  color: var(--text-primary);
  opacity: 0.8;
}

.chevron {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
}

/* --- iOS Text Modals (Novo Desafio / Renomear Vício) --- */
.ios-text-modal {
  background: var(--card-gradient);
  border: 0.5px solid var(--border-light);
  border-radius: 22px;
  width: 90%;
  max-width: 320px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.ios-text-input {
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 14px !important;
  text-align: center;
  font-size: 20px;
  color: var(--text-primary);
  padding: 14px;
  margin: 18px 0 24px;
  width: 85%;
  outline: none;
}

.ios-text-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.ios-text-subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 6px;
  padding: 0 20px;
}

.ios-text-label {
  align-self: flex-start;
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 14px;
  margin-left: 25px;
}

/* --- iOS Theme Modal (Padronizado) --- */
.ios-theme-modal {
  background: var(--card-gradient);
  border: 0.5px solid var(--border-light);
  border-radius: 22px;
  width: 90%;
  max-width: 320px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.theme-subtitle-ios {
  text-align: center;
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 8px;
  padding: 0 20px;
  margin-bottom: 20px;
}

.theme-options-ios {
  display: flex;
  gap: 12px;
  width: 90%;
  margin-bottom: 30px;
}

.theme-card-ios {
  flex: 1;
  background: var(--border-light);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.theme-card-ios i {
  width: 24px;
  height: 24px;
  opacity: 0.8;
}

.theme-card-ios span {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
}

.theme-card-ios.active {
  background: rgba(10, 132, 255, 0.1);
  border-color: #0A84FF;
}

.theme-card-ios:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.ios-full-btn {
  width: 100%;
  background: none;
  border: none;
  padding: 16px 0;
  font-size: 19px;
  font-weight: 600;
  color: #0A84FF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.ios-full-btn:active {
  background: var(--border-light);
}

/* --- iOS Profile Modal (REPLICAÇÃO ABSOLUTA) --- */
.ios-profile-modal {
  background: var(--card-gradient);
  border: 0.5px solid var(--border-light);
  border-radius: 30px;
  width: 90%;
  max-width: 340px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border-light);
  border-radius: 10px;
  margin: 12px auto 8px;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  margin: 10px 0 20px;
}

.profile-avatar-container {
  position: relative;
  margin: 10px auto;
  cursor: pointer;
  width: 120px;
  height: 120px;
}

.profile-avatar-ios {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #0A84FF; /* Borda azul conforme referência */
}

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

.profile-avatar-ios i {
  width: 60px;
  height: 60px;
  color: var(--text-primary);
}

.camera-badge-ios {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 34px;
  height: 34px;
  background: #0A84FF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 2px solid var(--card-bg); /* Borda de separação */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.camera-badge-ios i {
  width: 18px;
  height: 18px;
}

.profile-subtitle-ios {
  text-align: center;
  font-size: 17px;
  color: var(--text-secondary);
  margin-top: 25px;
}

.ios-name-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-light);
  border-radius: 25px;
  text-align: center;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 10px 0 40px;
  padding: 12px 20px;
  width: 90%;
  outline: none;
}

.modal-actions-ios {
  display: flex;
  width: 100%;
  border-top: 1px solid var(--border-light);
  background: transparent;
}

.ios-cancel-btn, .ios-save-btn, .ios-confirm-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 18px 0;
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-cancel-btn {
  color: #0A84FF;
  border-right: 1px solid var(--border-light);
}

.ios-save-btn, .ios-confirm-btn {
  color: #0A84FF;
  font-weight: 600;
}

.ios-cancel-btn:active, .ios-save-btn:active, .ios-confirm-btn:active, .ios-delete-btn:active {
  background: var(--border-light);
}

.ios-delete-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 18px 0;
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FF453A; /* Vermelho iOS */
  font-weight: 600;
}

.custom-input {
  width: 100%;
  padding: 15px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 21px;
  outline: none;
  text-align: center;
  margin-top: 10px;
}
.custom-input:focus {
  border-color: var(--primary);
}

/* ================= GOAL MODAL STYLES ================= */
.timer-selector {
  display: flex;
  justify-content: center;
  gap: 15px;
  width: 100%;
}
.selector-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.selector-unit input {
  width: 80px;
  height: 80px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  color: var(--text-main);
  font-size: 39px;
  font-weight: 800;
  text-align: center;
  outline: none;
  -moz-appearance: textfield; /* Remove arrows in Firefox */
}
.selector-unit input::-webkit-outer-spin-button,
.selector-unit input::-webkit-inner-spin-button {
  -webkit-appearance: none; /* Remove arrows in Chrome/Safari */
  margin: 0;
}
.selector-unit span {
  font-size: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.crisis-icon-container {
  width: 100px;
  height: 100px;
  border-radius: 50px;
  background-color: rgba(255, 76, 76, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}
.crisis-title {
  font-size: 51px;
  font-weight: bold;
  margin-bottom: 10px;
}
.crisis-subtitle {
  font-size: 24px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 40px;
}

.options-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.option-btn {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  color: white;
  padding: 18px;
  border-radius: 15px;
  font-size: 21px;
  font-weight: 500;
  cursor: pointer;
}
.option-btn:active {
  background-color: var(--border-color);
}

/* ================= TAB BAR (ESTILO APPLE) ================= */
.tab-bar {
  height: 85px;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
  z-index: 50;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-bar.has-cta {
  height: 220px;
  align-items: flex-end;
  padding-bottom: 20px;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}

.tab-item.active {
  color: #0A84FF;
}

.tab-item:active {
  transform: scale(0.96);
}

.tab-item i, .tab-item svg {
  width: 24px;
  height: 24px;
}

.tab-item span {
  font-size: 12px;
  font-weight: 500;
}

.tab-ai {
  transform: translateY(-20px);
  flex: 0 0 auto;
  margin: 0 20px;
  transition: transform 0.2s ease, bottom 0.2s ease, opacity 0.2s ease;
  position: relative;
  bottom: 0;
}

.tab-bar.chat-open .tab-ai {
  transform: translateY(0) scale(0.85);
  bottom: 5px; /* Alinhado levemente com a nav */
}

.tab-bar.has-cta .tab-ai {
  transform: translateY(-5px);
}

.ai-btn-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #0A84FF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(10, 132, 255, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  overflow: visible;
}
.ai-btn-inner:active {
  transform: scale(0.96);
  opacity: 0.85;
}
.ai-icon-svg, .ai-icon-img {
  width: 62%;
  height: 62%;
  object-fit: contain;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.2));
}
.tab-item.active .ai-btn-inner {
  transform: scale(1.05);
}

.tab-bar.chat-open .tab-item.active .ai-btn-inner {
    transform: scale(1); /* No chat aberto, mantemos escala normal mesmo se ativo */
}

.ai-btn-inner:active {
  transform: scale(0.92);
}

.chat-input-container {
  padding: 16px 20px;
  background: var(--card-bg);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 10;
}
.tab-ai.active {
  color: transparent;
}

/* Pulse Animation */
@keyframes pulse-sos {
  0% {
    transform: scale(1);
    box-shadow: 0 6px 20px rgba(10, 132, 255, 0.25);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 6px 35px rgba(10, 132, 255, 0.45);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 6px 20px rgba(10, 132, 255, 0.25);
  }
}

.tab-ai:not(.active) .ai-btn-inner {
  animation: pulse-sos 4s infinite ease-in-out;
}

/* CTA Wrapper & Container (Dentro da Tab-Bar expandida) */
.cta-wrapper {
  position: absolute;
  top: 30px; /* Bem mais para cima */
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.cta-wrapper.visible {
  opacity: 1;
}

.cta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.cta-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.cta-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin: 0;
}

.crisis-hint {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  margin-top: 5px;
}

.crisis-hint i, .crisis-hint svg {
  width: 24px;
  height: 24px;
}

/* ================= CRISIS SELECTION FLOW ================= */
.crisis-selection-container {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: slideUpFade 0.4s ease;
  max-width: 500px;
  margin: 0 auto;
}

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

.crisis-title-large {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 8px 0 28px 0;
  line-height: 1.1;
  letter-spacing: -0.8px;
  text-align: left;
}

.crisis-section {
  margin-bottom: 32px;
}

.crisis-section-header {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin: 0 0 12px 4px;
  text-transform: none;
  letter-spacing: -0.2px;
}

.crisis-glass-group {
  background: rgba(28, 28, 30, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.crisis-glass-group .crisis-option-btn {
  background: transparent;
  border: none;
  border-radius: 16px;
}

.crisis-glass-group .crisis-option-btn:active {
  background: var(--border-light);
}

.crisis-selection-container {
  padding: 0 16px 120px;
  animation: iosFadeIn 0.4s ease;
  width: 100%;
}

.crisis-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crisis-option-btn, .contact-item {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 16px;
    height: 64px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease;
    width: 100%;
    box-sizing: border-box;
}

.crisis-btn-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.crisis-divider {
    height: 0.5px;
    background: var(--border-light);
    margin: 0 16px;
}

.crisis-option-btn:active, .contact-item:active {
    transform: scale(0.96);
    opacity: 0.85;
}

.crisis-option-btn span, .contact-item span {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.crisis-icon-box {
    width: 42px;
    height: 42px;
    background: var(--border-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.crisis-glass-group .crisis-icon-box {
    background: rgba(10, 132, 255, 0.12);
}

.crisis-option-btn i, .crisis-option-btn svg, .contact-item i, .contact-item svg {
    width: 22px !important;
    height: 22px !important;
    color: #0A84FF;
    flex-shrink: 0;
}

.crisis-chevron {
    color: #0A84FF;
    width: 20px !important;
    height: 20px !important;
}

.crisis-option-btn.emotional {
    margin-top: 0;
}

.crisis-option-btn.call-help {
    /* Mantenha o padrão */
}

.crisis-option-btn.call-help i, .crisis-option-btn.call-help svg {
    color: #0A84FF;
}

.crisis-option-btn .btn-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.crisis-option-btn .btn-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 400;
    margin-top: -1px;
}

/* ================= FULLSCREEN MODAL (GOALS) ================= */
.fullscreen-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  z-index: 150;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.fullscreen-modal.open {
  transform: translateX(0);
}

.fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px 12px;
  padding-top: calc(16px + env(safe-area-inset-top)); /* Safe area support */
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 9999;
  margin: 0 !important;
}
.fullscreen-header h2 {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  flex: 1;
}

.back-btn-ios {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #2C2C2E;
  border-radius: 50%;
  border: none;
  color: var(--text-primary) !important;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.back-btn-ios:active {
  background: #3A3A3C;
  transform: scale(0.92);
  opacity: 0.8;
}

.back-btn-ios svg {
  width: 20px;
  height: 20px;
  margin: 0;
  display: block;
  transform: translateX(-1px); /* Ajuste visual para compensar o peso da seta */
}

.back-btn-ios span {
  display: none;
}

.fullscreen-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fullscreen-body.is-empty {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-bottom: 100px; /* Compensation for header */
}

.fullscreen-body.is-empty #goals-list-container {
  flex-grow: 0;
  margin-bottom: 20px;
}

.goals-empty-msg {
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1.4;
}

/* ================= GOALS ADD SECTION (LIST STYLE) ================= */
.goals-add-section {
  padding: 0;
  margin-top: 4px;
  margin-bottom: 20px;
}
.add-goal-item-ios {
  width: 100%;
  background: transparent;
  border: none;
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: opacity 0.2s;
}
.add-goal-left {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(10, 132, 255, 0.9);
  font-size: 19px;
  font-weight: 400;
}
.add-goal-left i {
  width: 22px;
  height: 22px;
}
.add-goal-chevron {
  color: var(--text-tertiary);
  width: 18px;
  height: 18px;
}
.add-goal-item-ios:active {
  opacity: 0.6;
}

/* ================= GOALS LIST ================= */
.goals-section-label {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 10px 0 6px;
  letter-spacing: -0.2px;
}
.secao-proximos-objetivos {
  margin-top: 16px;
}
.goals-empty-msg {
  font-size: 19px;
  color: var(--text-dim);
  text-align: center;
  padding: 30px 0;
  line-height: 1.6;
}

.card-objetivo {
  background-color: var(--card-bg);
  border: none;
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  margin-bottom: 12px;
  overflow: hidden;
}
.card-objetivo:last-child {
  margin-bottom: 0;
}
.card-objetivo:active {
  transform: scale(0.98);
}

.current-goal-card-ios {
  /* No special gradient as per request, just standard background */
}

.card-objetivo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px; /* Title -> Progress bar: +6px respiro (20->26) */
}
.card-objetivo-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
}
.goal-current-badge-ios {
  background-color: #0A84FF;
  color: var(--text-primary);
  font-size: 13px; /* Aumentado de 11px para 13px */
  font-weight: 600; /* Aumentado de 500 para 600 */
  padding: 4px 10px; /* Aumentado para acomodar o texto maior */
  border-radius: 10px; /* Ajustado proporcionalmente */
  letter-spacing: -0.2px;
}


.goal-progress-bar-bg-ios {
  height: 4px;
  background-color: #2C2C2E;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 24px; /* Progress bar -> Text: +6px respiro (18->24) */
}
.goal-progress-bar-fill-ios {
  height: 100%;
  background-color: rgba(10, 132, 255, 0.9);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-objetivo-stats-ios {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 32px; /* +8px respiro to divider (24->32) */
}
.prog-row-1 {
  font-size: 17px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
}
.prog-row-2 {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
}

.card-divider {
  height: 1px;
  background: var(--border-light);
  margin-bottom: 16px; /* Divider -> Values: +8px respiro (8->16) */
}

.goal-card-economy-ios {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.goal-econ-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.goal-econ-label {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
}
.goal-econ-value {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 400;
}

/* ================= GOAL DETAIL ================= */
/* ================= APPLE GOAL DETAIL ================= */
.apple-goal-card {
  background-color: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  margin: 16px;
  border: 1px solid var(--border-light);
}

.apple-goal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.apple-goal-label {
  color: var(--text-primary);
  font-size: 19px;
}

.apple-goal-value {
  color: var(--text-primary);
  font-size: 19px;
  font-weight: 500;
}

.apple-progress-bar-container {
  height: 8px;
  background-color: #2C2C2E;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.apple-progress-bar-fill {
  height: 100%;
  background-color: #0A84FF;
  border-radius: 4px;
}

.apple-goal-stats {
  display: flex;
  gap: 8px;
  align-items: center;
}

.apple-goal-percentage {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 17px;
}

.apple-goal-remaining {
  color: var(--text-tertiary);
  font-size: 17px;
}

.apple-card-section-title {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.2px;
  margin: 0 0 24px;
}

.apple-list-item {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--border-light);
}

.apple-list-item:first-of-type {
  border-top: none;
  padding-top: 0;
}

.apple-list-label {
  color: var(--text-secondary);
  font-size: 17px;
}

.apple-list-value {
  color: var(--text-primary);
  font-size: 19px;
  font-weight: 600;
}

.apple-delete-text-btn {
  width: 100%;
  background: none;
  border: none;
  color: #FF453A;
  font-size: 19px;
  padding: 24px;
  cursor: pointer;
  text-align: center;
  font-weight: 400;
}

.card-objetivo-stats {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
}

.card-objetivo-detail {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
}

.goal-card-economy-mini {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-econ-title {
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.goal-econ-values {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goal-econ-item {
  color: #34C759; /* Green Apple Style */
  font-weight: 600;
  font-size: 17px;
}

.goal-econ-separator {
  display: none; /* No longer needed in vertical layout */
}
.goal-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.goal-detail-label {
  font-size: 18px;
  color: var(--text-dim);
}
.goal-detail-value {
  font-size: 21px;
  font-weight: 700;
  color: var(--primary);
}

.goal-detail-economy {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
}
.goal-detail-economy-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.goal-detail-econ-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 19px;
}
.goal-detail-econ-row:last-child {
  border-bottom: none;
}
.goal-detail-econ-row .econ-label {
  color: var(--text-dim);
}
.goal-detail-econ-row .econ-val {
  color: var(--text-main);
  font-weight: 600;
}

.benefits-btn {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 25px;
  transition:
    opacity 0.2s,
    background-color 0.2s;
}
.benefits-btn:active {
  background-color: var(--border-color);
  opacity: 0.8;
}
.benefits-btn i {
  width: 18px;
  height: 18px;
}

.delete-goal-btn {
  background: none;
  border: 1px solid rgba(255, 69, 58, 0.25);
  border-radius: 12px;
  color: rgba(255, 69, 58, 0.85);
  font-size: 18px;
  font-weight: 500;
  padding: 14px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.delete-goal-btn:hover {
  background-color: rgba(255, 69, 58, 0.08);
  color: var(--danger);
}
.delete-goal-btn i,
.delete-goal-btn svg {
  width: 16px;
  height: 16px;
}

/* ================= PREMIUM APPLE INSTALLATION SCREEN ================= */
#install-instructions-screen-modal {
  background-color: var(--bg-primary);
}

#install-instructions-screen-modal .fullscreen-header {
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--border-light);
  padding: 12px 16px;
  height: 54px;
}

#install-instructions-screen-modal .back-btn-ios {
  color: #0A84FF;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.4px;
}

#install-instructions-screen-modal .fullscreen-header h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.apple-install-container {
  padding: 24px 16px 60px;
  max-width: 500px;
  margin: 0 auto;
  animation: iosFadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.apple-install-section {
  margin-bottom: 32px;
}

.apple-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-left: 8px;
}

.apple-section-header i {
  color: #8E8E93;
  width: 22px;
  height: 22px;
}

.apple-section-header h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.apple-glass-card {
  background: var(--border-light);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 20px;
  border: 0.5px solid var(--border-light);
  padding: 24px;
  overflow: hidden;
}

.apple-step-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.apple-step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.apple-step-number {
  width: 22px;
  height: 22px;
  background-color: #0A84FF;
  color: var(--text-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}

.apple-step-text {
  font-size: 19px;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.apple-mockup-container {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 20px;
  width: 100%;
}

.apple-mockup-container::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  pointer-events: none;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.apple-mockup-image {
  width: 100%;
  max-width: 320px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border: 0.5px solid var(--border-light);
  transition: transform 0.3s ease;
}

.apple-mockup-image:hover {
  transform: scale(1.01);
}

.apple-footer-tip {
  font-size: 17px;
  color: #8E8E93;
  text-align: center;
  line-height: 1.5;
  margin-top: 40px;
  padding: 0 20px;
  opacity: 0.8;
}

/* Specific adjustments for icons to look like SF Symbols */
[data-lucide="apple"], [data-lucide="smartphone"] {
  stroke-width: 1.5;
}

/* ================= CLICKABLE UTILITY ================= */
.clickable {
  cursor: pointer;
}
.goal-card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.goal-level-icon {
  width: 24px;
  height: 24px;
}
.goal-level-bronze {
  color: #D9A06C;
}
.goal-level-silver {
  color: #757575;
}
.goal-level-gold {
  color: #FFD60A;
}
.goal-level-legendary {
  color: #6D28D9;
}
.goal-level-diamond {
  color: #0EA5E9;
}
.goal-level-none {
  color: #8E8E93;
}



/* ================= BENEFITS TIMELINE STYLES ================= */
#screen-benefits {
  padding: 40px 20px 20px;
}
.timeline-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition:
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}
.timeline-card {
  background: rgba(28, 28, 30, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tl-period {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tl-period span:first-child {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}

.tl-current-badge {
  background: var(--primary);
  color: var(--text-primary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.tl-section-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-top: 16px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.tl-divider {
  border-top: 1px solid var(--border-light);
  margin: 12px 0;
}

.tl-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 16px;
  line-height: 1.4;
}

.tl-item span {
  color: rgba(255, 255, 255, 0.9);
}

.tl-item i, .tl-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.tl-item.benefit i, .tl-item.benefit svg {
  color: #30D158;
  opacity: 0.9;
}

.tl-item.symptom span {
  color: rgba(255, 255, 255, 0.65);
}

.tl-item.symptom i, .tl-item.symptom svg {
  color: var(--text-tertiary);
}

.tl-item.action i, .tl-item.action svg {
  color: #0A84FF;
}

.benefits-empty-msg {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1.5;
}

.chat-maintenance-alert {
  background-color: rgba(255, 152, 0, 0.1);
  border-bottom: 1px solid rgba(255, 152, 0, 0.2);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ff9800;
  font-size: 18px;
  font-weight: 500;
}
.chat-maintenance-alert i {
  width: 16px;
  height: 16px;
}

/* ================= SETTINGS SCREEN ================= */
.settings-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-group-label {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 16px 0 8px 4px;
  font-weight: 600;
}

.settings-item {
  background: var(--card-bg);
  padding: 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
}

.settings-item:active {
  background: var(--border-light);
  transform: scale(0.98);
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-item-left i,
.settings-item-left svg {
  width: 20px;
  height: 20px;
  color: var(--primary) !important;
  stroke: var(--primary) !important;
}

.settings-item span {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-main);
}

.settings-item-text {
  display: flex;
  flex-direction: column;
}

.settings-item-subtitle {
  font-size: 15px;
  color: var(--text-dim);
  margin-top: 2px;
}

.settings-chevron,
.settings-chevron svg {
  width: 18px;
  height: 18px;
  color: var(--primary) !important;
  stroke: var(--primary) !important;
}

.settings-item.disabled {
  opacity: 0.6;
  cursor: default;
}

.settings-item.disabled:active {
  transform: none;
  background: var(--card-bg);
}

.badge-soon {
  background: var(--border-light);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ================= PROFILE PICTURE STYLES ================= */
.profile-upload-area {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 20px auto 10px;
  cursor: pointer;
}

.profile-modal-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--bg-darker);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.profile-modal-avatar i {
  width: 40px;
  height: 40px;
  color: var(--primary);
}

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

.upload-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--card-bg);
}

.upload-badge i {
  width: 16px;
  height: 16px;
  color: white;
}

/* Home Screen Avatar */
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ================= THEME MODAL STYLES ================= */
.theme-options {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.theme-option-btn {
  flex: 1;
  border-radius: 15px;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

/* Fix colors to represent the theme regardless of current app state */
.theme-option-btn.dark {
  background: var(--card-bg);
  border: 1px solid #3a3a3c;
}
.theme-option-btn.dark i {
  width: 24px;
  height: 24px;
  color: var(--text-primary) !important;
  stroke: var(--text-primary) !important;
}
.theme-option-btn.dark span {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary) !important;
}

.theme-option-btn.light {
  background: var(--text-primary);
  border: 1px solid #e5e5ea;
}
.theme-option-btn.light i {
  width: 24px;
  height: 24px;
  color: #8e8e93 !important;
  stroke: #8e8e93 !important;
}
.theme-option-btn.light span {
  font-size: 19px;
  font-weight: 600;
  color: var(--bg-primary) !important;
}

.theme-option-btn.active {
  border-color: var(--primary) !important;
  background: rgba(10, 132, 255, 0.08);
}
/* Force white color for dark option icons and text */
.theme-option-btn.dark i,
.theme-option-btn.dark svg,
.theme-option-btn.dark span,
.theme-option-btn.active.dark i,
.theme-option-btn.active.dark svg,
.theme-option-btn.active.dark span {
  color: var(--text-primary) !important;
  stroke: var(--text-primary) !important;
}

/* Force dark color for light option icons and text */
.theme-option-btn.light i,
.theme-option-btn.light svg,
.theme-option-btn.light span,
.theme-option-btn.active.light i,
.theme-option-btn.active.light svg,
.theme-option-btn.active.light span {
  color: var(--bg-primary) !important;
  stroke: var(--bg-primary) !important;
}

/* Reset specific light icon color for better visibility when NOT active */
.theme-option-btn.light:not(.active) i,
.theme-option-btn.light:not(.active) svg {
  color: #8e8e93 !important;
  stroke: #8e8e93 !important;
}

/* ================= LANGUAGE MODAL STYLES ================= */
.language-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 5px;
}

.language-item {
  padding: 14px 20px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 20px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.language-item:hover {
  background-color: var(--border-color);
}

.language-item.active {
  border-color: var(--primary);
  background-color: rgba(10, 132, 255, 0.1);
  color: var(--primary);
}

/* ================= NIVEIS SCREEN STYLES (iOS LIST STYLE) ================= */
#screen-niveis {
  background: var(--bg-primary);
}

.niveis-list-container {
  display: flex;
  flex-direction: column;
  background: transparent;
  margin-top: 10px;
}

.level-item {
  display: flex;
  align-items: center;
  padding: 18px 16px;
  background: transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s, opacity 0.12s ease;
  position: relative;
  user-select: none;
}

.level-item:active {
  background: var(--border-light);
  transform: scale(0.97); /* Efeito de profundidade */
  opacity: 0.9;
}

.level-item + .level-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 70px;
  right: 70px;
  height: 0.5px;
  background: var(--border-light); /* Mais visível */
}

.level-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.level-icon-box i, .level-icon-box svg {
  width: 26px;
  height: 26px;
  color: var(--text-primary);
}

/* Cores originais sólidas/gradientes conforme configurado no início */
.level-box-none { background: linear-gradient(135deg, #2a2a2e, var(--card-bg)); }
.level-box-bronze { background: linear-gradient(135deg, #D9A06C 0%, #C58A5A 50%, #8A5A32 100%); }
.level-box-silver { background: linear-gradient(135deg, #757575, #4a4a4a); }
.level-box-gold { background: linear-gradient(135deg, #FFD60A, #FFCC00); }
.level-box-legendary { background: #6D28D9; }
.level-box-diamond { background: linear-gradient(135deg, #0ea5e9, #096d9a); }

.level-content {
  margin-left: 14px;
  display: flex;
  flex-direction: column;
}

.level-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.level-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.2;
}

.level-chevron {
  margin-left: auto;
  color: var(--text-tertiary); /* Mais visível */
}
.level-chevron svg, .level-chevron i {
  width: 20px;
  height: 20px;
}


.level-detail-subtitle-ios {
  font-size: 17px;
  font-weight: 500;
  text-align: center;
  margin-top: 2px;
  margin-bottom: 20px;
}

.level-detail-items-container {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.level-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
}

.level-detail-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.level-detail-icon i, .level-detail-icon svg {
  width: 18px;
  height: 18px;
}

.level-detail-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.level-detail-row-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.level-detail-row-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ios-close-full-btn {
  width: 100%;
  background: none;
  border: none;
  color: #0A84FF;
  font-size: 19px;
  font-weight: 600;
  padding: 16px 0;
  cursor: pointer;
  transition: opacity 0.2s;
}

.ios-close-full-btn:active {
  opacity: 0.5;
}

/* ================= LEVEL UNLOCK ANIMATIONS ================= */
#modal-level-details .ios-picker-modal {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#modal-level-details.open .ios-picker-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Badge Pop Animation */
#modal-level-details #level-detail-icon-box {
  transform: scale(0.8);
  opacity: 0;
  transition: box-shadow 0.4s ease;
}

#modal-level-details.open #level-detail-icon-box {
  animation: popBadge 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.1s;
}

@keyframes popBadge {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Cascading Content Animation */
#modal-level-details .modal-title,
#modal-level-details .level-detail-subtitle-ios,
#modal-level-details .level-detail-row {
  opacity: 0;
  transform: translateY(12px);
}

#modal-level-details.open .modal-title {
  animation: fadeUpDetail 0.4s ease forwards;
  animation-delay: 0.2s;
}

#modal-level-details.open .level-detail-subtitle-ios {
  animation: fadeUpDetail 0.4s ease forwards;
  animation-delay: 0.3s;
}

#modal-level-details.open .level-detail-row:nth-child(1) {
  animation: fadeUpDetail 0.4s ease forwards;
  animation-delay: 0.4s;
}

#modal-level-details.open .level-detail-row:nth-child(2) {
  animation: fadeUpDetail 0.4s ease forwards;
  animation-delay: 0.5s;
}

#modal-level-details.open .level-detail-row:nth-child(3) {
  animation: fadeUpDetail 0.4s ease forwards;
  animation-delay: 0.6s;
}

@keyframes fadeUpDetail {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer Animation */
#modal-level-details .modal-actions-ios {
  opacity: 0;
  transition: opacity 0.4s ease;
  transition-delay: 0.7s;
}

#modal-level-details.open .modal-actions-ios {
  opacity: 1;
}

/* --- iOS ACTION BUTTONS (MODAL) --- */
.ios-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s, opacity 0.1s ease;
  user-select: none;
}

.ios-action-btn:active {
  transform: scale(0.97);
  opacity: 0.8;
}

.ios-action-btn i, .ios-action-btn svg {
  width: 20px;
  height: 20px;
}

.ios-action-btn.primary-action {
  background: rgba(10, 132, 255, 0.15);
  color: #0A84FF;
}

.ios-action-btn.danger-action {
  background: rgba(255, 69, 58, 0.15);
  color: #FF453A;
}

/* --- iOS ACTION LIST (CALENDAR MODAL) --- */
.ios-action-list-ios {
  display: flex;
  flex-direction: column;
}

.ios-list-btn {
  width: 100%;
  padding: 16px;
  background: transparent;
  border: none;
  border-radius: 0 !important;
  color: #0A84FF;
  font-size: 19px;
  font-weight: 400;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  border-bottom: 0.5px solid var(--border-light);
  user-select: none;
}

.ios-list-btn:last-child {
  border-bottom: none;
}

.ios-list-btn:active {
  background: var(--border-light);
  transform: scale(0.99);
}

.ios-list-btn.danger {
  color: #FF453A;
}

/* --- EDITABLE TITLE STYLES --- */
.editable-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.editable-title:active {
  opacity: 0.6;
}
.editable-title i {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}

/* --- CURRENCY SELECTION STYLES --- */
.currency-options-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 5px;
  margin-bottom: 10px;
}
.currency-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition:
    transform 0.2s,
    border-color 0.2s,
    background-color 0.2s;
}
.currency-card:active {
  transform: scale(0.98);
}
.currency-card.active {
  border-color: var(--primary);
  background-color: rgba(10, 132, 255, 0.1);
}
.currency-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.currency-card-name {
  color: var(--text-main);
  font-size: 18px;
  font-weight: 500;
}
.currency-card-code {
  color: var(--text-dim);
  font-size: 16px;
}
.currency-check {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

/* ================= RISK TIMES SECTION ================= */
.risk-times-section {
  margin-top: 0;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header h3 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
}

.risk-description {
  margin-top: 6px;
  color: #8e8e93;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.add-time-btn {
  color: var(--primary);
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.add-time-btn:active {
  opacity: 0.6;
}

.times-list {
  margin-top: 4px;
}

.time-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  margin-top: 8px;
  background: var(--card-bg); /* Contraste contra o fundo var(--card-bg) da seção */
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 500;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.remove-btn:active {
  color: #8e8e93;
}

/* ================= UNIFIED PICKER SYSTEM (iOS STYLE) ================= */
.time-modal {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 20px;
  width: 90%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  animation: modalFadeIn 0.2s ease;
}

#duration-picker-modal .time-modal {
  max-width: 360px;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.time-picker-header-labels {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
  margin-bottom: 0px;
}

.column-label {
  width: 70px;
  text-align: center;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.time-picker-body {
  display: flex;
  justify-content: center;
  gap: 20px;
  height: 150px;
  position: relative;
  width: 100%;
}

.time-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  width: 70px;
  height: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.4) 15%,
    rgba(0,0,0,1) 40%,
    rgba(0,0,0,1) 60%,
    rgba(0,0,0,0.4) 85%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.4) 15%,
    rgba(0,0,0,1) 40%,
    rgba(0,0,0,1) 60%,
    rgba(0,0,0,0.4) 85%,
    transparent 100%
  );
}
.time-column::-webkit-scrollbar {
  display: none;
}

.time-item-picker {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-primary);
  opacity: 0.3;
  scroll-snap-align: center;
  transition: all 0.2s ease;
  width: 100%;
}

.time-item-picker.active {
  opacity: 1;
  font-size: 26px;
  font-weight: 600;
  transform: scale(1.05);
}

.time-column::before,
.time-column::after {
  content: "";
  display: block;
  height: 55px; /* (150/2 - 40/2) para centralizar perfeitamente */
  flex-shrink: 0;
}

/* --- PICKER ACTIONS --- */
.time-picker-actions {
  display: flex;
  gap: 12px;
  margin-top: 25px;
}

.time-btn-cancel,
.time-btn-confirm {
  flex: 1;
  min-height: 44px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.time-btn-cancel {
  background: var(--border-light);
  color: var(--text-primary);
  border: 1px solid var(--border-light) !important;
}

.time-btn-confirm {
  background-color: #0A84FF;
  color: white;
}

.time-btn-cancel:active,
.time-btn-confirm:active {
  transform: scale(0.96);
  opacity: 0.85;
}

/* --- LARGE ADD GOAL BUTTON --- */

.add-goal-btn-large {
  width: 100%;
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
}

.add-goal-btn-large:active {
  background: rgba(10, 132, 255, 0.1);
  transform: scale(0.98);
}

.add-goal-btn-large i,
.add-goal-btn-large svg {
  width: 20px;
  height: 20px;
}

/* --- SUBSTITUICAO DO VICIO --- */


/* --- QUICK ACTIONS (CRISIS) --- */
.quick-actions-container {
  margin-top: 15px;
  padding: 15px;
  background: rgba(10, 132, 255, 0.05);
  border-radius: 16px;
  border: 1px solid rgba(10, 132, 255, 0.2);
}

.quick-actions-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  text-align: center;
}

.quick-action-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  background: var(--card-bg);
  border-radius: 12px;
  color: var(--text-primary);
  border: 1px solid #2c2c2e;
  font-size: 17px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.1s,
    background 0.2s;
}

.quick-action-btn:active {
  transform: scale(0.96);
  background: #2c2c2e;
}



/* --- CONTATO DE CONFIANA --- */
.support-section {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #2c2c2e;
}

.support-section h4 {
  font-size: 16px;
  color: #8e8e93;
  margin-bottom: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.support-list {
  margin-bottom: 15px;
}

.support-item {
  background: var(--card-bg);
  padding: 14px;
  border-radius: 14px;
  margin-top: 10px;
  color: #0a84ff;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
}

.support-item:active {
  background: #2c2c2e;
  transform: scale(0.98);
}

.add-support-btn {
  width: 100%;
  background: none;
  border: none;
  color: #0a84ff;
  font-size: 16px;
  font-weight: 500;
  padding: 10px;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.2s;
}

.add-support-btn:active {
  opacity: 0.6;
}

/* --- SISTEMA DE XP E NVEL --- */
.user-progress-header {
  padding: 0 20px 15px;
  margin-top: -10px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.level-tag {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(10, 132, 255, 0.3);
}

.streak-tag {
  font-size: 16px;
  font-weight: 700;
  color: #ff9f0a;
  display: flex;
  align-items: center;
  gap: 4px;
}

.xp-progress-container {
  width: 100%;
  height: 8px;
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.xp-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0a84ff, #64d2ff);
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(10, 210, 255, 0.4);
}

/* Floating XP Animation */
.floating-xp {
  position: absolute;
  color: #64d2ff;
  font-weight: 800;
  font-size: 20px;
  pointer-events: none;
  animation: floatXP 1.2s forwards;
  z-index: 9999;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

@keyframes floatXP {
  0% {
    transform: translateY(0) opacity(1);
  }
  100% {
    transform: translateY(-50px) opacity(0);
  }
}

/* Modal Level Up */
.level-up-content {
  text-align: center;
  padding: 20px 10px;
}

.level-up-badge {
  font-size: 61px;
  margin-bottom: 15px;
  display: block;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}

.level-up-title {
  color: #ffd60a;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 10px;
}

.level-up-rank {
  font-size: 20px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

/* ================= TRUSTED CONTACTS ================= */
.trusted-contacts-container {
    padding: 10px 20px;
    animation: fadeIn 0.4s ease;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 18px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.contact-item:active {
    transform: scale(0.96);
}

.contact-item i {
    color: var(--primary);
    width: 24px;
    height: 24px;
}

.contact-item span {
    font-size: 19px;
    font-weight: 500;
    color: var(--text-main);
}

.add-contact-btn {
    margin-top: 28px;
    color: #0A84FF;
    background: transparent;
    border: none;
    font-size: 19px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.add-contact-btn:active {
    opacity: 0.6;
}

/* ================= CLEAN TIME COUNTER (PREMIUM BLUE) ================= */
.clickable {
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
  user-select: none;
}

.clickable:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.goal-attention {
  animation: breathe 3.5s ease-in-out infinite;
}


.clean-time-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.clean-time-label {
  align-self: center;
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-weight: 800;
}

.clean-time-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.clean-time-chart:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.clean-subtitle {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 16px;
  width: 100%;
}

@keyframes breathe {
  0% { transform: scale(1); }
  50% { transform: scale(1.01); }
  100% { transform: scale(1); }
}

.breathe {
  animation: breathe 3.5s ease-in-out infinite;
}

.time-bar {
  position: relative;
  height: 44px;
  background: var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.time-bar .label {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  pointer-events: none;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 14px;
  transition: width 0.4s cubic-bezier(0.1, 0.7, 1.0, 0.1);
  clip-path: polygon(
    0% 0%,
    100% 0%,
    88% 100%,
    0% 100%
  );
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#anos-bar .bar-fill { background: linear-gradient(90deg, #FFD700, #FFA500); }
#meses-bar .bar-fill { background: linear-gradient(90deg, #00E676, #00C853); }
#dias-bar .bar-fill { background: linear-gradient(90deg, #1DE9B6, #00BFA5); }
#horas-bar .bar-fill { background: linear-gradient(90deg, #40C4FF, #00B0FF); }
#minutos-bar .bar-fill { background: linear-gradient(90deg, #FFD740, #FFAB00); }
#segundos-bar .bar-fill { background: linear-gradient(90deg, #B388FF, #7C4DFF); }

/* Padronizao de H3 das sees (Horrios de Risco e Substituio) */

/* ================= LEVEL PROGRESS CARD ================= */
.level-progress-card {
  background: var(--card-gradient);
  border: 0.5px solid var(--border-light);
  border-radius: 24px;
  padding: 24px;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 10px 30px var(--shadow-color);
}


.level-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.level-item-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.level-item-group.next {
  align-items: flex-end;
}

.level-progress-card .level-label {
  font-size: 13px;
  font-weight: 500; /* Removido negrito (de 700 para 500) */
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.level-progress-card .level-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-progress-card .level-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.level-progress-card .level-name.next-level {
  font-size: 17px; /* Reduzido mais um pouco conforme solicitado */
}

.level-progress-card .level-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.level-progress-card .level-icon svg {
  width: 100%;
  height: 100%;
}

.level-progress-bar-container {
  height: 10px;
  background: var(--border-light);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.level-progress-bar-container.is-beginner {
  background: var(--border-light);
}

.level-progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.level-progress-footer {
  text-align: center;
  font-size: 15px; /* Reduzido de 17px para 15px */
  color: var(--text-primary); /* Alterado de rgba(255, 255, 255, 0.7) para branco */
  font-weight: 400;
}



.level-progress-footer strong {
  font-weight: 700;
  color: var(--text-primary);
}

/* Dynamic Level Colors */
.color-none { color: #8E8E93 !important; }
.color-bronze { color: #D9A06C !important; }
.color-silver { color: #757575 !important; }
.color-gold { color: #FFD60A !important; }
.color-legendary { color: #6D28D9 !important; }
.color-diamond { color: #0EA5E9 !important; }

.bg-none { background: linear-gradient(90deg, #2a2a2e, var(--card-bg)) !important; }
.bg-bronze { background: linear-gradient(90deg, #D9A06C, #8A5A32) !important; }
.bg-silver { background: linear-gradient(90deg, #757575, #4a4a4a) !important; }
.bg-gold { background: linear-gradient(90deg, #FFD60A, #FFCC00) !important; }
.bg-legendary { background: #6D28D9 !important; border: none; }
.bg-diamond { background: linear-gradient(90deg, #0ea5e9, #096d9a) !important; }

/* ================= SEÇÃO: SEUS MOTIVOS (ESTILO APPLE) ================= */
.motives-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.motives-section .section-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  width: 100%;
}

.motives-section h3 {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.5px;
}

.motives-section .section-subtitle {
  font-size: 15px;
  color: var(--text-dim);
  margin: 0;
}

.motives-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.motives-input-container {
  flex: 1;
  background: var(--bg-primary);
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.motives-input-container:focus-within {
  border-color: var(--primary);
  background: var(--bg-primary);
}

.motives-input-container textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 17px;
  outline: none;
  resize: none;
  padding: 0;
  min-height: 24px;
  line-height: 1.4;
  font-family: inherit;
}

.motives-input-container textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.add-motive-btn {
  width: 44px;
  height: 44px;
  background-color: var(--primary);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

.add-motive-btn:active {
  transform: scale(0.92);
  opacity: 0.9;
}

.add-motive-btn i, .add-motive-btn svg {
  width: 22px;
  height: 22px;
}

.motives-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.motive-card {
  background: var(--border-light);
  border: 0.5px solid var(--border-light);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  animation: motiveSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.motive-text {
  flex: 1;
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.4;
  cursor: pointer;
}

.motive-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  padding: 6px;
  cursor: pointer;
  transition: color 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.motive-delete-btn:hover {
  color: #ff453a;
}

.motive-delete-btn:active {
  transform: scale(0.9);
}

.motive-delete-btn i, .motive-delete-btn svg {
  width: 18px;
  height: 18px;
}


/* ================= TIMELINE DE NÍVEIS ================= */
#modal-level-timeline {
  --current-tier-color: #0A84FF; /* Default blue, updated via JS */
}

/* TIMELINE HEADER */
.timeline-header-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 24px 24px 15px;
  width: 100%;
  box-sizing: border-box;
}

.th-icon-box {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: var(--current-tier-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  border: none;
}

.th-icon-box::after {
  display: none;
}

.th-icon-box svg {
  color: #FFFFFF !important;
  width: 44px;
  height: 44px;
  color: var(--text-primary);
  z-index: 1;
}

.th-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.th-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.th-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 1px 0;
  line-height: 1.1;
}

.th-days {
  font-size: 16px;
  font-weight: 700;
  color: var(--current-tier-color); /* The 103 dias clean text */
  margin: 0 0 2px 0;
}

.th-remaining {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

/* REWARD BOX */
.timeline-reward-box {
  margin: 10px 12px 20px 12px; /* Sincronizado com a distância lateral de 12px do nível atual */
  padding: 16px;
  background: var(--card-bg);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border-light);
  width: calc(100% - 24px);
  box-sizing: border-box;
}

.reward-icon {
  width: 22px;
  height: 22px;
  color: var(--current-tier-color);
  flex-shrink: 0;
}

.reward-text {
  font-size: 15px;
  color: var(--text-primary);
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
  flex: 1;
}

/* TIMELINE CONTAINER & NODES */
.timeline-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: visible; /* Permitir glow lateral */
  padding: 32px 32px 40px 32px; /* Aumentado para dar respiro ao glow */
  display: flex;
  flex-direction: column;
  position: relative;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
  
  /* Efeito de Fade Real usando Máscara de Transparência Dinâmica */
  --timeline-mask-top: 1;
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0, var(--timeline-mask-top)) 0%,
    black 12%,
    black 88%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0, var(--timeline-mask-top)) 0%,
    black 12%,
    black 88%,
    transparent 100%
  );
}

.timeline-node {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 28px;
  z-index: 1;
}

.timeline-node:last-child {
  padding-bottom: 0;
}

/* A linha agora é única e global para o container, dentro do wrapper de conteúdo */
.timeline-global-line {
  position: absolute;
  top: 22px; /* Começa no centro do ícone do primeiro nível */
  bottom: 22px; /* Termina no centro do ícone do último nível */
  left: 15px; /* Centro do ícone (16px) - 1px da largura da linha */
  width: 2px;
  background: var(--border-light);
  z-index: -1; /* Camada inferior absoluta */
  pointer-events: none;
}

.timeline-scroll-content {
  position: relative;
  width: 100%;
}

.timeline-icon-container {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  flex-shrink: 0;
  background: var(--card-bg); /* Importante: esconde a linha que passa por trás */
  border: 2px solid var(--border-light);
  position: relative;
}

.timeline-icon-container i, .timeline-icon-container svg {
  width: 16px;
  height: 16px;
}

.timeline-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 4px;
}

.timeline-level-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.timeline-level-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

/* STATES REFINED */

/* Completed: Full color line and check icons */
.node-completed .timeline-icon-container {
  background: var(--current-tier-color);
  border-color: var(--current-tier-color);
}
.node-completed .timeline-icon-container i, .node-completed .timeline-icon-container svg {
  color: var(--card-bg); /* Dark icon */
}
.node-completed .timeline-level-desc {
  color: rgba(255, 255, 255, 0.7); /* Not extinguished */
}

/* Current: Halo, Glow and highlighted text */
.node-current {
  padding: 12px 16px 12px 16px !important; /* Aumentado padding interno para compensar o círculo maior */
  background: var(--border-light);
  border-radius: 40px 16px 16px 40px;
  margin: 0 -20px 16px -20px; /* Sincronizado margens laterais para distância uniforme (12px da borda) */
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  z-index: 10;
}
.node-current .timeline-icon-container {
  background: var(--card-bg);
  border: 2px solid var(--current-tier-color);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3), 0 0 0 4px var(--current-tier-color), 0 0 15px var(--current-tier-color);
  width: 44px;
  height: 44px;
  /* Cálculo: ContainerPadding(32) + NodeMargin(-20) + NodePadding(16) + IconHalfWidth(22) - IconMargin(5) = 47px (Alinhado com a linha: 32+15) */
  margin-left: -5px; 
}
.node-current .timeline-icon-container svg {
  width: 22px;
  height: 22px;
  color: var(--current-tier-color);
}
.node-current .timeline-level-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.node-current .timeline-level-desc {
  color: var(--current-tier-color);
  font-weight: 600;
}

/* Tier Colors for Future Nodes */
.tier-none { --node-tier-color: #8E8E93; }
.tier-bronze { --node-tier-color: #D9A06C; }
.tier-silver { --node-tier-color: #757575; }
.tier-gold { --node-tier-color: #FFD60A; }
.tier-diamond { --node-tier-color: #0EA5E9; }
.tier-legendary { --node-tier-color: #6D28D9; }

/* Future: Faded and outline with specific tier color */
.node-future .timeline-icon-container {
  background: var(--card-bg); /* Fundo sólido para esconder a linha atrás */
  border-color: color-mix(in srgb, var(--node-tier-color), transparent 75%);
}
.node-future .timeline-icon-container i, 
.node-future .timeline-icon-container svg {
  color: color-mix(in srgb, var(--node-tier-color), transparent 75%);
}

.node-future .timeline-level-name, 
.node-future .timeline-level-desc {
  opacity: 0.4;
}

/* Modal Width Adjustment */
#modal-level-timeline .ios-picker-modal {
  max-width: 480px;
  width: 95%;
}



/* Global Light Mode Force - Resolves white-on-white issues */
body.light-theme h1, 
body.light-theme h2, 
body.light-theme h3, 
body.light-theme p:not(.th-days, .th-remaining), 
body.light-theme span:not(.econ-val, .badge, .status, .tier-label, .th-days, .th-remaining), 
body.light-theme label {
  color: var(--text-primary);
}


/* Apple Style Fixes - Light Mode Force White Cards */
body.light-theme .level-progress-card,
body.light-theme .clean-time-container,
body.light-theme .motivo-banner,
body.light-theme .economy-section,
body.light-theme .motives-section {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .time-bar {
  background: rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .time-bar .label {
  color: #000000 !important;
  font-weight: 600 !important;
  text-shadow: none !important;
}

.close-btn i, .close-btn svg {
  background: var(--border-light);
  border-radius: 50%;
  padding: 4px;
  color: var(--text-secondary);
}

/* Light Mode Gradient Overrides */
body.light-theme .level-box-none { background: #E5E5EA !important; }
body.light-theme .level-box-silver { background: #D1D1D6 !important; }
body.light-theme .th-icon-box { background: var(--current-tier-color) !important; }

body.light-theme .timeline-reward-box { background: var(--bg-primary) !important; }

body.light-theme .th-remaining { color: rgba(0, 0, 0, 0.45) !important; }
