/* ==========================================================================
   WorkBaba 网页控制台 · 样式
   色板与桌面版 renderer/styles.css 保持一致（亮色 #2f62f5 / #f4f6fb）
   约束：无外链字体、无外链图片、无 @import —— CSP 是 script-src/style-src 'self'
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --brand: #2f62f5;
  --brand-soft: #eaf0ff;
  --brand-deep: #1f47c4;
  --ok: #12a06a;
  --ok-soft: #e6f7ef;
  --warn: #c97c07;
  --warn-soft: #fdf3e2;
  --err: #d93a41;
  --err-soft: #fdecec;
  --line: #e6eaf2;
  --line-soft: #f0f3f9;
  --text: #1b2230;
  --text-2: #5c6780;
  --text-3: #8a93a6;
  --radius: 10px;
  --radius-sm: 7px;
  --sider-w: 240px;
  --topbar-h: 56px;
  --shadow: 0 1px 2px rgba(27, 34, 48, .05), 0 8px 24px rgba(27, 34, 48, .06);
  --shadow-lg: 0 12px 48px rgba(27, 34, 48, .18);
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.55 "PingFang SC", "Microsoft YaHei UI", "Hiragino Sans GB", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: .01em; }
p { margin: 0; }
button { font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd6e4; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6c0d4; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 通用控件 ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { background: #f7f9fd; border-color: #d6ddea; }
.btn:active { background: #eef2fa; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(47, 98, 245, .28);
}
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-primary:active { background: #1a3da8; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand); }

.btn-danger { color: var(--err); border-color: #f3cfd1; background: #fff; }
.btn-danger:hover { background: var(--err-soft); border-color: #eeb7ba; }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn-block { width: 100%; height: 38px; }

.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
}
.linkbtn:hover { color: var(--brand); text-decoration: underline; }

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.iconbtn:hover { background: var(--line-soft); color: var(--text); }

.field { display: block; }
.field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}
.field input,
.field select,
.input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus,
.field select:focus,
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 98, 245, .13);
}
.field input::placeholder { color: #aab2c4; }

/* ============================ 登录页 ============================ */

.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 480px at 50% -10%, #e3ecff 0%, rgba(227, 236, 255, 0) 70%),
    var(--bg);
}
.gate[hidden] { display: none; }

.gate-card {
  width: 100%;
  max-width: 368px;
  padding: 34px 30px 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.gate-logo {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 13px;
  background: var(--brand-soft);
}
.gate-card h1 { font-size: 19px; margin-bottom: 4px; }
.gate-sub { color: var(--text-3); font-size: 12.5px; margin-bottom: 22px; }
.gate-card .field { margin-bottom: 14px; }
.gate-card .btn-block { margin-top: 4px; }

.gate-err {
  min-height: 18px;
  margin-top: 10px;
  color: var(--err);
  font-size: 12px;
  text-align: center;
}
.gate-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-3);
  font-size: 11.5px;
  text-align: center;
  line-height: 1.6;
}

/* ============================ 应用外壳 ============================ */

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.app[hidden] { display: none; }

/* ---------- 侧栏 ---------- */

.sider {
  flex: 0 0 var(--sider-w);
  width: var(--sider-w);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 20;
}

.sider-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
}
.sider-brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.sider-brand-txt b { font-size: 13.5px; letter-spacing: .02em; }
.sider-brand-txt span { font-size: 10.5px; color: var(--text-3); letter-spacing: .06em; }

.nav {
  flex: 1;
  padding: 10px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.nav-item:hover { background: var(--line-soft); color: var(--text); }
.nav-item.is-on {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.nav-item.is-on::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.nav-item span { flex: 1; }

.nav-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--line-soft);
  color: var(--text-3);
  font: 600 11px/18px var(--mono);
  font-style: normal;
  text-align: center;
}
.nav-badge:empty { display: none; }
.nav-badge.is-warn { background: var(--warn-soft); color: var(--warn); }
.nav-badge.is-err { background: var(--err-soft); color: var(--err); }

