:root {
  --bg: #edf3ef;
  --panel: rgba(255, 255, 255, 0.9);
  --ink: #13251f;
  --muted: #5b6e66;
  --line: rgba(19, 37, 31, 0.13);
  --green: #08745e;
  --green-soft: #dff3ec;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --amber: #b45309;
  --amber-soft: #fff1d6;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --shadow: 0 18px 52px rgba(13, 36, 29, 0.1);
  --soft-shadow: 0 10px 30px rgba(13, 36, 29, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 6%, rgba(22, 160, 133, 0.2), transparent 28rem),
    radial-gradient(circle at 94% 0, rgba(37, 99, 235, 0.13), transparent 28rem),
    linear-gradient(135deg, #fcfdfb 0%, var(--bg) 58%, #e6efe9 100%);
  color: var(--ink);
  font-family: "Trebuchet MS", Aptos, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(19, 37, 31, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 37, 31, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(238, 242, 239, 0.68);
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.loading-overlay.done {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-overlay article {
  display: grid;
  gap: 9px;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0, rgba(13, 124, 102, 0.18), transparent 42%),
    #ffffff;
  box-shadow: 0 24px 70px rgba(20, 32, 28, 0.22);
}

.loading-overlay p {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.loading-overlay strong {
  font-size: 42px;
  line-height: 1;
}

.loading-overlay span {
  color: var(--muted);
  font-weight: 900;
}

.loading-overlay i {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eeea;
}

.loading-overlay b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #14b8a6);
  transition: width 220ms ease;
}

button,
input,
select,
a {
  font: inherit;
}

.shell {
  width: calc(100% - 18px);
  margin: 0 auto;
  padding: 10px 0 16px;
}

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

.topbar {
  position: relative;
  z-index: 2000;
  padding: clamp(13px, 1.7vw, 23px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 4% 0, rgba(8, 116, 94, 0.17), transparent 25rem),
    rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.control-panel {
  position: relative;
  z-index: 100;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(8, 116, 94, 0.13);
  content: "";
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(31px, 3.35vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.actions,
.filters,
.query-form,
.token-form,
.search-bar {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

button,
.actions a,
.chip,
.query-form select,
.token-form input,
.search-bar input {
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 850;
}

button,
.actions a,
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  text-decoration: none;
  cursor: pointer;
}

.refresh-status-wrap {
  position: relative;
  display: inline-flex;
}

.refresh-status-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10050;
  display: grid;
  gap: 8px;
  width: min(520px, calc(100vw - 24px));
  max-height: 340px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0 0, rgba(8, 116, 94, 0.12), transparent 12rem),
    #ffffff;
  box-shadow: 0 22px 56px rgba(13, 36, 29, 0.2);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.refresh-status-wrap:hover .refresh-status-tooltip,
.refresh-status-wrap:focus-within .refresh-status-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.refresh-status-tooltip b {
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.refresh-status-tooltip > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.refresh-status-tooltip table {
  min-width: 430px;
  border-collapse: collapse;
  font-size: 12px;
}

.refresh-status-tooltip th,
.refresh-status-tooltip td {
  padding: 7px 8px;
  border-bottom: 1px solid #edf2ef;
  text-align: left;
  white-space: nowrap;
}

.refresh-status-tooltip th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3faf6;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.refresh-status-tooltip td:first-child {
  color: var(--green);
  font-weight: 950;
}

button:hover,
.actions a:hover,
.chip:hover {
  border-color: var(--green);
  box-shadow: var(--soft-shadow);
  transform: translateY(-1px);
}

button,
.actions a,
.chip {
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

button:focus-visible,
.actions a:focus-visible,
.chip:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.34);
  outline-offset: 2px;
}

.chip.active {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.query-form label,
.side-sort {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.query-form select,
.side-sort select {
  min-width: 138px;
  padding: 0 9px;
}

.token-form input {
  width: min(390px, 56vw);
  padding: 0 11px;
}

.search-bar input {
  width: min(360px, 46vw);
  padding: 0 12px;
}

.status-strip,
.hero-grid,
.decision-grid,
.tabs-panel,
.signal-grid,
.workbench {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.status-strip {
  grid-template-columns: 0.65fr 0.65fr 0.75fr minmax(260px, 1.7fr);
}

.status-strip article,
.flow-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.status-strip article {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 8px 10px;
}

.status-strip span,
.flow-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.status-strip strong {
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-strip .error {
  color: var(--red);
}

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

.flow-card {
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 15px;
  background:
    radial-gradient(circle at 100% 0, rgba(8, 116, 94, 0.11), transparent 11rem),
    var(--panel);
}

.flow-card strong {
  font-size: 28px;
  line-height: 1;
}

.flow-card small {
  color: var(--muted);
  font-weight: 800;
}

.flow-card.build strong,
.flow-card.add strong {
  color: var(--green);
}

.flow-card.reduce strong {
  color: var(--amber);
}

.flow-card.exit strong {
  color: var(--red);
}

.decision-grid {
  grid-template-columns: 1fr;
}

.tabs-panel {
  min-height: calc(100vh - 250px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.tab-bar {
  display: flex;
  gap: 7px;
  margin-bottom: 8px;
}

.tab-button {
  min-height: 36px;
  border-radius: 999px;
}

.tab-button.active {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.tab-page[hidden] {
  display: none;
}

.tab-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.analytics-tab {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: calc(100vh - 310px);
}

.quarter-chart-panel {
  grid-column: 1 / -1;
}

.analytics-side-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 8px;
}

.analytics-watchlist,
.weekly-new-panel {
  min-width: 0;
}

.report-tab {
  display: grid;
  gap: 8px;
}

.favorite-list {
  display: grid;
  gap: 7px;
  padding: 8px;
}

.favorite-group {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfdfb;
}

.favorite-group h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.favorite-group h3 span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 950;
}

.favorite-group > div {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 7px;
}

.favorite-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 7px;
  border-radius: 8px;
  background: #f5f8f6;
}

.favorite-title {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.favorite-card a {
  overflow: hidden;
  color: var(--ink);
  font-weight: 950;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-card a:hover {
  color: var(--green);
  text-decoration: underline;
}

.favorite-title span,
.favorite-card strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

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

.favorite-card label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.favorite-card input,
.favorite-card textarea {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-transform: none;
}

.favorite-card textarea {
  min-height: 56px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.35;
}

.analytics-tab .large-chart {
  min-height: 520px;
}

.analytics-tab .focus-list {
  max-height: 360px;
}

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

.workbench {
  grid-template-columns: minmax(0, 1fr) minmax(350px, 25vw);
  align-items: start;
}

.workbench.single {
  grid-template-columns: 1fr;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.panel h2 {
  margin: 0;
  font-size: 21px;
}

.panel header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.chart-panel,
.focus-panel,
.signal-grid .panel {
  padding-bottom: 9px;
}

.bar-chart,
.focus-list,
.signal-list {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 8px;
  max-height: 290px;
  overflow: auto;
  scrollbar-color: #8b918e #edf1ef;
  scrollbar-width: thin;
}

.pie-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.75fr) minmax(360px, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 468px;
  padding: 16px;
}

.pie-chart {
  width: min(430px, 100%);
  height: auto;
  aspect-ratio: 1;
  justify-self: center;
}

.pie-chart path {
  stroke: #ffffff;
  stroke-width: 1.4;
}

.pie-chart text {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.pie-layout ul {
  display: grid;
  gap: 5px;
  max-height: 430px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.pie-layout li {
  position: relative;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.chart-tooltip {
  position: fixed;
  z-index: 9999;
  display: grid;
  gap: 4px;
  width: min(560px, 76vw);
  max-height: 310px;
  overflow: auto;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(20, 32, 28, 0.18);
}

.chart-tooltip[hidden] {
  display: none;
}

.tip-title {
  overflow: hidden;
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pie-layout i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.pie-layout a,
.pie-layout span,
.pie-layout strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pie-layout a {
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.pie-layout a:hover {
  color: var(--green);
  text-decoration: underline;
}

.pie-layout li em {
  color: var(--green);
  font-style: normal;
  font-weight: 950;
}

.bar-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 86px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.quarter-chart {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding: 12px;
  scrollbar-color: #8b918e #edf1ef;
  scrollbar-width: thin;
}

.quarter-report-block {
  display: grid;
  gap: 7px;
}

.quarter-report-block h3 {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5faf7;
  color: var(--green);
  font-size: 15px;
}

.quarter-report-filter {
  display: inline-grid;
  grid-template-columns: auto 150px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.quarter-report-filter select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.quarter-report-table {
  min-width: 720px;
  font-size: 13px;
}

.quarter-report-table tr:hover td {
  background: #f5f8f6;
}

.quarter-report-table a {
  color: var(--ink);
  font-weight: 950;
  text-decoration: none;
}

.quarter-report-table a:hover {
  color: var(--green);
  text-decoration: underline;
}

.weekly-new-report {
  max-height: 430px;
  overflow: auto;
  padding: 12px;
  scrollbar-color: #8b918e #edf1ef;
  scrollbar-width: thin;
}

.weekly-new-table {
  min-width: 860px;
  font-size: 13px;
}

.weekly-new-table tr:hover td {
  background: #f5f8f6;
}

.weekly-new-table a {
  color: var(--ink);
  font-weight: 950;
  text-decoration: none;
}

.weekly-new-table a:hover {
  color: var(--green);
  text-decoration: underline;
}

.bar-row strong,
.bar-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row span {
  color: var(--muted);
  font-weight: 900;
  text-align: right;
}

.bar-track {
  display: flex;
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeeb;
}

.bar-track i {
  display: block;
  height: 100%;
}

.bar-track .buy {
  background: var(--green);
}

.bar-track .reduce {
  background: var(--amber);
}

.focus-row,
.signal-row {
  display: grid;
  min-width: 0;
  border-radius: 7px;
  background: #f5f8f6;
  color: var(--ink);
  text-decoration: none;
}

.focus-row {
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

.signal-row {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
}

.focus-row b {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
}

.focus-row strong,
.focus-row strong[data-tooltip],
.signal-row strong,
.signal-row span,
.signal-row em,
.signal-row small,
.focus-row span,
.focus-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-row strong[data-tooltip] {
  cursor: help;
}

.focus-row span,
.signal-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.signal-row em {
  color: var(--ink);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.focus-row em,
.signal-row span {
  color: var(--green);
  font-style: normal;
  font-weight: 950;
}

.table-panel {
  min-height: 540px;
}

.table-scroll {
  height: calc(100vh - 420px);
  min-height: 430px;
  overflow: auto;
  scrollbar-color: #8b918e #edf1ef;
  scrollbar-width: thin;
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  font-size: 13px;
}

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

.priority-investor-row td {
  background: linear-gradient(90deg, #fff7cc 0, #fffef5 52%, #ffffff 100%);
  box-shadow: inset 4px 0 0 #d97706;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(238, 244, 241, 0.96);
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.sort-head {
  min-height: 24px;
  width: 100%;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: inherit;
}

.sort-head.active::after {
  content: " " attr(data-dir);
  color: var(--green);
  font-size: 10px;
}

.stock-link,
.multi-card h3 a {
  color: var(--ink);
  font-weight: 950;
  text-decoration: none;
}

.favorite-star {
  min-height: 25px;
  width: 25px;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  background: #fff8df;
  color: #9a6700;
  font-size: 16px;
  line-height: 1;
}

.favorite-star.active {
  border-color: #d97706;
  background: #fbbf24;
  color: #3d2500;
}

.investor-hover .favorite-star {
  margin-right: 5px;
  vertical-align: middle;
}

.investor-count {
  display: inline-block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  cursor: help;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #d97706;
  color: #ffffff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.investor-hover {
  position: relative;
  display: block;
  width: max-content;
  max-width: 100%;
}

.investor-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 10;
  display: none;
  width: min(620px, 82vw);
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(20, 32, 28, 0.18);
  color: var(--ink);
  text-transform: none;
  white-space: normal;
}

.investor-hover:hover .investor-tooltip,
.investor-hover:focus-within .investor-tooltip {
  display: grid;
  gap: 4px;
}

.tip-head,
.tip-row {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) 90px 100px 88px 78px;
  gap: 8px;
  align-items: center;
  min-width: 536px;
}

.tip-head {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.tip-row {
  padding: 5px 0;
  border-top: 1px solid #eef1f0;
  font-size: 12px;
}

.tip-row b,
.tip-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tip-row .positive {
  color: var(--green);
  font-weight: 950;
}

.tip-row .negative {
  color: var(--red);
  font-weight: 950;
}

.stock-link:hover,
.multi-card h3 a:hover,
.focus-row:hover strong,
.signal-row:hover strong {
  color: var(--green);
  text-decoration: underline;
}

.change-pill {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef1f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.change-1 .change-pill {
  background: var(--green-soft);
  color: var(--green);
}

.change-2 .change-pill {
  background: var(--blue-soft);
  color: var(--blue);
}

.change-3 .change-pill {
  background: var(--amber-soft);
  color: var(--amber);
}

.change-4 .change-pill {
  background: var(--red-soft);
  color: var(--red);
}

.activity-panel header {
  align-items: flex-start;
}

.activity-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.activity-tab {
  min-height: 31px;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.activity-tab.active {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.activity-panel header > span {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 950;
}

.side-sort {
  margin-top: 7px;
}

.side-sort select {
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.multi-list {
  display: grid;
  align-content: start;
  gap: 8px;
  height: calc(100vh - 250px);
  min-height: 460px;
  overflow: auto;
  padding: 8px;
}

.multi-card {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.multi-card h3 {
  margin: 0;
  font-size: 15px;
}

.buyer-list {
  display: grid;
  gap: 5px;
}

.buyer-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  padding: 6px;
  border-radius: 6px;
  background: #f5f8f6;
  font-size: 12px;
}

.buyer-list strong,
.buyer-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

@media (max-width: 1180px) {
  .decision-grid,
  .analytics-tab,
  .analytics-side-grid,
  .quarter-chart,
  .signal-grid,
  .workbench {
    grid-template-columns: 1fr;
  }

  .table-scroll,
  .multi-list {
    height: min(520px, 58vh);
  }
}

@media (max-width: 760px) {
  .topbar,
  .control-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: clamp(32px, 11vw, 48px);
  }

  .actions,
  .filters,
  .query-form,
  .token-form,
  .search-bar,
  .refresh-status-wrap,
  .query-form label,
  .query-form select,
  .query-form button,
  .search-bar input,
  .token-form input,
  .token-form button {
    width: 100%;
  }

  .refresh-status-wrap #refreshButton {
    width: 100%;
    justify-content: center;
  }

  .refresh-status-tooltip {
    right: auto;
    left: 0;
  }

  .status-strip,
  .hero-grid,
  .decision-grid,
  .analytics-tab,
  .analytics-side-grid,
  .quarter-chart,
  .signal-grid {
    grid-template-columns: 1fr;
  }

  .pie-chart {
    width: 210px;
    height: 210px;
  }

  .bar-row,
  .pie-layout,
  .focus-row,
  .signal-row {
    grid-template-columns: 1fr;
  }

  .tabs-panel,
  .analytics-tab,
  .analytics-tab .large-chart,
  .pie-layout {
    min-height: auto;
  }

  .pie-chart {
    width: min(280px, 100%);
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  .actions a,
  .chip {
    transition: none;
  }
}
