:root {
  --primary: #6c3fc5;
  --primary-dark: #4e2d99;
  --secondary: #f0c040;
  --bg: #101012;
  --surface: #16162a;
  --surface2: #1e1e38;
  --text: #e8e8f5;
  --text-muted: #9090bb;
  --border: #2e2e50;
  --success: #3ecf8e;
  --danger: #f55;
  --bs-border-radius: 12px;
  --bs-border-radius-sm: 10px;
  --bs-border-radius-lg: 16px;
}

[data-theme="light"] {
  --primary: #6c3fc5;
  --primary-dark: #4e2d99;
  --secondary: #d4a017;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface2: #f8f9fa;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --success: #15803d;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#appContent {
  flex: 1;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-title {
  color: var(--secondary);
  letter-spacing: 0.04em;
}

.text-muted {
  color: var(--text-muted) !important;
}

.navbar {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
}

.navbar-brand {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--secondary) !important;
  letter-spacing: 2px;
}

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

.nav-link {
  color: var(--text-muted) !important;
  font-size: 0.95rem;
  padding: 0.4rem 0.8rem !important;
  border-radius: var(--bs-border-radius-sm);
  transition: all 0.2s;
}

.nav-link:hover {
  color: #fff !important;
  background: var(--primary);
}

.nav-link.active {
  color: #fff !important;
  background: var(--primary);
  font-weight: 500;
}

.dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.4rem;
  min-width: 220px;
}

.dropdown-item {
  color: var(--text);
  border-radius: var(--bs-border-radius-sm);
  padding: 0.45rem 0.7rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--surface2);
  color: var(--text);
}

html[dir="rtl"] .dropdown-toggle,
html[dir="rtl"] .dropdown-item,
html[dir="rtl"] .dropdown-menu {
  text-align: right;
}