.sider-foot {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cloud-dot {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-3);
}
.cloud-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c3cad9;
  flex: 0 0 auto;
}
.cloud-dot.is-on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(18, 160, 106, .14); }
.cloud-dot.is-off i { background: var(--err); box-shadow: 0 0 0 3px rgba(217, 58, 65, .14); }
.cloud-dot.is-wait i { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ---------- 主区 ---------- */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: 0 0 var(--topbar-h);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h2 { font-size: 15px; }
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stamp { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 40px;
}

.only-mobile { display: none; }

/* ============================ 面板与网格 ============================ */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.panel:last-child { margin-bottom: 0; }

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h3 { font-size: 13.5px; }
.panel-head .sub { color: var(--text-3); font-size: 11.5px; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 16px; }
.panel-body.flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- 指标卡 ---------- */

.stat {
  position: relative;
  padding: 15px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--brand-soft);
  opacity: .7;
}
.stat-k {
  position: relative;
  color: var(--text-3);
  font-size: 11.5px;
  letter-spacing: .02em;
}
.stat-v {
  position: relative;
  margin-top: 7px;
  font-size: 25px;
  font-weight: 650;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.stat-v small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat-hint { position: relative; margin-top: 5px; color: var(--text-3); font-size: 11.5px; }
.stat.is-ok .stat-v { color: var(--ok); }
.stat.is-ok::after { background: var(--ok-soft); }
.stat.is-warn .stat-v { color: var(--warn); }
.stat.is-warn::after { background: var(--warn-soft); }
.stat.is-err .stat-v { color: var(--err); }
.stat.is-err::after { background: var(--err-soft); }

/* ---------- 进度条 ---------- */

.bar {
  height: 6px;
  border-radius: 4px;
  background: var(--line-soft);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--brand);
  transition: width .4s ease;
}
.bar.is-ok > i { background: var(--ok); }
.bar.is-warn > i { background: var(--warn); }
.bar.is-err > i { background: var(--err); }

/* ============================ 表格 ============================ */

.tablewrap { overflow-x: auto; }

table.tb {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  white-space: nowrap;
}
table.tb th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 12px;
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  letter-spacing: .02em;
}
table.tb th.sortable { cursor: pointer; user-select: none; }
table.tb th.sortable:hover { color: var(--brand); }
table.tb th .caret { margin-left: 3px; opacity: .5; font-size: 9px; }
table.tb th.is-sorted .caret { opacity: 1; color: var(--brand); }

table.tb td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.tb tbody tr:last-child td { border-bottom: 0; }
table.tb tbody tr:hover td { background: #fafcff; }
table.tb td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
table.tb td.mono { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
table.tb td.act { text-align: right; }
table.tb td.act .btn { margin-left: 4px; }
table.tb .rowname { font-weight: 550; }
table.tb .rowsub { display: block; color: var(--text-3); font-size: 11px; font-weight: 400; margin-top: 1px; }

.empty {
  padding: 42px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
}
.empty b { display: block; color: var(--text-2); font-size: 13px; margin-bottom: 5px; }

/* ---------- 徽章 ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--line-soft);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.tag i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag.is-ok { background: var(--ok-soft); color: var(--ok); }
.tag.is-warn { background: var(--warn-soft); color: var(--warn); }
.tag.is-err { background: var(--err-soft); color: var(--err); }
.tag.is-brand { background: var(--brand-soft); color: var(--brand); }
.tag.is-mute { background: #f3f5fa; color: var(--text-3); }

/* ---------- 工具条 ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #fcfdff;
}
.toolbar .spacer { flex: 1; }
.toolbar .input { height: 30px; width: 200px; border-radius: 6px; font-size: 12.5px; }
.toolbar select.input { width: auto; min-width: 120px; }
.toolbar .hint { color: var(--text-3); font-size: 11.5px; }

/* ---------- 分段控件 ---------- */

.seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--line-soft);
  border-radius: 7px;
}
.seg button {
  height: 26px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.seg button:hover { color: var(--text); }
.seg button.is-on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 2px rgba(27,34,48,.09); }

/* ============================ 日志 ============================ */

