/* ── Reset ──────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

/* ── Splash Screen ──────────────────────────────────────────────── */
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-1);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  transition:
    transform 1.2s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#splash-screen.hidden .splash-content {
  transform: scale(0.95);
  opacity: 0;
}

.splash-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  animation: pulse 1.5s ease-in-out infinite;
}

.splash-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--fg-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --mono: "JetBrains Mono", "Fira Code", monospace;
  --sans: "Inter", system-ui, sans-serif;

  --r: 8px;
  --r-lg: 14px;
  --r-xl: 20px;

  --topbar-h: 38px;
  --spotlight-w: 640px;
  --drawer-max: 780px;
}

/* Tema Escuro (padrão) */
:root,
body[data-theme="dark"],
body[data-theme="auto"] {
  --bg: #0c0c0c;
  --bg-1: #111111;
  --bg-2: #161616;
  --bg-3: #1c1c1c;

  --border: #1f1f1f;
  --border-2: #2a2a2a;
  --border-3: #333333;

  --fg: #bebebe;
  --fg-2: #ffffff;
  --fg-3: #afafaf;

  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.1);
  --green-glow: rgba(74, 222, 128, 0.18);
  --green-bd: rgba(74, 222, 128, 0.25);

  --accent: #4ade80;

  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.1);
  --amber-bd: rgba(251, 191, 36, 0.22);

  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.1);
  --red-bd: rgba(248, 113, 113, 0.25);

  --violet: #a78bfa;
  --violet-dim: rgba(167, 139, 250, 0.1);
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.1);
}

/* Tema Claro */
body[data-theme="light"] {
  --bg: #e8e8e8;
  --bg-1: #d8d8d8;
  --bg-2: #c8c8c8;
  --bg-3: #b8b8b8;

  --border: #a0a0a0;
  --border-2: #888888;
  --border-3: #707070;

  --fg: #2a2a2a;
  --fg-2: #0f0f0f;
  --fg-3: #4a4a4a;

  --green: #2d8a3e;
  --green-dim: rgba(45, 138, 62, 0.12);
  --green-glow: rgba(45, 138, 62, 0.18);
  --green-bd: rgba(45, 138, 62, 0.3);

  --accent: #2d8a3e;

  --amber: #d68a00;
  --amber-dim: rgba(214, 138, 0, 0.12);
  --amber-bd: rgba(214, 138, 0, 0.3);

  --red: #c92a2a;
  --red-dim: rgba(201, 42, 42, 0.12);
  --red-bd: rgba(201, 42, 42, 0.3);

  --violet: #6741d9;
  --violet-dim: rgba(103, 65, 217, 0.12);
  --cyan: #0c8599;
  --cyan-dim: rgba(12, 133, 153, 0.12);
}

/* ── Base ───────────────────────────────────────────────────────── */
body {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: pan-y;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  padding-top: env(safe-area-inset-top, 0);
}

/* ── Topbar ─────────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--green-bd);
  user-select: none;
  z-index: 10;
}

/* Ocultar topbar em PWA standalone */
@media (display-mode: standalone) {
  #app {
    height: 100vh;
  }
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-logo {
  height: 36px;
  width: auto;
  margin-left: 2px;
  filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.3));
}

.topbar-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.5px;
  margin-left: 6px;
}

.topbar-title-dim {
  font-weight: 400;
  color: var(--fg-3);
}

.topbar-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: var(--r);
  padding: 2px 8px;
  letter-spacing: 1px;
}

/* ── Footer ─────────────────────────────────────────────────────── */
#app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  text-align: center;
  z-index: 5;
}

.footer-disclaimer {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--amber);
  margin: 0;
  letter-spacing: 0.3px;
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green-bd);
}

.user-name {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-2);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn-topbar {
  background: none;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 4px 8px;
  cursor: pointer;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  transition: all 120ms;
}

.logout-btn-topbar svg {
  width: 14px;
  height: 14px;
}

.logout-btn-topbar:hover {
  background: var(--red-dim);
  border-color: var(--red-bd);
  color: var(--red);
}

/* ── App ────────────────────────────────────────────────────────── */
#app {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── Spotlight ──────────────────────────────────────────────────── */
#spotlight {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px 120px;
}

#spotlight-inner {
  width: 100%;
  max-width: var(--spotlight-w);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Hero */
#spotlight-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
}

.hero-logo {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: var(--r-lg);
  box-shadow: 0 0 32px var(--green-glow);
  padding: 2px;
}

.hero-logo img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(74, 222, 128, 0.4));
}

.hero-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: var(--r-lg);
  color: var(--green);
  box-shadow: 0 0 32px var(--green-glow);
}

.hero-icon svg {
  width: 26px;
  height: 26px;
}

.hero-text {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  letter-spacing: 0.5px;
}

/* Search bar */
#search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  transition:
    border-color 150ms,
    box-shadow 150ms;
}

#search-wrap:focus-within {
  border-color: var(--green-bd);
  box-shadow:
    0 0 0 3px var(--green-dim),
    0 4px 24px rgba(0, 0, 0, 0.4);
}

.search-icon {
  color: var(--fg-3);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

#search {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--fg);
  caret-color: var(--green);
}

#search::placeholder {
  color: var(--fg-3);
}

#search-clear {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 4px;
  transition: color 120ms;
}

#search-clear:not([hidden]) {
  display: flex;
}

#search-clear:hover {
  color: var(--fg);
}

#search-clear svg {
  width: 14px;
  height: 14px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px;
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 6px;
  background: none;
  border: none;
  border-radius: calc(var(--r-lg) - 3px);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-3);
  transition:
    background 120ms,
    color 120ms;
  white-space: nowrap;
}

.tab svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.tab:hover {
  color: var(--fg-2);
}

.tab.active {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid var(--green-bd);
}

/* Results */
#results-wrap:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#list-meta {
  padding: 0 4px;
  display: flex;
  justify-content: start;
}

#list-meta .extras-header {
  justify-content: space-between;
}

#count {
  font-size: 11px;
  color: var(--fg-3);
}

/* Empty state */
#empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 0 0;
  color: var(--fg-3);
  font-size: 12px;
}

#empty-state svg {
  width: 14px;
  height: 14px;
}

#empty-state[hidden] {
  display: none;
}

/* ── Infraction list ────────────────────────────────────────────── */
#infraction-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#infraction-list li {
  border-radius: var(--r);
  cursor: pointer;
  transition: background 100ms;
  overflow: hidden;
  border: 1px solid transparent;
  position: relative;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.15);
  transform: scale(0);
  animation: ripple-anim 0.5s linear;
  pointer-events: none;
}

@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

#infraction-list li:hover {
  background: var(--bg-2);
  border-color: var(--border);
}

#infraction-list li.active {
  background: var(--green-dim);
  border-color: var(--green-bd);
}

.li-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.li-info {
  flex: 1;
  min-width: 0;
}

.li-code {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.li-art {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

.li-enq {
  font-size: 10px;
  font-weight: 500;
  color: var(--fg-3);
}

.li-tip {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-2);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.li-fav-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg-3);
  padding: 4px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  transition:
    color 120ms,
    transform 120ms;
}

.li-fav-btn svg {
  width: 13px;
  height: 13px;
}

.li-fav-btn:hover {
  color: var(--amber);
  transform: scale(1.2);
}

.li-fav-btn.active {
  color: var(--amber);
}

.li-fav-btn.active svg {
  fill: var(--amber);
}

.list-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--fg-3);
  font-size: 12px;
}

/* History */
.history-clear-row {
  padding: 2px 0 4px;
}

.history-clear-btn {
  background: none;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 6px 12px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--red);
  transition:
    background 120ms,
    border-color 120ms;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.history-clear-btn svg {
  width: 12px;
  height: 12px;
}

.history-clear-btn:hover {
  background: var(--red-dim);
  border-color: var(--red);
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--r);
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 120ms,
    border-color 120ms;
}

.history-item:hover {
  background: var(--bg-2);
  border-color: var(--border);
}

.history-item svg {
  width: 12px;
  height: 12px;
  color: var(--fg-3);
  flex-shrink: 0;
}

.history-query {
  flex: 1;
  font-size: 12px;
  color: var(--fg-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--fg-3);
  padding: 3px;
  border-radius: 4px;
  transition:
    color 120ms,
    background 120ms;
}

.history-remove svg {
  width: 11px;
  height: 11px;
}

.history-remove:hover {
  color: var(--red);
  background: var(--red-dim);
}

/* ── Detail view ────────────────────────────────────────────────── */
#detail-view {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-in 220ms ease;
}

#detail-view[hidden] {
  display: none;
}

