:root {
  color-scheme: light;
  --bg: #fcf9f2; /* Солнечный песок */
  --surface: #ffffff;
  --surface-2: #fffcf5;
  --line: #e5dec9;
  --line-soft: #f1ede1;
  --text: #3d3429; /* Глубокий кофейный */
  --muted: #8a7d6e;
  --blue: #e2a84d; /* Золотое солнце */
  --blue-soft: #faf3e1;
  --green: #8b9d77;
  --green-soft: #f0f4eb;
  --red: #c27a3d;
  --red-soft: #f7ede4;
  --amber: #d6a94e;
  --amber-soft: #fbf4e4;
  --violet: #a68b6d;
  --violet-soft: #f5f0e9;
  --shadow: 0 14px 36px rgba(61, 52, 41, .06);
  --lepra-paper: #fdfaf3;
}

.theme-mosque {
  --bg: #2c241a; /* Глубокая ночь в пустыне */
  --surface: #3d3429;
  --surface-2: #4a4034;
  --text: #f2e9d9;
  --muted: #a68b6d;
  --line: #5c4b37;
  --line-soft: #6e5c47;
  --blue: #e9c46a; /* Яркое золото */
  --blue-soft: #4a4034;
  --green: #a3b18a;
  --red: #e76f51;
  --amber: #f4a261;
  --shadow: 0 14px 36px rgba(0, 0, 0, .4);
}

.theme-mosque .shell {
  background-image: linear-gradient(rgba(242, 233, 217, 0.9), rgba(242, 233, 217, 0.9)), url('https://www.transparenttextures.com/patterns/parchment.png');
}


/* Lepra / Paradise Entrance Styles */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000 url('/assets/paradise_entrance.png') center/cover no-repeat;
  font-family: Georgia, 'Times New Roman', serif;
}

.login-box {
  width: 100%;
  max-width: 380px;
  padding: 50px 40px;
  background: rgba(255, 255, 255, var(--opacity, 0.4));
  backdrop-filter: blur(var(--blur, 25px)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur, 25px)) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  text-align: center;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-box h1 {
  font-size: 28px;
  margin-bottom: 35px;
  font-weight: normal;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  letter-spacing: -0.5px;
}

.login-input {
  width: 100%;
  padding: 14px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
  border-radius: 8px;
  transition: border-color 0.2s;
}

.login-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.login-input:focus {
  border-color: rgba(255, 255, 255, 0.8);
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: #fff;
  color: #000;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  transition: all 0.2s;
}

.login-btn:hover {
  background: #eee;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.glass-controls {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.glass-controls label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.glass-controls input[type="range"] {
  width: 60%;
  accent-color: #fff;
}

.shell[hidden] {
  display: none;
}

.debug-details {
  margin-top: 20px;
  text-align: left;
}

.debug-details summary {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: color 0.2s;
}

.debug-details summary:hover {
  color: rgba(255, 255, 255, 0.8);
}

.debug-console {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 10px;
  height: 120px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10px;
  line-height: 1.4;
  backdrop-filter: blur(5px);
}

.debug-console::-webkit-scrollbar {
  width: 4px;
}
.debug-console::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}


* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255, 225, 100, .35) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 5%, rgba(255, 195, 70, .2) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 105%, rgba(240, 200, 120, .18) 0%, transparent 45%),
    linear-gradient(165deg, #fffef8 0%, #fdf8ea 30%, #fcf6e8 60%, #fdf9f2 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

code {
  display: inline;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #0f172a;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  position: relative;
  z-index: 1;
  background: transparent;
  transition: background 0.3s ease;
}

.theme-mosque .shell {
  background: rgba(44, 36, 26, .95);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px 12px;
  background: rgba(252, 249, 242, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #3d3429;
  font-weight: 800;
}

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

h1 {
  font-size: 21px;
  line-height: 1.15;
  font-weight: 800;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  margin-left: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--amber));
  color: #3d3429;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  vertical-align: middle;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

h2 {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 760;
}

.brand p,
.section-title p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

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

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segmented button,
.tabs button,
.icon-btn {
  border: 0;
  color: var(--text);
  background: transparent;
}

.segmented button {
  min-width: 43px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
}

.segmented button.active {
  color: white;
  background: var(--blue);
  box-shadow: 0 5px 14px rgba(37, 99, 235, .22);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 20px;
}

.theme-toggle {
  position: relative;
  isolation: isolate;
}

.theme-toggle span {
  position: relative;
  z-index: 2;
}

.theme-toggle::after {
  content: "";
  position: absolute;
  top: 34px;
  right: 6px;
  width: 10px;
  height: 58px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease;
  background:
    radial-gradient(circle at 5px 5px, #d6a94e 0 3px, transparent 3.5px),
    radial-gradient(circle at 5px 16px, #0f7a45 0 3px, transparent 3.5px),
    radial-gradient(circle at 5px 27px, #d6a94e 0 3px, transparent 3.5px),
    radial-gradient(circle at 5px 38px, #0f7a45 0 3px, transparent 3.5px),
    radial-gradient(circle at 5px 49px, #d6a94e 0 3px, transparent 3.5px),
    linear-gradient(#b78a2e, #b78a2e) center top / 1px 58px no-repeat;
}

.theme-toggle:hover::after,
.theme-toggle[aria-pressed="true"]::after {
  opacity: 1;
  transform: translateY(0);
}

.tabs {
  position: sticky;
  top: 71px;
  z-index: 25;
  display: flex;
  gap: 6px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  opacity: 0.95;
  backdrop-filter: blur(12px);
}

.tabs button, .tab-link {
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.tabs button:hover, .tab-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tabs button.active {
  background: var(--text);
  color: white;
}

.content {
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: 18px 22px 32px;
}

.loading,
.empty {
  min-height: 140px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.empty.in-table {
  position: absolute;
  inset: 0;
  min-height: 180px;
  border: 0;
}

/* Skeleton Screens — shimmer effect (arXiv: perceived performance) */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skel-card, .skel-panel {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border: 1px solid var(--line-soft);
}

.skel-card {
  min-height: 88px;
}

.skel-panel {
  min-height: 240px;
}

.skel-panel.skel-tall {
  min-height: 430px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stats-grid.malware-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.stat span,
.stat em {
  display: block;
  color: var(--muted);
  font-style: normal;
  overflow-wrap: anywhere;
}

.stat strong {
  display: block;
  margin: 5px 0 2px;
  font-size: 24px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.overview-grid,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.overview-grid.lower {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.split {
  grid-template-columns: minmax(360px, .86fr) minmax(0, 1.35fr);
  align-items: start;
}

.raw-split {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
}

.panel {
  min-width: 0;
  min-height: 0;
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel.danger {
  border-color: var(--red-soft);
}

.panel > h2,
.panel-head {
  margin-bottom: 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-title {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.section-title h2 {
  margin-bottom: 5px;
  font-size: 20px;
}

.panel-note {
  margin-bottom: 10px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.cowrie-ip-grid {
  display: grid;
  grid-template-columns: minmax(420px, .85fr) minmax(0, 1.3fr);
  gap: 14px;
  align-items: start;
}

.ip-history-head {
  min-height: 53px;
  display: grid;
  align-content: center;
  gap: 2px;
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-2);
}

.ip-history-head strong,
.ip-history-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ip-history-head span {
  color: var(--muted);
}

.attack-map,
.map-canvas,
.timeline-canvas {
  display: block;
  width: 100%;
  height: 430px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-2);
}

.attack-map-shell {
  position: relative;
  min-height: 430px;
}

.attack-map {
  overflow: hidden;
}

.maplibregl-canvas {
  outline: none;
}

.map-hud,
.map-top-list,
.map-legend {
  position: absolute;
  z-index: 5;
  border: 1px solid rgba(203, 213, 225, .78);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .10);
  backdrop-filter: blur(10px);
}

.map-hud {
  left: 12px;
  top: 12px;
  display: grid;
  gap: 2px;
  min-width: 158px;
  padding: 10px 12px;
}

.map-hud strong {
  font-size: 20px;
  line-height: 1.05;
}

.map-hud span,
.map-top-list span,
.map-top-list em,
.map-legend span {
  color: var(--muted);
  font-style: normal;
}

.map-top-list {
  right: 12px;
  top: 58px;
  display: grid;
  gap: 5px;
  width: 218px;
  padding: 10px;
}

.map-top-list > span {
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.map-top-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: white;
  color: var(--text);
  text-align: left;
}

.map-top-list button em {
  flex: 0 0 auto;
}

.map-legend {
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.map-legend i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
}

.map-legend .heat {
  background: linear-gradient(90deg, #38bdf8, #2563eb, #f59e0b, #ef4444);
  width: 28px;
}

.map-legend .auth {
  background: #2563eb;
}

.map-legend .cmd {
  background: #f59e0b;
}

.map-legend .target {
  background: #111827;
}

.attack-popup {
  min-width: 220px;
}

.attack-popup strong,
.attack-popup span,
.attack-popup em {
  display: block;
  overflow-wrap: anywhere;
}

.attack-popup span,
.attack-popup em {
  color: var(--muted);
  font-style: normal;
}

.attack-popup dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  margin: 10px 0;
}

.attack-popup dt {
  color: var(--muted);
}

.attack-popup dd {
  margin: 0;
  font-weight: 760;
}

.timeline-canvas {
  height: 238px;
}

.map-tip {
  position: absolute;
  z-index: 4;
  width: 230px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.map-tip strong,
.map-tip span,
.map-tip em {
  display: block;
  overflow-wrap: anywhere;
}

.map-tip span,
.map-tip em {
  color: var(--muted);
  font-style: normal;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
}

.chip.ok {
  background: var(--green-soft);
  color: var(--green);
}

.chip.bad {
  background: var(--red-soft);
  color: var(--red);
}

.chip.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.chip.custom {
  background: var(--violet-soft);
  color: var(--violet);
}

.chip.github {
  background: #e0f2fe;
  color: #0369a1;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111827;
  color: white;
  text-decoration: none;
  white-space: nowrap;
}

.download-link:hover {
  background: #1f2937;
}

.group-list,
.feed,
.service-grid,
.bars {
  display: grid;
  gap: 8px;
}

.group-card {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
}

.group-main {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px;
  padding: 10px;
  border: 0;
  background: transparent;
  text-align: left;
}

.group-main strong,
.group-main span,
.group-main em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.group-main strong {
  align-self: center;
  font-size: 13px;
}

.group-main > span:not(.group-type) {
  color: var(--muted);
}

.group-main em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
}

.group-details {
  border-top: 1px solid var(--line);
  background: white;
}

.inline-loading {
  padding: 14px;
  color: var(--muted);
}

.mini-events {
  display: grid;
  max-height: 360px;
  overflow: auto;
}

.mini-events > div {
  display: grid;
  grid-template-columns: 150px 120px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.mini-events time,
.mini-events span {
  color: var(--muted);
}

.feed {
  max-height: 560px;
  overflow: auto;
}

.feed article {
  display: grid;
  grid-template-columns: auto minmax(88px, .8fr) minmax(90px, .8fr);
  gap: 5px 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.feed code,
.feed em {
  grid-column: 1 / -1;
}

.feed em {
  color: var(--muted);
  font-style: normal;
}

.service-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px auto 90px;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.service-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.service-row span,
.service-row em {
  color: var(--muted);
  font-style: normal;
}

.port-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.port-pill {
  min-width: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 4px 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-2);
}

.port-pill .chip {
  grid-column: 1 / -1;
  width: max-content;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(80px, .8fr) minmax(0, 1fr) 70px;
  align-items: center;
  gap: 10px;
}

.bar-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bar-row div {
  height: 9px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.bar-row strong {
  text-align: right;
}

.virtual-table {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.vt-header,
.vt-row {
  display: grid;
  min-width: 760px;
}

.vt-header {
  height: 42px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.vt-header > div,
.vt-row > div {
  min-width: 0;
  padding: 0 10px;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.vt-viewport {
  position: relative;
  height: 560px;
  overflow: auto;
}

.virtual-table.tall .vt-viewport {
  height: 680px;
}

.virtual-table.compact .vt-header,
.virtual-table.compact .vt-row,
.virtual-table.compact .vt-spacer {
  min-width: 680px;
}

.vt-spacer {
  position: relative;
  min-width: 760px;
}

.vt-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 56px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  background: white;
  will-change: transform;
}

.vt-row:nth-child(even) {
  background: #fbfdff;
}

.vt-row.clickable:hover {
  background: #eef6ff;
}

.vt-row.selected {
  background: #eaf2ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.vt-row small {
  color: var(--muted);
}

.raw-json {
  height: 722px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  padding: 10px 12px;
  border-radius: 8px;
  background: #111827;
  color: white;
  box-shadow: var(--shadow);
}

.busy #refreshBtn {
  opacity: .65;
}

@media (max-width: 1320px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stats-grid.malware-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid,
  .overview-grid.lower,
  .split,
  .raw-split,
  .cowrie-ip-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .tabs {
    top: 0;
  }

  .controls {
    width: 100%;
  }

  .segmented {
    flex: 1;
    overflow-x: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid.malware-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content {
    padding: 14px;
  }

  .map-canvas {
    height: 320px;
  }

  .attack-map,
  .attack-map-shell {
    min-height: 360px;
    height: 360px;
  }

  .map-top-list {
    display: none;
  }

  .map-hud {
    max-width: calc(100% - 24px);
  }

  .mini-events > div,
  .feed article,
  .service-row {
    grid-template-columns: 1fr;
  }

  .vt-header,
  .vt-row,
  .vt-spacer {
    min-width: 940px;
  }
}

body.theme-mosque {
  --bg: #07110d;
  --surface: rgba(12, 38, 28, .78);
  --surface-2: rgba(255, 250, 232, .10);
  --line: rgba(222, 184, 93, .38);
  --line-soft: rgba(222, 184, 93, .22);
  --text: #fff8e6;
  --muted: #dbcda7;
  --blue: #0f8a5f;
  --blue-soft: rgba(15, 138, 95, .24);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, .18);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .18);
  --amber: #f7c85f;
  --amber-soft: rgba(247, 200, 95, .20);
  --violet: #7dd3fc;
  --violet-soft: rgba(125, 211, 252, .18);
  --shadow: 0 22px 70px rgba(0, 0, 0, .34);
  background:
    linear-gradient(180deg, rgba(4, 11, 8, .58), rgba(4, 11, 8, .78)),
    radial-gradient(circle at 50% 24%, rgba(247, 200, 95, .28), transparent 34%),
    url("/assets/mosque-interior.jpg") center center / cover fixed,
    #07110d;
}

body.theme-mosque::before {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 46, 22, .36), rgba(255,255,255,0) 30%, rgba(5, 46, 22, .28)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(45deg, rgba(222,184,93,.038) 0 1px, transparent 1px 24px);
  mix-blend-mode: screen;
}

body.theme-mosque code {
  color: #fff7dc;
}

body.theme-mosque .topbar,
body.theme-mosque .tabs {
  background: rgba(6, 28, 18, .76);
  border-color: rgba(222, 184, 93, .34);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .20);
}

body.theme-mosque .brand p,
body.theme-mosque .section-title p,
body.theme-mosque .tabs button,
body.theme-mosque .segmented button {
  color: #d8caa6;
}

body.theme-mosque .mark,
body.theme-mosque .tabs button.active {
  background: linear-gradient(135deg, #0b5f38, #0f8a5f 55%, #d6a94e);
  color: #fff8e6;
  box-shadow: 0 12px 28px rgba(15, 138, 95, .30);
}

body.theme-mosque .segmented,
body.theme-mosque .icon-btn {
  border-color: rgba(222, 184, 93, .36);
  background: rgba(255, 250, 232, .12);
  color: #fff8e6;
}

body.theme-mosque .segmented button.active {
  background: linear-gradient(135deg, #0f8a5f, #d6a94e);
  box-shadow: 0 8px 22px rgba(214, 169, 78, .24);
}

body.theme-mosque .theme-toggle[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(15, 138, 95, .92), rgba(214, 169, 78, .92));
}

body.theme-mosque .panel,
body.theme-mosque .section-title,
body.theme-mosque .stat,
body.theme-mosque .virtual-table,
body.theme-mosque .loading,
body.theme-mosque .empty,
body.theme-mosque .raw-json {
  border-color: rgba(222, 184, 93, .34);
  background: linear-gradient(180deg, rgba(9, 34, 24, .82), rgba(8, 24, 18, .72));
  color: #fff8e6;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px) saturate(1.12);
}

body.theme-mosque .panel,
body.theme-mosque .stat {
  overflow: hidden;
}

body.theme-mosque .panel::before,
body.theme-mosque .stat::after {
  content: attr(data-place);
  position: absolute;
  right: 12px;
  top: 10px;
  max-width: calc(100% - 24px);
  padding: 3px 9px;
  border: 1px solid rgba(222, 184, 93, .32);
  border-radius: 999px;
  background: rgba(5, 46, 22, .58);
  color: #f7d98a;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.theme-mosque .panel > h2,
body.theme-mosque .panel-head {
  padding-right: 130px;
}

body.theme-mosque .stat::after {
  position: static;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin-top: 7px;
}

body.theme-mosque .stat strong {
  color: #fff4c7;
  text-shadow: 0 0 22px rgba(247, 200, 95, .22);
}

body.theme-mosque .stat span,
body.theme-mosque .stat em,
body.theme-mosque .feed em,
body.theme-mosque .feed span,
body.theme-mosque .service-row span,
body.theme-mosque .service-row em,
body.theme-mosque .mini-events time,
body.theme-mosque .mini-events span,
body.theme-mosque .vt-row small,
body.theme-mosque .group-main em,
body.theme-mosque .group-main > span:not(.group-type) {
  color: #d8caa6;
}

body.theme-mosque .vt-header,
body.theme-mosque .vt-row,
body.theme-mosque .group-card,
body.theme-mosque .port-pill,
body.theme-mosque .ip-history-head {
  border-color: rgba(222, 184, 93, .22);
  background: rgba(255, 250, 232, .08);
  color: #fff8e6;
}

body.theme-mosque .vt-row:nth-child(even) {
  background: rgba(255, 250, 232, .05);
}

body.theme-mosque .vt-row.clickable:hover,
body.theme-mosque .vt-row.selected {
  background: rgba(15, 138, 95, .24);
}

body.theme-mosque .attack-map,
body.theme-mosque .map-canvas,
body.theme-mosque .timeline-canvas {
  border-color: rgba(222, 184, 93, .32);
  background: rgba(255, 250, 232, .08);
}

body.theme-mosque .map-hud,
body.theme-mosque .map-top-list,
body.theme-mosque .map-legend,
body.theme-mosque .map-tip {
  border-color: rgba(222, 184, 93, .34);
  background: rgba(8, 24, 18, .78);
  color: #fff8e6;
}

body.theme-mosque .map-top-list button,
body.theme-mosque .download-link {
  border-color: rgba(222, 184, 93, .34);
  background: linear-gradient(135deg, #0b5f38, #0f8a5f);
  color: #fff8e6;
}

body.theme-mosque .chip {
  background: rgba(255, 250, 232, .14);
  color: #f5e8c3;
}

body.theme-mosque .chip.ok {
  background: rgba(34, 197, 94, .18);
  color: #86efac;
}

body.theme-mosque .chip.bad {
  background: rgba(248, 113, 113, .18);
  color: #fecaca;
}

body.theme-mosque .chip.warn {
  background: rgba(247, 200, 95, .18);
  color: #fde68a;
}

body.theme-mosque .chip.custom,
body.theme-mosque .chip.github {
  background: rgba(125, 211, 252, .16);
  color: #bae6fd;
}

@media (max-width: 760px) {
  body.theme-mosque {
    background-attachment: scroll;
  }

  body.theme-mosque .panel > h2,
  body.theme-mosque .panel-head {
    padding-right: 0;
    padding-top: 24px;
  }

  body.theme-mosque .panel::before {
    left: 12px;
    right: auto;
  }
}

/* --- Added for Micro-animations and Interactions --- */
button, .clickable-stat, .icon-btn, .vt-row.clickable {
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.15s ease, background 0.15s ease;
}
button:active, .clickable-stat:active, .icon-btn:active, .vt-row.clickable:active {
  transform: scale(0.96);
}

.clickable-stat {
  cursor: pointer;
  position: relative;
  user-select: none;
}
.clickable-stat:hover {
  background: var(--surface-2);
}

.stat-dropdown {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--text);
  animation: slideDown 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.stat-dropdown p {
  margin-bottom: 4px;
}
.stat-dropdown strong {
  display: inline;
  font-size: 12.5px;
  margin: 0;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-hint {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface-2);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
}

/* Architecture tab styles */
.arch-pipeline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.arch-step {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  min-width: 160px;
}

.arch-step strong {
  color: var(--blue);
}

.arch-step span {
  color: var(--muted);
  font-size: 12.5px;
}

.arch-arrow {
  font-size: 20px;
  color: var(--muted);
  font-weight: 700;
}

.arch-sources {
  display: grid;
  gap: 8px;
}

.arch-source {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-2);
}

.arch-source em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.arch-db h3 {
  margin: 14px 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.arch-db-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.arch-indexes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.arch-indexes code {
  padding: 4px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  font-size: 11px;
}

.arch-cache {
  display: grid;
  gap: 6px;
}

.arch-cache-entry {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-2);
}

.arch-cache-entry strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.sys-pre {
  background: #000;
  color: #0f0;
  padding: 14px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  border: 1px solid var(--line);
}

