/* ==========================================================================
   WikiTek 3.0 — Folha de Estilos Oficial (Identidade Visual Teknisa)
   Cores oficiais: #040486, #03004F, #0800B7, #0051D0, #F2F6FB, #059E1E, #F4B800, #273138
   Tipografia: Poppins (títulos) e Roboto (corpo)
   ========================================================================== */

:root {
  --tk-primary: #040486;
  --tk-dark: #03004F;
  --tk-royal: #0800B7;
  --tk-light-bg: #F2F6FB;
  --tk-electric: #0051D0;
  --tk-green: #059E1E;
  --tk-yellow: #F4B800;
  --tk-text: #273138;
  --tk-muted: #5A6772;
  --tk-border: #D8E1EE;
  --tk-white: #FFFFFF;
  --tk-soft-blue: #E7ECFA;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

[hidden] {
  display: none !important;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: var(--tk-text);
  background-color: var(--tk-light-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.modal-is-open {
  overflow: hidden;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--tk-electric);
  outline-offset: 2px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 268px;
  background: var(--tk-white);
  border-right: 1px solid var(--tk-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 20;
}

.sidebar-brand {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--tk-border);
}

.sidebar-brand img {
  height: 28px;
  width: auto;
  display: block;
}

.sidebar-section {
  padding: 16px 14px 6px;
}

.sidebar-section-header {
  padding: 0 10px 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tk-primary);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--tk-text);
  font-family: 'Roboto', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-item:hover {
  background: var(--tk-light-bg);
}

.nav-item.active {
  background: var(--tk-soft-blue);
  color: var(--tk-primary);
  font-weight: 700;
}

.nav-item-onboarding {
  background: #FFFDF5;
  border-color: #F5DF98;
}

.nav-item-onboarding:hover {
  background: #FFF8DC;
}

.nav-item-onboarding.active {
  background: var(--tk-primary);
  border-color: var(--tk-primary);
  color: var(--tk-white);
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #B7C3D7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--tk-primary);
  flex-shrink: 0;
  background: var(--tk-white);
}

.nav-num-accent {
  border-color: var(--tk-yellow);
  color: #9A7200;
}

.nav-item.active .nav-num {
  background: var(--tk-primary);
  color: var(--tk-white);
  border-color: var(--tk-primary);
}

.nav-item-onboarding.active .nav-num {
  background: var(--tk-yellow);
  color: var(--tk-dark);
  border-color: var(--tk-yellow);
}

.nav-title {
  font-size: 13.5px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--tk-muted);
  background: var(--tk-light-bg);
  padding: 2px 7px;
  border-radius: 99px;
  flex-shrink: 0;
}

.nav-item.active .nav-count {
  background: var(--tk-white);
  color: var(--tk-primary);
}

.sidebar-tip {
  margin: auto 14px 16px;
  padding: 12px;
  background: var(--tk-light-bg);
  border: 1px solid var(--tk-border);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--tk-muted);
  line-height: 1.45;
}

.sidebar-tip kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--tk-primary);
  background: var(--tk-white);
  border: 1px solid #C5D1E0;
  border-radius: 4px;
}

.tip-dotted {
  border-bottom: 1.5px dotted var(--tk-electric);
  color: var(--tk-primary);
  font-weight: 500;
}

/* ---------- Área Principal ---------- */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hero-banner {
  background-color: var(--tk-primary);
  background-image:
    radial-gradient(circle at 88% 22%, rgba(8, 0, 183, 0.55) 0%, transparent 45%),
    linear-gradient(135deg, var(--tk-primary) 0%, var(--tk-dark) 100%);
  color: var(--tk-white);
  padding: 28px 44px 26px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-banner::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 240px;
  height: 240px;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.14) 22%, transparent 23%),
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 80px 80px, 40px 40px, 40px 40px;
  pointer-events: none;
  opacity: 0.7;
}

