/* ============================================================
   Entende Lei — Design System (Neurodesign Ânima)
   Paleta de baixa saturação: azuis e cinzas suaves para reduzir
   cortisol; dourado como acento de marca; alto contraste WCAG 2.1.
   ============================================================ */

:root {
  --navy-900: #1c1a40;
  --navy-800: #232052;
  --navy-700: #2e2a68;
  --navy-100: #e8e9f6;

  --blue-700: #2456a0;
  --blue-600: #2f68b0;
  --blue-100: #e4edf8;
  --blue-050: #f0f5fb;

  --gold-500: #d9952c;
  --gold-600: #b97a1a;
  --gold-100: #fbf0dc;

  --bg: #f2f5f9;
  --surface: #ffffff;
  --ink: #233148;
  --ink-soft: #576780;
  --ink-faint: #8494ab;
  --border: #dbe3ee;
  --border-soft: #e8edf5;

  --green-700: #24704f;
  --green-100: #e3f3ea;
  --amber-700: #9a6210;
  --amber-100: #fbf0da;
  --violet-700: #6448a8;
  --violet-100: #eee9fa;
  --teal-700: #1d7a78;
  --teal-100: #e0f3f2;
  --red-600: #c04545;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(28, 26, 64, 0.07);
  --shadow-lg: 0 18px 48px rgba(28, 26, 64, 0.16);

  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Header ---------- */

.app-header {
  background: linear-gradient(120deg, var(--navy-900) 0%, var(--navy-700) 100%);
  color: #fff;
  padding: 0 24px;
}

.app-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  color: var(--gold-500);
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-name .now { color: var(--gold-500); }

.brand-tagline {
  font-size: 0.8rem;
  color: #b9bde0;
  margin-top: 2px;
}

/* ---------- Stepper ---------- */

.stepper-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.stepper {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 14px 24px;
  gap: 8px;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-faint);
  font-size: 0.86rem;
  font-weight: 600;
}

.stepper-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--border-soft);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.stepper-item.active { color: var(--navy-800); }
.stepper-item.active .stepper-dot {
  background: var(--navy-800);
  color: #fff;
  box-shadow: 0 0 0 4px var(--navy-100);
}
.stepper-item.done { color: var(--green-700); }
.stepper-item.done .stepper-dot { background: var(--green-100); color: var(--green-700); }

.stepper-line {
  flex: 1;
  min-width: 20px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
}
.stepper-line.done { background: var(--green-700); }

/* ---------- Layout ---------- */

.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.screen {
  animation: fadeUp 0.45s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--navy-800);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.screen-sub {
  color: var(--ink-soft);
  margin: 0 0 28px;
  max-width: 640px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.card + .card { margin-top: 24px; }

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-800);
  margin: 0 0 6px;
}

.card-title .icon { color: var(--blue-600); }

.card-desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.icon { display: inline-flex; flex-shrink: 0; }
.icon svg { display: block; }

/* ---------- Screen 1: Input ---------- */

.input-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink);
  background: #fbfcfe;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px var(--blue-100);
}

.textarea.valid { border-color: var(--green-700); }
.textarea.valid:focus { box-shadow: 0 0 0 4px var(--green-100); }

.input-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-faint);
  min-height: 24px;
}

.input-feedback.ok { color: var(--green-700); }

.input-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 26px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}

.btn:active:not(:disabled) { transform: scale(0.98); }

.btn-primary {
  background: var(--blue-700);
  color: #fff;
  box-shadow: 0 6px 18px rgba(36, 86, 160, 0.32);
}
.btn-primary:hover:not(:disabled) { background: var(--blue-600); box-shadow: 0 8px 22px rgba(36, 86, 160, 0.4); }
.btn-primary:disabled { background: #a7b7cd; box-shadow: none; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--blue-700);
  border: 2px solid var(--border);
  padding: 11px 20px;
}
.btn-ghost:hover { border-color: var(--blue-600); background: var(--blue-050); }

.btn-soft {
  background: var(--blue-050);
  color: var(--blue-700);
  border: 1px solid var(--blue-100);
  padding: 11px 20px;
}
.btn-soft:hover { background: var(--blue-100); }

/* Alt input methods (MVP: visually present, inactive) */

.alt-methods { display: flex; flex-direction: column; gap: 12px; }

.alt-method {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfd;
  color: var(--ink-soft);
  cursor: not-allowed;
  text-align: left;
  position: relative;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.alt-method .icon { color: var(--ink-faint); }

/* Upload ativo (drop zone funcional) */
.alt-method.enabled {
  cursor: pointer;
  border-color: var(--blue-600);
  background: var(--blue-050);
}
.alt-method.enabled .icon { color: var(--blue-600); }
.alt-method.enabled:hover { background: var(--blue-100); }
.alt-method.enabled.dragover {
  background: var(--blue-100);
  border-color: var(--blue-700);
  box-shadow: 0 0 0 4px var(--blue-100);
}

.alt-method-title { font-size: 0.92rem; font-weight: 700; color: var(--ink); display: block; }
.alt-method-sub { font-size: 0.78rem; color: var(--ink-faint); display: block; }

.soon-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-600);
  background: var(--gold-100);
  padding: 3px 8px;
  border-radius: 999px;
}

/* tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--navy-900);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 30;
}
[data-tip]:hover::after,
[data-tip]:focus-within::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.side-note {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--navy-100);
  color: var(--navy-700);
  font-size: 0.8rem;
  line-height: 1.55;
  display: flex;
  gap: 10px;
}
.side-note .icon { color: var(--navy-700); margin-top: 1px; }

/* ---------- Screen 2: Processing ---------- */

.processing-card {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 40px;
}

.processing-orb {
  width: 88px;
  height: 88px;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--navy-700), var(--navy-900));
  display: grid;
  place-items: center;
  color: var(--gold-500);
  position: relative;
  animation: breathe 2.6s ease-in-out infinite;
}
.processing-orb::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid var(--gold-500);
  opacity: 0.35;
  animation: pulse-ring 2.6s ease-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.45; }
  100% { transform: scale(1.35); opacity: 0; }
}

.progress-track {
  height: 10px;
  background: var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
  margin: 26px 0 10px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-600), var(--gold-500));
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  margin-bottom: 28px;
}

.proc-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.proc-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--ink-faint);
  transition: background 0.3s, color 0.3s;
}

.proc-step .step-state {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.proc-step.pending .step-state { color: var(--border); }
.proc-step.running {
  background: var(--blue-050);
  color: var(--navy-800);
  font-weight: 600;
}
.proc-step.running .step-state { color: var(--blue-600); }
.proc-step.done { color: var(--ink-soft); }
.proc-step.done .step-state { color: var(--green-700); }

.mini-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--blue-100);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.proc-note {
  margin-top: 26px;
  font-size: 0.78rem;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ---------- Screen 3: Dashboard ---------- */

.dash-head {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.proc-id {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy-700);
  background: var(--navy-100);
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.confidence-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.ring {
  position: relative;
  width: 74px;
  height: 74px;
  flex-shrink: 0;
}
.ring svg { transform: rotate(-90deg); }
.ring .ring-track { stroke: var(--border-soft); }
.ring .ring-fill { stroke: var(--green-700); transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1); }
.ring .ring-val {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--navy-800);
}
.ring .ring-val small { font-size: 0.6rem; color: var(--ink-faint); font-weight: 600; }

