:root {
  color-scheme: dark;
  --bg: #0b0f17;
  --panel: #111827;
  --panel-2: #162032;
  --border: #232f42;
  --border-light: #2d3d54;
  --text: #f1f5f9;
  --text-bright: #ffffff;
  --muted: #94a3b8;
  --muted-dark: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-2: #60a5fa;
  --danger: #ef4444;
  --danger-bg: #221214;
  --danger-border: #7f1d1d;
  --danger-text: #fca5a5;
  --success: #10b981;
  --success-bg: #0c271e;
  --success-border: #047857;
  --success-text: #6ee7b7;
  --code: #070a0f;
  --code-text: #e2e8f0;
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  min-height: 36px;
  padding: 0 14px;
  font-weight: 500;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

button:hover {
  border-color: var(--accent);
  background: #1c273c;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button[type="submit"],
#saveRuleBtn,
#saveDecoderBtn,
#saveFeedBtn,
#saveExporterBtn,
.user-form button {
  background: var(--accent);
  border-color: var(--accent-hover);
  color: #ffffff;
  font-weight: 600;
}

button[type="submit"]:hover,
#saveRuleBtn:hover,
#saveDecoderBtn:hover,
#saveFeedBtn:hover,
#saveExporterBtn:hover,
.user-form button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-2);
}

.danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.danger:hover {
  background: #7f1d1d;
  border-color: #dc2626;
  color: #ffffff;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 20px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--border);
  background: #0f1522;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #070a0f;
  padding: 4px;
}

.tabs a {
  color: var(--muted);
  text-decoration: none;
  border-radius: 5px;
  padding: 7px 12px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  transition: color 120ms ease, background 120ms ease;
}

.tabs a:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.05);
}

.tabs a.active {
  background: #1e293b;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ── Topbar User Dropdown ── */
.user-dropdown-container {
  position: relative;
  display: inline-block;
}

.user-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 5px 12px;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease;
  outline: none;
  min-height: 34px;
}

