/* ==========================================================================
   SensoryPass — Mock navegável
   Tokens derivados de sensorypass_brand_guide.md
   ========================================================================== */

:root {
  /* Marca */
  --sp-primary: #707CB8;          /* Indigo Sensory */
  --sp-primary-soft: #A180BE;     /* Lilás de apoio */
  --sp-teal: #07B0AE;
  --sp-blue: #4196DD;
  --sp-orange: #FF9D4B;
  --sp-coral: #FF7E4D;
  --sp-red-coral: #FD3B4C;
  --sp-pink: #E083C2;
  --sp-lavender: #99ACFF;
  --sp-lavender-soft: #CDD6FF;

  /* Papéis de interface */
  --color-primary: var(--sp-primary);
  --color-primary-action: #636FAF; /* variação do indigo com contraste AA para texto branco */
  --color-primary-ink: #4C5796;    /* indigo para textos pequenos sobre fundos claros */
  --color-primary-tint: #EEF0FA;
  --color-primary-tint-2: #E2E6F6;
  --color-secondary: var(--sp-teal);
  --color-secondary-ink: #057C7A;
  --color-secondary-tint: #E3F6F5;
  --color-warm: var(--sp-coral);
  --color-warm-ink: #B4471F;
  --color-warm-tint: #FFEDE4;
  --color-lilac-ink: #7E4F9C;
  --color-lilac-tint: #F3EAF8;

  --color-background: #FFF7F1;
  --color-background-warm: #F6E7D8;
  --color-surface: #FFFFFF;
  --color-surface-muted: #FBF4EE;
  --color-border: #EFE4DA;
  --color-border-strong: #E2D5C9;

  --color-text: #111111;
  --color-text-soft: #3A3740;
  --color-text-muted: #5E5966;
  --color-text-on-primary: #FFFFFF;

  --color-success: #2CD164;
  --color-success-ink: #17803C;
  --color-error: #DF260B;
  --color-error-ink: #B0250E;

  --gradient-brand: linear-gradient(90deg, #FF9D4B 0%, #FD3B4C 25%, #E083C2 50%, #707CB8 75%, #07B0AE 100%);
  --gradient-brand-soft: linear-gradient(120deg, rgba(255,157,75,.14), rgba(224,131,194,.14) 45%, rgba(112,124,184,.14) 75%, rgba(7,176,174,.14));
  --gradient-symbol: linear-gradient(135deg, #707CB8 0%, #A180BE 60%, #C98AC8 100%);

  /* Tipografia — Agrandir não está disponível livremente; Lexend é a alternativa geométrica mais próxima */
  --font-display: "Agrandir", "Lexend", "Open Sans", Arial, sans-serif;
  --font-body: "Open Sans", Arial, sans-serif;

  --text-xs: .75rem;
  --text-sm: .8125rem;
  --text-base: .9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.625rem;

  /* Formas */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --shadow-soft: 0 1px 2px rgba(76, 60, 50, .04), 0 6px 20px -8px rgba(76, 60, 50, .10);
  --shadow-raised: 0 2px 4px rgba(76, 60, 50, .05), 0 14px 32px -12px rgba(76, 60, 50, .18);
  --shadow-primary: 0 10px 24px -10px rgba(99, 111, 175, .65);

  /* Espaçamento */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;

  --app-max: none;
  --tabbar-h: 72px;
  --gutter: 24px;

  --ease-out: cubic-bezier(.22, .8, .32, 1);
  --dur-fast: 150ms;
  --dur: 250ms;
  --dur-slow: 350ms;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-background-warm);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--color-primary-action); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

svg.lucide { width: 20px; height: 20px; stroke-width: 1.9; flex-shrink: 0; }

/* ---------- Moldura do app (mobile-first; centralizada no desktop) ---------- */
.app {
  position: relative;
  max-width: var(--app-max);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--color-background);
  overflow-x: hidden;
}

/* Linhas onduladas discretas no topo */
.app::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 260px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='260' viewBox='0 0 480 260' fill='none' stroke='%23E9DDD2' stroke-width='1.2'%3E%3Cpath d='M-20 60 C 80 20, 160 100, 260 60 S 420 20, 500 60'/%3E%3Cpath d='M-20 78 C 80 38, 160 118, 260 78 S 420 38, 500 78'/%3E%3Cpath d='M-20 96 C 80 56, 160 136, 260 96 S 420 56, 500 96'/%3E%3Cpath d='M-20 114 C 80 74, 160 154, 260 114 S 420 74, 500 114'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% auto;
  opacity: .8;
  pointer-events: none;
}

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; align-content: center; gap: 28px;
  background: var(--color-background);
  transition: opacity 400ms ease, visibility 400ms;
}
.splash__logo { width: min(320px, 78vw); height: auto; animation: splash-in 700ms var(--ease-out) both; }
.splash__ribbon {
  width: 120px; height: 4px; border-radius: 4px; background: var(--gradient-brand);
  transform-origin: left; animation: ribbon 900ms var(--ease-out) 150ms both;
}
.splash.is-hidden { opacity: 0; visibility: hidden; }
@keyframes splash-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ribbon { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Telas ---------- */
.screens {
  position: relative;
  padding: 0 var(--gutter) calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom));
}
.screen { padding-top: 16px; }
.screen.is-entering { animation: screen-in var(--dur) var(--ease-out) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Topbar & cabeçalhos ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; position: relative;
}
.topbar__symbol { width: 46px; height: auto; }
.topbar__actions { display: flex; align-items: center; gap: 6px; }

