:root {
  color-scheme: dark;
  --bg: #07131f;
  --surface: #0c1d2d;
  --surface-2: #10263a;
  --border: #1d3a50;
  --text: #e7f1f8;
  --muted: #8198aa;
  --brand: #2dd4bf;
  --brand-soft: rgba(45, 212, 191, 0.12);
  --warn: #fbbf24;
  --danger: #fb7185;
  --neutral: #6f8799;
  font-family:
    Inter,
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}
body {
  overscroll-behavior-y: none;
}
button,
input {
  font: inherit;
}
button {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
h1,
h2,
p {
  margin-top: 0;
}

.app-shell {
  min-height: 100vh;
  max-width: 920px;
  margin: 0 auto;
  padding-bottom: 88px;
  background: var(--bg);
}
.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 12px;
  border-bottom: 1px solid rgba(29, 58, 80, 0.6);
}
.brand {
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.brand span {
  color: var(--brand);
}
.subtitle {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}
.icon-button,
.text-button,
.refresh-button {
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  font-size: 1.1rem;
}
.text-button {
  color: var(--brand);
  font-weight: 700;
}

.trust-banner {
  margin: 12px 14px 0;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.trust-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--neutral);
  box-shadow: 0 0 0 4px rgba(111, 135, 153, 0.12);
}
.trust-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.trust-copy strong {
  font-size: 0.78rem;
}
.trust-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.66rem;
}
.trust-safe {
  border-color: rgba(45, 212, 191, 0.36);
  background: var(--brand-soft);
}
.trust-safe .trust-dot {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.13);
}
.trust-stale {
  border-color: rgba(251, 191, 36, 0.36);
}
.trust-stale .trust-dot {
  background: var(--warn);
}
.trust-unsafe,
.trust-offline {
  border-color: rgba(251, 113, 133, 0.32);
}
.trust-unsafe .trust-dot,
.trust-offline .trust-dot {
  background: var(--danger);
}
.refresh-button {
  min-height: 36px;
  padding: 0 10px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
}
.refresh-button:disabled {
  color: var(--muted);
}

.settings-panel {
  margin: 12px 14px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}
.settings-panel label {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  color: #b8c9d5;
  font-size: 0.78rem;
  font-weight: 700;
}
.settings-panel input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: #071725;
}
.settings-panel input::placeholder {
  color: #557085;
}
.field-note,
.section-note {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.55;
}
.inline-error {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.1);
  font-size: 0.75rem;
}
.inline-warning {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.08);
  font-size: 0.72rem;
  line-height: 1.45;
}
.primary-button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  color: #04231f;
  background: var(--brand);
  font-weight: 900;
  cursor: pointer;
}

.content {
  padding: 16px 14px 24px;
}
.unverified-strip {
  margin-bottom: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.08);
  font-size: 0.68rem;
  text-align: center;
}
.hero-card {
  padding: 20px;
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(45, 212, 191, 0.14), transparent 50%),
    linear-gradient(150deg, #102a3d, #0b1c2a);
}
.hero-label {
  color: #91a7b7;
  font-size: 0.76rem;
}
.hero-value {
  margin: 7px 0 15px;
  font-size: clamp(1.85rem, 9vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.045em;
}
.hero-value small {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0;
}
.hero-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  color: var(--muted);
  font-size: 0.7rem;
}
.hero-meta span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-meta b {
  font-size: 0.9rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.metric-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}