#detail-view.slide-out {
  animation: slide-out 220ms ease forwards;
}

#detail-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}

#back-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
  transition:
    background 120ms,
    color 120ms,
    border-color 120ms;
}

#back-btn svg {
  width: 14px;
  height: 14px;
}

#back-btn:hover {
  background: var(--bg-3);
  color: var(--fg);
  border-color: var(--border-3);
}

#detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 48px;
}

#detail-body .ficha {
  max-width: 860px;
  margin: 0 auto;
}

@keyframes slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ── Ficha ──────────────────────────────────────────────────────── */
.ficha {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ficha-header {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}

.ficha-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green) 0%, transparent 70%);
}

.ficha-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.ficha-hero-left {
  flex: 1;
  min-width: 0;
}

.ficha-artigo {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: 4px;
  padding: 3px 10px;
  letter-spacing: 0.5px;
}

.ficha-tip {
  display: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--fg);
}

.ficha-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.ficha-code {
  font-family: var(--mono);
  font-size: 14px !important;
  font-weight: 600;
  color: #5a8a6a !important;
  letter-spacing: -0.5px;
  line-height: 1;
  text-shadow: none !important;
  opacity: 0.85;
}

.fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 5px 12px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-2);
  transition: all 120ms;
  white-space: nowrap;
}

.fav-btn svg {
  width: 13px;
  height: 13px;
}

.fav-btn:hover {
  border-color: var(--amber-bd);
  color: var(--amber);
  background: var(--amber-dim);
}

.fav-btn.active {
  border-color: var(--amber-bd);
  color: var(--amber);
  background: var(--amber-dim);
}

.fav-btn.active svg {
  fill: var(--amber);
}

.ficha-tipEnq {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-2);
  background: var(--bg-3);
  border-left: 2px solid var(--green);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 10px 14px;
  line-height: 1.65;
}

.keywords-display {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
}

.keywords-display-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.keywords-display-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--fg-3);
}

.btn-manage-keywords {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: var(--r);
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--green);
  transition: all 120ms;
}

.btn-manage-keywords svg {
  width: 11px;
  height: 11px;
}

.btn-manage-keywords:hover {
  background: var(--green-glow);
  border-color: var(--green);
}

.keywords-display-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  align-items: center;
}

.keyword-display-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--amber-dim);
  border: 1px solid var(--amber-bd);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 0.3px;
  transition: all 120ms;
}

.keyword-display-tag:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--amber);
}

.keyword-display-tag button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--amber);
  padding: 0;
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 120ms;
}

.keyword-display-tag button:hover {
  opacity: 1;
}

.empty-keywords-msg {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-3);
  font-style: italic;
}

.keyword-input-wrapper {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  animation: slideDown 200ms ease;
}

.keyword-input-wrapper[hidden] {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

.keyword-input-field {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  outline: none;
  transition: all 150ms;
}

.keyword-input-field:focus {
  border-color: var(--green-bd);
  box-shadow: 0 0 0 2px var(--green-dim);
}

.btn-add-keyword-inline,
.btn-cancel-keyword-inline {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 120ms;
}

.btn-add-keyword-inline svg,
.btn-cancel-keyword-inline svg {
  width: 14px;
  height: 14px;
}

.btn-add-keyword-inline {
  color: var(--green);
}

.btn-add-keyword-inline:hover {
  background: var(--green-dim);
  border-color: var(--green-bd);
}

.btn-cancel-keyword-inline {
  color: var(--fg-3);
}

.btn-cancel-keyword-inline:hover {
  background: var(--red-dim);
  border-color: var(--red-bd);
  color: var(--red);
}

/* ── Meta grid ──────────────────────────────────────────────────── */
.meta-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Faixas de prioridade */
.meta-row {
  display: grid;
  gap: 4px;
}

.meta-row-p1 {
  grid-template-columns: repeat(2, 1fr);
}

.meta-row-p2 {
  grid-template-columns: repeat(3, 1fr);
}

.meta-row-p3 {
  grid-template-columns: repeat(4, 1fr);
}

/* Base do card */
.meta-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: border-color 120ms;
  cursor: default;
}

.meta-item:hover {
  border-color: var(--green-bd);
}

.meta-label {
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--fg-3);
}

.meta-value {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}

/* P1 — destaque máximo */
.meta-item.p1 {
  padding: 14px 16px;
  border-color: var(--green-bd);
  background: var(--bg-3);
}

.meta-item.p1 .meta-label {
  font-size: 10px;
  color: var(--green);
  margin-bottom: 6px;
}

.meta-item.p1 .meta-value {
  font-size: 18px;
  color: var(--fg);
}

/* P2 — padrão */
.meta-item.p2 {
  padding: 10px 12px;
}

.meta-item.p2 .meta-label {
  font-size: 9px;
  margin-bottom: 4px;
}

.meta-item.p2 .meta-value {
  font-size: 12px;
}

/* P3 — secundário */
.meta-item.p3 {
  padding: 7px 10px;
  border-color: transparent;
  background: var(--bg-1);
}

.meta-item.p3 .meta-label {
  font-size: 8px;
  margin-bottom: 2px;
}

.meta-item.p3 .meta-value {
  font-size: 10px;
  color: var(--fg-3);
  font-weight: 500;
}

.meta-item.p3:hover {
  border-color: var(--border);
}

.meta-item.competencia .meta-value {
  font-family: var(--sans);
  font-weight: 400;
}

/* ── Badges ─────────────────────────────────────────────────────── */
.badge-sim,
.badge-nao,
.grav-gravissima,
.grav-grave,
.grav-media,
.grav-leve {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-sim {
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid var(--red-bd);
}

.badge-nao {
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
}

.crime-article {
  color: var(--red);
  font-weight: 700;
}

.crime-article[onclick] {
  cursor: pointer;
  transition: all 120ms;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.crime-article[onclick]:hover {
  color: var(--fg-2);
  background: var(--red-dim);
  padding: 2px 6px;
  border-radius: 4px;
}

.grav-gravissima {
  color: var(--violet);
  background: var(--violet-dim);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.grav-grave {
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid var(--red-bd);
}

.grav-media {
  color: var(--amber);
  background: var(--amber-dim);
  border: 1px solid var(--amber-bd);
}

.grav-leve {
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

/* ── Accordion sections ─────────────────────────────────────────── */
.section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 120ms;
}

.section:hover {
  border-color: var(--border-2);
}

.section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
  text-align: left;
  gap: 8px;
  transition:
    background 120ms,
    color 120ms;
}

.section-toggle:hover {
  background: var(--bg-3);
  color: var(--fg);
}

.section[open] .section-toggle {
  color: var(--fg);
  background: var(--bg-3);
}

.section-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-toggle-left svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.chevron {
  flex-shrink: 0;
  color: var(--fg-3);
  transition:
    transform 0.18s ease,
    color 120ms;
  display: flex;
  align-items: center;
}

.chevron svg {
  width: 13px;
  height: 13px;
}

.section[open] .chevron {
  transform: rotate(180deg);
  color: var(--green);
}

.section-body {
  display: none;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.section[open] .section-body {
  display: block;
}

.section.important {
  border-color: rgba(251, 191, 36, 0.15);
}

.section.important .section-toggle {
  color: var(--amber);
}

.section.important .section-toggle:hover,
.section.important[open] .section-toggle {
  background: var(--amber-dim);
}

.section.important .chevron {
  color: var(--amber);
}

.section.danger {
  border-color: var(--red-bd);
}

.section.danger .section-toggle {
  color: var(--red);
}

.section.danger .section-toggle:hover,
.section.danger[open] .section-toggle {
  background: var(--red-dim);
}

.section.danger .chevron {
  color: var(--red);
}

.section.danger[open] .chevron {
  color: var(--red);
}

/* ── Num list ───────────────────────────────────────────────────── */
.num-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.num-list li {
  display: flex;
  gap: 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--fg-2);
  line-height: 1.65;
  padding: 8px 10px;
  background: var(--bg-3);
  border-radius: var(--r);
  border-left: 2px solid var(--border-2);
  transition: border-color 120ms;
}

.num-list li:hover {
  border-left-color: var(--green);
}

.num-list li .num {
  flex-shrink: 0;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--green);
  min-width: 20px;
}

/* Subitens - Nível 2 (1.1) */
.num-list li.subitem {
  margin-left: 32px;
  background: var(--bg-2);
  border-left: 2px solid var(--border);
  padding: 6px 10px;
  font-size: 12px;
}

.num-list li.subitem .num {
  color: var(--amber);
  font-size: 11px;
  min-width: 28px;
}

.num-list li.subitem:hover {
  border-left-color: var(--amber);
}

/* Subitens - Nível 3 (1.1.1) */
.num-list li.subitem-2 {
  margin-left: 64px;
  background: var(--bg-1);
  border-left: 2px solid var(--border);
  padding: 5px 8px;
  font-size: 11.5px;
}

.num-list li.subitem-2 .num {
  color: var(--cyan);
  font-size: 10px;
  min-width: 32px;
}

.num-list li.subitem-2:hover {
  border-left-color: var(--cyan);
}

/* Subitens - Nível 4+ (1.1.1.1) */
.num-list li.subitem-3 {
  margin-left: 96px;
  background: var(--bg-1);
  border-left: 2px solid var(--border);
  padding: 4px 8px;
  font-size: 11px;
  opacity: 0.95;
}

.num-list li.subitem-3 .num {
  color: var(--violet);
  font-size: 10px;
  min-width: 36px;
}

.num-list li.subitem-3:hover {
  border-left-color: var(--violet);
  opacity: 1;
}

/* ── AIT list ───────────────────────────────────────────────────── */
.ait-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ait-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.65;
  transition: border-color 120ms;
}