.greeting { margin: 22px 0 22px; position: relative; }
.greeting__title { font-size: var(--text-xl); font-weight: 600; color: var(--color-text); line-height: 1.2; }
.greeting__text { color: var(--color-text-muted); margin-top: 4px; font-size: var(--text-md); }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 0 20px; position: relative;
}
.page-head__title { font-size: var(--text-xl); line-height: 1.2; }
.page-head__text { color: var(--color-text-muted); margin-top: 6px; }
.page-head .badge { margin-top: 6px; }

.section { margin-top: 28px; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 12px;
}
.section__title { font-size: var(--text-md); font-weight: 600; }
.section__meta { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ---------- Badge / chip / status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  padding: 4px 9px; border-radius: var(--radius-pill);
  white-space: nowrap;
}
.badge svg.lucide { width: 13px; height: 13px; }
.badge--mock { background: var(--color-surface); color: var(--color-text-muted); border: 1px dashed var(--color-border-strong); }
.badge--ai { background: var(--color-secondary-tint); color: var(--color-secondary-ink); }
.badge--neutral { background: var(--color-primary-tint); color: var(--color-primary-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-tint); color: var(--color-primary-ink);
  font-size: var(--text-sm); font-weight: 600;
}
.chip--outline { background: var(--color-surface); border: 1px solid var(--color-border-strong); color: var(--color-text-soft); }
.chip--hash::before { content: "#"; opacity: .6; margin-right: -3px; }
.chip--lg { min-height: 40px; padding: 8px 16px; font-size: var(--text-base); }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: var(--text-sm); font-weight: 600; color: var(--color-secondary-ink); }
.status__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sp-teal); position: relative; }
.status__dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--sp-teal); opacity: 0; animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: .6; } 80%, 100% { transform: scale(1.4); opacity: 0; } }

/* ---------- Avatar ---------- */
.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 56px; height: 56px; border-radius: 50%;
  font-family: var(--font-display); font-weight: 600; font-size: 1.25rem;
  color: var(--color-primary-ink); background: var(--color-primary-tint);
}
.avatar--sm { width: 40px; height: 40px; font-size: .95rem; background: var(--color-lilac-tint); color: var(--color-lilac-ink); }
.avatar--xs { width: 32px; height: 32px; font-size: .8rem; }
.avatar--ring { background: var(--gradient-brand); padding: 3px; width: 62px; height: 62px; }
.avatar--ring span {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  border: 3px solid var(--color-surface);
  background: linear-gradient(160deg, #F1F2FB, #E5E0F3);
}

/* ---------- Botões ---------- */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; color: var(--color-text-soft);
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.icon-btn:hover { background: rgba(112, 124, 184, .10); }
.icon-btn:active { transform: scale(.92); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px;
  border-radius: var(--radius-md); border: 0;
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-base);
  cursor: pointer; text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast), background var(--dur-fast), opacity var(--dur-fast);
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--block { width: 100%; }

.btn--primary { background: var(--color-primary-action); color: var(--color-text-on-primary); box-shadow: var(--shadow-primary); }
.btn--primary:hover { background: #5865A6; }

.btn--secondary { background: var(--color-surface); color: var(--color-primary-ink); box-shadow: inset 0 0 0 1.5px var(--color-primary); }
.btn--secondary:hover { background: var(--color-primary-tint); }

.btn--ghost { background: transparent; color: var(--color-primary-ink); min-height: 44px; padding: 8px 12px; }
.btn--ghost:hover { background: var(--color-primary-tint); }

/* Botão principal de relato: único lugar onde o gradiente vira moldura */
.btn--record {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 80px; padding: 16px 20px 16px 16px; text-align: left;
  border: 0; border-radius: var(--radius-lg); cursor: pointer;
  background:
    linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
    var(--gradient-brand) border-box;
  border: 2px solid transparent;
  box-shadow: var(--shadow-raised);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur);
}
.btn--record:hover { box-shadow: 0 18px 36px -14px rgba(112, 124, 184, .45); transform: translateY(-1px); }
.btn--record:active { transform: scale(.985); }
.btn--record__icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-primary-action); color: #fff; flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}
.btn--record__icon svg.lucide { width: 22px; height: 22px; }
.btn--record__label { display: flex; flex-direction: column; flex: 1; }
.btn--record__label strong { font-family: var(--font-display); font-weight: 600; font-size: var(--text-md); }
.btn--record__label small { color: var(--color-text-muted); font-size: var(--text-sm); }
.btn--record__chev { color: var(--color-primary); }

