:root {
  color-scheme: light;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: #183333;
  background: #f1f5f3;
  --line: #cad8d2;
  --accent: #126352;
  --muted: #506660;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.top {
  display: flex; align-items: center; gap: .85rem;
  padding: 1.05rem max(1rem, calc((100% - 1180px) / 2));
  background: #143932; color: #fff;
}
.mark {
  flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  border: 3px solid #a1ddba; position: relative; overflow: hidden;
}
.mark::after {
  content: ""; position: absolute; inset: -.2rem .45rem;
  border: 2px solid #a1ddba; border-radius: 50%; transform: rotate(32deg);
}
.top h1 { flex: 1; margin: 0; font-size: 1.13rem; letter-spacing: -.025em; }
#identity { font-size: .88rem; color: #d2e6dc; }
#logout { background: transparent; color: white; border-color: #77988e; }
main { max-width: 1212px; margin: auto; padding: 2rem 1rem 4rem; }
#workspace { display: grid; grid-template-columns: 12.5rem minmax(0,1fr); gap: 2rem; align-items: start; }
nav { display: grid; gap: .35rem; position: sticky; top: 1rem; }
nav button { background: transparent; text-align: left; border: 1px solid transparent; }
nav [aria-pressed=true] { border-color: #bfdbce; background: #dcece2; color: #174e3f; font-weight: 700; }
.card { background: #fff; padding: clamp(1rem,2.3vw,2rem); border: 1px solid var(--line); border-radius: 14px; }
.login { max-width: 430px; margin: 8vh auto; border-top: 4px solid var(--accent); }
.login button { width: 100%; }
.screen, .node-grid, .fields { display: grid; gap: 1rem; min-width: 0; }
.fields, .node-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
h2, h3 { margin: 0 0 1rem; line-height: 1.18; letter-spacing: -.035em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.12rem; }
.page-title { font-size: clamp(1.65rem,3.2vw,2.5rem); }
.section-top, .support-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.section-top h2 { margin: 0; }
p, dt { color: var(--muted); }
button, input { font: inherit; border: 1px solid #aabdb3; border-radius: 8px; }
button { padding: .52rem .9rem; background: #fff; color: inherit; cursor: pointer; min-height: 42px; }
button:hover { border-color: var(--accent); }
button:disabled { cursor: progress; opacity: .65; }
.primary { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 650; }
:focus-visible { outline: 3px solid #218969; outline-offset: 3px; }
input:not([type=checkbox]) { display: block; width: 100%; padding: .62rem .75rem; margin: .35rem 0 1rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
.check { display: inline-flex; align-items: center; gap: .35rem; margin: .45rem .6rem 0 0; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 8px; }
input[type=checkbox] { accent-color: var(--accent); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .92rem; }
th, td { padding: .7rem .6rem; border-bottom: 1px solid #deE7e1; }
th { background: #f4f7f5; color: var(--muted); font-weight: 600; }
td:first-child { font-weight: 600; overflow-wrap: anywhere; }
td button { font-size: .88rem; }
.pill { display: inline-flex; align-items: center; gap: .4rem; margin: 0; padding: .22rem .55rem; border-radius: 20px; font-size: .82rem; white-space: nowrap; }
.pill::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
.good { background: #e1f2e6; color: #205d3d; }
.bad { background: #ffebe2; color: #8a3d23; }
.neutral { background: #edf0ee; color: #506159; }
dl { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .5rem .85rem; margin: 1rem 0 0; border-top: 1px solid var(--line); padding-top: 1rem; font-size: .88rem; }
dt, dd { overflow-wrap: anywhere; }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
pre { background: #f4f7f5; padding: .8rem; border-radius: 6px; overflow: auto; }
#notice { padding: .65rem .85rem; border-left: 3px solid #a9512e; background: #fff1e8; color: #743d21; }
@media (max-width: 850px) {
  #workspace { grid-template-columns: minmax(0,1fr); gap: 1.25rem; }
  nav { position: static; display: flex; flex-wrap: wrap; }
  main { padding-top: 1rem; }
}
@media (max-width: 620px) {
  .fields, .node-grid { grid-template-columns: minmax(0,1fr); }
  .top { gap: .5rem; }
  nav button { padding: .4rem .6rem; font-size: .88rem; }
  .screen > .section-top { align-items: flex-start; }
  .login { margin: 4vh auto; }
}

#history-plots canvas { width: 100%; height: 64px; background: #f4f8f7; }
#history-plots figure { margin: 1rem 0; }
