:root {
  --bg: #f6f7f4;
  --ink: #1c211f;
  --muted: #66706b;
  --line: #d8ded7;
  --panel: #ffffff;
  --red: #c53b38;
  --green: #10805f;
  --gold: #b77a1b;
  --graphite: #2c3330;
  --soft-red: #fff0ef;
  --soft-green: #edf8f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Noto Sans SC", sans-serif;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px clamp(16px, 5vw, 58px);
  color: #fff;
  background: linear-gradient(112deg, #18382f 0%, #3c6f59 54%, #9a463e 100%);
}

.topbar img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.topbar h1,
.section-title h2,
.focus-card h2 {
  margin: 0;
  line-height: 1.16;
}

.topbar p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.84);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.freshness {
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 56px;
}

.warning,
.focus-card,
.metric-grid article,
.usage-grid article,
.playbook,
.explain-grid article,
.pool-card,
.event-row,
.strategy-card,
.blacklist,
.late-money {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.warning {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 13px 15px;
  color: #5d3b10;
  background: #fff8ea;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 16px;
}

.focus-card {
  padding: clamp(18px, 3vw, 28px);
}

.focus-card p:last-of-type {
  margin: 10px 0 0;
  color: var(--muted);
}

.condition-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.condition-list span,
.blacklist span {
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--graphite);
  background: #eef2ed;
  font-size: 13px;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-grid article {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 16px;
}

.metric-grid span,
.pool-card span,
.event-row span,
.late-money span {
  color: var(--muted);
  font-size: 13px;
}

.metric-grid strong {
  align-self: end;
  font-size: clamp(24px, 4vw, 36px);
}

.section-title {
  margin: 28px 0 11px;
}

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

.usage-grid article {
  padding: 15px;
}

.usage-grid article > span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #fff;
  background: var(--red);
  font-weight: 800;
}

.usage-grid h3 {
  margin: 12px 0 7px;
}

.usage-grid p,
.playbook p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.playbook {
  margin-top: 12px;
  padding: 14px 15px;
  background: var(--soft-green);
}

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

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  margin-bottom: 12px;
}

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

.explain-grid article {
  padding: 10px;
  background: #fbfcfa;
}

.explain-grid strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.explain-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

input,
button {
  min-height: 40px;
  border-radius: 8px;
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: #fff;
}

button {
  border: 0;
  padding: 0 14px;
  color: #fff;
  background: var(--graphite);
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: var(--green);
}

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

.pool-card {
  display: grid;
  gap: 8px;
  padding: 9px;
}

.pool-title {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: start;
}

.code {
  font-size: 15px;
  font-weight: 800;
}

.pool-title strong {
  display: block;
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.sample-count {
  border-radius: 6px;
  padding: 3px 5px;
  color: var(--muted);
  background: #f3f5f2;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

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

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

.stats div {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  padding: 5px;
  background: #f3f5f2;
}

.stats span {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats strong {
  font-size: 11px;
  white-space: nowrap;
}

.compact-date {
  font-size: 12px;
}

.positive {
  color: var(--red);
}

.negative {
  color: var(--green);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.event-list,
.strategy-list {
  display: grid;
  gap: 10px;
}

.event-row {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, minmax(72px, 0.5fr));
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.strategy-card {
  padding: 14px;
}

.strategy-card h3 {
  margin: 0 0 6px;
}

.strategy-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  background: var(--graphite);
  font-size: 12px;
  font-weight: 800;
}

.blacklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
}

.blacklist strong {
  width: 100%;
}

.late-money {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.late-row {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, minmax(76px, 0.5fr));
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

@media (max-width: 880px) {
  .topbar,
  .hero-grid,
  .two-column,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .topbar img {
    width: 60px;
    height: 60px;
  }

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

  .usage-grid,
  .explain-grid {
    grid-template-columns: 1fr;
  }

  .event-row,
  .late-row {
    grid-template-columns: 1fr 1fr;
  }

  .warning {
    align-items: flex-start;
    flex-direction: column;
  }
}
