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

:root {
  --bg: #0a0e14;
  --bg-elevated: #111820;
  --bg-card: #141c27;
  --bg-hover: #1a2433;
  --bg-active: #1f2b3d;
  --bg-inset: #0c121c;
  --border: #1e293b;
  --border-light: #283548;
  --text: #e8edf5;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-dim: rgba(56, 189, 248, 0.12);
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.12);
  --orange: #fb923c;
  --orange-dim: rgba(251, 146, 60, 0.12);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --purple: #a78bfa;
  --yellow: #fbbf24;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 230px;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: #000;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ── App Shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.brand-icon svg {
  width: 30px;
  height: 30px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.brand-name .accent {
  color: var(--accent);
}

.brand-version {
  font-size: 0.6rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-nav {
  flex: 1;
  padding: 0.6rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-align: left;
  width: 100%;
  font-family: var(--font-sans);
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--border-light);
  color: var(--text-tertiary);
  font-size: 0.65rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-weight: 600;
}

.nav-item.active .nav-badge {
  background: var(--accent);
  color: #000;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.logout-link {
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.logout-link svg {
  width: 16px;
  height: 16px;
}

.logout-link:hover {
  color: var(--red);
  background: var(--red-dim);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.status-dot.scanning {
  background: var(--accent);
  animation: pulse 1.2s ease infinite;
}

.status-dot.error {
  background: var(--red);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Main Area ── */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ── */
.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.15rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-xs);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

.topbar-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.keyboard-hint kbd {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-tertiary);
}

/* ── Content ── */
.content {
  flex: 1;
  padding: 1.25rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeSlideIn 0.25s ease;
}

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

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow);
}

/* ── Input Section ── */
.input-section {
  padding: 1.1rem;
}

.input-mode-toggle {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
  width: fit-content;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.mode-btn.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mode-btn:hover:not(.active) {
  color: var(--text);
}

.input-group {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}

#domain {
  width: 100%;
  background: var(--bg-inset);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.7rem 0.85rem 0.7rem 2.3rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#domain:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

#domain::placeholder {
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-weight: 400;
}

.input-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

#domains {
  width: 100%;
  background: var(--bg-inset);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 80px;
}

#domains:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  line-height: 1;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-warn {
  background: var(--orange-dim);
  color: var(--orange);
  border-color: rgba(251, 146, 60, 0.2);
}

.btn-warn:hover:not(:disabled) {
  background: rgba(251, 146, 60, 0.2);
  border-color: var(--orange);
}

.btn-warn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--text-tertiary);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
}

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

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

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

.btn-group {
  display: flex;
  gap: 0.2rem;
}

/* ── Options Bar ── */
.options-bar {
  margin-top: 0.65rem;
}

.options-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.3rem 0;
  font-family: var(--font-sans);
  transition: color var(--transition);
}

.options-toggle:hover {
  color: var(--text);
}

.options-toggle svg {
  width: 14px;
  height: 14px;
}

.options-toggle .chevron {
  transition: transform var(--transition);
}

.options-toggle.open .chevron {
  transform: rotate(180deg);
}

/* ── Options Panel ── */
.options-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.25s ease;
  margin-top: 0;
}

