:root {
  color-scheme: light;
  --ink: #1b1f24;
  --muted: #667085;
  --line: #d9dee8;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-2: #8a5a00;
  --bad: #b42318;
  --good: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 24px;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand img {
  height: 40px;
  width: 40px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 700;
}

h2 {
  font-size: 15px;
}

.brand p,
small,
.facts dt,
.result-grid span,
#tableMeta {
  color: var(--muted);
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-width: 86px;
  padding: 6px 12px;
  text-align: center;
}

main {
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 1240px;
  padding: 18px;
}

.metrics,
.layout {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics article {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 16px;
}

.metrics span {
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  font-size: 26px;
  line-height: 1.1;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.monitor-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.strategy-tabs {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
}

.strategy-tabs button {
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  height: 30px;
  min-width: 64px;
  padding: 0 10px;
  width: auto;
}

.strategy-tabs button.active {
  background: var(--accent);
  color: #ffffff;
}

button {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-size: 16px;
  height: 34px;
  justify-content: center;
  width: 38px;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.facts div {
  display: grid;
  gap: 4px;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  min-height: 150px;
  padding: 10px;
  resize: vertical;
  width: 100%;
}

.result-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.notice-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.result-grid div,
.notice-grid div {
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.notice-grid span {
  color: var(--muted);
  font-size: 13px;
}

.notice-grid strong {
  font-size: 20px;
}

.progress-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 12px;
}

.legend-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.legend-item {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  gap: 6px;
  white-space: nowrap;
}

.legend-item i {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.legend-active i {
  background: #0f766e;
}

.legend-upcoming i {
  background: #2563eb;
}

.legend-closed i {
  background: #b45309;
}

.legend-listed i {
  background: #64748b;
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  min-width: 1040px;
  width: 100%;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.opportunity-row td {
  background: transparent;
}

.opportunity-row {
  cursor: pointer;
}

.opportunity-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.opportunity-row:hover {
  box-shadow: inset 0 0 0 9999px rgba(15, 118, 110, 0.05);
}

.opportunity-row.selected {
  box-shadow:
    inset 4px 0 0 var(--accent),
    inset 0 0 0 9999px rgba(15, 118, 110, 0.08);
}

.ipo-status-active {
  background: #edfdf7;
  box-shadow: inset 4px 0 0 #0f766e;
}

.ipo-status-upcoming {
  background: #eff6ff;
  box-shadow: inset 4px 0 0 #2563eb;
}

.ipo-status-closed {
  background: #fff7ed;
  box-shadow: inset 4px 0 0 #b45309;
}

.ipo-status-listed {
  background: #f8fafc;
  box-shadow: inset 4px 0 0 #64748b;
}

.progress-badge {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  justify-content: center;
  min-width: 58px;
  padding: 3px 8px;
  white-space: nowrap;
}

.progress-active {
  background: #ccfbef;
  border-color: #99f6e4;
  color: #115e59;
}

.progress-upcoming {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.progress-closed {
  background: #ffedd5;
  border-color: #fed7aa;
  color: #9a3412;
}

.progress-listed {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}

.progress-unknown {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: var(--muted);
}

.opportunity-detail-row td {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 0 8px 14px 8px;
}

.opportunity-detail {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  margin: 0;
  padding: 14px 16px 16px;
}

.detail-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.detail-head h3 {
  font-size: 18px;
  line-height: 1.3;
  margin: 0;
}

.detail-head p {
  color: var(--muted);
  margin-top: 3px;
}

.detail-badges {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.decision-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  min-width: 42px;
  padding: 3px 8px;
}

.detail-section {
  border-top: 1px solid #edf0f5;
  padding: 12px 0;
}

.detail-section h4,
.detail-snippet h4 {
  font-size: 13px;
  margin: 0 0 8px;
}

.detail-section p {
  color: #344054;
  margin: 0;
}

.detail-list {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.detail-list div {
  border-bottom: 1px solid #edf0f5;
  display: grid;
  gap: 2px;
  grid-template-columns: minmax(108px, 0.44fr) minmax(0, 1fr);
  padding: 7px 10px 7px 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-table {
  min-width: 720px;
}

.detail-snippet {
  border-bottom: 1px solid #edf0f5;
  padding: 8px 0;
}

.detail-snippet p {
  color: #344054;
  margin-bottom: 4px;
}

.detail-raw {
  border-top: 1px solid #edf0f5;
  padding-top: 12px;
}

.detail-raw summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.detail-raw pre {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  margin: 10px 0 0;
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
}

td a {
  color: var(--accent);
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.name-cell {
  min-width: 230px;
}

.name-primary {
  color: var(--ink);
  font-weight: 600;
}

.name-secondary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
}

.good {
  color: var(--good);
}

.bad {
  color: var(--bad);
}

.warn {
  color: var(--accent-2);
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
  }

  .metrics,
  .layout {
    grid-template-columns: 1fr;
  }

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

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

  .detail-head {
    display: grid;
  }

  .detail-badges {
    justify-content: flex-start;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }
}
