* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f6f8fb;
  color: #33445c;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

/* ── HERO UNIFICADO (Estado Home) ── */
.hero {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: #ffffff;
}

.topbar {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  color: #ffffff;
  font-size: 15px;
  padding: 4px 0;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(10, 53, 120, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand strong { font-weight: 700; letter-spacing: 0.9px; font-size: 14.5px; }
.brand-sep { opacity: 0.45; font-weight: 300; }
.brand-sub { opacity: 0.92; font-weight: 400; }

.topbar-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar-link {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13.5px;
  font-weight: 500;
  padding: 4px 0;
  transition: color 0.15s;
}
.topbar-link:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero-center {
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 24px 48px;
  text-align: center;
}
.hero-title {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 22px;
  line-height: 1.25;
}

/* ── CAMPO DE BUSCA PROTAGONISTA ── */
.search-wrap {
  position: relative;
  max-width: 580px;
  margin: 0 auto;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 46px;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  color: #1a283b;
  font-size: 14.5px;
  box-shadow: 0 8px 24px rgba(13, 71, 161, 0.24);
  transition: box-shadow 0.15s;
}
.search-input::placeholder { color: #8898aa; }
.search-input:focus {
  outline: none;
  box-shadow: 0 8px 28px rgba(13, 71, 161, 0.34), 0 0 0 3px rgba(255, 255, 255, 0.35);
}
.search-kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid #dfe5ee;
  background: #f6f8fb;
  color: #8898aa;
  font-size: 12px;
  font-family: Consolas, monospace;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search-clear:hover {
  background: #eef2f7;
  color: #1a283b;
}

/* ── HEADER COMPACTO (Estado Tópico / Busca) ── */
.hero.compact {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(13, 71, 161, 0.16);
}
.hero.compact .topbar {
  max-width: 960px;
  padding: 12px 24px;
}
.hero.compact .hero-center { display: none; }
.compact-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.compact-search .search-input {
  height: 38px;
  font-size: 13.5px;
  padding: 0 38px 0 38px;
  border-radius: 8px;
  box-shadow: none;
}
.compact-search .search-icon { left: 12px; }
.compact-search .search-clear { right: 6px; width: 26px; height: 26px; }

/* ── CONTEÚDO PRINCIPAL ── */
main {
  flex: 1;
  width: 100%;
}

.home-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 24px 20px;
}

.reading-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 24px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-label {
  font-size: 13px;
  font-weight: 600;
  color: #5c6f88;
  letter-spacing: 0.1px;
}
.link-action {
  background: none;
  border: 0;
  color: #1a73e8;
  font-size: 13.5px;
  font-weight: 500;
  padding: 2px 0;
}
.link-action:hover {
  color: #0d47a1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── GRID 3×3 DE FERRAMENTAS ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  background: #ffffff;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  padding: 18px 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.tool-card:hover {
  border-color: #a8c7fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.08);
}
.tool-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e8f0fe;
  color: #1a73e8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tool-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a283b;
  margin-bottom: 3px;
  transition: color 0.15s;
}
.tool-card:hover .tool-title { color: #1a73e8; }
.tool-desc {
  font-size: 13px;
  color: #5c6f88;
  line-height: 1.4;
}

/* ── BLOCO DE FAQ ── */
.home-faq-block {
  margin-top: 44px;
}

.faq-surface {
  background: #ffffff;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid #edf1f7;
  position: relative;
}
.faq-item:last-child { border-bottom: 0; }
.faq-item.focused-anchor::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #1a73e8;
}

.faq-trigger {
  width: 100%;
  padding: 17px 20px;
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  transition: background 0.14s;
}
.faq-trigger:hover { background: #fafcff; }
.faq-trigger-text { min-width: 0; }

.faq-meta {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #1a73e8;
  margin-bottom: 3px;
}
.faq-question {
  font-size: 15px;
  font-weight: 500;
  color: #1a283b;
  line-height: 1.4;
}
.faq-item[data-open="true"] .faq-question {
  color: #0d47a1;
  font-weight: 600;
}

.faq-chevron {
  color: #8898aa;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.15s;
}
.faq-item[data-open="true"] .faq-chevron {
  transform: rotate(180deg);
  color: #1a73e8;
}

.faq-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}
.faq-item[data-open="true"] .faq-content {
  grid-template-rows: 1fr;
}
.faq-inner { overflow: hidden; }

.faq-body {
  padding: 0 20px 20px;
  font-size: 14px;
  line-height: 1.65;
  color: #33445c;
}
.faq-prose {
  max-width: 68ch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq-prose ul, .faq-prose ol {
  margin: 2px 0 2px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.faq-prose code, .modal-body code {
  font-family: Consolas, 'Cascadia Mono', monospace;
  font-size: 12.5px;
  background: #f0f4fa;
  color: #1558b0;
  padding: 1px 6px;
  border-radius: 4px;
}

.callout {
  margin-top: 4px;
  padding: 10px 14px;
  background: #f4f8ff;
  border-left: 3px solid #1a73e8;
  border-radius: 0 6px 6px 0;
  font-size: 13.5px;
  color: #1d3f72;
}

.faq-micro-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0f3f8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: #6b7c93;
}
.micro-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.micro-link {
  background: none;
  border: 0;
  color: #5c6f88;
  font-size: 12.5px;
  font-weight: 500;
  padding: 2px 0;
}
.micro-link:hover {
  color: #1a73e8;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.vote-done {
  color: #1558b0;
  font-weight: 500;
}

/* ── CABEÇALHO DE TÓPICO / BUSCA ── */
.topic-header {
  margin-bottom: 22px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  color: #1a73e8;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 12px;
  padding: 2px 0;
}
.back-link:hover {
  color: #0d47a1;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.topic-title {
  font-size: 24px;
  font-weight: 600;
  color: #1a283b;
  letter-spacing: -0.2px;
  line-height: 1.25;
}
.topic-subtitle {
  font-size: 13.5px;
  color: #5c6f88;
  margin-top: 4px;
}

.related-bar {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 13px;
  color: #6b7c93;
}
.related-link {
  background: none;
  border: 0;
  color: #1a73e8;
  font-size: 13px;
  font-weight: 500;
  padding: 2px 0;
}
.related-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── ESTADO VAZIO ── */
.empty-state {
  background: #ffffff;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  padding: 40px 24px;
  text-align: center;
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1a283b;
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 13.5px;
  color: #5c6f88;
  margin-bottom: 18px;
}
.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.btn-primary {
  padding: 9px 18px;
  border: 0;
  border-radius: 7px;
  background: #1a73e8;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-primary:hover { background: #1558b0; }

/* ── RODAPÉ MÍNIMO ── */
.footer {
  max-width: 920px;
  width: 100%;
  margin: 48px auto 0;
  padding: 20px 24px 28px;
  border-top: 1px solid #e3e8ef;
  font-size: 12.5px;
  color: #6b7c93;
}

/* ── MODAL DE NOVIDADES ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 46, 0.42);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}
.modal-overlay.visible { display: flex; }
.modal {
  background: #ffffff;
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 28, 46, 0.24);
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid #edf1f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.modal-head h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1a283b;
}
.modal-close {
  background: none;
  border: 0;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}
.modal-close:hover { background: #f0f3f8; color: #1a283b; }
.modal-body {
  padding: 18px 20px 22px;
  font-size: 13.5px;
  color: #33445c;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.release-item {
  padding-bottom: 16px;
  border-bottom: 1px solid #edf1f7;
}
.release-item:last-child { border-bottom: 0; padding-bottom: 0; }
.release-version {
  font-size: 14px;
  font-weight: 700;
  color: #1a73e8;
  margin-bottom: 6px;
}
.release-heading {
  font-size: 13.5px;
  font-weight: 600;
  color: #1a283b;
  margin: 8px 0 4px;
}
.release-list {
  margin-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1a283b;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(15, 28, 46, 0.22);
  display: none;
  z-index: 50;
}
.toast.visible { display: block; }

@media (max-width: 780px) {
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero.compact .topbar { flex-wrap: wrap; }
  .compact-search { order: 3; max-width: 100%; flex-basis: 100%; }
}
@media (max-width: 520px) {
  .tools-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 22px; }
}
