:root {
  color-scheme: light;
  --ink: #071426;
  --muted: #536176;
  --line: #d7e2ef;
  --soft: #f3f8fd;
  --blue: #1166d8;
  --green: #087a60;
  --orange: #b85a00;
  --red: #b42318;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef7fb 0%, #f8fbff 34%, #ffffff 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
textarea,
a {
  font: inherit;
}

.chain-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.chain-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  padding: 26px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #092f4d, #087a60);
  box-shadow: 0 18px 45px rgba(8, 42, 71, 0.18);
}

.chain-hero a {
  color: #dff9ff;
  font-weight: 800;
  text-decoration: none;
}

.chain-hero span,
.criteria-panel span,
.pick-card span {
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chain-hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: .95;
}

.chain-hero p {
  max-width: 720px;
  margin: 0;
  color: #eaf8ff;
  font-size: 18px;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-actions a,
.paste-actions button {
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px;
  padding: 12px 16px;
  background: rgba(255,255,255,.13);
}

.paste-panel,
.criteria-panel,
.table-wrap {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(17, 42, 70, .08);
}

.paste-panel {
  padding: 18px;
}

.paste-panel label {
  display: block;
  margin-bottom: 10px;
  color: #19385f;
  font-weight: 900;
}

textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border: 1px solid #bfcfe0;
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: #fbfdff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 15px;
  line-height: 1.45;
}

textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(17, 102, 216, .35);
  outline-offset: 3px;
}

.paste-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.paste-actions button {
  min-width: 170px;
  border-color: #b9cbe0;
  color: #08223f;
  background: #eef6ff;
  cursor: pointer;
  font-weight: 900;
}

.paste-actions button:first-child {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.paste-actions .danger {
  color: var(--red);
  background: #fff4f2;
}

.status {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 16px;
  background: #eef8f4;
  color: #07513f;
  font-weight: 900;
}

.status.error {
  color: var(--red);
  background: #fff5f2;
}

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

.summary-grid > div,
.pick-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 16px;
  box-shadow: 0 12px 28px rgba(17, 42, 70, .07);
}

.summary-grid span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

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

.pick-card.best {
  border-color: #73d3bb;
  background: #ecfff8;
}

.pick-card.watch {
  border-color: #f0c686;
  background: #fff9ec;
}

.pick-card.avoid {
  border-color: #f4b5ad;
  background: #fff6f4;
}

.pick-card h2 {
  margin: 8px 0 2px;
  font-size: 28px;
}

.score {
  display: inline-flex;
  margin-top: 10px;
  border-radius: 999px;
  padding: 8px 12px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.score.watch {
  background: var(--orange);
}

.score.avoid {
  background: var(--red);
}

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

.metric {
  border: 1px solid #dce8f3;
  border-radius: 8px;
  padding: 10px;
  background: rgba(255,255,255,.75);
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.pick-card p {
  color: #384b63;
  line-height: 1.45;
}

.criteria-panel {
  padding: 18px;
}

.criteria-panel h2 {
  margin: 6px 0 8px;
}

.criteria-panel ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #2f4057;
  line-height: 1.55;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: #40546e;
  background: var(--soft);
  font-size: 12px;
  text-transform: uppercase;
}

td strong {
  color: var(--ink);
}

.call {
  color: #075e4d;
  font-weight: 900;
}

.put {
  color: #8a3f00;
  font-weight: 900;
}

@media (max-width: 820px) {
  .chain-hero {
    display: block;
    padding: 20px;
  }

  .hero-actions {
    justify-content: flex-start;
    margin-top: 16px;
  }

  .summary-grid,
  .best-grid {
    grid-template-columns: 1fr;
  }

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

  .paste-actions button {
    width: 100%;
  }
}