.ait-item:hover {
  border-color: var(--green-bd);
}

.ait-num {
  flex-shrink: 0;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--green);
  min-width: 20px;
}

.ait-text {
  flex: 1;
  color: var(--fg-2);
}

.copy-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-3);
  transition: all 120ms;
}

.copy-btn svg {
  width: 12px;
  height: 12px;
}

.copy-btn:hover {
  background: var(--green-dim);
  color: var(--green);
  border-color: var(--green-bd);
}

.copy-btn.copied {
  background: var(--green-dim);
  color: var(--green);
  border-color: var(--green-bd);
}

.meta-item.multa .meta-value {
  color: var(--green);
}

.multa-mult {
  font-size: 10px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-dim);
  border: 1px solid var(--amber-bd);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}

.empty-msg {
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 12px;
  font-style: italic;
}

.section-text {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--fg-2);
  line-height: 1.65;
  padding: 8px 10px;
  background: var(--bg-3);
  border-radius: var(--r);
  border-left: 2px solid var(--border-2);
}

/* ── Scrollbar ──────────────────────────────────────────────────── */
/* NProgress */
#nprogress .bar {
  background: var(--green) !important;
  height: 2px !important;
}

#nprogress .peg {
  box-shadow:
    0 0 10px var(--green),
    0 0 5px var(--green) !important;
}

/* iziToast */
.iziToast {
  font-family: var(--mono) !important;
  font-size: 12px !important;
  border-radius: var(--r-lg) !important;
  background: var(--bg-2) !important;
  border: 1px solid var(--border-2) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

.iziToast > .iziToast-body .iziToast-message {
  color: var(--fg-2) !important;
}

.iziToast-color-green {
  border-color: var(--green-bd) !important;
}

.iziToast-color-green .iziToast-icon {
  color: var(--green) !important;
}

.iziToast-color-blue {
  border-color: rgba(34, 211, 238, 0.25) !important;
}

.iziToast-color-red {
  border-color: var(--red-bd) !important;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green-bd);
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 680px) {
  #spotlight {
    padding: 28px 12px 100px;
  }

  .hero-logo {
    width: 140px;
    height: 140px;
  }

  .hero-logo img {
    width: 130px;
    height: 130px;
  }

  .ficha-hero {
    flex-direction: row;
    gap: 10px;
    align-items: center;
  }

  .ficha-hero-left {
    flex: 1;
  }

  .ficha-hero-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .ficha-code {
    font-size: 18px;
  }

  .meta-row-p1 {
    grid-template-columns: repeat(2, 1fr);
  }

  .meta-row-p2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .meta-row-p3 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Topbar Mobile */
  #topbar {
    height: auto;
    min-height: var(--topbar-h);
    padding: 8px 12px;
  }

  .topbar-left {
    gap: 6px;
    flex: 1;
    min-width: 0;
  }

  .topbar-logo {
    height: 28px;
    margin-left: 0;
  }

  .topbar-title {
    font-size: 11px;
    margin-left: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-title-dim {
    display: none;
  }

  .topbar-badge {
    font-size: 9px;
    padding: 2px 6px;
    letter-spacing: 0.5px;
  }

  .footer-disclaimer {
    font-size: 9px;
  }

  .user-menu {
    gap: 6px;
  }

  .user-avatar {
    width: 24px;
    height: 24px;
    border-width: 1.5px;
  }

  .user-name {
    display: none;
  }

  .logout-btn-topbar {
    padding: 4px 6px;
  }

  .logout-btn-topbar svg {
    width: 13px;
    height: 13px;
  }
}

@media (max-width: 380px) {
  .meta-row-p1,
  .meta-row-p2,
  .meta-row-p3 {
    grid-template-columns: 1fr;
  }

  /* Topbar Extra Small */
  #topbar {
    padding: 6px 10px;
  }

  .topbar-logo {
    height: 24px;
  }

  .topbar-title {
    font-size: 10px;
    margin-left: 2px;
  }

  .topbar-badge {
    font-size: 8px;
    padding: 1px 5px;
  }

  .footer-disclaimer {
    font-size: 8px;
  }

  .user-avatar {
    width: 22px;
    height: 22px;
  }

  .logout-btn-topbar {
    padding: 3px 5px;
  }

  .logout-btn-topbar svg {
    width: 12px;
    height: 12px;
  }
}

/* ── Lists ──────────────────────────────────────────────────────── */
.li-badge {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: 4px;
  padding: 2px 8px;
}

.li-badge.badge-crime {
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid var(--red-bd);
}

.list-create-row {
  padding: 2px 0 4px;
  display: flex;
  gap: 4px;
}

.list-create-btn,
.list-import-btn {
  flex: 1;
  border-radius: var(--r);
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  transition: all 120ms;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.list-create-btn {
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  color: var(--green);
}

.list-create-btn svg {
  width: 13px;
  height: 13px;
}

.list-create-btn:hover {
  background: var(--green-glow);
  border-color: var(--green);
}

.list-import-btn {
  background: var(--cyan-dim);
  border: 1px solid rgba(34, 211, 238, 0.2);
  color: var(--cyan);
}

.list-import-btn svg {
  width: 13px;
  height: 13px;
}

.list-import-btn:hover {
  background: rgba(34, 211, 238, 0.15);
  border-color: var(--cyan);
}

.list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: all 120ms;
}

.list-card:hover {
  background: var(--bg-3);
  border-color: var(--border-2);
}

.list-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.list-card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: var(--r);
  color: var(--green);
  flex-shrink: 0;
}

.list-card-icon svg {
  width: 18px;
  height: 18px;
}

.list-card-info {
  flex: 1;
  min-width: 0;
}

.list-card-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  margin-bottom: 2px;
}

.list-card-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-3);
}

.list-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.list-edit-btn,
.list-delete-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 6px;
  cursor: pointer;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  transition: all 120ms;
}

.list-edit-btn svg,
.list-delete-btn svg {
  width: 13px;
  height: 13px;
}

.list-edit-btn:hover {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: var(--amber-bd);
}

.list-delete-btn:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red-bd);
}

.back-to-lists-btn {
  background: none;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms;
  margin-right: 12px;
}

.back-to-lists-btn svg {
  width: 12px;
  height: 12px;
}

.back-to-lists-btn:hover {
  background: var(--bg-3);
  border-color: var(--border-3);
}

.list-actions-group {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.list-action-btn {
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: var(--r);
  padding: 4px 8px;
  cursor: pointer;
  color: var(--green);
  display: flex;
  align-items: center;
  transition: all 120ms;
}

.list-action-btn svg {
  width: 14px;
  height: 14px;
}

.list-action-btn:hover {
  background: var(--green-glow);
  border-color: var(--green);
}

.li-remove-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg-3);
  padding: 4px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  transition: all 120ms;
}

.li-remove-btn svg {
  width: 14px;
  height: 14px;
}

.li-remove-btn:hover {
  color: var(--red);
  background: var(--red-dim);
}

.list-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: var(--r);
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  transition: all 120ms;
  white-space: nowrap;
}

.list-btn svg {
  width: 13px;
  height: 13px;
}

.list-btn:hover {
  background: var(--green-glow);
  border-color: var(--green);
}

