:root {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  color: #15324a;
  background: #f0f5f8;
  font-size: 16px;
}

[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 46rem; margin: auto; padding: clamp(1rem, 4vw, 2rem); }
h1 { font-size: 1.6rem; margin: 0 0 1.3rem; }
h2 { font-size: 1.05rem; margin: 0 0 .45rem; }
.panel, article { background: white; border: 1px solid #c5d6e3; border-radius: .75rem; padding: 1rem; }
.panel { display: grid; gap: 1rem; }
.tools { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; margin-bottom: .85rem; }
.tools span { flex: 1; align-self: center; }
.tools label { flex: 1; }
label { display: grid; gap: .4rem; font-size: .92rem; }
input, button { box-sizing: border-box; min-height: 44px; font: inherit; border-radius: .45rem; }
input { width: 100%; min-width: 0; border: 1px solid #a1b7c9; color: inherit; padding: .5rem .6rem; }
button { padding: .55rem .85rem; border: 1px solid #1260a5; color: white; background: #1260a5; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible { outline: 3px solid #78a9d8; outline-offset: 2px; }
#logout { background: white; color: #1260a5; }
article { margin: 0 0 .65rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: .65rem 0 0; }
dt { color: #536b7d; }
dd { margin: 0; overflow-wrap: anywhere; }
#status { color: #586c7f; }
.board-top { display: flex; justify-content: space-between; align-items: center; }
.muted { color: #526a7b; font-size: .85rem; }
button.quiet, .board-nav button[aria-pressed="false"] { color: #18558a; background: #fff; border-color: #becfe0; }
.board-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .7rem 0; }
.metric { background: #fff; border: 1px solid #c5d6e3; border-radius: .65rem; padding: .65rem; }
.metric span, .metric strong { display: block; }
.metric span { font-size: .78rem; color: #526a7b; }
.metric strong { font-size: 1.25rem; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.board-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin: .8rem 0; }
.board-nav button { padding-inline: .2rem; font-size: .9rem; }
.line-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem; }
.line-heading h2 { margin: 0; }
.line-state { display: inline-block; border-radius: .35rem; padding: .25rem .45rem; font-size: .78rem; background: #edf2f5; color: #405766; }
.line-state[data-phase="running"] { background: #e4f4e9; color: #185a36; }
.line-state[data-phase="fault"], .line-state[data-phase="scrap"] { background: #fff0e5; color: #87421b; }
.line-state[data-phase="unknown"] { background: #f8ebea; color: #873532; }
.line-reading { font-size: 1.24rem; font-weight: 650; color: #1b4d78; margin: .7rem 0 .15rem; }
details { margin-top: .75rem; border-top: 1px solid #e0e9ef; padding-top: .6rem; }
summary { cursor: pointer; color: #18558a; font-size: .91rem; padding: .2rem 0; }
.stop-pair { padding: .45rem 0; border-bottom: 1px solid #e0e9ef; color: #843a2c; }
.stop-pair span + span { border-left: 1px dashed #819fb9; padding-left: .6rem; margin-left: .6rem; color: #185a36; }
@media (max-width: 355px) {
  .metric { padding-inline: .4rem; }
  .metric strong { font-size: 1rem; }
  .board-nav { gap: .25rem; }
  .board-nav button { font-size: .8rem; }
}