.options-panel.open {
  max-height: 600px;
  opacity: 1;
  margin-top: 0.75rem;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  padding: 0.85rem;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.full-col {
  grid-column: 1 / -1;
}

.opt-section label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.opt-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.opt-header label {
  margin-bottom: 0;
}

.src-count {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.src-actions {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.src-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.src-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
}

.src-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.src-grid label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.src-grid label:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.src-grid input[type="checkbox"] {
  accent-color: var(--accent);
  width: 11px;
  height: 11px;
}

.opt-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.4rem 0.5rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.opt-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.opt-hint {
  display: block;
  font-size: 0.68rem;
  color: var(--text-tertiary);
  margin-top: 0.2rem;
}

.toggle-row {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-weight: 400 !important;
  margin-bottom: 0 !important;
}

.toggle-row input {
  display: none;
}

.toggle-track {
  width: 32px;
  height: 18px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-tertiary);
  border-radius: 50%;
  transition: all var(--transition);
}

.toggle-row input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-row input:checked + .toggle-track .toggle-thumb {
  background: #000;
  transform: translateX(14px);
}

.toggle-label {
  font-size: 0.82rem !important;
  color: var(--text) !important;
  font-weight: 500 !important;
}

/* ── Status Card ── */
.status-card {
  padding: 1rem;
  animation: slideDown 0.3s ease;
}

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

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.status-phase {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.phase-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease infinite;
}

.phase-dot.done {
  background: var(--green);
  animation: none;
}

.phase-dot.error {
  background: var(--red);
  animation: none;
}

.phase-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.status-elapsed {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-fill.complete {
  background: linear-gradient(90deg, var(--green), #22d3ee);
}

.status-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
}

.status-msg {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.status-metrics {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.metric {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
}

.metric-value {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}

.metric-label {
  color: var(--text-tertiary);
}

.metric-divider {
  width: 1px;
  height: 12px;
  background: var(--border);
}

.source-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.src-pill {
  font-size: 0.62rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text-tertiary);
  transition: all var(--transition);
  font-family: var(--font-mono);
  font-weight: 500;
}

.src-pill.done {
  background: var(--green-dim);
  border-color: rgba(74, 222, 128, 0.2);
  color: var(--green);
}

.src-pill.error {
  background: var(--red-dim);
  border-color: rgba(248, 113, 113, 0.2);
  color: var(--red);
}

.src-pill.skipped {
  opacity: 0.35;
}

.src-pill.running {
  border-color: var(--accent);
  color: var(--accent);
  animation: pulse 1.2s ease infinite;
}

.src-pill.truncated {
  border-color: var(--yellow);
  color: var(--yellow);
}

/* ── Results ── */
.results-container {
  animation: fadeSlideIn 0.3s ease;
}

.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.results-summary {
  display: flex;
  gap: 0.4rem;
}

.stat-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  text-align: center;
  min-width: 75px;
}

.stat-block-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-block-label {
  font-size: 0.62rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.results-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem 0.4rem 1.5rem;
  outline: none;
  width: 200px;
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
  width: 250px;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

/* ── Table ── */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 65vh;
  overflow-y: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.results-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.results-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  font-weight: 600;
  font-family: var(--font-sans);
  user-select: none;
}

.sortable {
  cursor: pointer;
  transition: color var(--transition);
}

.sortable:hover {
  color: var(--text-secondary);
}

.sortable::after {
  content: '';
  margin-left: 0.35rem;
  font-size: 0.6rem;
  opacity: 0;
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-bottom: 5px solid var(--text-tertiary);
  vertical-align: middle;
}

.sortable.sort-asc::after {
  content: '';
  opacity: 1;
  border-bottom: 5px solid var(--accent);
  border-top: none;
}

.sortable.sort-desc::after {
  content: '';
  opacity: 1;
  border-top: 5px solid var(--accent);
  border-bottom: none;
}

.col-idx {
  width: 2.5rem;
  text-align: right;
}

.col-subdomain {
  min-width: 180px;
}

.col-ips {
  min-width: 130px;
}

.col-status {
  min-width: 55px;
  text-align: center;
}

.col-sources {
  min-width: 100px;
}

.results-table td {
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  transition: background var(--transition);
}

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

.results-table tbody tr:hover td {
  background: var(--bg-hover);
}

.results-table .idx {
  color: var(--text-tertiary);
  font-size: 0.7rem;
}

.subdomain-cell {
  color: var(--accent);
  word-break: break-all;
  font-weight: 500;
}

.ip-cell {
  color: var(--text-tertiary);
  font-size: 0.72rem;
  word-break: break-all;
}

.status-cell {
  text-align: center;
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  display: inline-block;
}

.status-cell.alive {
  color: var(--green);
  background: var(--green-dim);
}

.status-cell.dead {
  color: var(--text-tertiary);
  background: var(--bg-inset);
}

.status-cell.redirect {
  color: var(--yellow);
  background: rgba(251, 191, 36, 0.1);
}

.status-cell.error {
  color: var(--red);
  background: var(--red-dim);
}

.source-badge {
  display: inline-block;
  font-size: 0.6rem;
  padding: 0.08rem 0.3rem;
  border-radius: 3px;
  margin: 0.06rem 0.1rem;
  font-weight: 500;
  font-family: var(--font-sans);
}

.results-empty {
  padding: 2.5rem 1rem;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.empty-icon {
  width: 40px;
  height: 40px;
  color: var(--border-light);
  margin-bottom: 0.3rem;
}

.empty-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-desc {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* ── Results Footer ── */
.results-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  justify-content: center;
  flex-wrap: wrap;
}

.footer-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.footer-stat svg {
  width: 13px;
  height: 13px;
}

.footer-stat strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.footer-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
}

/* ── Chart ── */
.chart-card {
  padding: 1rem;
}

.chart-header {
  margin-bottom: 0.75rem;
}

.chart-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
}

.chart-subtitle {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  margin-top: 0.15rem;
}

.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  min-width: 75px;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.chart-bar-track {
  flex: 1;
  height: 20px;
  background: var(--bg-inset);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

.chart-count {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  min-width: 28px;
  text-align: left;
  font-family: var(--font-mono);
}

/* ── History ── */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  gap: 0.35rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition);
}

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

