.sports-workbench {
  --ink: #142826;
  --muted: #506561;
  --line: #dce5df;
  --home: #167b64;
  --away: #aa580f;
  margin: 0;
  background: #f5f7f2;
  color: var(--ink);
  font: 1rem/1.5 "Inter", "Microsoft YaHei", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.sports-workbench *, .sports-workbench *::before, .sports-workbench *::after { box-sizing: border-box; }
.sports-workbench [hidden] { display: none !important; }
.sports-workbench a { color: #16624e; text-underline-offset: .18em; }
.sports-workbench :focus-visible { outline: 3px solid #286ab0; outline-offset: 3px; }
.sports-workbench h1, .sports-workbench h2, .sports-workbench h3, .sports-workbench p { margin: 0; }
.sports-workbench button, .sports-workbench input { font: inherit; }
.workbench-skip {
  position: fixed;
  z-index: 5;
  inset: .5rem auto auto .5rem;
  transform: translateY(-200%);
  padding: .6rem;
  background: #fff;
}
.workbench-skip:focus { transform: none; }
#workspace { max-width: 1130px; margin: auto; padding: 20px clamp(12px, 3vw, 32px) 32px; }

.fixture {
  padding: clamp(16px, 3.6vw, 35px);
  border-radius: 16px;
  color: #f4fbf7;
  background: radial-gradient(ellipse at 100% -50%, #296c58, #143833 62%, #102d2a);
}
.fixture-heading, .fixture-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.fixture-heading { justify-content: space-between; font-weight: 700; font-size: .88rem; }
.fixture-state {
  padding: 2px 10px;
  border: 1px solid #6b9b89;
  border-radius: 999px;
  color: #d9f1e5;
  font-size: .77rem;
}
.fixture .competition { margin-top: clamp(12px, 3vw, 24px); color: #bee1d2; font-size: .85rem; }
.fixture h1 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 .32em;
  margin: 3px 0 8px;
  font-size: clamp(1.45rem, 4.3vw, 2.6rem);
  line-height: 1.23;
  letter-spacing: -.02em;
}
.versus { font: 600 .52em/1 system-ui, sans-serif; color: #9dd1bd; }
.fixture-meta { color: #d7e8e1; font-size: .84rem; }
.fixture .fixture-result { margin-top: 12px; color: #b9edd1; font-weight: 700; font-size: .9rem; }

.outcome-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.outcome-metrics > div, .pane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.outcome-metrics > div { padding: 10px clamp(7px, 2.2vw, 18px); }
.outcome-metrics dt { color: var(--muted); font-size: .75rem; }
.outcome-metrics dd { margin: 0; font-size: clamp(1.01rem, 2.4vw, 1.7rem); font-weight: 750; }
.profit { color: #15664f; }

.workbench-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.pane { padding: clamp(12px, 2.4vw, 19px); }
.pane-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.pane h2 { font-size: clamp(1.13rem, 2.1vw, 1.28rem); }
.pane-head p, .settlement-note, #chart-caption, .replay-message { color: var(--muted); font-size: .82rem; }
.replay-pane, #replay-title { scroll-margin-block-start: 12px; }
.btn {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #b8cdc1;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .82rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: #17634f; color: #fff; border-color: #17634f; }
.btn-primary:hover { background: #0f4e3d; }
.btn-secondary { background: #f4f9f6; color: #145742; }
.btn-secondary:hover, .btn-secondary[aria-pressed="true"] { background: #e1efe7; border-color: #729b88; }
.replay-figure { margin: 11px 0 0; }
.quote-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  list-style: none;
  margin: 0 0 5px;
  padding: 0;
  color: var(--muted);
  font-size: .8rem;
}
.quote-legend li::before { content: ""; display: inline-block; width: 13px; height: 3px; margin: 0 .35em .19em 0; }
.home-legend::before { background: var(--home); }
.away-legend::before { border-top: 3px dashed var(--away); }
#replay-chart { width: 100%; height: clamp(11rem, 33dvh, 18rem); }
#chart-caption { margin-top: 5px; }
.replay-message:empty { display: none; }
.replay-controls { margin-top: 10px; }
.position-label { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .85rem; }
.position-label label { font-weight: 700; }
.position-label time { color: #28574a; font-size: .88rem; }
.phase { padding: 2px 6px; border-radius: 6px; background: #eef5ef; color: #275647; font-size: .75rem; }
#position { display: block; width: 100%; min-height: 44px; margin: 0; accent-color: #17634f; cursor: pointer; }
.replay-jumps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.replay-jumps .btn { padding: 5px 2px; font-size: clamp(.76rem, 2.5vw, .9rem); }
.quote-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 10px 0 0;
}
.quote-cards > div { padding: 7px 6px 7px 8px; border-radius: 6px; border: 1px solid var(--line); }
.quote-cards .home-quote { border-inline-start: 3px solid var(--home); }
.quote-cards .away-quote { border-inline-start: 3px dashed var(--away); }
.quote-cards dt { font-weight: 700; font-size: .8rem; }
.quote-cards dd { margin: 2px 0 0; font-size: .77rem; color: var(--muted); }

.settlement-lines { margin: 8px 0 12px; font-size: .9rem; }
.settlement-lines > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.settlement-lines dd { margin: 0; font-weight: 750; text-align: end; }
.settlement-total { color: #15664f; }
.settlement-pane h3 { margin-top: 12px; font-size: .93rem; }
.settlement-pane .scenario { margin: 2px 0 7px; }
.orders-pane { margin-top: 12px; }
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  align-items: start;
  gap: 8px;
  margin-top: 10px;
}
.trade-card { min-width: 0; border: 1px solid var(--line); border-radius: 9px; }
.trade-card summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 60px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.trade-card summary::before { content: "▸"; color: #1e6955; }
.trade-card[open] summary::before { content: "▾"; }
.trade-card[open] summary { border-bottom: 1px solid var(--line); }
.trade-name, .trade-result { display: grid; }
.trade-result { margin-inline-start: auto; text-align: end; }
.trade-result span, .trade-side { color: var(--muted); font-size: .75rem; }
.trade-card dl { margin: 8px 10px; font-size: .83rem; }
.trade-card dl > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; padding: 4px 0; }
.trade-card dt { color: var(--muted); }
.trade-card dd { margin: 0; text-align: end; }
.trade-card .btn { margin: 0 10px 10px; }
.workbench-source { padding: 12px 0 0; color: var(--muted); font-size: .8rem; }
.workbench-source div { display: flex; flex-wrap: wrap; gap: 0 12px; }
.workbench-source a { display: inline-flex; align-items: center; min-height: 44px; }

@media (min-width: 800px) {
  .workbench-grid { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
}
@media (max-width: 359px) {
  .trade-card dl > div { grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .trade-card dd { text-align: start; }
}
