:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1b2434;
  --muted: #6b7688;
  --border: #e4e8f0;
  --border-strong: #d5dbe7;
  --primary: #2456d6;
  --primary-dark: #1741ae;
  --primary-soft: #eaf0ff;
  --success: #0d8a62;
  --success-soft: #e7f6f0;
  --warning: #b76a00;
  --warning-soft: #fff4df;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --shadow: 0 1px 2px rgba(20, 35, 70, .04), 0 8px 24px rgba(20, 35, 70, .05);
  --radius: 14px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 258px;
  flex: 0 0 258px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  display: grid; place-items: center;
  flex: 0 0 40px;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .2px; }
.brand span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

.nav { padding: 18px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 11px 12px;
  background: transparent; border: 0; border-radius: 10px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #f5f7fb; }
.nav-item.active { background: var(--primary-soft); }
.nav-icon {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 8px;
  background: #eef1f6; color: var(--muted);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; font-family: var(--mono);
}
.nav-item.active .nav-icon { background: var(--primary); color: #fff; }
.nav-text strong { display: block; font-size: 13.5px; font-weight: 600; }
.nav-item.active .nav-text strong { color: var(--primary-dark); }
.nav-text small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

.sidebar-foot { padding: 16px 18px 20px; border-top: 1px solid var(--border); }
.tip-card { background: #f7f9fd; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tip-title { font-size: 12px; font-weight: 700; color: var(--primary-dark); margin-bottom: 4px; }
.tip-card p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.sidebar-note { font-size: 10.5px; color: #9aa3b2; margin: 12px 2px 0; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; }
.topbar {
  height: 82px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 34px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.eyebrow { margin: 0; font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--primary); font-weight: 700; }
.topbar h1 { margin: 2px 0 0; font-size: 21px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.pill { font-size: 11px; color: var(--muted); background: #f1f3f8; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }
.pill.live { color: var(--success); background: var(--success-soft); border-color: #cbeade; }

.content { padding: 26px 34px 60px; max-width: 1500px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.grid { display: grid; gap: 20px; }
.grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.two-col { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.grid .card { margin-bottom: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.card-head p { margin: 4px 0 0; font-size: 12px; }
.muted { color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }

/* ---------- Controls ---------- */
.btn {
  border: 1px solid transparent; border-radius: 8px;
  padding: 8px 15px; font-size: 12.5px; font-weight: 600;
  transition: all .15s; white-space: nowrap;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.primary:disabled { background: #a9b9dc; cursor: not-allowed; }
.btn.subtle { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn.subtle:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary-soft { background: var(--primary-soft); color: var(--primary-dark); border-color: #c9d8ff; }
.btn.primary-soft:hover { background: #dce7ff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--primary); background: var(--primary-soft); }
.icon-btn { border: 0; background: transparent; font-size: 22px; color: var(--muted); line-height: 1; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar select, select, input, textarea {
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: #fff; padding: 8px 11px; outline: none;
}
select:focus, input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36,86,214,.1); }

.dropzone { position: relative; border-radius: 10px; transition: box-shadow .15s; }
.dropzone.drag-over { box-shadow: 0 0 0 3px rgba(36,86,214,.18); }
.dropzone.drag-over textarea { border-color: var(--primary); background: #f3f7ff; }
.drop-overlay {
  display: none; position: absolute; inset: 0; z-index: 2;
  align-items: center; justify-content: center;
  border: 2px dashed var(--primary); border-radius: 10px;
  background: rgba(234,240,255,.92); color: var(--primary-dark);
  font-size: 14px; font-weight: 700; pointer-events: none;
}
.dropzone.drag-over .drop-overlay { display: flex; }
textarea#message-input {
  width: 100%; min-height: 340px; resize: vertical;
  font-family: var(--mono); font-size: 12px; line-height: 1.65;
  background: #fbfcfe;
}
.file-hint { font-size: 11px; margin: 8px 0 0; line-height: 1.55; }
.file-hint.ocr-working { color: var(--primary); font-weight: 600; }

.form-row { margin-bottom: 14px; }
.form-row label, label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.form-row-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row input, .form-row select { width: 100%; }
.form-error { color: var(--danger); font-size: 12px; min-height: 18px; margin: 0; }
.tag { font-weight: 400; color: var(--muted); font-size: 11px; }

.segmented { display: inline-flex; background: #f1f3f8; border-radius: 8px; padding: 3px; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; font-size: 11.5px; color: var(--muted); }
.segmented button.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-icon { font-size: 34px; color: #c3cddd; margin-bottom: 8px; }
.empty-state p { margin: 0 auto 12px; max-width: 340px; font-size: 12.5px; }

/* ---------- Summary ---------- */
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.summary-item { background: #f8fafd; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; min-width: 0; }
.summary-item.wide { grid-column: 1 / -1; }
.summary-label { font-size: 10.5px; color: var(--muted); display: flex; justify-content: space-between; }
.summary-value { font-size: 13px; font-weight: 600; margin-top: 3px; word-break: break-all; }
.summary-value.accent { color: var(--primary-dark); font-family: var(--mono); font-size: 12px; }
.summary-value.mono { font-family: var(--mono); font-size: 12px; }
.amount-big { font-size: 20px; font-weight: 700; color: var(--primary-dark); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.field-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.field-table th { text-align: left; padding: 9px 10px; background: #f7f9fc; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.field-table td { padding: 9px 10px; border-bottom: 1px solid #eef1f6; vertical-align: top; }
.field-table tr:last-child td { border-bottom: 0; }
.field-table tbody tr:hover { background: #fafcff; }
.field-tag { font-family: var(--mono); font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 2px 6px; border-radius: 5px; font-size: 11px; }
.field-value { font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap; word-break: break-word; }
.field-explain { color: var(--muted); font-size: 11.5px; }
.star { color: #e0a100; margin-left: 3px; }

/* ---------- Annotated raw ---------- */
.annotated { background: #fbfcfe; border: 1px solid var(--border); border-radius: 10px; padding: 16px; max-height: 420px; overflow: auto; }
.anno-line { display: flex; gap: 10px; padding: 3px 0; font-family: var(--mono); font-size: 12px; line-height: 1.7; }
.anno-tag { color: var(--primary); font-weight: 700; flex: 0 0 52px; cursor: help; }
.anno-text { white-space: pre-wrap; word-break: break-all; }
.anno-line.mx { display: block; white-space: pre-wrap; font-size: 11.5px; }

/* ---------- Notices / legend / catalog ---------- */
.notice-box { background: var(--warning-soft); border: 1px solid #f3dfb5; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.notice-box strong { font-size: 12px; color: var(--warning); }
.notice-box p { margin: 4px 0 0; font-size: 11.5px; color: #7a6338; line-height: 1.6; }

.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-bottom: 16px; }
.legend > div { display: flex; align-items: center; gap: 8px; }
.legend small { font-size: 10.5px; color: var(--muted); }

.catalog-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.catalog-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 11.5px; }
.catalog-row strong { font-weight: 600; }
.catalog-row span { color: var(--muted); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.badge.found { background: var(--success-soft); color: var(--success); }
.badge.missing { background: #f1f3f7; color: var(--muted); }
.badge.blocked { background: var(--warning-soft); color: var(--warning); }
.badge.error { background: var(--danger-soft); color: var(--danger); }

/* ---------- Query results ---------- */
.results-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
@media (max-width: 1100px) { .results-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 700px) { .results-grid { grid-template-columns: 1fr; } }
.result-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.result-card a { text-decoration: none; color: inherit; }
.result-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.result-card h3 { margin: 0; font-size: 13px; }
.result-card p { margin: 0; font-size: 11.5px; color: var(--muted); }
.result-lines { margin: 0; font-size: 11px; }
.result-lines div { display: flex; gap: 8px; padding: 2px 0; }
.result-lines dt { color: var(--muted); flex: 0 0 70px; }
.result-lines dd { margin: 0; word-break: break-all; }
.jump { color: var(--primary) !important; font-weight: 600; margin-top: auto !important; }

/* ---------- Logistics-style flow ---------- */
.flow-progress { margin-bottom: 8px; }
.flow-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, #eef4ff, #f6f9ff);
  border: 1px solid #c9d8ff; border-radius: 12px;
  padding: 16px 18px; margin-bottom: 22px;
}
.flow-banner.failed { background: linear-gradient(135deg, #fdecea, #fff5f3); border-color: #f3c9c2; }
.flow-banner .flow-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 19px; flex: 0 0 42px; }
.flow-banner.failed .flow-icon { background: var(--danger); }
.flow-banner .flow-text strong { display: block; font-size: 16px; color: var(--primary-dark); }
.flow-banner.failed .flow-text strong { color: var(--danger); }
.flow-banner .flow-text small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.flow-bar { flex: 1 1 200px; min-width: 120px; height: 8px; background: #dfe6f2; border-radius: 999px; overflow: hidden; }
.flow-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s; }
.flow-banner.failed .flow-bar span { background: var(--danger); }
.flow-pct { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }

.flow-track { position: relative; padding-left: 6px; }
.flow-step { position: relative; display: flex; gap: 16px; padding: 0 0 26px 0; }
.flow-step:last-child { padding-bottom: 4px; }
.flow-step::before {
  content: ""; position: absolute; left: 15px; top: 32px; bottom: -4px;
  width: 2px; background: var(--border-strong);
}
.flow-step:last-child::before { display: none; }
.flow-step.done::before { background: var(--primary); }
.flow-step.current::before { background: linear-gradient(var(--primary), var(--border-strong)); }
.flow-dot {
  position: relative; z-index: 1; flex: 0 0 32px; width: 32px; height: 32px;
  border-radius: 50%; background: #fff; border: 2px solid var(--border-strong);
  display: grid; place-items: center; font-size: 13px; color: var(--muted); font-weight: 700;
}
.flow-step.done .flow-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.flow-step.current .flow-dot { background: #fff; border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 5px var(--primary-soft); } 50% { box-shadow: 0 0 0 9px rgba(36,86,214,.10); } }
.flow-body { flex: 1; min-width: 0; padding-top: 3px; }
.flow-step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flow-step-title { font-size: 13.5px; font-weight: 700; }
.flow-step.current .flow-step-title { color: var(--primary-dark); }
.flow-step.pending .flow-step-title { color: var(--muted); }
.flow-tag { font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.flow-tag.done { background: var(--success-soft); color: var(--success); }
.flow-tag.current { background: var(--primary-soft); color: var(--primary-dark); }
.flow-tag.pending { background: #f1f3f7; color: var(--muted); }
.flow-step-desc { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.flow-step-meta { font-size: 11px; color: var(--muted); margin-top: 5px; display: flex; gap: 14px; flex-wrap: wrap; }
.flow-step-meta b { color: var(--text); font-weight: 600; }
.flow-hint { font-size: 11px; color: var(--muted); border-top: 1px dashed var(--border-strong); padding-top: 10px; margin-top: 2px; }

/* ---------- Chain ---------- */
.chain-flow { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 12px 4px 22px; }
.chain-node { flex: 1 0 148px; max-width: 190px; background: #fff; border: 1px solid var(--border-strong); border-radius: 11px; padding: 14px 12px; text-align: center; position: relative; }
.chain-node.optional { border-style: dashed; background: #fafbfe; }
.chain-node .role { font-size: 10.5px; color: var(--muted); }
.chain-node .icon { width: 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 8px auto; font-size: 15px; font-weight: 700; }
.chain-node .name { font-size: 12.5px; font-weight: 700; word-break: break-word; }
.chain-node .code { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 4px; word-break: break-all; }
.chain-node .acct { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 4px; word-break: break-all; }
.chain-arrow { flex: 0 0 30px; display: grid; place-items: center; color: #aab4c4; font-size: 18px; }
.chain-empty-hint { font-size: 11px; color: var(--muted); text-align: center; margin-top: -8px; }
.notes-list { display: flex; flex-direction: column; gap: 10px; }
.note { border-left: 3px solid var(--primary); background: #f7f9fd; padding: 9px 12px; border-radius: 0 8px 8px 0; font-size: 12px; }
.note.warn { border-color: var(--warning); background: var(--warning-soft); }

/* ---------- Document tabs / validation / timeline ---------- */
.doc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-tab { border: 1px solid var(--border-strong); background: #fff; border-radius: 7px; padding: 5px 10px; font-size: 11px; color: var(--muted); }
.doc-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.doc-tab .tab-status { margin-left: 5px; color: var(--success); }

.check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 820px) { .check-list { grid-template-columns: 1fr; } }
.check-item { display: flex; gap: 10px; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; background: #fff; }
.check-item .mark { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.check-item.ok .mark { background: var(--success-soft); color: var(--success); }
.check-item.warn { border-color: #f0dcb4; background: #fffcf5; }
.check-item.warn .mark { background: var(--warning-soft); color: var(--warning); }
.check-item.error { border-color: #f3c9c2; background: #fff7f5; }
.check-item.error .mark { background: var(--danger-soft); color: var(--danger); }
.check-item strong { display: block; font-size: 12px; }
.check-item small { display: block; color: var(--muted); font-size: 11px; line-height: 1.55; margin-top: 2px; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--border-strong); }
.timeline-item { position: relative; padding: 0 0 16px 0; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.timeline-item .t-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.timeline-item .t-date { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.timeline-item .t-title { font-size: 12.5px; font-weight: 700; }
.timeline-item .t-body { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ---------- Quick status script ---------- */
.quick-script-card { border-color: #c9d8ff; box-shadow: 0 2px 10px rgba(36,86,214,.08); }
.status-badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-badge.good { background: var(--success-soft); color: var(--success); }
.status-badge.pending { background: var(--warning-soft); color: var(--warning); }
.status-badge.bad { background: var(--danger-soft); color: var(--danger); }
.status-badge.neutral { background: #f1f3f7; color: var(--muted); }

/* ---------- Scripts ---------- */
.scenario-list { display: flex; flex-direction: column; gap: 8px; }
.scenario { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; background: #fff; text-align: left; width: 100%; }
.scenario:hover { border-color: var(--primary); }
.scenario.active { border-color: var(--primary); background: var(--primary-soft); }
.scenario .num { width: 24px; height: 24px; border-radius: 7px; background: #eef1f6; color: var(--muted); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 24px; }
.scenario.active .num { background: var(--primary); color: #fff; }
.scenario strong { display: block; font-size: 12.5px; }
.scenario small { display: block; color: var(--muted); font-size: 10.5px; }

.script-box { background: #f8fafd; border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.script-box p { margin: 0 0 10px; font-size: 13px; line-height: 1.85; }
.script-box p:last-child { margin-bottom: 0; }
.script-meta { font-size: 11px; color: var(--muted); border-top: 1px dashed var(--border-strong); margin-top: 14px; padding-top: 10px; }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(18,28,48,.35); }
.modal-card { position: relative; background: #fff; border-radius: 16px; width: min(560px, calc(100vw - 32px)); padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 16px; }
.guide-steps { margin: 0; padding-left: 20px; }
.guide-steps li { margin-bottom: 10px; font-size: 12.5px; }
.guide-steps strong { display: block; }
.guide-steps span { color: var(--muted); font-size: 11.5px; }
code { font-family: var(--mono); background: #f1f3f8; padding: 1px 5px; border-radius: 4px; font-size: 11px; }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #1b2434; color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 12px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast[hidden] { display: none; }

@media (max-width: 820px) {
  .sidebar { width: 100%; height: auto; position: static; flex-basis: auto; }
  .app { flex-direction: column; }
  .nav { flex-direction: row; overflow-x: auto; padding: 10px; }
  .nav-item { flex: 0 0 auto; }
  .nav-text small, .sidebar-foot { display: none; }
  .topbar { padding: 0 18px; height: 70px; }
  .content { padding: 18px 16px 40px; }
  .form-row-row { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
}