/* ---------- Card ---------- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: var(--space-6);
  position: relative;
}
.card--interactive {
  cursor: pointer; width: 100%; text-align: left; border: 0;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur);
}
.card--interactive:hover { box-shadow: var(--shadow-raised); transform: translateY(-2px); }
.card--interactive:active { transform: scale(.985); box-shadow: var(--shadow-soft); }

.card--accent { overflow: hidden; }
.card--accent::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: var(--gradient-brand);
}

/* Card da criança */
.child-card { display: flex; align-items: center; gap: 16px; padding: 22px 24px; overflow: hidden; }
.child-card::after {
  content: ""; position: absolute; right: -40px; top: -50px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(161,128,190,.16), transparent 70%);
  pointer-events: none;
}
.child-card__info { flex: 1; min-width: 0; }
.child-card__name { font-size: var(--text-lg); }
.child-card__age { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: 6px; }
.child-card__device {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--color-secondary-tint); color: var(--color-secondary-ink);
}

/* ---------- Indicadores "Agora" ---------- */
.now-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.now-card { padding: 14px 12px 14px; border-radius: var(--radius-md); display: flex; flex-direction: column; gap: 10px; min-height: 128px; }
.now-card__icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
}
.now-card__icon svg.lucide { width: 18px; height: 18px; }
.now-card__label { font-size: 11.5px; color: var(--color-text-muted); line-height: 1.3; font-weight: 600; }
.now-card__value { font-family: var(--font-display); font-weight: 600; font-size: var(--text-md); line-height: 1.15; margin-top: auto; }

.tone-indigo .now-card__icon, .tone-indigo.icon-tile { background: var(--color-primary-tint); color: var(--color-primary-ink); }
.tone-teal .now-card__icon, .tone-teal.icon-tile { background: var(--color-secondary-tint); color: var(--color-secondary-ink); }
.tone-coral .now-card__icon, .tone-coral.icon-tile { background: var(--color-warm-tint); color: var(--color-warm-ink); }
.tone-lilac .now-card__icon, .tone-lilac.icon-tile { background: var(--color-lilac-tint); color: var(--color-lilac-ink); }

.updated { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: var(--text-sm); color: var(--color-text-muted); }
.updated svg.lucide { width: 15px; height: 15px; }

/* Indicador de nível (3 segmentos, com texto — não depende só de cor) */
.level { display: flex; gap: 3px; margin-top: 6px; width: 100%; max-width: 64px; color: var(--color-primary); }
.tone-teal .level { color: var(--sp-teal); }
.level span { flex: 1; height: 4px; border-radius: 4px; background: var(--color-border); transition: background var(--dur); }
.level[data-level="1"] span:nth-child(-n+1),
.level[data-level="2"] span:nth-child(-n+2),
.level[data-level="3"] span:nth-child(-n+3) { background: currentColor; }

/* ---------- Resumo de hoje ---------- */
.summary { display: grid; gap: 2px; padding: 6px; }
.summary__row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--radius-sm); }
.icon-tile { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; }
.summary__num { font-family: var(--font-display); font-weight: 600; font-size: 1.375rem; min-width: 26px; font-variant-numeric: tabular-nums; }
.summary__text { color: var(--color-text-soft); line-height: 1.3; }
.summary__row + .summary__row { border-top: 1px solid var(--color-border); border-radius: 0; }
.num-bump { animation: bump 450ms var(--ease-out); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); color: var(--color-primary-ink); } 100% { transform: scale(1); } }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 19px; top: 18px; bottom: 18px; width: 2px;
  background: linear-gradient(var(--color-border-strong), var(--color-border) 80%, transparent);
}
.timeline__item { position: relative; display: flex; gap: 12px; padding-bottom: 12px; }
.timeline__item.is-new { animation: item-in 450ms var(--ease-out) both; }
@keyframes item-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.timeline__marker {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid var(--color-background);
}
.timeline__marker svg.lucide { width: 17px; height: 17px; }
.timeline__card { flex: 1; padding: 16px 18px; border-radius: var(--radius-md); display: flex; align-items: center; gap: 10px; }
.timeline__body { flex: 1; min-width: 0; }
.timeline__time { font-size: var(--text-xs); font-weight: 700; color: var(--color-text-muted); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.timeline__title { font-weight: 600; color: var(--color-text); line-height: 1.35; }
.timeline__sub { font-size: var(--text-sm); color: var(--color-text-muted); }
.timeline__chev { color: var(--color-text-muted); opacity: .6; }

/* ---------- Início simplificado ---------- */
.hero { display: flex; align-items: center; gap: 16px; padding: 24px; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -50px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(7,176,174,.16), transparent 70%); pointer-events: none;
}
.hero--alert::after { background: radial-gradient(circle, rgba(255,126,77,.2), transparent 70%); }
.hero__info { flex: 1; min-width: 0; }
.hero__name { font-size: var(--text-sm); color: var(--color-text-muted); font-weight: 600; }
.hero__headline { font-size: var(--text-lg); line-height: 1.2; margin: 2px 0 6px; }
.hero__meta { display: flex; align-items: center; gap: 5px; font-size: var(--text-sm); color: var(--color-text-muted); }
.hero__meta svg.lucide { width: 14px; height: 14px; }
.hero__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; position: relative; z-index: 1; }
.hero--calm .hero__icon { background: var(--color-secondary-tint); color: var(--color-secondary-ink); }
.hero--alert .hero__icon { background: var(--color-warm-tint); color: var(--color-warm-ink); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.pair__item { display: flex; flex-direction: column; gap: 2px; padding: 20px; }
.pair__label { font-size: var(--text-sm); color: var(--color-text-muted); font-weight: 600; }
.pair__value { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); }
.pair__item .level { max-width: 72px; margin-top: 8px; }

