:root {
  color-scheme: dark;
  --bg: #10141a;
  --panel: #171d24;
  --panel-soft: #1f2832;
  --line: #2c3642;
  --text: #eef3f8;
  --muted: #9aa8b6;
  --green: #5ee3a1;
  --blue: #72b7ff;
  --amber: #f2c56b;
  --red: #ff7b7b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(114, 183, 255, 0.08), transparent 260px),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body,
button,
input,
select,
textarea {
  font-size: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px;
  background: rgba(16, 20, 26, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  font-size: 23px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 22px;
}

main {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 14px 12px 32px;
}

.scan-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 118px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-align: right;
}

.regime {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 5px;
  padding: 3px 8px;
  border: 1px solid rgba(94, 227, 161, 0.34);
  border-radius: 999px;
  color: var(--green);
  background: rgba(94, 227, 161, 0.1);
  font-weight: 700;
}

.panel {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 29, 36, 0.94);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

.pill {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.notification-panel {
  display: grid;
  gap: 10px;
}

.primary-button {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid rgba(94, 227, 161, 0.52);
  border-radius: 8px;
  background: rgba(94, 227, 161, 0.16);
  color: var(--text);
  font-weight: 800;
}

.secondary-button {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(114, 183, 255, 0.1);
  color: var(--text);
  font-weight: 750;
}

.primary-button:disabled,
.secondary-button:disabled {
  border-color: var(--line);
  background: rgba(154, 168, 182, 0.12);
  color: var(--muted);
}

.notification-status {
  line-height: 1.4;
}

.warnings {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.warning {
  padding: 10px 12px;
  border: 1px solid rgba(242, 197, 107, 0.42);
  border-radius: 8px;
  background: rgba(242, 197, 107, 0.11);
  color: #ffe0a0;
  font-size: 14px;
  line-height: 1.35;
}

.warning.info {
  border-color: rgba(114, 183, 255, 0.38);
  background: rgba(114, 183, 255, 0.1);
  color: #cbe6ff;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.health-item {
  min-height: 66px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.health-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.health-item strong {
  font-size: 20px;
}

.card-list {
  display: grid;
  gap: 10px;
}

.ticker-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ticker-card.is-short {
  border-left-color: var(--amber);
}

.ticker-card.is-long {
  border-left-color: var(--green);
}

.ticker-card.is-neutral {
  border-left-color: var(--blue);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.primary-metric {
  min-width: 86px;
  text-align: right;
}

.primary-metric span,
.mini-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.primary-metric strong {
  display: block;
  margin-top: 2px;
  color: var(--green);
  font-size: 30px;
  line-height: 1;
}

.hint {
  margin-top: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mini-metric {
  min-height: 52px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(16, 20, 26, 0.72);
}

.mini-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.z-metric strong {
  color: var(--blue);
}

.structure {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.empty-state {
  padding: 12px 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--panel-soft);
}

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #202a35;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-size: 14px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

@media (min-width: 760px) {
  main {
    padding: 22px 18px 42px;
  }

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

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