.metric-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.68rem;
}
.metric-card strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}
.panel,
.data-card {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-heading h1,
.section-heading h2 {
  margin: 3px 0 0;
  font-size: 1rem;
}
.page-heading {
  margin: 6px 2px 16px;
}
.page-heading h1 {
  font-size: 1.25rem;
}
.eyebrow {
  color: var(--brand);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}
.muted {
  color: var(--muted);
  font-size: 0.68rem;
}
.status-pill,
.count-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--neutral);
  background: rgba(111, 135, 153, 0.08);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  white-space: nowrap;
}
.status-pill.verified,
.verified {
  color: var(--brand);
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.09);
}
.status-pill.negative,
.negative {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.08);
}
.status-pill.unverified,
.unverified {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.07);
}
.neutral {
  color: var(--neutral);
}
.value-positive {
  color: var(--brand);
}
.value-negative {
  color: var(--danger);
}
.value-neutral {
  color: #c6d3dc;
}
.connector-list {
  margin-top: 12px;
}
.connector-row,
.soak-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid rgba(29, 58, 80, 0.65);
  font-size: 0.72rem;
}
.connector-row b,
.soak-row b {
  text-align: right;
  font-size: 0.68rem;
}
.soak-row {
  color: var(--muted);
}
.last-refresh {
  margin: 14px 0 0;
  color: #5f778a;
  font-size: 0.64rem;
  text-align: center;
}

