/* Bone Impact — working app shell */
:root {
  --bg: #0c1016;
  --panel: #141b24;
  --panel-2: #1a2330;
  --line: #2a3544;
  --text: #e8ecef;
  --muted: #8b95a1;
  --accent: #4d7cff;
  --accent-soft: rgba(77, 124, 255, 0.14);
  --good: #3ecf8e;
  --warn: #e0b45c;
  --bad: #e06c5c;
  --font: "Manrope", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 14px;
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, select, input { font: inherit; color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 18px; }

.id-banner {
  background: #f4e27c;
  color: #101318;
  border-bottom: 4px solid #101318;
  padding: 18px clamp(18px, 4vw, 54px);
  font-family: var(--font);
}
.id-banner p { margin: 4px 0; font-size: clamp(.78rem, 1.5vw, .95rem); font-weight: 650; }
.id-banner .id-project,
.id-banner .id-terminal { font-size: clamp(1.45rem, 3vw, 2.35rem); font-weight: 800; line-height: 1.05; letter-spacing: -.04em; }
.id-banner .id-terminal { margin-bottom: 14px; }
.id-banner .id-receipt { border-top: 2px solid #101318; margin-top: 12px; padding-top: 10px; }

.app-nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(12, 16, 22, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo {
  font-weight: 700; letter-spacing: -0.02em; color: var(--text); text-decoration: none;
}
.logo em { font-style: normal; color: var(--accent); }
.nav-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nav-actions a, .nav-actions button {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 8px 12px; border-radius: 8px; font-size: 0.85rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
}
.nav-actions a:hover, .nav-actions button:hover {
  color: var(--text); border-color: #3d4b5c; text-decoration: none;
}
.nav-actions .primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

.hero-strip {
  padding: 28px 0 8px;
}
.hero-strip h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
}
.hero-strip p { color: var(--muted); max-width: 52em; font-size: 0.98rem; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.badge {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.badge.on { border-color: rgba(77,124,255,.45); color: #9bb6ff; background: var(--accent-soft); }
.badge.good { border-color: rgba(62,207,142,.4); color: var(--good); }

.grid-main {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  padding: 18px 0 28px;
}
@media (max-width: 960px) {
  .grid-main { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-h {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.panel-h h2 {
  font-size: 0.95rem; font-weight: 650; letter-spacing: -0.01em;
}
.panel-h .sub {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 0.04em;
}
.panel-b { padding: 16px; }

/* Report card live */
.rcard .grade-row {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center;
}
@media (max-width: 520px) {
  .rcard .grade-row { grid-template-columns: 1fr; text-align: center; }
}
.ring {
  width: 120px; height: 120px; position: relative; margin: 0 auto;
}
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .gnum {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 2.1rem; letter-spacing: -0.04em;
}
.ring .gnum small {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.grade-copy h3 { font-size: 1.15rem; margin-bottom: 4px; }
.grade-copy p { color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
.tags span {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); color: #c5cdd6;
}
.tags span.good { border-color: #1b7f52; color: #5dcaa0; background: rgba(27,127,82,.12); }
.tags span.warn { border-color: #b07a1a; color: #e0b45c; background: rgba(176,122,26,.12); }

.meters {
  display: grid; gap: 12px; margin-top: 16px;
}
.meter-row label {
  display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted);
  margin-bottom: 5px;
}
.meter-row label b { color: var(--text); font-weight: 600; }
.track {
  height: 10px; background: #0c1016; border-radius: 999px; overflow: hidden; border: 1px solid var(--line);
}
.track > i {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #3a6ae8, #5b8cff);
  transition: width 0.25s ease;
}
.track > i.session { background: linear-gradient(90deg, #1b7f52, #3ecf8e); }
.track > i.warn { background: linear-gradient(90deg, #a67c1a, #e0b45c); }

.week-bars {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  align-items: end; height: 84px; margin-top: 14px;
}
.week-bars .d {
  display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end;
}
.week-bars .col {
  width: 100%; border-radius: 4px 4px 2px 2px; min-height: 4px;
  background: #2a4a8a;
}
.week-bars .col.hit { background: #3ecf8e; }
.week-bars .col.mid { background: #5b8cff; }
.week-bars .col.low { background: #3d4654; }
.week-bars span { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }

.sites {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px;
  background: var(--line); border-top: 1px solid var(--line); margin-top: 16px;
}
.sites > div { background: var(--panel); padding: 12px; }
.sites .k { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 0.06em; margin-bottom: 8px; }
.sites .v { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.03em; }
.sites .s { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* Sensors */
.sensor-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
@media (max-width: 560px) {
  .sensor-grid { grid-template-columns: 1fr; }
}
.sensor-card {
  text-align: left; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px;
  transition: border-color .15s, background .15s;
}
.sensor-card:hover { border-color: #3d4b5c; }
.sensor-card.selected {
  border-color: var(--accent); background: var(--accent-soft);
}
.sensor-card .name { font-weight: 650; font-size: 0.9rem; margin-bottom: 2px; }
.sensor-card .meta {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 0.03em;
}
.sensor-card .blurb { font-size: 0.78rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.sensor-card .path {
  display: inline-block; margin-top: 8px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: #9bb6ff;
}

.detail-box {
  margin-top: 12px; padding: 12px; border-radius: 10px;
  background: #0c1016; border: 1px solid var(--line);
  font-size: 0.85rem; color: var(--muted);
}
.detail-box strong { color: var(--text); }
.detail-box .row { margin: 4px 0; }

/* Live motion */
.live-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px;
}
@media (max-width: 560px) {
  .live-stats { grid-template-columns: 1fr 1fr; }
}
.stat {
  background: #0c1016; border: 1px solid var(--line); border-radius: 10px; padding: 10px;
}
.stat .k { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 0.05em; }
.stat .v { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 2px; }
.stat .v em { font-style: normal; font-size: 0.7rem; color: var(--muted); font-weight: 500; margin-left: 2px; }

.wave-wrap {
  background: #0c1016; border: 1px solid var(--line); border-radius: 10px;
  height: 120px; position: relative; overflow: hidden;
}
.wave-wrap canvas { width: 100%; height: 100%; display: block; }
.wave-label {
  position: absolute; top: 8px; left: 10px;
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
}

.controls {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center;
}
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 10px 14px; border-radius: 9px; font-weight: 600; font-size: 0.88rem;
  cursor: pointer;
}
.btn:hover { border-color: #445366; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-good { background: #1b7f52; border-color: #1b7f52; color: #fff; }
.btn-ghost { background: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.sim-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-modes button {
  font-size: 0.78rem; padding: 7px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer;
}
.sim-modes button.on {
  border-color: rgba(62,207,142,.5); color: var(--good); background: rgba(62,207,142,.1);
}

.cal-list { display: grid; gap: 8px; }
.cal-item {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
  padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2);
}
.cal-item h4 { font-size: 0.92rem; margin-bottom: 3px; }
.cal-item p { font-size: 0.8rem; color: var(--muted); }
.cal-item .go { white-space: nowrap; }

.opt-box {
  margin-top: 12px; padding: 14px; border-radius: 10px;
  border: 1px solid rgba(77,124,255,.35); background: var(--accent-soft);
}
.opt-box h3 { font-size: 0.95rem; margin-bottom: 8px; }
.opt-box ul { margin-left: 1.1em; color: var(--muted); font-size: 0.88rem; }
.opt-box li { margin: 4px 0; }

/* Manual log strip */
.log-row {
  display: grid; grid-template-columns: 1.4fr 0.6fr 0.6fr auto; gap: 8px; align-items: end;
}
@media (max-width: 640px) {
  .log-row { grid-template-columns: 1fr 1fr; }
}
.field label {
  display: block; font-size: 0.72rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px;
}
.field select, .field input {
  width: 100%; background: #0c1016; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; color: var(--text);
}
.log-list { list-style: none; margin-top: 12px; }
.log-list li {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem;
}
.log-list li button {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.8rem;
}
.log-list .empty { color: var(--muted); border: none; }

/* Matrix */
.matrix-wrap { padding-bottom: 40px; }
.matrix {
  width: 100%; border-collapse: collapse; font-size: 0.86rem;
}
.matrix th, .matrix td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.matrix th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.matrix td.feature { color: var(--text); font-weight: 600; width: 28%; }
.matrix .v { display: inline-block; margin-top: 4px; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px;
  background: var(--accent-soft); color: #9bb6ff; }

.receipt {
  margin: 0 0 32px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}
.receipt b { color: var(--text); }

.status-line {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  margin-top: 10px; min-height: 1.4em;
}
.status-line.ok { color: var(--good); }
.status-line.err { color: var(--bad); }

.provenance {
  padding: 10px 12px; border-radius: 10px; margin-bottom: 12px;
  border: 1px solid var(--line); background: #0c1016;
  font-size: 0.85rem; color: var(--muted);
}
.provenance b { color: var(--text); }
.provenance.live { border-color: rgba(62,207,142,.45); background: rgba(62,207,142,.08); }
.provenance.sim { border-color: rgba(224,180,92,.5); background: rgba(224,180,92,.1); }
.provenance.fake { border-color: rgba(224,108,92,.55); background: rgba(224,108,92,.1); }
.provenance #provLabel { color: var(--text); font-weight: 650; }

.hint-line {
  font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; line-height: 1.45;
}

.sensor-card {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
}
.sensor-card .check {
  width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent);
}
.sensor-card .body { min-width: 0; }
.sensor-card .roles {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.sensor-card .roles span {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted);
}
.sensor-card .roles span.truth { border-color: #1b7f52; color: #5dcaa0; }
.sensor-card .roles span.costream { border-color: #3d4b5c; color: #9bb6ff; }
.sensor-card .roles span.blocked { border-color: #b07a1a; color: #e0b45c; }

.lane-strip {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; min-height: 1.5em;
}
.lane-pill {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.03em;
  padding: 5px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.lane-pill.on { border-color: rgba(62,207,142,.45); color: var(--good); }
.lane-pill.sim { border-color: rgba(224,180,92,.5); color: var(--warn); }
.lane-pill.off { opacity: 0.55; }

.explain-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 720px) {
  .explain-grid { grid-template-columns: 1fr; }
}
.explain-grid h3 {
  font-size: 0.92rem; margin-bottom: 6px; color: #9bb6ff;
}
.explain-grid p {
  font-size: 0.86rem; color: var(--muted); line-height: 1.45;
}
.explain-grid code {
  font-family: var(--font-mono); font-size: 0.78rem; color: #c5cdd6;
}

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  padding-bottom: 28px;
}
.product-grid:has(.dexa-panel) { grid-template-columns: 1fr; }
.dexa-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 22px; }
.dexa-copy h3, .academy-body h3 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.06; margin: 8px 0 12px; }
.dexa-copy p, .academy-body p, .upgrade-card p { color: var(--muted); }
.dexa-copy img { width: 100%; margin-top: 18px; border-radius: 12px; border: 1px solid var(--line); }
.overline { font: 600 .68rem/1.2 var(--font-mono); letter-spacing: .11em; text-transform: uppercase; color: #9bb6ff !important; }
.dexa-form { display: grid; gap: 12px; align-content: start; background: #0c1016; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.dexa-form label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.dexa-form input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; }
.dexa-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.privacy-note { color: var(--muted); font-size: .75rem; }
.dexa-records { padding: 0 18px 18px; }
.dexa-records article { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; background: #0c1016; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.dexa-records article > div { display: grid; gap: 3px; min-width: 0; }
.dexa-records span { font: 600 .58rem/1.2 var(--font-mono); letter-spacing: .08em; color: var(--muted); }
.dexa-records b { font-size: 1rem; overflow-wrap: anywhere; }
.dexa-records small { color: var(--muted); font-size: .67rem; }
.dexa-empty { color: var(--muted); font-size: .85rem; }
.academy-body { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.academy-body .btn { display: inline-block; margin-top: 18px; }
.fact-stack { display: grid; gap: 8px; }
.fact-stack article { padding: 14px; background: #0c1016; border: 1px solid var(--line); border-radius: 10px; }
.fact-stack b { display: block; margin-bottom: 5px; }
.fact-stack p { font-size: .82rem; }
.upgrade-card { background: linear-gradient(145deg, #18283a, #111820); }
.upgrade-card h2 { font-family: var(--font-display); font-size: 3.2rem; margin: 8px 0; }
.upgrade-card h2 span { font-family: var(--font); font-size: .85rem; color: var(--muted); }
.upgrade-card ul { list-style: none; display: grid; gap: 8px; margin: 18px 0; }
.upgrade-card li::before { content: "✓"; color: var(--good); margin-right: 8px; }
.upgrade-card .btn { display: block; text-align: center; }
.upgrade-card small { display: block; color: var(--muted); font-size: .67rem; margin-top: 12px; }

@media (max-width: 850px) {
  .product-grid, .dexa-layout, .academy-body { grid-template-columns: 1fr; }
  .dexa-records article { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .dexa-fields, .dexa-records article { grid-template-columns: 1fr; }
}
