:root {
  color-scheme: light;
  --ink: #18302f;
  --muted: #526a68;
  --teal: #09675b;
  --line: #d6e2df;
  --paper: #fff;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 16px; }
body { margin: 0; background: #f4f7f5; color: var(--ink); font-size: 14px; }
.mast { background: #112e2c; color: #f3fffa; }
.mast-inner, main { max-width: 1450px; margin: 0 auto; padding: 0 clamp(18px, 4.5vw, 72px); }
.mast-inner, .mast nav, .brand, .identity, .page-head, .section-head, .group-head, .group-head h3, .actions, .pager {
  display: flex; align-items: center;
}
.mast-inner { gap: clamp(18px, 4vw, 68px); min-height: 68px; }
a { color: inherit; text-decoration: none; }
.brand { gap: 11px; font-size: 18px; font-weight: 720; white-space: nowrap; }
.chip { width: 28px; height: 28px; display: grid; place-items: center; background: #70d9af; border-radius: 7px; transform: rotate(-5deg); }
.chip i { width: 15px; height: 15px; display: block; border: 2px solid #123e34; border-radius: 3px; outline: 1px dashed #123e34; outline-offset: 2px; }
.mast nav { align-self: stretch; gap: clamp(12px, 2.4vw, 38px); }
.mast nav a { display: grid; align-items: center; padding: 2px 0 0; font-weight: 600; color: #b6c9c4; border-bottom: 3px solid transparent; white-space: nowrap; }
.mast nav a[aria-current] { color: #fff; border-color: #78dcb3; }
.identity { margin-left: auto; gap: 14px; color: #d9e9e4; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.nav-button { padding: 5px 10px; border: 1px solid #55716a; border-radius: 5px; color: inherit; background: transparent; }
main { padding-bottom: 48px; }
.page-head, .section-head, .group-head { justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-head { margin: 36px 0 22px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.35; letter-spacing: -.045em; }
h2 { font-size: 20px; letter-spacing: -.025em; }
h3 { font-size: 16px; }
.muted, .time, .empty, .empty-state p, .chart-empty { color: var(--muted); }
h1 + .muted, h2 + .muted { margin-top: 5px; }
.button, .primary { min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 14px; border: 1px solid #b9cdc6; border-radius: 7px; background: #fff; color: var(--ink); font-weight: 600; }
.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.button:hover, .asset-chips a:hover { background: #ecf4ef; }
.primary:hover { background: #07594e; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #419c88; outline-offset: 2px; }
button:disabled { cursor: default; opacity: .5; }
.stats, .gpu-grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stats > div, .panel, .gpu-group, .empty-state { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.stats > div { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stats > div:first-child { background: #e2f2e9; border-color: #bbdacb; }
.stats strong { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: clamp(26px, 3vw, 42px); line-height: 1.2; font-weight: 550; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.stats small { margin-left: 5px; font: 500 14px Inter, system-ui, sans-serif; letter-spacing: 0; }
.stats span { font-weight: 600; }
.stats em, .stats a, .time { font-size: 12px; font-style: normal; color: var(--muted); }
.stats a, .text-link { color: var(--teal); font-weight: 600; }
.text-link { background: transparent; padding: 3px 0; border: 0; }
.text-link:hover, .stats a:hover { text-decoration: underline; }
.resource-section, .panel { margin-top: 23px; }
.section-head { margin-bottom: 15px; }
.gpu-grid { grid-template-columns: minmax(0,1fr); }
.gpu-group { overflow: hidden; }
.group-head { padding: 13px 16px; border-bottom: 1px solid var(--line); background: #edf4f0; }
.group-head h3 { gap: 9px; }
.group-head > span, .gpu-row small { color: var(--muted); font-size: 12px; }
.node-mark { width: 12px; height: 12px; background: #52977d; border: 3px double #fff; border-radius: 3px; box-shadow: 0 0 0 1px #52977d; }
.host-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1px; background: var(--line); }
.gpu-row { display: grid; align-content: start; background: var(--paper); padding: 13px 16px; }
.gpu-row:hover { background: #f7faf7; }
.gpu-row[aria-current] { box-shadow: inset 0 3px var(--teal); }
.gpu-row:focus-visible { outline-offset: -3px; }
.gpu-row small { display: block; margin-top: 3px; }
.device-head, .gauge > div, .gpu-mem { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gauge { display: grid; gap: 4px; margin-top: 12px; min-height: 28px; }
.gauge span, .gpu-mem span { color: var(--muted); font-size: 12px; }
.gauge b, .gpu-mem b { font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 5px; accent-color: #278b74; appearance: none; border: 0; border-radius: 9px; overflow: hidden; background: #e2ebe6; }
progress::-webkit-progress-bar { background: #e2ebe6; }
progress::-webkit-progress-value { background: #278b74; border-radius: 9px; }
progress::-moz-progress-bar { background: #278b74; }
.gpu-mem { margin-top: 7px; font-size: 12px; }
.tag, .status { font-size: 12px; border-radius: 12px; background: #edf1f0; color: #50655e; padding: 3px 8px; white-space: nowrap; }
.live { color: #08644c; background: #e0f4e9; }
.warn { color: #89510d; background: #fff1d8; }
.panel { padding: clamp(16px, 2.5vw, 28px); }
.segments, .asset-chips, .legend, .form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.segments { background: #f0f5f2; padding: 3px; gap: 2px; border-radius: 7px; }
.segments a { font-size: 13px; padding: 5px 9px; border-radius: 4px; }
.segments a[aria-current] { background: white; font-weight: 650; color: var(--teal); box-shadow: 0 1px 3px #173c3023; }
.legend { gap: 20px; color: var(--muted); font-size: 12px; }
.legend span::before { content: ""; display: inline-block; width: 16px; height: 3px; margin: 0 6px 3px 0; background: #117e69; }
.legend span:nth-child(2)::before { background: #bc741e; }
.legend small { margin-left: auto; }
canvas { display: block; width: 100%; height: 190px; }
.chart-empty, .empty-state { background-color: #f8fbf8; text-align: center; padding: 30px 16px; }
.chart-empty { border: 1px dashed var(--line); border-radius: 8px; }
.empty-state h3, .empty-state p, .empty-state a { margin-top: 7px; display: block; }
.empty-symbol { font-size: 24px; color: var(--teal); }
.form-row { align-items: end; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 550; }
input, select, textarea { background: white; min-height: 38px; padding: 7px 10px; border-radius: 6px; border: 1px solid #bfd1c9; color: var(--ink); max-width: 100%; min-width: 0; }
textarea { resize: vertical; }
.form-row .text-link { margin-left: auto; }
.toolbar, .grant-form { margin-bottom: 15px; }
.grant-form, .inset { padding-top: 14px; margin-top: 12px; border-top: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 11px 10px; border-bottom: 1px solid #e3ebe6; vertical-align: middle; }
th { font-weight: 600; font-size: 12px; color: var(--muted); background: #f5f8f5; white-space: nowrap; }
td { font-size: 13px; overflow-wrap: anywhere; }
td:last-child { white-space: normal; }
.actions, .pager { gap: 10px; }
.danger { color: #98422f; }
.empty { padding: 22px; text-align: center; }
.notice { border: 1px solid #b8d6ca; background: #e8f6ed; padding: 12px 16px; border-radius: 7px; margin: 14px 0; }
.notice.error { background: #fff3e5; color: #814515; border-color: #eed2aa; }
.asset-chips a { border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; }
.asset-chips small { display: block; color: var(--muted); margin-top: 4px; }
.asset-entry { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.note-editor label { flex: 1; }
.note-text { white-space: pre-line; overflow-wrap: anywhere; }
.remote-note { font-size: 12px; margin: 8px 0; }
.selected-note { border-left: 3px solid #83b79f; padding: 4px 12px; margin: 12px 0 16px; }
.login { max-width: 420px; margin: clamp(40px, 12vh, 120px) auto; padding: 34px; }
.login h1 { font-size: 26px; margin-top: 20px; }
.login form { display: grid; margin-top: 24px; gap: 16px; }
.big { width: 40px; height: 40px; }
code { font: .94em "IBM Plex Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
.pager { justify-content: flex-end; margin-top: 15px; }
@media (max-width:850px) {
  .mast-inner { gap: 18px; flex-wrap: wrap; padding-top: 12px; }
  .mast nav { order: 3; width: 100%; min-height: 40px; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:520px) {
  .mast nav { justify-content: space-between; gap: 6px; font-size: 13px; }
  .stats > div { padding: 13px; }
  .stats, .gpu-grid { gap: 8px; }
  .form-row { align-items: stretch; flex-direction: column; }
  .form-row label { width: 100%; }
  .form-row .text-link { margin-left: 0; }
  .host-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); }
  .gpu-row { padding: 12px; }
  .gpu-row small { font-size: 11px; }
  .page-head { margin-top: 22px; }
}
