/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:       #3CC83C;
  --green-light: #EAF7EA;
  --green-pale:  #F2FBF2;
  --sage-light:  #EAF0F7;
  --warm-light:  #F7F5EA;
  --white:       #FFFFFF;
  --bg:          #F5F5F5;
  --border:      #E0E0E0;
  --border-light:#EBEBEB;
  --text:        #111111;
  --text-2:      #555555;
  --text-3:      #888888;
  --card:        var(--white);
  --navy:        var(--text);
  --blue:        var(--green);
  --blue-light:  var(--green-light);
  --blue-mid:    var(--text);
  --committed:   var(--green);
  --paidin:      var(--green);
  --deployed:    var(--green);
  --amber:       var(--text-2);
  --danger:      var(--text-3);
  --sidebar-w:   220px;
  --topbar-h:    64px;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── App shell ──────────────────────────────────────────────────────────── */
#app {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 36px; height: 36px;
  background: var(--navy);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--white);
  flex-shrink: 0;
}

.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-name { font-weight: 700; font-size: 13.5px; color: var(--text); }
.logo-fund { font-size: 11px; color: var(--text-3); }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: .5rem .5rem .35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background .12s, color .12s;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item--active {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}

.nav-item--active svg { color: var(--blue); }

/* Sidebar footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-user { display: flex; align-items: center; gap: .6rem; min-width: 0; }

.user-avatar {
  width: 32px; height: 32px;
  background: var(--navy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.user-info { min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 600; color: var(--text); truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.user-role { font-size: 11px; color: var(--text-3); }

.logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  text-decoration: none;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.logout-btn:hover { background: var(--bg); color: var(--text-2); }

/* ─── Main wrapper ───────────────────────────────────────────────────────── */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left { display: flex; flex-direction: column; justify-content: center; }

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-greeting {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.topbar-date {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.icon-btn {
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: background .12s;
}
.icon-btn:hover { background: var(--bg); }

.topbar-avatar {
  width: 36px; height: 36px;
  background: var(--navy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  cursor: default;
  user-select: none;
}

/* ─── Content area ───────────────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 1.75rem 2rem 4rem;
}

/* Fund strip */
.fund-strip {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 1.5rem;
}

.strip-dot { color: var(--border); }

.strip-status {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--green);
  font-weight: 600;
}

.status-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

/* Section label */
.section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

/* ─── Capital row: committed ring + first close tracker ──────────────────── */
.capital-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}

@media (max-width: 820px) {
  .capital-row { grid-template-columns: 1fr; }
}

/* ─── Ring cards row ─────────────────────────────────────────────────────── */
.rings-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ring-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.ring-card--featured {
  border-color: var(--green);
  border-width: 1.5px;
  background: linear-gradient(160deg, var(--white) 70%, var(--green-light) 100%);
}

/* Card header */
.ring-card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.ring-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.ring-icon--brand {
  background: var(--green-light);
  color: var(--green);
}

.ring-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

/* Ring SVG area */
.ring-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin: .25rem 0;
}

.ring-svg {
  width: 148px;
  height: 148px;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 9;
}

@keyframes ring-spin-committed {
  from { stroke-dasharray: 0 314; }
  to   { stroke-dasharray: 188 314; }
}
@keyframes ring-spin-paidin {
  from { stroke-dasharray: 0 314; }
  to   { stroke-dasharray: 0 314; }
}
@keyframes ring-spin-deployed {
  from { stroke-dasharray: 0 314; }
  to   { stroke-dasharray: 0 314; }
}

.ring-fill {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 0 314;
}

.ring-committed {
  stroke: var(--committed);
  animation: ring-spin-committed 1.1s cubic-bezier(.4,0,.2,1) 0.15s both;
}
.ring-paidin {
  stroke: var(--paidin);
  animation: ring-spin-paidin 1.1s cubic-bezier(.4,0,.2,1) 0.15s both;
}
.ring-deployed {
  stroke: var(--deployed);
  animation: ring-spin-deployed 1.1s cubic-bezier(.4,0,.2,1) 0.15s both;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ring-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -.02em;
}

.ring-pct {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

/* Card footer */
.ring-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .25rem;
  border-top: 1px solid var(--border);
}

.ring-sub-label {
  font-size: 11px;
  color: var(--text-3);
}

.ring-trend {
  font-size: 11px;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 999px;
}

.ring-trend--up {
  color: var(--green);
  background: var(--green-light);
}

/* ─── First Close card ───────────────────────────────────────────────────── */
.close-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.close-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.close-title-group {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.close-icon {
  width: 36px; height: 36px;
  background: var(--blue-light);
  color: var(--green);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.close-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .1rem;
}

.close-sub { font-size: 12px; color: var(--text-3); }

.close-badges { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-start; }

/* Badges */
.badge {
  display: inline-block;
  padding: .3rem .8rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--committed { background: var(--green-light); color: var(--text); }
.badge--gap       { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }

/* Stats row */
.close-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.25rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.close-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .75rem .5rem;
}

.close-stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

.close-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.1;
}

.close-stat-label {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: .2rem;
}