.history-item-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.history-domain {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
}

.history-meta {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.history-count {
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 600;
  font-family: var(--font-mono);
}

.history-rm {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  transition: all var(--transition);
  line-height: 1;
}

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

/* ── Settings ── */
#panel-settings h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.settings-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.settings-row + .settings-row {
  border-top: 1px solid var(--border);
}

.settings-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.settings-name {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

.settings-desc {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.toggle-el {
  display: inline-flex;
  cursor: pointer;
}

.toggle-el input {
  display: none;
}

.toggle-el .toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border-light);
  border-radius: 999px;
  position: relative;
  transition: background var(--transition);
}

.toggle-el .toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-tertiary);
  border-radius: 50%;
  transition: all var(--transition);
}

.toggle-el input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-el input:checked + .toggle-track .toggle-thumb {
  background: #000;
  transform: translateX(16px);
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.shortcut kbd {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-tertiary);
  min-width: 28px;
  text-align: center;
}

.about-section .about-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.about-logo svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.about-text {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.about-text strong {
  color: var(--text-secondary);
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  pointer-events: auto;
  border-left: 3px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  backdrop-filter: blur(12px);
}

.toast.success {
  border-left-color: var(--green);
}

.toast.error {
  border-left-color: var(--red);
}

.toast.warn {
  border-left-color: var(--orange);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ── Overlay ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  backdrop-filter: blur(4px);
}

.overlay.show {
  display: block;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-area {
    margin-left: 0;
  }

  .topbar {
    display: flex;
  }

  .content {
    padding: 0.85rem;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .results-summary {
    justify-content: center;
  }

  .results-actions {
    justify-content: center;
  }

  .search-input {
    width: 100%;
  }

  .search-input:focus {
    width: 100%;
  }

  .shortcuts-grid {
    grid-template-columns: 1fr;
  }

  .history-item {
    flex-direction: column;
    gap: 0.3rem;
    align-items: flex-start;
  }

  .results-footer {
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
  }

  .footer-divider {
    display: none;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 0.6rem;
  }

  .input-group {
    flex-direction: column;
  }

  .input-actions {
    width: 100%;
  }

  .input-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .status-detail {
    flex-direction: column;
    gap: 0.3rem;
    align-items: flex-start;
  }

  .results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .stat-block {
    min-width: auto;
  }
}

/* ── Row Enter Animation ── */
@keyframes rowEnter {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-table tbody tr {
  animation: rowEnter 0.2s ease;
}

/* ── Loading shimmer for initial state ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-inset) 25%, var(--bg-hover) 50%, var(--bg-inset) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-xs);
}
