:root {
  --bg: #0a0a0f;
  --panel: #12121a;
  --panel-2: #0f0f16;
  --border: #1e1e2e;
  --border-soft: #191923;
  --blue: #3b82f6;
  --blue-2: #2563eb;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --purple: #818cf8;
  --text: #e4e4e7;
  --muted: #71717a;
  --muted-2: #52525b;
  --radius: 15px;
  --radius-sm: 10px;
  --ease: 180ms ease;
  --header-h: 68px;
}

* { box-sizing: border-box; }

/* Keep inactive mode workspaces out of layout even when they define display:grid. */
[hidden] { display: none !important; }

html { color-scheme: dark; background: var(--bg); }

body {
  margin: 0; min-width: 320px; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, textarea, input, select { font: inherit; }
button { color: inherit; }

.app { min-height: 100vh; }

/* Topbar */
.topbar {
  height: var(--header-h); border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, .96); display: flex; align-items: center;
  justify-content: space-between; padding: 0 28px;
  position: sticky; top: 0; z-index: 40;
}
.brand {
  color: var(--blue); font-weight: 800; letter-spacing: .14em;
  font-size: 19px; line-height: 1; user-select: none;
}
.top-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 40px; height: 40px; border: 1px solid var(--border);
  border-radius: 11px; background: var(--panel);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.icon-btn:hover { border-color: #303044; background: #161621; }
.icon-btn:active { transform: scale(.97); }
.icon-btn svg { width: 18px; height: 18px; color: #a1a1aa; }

.user-chip {
  height: 40px; display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--border); background: var(--panel);
  border-radius: 11px; padding: 0 13px; color: #c7c7ce; font-weight: 500;
}
.online-dot { width: 7px; height: 7px; background: var(--green); border-radius: 99px; flex: 0 0 auto; }

/* Container */
.container { width: min(1440px, 100%); margin: 0 auto; padding: 24px 28px 32px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card {
  min-height: 98px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 17px 18px; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px;
  width: 2px; background: var(--tone, var(--muted-2)); border-radius: 0 4px 4px 0;
}
.stat-top {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .03em;
}
.stat-icon { color: var(--tone, var(--muted)); width: 18px; height: 18px; }
.stat-value {
  font-family: "JetBrains Mono", monospace; font-size: 26px; line-height: 1.1;
  font-weight: 600; margin-top: 12px; letter-spacing: -.04em;
}
.stat-foot { color: var(--muted-2); font-size: 11px; margin-top: 6px; }

/* Toolbar */
.toolbar { display: grid; grid-template-columns: minmax(250px, 1fr) auto; gap: 12px; margin-bottom: 14px; }
.surface { border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius); }
.mode-wrap { padding: 8px; display: flex; align-items: center; gap: 8px; }
.mode-label { color: var(--muted); font-size: 12px; font-weight: 600; padding: 0 10px 0 5px; white-space: nowrap; }
.segmented {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: #0c0c12; border: 1px solid var(--border-soft);
  border-radius: 11px; padding: 4px; flex: 1; max-width: 440px;
}
.segment {
  height: 36px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600;
  transition: background var(--ease), color var(--ease);
}
.segment.active { background: var(--blue); color: white; }

.duplicates {
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  color: var(--muted); font-size: 12px; white-space: nowrap;
}
.duplicates strong { color: #b3b3bc; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.dup-indicator { display: none; }
.dup-indicator.visible { display: flex; }

/* Config / Hash accordion */
.config { margin-bottom: 14px; overflow: hidden; }
.config-toggle {
  width: 100%; min-height: 50px; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  border: 0; background: transparent; cursor: pointer; color: #c8c8cf;
}
.config-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; }
.config-title svg, .chevron { width: 17px; height: 17px; color: var(--muted); }
.chevron { transition: transform var(--ease); }
.config.open .chevron { transform: rotate(180deg); }
.config-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 220ms ease; }
.config.open .config-body { grid-template-rows: 1fr; }
.config-inner { min-height: 0; overflow: hidden; }
.config-content { border-top: 1px solid var(--border); padding: 14px 16px 16px; }
.config-textarea {
  width: 100%; min-height: 96px; resize: vertical;
  border: 1px solid var(--border); border-radius: 11px;
  background: #0b0b11; color: #d4d4d8; padding: 13px 14px; outline: none;
  font-family: "JetBrains Mono", monospace; font-size: 12px;
  transition: border-color var(--ease);
}
.config-textarea:focus { border-color: #30456d; }
.config-help { color: var(--muted-2); font-size: 11px; margin-top: 8px; }

.hash-status { margin-left: 8px; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.hash-status.saved { background: rgba(34,197,94,.15); color: #22c55e; }
.hash-status.missing { background: rgba(239,68,68,.15); color: #ef4444; }
.btn-save-hash {
  margin-top: 8px; padding: 8px 20px; background: var(--green); color: #fff;
  border: none; border-radius: 9px; font-size: 12px; font-weight: 650; cursor: pointer;
  transition: background var(--ease);
}
.btn-save-hash:hover { background: #16a34a; }

/* Workspace */
.workspace {
  display: grid; grid-template-columns: minmax(360px, .9fr) minmax(500px, 1.4fr);
  gap: 14px; align-items: start;
}

/* Panels */
.panel {
  border: 1px solid var(--border); background: var(--panel);
  border-radius: var(--radius); overflow: hidden;
}
.panel-head {
  min-height: 56px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 17px; gap: 12px;
}
.panel-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.panel-title h2, .panel-title h3 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: -.01em; }
.panel-title svg { width: 18px; height: 18px; color: var(--muted); }
.panel-subtitle { color: var(--muted); font-size: 11px; margin-top: 2px; }

.input-body { padding: 16px; }
.data-input {
  width: 100%; height: 280px; resize: vertical;
  border: 1px solid var(--border); border-radius: 12px;
  background: #0b0b11; color: #d7d7dd; padding: 15px; outline: none;
  font-family: "JetBrains Mono", monospace; font-size: 12px; line-height: 1.65;
  caret-color: var(--blue); transition: border-color var(--ease);
}
.data-input::placeholder { color: #41414b; }
.data-input:focus { border-color: #31486f; }

.progress-block { margin-top: 15px; }
.progress-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px; font-size: 11px; color: var(--muted);
}
.progress-meta strong { font-family: "JetBrains Mono", monospace; color: #b7b7bf; font-weight: 500; }
.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: #20202a; }
.progress-bar { height: 100%; width: 0%; background: var(--blue); border-radius: inherit; transition: width 220ms ease; }

.action-row { display: grid; grid-template-columns: 1fr 120px; gap: 9px; margin-top: 15px; }

.btn {
  min-height: 44px; border: 1px solid transparent; border-radius: 11px;
  padding: 0 15px; display: inline-flex; align-items: center; justify-content: center;
  gap: 9px; cursor: pointer; font-weight: 650; font-size: 12px;
  transition: background var(--ease), border-color var(--ease), opacity var(--ease), transform var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-2); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: #171720; border-color: var(--border); color: #a8a8b0; }
.btn-secondary:hover { background: #1a1a25; border-color: #303040; }
.btn-danger { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .2); color: #f87171; }
.btn svg { width: 16px; height: 16px; }

.mini-info {
  margin-top: 13px; display: flex; align-items: center;
  justify-content: space-between; color: var(--muted-2); font-size: 11px; gap: 12px;
}
.mini-info .mono { color: #9999a2; }

/* Results */
.results-stack { display: grid; gap: 14px; }

.filters {
  display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter-chip {
  min-height: 32px; border: 1px solid var(--border); border-radius: 9px;
  padding: 0 10px; background: #101017; color: var(--muted);
  cursor: pointer; white-space: nowrap; font-size: 11px; font-weight: 600;
}
.filter-chip.active {
  border-color: rgba(59, 130, 246, .45); color: #c9dcff;
  background: rgba(59, 130, 246, .08);
}

.result-panel { --accent: var(--blue); }
.result-panel .panel-head { position: relative; cursor: pointer; user-select: none; }
.result-panel .panel-head::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 2px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.panel-count {
  min-width: 26px; height: 24px; border-radius: 8px;
  border: 1px solid var(--border); color: #a1a1aa;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 7px; font-family: "JetBrains Mono", monospace; font-size: 10px;
}

/* Collapsible panels */
.result-panel.collapsed .result-list,
.result-panel.collapsed .filters { display: none; }
.panel-chevron {
  width: 14px; height: 14px; color: var(--muted); transition: transform var(--ease);
  flex-shrink: 0;
}
.result-panel.collapsed .panel-chevron { transform: rotate(-90deg); }

/* Panel action buttons */
.panel-actions { display: flex; align-items: center; gap: 6px; }
.btn-copy-panel, .btn-clear-panel {
  width: 28px; height: 28px; border: 1px solid var(--border-soft);
  border-radius: 7px; background: transparent; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
  position: relative;
}
.btn-copy-panel:hover, .btn-clear-panel:hover {
  background: rgba(255,255,255,.06); border-color: var(--border);
}
.btn-copy-panel svg, .btn-clear-panel svg { width: 13px; height: 13px; color: var(--muted); }
.btn-clear-panel svg { color: #f8717188; }
.btn-clear-panel:hover svg { color: #f87171; }

.result-list { max-height: 250px; overflow: auto; scrollbar-width: thin; scrollbar-color: #282836 transparent; }
.result-list:empty::after {
  content: "Aguardando resultados..."; display: block;
  text-align: center; padding: 30px; color: var(--muted-2); font-size: 12px;
}

.result-item {
  padding: 13px 15px; border-top: 1px solid var(--border-soft);
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px; align-items: start; animation: itemIn 180ms ease both;
}
@keyframes itemIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-primary { min-width: 0; }
.result-id {
  font-family: "JetBrains Mono", monospace; color: #d4d4da; font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.result-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--muted); font-size: 10px; margin-top: 6px; }
.result-meta span { display: inline-flex; align-items: center; gap: 4px; }
.result-reason { color: #94a3b8; font-size: 10px; font-style: italic; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }

.status-badge {
  height: 23px; padding: 0 8px; border-radius: 7px;
  display: inline-flex; align-items: center;
  border: 1px solid currentColor; font-size: 9px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.badge-success { color: #4ade80; background: rgba(34,197,94,.07); border-color: rgba(34,197,94,.25); }
.badge-failed { color: #f87171; background: rgba(239,68,68,.07); border-color: rgba(239,68,68,.25); }
.badge-warning { color: #fbbf24; background: rgba(245,158,11,.07); border-color: rgba(245,158,11,.25); }
.badge-info { color: #60a5fa; background: rgba(59,130,246,.07); border-color: rgba(59,130,246,.25); }
.badge-probable { color: #a78bfa; background: rgba(129,140,248,.07); border-color: rgba(129,140,248,.25); }
.duration { color: var(--muted-2); font-family: "JetBrains Mono", monospace; font-size: 9px; }

/* Footer */
.footerbar {
  margin-top: 14px; min-height: 64px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.footer-actions { display: flex; gap: 8px; min-width: 0; }
.footer-actions .btn { min-height: 40px; }
.system-state { display: flex; align-items: center; gap: 9px; color: var(--muted); white-space: nowrap; font-size: 11px; }
.system-state .mono { color: #b1b1ba; }
.telegram-badge {
  height: 28px; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 9px; border: 1px solid var(--border); border-radius: 8px;
  color: #8eaad2; background: #10131a;
}
.telegram-badge svg { width: 13px; height: 13px; }

/* History overlay Ã¢â‚¬â€ full page */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 5, 8, .88); display: none;
}
.overlay.open { display: block; }

.history {
  width: 100%; height: 100vh;
  border: none; border-radius: 0; background: var(--bg);
  overflow: hidden; display: flex; flex-direction: column;
}
.history-head {
  min-height: 68px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border);
  padding: 0 28px; gap: 14px;
}
.history-title { display: flex; align-items: center; gap: 10px; }
.history-title h2 { margin: 0; font-size: 15px; }
.history-title span { color: var(--muted); font-size: 11px; }
.history-actions { display: flex; gap: 8px; align-items: center; }

.history-tools {
  padding: 14px 28px; border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 10px; align-items: center;
}
.search {
  height: 42px; border: 1px solid var(--border); background: var(--panel);
  border-radius: 10px; display: flex; align-items: center; gap: 9px; padding: 0 12px;
}
.search svg { width: 16px; height: 16px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.search select {
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font-size: 11px; outline: none;
}

.history-body { padding: 20px 28px 28px; overflow: auto; flex: 1; }
.history-grid { display: grid; gap: 10px; }

/* Responsive */
@media (max-width: 1023px) {
  .container { padding-left: 18px; padding-right: 18px; }
  .workspace { grid-template-columns: 1fr; }
  .data-input { height: 260px; }
  .results-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  :root { --header-h: 60px; }
  .topbar { padding: 0 14px; justify-content: center; }
  .brand { position: absolute; left: 50%; transform: translateX(-50%); font-size: 17px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .user-chip { width: 40px; padding: 0; justify-content: center; }
  .user-chip .username { display: none; }
  .container { padding: 14px 12px 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .stat-card { min-height: 88px; padding: 14px; border-radius: 13px; }
  .stat-value { font-size: 22px; margin-top: 10px; }
  .stat-foot { display: none; }
  .toolbar { grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px; }
  .mode-wrap { display: block; padding: 8px; }
  .mode-label { display: block; margin: 0 0 8px 3px; }
  .segmented { max-width: none; }
  .duplicates { min-height: 42px; justify-content: space-between; }
  .config { margin-bottom: 10px; }
  .workspace { gap: 10px; }
  .panel-head { min-height: 52px; padding: 0 14px; }
  .input-body { padding: 12px; }
  .data-input { height: 280px; min-height: 200px; }
  .action-row { grid-template-columns: 1fr; }
  .action-row .btn { width: 100%; }
  .results-stack { grid-template-columns: 1fr; gap: 10px; }
  .result-list { max-height: 300px; }
  .footerbar { align-items: stretch; flex-direction: column; }
  .footer-actions { overflow-x: auto; padding-bottom: 2px; }
  .footer-actions .btn { flex: 0 0 auto; }
  .system-state { justify-content: space-between; }
  .overlay { padding: 0; }
  .history { height: 100vh; border-radius: 0; border-left: 0; border-right: 0; }
  .history-head { min-height: 62px; padding: 0 12px; }
  .history-title span { display: none; }
  .history-tools { grid-template-columns: 1fr; padding: 10px 12px; }
  .history-body { padding: 12px; }
}

/* ===== Transparent skin override ===== */
:root {
  --bg: #05070b;
  --panel: rgba(12, 16, 23, .46);
  --panel-2: rgba(5, 8, 13, .58);
  --glass: rgba(255, 255, 255, .045);
  --glass-strong: rgba(12, 17, 25, .58);
  --input: rgba(2, 5, 9, .54);
  --border: rgba(255, 255, 255, .105);
  --border-soft: rgba(255, 255, 255, .06);
  --blue: #67e8f9;
  --blue-2: #38bdf8;
  --text: #ecf4f8;
  --muted: #8b99a8;
  --muted-2: #637080;
  --shadow: 0 18px 44px rgba(0, 0, 0, .34);
}
html { background: #05070b; }
body {
  background:
    linear-gradient(135deg, rgba(6, 182, 212, .11), transparent 31%),
    linear-gradient(210deg, rgba(245, 158, 11, .08), transparent 34%),
    linear-gradient(180deg, #05070b 0%, #070b12 50%, #030406 100%);
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.72), rgba(0,0,0,.12));
}
.app { isolation: isolate; }
.topbar {
  background: rgba(5, 8, 13, .56);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}
.brand { color: #dffbff; text-shadow: 0 0 18px rgba(103, 232, 249, .38); }

.icon-btn, .user-chip, .surface, .panel, .stat-card, .history, .search {
  background: var(--glass-strong); border-color: var(--border);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: var(--shadow);
}
.icon-btn, .user-chip, .search { box-shadow: 0 10px 26px rgba(0, 0, 0, .22); }

.icon-btn:hover, .btn-secondary:hover, .filter-chip:hover {
  border-color: rgba(103, 232, 249, .34);
  background: rgba(103, 232, 249, .085);
}
.online-dot { box-shadow: 0 0 16px rgba(34, 197, 94, .78); }

.stat-card { position: relative; }
.stat-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.075), transparent 42%);
  pointer-events: none;
}
.stat-card > * { position: relative; }
.stat-card::after, .result-panel .panel-head::before { box-shadow: 0 0 18px currentColor; }
.stat-value, .panel-title h2, .panel-title h3 { letter-spacing: 0; }

.segmented, .config-textarea, .data-input, .progress-track,
.filter-chip, .panel-count, .telegram-badge {
  background: var(--input); border-color: var(--border-soft);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.segment.active {
  background: linear-gradient(135deg, rgba(103,232,249,.9), rgba(34,197,94,.62));
  color: #031216; box-shadow: 0 0 20px rgba(103,232,249,.24);
}

.config-content, .panel-head, .history-head, .history-tools,
.result-item, .filters { border-color: var(--border-soft) !important; }
.panel-head, .history-head, .history-tools { background: rgba(255,255,255,.025); }

.config-textarea, .data-input {
  color: #e7f2f5;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.018), inset 0 18px 34px rgba(0,0,0,.26);
}
.config-textarea::placeholder, .data-input::placeholder { color: rgba(139,153,168,.56); }
.config-textarea:focus, .data-input:focus, .search:focus-within {
  border-color: rgba(103,232,249,.48);
  box-shadow: 0 0 0 3px rgba(103,232,249,.08), inset 0 18px 34px rgba(0,0,0,.26);
}

.progress-track { height: 6px; background: rgba(255,255,255,.075); }
.progress-bar { background: linear-gradient(90deg, #22c55e, #67e8f9); box-shadow: 0 0 18px rgba(103,232,249,.5); }

.btn-primary {
  background: linear-gradient(135deg, rgba(103,232,249,.9), rgba(34,197,94,.68));
  color: #031216; box-shadow: 0 12px 26px rgba(6,182,212,.18);
}
.btn-primary:hover { background: linear-gradient(135deg, rgba(165,243,252,.96), rgba(74,222,128,.76)); }
.btn-secondary { background: rgba(255,255,255,.05); border-color: var(--border); color: #c5d0d8; }
.btn-danger { background: rgba(239,68,68,.075); border-color: rgba(248,113,113,.25); }

.filter-chip.active {
  border-color: rgba(103,232,249,.45); color: #dffbff;
  background: rgba(103,232,249,.105); box-shadow: inset 0 0 18px rgba(103,232,249,.075);
}
.panel-count { color: #cbd7de; }
.result-list { scrollbar-color: rgba(103,232,249,.28) transparent; }
.result-item { background: rgba(255,255,255,.018); }
.result-item:hover { background: rgba(255,255,255,.045); }
.result-id { color: #edf7fa; }
.status-badge { background-clip: padding-box; box-shadow: inset 0 0 18px rgba(255,255,255,.035); }
.footerbar { background: rgba(12, 17, 25, .42); }
.telegram-badge { color: #9ccfe6; }
.overlay { background: rgba(1,3,7,.68); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.history { background: rgba(7,11,17,.92); box-shadow: none; }

@media (max-width: 767px) {
  body::before { background-size: 34px 34px; }
}

/* Accessibility and low-cost rendering safeguards */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(103, 232, 249, .72);
  outline-offset: 3px;
}

.segment[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(103,232,249,.9), rgba(34,197,94,.62));
  color: #031216;
  box-shadow: 0 0 20px rgba(103,232,249,.24);
}

.connection-status[data-state="connecting"] .online-dot {
  background: var(--amber);
  box-shadow: 0 0 16px rgba(245,158,11,.55);
}

.connection-status[data-state="offline"] .online-dot {
  background: var(--red);
  box-shadow: 0 0 16px rgba(239,68,68,.55);
}

.connection-label {
  color: var(--muted);
  font-size: 11px;
}

.feedback {
  min-height: 1.5em;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.feedback[data-tone="error"] { color: #fca5a5; }
.feedback[data-tone="success"] { color: #86efac; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (pointer: coarse) {
  .btn-copy-panel,
  .btn-clear-panel {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 430px) {
  .segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segment { min-height: 42px; height: auto; }
}

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

  .topbar,
  .icon-btn,
  .user-chip,
  .surface,
  .panel,
  .stat-card,
  .history,
  .search,
  .segmented,
  .config-textarea,
  .data-input,
  .filter-chip {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ── Historico page ── */
.historico-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px 8px; color: var(--muted); font-size: 12px;
}
.historico-summary-page { color: var(--muted-2); }

.historico-filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 14px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.historico-filters select,
.historico-filters input[type="text"],
.historico-filters input[type="date"] {
  height: 34px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 12px; outline: none;
}
.historico-filters select { min-width: 130px; }
.historico-filters input[type="text"] { min-width: 180px; flex: 1; }
.historico-filters input[type="date"] { min-width: 130px; }
.historico-filters select:focus,
.historico-filters input:focus { border-color: var(--blue); }

.result-date { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--muted-2); }
.result-mode {
  font-family: "JetBrains Mono", monospace; font-size: 9px; font-weight: 700;
  color: var(--purple); letter-spacing: .04em; text-transform: uppercase;
}

.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 4px; padding: 18px 0 30px; flex-wrap: wrap;
}
.pagination-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--panel); color: var(--text);
  font-size: 12px; font-weight: 500; text-decoration: none;
  transition: background var(--ease), border-color var(--ease);
}
.pagination-btn:hover { background: var(--panel-2); border-color: var(--blue); }
.pagination-current {
  background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700;
}
.pagination-current:hover { background: var(--blue-2); }
.pagination-disabled {
  color: var(--muted-2); pointer-events: none; opacity: .5;
}
.pagination-ellipsis {
  color: var(--muted-2); font-size: 12px; padding: 0 4px;
}


