:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #18211e;
  --muted: #68736e;
  --line: #dfe5e2;
  --line-strong: #cad3cf;
  --accent: #087f66;
  --accent-dark: #056550;
  --accent-soft: #e7f4f0;
  --amber: #a65e06;
  --amber-soft: #fff3dd;
  --danger: #b42318;
  --danger-soft: #ffebe9;
  --shadow: 0 12px 32px rgba(24, 33, 30, .10);
  --sidebar: 248px;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}

* { box-sizing: border-box; letter-spacing: 0; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: wait; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 27px; }
h2 { margin: 0; font-size: 22px; line-height: 1.25; }
h3 { margin: 0; font-size: 18px; }
h4 { margin-bottom: 8px; font-size: 15px; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: 13px; }

.login-view { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: #edf1ef; }
.login-panel { width: min(400px, 100%); padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.brand-mark { width: 48px; height: 48px; margin-bottom: 22px; display: grid; place-items: center; overflow: hidden; color: white; background: #fff; border-radius: 8px; box-shadow: 0 0 0 1px rgba(24, 33, 30, .10); }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-mark svg { width: 25px; height: 25px; }
.brand-mark.small { width: 36px; height: 36px; margin: 0; }
.sidebar .brand-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
.brand-mark.small svg { width: 19px; }
.login-form { display: grid; gap: 18px; margin-top: 30px; }
.login-form label, .field { display: grid; gap: 7px; color: #3e4944; font-size: 13px; font-weight: 600; }
.field small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.45; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 10px 11px; outline: none; }
input, select { min-height: 40px; }
textarea { min-height: 108px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(8, 127, 102, .12); }
.form-error { min-height: 18px; margin: -4px 0 0; color: var(--danger); font-size: 13px; }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.nav-scrim { display: none; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; background: #202824; color: #eaf0ed; border-right: 1px solid #303a35; z-index: 30; }
.sidebar-brand { min-height: 76px; display: flex; align-items: center; gap: 12px; padding: 18px; border-bottom: 1px solid #35403a; }
.sidebar-brand > div:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.sidebar-brand strong { white-space: nowrap; font-size: 15px; }
.sidebar-brand span, .operator span { color: #9eaaa4; font-size: 12px; }
.main-nav { padding: 14px 10px; display: grid; align-content: start; gap: 12px; overflow-y: auto; }
.nav-group { display: grid; gap: 4px; }
.nav-group-label { padding: 0 12px 3px; color: #81918a; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.main-nav button { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 12px; color: #c7d0cc; background: transparent; border: 0; border-radius: 6px; text-align: left; }
.main-nav button:hover { color: white; background: #2b3530; }
.main-nav button.active { color: white; background: #087f66; }
.main-nav svg { width: 18px; height: 18px; flex: none; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 15px; border-top: 1px solid #35403a; }
.operator { min-width: 0; display: flex; align-items: center; gap: 9px; }
.operator > div { min-width: 0; display: grid; }
.operator strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.status-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #3ccf91; box-shadow: 0 0 0 3px rgba(60, 207, 145, .14); }

.workspace { min-width: 0; }
.topbar { min-height: 76px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 28px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.page-content { width: min(1460px, 100%); margin: 0 auto; padding: 26px 28px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin: 5px 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.config-route-card { margin: 0 0 18px; padding: 15px; background: #f8fbfa; border: 1px solid #cfe0d9; border-radius: 7px; }
.config-route-card > header { min-height: 35px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.config-route-card > header h4 { margin-bottom: 3px; color: var(--accent-dark); }
.config-route-card > header span { color: var(--muted); font-size: 12px; }
.config-route-card > header > svg { width: 20px; color: var(--accent); }
.config-route-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.config-route-link { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 10px; color: var(--ink); text-align: left; background: white; border: 1px solid #d7e3de; border-radius: 6px; }
.config-route-link:hover { border-color: var(--accent); background: #f0f8f5; }
.config-route-link > svg:first-child { width: 18px; color: var(--accent); flex: none; }
.config-route-link > svg:last-child { width: 14px; margin-left: auto; color: #8c9b95; flex: none; }
.config-route-link span { min-width: 0; display: grid; gap: 3px; }
.config-route-link strong, .config-route-link small { overflow-wrap: anywhere; }
.config-route-link strong { font-size: 12px; }
.config-route-link small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.settings-bot-picker { min-width: min(340px, 46vw); display: grid; grid-template-columns: auto minmax(190px, 1fr); align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; }
.settings-bot-picker select { min-height: 40px; }

.btn, .icon-btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 6px; }
.btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; font-weight: 600; }
.btn:hover, .icon-btn:hover { border-color: #9fada7; background: var(--surface-soft); }
.btn.primary { border-color: var(--accent); color: white; background: var(--accent); }
.btn.primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.btn.danger { color: var(--danger); border-color: #e9b7b1; background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn svg, .icon-btn svg { width: 17px; height: 17px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; color: inherit; flex: none; }
.btn:disabled, .icon-btn:disabled { opacity: .55; cursor: wait; }
.sidebar .icon-btn { border-color: transparent; color: #b7c1bc; background: transparent; }
.state-badge { min-height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.state-badge span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state-badge.ok { color: #087052; background: var(--accent-soft); }
.state-badge.warn { color: var(--amber); background: var(--amber-soft); }
.state-badge.neutral { color: #63706a; background: #edf0ef; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { min-width: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.stat-card header { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.stat-card header svg { width: 18px; color: var(--accent); }
.stat-card strong { display: block; margin-top: 12px; font-size: 28px; line-height: 1; overflow-wrap: anywhere; }
.stat-card small { display: block; margin-top: 8px; color: var(--muted); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); gap: 18px; align-items: start; }
.section-block { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.section-block > header { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.section-body { padding: 16px; }
.empty-state { min-height: 180px; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; }
.empty-state svg { width: 28px; margin-bottom: 10px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 10px 12px; color: var(--muted); background: var(--surface-soft); font-weight: 700; text-align: left; white-space: nowrap; }
td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #fbfcfb; }
.row-title { display: grid; gap: 3px; min-width: 150px; }
.row-title strong { font-size: 14px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.bot-action { width: 40px; height: 40px; border-width: 1px; }
.bot-action svg { width: 19px; height: 19px; stroke-width: 2.4; }
.bot-action-start { color: #087052; border-color: #9bd8c5; background: #e8f7f1; }
.bot-action-start:hover { color: #fff; border-color: #087052; background: #087052; }
.bot-action-stop, .bot-action-delete { color: #b42318; border-color: #e8b8b1; background: #fff0ee; }
.bot-action-stop:hover, .bot-action-delete:hover { color: #fff; border-color: #b42318; background: #b42318; }
.bot-action-restart { color: #8a5a00; border-color: #e5cc91; background: #fff8e5; }
.bot-action-restart:hover { color: #fff; border-color: #8a5a00; background: #8a5a00; }
.bot-action-settings { color: #17658a; border-color: #a9d0e2; background: #edf7fb; }
.bot-action-settings:hover { color: #fff; border-color: #17658a; background: #17658a; }
.bot-action-export { color: #315e9b; border-color: #b8cae6; background: #f0f5ff; }
.bot-action-export:hover { color: #fff; border-color: #315e9b; background: #315e9b; }
.bot-action-primary { color: #76521b; border-color: #e0c68f; background: #fff8e8; }
.bot-action-primary:hover { color: #fff; border-color: #76521b; background: #76521b; }
.bot-action-edit { color: #5b4d87; border-color: #cfc6e6; background: #f6f3ff; }
.bot-action-edit:hover { color: #fff; border-color: #5b4d87; background: #5b4d87; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 5px; color: #4e5a55; background: #edf1ef; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag.success { color: #087052; background: var(--accent-soft); }
.tag.warning { color: var(--amber); background: var(--amber-soft); }
.tag.danger { color: var(--danger); background: var(--danger-soft); }
.bot-identity { min-width: 180px; display: flex; align-items: center; gap: 10px; }
.bot-avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 6px; }
.bot-avatar svg { width: 18px; height: 18px; }
.bot-flags { display: flex; flex-wrap: wrap; gap: 5px; }
.runtime-state { min-width: 135px; display: flex; align-items: flex-start; gap: 8px; }
.runtime-state > div { min-width: 0; display: grid; gap: 3px; }
.runtime-state strong { font-size: 13px; }
.runtime-dot { width: 9px; height: 9px; margin-top: 4px; flex: none; border-radius: 50%; background: #98a39e; }
.runtime-dot.running { background: #1ca66f; box-shadow: 0 0 0 4px rgba(28, 166, 111, .12); }
.runtime-dot.starting { background: #c17a12; box-shadow: 0 0 0 4px rgba(193, 122, 18, .12); animation: runtime-pulse 1.4s ease-in-out infinite; }
.runtime-dot.warning { background: #c17a12; box-shadow: 0 0 0 4px rgba(193, 122, 18, .12); }
.runtime-dot.error { background: var(--danger); box-shadow: 0 0 0 4px rgba(180, 35, 24, .10); }
.runtime-error { max-width: 220px; overflow: hidden; color: var(--danger); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.live-indicator { display: inline-flex; align-items: center; gap: 6px; color: #087052; font-size: 12px; font-weight: 700; }
.live-indicator > span { width: 7px; height: 7px; border-radius: 50%; background: #1ca66f; box-shadow: 0 0 0 4px rgba(28, 166, 111, .12); }
.token-field { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 7px; }
.token-field .icon-btn { width: 40px; height: 40px; }
@keyframes runtime-pulse { 50% { opacity: .45; } }
.list-rows { display: grid; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:first-child { padding-top: 0; }
.list-row:last-child { padding-bottom: 0; border-bottom: 0; }
.list-row > div { min-width: 0; }
.list-row strong, .list-row span { display: block; overflow-wrap: anywhere; }
.list-row span { margin-top: 3px; color: var(--muted); font-size: 12px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.form-footer .footer-spacer { flex: 1 1 20px; }
.export-config { color: var(--accent-dark); border-color: #9fd6c8; background: var(--accent-soft); }
.sensitive-note { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 9px 11px; color: #73500d; background: var(--amber-soft); border: 1px solid #ead8a8; border-radius: 6px; font-size: 12px; }
.sensitive-note svg { width: 18px; flex: none; }
.switch-field { min-height: 40px; display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; }
.switch-field input { width: 17px; min-height: 17px; accent-color: var(--accent); }
.share-card-config { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.share-card-config > header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.share-card-config > header > div { min-width: 0; display: grid; gap: 3px; }
.share-card-config h5 { font-size: 15px; }
.share-card-controls { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(190px, 1.2fr) minmax(140px, .7fr) minmax(130px, .6fr); gap: 12px; align-items: end; margin-bottom: 12px; padding: 12px; background: #f5f8f6; border: 1px solid var(--line); border-radius: 7px; }
.share-card-controls .switch-field { align-self: center; }
.share-card-editor-layout { margin-top: 14px; }
.share-card-preview { min-height: 280px; }
.share-card-preview .share-target-preview { margin-top: 8px; }
.referral-profile-config { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.referral-profile-config > header { display: grid; gap: 3px; margin-bottom: 12px; }
.referral-profile-config h5 { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.referral-profile-config h5 svg { width: 18px; color: var(--accent-dark); }
.profile-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-rule-option { min-width: 0; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf9; cursor: pointer; }
.profile-rule-option input { width: 17px; min-height: 17px; margin-top: 2px; accent-color: var(--accent); }
.profile-rule-option span { min-width: 0; display: grid; gap: 3px; }
.profile-rule-option strong { font-size: 13px; }
.profile-rule-option small { color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.profile-bio-option { border-color: #9fd6c8; background: var(--accent-soft); }
.profile-rule-summary { margin-top: 10px; padding: 9px 11px; color: #285649; background: #f2f7f4; border-left: 3px solid var(--accent); font-size: 12px; line-height: 1.55; }
.target-config { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.target-config > header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.target-config > header > div { min-width: 0; display: grid; gap: 2px; }
.target-config h5 { font-size: 15px; }
.target-list { display: grid; gap: 12px; }
.target-editor { min-width: 0; overflow: hidden; background: #f8faf9; border: 1px solid #cbd8d2; border-radius: 7px; }
.target-editor-head { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; background: white; border-bottom: 1px solid var(--line); }
.target-editor-head > div:first-child { min-width: 0; display: grid; gap: 2px; }
.target-editor-head strong, .target-editor-head span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-head-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.target-head-actions .icon-btn { width: 34px; height: 34px; color: var(--danger); border-color: #edc2bc; background: var(--danger-soft); }
.target-primary { display: flex; align-items: center; gap: 6px; color: var(--accent-dark); font-size: 12px; font-weight: 700; white-space: nowrap; }
.target-primary input { width: 16px; min-height: 16px; accent-color: var(--accent); }
.target-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.target-stats span { min-width: 0; padding: 9px 12px; color: var(--muted); border-right: 1px solid var(--line); font-size: 11px; }
.target-stats span:last-child { border-right: 0; }
.target-stats strong { display: block; margin-top: 2px; color: var(--ink); font-size: 17px; }
.target-fields { display: grid; grid-template-columns: minmax(170px, .8fr) minmax(180px, 1fr); gap: 12px; padding: 12px; }
.target-url { grid-column: 1 / -1; }
.target-active { align-self: end; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: #e9eeeb; border-radius: 7px; }
.segmented button { min-height: 30px; padding: 0 11px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.segmented button.active { color: var(--ink); background: white; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.search-box { width: min(320px, 100%); position: relative; }
.search-box svg { position: absolute; left: 10px; top: 11px; width: 17px; color: var(--muted); }
.search-box input { padding-left: 35px; }
.detail-link { display: inline-flex; align-items: center; gap: 3px; padding: 3px 0; color: var(--accent); background: transparent; border: 0; font-weight: 700; }
.detail-link svg { width: 15px; }
.detail-link:disabled { color: var(--muted); cursor: default; }
.capture-strip { display: grid; gap: 7px; margin: -10px 0 18px; }
.capture-strip > div { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 8px 11px; background: var(--amber-soft); border: 1px solid #ead8a8; border-radius: 6px; }
.capture-strip > div > span:not(.status-dot) { color: var(--muted); font-size: 12px; }
.capture-strip .icon-btn { margin-left: auto; }
.status-dot { width: 8px; height: 8px; flex: none; background: var(--amber); border-radius: 50%; }

.menu-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.telegram-preview { position: sticky; top: 100px; min-width: 0; background: #dce8e4; border: 1px solid #bdccc6; border-radius: 8px; overflow: hidden; }
.preview-head { padding: 12px 14px; color: white; background: #52796c; }
.preview-head strong, .preview-head span { display: block; }
.preview-head span { margin-top: 2px; font-size: 11px; opacity: .8; }
.preview-chat { min-height: 390px; display: flex; align-items: flex-end; padding: 18px 12px; }
.bot-bubble { width: 100%; padding: 11px; background: white; border-radius: 7px; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.bot-bubble > p { margin: 0 0 12px; font-size: 13px; line-height: 1.5; }
.keyboard-preview { display: grid; gap: 4px; }
.keyboard-row { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: 4px; }
.keyboard-button { min-height: 34px; display: flex; align-items: center; justify-content: center; padding: 5px; color: #18638b; background: #edf5f7; border: 1px solid #d8e9ed; border-radius: 5px; font-size: 12px; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.keyboard-button.color-blue { color: white; background: #2481cc; border-color: #2481cc; }
.keyboard-button.color-green { color: white; background: #31a85b; border-color: #31a85b; }
.keyboard-button.color-red { color: white; background: #d24b4b; border-color: #d24b4b; }
.keyboard-button svg { width: 13px; height: 13px; margin-right: 3px; }
.color-label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.color-label > span { width: 10px; height: 10px; display: inline-block; background: #b7c4bf; border-radius: 50%; }
.color-label.color-blue > span { background: #2481cc; }
.color-label.color-green > span { background: #31a85b; }
.color-label.color-red > span { background: #d24b4b; }
.inline-icon { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; color: var(--accent); }

.welcome-config-form { display: grid; gap: 18px; margin: 0 0 18px; }
.main-message-section { overflow: hidden; }
.welcome-method { width: min(360px, 100%); margin-bottom: 16px; }
.main-menu-editor-layout { grid-template-columns: minmax(0, 1.45fr) minmax(290px, .55fr); }
.main-menu-preview { top: 92px; }
.main-menu-preview [data-message-preview] { padding-top: 14px; }
.menu-message-keyboard { margin-top: 10px; }
.welcome-flow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.welcome-flow-grid .section-block { height: 100%; }
.welcome-subsection { display: grid; gap: 9px; }
.welcome-subsection + .welcome-subsection { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.welcome-subsection > strong { font-size: 13px; }
.welcome-template-list, .welcome-target-list { display: grid; gap: 7px; max-height: 330px; overflow: auto; padding-right: 3px; }
.welcome-template-option { min-width: 0; min-height: 48px; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px 10px; background: #f7faf8; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.welcome-template-option:hover { border-color: #9bcabc; background: #f1f8f5; }
.welcome-template-option input { width: 16px; min-height: 16px; accent-color: var(--accent); }
.welcome-template-option > span { min-width: 0; display: grid; gap: 2px; }
.welcome-template-option strong, .welcome-template-option small { overflow-wrap: anywhere; }
.welcome-template-option strong { font-size: 13px; }
.welcome-template-option small { color: var(--muted); font-size: 11px; }
.welcome-config-actions { min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.reward-welcome-section { overflow: hidden; }
.reward-welcome-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .65fr); align-items: center; gap: 16px; }
.reward-welcome-summary .telegram-preview { position: static; border-radius: 7px; }
.reward-welcome-summary .preview-chat { min-height: 0; padding: 12px; }
.reward-welcome-summary .bot-bubble { background: #fff; }
.reward-welcome-summary .muted { line-height: 1.6; }
.reward-welcome-summary code { padding: 2px 4px; color: var(--accent-dark); background: var(--accent-soft); border-radius: 3px; }
.menu-button-section { overflow: hidden; }
.inline-mode-status { min-height: 58px; display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 11px 13px; border: 1px solid; border-radius: 7px; }
.inline-mode-status > svg { width: 20px; flex: none; margin-top: 1px; }
.inline-mode-status > div { min-width: 0; display: grid; gap: 3px; }
.inline-mode-status strong { font-size: 13px; }
.inline-mode-status span { color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.inline-mode-status.ready { color: #087052; background: var(--accent-soft); border-color: #a8d7ca; }
.inline-mode-status.pending { color: #8a5a00; background: var(--amber-soft); border-color: #e5cc91; }
.menu-action-editor { min-height: 116px; font-family: Consolas, "Microsoft YaHei", sans-serif; }
.system-reply-controls { min-width: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.system-reply-controls-head { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.system-reply-controls-head .switch-field { min-width: 0; }
.system-reply-editor { min-width: 0; margin-top: 12px; padding: 16px; background: #f7faf8; border: 1px solid #c8d8d2; border-radius: 7px; }
.system-reply-editor-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); align-items: end; gap: 14px; margin-bottom: 15px; }
.system-reply-editor-head > div { min-width: 0; display: grid; gap: 4px; align-self: center; }
.system-reply-editor-head strong { font-size: 14px; }
.system-reply-editor-head span { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.system-reply-editor-layout { grid-template-columns: minmax(0, 1.5fr) minmax(250px, .5fr); }
.system-reply-preview { min-height: 280px; }

.bottom-layout { grid-template-columns: minmax(0, 1fr) 340px; }
.bottom-module-panel { overflow: hidden; }
.module-catalog > header h4 { margin-bottom: 2px; }
.module-catalog > header b { color: var(--accent-dark); }
.module-catalog-body { min-width: 0; }
.module-list-group + .module-list-group { border-top: 1px solid var(--line); }
.module-list-group > header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; color: #4f625b; background: #f5f8f7; border-bottom: 1px solid var(--line); font-size: 12px; }
.module-list-group > header > div { display: flex; align-items: center; gap: 8px; }
.module-list-group > header svg { width: 16px; height: 16px; color: var(--accent); }
.module-list-group > header > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.module-list { min-width: 0; }
.module-row { min-width: 0; min-height: 72px; display: grid; grid-template-columns: 36px minmax(220px, 1fr) minmax(170px, .65fr) auto; align-items: center; gap: 12px; padding: 11px 16px; background: #fff; }
.module-row + .module-row { border-top: 1px solid #e5ebe8; }
.module-row-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--accent-dark); background: var(--accent-soft); border-radius: 6px; }
.module-row-paused .module-row-icon { color: #875a00; background: var(--amber-soft); }
.module-row-unbound .module-row-icon { color: #65746e; background: #edf1ef; }
.module-row-icon svg { width: 17px; height: 17px; }
.module-row-copy { min-width: 0; display: grid; gap: 3px; }
.module-row-copy > strong { font-size: 13px; }
.module-row-copy > small { color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.module-row-status { min-width: 0; display: grid; grid-template-columns: 8px minmax(0, 1fr); align-items: center; gap: 7px; font-size: 11px; }
.module-row-status > span { width: 8px; height: 8px; background: #87938e; border-radius: 50%; }
.module-row-status > div { min-width: 0; display: grid; gap: 2px; }
.module-row-status strong { white-space: nowrap; }
.module-row-status small { color: var(--muted); overflow-wrap: anywhere; }
.module-state-bound { color: #087052; }
.module-state-bound > span { background: #13a47d; }
.module-state-paused { color: #8a5a00; }
.module-state-paused > span { background: var(--amber); }
.module-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.module-row-actions .btn { min-width: 108px; padding: 0 10px; font-size: 12px; }
.module-row-actions .btn svg, .module-row-actions .icon-btn svg { width: 15px; height: 15px; }
.module-row-actions .icon-btn { width: 34px; height: 34px; }
.compact-grid { gap: 10px; }
.bottom-rows { display: grid; gap: 12px; margin-top: 18px; }
.bottom-row-editor { padding: 12px; background: #f7faf8; border: 1px solid var(--line); border-radius: 7px; }
.bottom-row-head, .bottom-button-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bottom-row-head { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.bottom-row-head strong { font-size: 13px; }
.bottom-button-list { display: grid; gap: 9px; padding-top: 10px; }
.bottom-button-editor { padding: 10px; background: white; border: 1px solid #cbd8d2; border-radius: 6px; }
.bottom-button-head { min-height: 28px; margin-bottom: 9px; }
.bottom-button-head strong { color: var(--accent-dark); font-size: 12px; }
.bottom-button-head .switch-field { min-height: 28px; margin-left: auto; color: var(--muted); font-size: 11px; }
.bottom-button-head .icon-btn { width: 30px; height: 30px; color: var(--danger); border-color: #edc2bc; background: var(--danger-soft); }
.empty-inline { padding: 13px; color: var(--muted); background: #f1f5f3; border: 1px dashed #cbd7d1; border-radius: 5px; font-size: 12px; text-align: center; }
.bottom-preview .preview-chat { min-height: 430px; align-items: flex-end; }
.bottom-chat-frame { width: 100%; }
.bottom-input-preview { min-height: 35px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 0 10px; color: #8a9691; background: white; border-radius: 6px; font-size: 12px; }
.bottom-input-preview svg { width: 15px; }
.bottom-color-default { color: #394944; background: #d8d5d5; border-color: #d8d5d5; }
.bottom-color-blue { color: white; background: #2481cc; border-color: #2481cc; }
.bottom-color-green { color: white; background: #31a85b; border-color: #31a85b; }
.bottom-color-red { color: white; background: #d24b4b; border-color: #d24b4b; }
.bottom-layout .settings-bot-picker { margin-left: auto; }
.bottom-layout .section-block > header h4 { margin-bottom: 2px; }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 18px; }
.editor-fields { display: grid; gap: 14px; }
.content-mode-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px; background: #eef3f1; border: 1px solid #d4dfda; border-radius: 7px; }
.content-mode-switch button { min-width: 0; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 9px; color: #4f625b; background: transparent; border: 1px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 800; line-height: 1.25; }
.content-mode-switch button:hover { color: #0d6d57; background: #f8fbfa; border-color: #bed2ca; }
.content-mode-switch button.active { color: white; background: #177f67; border-color: #177f67; box-shadow: 0 1px 3px rgba(16, 72, 58, .16); }
.content-mode-switch svg { width: 16px; height: 16px; flex: none; }
.media-source-field { padding: 12px; background: #f4f8f6; border: 1px solid #c9d8d2; border-radius: 6px; }
.message-preview { position: sticky; top: 0; min-height: 320px; max-height: calc(100dvh - 170px); align-self: start; overflow: auto; padding: 18px; background: #dce8e4; border: 1px solid #bdccc6; border-radius: 8px; }
.message-preview .bot-bubble { width: min(360px, 100%); }
.preview-media { width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; margin-bottom: 9px; color: #66736d; background: #dce3e0; border-radius: 5px; overflow: hidden; }
.preview-media img { width: 100%; height: 100%; object-fit: cover; }
.preview-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; }
.inline-button-editor { display: grid; gap: 8px; }
.inline-keyboard-rows { display: grid; gap: 10px; }
.inline-keyboard-row { display: grid; gap: 8px; padding: 10px; background: #f5f7f6; border: 1px solid var(--line); border-radius: 6px; }
.inline-button-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(115px, .7fr) minmax(150px, 1.25fr) minmax(125px, .85fr) 92px 34px; gap: 7px; align-items: end; }
.inline-button-row .compact input, .inline-button-row .compact select { min-width: 0; }
.inline-row-actions { display: flex; align-items: center; gap: 7px; }
.format-panel { margin: 7px 0 9px; overflow: hidden; background: #f8faf9; border: 1px solid #ccd9d4; border-radius: 6px; }
.format-panel-head { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; color: #165d4d; border-bottom: 1px solid #d8e2de; }
.format-button-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 10px; }
.format-button-grid button { min-width: 0; min-height: 38px; padding: 7px 8px; color: var(--ink); background: #edf4f7; border: 1px solid #cbdce5; border-radius: 5px; font-size: 12px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.format-button-grid button:hover { color: #0e6753; background: #e6f3ef; border-color: var(--accent); }
.advanced-format-toggle { min-height: 34px; margin: 0 10px 8px; padding: 6px 8px; color: #426056; background: #eef7f4; border-radius: 5px; font-size: 11px; }
.advanced-format-toggle input { width: 15px; min-height: 15px; }
.advanced-formats { border-top: 1px dashed #cbd8d3; }
.advanced-formats > summary { width: max-content; margin: 10px; padding: 7px 10px; color: #12624f; background: white; border: 1px solid #c8d8d2; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 800; list-style: none; }
.advanced-formats > summary::-webkit-details-marker { display: none; }
.advanced-formats > summary::after { content: "+"; margin-left: 7px; }
.advanced-formats[open] > summary::after { content: "-"; }
.format-group { border-top: 1px solid #e1e8e5; }
.format-group > span { display: block; padding: 9px 11px 0; color: var(--muted); font-size: 11px; font-weight: 800; }
.format-configurator { margin: 0 10px 10px; padding: 11px; background: white; border: 1px solid #b8cec5; border-radius: 6px; box-shadow: 0 5px 18px rgba(18, 59, 47, .08); }
.format-configurator > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.format-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.format-config-grid .format-wide { grid-column: 1 / -1; }
.format-config-grid textarea { min-height: 86px; }
.format-check { align-self: end; min-height: 42px; }
.format-config-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 11px; }
.rich-content-editor { min-height: 260px; font: 13px/1.6 Consolas, "Microsoft YaHei", sans-serif; }
.rich-blocks-editor { min-height: 310px; }
.rich-media-definitions { width: 100%; }
.rich-media-definitions .field { padding: 5px 2px 2px; }
.blocks-preview { max-height: 330px; margin: 0; overflow: auto; white-space: pre-wrap; font: 11px/1.45 Consolas, monospace; }
.rich-preview a { color: #1677a8; text-decoration: underline; }
.rich-preview tg-spoiler { padding: 0 2px; color: transparent; background: #6f7c77; border-radius: 2px; }
.rich-preview tg-spoiler:hover { color: inherit; background: #d9e1de; }
.rich-preview tg-emoji { display: inline-block; min-width: 1em; }
.rich-preview tg-time { padding: 0 2px; color: #0d6d57; background: #e2f2ec; border-radius: 3px; }
.rich-preview mark { padding: 0 2px; background: #ffe583; }
.rich-preview h1, .rich-preview h2, .rich-preview h3, .rich-preview h4, .rich-preview h5, .rich-preview h6 { margin: 12px 0 6px; letter-spacing: 0; line-height: 1.25; }
.rich-preview h1 { font-size: 22px; } .rich-preview h2 { font-size: 20px; } .rich-preview h3 { font-size: 18px; }
.rich-preview h4 { font-size: 16px; } .rich-preview h5 { font-size: 14px; } .rich-preview h6 { font-size: 13px; }
.rich-preview p { margin: 6px 0; }
.rich-preview pre { max-width: 100%; overflow-x: auto; padding: 8px; background: #edf1ef; border-radius: 4px; white-space: pre-wrap; }
.rich-preview blockquote { margin: 8px 0; padding: 7px 9px; background: #edf7f3; border-left: 3px solid #36a184; }
.rich-preview aside { margin: 10px 14px; padding: 9px; text-align: center; background: #f6f1e3; border-top: 1px solid #d7c99e; border-bottom: 1px solid #d7c99e; }
.rich-preview cite { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-style: italic; }
.rich-preview footer { margin-top: 10px; padding-top: 7px; color: var(--muted); border-top: 1px solid #d4dfda; font-size: 11px; }
.rich-preview hr { margin: 11px 0; border: 0; border-top: 1px solid #bdcac5; }
.rich-preview ul, .rich-preview ol { margin: 7px 0; padding-left: 23px; }
.rich-preview input[type="checkbox"] { width: 14px; height: 14px; margin: 0 6px 0 0; vertical-align: -2px; }
.rich-preview details { margin: 8px 0; padding: 7px 9px; background: #f3f6f5; border: 1px solid #d5dfdb; border-radius: 5px; }
.rich-preview summary { cursor: pointer; font-weight: 800; }
.rich-preview table { width: 100%; display: block; overflow-x: auto; margin: 8px 0; border-collapse: collapse; white-space: normal; }
.rich-preview caption { padding: 5px; font-weight: 800; text-align: left; }
.rich-preview th, .rich-preview td { min-width: 72px; padding: 5px 7px; border: 1px solid #c9d4cf; text-align: left; }
.rich-preview table[striped] tr:nth-child(even) { background: #f1f5f3; }
.rich-preview img, .rich-preview video, .rich-preview audio { max-width: 100%; margin: 6px 0; border-radius: 4px; }
.rich-preview figure { margin: 9px 0; }
.rich-preview figcaption { color: var(--muted); font-size: 11px; }
.rich-preview tg-map { display: grid; min-height: 84px; place-items: center; margin: 8px 0; color: #2b6255; background: #d9ebe5; border: 1px solid #bdd5cd; border-radius: 5px; }
.rich-preview tg-collage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 8px 0; }
.rich-preview tg-collage figcaption, .rich-preview tg-slideshow figcaption { grid-column: 1 / -1; }
.rich-preview tg-slideshow { display: block; margin: 8px 0; }
.rich-preview tg-slideshow img:not(:first-of-type), .rich-preview tg-slideshow video:not(:first-of-type) { display: none; }
.rich-preview tg-math, .rich-preview tg-math-block { font-family: Cambria Math, "Times New Roman", serif; }
.rich-preview tg-math-block { display: block; margin: 8px 0; padding: 9px; text-align: center; background: #f4f2ea; }
.entity-editor { min-height: 125px; font: 12px/1.5 Consolas, monospace; white-space: pre; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; }
.capture-source { display: flex; align-items: center; gap: 8px; margin-top: 13px; padding: 9px 11px; color: #11634f; background: var(--accent-soft); border: 1px solid #b9ddd3; border-radius: 6px; font-size: 12px; }
.capture-source svg { width: 17px; flex: none; }
.random-text-editor { margin-top: 18px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.random-text-editor > header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.random-text-editor > header > div { min-width: 0; display: grid; gap: 3px; }
.random-text-editor > header strong { font-size: 13px; }
.random-text-editor > header span { color: var(--muted); font-size: 11px; }
.random-text-list { display: grid; gap: 9px; padding: 12px; }
.random-text-list:empty { display: none; }
.random-text-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 38px; align-items: start; gap: 8px; }
.random-text-row textarea { min-height: 82px; }
.random-text-index { width: 28px; height: 28px; display: grid; place-items: center; margin-top: 6px; color: var(--muted); background: #edf1ef; border-radius: 5px; font-size: 11px; font-weight: 800; }
.random-text-row .icon-btn { margin-top: 1px; }
.source-json { margin-top: 8px; }
.source-json summary { padding: 7px 2px; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; }
.source-json .code-editor { width: 100%; min-height: 220px; margin-top: 6px; }
.capture-state { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.capture-state h4 { margin: 15px 0 8px; font-size: 20px; }
.capture-state p { margin: 14px 0 0; color: var(--muted); }
.capture-state .form-footer { width: 100%; justify-content: center; }
.capture-icon { width: 58px; height: 58px; display: grid; place-items: center; color: var(--amber); background: var(--amber-soft); border-radius: 50%; }
.capture-icon.success { color: var(--accent); background: var(--accent-soft); }
.capture-icon svg { width: 27px; }
.referral-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 180px)); gap: 10px; margin-bottom: 16px; }
.referral-summary > div { padding: 13px; background: #f4f7f5; border: 1px solid var(--line); border-radius: 6px; }
.referral-summary span, .referral-summary strong { display: block; }
.referral-summary span { color: var(--muted); font-size: 12px; }
.referral-summary strong { margin-top: 4px; font-size: 22px; }
.code-editor { min-height: 330px; font: 13px/1.55 Consolas, monospace; white-space: pre; }

.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(14, 20, 17, .56); }
.modal-panel { position: relative; width: min(960px, 100%); max-height: calc(100dvh - 40px); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; background: var(--surface); border-radius: 8px; box-shadow: 0 24px 64px rgba(0,0,0,.28); }
.modal-panel.wide { width: min(1180px, 100%); }
.modal-panel > header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.modal-body { overflow-y: auto; padding: 20px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; width: min(360px, calc(100% - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; color: white; background: #27312c; border-radius: 6px; box-shadow: var(--shadow); }
.toast.error { background: #8f241b; }
.toast svg { width: 18px; flex: none; }

@media (max-width: 1080px) {
  .config-route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .menu-layout, .editor-layout { grid-template-columns: 1fr; }
  .inline-button-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-button-row .inline-value { grid-column: 1 / -1; }
  .inline-button-row > .icon-btn { align-self: end; }
  .telegram-preview { position: static; }
  .message-preview { position: static; max-height: none; }
  .preview-chat { min-height: 300px; }
  .main-menu-editor-layout, .welcome-flow-grid { grid-template-columns: 1fr; }
  .share-card-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .config-route-grid { grid-template-columns: 1fr; }
  .config-route-card { padding: 12px; }
  .mobile-only { display: inline-grid !important; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(290px, 88vw); transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .nav-scrim { position: fixed; inset: 0; z-index: 25; display: none; background: rgba(14,20,17,.48); }
  .nav-scrim.open { display: block; }
  .sidebar-brand .mobile-only { margin-left: auto; }
  .topbar { min-height: 68px; padding: 11px 14px; }
  .topbar > div:nth-child(2) { min-width: 0; flex: 1; }
  .topbar h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 19px; }
  .topbar .eyebrow { display: none; }
  .page-content { padding: 18px 14px 46px; }
  .page-head { align-items: flex-start; }
  .page-head p { font-size: 13px; }
  .state-badge { max-width: 105px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 23px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .target-fields { grid-template-columns: 1fr; }
  .target-url { grid-column: auto; }
  .target-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .target-stats span:nth-child(2) { border-right: 0; }
  .target-stats span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .modal-root { padding: 0; place-items: end center; }
  .modal-panel { width: 100%; max-height: 92dvh; border-radius: 8px 8px 0 0; }
  .modal-body { padding: 16px 14px 28px; }
  .inline-button-row { grid-template-columns: 1fr 1fr; }
  .inline-button-row .inline-value, .inline-button-row .compact:first-of-type { grid-column: 1 / -1; }
  .bottom-row-head { align-items: flex-start; flex-direction: column; }
  .bottom-row-head .inline-row-actions { width: 100%; }
  .bottom-row-head .inline-row-actions .btn { flex: 1; }
  .bottom-layout .settings-bot-picker { width: 100%; margin: 0; }
  .module-catalog > header { align-items: flex-start; flex-direction: column; }
  .module-catalog > header .btn { width: 100%; }
  .module-row { grid-template-columns: 34px minmax(0, 1fr); gap: 8px 10px; padding: 12px 14px; }
  .module-row-status, .module-row-actions { grid-column: 2; }
  .module-row-actions { justify-content: flex-start; }
  .capture-strip > div { flex-wrap: wrap; }
  .form-footer .export-config { width: 100%; }
  .form-footer .footer-spacer { display: none; }
  .random-text-editor > header { align-items: flex-start; }
  .format-button-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; }
  .format-config-grid { grid-template-columns: 1fr; }
  .format-config-grid .format-wide { grid-column: auto; }
  .format-config-actions .btn { flex: 1; }
  .referral-summary { grid-template-columns: 1fr 1fr; }
  .welcome-config-actions { position: static; margin: 0; box-shadow: none; }
  .welcome-config-actions .btn { flex: 1 1 180px; }
  .main-message-section > header, .reward-welcome-section > header, .welcome-flow-grid .section-block > header { align-items: flex-start; flex-direction: column; }
  .system-reply-controls-head { align-items: flex-start; flex-direction: column; }
  .system-reply-editor { padding: 12px; }
  .system-reply-editor-head { grid-template-columns: 1fr; align-items: stretch; }
  .main-message-section > header .switch-field, .reward-welcome-section > header .switch-field, .welcome-flow-grid .section-block > header .switch-field { width: 100%; }
  .reward-welcome-summary { grid-template-columns: 1fr; }
  .welcome-template-list, .welcome-target-list { max-height: none; }
  .menu-layout table th:nth-child(3),
  .menu-layout table td:nth-child(3),
  .menu-layout table th:nth-child(4),
  .menu-layout table td:nth-child(4) { display: none; }
  .menu-layout table th,
  .menu-layout table td { padding-left: 9px; padding-right: 9px; }
  .menu-button-section table { min-width: 560px; }
  .menu-button-section table th:nth-child(3),
  .menu-button-section table td:nth-child(3),
  .menu-button-section table th:nth-child(4),
  .menu-button-section table td:nth-child(4) { display: none; }
  .menu-button-section th:nth-child(1),
  .menu-button-section td:nth-child(1),
  .menu-button-section th:nth-child(2),
  .menu-button-section td:nth-child(2),
  .menu-button-section th:nth-child(5),
  .menu-button-section td:nth-child(5),
  .menu-button-section th:nth-child(6),
  .menu-button-section td:nth-child(6) { white-space: nowrap; }
  .side-menu-table th:nth-child(1), .side-menu-table td:nth-child(1) { width: 72px; }
  .side-menu-table { table-layout: fixed; }
  .side-menu-table th:nth-child(2), .side-menu-table td:nth-child(2) { width: 144px; }
  .side-menu-table th:nth-child(3), .side-menu-table td:nth-child(3) { display: none; }
  .side-menu-table th:nth-child(4), .side-menu-table td:nth-child(4) { width: 62px; }
  .side-menu-table th:nth-child(5), .side-menu-table td:nth-child(5) { width: 84px; min-width: 84px; padding-left: 4px; padding-right: 4px; }
  .side-menu-table td:nth-child(5) .row-actions { gap: 3px; }
  .side-menu-table td:nth-child(5) .icon-btn { width: 34px; height: 34px; }
  .side-menu-table td:nth-child(2) { word-break: keep-all; overflow-wrap: anywhere; }
  .side-menu-table td:nth-child(2) strong, .side-menu-table td:nth-child(2) .muted { max-width: 126px; overflow-wrap: anywhere; }
}

@media (max-width: 430px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-head { display: grid; }
  .page-actions { width: 100%; }
  .settings-bot-picker { width: 100%; min-width: 0; grid-template-columns: 1fr; gap: 6px; }
  .page-actions .btn { flex: 1; }
  .target-config > header, .target-editor-head, .share-card-config > header { align-items: flex-start; }
  .share-card-config > header { flex-direction: column; }
  .share-card-controls { grid-template-columns: 1fr; }
  .profile-rule-grid { grid-template-columns: 1fr; }
  .target-config > header { flex-direction: column; }
  .target-config > header .btn { width: 100%; }
  .target-editor-head { display: grid; }
  .target-head-actions { width: 100%; justify-content: space-between; }
  .login-panel { padding: 25px 20px; }
  .welcome-config-actions { padding: 10px; }
  .welcome-config-actions .btn { width: 100%; flex-basis: 100%; }
}

.nav-count { min-width: 22px; height: 22px; margin-left: auto; display: inline-grid; place-items: center; padding: 0 6px; color: #fff; background: #d64545; border-radius: 11px; font-size: 11px; font-weight: 800; }
.telegram-custom-emoji { width: 1.28em; height: 1.28em; display: inline-grid; vertical-align: -.28em; line-height: 1; }
.telegram-custom-emoji > img, .telegram-custom-emoji > span { width: 100%; height: 100%; grid-area: 1 / 1; }
.telegram-custom-emoji > img { position: relative; z-index: 1; object-fit: contain; }
.telegram-custom-emoji > span { display: grid; place-items: center; font-size: .92em; overflow: hidden; }
.keyboard-button .telegram-custom-emoji { margin-right: 4px; flex: none; }

.media-upload-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.media-upload-control .btn { white-space: nowrap; }
.editor-source-bar { min-height: 50px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 12px; padding: 9px 11px; color: #345149; background: #eef7f4; border: 1px solid #b9d8cf; border-radius: 7px; }
.editor-source-bar > svg { width: 18px; color: var(--accent); flex: none; }
.editor-source-bar > label { min-width: min(320px, 100%); display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.editor-source-bar select { min-height: 34px; padding: 6px 9px; }
.editor-source-bar > span { color: var(--muted); font-size: 11px; }
.entity-json-guide { padding: 0; overflow: hidden; }
.entity-json-guide > summary { padding: 11px 12px; color: #315f53; background: #eef7f4; font-weight: 700; cursor: pointer; }
.entity-guide-copy { display: grid; gap: 6px; padding: 12px; color: var(--muted); background: #fafcfb; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.55; }
.entity-guide-copy code { padding: 7px 8px; overflow-x: auto; color: #34423d; background: #eef1ef; border-radius: 5px; white-space: nowrap; }
.entity-json-guide > .field { padding: 12px 12px 0; }
.entity-json-actions { display: flex; justify-content: flex-end; gap: 7px; padding: 8px 12px 12px; }
.preview-media img, .preview-media video { width: 100%; max-height: 260px; display: block; object-fit: contain; background: #edf2f0; border-radius: 6px; }
.preview-file { min-height: 72px; display: flex; align-items: center; gap: 9px; padding: 12px; color: var(--muted); background: #eef2f0; border-radius: 6px; overflow-wrap: anywhere; }

.schedule-capture-panel, .schedule-target-panel, .schedule-rotation-panel { margin-top: 18px; padding: 14px; background: #f8faf9; border: 1px solid var(--line); border-radius: 7px; }
.group-mention-guide { background: #eef8f5; border-color: #b8dcd2; }
.group-mention-guide > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.group-mention-guide > header > div { display: grid; gap: 4px; min-width: 0; }
.group-mention-guide code { color: var(--accent-dark); font-weight: 700; }
.group-mention-cleanup-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, 210px) minmax(260px, 1fr) auto auto; gap: 10px; align-items: end; margin-top: 14px; padding: 12px; background: rgba(255,255,255,.78); border: 1px solid var(--line); border-radius: 7px; }
.group-mention-cleanup-form .switch-field { min-height: 42px; }
.group-mention-cleanup-form .field { margin: 0; }
.group-mention-targets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.group-mention-target { min-width: 150px; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 0 7px; align-items: center; padding: 9px 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.group-mention-target i { grid-row: span 2; color: var(--accent); }
.group-mention-target strong, .group-mention-target small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-mention-target small { color: var(--muted); }
.schedule-target-summary { display: grid; gap: 5px; min-width: 190px; max-width: 320px; }
.schedule-target-chip { min-width: 0; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 0 5px; align-items: center; padding: 5px 7px; background: #f4f8f7; border: 1px solid var(--line); border-radius: 5px; }
.schedule-target-chip i { grid-row: span 2; color: var(--accent); width: 14px; height: 14px; }
.schedule-target-chip strong, .schedule-target-chip small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-target-chip small { color: var(--muted); font-size: 10px; }
.schedule-target-chip code { font-size: 10px; }
.schedule-capture-panel { background: #eef8f5; border-color: #b8dcd2; }
.schedule-rotation-panel { background: #fff; }
.schedule-capture-panel > header, .schedule-target-panel > header, .schedule-rotation-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.schedule-capture-panel > header > div, .schedule-target-panel > header > div, .schedule-rotation-panel > header > div { display: grid; gap: 3px; }
.schedule-capture-panel > header span, .schedule-target-panel > header span, .schedule-rotation-panel > header span, .broadcast-note span { color: var(--muted); font-size: 12px; }
.schedule-capture-controls { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 10px; align-items: end; }
.schedule-rotation-controls { display: grid; gap: 9px; }
.schedule-rotation-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.schedule-rotation-toolbar > .muted { margin-left: auto; font-size: 11px; }
.schedule-rotation-list { display: grid; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.schedule-rotation-item { min-width: 0; min-height: 58px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 10px; background: #fff; }
.schedule-rotation-item + .schedule-rotation-item { border-top: 1px solid var(--line); }
.schedule-rotation-item.active { background: #edf8f4; box-shadow: inset 3px 0 0 var(--accent); }
.schedule-rotation-index { width: 26px; height: 26px; display: grid; place-items: center; color: var(--accent-dark); background: var(--accent-soft); border-radius: 50%; font-size: 11px; font-weight: 700; }
.schedule-rotation-copy { min-width: 0; display: grid; gap: 2px; padding: 0; color: inherit; background: transparent; border: 0; text-align: left; cursor: pointer; }
.schedule-rotation-copy strong, .schedule-rotation-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-rotation-copy small { color: var(--muted); }
.schedule-delete-option { display: grid; grid-template-columns: minmax(250px, auto) minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.schedule-delete-option > span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.schedule-delete-option.disabled { opacity: .55; }
.capture-hint { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 10px 11px; color: #245b50; background: #fff; border: 1px solid #cce3dc; border-radius: 6px; font-size: 12px; line-height: 1.45; }
.capture-hint svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.capture-state.compact { margin-top: 12px; }
.schedule-target-mode { margin-bottom: 12px; }
.schedule-target-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 250px; overflow: auto; }
.schedule-target-option { min-width: 0; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.schedule-target-option:has(input:checked) { border-color: #74b7a5; background: #edf8f4; }
.schedule-target-option input { width: 16px; min-height: 16px; accent-color: var(--accent); }
.schedule-target-option span { min-width: 0; display: grid; gap: 2px; }
.schedule-target-option strong, .schedule-target-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-target-option small { color: var(--muted); }
.broadcast-note { min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 12px; color: #315f53; background: #eaf7f2; border: 1px solid #afd8cb; border-radius: 6px; }
.broadcast-note > svg { width: 24px; flex: none; }
.broadcast-note > div { display: grid; gap: 3px; }
.schedule-delivery-options { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.schedule-error { max-width: 300px; white-space: normal; }

.audience-section { margin-top: 16px; overflow: hidden; }
.audience-section > header h4 { display: flex; align-items: center; gap: 8px; margin: 0; }
.audience-section > header svg { width: 18px; height: 18px; color: var(--accent); }
.audience-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; }
.audience-card { min-width: 0; display: grid; gap: 12px; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 1px 2px rgba(21, 44, 37, .04); }
.audience-card > header, .audience-card > footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.audience-card > header > div { min-width: 0; display: grid; gap: 3px; }
.audience-card strong, .audience-card .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audience-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.audience-metrics > div { min-width: 0; padding: 10px; background: #f4f8f6; border: 1px solid #dce8e3; border-radius: 6px; }
.audience-metrics span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.audience-metrics strong { display: block; margin-top: 3px; color: var(--ink); font-size: 20px; }
.audience-user-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.audience-user-panel > header > div { display: grid; gap: 3px; }
.audience-user-panel > header span { color: var(--muted); font-size: 12px; }

.inline-keyboard-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0 6px; }
.inline-delete-button { min-height: 36px; justify-content: center; }

.rich-setting-field { padding: 13px; background: #f8faf9; border: 1px solid var(--line); border-radius: 7px; }
.rich-setting-source { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.rich-setting-preview { min-height: 54px; padding: 10px 12px; color: #24322d; background: #dfeae6; border: 1px solid #c1d0ca; border-radius: 6px; font-weight: 400; }
.withdrawal-copy-config { margin-top: 18px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.withdrawal-copy-config > summary { padding: 13px 15px; background: #f1f5f3; font-weight: 800; cursor: pointer; }
.withdrawal-copy-config > .form-grid { padding: 14px; }

.copywriting-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-bottom: 16px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 8px; }
.copywriting-summary > div { min-width: 0; display: grid; gap: 4px; padding: 14px 16px; background: var(--surface); }
.copywriting-summary span { color: var(--muted); font-size: 11px; font-weight: 700; }
.copywriting-summary strong { overflow-wrap: anywhere; font-size: 17px; }
.copy-flow { display: grid; gap: 7px; margin-bottom: 18px; }
.copy-flow-step { min-width: 0; min-height: 58px; display: grid; grid-template-columns: 28px 32px minmax(0, 1fr) auto 38px; align-items: center; gap: 10px; padding: 9px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.copy-flow-step > svg { width: 18px; color: var(--accent); }
.copy-flow-step > div { min-width: 0; display: grid; gap: 3px; }
.copy-flow-step strong, .copy-flow-step small { overflow-wrap: anywhere; }
.copy-flow-step small { color: var(--muted); font-size: 11px; }
.copy-flow-number { color: #7b8781; font: 700 11px Consolas, monospace; }
.copy-module-map { margin-bottom: 18px; }
.copy-module-list { display: grid; }
.copy-action-row { min-width: 0; border-top: 1px solid var(--line); }
.copy-action-row:first-child { border-top: 0; }
.copy-action-row > summary { min-height: 62px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto 20px; align-items: center; gap: 11px; padding: 10px 15px; list-style: none; cursor: pointer; }
.copy-action-row > summary::-webkit-details-marker { display: none; }
.copy-action-row > summary > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.copy-action-row > summary strong, .copy-action-routing strong { overflow-wrap: anywhere; font-size: 12px; }
.copy-action-row > summary small, .copy-action-routing span { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.copy-action-row > summary > svg { width: 17px; color: var(--muted); transition: transform .16s ease; }
.copy-action-row[open] > summary > svg { transform: rotate(180deg); }
.copy-action-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .34fr); gap: 14px; padding: 0 15px 15px 64px; }
.copy-action-copy-list { min-width: 0; display: grid; gap: 8px; }
.copy-action-copy-list > strong { font-size: 11px; }
.copy-action-copy-list > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.copy-field-link { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; padding: 9px 10px; color: inherit; text-align: left; background: #f5f8f7; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.copy-field-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.copy-field-link span { overflow-wrap: anywhere; font-size: 11px; font-weight: 800; }
.copy-field-link small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.copy-field-link em { color: #8d5616; font-size: 9px; font-style: normal; font-weight: 800; }
.copy-action-routing { min-width: 0; display: grid; align-content: start; gap: 8px; padding-left: 13px; border-left: 2px solid #dbe5e1; }
.copy-action-routing > div { display: grid; gap: 3px; }
.copy-entry-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.copywriting-form { display: grid; gap: 10px; }
.copy-editor-group { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.copy-editor-group > summary { min-height: 62px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 20px; align-items: center; gap: 11px; padding: 11px 15px; list-style: none; cursor: pointer; }
.copy-editor-group > summary::-webkit-details-marker { display: none; }
.copy-editor-group > summary > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.copy-editor-group > summary small { color: var(--muted); font-size: 11px; font-weight: 500; overflow-wrap: anywhere; }
.copy-editor-group > summary > svg { width: 17px; color: var(--muted); transition: transform .16s ease; }
.copy-editor-group[open] > summary > svg { transform: rotate(180deg); }
.copy-group-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 6px; }
.copy-group-icon svg { width: 17px; }
.copy-editor-fields { border-top: 1px solid var(--line); }
.copy-editor-entry { border-top: 1px solid var(--line); scroll-margin-top: 100px; }
.copy-editor-entry:first-child { border-top: 0; }
.copy-editor-entry > summary { min-height: 54px; display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; padding: 10px 15px; list-style: none; cursor: pointer; }
.copy-editor-entry > summary::-webkit-details-marker { display: none; }
.copy-editor-entry > summary > div:first-child { min-width: 0; display: grid; gap: 3px; }
.copy-editor-entry > summary span:not(.tag) { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.copy-editor-entry > summary > svg { width: 16px; color: var(--muted); transition: transform .16s ease; }
.copy-editor-entry[open] > summary > svg { transform: rotate(180deg); }
.copy-editor-entry[open] > summary { background: #f7faf8; }
.copy-editor-content { padding: 0 15px 15px; }
.copy-editor-entry .rich-setting-field { padding: 0; background: transparent; border: 0; }
.copywriting-footer { position: sticky; bottom: 10px; z-index: 5; justify-content: space-between; padding: 11px 14px; background: rgba(255,255,255,.97); border: 1px solid var(--line-strong); border-radius: 7px; box-shadow: 0 8px 22px rgba(24, 33, 30, .10); }
.copywriting-footer > span { color: var(--muted); font-size: 11px; }

.user-ops-summary { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)) auto; gap: 10px; align-items: stretch; margin-bottom: 16px; }
.user-ops-summary > div { display: grid; gap: 4px; padding: 12px; background: #f4f7f5; border: 1px solid var(--line); border-radius: 7px; }
.user-ops-summary span { color: var(--muted); font-size: 11px; }
.user-ops-summary .btn { align-self: stretch; }
.user-ops-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 16px; align-items: start; }
.user-chat-panel, .user-balance-panel { min-width: 0; }
.user-chat-panel > header, .user-balance-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.user-chat-panel > header > div, .user-balance-panel > header { display: grid; gap: 3px; }
.user-chat-panel header span, .user-balance-panel header span { color: var(--muted); font-size: 12px; }
.user-message-thread { min-height: 180px; max-height: 420px; display: grid; align-content: start; gap: 8px; overflow-y: auto; padding: 12px; background: #dfe9e5; border: 1px solid #c5d3ce; border-radius: 7px; }
.user-message { width: min(78%, 640px); padding: 9px 11px; background: #fff; border-radius: 7px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.user-message.outgoing { justify-self: end; background: #ddf5eb; }
.user-message > header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.user-message .rich-preview { white-space: pre-wrap; overflow-wrap: anywhere; }
.user-message-media { width: min(100%, 420px); margin: 7px 0; overflow: hidden; border: 1px solid rgba(35, 70, 60, .12); border-radius: 6px; background: #eef3f1; }
.user-message-media img, .user-message-media video { display: block; width: 100%; max-height: 320px; object-fit: contain; }
.user-message-media.audio { padding: 8px; }
.user-message-media audio { width: 100%; }
.user-message-file { display: inline-flex; align-items: center; gap: 7px; margin: 7px 0; color: var(--accent); }
.user-message-file svg { width: 15px; height: 15px; }
.message-error, .danger-text { color: var(--danger); }
.success-text { color: var(--accent-dark); }
.compact-editor { grid-template-columns: minmax(0, 1fr) 250px; margin-top: 12px; }
.user-balance-panel { padding: 14px; background: #f7f9f8; border: 1px solid var(--line); border-radius: 7px; }
.balance-history { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.balance-history h5 { margin-bottom: 8px; }
.balance-history > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.balance-history small { display: block; margin-top: 2px; color: var(--muted); }
.wallet-table-cell { display: grid; gap: 4px; min-width: 130px; }
.wallet-table-cell .mono { font-size: 11px; }
.user-wallet-panel { display: grid; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.user-wallet-panel > header { display: grid; gap: 3px; }
.user-wallet-panel > header span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.user-wallet-status { display: grid; gap: 5px; justify-items: start; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.user-wallet-panel dl { display: grid; gap: 7px; margin: 0; }
.user-wallet-panel dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.user-wallet-panel dt { color: var(--muted); }
.user-wallet-panel dd { margin: 0; text-align: right; }
.full-width { width: 100%; }
.payout-detail { min-width: 180px; display: grid; gap: 6px; }
.receipt-preview { width: 132px; display: grid; gap: 4px; color: var(--accent); font-size: 11px; }
.receipt-preview img { width: 96px; height: 72px; object-fit: contain; background: #edf1ef; border: 1px solid var(--line); border-radius: 5px; }
.receipt-preview.receipt-file { grid-template-columns: 18px 1fr; align-items: center; width: auto; }

.sticker-clone-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(460px, 1.2fr); gap: 16px; align-items: stretch; }
.sticker-mode-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.sticker-mode-bar > span { color: var(--muted); font-size: 12px; text-align: right; }
.sticker-mode-bar .segmented button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sticker-mode-bar .segmented svg { width: 15px; height: 15px; }
.sticker-source-panel, .sticker-inspection-panel { min-height: 360px; }
.sticker-inspect-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: end; }
.sticker-inspect-form .btn { min-height: 40px; }
.sticker-support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.sticker-support-grid span { min-width: 0; min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 9px 10px; color: #365149; background: #f3f8f6; border: 1px solid #d8e6e0; border-radius: 6px; font-size: 12px; font-weight: 700; }
.sticker-support-grid svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.sticker-inspection-panel { display: grid; }
.sticker-inspection-empty { min-height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 32px; color: var(--muted); text-align: center; }
.sticker-inspection-empty svg { width: 34px; height: 34px; color: #8aa099; }
.sticker-inspection-empty strong { color: var(--ink); font-size: 15px; }
.sticker-inspection-empty span { max-width: 360px; line-height: 1.6; }
.sticker-inspection-result { min-width: 0; padding: 16px; }
.sticker-inspection-result > header { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 14px; }
.sticker-inspection-result > header > div { min-width: 0; display: grid; gap: 4px; }
.sticker-inspection-result h4 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.sticker-inspection-result a { max-width: 100%; overflow: hidden; color: var(--accent-dark); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sticker-type-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: none; color: #17658a; background: #edf7fb; border-radius: 6px; }
.sticker-type-icon.large { width: 42px; height: 42px; }
.sticker-type-icon svg { width: 18px; height: 18px; }
.sticker-source-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sticker-source-metrics > div { min-width: 0; display: grid; gap: 3px; padding: 9px 10px; background: #f6f8f7; border: 1px solid var(--line); border-radius: 6px; }
.sticker-source-metrics span { color: var(--muted); font-size: 10px; font-weight: 700; }
.sticker-source-metrics strong { overflow-wrap: anywhere; font-size: 12px; }
.sticker-premium-note { min-height: 48px; display: flex; align-items: center; gap: 9px; margin-top: 10px; padding: 10px; color: #694f18; background: #fff8e7; border: 1px solid #ead59b; border-radius: 6px; font-size: 11px; line-height: 1.5; }
.sticker-premium-note svg { width: 18px; height: 18px; flex: none; }
.sticker-create-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.sticker-batch-panel { overflow: hidden; }
.sticker-batch-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr); gap: 16px; align-items: stretch; }
.sticker-batch-input { min-width: 0; }
.sticker-batch-results { min-width: 0; display: grid; align-content: start; border-left: 1px solid var(--line); padding-left: 16px; }
.sticker-batch-results > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sticker-batch-results > header h4 { margin: 0 0 3px; }
.sticker-batch-results > header > svg { width: 20px; height: 20px; color: var(--accent); }
.sticker-batch-form textarea { min-height: 210px; resize: vertical; overflow-wrap: anywhere; }
.sticker-batch-result { display: grid; gap: 10px; margin-top: 14px; padding: 12px; border: 1px solid #b8dccc; border-left: 4px solid var(--accent); background: #f1faf6; }
.sticker-batch-result.partial { border-color: #ead59b; border-left-color: var(--amber); background: #fffaf0; }
.sticker-batch-result > header { display: flex; align-items: flex-start; gap: 9px; }
.sticker-batch-result > header svg { width: 19px; height: 19px; flex: none; color: var(--accent); }
.sticker-batch-result.partial > header svg { color: var(--amber); }
.sticker-batch-result > header div { min-width: 0; display: grid; gap: 3px; }
.sticker-batch-result > header span { color: var(--muted); font-size: 11px; }
.sticker-batch-result details summary { color: var(--amber); font-size: 12px; font-weight: 800; cursor: pointer; }
.sticker-batch-result details p { display: grid; gap: 3px; margin: 8px 0 0; padding-top: 8px; border-top: 1px solid rgba(130, 103, 34, .18); }
.sticker-batch-result details code, .sticker-batch-result details span { overflow-wrap: anywhere; font-size: 11px; }
.sticker-batch-result details span { color: var(--danger); }
.sticker-batch-link-heading { display: grid; gap: 3px; padding-top: 2px; border-top: 1px solid rgba(31, 110, 83, .16); }
.sticker-batch-link-heading span { color: var(--muted); font-size: 11px; }
.sticker-batch-links { display: grid; gap: 8px; max-height: 340px; overflow: auto; }
.sticker-batch-links article { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; background: #fff; border: 1px solid #d7e7df; border-radius: 6px; }
.sticker-batch-links article > div { min-width: 0; display: grid; gap: 3px; }
.sticker-batch-links strong, .sticker-batch-links span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticker-batch-links span { color: var(--muted); font-size: 11px; }
.sticker-batch-links code { color: var(--accent-dark); overflow-wrap: anywhere; }
.sticker-batch-links .btn { flex: none; }
.sticker-compose-panel { overflow: hidden; }
.sticker-compose-workspace { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 16px; align-items: start; }
.sticker-compose-left, .sticker-compose-right { min-width: 0; display: grid; gap: 16px; }
.sticker-compose-create, .sticker-compose-channel-config, .sticker-compose-library, .sticker-compose-right > section { min-width: 0; padding: 14px; background: #fbfdfc; border: 1px solid var(--line); border-radius: 7px; }
.sticker-compose-create > header, .sticker-compose-library > header, .sticker-compose-history > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sticker-compose-create > header > div, .sticker-compose-library > header > div { min-width: 0; display: grid; gap: 3px; }
.sticker-compose-create h4 { margin: 0; }
.sticker-compose-create header span, .sticker-compose-library header span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.sticker-compose-collect { display: grid; gap: 9px; }
.sticker-compose-collect textarea { min-height: 150px; resize: vertical; overflow-wrap: anywhere; }
.sticker-compose-library > header { align-items: center; flex-wrap: wrap; }
.sticker-compose-library .segmented { max-width: 100%; overflow-x: auto; }
.sticker-compose-library .segmented button { white-space: nowrap; }
.sticker-compose-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 470px; overflow: auto; }
.sticker-compose-item { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 10px; background: #fff; border: 1px solid #d9e5e0; border-radius: 6px; }
.sticker-compose-item > label { min-width: 0; display: grid; grid-template-columns: auto 30px minmax(0, 1fr); align-items: center; gap: 8px; cursor: pointer; }
.sticker-compose-item:hover { border-color: #9bcaba; background: #f7fcfa; }
.sticker-compose-item.selected { border-color: #16846d; background: #effaf6; box-shadow: inset 3px 0 #16846d; }
.sticker-compose-item input { margin: 0; accent-color: #16846d; }
.sticker-compose-item-icon { width: 30px; height: 30px; display: grid; place-items: center; color: #17658a; background: #edf7fb; border-radius: 5px; }
.sticker-compose-item-icon svg { width: 16px; height: 16px; }
.sticker-compose-item > label > div { min-width: 0; display: grid; gap: 2px; }
.sticker-compose-item strong, .sticker-compose-item span, .sticker-compose-item small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticker-compose-item span { color: #365149; font-size: 11px; }
.sticker-compose-item small { color: var(--muted); font-size: 10px; }
.compose-order { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-right: 5px; color: #fff !important; background: #17658a; border-radius: 10px; font-size: 9px !important; }
.compose-order-actions { display: flex; align-items: center; gap: 3px; }
.compose-order-actions .icon-btn { width: 27px; height: 27px; }
.compose-order-actions .icon-btn.group { color: #fff; background: #17658a; border-color: #17658a; }
.sticker-compose-channel-config { display: grid; gap: 12px; }
.sticker-compose-channel-config > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sticker-compose-channel-config > header > div { min-width: 0; display: grid; gap: 4px; }
.sticker-compose-channel-config > header span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.sticker-compose-channel-config form { display: grid; gap: 10px; }
.compose-channel-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.compose-channel-choice { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 9px; background: #fff; border: 1px solid #d8e5df; border-radius: 6px; cursor: pointer; }
.compose-channel-choice.active { border-color: #16846d; background: #effaf6; }
.compose-channel-choice input { margin: 0; accent-color: #16846d; }
.compose-channel-choice span { min-width: 0; display: grid; gap: 3px; }
.compose-channel-choice strong, .compose-channel-choice small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-channel-choice small { color: var(--muted); font-size: 10px; }
.compose-channel-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.compose-channel-stat { display: grid; gap: 2px; padding: 6px 8px; background: #edf7fb; border: 1px solid #cfe4ec; border-radius: 5px; }
.compose-channel-stat small { color: var(--muted); font-size: 9px; }
.sticker-compose-empty, .sticker-compose-result-wait { min-height: 170px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 22px; color: var(--muted); text-align: center; }
.sticker-compose-empty svg, .sticker-compose-result-wait svg { width: 32px; height: 32px; color: #8aa099; }
.sticker-compose-empty strong { color: var(--ink); }
.sticker-compose-current { display: grid; gap: 12px; }
.sticker-compose-current > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sticker-compose-current > header > div { min-width: 0; display: grid; gap: 5px; }
.sticker-compose-current h4 { margin: 0; overflow-wrap: anywhere; }
.sticker-compose-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.sticker-compose-metrics span { display: grid; gap: 3px; padding: 8px; color: var(--muted); background: #f3f8f6; border: 1px solid #d8e6e0; border-radius: 5px; font-size: 10px; }
.sticker-compose-metrics strong { color: var(--ink); font-size: 12px; }
.sticker-compose-links { display: grid; gap: 8px; }
.sticker-compose-links article { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; background: #fff; border: 1px solid #d7e7df; border-radius: 6px; }
.sticker-compose-links article > div { min-width: 0; display: grid; gap: 3px; }
.sticker-compose-links strong, .sticker-compose-links code, .sticker-compose-links span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticker-compose-links code { color: var(--accent-dark); font-size: 11px; }
.sticker-compose-links span { color: var(--muted); font-size: 10px; }
.sticker-compose-links .btn { flex: none; }
.sticker-compose-error { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; color: var(--danger); background: var(--danger-soft); border-left: 3px solid var(--danger); font-size: 11px; line-height: 1.5; }
.sticker-compose-error svg { width: 16px; height: 16px; flex: none; }
.sticker-compose-build { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.sticker-compose-build small { line-height: 1.5; }
.sticker-compose-history { display: grid; gap: 10px; }
.sticker-compose-history > header { align-items: center; margin-bottom: 0; }
.sticker-compose-history-item { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 7px 0; border-top: 1px solid var(--line); }
.sticker-compose-history-item > button:first-child { min-width: 0; display: grid; gap: 3px; padding: 4px; color: inherit; background: transparent; border: 0; text-align: left; cursor: pointer; }
.sticker-compose-history-item > button:first-child:hover strong { color: var(--accent-dark); }
.sticker-compose-history-item strong, .sticker-compose-history-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticker-compose-history-item span { color: var(--muted); font-size: 10px; }
.sticker-compose-history-item.active { border-left: 3px solid var(--accent); padding-left: 7px; }
.sticker-jobs-panel { margin-top: 16px; overflow: hidden; }
.sticker-job-list { display: grid; }
.sticker-job-card { min-width: 0; display: grid; gap: 12px; padding: 15px 16px; }
.sticker-job-card + .sticker-job-card { border-top: 1px solid var(--line); }
.sticker-job-card > header, .sticker-job-card > footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sticker-job-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.sticker-job-title > div { min-width: 0; display: grid; gap: 3px; }
.sticker-job-title strong, .sticker-job-title span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticker-job-title span { color: var(--muted); font-size: 11px; }
.sticker-progress { display: grid; gap: 6px; }
.sticker-progress > div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.sticker-progress strong { color: var(--ink); }
.sticker-progress progress { width: 100%; height: 9px; overflow: hidden; appearance: none; border: 0; border-radius: 5px; background: #e5ebe8; }
.sticker-progress progress::-webkit-progress-bar { background: #e5ebe8; }
.sticker-progress progress::-webkit-progress-value { background: #16846d; }
.sticker-progress progress::-moz-progress-bar { background: #16846d; }
.sticker-job-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; color: #52615b; font-size: 11px; }
.sticker-job-meta span { display: inline-flex; align-items: center; gap: 5px; }
.sticker-job-meta svg { width: 14px; height: 14px; color: #71837b; }
.sticker-job-error { min-height: 38px; display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; color: var(--danger); background: var(--danger-soft); border-left: 3px solid var(--danger); font-size: 11px; line-height: 1.5; }
.sticker-job-error svg { width: 16px; height: 16px; margin-top: 1px; flex: none; }
.sticker-failures { font-size: 11px; }
.sticker-failures > summary { color: var(--amber); font-weight: 800; cursor: pointer; }
.sticker-failures > div { max-height: 180px; margin-top: 7px; overflow-y: auto; border-top: 1px solid var(--line); }
.sticker-failures p { display: grid; grid-template-columns: 42px 46px minmax(0, 1fr); gap: 7px; margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
.sticker-failures small { color: var(--muted); overflow-wrap: anywhere; }
.sticker-job-card > footer { align-items: center; }
.sticker-job-card > footer > .muted { font-size: 10px; }

@media (max-width: 900px) {
  .schedule-target-list, .schedule-capture-controls, .audience-grid, .user-ops-grid, .sticker-clone-layout, .sticker-batch-workspace, .sticker-compose-workspace { grid-template-columns: 1fr; }
  .user-ops-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-editor { grid-template-columns: 1fr; }
  .compact-editor .message-preview { position: static; }
  .copywriting-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .copy-action-body { grid-template-columns: 1fr; }
  .copy-action-routing { padding: 10px 0 0; border-left: 0; border-top: 2px solid #dbe5e1; }
}

@media (max-width: 620px) {
  .media-upload-control, .rich-setting-source { grid-template-columns: 1fr; }
  .editor-source-bar > label { display: grid; }
  .schedule-capture-panel > header, .schedule-target-panel > header, .schedule-rotation-panel > header, .audience-user-panel > header, .audience-card > footer { align-items: flex-start; flex-direction: column; }
  .group-mention-guide > header { align-items: flex-start; flex-direction: column; }
  .group-mention-guide > header .tag { align-self: flex-start; }
  .group-mention-cleanup-form { grid-template-columns: 1fr; align-items: stretch; }
  .group-mention-cleanup-form .btn { width: 100%; }
  .schedule-capture-panel > header .btn, .schedule-target-panel > header .btn { width: 100%; }
  .schedule-rotation-item { grid-template-columns: 28px minmax(0, 1fr); }
  .schedule-rotation-item .row-actions { grid-column: 2; justify-content: flex-start; }
  .schedule-delete-option { grid-template-columns: 1fr; gap: 6px; }
  .schedule-target-mode { width: 100%; }
  .schedule-target-mode button { flex: 1; }
  .audience-metrics { grid-template-columns: 1fr; }
  .user-ops-summary { grid-template-columns: 1fr; }
  .user-message { width: 92%; }
  .sticker-source-panel, .sticker-inspection-panel { min-height: 0; }
  .sticker-compose-items { grid-template-columns: 1fr; max-height: none; }
  .compose-channel-choices { grid-template-columns: 1fr; }
  .sticker-compose-channel-config > header { flex-direction: column; }
  .sticker-compose-channel-config > header .btn { width: 100%; }
  .sticker-batch-results { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
  .sticker-mode-bar { align-items: stretch; flex-direction: column; }
  .sticker-mode-bar > span { text-align: left; }
  .sticker-mode-bar .segmented { width: 100%; }
  .sticker-mode-bar .segmented button { flex: 1; justify-content: center; min-width: 0; }
  .sticker-inspect-form, .sticker-source-metrics, .sticker-support-grid { grid-template-columns: 1fr; }
  .sticker-job-card > header, .sticker-job-card > footer { align-items: flex-start; flex-direction: column; }
  .sticker-job-card > footer .row-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .sticker-failures p { grid-template-columns: 36px minmax(0, 1fr); }
  .sticker-failures small { grid-column: 1 / -1; }
  .copywriting-summary { grid-template-columns: 1fr; }
  .copy-flow-step { grid-template-columns: 24px 28px minmax(0, 1fr) 36px; }
  .copy-flow-step .tag { grid-column: 3; justify-self: start; }
  .copy-flow-step > .icon-btn { grid-column: 4; grid-row: 1 / span 2; }
  .copy-module-map > header, .copywriting-footer { align-items: flex-start; flex-direction: column; }
  .copy-action-row > summary { grid-template-columns: 34px minmax(0, 1fr) 18px; }
  .copy-action-row > summary .tag { grid-column: 2; justify-self: start; }
  .copy-action-row > summary > svg { grid-column: 3; grid-row: 1 / span 3; }
  .copy-action-body { grid-template-columns: 1fr; padding-left: 15px; }
  .copy-action-routing { padding: 10px 0 0; border-left: 0; border-top: 2px solid #dbe5e1; }
  .copy-action-copy-list > div { grid-template-columns: 1fr; }
  .copy-editor-group > summary { grid-template-columns: 34px minmax(0, 1fr) 18px; }
  .copy-editor-group > summary .tag { grid-column: 2; justify-self: start; }
  .copy-editor-group > summary > svg { grid-column: 3; grid-row: 1 / span 2; }
  .copy-editor-entry > summary { grid-template-columns: minmax(0, 1fr) 18px; }
  .copy-editor-entry > summary .copy-entry-tags { grid-column: 1; justify-content: flex-start; }
  .copy-editor-entry > summary > svg { grid-column: 2; grid-row: 1 / span 2; }
  .copywriting-footer { position: static; }
  .copywriting-footer .btn { width: 100%; }
}

/* V16.9: compact operations-first administration layout. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sidebar-brand { min-height: 66px; padding: 14px 16px; }
.main-nav { gap: 5px; padding: 10px 9px 14px; }
.nav-group { gap: 2px; }
.nav-group-toggle {
  width: 100%;
  min-height: 30px !important;
  justify-content: space-between;
  padding: 0 9px !important;
  color: #85958e !important;
  background: transparent !important;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}
.nav-group-toggle:hover { color: #c8d4cf !important; background: #27312c !important; }
.nav-group-toggle svg { width: 14px; height: 14px; transition: transform .16s ease; }
.nav-group.collapsed .nav-group-toggle svg { transform: rotate(-90deg); }
.nav-group.current .nav-group-toggle { color: #8dd7c3 !important; }
.nav-group-items { display: grid; gap: 2px; }
.nav-group.collapsed .nav-group-items { display: none; }
.main-nav .nav-group-items > button {
  min-height: 38px;
  gap: 10px;
  padding: 0 10px;
  color: #c7d0cc;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
}
.main-nav .nav-group-items > button:hover { color: #fff; background: #2b3530; }
.main-nav .nav-group-items > button.active { color: #fff; background: #087f66; }
.main-nav .nav-group-items > button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar { min-height: 66px; padding: 10px 24px; }
.topbar .eyebrow { margin-bottom: 2px; font-size: 10px; }
.topbar h2 { font-size: 20px; }
.page-content { padding-top: 18px; }
.page-head { min-height: 40px; margin-bottom: 14px; }
.page-head-copy { min-width: 0; }
.page-head-copy p { max-width: 760px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

.config-route-card { margin-bottom: 14px; padding: 0; overflow: hidden; }
.config-route-card > summary {
  min-height: 50px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  list-style: none;
  cursor: pointer;
}
.config-route-card > summary::-webkit-details-marker { display: none; }
.config-route-card > summary > svg:first-child { width: 18px; color: var(--accent); }
.config-route-card > summary > svg:last-child { width: 15px; color: #75847e; transition: transform .16s ease; }
.config-route-card[open] > summary > svg:last-child { transform: rotate(180deg); }
.config-route-card > summary > span { min-width: 0; display: grid; gap: 2px; }
.config-route-card > summary strong { color: var(--accent-dark); font-size: 12px; }
.config-route-card > summary small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.config-route-card[open] > summary { border-bottom: 1px solid #dce7e2; }
.config-route-card > .config-route-grid { padding: 11px 12px 12px; }

.dashboard-quick-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.dashboard-quick-actions button {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  color: #31423c;
  background: var(--surface);
  border: 0;
  text-align: left;
}
.dashboard-quick-actions button:hover { color: var(--accent-dark); background: #f1f8f5; }
.dashboard-quick-actions button.attention { color: #8b411a; background: #fff7ed; }
.dashboard-quick-actions svg { width: 17px; color: var(--accent); }
.dashboard-quick-actions button.attention svg { color: #c45b24; }
.dashboard-quick-actions span { overflow: hidden; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-quick-actions small { min-width: 23px; padding: 2px 5px; color: var(--muted); background: #edf2f0; border-radius: 4px; font-size: 10px; font-weight: 800; text-align: center; }
.dashboard-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
.dashboard-stats .stat-card { min-height: 112px; padding: 14px; }
.dashboard-stats .stat-card header { font-size: 11px; }
.dashboard-stats .stat-card strong { margin-top: 10px; font-size: 24px; }
.dashboard-stats .stat-card small { margin-top: 7px; font-size: 10px; line-height: 1.4; }

.collapsible-section-header { position: relative; padding-right: 56px !important; }
.collapsible-section-header .section-collapse-button {
  position: absolute;
  top: 11px;
  right: 12px;
  width: 32px;
  height: 32px;
  color: #66766f;
  background: #f7f9f8;
}
.section-block.section-collapsed > :not(header) { display: none !important; }
.section-block.section-collapsed > header { border-bottom: 0; }
.section-block.section-collapsed > header h4 { margin-bottom: 3px; }
.user-list-section > .table-wrap { max-height: min(720px, calc(100dvh - 220px)); overflow: auto; }
.user-list-section thead { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--line); }
.user-list-header > div:first-child { display: grid; gap: 3px; }
.user-list-controls { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.user-list-controls label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.user-list-controls select { min-height: 34px; padding: 6px 30px 6px 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 12px; }
.user-list-footer { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.user-pagination { display: flex; align-items: center; gap: 5px; }
.user-pagination .icon-btn, .pager-page { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 800; }
.user-pagination .icon-btn:disabled { opacity: .38; cursor: default; }
.pager-page.active { color: #fff; border-color: var(--accent); background: var(--accent); }
.pager-gap { min-width: 18px; color: var(--muted); text-align: center; }

@media (min-width: 761px) and (max-width: 1120px) {
  .dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .sidebar-brand { min-height: 64px; }
  .main-nav { gap: 4px; }
  .topbar { min-height: 62px; padding: 9px 12px; }
  .topbar h2 { font-size: 18px; }
  .page-content { padding: 13px 12px 40px; }
  .page-head { min-height: 0; display: grid; gap: 9px; margin-bottom: 11px; }
  .page-head-copy p { font-size: 11px; }
  .page-actions { gap: 6px; }
  .settings-bot-picker { grid-template-columns: 1fr; gap: 4px; }
  .settings-bot-picker span { font-size: 10px; }
  .settings-bot-picker select { min-height: 38px; }
  .config-route-card > summary { min-height: 46px; padding: 8px 10px; }
  .config-route-card > summary small { white-space: normal; line-height: 1.35; }
  .dashboard-quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-quick-actions button { min-height: 44px; }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .dashboard-stats .stat-card { min-height: 106px; padding: 12px; }
  .dashboard-stats .stat-card strong { font-size: 22px; }
  .dashboard-log-table th:nth-child(2),
  .dashboard-log-table td:nth-child(2),
  .dashboard-log-table th:nth-child(4),
  .dashboard-log-table td:nth-child(4) { display: none; }
  .dashboard-log-table th, .dashboard-log-table td { padding-left: 8px; padding-right: 8px; }
  .section-body { padding: 13px; }
  .collapsible-section-header { padding-right: 52px !important; }
  .collapsible-section-header .section-collapse-button { top: 10px; right: 10px; }
  .reward-welcome-section .inline-row-actions { width: 100%; }
  .reward-welcome-section .inline-row-actions .btn { flex: 1; white-space: nowrap; }
  .user-list-section > .table-wrap { max-height: calc(100dvh - 205px); }
  .user-list-header { align-items: stretch; flex-direction: column; }
  .user-list-controls { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .user-list-controls label { display: grid; gap: 4px; }
  .user-list-controls select { width: 100%; }
  .user-list-footer { align-items: flex-start; flex-direction: column; }
  .user-pagination { width: 100%; justify-content: flex-end; overflow-x: auto; padding-bottom: 2px; }
}

@media (max-width: 430px) {
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-quick-actions button:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* 链接投稿审核与自动筛群 */
.link-submission-table table { min-width: 1180px; }
.link-submission-table td { max-width: 280px; }
.link-submission-table td > strong,
.link-submission-table td > span,
.link-submission-table td > a { display: block; }
.link-submission-table td > a { max-width: 270px; overflow: hidden; color: var(--accent-dark); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.link-submission-table td > .muted { max-width: 280px; margin-top: 4px; overflow-wrap: anywhere; font-size: 11px; line-height: 1.45; }
.link-submission-table .tag + .muted { margin-top: 6px; }
.link-submission-table .user-list-header > .segmented { display: flex; max-width: 100%; overflow-x: auto; }
.link-submission-table .user-list-header > .segmented button { flex: none; white-space: nowrap; }
.link-submission-cards { display: none; }

.link-review-modal { min-width: 0; }
.link-review-grid { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr); gap: 18px; align-items: start; }
.link-review-media,
.link-review-data { min-width: 0; }
.link-review-media { overflow: hidden; background: #f5f8f6; border: 1px solid var(--line); border-radius: 7px; }
.link-review-media > header { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.link-review-media > header > div { min-width: 0; display: grid; gap: 2px; }
.link-review-media h4 { margin: 0; font-size: 14px; }
.link-review-media header span { color: var(--muted); font-size: 11px; }
.link-review-image { width: 100%; min-height: 420px; max-height: 620px; display: grid; place-items: center; padding: 12px; color: var(--muted); background: #edf2f0; }
.link-review-image img { width: 100%; height: 100%; max-height: 594px; display: block; object-fit: contain; }
.link-review-image.empty-state { min-height: 420px; }
.link-review-data { display: grid; gap: 12px; }
.link-review-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.link-review-summary > div { min-width: 0; min-height: 68px; display: grid; align-content: center; gap: 5px; padding: 10px 12px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.link-review-summary > div:nth-child(2n) { border-right: 0; }
.link-review-summary > div:nth-last-child(-n+2) { border-bottom: 0; }
.link-review-summary span { color: var(--muted); font-size: 11px; }
.link-review-summary strong { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.screening-reason { display: grid; gap: 5px; padding: 12px; background: #f3f8f6; border-left: 3px solid var(--accent); }
.screening-reason strong { font-size: 13px; overflow-wrap: anywhere; }
.screening-reason span { color: #4f5e58; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.screening-check-list { display: grid; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.screening-check-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.screening-check-row:last-child { border-bottom: 0; }
.screening-check-row > div { min-width: 0; display: grid; gap: 3px; }
.screening-check-row > div:last-child { justify-items: end; }
.screening-check-row strong { font-size: 12px; }
.screening-check-row span,
.screening-check-row small { color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.link-review-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.link-review-form .span-2 { grid-column: span 2; }
.link-review-form textarea { min-height: 88px; }
.screening-override { min-height: 48px; padding: 10px 12px; color: #70420d; background: var(--amber-soft); border: 1px solid #ead8a8; border-radius: 6px; }
.link-review-final { min-height: 52px; display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px; background: #f5f8f6; border: 1px solid var(--line); border-radius: 7px; }
.link-review-final span:nth-child(2) { min-width: 0; flex: 1; color: var(--muted); overflow-wrap: anywhere; }
.link-review-final strong { font-size: 14px; white-space: nowrap; }

.link-screening-form { display: grid; gap: 16px; }
.screening-control-bar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; color: #183f34; background: #edf7f3; border: 1px solid #b9d9ce; border-radius: 8px; }
.screening-master-switch { min-width: 0; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.screening-master-switch input { width: 20px; min-height: 20px; flex: none; accent-color: var(--accent); }
.screening-master-switch > span { min-width: 0; display: grid; gap: 3px; }
.screening-master-switch strong { font-size: 14px; }
.screening-master-switch small { color: #527067; font-size: 11px; line-height: 1.45; }
.screening-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.screening-settings-section > header,
.screening-reply-section > header,
.screening-operation > header { align-items: flex-start; }
.screening-settings-section > header > div,
.screening-reply-section > header > div,
.screening-operation > header > div { min-width: 0; display: grid; gap: 3px; }
.screening-settings-section h4,
.screening-reply-section h4,
.screening-operation h4 { display: flex; align-items: center; gap: 7px; margin: 0; }
.screening-settings-section h4 svg,
.screening-reply-section h4 svg,
.screening-operation h4 svg { width: 17px; color: var(--accent); }
.screening-settings-section header span,
.screening-reply-section header span,
.screening-operation header span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.screening-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.screening-form-grid .span-2 { grid-column: span 2; }
.screening-info { min-height: 43px; display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; color: #53625c; background: #f3f6f5; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; line-height: 1.5; }
.screening-info svg { width: 16px; flex: none; color: var(--accent); }
.screening-check-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.screening-option { min-width: 0; min-height: 60px; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; padding: 10px; background: #f7faf8; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.screening-option input { width: 17px; min-height: 17px; margin-top: 2px; accent-color: var(--accent); }
.screening-option > span { min-width: 0; display: grid; gap: 3px; }
.screening-option strong { font-size: 12px; }
.screening-option small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.screening-field-muted { opacity: .56; }
.screening-field-muted input { background: #edf1ef; }
.screening-reply-section textarea { min-height: 88px; }
.screening-save-bar { min-height: 62px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 5px 16px rgba(24, 33, 30, .08); }
.screening-save-bar span { flex: 1; color: var(--muted); font-size: 11px; text-align: right; }
.screening-operations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.screening-test-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: end; }
.screening-test-result { margin-top: 14px; }
.screening-test-result.empty-inline { min-height: 54px; display: grid; place-items: center; }
.screening-test-head { padding: 11px 12px; background: #f3f8f6; border: 1px solid var(--line); border-radius: 7px 7px 0 0; }
.screening-test-head > div { display: flex; align-items: flex-start; gap: 8px; }
.screening-test-head strong { min-width: 0; padding-top: 3px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.screening-test-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-top: 0; }
.screening-test-summary > div { min-width: 0; display: grid; gap: 3px; padding: 9px; border-right: 1px solid var(--line); }
.screening-test-summary > div:last-child { border-right: 0; }
.screening-test-summary span { color: var(--muted); font-size: 10px; }
.screening-test-summary strong { font-size: 11px; overflow-wrap: anywhere; }
.screening-test-result .screening-check-list { border-radius: 0 0 7px 7px; border-top: 0; }
.screening-test-error { min-height: 52px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--danger); background: var(--danger-soft); border: 1px solid #e9b7b1; border-radius: 6px; font-size: 12px; }
.screening-test-error svg { width: 17px; flex: none; }
.screening-batch-body { display: grid; align-content: start; gap: 13px; }
.screening-batch-copy { display: grid; gap: 4px; }
.screening-batch-copy strong { font-size: 13px; }
.screening-batch-copy span { color: var(--muted); font-size: 11px; line-height: 1.55; }
.screening-batch-body > .btn { justify-self: start; }
.screening-batch-result { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px; background: #f4f7f5; border: 1px solid var(--line); border-radius: 6px; }
.screening-batch-result span { padding: 4px 7px; color: #4e5a55; background: white; border-radius: 4px; font-size: 11px; }
.screening-batch-result .success { color: #087052; }
.screening-batch-result .danger { color: var(--danger); }
.screening-batch-result .warning { color: var(--amber); }

@media (max-width: 1050px) {
  .link-review-grid { grid-template-columns: 1fr; }
  .link-review-image,
  .link-review-image.empty-state { min-height: 360px; max-height: 540px; }
  .screening-settings-grid,
  .screening-operations-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .link-submission-table > .table-wrap { display: none; }
  .link-submission-table .user-list-header > .segmented { width: 100%; }
  .link-submission-table .user-list-header > .segmented button { min-width: max-content; flex: 1; }
  .link-submission-cards { display: grid; gap: 10px; padding: 10px; background: #f1f4f2; border-radius: 0 0 8px 8px; }
  .link-submission-card { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; }
  .link-submission-card > header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; background: #f8faf9; border-bottom: 1px solid var(--line); }
  .link-submission-card > header > div { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
  .link-submission-card > header strong { font-size: 14px; }
  .link-submission-card > header span:not(.tag) { color: var(--muted); font-size: 10px; }
  .link-submission-card-body { display: grid; gap: 10px; padding: 11px; }
  .link-submission-card-owner { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .link-submission-card-owner span { min-width: 0; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
  .link-submission-card-owner code { color: var(--muted); font-size: 10px; }
  .link-submission-card-link { min-width: 0; position: relative; display: grid; gap: 3px; padding: 10px 34px 10px 10px; color: var(--accent-dark); background: #f2f8f5; border: 1px solid #d2e3dc; border-radius: 6px; }
  .link-submission-card-link strong,
  .link-submission-card-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .link-submission-card-link strong { font-size: 12px; }
  .link-submission-card-link span { color: var(--muted); font-size: 10px; }
  .link-submission-card-link svg { width: 16px; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
  .link-submission-card-shot { min-height: 82px; position: relative; display: grid; place-items: center; overflow: hidden; color: var(--accent-dark); background: #edf2f0; border: 1px solid var(--line); border-radius: 6px; }
  .link-submission-card-shot img { width: 100%; height: 128px; display: block; object-fit: contain; }
  .link-submission-card-shot > span { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; font-weight: 700; }
  .link-submission-card-shot > span svg,
  .link-submission-card-shot.empty > svg { width: 16px; }
  .link-submission-card-shot.empty { align-content: center; gap: 5px; color: var(--muted); font-size: 11px; }
  .link-submission-card-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
  .link-submission-card-metrics > div { min-width: 0; display: grid; align-content: start; gap: 5px; padding: 9px; }
  .link-submission-card-metrics > div + div { border-left: 1px solid var(--line); }
  .link-submission-card-metrics > div > span:first-child { color: var(--muted); font-size: 10px; }
  .link-submission-card-metrics strong { font-size: 12px; overflow-wrap: anywhere; }
  .link-submission-card-metrics small { color: var(--muted); font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
  .link-submission-card-note { display: grid; gap: 3px; padding: 8px 9px; color: #5d4a23; background: #fff8e8; border-left: 3px solid var(--amber); font-size: 10px; line-height: 1.45; }
  .link-submission-card > footer { display: flex; padding: 10px 11px; border-top: 1px solid var(--line); }
  .link-submission-card > footer .btn { width: 100%; }
  .link-submission-card-empty { min-height: 150px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 6px; }
  .link-review-media > header { align-items: flex-start; }
  .link-review-image,
  .link-review-image.empty-state { min-height: 280px; max-height: 440px; padding: 8px; }
  .link-review-form { grid-template-columns: 1fr; }
  .link-review-form .span-2 { grid-column: auto; }
  .link-review-form .form-footer { align-items: stretch; flex-direction: column; }
  .link-review-form .form-footer .btn { width: 100%; }
  .link-review-final { align-items: flex-start; flex-wrap: wrap; }
  .link-review-final span:nth-child(2) { flex-basis: calc(100% - 90px); }
  .screening-control-bar { align-items: flex-start; }
  .screening-form-grid { grid-template-columns: 1fr; }
  .screening-form-grid .span-2 { grid-column: auto; }
  .screening-check-options { grid-template-columns: 1fr; }
  .screening-save-bar { align-items: stretch; flex-direction: column; gap: 7px; }
  .screening-save-bar span { text-align: left; }
  .screening-save-bar .btn { width: 100%; }
  .screening-test-form { grid-template-columns: 1fr; }
  .screening-test-form .btn { width: 100%; }
  .screening-test-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screening-test-summary > div:nth-child(2) { border-right: 0; }
  .screening-test-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .screening-check-row { align-items: start; grid-template-columns: 1fr; }
  .screening-check-row > div:last-child { grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-items: start; }
}

@media (max-width: 430px) {
  .link-review-summary { grid-template-columns: 1fr; }
  .link-review-summary > div { border-right: 0; border-bottom: 1px solid var(--line) !important; }
  .link-review-summary > div:last-child { border-bottom: 0 !important; }
  .link-review-media > header { display: grid; }
  .link-review-media > header .btn { width: 100%; }
  .link-review-image,
  .link-review-image.empty-state { min-height: 230px; }
  .screening-control-bar { display: grid; }
  .screening-control-bar > .tag { justify-self: start; }
  .screening-batch-body > .btn { width: 100%; }
}