.hero-inner {
  max-width: 1140px;
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.hero-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-mobile-mark {
  display: none;
  flex-shrink: 0;
}

.hero-title {
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tk-white);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: 14.5px;
  color: rgba(242, 246, 251, 0.92);
  max-width: 680px;
}

.hero-logo-box {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.hero-logo-box img {
  height: 26px;
  width: auto;
  opacity: 0.96;
}

.content-wrapper {
  max-width: 1140px;
  width: 100%;
  padding: 20px 44px 96px;
}

/* ---------- Barra de Busca Sticky ---------- */
.search-sticky {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 0 10px;
  background: var(--tk-light-bg);
  border-bottom: 1px solid var(--tk-border);
  margin: -12px 0 14px;
}

.search-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 360px;
  max-width: 560px;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--tk-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 42px 10px 38px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: var(--tk-text);
  background: var(--tk-white);
  border: 1px solid #C5D1E0;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: var(--tk-primary);
  box-shadow: 0 0 0 3px rgba(4, 4, 134, 0.12);
}

.search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--tk-muted);
  background: var(--tk-light-bg);
  border: 1px solid #C5D1E0;
  border-radius: 4px;
  padding: 1px 6px;
  pointer-events: none;
}

.clear-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  color: var(--tk-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.clear-btn:hover {
  color: var(--tk-primary);
  background: var(--tk-light-bg);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.division-select {
  display: none;
  padding: 9px 10px;
  border: 1px solid #C5D1E0;
  border-radius: var(--radius-md);
  background: var(--tk-white);
  color: var(--tk-text);
  font: inherit;
  font-size: 13.5px;
}

.toolbar-pill {
  border: 1px solid #C5D1E0;
  background: var(--tk-white);
  color: var(--tk-primary);
  border-radius: var(--radius-md);
  padding: 9px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.toolbar-pill:hover {
  background: #F7F9FE;
  border-color: var(--tk-primary);
}

.toolbar-pill[aria-pressed="true"] {
  background: var(--tk-soft-blue);
  border-color: var(--tk-primary);
  font-weight: 700;
}

.mobile-only {
  display: none;
}

.terms-count {
  font-size: 13px;
  color: var(--tk-muted);
  font-weight: 500;
  margin-left: auto;
}

.active-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--tk-muted);
}

.active-filters button {
  border: 0;
  background: transparent;
  color: var(--tk-primary);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  padding: 2px 4px;
}

/* ---------- Mais consultados ---------- */
.quick-picks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12.5px;
}

.quick-picks-label {
  font-weight: 600;
  color: var(--tk-muted);
}

.quick-picks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-pick-btn {
  border: 1px dashed #B7C3D7;
  background: var(--tk-white);
  color: var(--tk-primary);
  border-radius: 999px;
  padding: 3px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
}

.quick-pick-btn:hover {
  border-style: solid;
  border-color: var(--tk-primary);
  background: var(--tk-soft-blue);
}

/* ---------- Filtros por Assunto (compactos) ---------- */
.chips-bar {
  margin-bottom: 12px;
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.chip {
  font-family: 'Roboto', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--tk-text);
  background: var(--tk-white);
  border: 1px solid #C5D1E0;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.14s ease;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-count {
  font-size: 11px;
  color: var(--tk-muted);
  font-weight: 400;
}

.chip:hover {
  border-color: var(--tk-primary);
  color: var(--tk-primary);
  background: #F7F9FE;
}

.chip.active {
  background: var(--tk-primary);
  color: var(--tk-white);
  border-color: var(--tk-primary);
  font-weight: 700;
}

.chip.active .chip-count {
  color: rgba(255, 255, 255, 0.82);
}

.chips-toggle-btn {
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--tk-electric);
  font-family: 'Roboto', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}

.chips-toggle-btn:hover {
  text-decoration: underline;
}