.user-dropdown-btn:hover,
.user-dropdown-btn.active {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.user-avatar-icon {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(56, 189, 248, 0.15);
  border-radius: 50%;
  color: #38bdf8;
}

.user-email-label {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chevron {
  font-size: 10px;
  color: #94a3b8;
  transition: transform 140ms ease;
}

.user-dropdown-btn.active .user-chevron {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: #0d1424;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 8px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: dropdownFadeIn 130ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.user-dropdown-menu[hidden] {
  display: none !important;
}

.user-dropdown-header {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.user-dropdown-email {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  word-break: break-all;
  line-height: 1.3;
}

.user-role-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
}

.user-role-badge.role-admin {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.user-role-badge.role-user {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.user-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 2px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 120ms ease;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.user-dropdown-logout {
  color: #f87171 !important;
}

.user-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

.dropdown-item-icon {
  font-size: 15px;
  line-height: 1;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 750;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 15px;
  font-weight: 700;
}

.topbar p {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

/* ── Global Toast Notification ── */
.global-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0d1424;
  color: #f1f5f9;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 15px rgba(56, 189, 248, 0.15);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(8px);
}

.global-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.global-toast.toast-error {
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  background: #180d14;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 15px rgba(239, 68, 68, 0.15);
}

.global-toast.toast-info {
  border-color: rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  padding: 20px clamp(18px, 4vw, 48px) 42px;
}

.analyze-layout {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  min-height: calc(100vh - 130px);
  padding: 24px clamp(18px, 3.5vw, 42px) 36px;
}

@media (max-width: 960px) {
  .analyze-layout {
    grid-template-columns: 1fr;
  }
}

.library-layout {
  grid-template-columns: 1fr;
}

.latest-layout {
  grid-template-columns: 1fr;
  align-items: stretch;
  min-height: calc(100vh - 126px);
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  min-width: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header-icon {
  font-size: 18px;
}

.panel-title-group h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  margin: 0;
}

.library-pill {
  font-size: 11px;
  font-weight: 600;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  padding: 3px 10px;
}

.result-meta-pill {
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 999px;
  padding: 3px 10px;
}

.viewer-action-btn {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  font-weight: 600 !important;
  transition: all 120ms ease;
}

.viewer-action-btn:hover {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: #38bdf8 !important;
  color: #fff !important;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── Intake Body ── */
.intake-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Modern Drop Zone ── */
.upload-zone-modern {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drop-zone-prompt {
  border: 2px dashed rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.5);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.drop-zone-prompt:hover,
.drop-zone-prompt:focus-visible,
.drop-zone-prompt.drag-over {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.2);
  transform: translateY(-1px);
}

.drop-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: grid;
  place-items: center;
  transition: transform 160ms ease, background 160ms ease;
}

.drop-zone-prompt:hover .drop-icon-wrap {
  transform: scale(1.08);
  background: rgba(56, 189, 248, 0.18);
}

.drop-icon {
  font-size: 24px;
  color: #38bdf8;
}

.drop-text-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drop-title {
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
}

.browse-link {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.drop-subtitle {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  max-width: 320px;
}

.format-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.format-chips .chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  font-family: "SFMono-Regular", Consolas, monospace;
}

/* ── Selected File Card ── */
.selected-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: #0c1424;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  animation: fadeIn 150ms ease;
}

.file-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.file-card-icon {
  font-size: 24px;
}

.file-card-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.file-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  font-family: "SFMono-Regular", Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.file-card-size {
  font-size: 11px;
  color: var(--muted);
}

.clear-file-btn {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  min-height: auto;
  line-height: 1;
  transition: all 120ms ease;
}

.clear-file-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

/* ── Submit Button ── */
.analyze-submit-btn {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 140ms ease;
}

.analyze-submit-btn:hover {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

/* ── Intake Divider ── */
.intake-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.divider-text {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Modern Hash Zone ── */
.hash-zone-modern {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hash-input-wrapper {
  display: flex;
  align-items: center;
  background: #080c14;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 3px 4px 3px 12px;
  gap: 8px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.hash-input-wrapper:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.hash-input-wrapper .search-icon {
  font-size: 13px;
  opacity: 0.6;
}

.hash-input-wrapper input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: #f1f5f9;
  font-size: 13px;
  font-family: "SFMono-Regular", Consolas, monospace;
  min-height: 36px;
  padding: 0;
}

.hash-submit-btn {
  background: #1e293b;
  color: #93c5fd;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  padding: 0 14px;
  min-height: 34px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 120ms ease;
}

.hash-submit-btn:hover {
  background: #2563eb;
  color: #fff;
  border-color: transparent;
}

.hash-hint {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  padding-left: 2px;
}

/* ── Result Panel & Empty State ── */
.result-panel {
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.result-empty-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
}

.empty-graphic {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.empty-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(56, 189, 248, 0.25);
  animation: rotateRing 25s linear infinite;
}

@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.empty-emoji {
  font-size: 36px;
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.35));
}

.result-empty-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 8px;
}

.result-empty-card p {
  font-size: 13px;
  color: var(--muted);
  max-width: 440px;
  margin: 0 0 28px;
  line-height: 1.5;
}

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 520px;
  width: 100%;
}

@media (max-width: 640px) {
  .capabilities-grid {
    grid-template-columns: 1fr;
  }
}

.capability-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
}

.cap-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.cap-text strong {
  display: block;
  font-size: 12px;
  color: #e2e8f0;
  font-weight: 600;
}

.cap-text span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Analysis Loading State Card ── */
.analysis-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  min-height: 380px;
  gap: 14px;
}

.analysis-loading-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: #38bdf8;
  margin: 0;
}

.analysis-loading-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(56, 189, 248, 0.15);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ══════════════════════════════════════════════════════════════════
   SUCCESSFULLY DECODED SAMPLES WITH MATCHES PANEL
   ══════════════════════════════════════════════════════════════════ */

.decoded-matches-panel {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

.count-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.table-search-box {
  display: flex;
  align-items: center;
  background: #090e18;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 2px 6px 2px 10px;
  gap: 6px;
  transition: border-color 140ms ease;
}

.table-search-box:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.table-search-box input {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 12px;
  width: 240px;
  padding: 4px 0;
}

.clear-mini-btn {
  background: transparent;
  border: 0;
  color: #64748b;
  cursor: pointer;
  padding: 2px;
  font-size: 12px;
  min-height: auto;
  line-height: 1;
}

.clear-mini-btn:hover {
  color: #f1f5f9;
}

.decoded-matches-body {
  padding: 16px 20px 24px;
}

.decoded-cards-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Individual Decoded Sample Card ── */
.decoded-sample-card {
  background: #0d1424;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.decoded-sample-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.decoded-sample-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.decoded-sample-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.family-badge {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(14, 165, 233, 0.3) 100%);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

.sample-name-link {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.sample-meta-pill {
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

.decoded-sample-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-card-action {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: all 120ms ease;
}

.btn-card-action:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #fff;
}

.btn-card-action-primary {
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

.btn-card-action-primary:hover {
  background: #2563eb;
  color: #fff;
}

/* ── Meta & Signatures Row ── */
.decoded-sample-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.yara-pill {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 4px;
  padding: 2px 7px;
  font-weight: 600;
}

.decoder-pill {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 4px;
  padding: 2px 7px;
  font-weight: 600;
}

.hash-chip-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

/* ── Extracted Matches Box ── */
.decoded-matches-box {
  background: #080c14;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matches-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 6px 12px;
}

.match-item-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
}

.match-item-key {
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

.match-item-val {
  color: #f1f5f9;
  font-family: "SFMono-Regular", Consolas, monospace;
  word-break: break-all;
  text-align: right;
}

.match-item-val.highlight-c2 {
  color: #38bdf8;
  font-weight: 600;
}

.matches-raw-text {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
}

.code-output,
textarea {
  width: 100%;
  background: var(--code);
  color: var(--code-text);
  border: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.code-output {
  min-height: 360px;
  margin: 0;
  padding: 16px;
  overflow: auto;
}

.library {
  grid-column: 1 / -1;
}

.library-layout .library {
  grid-column: auto;
}

.split {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 190px);
}

.list {
  border-right: 1px solid var(--border);
  background: #0a0e16;
  overflow: auto;
}

.list button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #162032;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 12px 16px;
  transition: background 120ms ease, color 120ms ease;
}

.list button:hover {
  background: #131b29;
  border-color: #162032;
}

.list button.active {
  background: #1e293b;
  color: #ffffff;
  border-left: 3px solid var(--accent);
}

.list small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-size: 12px;
}

.editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background: var(--panel);
}

.editor > input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 12px 16px;
  outline: none;
  font-size: 14px;
}

