:root {
  --ink: #1a1714;
  --ink-soft: #5c564e;
  --paper: #f4efe6;
  --paper-2: #ebe4d4;
  --panel: #fffdf8;
  --line: #ddd4c2;
  --line-strong: #c9bda6;
  --accent: #b45309;
  --accent-dark: #9a3b09;
  --accent-soft: #f3e0c8;
  --ok: #3f6b4a;
  --ok-bg: #e4efe6;
  --danger: #9f2d2d;
  --danger-bg: #f8e4e0;
  --shadow: 0 18px 40px rgba(48, 36, 18, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 10% -10%, #fff8ea 0%, var(--paper) 45%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%235c564e' d='M1 1.2L6 6.2 11 1.2 12.2 2.4 6 8.6 0 2.4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 32px 8px 12px;
  min-height: 38px;
  outline: none;
  cursor: pointer;
}
select:hover { border-color: #b8aa90; }
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select:disabled { opacity: 0.55; cursor: not-allowed; background-color: #f6f1e8; }

#app { min-height: 100vh; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.login-card {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 40px 36px 32px;
  box-shadow: var(--shadow);
}
.login-kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
.login-card h1 {
  margin: 0 0 28px;
  font-size: 28px;
  font-weight: 650;
  text-align: center;
}
.login-card p.hint {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 14px;
}
.login-card .form-error {
  min-height: 20px;
  margin: 2px 0 16px;
  text-align: center;
}
.login-card .btn.full {
  height: 44px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
.field select { padding-right: 32px; }
.field textarea { min-height: 88px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}
.btn:hover { background: #2b2621; }
.btn.primary { background: var(--accent); }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn.danger { background: var(--danger); }
.btn.sm { padding: 7px 10px; font-size: 13px; }
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  margin: 8px 0 4px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper-2);
  gap: 2px;
  max-width: 100%;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 9px;
  padding: 6px 14px;
  font-weight: 600;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(48,36,18,.12); }
.drive-table { overflow-x: auto; }
.drive-table table { width: 100%; border-collapse: collapse; min-width: 760px; }
.drive-table th, .drive-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}
.drive-table th { color: var(--ink-soft); font-weight: 600; }
.drive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
}
.drive-main, .drive-side { min-width: 0; }
.drive-side { position: sticky; top: 16px; }
.drive-main.panel, .drive-side.panel { overflow: visible; }
.drive-side .pick { max-width: none; width: 100%; }
.drive-toolbar, .drive-import, .drive-pad-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.drive-toolbar { margin: 8px 0 12px; }
.drive-toolbar .search, .drive-import input, .drive-pad-tools .search {
  flex: 1 1 180px;
  min-width: 0;
}
.drive-kinds { margin-left: 0; }
.drive-list, .drive-pad-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: auto;
}
.drive-list { max-height: calc(100vh - 250px); }
.drive-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.drive-row:last-child { border-bottom: 0; }
.drive-row:hover { background: var(--paper-2); }
.drive-row.is-checked { background: #f6efe3; }
.drive-row.is-push { box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-soft); }
.drive-row-main strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drive-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}
.drive-kind {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
}
.drive-kind.apk { background: var(--ok-bg); color: var(--ok); }
.drive-kind.zip { background: var(--accent-soft); color: var(--accent-dark); }
.drive-row-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.drive-push-file {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 650;
}
.drive-pad-list {
  max-height: calc(100vh - 430px);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 10px 0 12px;
}
.drive-pad {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.drive-pad:last-child { border-bottom: 0; }
.drive-pad.on { background: var(--accent-soft); }
.drive-pad-name { display: block; font-weight: 650; font-size: 13px; }
.drive-pad-code { display: block; font-size: 12px; color: var(--ink-soft); }
.drive-side .btn.primary { width: 100%; }
@media (max-width: 1100px) {
  .drive-layout { grid-template-columns: 1fr; }
  .drive-side { position: static; }
  .drive-list, .drive-pad-list { max-height: 380px; }
}
.full { width: 100%; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 12px; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: #1c1814;
  color: #f4efe6;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}
.brand { padding: 4px 10px 20px; }
.brand .kicker { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #d6a36a; }
.brand h2 { margin: 6px 0 0; font-size: 20px; font-weight: 650; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
  padding: 10px 12px;
  border-radius: 10px;
  color: #d9d0c2;
}
.nav a:hover, .nav a.router-link-active {
  background: #2a241e;
  color: #fff;
}
.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 0;
  border-top: 1px solid #3a322a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #cfc4b4;
}
.main { min-width: 0; padding: 28px 28px 48px; }
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.topbar h1 { margin: 0; font-size: 26px; }
.topbar .sub { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; }
.topbar > .btn { flex: 0 0 auto; white-space: nowrap; }
.toolbar { display: flex; gap: 10px; align-items: center; }
.search {
  min-width: 220px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 10px;
  padding: 9px 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.resource-table { overflow-x: auto; }
.resource-table table { min-width: 920px; }
.resource-table th, .resource-table td { white-space: nowrap; }
.resource-table td:nth-child(2) .muted { white-space: normal; min-width: 160px; }
.resource-table td.persona-cell { white-space: normal; min-width: 220px; }
.persona-brief { display: flex; align-items: center; gap: 10px; }
.thumbs-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thumb-sm, .thumb-lg { display: block; object-fit: cover; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); }
.thumb-sm { width: 44px; height: 44px; }
.thumb-lg { width: 72px; height: 72px; }
.media-avatar { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: start; }
.media-avatar img, .media-empty {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper);
}
.media-empty { display: grid; place-items: center; color: var(--ink-soft); font-size: 12px; }
.media-avatar-side { display: grid; gap: 8px; }
.photo-wall { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-card {
  position: relative;
  width: 168px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.photo-card.current { outline: 2px solid var(--brand, #2f6bff); border-color: var(--brand, #2f6bff); }
.photo-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 168px;
  background: var(--paper);
  cursor: pointer;
}
.photo-card img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(20, 16, 12, 0.72);
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
}
.photo-add {
  width: 168px;
  height: 168px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}
.photo-add:disabled { opacity: 0.5; cursor: not-allowed; }
.sheet-overlay {
  z-index: 50;
  place-items: end center;
  padding: 0;
}
.action-sheet {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  padding-bottom: 10px;
}
.action-sheet button {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 15px;
  cursor: pointer;
}
.action-sheet button.danger { color: #c0392b; }
.action-sheet button.primary { color: var(--brand, #2f6bff); font-weight: 600; }
.action-sheet .sheet-cancel {
  margin-top: 8px;
  border-bottom: 0;
  color: var(--ink-soft);
}
.sheet-url { padding: 12px 16px 4px; }
.sheet-url input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}
.media-preview-overlay {
  z-index: 60;
  background: rgba(10, 8, 6, 0.72);
}
.media-preview-overlay img {
  max-width: min(92vw, 720px);
  max-height: 86vh;
  border-radius: 12px;
  object-fit: contain;
}
.copy-line textarea { min-height: 46px; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 8px 10px; font-family: inherit; width: 100%; box-sizing: border-box; }
.copy-line-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.copy-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.copy-random, .copy-random-chip {
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
}
.copy-random-chip { display: inline-flex; align-items: center; padding: 6px 10px; }
.photo-picker-overlay { z-index: 30; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo-pick {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}
.photo-pick img { display: block; width: 100%; height: 96px; object-fit: cover; }
.photo-pick.on { outline: 2px solid var(--brand, #2f6bff); border-color: var(--brand, #2f6bff); }
.random-pick { min-height: 96px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--ink-soft); }
.image-slot { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.image-slot-head { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: top;
}
th { color: var(--ink-soft); font-weight: 600; background: #faf6ee; }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--ink-soft); }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: var(--danger-bg); color: var(--danger); }
.badge.dim { background: var(--paper-2); color: var(--ink-soft); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.usage-tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 120px; }

.empty { padding: 40px 16px; text-align: center; color: var(--ink-soft); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 20, 0.38);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}
.control-overlay { z-index: 40; }
.modal {
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--panel);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
}
.modal h3 { margin: 0 0 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-2 .span-2 { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.push-actions { display: flex; flex-direction: column; gap: 8px; }
.push-actions .btn { width: 100%; }
.history-modal { width: min(1080px, 100%); }
.history-modal table { table-layout: fixed; }
.history-modal th:first-child { width: 190px; }
.history-modal th:nth-child(2), .history-modal th:nth-child(3) { width: 110px; }
.history-modal th:last-child { width: 140px; }
.history-json {
  max-height: 260px;
  overflow: auto;
  margin: 6px 0 0;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0 16px; }
.country-config .country-search {
  margin-bottom: 10px;
}
.country-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.country-pane {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.country-pane-head,
.country-pane-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
}
.country-pane-head { border-bottom: 1px solid var(--line); }
.country-pane-actions { padding-top: 0; }
.country-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 10px;
}
.country-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.country-tag em {
  font-style: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink-soft);
}
.country-list {
  max-height: 240px;
  overflow: auto;
  padding: 0 8px 8px;
}
.country-row {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  margin: 0;
}
.country-row:hover { background: var(--paper); }
.country-name { font-size: 13px; }
.country-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink-soft);
}
.country-mcc {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #8a8173;
  min-width: 72px;
  text-align: right;
}
@media (max-width: 720px) {
  .country-grid { grid-template-columns: 1fr; }
}
.modal-switch { display: flex; gap: 8px; margin: -4px 0 16px; }
.numbered-fields { display: grid; gap: 8px; }
.numbered-field { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center; }
.numbered-field span { color: var(--ink-soft); font-weight: 600; text-align: center; }
.numbered-field input { border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 8px 10px; }
.text-list, .reply-groups { display: grid; gap: 10px; }
.text-list-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: start; }
.text-list-row > span { padding-top: 10px; color: var(--ink-soft); font-weight: 600; text-align: center; }
.text-list-row textarea { min-height: 46px; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 8px 10px; font-family: inherit; }
.reply-key-add { display: flex; gap: 8px; margin-bottom: 10px; }
.reply-key-add input { min-width: 210px; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 8px 10px; }
.reply-group { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fffdf8; }
.reply-group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
details summary { cursor: pointer; color: var(--ink-soft); font-size: 13px; margin-bottom: 10px; }
.redis-grid { display: grid; grid-template-columns: minmax(440px, 1.1fr) minmax(360px, .9fr); gap: 16px; align-items: start; }
.redis-grid > * { min-width: 0; }
.redis-keys { max-width: 100%; overflow-x: auto; }
.redis-keys td:first-child { cursor: pointer; }
.redis-keys tr.selected td { background: var(--accent-soft); }
.redis-value, .redis-editor { padding: 18px; margin-bottom: 16px; }
.redis-trends { margin-bottom: 16px; overflow: hidden; }
.channel-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.channel-metric {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.channel-metric span { display: block; color: var(--ink-soft); font-size: 12px; }
.channel-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.channel-metric small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 12px; }
.funnel-pipeline {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.funnel-pipe-step {
  flex: 1 1 160px;
  min-width: 140px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.funnel-pipe-step span { display: block; color: var(--ink-soft); font-size: 12px; }
.funnel-pipe-step strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.funnel-pipe-step small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 12px; }
.funnel-pipe-arrow {
  display: flex;
  align-items: center;
  color: var(--accent);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 13px;
  padding: 0 2px;
}
.funnel-pipe-arrow span::before { content: "→ "; color: var(--ink-soft); font-weight: 400; }
.funnel-extra-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 14px;
}
.funnel-extra {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.funnel-extra span { display: block; color: var(--ink-soft); font-size: 12px; }
.funnel-extra strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.origin-block { border-top: 1px solid var(--line); }
.origin-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 16px;
}
.origin-extra {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}
.origin-extra em {
  font-style: normal;
  color: var(--ink-soft);
}
.country-share {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.country-share i {
  display: block;
  height: 8px;
  min-width: 4px;
  background: var(--accent);
  border-radius: 99px;
}
.country-share span { color: var(--ink-soft); font-size: 12px; }
@media (max-width: 900px) {
  .funnel-extra-metrics { grid-template-columns: 1fr 1fr; }
}
.funnel-table td:last-child { color: var(--accent); }
.channel-day-table th:first-child, .channel-day-table td:first-child { min-width: 120px; }
.channel-link-table td:nth-child(2) { text-align: left; }
.channel-link-table a { color: var(--accent); text-decoration: underline; }
.muted { color: var(--ink-soft); font-size: 12px; }
.danger-text { color: var(--danger); font-size: 12px; margin-top: 4px; white-space: normal; }
.trend-section-head, .redis-raw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.trend-section-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.trend-section-head h3, .redis-raw-head h3 { margin: 0; font-size: 16px; }
.trend-section-head p, .redis-raw-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; }
.day-range-control { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.trend-controls { display: flex; align-items: center; gap: 10px; }
.day-range-control select, .trend-controls select {
  max-width: 360px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px;
}
.trend-table-scroll { max-width: 100%; overflow-x: auto; }
.trend-table-scroll table { width: max-content; min-width: 100%; }
.trend-table-scroll th, .trend-table-scroll td { min-width: 70px; white-space: nowrap; }
.trend-table-scroll th:first-child, .trend-table-scroll td:first-child { min-width: 220px; }
.funnel-table th.sortable { cursor: pointer; user-select: none; }
.funnel-table th.sortable:hover, .funnel-table th.sortable.active { color: var(--ink); }
.funnel-table td:first-child {
  white-space: normal;
  max-width: 420px;
  vertical-align: top;
}
.funnel-table td:first-child .muted {
  white-space: normal;
  line-height: 1.45;
}
.package-trend-table tbody tr, .device-trend-table tbody tr, .channel-link-table tbody tr, .funnel-table tbody tr { cursor: pointer; }
.package-trend-table tbody tr.selected td, .device-trend-table tbody tr.selected td, .channel-link-table tbody tr.selected td { background: var(--accent-soft); }
.funnel-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.funnel-detail .trend-table-scroll + .trend-table-scroll { border-left: 1px solid var(--line); }
@media (max-width: 1100px) {
  .funnel-detail { grid-template-columns: 1fr; }
  .funnel-detail .trend-table-scroll + .trend-table-scroll { border-left: 0; border-top: 1px solid var(--line); }
}
.package-trend-table th:not(:first-child), .package-trend-table td:not(:first-child),
.device-trend-table th:not(:first-child), .device-trend-table td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.text-right { text-align: right; }
.package-trend-table th.text-right, .package-trend-table td.text-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- 触达国家分布：世界地图 + 排名 ---------- */
.country-heatmap { display: block; }
.country-heatmap-body {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.country-heatmap-map {
  padding: 14px 18px 18px;
  background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
  border-right: 1px solid var(--line);
  min-height: 360px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.country-heatmap-map .empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 13px;
}
.country-heatmap-svg {
  width: 100%;
  height: auto;
  min-height: 360px;
  max-height: 520px;
  display: block;
  border-radius: 12px;
  background: #fbfdff;
  border: 1px solid var(--line);
}
.country-ocean { fill: #f4f7fb; }
.country-shape {
  stroke: #c9d3e2;
  stroke-width: 0.4;
  stroke-linejoin: round;
  transition: filter 0.15s ease, stroke-width 0.15s ease;
}
.country-shape.hit { cursor: pointer; }
.country-shape.hit:hover, .country-shape.hovered {
  stroke: #0f172a;
  stroke-width: 0.85;
  filter: brightness(1.02);
}
.country-shape.active {
  stroke: #1e40af;
  stroke-width: 1.1;
}
.country-map-count {
  font-size: 11px;
  font-weight: 700;
  fill: #ffffff;
  paint-order: stroke;
  stroke: rgba(15, 23, 42, 0.65);
  stroke-width: 2.4px;
  stroke-linejoin: round;
  font-variant-numeric: tabular-nums;
}
.country-map-code {
  font-size: 9px;
  fill: rgba(15, 23, 42, 0.85);
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 2px;
  stroke-linejoin: round;
  letter-spacing: 0.4px;
}
.country-heatmap-side {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.country-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font-size: 12px;
  color: var(--ink-soft);
}
.country-legend .legend-title { color: var(--ink); font-weight: 600; }
.country-legend .legend-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.country-legend .legend-bar i {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(to right, rgb(214, 227, 245), rgb(30, 64, 175));
}
.country-legend .legend-help { color: var(--ink-soft); }
.country-legend .legend-help b { color: var(--ink); }
.country-legend .legend-help a { color: var(--accent); text-decoration: none; margin-left: 4px; }
.country-legend .legend-help a:hover { text-decoration: underline; }
.country-heatmap-table {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.country-heatmap-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.country-heatmap-table thead th {
  position: sticky;
  top: 0;
  background: #f6f8fb;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.country-heatmap-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.country-heatmap-table tbody tr { cursor: pointer; }
.country-heatmap-table tbody tr:hover td { background: rgba(30, 64, 175, 0.05); }
.country-heatmap-table tbody tr.selected td { background: var(--accent-soft); }
.country-heatmap-table td.muted { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.country-heatmap-table td strong { font-weight: 600; }
.country-heatmap-table td .muted { color: var(--ink-soft); font-size: 11px; margin-top: 1px; }
.country-heatmap-devices h4 {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--ink);
}
.country-device-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.country-device-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.country-device-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.country-device-head strong {
  font-weight: 600;
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 65%;
}
.country-device-head .muted { font-size: 11px; color: var(--ink-soft); }
.country-device-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-soft);
}
.country-device-metrics strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}
.uid-chart { padding: 14px 18px 18px; }
.uid-chart > .chart-legend { margin: 0 0 10px; }
.uid-chart svg { display: block; width: 100%; height: 360px; overflow: visible; color: var(--ink-soft); font: 11px sans-serif; }
.uid-chart .chart-value {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
}
.package-chart { border-bottom: 1px solid var(--line); }
.chart-grid-line { stroke: var(--line); stroke-width: 1; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chart-legend-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.chart-legend-cards span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
}
.chart-legend-cards i { width: 12px; height: 12px; }
.chart-legend-cards em {
  font-style: normal;
  color: var(--ink-soft);
  font-size: 12px;
}
.chart-legend-cards strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.chart-selected-line { stroke: var(--ink-soft); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-caption { margin-top: 8px; }
@media (max-width: 1100px) {
  .chart-legend-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.day-range-control input[type="date"] {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font: inherit;
  color: var(--ink);
}
.device-trend-table { border-top: 1px solid var(--line); }
.device-trend-table td.device-id { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.device-trend-table .mini-trend-column, .device-trend-table .mini-trend-cell { min-width: 156px; text-align: center; }
.mini-trend { width: 132px; height: 34px; margin: 0 auto; }
.mini-trend line { stroke: var(--line); stroke-width: 1; }
.mini-trend rect { fill: #3f6b4a; }
.redis-raw-head { margin: 26px 0 12px; }
.redis-data-controls { flex-wrap: wrap; justify-content: flex-end; }
.data-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.data-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.redis-key-label { border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 9px 10px; overflow-wrap: anywhere; }
.redis-value h3, .redis-editor h3 { margin: 0 0 12px; font-size: 15px; }
.redis-value pre { max-height: 470px; overflow: auto; margin: 0; white-space: pre-wrap; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.uid-comparison-scroll { max-width: 100%; margin-bottom: 14px; }
.uid-comparison { width: 100%; table-layout: fixed; border: 1px solid var(--line); }
.uid-comparison th, .uid-comparison td { padding: 10px 12px; }
.uid-comparison th:first-child { width: 76px; color: var(--ink-soft); }
.uid-comparison thead span, .uid-comparison thead strong { display: block; }
.uid-comparison thead span { margin-bottom: 3px; color: var(--ink-soft); font-size: 11px; font-weight: 500; }
.uid-comparison thead strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uid-comparison tbody td { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.more { margin: 12px; }
.ledger-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.ledger-filters input, .ledger-filters select {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 9px 10px;
}
.filter-date { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 12px; }
.ledger-summary {
  display: flex;
  flex-wrap: wrap;
  border-block: 1px solid var(--line);
  margin-bottom: 14px;
}
.ledger-summary section {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 12px 18px;
  border-right: 1px solid var(--line);
  font-size: 13px;
}
.ledger-summary section > strong { font-size: 16px; }
.ledger-summary span { color: var(--ink-soft); white-space: nowrap; }
.ledger-summary b { color: var(--ink); margin-left: 4px; }
.ledger-summary section.ledger-total-cny {
  background: linear-gradient(90deg, rgba(255, 214, 102, 0.18), transparent 60%);
  border-left: 3px solid #f2b100;
  width: 100%;
}
.ledger-summary section.ledger-total-cny > strong { font-size: 17px; }
.ledger-summary section.ledger-total-cny b { font-size: 18px; font-variant-numeric: tabular-nums; }
.amount-income { color: var(--ok) !important; }
.amount-expense { color: var(--danger) !important; }
.amount-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger-table { overflow-x: auto; }
.ledger-table table { min-width: 1060px; }
.ledger-note { max-width: 260px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ledger-pager-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft); font-size: 13px;
}
.ledger-pager-bar .pager-info b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ledger-pager-bar .pager-controls { display: flex; gap: 8px; align-items: center; }
.ledger-pager-bar .pager-controls select { padding: 4px 8px; }
.ledger-modal { width: min(680px, 100%); }
.entry-type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }

.alert-summary {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 14px;
}
.alert-summary button {
  min-width: 130px;
  padding: 12px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}
.alert-summary button.active { background: var(--accent-soft); color: var(--accent-dark); }
.alert-summary strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.alert-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.alert-filters input, .alert-filters select {
  min-width: 150px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 9px 10px;
}
.alert-table { width: 100%; max-width: 100%; overflow-x: auto; }
.alert-table table { min-width: 1080px; }
.alert-message, .alert-source, .alert-time { display: table-cell; }
.alert-message strong, .alert-message span, .alert-message small,
.alert-source strong, .alert-source span, .alert-source small,
.alert-time strong, .alert-time span, .alert-time small {
  display: block;
}
.alert-message { min-width: 260px; max-width: 420px; }
.alert-message span, .alert-source span, .alert-time span { margin-top: 4px; }
.alert-message small, .alert-source small, .alert-time small {
  margin-top: 4px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.device-link {
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 600;
}
.device-link:hover { text-decoration: underline; }
.badge.severity-critical { background: var(--danger-bg); color: var(--danger); }
.badge.severity-warning { background: #fff0ca; color: #835600; }
.badge.severity-info { background: #e3edf8; color: #315d87; }
.badge.status-open { background: var(--danger-bg); color: var(--danger); }
.badge.status-resolved { background: var(--ok-bg); color: var(--ok); }
.badge.status-ignored { background: var(--paper-2); color: var(--ink-soft); }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 30;
}
.toast.error { background: var(--danger); }

.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.phone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.phone-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}
.phone-pick { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.phone-screen {
  aspect-ratio: 9 / 16;
  background: #1c1814;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #d9d0c2;
  cursor: pointer;
}
.phone-screen { position: relative; }
.phone-screen img { width: 100%; height: 100%; object-fit: cover; }
.phone-screen .live-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #f3efe7;
  font-size: 11px;
}
.phone-screen .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.8);
  animation: livePulse 1.6s infinite;
}
.phone-screen .screen-hint {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #f3efe7;
  font-size: 11px;
  pointer-events: none;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.phone-meta { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; font-size: 12px; color: var(--ink-soft); }
.phone-meta strong { color: var(--ink); font-size: 13px; }
.phone-card.is-selected {
  border-color: #b45309;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.18);
}
.panel-active { border-color: #b45309; }
.vmos-title { margin: 0 0 10px; font-size: 15px; }
.form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: flex-end;
}
.pick {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
  flex: 1 1 168px;
  max-width: 280px;
}
.pick.wide { flex: 1 1 240px; max-width: 360px; }
.pick.narrow { flex: 0 0 108px; min-width: 88px; max-width: 120px; }
.pick > span {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-soft);
}
.pick select, .pick input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background-color: #fff;
  border-radius: 10px;
  min-height: 38px;
  padding: 8px 12px;
}
.pick select { padding-right: 32px; }
.pick input:focus, .pick select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.pick-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 0 4px 2px;
  white-space: nowrap;
}
.vmos-banner {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}
.control-modal {
  width: min(430px, 96vw);
  max-height: 96vh;
  display: flex;
  flex-direction: column;
}
.control-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.control-head h3 { margin: 0; }
.control-actions { display: flex; gap: 8px; flex-shrink: 0; }
.control-frame {
  width: 100%;
  height: min(78vh, 740px);
  border: 0;
  border-radius: 16px;
  background: #111;
}

.adb-modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: #161311;
  color: #efe7db;
  border-color: #3a322c;
}
.adb-modal h3 { margin: 0; color: #efe7db; }
.adb-modal .hint { color: #8a8074; }
.adb-cmd-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin: 12px 0;
}
.adb-cmd-row textarea {
  flex: 1;
  min-height: 76px;
  resize: vertical;
  background: #1c1814;
  color: #efe7db;
  border: 1px solid #4b4036;
  border-radius: 10px;
  padding: 10px 12px;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.adb-cmd-row .btn { align-self: flex-end; }
.adb-out {
  min-height: 220px;
  max-height: 36vh;
  overflow: auto;
  background: #0b0908;
  border-radius: 10px;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-all;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #b7f5c4;
}
.adb-remote {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #3a322c;
}
.adb-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.adb-switch strong { font-size: 14px; }
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.switch i {
  display: block;
  position: relative;
  height: 100%;
  background: #3a322c;
  border-radius: 999px;
  pointer-events: none;
}
.switch i::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #efe7db;
  border-radius: 50%;
  transition: transform .15s ease;
}
.switch input:checked + i { background: #b45309; }
.switch input:checked + i::before { transform: translateX(20px); }
.switch input:disabled { cursor: wait; }
.adb-connect {
  margin-top: 10px;
  padding: 10px 12px;
  background: #1c1814;
  border-radius: 10px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.adb-connect-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 6px 0;
}
.adb-connect-row code {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-all;
  color: #fde68a;
}
.adb-connect .hint { margin: 4px 0 0; }

.job-log {
  margin-top: 12px;
  max-height: 240px;
  overflow: auto;
  background: #1c1814;
  color: #efe7db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}
.job-log .ok { color: #86efac; }
.job-log .warn { color: #fde68a; }
.job-log .error, .job-log .err { color: #fca5a5; }
.lock-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #9a3412;
  color: #fff7ed;
  font-size: 11px;
  vertical-align: middle;
}
.phone-card.is-locked { outline: 2px solid #c2410c; }
.has-job-drawer .main { padding-right: min(432px, 100vw); }
.job-drawer-tab {
  position: fixed;
  right: 0;
  top: 28%;
  z-index: 28;
  border: 0;
  border-radius: 10px 0 0 10px;
  background: #9a3412;
  color: #fff7ed;
  padding: 10px 12px;
  writing-mode: vertical-rl;
  cursor: pointer;
}
.job-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: #1c1814;
  color: #efe7db;
  box-shadow: -12px 0 30px rgba(0,0,0,.28);
}
.job-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 10px;
}
.job-drawer-head h3 { margin: 0; color: #fff7ed; }
.job-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 8px; }
.job-tab {
  border: 1px solid #4b4036;
  background: #2a241f;
  color: #efe7db;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
}
.job-tab.on { background: #9a3412; border-color: #9a3412; }
.job-pads { margin: 0 16px 8px; font-size: 12px; color: #d9d0c2; }
.job-log.drawer {
  flex: 1;
  min-height: 0;
  margin: 0 16px;
  max-height: none;
  overflow: auto;
}
@media (max-width: 900px) {
  .has-job-drawer .main { padding-right: 0; }
  .job-drawer { width: 100vw; }
}
.job-drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px 16px;
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; align-items: center; }
.buy-mail-steps { color: var(--ink-soft); font-size: 13px; margin: -6px 0 14px; }
.buy-mail-captcha {
  height: 42px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.buy-mail-captcha-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.buy-mail-captcha-empty {
  min-width: 108px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--ink-soft);
}
.buy-mail-qr {
  display: block;
  width: 240px;
  height: 240px;
  margin: 12px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.buy-mail-amount { text-align: center; font-size: 18px; font-weight: 700; margin: 8px 0 4px; }
.buy-mail-meta { text-align: center; color: var(--ink-soft); font-size: 13px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .redis-grid { grid-template-columns: 1fr; }
  .trend-section-head, .redis-raw-head { align-items: flex-start; flex-direction: column; }
  .trend-controls, .redis-raw-head .toolbar { width: 100%; }
  .redis-data-controls { justify-content: flex-start; }
  .trend-controls select, .redis-raw-head .search { flex: 1; min-width: 0; }
  .channel-metrics { grid-template-columns: 1fr; }
  .uid-chart svg { height: 240px; }
  .chart-legend-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 18px 14px 32px; }
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .topbar > div:first-child { min-width: 0; }
  .ledger-topbar { align-items: flex-start; }
  .ledger-filters > * { flex: 1 1 140px; min-width: 0; }
  .ledger-summary { display: block; }
  .ledger-summary section { flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .alert-summary button { flex: 1 1 50%; border-bottom: 1px solid var(--line); }
  .alert-filters > * { flex: 1 1 145px; min-width: 0; }
  .country-heatmap-body { grid-template-columns: 1fr; }
  .country-heatmap-map { border-right: 0; border-bottom: 1px solid var(--line); min-height: 260px; }
  .country-heatmap-svg { min-height: 240px; }
  .country-heatmap-table { max-height: 320px; }
}
