/* Outfit, Inter, Cinzel, Cinzel Decorative, and JetBrains Mono. Latin subset, SIL Open Font License. */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/cinzel-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Cinzel Decorative';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/cinzel-decorative-latin-700.woff2') format('woff2');
}

:root {
  --bg0: #030610;
  --bg1: #07101f;
  --bg2: #0c1830;
  --bg3: #13233f;
  --acc: #00e5ff;
  --acc2: #5f7daa;
  --grn: #00e5ff;
  --org: #ffbe3c;
  --red: #ff5252;
  --ylw: #ffbe3c;
  --pur: #6e1ebe;
  --txt: #f0f6ff;
  --txt2: #c5d4ea;
  --txt3: #96a8be;
  --border: rgba(150, 180, 215, 0.35);
  --border2: rgba(150, 180, 215, 0.16);
  --card: rgba(7, 16, 31, 0.94);
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --sans: 'Inter', 'Avenir Next', 'Segoe UI', sans-serif;
  --radius: 16px;
  --header: 168px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  min-height: 100vh;
  background: #030610;
  color: var(--txt);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 6, 16, 0.68), rgba(3, 6, 16, 0.76)),
    url('../images/cover.jpg') center / cover no-repeat;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12px 18px, rgba(230, 240, 255, 0.75), transparent),
    radial-gradient(1px 1px at 80px 64px, rgba(180, 210, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 140px 28px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 40px 120px, rgba(140, 180, 255, 0.45), transparent);
  background-size: 180px 160px;
}
button, textarea, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
h1, h2, h3, p { margin: 0; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--acc);
  color: #041018;
  padding: 8px 12px;
  z-index: 10;
}
.skip:focus { top: 12px; }

#app {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  min-height: 100vh;
}

#header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 14px 8px;
  background: rgba(6, 13, 24, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border2);
}
.header-top, .status-row, .header-actions, .brand {
  display: flex;
  align-items: center;
}
.header-top { justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.brand { gap: 10px; flex: 1; min-width: 0; }
.brand > div { min-width: 0; }
.header-actions { flex: none; gap: 8px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; }
h1 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--acc);
}
.wordmark {
  font-family: 'Cinzel Decorative', serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: #f0f6ff;
}
.brand-kicker {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #96b4d7;
}
.product-name {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--txt2);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .wordmark {
    background: linear-gradient(180deg, #f5faff 0%, #5f7daa 46%, #f5faff 54%, #8aa0be 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.brand-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  min-width: 0;
  font-size: 16px;
  color: var(--txt2);
  white-space: nowrap;
}
#status-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grn);
  box-shadow: 0 0 10px var(--grn);
  flex: none;
}
html[data-swarm="running"] .status-dot {
  background: var(--acc);
  box-shadow: 0 0 10px var(--acc);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg1);
  padding: 4px;
  border-radius: 12px;
}
.tab, .header-actions button, .input-row button, .copy, .deep-btn, .chip, .study-tab {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
  padding: 10px 14px;
}
.tab { border-color: transparent; background: transparent; color: var(--txt3); font-weight: 650; }
.tab.active { background: var(--bg3); color: var(--acc); border-color: var(--border); }
.header-actions button { background: transparent; min-height: 44px; }
#install-btn { background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #041018; border: 0; font-weight: 700; }

#content { padding: 16px; }
.view[hidden] { display: none !important; }
.lede { color: var(--txt2); margin-bottom: 8px; }

.device-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
@media (max-width: 959px) {
  .device-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .device { flex: 0 0 auto; }
}
.device {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg1);
}
.device[aria-checked="true"] { background: rgba(0, 212, 255, 0.14); color: var(--acc); border-color: var(--acc); }

.field-label, .kicker {
  display: block;
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt3);
}
textarea, input[type="password"], input[type="text"], input[type="email"], select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg1);
  padding: 12px 14px;
  min-height: 48px;
}
textarea {
  min-height: 92px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.45;
}
textarea:focus, input:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(0, 212, 255, 0.45);
  outline-offset: 2px;
}
.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 10px;
}
#clear-btn { background: transparent; }
#auto-note { color: var(--txt3); font-size: 16px; }

