/**
 * como você está — estilos
 * ─────────────────────────────────────────────────────────
 * SEÇÕES PRINCIPAIS (use Ctrl+F pra navegar):
 *   :root              — variáveis CSS (cores e transições)
 *   body / .ambient    — fundo animado com blobs
 *   .container/.screen — sistema de telas
 *   .welcome-*         — tela de boas-vindas
 *   h1, .subtitle      — tipografia base
 *   .streak-indicator  — streak no topo
 *   textarea / .option — campos de input
 *   .submit            — botão principal de continuar
 *   .extras-*          — painel de contexto adicional
 *   .result-*          — tela de resultado (frase + ações)
 *   .pulse             — partícula pulsante / modo respirar
 *   .top-controls      — botões fixos (padrões, histórico, som)
 *   .history-*         — diário visual em grade
 *   .pattern-*         — tela de padrões emocionais
 *   .heatmap           — calendário dia × período
 *   .modal-overlay     — modais (compartilhar, detalhe, apoio)
 *   .share-*           — modal de compartilhar redesenhado
 *   .support-*         — botão e modal de recursos de apoio
 *   .toast             — feedback flutuante
 *   .color-wave        — onda de transição entre cores
 *   .quiet-line        — frase rotativa no rodapé
 * ─────────────────────────────────────────────────────────
 */

  :root {
    --bg: #f5f1ea;
    --fg: #2a2a2a;
    --accent: #2a2a2a;
    --transition-slow: 2.5s cubic-bezier(0.4, 0, 0.2, 1);
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html, body { min-height: 100%; }

  body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--fg);
    transition: background var(--transition-slow), color var(--transition-slow);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
  }

  /* quando extras está aberto, alinha pelo topo pra permitir rolagem */
  body:has(.extras.open) {
    align-items: flex-start;
  }

  .ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-slow);
    z-index: 0;
    overflow: hidden;
  }

  .ambient.active { opacity: 1; }

  .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
  }

  .blob:nth-child(1) { width: 50vw; height: 50vw; background: var(--accent); top: -10%; left: -10%; animation-duration: 25s; }
  .blob:nth-child(2) { width: 40vw; height: 40vw; background: var(--accent); bottom: -10%; right: -10%; animation-duration: 30s; animation-delay: -5s; }
  .blob:nth-child(3) { width: 35vw; height: 35vw; background: var(--accent); top: 40%; left: 50%; animation-duration: 35s; animation-delay: -10s; }

  @keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(5vw, -5vw) scale(1.1); }
    66% { transform: translate(-5vw, 5vw) scale(0.9); }
  }

  .container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    width: 90%;
    text-align: center;
    padding: 2rem 2rem 8rem;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .screen {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }

  .screen.active { opacity: 1; pointer-events: auto; display: flex; }

  /* quando o painel de extras está aberto, deixa o container crescer e a página rolar */
  body:has(.extras.open) .container {
    min-height: auto;
    align-items: flex-start;
    padding-top: 4rem;
  }

  h1 {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 2rem;
    font-variation-settings: "opsz" 144;
  }

  h1 em { font-style: italic; font-weight: 300; }

  /* TELA DE BOAS-VINDAS */
  .welcome-content {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    padding: 1rem;
  }

  .welcome-mark {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: currentColor;
    margin: 0 auto 2rem;
    opacity: 0.6;
    animation: welcomePulse 3s ease-in-out infinite;
  }

  @keyframes welcomePulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.6); opacity: 0.8; }
  }

  .welcome-title {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    margin-bottom: 1rem;
    font-variation-settings: "opsz" 144;
    letter-spacing: -0.02em;
  }

  .welcome-title em { font-style: italic; font-weight: 300; }

  .welcome-subtitle {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1rem;
    opacity: 0.65;
    margin-bottom: 3rem;
    letter-spacing: 0.01em;
  }

  .welcome-steps {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    margin: 0 auto 3rem;
    text-align: left;
    max-width: 380px;
  }

  .welcome-step {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    opacity: 0;
    transform: translateY(10px);
    animation: welcomeStepIn 0.8s ease forwards;
  }

  .welcome-step:nth-child(1) { animation-delay: 0.4s; }
  .welcome-step:nth-child(2) { animation-delay: 0.7s; }
  .welcome-step:nth-child(3) { animation-delay: 1s; }

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

  .welcome-step-num {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.5;
    flex-shrink: 0;
    line-height: 1;
    padding-top: 0.1em;
    width: 1.5em;
  }

  .welcome-step p {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.5;
    opacity: 0.85;
    margin: 0;
  }

  .welcome-promise {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    opacity: 0.5;
    line-height: 1.5;
    margin-bottom: 2.5rem;
    letter-spacing: 0.01em;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }

  .welcome-start {
    background: var(--fg);
    color: var(--bg);
    border: none;
    padding: 1rem 3rem;
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1.05rem;
    cursor: pointer;
    border-radius: 100px;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  }

  .welcome-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  }

  .welcome-start:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
  }

  @media (max-width: 600px) {
    .welcome-step p { font-size: 0.95rem; }
    .welcome-subtitle { margin-bottom: 2rem; }
    .welcome-steps { gap: 1.2rem; margin-bottom: 2rem; }
    .welcome-promise { margin-bottom: 2rem; }
  }

  /* INDICADOR DE STREAK */
  .streak-indicator {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0;
    margin-bottom: 1.5rem;
    transition: opacity 0.8s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .streak-indicator.visible { opacity: 0.5; }

  .streak-indicator .dots {
    display: flex;
    gap: 4px;
  }

  .streak-indicator .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
  }

  .streak-indicator .dot.filled { opacity: 1; }

  .subtitle {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 1rem;
    opacity: 0.6;
    margin-bottom: 3rem;
    letter-spacing: 0.02em;
  }

  textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid currentColor;
    color: inherit;
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 1.5rem;
    padding: 1rem 0;
    resize: none;
    outline: none;
    text-align: center;
    min-height: 80px;
    transition: border-color 0.3s;
  }

  textarea::placeholder { color: currentColor; opacity: 0.3; font-style: italic; }
  textarea:focus { border-bottom-width: 2px; }

  .question { margin-top: 3rem; }

  .question-label {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.7;
  }

  .question-hint {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-style: normal;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-left: 0.5rem;
  }

  .options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .option {
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.6rem 1.2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
  }

  .option:hover { background: currentColor; }
  .option:hover span { color: var(--bg); }
  .option.selected { background: currentColor; }
  .option.selected span { color: var(--bg); }

  /* Foco visível pra navegação por teclado */
  .option:focus-visible,
  .submit:focus-visible,
  .action-btn:focus-visible,
  .top-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
    opacity: 1;
  }

  textarea:focus-visible {
    outline: none;
  }

  .submit {
    margin-top: 3rem;
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.9rem 2.5rem;
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 100px;
    opacity: 0.4;
    pointer-events: none;
  }

  .submit.ready { opacity: 1; pointer-events: auto; }
  .submit:hover { background: currentColor; }
  .submit:hover span { color: var(--bg); }

  /* TOGGLE DE EXTRAS */
  .extras-toggle {
    margin-top: 2.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.45;
    cursor: pointer;
    transition: opacity 0.3s;
    padding: 0.5rem;
    user-select: none;
  }

  .extras-toggle:hover { opacity: 0.8; }

  .extras-toggle span::before {
    content: '+';
    margin-right: 0.3em;
    font-family: 'Fraunces', serif;
    font-size: 1rem;
  }

  .extras-toggle.open span::before { content: '−'; }

  .extras {
    max-height: 0;
    overflow: hidden;
    width: 100%;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
  }

  .extras.open {
    max-height: 1200px;
    opacity: 1;
  }

  .extras-question { margin-top: 2rem; }
  .extras-question:first-child { margin-top: 1.5rem; }

  .note-input {
    font-size: 1rem !important;
    min-height: 60px !important;
    font-style: italic;
    opacity: 0.85;
  }

  .result-frase {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin-bottom: 3rem;
    max-width: 540px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease 0.5s, transform 1.5s ease 0.5s;
  }

  .result.active .result-frase { opacity: 1; transform: translateY(0); }

  .mood-label {
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.7rem;
    opacity: 0;
    margin-bottom: 0.5rem;
    transition: opacity 1s ease 1s;
  }

  .result.active .mood-label { opacity: 0.5; }

  .result-actions {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s ease 1.5s;
    margin-top: 1rem;
  }

  .result.active .result-actions { opacity: 1; }

  .action-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.5rem 0;
    opacity: 0.5;
    border-bottom: 1px solid transparent;
    transition: opacity 0.3s, border-color 0.3s;
  }

  .action-btn:hover { opacity: 1; border-bottom-color: currentColor; }

  .top-controls {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.75rem;
    z-index: 10;
  }

  .top-btn {
    background: var(--bg);
    border: 1px solid currentColor;
    color: inherit;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.6;
    transition: opacity 0.3s, background 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .top-btn:hover {
    opacity: 1;
    background: var(--fg);
    color: var(--bg);
  }

  .pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    margin-bottom: 2rem;
    opacity: 0;
  }

  .result.active .pulse { opacity: 0.6; animation: pulse 3s ease-in-out infinite; }

  .pulse.breathing {
    width: 120px;
    height: 120px;
    margin-bottom: 3.5rem;
    animation: breathe 8s ease-in-out infinite;
    opacity: 0.4;
  }

  @keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(2); opacity: 0.7; }
  }

  @keyframes breathe {
    0%, 100% { transform: scale(0.5); opacity: 0.25; }
    50% { transform: scale(1.6); opacity: 0.65; }
  }

  .breathe-instruction {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1rem;
    opacity: 0;
    margin-bottom: 1rem;
    height: 1.5rem;
    transition: opacity 0.8s ease;
    letter-spacing: 0.08em;
  }

  .breathe-instruction.visible { opacity: 0.7; }

  /* MODO RESPIRAR FOCADO — esconde tudo exceto pulse + instrução */
  body.breathing-mode .top-controls,
  body.breathing-mode .ambient,
  body.breathing-mode .quiet-line,
  body.breathing-mode .mood-label,
  body.breathing-mode .result-frase,
  body.breathing-mode .time-comparison,
  body.breathing-mode .music-card,
  body.breathing-mode .result-actions {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 1s ease !important;
  }

  body.breathing-mode .pulse.breathing {
    opacity: 0.55;
  }

  body.breathing-mode .breathe-instruction {
    font-size: 1.4rem;
    opacity: 0.85 !important;
    transition: opacity 1s ease 0.5s, font-size 1s ease 0.5s;
  }

  body.breathing-mode .breathe-exit {
    display: flex;
  }

  /* botão sutil de sair do modo respirar */
  .breathe-exit {
    display: none;
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.7rem 1.8rem;
    border-radius: 100px;
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 1.5s ease 1.5s;
    z-index: 50;
    align-items: center;
    justify-content: center;
  }

  body.breathing-mode .breathe-exit {
    opacity: 0.5;
  }

  .breathe-exit:hover { opacity: 1 !important; }

  .history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    width: 100%;
    max-width: 600px;
    margin: 2rem 0;
  }

  .history-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    overflow: hidden;
  }

  .history-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 5;
  }

  .history-cell .day {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.9;
  }

  .history-cell .mood {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    text-align: center;
  }

  .history-empty {
    font-family: 'Fraunces', serif;
    font-style: italic;
    opacity: 0.5;
    margin: 3rem 0;
    line-height: 1.6;
  }

  /* COMPARAÇÃO TEMPORAL */
  .time-comparison {
    display: none;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid currentColor;
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    opacity: 0;
    transition: opacity 1s ease 1.8s;
    text-align: left;
  }

  .result.active .time-comparison.has-data {
    display: block;
    opacity: 0.85;
  }

  .time-comparison-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 0.6rem;
  }

  .time-comparison-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .time-comparison-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid currentColor;
  }

  .time-comparison-text {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.4;
    flex: 1;
  }

  .time-comparison-mood {
    font-style: normal;
    font-weight: 400;
    opacity: 0.75;
  }

  /* MÚSICA — linha discreta na base do resultado */
  .music-card {
    display: none;
    margin: 1rem 0 0;
    width: 100%;
    max-width: 480px;
    opacity: 0;
    transition: opacity 1.5s ease 2.5s;
  }

  .result.active .music-card.visible {
    display: block;
    opacity: 0.55;
  }

  .music-card:hover { opacity: 0.95 !important; }

  .music-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: nowrap;
    font-size: 0.72rem;
    padding: 0.4rem 0.5rem;
    border-top: 1px solid currentColor;
    border-color: rgba(0,0,0,0.08);
    border-radius: 0;
  }

  .music-info-inline {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    justify-content: center;
  }

  .music-title {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 0.85rem;
    font-weight: 300;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
  }

  .music-artist {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    opacity: 0.65;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 35%;
  }

  .music-sep {
    opacity: 0.35;
    font-size: 0.7rem;
    flex-shrink: 0;
  }

  .music-shuffle-icon,
  .music-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    color: inherit;
    text-decoration: none;
    opacity: 0.45;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s;
    padding: 0;
    flex-shrink: 0;
  }

  .music-shuffle-icon:hover,
  .music-link-icon:hover {
    opacity: 1;
  }

  .music-link-icon:focus-visible,
  .music-shuffle-icon:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    opacity: 1;
  }

  .music-shuffle-icon:active svg {
    transform: rotate(180deg);
    transition: transform 0.4s;
  }

  @media (max-width: 480px) {
    .music-title { font-size: 0.78rem; max-width: 55%; }
    .music-artist { font-size: 0.65rem; max-width: 32%; }
    .music-line { gap: 0.4rem; padding: 0.4rem 0.25rem; font-size: 0.68rem; }
    .music-shuffle-icon, .music-link-icon { width: 20px; height: 20px; }
  }

  /* TELA DE PADRÕES */
  .pattern-section {
    width: 100%;
    max-width: 600px;
    margin: 1.5rem 0;
    padding: 1.5rem;
    border-top: 1px solid currentColor;
    text-align: left;
  }

  .pattern-section:first-of-type { border-top: none; padding-top: 0; }

  .pattern-section-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: 1.25rem;
  }

  .pattern-insight {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    opacity: 0.85;
  }

  .pattern-insight strong {
    font-weight: 400;
    font-style: normal;
    opacity: 1;
  }

  /* HEATMAP DIA DA SEMANA x PERÍODO */
  .heatmap {
    display: grid;
    grid-template-columns: 70px repeat(4, 1fr);
    gap: 4px;
    margin-top: 0.5rem;
    width: 100%;
    overflow-x: auto;
  }

  .heatmap-header {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.5;
    text-align: center;
    padding: 0.4rem 0;
  }

  .heatmap-row-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
  }

  .heatmap-cell {
    aspect-ratio: 1.4;
    border-radius: 4px;
    background: currentColor;
    opacity: 0.05;
    cursor: default;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    position: relative;
  }

  .heatmap-cell.has-data {
    cursor: help;
  }

  .heatmap-cell.has-data:hover {
    opacity: 1 !important;
  }

  .heatmap-cell .count {
    color: var(--bg);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
  }

  .heatmap-cell.has-data:hover .count {
    opacity: 1;
  }

  /* TOP HUMORES */
  .top-moods-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }

  .top-mood-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
  }

  .top-mood-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .top-mood-name {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1rem;
    flex: 0 0 auto;
    min-width: 100px;
  }

  .top-mood-bar {
    flex: 1;
    height: 4px;
    background: currentColor;
    opacity: 0.15;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
  }

  .top-mood-bar-fill {
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0.85;
    border-radius: 2px;
    transform-origin: left;
    transition: transform 1s ease;
  }

  .top-mood-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    opacity: 0.6;
    flex-shrink: 0;
    min-width: 30px;
    text-align: right;
  }

  /* NOTA EXIBIDA NO HISTÓRICO */
  .history-cell .note-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
  }

  /* DETALHE DO REGISTRO (modal) */
  .entry-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
  }

  .entry-detail-overlay.active { display: flex; }

  .entry-detail {
    background: var(--bg);
    color: var(--fg);
    padding: 2rem;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    text-align: left;
    max-height: 85vh;
    overflow-y: auto;
  }

  .entry-detail-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 0.5rem;
  }

  .entry-detail-mood {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 300;
  }

  .entry-detail-frase {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    opacity: 0.85;
    padding-left: 1rem;
    border-left: 2px solid currentColor;
  }

  .entry-detail-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid currentColor;
    border-color: rgba(0,0,0,0.1);
  }

  .entry-detail-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 0.5rem;
  }

  .entry-detail-text {
    font-family: 'Fraunces', serif;
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.8;
  }

  .entry-detail-text.italic { font-style: italic; }

  .entry-detail-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
  }

  .entry-tag {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid currentColor;
    border-radius: 100px;
    opacity: 0.6;
  }

  .entry-detail-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    flex-wrap: wrap;
  }

  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.4s ease;
  }

  .modal-overlay.active {
    display: flex;
    opacity: 1;
  }

  .modal {
    background: var(--bg);
    color: var(--fg);
    padding: 2rem;
    border-radius: 12px;
    max-width: 420px;
    width: 100%;
    text-align: center;
  }

  /* MODAL DE COMPARTILHAR — REDESENHADO */
  .share-modal {
    max-width: 440px;
    padding: 3.25rem 1.75rem 1.75rem;
    position: relative;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .modal-overlay.active .share-modal {
    transform: scale(1) translateY(0);
  }

  .modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid currentColor;
    color: inherit;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s, background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    z-index: 10;
    padding: 0;
  }

  .modal-close:hover {
    opacity: 1;
    transform: rotate(90deg);
    background: var(--fg);
    color: var(--bg);
  }

  .modal-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    opacity: 1;
  }

  .share-card-wrapper {
    border-radius: 16px;
    overflow: hidden;
    margin: 0 auto 1.5rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    transition: transform 0.4s ease;
    max-width: 220px;
    width: 100%;
  }

  .share-card-wrapper:hover {
    transform: translateY(-2px);
  }

  .share-card-preview {
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 9 / 16;
  }

  .share-card-preview canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-fit: cover;
  }

  .share-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  /* BOTÃO PRIMÁRIO — destaque máximo */
  .share-primary-btn {
    background: var(--fg);
    color: var(--bg);
    border: none;
    padding: 1rem 2rem;
    border-radius: 100px;
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1.05rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease, opacity 0.3s;
    width: 100%;
    max-width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
  }

  .share-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  }

  .share-primary-btn:active {
    transform: translateY(0);
  }

  .share-primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .share-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .share-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
  }

  .share-hint {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 0.78rem;
    opacity: 0.5;
    margin: 0;
    line-height: 1.4;
    text-align: center;
    max-width: 320px;
    min-height: 1.2em;
  }

  /* AÇÕES SECUNDÁRIAS — links discretos */
  .share-secondary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .share-link-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
    opacity: 0.5;
    padding: 0.4rem 0.6rem;
    transition: opacity 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 6px;
  }

  .share-link-btn:hover {
    opacity: 1;
  }

  .share-link-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    opacity: 1;
  }

  .share-link-icon {
    font-size: 0.85rem;
    opacity: 0.7;
  }

  .share-divider {
    opacity: 0.25;
    font-size: 0.85rem;
    user-select: none;
  }

  /* feedback de "copiado" no botão */
  .share-link-btn.copied {
    color: inherit;
    opacity: 1;
  }

  .share-link-btn.copied .share-link-icon {
    opacity: 1;
  }

  @media (max-width: 480px) {
    .share-modal {
      padding: 1.5rem 1.25rem 1.25rem;
      border-radius: 20px;
    }
    .share-primary-btn {
      font-size: 1rem;
      padding: 0.9rem 1.5rem;
    }
  }

  /* DESTAQUE DO BOTÃO DE APOIO (♡ no topo) quando humor difícil */
  #supportBtn.highlighted {
    opacity: 1;
    background: var(--fg);
    color: var(--bg);
    animation: supportHighlight 2.5s ease;
  }

  @keyframes supportHighlight {
    0% { transform: scale(1); }
    20% { transform: scale(1.15); }
    40% { transform: scale(1); }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); }
  }

  /* MODAL DE APOIO */
  .support-modal {
    max-width: 520px;
    padding: 3.25rem 1.75rem 1.75rem;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
  }

  .modal-overlay.active .support-modal {
    transform: scale(1) translateY(0);
  }

  .support-header {
    text-align: center;
    margin-bottom: 1.5rem;
  }

  .support-mark {
    width: 24px;
    height: 24px;
    margin: 0 auto 1rem;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    opacity: 0.6;
  }

  .support-mark::before {
    content: '♡';
  }

  .support-title {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
  }

  .support-title em {
    font-style: italic;
    font-weight: 300;
  }

  .support-intro {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.55;
    opacity: 0.8;
    margin: 0;
  }

  .support-resources {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1.5rem 0;
  }

  .support-resource {
    display: block;
    padding: 1rem 1.1rem;
    border: 1px solid currentColor;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: background 0.3s, transform 0.2s;
    opacity: 0.85;
  }

  .support-resource:hover {
    opacity: 1;
    transform: translateY(-1px);
  }

  .support-resource:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
    opacity: 1;
  }

  .support-resource-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
  }

  .support-resource-name {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.3;
    flex: 1;
    min-width: 200px;
  }

  .support-resource-contact {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    flex-shrink: 0;
  }

  .support-resource-contact strong {
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
  }

  .support-resource-info {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    opacity: 0.6;
    line-height: 1.4;
  }

  .support-footer {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0.55;
    text-align: center;
    margin: 1.5rem 0 0;
    padding: 1.25rem 0 0;
    border-top: 1px solid currentColor;
    border-color: rgba(0,0,0,0.1);
  }

  /* esconde botão de apoio na tela de boas-vindas */
  body:has(#screen-welcome.active) #supportBtn {
    display: none;
  }

  @media (max-width: 480px) {
    .support-modal { padding: 1.5rem 1.25rem; border-radius: 20px; }
    .support-resource { padding: 0.85rem 0.95rem; }
    .support-resource-name { font-size: 0.95rem; }
  }
  .toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--fg);
    color: var(--bg);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    line-height: 1.5;
    max-width: 90%;
    text-align: center;
    z-index: 200;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  }

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

  .toast-strong {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
  }

  .loading {
    display: inline-block;
    font-family: 'Fraunces', serif;
    font-style: italic;
    opacity: 0.6;
  }

  .loading::after { content: '...'; animation: dots 1.5s steps(4, end) infinite; }

  @keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
  }

  /* ONDA DE TRANSIÇÃO DE COR */
  .color-wave {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 50;
    will-change: transform, opacity;
    transition: none;
  }

  .color-wave.expanding {
    animation: colorWave 1.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  }

  @keyframes colorWave {
    0% {
      transform: translate(-50%, -50%) scale(0);
      opacity: 0.95;
    }
    60% {
      opacity: 0.9;
    }
    100% {
      transform: translate(-50%, -50%) scale(400);
      opacity: 0;
    }
  }

  /* LOADING RESPIRATÓRIO (substitui os "..." padrão do modo IA) */
  .breathing-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-family: 'Fraunces', serif;
    font-style: italic;
    opacity: 0.7;
  }

  .breathing-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: breathingDot 1.6s ease-in-out infinite;
  }

  .breathing-dots .dot:nth-child(2) { animation-delay: 0.2s; }
  .breathing-dots .dot:nth-child(3) { animation-delay: 0.4s; }
  .breathing-dots .dot:nth-child(4) { animation-delay: 0.6s; }

  @keyframes breathingDot {
    0%, 100% { transform: scale(0.6); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 1; }
  }

  /* FRASE ROTATIVA NO RODAPÉ */
  .quiet-line {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem 1rem 1.25rem;
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 0.8rem;
    opacity: 0;
    color: var(--fg);
    text-align: center;
    pointer-events: none;
    transition: opacity 1.5s ease;
    z-index: 8;
    letter-spacing: 0.01em;
    line-height: 1.4;
    background: linear-gradient(to top, var(--bg) 30%, transparent);
  }

  .quiet-line.visible { opacity: 0.5; }

  @media (max-width: 600px) {
    /* CRÍTICO: padding-bottom pra conteúdo não ficar atrás da frase quieta no rodapé */
    .container {
      padding-bottom: 7rem;
    }

    /* TIPOGRAFIA E TAMANHOS GERAIS */
    h1 { font-size: 2rem; line-height: 1.15; margin-bottom: 1.75rem; }
    .subtitle { margin-bottom: 2.5rem; }
    textarea { font-size: 1.15rem; padding: 0.85rem 0; min-height: 70px; }
    .result-frase { font-size: 1.65rem; line-height: 1.3; }

    /* ESPAÇAMENTO ENTRE PERGUNTAS — bem mais respiro vertical */
    .question { margin-top: 3rem; }
    .extras-question { margin-top: 2.75rem; }

    /* BOTÕES DO TOPO — mais distância entre eles + área de toque */
    .top-controls {
      top: 1rem;
      right: 1rem;
      gap: 0.7rem;
    }
    .top-btn {
      width: 42px;
      height: 42px;
      font-size: 0.95rem;
    }

    /* GRUPOS DE OPÇÕES — gap generoso pra respirar */
    .options {
      gap: 0.7rem 0.55rem;
    }

    /* CADA BOTÃO DE OPÇÃO — mais alto, mais "tocável" */
    .option {
      padding: 0.75rem 1.15rem;
      font-size: 0.85rem;
      min-height: 44px;
      letter-spacing: 0.01em;
    }

    /* LABEL DAS PERGUNTAS */
    .question-label {
      font-size: 1.05rem;
      margin-bottom: 1.3rem;
      line-height: 1.4;
    }

    /* HINT QUEBRA EM LINHA NOVA */
    .question-hint {
      display: block;
      margin-left: 0;
      margin-top: 0.4rem;
      font-size: 0.65rem;
    }

    /* TOGGLE DO PAINEL EXTRAS */
    .extras-toggle {
      margin-top: 3.5rem;
      padding: 0.85rem 1rem;
      font-size: 0.72rem;
    }

    /* INPUT DE NOTA */
    .note-input {
      font-size: 0.95rem !important;
      min-height: 70px !important;
    }

    /* BOTÃO CONTINUAR — destaque + área generosa */
    .submit {
      margin-top: 3rem;
      padding: 1.05rem 2.75rem;
      font-size: 1rem;
    }

    /* AÇÕES DA TELA DE RESULTADO — quebra em linhas se precisar */
    .result-actions {
      gap: 1.25rem 1.5rem;
      flex-wrap: wrap;
      justify-content: center;
      padding: 0 1rem;
    }
    .action-btn {
      padding: 0.7rem 0.5rem;
      min-height: 44px;
      font-size: 0.78rem;
    }

    /* CARD DE MÚSICA — espaçamento interno */
    .music-card { margin-bottom: 2rem; }
    .music-card-content { gap: 1rem; margin-bottom: 0.8rem; }
    .music-controls { gap: 1.5rem; margin-top: 0.8rem; }

    /* FRASE QUIETA */
    .quiet-line {
      font-size: 0.72rem;
      padding: 2rem 1rem 1rem;
    }

    /* MOOD LABEL DO RESULTADO */
    .mood-label {
      letter-spacing: 0.25em;
      margin-bottom: 0.75rem;
    }

    /* TIME COMPARISON — mais respiro */
    .time-comparison {
      padding: 1rem 1.2rem;
      margin-bottom: 1.75rem;
    }

    /* TELA DE BOAS-VINDAS — espaçamento mais aberto */
    .welcome-step { gap: 1rem; }
    .welcome-steps { gap: 1.5rem; margin-bottom: 2.5rem; }
    .welcome-start { padding: 1.05rem 2.75rem; }

    /* CÉLULAS DO HISTÓRICO — mais tocáveis */
    .history-grid {
      grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
      gap: 0.55rem;
    }

    /* MODAIS — padding interno */
    .modal { padding: 1.5rem 1.25rem; }

    /* BOTÕES SECUNDÁRIOS DO COMPARTILHAR */
    .share-secondary { gap: 0.4rem; }
    .share-link-btn {
      padding: 0.55rem 0.7rem;
      font-size: 0.78rem;
    }
  }