.home-record { margin-top: 14px; }
.link-btn { background: none; border: 0; padding: 6px 0; min-height: 32px; color: var(--color-primary-ink); font-weight: 600; font-size: var(--text-sm); cursor: pointer; }
.footnote-mini { margin-top: 24px; font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.5; text-align: center; }
.footnote-mini button { background: none; border: 0; padding: 0; color: var(--color-primary-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: inherit; }

/* ---------- Nota de rodapé / disclaimer ---------- */
.footnote {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 28px; padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--color-surface-muted); border: 1px solid var(--color-border);
  font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.45;
}
.footnote svg.lucide { width: 17px; height: 17px; margin-top: 1px; color: var(--color-primary); }
.footnote button { background: none; border: 0; padding: 0; color: var(--color-primary-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 24px; }

/* ---------- Relatos ---------- */
.report-list { display: grid; gap: 14px; margin-top: 8px; }
.report-day { font-size: var(--text-sm); font-weight: 700; color: var(--color-text-muted); margin: 18px 0 -4px; text-transform: uppercase; letter-spacing: .06em; }
.report-card { display: flex; flex-direction: column; gap: 12px; }
.report-card.is-new { animation: item-in 450ms var(--ease-out) both; box-shadow: 0 0 0 2px var(--color-primary-tint-2), var(--shadow-raised); }
.report-card__head { display: flex; align-items: center; gap: 10px; }
.report-card__who { flex: 1; min-width: 0; }
.report-card__name { font-weight: 600; font-size: var(--text-sm); }
.report-card__when { font-size: var(--text-xs); color: var(--color-text-muted); }
.report-card__quote {
  font-size: var(--text-base); color: var(--color-text-soft); line-height: 1.55;
  padding-left: 12px; border-left: 3px solid var(--color-primary-tint-2);
}
.report-card__analysis {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding-top: 12px; border-top: 1px dashed var(--color-border-strong);
  font-size: var(--text-sm);
}
.kv__k { color: var(--color-text-muted); }
.kv__v { font-weight: 600; }
.kv { display: flex; gap: 6px; }

/* ---------- Estados vazios / erro / loading ---------- */
.state {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 36px 24px;
}
.state__art {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px;
  background: var(--gradient-brand-soft); color: var(--color-primary-ink);
}
.state__art svg.lucide { width: 34px; height: 34px; }
.state__title { font-size: var(--text-md); }
.state__text { color: var(--color-text-muted); max-width: 300px; }
.state .btn { margin-top: 10px; }
.state--error .state__art { background: #FDEDEA; color: var(--color-error-ink); }

.skeleton {
  border-radius: 8px; height: 12px;
  background: linear-gradient(90deg, #F2EAE3 0%, #FAF5F0 50%, #F2EAE3 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 25%, var(--sp-primary) 60%, var(--sp-teal));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Bottom sheet / modal ---------- */
.sheet-layer {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-backdrop {
  position: absolute; inset: 0; background: rgba(30, 24, 40, .38);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity var(--dur) ease;
}
.sheet {
  position: relative; width: 100%; max-width: none;
  max-height: 92vh;
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--color-background);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 10px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px -20px rgba(30, 24, 40, .35);
  transform: translateY(40px); opacity: 0;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur) ease;
}
.sheet-layer.is-open .sheet-backdrop { opacity: 1; }
.sheet-layer.is-open .sheet { transform: none; opacity: 1; }
.sheet__grip { width: 40px; height: 4px; border-radius: 4px; background: var(--color-border-strong); margin: 0 auto 6px; }
.sheet__close { position: absolute; right: 10px; top: 10px; }
.sheet__body { padding-top: 14px; }
.sheet__title { font-size: var(--text-lg); padding-right: 44px; }
.sheet__sub { color: var(--color-text-muted); margin-top: 4px; font-size: var(--text-sm); }
.sheet__step { animation: screen-in var(--dur) var(--ease-out) both; }
.sheet__actions { display: grid; gap: 10px; margin-top: 22px; }

@media (min-width: 560px) {
  .sheet-layer { align-items: center; padding: 24px; }
  .sheet { border-radius: var(--radius-xl); max-height: 88vh; max-width: 560px; }
  .sheet__grip { display: none; }
}

/* ---------- Gravação ---------- */
.rec { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 0 4px; }
.rec__status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--color-text-soft); }
.rec__status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sp-red-coral); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.rec__timer { font-family: var(--font-display); font-weight: 500; font-size: 3rem; letter-spacing: .02em; margin: 6px 0 18px; font-variant-numeric: tabular-nums; }