.sample-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 68vw);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.sample {
  scroll-snap-align: start;
  text-align: left;
  min-height: 72px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.sample-title { font-weight: 700; }
.sample-blurb { color: var(--txt3); font-size: 16px; }
.badge {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ylw);
  border: 1px solid rgba(255, 214, 0, 0.4);
  border-radius: 999px;
  padding: 2px 8px;
}

.swarm-out { margin-top: 18px; }
#swarm-board, #report { scroll-margin-top: 128px; }
.coord-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(0, 80, 120, 0.35), rgba(8, 16, 32, 0.2));
  margin-bottom: 10px;
}
.coord-line strong { font-size: 18px; }
.bot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bot {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border2);
  background: var(--card);
}
.bot.scanning { border-color: var(--border); }
.bot.scanning::after {
  content: '';
  position: absolute;
  left: 0; right: 0; height: 2px;
  background: var(--acc);
  animation: scan 1.1s linear infinite;
}
@keyframes scan { from { top: 0; } to { top: 100%; } }
.bot-name { font-weight: 700; }
.bot-role, .bot-status { color: var(--txt3); font-size: 16px; }
.bot.alert { border-color: rgba(255, 107, 107, 0.55); }
.bot.watch { border-color: rgba(255, 214, 0, 0.4); }
.bot.clear { border-color: rgba(0, 230, 118, 0.35); }
.finding-mini { margin: 8px 0 0; padding: 0; list-style: none; }
.finding-mini li { margin-top: 4px; }

.report {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg1);
  padding: 16px;
  margin-bottom: 14px;
}
.report h2 { font-size: 26px; letter-spacing: -0.03em; line-height: 1.2; margin: 8px 0; }
.meter {
  height: 10px;
  border-radius: 99px;
  background: #07111f;
  overflow: hidden;
  margin: 8px 0 4px;
}
.meter span {
  display: block;
  height: 100%;
  width: calc(var(--p) * 1%);
  background: linear-gradient(90deg, var(--org), var(--grn));
}
.confidence { font-family: var(--mono); color: var(--acc); }
.narrative { margin: 10px 0 14px; }
.action {
  border-top: 1px solid var(--border2);
  padding: 12px 0 12px 12px;
  border-left: 4px solid var(--acc);
}
.action.critical { border-left-color: var(--red); }
.action.high { border-left-color: var(--org); }
.action.medium { border-left-color: var(--ylw); }
.action.low, .action.info { border-left-color: var(--acc); }
.action h3 { font-size: 18px; }
.sev {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt3);
}
.script-head, .chip-row, .deep-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.script-head { justify-content: space-between; margin-top: 8px; }
pre, .cmd {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  background: #071018;
  border-radius: 12px;
  border-left: 3px solid var(--grn);
  padding: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--grn);
}
.copy, .deep-btn {
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #041018;
  border: 0;
  font-weight: 700;
}
.chip {
  border-radius: 999px;
  background: var(--bg2);
  text-align: left;
}
.deep-box, .note, .pro-card, .ref-card, .tstep, .cs-card, .settings-card {
  margin-top: 12px;
}
.note { color: var(--txt3); }
details { margin-top: 8px; }
summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::marker { content: none; }
summary::before {
  content: '';
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  flex: none;
}
details[open] > summary::before {
  margin-top: 3px;
  transform: rotate(45deg);
}
.deep-text { white-space: pre-wrap; }