.editor > input:focus {
  background: #1a2538;
}

.editor textarea {
  flex: 1;
  min-height: 320px;
  resize: vertical;
  padding: 16px;
  border: 0;
  outline: none;
  background: var(--code);
}

.code-editor-container {
  display: flex;
  position: relative;
  flex: 1;
  min-height: 380px;
  background: var(--code);
  border-top: 1px solid var(--border);
  overflow: hidden;
  resize: vertical;
}

.editor-gutter {
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
  width: 44px;
  padding: 14px 10px 14px 8px;
  text-align: right;
  color: var(--muted-dark);
  background: #090e17;
  border-right: 1px solid var(--border);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 13px;
  line-height: 21px;
  overflow: hidden;
  box-sizing: border-box;
  white-space: pre;
  cursor: pointer;
}

.code-editor-container textarea {
  flex: 1;
  min-height: 100%;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--code-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 13px;
  line-height: 21px;
  white-space: pre;
  overflow-wrap: normal;
  overflow: auto;
  box-sizing: border-box;
  tab-size: 4;
  -moz-tab-size: 4;
  resize: none;
}

.editor-stats {
  margin-right: auto;
  align-self: center;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
  user-select: none;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
}

/* ── YARA Rules Library & Editor ── */
.library-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #0a0e16;
  min-height: 0;
}

.rule-search-box {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #090e17;
  flex-shrink: 0;
}

.rule-search-box input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0c121e;
  color: var(--text);
  font-size: 12px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.rule-search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.rule-nav-list {
  flex: 1;
  overflow-y: auto;
  border-right: 0;
}

.rule-list-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid #162032;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease;
}

.rule-list-item:hover {
  background: #131b29;
}

.rule-list-item.active {
  background: #1e293b;
  color: #ffffff;
  border-left: 3px solid var(--accent);
}

.rule-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}

.rule-icon-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  letter-spacing: 0.03em;
}

.rule-item-meta {
  color: var(--muted);
  font-size: 11px;
}

.rule-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.rule-editor .editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  padding: 32px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.auth-panel p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #090d14;
  color: var(--text);
  min-height: 40px;
  padding: 0 12px;
  outline: none;
  transition: border-color 120ms ease;
}

.auth-form input:focus {
  border-color: var(--accent);
}

.auth-form button {
  margin-top: 8px;
  background: var(--accent);
  border-color: var(--accent-hover);
  color: #ffffff;
  font-weight: 600;
}

.auth-form button:hover {
  background: var(--accent-hover);
}

.auth-message {
  color: var(--danger-text);
  min-height: 22px;
  font-size: 13px;
}

.dev-link {
  color: var(--accent-2);
  overflow-wrap: anywhere;
}

/* ── User Management Page ── */
.user-panel {
  overflow: hidden;
}

.user-form {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) minmax(180px, 0.9fr) auto;
  gap: 14px;
  align-items: flex-end;
  padding: 16px 20px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}

.user-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-form .form-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-form .form-field input,
.user-form .form-field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #090d14;
  color: var(--text);
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.user-form .form-field input:focus,
.user-form .form-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.user-form .form-field-action button {
  min-height: 38px;
  white-space: nowrap;
  padding: 0 18px;
}

.user-list {
  display: flex;
  flex-direction: column;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 120ms ease;
}