.rec__mic { position: relative; width: 112px; height: 112px; display: grid; place-items: center; margin: 4px 0 22px; }
.rec__mic-core {
  position: relative; z-index: 2; width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: var(--gradient-symbol);
  box-shadow: 0 14px 30px -10px rgba(112, 124, 184, .7);
  animation: mic-breathe 1.8s ease-in-out infinite;
}
.rec__mic-core svg.lucide { width: 34px; height: 34px; }
.rec__mic::before, .rec__mic::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: rgba(161, 128, 190, .22);
  animation: halo 2.2s ease-out infinite;
}
.rec__mic::after { animation-delay: 1.1s; }
@keyframes mic-breathe { 50% { transform: scale(1.05); } }
@keyframes halo { from { transform: scale(.75); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }

.wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 56px; width: 100%; max-width: 300px; margin-bottom: 26px; }
.wave span {
  display: block; width: 4px; border-radius: 4px; height: 100%;
  background: var(--gradient-symbol);
  transform-origin: center; transform: scaleY(.15);
  animation: wave 1.1s ease-in-out infinite;
}
@keyframes wave { 0%, 100% { transform: scaleY(.15); } 50% { transform: scaleY(var(--h, .8)); } }

.btn--stop {
  width: 100%; min-height: 60px; font-size: var(--text-md);
  background: var(--color-text); color: #fff; border-radius: var(--radius-lg);
}
.btn--stop:hover { background: #2A2730; }
.btn--stop .stop-square { width: 14px; height: 14px; border-radius: 4px; background: var(--sp-red-coral); }

.rec__hint { margin-top: 14px; font-size: var(--text-sm); color: var(--color-text-muted); }

/* ---------- Loading de processo ---------- */
.process { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 0 12px; text-align: center; }
.process__label { font-weight: 600; font-family: var(--font-display); }
.process__skeleton { width: 100%; display: grid; gap: 10px; margin-top: 12px; }
.process__skeleton .skeleton:nth-child(2) { width: 88%; }
.process__skeleton .skeleton:nth-child(3) { width: 64%; }

/* ---------- Transcrição ---------- */
.field { display: grid; gap: 8px; margin-top: 18px; }
.field__label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--text-sm); color: var(--color-text-soft); }
.field__label svg.lucide { width: 16px; height: 16px; color: var(--color-primary); }
.textarea {
  width: 100%; min-height: 130px; resize: vertical;
  padding: 14px 16px; border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border-strong); background: var(--color-surface);
  font: inherit; font-size: var(--text-md); line-height: 1.55; color: var(--color-text);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(112, 124, 184, .18); outline: none; }
.field__help { display: flex; gap: 6px; align-items: center; font-size: var(--text-sm); color: var(--color-text-muted); }
.field__help svg.lucide { width: 15px; height: 15px; }

/* ---------- Bloco de origem: Relato original → Análise por IA ---------- */
.source-block { border-radius: var(--radius-md); padding: 16px; background: var(--color-surface); box-shadow: var(--shadow-soft); }
.source-block__label { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); margin-bottom: 8px; }
.source-block__label svg.lucide { width: 14px; height: 14px; }
.source-block__text { font-size: var(--text-base); line-height: 1.55; color: var(--color-text-soft); }

.flow-arrow { display: flex; justify-content: center; padding: 6px 0; color: var(--color-text-muted); }
.flow-arrow svg.lucide { width: 18px; height: 18px; }

.ai-block {
  position: relative; border-radius: var(--radius-md); padding: 16px;
  background:
    linear-gradient(#F6FBFB, #F6FBFB) padding-box,
    linear-gradient(135deg, rgba(7,176,174,.55), rgba(112,124,184,.55) 60%, rgba(224,131,194,.45)) border-box;
  border: 1.5px solid transparent;
}
.ai-block__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.ai-tag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); font-weight: 700; color: var(--color-secondary-ink); letter-spacing: .02em; }
.ai-tag svg.lucide { width: 14px; height: 14px; }
.ai-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ai-metric { background: var(--color-surface); border-radius: var(--radius-sm); padding: 10px 12px; }
.ai-metric dt { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 600; }
.ai-metric dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 600; font-size: var(--text-md); }
.ai-summary { font-size: var(--text-base); color: var(--color-text-soft); line-height: 1.55; margin-top: 12px; }
.ai-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 14px; font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.45; }
.ai-note svg.lucide { width: 14px; height: 14px; margin-top: 1px; }
.ai-block .chip { background: var(--color-surface); }