/* ── Modal ──────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: modal-in 200ms ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}

.modal-header h3 {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-2);
  letter-spacing: 0.3px;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg-3);
  padding: 4px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  transition: all 120ms;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-close:hover {
  color: var(--red);
  background: var(--red-dim);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-form label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--green);
  margin-bottom: -8px;
}

.modal-form input {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  outline: none;
  transition: all 150ms;
}

.modal-form input:focus {
  border-color: var(--green-bd);
  box-shadow: 0 0 0 3px var(--green-dim);
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.icon-option {
  aspect-ratio: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 120ms;
}

.icon-option svg {
  width: 18px;
  height: 18px;
}

.icon-option:hover {
  background: var(--bg-1);
  border-color: var(--border-2);
  color: var(--fg);
}

.icon-option.active {
  background: var(--green-dim);
  border-color: var(--green-bd);
  color: var(--green);
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 9px 16px;
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  transition: all 120ms;
}

.btn-primary {
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  color: var(--green);
}

.btn-primary:hover {
  background: var(--green-glow);
  border-color: var(--green);
}

.btn-secondary {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--fg-2);
}

.btn-secondary:hover {
  background: var(--bg-1);
  border-color: var(--border-3);
}

.btn-danger {
  flex: 1;
  padding: 9px 16px;
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  transition: all 120ms;
  background: var(--red-dim);
  border: 1px solid var(--red-bd);
  color: var(--red);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.18);
  border-color: var(--red);
}

.modal-list-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-2);
  transition: all 120ms;
  width: 100%;
  text-align: left;
}

.list-select-item svg:first-child {
  width: 16px;
  height: 16px;
  color: var(--green);
  flex-shrink: 0;
}

.list-select-item span {
  flex: 1;
}

.list-select-item svg:last-child {
  width: 14px;
  height: 14px;
  color: var(--green);
  flex-shrink: 0;
}

.list-select-item:not([disabled]):hover {
  background: var(--green-dim);
  border-color: var(--green-bd);
  color: var(--green);
}

.list-select-item.active {
  background: var(--bg-1);
  border-color: var(--border-2);
  color: var(--fg-3);
  cursor: not-allowed;
}

/* ── Extras Tab ─────────────────────────────────────────────────── */
.extras-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.extras-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all 150ms;
  cursor: pointer;
}

.extras-card:hover {
  background: var(--bg-3);
  border-color: var(--green-bd);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.extras-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: var(--r-lg);
  color: var(--green);
  flex-shrink: 0;
}

.extras-card-icon svg {
  width: 24px;
  height: 24px;
}

.extras-card-content {
  flex: 1;
  min-width: 0;
}

.extras-card-content h3 {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-2);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.extras-card-content p {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.extras-card-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: var(--r);
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  transition: all 120ms;
  flex-shrink: 0;
  white-space: nowrap;
}

.extras-card-btn svg {
  width: 13px;
  height: 13px;
}

.extras-card-btn:hover {
  background: var(--green-glow);
  border-color: var(--green);
}

.extras-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.back-to-extras-btn {
  background: none;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms;
}

.back-to-extras-btn svg {
  width: 12px;
  height: 12px;
}

.back-to-extras-btn:hover {
  background: var(--bg-3);
  border-color: var(--border-3);
}

/* ── Quiz ───────────────────────────────────────────────────────── */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 12px 0;
}

.quiz-progress {
  height: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  transition: width 300ms ease;
  box-shadow: 0 0 12px var(--green-glow);
}

.quiz-question {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
}

.quiz-question h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-2);
  line-height: 1.6;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--fg-2);
  text-align: left;
  transition: all 150ms;
}

.quiz-option:hover:not(:disabled) {
  background: var(--bg-3);
  border-color: var(--green-bd);
  transform: translateX(4px);
}

.quiz-option:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.quiz-option-letter {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-3);
  flex-shrink: 0;
}

.quiz-option-text {
  flex: 1;
}

.quiz-option.correct {
  background: var(--green-dim);
  border-color: var(--green-bd);
  animation: pulse-correct 500ms ease;
}

.quiz-option.correct .quiz-option-letter {
  background: var(--green);
  color: var(--bg);
  border-color: var(--green);
}

.quiz-option.wrong {
  background: var(--red-dim);
  border-color: var(--red-bd);
  animation: shake 400ms ease;
}

.quiz-option.wrong .quiz-option-letter {
  background: var(--red);
  color: var(--bg);
  border-color: var(--red);
}

@keyframes pulse-correct {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

.quiz-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

.quiz-score svg {
  width: 16px;
  height: 16px;
}

/* Quiz Results */
.quiz-results {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 12px 0;
}

.quiz-results-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  text-align: center;
}

.quiz-results-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  animation: scale-in 400ms ease;
}

.quiz-results-icon svg {
  width: 40px;
  height: 40px;
}

.quiz-results-icon.grade-pass {
  background: var(--green-dim);
  border: 2px solid var(--green-bd);
  color: var(--green);
  box-shadow: 0 0 32px var(--green-glow);
}

.quiz-results-icon.grade-fail {
  background: var(--red-dim);
  border: 2px solid var(--red-bd);
  color: var(--red);
}

@keyframes scale-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.quiz-results-header h2 {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--fg-2);
}

.quiz-results-score {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--green);
}

.quiz-results-percentage {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--fg-3);
}

.quiz-results-actions {
  display: flex;
  gap: 10px;
}

.quiz-results-review {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-results-review h3 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 4px;
}

.quiz-review-item {
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.quiz-review-item.correct {
  border-color: var(--green-bd);
  background: var(--green-dim);
}

.quiz-review-item.wrong {
  border-color: var(--red-bd);
  background: var(--red-dim);
}

.quiz-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quiz-review-number {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--fg-3);
}

.quiz-review-item.correct .quiz-review-header svg {
  color: var(--green);
  width: 18px;
  height: 18px;
}

.quiz-review-item.wrong .quiz-review-header svg {
  color: var(--red);
  width: 18px;
  height: 18px;
}

.quiz-review-question {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--fg-2);
  margin-bottom: 8px;
  line-height: 1.5;
}

.quiz-review-answer,
.quiz-review-correct {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 6px;
}

.quiz-review-answer strong,
.quiz-review-correct strong {
  color: var(--fg-2);
}

/* ── Flashcards ─────────────────────────────────────────────────── */
.flashcard-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 12px 0;
}

.flashcard-progress {
  height: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.flashcard-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--violet));
  transition: width 300ms ease;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.3);
}

.flashcard {
  width: 100%;
  height: 320px;
  perspective: 1000px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 500ms;
  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  background: var(--bg-2);
  border: 2px solid var(--border-2);
  border-radius: var(--r-xl);
  text-align: center;
}

.flashcard-front {
  border-color: var(--green-bd);
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-3) 100%);
}

.flashcard-back {
  transform: rotateY(180deg);
  border-color: var(--amber-bd);
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--bg-2) 100%);
}

.flashcard-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-3);
}

.flashcard-code {
  font-family: var(--mono);
  font-size: 48px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -2px;
  text-shadow: 0 0 24px var(--green-glow);
}

.flashcard-art {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: var(--r);
  padding: 6px 14px;
}

.flashcard-description {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-2);
  line-height: 1.6;
  max-width: 90%;
}

.flashcard-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.flashcard-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.flashcard-badge.gravíssima {
  color: var(--violet);
  background: var(--violet-dim);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.flashcard-badge.grave {
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid var(--red-bd);
}

.flashcard-badge.média {
  color: var(--amber);
  background: var(--amber-dim);
  border: 1px solid var(--amber-bd);
}

.flashcard-badge.leve {
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.flashcard-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-3);
  font-style: italic;
  margin-top: 8px;
}

.flashcard-actions {
  display: flex;
  gap: 12px;
}

.flashcard-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--r-lg);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  transition: all 150ms;
}

.flashcard-btn svg {
  width: 16px;
  height: 16px;
}

.flashcard-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-unknown {
  background: var(--red-dim);
  border: 1px solid var(--red-bd);
  color: var(--red);
}

.btn-unknown:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.18);
  border-color: var(--red);
  transform: translateY(-2px);
}

.btn-known {
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  color: var(--green);
}

.btn-known:hover:not(:disabled) {
  background: var(--green-glow);
  border-color: var(--green);
  transform: translateY(-2px);
}

.flashcard-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.flashcard-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-2);
}

.flashcard-stat svg {
  width: 14px;
  height: 14px;
  color: var(--fg-3);
}

/* Flashcard Results */
.flashcard-results {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 12px 0;
}

.flashcard-results-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  text-align: center;
}

.flashcard-results-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--amber-dim);
  border: 2px solid var(--amber-bd);
  border-radius: 50%;
  color: var(--amber);
  animation: scale-in 400ms ease;
}

.flashcard-results-icon svg {
  width: 40px;
  height: 40px;
}

.flashcard-results-header h2 {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--fg-2);
}

.flashcard-results-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.flashcard-result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all 150ms;
}

