:root {
  color-scheme: light;
  --ink: #202431;
  --muted: #737c8c;
  --line: #e7e9ee;
  --panel: #ffffff;
  --ground: #f5f6f9;
  --blue: #5268f2;
  --blue-deep: #4056e3;
  --blue-soft: #edf0ff;
  --mint: #3d9b7a;
  --amber: #a97920;
  --red: #c15b60;
  --shadow: 0 10px 30px rgba(31, 43, 75, .045), 0 1px 2px rgba(31, 43, 75, .035);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif; font-size: 14px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar { height: 68px; padding: 0 clamp(20px, 5vw, 74px); background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); font-weight: 800; font-size: 16px; letter-spacing: -.04em; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--blue); color: #fff; font-family: "Segoe UI", sans-serif; font-weight: 800; font-size: 17px; box-shadow: 0 5px 12px rgba(82,104,242,.25); }
.topbar-right { display: flex; align-items: center; gap: 17px; }
.local-tag { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.local-tag i, .small-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #43aa82; box-shadow: 0 0 0 3px #e6f5ef; }
.state-pill, .channel-badge, .count-chip, .receipt-pill { border-radius: 999px; padding: 6px 10px; font-size: 11px; line-height: 1; font-weight: 700; white-space: nowrap; }
.state-good { background: #e9f7f1; color: #398468; }
.state-warn { background: #fff4df; color: #a97920; }
.state-muted { background: #eef0f4; color: #6d7584; }
.workspace { width: min(1280px, calc(100vw - 48px)); margin: 0 auto; padding: 40px 0 28px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 25px; }
.eyebrow { margin: 0 0 8px; color: #9198a7; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
h1, h2, p { margin-top: 0; }
h1 { margin: 0; font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif; letter-spacing: -.04em; font-size: 30px; line-height: 1.2; font-weight: 800; }
.subheading { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.account-card { display: grid; grid-template-columns: minmax(175px, 1fr) 1px minmax(175px, 1fr); align-items: center; gap: 13px; min-width: 410px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.account-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.account-divider { width: 1px; height: 36px; background: var(--line); }
.account-avatar { display: grid; place-items: center; height: 34px; width: 34px; border-radius: 11px; background: #f0ebff; color: #7661c6; font-family: "Segoe UI", sans-serif; font-weight: 800; }
.account-avatar.media-avatar { background: #e9f7f1; color: #3d8d72; }
.account-lines { display: grid; gap: 3px; flex: 1; }
.account-lines strong { font-size: 12px; }
.account-lines small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: "Segoe UI", sans-serif; font-size: 10px; }
.account-lock { color: #81889a; font-size: 18px; }
.notice { margin: 0 0 20px; padding: 11px 14px; border: 1px solid #e3e7ff; background: #f0f2ff; border-radius: 11px; display: flex; align-items: center; gap: 10px; color: #586487; font-size: 12px; }
.notice-warn { border-color: #f3e5bd; background: #fff8e8; color: #8b6e32; }
.notice-icon { display: grid; place-items: center; flex: 0 0 auto; width: 19px; height: 19px; border-radius: 50%; background: #fff; color: var(--blue); font-family: Georgia, serif; font-weight: 700; }
.capability-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.capability-strip > div { min-width: 0; display: grid; grid-template-columns: 31px minmax(0, 1fr); align-items: center; column-gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.76); }
.capability-strip strong, .capability-strip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capability-strip strong { align-self: end; font-size: 10px; }
.capability-strip small { align-self: start; color: #929aaa; font-size: 8px; }
.capability-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 800; }
.capability-strip > div:nth-child(3) .capability-icon { background: #fff1e9; color: #b87553; }
.capability-strip > div:nth-child(4) .capability-icon { background: #eaf7f2; color: #418b73; }
.two-column { display: grid; grid-template-columns: minmax(350px, .94fr) minmax(480px, 1.06fr); gap: 18px; align-items: stretch; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.audience-panel, .composer-panel { min-height: 560px; padding: 22px; display: flex; flex-direction: column; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.panel-heading .eyebrow { margin-bottom: 6px; }
.count-chip { display: flex; gap: 6px; align-items: center; background: var(--blue-soft); color: var(--blue); padding: 7px 10px; }
.count-chip b { font-size: 12px; }
.count-chip span { font-size: 10px; font-weight: 600; }
.message-search { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fafbff; }
.message-search summary { padding: 11px 12px; color: var(--blue); font-size: 12px; font-weight: 700; cursor: pointer; }
.message-search-body { display: grid; gap: 9px; padding: 0 12px 12px; }
.rule-field { display: grid; gap: 5px; color: #737c8c; font-size: 10px; }
.rule-field input, .rule-field select { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); font-size: 11px; }
.rule-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-actions button { padding: 7px 9px; border: 1px solid #dce2ff; border-radius: 7px; background: white; color: var(--blue); font-size: 10px; }
.rule-actions button:first-child { background: var(--blue); color: white; border-color: var(--blue); }
.rule-actions button:disabled { opacity: .45; cursor: not-allowed; }
.rule-result { margin: 0; color: #838b9c; font-size: 10px; line-height: 1.5; }
.searchbox { margin-top: 21px; height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: #a3a9b5; }
.searchbox > span { font-size: 20px; line-height: 1; }
.searchbox input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.searchbox input::placeholder { color: #a3a9b5; }
kbd { border: 1px solid #e4e6eb; border-radius: 5px; padding: 2px 5px; color: #a4aab4; background: #fafbfc; font-size: 9px; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 2px 10px; color: #969dac; font-size: 10px; }
.text-button { color: var(--blue); border: 0; background: transparent; font-size: 11px; font-weight: 700; padding: 3px 0; }
.text-button:hover { color: var(--blue-deep); }
.group-list { flex: 1; min-height: 250px; max-height: 390px; overflow: auto; padding: 0 3px 0 0; scrollbar-color: #d8dce6 transparent; scrollbar-width: thin; }
.selected-preview { display: flex; align-content: flex-start; flex-wrap: wrap; gap: 5px; max-height: 72px; min-height: 29px; overflow: auto; margin-top: 7px; padding: 2px 0; }
.selected-preview.empty { align-items: center; color: #a5abb7; font-size: 10px; }
.selected-chip { max-width: 175px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px 4px 9px; border: 1px solid #e5e8fb; border-radius: 999px; background: #f5f6ff; color: #6974b2; font-size: 9px; }
.selected-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-chip button { padding: 0; border: 0; background: transparent; color: #8d95b7; font-size: 13px; line-height: 1; }
.selected-chip button:hover { color: #c15b60; }
.group-row { min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 10px; cursor: pointer; transition: background .15s ease; }
.group-row:hover { background: #f7f8fb; }
.group-row:has(input:checked) { background: #f1f3ff; }
.group-row input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.group-avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: #eef1f6; color: #677287; font-size: 12px; font-weight: 700; }
.group-row:nth-child(4n+2) .group-avatar { background: #e9f5f2; color: #478d7a; }
.group-row:nth-child(4n+3) .group-avatar { background: #fff1e9; color: #bf7957; }
.group-row:nth-child(4n+4) .group-avatar { background: #f2edff; color: #8066b7; }
.group-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.group-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.group-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #a0a6b1; font-size: 9px; font-family: "Segoe UI", sans-serif; }
.row-check { display: none; color: var(--blue); font-size: 13px; font-weight: 800; }
.group-row:has(input:checked) .row-check { display: block; }
.audience-footer { display: flex; align-items: center; gap: 9px; padding-top: 14px; margin-top: 8px; border-top: 1px solid #f0f1f4; color: #9aa1ae; font-size: 10px; }
.small-dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px #e6f5ef; }
.channel-badge { background: #eef7f4; color: #498e78; }
.composer-heading { margin-bottom: 20px; }
.media-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 0 0 17px; padding: 13px; border: 1px solid #dfe4ff; border-radius: 11px; background: #f8f9ff; }
.media-context-heading { grid-column: 1 / -1; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.media-context-heading > div { display: grid; gap: 3px; }
.media-context-heading strong { font-size: 11px; }
.media-context-heading small { color: #838da1; font-size: 9px; line-height: 1.45; }
.account-bound-chip { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: #e9edff; color: #5969ba; font-size: 9px; font-weight: 700; }
.media-context .rule-field { font-size: 9px; }
.media-context input, .media-context select { background: #fff; }
.media-context .media-group-list, .media-context .rule-result { grid-column: 1 / -1; }
.media-context .rule-result { margin: 0; }
.media-plan-actions { margin-top: 9px; }
.plan-legend { display: grid; gap: 4px; margin-top: 10px; padding: 9px 10px; border: 1px solid #f0e5c9; border-radius: 8px; background: #fffaf0; color: #8f774a; }
.plan-legend strong { font-size: 10px; }
.plan-legend span { font-size: 9px; line-height: 1.5; }
.media-send-guidance { display: grid; gap: 5px; margin-top: 18px; padding: 12px 13px; border: 1px solid #dfe4ff; border-radius: 9px; background: #f7f8ff; color: #687497; }
.media-send-guidance strong { font-size: 10px; color: #4e5e9c; }
.media-send-guidance span { font-size: 9px; line-height: 1.55; }
.tabs { display: flex; align-items: center; gap: 5px; padding: 4px; border-radius: 10px; background: #f4f5f8; }
.tab { flex: 1; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: #8a91a0; font-size: 11px; font-weight: 700; }
.tab span { margin-right: 5px; font-size: 13px; }
.tab.active { background: #fff; color: var(--blue); box-shadow: 0 2px 6px rgba(35,45,75,.08); }
.compose-pane { flex: 1; padding-top: 19px; }
.hidden { display: none !important; }
.field-label { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 700; }
textarea { width: 100%; min-height: 205px; resize: vertical; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fff; color: var(--ink); font-size: 13px; line-height: 1.7; }
textarea:focus, .searchbox:focus-within { border-color: #aab5ff; box-shadow: 0 0 0 3px rgba(82,104,242,.08); }
textarea::placeholder { color: #b3b8c3; }
.field-meta { display: flex; justify-content: space-between; margin-top: 7px; color: #a0a6b1; font-size: 10px; }
.delivery-note { display: flex; gap: 8px; align-items: center; margin-top: 17px; padding: 10px 11px; border-radius: 9px; background: #f7f8fc; color: #828b9c; font-size: 10px; }
.note-icon { color: var(--blue); font-size: 15px; }
.send-review { margin-top: auto; padding-top: 18px; border-top: 1px solid #eef0f4; }
.confirm-check { display: flex; align-items: center; gap: 8px; color: #697284; font-size: 11px; cursor: pointer; }
.confirm-check input { width: 14px; height: 14px; margin: 0; accent-color: var(--blue); }
.send-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.expiry-note { color: #a0a6b1; font-size: 10px; }
.send-button { display: flex; gap: 19px; align-items: center; justify-content: center; min-width: 167px; padding: 11px 15px; border: 0; border-radius: 9px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 5px 13px rgba(82,104,242,.2); transition: background .15s, transform .15s; }
.send-button:hover:not(:disabled) { background: var(--blue-deep); transform: translateY(-1px); }
.send-button:disabled { cursor: not-allowed; background: #c5cbdf; box-shadow: none; }
.inline-error { margin: 11px 0 0; color: var(--red); font-size: 11px; }
.dropzone { min-height: 240px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 20px; border: 1px dashed #cdd2e0; border-radius: 12px; background: #fafbfe; cursor: pointer; text-align: center; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone strong { margin-top: 3px; font-size: 12px; }
.dropzone small { color: #929aaa; font-size: 10px; }
.video-dropzone { min-height: 210px; }
.upload-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 13px; background: var(--blue-soft); color: var(--blue); font-size: 22px; }
.media-preview { max-width: 100%; max-height: 170px; margin-top: 8px; border-radius: 8px; object-fit: contain; }
.file-preview-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; color: var(--muted); font-size: 10px; }
.file-preview-item { min-width: 0; display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 9px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.file-preview-item img { width: 56px; height: 56px; border-radius: 7px; background: #eef1f6; object-fit: cover; }
.file-preview-item > div { min-width: 0; display: grid; gap: 3px; }
.file-preview-item strong, .file-preview-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-item strong { color: var(--ink); font-size: 10px; }
.media-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 10px; margin: 10px 0 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfe; font-size: 10px; }
.media-meta dt { color: #929aaa; }
.media-meta dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.pane-intro { margin: 0 0 12px; color: #747e91; font-size: 10px; line-height: 1.6; }
.order-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding: 9px 10px; border: 1px solid #e4e8ff; border-radius: 9px; background: #f7f8ff; color: #6471b3; font-size: 9px; }
.order-flow span { padding: 4px 7px; border-radius: 999px; background: #fff; font-weight: 700; }
.order-flow b { color: #a1a9cb; }
.order-flow small { flex-basis: 100%; color: #8c94a8; }
#refresh-stickers, #load-favorite-catalog, #register-favorite { padding: 7px 9px; border: 1px solid #dce2ff; border-radius: 7px; background: #fff; color: var(--blue); font-size: 9px; }
#refresh-stickers { margin-right: 5px; }
#favorite-to-register { max-width: 100%; margin: 8px 5px 8px 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font-size: 9px; }
.drafts-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.drafts-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; }
.drafts-heading button { border: 0; background: transparent; color: var(--blue); font-size: 10px; }
.media-group-list { display: grid; gap: 5px; max-height: 180px; overflow-y: auto; padding: 7px; border: 1px solid var(--line); border-radius: 8px; }
.media-group-option { display: flex; align-items: flex-start; gap: 7px; padding: 5px; font-size: 11px; cursor: pointer; overflow-wrap: anywhere; }
.media-group-option input { flex-shrink: 0; margin-top: 3px; }
.media-group-option span { min-width: 0; }
.drafts-list { display: grid; gap: 7px; margin-top: 9px; font-size: 10px; color: var(--muted); }
.draft-entry { display: grid; gap: 3px; padding: 7px 4px; border-top: 1px solid #edf0f4; }
.draft-entry strong { font-size: 10px; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.draft-entry small { color: var(--muted); }
.draft-entry-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.draft-entry-heading > small { text-align: right; }
.draft-entry-heading button { flex: 0 0 auto; padding: 4px 7px; border: 1px solid #dce2ff; border-radius: 6px; background: #fff; color: var(--blue); font-size: 9px; }
.draft-entry-heading button:disabled { opacity: .55; cursor: default; }
.draft-files { display: grid; gap: 4px; margin-top: 5px; }
.draft-file { display: grid; gap: 2px; padding: 5px 7px; border-radius: 6px; background: #f8f9fc; }
.draft-file strong, .draft-file small { overflow-wrap: anywhere; }
.stage-button { margin-top: 12px; width: 100%; padding: 10px 12px; color: var(--blue); border: 1px solid #cfd7ff; border-radius: 9px; background: #f8f9ff; font-size: 11px; font-weight: 700; }
.stage-button:disabled { opacity: .5; cursor: not-allowed; }
.locked-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; padding: 11px 12px; border: 1px solid #f0e5c9; border-radius: 9px; background: #fffaf0; color: #947540; }
.locked-note > span { font-size: 16px; }
.locked-note div { display: grid; gap: 3px; }
.locked-note strong { font-size: 10px; }
.locked-note small { color: #9e8b66; font-size: 10px; line-height: 1.5; }
.history-panel { margin-top: 19px; padding: 21px 22px 14px; }
.history-heading { margin-bottom: 13px; }
.history-list { display: grid; gap: 8px; }
.operation-card { overflow: hidden; border: 1px solid #edf0f4; border-radius: 11px; background: #fff; }
.operation-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; }
.operation-summary > div { display: grid; gap: 3px; }
.operation-summary strong { font-size: 11px; }
.operation-summary small { color: #9aa1ae; font-size: 9px; }
.receipt-pill { font-size: 9px; }
.receipt-good { background: #e9f7f1; color: #398468; }
.receipt-pending { background: #fff4df; color: #a97920; }
.receipt-unknown { background: #fbecee; color: #b5545b; }
.operation-targets { padding: 0 13px 8px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px 13px; }
.target-receipt { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 3px 0; color: #858d9b; font-size: 9px; }
.target-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-status { white-space: nowrap; }
.receipt-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #c3c8d2; }
.dot-good { background: #4da487; }
.dot-pending { background: #d6a64b; }
.dot-bad { background: #c9646a; }
.dot-muted { background: #adb3bf; }
.footer-note { display: flex; justify-content: space-between; padding: 16px 2px 0; color: #a0a6b1; font-size: 9px; }
.empty-state, .loading-state { min-height: 160px; display: grid; place-items: center; color: #a0a6b1; font-size: 11px; text-align: center; }
.loading-state { display: flex; gap: 9px; justify-content: center; }
.spinner { width: 13px; height: 13px; border: 2px solid #e1e4ed; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.action-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 15px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(25, 34, 59, .24); }
.action-dialog::backdrop { background: rgba(28, 34, 50, .42); backdrop-filter: blur(2px); }
.action-dialog form { display: grid; gap: 12px; padding: 22px; }
.action-dialog h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.dialog-message { margin: 0; color: #687184; font-size: 11px; line-height: 1.65; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 3px; }
.primary-button, .secondary-button, .danger-button { min-width: 76px; padding: 8px 12px; border-radius: 8px; font-size: 10px; font-weight: 700; }
.primary-button { border: 1px solid var(--blue); background: var(--blue); color: #fff; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: #687184; }
.danger-button { border: 1px solid #b94e56; background: #b94e56; color: #fff; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(82,104,242,.25); outline-offset: 2px; }
#sticker-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 8px; margin: 12px 0; }
#sticker-assets .sticker-asset { display: grid; grid-template-columns: 18px 58px minmax(0, 1fr); align-items: center; gap: 7px; padding: 9px; border: 1px solid #e4e7f1; border-radius: 9px; background: #fff; cursor: pointer; }
#sticker-assets .sticker-asset:has(input:checked) { border-color: #8d99ed; background: #f4f5ff; }
#sticker-assets .sticker-asset input { margin: 0; accent-color: var(--blue); }
#sticker-assets .sticker-asset img { width: 58px; height: 58px; object-fit: contain; border-radius: 7px; background: #f7f8fb; }
#sticker-assets .sticker-asset span { min-width: 0; color: #778095; font-size: 8px; line-height: 1.45; overflow-wrap: anywhere; }
#sticker-text { box-sizing: border-box; width: 100%; min-height: 84px; max-height: 180px; resize: vertical; padding: 10px; border: 1px solid #e4e7f1; border-radius: 8px; font: inherit; }
#sticker-pane > label:not(.field-label) { display: flex; align-items: center; gap: 7px; margin: 10px 0; color: #687184; font-size: 9px; }

@media (max-width: 900px) {
  .workspace { width: min(700px, calc(100% - 28px)); padding-top: 27px; }
  .two-column { grid-template-columns: minmax(0, 1fr); }
  .audience-panel, .composer-panel { min-height: auto; }
  .group-list { max-height: 350px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .account-card { width: 100%; }
  .capability-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .topbar { padding: 0 16px; }
  .workspace { width: calc(100% - 22px); padding-top: 23px; }
  .topbar-right { gap: 9px; }
  .local-tag { display: none; }
  .page-heading { margin-bottom: 17px; }
  .page-heading > div { min-width: 0; }
  .account-card { width: 100%; min-width: 0; grid-template-columns: 1fr; gap: 9px; }
  .account-divider { width: 100%; height: 1px; }
  .capability-strip { grid-template-columns: 1fr; }
  .capability-strip > div { padding: 9px 10px; }
  .audience-panel, .composer-panel, .history-panel { padding: 16px; border-radius: 13px; }
  h1 { font-size: 26px; }
  .media-context { grid-template-columns: 1fr; padding: 11px; }
  .media-context .media-group-list, .media-context .rule-result, .media-context-heading { grid-column: 1; }
  .file-preview-list { grid-template-columns: 1fr; }
  .tabs { gap: 3px; padding: 3px; overflow-x: auto; }
  .tab { min-width: 68px; padding-inline: 5px; font-size: 10px; }
  .tab span { margin-right: 3px; font-size: 12px; }
  .send-row { align-items: flex-start; flex-direction: column; }
  .send-button { width: 100%; }
  .operation-targets { grid-template-columns: 1fr; }
  .footer-note { align-items: flex-start; flex-direction: column; gap: 5px; }
}

/* Public gateway additions */
.account-switcher { margin: 0 0 17px; padding: 17px 19px; background: #fff; border: 2px solid #cbd5ff; border-radius: 15px; box-shadow: var(--shadow); }
.account-switcher-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 16px; margin-bottom: 12px; }
.account-switcher-title strong { font-size: 17px; color: #253fbe; }
.account-switcher-title span { color: #737d8f; font-size: 12px; line-height: 1.5; }
.account-switcher-controls { display: flex; gap: 11px; align-items: flex-end; }
.account-switcher-controls label { display: grid; gap: 6px; min-width: 0; flex: 1; font-weight: 700; font-size: 12px; color: #47516a; }
.account-switcher-controls select { width: 100%; height: 46px; min-width: 0; padding: 0 13px; border: 1px solid #b9c5f6; border-radius: 10px; background: #f7f8ff; color: #27365b; font-size: 16px; font-weight: 700; }
.account-switcher-controls select:focus-visible, .account-refresh-button:focus-visible { outline: 3px solid #99acff; outline-offset: 2px; }
.account-refresh-button { flex: 0 0 auto; min-height: 46px; padding: 0 16px; border: 1px solid #cbd5ff; border-radius: 10px; background: #eef0ff; color: #4257ca; font-weight: 700; }
.account-refresh-button:disabled { opacity: .6; cursor: wait; }
.account-switch-status { margin: 11px 0 0; color: #596783; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.node-picker { display: flex; align-items: center; gap: 8px; }
.node-picker label { display: flex; flex-direction: column; gap: 2px; font-size: 10px; color: #6b7280; }
.node-picker select { min-width: 132px; height: 31px; border: 1px solid #dbe2ea; border-radius: 8px; background: #fff; color: #172033; padding: 0 8px; font: inherit; font-size: 12px; }
.remote-banner { margin: 0 0 16px; padding: 11px 14px; border-radius: 11px; border: 1px solid #f2d48b; background: #fff9e9; color: #72520a; font-size: 13px; line-height: 1.55; }
.remote-banner-error { border-color: #f1b7b7; background: #fff2f2; color: #8b2626; }
.node-status-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.node-status-grid > div { min-width: 0; padding: 11px 13px; border: 1px solid #e3e8ef; border-radius: 11px; background: #fff; box-shadow: 0 4px 12px rgba(15, 23, 42, .035); }
.node-status-grid small { display: block; color: #7a8494; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 5px; }
.node-status-grid strong { display: block; color: #172033; font-size: 13px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-status-grid span { display: block; color: #6b7280; font-size: 11px; line-height: 1.4; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-warning { margin: 0 0 12px; padding: 10px 12px; border-radius: 9px; border: 1px solid #f2d48b; background: #fff9e9; color: #72520a; font-size: 12px; line-height: 1.5; }
.tab.disabled-tab { opacity: .55; }
.native-check { margin-top: 4px; padding: 0; font-size: 10px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 0%, #eaf0ff, transparent 42%), #f6f8fb; }
.login-card { width: min(430px, 100%); padding: 30px; border: 1px solid #e3e8ef; border-radius: 18px; background: #fff; box-shadow: 0 18px 60px rgba(15, 23, 42, .12); }
.login-card h1 { margin: 8px 0 6px; font-size: 28px; }
.login-card p { color: #6b7280; font-size: 13px; line-height: 1.6; }
.login-card label { display: block; margin-top: 15px; color: #374151; font-size: 12px; font-weight: 600; }
.login-card input { display: block; width: 100%; margin-top: 6px; height: 42px; border: 1px solid #dbe2ea; border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; color: #172033; background: #fff; }
.login-card button { width: 100%; height: 44px; margin-top: 20px; border: 0; border-radius: 10px; background: #3f5bd9; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.login-card button:disabled { opacity: .6; cursor: wait; }
.login-error { margin-top: 13px; padding: 9px 11px; border-radius: 8px; background: #fff2f2; color: #8b2626; font-size: 12px; line-height: 1.5; }
.login-note { margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf0f5; color: #8a93a3; font-size: 11px; line-height: 1.6; }
@media (max-width: 1100px) {
  .node-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 9px; }
  .topbar-right { flex-wrap: wrap; justify-content: flex-end; }
  .node-picker { width: 100%; justify-content: flex-end; }
  .node-picker label { flex: 1; }
  .node-picker select { width: 100%; min-width: 0; }
  .node-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .topbar-right { width: 100%; justify-content: space-between; }
  .node-picker { flex-direction: column; align-items: stretch; }
  .node-status-grid { grid-template-columns: 1fr; }
  .account-switcher { padding: 14px; }
  .account-switcher-title strong { font-size: 16px; }
  .account-switcher-controls { flex-direction: column; align-items: stretch; }
  .account-refresh-button { width: 100%; }
  .login-card { padding: 22px; }
}