.reveal > * { animation: reveal 420ms var(--ease-out) both; }
.reveal > *:nth-child(2) { animation-delay: 70ms; }
.reveal > *:nth-child(3) { animation-delay: 140ms; }
.reveal > *:nth-child(4) { animation-delay: 210ms; }
.reveal > *:nth-child(5) { animation-delay: 280ms; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Detalhe do relato ---------- */
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.detail-meta__item { background: var(--color-surface); border-radius: var(--radius-sm); padding: 10px 12px; }
.detail-meta__item dt { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 600; }
.detail-meta__item dd { margin: 2px 0 0; font-weight: 600; }
.detail-section { margin-top: 22px; }
.detail-section__title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--text-base); margin-bottom: 10px; }
.context-grid { display: grid; gap: 8px; }
.context-row { display: flex; align-items: center; gap: 12px; background: var(--color-surface); border-radius: var(--radius-sm); padding: 10px 12px; }
.context-row__label { flex: 1; color: var(--color-text-soft); font-size: var(--text-sm); }
.context-row__value { font-weight: 700; font-size: var(--text-sm); display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 70px; }
.context-row .icon-tile { width: 34px; height: 34px; border-radius: 10px; }
.context-row .icon-tile svg.lucide { width: 17px; height: 17px; }
.context-note { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.context-note svg.lucide { width: 14px; height: 14px; }

/* ---------- Localização ---------- */
.loc-card { padding: 0; overflow: hidden; }
.loc-card__top { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 18px; }
.loc-card__place { flex: 1; }
.loc-card__eyebrow { font-size: var(--text-sm); color: var(--color-text-muted); }
.loc-card__name { font-size: 1.5rem; line-height: 1.2; }
.loc-card__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: var(--text-sm); color: var(--color-text-muted); }
.loc-card__meta span { display: inline-flex; align-items: center; gap: 6px; }
.loc-card__meta svg.lucide { width: 15px; height: 15px; }
.loc-card__pin { width: 52px; height: 52px; border-radius: 16px; }
.loc-card__pin svg.lucide { width: 24px; height: 24px; }

.map-wrap { padding: 0 14px 14px; }
.map {
  height: 300px; border-radius: var(--radius-md); overflow: hidden;
  background: #EEE9E3; position: relative; z-index: 0;
}
.map-caption { display: flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--color-text-muted); margin: 12px 4px 0; }
.map-caption svg.lucide { width: 15px; height: 15px; }

/* Leaflet: controles discretos + popup na identidade */
.map .leaflet-control-zoom { border: 0; box-shadow: var(--shadow-soft); border-radius: 12px; overflow: hidden; margin: 10px; }
.map .leaflet-control-zoom a {
  width: 34px; height: 34px; line-height: 32px; font-size: 18px;
  color: var(--color-text-soft); background: rgba(255,255,255,.95); border-bottom-color: var(--color-border);
}
.map .leaflet-control-zoom a:hover { background: var(--color-primary-tint); }
.map .leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.8); border-top-left-radius: 8px; }
.map .leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: var(--shadow-raised); font-family: var(--font-body); }
.map .leaflet-popup-content { margin: 14px 16px; line-height: 1.4; }
.map .leaflet-popup-close-button { width: 30px !important; height: 30px !important; font-size: 20px !important; }
.popup__name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--color-text); }
.popup__line { color: var(--color-text-soft); font-size: 13px; margin-top: 4px; }
.popup__muted { color: var(--color-text-muted); font-size: 12px; }
.popup .badge { margin-top: 8px; }