/* Progress bar */
.progress-wrap { display: flex; flex-direction: column; gap: .65rem; }

.progress-bar {
  display: flex;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-filled {
  background: var(--committed);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  flex-shrink: 0;
}

.progress-label-inner {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.progress-gap {
  flex: 1;
  background: var(--green-light);
  border-left: 2px dashed var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  cursor: pointer;
  transition: background .15s;
  position: relative;
}

.progress-gap:hover,
.progress-gap:focus {
  background: var(--bg);
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.progress-gap-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  pointer-events: none;
  white-space: nowrap;
}

.progress-legend {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 11px;
  color: var(--text-3);
}

.legend-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot--committed { background: var(--committed); }
.legend-dot--gap       { background: var(--amber); }

/* ─── Overlay ────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--text) 30%, transparent);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  backdrop-filter: blur(1px);
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

/* ─── Drawer ─────────────────────────────────────────────────────────────── */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(520px, 100vw);
  background: var(--card);
  border-left: 1px solid var(--border);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.drawer.is-open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.25rem .9rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: .15rem; }
.drawer-sub   { font-size: 11px; color: var(--text-3); }

.drawer-close {
  width: 32px; height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
  transition: background .12s;
}
.drawer-close:hover { background: var(--bg); }

.drawer-gap-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: var(--green-light);
  border-bottom: 1px solid var(--border);
  padding: .85rem 1.25rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.drawer-gap-main { display: flex; align-items: center; gap: .75rem; }
.drawer-gap-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text);
  background: var(--white);
  padding: .2rem .5rem;
  border-radius: 999px;
}
.drawer-gap-amount { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.03em; }
.drawer-gap-note   { font-size: 11.5px; color: var(--text-2); }

/* Prospect table */
.drawer-table-wrap { flex: 1; overflow-y: auto; }

.prospect-table { width: 100%; border-collapse: collapse; }

.prospect-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  padding: .6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.prospect-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.prospect-table tbody tr:hover { background: var(--bg); }

.prospect-table td {
  padding: .8rem 1rem;
  vertical-align: middle;
  font-size: 13px;
}

.td-rank {
  width: 28px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-align: right;
}

.td-name-cell .td-name { font-weight: 600; color: var(--text); }
.td-name-cell .td-firm { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.prob-wrap { display: flex; align-items: center; gap: .5rem; }
.prob-bar-bg {
  width: 52px; height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.prob-bar-fill { height: 100%; border-radius: 99px; }
.prob-text { font-size: 12px; font-weight: 700; min-width: 30px; }

.td-amount { font-weight: 700; color: var(--text); white-space: nowrap; }
.td-date   { color: var(--text-3); font-size: 12px; white-space: nowrap; }

.owner-pill {
  display: inline-block;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  text-align: center;
  line-height: 24px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}

.drawer-disclaimer {
  font-size: 10.5px;
  color: var(--text-3);
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  line-height: 1.5;
}

/* ─── Investor Activity Lists ────────────────────────────────────────────── */
.lists-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: max-content;
  gap: 1rem;
  align-items: start;
}

.list-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  align-self: start;
  height: fit-content;
}

.list-card.is-collapsed {
  max-height: 64px;
}

/* Card header (button) */
.list-card-hdr {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: .5rem;
  transition: filter .15s;
}
.list-card-hdr:hover { filter: brightness(1.1); }

.list-card--green .list-card-hdr {
  background: var(--green-light);
  border-bottom: 1px solid var(--border);
}

.list-card--amber .list-card-hdr {
  background: var(--warm-light);
  border-bottom: 1px solid var(--border);
}

.list-card--blue .list-card-hdr {
  background: var(--sage-light);
  border-bottom: 1px solid var(--border);
}

.list-card.is-collapsed .list-card-hdr {
  border-bottom-color: transparent;
}

.list-hdr-left {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.list-hdr-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--white);
  color: var(--green);
  border: 1px solid var(--border-light);
}

.list-card--amber .list-hdr-icon {
  color: var(--text-2);
}

.list-card--blue .list-hdr-icon {
  color: #3a6fa8;
}

.list-hdr-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-hdr-count {
  font-size: 11px;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border-light);
}

.list-chevron {
  flex-shrink: 0;
  color: var(--text-2);
  transition: transform .22s ease;
}
.list-card-hdr[aria-expanded="false"] .list-chevron {
  transform: rotate(-90deg);
}

/* Collapsible body */
.list-body {
  overflow: hidden;
  max-height: 800px;
  transition: max-height .3s cubic-bezier(.4,0,.2,1), opacity .25s ease;
  opacity: 1;
  border-top: 1px solid var(--border);
}
.list-body.is-collapsed {
  max-height: 0;
  opacity: 0;
  border-top-color: transparent;
}

/* List items */
.list-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg); }

.list-item-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.list-item-avatar--green,
.list-item-avatar--amber,
.list-item-avatar--blue {
  background: var(--green-light);
  color: var(--text);
}

