/* ===== ETGFR 2026 - estilos (identidade visual Petrobras) =====
   Paleta conforme Manual do Sistema de Identidade Visual Petrobras (Rev. 9, Out/2023):
   - Cores principais (obrigatorias): Verde #008542, Amarelo #FDC82F, Branco #FFFFFF
   - Cores de apoio: Verde agua #00B2A9, Verde claro #C4D600, Amarelo claro #EBFF00,
     Laranja #ED8B00, Azul escuro #006298, Azul claro #3DDAFF, Cinza #75787B
   - Tipografia: Trebuchet MS (fonte de apoio oficial, web-safe)
   - Gradiente linear verde->amarelo Petrobras (cor principal ocupa 60-70%)
*/
:root {
  /* Cores principais */
  --verde: #008542;
  --amarelo: #FDC82F;
  --branco: #FFFFFF;

  /* Cores de apoio */
  --verde-agua: #00B2A9;
  --verde-claro: #C4D600;
  --amarelo-claro: #EBFF00;
  --laranja: #ED8B00;
  --azul-escuro: #006298;
  --azul-claro: #3DDAFF;
  --cinza: #75787B;

  /* Tokens semanticos */
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F4F6F8;
  --text: #1A1A1A;
  --text-muted: #5C5C5C;
  --primary: var(--verde);
  --primary-2: #006B35;
  --primary-soft: #E6F4EC;
  --accent: var(--amarelo);
  --accent-2: #F0B800;
  --danger: #C0392B;
  --success: var(--verde);
  --border: #DDE2E6;
  --shadow: 0 1px 3px rgba(0, 0, 0, .10), 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .14);
  --radius: 10px;
  --radius-sm: 6px;
  --gradient: linear-gradient(90deg, var(--verde) 0%, var(--verde) 60%, var(--amarelo) 100%);
  --gradient-soft: linear-gradient(135deg, var(--verde) 0%, var(--verde) 65%, var(--amarelo) 100%);

  /* Tipografia */
  --font: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif;

  /* Cores por tipo de sessao (combina principal + apoio) */
  --type-break: var(--cinza);
  --type-talk: var(--verde);
  --type-workshop: var(--laranja);
  --type-panel: var(--azul-escuro);
}