.flashcard-result-stat:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
}

.flashcard-result-stat svg {
  width: 24px;
  height: 24px;
  color: var(--fg-3);
}

.flashcard-result-stat.success svg {
  color: var(--green);
}

.flashcard-result-stat.error svg {
  color: var(--red);
}

.stat-value {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--fg-2);
}

.stat-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--fg-3);
}

.flashcard-results-actions {
  display: flex;
  gap: 10px;
}

/* ── Configurações ──────────────────────────────────────────────── */
.config-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0;
}

.config-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.config-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

#feedback-section .config-section-header {
  justify-content: space-between;
}

.config-section-header svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.config-section-header h3 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 120ms;
}

.config-item:last-child {
  border-bottom: none;
}

.config-item:hover {
  background: var(--bg-3);
}

.config-item.danger {
  background: var(--red-dim);
  border-bottom-color: var(--red-bd);
}

.config-item.danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.config-item-info {
  flex: 1;
  min-width: 0;
}

.config-item-label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  margin-bottom: 2px;
}

.config-item-desc {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--fg-3);
  line-height: 1.4;
}

.config-item-control {
  flex-shrink: 0;
}

.config-select {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  cursor: pointer;
  outline: none;
  transition: all 120ms;
  min-width: 120px;
}

.config-select:hover {
  border-color: var(--green-bd);
}

.config-select:focus {
  border-color: var(--green-bd);
  box-shadow: 0 0 0 2px var(--green-dim);
}

.config-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.config-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.config-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 26px;
  transition: all 200ms;
}

.config-toggle-slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--fg-3);
  border-radius: 50%;
  transition: all 200ms;
}

.config-toggle input:checked + .config-toggle-slider {
  background: var(--green-dim);
  border-color: var(--green-bd);
}

.config-toggle input:checked + .config-toggle-slider:before {
  transform: translateX(22px);
  background: var(--green);
}

.config-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-2);
  transition: all 120ms;
}

.config-btn svg {
  width: 13px;
  height: 13px;
}

.config-btn:hover {
  background: var(--green-dim);
  border-color: var(--green-bd);
  color: var(--green);
}

.config-btn.danger {
  color: var(--red);
  background: rgba(248, 113, 113, 0.08);
  border-color: var(--red-bd);
}

.config-btn.danger:hover {
  background: var(--red-dim);
  border-color: var(--red);
}

.config-about {
  padding: 16px 18px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.6;
}

.config-about p {
  margin-bottom: 4px;
}

.config-about strong {
  color: var(--green);
  font-weight: 600;
}

/* Config Account */
.config-account {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.config-account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green-bd);
  flex-shrink: 0;
}

.config-account-info {
  flex: 1;
  min-width: 0;
}

.config-account-name {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-2);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-account-email {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clear-warning {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--red-dim);
  border: 1px solid var(--red-bd);
  border-radius: var(--r);
  color: var(--fg-2);
}

.clear-warning svg {
  width: 32px;
  height: 32px;
  color: var(--red);
  align-self: center;
}

.clear-warning p {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}

.clear-warning strong {
  color: var(--red);
  font-weight: 700;
}

.clear-warning ul {
  margin: 0;
  padding-left: 20px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.8;
}

.clear-warning li {
  color: var(--fg-3);
}

/* Tema e ajustes de fonte */
/* Fonte Pequena */
body[data-fontsize="small"] {
  font-size: 11px;
}

body[data-fontsize="small"] .hero-text {
  font-size: 11px;
}

body[data-fontsize="small"] #search {
  font-size: 13px;
}

body[data-fontsize="small"] .tab {
  font-size: 10px;
}

body[data-fontsize="small"] .li-art {
  font-size: 11px;
}

body[data-fontsize="small"] .li-enq {
  font-size: 9px;
}

body[data-fontsize="small"] .li-tip {
  font-size: 11px;
}

body[data-fontsize="small"] .ficha-tip {
  font-size: 12px;
}

body[data-fontsize="small"] .ficha-artigo {
  font-size: 15px;
}

body[data-fontsize="small"] .ficha-code {
  font-size: 12px !important;
}

body[data-fontsize="small"] .ficha-tipEnq {
  font-size: 11px;
}

body[data-fontsize="small"] .meta-item.p1 .meta-value {
  font-size: 16px;
}

body[data-fontsize="small"] .meta-item.p2 .meta-value {
  font-size: 11px;
}

body[data-fontsize="small"] .meta-item.p3 .meta-value {
  font-size: 9px;
}

body[data-fontsize="small"] .section-toggle {
  font-size: 11px;
}

body[data-fontsize="small"] .num-list li,
body[data-fontsize="small"] .ait-text {
  font-size: 11px;
}

body[data-fontsize="small"] .config-item-label {
  font-size: 12px;
}

body[data-fontsize="small"] .config-item-desc {
  font-size: 10px;
}

/* Fonte Grande */
body[data-fontsize="large"] {
  font-size: 15px;
}

body[data-fontsize="large"] .hero-text {
  font-size: 15px;
}

body[data-fontsize="large"] #search {
  font-size: 17px;
}

body[data-fontsize="large"] .tab {
  font-size: 12px;
}

body[data-fontsize="large"] .li-art {
  font-size: 14px;
}

body[data-fontsize="large"] .li-enq {
  font-size: 11px;
}

body[data-fontsize="large"] .li-tip {
  font-size: 14px;
}

body[data-fontsize="large"] .ficha-tip {
  font-size: 16px;
}

body[data-fontsize="large"] .ficha-artigo {
  font-size: 22px;
}

body[data-fontsize="large"] .ficha-code {
  font-size: 16px !important;
}

body[data-fontsize="large"] .ficha-tipEnq {
  font-size: 14px;
}

body[data-fontsize="large"] .meta-item.p1 .meta-label {
  font-size: 11px;
}

body[data-fontsize="large"] .meta-item.p1 .meta-value {
  font-size: 20px;
}

body[data-fontsize="large"] .meta-item.p2 .meta-label {
  font-size: 10px;
}

body[data-fontsize="large"] .meta-item.p2 .meta-value {
  font-size: 14px;
}

body[data-fontsize="large"] .meta-item.p3 .meta-label {
  font-size: 9px;
}

body[data-fontsize="large"] .meta-item.p3 .meta-value {
  font-size: 11px;
}

body[data-fontsize="large"] .section-toggle {
  font-size: 13px;
}

body[data-fontsize="large"] .num-list li,
body[data-fontsize="large"] .ait-text {
  font-size: 14px;
}

body[data-fontsize="large"] .config-item-label {
  font-size: 14px;
}

body[data-fontsize="large"] .config-item-desc {
  font-size: 12px;
}

body[data-fontsize="large"] .list-card-name {
  font-size: 14px;
}

body[data-fontsize="large"] .list-card-count {
  font-size: 11px;
}

body[data-fontsize="large"] #count {
  font-size: 12px;
}

body[data-fontsize="large"] .history-query {
  font-size: 13px;
}

body[data-fontsize="large"] .extras-card-content h3 {
  font-size: 15px;
}

body[data-fontsize="large"] .extras-card-content p {
  font-size: 13px;
}

body[data-fontsize="large"] .quiz-question h3 {
  font-size: 18px;
}

body[data-fontsize="large"] .quiz-option {
  font-size: 14px;
}

body[data-fontsize="large"] .flashcard-description {
  font-size: 18px;
}

/* Modo Compacto Desktop */
body[data-compact="true"] #spotlight {
  padding: 16px 12px 40px;
}

body[data-compact="true"] #spotlight-hero {
  padding-bottom: 2px;
  gap: 4px;
}

body[data-compact="true"] .hero-logo {
  width: 80px;
  height: 80px;
}

body[data-compact="true"] .hero-logo img {
  width: 72px;
  height: 72px;
}

body[data-compact="true"] .hero-text {
  font-size: 11px;
}

body[data-compact="true"] #spotlight-inner {
  gap: 8px;
}

body[data-compact="true"] #search-wrap {
  padding: 8px 12px;
}

body[data-compact="true"] .tab {
  padding: 5px 4px;
  font-size: 10px;
}

body[data-compact="true"] .li-row {
  padding: 6px 10px;
}

body[data-compact="true"] .config-item {
  padding: 10px 14px;
}

body[data-compact="true"] .meta-item.p1 {
  padding: 8px 10px;
}

body[data-compact="true"] .meta-item.p2 {
  padding: 6px 8px;
}

body[data-compact="true"] .meta-item.p3 {
  padding: 5px 7px;
}

body[data-compact="true"] .ficha-header {
  padding: 12px 14px 10px;
}