.logview {
  max-height: 60vh;
  overflow: auto;
  margin: 0;
  padding: 12px 16px;
  background: #fbfcfe;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.72;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
  tab-size: 2;
}
.logview .ln { display: block; padding: 1px 0; }
.logview .ln.err { color: var(--err); }
.logview .ln.warn { color: var(--warn); }
.logview .ln.ok { color: var(--ok); }
.logview .ts { color: #a3abbe; margin-right: 8px; }
.logview mark { background: #fff2a8; color: inherit; padding: 0 2px; border-radius: 2px; }

/* ============================ 设置项 ============================ */

.rowset {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.rowset:last-child { border-bottom: 0; }
.rowset .txt { flex: 1; min-width: 0; }
.rowset .txt b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.rowset .txt span { color: var(--text-3); font-size: 11.5px; line-height: 1.5; }
.rowset .ctrl { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 0; font-size: 12.5px; }
.kv > div { padding: 8px 0; border-bottom: 1px dashed var(--line-soft); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv > div:nth-child(odd) { color: var(--text-3); }
.kv > div:nth-child(even) { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }

/* ============================ 弹层 ============================ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 26, 38, .42);
  backdrop-filter: blur(2px);
  animation: fadein .14s ease;
}
.overlay[hidden] { display: none; }

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideup { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  animation: slideup .16s ease;
  overflow: hidden;
}
.modal.wide { max-width: 760px; }
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { font-size: 14px; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line-soft);
  background: #fcfdff;
}

.note {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.65;
  border: 1px solid transparent;
}
.note.is-warn { background: var(--warn-soft); border-color: #f5e2bf; color: #8a5a05; }
.note.is-err { background: var(--err-soft); border-color: #f6d3d5; color: #a52830; }
.note.is-brand { background: var(--brand-soft); border-color: #d6e2ff; color: #23409e; }
.note b { font-weight: 650; }

.tokenbox {
  margin-top: 10px;
  padding: 11px 12px;
  max-height: 190px;
  overflow: auto;
  background: #f7f9fd;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.65;
  word-break: break-all;
  color: var(--text-2);
  user-select: all;
}

/* ============================ Toast ============================ */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: min(400px, calc(100vw - 36px));
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: #222a3a;
  color: #f4f7ff;
  font-size: 12.5px;
  line-height: 1.55;
  box-shadow: 0 8px 26px rgba(20, 26, 38, .28);
  animation: slideup .18s ease;
  pointer-events: auto;
}
.toast.is-ok { background: #0d7a52; }
.toast.is-warn { background: #96600a; }
.toast.is-err { background: #a92c33; }
.toast i { flex: 0 0 auto; margin-top: 1px; opacity: .85; }

/* ============================ 骨架 / 加载 ============================ */

.skeleton {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
}
.spin {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 7px;
  vertical-align: -2px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn .spin { width: 12px; height: 12px; margin-right: 0; border-top-color: currentColor; border-color: rgba(255,255,255,.35); border-top-color: #fff; }

/* ============================ 工具类 ============================
   CSP 是 style-src 'self'，HTML 里的 style="..." 属性会被浏览器直接丢掉，
   所以所有布局都靠这里的类；动态宽度（进度条）改用 .bar[data-w]，由 JS 通过
   CSSOM 赋值（CSSOM 不受 CSP 限制）。
   ============================================================== */

.mb { margin-bottom: 16px; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 18px; }

.flexrow { display: flex; align-items: center; gap: 14px; }
.flexrow-t { display: flex; align-items: center; gap: 10px; }
.flexcol { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.push { margin-left: auto; }

.barv { margin: 0; font-size: 22px; }
.mini { color: var(--text-3); font-size: 11.5px; }
.errsub { color: var(--err); }
.leftalign { text-align: left; margin-top: 10px; }
.tall { max-height: 52vh; }

.baritem { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.baritem:last-child { margin-bottom: 0; }
.barlbl {
  flex: 0 0 132px;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.barval {
  flex: 0 0 78px;
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.checklbl {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.checklbl input { margin: 0; cursor: pointer; }

/* ============================ 响应式 ============================ */

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .only-mobile { display: inline-flex; }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }

  .sider {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(20, 26, 38, .18);
  }
  .sider.is-open { transform: none; }

  .topbar { padding: 0 14px; }
  .content { padding: 14px 14px 32px; }
  .stamp { display: none; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv > div:nth-child(odd) { border-bottom: 0; padding-bottom: 0; color: var(--text-3); }
  .rowset { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .stat-v { font-size: 22px; }
  .gate-card { padding: 26px 20px 20px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
}
