.app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
}

.rail__brand {
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.rail__mark {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--fg);
  color: var(--fg-inverse);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -.04em;
}
.rail__name { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.rail__build { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--fg-4); }

.rail__nav { flex: 1 1 auto; overflow-y: auto; padding: var(--s-2); }
.rail__group {
  padding: 14px 10px 6px;
  font-size: 10px;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-4);
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 30px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  color: var(--fg-2);
  font-size: 13px;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
  width: 100%;
  text-align: left;
}
.nav-item svg { flex: none; opacity: .8; }
.nav-item:hover { background: var(--bg-control); color: var(--fg); }
.nav-item.is-active { background: var(--bg-control); color: var(--fg); font-weight: 500; }
.nav-item.is-active svg { opacity: 1; }
.nav-item__count {
  margin-left: auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-3);
  padding: 0 5px;
  height: 17px;
  line-height: 17px;
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  border: 1px solid var(--line-soft);
}
.nav-item.is-active .nav-item__count { background: var(--bg); }

.rail__foot { border-top: 1px solid var(--line); padding: var(--s-2); flex: none; }
.rail__user {
  display: flex; align-items: center; gap: 8px;
  padding: 6px; border-radius: var(--r-sm); width: 100%;
}
.rail__user:hover { background: var(--bg-control); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar);
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-5) 0 var(--s-6);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-3); min-width: 0; }
.crumbs a, .crumbs button { color: var(--fg-3); }
.crumbs a:hover, .crumbs button:hover { color: var(--fg); }
.crumbs__sep { color: var(--fg-4); }
.crumbs__here { color: var(--fg); font-weight: 500; }

.cmd {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 6px 0 10px;
  min-width: 244px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-subtle);
  color: var(--fg-3);
  font-size: 12.5px;
  transition: border-color var(--fast), color var(--fast);
}
.cmd:hover { border-color: var(--line-strong); color: var(--fg-2); }
.cmd__row { display: flex; align-items: center; gap: 8px; flex: 1; }
.cmd__keys { display: flex; gap: 3px; }
.kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 15px;
  padding: 0 4px;
  min-width: 17px;
  text-align: center;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: var(--r-xs);
  background: var(--bg-control);
  color: var(--fg-2);
}

.topbar__stat { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-2); }
.topbar__stat .dot { margin: 0; }
.topbar__sep { width: 1px; height: 18px; background: var(--line); }

.avatar {
  width: 24px; height: 24px; flex: none;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  background: var(--bg-control);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-2);
  letter-spacing: .02em;
}
.avatar--lg { width: 32px; height: 32px; font-size: 12px; }

.page {
  padding: var(--s-6) var(--s-6) var(--s-10);
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
}
.page--flush { padding: 0; max-width: none; }

.page-head { display: flex; align-items: flex-start; gap: var(--s-4); margin-bottom: var(--s-5); }
.page-head__text { min-width: 0; }
.page-title { font-size: var(--text-20); line-height: var(--lh-20); }
.page-sub { margin-top: 4px; font-size: 13px; color: var(--fg-3); max-width: 76ch; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); flex: none; }

.section-head { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-6) 0 var(--s-3); }
.section-head:first-child { margin-top: 0; }
.section-head__title { font-size: 13px; font-weight: 600; }
.section-head__hint { font-size: 12px; color: var(--fg-3); }
.section-head__actions { margin-left: auto; display: flex; gap: var(--s-2); }

.grid { display: grid; gap: var(--s-4); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1fr) 360px; }
.grid--split { grid-template-columns: 280px minmax(0, 1fr); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
  user-select: none;
}
.btn svg { flex: none; }
.btn:hover { background: var(--bg-control); border-color: var(--line-strong); }
.btn:active { transform: translateY(.5px); }

.btn--primary {
  background: var(--accent-soft);
  color: var(--primary-fg);
  border-color: var(--accent-line);
  font-weight: 600;
}
.btn--primary:hover { background: var(--primary-hover); border-color: var(--accent); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn--ghost:hover { background: var(--bg-control); color: var(--fg); border-color: transparent; }

.btn--danger { background: var(--danger); border-color: transparent; color: #fff; font-weight: 600; }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 86%, #000); }
.btn--danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--danger) 34%, transparent); color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }

.btn--sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: var(--r-sm); }
.btn--lg { height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn--icon { width: 32px; padding: 0; }
.btn--icon.btn--sm { width: 26px; }
.btn[aria-pressed="true"] { background: var(--bg-control); border-color: var(--line-strong); color: var(--fg); }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; }
.btn--ghost[disabled] { opacity: .35; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.input, .select, .textarea {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--fg-4); }
.input:hover, .select:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}
.input--mono { font-family: var(--font-mono); font-size: 12px; }
.input--search { padding-left: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 10px center; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; color: var(--fg-2); font-weight: 500; }
.field__hint { font-size: 11.5px; line-height: 1.45; color: var(--fg-3); }
.field__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.fieldset { display: grid; gap: var(--s-4); }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--fg-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 14px; height: 14px; margin: 2px 0 0; flex: none; }

.switch {
  width: 34px; height: 20px; flex: none;
  border-radius: var(--r-full);
  background: var(--bg-control);
  border: 1px solid var(--line);
  position: relative;
  transition: background var(--fast) var(--ease), border-color var(--fast);
}
.switch::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--fg-3);
  transition: transform var(--fast) var(--ease), background var(--fast);
}
.switch.is-on { background: var(--fg); border-color: transparent; }
.switch.is-on::after { transform: translateX(14px); background: var(--bg); }
.switch-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.switch-row__text { min-width: 0; }
.switch-row__title { font-size: 12.5px; color: var(--fg); }
.switch-row__hint { font-size: 11.5px; color: var(--fg-3); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 18px; background: transparent; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: var(--r-full); background: var(--bg-control); border: 1px solid var(--line-soft);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; margin-top: -5px;
  border-radius: 50%; background: var(--fg); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-1);
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: var(--r-full); background: var(--bg-control); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--fg); border: 1px solid var(--line-strong); }

.card {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.card--plain { background: transparent; }
.card--inset { background: var(--bg-inset); }
.card__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 46px;
  padding: 10px var(--s-4);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.card__title { font-size: 13px; font-weight: 600; letter-spacing: -.005em; }
.card__sub { font-size: 12px; color: var(--fg-3); }
.card__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.card__body { padding: var(--s-4); }
.card__body--flush { padding: 0; }
.card__body--tight { padding: 10px var(--s-4); }
.card__foot { padding: 10px var(--s-4); border-top: 1px solid var(--line); display: flex; align-items: center; gap: var(--s-2); }
.card--hover { transition: border-color var(--fast), background var(--fast); }
.card--hover:hover { border-color: var(--line-strong); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--bg-control);
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge--ok { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.badge--warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.badge--danger { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.badge--info { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.badge--violet { color: var(--violet); background: var(--violet-soft); border-color: color-mix(in srgb, var(--violet) 26%, transparent); }
.badge--outline { background: transparent; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.dot--live { box-shadow: 0 0 0 0 currentColor; animation: live-pulse 2.4s var(--ease) infinite; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  70% { box-shadow: 0 0 0 5px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 6px;
  border-radius: var(--r-xs);
  background: var(--bg-control);
  color: var(--fg-2);
  font-size: 11px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--fg-2);
  font-size: 12px;
  white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); color: var(--fg); }
.chip.is-active { background: var(--bg-control); color: var(--fg); border-color: var(--line-strong); }
.chip__x { color: var(--fg-4); display: inline-flex; }
.chip__x:hover { color: var(--fg); }

.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 var(--s-1); }
.tab {
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fg-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--fast), border-color var(--fast);
  white-space: nowrap;
}
.tab:hover { color: var(--fg); }
.tab.is-active { color: var(--fg); border-bottom-color: var(--fg); }
.tab__count { font-size: 10.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; }

.segmented {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: var(--r-sm);
  background: var(--bg-control);
  border: 1px solid var(--line-soft);
}
.segmented button {
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-xs);
  font-size: 12px;
  color: var(--fg-3);
  transition: color var(--fast), background var(--fast);
  white-space: nowrap;
}
.segmented button:hover { color: var(--fg); }
.segmented button.is-active { background: var(--bg-elevated); color: var(--fg); box-shadow: var(--shadow-1); }

.table-wrap { overflow: auto; border-radius: inherit; }
.table { width: 100%; font-size: 13px; }
.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 34px;
  padding: 0 var(--s-3);
  text-align: left;
  vertical-align: middle;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--fg-3);
  white-space: nowrap;
}
.table th[data-align="right"] { text-align: right; }
.table th.is-sortable { cursor: pointer; }
.table th.is-sortable:hover { color: var(--fg-2); }
.table td {
  height: 44px;
  padding: 0 var(--s-3);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--fg);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--fast); }