/* ---------- Barra Alfabética A-Z ---------- */
.alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 14px;
  padding: 6px 10px;
  background: var(--tk-white);
  border: 1px solid var(--tk-border);
  border-radius: var(--radius-md);
  align-items: center;
}

.alpha-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--tk-primary);
  margin-right: 6px;
  font-family: 'Poppins', sans-serif;
}

.alpha-btn {
  border: none;
  background: transparent;
  color: var(--tk-text);
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  font-weight: 500;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.alpha-btn:hover:not(:disabled) {
  background: var(--tk-soft-blue);
  color: var(--tk-primary);
}

.alpha-btn.active {
  background: var(--tk-primary);
  color: var(--tk-white);
  font-weight: 700;
}

.alpha-btn:disabled {
  color: #C5D1E0;
  cursor: default;
}

/* ---------- Avisos de Busca Inteligente ---------- */
.smart-feedback-bar {
  display: flex;
  background: #FFFDF5;
  border: 1px solid #F5DF98;
  border-left: 4px solid var(--tk-yellow);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  font-size: 13.5px;
  color: var(--tk-text);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.smart-link-btn {
  background: none;
  border: none;
  color: var(--tk-primary);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0 4px;
}

.btn-search-all-divs {
  background: var(--tk-primary);
  color: var(--tk-white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-search-all-divs:hover {
  background: var(--tk-electric);
}

/* ---------- Tabela do Glossário ---------- */
.table-card {
  background: var(--tk-white);
  border: 1px solid var(--tk-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(3, 0, 79, 0.04);
}

.glossary-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.glossary-table thead th {
  background-color: var(--tk-primary);
  color: var(--tk-white);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 18px;
  letter-spacing: 0.01em;
}

.glossary-table thead th:nth-child(1) { width: 24%; }
.glossary-table thead th:nth-child(2) { width: 18%; }
.glossary-table thead th:nth-child(3) { width: 58%; }

.glossary-table tbody tr {
  border-bottom: 1px solid var(--tk-border);
  transition: background-color 0.12s ease;
}

.glossary-table tbody tr:last-child {
  border-bottom: none;
}

.glossary-table tbody tr:hover {
  background-color: #F8FAFE;
}

.glossary-table tbody tr:focus {
  outline: 2px solid var(--tk-electric);
  outline-offset: -2px;
}

.glossary-table td {
  padding: 16px 18px;
  vertical-align: top;
  font-size: 14px;
  color: var(--tk-text);
  overflow-wrap: anywhere;
}

.term-header-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.btn-fav-inline {
  border: none;
  background: transparent;
  color: #9AA7B4;
  font-size: 16px;
  line-height: 1.25;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.12s ease, transform 0.12s ease;
}

.btn-fav-inline:hover {
  color: var(--tk-yellow);
  transform: scale(1.1);
}

.btn-fav-inline[aria-pressed="true"] {
  color: #D99B00;
}

.col-term-title {
  font-weight: 700;
  color: var(--tk-text);
  font-size: 14.5px;
  line-height: 1.35;
}

.term-aliases {
  font-size: 11.5px;
  color: var(--tk-muted);
  margin-top: 4px;
  padding-left: 24px;
}

.term-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding-left: 24px;
}

.div-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--tk-light-bg);
  color: var(--tk-primary);
  border: 1px solid #D5E0F2;
}

.col-subject {
  color: #46535E;
  font-size: 13px;
  font-weight: 500;
}

.col-meaning {
  line-height: 1.62;
}

/* ---------- Termos citados com pontinhos (Referência cruzada) ---------- */
.xref-term {
  display: inline;
  background: transparent;
  border: none;
  border-bottom: 1.5px dotted var(--tk-electric);
  color: var(--tk-primary);
  font: inherit;
  padding: 0 1px;
  cursor: help;
  border-radius: 2px;
  transition: background-color 0.12s ease;
}

.xref-term:hover,
.xref-term:focus-visible {
  background-color: var(--tk-soft-blue);
}

/* ---------- Telinha flutuante (Popover de referência cruzada) ---------- */
.xref-popover {
  position: fixed;
  z-index: 120;
  width: min(360px, calc(100vw - 24px));
  background: var(--tk-white);
  border: 1px solid #C5D1E0;
  border-top: 3px solid var(--tk-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(3, 0, 79, 0.18);
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--tk-text);
  line-height: 1.5;
}

.xref-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.xref-popover-title {
  font-family: 'Poppins', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--tk-primary);
  line-height: 1.25;
}

.xref-popover-meta {
  font-size: 11px;
  color: var(--tk-muted);
  margin-top: 2px;
}

.xref-popover-close {
  border: none;
  background: transparent;
  color: var(--tk-muted);
  font-size: 19px;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.xref-popover-close:hover {
  background: var(--tk-light-bg);
  color: var(--tk-primary);
}

.xref-popover-body {
  font-size: 13px;
  color: var(--tk-text);
  margin-bottom: 10px;
}

.xref-popover-foot {
  display: flex;
  justify-content: flex-end;
}

.xref-popover-goto {
  border: none;
  background: transparent;
  color: var(--tk-electric);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}

.xref-popover-goto:hover {
  text-decoration: underline;
}

/* ---------- Manuais (somente nome, sem páginas) ---------- */
.manuals-box {
  margin-top: 10px;
  padding: 8px 12px;
  background: #F7F9FC;
  border-left: 3px solid #B7C3D7;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: var(--tk-muted);
}

.manuals-title {
  font-weight: 700;
  color: #46535E;
  margin-bottom: 4px;
  font-size: 11.5px;
}

.manuals-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.manual-name {
  font-weight: 500;
  color: var(--tk-text);
}

.btn-toggle-manuals {
  background: none;
  border: none;
  color: var(--tk-primary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0 0;
  text-decoration: underline;
}

/* ---------- Barra de Ações Limpa ---------- */
.row-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-ai {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--tk-light-bg);
  color: var(--tk-primary);
  border: 1px solid #C5D1E0;
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.btn-ai:hover:not(:disabled) {
  background: var(--tk-soft-blue);
  border-color: var(--tk-primary);
}

.btn-ai:disabled {
  opacity: 0.65;
  cursor: wait;
}

.row-utils {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.btn-util {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--tk-muted);
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.btn-util:hover {
  background: var(--tk-light-bg);
  color: var(--tk-primary);
}

/* ---------- Caixa de Resposta da IA ---------- */
.ai-box {
  margin-top: 10px;
  padding: 11px 14px;
  background: #FFFDF5;
  border: 1px solid #F5DF98;
  border-left: 3px solid var(--tk-yellow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px;
  line-height: 1.58;
}

.ai-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ai-label {
  font-size: 11px;
  font-weight: 700;
  color: #5A6772;
}

.ai-close-btn {
  border: none;
  background: transparent;
  color: var(--tk-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.ai-close-btn:hover {
  background: rgba(4, 4, 134, 0.08);
  color: var(--tk-primary);
}

.ai-content p {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.ai-content p:last-child {
  margin-bottom: 0;
}

mark.hl {
  background-color: rgba(244, 184, 0, 0.32);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* ---------- Paginação e Estado Vazio ---------- */
.load-more {
  padding: 16px;
  text-align: center;
  border-top: 1px solid var(--tk-border);
}

.load-more p {
  font-size: 12px;
  color: var(--tk-muted);
  margin-bottom: 8px;
}

.load-more button {
  border: 1px solid #B7C3D7;
  background: var(--tk-light-bg);
  color: var(--tk-primary);
  border-radius: var(--radius-md);
  padding: 9px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.load-more button:hover {
  background: var(--tk-soft-blue);
  border-color: var(--tk-primary);
}

.empty-state {
  padding: 44px 24px;
  text-align: center;
  color: var(--tk-muted);
}

.empty-state h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  color: var(--tk-primary);
  margin-bottom: 8px;
}

.empty-actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.action-status {
  font-size: 13px;
  margin-top: 12px;
  color: var(--tk-primary);
  min-height: 20px;
}

.page-footer {
  margin-top: 14px;
  font-size: 12px;
  color: var(--tk-muted);
}

/* ---------- Botão Fixo e Modal de Sugestões ---------- */
.suggest-fab {
  position: fixed;
  bottom: 18px;
  right: 20px;
  z-index: 90;
  background: var(--tk-white);
  color: var(--tk-primary);
  border: 1px solid #B7C3D7;
  box-shadow: 0 4px 14px rgba(3, 0, 79, 0.14);
  border-radius: 999px;
  padding: 8px 15px;
  font-family: 'Roboto', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.suggest-fab:hover {
  background: var(--tk-primary);
  color: var(--tk-white);
  border-color: var(--tk-primary);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 0, 79, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 140;
  padding: 16px;
}

.modal-card {
  background: var(--tk-white);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 18px 44px rgba(3, 0, 79, 0.28);
  border-top: 4px solid var(--tk-primary);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.modal-head h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  color: var(--tk-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--tk-muted);
  cursor: pointer;
  min-width: 34px;
  min-height: 34px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--tk-light-bg);
  color: var(--tk-primary);
}

.modal-desc {
  font-size: 13.5px;
  color: var(--tk-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.suggest-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tk-text);
}

.form-row input,
.form-row select,
.form-row textarea {
  font-family: 'Roboto', sans-serif;
  font-size: 13.5px;
  color: var(--tk-text);
  background: var(--tk-white);
  border: 1px solid #C5D1E0;
  border-radius: var(--radius-md);
  padding: 9px 11px;
}

.form-row textarea {
  resize: vertical;
  min-height: 88px;
}

.form-feedback {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  line-height: 1.45;
}

.form-feedback.ok {
  background: #EDF9F0;
  border: 1px solid #B6E3C0;
  color: #0D5C1B;
}

.form-feedback.err {
  background: #FEF2F2;
  border: 1px solid #F5C2C2;
  color: #991B1B;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.btn-primary {
  background: var(--tk-primary);
  color: var(--tk-white);
  border: none;
  border-radius: var(--radius-md);
  padding: 9px 18px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
  background: var(--tk-electric);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-secondary {
  background: var(--tk-light-bg);
  color: var(--tk-text);
  border: 1px solid #C5D1E0;
  border-radius: var(--radius-md);
  padding: 9px 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #E5ECF6;
}

.no-script {
  padding: 16px;
  background: #FFFDF5;
}

/* ---------- Responsividade Mobile ---------- */
@media (max-width: 960px) {
  .sidebar {
    display: none;
  }
  .mobile-only {
    display: inline-flex;
  }
  .division-select {
    display: block;
    flex: 1 1 160px;
  }
  .hero-banner {
    padding: 14px 16px;
  }
  .hero-mobile-mark {
    display: block;
  }
  .hero-title {
    font-size: 18px;
    margin-bottom: 0;
  }
  .hero-subtitle,
  .hero-logo-box,
  .search-kbd {
    display: none;
  }
  .content-wrapper {
    padding: 12px 14px 92px;
  }
  .search-sticky {
    margin-top: 0;
    padding: 8px 0;
  }
  .search-input-wrap {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .toolbar-controls {
    width: 100%;
  }
  .terms-count {
    margin-left: 0;
    font-size: 12px;
  }
  .alpha-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .alpha-btn {
    flex-shrink: 0;
  }
  .glossary-table thead {
    display: none;
  }
  .glossary-table,
  .glossary-table tbody,
  .glossary-table tr,
  .glossary-table td {
    display: block;
    width: 100%;
  }
  .glossary-table tr {
    padding: 14px 14px;
  }
  .glossary-table td {
    padding: 3px 0;
  }
  .row-utils {
    margin-left: 0;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