/* Modo escuro: usa tons da propria paleta (azul escuro, cinza) - evita preto puro e cores fora da paleta */
[data-theme="dark"] {
  --bg: #0A1F2E;
  --surface: #112A3D;
  --surface-2: #1A3A52;
  --text: #F0F4F7;
  --text-muted: #A8B8C4;
  --primary: #2EAD6E;
  --primary-2: #4DC288;
  --primary-soft: #11352A;
  --accent: #FDC82F;
  --accent-2: #F0B800;
  --border: #2A4458;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55);
  --type-break: #8A9BA8;
  --type-talk: #2EAD6E;
  --type-workshop: #F5A623;
  --type-panel: #4DA3D8;
  --gradient: linear-gradient(90deg, #2EAD6E 0%, #2EAD6E 60%, var(--amarelo) 100%);
  --gradient-soft: linear-gradient(135deg, #2EAD6E 0%, #2EAD6E 65%, var(--amarelo) 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background .2s, color .2s;
  -webkit-font-smoothing: antialiased;
  -webkit-touch-callout: none;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

/* Touch: sem selecao de texto em elementos de UI */
button, .btn, .tab, .bn-item, .day-pill, .icon-btn, .fav-btn,
.modal-close, .vote-card, .session .time, .session .title,
.brand, .brand-text, .logo-mark, .badge, .tag, .sheet-handle {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Inputs: font-size >= 16px evita auto-zoom no iOS Safari */
input, textarea, select { font-size: 16px; }

/* ---- Topbar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--gradient);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--branco);
  border-radius: 50%;
  flex-shrink: 0;
}
.logo-mark svg { width: 28px; height: 28px; }
.brand-text h1 { margin: 0; font-size: 18px; font-weight: 700; color: var(--branco); letter-spacing: .01em; }
.brand-text p { margin: 0; font-size: 12px; color: rgba(255, 255, 255, .9); }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  color: var(--branco);
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.icon-btn:hover { background: rgba(255, 255, 255, .32); }
.icon-btn:active { transform: scale(.9); background: rgba(255, 255, 255, .4); }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 3px solid var(--verde);
  overflow-x: auto;
  position: sticky;
  top: 68px;
  z-index: 40;
}
.tab {
  flex: 1;
  min-width: 90px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: -3px;
}
.tab:hover { color: var(--verde); }
.tab.active { color: var(--verde); border-bottom-color: var(--amarelo); }
.tab:active { background: var(--primary-soft); }
.badge {
  background: var(--verde);
  color: var(--branco);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  font-weight: 700;
}
.badge:empty, .badge[data-zero] { opacity: .35; }

/* ---- Container ---- */
.container {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- Day selector ---- */
.day-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.day-pill {
  flex: 1;
  min-width: 140px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--verde);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: border-color .15s, background .15s, transform .1s;
}
.day-pill:hover { background: var(--primary-soft); border-left-color: var(--amarelo); }
.day-pill:active { transform: scale(.97); background: var(--primary-soft); }
.day-pill.active {
  background: var(--primary-soft);
  border-color: var(--verde);
  border-left-color: var(--amarelo);
}
.day-pill .day-num { font-size: 12px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.day-pill .day-title { font-size: 14px; font-weight: 700; margin-top: 2px; color: var(--text); }
.day-pill.active .day-num { color: var(--verde); }

/* ---- Day carousel (swipe entre dias, scroll-snap nativo) ---- */
.day-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.day-carousel::-webkit-scrollbar { display: none; }
.day-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 4px;
}

/* ---- Schedule cards ---- */
.schedule { display: flex; flex-direction: column; gap: 8px; }
.session {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--type-talk);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .1s;
}
.session:hover { box-shadow: var(--shadow-lg); }
.session:active { transform: scale(.99); }
.session.type-break { border-left-color: var(--type-break); background: var(--surface-2); }
.session.type-talk { border-left-color: var(--type-talk); }
.session.type-workshop { border-left-color: var(--type-workshop); }
.session.type-panel { border-left-color: var(--type-panel); }
.session.is-fav { box-shadow: var(--shadow); border-right: 4px solid var(--amarelo); }
.session .time {
  font-size: 13px;
  font-weight: 700;
  color: var(--verde);
}
.session .time .end { display: block; color: var(--text-muted); font-weight: 500; font-size: 11px; }
.session .body { min-width: 0; }
.session .title { font-weight: 700; font-size: 15px; margin: 0 0 4px; line-height: 1.35; }
.session .author { font-size: 13px; color: var(--text-muted); margin: 0; }
.session .author strong { color: var(--text); }
.session .meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tag.talk { background: var(--primary-soft); color: var(--verde); }
.tag.workshop { background: rgba(237, 139, 0, .12); color: var(--laranja); }
.tag.panel { background: rgba(0, 98, 152, .12); color: var(--azul-escuro); }
.tag.break { background: rgba(117, 120, 123, .14); color: var(--cinza); }
[data-theme="dark"] .tag.talk { background: rgba(46, 173, 110, .18); }
[data-theme="dark"] .tag.workshop { background: rgba(245, 166, 35, .18); }
[data-theme="dark"] .tag.panel { background: rgba(77, 163, 216, .18); }
.session .room { font-size: 12px; color: var(--text-muted); }
.session .abstract {
  font-size: 13px;
  color: var(--text-muted);
  margin: 8px 0 0;
  line-height: 1.5;
}
.session .actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.fav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--cinza);
  padding: 6px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.fav-btn:hover { background: var(--surface-2); color: var(--amarelo); }
.fav-btn.active { color: var(--amarelo); }
.fav-btn svg { display: block; }

/* ---- Voting / Avaliar status ---- */
.vote-status {
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--verde);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text);
}
.vote-status.closed { background: rgba(192, 57, 43, .08); color: var(--danger); border-left-color: var(--danger); }
.vote-status.voted { background: rgba(0, 133, 66, .1); color: var(--verde); border-left-color: var(--verde); }
.vote-list { display: flex; flex-direction: column; gap: 10px; }