.table tbody tr:hover { background: color-mix(in srgb, var(--fg) 3.5%, transparent); }
.table tbody tr.is-selected { background: var(--accent-soft); }
.table tbody tr.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.table--dense td { height: 34px; }
.table td[data-align="right"], .table th[data-align="right"] { text-align: right; }
.table__rowlink { cursor: pointer; }
.table__cell-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.table__cell-sub { font-size: 11.5px; color: var(--fg-3); }
.table__empty td { height: 120px; text-align: center; color: var(--fg-3); }

.kpi-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-subtle);
  overflow: hidden;
}
.kpi { padding: 14px var(--s-4); border-right: 1px solid var(--line); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi__label { font-size: 11.5px; color: var(--fg-3); display: flex; align-items: center; gap: 6px; }
.kpi__value { margin-top: 4px; font-size: var(--text-24); line-height: 30px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 13px; font-weight: 500; color: var(--fg-3); letter-spacing: 0; }
.kpi__meta { margin-top: 2px; font-size: 11.5px; color: var(--fg-3); display: flex; align-items: center; gap: 6px; }
.kpi__spark { margin-top: 8px; height: 28px; }

.spark { display: block; width: 100%; height: 100%; overflow: visible; }
.spark path.line { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark path.area { stroke: none; }
.legend { display: flex; align-items: center; gap: var(--s-4); font-size: 11.5px; color: var(--fg-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.bar { height: 4px; border-radius: var(--r-full); background: var(--bg-control); overflow: hidden; }
.bar__fill { height: 100%; border-radius: inherit; background: var(--fg-2); }
.bar__fill--ok { background: var(--ok); }
.bar__fill--warn { background: var(--warn); }
.bar__fill--danger { background: var(--danger); }
.bar__fill--accent { background: var(--accent); }

.ring { --p: 0; width: 32px; height: 32px; flex: none; position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring__val { font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.props { display: grid; gap: 0; }
.prop {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  min-height: 34px;
}
.prop:last-child { border-bottom: 0; }
.prop__k { color: var(--fg-3); }
.prop__v { color: var(--fg); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop__v--mono { font-family: var(--font-mono); font-size: 12px; }
.prop__action { opacity: 0; transition: opacity var(--fast); }
.prop:hover .prop__action { opacity: 1; }

.empty { display: grid; place-items: center; gap: 10px; padding: var(--s-9) var(--s-4); text-align: center; }
.empty__icon { width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-subtle); display: grid; place-items: center; color: var(--fg-3); }
.empty__title { font-size: 13px; font-weight: 600; }
.empty__text { font-size: 12px; color: var(--fg-3); max-width: 46ch; }

.skeleton { background: var(--bg-control); border-radius: var(--r-xs); height: 10px; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { 0% { opacity: .55; } 50% { opacity: 1; } 100% { opacity: .55; } }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-2);
  font-size: 12.5px;
  animation: toast-in var(--med) var(--ease);
}
.toast__icon { color: var(--ok); margin-top: 1px; }
.toast--warn .toast__icon { color: var(--warn); }
.toast--danger .toast__icon { color: var(--danger); }
.toast__text { min-width: 0; }
.toast__title { font-weight: 600; margin-bottom: 1px; }
.toast__sub { color: var(--fg-3); font-size: 11.5px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.palette-scrim {
  position: fixed; inset: 0; z-index: var(--z-palette);
  background: var(--bg-scrim);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: start center;
  padding-top: 12vh;
}
.palette {
  width: min(680px, 92vw);
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: palette-in 160ms var(--ease);
}
@keyframes palette-in { from { opacity: 0; transform: translateY(-6px) scale(.995); } to { opacity: 1; transform: none; } }
.palette__input {
  width: 100%; height: 48px; padding: 0 16px;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  color: var(--fg); font-size: 14px;
}
.palette__input:focus { outline: none; }
.palette__list { max-height: 46vh; overflow: auto; padding: 6px; }
.palette__group { padding: 8px 10px 4px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-4); font-weight: 600; }
.palette__item {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--fg-2); font-size: 13px; width: 100%; text-align: left;
}
.palette__item svg { opacity: .7; }
.palette__item.is-active { background: var(--bg-control); color: var(--fg); }
.palette__item svg { flex: none; }
.palette__hint { margin-left: auto; font-size: 11px; color: var(--fg-4); }
.palette__foot { display: flex; gap: 14px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--fg-4); }

.scrim {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: var(--bg-scrim);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: var(--s-6);
}
.modal {
  width: min(520px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.modal__head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal__title { font-size: 14px; font-weight: 600; }
.modal__body { padding: 16px; font-size: 13px; color: var(--fg-2); }
.modal__foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.progress { height: 6px; border-radius: var(--r-full); background: var(--bg-control); overflow: hidden; }
.progress__fill { height: 100%; background: var(--fg-2); border-radius: inherit; transition: width var(--med) var(--ease); }

.meter-list { display: grid; gap: 12px; }
.meter { display: grid; grid-template-columns: 88px minmax(0, 1fr) 52px; align-items: center; gap: 10px; font-size: 11.5px; color: var(--fg-3); }
.meter__val { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg-2); }

.split-aside { display: flex; flex-direction: column; gap: var(--s-4); }
.sidebar-panel { border-left: 1px solid var(--line); }

.scroll-y { overflow-y: auto; }
.flex-none { flex: none; }
.flex-1 { flex: 1 1 auto; min-width: 0; min-height: 0; }

.toollist { display: flex; flex-direction: column; gap: 2px; }

.hr-inset { margin: var(--s-4) 0; }

.btn--hold { position: relative; overflow: hidden; isolation: isolate; }
.btn--hold .btn__hold {
  position: absolute; inset: 0; z-index: -1;
  background: rgba(0, 0, 0, .28);
  transform-origin: left center;
  transform: scaleX(0);
}
.btn--hold.is-done { opacity: .6; }
.btn--hold:focus-visible { outline-offset: 2px; }

@media (max-width: 1280px) {
  :root { --rail: 208px; }
  .grid--main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .app { grid-template-columns: var(--rail-collapsed); }
  .rail__name, .rail__group, .nav-item span.nav-item__label, .rail__build { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item__count { display: none; }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; line-height: 1; color: var(--fg-2);
  white-space: nowrap;
}
.status__dot {
  width: 6px; height: 6px; flex: none;
  border-radius: 50%;
  background: currentColor;
}
.status--online { color: var(--fg-2); }
.status--online .status__dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 15%, transparent);
}
.status--idle .status__dot { background: var(--warn); }
.status--off { color: var(--fg-4); }
.status--off .status__dot { background: transparent; border: 1px solid currentColor; }

@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 32%, transparent); }
  70% { box-shadow: 0 0 0 5px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.status--online .status__dot { animation: status-pulse 2.8s var(--ease) infinite; }

.modal--compact { width: min(360px, 100%); }
.modal--compact .modal__head { padding: 12px 12px 12px 14px; align-items: center; border-bottom: 0; }
.modal--compact .modal__title { font-size: 13.5px; }
.modal--compact .modal__foot { padding: 10px 12px; gap: 6px; }
.modal--compact .modal__foot .btn { height: 28px; padding: 0 10px; font-size: 12.5px; }
.modal--compact .modal__head > svg { color: var(--danger); }

