:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #fff;
  --ink: #192b38;
  --muted: #60717d;
  --line: #dce3e8;
  --accent: #126b63;
  --soft: #e7f3ef;
  --red: #a63e35;
  --gold: #ad7632;
  --blue: #446aa0;
  --shadow: 0 4px 20px #17334505;
  font:
    15px/1.55 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
body.dark {
  color-scheme: dark;
  --bg: #111c24;
  --panel: #192934;
  --ink: #e3ecf1;
  --muted: #a1b3bf;
  --line: #32434e;
  --accent: #7dd5bd;
  --soft: #213f3a;
  --red: #f5a39a;
  --gold: #e4b671;
  --blue: #9ab9f3;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
.button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 9px 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #61ae9e;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  background: var(--accent);
  color: var(--panel);
  border-color: var(--accent);
}
.primary:hover {
  color: var(--panel);
  filter: brightness(1.12);
}
a {
  color: var(--accent);
}
.quiet {
  background: transparent;
}
.danger {
  color: var(--red);
}
.top {
  height: 88px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  line-height: 1.2;
}
.brand b {
  font-weight: 700;
}
.brand small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.7px;
}
.mark {
  background: var(--ink);
  color: var(--panel);
  padding: 12px 8px;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 700;
}
.edition {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.edition span {
  display: block;
}
.shell {
  max-width: 1800px;
  margin: auto;
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr);
}
aside {
  padding: 30px 20px;
  border-right: 1px solid var(--line);
}
nav {
  display: grid;
  gap: 7px;
  position: sticky;
  top: 25px;
}
nav button {
  display: flex;
  gap: 12px;
  border: 0;
  text-align: left;
  background: transparent;
  color: var(--muted);
  padding: 12px 10px;
  font-size: 12px;
}
nav button span {
  font-size: 14px;
  font-weight: 600;
}
nav button.active {
  color: var(--accent);
  background: var(--soft);
}
.aside-note {
  margin-top: 65px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 10px;
}
.aside-note strong {
  color: var(--ink);
}
.legacy {
  display: block;
  margin: 30px 10px;
  font-size: 12px;
}
.legacy small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
main {
  padding: 35px 38px;
  min-width: 0;
  max-width: 1600px;
}
h1 {
  font-size: 34px;
  letter-spacing: -1.1px;
  line-height: 1.2;
  margin: 6px 0 12px;
  font-weight: 650;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.4px;
  margin: 0 0 9px;
}
h3 {
  font-size: 15px;
  margin: 15px 0 8px;
}
p {
  margin: 8px 0 14px;
}
.eyebrow {
  letter-spacing: 1.8px;
  font-size: 10px;
  font-weight: 750;
  color: var(--accent);
  margin: 0;
}
.heading {
  display: flex;
  gap: 25px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.heading p:not(.eyebrow) {
  color: var(--muted);
  max-width: 660px;
  margin-bottom: 0;
}
.coverage {
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  font-size: 12px;
  color: var(--muted);
  min-width: 145px;
}
.coverage strong {
  font-size: 22px;
  display: block;
  color: var(--ink);
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 550;
}
input,
select {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  width: 100%;
  min-width: 0;
  font-weight: 400;
  color: var(--ink);
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin: 22px 0 18px;
}
.toolbar .search {
  flex: 1;
  min-width: 150px;
  max-width: 350px;
}
.check {
  flex-direction: row;
  align-items: center;
  padding-bottom: 9px;
  gap: 8px;
}
.table-wrap {
  overflow: auto;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
th,
td {
  text-align: right;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 550;
  background: var(--bg);
}
th:first-child,
th:nth-child(2),
td:first-child,
td:nth-child(2) {
  text-align: left;
}
th button {
  border: 0;
  padding: 0;
  background: transparent;
  font-size: inherit;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
td .market-name {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
tr.selected {
  background: var(--soft);
}
tbody tr:hover {
  background: var(--bg);
}
tbody tr:last-child td {
  border-bottom: 0;
}
.star {
  border: 0;
  background: transparent;
  padding: 3px;
  color: var(--muted);
}
.star.on {
  color: var(--gold);
}
.rank {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
}
.rank-track {
  width: 68px;
  height: 5px;
  background: var(--line);
  position: relative;
  border-radius: 2px;
}
.rank-track i {
  position: absolute;
  top: -3px;
  height: 11px;
  width: 4px;
  border-radius: 3px;
  background: var(--accent);
}
.rank.low {
  color: var(--blue);
}
.rank.high {
  color: var(--gold);
}
.caption {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
  margin: 12px 0 22px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 24px;
  margin: 22px 0;
  box-shadow: var(--shadow);
  min-width: 0;
}
.chart-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
.chart-heading p {
  font-size: 12px;
  color: var(--muted);
}
.tag {
  font-size: 10px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 4px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 22px 0;
}
.stat small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.stat strong {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.7px;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.chart {
  min-height: 240px;
  width: 100%;
  margin: 10px 0;
}
.chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.chart text {
  fill: var(--muted);
  font: 11px system-ui;
}
.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}
.chart .zero {
  stroke: var(--muted);
  stroke-dasharray: 3 4;
}
.chart .line {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
}
.chart .point {
  stroke: var(--panel);
  stroke-width: 1.5;
}
.empty {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  min-height: 245px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 24px;
  color: var(--muted);
}
.empty strong {
  color: var(--ink);
  font-size: 18px;
}
.empty p {
  max-width: 570px;
  font-size: 13px;
  margin: 10px 0 15px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
  font-size: 12px;
}
.legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.market-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.market-chips button {
  font-size: 12px;
  padding: 6px 10px;
}
.market-chips button.on {
  background: var(--soft);
  color: var(--accent);
  border-color: var(--accent);
}
.market-chips button span {
  font-size: 10px;
  color: var(--muted);
  padding-left: 3px;
}
.two-col,
.scenario-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.two-col .panel,
.scenario-layout .panel {
  margin-top: 0;
}
.scenario-layout {
  grid-template-columns: minmax(330px, 1.04fr) minmax(280px, 0.96fr);
}
form label {
  margin: 12px 0;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.spec {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.result .big-number {
  font-size: 38px;
  letter-spacing: -1.5px;
  font-weight: 650;
  margin: 10px 0;
}
.positive {
  color: var(--accent);
}
.negative {
  color: var(--red);
}
.result dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}
.result dt {
  color: var(--muted);
  font-size: 12px;
}
.result dd {
  margin: 0;
  font-size: 17px;
}
.callout {
  background: var(--soft);
  border-left: 3px solid var(--accent);
  padding: 13px 15px;
  font-size: 12px;
  margin: 17px 0;
}
.warning {
  background: var(--bg);
  border-left-color: var(--gold);
}
.error {
  color: var(--red);
  font-size: 13px;
}
details summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}
details p,
details li {
  font-size: 13px;
  color: var(--muted);
}
details[open] summary {
  margin-bottom: 18px;
}
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.file-button {
  margin-top: 18px;
  padding: 15px;
  border: 1px dashed var(--accent);
  border-radius: 6px;
}
input[type="file"] {
  padding: 5px;
  border: 0;
  font-size: 12px;
}
.file-button input {
  background: transparent;
}
#notice {
  position: sticky;
  top: 10px;
  z-index: 2;
  background: var(--soft);
  border: 1px solid var(--accent);
  padding: 12px 17px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 13px;
}
#batchOutput {
  font-size: 12px;
  margin-top: 15px;
  overflow-wrap: anywhere;
}
#batchOutput button {
  margin: 8px 8px 0 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
footer {
  font-size: 10px;
  color: var(--muted);
  margin-top: 45px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  main {
    padding: 40px 50px;
  }
  .shell {
    grid-template-columns: 235px minmax(0, 1fr);
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  main {
    padding: 25px 23px;
  }
  aside {
    padding: 25px 12px;
  }
  .edition {
    display: none;
  }
  .top #theme {
    margin-left: auto;
  }
  .scenario-layout,
  .two-col {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    gap: 12px;
  }
  .stat strong {
    font-size: 22px;
  }
  th,
  td {
    padding: 12px 10px;
  }
}
@media (max-width: 700px) {
  .top {
    height: 74px;
    padding: 0 16px;
  }
  .brand {
    font-size: 16px;
  }
  .brand small {
    font-size: 9px;
  }
  .shell {
    display: block;
  }
  aside {
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  nav {
    display: flex;
    overflow: auto;
    position: static;
    gap: 0;
  }
  nav button {
    gap: 6px;
    padding: 10px;
    white-space: nowrap;
  }
  nav button span {
    font-size: 12px;
  }
  .aside-note,
  .legacy {
    display: none;
  }
  main {
    padding: 24px 16px;
  }
  h1 {
    font-size: 28px;
  }
  .heading {
    align-items: flex-start;
    gap: 15px;
    flex-wrap: wrap;
  }
  .coverage {
    display: flex;
    gap: 10px;
    border: 0;
    padding: 0;
    align-items: center;
    font-size: 11px;
  }
  .coverage strong {
    font-size: 18px;
  }
  .toolbar {
    gap: 12px;
  }
  .toolbar label {
    flex: 1;
    min-width: 120px;
  }
  .toolbar .check {
    min-width: 150px;
  }
  .panel {
    padding: 18px;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  .chart-heading {
    flex-wrap: wrap;
    gap: 5px;
  }
  .form-grid {
    gap: 0 12px;
  }
  .chart {
    min-height: 180px;
  }
  .scenario-layout {
    display: block;
  }
  .result dl {
    grid-template-columns: 1fr 1fr;
  }
  .tag {
    white-space: normal;
  }
}

.working-market {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.working-market label {
  min-width: 220px;
}
.working-market span {
  font-size: 11px;
  color: var(--muted);
}
.chart-inspection {
  white-space: pre-line;
  font-size: 12px;
  line-height: 1.6;
  min-height: 70px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 6px;
  color: var(--muted);
  margin-top: 8px;
}
.chart-inspection[data-active="true"] {
  color: var(--ink);
}
.chart svg:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}
#observationDetails {
  margin-top: 20px;
  font-size: 12px;
}
#observationDetails button {
  margin: 12px 0;
}
.collection-plan .toolbar label {
  min-width: 125px;
}
.collection-plan .toolbar .check {
  min-width: 100px;
}
.collection-market {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.collection-market summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}
.collection-market p {
  color: var(--muted);
}
.collection-market .button-row {
  margin: 15px 0;
}
.collection-market .table-wrap {
  max-height: 300px;
}
.collection-market .table-wrap thead {
  position: sticky;
  top: 0;
}
.collection-market .caption {
  white-space: normal;
  overflow-wrap: anywhere;
}
.advanced {
  margin: 12px 0 20px;
  font-size: 12px;
}
.advanced summary {
  cursor: pointer;
}
#observedContext p {
  font-size: 11px;
  margin: 8px 0;
}
#observedContext button {
  font-size: 11px;
  padding: 6px 9px;
}
#calendarContext p {
  font-size: 11px;
}
#rollControls label:last-child {
  flex: 1;
  min-width: 190px;
}
#chartObservations {
  max-height: 450px;
  margin-top: 12px;
}
#chartObservations thead {
  position: sticky;
  top: 0;
}
@media (max-width: 700px) {
  .working-market {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
  }
  .working-market label {
    width: 100%;
    min-width: 0;
  }
  .chart-inspection {
    font-size: 11px;
    min-height: 70px;
  }
  .collection-plan .toolbar label {
    min-width: 120px;
    flex: 1;
  }
  .collection-plan .toolbar .check {
    flex-basis: 100%;
  }
  .collection-market .button-row button {
    font-size: 11px;
  }
  .chart {
    min-height: 260px;
  }
}