/* ---- Vote card ---- */
.vote-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.vote-card:hover { border-color: var(--verde); }
.vote-card.selected {
  border-color: var(--verde);
  background: linear-gradient(0deg, rgba(0, 133, 66, .05), rgba(0, 133, 66, .05)), var(--surface);
}
.vote-radio {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  display: grid; place-items: center;
  transition: border-color .15s;
}
.vote-card:hover .vote-radio { border-color: var(--verde); }
.vote-card.selected .vote-radio { border-color: var(--verde); }
.vote-card.selected .vote-radio::after {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--verde);
}
.vote-card .vc-title { font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.vote-card .vc-author { font-size: 13px; color: var(--text-muted); margin: 0; }
.vote-card .vc-time { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.vote-card.disabled { opacity: .55; cursor: not-allowed; }

/* ---- Rate card ---- */
.rate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--verde);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.rate-card .rc-title { font-weight: 700; font-size: 15px; margin: 0 0 4px; line-height: 1.35; }
.rate-card .rc-author { font-size: 13px; color: var(--text-muted); margin: 0 0 8px; }
.rate-card .rc-time { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.rate-card.disabled .stars label { cursor: default; }

/* ---- Results ---- */
.results-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.results-head h2 { margin: 0; font-size: 18px; }
.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
}
.ghost-btn:hover { border-color: var(--verde); color: var(--verde); }
.results-list { display: flex; flex-direction: column; gap: 22px; }
.results-day h3 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 2px solid var(--amarelo); }
.results-day h3 .date { color: var(--text-muted); font-weight: 500; font-size: 13px; }
.result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  margin-bottom: 10px;
}
.result-row .rr-title { font-size: 13px; font-weight: 700; }
.result-row .rr-author { font-size: 12px; color: var(--text-muted); grid-column: 1; }
.result-row .rr-count { font-size: 13px; font-weight: 700; color: var(--verde); align-self: center; }
.result-row .rr-bar {
  grid-column: 1 / -1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.result-row .rr-bar > span {
  display: block;
  height: 100%;
  background: var(--gradient);
  border-radius: 4px;
  transition: width .5s ease;
}
.result-row.winner .rr-title::before { content: "\1F3C6 "; }
.result-row.winner .rr-bar > span { background: linear-gradient(90deg, var(--amarelo), var(--verde-claro)); }
.result-row.zero { opacity: .5; }
.results-empty { color: var(--text-muted); text-align: center; padding: 40px 0; }

/* ---- Empty state ---- */
.empty-state { color: var(--text-muted); text-align: center; padding: 40px 20px; font-size: 14px; }

/* ---- Star rating widget ---- */
.stars {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 2px;
  --star-color: #C9D1DC;
}
[data-theme="dark"] .stars { --star-color: #4A5A6A; }
.stars input { display: none; }
.stars label {
  cursor: pointer;
  color: var(--star-color);
  font-size: 26px;
  line-height: 1;
  transition: color .1s, transform .08s;
  padding: 2px;
}
.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label,
.stars input:focus-visible ~ label {
  color: var(--amarelo);
}
.stars label:hover, .stars label:active { transform: scale(1.12); }
.stars.readonly { pointer-events: none; }
.stars.readonly .filled { color: var(--amarelo); }

/* ---- Action buttons ---- */
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.btn:hover { border-color: var(--verde); color: var(--verde); }
.btn.primary { background: var(--verde); border-color: var(--verde); color: var(--branco); }
.btn.primary:hover { background: var(--primary-2); color: var(--branco); }
.btn svg { width: 15px; height: 15px; }
.btn.icon-only { padding: 7px; }
.btn.small { padding: 5px 8px; font-size: 11px; }

/* ---- Rate row ---- */
.rate-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rate-row .rate-meta { font-size: 12px; color: var(--text-muted); }
.rate-row .rate-meta strong { color: var(--text); }

/* ---- Result rows with stars ---- */
.result-row .rr-stars { color: var(--amarelo); font-size: 13px; letter-spacing: 1px; }
.result-row.zero .rr-stars { color: var(--text-muted); opacity: .4; }

/* ---- Modal ---- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 31, 46, .6); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 5px solid var(--verde);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: pop .2s ease;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-card-wide { max-width: 560px; text-align: left; }
.modal-card-wide h3 { margin: 0 0 4px; font-size: 19px; }
.modal-card-wide .wm-author { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }
.modal-card-wide .wm-abstract { font-size: 13px; color: var(--text-muted); margin: 12px 0; line-height: 1.55; }
.modal-card-wide .wm-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.modal-card-wide .wm-section { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.modal-card-wide .wm-section h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--verde); }
.modal-card-wide .wm-deeplink { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.modal-card-wide .wm-deeplink input {
  flex: 1; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-family: monospace;
}
.modal-card-wide .wm-qr { display: grid; place-items: center; margin: 8px 0; }
.modal-card-wide .wm-qr img, .modal-card-wide .wm-qr canvas {
  background: #fff; padding: 10px; border-radius: var(--radius-sm); max-width: 100%;
}
.wm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wm-actions .btn { flex: 1; min-width: 120px; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle {
  display: none;
  width: 40px; height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin: 0 auto 14px;
}
.modal-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; font-size: 26px;
  color: var(--text-muted); cursor: pointer; line-height: 1;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.modal-close:active { color: var(--text); }
.modal-card h3 { margin: 0 0 6px; font-size: 18px; }
.qr-target {
  display: grid; place-items: center;
  background: #fff; padding: 16px; border-radius: var(--radius-sm);
  margin: 12px auto; width: 220px; height: 220px;
}
.qr-target img, .qr-target canvas { max-width: 100%; height: auto; }
.muted { color: var(--text-muted); margin: 4px 0; }
.muted.small { font-size: 12px; word-break: break-all; }

/* ---- Bottom navigation (mobile) ---- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
  padding: 4px 0;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 60;
  justify-content: space-around;
}
.bn-item {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color .15s;
}
.bn-item:active { color: var(--verde); }
.bn-item.active { color: var(--verde); }
.bn-item.active svg { transform: scale(1.1); }
.bn-item svg { transition: transform .15s; }
.bn-item .badge {
  position: absolute;
  transform: translate(8px, -4px);
  font-size: 9px;
  padding: 0 5px;
  min-width: 15px;
  height: 15px;
  line-height: 15px;
  border-radius: 8px;
}
.bn-item span { display: inline-flex; align-items: center; }

/* ---- Pull-to-refresh indicator ---- */
.pull-indicator {
  position: fixed;
  top: calc(68px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--verde);
  box-shadow: var(--shadow);
  z-index: 45;
  opacity: 0;
  transition: transform .2s, opacity .2s;
  pointer-events: none;
}
.pull-indicator.visible { opacity: 1; }
.pull-indicator.spin svg { animation: spin .8s linear infinite; }
.pull-indicator.ready { color: var(--amarelo); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--verde);
  color: var(--branco);
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 200;
  max-width: 90vw;
  -webkit-tap-highlight-color: transparent;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: var(--branco); }
.toast.success { background: var(--verde); color: var(--branco); }

/* ---- Footer (hidden on mobile, replaced by bottom-nav) ---- */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 3px solid var(--verde);
  background: var(--surface);
}
.footer .dot { margin: 0 6px; }