.sp-marker { position: relative; width: 48px; height: 48px; }
.sp-marker__halo { position: absolute; inset: 0; border-radius: 50%; background: rgba(112,124,184,.25); animation: halo 2.4s ease-out infinite; }
.sp-marker__ring {
  position: absolute; inset: 6px; border-radius: 50%;
  background: conic-gradient(from 200deg, #FF9D4B, #FD3B4C, #E083C2, #707CB8, #07B0AE, #FF9D4B);
  box-shadow: 0 6px 14px -4px rgba(76, 60, 50, .45);
}
.sp-marker__core {
  position: absolute; inset: 9px; border-radius: 50%; background: var(--color-primary-action);
  border: 3px solid #fff; display: grid; place-items: center;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 13px;
}

.places { padding: 6px; }
.place { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.place + .place { border-top: 1px solid var(--color-border); }
.place__time { font-size: var(--text-xs); font-weight: 700; color: var(--color-text-muted); width: 42px; font-variant-numeric: tabular-nums; }
.place__name { flex: 1; font-weight: 600; }
.place__desc { font-size: var(--text-sm); color: var(--color-text-muted); font-weight: 400; }

/* ---------- Insights ---------- */
.filter {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong); background: var(--color-surface);
  font-weight: 600; font-size: var(--text-sm); color: var(--color-text-soft); cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.filter:hover { background: var(--color-primary-tint); }
.filter:active { transform: scale(.97); }
.filter svg.lucide { width: 16px; height: 16px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat { padding: 18px 16px; border-radius: var(--radius-md); display: flex; flex-direction: column; gap: 8px; }
.stat__num { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 11.5px; line-height: 1.3; color: var(--color-text-muted); font-weight: 600; }
.stat .icon-tile { width: 32px; height: 32px; border-radius: 10px; }
.stat .icon-tile svg.lucide { width: 16px; height: 16px; }

.bars { display: grid; gap: 14px; }
.bar__head { display: flex; justify-content: space-between; font-size: var(--text-sm); margin-bottom: 6px; }
.bar__name { font-weight: 600; color: var(--color-text-soft); }
.bar__pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.bar__track { height: 10px; border-radius: 10px; background: var(--color-surface-muted); overflow: hidden; box-shadow: inset 0 0 0 1px var(--color-border); }
.bar__fill { height: 100%; border-radius: 10px; width: 0; transition: width 900ms var(--ease-out); }

.trend { overflow: hidden; }
.trend::after {
  content: ""; position: absolute; right: -60px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(7,176,174,.12), transparent 70%); pointer-events: none;
}
.trend__title { display: flex; align-items: center; gap: 10px; font-size: var(--text-md); margin: 4px 0 10px; }
.trend__text { color: var(--color-text-soft); line-height: 1.6; }
.trend__assoc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.trend__assoc .chip { background: var(--color-surface-muted); }
.trend__plus { color: var(--color-text-muted); font-size: var(--text-sm); }
.trend__foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--color-border-strong); font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.5; }

/* ---------- Sobre os dados ---------- */
.about__logo { width: 240px; height: auto; margin: 6px auto 18px; }
.about__list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.about__list li { display: flex; gap: 12px; align-items: flex-start; background: var(--color-surface); border-radius: var(--radius-sm); padding: 12px 14px; font-size: var(--text-sm); color: var(--color-text-soft); }
.about__list .icon-tile { width: 34px; height: 34px; border-radius: 10px; }
.about__list .icon-tile svg.lucide { width: 17px; height: 17px; }
.about__demo { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Perfil ---------- */
.avatar--btn { border: 0; cursor: pointer; transition: transform var(--dur-fast), box-shadow var(--dur-fast); }
.avatar--btn:hover { box-shadow: 0 0 0 3px var(--color-primary-tint-2); }
.avatar--btn:active { transform: scale(.92); }

.profile-card { display: flex; align-items: center; gap: 16px; overflow: hidden; }
.profile-card .avatar { width: 64px; height: 64px; font-size: 1.5rem; }
.profile-card__name { font-size: var(--text-lg); }
.profile-card__role { color: var(--color-text-muted); font-size: var(--text-sm); }
.profile-card__mail { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: 2px; }

.list { padding: 6px; }
.list__row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 60px; padding: 12px 14px; border: 0; background: transparent; text-align: left;
  border-radius: var(--radius-sm);
}
.list__row + .list__row { border-top: 1px solid var(--color-border); }
button.list__row { cursor: pointer; transition: background var(--dur-fast); }
button.list__row:hover { background: var(--color-surface-muted); }
button.list__row:active { background: var(--color-primary-tint); }
.list__main { flex: 1; min-width: 0; }
.list__title { display: block; font-weight: 600; }
.list__sub { display: block; font-size: var(--text-sm); color: var(--color-text-muted); }
.list .icon-tile { width: 38px; height: 38px; border-radius: 12px; }
.list .icon-tile svg.lucide { width: 18px; height: 18px; }

