:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --panel: #ffffff;
  --ink: #151d22;
  --muted: #63707a;
  --line: #dce2df;
  --navy: #142331;
  --teal: #24747b;
  --gold: #b6882e;
  --green: #2f7a56;
  --amber: #a96f1d;
  --red: #ad443f;
  --shadow: 0 16px 42px rgba(21, 29, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dashboard {
  width: min(1180px, calc(100% - 22px));
  margin: 0 auto;
  padding: 14px 0 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
}

.eyebrow,
.label {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 620px;
  font-size: clamp(1.28rem, 2.4vw, 1.9rem);
  line-height: 1.06;
}

h2 {
  font-size: clamp(1.08rem, 1.6vw, 1.36rem);
  line-height: 1.14;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.state-badge {
  display: grid;
  min-width: 124px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #ffffff;
  background: var(--navy);
  text-align: center;
}

.state-badge span {
  font-size: 1.08rem;
  font-weight: 900;
}

.state-badge small {
  color: #dce6e4;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.hero-card,
.recon-card,
.signal-table,
.macro-strip article,
.update-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 92px;
  padding: 10px;
}

.hero-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: clamp(1.02rem, 2vw, 1.45rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-card p {
  font-size: 0.78rem;
  line-height: 1.28;
}

.net-worth {
  border-top: 4px solid var(--gold);
}

.notime-profit-card {
  border-top: 4px solid var(--green);
}

.notime-profit-card strong {
  color: var(--green);
}

.recon-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  align-items: start;
  margin-top: 8px;
  padding: 12px;
}

.recon-card h2 {
  margin-bottom: 9px;
}

.directive-list,
.mini-actions {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.directive-list li,
.mini-actions span {
  padding: 11px 12px;
  border-radius: 8px;
  background: #eef5f4;
  color: #25343a;
  font-weight: 760;
  line-height: 1.35;
}

.signal-table {
  margin-top: 8px;
  overflow: hidden;
}

.table-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.table-head span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.asset-row {
  display: grid;
  grid-template-columns: 0.75fr repeat(3, 1fr);
  align-items: stretch;
}

.asset-row + .asset-row {
  border-top: 1px solid var(--line);
}

.asset-name,
.time-signal {
  padding: 10px 12px;
}

.asset-name {
  background: #fbfcfb;
}

.asset-name strong,
.time-signal strong,
.macro-strip strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
}

.asset-name p,
.time-signal p {
  font-size: 0.88rem;
}

.asset-name small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.cell-detail {
  margin-top: 7px;
}

.cell-detail summary {
  color: var(--teal);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
}

.cell-detail p,
.cell-detail small {
  margin-top: 5px;
  font-size: 0.82rem;
}

.time-signal {
  border-left: 1px solid var(--line);
}

.signal-pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 850;
}

.signal-pill.hold {
  background: var(--navy);
}

.signal-pill.buy,
.signal-pill.accumulate {
  background: var(--green);
}

.signal-pill.protect,
.signal-pill.watch {
  background: var(--amber);
}

.signal-pill.sell,
.signal-pill.reduce {
  background: var(--red);
}

.macro-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.macro-strip article {
  min-height: 136px;
  padding: 10px;
}

.dial-card {
  --dial-color: var(--amber);
  display: grid;
  grid-template-columns: 134px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.dial-card.calm {
  --dial-color: var(--green);
}

.dial-card.watch {
  --dial-color: var(--amber);
}

.dial-card.stress {
  --dial-color: var(--red);
}

.dial-panel {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.dial {
  position: relative;
  width: 112px;
  height: 64px;
  overflow: hidden;
  border-radius: 112px 112px 0 0;
  background:
    conic-gradient(
      from -90deg at 50% 100%,
      var(--green) 0deg 58deg,
      #f1af24 58deg 122deg,
      var(--red) 122deg 180deg,
      transparent 180deg 360deg
    );
  box-shadow: inset 0 0 0 1px rgba(21, 29, 34, 0.08);
}

.dial::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 42px;
  border-radius: 80px 80px 0 0;
  background: var(--panel);
  content: "";
}

.dial span {
  position: absolute;
  right: 30px;
  bottom: 12px;
  left: 30px;
  z-index: 3;
  max-width: 44px;
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

.dial-needle {
  position: absolute;
  bottom: 2px;
  left: 50%;
  z-index: 4;
  width: 45%;
  height: 3px;
  border-radius: 999px;
  background: #404346;
  box-shadow: 0 1px 3px rgba(21, 29, 34, 0.22);
  transform: rotate(calc(-180deg + (var(--pct) * 1.8deg)));
  transform-origin: 0 50%;
}

.dial-needle::after {
  position: absolute;
  top: 50%;
  left: -7px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #7b7f80;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 1px 4px rgba(21, 29, 34, 0.2);
  content: "";
  transform: translateY(-50%);
}

.dial-scale-row {
  width: 104px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.dial-scale-row small {
  padding: 2px 3px;
  border-radius: 4px;
  background: #eef3f1;
  color: #57646d;
  font-size: 0.4rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.dial-card p {
  font-size: 0.76rem;
  line-height: 1.24;
}

.dial-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.22;
}

.health-barometer {
  grid-column: 1 / -1;
  min-height: 172px;
  grid-template-columns: 240px minmax(0, 1fr);
  padding: 14px;
}

.health-barometer .dial {
  width: 220px;
  height: 122px;
  border-radius: 220px 220px 0 0;
}

.health-barometer .dial::after {
  right: 34px;
  left: 34px;
  height: 80px;
  border-radius: 160px 160px 0 0;
}

.health-barometer .dial span {
  right: 65px;
  bottom: 24px;
  left: 65px;
  max-width: 76px;
  font-size: 1rem;
}

.health-barometer .dial-needle {
  bottom: 4px;
  height: 4px;
}

.health-barometer .dial-needle::after {
  left: -10px;
  width: 20px;
  height: 20px;
}

.health-barometer .dial-scale-row {
  width: 200px;
}

.health-barometer .dial-scale-row small {
  font-size: 0.58rem;
}

.health-barometer .label {
  font-size: 0.84rem;
}

.health-barometer p {
  max-width: 680px;
  font-size: 0.92rem;
}

.health-barometer small {
  max-width: 780px;
  font-size: 0.78rem;
}

.empty-state {
  padding: 18px;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
}

.update-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
  margin-top: 8px;
  padding: 12px;
}

.detail-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detail-box summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.detail-box[open] {
  padding-bottom: 12px;
}

.detail-box[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.detail-box > :not(summary) {
  margin-left: 12px;
  margin-right: 12px;
}

.macro-box {
  margin-top: 8px;
}

.recon-card .detail-box {
  box-shadow: none;
}

@media (max-width: 900px) {
  .hero-grid,
  .recon-card,
  .update-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .dashboard {
    width: min(100% - 22px, 1120px);
    padding-top: 12px;
  }

  .topbar,
  .table-head {
    display: grid;
  }

  .state-badge {
    min-width: 0;
    width: 100%;
  }

  .asset-row {
    grid-template-columns: 0.86fr repeat(3, minmax(92px, 1fr));
    overflow-x: auto;
  }

  .time-signal {
    border-left: 1px solid var(--line);
    border-top: 0;
  }

  .recon-card,
  .update-card {
    grid-template-columns: 1fr;
  }

  .hero-grid,
  .macro-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-card {
    min-height: 88px;
  }

  .dial-card {
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: start;
    gap: 8px;
    text-align: center;
  }

  .health-barometer {
    grid-template-columns: 1fr;
  }

  .dial {
    width: 104px;
    height: 60px;
  }

  .health-barometer .dial {
    width: 160px;
    height: 92px;
  }

  .health-barometer .dial::after {
    right: 28px;
    left: 28px;
    height: 58px;
  }

  .health-barometer .dial span {
    right: 48px;
    bottom: 18px;
    left: 48px;
    max-width: 64px;
    font-size: 0.82rem;
  }

  .dial span {
    max-width: 38px;
    font-size: 0.54rem;
  }

  .dial-scale-row {
    width: 70px;
  }

  .dial-scale-row small {
    font-size: 0.4rem;
  }
}