body[data-compact="true"] .section-toggle {
  padding: 8px 10px;
}

body[data-compact="true"] .section-body {
  padding: 8px 10px;
}

body[data-compact="true"] #detail-body {
  padding: 12px 14px 24px;
}

body[data-compact="true"] .ficha {
  gap: 6px;
}

body[data-compact="true"] .meta-grid {
  gap: 2px;
}

body[data-compact="true"] .meta-row {
  gap: 2px;
}

body[data-compact="true"] .extras-card {
  padding: 12px 14px;
  gap: 10px;
}

body[data-compact="true"] .extras-card-icon {
  width: 36px;
  height: 36px;
}

body[data-compact="true"] .extras-card-icon svg {
  width: 18px;
  height: 18px;
}

body[data-compact="true"] .list-card {
  padding: 8px 10px;
}

body[data-compact="true"] .list-card-icon {
  width: 28px;
  height: 28px;
}

body[data-compact="true"] .list-card-icon svg {
  width: 14px;
  height: 14px;
}

body[data-compact="true"] .history-item {
  padding: 6px 10px;
}

body[data-compact="true"] .num-list li {
  padding: 6px 8px;
}

body[data-compact="true"] .ait-item {
  padding: 7px 10px;
}

body[data-compact="true"] .ficha-hero {
  margin-bottom: 8px;
  gap: 12px;
}

body[data-compact="true"] .ficha-tipEnq {
  padding: 8px 12px;
}

body[data-compact="true"] .keywords-display {
  margin-top: 12px;
  padding: 12px 14px;
}

body[data-compact="true"] .modal-header {
  padding: 12px 14px;
}

body[data-compact="true"] .modal-body {
  padding: 14px;
}

body[data-compact="true"] .quiz-container,
body[data-compact="true"] .flashcard-container {
  gap: 12px;
  padding: 8px 0;
}

body[data-compact="true"] .quiz-question {
  padding: 16px;
}

body[data-compact="true"] .quiz-option {
  padding: 10px 14px;
}

body[data-compact="true"] .flashcard {
  height: 260px;
}

body[data-compact="true"] .flashcard-front,
body[data-compact="true"] .flashcard-back {
  padding: 24px;
  gap: 12px;
}

/* Modo Compacto Mobile */
@media (max-width: 680px) {
  body[data-compact="true"] #spotlight {
    padding: 16px 12px 60px;
  }

  body[data-compact="true"] #spotlight-hero {
    padding-bottom: 2px;
    gap: 4px;
  }

  body[data-compact="true"] .hero-logo {
    width: 64px;
    height: 64px;
  }

  body[data-compact="true"] .hero-logo img {
    width: 56px;
    height: 56px;
  }

  body[data-compact="true"] .hero-text {
    font-size: 11px;
  }

  body[data-compact="true"] #search-wrap {
    padding: 8px 12px;
  }

  body[data-compact="true"] .tab {
    padding: 5px 4px;
    font-size: 10px;
  }

  body[data-compact="true"] .li-row {
    padding: 6px 10px;
  }
}

@media (max-width: 380px) {
  body[data-compact="true"] #spotlight {
    padding: 12px 10px 60px;
  }

  body[data-compact="true"] .hero-logo {
    width: 56px;
    height: 56px;
  }

  body[data-compact="true"] .hero-logo img {
    width: 48px;
    height: 48px;
  }

  body[data-compact="true"] .hero-text {
    font-size: 10px;
  }
}

/* ── Responsive Extras ──────────────────────────────────────────── */
@media (max-width: 680px) {
  .list-create-row {
    flex-direction: column;
  }

  .list-create-btn,
  .list-import-btn {
    width: 100%;
  }

  .extras-card {
    flex-direction: column;
    text-align: center;
    padding: 14px 16px;
    gap: 12px;
  }

  .extras-card-icon {
    width: 42px;
    height: 42px;
  }

  .extras-card-icon svg {
    width: 20px;
    height: 20px;
  }

  .extras-card-content h3 {
    font-size: 13px;
    white-space: normal;
  }

  .extras-card-content p {
    font-size: 11px;
    -webkit-line-clamp: 3;
  }

  .extras-card-btn {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    font-size: 10px;
  }

  .extras-card-btn svg {
    width: 12px;
    height: 12px;
  }

  .flashcard {
    height: 280px;
  }

  .flashcard-code {
    font-size: 36px;
  }

  .flashcard-results-stats {
    grid-template-columns: 1fr;
  }

  .quiz-results-actions,
  .flashcard-results-actions {
    flex-direction: column;
  }

  .config-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .config-item-control {
    width: 100%;
  }

  .config-select {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .extras-card {
    padding: 12px 14px;
    gap: 10px;
  }

  .extras-card-icon {
    width: 36px;
    height: 36px;
  }

  .extras-card-icon svg {
    width: 18px;
    height: 18px;
  }

  .extras-card-content h3 {
    font-size: 12px;
  }

  .extras-card-content p {
    font-size: 10px;
  }

  .extras-card-btn {
    padding: 7px 10px;
    font-size: 9px;
  }

  .extras-card-btn svg {
    width: 11px;
    height: 11px;
  }
}

/* ── Crime CTB Popup ────────────────────────────────────────────── */
.crime-popup {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 200ms ease;
}

.crime-popup[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.crime-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
}

.crime-popup-content {
  position: relative;
  background: var(--bg-2);
  border: 2px solid var(--red-bd);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 24px 80px rgba(248, 113, 113, 0.3),
    0 0 0 1px var(--red-bd);
  animation: slideUp 250ms ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.crime-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--red-dim);
  border-bottom: 1px solid var(--red-bd);
}

.crime-popup-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.5px;
}

.crime-popup-title svg {
  width: 20px;
  height: 20px;
}

.crime-popup-close {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  cursor: pointer;
  color: var(--fg-3);
  padding: 6px;
  display: flex;
  align-items: center;
  transition: all 120ms;
}

.crime-popup-close svg {
  width: 18px;
  height: 18px;
}

.crime-popup-close:hover {
  color: var(--red);
  background: var(--red-dim);
  border-color: var(--red-bd);
}

.crime-popup-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.crime-article-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid var(--red-bd);
  border-radius: var(--r);
  padding: 6px 14px;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.crime-description {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.7;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-3);
  border-radius: var(--r-lg);
  border-left: 3px solid var(--red);
}

.crime-penas {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.crime-penas-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--red);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.crime-penas-label svg {
  width: 14px;
  height: 14px;
}

.crime-penas-text {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.6;
}

.crime-paragrafos {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crime-paragrafo {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  transition: border-color 120ms;
}

.crime-paragrafo:hover {
  border-color: var(--red-bd);
}

.crime-paragrafo-header {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 8px;
}

.crime-paragrafo-desc {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.6;
  margin-bottom: 10px;
}

.crime-incisos {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-left: 16px;
}

.crime-inciso {
  display: flex;
  gap: 10px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-2);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--bg-2);
  border-radius: var(--r);
  border-left: 2px solid var(--amber);
}

.crime-inciso-num {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--amber);
  flex-shrink: 0;
  min-width: 24px;
}

.crime-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 12px;
}

@media (max-width: 680px) {
  .crime-popup {
    padding: 12px;
  }

  .crime-popup-content {
    max-height: 90vh;
  }

  .crime-popup-body {
    padding: 18px;
  }

  .crime-description {
    font-size: 13px;
    padding: 14px;
  }
}

/* ── Custom Modals ──────────────────────────────────────────────── */
.custom-input {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg);
  outline: none;
  transition: all 150ms;
  width: 100%;
}

.custom-input:focus {
  border-color: var(--green-bd);
  box-shadow: 0 0 0 3px var(--green-dim);
}

.modal-message {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.6;
  margin-bottom: 4px;
}

.modal-message-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  text-align: center;
}

.modal-message-box svg {
  width: 48px;
  height: 48px;
  color: var(--fg-3);
}

.modal-message-box.info svg {
  color: var(--cyan);
}

.modal-message-box.success svg {
  color: var(--green);
}

.modal-message-box.warning svg {
  color: var(--amber);
}

.modal-message-box.error svg {
  color: var(--red);
}

.modal-message-box.danger {
  background: var(--red-dim);
  border-color: var(--red-bd);
}

.modal-message-box.danger svg {
  color: var(--red);
}

.modal-message-box p {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.6;
  margin: 0;
}

/* ── Share/Import ───────────────────────────────────────────────── */
.share-textarea,
.import-textarea {
  width: 100%;
  min-height: 180px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg);
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: all 150ms;
}

.share-textarea:focus,
.import-textarea:focus {
  border-color: var(--green-bd);
  box-shadow: 0 0 0 3px var(--green-dim);
}

