/* A compact instrument-panel layout; no external fonts, images, or UI framework. */
:root {
  font-family:
    Inter, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: #203334;
  background: #f4f5f1;
  font-synthesis: none;
  --ink: #183337;
  --muted: #657577;
  --teal: #087f73;
  --line: #dde4df;
  --amber: #b14e20;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
select {
  font: inherit;
}
button,
a,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
select,
summary {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
summary:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid #33a99b;
  outline-offset: 4px;
}
button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 14px;
  color: var(--ink);
  background: white;
}
button:hover {
  background: #eaf3ee;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
.notice {
  background: #f5e9cf;
  border-bottom: 1px solid #e8d7b4;
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  padding: 10px 20px;
  color: #684b23;
  font-size: 12px;
}
.notice strong {
  font-size: 13px;
  letter-spacing: 0.03em;
}
main {
  max-width: 1280px;
  padding: 0 36px;
  margin: auto;
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 86px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.08em;
}
.brand-icon {
  background: var(--ink);
  color: #8ff0d0;
  border-radius: 7px;
  width: 31px;
  height: 31px;
  text-align: center;
  line-height: 31px;
  font: 700 22px/31px monospace;
}
.muted {
  color: var(--muted);
}
.edition {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 25px;
}
.mono,
.metric-value,
td,
.chart-foot,
.step {
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: Consolas, monospace;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  padding: 35px 0 28px;
}
.eyebrow {
  font-family: Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: #5b7b78;
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(25px, 3vw, 37px);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.3;
  margin: 0 0 12px;
}
.mobile-break {
  display: none;
}
.lede {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.8;
}
.connection {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  flex-shrink: 0;
  font-size: 11px;
}
.connection button {
  font-size: 12px;
  min-height: 34px;
  padding: 5px 13px;
}
.status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
}
.status:before {
  content: "";
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: #9aa8a4;
}
.status[data-state="live"] {
  color: var(--teal);
}
.status[data-state="live"]:before {
  background: #22a48a;
  box-shadow: 0 0 0 3px #e2f3e9;
}
.status[data-state="error"] {
  color: #a34226;
}
.status[data-state="error"]:before {
  background: #bb532d;
}
.error-banner {
  padding: 12px 16px;
  background: #fff0e4;
  border: 1px solid #eac7af;
  border-radius: 8px;
  color: #8b3d23;
  margin-bottom: 18px;
  font-size: 13px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 22px;
  position: relative;
}
.metric-label {
  font-size: 12px;
  color: #617674;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
}
.metric-label .mono {
  font-size: 10px;
  color: #94a19b;
}
.metric-value {
  font-size: 34px;
  font-weight: 550;
  letter-spacing: -0.045em;
  line-height: 1.2;
}
.metric-value small {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  color: #788785;
  margin-left: 7px;
}
.metric-reference {
  font-size: 11px;
  color: #788785;
  margin-top: 11px;
  min-height: 17px;
}
.metric.wrong {
  border-color: #e1bd9c;
  background: #fffcf6;
}
.metric.wrong .metric-value {
  color: var(--amber);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr);
  gap: 20px;
  margin-bottom: 23px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.section-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.chart-panel {
  padding: 24px 24px 0;
}
.section-top .eyebrow {
  margin-bottom: 8px;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
}
.unit {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 8px;
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 10px;
  color: var(--muted);
}
.legend span:before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 3px;
  margin-right: 5px;
  vertical-align: middle;
  background: #0c8c7d;
}
.legend .decoded:before {
  background: #ce8646;
}
.chart-wrap {
  position: relative;
  margin: 25px 0 7px;
  min-height: 190px;
}
#chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
#chart text {
  fill: #81908d;
  font:
    11px Consolas,
    monospace;
}
#chart .grid {
  stroke: #e8eeea;
  stroke-width: 1;
}
#chart .reference-line {
  fill: none;
  stroke: #078675;
  stroke-width: 2.5;
}
#chart .decoded-line {
  fill: none;
  stroke: #ce8646;
  stroke-width: 2;
  stroke-dasharray: 5 4;
}
#chart-empty {
  position: absolute;
  inset: 35% 0 auto;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.chart-foot {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #7e8d88;
  padding-bottom: 23px;
  gap: 10px;
}
.device-state {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  flex-wrap: wrap;
}
.device-state strong {
  font-weight: 500;
  margin-left: 5px;
}
.indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #a8b2ad;
  border-radius: 50%;
  margin-right: 6px;
}
.indicator.on {
  background: #1c9d82;
}
.alarm {
  padding: 4px 7px;
  background: #f0f5f0;
  border-radius: 4px;
  color: #487263;
}
.alarm.active {
  background: #ffe7d6;
  color: #a84522;
}
.controls {
  padding: 25px;
}
.controls > p.muted {
  font-size: 12px;
  line-height: 1.7;
  margin: 12px 0 21px;
}
.controls label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 17px 0 8px;
}
.controls select {
  width: 100%;
  padding: 11px 10px;
  border: 1px solid #dce3df;
  background: #fafcf9;
  border-radius: 6px;
  color: var(--ink);
  font-size: 12px;
  min-height: 42px;
}
.decode-message {
  background: #eef6f0;
  color: #38725e;
  border-radius: 6px;
  padding: 11px;
  font-size: 11px;
  line-height: 1.7;
  margin-top: 17px;
}
.decode-message.warning {
  background: #fff0dc;
  color: #945122;
}
.reset {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 12px;
  border-color: var(--line);
}
.fine-print {
  font-size: 10px;
  line-height: 1.7;
  color: #7e8c87;
  margin: 15px 0 0;
}
.registers {
  padding: 25px 25px 0;
}
.tag {
  font-size: 10px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  white-space: nowrap;
}
.table-help {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  margin: 15px 0 20px;
}
.table-scroll {
  width: 100%;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  text-align: left;
}
th {
  font-weight: 500;
  font-size: 10px;
  color: #788982;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  background: #f8faf7;
}
td {
  padding: 17px 10px;
  border-bottom: 1px solid #edf0ec;
  font-size: 12px;
  vertical-align: middle;
}
td strong {
  font-size: 12px;
  font-weight: 600;
  display: block;
}
td small {
  display: block;
  color: #809088;
  font-size: 10px;
  margin-top: 5px;
  font-family: Consolas, monospace;
}
td .raw {
  font-family: Consolas, monospace;
  font-size: 13px;
}
td.result {
  color: #177b67;
  font-weight: 600;
}
td.result.wrong {
  color: var(--amber);
  background: #fffbf3;
}
td.result.invalid {
  font-size: 10px;
  max-width: 170px;
}
details {
  border-top: 1px solid var(--line);
  margin-top: 0;
}
summary {
  padding: 17px 0;
  font-size: 12px;
  min-height: 48px;
}
summary span {
  color: #7a8981;
  margin-left: 10px;
  font-size: 10px;
}
.point-contract {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 24px;
}
.contract-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.8;
}
.contract-item strong {
  display: block;
  font-size: 12px;
}
.contract-item p {
  margin: 4px 0;
  color: var(--muted);
}
.learning {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 35px 0 32px;
}
.step {
  font:
    10px Consolas,
    monospace;
  letter-spacing: 0.08em;
  color: #65877d;
}
h3 {
  font-size: 13px;
  margin: 11px 0;
  font-weight: 600;
}
.learning p {
  font-size: 11px;
  line-height: 1.9;
  color: var(--muted);
  margin: 0;
}
footer {
  border-top: 1px solid var(--line);
  padding: 23px 0 28px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: #809087;
  font-size: 10px;
}
.brand-small {
  letter-spacing: 0.08em;
  color: #506c63;
  font-weight: 600;
}
/* Mobile keeps controls and values readable; only the data table scrolls sideways. */
@media (max-width: 900px) {
  main {
    padding: 0 22px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1.65fr) minmax(240px, 1fr);
    gap: 14px;
  }
  .chart-panel {
    padding: 20px 16px 0;
  }
  .legend {
    flex-direction: column;
    gap: 6px;
  }
  .controls {
    padding: 20px;
  }
  .metric {
    padding: 16px;
  }
  .metric-value {
    font-size: 30px;
  }
  .device-state {
    gap: 12px;
  }
  .device-state > .muted {
    width: 100%;
  }
}
@media (max-width: 680px) {
  .notice {
    flex-direction: column;
    gap: 4px;
    padding: 9px 12px;
    font-size: 10px;
  }
  .notice strong {
    font-size: 12px;
  }
  main {
    padding: 0 16px;
  }
  .masthead {
    height: 68px;
  }
  .brand {
    font-size: 13px;
    gap: 6px;
  }
  .edition {
    font-size: 10px;
    gap: 12px;
  }
  .intro {
    display: block;
    padding: 26px 0 21px;
  }
  .intro h1 {
    font-size: 29px;
  }
  .lede {
    font-size: 12px;
  }
  .connection {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
  }
  .connection button {
    margin-left: auto;
  }
  .connection > .muted {
    font-size: 10px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
  }
  .metric {
    padding: 16px;
  }
  .metric-label {
    font-size: 11px;
    margin-bottom: 10px;
  }
  .metric-value {
    font-size: 30px;
  }
  .metric-value small {
    font-size: 12px;
  }
  .metric-reference {
    font-size: 10px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
  }
  .chart-panel {
    padding: 19px 15px 0;
  }
  .chart-wrap {
    min-height: 120px;
    margin-top: 23px;
  }
  .chart-foot {
    font-size: 9px;
    padding-bottom: 17px;
  }
  .controls {
    padding: 20px;
  }
  .controls .eyebrow {
    margin-bottom: 9px;
  }
  .controls > p.muted {
    margin-bottom: 14px;
  }
  .fine-print {
    font-size: 11px;
  }
  .device-state > .muted {
    width: auto;
    font-size: 10px;
  }
  .registers {
    padding: 20px 15px 0;
  }
  .registers .section-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .point-contract {
    grid-template-columns: 1fr;
  }
  summary span {
    display: block;
    margin: 7px 0 0 15px;
  }
  .learning {
    grid-template-columns: 1fr;
    gap: 23px;
    margin: 28px 0;
  }
  .learning p {
    font-size: 12px;
  }
  .learning h3 {
    font-size: 14px;
  }
  footer {
    flex-direction: column;
    gap: 9px;
  }
  .mobile-break {
    display: block;
  }
  h2 {
    font-size: 17px;
  }
}
