.wrap.wide { max-width: 980px; }
.top .grow { flex: 1; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12.5px; color: var(--muted); }
.meter { height: 8px; background: var(--soft); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--accent); }

.group { margin-bottom: 14px; }
.group h3 { margin: 0 0 4px; font-size: 16px; }
.f { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }
.f:first-of-type { border-top: 0; }
.f .lbl { font-weight: 500; }
.f .help { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.f .ctl { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.f .ctl input:not([type=checkbox]), .f .ctl select { width: 100%; }
.f .unit { color: var(--muted); font-size: 13px; white-space: nowrap; }
.f.changed .lbl::after { content: " •"; color: var(--accent); }
.switch { position: relative; width: 46px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .15s; }
.switch span::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.savebar { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.12); margin-top: 12px; }
.savebar .grow { flex: 1; font-size: 13px; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .nm { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .act { white-space: nowrap; text-align: right; }
.scroll-x { overflow-x: auto; }
.logs { font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #0d1016; color: #cfd6e4; border-radius: 12px; padding: 12px; max-height: 65vh; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.logs .WARN { color: #f2c05a; } .logs .ERROR { color: #ff7a7a; } .logs .DEBUG { color: #7f8aa3; }
.codebox { font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--soft); padding: 10px 12px; border-radius: 10px; word-break: break-all; position: relative; }
.steps { padding-left: 20px; margin: 8px 0; }
.steps li { margin: 8px 0; }
.dot-on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 4px; }
.section-head { display: flex; align-items: center; gap: 8px; margin: 18px 2px 10px; }
.section-head h2 { margin: 0; }
.section-head .grow { flex: 1; }
#dlg { width: min(560px, calc(100vw - 24px)); }
@media (max-width: 640px) {
  .f { grid-template-columns: 1fr; }
  .f .ctl { justify-content: flex-start; }
  .table .hide-sm { display: none; }
}