.share-textarea {
  cursor: text;
  user-select: all;
}

.modal-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.modal-share-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-section-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--fg-2);
  margin: 0;
}

.modal-share-actions {
  display: flex;
  gap: 8px;
}

.btn-share,
.btn-import {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  transition: all 120ms;
}

.btn-share {
  background: var(--amber-dim);
  border: 1px solid var(--amber-bd);
  color: var(--amber);
}

.btn-share:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--amber);
}

.btn-share svg {
  width: 14px;
  height: 14px;
}

.btn-import {
  background: var(--cyan-dim);
  border: 1px solid rgba(34, 211, 238, 0.2);
  color: var(--cyan);
}

.btn-import:hover {
  background: rgba(34, 211, 238, 0.15);
  border-color: var(--cyan);
}

.btn-import svg {
  width: 14px;
  height: 14px;
}

#list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#list-meta.placas-meta {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

#list-meta.placas-meta .placas-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

#list-meta.placas-meta .placas-count {
  font-size: 11px;
  color: var(--fg-3);
}

#list-meta.placas-meta .placas-description {
  font-size: 11px;
  color: var(--fg-3);
  text-align: center;
  width: 100%;
}

#infraction-list .placas-description {
  font-size: 11px;
  color: var(--fg-3);
  text-align: center;
  margin-bottom: 8px;
}

/* ── Changelog ──────────────────────────────────────────────────── */
.changelog-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.changelog-version {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.changelog-version-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.changelog-version-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.changelog-version-number {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}

.changelog-version-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 4px;
}

.changelog-version-badge.release {
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  color: var(--green);
}

.changelog-version-badge.update {
  background: var(--amber-dim);
  border: 1px solid var(--amber-bd);
  color: var(--amber);
}

.changelog-version-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-3);
}

.changelog-version-body {
  padding: 18px;
}

.changelog-category {
  margin-bottom: 20px;
}

.changelog-category:last-child {
  margin-bottom: 0;
}

.changelog-category-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--green);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.changelog-category-title svg {
  width: 13px;
  height: 13px;
}

.changelog-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.changelog-item {
  display: flex;
  gap: 10px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-2);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--bg-1);
  border-radius: var(--r);
  border-left: 2px solid var(--border-2);
  transition: border-color 120ms;
}

.changelog-item:hover {
  border-left-color: var(--green);
}

.changelog-item:before {
  content: "•";
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Placas Grid ────────────────────────────────────────────────── */
.placas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 8px 0;
}

.placa-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all 150ms;
  min-height: 240px;
}

.placa-card.has-infracoes {
  cursor: pointer;
}

.placa-card.has-infracoes:hover {
  background: var(--bg-3);
  border-color: var(--green-bd);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.placa-codigo {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg-2);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.placa-img {
  width: 100%;
  height: auto;
  max-width: 120px;
  object-fit: contain;
  border-radius: var(--r);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.placa-nome {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-2);
  text-align: center;
  line-height: 1.4;
  margin-bottom: auto;
  padding: 0 4px;
}

.placa-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: 4px;
  padding: 4px 12px;
  letter-spacing: 0.3px;
  margin-top: 12px;
}

.back-to-placas-btn {
  background: none;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms;
  margin-right: 12px;
}

.back-to-placas-btn svg {
  width: 12px;
  height: 12px;
}

.back-to-placas-btn:hover {
  background: var(--bg-3);
  border-color: var(--border-3);
}

@media (max-width: 680px) {
  .placas-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .placa-card {
    padding: 12px;
    min-height: 220px;
  }

  .placa-codigo {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .placa-img {
    max-width: 100px;
    margin-bottom: 10px;
  }

  .placa-nome {
    font-size: 10px;
  }

  .placa-badge {
    margin-top: 10px;
  }
}

@media (max-width: 380px) {
  .placas-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .placa-card {
    padding: 10px;
    min-height: 200px;
  }

  .placa-codigo {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .placa-img {
    max-width: 80px;
    margin-bottom: 8px;
  }

  .placa-nome {
    font-size: 9px;
  }

  .placa-badge {
    font-size: 9px;
    padding: 3px 10px;
    margin-top: 8px;
  }
}

/* ── Placa Popup ────────────────────────────────────────────────── */
.placa-popup {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 200ms ease;
}

.placa-popup[hidden] {
  display: none;
}

.placa-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
}

.placa-popup-content {
  position: relative;
  background: var(--bg-2);
  border: 2px solid var(--green-bd);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 24px 80px rgba(74, 222, 128, 0.3),
    0 0 0 1px var(--green-bd);
  animation: slideUp 250ms ease;
}

.placa-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--green-dim);
  border-bottom: 1px solid var(--green-bd);
}

.placa-popup-title {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.5px;
}

.placa-popup-close {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  cursor: pointer;
  color: var(--fg-3);
  padding: 6px;
  display: flex;
  align-items: center;
  transition: all 120ms;
}

.placa-popup-close svg {
  width: 18px;
  height: 18px;
}

.placa-popup-close:hover {
  color: var(--red);
  background: var(--red-dim);
  border-color: var(--red-bd);
}

.placa-popup-body {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.placa-popup-img {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.placa-popup-description {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-2);
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 680px) {
  .placa-popup {
    padding: 12px;
  }

  .placa-popup-content {
    max-width: 100%;
  }

  .placa-popup-body {
    padding: 24px 18px;
  }

  .placa-popup-img {
    max-width: 160px;
  }

  .placa-popup-description {
    font-size: 14px;
  }
}

/* ── Placa Links ────────────────────────────────────────────────── */
.placa-link {
  color: var(--green);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  transition: all 120ms;
  padding: 2px 4px;
  border-radius: 3px;
}

.placa-link:hover {
  color: var(--fg-2);
  background: var(--green-dim);
  text-decoration: none;
}

/* ── Update Modal ───────────────────────────────────────────────── */
.update-modal .modal-content {
  max-width: 560px;
  max-height: 90vh;
}

.update-modal-header {
  background: var(--green-dim);
  border-bottom: 2px solid var(--green-bd);
}

.update-modal-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.update-modal-header-content svg {
  width: 32px;
  height: 32px;
  color: var(--green);
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }

  50% {
    transform: scale(1.1) rotate(5deg);
    opacity: 0.8;
  }
}

.update-modal-version {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.update-modal-version-number {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.5px;
}

.update-modal-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.update-modal-description {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.6;
}

.update-modal-description p {
  margin: 0 0 8px 0;
}

.update-modal-description p:last-child {
  margin-bottom: 0;
}

.update-modal-changelog {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Scrollbar personalizada para changelog */
.update-modal-changelog::-webkit-scrollbar {
  width: 6px;
}

.update-modal-changelog::-webkit-scrollbar-track {
  background: var(--bg-2);
  border-radius: 3px;
}

.update-modal-changelog::-webkit-scrollbar-thumb {
  background: var(--fg-3);
  border-radius: 3px;
}

.update-modal-changelog::-webkit-scrollbar-thumb:hover {
  background: var(--fg-2);
}

.update-modal-changelog h4 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--green);
  margin: 0 0 14px 0;
}

/* Bloco de versão individual */
.update-version-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.update-version-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.update-version-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.update-version-badge {
  background: var(--accent);
  color: var(--bg);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.update-version-title {
  font-weight: 600;
  color: var(--fg-1);
  font-size: 1rem;
}

.update-category {
  margin-bottom: 16px;
}

.update-category:last-child {
  margin-bottom: 0;
}

.update-category-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--amber);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.update-category-title svg {
  width: 13px;
  height: 13px;
}

.update-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.update-list li {
  display: flex;
  gap: 10px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-2);
  line-height: 1.6;
  padding: 6px 10px;
  background: var(--bg-2);
  border-radius: var(--r);
  border-left: 2px solid var(--border-2);
  transition: border-color 120ms;
}

.update-list li:hover {
  border-left-color: var(--green);
}

.update-list li:before {
  content: "•";
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}

.update-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.update-modal-actions .btn-primary,
.update-modal-actions .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.update-modal-actions svg {
  width: 14px;
  height: 14px;
}

.update-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 20px;
}

.update-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.update-loading p {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-2);
  margin: 0;
}

@media (max-width: 680px) {
  .update-modal .modal-content {
    max-width: 100%;
    max-height: 95vh;
  }

  .update-modal-header-content svg {
    width: 28px;
    height: 28px;
  }

  .update-modal-version {
    font-size: 12px;
  }

  .update-modal-version-number {
    font-size: 20px;
  }

  .update-modal-actions {
    flex-direction: column;
  }
}

