:root {
  --bg: #0b1220;
  --card: #141c2e;
  --card-elevated: #1a2438;
  --text: #e8eefc;
  --muted: #9aa8c7;
  --accent: #3d8bfd;
  --warn: #f0b429;
  --warn-bg: #2a2208;
  --warn-border: #5c4a12;
  --border: #243049;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
  --banner-h: 40px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
}

.skip {
  position: absolute; left: -999px; top: 0;
}
.skip:focus {
  left: 8px; top: calc(var(--safe-top) + 8px);
  background: var(--card); padding: 8px 12px; z-index: 40;
  color: var(--text); border-radius: 8px; border: 1px solid var(--accent);
}

.nonlive-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  color: var(--warn);
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.01em;
}

.top {
  padding: 14px 16px 4px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo { font-size: 1.6rem; color: var(--accent); line-height: 1; }
h1 { margin: 0; font-size: 1.2rem; font-weight: 650; }
.tag { margin: 2px 0 0; color: var(--muted); font-size: 0.8rem; }

main {
  flex: 1;
  padding: 8px 16px 16px;
}

.panel[hidden] { display: none !important; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 8px;
}
.panel-head h2 { margin: 0; font-size: 1.15rem; }

.badge {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-border);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  font-weight: 600;
}
.badge-inline { margin-left: 6px; }

.hint { color: var(--muted); font-size: 0.88rem; margin: 0 0 14px; line-height: 1.4; }

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  margin: 0;
}
.stat-label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  margin: 6px 0 2px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}
.stat-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--warn);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 12px;
}
.detail-card { margin-top: 0; }
.detail-card div,
.shell-fields div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.detail-card div:last-child,
.shell-fields div:last-child { border-bottom: 0; }
dt { color: var(--muted); font-size: 0.9rem; }
dd { margin: 0; font-weight: 600; text-align: right; }

.empty-state { text-align: left; }
.empty-title { margin: 0 0 6px; font-weight: 650; }
.empty-body { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.4; }

.holdings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.holding-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.demo-row {
  border-style: dashed;
  border-color: var(--warn-border);
  background: var(--card-elevated);
}
.holding-main {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}
.holding-symbol {
  font-weight: 700;
  letter-spacing: 0.06em;
}
.holding-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 0.85rem;
}
.holding-note {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--warn);
  line-height: 1.35;
}

.statement-shell { margin-bottom: 12px; }
.shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.shell-head h3 { margin: 0; font-size: 1rem; }
.shell-body { margin: 0 0 8px; color: var(--muted); font-size: 0.88rem; }
.shell-fields { margin: 0; }
.shell-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.shell-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.shell-list li:last-child { border-bottom: 0; }

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 6px 8px calc(6px + var(--safe-bottom));
  background: rgba(11, 18, 32, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
  z-index: 20;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 12px;
  padding: 8px 4px;
  font: inherit;
  cursor: pointer;
}
.nav-item.is-active {
  color: var(--text);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.nav-icon { font-size: 1.05rem; line-height: 1; }
.nav-label { font-size: 0.72rem; font-weight: 600; }

.foot {
  padding: 8px 16px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.foot p { margin: 0; }

@media (min-width: 481px) {
  body {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

.feed-card { margin-top: 12px; }
.shell-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.benchmark-block {
  padding: 10px 0 !important;
}
.benchmark-block strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}
.benchmark-points {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 8px;
  border-left: 2px solid var(--border);
}
.benchmark-points li {
  border-bottom: 0 !important;
  padding: 2px 0 !important;
  font-variant-numeric: tabular-nums;
}
code {
  font-size: 0.85em;
  color: var(--accent);
}