.list-item-info {
  flex: 1;
  min-width: 0;
}
.list-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-firm {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.list-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.list-item-amount {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.list-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.list-tag--green,
.list-tag--amber,
.list-tag--blue {
  background: var(--green-light);
  color: var(--text);
}

/* ─── Section head with inline controls ──────────────────────────────────── */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.section-head-left { min-width: 0; }

.section-caption {
  font-size: 12px;
  color: var(--text-3);
  margin-top: .35rem;
  max-width: 60ch;
}

/* Toggle (time horizon + period) */
.horizon-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-shrink: 0;
}

.horizon-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding: .35rem .75rem;
  border-radius: 999px;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.horizon-btn:hover { color: var(--text); }
.section-head-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .65rem;
  flex-shrink: 0;
}

.period-picker {
  display: inline-flex;
  align-items: flex-end;
  gap: .5rem;
  flex-wrap: wrap;
}

.period-picker-field {
  display: inline-flex;
  flex-direction: column;
  gap: .25rem;
}

.period-picker-field.is-hidden { display: none; }

.period-picker-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.period-picker-input {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .4rem .55rem;
  min-height: 32px;
}

.period-picker-input:focus {
  outline: 2px solid var(--green-light);
  outline-offset: 1px;
  border-color: var(--green);
}

.period-picker-quarter {
  display: inline-flex;
  gap: .35rem;
  align-items: center;
}

.period-picker-select { min-width: 4.5rem; cursor: pointer; }

.period-picker-year {
  width: 4.5rem;
  -moz-appearance: textfield;
}

.period-picker-today {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  padding: .45rem .65rem;
  border-radius: 8px;
  cursor: pointer;
  min-height: 32px;
  align-self: flex-end;
  transition: color .12s, border-color .12s;
}

.period-picker-today:hover {
  color: var(--text);
  border-color: var(--text-3);
}

.horizon-btn.is-active {
  background: var(--white);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

/* ─── Status board ───────────────────────────────────────────────────────── */
.status-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 1rem;
}

.status-board-empty {
  grid-column: 1 / -1;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}

.data-error-banner {
  margin: 0 1.5rem 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: #fff4e5;
  border: 1px solid #f0c36d;
  color: #7a4d00;
  font-size: 13px;
  line-height: 1.45;
}

.status-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: relative;
  overflow: hidden;
}
.status-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, var(--green));
}

.status-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}

.status-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.status-card-total {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Big net-change number — the hero metric that responds to the time horizon */
.status-net-wrap {
  position: relative;
  overflow: hidden;
  height: 36px;
}

.status-net {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  cursor: default;
  display: block;
  position: relative;
}
.status-net--up   { color: var(--green); }
.status-net--down { color: var(--text-2); }
.status-net--flat { color: var(--text-3); }

/* ── Slot-machine roll animation ─────────────────────────────────────────── */
@keyframes slot-exit-down {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(100%); opacity: 0; }
}
@keyframes slot-enter-top {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.status-net.is-slot-entering {
  animation: slot-enter-top 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.slot-ghost {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  pointer-events: none;
  animation: slot-exit-down 0.22s ease-in both;
}

.status-card-foot {
  font-size: 10.5px;
  color: var(--text-3);
  border-top: 1px solid var(--border-light);
  padding-top: .5rem;
  transition: opacity 0.18s ease;
}

/* ─── Momentum (period comparison) ───────────────────────────────────────── */
.momentum-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.momentum-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.momentum-loading { font-size: 13px; color: var(--text-3); }

.momentum-figure { display: flex; align-items: baseline; gap: .5rem; }
.momentum-big {
  font-size: 34px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1;
}
.momentum-unit { font-size: 13px; color: var(--text-2); font-weight: 600; }

.momentum-compare { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }

.momentum-trend {
  font-size: 13px;
  font-weight: 700;
  padding: .25rem .65rem;
  border-radius: 999px;
}
.momentum-trend--up   { background: var(--green-light); color: var(--green); }
.momentum-trend--down { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.momentum-trend--flat { background: var(--bg); color: var(--text-3); }
.momentum-prev { font-size: 11px; color: var(--text-3); }

.momentum-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: .4rem;
  flex-wrap: wrap;
}
.momentum-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }
.legend-swatch--current { background: var(--green); }
.legend-swatch--prev    { background: var(--border); }

.momentum-legend-caption {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: .85rem;
}
.momentum-legend-caption strong { color: var(--text-2); font-weight: 600; }

.momentum-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: center;
  padding: .4rem 0;
}

.momentum-row-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.momentum-row-bars { display: flex; flex-direction: column; gap: 4px; }

.momentum-bar-track {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: help;
  border-radius: 4px;
  padding: 2px 0;
  transition: background .12s;
}
.momentum-bar-track:hover { background: var(--bg); }

.momentum-bar {
  height: 10px;
  border-radius: 99px;
  min-width: 2px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.momentum-bar--current { background: var(--green); }
.momentum-bar--prev    { background: var(--border); }

.momentum-bar-val { font-size: 11px; font-weight: 700; color: var(--text); }
.momentum-bar-val--muted { color: var(--text-3); font-weight: 600; }

@media (max-width: 560px) {
  .momentum-row { grid-template-columns: 1fr; gap: .4rem; }
}