/* ── Feedback Form ──────────────────────────────────────────────── */
.feedback-form {
  display: flex;
  flex-direction: column;
}

/* Feedback Section Toggle */
#feedback-section .config-section-header {
  cursor: pointer;
}

.config-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-section-chevron {
  width: 16px;
  height: 16px;
  color: var(--fg-3);
  transition:
    transform 200ms ease,
    color 120ms;
}

#feedback-section.expanded .config-section-chevron {
  transform: rotate(180deg);
  color: var(--green);
}

.config-section-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 300ms ease,
    opacity 200ms ease;
}

#feedback-section.expanded .config-section-content {
  max-height: 2000px;
  opacity: 1;
}

.feedback-input-wrapper {
  width: 100%;
  max-width: 280px;
}

.feedback-input,
.feedback-select {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  outline: none;
  transition: all 150ms;
}

.feedback-input:focus,
.feedback-select:focus {
  border-color: var(--green-bd);
  box-shadow: 0 0 0 2px var(--green-dim);
}

.feedback-input::placeholder {
  color: var(--fg-3);
  font-size: 11px;
}

.feedback-select {
  cursor: pointer;
}

.feedback-message-item {
  flex-direction: column;
  align-items: flex-start !important;
  gap: 12px !important;
}

.feedback-textarea-wrapper {
  width: 100%;
  position: relative;
}

.feedback-textarea {
  width: 100%;
  min-height: 120px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: all 150ms;
}

.feedback-textarea:focus {
  border-color: var(--green-bd);
  box-shadow: 0 0 0 2px var(--green-dim);
}

.feedback-textarea::placeholder {
  color: var(--fg-3);
  font-size: 11px;
}

.feedback-counter {
  text-align: right;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-3);
  margin-top: 4px;
  letter-spacing: 0.3px;
}

.feedback-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green-dim);
  border: 1px solid var(--green-bd);
  border-radius: var(--r);
  padding: 12px 20px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  transition: all 150ms;
}

.feedback-submit-btn svg {
  width: 14px;
  height: 14px;
}

.feedback-submit-btn:hover:not(:disabled) {
  background: var(--green-glow);
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--green-glow);
}

.feedback-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.feedback-result {
  padding: 14px 16px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 12px;
  animation: slideDown 300ms ease;
}

.feedback-result svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.feedback-result.success {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid var(--green-bd);
}

.feedback-result.error {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red-bd);
}

.hidden {
  display: none !important;
}

@media (max-width: 680px) {
  .config-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .feedback-input-wrapper {
    max-width: 100%;
  }

  .feedback-submit-btn {
    padding: 10px 16px;
    font-size: 11px;
  }
}

/* ── Política de Privacidade ────────────────────────────────────── */
.privacy-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}

.privacy-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 32px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
}

.privacy-header .hero-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--green-dim);
  border: 2px solid var(--green-bd);
  color: var(--green);
  box-shadow: 0 0 24px var(--green-glow);
}

.privacy-header h1 {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--fg-2);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.privacy-subtitle {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-3);
  margin: 0;
}

.privacy-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.privacy-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: border-color 120ms;
}

.privacy-section:hover {
  border-color: var(--border-2);
}

.privacy-section h2 {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
  margin: 0 0 16px 0;
  letter-spacing: 0.3px;
}

.privacy-section h3 {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-2);
  margin: 20px 0 12px 0;
  letter-spacing: 0.2px;
}

.privacy-section p {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.7;
  margin: 0 0 16px 0;
}

.privacy-section p:last-child {
  margin-bottom: 0;
}

.privacy-section ul {
  list-style: none;
  margin: 0 0 16px 0;
  padding: 0;
}

.privacy-section ul:last-child {
  margin-bottom: 0;
}

.privacy-section li {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.7;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--bg-3);
  border-radius: var(--r);
  border-left: 3px solid var(--green-bd);
  position: relative;
  padding-left: 32px;
}

.privacy-section li:before {
  content: "•";
  color: var(--green);
  font-weight: 700;
  position: absolute;
  left: 16px;
  top: 8px;
}

.privacy-section li:last-child {
  margin-bottom: 0;
}

.privacy-section strong {
  color: var(--green);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 680px) {
  .privacy-container {
    padding: 12px 0;
  }

  .privacy-header {
    padding: 24px 16px;
    margin-bottom: 24px;
  }

  .privacy-header .hero-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
  }

  .privacy-header h1 {
    font-size: 22px;
  }

  .privacy-section {
    padding: 18px;
  }

  .privacy-section h2 {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .privacy-section h3 {
    font-size: 13px;
    margin: 16px 0 10px 0;
  }

  .privacy-section p,
  .privacy-section li {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .privacy-header {
    padding: 20px 12px;
  }

  .privacy-header .hero-icon {
    width: 56px;
    height: 56px;
  }

  .privacy-header h1 {
    font-size: 20px;
  }

  .privacy-section {
    padding: 16px;
  }

  .privacy-section h2 {
    font-size: 15px;
  }
}
/* ── Política de Privacidade Modal ──────────────────────────────── */
.privacy-modal-content {
  max-height: 70vh;
  overflow-y: auto;
}

.privacy-modal-header {
  text-align: center;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-3);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-2);
}

.privacy-subtitle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-3);
  margin: 0;
  letter-spacing: 0.5px;
}

.privacy-modal-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.privacy-modal-section {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  transition: border-color 120ms;
}

.privacy-modal-section:hover {
  border-color: var(--border-2);
}

.privacy-modal-section h3 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  margin: 0 0 12px 0;
  letter-spacing: 0.3px;
}

.privacy-modal-section h4 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
  margin: 16px 0 8px 0;
  letter-spacing: 0.2px;
}

.privacy-modal-section h4:first-of-type {
  margin-top: 8px;
}

.privacy-modal-section p {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-2);
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.privacy-modal-section p:last-child {
  margin-bottom: 0;
}

.privacy-modal-section ul {
  list-style: none;
  margin: 0 0 12px 0;
  padding: 0;
}

.privacy-modal-section ul:last-child {
  margin-bottom: 0;
}

.privacy-modal-section li {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-2);
  line-height: 1.6;
  margin-bottom: 6px;
  padding: 6px 10px;
  background: var(--bg-2);
  border-radius: var(--r);
  border-left: 2px solid var(--green-bd);
  position: relative;
  padding-left: 24px;
}

.privacy-modal-section li:before {
  content: "•";
  color: var(--green);
  font-weight: 700;
  position: absolute;
  left: 12px;
  top: 6px;
}

.privacy-modal-section li:last-child {
  margin-bottom: 0;
}

.privacy-modal-section strong {
  color: var(--green);
  font-weight: 600;
}

.privacy-modal-section a,
.privacy-source-link {
  color: var(--green) !important;
  text-decoration: none !important;
  border-bottom: 1px dotted var(--green-bd) !important;
  transition: all 120ms !important;
}

.privacy-modal-section a:hover,
.privacy-source-link:hover {
  color: var(--fg-2) !important;
  background: var(--green-dim) !important;
  border-bottom-color: var(--green) !important;
  padding: 2px 4px !important;
  border-radius: 4px !important;
}

/* Responsive para modal */
@media (max-width: 680px) {
  .privacy-modal-content {
    max-height: 75vh;
  }

  .privacy-modal-section {
    padding: 12px;
  }

  .privacy-modal-section h3 {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .privacy-modal-section h4 {
    font-size: 11px;
    margin: 12px 0 6px 0;
  }

  .privacy-modal-section p,
  .privacy-modal-section li {
    font-size: 11px;
  }

  .privacy-modal-section li {
    padding: 5px 8px 5px 20px;
  }

  .privacy-modal-section li:before {
    left: 10px;
    top: 5px;
  }
}

/* ── Palavras-chave padrão ──────────────────────────────────────── */
.keyword-display-tag.default-keyword {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.keyword-display-tag.default-keyword:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: #60a5fa;
}

.keyword-display-tag.default-keyword button {
  color: #60a5fa;
}

.default-badge {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-left: 4px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ── Crime Navigation Controls ──────────────────────────────────── */
.crime-nav-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
}

.crime-nav-controls[hidden] {
  display: none !important;
}

.crime-nav-btn {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 8px;
  cursor: pointer;
  color: var(--fg-2);
  display: flex;
  align-items: center;
  transition: all 120ms;
}

.crime-nav-btn svg {
  width: 18px;
  height: 18px;
}

.crime-nav-btn:hover {
  background: var(--green-dim);
  border-color: var(--green-bd);
  color: var(--green);
}

.crime-counter {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  min-width: 60px;
  text-align: center;
}