.profile-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 32px; text-align: center; }
.profile-foot img { width: 200px; height: auto; opacity: .95; }
.profile-foot p { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------- Barra de navegação inferior ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; pointer-events: none;
  padding: 0;
}
.tabbar__inner {
  pointer-events: auto;
  width: 100%; max-width: none;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 6px max(8px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 0;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -8px 24px -16px rgba(76, 60, 50, .25);
}
.tab {
  position: relative; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 44px; border-radius: 18px;
  color: var(--color-text-muted);
  transition: color var(--dur) var(--ease-out), background var(--dur-fast);
}
.tab:hover { color: var(--color-primary-ink); }
.tab:active .tab__icon { transform: scale(.88); }
.tab__icon {
  position: relative; display: grid; place-items: center;
  width: 46px; height: 30px; border-radius: 15px;
  transition: background var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.tab__icon svg.lucide { width: 21px; height: 21px; }
.tab__label { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; letter-spacing: .01em; }
.tab.is-active { color: var(--color-primary-ink); }
.tab.is-active .tab__icon { background: var(--color-primary-tint); animation: tab-pop 350ms var(--ease-out); }
.tab.is-active .tab__label { font-weight: 700; }
.tab.is-active::after {
  content: ""; position: absolute; bottom: 2px; width: 18px; height: 3px; border-radius: 3px;
  background: var(--gradient-brand);
}
@keyframes tab-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ---------- Toast ---------- */
.toast-region {
  position: fixed; left: 0; right: 0; z-index: 90;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 20px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  max-width: 420px; padding: 12px 18px 12px 12px; border-radius: var(--radius-pill);
  background: #1D1A22; color: #fff; font-weight: 600; font-size: var(--text-sm);
  box-shadow: 0 16px 40px -14px rgba(0,0,0,.45);
  animation: toast-in var(--dur-slow) var(--ease-out) both;
}
.toast__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--color-success); color: #fff; }
.toast__icon svg.lucide { width: 16px; height: 16px; stroke-width: 2.6; }
.toast.is-leaving { animation: toast-out var(--dur) ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Telas pequenas ---------- */
@media (max-width: 360px) {
  :root { --gutter: 20px; }
  .now-grid, .stats { gap: 8px; }
  .now-card, .stat { padding: 14px 12px; }
  .topbar .badge--mock { display: none; }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 120ms !important;
    scroll-behavior: auto !important;
  }
  .screen.is-entering, .sheet__step, .reveal > * { animation: none !important; }
  .card--interactive:hover, .btn--record:hover { transform: none; }
  .sheet { transform: none; }
  .status__dot::after, .rec__mic::before, .rec__mic::after, .sp-marker__halo { display: none; }
  .wave span { transform: scaleY(var(--h, .5)); }
  .skeleton { animation: none; }
  .spinner { animation: spin 1.6s linear infinite !important; animation-iteration-count: infinite !important; animation-duration: 1.6s !important; }
}

/* ==========================================================================
   Layout responsivo
   mobile (<768): coluna única, barra inferior, ocupa a tela toda como app
   tablet (768–1023): coluna mais larga, barra inferior centralizada
   desktop (≥1024): menu lateral + conteúdo em colunas
   ========================================================================== */

/* Celular na horizontal: barra mais baixa para sobrar espaço de conteúdo */
@media (max-height: 480px) and (orientation: landscape) {
  :root { --tabbar-h: 54px; }
  .tab__label { display: none; }
  .tab__icon { height: 34px; }
  .tab.is-active::after { display: none; }
}

/* Áreas seguras (notch) nas laterais */
.screens {
  padding-left: calc(var(--gutter) + env(safe-area-inset-left));
  padding-right: calc(var(--gutter) + env(safe-area-inset-right));
}

/* Tablet */
@media (min-width: 768px) {
  :root { --gutter: 32px; }
  .screens { max-width: 760px; margin: 0 auto; }
  .greeting { margin-top: 30px; }
  .sheet { max-width: 560px; }
  .report-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .map { height: 380px; }
}

/* Desktop: menu lateral fixo */
@media (min-width: 1024px) {
  :root { --side-w: 248px; --gutter: 48px; }

  .app { margin: 0 0 0 var(--side-w); max-width: none; box-shadow: none; }
  .app::before { height: 300px; }

  .screens { max-width: 1120px; margin: 0 auto; padding-bottom: 56px; }
  .screen { padding-top: 28px; }

  /* A barra inferior vira menu lateral */
  .tabbar {
    left: 0; right: auto; top: 0; bottom: 0; width: var(--side-w);
    padding: 28px 16px 24px; justify-content: stretch; align-items: stretch;
    background: var(--color-surface); pointer-events: auto;
    border-right: 1px solid var(--color-border);
  }
  .tabbar__inner {
    display: flex; flex-direction: column; gap: 6px;
    max-width: none; height: auto; width: 100%; padding: 0;
    background: transparent; box-shadow: none; border-radius: 0; border-top: 0;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .tabbar__inner::before {
    content: ""; display: block; height: 52px; margin: 0 0 22px 10px;
    background: url("logo.png") left center / contain no-repeat;
  }
  .tab {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    min-height: 48px; padding: 0 12px 0 8px; border-radius: 14px;
  }
  .tab:hover { background: var(--color-primary-tint); }
  .tab.is-active { background: var(--color-primary-tint); }
  .tab.is-active .tab__icon { background: transparent; animation: none; }
  .tab__icon { width: 32px; height: 32px; }
  .tab__label { font-size: var(--text-base); }
  .tab.is-active::after {
    bottom: auto; top: 50%; left: 0; width: 3px; height: 22px; transform: translateY(-50%);
  }

  .toast-region { left: var(--side-w); bottom: 32px; }
  .topbar__symbol { display: none; }
  .topbar { justify-content: flex-end; }

  #home-content { max-width: 720px; }

  .report-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map { height: 440px; }
  #insights-content, #profile-content { max-width: 860px; }

  /* Sem a barra inferior, o modal centraliza na área de conteúdo */
  .sheet-layer { padding-left: calc(var(--side-w) + 24px); }
}

/* Telas muito largas */
@media (min-width: 1600px) {
  .screens { max-width: 1240px; }
}