.list-empty,
.empty-state {
  padding: 34px 22px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(12, 29, 45, 0.48);
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.55;
}
.empty-state {
  margin-top: 8vh;
}
.empty-state h1 {
  margin: 10px 0 6px;
  color: var(--text);
  font-size: 1.15rem;
}
.empty-state .primary-button {
  margin-top: 12px;
}
.empty-icon {
  color: var(--brand);
  font-size: 2rem;
}
.card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card-title > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.card-title strong {
  font-size: 0.95rem;
}
.side {
  margin-left: 8px;
  font-size: 0.62rem;
  font-weight: 900;
}
.side.buy {
  color: var(--brand);
}
.side.sell {
  color: var(--danger);
}
.data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 15px 0 0;
}
.data-grid div {
  min-width: 0;
}
.data-grid dt {
  color: var(--muted);
  font-size: 0.63rem;
}
.data-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 0.76rem;
  font-weight: 800;
}
.data-grid.compact {
  margin-top: 12px;
}
.record-id {
  margin-top: 14px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #071725;
}
.record-id span {
  display: block;
  color: var(--muted);
  font-size: 0.58rem;
}
.record-id code {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #b9d0df;
  font-size: 0.68rem;
}
.strategy-status-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(45, 212, 191, 0.11), transparent 55%), var(--surface);
}
.strategy-lead {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.strategy-lead span,
.strategy-lead small,
.strategy-counts span {
  color: var(--muted);
  font-size: 0.61rem;
}
.strategy-lead strong {
  color: var(--brand);
  font-size: 1.25rem;
  letter-spacing: 0.035em;
}
.strategy-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.strategy-counts div {
  min-width: 0;
  padding: 9px;
  border-radius: 10px;
  background: #071725;
}
.strategy-counts b,
.strategy-counts span {
  display: block;
  overflow-wrap: anywhere;
}
.strategy-counts b {
  margin-bottom: 3px;
  font-size: 0.84rem;
}
.indicator-settings-groups {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.settings-group {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.settings-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.settings-group-title span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 0.56rem;
  font-weight: 900;
}
.settings-group-title h2 {
  margin: 0;
  font-size: 0.8rem;
}
.settings-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}
.settings-values div {
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(29, 58, 80, 0.55);
}
.settings-values dt {
  color: var(--muted);
  font-size: 0.57rem;
}
.settings-values dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 0.71rem;
  font-weight: 850;
}
.read-only-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 12px;
  border-left: 3px solid var(--brand);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(45, 212, 191, 0.065);
  font-size: 0.65rem;
  line-height: 1.45;
}
.read-only-note strong {
  color: #b8c9d5;
}
.subsection-heading {
  margin: 24px 2px 8px;
}
.subsection-heading h2 {
  margin: 4px 0 0;
  font-size: 1.02rem;
}
.gate-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.gate-summary div {
  min-width: 0;
  padding: 9px;
  border-radius: 10px;
  background: #071725;
}
.gate-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.56rem;
}
.gate-summary b {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 0.66rem;
}
.indicator-diagnostics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}
.indicator-diagnostics div {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(29, 58, 80, 0.58);
  border-radius: 9px;
  background: rgba(7, 23, 37, 0.72);
}
.indicator-diagnostics dt {
  color: var(--muted);
  font-size: 0.55rem;
}
.indicator-diagnostics dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #c6d3dc;
  font-size: 0.67rem;
  font-weight: 800;
}
.gate-pass {
  color: var(--brand) !important;
}
.gate-fail {
  color: var(--warn) !important;
}
.gate-unverified {
  color: #b8c9d5 !important;
}
.gate-unknown {
  color: var(--neutral) !important;
}
.gate-details {
  margin-top: 12px;
  border-top: 1px solid rgba(29, 58, 80, 0.65);
}
.gate-details summary {
  padding: 12px 0 0;
  color: #b8c9d5;
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 800;
}
.gate-details summary span {
  margin-left: 5px;
  color: var(--muted);
  font-weight: 500;
}
.gate-metric-list {
  margin-top: 8px;
}
.gate-metric-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(29, 58, 80, 0.42);
  font-size: 0.62rem;
}
.gate-metric-list span {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--muted);
}
.gate-metric-list i {
  width: 18px;
  flex: 0 0 18px;
  font-style: normal;
  font-weight: 900;
}
.gate-metric-list b {
  max-width: 48%;
  overflow-wrap: anywhere;
  color: #c6d3dc;
  text-align: right;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.blocker-chip,
.direction-chip {
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: #aabdc9;
  background: rgba(111, 135, 153, 0.07);
  font-size: 0.55rem;
  font-weight: 800;
}
.blocker-chip.danger {
  color: var(--danger);
}
.evidence-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 14px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid rgba(29, 58, 80, 0.65);
  color: var(--muted);
  font-size: 0.61rem;
}
.evidence-row b {
  color: #b8c9d5;
}
.news-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.61rem;
}
.news-card h2 {
  margin: 10px 0 0;
  font-size: 0.87rem;
  line-height: 1.45;
}
.update-detail {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}
.update-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  text-decoration: none;
  line-height: 46px;
}
.safety-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  max-width: 920px;
  min-height: 70px;
  margin: 0 auto;
  padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
  border-top: 1px solid var(--border);
  background: rgba(7, 19, 31, 0.96);
  backdrop-filter: blur(18px);
}
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 10px;
  color: #657e91;
  background: transparent;
  cursor: pointer;
}
.bottom-nav button span {
  font-size: 1.05rem;
}
.bottom-nav button small {
  font-size: 0.56rem;
  font-weight: 800;
}
.bottom-nav button.active {
  color: var(--brand);
  background: rgba(45, 212, 191, 0.07);
}

#blazor-error-ui {
  display: none;
  position: fixed;
  z-index: 1000;
  right: 12px;
  bottom: 82px;
  left: 12px;
  padding: 12px 36px 12px 14px;
  border: 1px solid rgba(251, 113, 133, 0.4);
  border-radius: 12px;
  color: #fecdd3;
  background: #3b1620;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
  font-size: 0.75rem;
}
#blazor-error-ui .reload {
  color: white;
}
#blazor-error-ui .dismiss {
  position: absolute;
  right: 12px;
  cursor: pointer;
}

@media (min-width: 700px) {
  .app-shell {
    border-right: 1px solid rgba(29, 58, 80, 0.35);
    border-left: 1px solid rgba(29, 58, 80, 0.35);
  }
  .topbar,
  .content {
    padding-right: 28px;
    padding-left: 28px;
  }
  .trust-banner,
  .settings-panel {
    margin-right: 28px;
    margin-left: 28px;
  }
  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .data-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .strategy-status-panel {
    grid-template-columns: minmax(190px, 0.8fr) 2fr;
    align-items: center;
  }
  .indicator-settings-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .indicator-diagnostics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