/* ============================================================
   MOBILE FIRST — alvo: iPhone 15 (393x852pt) / Galaxy S25 (360x800dp)
   Em telas <= 768px: navegação inferior substitui tabs no topo
   ============================================================ */
@media (max-width: 768px) {
  /* Topbar compacto */
  .topbar { padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand-text h1 { font-size: 16px; }
  .brand-text p { font-size: 11px; }
  .logo-mark { width: 38px; height: 38px; }
  .logo-mark svg { width: 24px; height: 24px; }

  /* Esconde tabs do topo, mostra bottom-nav */
  .tabs-top { display: none; }
  .bottom-nav { display: flex; }

  /* Container com espaço para bottom-nav */
  .container {
    padding: 12px 12px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }

  /* Day selector: pílulas horizontais scrolláveis (swipe-friendly) */
  .day-selector {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 8px;
    margin: 0 -12px 14px;
    padding: 0 12px 4px;
    scrollbar-width: none;
  }
  .day-selector::-webkit-scrollbar { display: none; }
  .day-pill {
    min-width: 150px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }
  .day-pill:active { transform: scale(.96); }

  /* Sessões: layout compacto touch */
  .session {
    grid-template-columns: 52px 1fr;
    padding: 12px;
    gap: 10px;
  }
  .session .actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  .session .title { font-size: 14px; }
  .session .abstract { font-size: 12.5px; }

  /* Botões de ação: targets maiores */
  .btn { padding: 10px 14px; font-size: 12px; min-height: 40px; }
  .btn.small { padding: 8px 11px; font-size: 11px; min-height: 36px; }
  .btn svg { width: 16px; height: 16px; }
  .fav-btn { width: 44px; height: 44px; }

  /* Vote/rate cards touch */
  .vote-card { padding: 12px; min-height: 48px; }
  .vote-card:active { transform: scale(.98); }
  .rate-card { padding: 12px; }
  .rate-card:active { transform: scale(.99); }
  .stars label { font-size: 32px; padding: 4px; }

  /* Modal: bottom sheet full-width */
  .modal { padding: 0; place-items: flex-end; }
  .modal-card,
  .modal-card-wide {
    max-width: 100%;
    width: 100%;
    border-radius: 16px 16px 0 0;
    border-top: none;
    border-bottom: 5px solid var(--verde);
    padding: 16px 18px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
    max-height: 88vh;
    max-height: 88dvh;
    animation: slideUp .25s cubic-bezier(.32, .72, 0, 1);
  }
  .modal-card-wide { text-align: left; }
  .sheet-handle { display: block; }
  .modal-close {
    top: 10px; right: 8px;
    width: 40px; height: 40px;
    font-size: 28px;
  }
  .modal-backdrop { background: rgba(0, 31, 46, .55); }

  /* QR no modal: menor */
  .qr-target { width: 180px; height: 180px; padding: 12px; }

  /* Inputs maiores (sem auto-zoom iOS) */
  .modal-card-wide .wm-deeplink input { font-size: 13px; padding: 12px; }

  /* Results */
  .results-head h2 { font-size: 16px; }
  .ghost-btn { padding: 10px 16px; min-height: 40px; }

  /* Star labels maiores para touch */
  .stars label { font-size: 30px; }

  /* wm-actions empilhados */
  .wm-actions .btn { min-width: 100%; }
}

/* Telas muito estreitas (360px = Galaxy S25) */
@media (max-width: 380px) {
  .container { padding: 10px 10px; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .session { padding: 10px; grid-template-columns: 48px 1fr; gap: 8px; }
  .session .title { font-size: 13.5px; }
  .session .author { font-size: 12px; }
  .brand-text h1 { font-size: 15px; }
  .bn-item { font-size: 10px; }
  .bn-item svg { width: 22px; height: 22px; }
}

/* Landscape: ajusta bottom-nav e modais */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .modal { place-items: center; padding: 10px; }
  .modal-card, .modal-card-wide {
    max-height: 95vh;
    max-height: 95dvh;
    border-radius: var(--radius);
    border-bottom: none;
    border-top: 5px solid var(--verde);
    animation: pop .2s ease;
  }
  .sheet-handle { display: none; }
  .bottom-nav { padding-bottom: 4px; }
  .bn-item { min-height: 44px; padding: 6px 4px; }
}

/* Reduce motion: respeita preferencia do usuario */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- a11y: foco visivel ---- */
button:focus-visible, .vote-card:focus-visible, .day-pill:focus-visible, .btn:focus-visible, .stars input:focus-visible ~ label, .bn-item:focus-visible {
  outline: 2px solid var(--verde);
  outline-offset: 2px;
}