html[dir="rtl"] .dropdown-menu[data-bs-popper] {
  right: 0;
  left: auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.card-body {
  background: var(--surface);
  color: var(--text);
}

.card-body strong,
.card-body p,
.card-body small,
.card-body pre {
  color: var(--text);
}

.card-body .text-muted {
  color: var(--text-muted) !important;
}

.list-group-item {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}

.list-group-item strong,
.list-group-item small {
  color: var(--text);
}

.accordion-item {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.accordion-button {
  background: var(--surface2);
  color: var(--text);
}

.accordion-button:not(.collapsed) {
  background: var(--surface2);
  color: var(--text);
  box-shadow: none;
}

.accordion-button::after {
  filter: invert(1) brightness(2);
}

.accordion-body {
  background: var(--surface);
  color: var(--text);
}

.btn-primary {
  background: var(--primary);
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: var(--bs-border-radius);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
  border-radius: var(--bs-border-radius);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-outline-secondary {
  color: var(--text);
  border-color: var(--border);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--primary);
}

.btn-outline-danger {
  color: #ff9f9f;
  border-color: rgba(245, 85, 85, 0.45);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background: rgba(245, 85, 85, 0.12);
  color: #ffd4d4;
  border-color: rgba(245, 85, 85, 0.7);
}

.btn-warning {
  background: var(--secondary);
  border: none;
  color: #111;
  border-radius: var(--bs-border-radius);
  font-weight: 700;
}

.hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0 1rem;
  text-align: center;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 900;
  color: var(--secondary);
  letter-spacing: 4px;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 580px;
  margin: auto;
}

footer {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

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

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

.home-tool-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.access-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.access-kicker {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(108, 63, 197, 0.18);
  color: var(--secondary);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.access-heading {
  color: var(--text);
}

.access-subtitle {
  color: var(--text-muted);
  max-width: 760px;
}

.access-action-btn {
  min-width: 135px;
}

.flash-message-viewport {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  pointer-events: none;
  padding: 1rem;
}

.global-flash-message {
  pointer-events: auto;
  width: min(92vw, 560px);
  max-width: 560px;
  margin: 0;
  border-radius: 14px;
  border: 1px solid transparent;
  box-shadow: 0 14px 34px rgba(8, 12, 22, 0.24);
  backdrop-filter: none;
  font-size: 0.93rem;
  font-weight: 600;
  color: #fff;
  padding: 0.8rem 0.95rem;
  animation: flash-slide-in 0.22s ease-out;
}

.global-flash-message span,
.global-flash-message i {
  color: inherit;
}

.global-flash-message.alert-success {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

.global-flash-message.alert-danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.global-flash-message.alert-warning {
  background: #b45309;
  border-color: #b45309;
  color: #fff;
}

.global-flash-message.alert-info {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

[data-theme="light"] .global-flash-message.alert-success {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

[data-theme="light"] .global-flash-message.alert-danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

[data-theme="light"] .global-flash-message.alert-warning {
  background: #b45309;
  border-color: #b45309;
  color: #fff;
}

[data-theme="light"] .global-flash-message.alert-info {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.global-flash-message .btn-close {
  filter: invert(1);
  opacity: 0.8;
}

[data-theme="light"] .global-flash-message .btn-close {
  filter: none;
}

@keyframes flash-slide-in {
  from {
    transform: translateY(-8px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .flash-message-viewport { padding: 0.85rem; }

  .global-flash-message {
    width: min(94vw, 560px);
    padding: 0.72rem 0.82rem;
    font-size: 0.9rem;
  }
}

.access-stat-card {
  height: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.access-stat-label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.access-stat-value {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
}

.access-table-card {
  overflow: hidden;
}

.access-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.access-table thead th {
  color: var(--secondary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom-width: 1px;
  border-color: rgba(255, 255, 255, 0.08);
  padding: 0.55rem 0.9rem;
}

.access-table tbody td {
  padding: 0.55rem 0.9rem;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.access-table tbody tr {
  transition: background 0.18s ease, transform 0.18s ease;
}

.access-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.access-user-cell {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.access-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #8562d6);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.access-user-name {
  color: var(--text);
  display: block;
  margin-bottom: 0.12rem;
}

.access-user-meta,
.access-security-text,
.access-date,
.access-delete-target,
.access-muted {
  color: var(--text-muted);
}

.access-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.access-status-badge.is-active {
  background: rgba(62, 207, 142, 0.16);
  color: #9bf1c9;
}

.access-status-badge.is-disabled {
  background: rgba(255, 255, 255, 0.08);
  color: #c9cad8;
}

.access-mini-btn {
  min-width: 78px;
}

.access-modal-content {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.access-pre {
  background: var(--surface2);
  color: var(--text);
  white-space: pre-wrap;
}

.modal-header,
.modal-footer {
  border-color: var(--border) !important;
}

.form-check-input {
  background-color: var(--surface2);
  border-color: var(--border);
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-label {
  color: var(--text);
}

@media (max-width: 767.98px) {
  .access-table thead {
    display: none;
  }

  .access-table tbody tr {
    display: block;
    margin-bottom: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
  }

  .access-table tbody td {
    display: block;
    text-align: left !important;
    border: 0;
    padding: 0.45rem 0.75rem;
  }
}

.home-tool-card {
  padding: 0.75rem !important;
}

.profile-hit-card {
  transition: transform 0.15s, border-color 0.15s;
  cursor: pointer;
}

.profile-hit-card:hover {
  transform: translateY(-2px);
}

.profile-hit-found {
  border-color: var(--success) !important;
}

.profile-hit-maybe {
  opacity: 0.65;
}

/* Calm unique button colors — one per homepage card */
.btn-home-1 { background: #2a9d8f; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-1:hover { background: #21867a; color: #fff; }
.btn-home-2 { background: #b07d3a; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-2:hover { background: #956933; color: #fff; }
.btn-home-3 { background: #4a7fcb; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-3:hover { background: #3a6ab0; color: #fff; }
.btn-home-4 { background: #3a9e72; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-4:hover { background: #2f8560; color: #fff; }
.btn-home-5 { background: #b06040; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-5:hover { background: #945035; color: #fff; }
.btn-home-6 { background: #7258a8; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-6:hover { background: #5e4890; color: #fff; }
.btn-home-7 { background: #a8546a; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-7:hover { background: #8e4459; color: #fff; }
.btn-home-8 { background: #3a7fa0; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-8:hover { background: #2e6a87; color: #fff; }
.btn-home-9 { background: #5a6abf; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-9:hover { background: #4a58a8; color: #fff; }
.btn-home-10 { background: #5d8f52; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-10:hover { background: #4d7844; color: #fff; }
.btn-home-11 { background: #8d5e78; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-11:hover { background: #764d64; color: #fff; }
.btn-home-12 { background: #6a9d47; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-12:hover { background: #5a863d; color: #fff; }
.btn-home-13 { background: #8d6246; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-13:hover { background: #77513b; color: #fff; }
.btn-home-15 { background: #c84e40; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-15:hover { background: #a03d32; color: #fff; }
.btn-home-16 { background: #d4a520; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-16:hover { background: #a68117; color: #fff; }
.btn-home-17 { background: #6b8a4f; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-17:hover { background: #536640; color: #fff; }
.btn-home-18 { background: #c0602a; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-18:hover { background: #9f4f22; color: #fff; }
.btn-home-19 { background: #2a7ac0; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-19:hover { background: #22649d; color: #fff; }
.btn-home-20 { background: #5a3a9e; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-20:hover { background: #482f7f; color: #fff; }
.btn-home-21 { background: #c04a7c; border: none; color: #fff; border-radius: var(--bs-border-radius); font-weight: 600; padding: 0.6rem 1.5rem; }
.btn-home-21:hover { background: #9a3b60; color: #fff; }

.ocr-preview-wrap {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.65rem;
  background: var(--surface2);
}

.ocr-text-block {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  max-height: 420px;
  overflow: auto;
}

.home-tool-card .tool-icon {
  font-size: 1.65rem;
}

.home-tool-card p {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  line-height: 1.35;
  max-height: calc(1.35em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-tool-card h5,
.intel-result-card h5 {
  color: var(--text);
}

.page-shell {
  padding: 2rem 0 3rem;
}

.intel-panel,
.intel-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.intel-panel {
  padding: 1.25rem;
  position: sticky;
  top: 1.5rem;
}

.intel-label {
  color: var(--secondary);
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.intel-input,
.intel-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}

.form-control,
.form-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}

.form-control::placeholder,
.form-select::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-control:focus,
.form-select:focus {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(108, 63, 197, 0.18);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text);
  opacity: 1;
}

.form-control:disabled::placeholder,
.form-control[readonly]::placeholder {
  color: var(--text-muted);
}

.form-label {
  color: var(--secondary);
  font-weight: 700;
}

.intel-input:focus,
.intel-select:focus {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(108, 63, 197, 0.18);
}

.intel-result-card {
  padding: 1rem;
  height: auto;
}

.result-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-stack .intel-result-card {
  margin-bottom: 0 !important;
}

.intel-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.intel-empty {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.01);
}

.source-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.app-loader {
  position: fixed;
  inset: 0;
  background: rgba(14, 14, 26, 0.65);
  backdrop-filter: blur(2px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.app-loader.show {
  display: flex;
}

.app-loader-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 170px;
  justify-content: center;
}

.app-loader .spinner-border {
  width: 1.1rem;
  height: 1.1rem;
}

.dns-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
}

.dns-record-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  padding: 0.65rem;
}

.dns-record-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
}

.dns-record-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.dns-record-count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.dns-record-values {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dns-value-item {
  font-size: 0.84rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
  background: var(--surface);
  color: var(--text);
  word-break: break-word;
}

.owner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.owner-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  padding: 0.7rem;
}

.owner-card h6 {
  margin-bottom: 0.55rem;
  color: var(--secondary);
  font-weight: 700;
}

.contact-line {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 0.35rem;
}

.contact-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.contact-val {
  font-size: 0.86rem;
  color: var(--text);
  word-break: break-word;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem;
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-bottom: 0.3rem;
}

.metric-value {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.metric-danger {
  color: var(--danger);
}

.archiver-result {
  overflow: hidden;
}

.archiver-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.archiver-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.65rem;
}

.archiver-meta-item {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
}

.archiver-meta-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.archiver-meta-value {
  color: var(--text);
  font-size: 0.85rem;
  word-break: break-word;
}

.archiver-actions {
  padding-bottom: 0.2rem;
}

.archiver-preview-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.35rem;
  background: var(--surface2);
}

.archiver-preview {
  border: 1px solid var(--border);
  max-height: 420px;
  width: 100%;
  object-fit: contain;
}

.archiver-recent-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  padding: 0.55rem 0.65rem;
}

.archiver-recent-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.archiver-recent-url {
  font-size: 0.82rem;
  color: var(--text);
  word-break: break-word;
}

.result-hl {
  background: var(--secondary);
  color: #111;
  padding: 0 0.2rem;
  border-radius: 4px;
}

/* ── Dark mode: fix invisible icons ───────────────────────────── */

/* Bootstrap .btn-close uses a dark SVG — invert it in dark mode */
:root .btn-close {
  filter: invert(1) grayscale(1) brightness(1.8);
  opacity: 0.75;
}
[data-theme="light"] .btn-close {
  filter: none;
  opacity: 0.55;
}
/* Exception: flash messages already handle their own btn-close */
:root .global-flash-message .btn-close {
  filter: invert(1);
  opacity: 0.8;
}
[data-theme="light"] .global-flash-message .btn-close {
  filter: none;
  opacity: 0.8;
}

/* Browser-native date/month/time picker icons — set color-scheme so
   the calendar/clock icon uses the light variant on dark backgrounds */
:root input[type="date"],
:root input[type="month"],
:root input[type="time"],
:root input[type="datetime-local"],
:root input[type="week"] {
  color-scheme: dark;
}
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="month"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="datetime-local"],
[data-theme="light"] input[type="week"] {
  color-scheme: light;
}