.user-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.user-row:last-child {
  border-bottom: 0;
}

.user-profile-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar-admin {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.25));
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.35);
}

.avatar-user {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(14, 165, 233, 0.25));
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.35);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.user-email-text {
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 600;
}

.user-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-role-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.role-admin {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.role-user {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.user-locked-pill {
  font-size: 11px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.task-panel,
.task-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 186px);
}

.task-detail-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  width: min(720px, calc(100vw - 36px));
  min-height: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-light);
  transform: translateX(calc(100% + 24px));
  transition: transform 180ms ease;
  background: var(--panel);
}

.task-detail-panel.open {
  transform: translateX(0);
}

.task-list {
  display: block;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.task-result-view {
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 18px;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.analyze-layout .result-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.result-field {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #0c111a;
  padding: 10px 14px;
}

.result-field span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-field strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-bright);
}

.danger-field strong {
  color: var(--danger-text);
}

.mono-field strong,
.scalar-value {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

.result-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
}

.result-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
}

.hash-grid {
  display: grid;
  gap: 8px;
}

.decompiler-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.decompiler-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #0c111a;
  padding: 9px 12px;
}

.decompiler-item.ok {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
}

.decompiler-item span {
  border-radius: 999px;
  background: #231214;
  color: var(--danger-text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  text-transform: uppercase;
}

.decompiler-item.ok span {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-text);
}

.decompiler-item p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.extracted-file-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.extracted-file-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
}

.source-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: 12px 0 6px;
}

.source-output {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--code);
  color: var(--code-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  padding: 14px;
}

.value-table {
  display: grid;
  gap: 8px;
}

.value-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #0c111a;
  padding: 9px 12px;
}

.value-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.value-list {
  display: grid;
  gap: 8px;
}

.value-list-item {
  min-width: 0;
}

.scalar-value {
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #131b29;
  color: #cbd5e1;
  padding: 2px 8px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 12px;
}

.muted-value {
  color: var(--muted);
}

.match-list,
.error-list {
  display: grid;
  gap: 10px;
}

.match-card,
.error-list > div {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #0c111a;
  padding: 10px 14px;
}

.match-card > strong,
.match-card > span {
  display: block;
}

.match-card > span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip-list span {
  border-radius: 999px;
  background: #1e293b;
  color: #93c5fd;
  border: 1px solid #334155;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  text-transform: uppercase;
}

.error-list > div {
  border-color: var(--danger-border);
  color: var(--danger-text);
  background: var(--danger-bg);
}

.task-table-header,
.task-row {
  display: grid;
  grid-template-columns: 140px minmax(160px, 1fr) minmax(120px, 0.6fr) minmax(0, 0.7fr) minmax(0, 0.85fr) 86px 92px;
  gap: 14px;
  align-items: center;
  width: 100%;
}

.task-table-header {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--border);
  background: #0f1522;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 14px 18px;
}

.task-row {
  min-height: 60px;
  border: 0;
  border-bottom: 1px solid #162032;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  padding: 12px 18px;
  transition: background 120ms ease;
}

.task-row:hover {
  background: #131b29;
}

.task-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.task-row.active {
  background: #1e293b;
}

.task-date {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.task-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.task-hash {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  line-height: 1.35;
}

.task-status {
  justify-self: start;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
  border-radius: 999px;
  color: var(--success-text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  text-transform: uppercase;
}

.task-status.error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-text);
}

.download-action,
.icon-action {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 13px;
}

.download-action {
  justify-self: end;
}

.empty-state {
  color: var(--muted);
  padding: 24px;
  font-size: 14px;
}

@media (max-width: 1200px) {
  .task-table-header,
  .task-row {
    grid-template-columns: 140px minmax(180px, 1fr) minmax(140px, 0.7fr) 86px 92px;
  }

  .task-table-header span:nth-child(4),
  .task-table-header span:nth-child(5),
  .task-row code:nth-of-type(2),
  .task-row code:nth-of-type(3) {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar,
  .layout,
  .upload-zone,
  .hash-zone,
  .split {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
  }

  .list {
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .user-form {
    grid-template-columns: 1fr;
  }

  .user-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-panel,
  .task-detail-panel {
    display: grid;
    min-height: auto;
  }

  .task-detail-panel {
    top: 10px;
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .task-list {
    max-height: 360px;
  }

  .task-table-header,
  .task-row {
    min-width: 0;
  }

  .task-table-header,
  .task-row {
    grid-template-columns: 118px minmax(150px, 1fr) minmax(120px, 0.8fr) 86px;
  }

  .task-table-header span:nth-child(4),
  .task-table-header span:nth-child(5),
  .task-table-header span:nth-child(6),
  .task-row code:nth-of-type(2),
  .task-row code:nth-of-type(3),
  .task-status {
    display: none;
  }

  .result-summary,
  .value-row {
    grid-template-columns: 1fr;
  }
}

/* ── Feed & Exporter Editor Styles ── */
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  padding: 0 16px 0 0;
  min-height: 48px;
}

.editor-header .feed-name-input {
  flex: 1;
  min-width: 160px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-bright);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 550;
  outline: none;
}

.editor-header .feed-name-input:focus {
  background: rgba(255, 255, 255, 0.02);
}

.feed-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.feed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--muted);
  transition: color 120ms ease;
}

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