.study-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.study-tab.active { color: var(--acc); border-color: var(--acc); }
.ref-card, .tstep, .cs-card, .pro-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.ref-head, .step-top { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; min-height: 48px; padding: 0; }
.ref-head > span:last-child, .step-top > span:last-child { display: flex; flex-direction: column; align-items: flex-start; }
.ref-body { display: none; padding-top: 8px; }
.ref-card.open .ref-body { display: block; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag { border-radius: 99px; padding: 4px 8px; border: 1px solid var(--border); color: var(--acc); font-size: 14px; }
.tstep.done { border-color: rgba(0, 230, 118, 0.45); }
.cs-grid { display: grid; gap: 10px; }
.cs-card h3 { font-size: 18px; }
.cs-item { padding: 8px 0; border-bottom: 1px solid var(--border2); }
.cs-key { font-family: var(--mono); color: var(--acc); }

.signup-form { display: grid; gap: 8px; margin-top: 12px; }
.signup-form[hidden] { display: none !important; }
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.pro-card ul { margin: 10px 0 0; padding-left: 18px; }
.pro-card li { margin: 6px 0; }
dialog {
  width: min(480px, calc(100vw - 24px));
  background: var(--bg1);
  color: var(--txt);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
label.settings { display: block; margin-top: 12px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(80px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--acc);
  border-radius: 999px;
  padding: 12px 16px;
  max-width: calc(100% - 24px);
  z-index: 30;
  transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0.2s;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0s;
}

@media (max-width: 959px) {
  .sample-blurb { display: none; }
  .sample { min-height: 64px; }
}

@media (max-width: 720px) {
  #header { padding: 6px 12px 6px; }
  .header-top { margin-bottom: 6px; gap: 8px; }
  .brand { gap: 8px; }
  .brand img { width: 32px; height: 32px; border-radius: 10px; }
  h1 { font-size: 18px; }
  .product-name { font-size: 11px; line-height: 1.2; }
  .brand-sub { margin-top: 0; font-size: 16px; line-height: 1.2; }
  .header-actions button { padding-inline: 10px; }
  .tab { min-height: 40px; padding: 8px; }
  #swarm-board, #report { scroll-margin-top: 128px; }
}

@media (min-width: 960px) {
  #header { padding-inline: 22px; }
  #content { padding: 22px; }
  .swarm-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
  }
  .swarm-out { margin-top: 0; }
  .sample-row {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .bot-grid { grid-template-columns: repeat(3, 1fr); }
  .cs-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .bot.scanning::after, .status-dot { animation: none; }
}

.section-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.section-nav .tab { flex: none; white-space: nowrap; }
.screen-title {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.hub {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.hub-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  min-height: 72px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(12, 22, 40, 0.88);
  backdrop-filter: blur(12px);
}
.hub-card strong { font-size: 18px; }
.hub-card span { color: var(--txt2); font-size: 16px; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.toolbar button, .checkline {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2);
  padding: 8px 14px;
}
.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.toolbar button.active {
  border-color: var(--acc);
  color: var(--acc);
}
.alert-card, .list-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(8, 16, 32, 0.9);
  backdrop-filter: blur(12px);
  padding: 14px;
  margin: 10px 0;
}
.alert-card.done { opacity: 0.62; }
.sev {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sev.critical { color: #ffd0d0; background: #4a1020; }
.sev.high { color: #ffe3b0; background: #3d2a0c; }
.sev.medium { color: #d7ecff; background: #12304a; }
.sev.low, .sev.info { color: #d8fff8; background: #0c3338; }
.steps { margin: 8px 0 0; padding-left: 18px; }
.steps li { margin: 6px 0; }
.form-error {
  color: #ffb4b4;
  background: #3a1018;
  border: 1px solid #ff5252;
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
}
.plain-links { padding-left: 18px; }
.plain-links a, .list-card a, .alert-card a { color: var(--acc); }
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(3, 6, 16, 0.9);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border2);
}
.nav-item {
  min-height: 48px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--txt3);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
  padding: 4px 2px;
}
.nav-item.active { color: var(--acc); background: var(--bg3); }
#wallet-input, #threats-search, #bots-search, #hotfixes-search {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg1);
  padding: 12px;
  font-size: 17px;
}
.meta-line { color: var(--txt3); font-size: 16px; margin-top: 6px; }
.cmd-block {
  font-family: var(--mono);
  font-size: 14px;
  white-space: pre-wrap;
  background: #070d18;
  border-radius: 12px;
  padding: 10px;
  overflow-x: auto;
}

@media (max-width: 799px) {
  .section-nav { display: none; }
  #content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (min-width: 800px) {
  .bottom-nav { display: none; }
  .hub { grid-template-columns: 1fr 1fr; }
}
