:root {
  --ink: #1b1714;
  --muted: #6b6158;
  --paper: #f6f0e6;
  --card: #fffaf3;
  --line: #e4d8c8;
  --accent: #0f6e62;
  --accent-2: #c45c26;
  --ok: #1f7a4d;
  --bad: #b42318;
  --warn: #b45309;
  --shadow: 0 18px 40px rgba(27, 23, 20, 0.08);
  --mono: "IBM Plex Mono", "Cascadia Mono", ui-monospace, monospace;
  --sans: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 500px at 10% -10%, #efe4d2 0%, var(--paper) 55%);
  color: var(--ink);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 10px;
}
.brand { font-family: var(--sans); font-size: 28px; letter-spacing: 0.02em; }
.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
  font-weight: 600; text-decoration: none; background: #fff;
}
.nav a:hover { color: var(--ink); border-color: var(--ink); text-decoration: none; }
.nav a.active {
  background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700;
}
.hero { margin: 24px 0 28px; }
.hero h1 { font-family: var(--sans); font-size: 44px; margin: 0 0 8px; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; }
.grid { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
textarea { min-height: 160px; resize: vertical; font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,110,98,.12); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer;
  background: var(--ink); color: #fff; font-weight: 600;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost.is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.accent { background: var(--accent); }
.btn.warn { background: var(--accent-2); }
.msg { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.msg.err { background: #fde8e6; color: var(--bad); }
.msg.ok { background: #e8f6ee; color: var(--ok); }
.msg.info { background: #f3ece1; color: var(--muted); }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 500; }
.help { white-space: pre-wrap; line-height: 1.7; color: #3c342d; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.tag {
  display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px;
  background: #efe6d8; color: var(--ink);
}
.tag.ok { background: #d9f2e3; color: var(--ok); }
.tag.bad { background: #fde2df; color: var(--bad); }
.tag.warn { background: #fce8cc; color: var(--warn); }
.hidden { display: none !important; }
.foot { padding: 40px 0; color: var(--muted); font-size: 13px; }

.admin-body { background: #efe8dc; height: 100vh; overflow: hidden; }
.shell {
  display: grid; grid-template-columns: 230px 1fr;
  height: 100%; overflow: hidden;
}
.side {
  background: #171310; color: #f4eadc; padding: 22px 16px;
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
.side .brand { color: #fff; font-size: 22px; margin-bottom: 24px; }
.side a {
  display: block; color: #d9cbb8; padding: 10px 12px; border-radius: 10px; margin-bottom: 4px;
}
.side a:hover, .side a.active { background: #2a241f; color: #fff; text-decoration: none; }
.main {
  padding: 24px; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
}
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
h2 { font-family: var(--sans); margin: 0 0 14px; }
.search-box {
  display: flex; align-items: stretch; gap: 8px;
  flex: 1 1 240px; min-width: 200px; max-width: 420px;
}
.search-box .search-input { width: 100%; min-width: 0; }
.search-box .search-btn { flex: 0 0 auto; white-space: nowrap; }
.pager {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 14px; color: var(--muted); font-size: 13px;
}
.pager-meta { margin-right: 4px; }
.pager-size {
  width: auto; padding: 6px 10px; border-radius: 999px; font-size: 13px;
}
.pager-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 600;
}
.pager-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pager-btn.is-current {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.pager-ellipsis { padding: 0 4px; }
.dialog-mask {
  position: fixed; inset: 0; background: rgba(27, 23, 20, 0.35);
  display: flex; align-items: center; justify-content: center; z-index: 40;
  padding: 24px;
}
.dialog { width: min(520px, 100%); }
.dialog h3 { margin: 0 0 12px; }
.dialog-code {
  font-family: var(--mono); font-size: 16px; word-break: break-all;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px;
}
.ops { display: flex; flex-wrap: wrap; gap: 6px; }
.ops .btn { padding: 6px 12px; font-size: 12px; }

.progress-panel {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.progress-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.progress-title { font-weight: 700; }
.progress-pct {
  font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 600;
}
.progress-track {
  height: 10px; border-radius: 999px; background: #efe6d8; overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f6e62, #27a392);
  transition: width .25s ease-out;
  position: relative;
}
.progress-bar.is-run::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  animation: progress-sheen 1.4s linear infinite;
}
.progress-bar.is-ok { background: linear-gradient(90deg, #1f7a4d, #3cb371); }
.progress-bar.is-bad { background: linear-gradient(90deg, #c45c26, #e08a4f); }
.progress-hint {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; color: var(--muted); font-size: 13px; min-height: 20px;
}
.progress-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(15, 110, 98, .45);
  animation: progress-pulse 1.2s ease-out infinite;
}
.progress-dot.is-ok { background: var(--ok); animation: none; box-shadow: none; }
.progress-dot.is-bad { background: var(--accent-2); animation: none; box-shadow: none; }
.progress-actions { margin-top: 14px; }
.progress-panel.is-queue .progress-track,
.progress-panel.is-queue .progress-pct { display: none; }
@keyframes progress-sheen {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@keyframes progress-pulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 110, 98, .45); }
  70% { box-shadow: 0 0 0 8px rgba(15, 110, 98, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 110, 98, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .progress-bar { transition: none; }
  .progress-bar.is-run::after, .progress-dot { animation: none; }
}

.stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
}
.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.stat-num { font-family: var(--sans); font-size: 26px; font-weight: 700; }
.stat-num.ok { color: var(--ok); }
.stat-num.bad { color: var(--bad); }
@media (max-width: 860px) {
  .grid, .shell { grid-template-columns: 1fr; }
  .shell { grid-template-rows: auto 1fr; }
  .hero h1 { font-size: 32px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .tool-actions { align-items: stretch; }
}

.tool-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-top: 14px;
}
.inline-label { margin: 0; min-width: 160px; }
.inline-label select { margin-top: 6px; }
.sub-list { display: grid; gap: 12px; margin-top: 14px; }
.sub-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.verify-box {
  margin-top: 16px; padding: 14px 16px; border-radius: 14px;
  background: #fff7ed; border: 1px solid #f3d3b0;
}
.verify-box p { margin: 8px 0 12px; color: var(--muted); font-size: 14px; }
.verify-title { font-weight: 700; }
#toolResult:empty { display: none; }

/* Refined UI layer: keeps the existing page and API contracts intact. */
:root {
  --ink: #172033;
  --muted: #667085;
  --paper: #f5f7fb;
  --card: #ffffff;
  --line: #e3e8ef;
  --accent: #0f766e;
  --accent-2: #c66a2b;
  --ok: #16855b;
  --bad: #c2413e;
  --warn: #a86a16;
  --shadow: 0 12px 30px rgba(23, 32, 51, 0.07);
  --shadow-soft: 0 4px 14px rgba(23, 32, 51, 0.05);
  --mono: "IBM Plex Mono", "Cascadia Mono", ui-monospace, monospace;
  --sans: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif SC", serif;
}

body {
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

body:not(.admin-body) {
  background: linear-gradient(180deg, #f8fafc 0, var(--paper) 280px);
}

button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .2);
  outline-offset: 2px;
}

.wrap { width: min(1120px, calc(100% - 40px)); }
.top {
  min-height: 76px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--ink); font-size: 25px; font-weight: 700; letter-spacing: .01em; }
.nav { gap: 6px; }
.nav a {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 9px;
  border-color: transparent;
  background: transparent;
  font-size: 14px;
  color: var(--muted);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.nav a:hover { background: #eaf3f2; border-color: #cde5e1; color: var(--accent); }
.nav a.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.hero { margin: 52px 0 28px; max-width: 720px; }
.hero h1 { color: var(--ink); font-size: clamp(32px, 4vw, 46px); line-height: 1.12; letter-spacing: -.02em; }
.hero p { color: var(--muted); font-size: 15px; }
.grid { grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 22px; align-items: start; }
.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}
.card h3 { margin: 0 0 14px; font-size: 17px; line-height: 1.35; }
.card p { line-height: 1.7; }
label { margin: 16px 0 7px; color: #475467; font-weight: 600; }
input, select, textarea {
  border-color: #d6dde7;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:hover, select:hover, textarea:hover { border-color: #b8c3d2; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .11);
}
textarea { min-height: 168px; line-height: 1.6; }
.row { gap: 10px; }
.btn {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 9px;
  background: var(--ink);
  font-size: 14px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(23, 32, 51, .12); }
.btn.accent { background: var(--accent); }
.btn.accent:hover:not(:disabled) { background: #0b625b; }
.btn.warn { background: var(--accent-2); }
.btn.ghost { background: #fff; border-color: #d6dde7; color: var(--ink); }
.btn.ghost:hover:not(:disabled) { background: #f8fafc; border-color: #aeb9c8; }
.btn.ghost.is-current { background: var(--ink); border-color: var(--ink); }
.msg { margin-top: 14px; padding: 11px 13px; border: 1px solid transparent; border-radius: 9px; line-height: 1.5; }
.msg.err { background: #fff2f1; border-color: #f3c9c6; color: var(--bad); }
.msg.ok { background: #eefaf4; border-color: #c4ead5; color: var(--ok); }
.msg.info { background: #f3f6fa; border-color: #dce4ee; color: var(--muted); }
.kv { grid-template-columns: minmax(82px, 104px) 1fr; gap: 8px 14px; line-height: 1.5; }
.kv b { color: #667085; }
.help { color: #475467; line-height: 1.85; }
table { font-size: 13px; }
th, td { padding: 12px 10px; border-bottom-color: var(--line); }
th { color: #667085; font-size: 12px; letter-spacing: .02em; white-space: nowrap; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: #f8fafc; }
.tag { padding: 3px 9px; border-radius: 6px; background: #eef2f6; color: #475467; font-weight: 600; }
.tag.ok { background: #e8f7ef; color: var(--ok); }
.tag.bad { background: #fff0ef; color: var(--bad); }
.tag.warn { background: #fff5e6; color: var(--warn); }

.progress-panel {
  padding: 18px;
  border-color: var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.progress-title { font-size: 15px; }
.progress-track { height: 9px; background: #e9eef3; }
.progress-bar { background: linear-gradient(90deg, #0f766e, #27a69a); }
.progress-bar.is-ok { background: linear-gradient(90deg, #16855b, #38ad78); }
.progress-bar.is-bad { background: linear-gradient(90deg, #c2413e, #dd7164); }
.progress-hint { margin-top: 12px; }
.verify-box { background: #fff9f1; border-color: #f3d7b6; }
.dialog-mask { background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
.dialog { max-height: min(680px, calc(100vh - 48px)); overflow: auto; box-shadow: 0 24px 60px rgba(15, 23, 42, .2); }

/* Admin workspace */
.admin-body { min-height: 100vh; height: auto; overflow: auto; background: #f1f4f8; }
.login-box {
  position: fixed;
  inset: 0;
  width: min(420px, calc(100% - 32px));
  height: max-content;
  margin: auto;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(23, 32, 51, .14);
}
.login-box h2 { margin-bottom: 22px; font-size: 25px; }
.shell { display: flex; min-height: 100vh; height: auto; overflow: visible; }
.side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 248px;
  height: 100vh;
  flex: 0 0 248px;
  padding: 24px 16px;
  background: #172033;
  color: #e7edf5;
  border-right: 1px solid #25334c;
}
.side .brand { margin: 0 10px 28px; color: #fff; font-size: 22px; letter-spacing: .02em; }
.side a {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin: 2px 0;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #aebbd0;
  font-size: 14px;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.side a:hover, .side a.active { background: #25334c; border-color: #34435f; color: #fff; text-decoration: none; }
.side #btnLogout { margin-top: auto; color: #c6d0df; }
.main { width: min(100%, 1380px); flex: 1; padding: 34px clamp(22px, 4vw, 52px) 56px; overflow: visible; }
.toolbar { min-height: 42px; margin-bottom: 18px; }
.toolbar h2 { color: var(--ink); font-size: 25px; letter-spacing: -.01em; }
.main > section > p { max-width: 920px; }
.main .card { box-shadow: var(--shadow-soft); }
.main .card + .card { margin-top: 18px !important; }
.main .card > h3 { color: var(--ink); }
.search-box { max-width: 440px; }
.search-box .search-input { min-height: 40px; }
.search-box .search-btn { min-height: 40px; }
.pager { margin-top: 18px; gap: 7px; }
.pager-btn { border-color: #d6dde7; border-radius: 8px; padding: 7px 11px; }
.pager-btn:hover:not(:disabled) { background: #f8fafc; border-color: #aeb9c8; }
.pager-btn.is-current { background: var(--ink); border-color: var(--ink); }
.pager-size { border-radius: 8px; }
.stat-grid { gap: 14px; }
.stat-card { padding: 16px 17px; border-color: var(--line); border-radius: 11px; box-shadow: none; }
.stat-label { color: #667085; }
.stat-num { color: var(--ink); font-size: 27px; }
.sub-card { border-color: var(--line); border-radius: 10px; box-shadow: none; }
.ops { gap: 7px; }
.ops .btn { min-height: 34px; padding: 6px 11px; border-radius: 7px; }
.main table { min-width: 680px; }
.main input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.tool-actions { gap: 10px; }

.front-wrap { width: min(720px, calc(100% - 40px)); }
.front-hero { margin: 28px 0 18px; max-width: none; }
.front-hero h1 { font-size: clamp(28px, 4vw, 36px); }
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
}
.notice-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #f3d7b6;
  border-radius: 12px;
  background: #fff8eb;
  color: #7a4e12;
  font-size: 14px;
  line-height: 1.6;
}
.open-card { padding: 22px 22px 20px; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f4f7fb;
  color: #667085;
  font-size: 13px;
  font-weight: 650;
}
.steps li span {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e4eaf2;
  color: #475467;
  font-size: 12px;
}
.steps li.is-on { background: #e7f5f3; color: var(--accent); }
.steps li.is-on span { background: var(--accent); color: #fff; }
.steps li.is-done { color: var(--ok); }
.steps li.is-done span { background: #d9f3e6; color: var(--ok); }
#step1 > label { margin-top: 0; }
.field-row { display: flex; gap: 10px; align-items: stretch; }
.field-row input { flex: 1; min-width: 0; }
.field-row .btn { flex: 0 0 auto; white-space: nowrap; }
.mono-input { font-family: var(--mono); letter-spacing: .02em; }
.summary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 22px;
  margin-bottom: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fc;
}
.summary div span { display: block; color: #667085; font-size: 12px; }
.summary div b { display: block; margin-top: 2px; font-size: 15px; }
.summary .text-btn { margin-left: auto; }
.text-btn {
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--accent);
  font-weight: 650;
  cursor: pointer;
}
.text-btn:hover { text-decoration: underline; }
.copy-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.copy-line code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-line .btn { min-height: 34px; padding: 6px 12px; }
.hint { margin: 8px 0 0; color: #667085; font-size: 13px; line-height: 1.6; }
.receipt {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.btn-block { width: 100%; margin-top: 14px; }
.trust { margin: 10px 0 0; color: #98a2b3; font-size: 12px; text-align: center; }
.help-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.help-steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.help-steps li > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e7f5f3;
  color: var(--accent);
  font-weight: 700;
}
.help-steps h3 { margin: 2px 0 6px; font-size: 16px; }
.help-steps p { margin: 0; color: #475467; font-size: 14px; line-height: 1.65; }
.help-steps .see {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid #d5e8e4;
  color: #667085;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.warn-card {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid #f3c9c6;
  border-radius: 14px;
  background: #fff6f5;
}
.warn-card b { display: block; margin-bottom: 4px; color: var(--bad); }
.warn-card p { margin: 0; color: #7a3b38; font-size: 14px; line-height: 1.6; }
.help-extra { margin-top: 14px; }
.help-extra h3 { margin-bottom: 8px; }

@media (max-width: 860px) {
  .wrap { width: min(100% - 28px, 680px); }
  .top { align-items: flex-start; gap: 14px; flex-direction: column; }
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .nav a { flex: 0 0 auto; }
  .hero { margin-top: 36px; }
  .grid { grid-template-columns: 1fr; }
  .shell { display: block; }
  .side {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: auto;
    min-height: 62px;
    padding: 10px 14px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #25334c;
  }
  .side .brand { flex: 0 0 auto; margin: 0 12px 0 0; font-size: 18px; }
  .side a { flex: 0 0 auto; min-height: 38px; margin: 0 2px; padding: 7px 10px; white-space: nowrap; }
  .side #btnLogout { margin: 0 0 0 4px; }
  .main { padding: 26px 16px 40px; }
  .toolbar { align-items: flex-start; }
  .toolbar h2 { font-size: 23px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  .wrap { width: min(100% - 24px, 680px); }
  .hero h1 { font-size: 32px; }
  .card { padding: 18px; }
  .front-wrap { width: min(100% - 24px, 720px); }
  .steps li { padding: 8px 6px; font-size: 12px; }
  .field-row, .copy-line { flex-direction: column; align-items: stretch; }
  .field-row .btn, .copy-line .btn { width: 100%; }
  .copy-line code { white-space: normal; }
  .summary .text-btn { margin-left: 0; }
  .row > input, .row > select, .row > button { min-width: 0; flex: 1 1 100%; max-width: none !important; }
  .tool-actions .inline-label { flex: 1 1 100%; }
  .tool-actions .btn { flex: 1 1 auto; }
  .kv { grid-template-columns: 82px 1fr; }
  .login-box { padding: 24px 20px; }
  .main { padding-left: 12px; padding-right: 12px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar > .btn { width: 100%; }
  .stat-grid { grid-template-columns: 1fr; }
  .search-box { max-width: none; width: 100%; }
  .search-box .search-btn { flex: 0 0 auto; }
}