.feed-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.feed-interval {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}

.feed-interval input[type="number"] {
  width: 54px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #090d14;
  color: var(--text-bright);
  text-align: center;
  font-size: 13px;
  outline: none;
  transition: border-color 120ms ease;
}

.feed-interval input[type="number"]:focus {
  border-color: var(--accent);
}

.feed-status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--muted);
  background: #0a0e16;
  border-bottom: 1px solid var(--border);
  min-height: 36px;
}

.feed-status-bar.status-ok {
  background: rgba(16, 185, 129, 0.08);
  border-bottom-color: rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
}

.feed-status-bar.status-err {
  background: rgba(239, 68, 68, 0.08);
  border-bottom-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.feed-error-msg {
  color: var(--danger-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 450px;
}

.feed-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 6px;
}

.feed-badge.feed-ok {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--success-text);
}

.feed-badge.feed-err {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--danger-text);
}

.feed-badge.feed-none {
  background: #1e293b;
  border: 1px solid #334155;
  color: var(--muted);
}

.disabled-feed {
  opacity: 0.55;
}

.feed-editor .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-run {
  background: #1e293b;
  border: 1px solid #3b82f6;
  color: #93c5fd;
  font-weight: 600;
  padding: 8px 16px;
  transition: all 120ms ease;
}

.btn-run:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent-hover);
  color: #ffffff;
}

/* ── Tools & Execution Panel Styles ── */
.tool-api-hint {
  font-size: 12px;
  color: var(--muted);
}

.tool-api-hint code {
  color: var(--accent-2);
  background: #090d14;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.tool-execution-section {
  border-top: 1px solid var(--border);
  background: #0b1019;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.execution-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.execution-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #cbd5e1;
}

.muted-note {
  font-size: 12px;
  color: var(--muted);
}

.tool-multi-select-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-multi-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.select-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
}

.tool-select-quick-actions {
  display: flex;
  gap: 6px;
}

.small-btn {
  font-size: 11px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 4px;
  background: #162032;
  border: 1px solid var(--border-light);
  color: var(--muted);
}

.small-btn:hover {
  color: var(--text-bright);
  border-color: var(--accent);
}

.tools-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 140px;
  overflow-y: auto;
  padding: 8px;
  background: #090d14;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.tool-check-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #111827;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: border-color 120ms ease, background 120ms ease;
}

.tool-check-item:hover {
  border-color: var(--accent);
  background: #162032;
}

.tool-check-item.selected {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
  color: #fff;
}

.tool-check-item input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
}

.tool-batch-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-batch-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}

.tool-batch-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.tool-batch-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

.tool-batch-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}


.execution-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
}

.execution-target-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.execution-target-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.execution-target-group input[type="file"] {
  font-size: 12px;
  color: var(--text);
}

.execution-target-group select {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #090d14;
  color: var(--text);
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}

.or-separator {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-dark);
  text-transform: uppercase;
}

.tool-run-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tool-run-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.output-files-box {
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
  border-radius: 8px;
  padding: 14px 16px;
}

.output-files-box h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--success-text);
}

.output-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.output-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #0c111a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
}

.output-file-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.output-file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.output-file-size {
  font-size: 11px;
  color: var(--muted);
}

.output-file-download {
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: background 120ms ease;
}

.output-file-download:hover {
  background: var(--accent-hover);
}

.console-box h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.tool-logs {
  min-height: 120px;
  max-height: 260px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* ── Modal Dialog Styles ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: min(640px, 100%);
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.modal-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.dep-install-form {
  display: flex;
  gap: 10px;
}

.dep-install-form input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #090d14;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}

.dep-install-form input:focus {
  border-color: var(--accent);
}

.dep-status {
  font-size: 12px;
  min-height: 20px;
}

.installed-deps-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.installed-deps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.installed-deps-header h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.installed-deps-header input {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #090d14;
  color: var(--text);
  padding: 4px 8px;
  font-size: 12px;
  width: 180px;
  outline: none;
}

.dep-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  background: #090d14;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.dep-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #162032;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--text);
}