.confidence-text { max-width: 300px; }
.confidence-text strong { font-size: 0.9rem; color: var(--navy-800); display: block; }
.confidence-text p { font-size: 0.76rem; color: var(--ink-soft); margin: 3px 0 0; line-height: 1.5; }
.confidence-text .what {
  background: none;
  border: none;
  padding: 0;
  margin-top: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--blue-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

/* side-by-side */

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.compare-pane { padding: 22px 24px; }

.compare-pane.original {
  background: #f7f8fb;
  border-right: 1px solid var(--border);
}

.compare-pane.simplified { background: var(--blue-050); }

.compare-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.compare-tag.src { background: var(--border-soft); color: var(--ink-soft); }
.compare-tag.dst { background: var(--blue-600); color: #fff; }

.compare-pane p {
  margin: 0 0 12px;
  font-size: 0.92rem;
}
.compare-pane.original p { color: var(--ink-soft); font-size: 0.88rem; line-height: 1.7; }
.compare-pane.simplified p { color: var(--ink); font-weight: 500; }
.compare-pane.simplified p:last-child,
.compare-pane.original p:last-child { margin-bottom: 0; }

.hl {
  background: linear-gradient(transparent 62%, rgba(217, 149, 44, 0.32) 62%);
  border-radius: 2px;
  padding: 0 1px;
}

/* timeline */

.timeline {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 8px 2px 4px;
}

.tl-step {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px 12px;
  border-radius: var(--radius-sm);
  position: relative;
  transition: background 0.2s;
}
.tl-step:hover { background: var(--blue-050); }

.tl-node {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  background: var(--surface);
  border: 2.5px solid var(--border);
  color: var(--ink-faint);
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
  transition: all 0.25s;
}

.tl-step::before {
  content: "";
  position: absolute;
  top: 26px;
  left: -50%;
  width: 100%;
  height: 2.5px;
  background: var(--border);
  z-index: 1;
}
.tl-step:first-child::before { display: none; }

.tl-step.done .tl-node { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.tl-step.done::before { background: var(--green-700); }
.tl-step.current .tl-node {
  background: var(--surface);
  border-color: var(--blue-600);
  color: var(--blue-700);
  box-shadow: 0 0 0 5px var(--blue-100);
}
.tl-step.current::before { background: linear-gradient(90deg, var(--green-700), var(--blue-600)); }
.tl-step.selected { background: var(--blue-050); }

.tl-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}
.tl-step.pending .tl-name { color: var(--ink-soft); font-weight: 600; }

.tl-flags { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; justify-content: center; }

.tl-flag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tl-flag.now { background: var(--blue-600); color: #fff; }
.tl-flag.critical { background: var(--amber-100); color: var(--amber-700); }
.tl-flag.done { background: var(--green-100); color: var(--green-700); }

.tl-detail {
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--blue-050);
  border: 1px solid var(--blue-100);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: fadeUp 0.3s ease both;
}
.tl-detail .icon { color: var(--blue-600); margin-top: 2px; }
.tl-detail strong { color: var(--navy-800); font-size: 0.9rem; display: block; }
.tl-detail p { margin: 3px 0 0; font-size: 0.86rem; color: var(--ink-soft); }

/* rights vs duties */

.rd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.rd-col { border-radius: var(--radius-sm); padding: 20px; }
.rd-col.rights { background: var(--green-100); }
.rd-col.duties { background: var(--amber-100); }

.rd-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.rd-col.rights .rd-head { color: var(--green-700); }
.rd-col.duties .rd-head { color: var(--amber-700); }

.rd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.rd-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.87rem;
  line-height: 1.5;
  color: var(--ink);
}

.rd-item .rd-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.rd-col.rights .rd-icon { background: #fff; color: var(--green-700); }
.rd-col.duties .rd-icon { background: #fff; color: var(--amber-700); }

/* dictionary */

.term-chips { display: flex; flex-wrap: wrap; gap: 10px; }

.term-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy-800);
  cursor: pointer;
  transition: all 0.18s;
}
.term-chip:hover { border-color: var(--blue-600); background: var(--blue-050); transform: translateY(-1px); }
.term-chip .tipo-dot { width: 9px; height: 9px; border-radius: 50%; }

.tipo-Latinismo { --tipo: var(--violet-700); --tipo-bg: var(--violet-100); }
.tipo-Processual { --tipo: var(--blue-700); --tipo-bg: var(--blue-100); }
.tipo-Substantivo { --tipo: var(--teal-700); --tipo-bg: var(--teal-100); }

.term-chip .tipo-dot { background: var(--tipo); }

/* modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 64, 0.55);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 100;
  animation: fadeIn 0.2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
  padding: 30px;
  position: relative;
  animation: popIn 0.28s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--border-soft);
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.modal-close:hover { background: var(--border); color: var(--ink); }

.modal-anchor {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--tipo-bg, var(--blue-100));
  color: var(--tipo, var(--blue-700));
  margin-bottom: 16px;
}

.modal-tipo {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tipo, var(--blue-700));
  background: var(--tipo-bg, var(--blue-100));
  padding: 4px 11px;
  border-radius: 999px;
}

.modal h3 { margin: 12px 0 8px; font-size: 1.3rem; color: var(--navy-800); letter-spacing: -0.01em; }
.modal p { margin: 0 0 14px; color: var(--ink-soft); font-size: 0.93rem; }

.modal-anchor-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--tipo-bg, var(--blue-050));
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.8rem;
  color: var(--ink);
  margin-top: 6px;
}
.modal-anchor-note .icon { color: var(--tipo, var(--blue-700)); margin-top: 1px; }
.modal-anchor-note em { display: block; font-size: 0.72rem; color: var(--ink-soft); font-style: normal; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }

.modal .btn { width: 100%; margin-top: 20px; }

/* ---------- Consulta pública (CPF/CNPJ/CNJ) ---------- */

.consulta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--blue-700);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 4px;
}
.consulta-link:hover { color: var(--blue-600); }

.consulta-modal { max-width: 580px; }

.consulta-field { position: relative; }

.consulta-input {
  width: 100%;
  padding: 13px 90px 13px 15px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--ink);
  background: #fbfcfe;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.consulta-input:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px var(--blue-100);
}

.doc-type {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--blue-700);
  background: var(--blue-100);
  padding: 4px 10px;
  border-radius: 999px;
}

.consulta-btn { margin-top: 14px; }
.consulta-btn .mini-spinner { border-color: rgba(255,255,255,0.35); border-top-color: #fff; }

.consulta-count {
  font-size: 0.84rem;
  color: var(--ink-soft);
  margin: 20px 0 10px;
}

.proc-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.proc-result {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  background: #fbfcfe;
}

.proc-result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.proc-num {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--blue-700);
  letter-spacing: 0.02em;
}

.proc-titulo {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.proc-trib {
  font-size: 0.75rem;
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.proc-result-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.proc-sit {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.proc-sit.open { background: var(--blue-100); color: var(--blue-700); }
.proc-sit.closed { background: var(--green-100); color: var(--green-700); }

.consulta-modal .btn-sm { width: auto; padding: 8px 14px; font-size: 0.8rem; margin-top: 0; }

/* footer actions */

.dash-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.mock-note { font-size: 0.75rem; color: var(--ink-faint); display: flex; align-items: center; gap: 7px; }

/* confidence info modal list */
.legend-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.legend-list li { display: flex; gap: 10px; align-items: center; font-size: 0.85rem; color: var(--ink-soft); }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .input-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-pane.original { border-right: none; border-bottom: 1px solid var(--border); }
  .rd-grid { grid-template-columns: 1fr; }
  .confidence-wrap { margin-left: 0; }
  .stepper-label { display: none; }
  .stepper { gap: 6px; }
  .main { padding: 24px 16px 56px; }
  .card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