.dep-chip-version {
  color: var(--accent-2);
  font-family: monospace;
  font-size: 11px;
}

.tool-task-overview-box {
  background: var(--panel-2, #0d131f);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-tools-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-select-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.highlight-pulse {
  animation: highlightPulse 1.2s ease-out;
  border-color: var(--accent) !important;
}

/* ── Change Password Modal & Actions ── */
.modal-form-vertical {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.modal-form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
}

.modal-form-group input {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #090d14;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 120ms ease;
}

.modal-form-group input:focus {
  border-color: var(--accent);
}

.modal-actions-right {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 120ms ease;
}

.btn-cancel:hover {
  color: var(--text-bright);
  border-color: var(--border-light);
  background: rgba(255, 255, 255, 0.05);
}

.form-feedback {
  font-size: 12px;
  min-height: 18px;
  line-height: 1.4;
}

.form-feedback.error {
  color: #f87171;
}

.form-feedback.success {
  color: #34d399;
}

.user-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.topbar-btn:hover {
  color: var(--text-bright);
  border-color: var(--border-light);
  background: rgba(255, 255, 255, 0.05);
}

/* ══════════════════════════════════════════════════════════════════
   BINARY SAMPLE VIEWER / REVERSE ENGINEERING WORKBENCH (FULL-VIEWPORT)
   ══════════════════════════════════════════════════════════════════ */

html:has(body[data-page="viewer"]),
body[data-page="viewer"] {
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body[data-page="viewer"] {
  display: flex;
  flex-direction: column;
}

body[data-page="viewer"] .topbar {
  flex-shrink: 0;
  padding: 8px clamp(16px, 2.5vw, 28px);
}

body[data-page="viewer"] .topbar h1 {
  font-size: 16px;
  line-height: 1.2;
}

body[data-page="viewer"] .topbar p {
  display: none;
}

.viewer-layout {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px clamp(16px, 2.5vw, 28px) 8px;
  overflow: hidden;
}

/* ── Sleek Compact Toolbar ── */
.viewer-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.viewer-toolbar.drag-over {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1.4;
  min-width: 280px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sample-picker-box {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.toolbar-icon {
  position: absolute;
  left: 10px;
  font-size: 15px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}

.toolbar-select {
  width: 100%;
  background: #0b1120;
  color: var(--text-bright);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all 140ms ease;
}

.toolbar-select:focus,
.toolbar-select:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: #0e172a;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  color: var(--text-bright);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}

.toolbar-btn:hover {
  background: #334155;
  border-color: rgba(56, 189, 248, 0.4);
  color: #fff;
}

.toolbar-search-input-wrap {
  display: flex;
  align-items: center;
  background: #0b1120;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 2px 4px 2px 10px;
  transition: border-color 140ms ease;
}

.toolbar-search-input-wrap:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.toolbar-search-input-wrap .search-icon {
  font-size: 12px;
  opacity: 0.6;
  margin-right: 6px;
}

.toolbar-search-input-wrap input {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
  width: 200px;
  padding: 5px 0;
}

.toolbar-btn-compact {
  background: #1e293b;
  color: #93c5fd;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 120ms ease;
}

.toolbar-btn-compact:hover {
  background: #2563eb;
  color: #fff;
}

/* ── Empty State ── */
.empty-viewer-state {
  padding: 80px 24px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed rgba(56, 189, 248, 0.25);
  background: rgba(15, 23, 42, 0.4);
}

.empty-state-content {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.empty-icon-wrap {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 50%;
  margin-bottom: 4px;
}

.empty-icon {
  font-size: 36px;
}

.empty-state-content h2 {
  font-size: 18px;
  color: var(--text-bright);
  font-weight: 700;
  margin: 0;
}

.empty-state-content p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.action-btn-primary {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 140ms ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.action-btn-primary:hover {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

/* ── Active Viewer Container ── */
.viewer-active-container {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

/* ── Reversing Identity & Telemetry Hero Strip ── */
.sample-hero-strip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #111b2e 0%, #0b1322 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sample-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-type-icon {
  font-size: 18px;
}

.sample-name {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
  margin: 0;
  word-break: break-all;
}

.size-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-action-btn {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  min-height: 26px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 120ms ease;
  white-space: nowrap;
}

.hero-action-btn:hover {
  background: #1e293b;
  border-color: #38bdf8;
  color: #fff;
}

/* ── Telemetry Row (Hashes + Entropy) ── */
.hero-telemetry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.telemetry-hash-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hash-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 6px;
}

.hash-tag {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hash-string {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  color: #e2e8f0;
}

.copy-mini-btn {
  background: transparent;
  border: 0;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 2px;
  font-size: 10px;
  min-height: auto;
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.copy-mini-btn:hover {
  opacity: 1;
  color: #38bdf8;
}

.telemetry-entropy-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.entropy-label {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.entropy-widget {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.entropy-bar-track {
  width: 70px;
  height: 5px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}

.entropy-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 300ms ease, background-color 300ms ease;
}

.entropy-low { background: #10b981; }
.entropy-mid { background: #f59e0b; }
.entropy-high { background: #ef4444; }

.entropy-val {
  font-size: 11px;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: #f1f5f9;
}

.entropy-scale {
  font-size: 10px;
  color: #64748b;
}

/* ── Sub-Tabs Navigation Strip ── */
.sub-tabs-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 3px 5px;
  overflow-x: auto;
}

.sub-tab-btn {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  min-height: 28px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 140ms ease;
}

.sub-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.sub-tab-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.sub-tab-btn.tab-highlight {
  color: #c084fc;
}

.sub-tab-btn.tab-highlight.active {
  color: #e879f9;
  background: rgba(192, 132, 252, 0.15);
  border-color: rgba(192, 132, 252, 0.35);
}

.tab-icon {
  font-size: 13px;
}

.tab-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: #1e293b;
  color: #94a3b8;
}

.tab-pill.active-pill {
  background: rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}

/* ── Sub-Tab Pane ── */
.sub-tab-pane {
  display: none;
  flex: 1 1 0;
  min-height: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel);
  overflow: hidden;
}

.sub-tab-pane.active {
  display: flex;
  flex-direction: column;
}

.tab-pane-content {
  flex: 1 1 0;
  min-height: 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

/* ── Block Headers ── */
.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.block-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.header-hint {
  font-size: 11px;
  color: var(--muted);
}

/* ── Tab 1: Binary Info Layout ── */
.info-columns-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.info-block {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
}

.properties-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.prop-key {
  color: var(--muted);
  font-size: 12px;
}

.prop-val {
  font-family: "SFMono-Regular", Consolas, monospace;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 500;
}

.indicators-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.indicator-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #f1f5f9;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #38bdf8;
}

.indicator-item.flag-warn {
  border-left-color: #ef4444;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
}

.indicator-item.flag-info {
  border-left-color: #10b981;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.08);
}

/* ── PE Sections Table ── */
.sections-block {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table th {
  background: #090e17;
  color: #94a3b8;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: "SFMono-Regular", Consolas, monospace;
  color: #cbd5e1;
}

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

.section-entropy-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-entropy-track {
  width: 60px;
  height: 5px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}

.section-entropy-fill {
  height: 100%;
  border-radius: 999px;
}

.entropy-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ── Hex Dump Block ── */
.hex-dump-block {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
}

.hex-output {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #93c5fd;
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
}

/* ── Tab 3: Decompiled Code / Disassembly ── */
.tab-pane-content.decompile-tab-content {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  overflow: hidden !important;
}

.decompile-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.decompile-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.decompile-title-group h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
  margin: 0;
}

.decompile-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.decompile-actions .small-btn {
  padding: 3px 8px;
  font-size: 11px;
  min-height: 26px;
}

#decompileNotes {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1.4;
  margin: 0;
}

.full-height-editor {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  width: 100%;
  display: flex;
  position: relative;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  overflow: hidden;
  background: #090e17;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: border-color 140ms ease;
}

.full-height-editor.editor-fullscreen {
  position: fixed;
  inset: 12px;
  width: auto;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  z-index: 9999;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85), 0 20px 50px rgba(0, 0, 0, 0.95);
  border: 1px solid #38bdf8;
}

.full-height-editor .editor-gutter {
  flex-shrink: 0;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 13px;
  line-height: 21px;
  padding: 10px 10px 10px 8px;
  overflow: hidden;
  background: #070b13;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
  color: #64748b;
  text-align: right;
}

.full-height-editor textarea {
  flex: 1 1 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  padding: 10px 14px;
  border: 0;
  outline: none;
  background: transparent;
  color: #f1f5f9;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 13px;
  line-height: 21px;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  overflow-y: scroll;
  box-sizing: border-box;
  tab-size: 4;
  -moz-tab-size: 4;
  resize: none;
}

.full-height-editor textarea::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.full-height-editor textarea::-webkit-scrollbar-track {
  background: #060911;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.full-height-editor textarea::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 6px;
  border: 2px solid #060911;
}

.full-height-editor textarea::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

.full-height-editor textarea::-webkit-scrollbar-corner {
  background: #060911;
}

.editor-status-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* ── Tab 4: Strings Toolbar & Table ── */
#tab-strings .tab-pane-content {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  gap: 8px;
  overflow: hidden;
}

.strings-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.strings-filter-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 260px;
  background: #0b1120;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 2px 6px 2px 10px;
}

.strings-filter-box:focus-within {
  border-color: #38bdf8;
}

.strings-filter-box input {
  flex: 1;
  background: transparent;
  color: var(--text);
  border: 0;
  outline: none;
  font-size: 13px;
  padding: 6px 0;
}

.strings-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.viewer-select-small {
  background: #0b1120;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
}

.strings-summary-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.category-badge-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cat-pill-btn {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 120ms ease;
}

.cat-pill-btn:hover,
.cat-pill-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #7dd3fc;
}

.strings-table-container {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: #080c14;
}

.strings-data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0c121e;
}

.string-cat-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.string-cat-badge.cat-url { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.string-cat-badge.cat-ip { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.string-cat-badge.cat-api { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.string-cat-badge.cat-registry { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }
.string-cat-badge.cat-file { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.string-cat-badge.cat-base64 { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.string-cat-badge.cat-general { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

/* ── Tab 5: FLOSS Strings Grid ── */
.floss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.floss-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.floss-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.floss-card.full-width {
  grid-column: 1 / -1;
}

.floss-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.floss-card-header h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.floss-card-body {
  flex: 1;
}

.floss-code {
  min-height: 200px;
  max-height: 320px;
  overflow-y: auto;
  border-radius: 0;
  margin: 0;
  background: #070a12;
  padding: 12px;
  font-size: 12px;
}

/* ══════════════════════════════════════════════════════════════
   Decoded Page Styles
   ══════════════════════════════════════════════════════════════ */
.decoded-page-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 24px 36px 24px;
  max-width: 1700px;
  margin: 0 auto;
  width: 100%;
}

/* ── Top Stats Row ── */
.decoded-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.decoded-stat-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.85) 0%, rgba(13, 20, 36, 0.7) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  transition: transform 140ms ease, border-color 140ms ease;
}

.decoded-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
}

.stat-icon {
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.1;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

/* ── Decoded Panel & Controls ── */
.decoded-main-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 250px);
}

.decoded-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 18px;
}

.decoded-controls-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.decoded-search-input {
  min-width: 280px;
}

.dropdown-filter {
  background: rgba(13, 20, 36, 0.95);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  height: 32px;
  transition: all 120ms ease;
}

.dropdown-filter:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.btn-order-toggle {
  background: rgba(30, 41, 59, 0.85);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  transition: all 140ms ease;
}

.btn-order-toggle:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}

.order-icon {
  font-size: 14px;
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  transition: all 120ms ease;
}

.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.decoded-page-body {
  padding: 16px;
}

/* ── Modal Dialog ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-dialog {
  background: #0b1120;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 120ms ease;
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  background: #070a12;
}

.modal-code {
  margin: 0;
  padding: 12px;
  background: transparent;
  font-size: 12px;
  line-height: 1.5;
  color: #38bdf8;
  max-height: 60vh;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}


.extracted-files-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.extracted-files-toolbar input { flex: 1; min-width: 180px; }
.extracted-files-table { width: 100%; max-height: 60vh; overflow: auto; }
.extracted-files-table table { width: 100%; table-layout: fixed; }
.extracted-files-table th:first-child { width: 70%; }
.extracted-files-table td:first-child { overflow-wrap: anywhere; font-family: monospace; }
.extracted-files-table th, .extracted-files-table td { padding: 12px 16px; }
.extracted-files-table th:last-child { width: 90px; }
.extracted-download { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; text-decoration: none; font-size: 20px; }
@media (max-width: 600px) {
  .extracted-files-table th:first-child { width: auto; }
  .extracted-files-table th:nth-child(2) { width: 70px; }
  .extracted-files-table th, .extracted-files-table td { padding: 10px 8px; }
}
.sample-tags-editor { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 0; }
.sample-tags-label { font-size: 12px; color: var(--muted); }
.sample-tags-list { display: inline-flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.sample-tag { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 4px; padding: 3px 7px; font-size: 12px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; white-space: normal; min-width: 0; max-width: 100%; }
.sample-tag button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; width: 20px; height: 20px; flex-shrink: 0; }
.sample-tag > span { min-width: 0; overflow-wrap: anywhere; }
.sample-tag-form { display: flex; gap: 6px; min-width: 0; }
.sample-tag-form input { width: 180px; min-width: 0; }
.sample-tag-form button { width: 32px; height: 32px; padding: 0; font-size: 20px; flex-shrink: 0; }
.sample-tags-editor [role="status"] { font-size: 12px; color: var(--muted); }
.task-filename .sample-tags-list { display: flex; margin-top: 4px; }
