:root {
  color-scheme: light;
  --bg: #f4f7f9;
  --panel: #ffffff;
  --text: #17212b;
  --muted: #6b7a89;
  --line: #dfe7ed;
  --primary: #229ed9;
  --primary-dark: #1686bc;
  --success: #258c60;
  --danger: #c23b49;
  --gold: #a66b00;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--primary-dark); text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.topbar { height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: #17212b; color: white; }
.brand { color: white; font-weight: 750; font-size: 18px; }
.link-button { color: #d9e7f0; background: transparent; border: 0; }
.container { width: min(1180px, calc(100% - 32px)); margin: 34px auto 80px; }
.page-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
h1 { margin: 0 0 6px; font-size: 30px; }
h2 { margin: 0 0 18px; font-size: 19px; }
.muted { color: var(--muted); }
.page-heading .muted { margin: 0; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; margin-top: 26px; }
.group-card, .panel, .empty-state { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 5px 18px rgba(23, 33, 43, .04); }
.group-card { display: block; height: 100%; padding: 22px 22px 22px 52px; color: var(--text); transition: transform .15s ease, box-shadow .15s ease; }
.group-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(23, 33, 43, .09); }
.group-select-card { position: relative; min-width: 0; }
.group-check-label { position: absolute; z-index: 2; top: 20px; left: 18px; display: block; cursor: pointer; }
.group-check-label input { width: 19px; height: 19px; accent-color: var(--primary); cursor: pointer; }
.bulk-toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.bulk-toolbar small { margin-left: auto; }
.danger-button:disabled { cursor: not-allowed; opacity: .48; }
.group-title { font-size: 19px; font-weight: 700; }
.group-id { color: var(--muted); font-size: 12px; margin: 6px 0 20px; }
.stats-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.status, .badge { display: inline-flex; border-radius: 999px; padding: 4px 9px; background: #edf2f5; color: #52606d; font-size: 12px; white-space: nowrap; }
.status.active { background: #e1f5eb; color: var(--success); }
.status.inactive, .badge.danger { background: #fde8ea; color: var(--danger); }
.badge.success { background: #e1f5eb; color: var(--success); }
.badge.warning { background: #fff0cb; color: var(--gold); }
.badge.gold { background: #fff0cb; color: var(--gold); }
.panel { padding: 24px; margin-top: 22px; }
.takeover-panel { border-color: #b9ddeb; background: linear-gradient(145deg, #fff, #f3fbff); }
.runtime-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.runtime-summary div { display: grid; gap: 6px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.runtime-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runtime-error { margin: 0 0 16px; padding: 11px 13px; border-radius: 9px; background: #fde8ea; color: var(--danger); overflow-wrap: anywhere; }
.takeover-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.takeover-note { margin-top: 16px; padding: 12px 14px; border-radius: 9px; background: #fff5d8; color: #6f5000; line-height: 1.55; }
.bot-profile-editor { display: grid; gap: 14px; margin-top: 20px; padding-top: 20px; border-top: 1px solid #cfe4ee; }
.bot-profile-editor h3 { margin: 0 0 6px; font-size: 17px; }
.bot-profile-editor p { margin: 0; }
.bot-profile-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: end; }
.full-width { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 14px; font-weight: 650; }
input, textarea, select { min-width: 0; padding: 10px 11px; border: 1px solid #cbd7df; border-radius: 8px; background: white; color: var(--text); }
textarea { width: 100%; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(34, 158, 217, .14); border-color: var(--primary); }
small { color: var(--muted); font-weight: 400; }
.checkbox-label { flex-direction: row; align-items: center; align-self: center; }
.checkbox-label input { width: 17px; height: 17px; }
.primary, button, .button-link { display: inline-flex; align-items: center; justify-content: center; padding: 9px 13px; border: 1px solid #c8d4dc; border-radius: 8px; background: #f7fafb; color: #243441; line-height: normal; }
.primary { border-color: var(--primary); background: var(--primary); color: white; font-weight: 700; }
.primary:hover { background: var(--primary-dark); }
.gold-button { border-color: #e7c260; background: #fff5d8; color: #845600; }
.danger-button { border-color: #efb8be; background: #fff2f3; color: var(--danger); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.inline-form, .search-form { display: flex; gap: 7px; align-items: center; }
.inline-form input { width: 145px; }
.keyword-admin-form { align-items: stretch; min-width: 360px; }
.keyword-admin-form textarea { min-width: 230px; }
.search-form input { width: 230px; }
.member-pagination { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.member-pagination-summary { color: var(--muted); font-size: 13px; }
.member-pagination-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.page-button { display: inline-flex; min-width: 38px; height: 38px; align-items: center; justify-content: center; padding: 0 11px; border: 1px solid #c8d4dc; border-radius: 8px; background: #f7fafb; color: #243441; }
.page-button:hover { border-color: var(--primary); color: var(--primary-dark); }
.page-button.active { border-color: var(--primary); background: var(--primary); color: white; font-weight: 750; }
.page-button.disabled { pointer-events: none; opacity: .42; }
.page-ellipsis { padding: 0 3px; color: var(--muted); }
.page-jump-form { display: inline-flex; align-items: center; gap: 7px; }
.page-jump-form input { width: 78px; height: 38px; padding: 7px 9px; text-align: center; }
.page-jump-form button { height: 38px; }
.invitation-heading-actions { display: grid; grid-template-columns: repeat(3, auto); align-items: center; justify-items: end; gap: 8px; }
.invitation-heading-actions .search-form { grid-column: 1 / -1; }
.section-anchor, #moderation, #integration, #support-agents, #ads, #invitations, #keyword-monitors { scroll-margin-top: 78px; }
.business-workbench { margin-top: 24px; padding: 8px 12px; border: 1px solid #dce6ef; border-radius: 13px; background: #fff; box-shadow: 0 8px 25px rgba(31, 55, 84, .06); }
.business-workbench-heading { display: none; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.business-workbench-heading h2 { margin: 3px 0 0; font-size: 22px; }
.business-workbench-heading small { color: var(--primary-dark); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.business-workbench-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.business-nav { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 5px; }
.business-nav a { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 5px; padding: 11px 5px; border: 0; border-radius: 7px; background: white; color: #26394f; font-size: 12px; font-weight: 750; text-align: center; white-space: nowrap; transition: color .15s ease, background .15s ease, box-shadow .15s ease; }
.business-nav a i { color: #7590ad; font-size: 15px; font-style: normal; line-height: 1; }
.business-nav a:hover { background: #eff6ff; color: #075dd8; }
.business-nav a.active { background: #0868ef; color: white; box-shadow: 0 5px 13px rgba(8,104,239,.22); }
.business-nav a.active i { color: white; }
.business-module-context { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; margin-top: 14px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--muted); font-size: 13px; }
.business-back-link { display: inline-flex; align-items: center; min-height: 36px; padding: 8px 12px; border: 1px solid #b9ddeb; border-radius: 8px; background: #eef8fc; color: var(--primary-dark); font-weight: 750; }
.finance-overview { border-color: #b9ddeb; background: linear-gradient(180deg, #fff, #fbfdfe); }
.finance-overview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.finance-overview-heading h2 { margin-bottom: 7px; font-size: 23px; }
.finance-overview-heading p { max-width: 720px; margin: 0; line-height: 1.55; }
.finance-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.range-tabs { display: inline-flex; overflow: hidden; border: 1px solid #c8d4dc; border-radius: 8px; }
.range-tabs a { padding: 9px 11px; color: #52606d; background: white; white-space: nowrap; }
.range-tabs a + a { border-left: 1px solid #dbe4ea; }
.range-tabs a.active { background: #eaf6fb; color: var(--primary-dark); font-weight: 750; }
.finance-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.finance-kpis > div { display: grid; min-width: 0; gap: 7px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.finance-kpis > .finance-kpi-card { grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 11px; }
.finance-kpi-card > div { display: grid; min-width: 0; gap: 7px; }
.finance-kpi-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: #0868ef; color: #fff; font-size: 18px; font-style: normal; font-weight: 850; box-shadow: 0 5px 12px rgba(8,104,239,.18); }
.tone-cyan .finance-kpi-icon { background: #11b7d4; box-shadow: 0 5px 12px rgba(17,183,212,.18); }
.tone-indigo .finance-kpi-icon { background: #5b74ed; box-shadow: 0 5px 12px rgba(91,116,237,.18); }
.tone-violet .finance-kpi-icon { background: #7659e8; box-shadow: 0 5px 12px rgba(118,89,232,.18); }
.tone-coral .finance-kpi-icon { background: #f2604d; box-shadow: 0 5px 12px rgba(242,96,77,.18); }
.tone-amber .finance-kpi-icon { background: #f3a315; box-shadow: 0 5px 12px rgba(243,163,21,.18); }
.tone-green .finance-kpi-icon { background: #42aa59; box-shadow: 0 5px 12px rgba(66,170,89,.18); }
.tone-orange .finance-kpi-icon { background: #ff8b00; box-shadow: 0 5px 12px rgba(255,139,0,.18); }
.finance-kpis span { color: var(--muted); font-size: 13px; }
.finance-kpis strong { overflow-wrap: anywhere; font-size: 20px; }
.finance-kpis .retained { border-color: #91d0ad; background: #f3fcf7; }
.finance-kpis .retained strong { color: var(--success); }
.finance-visual-grid, .finance-management-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .9fr); gap: 14px; margin-top: 14px; }
.finance-management-grid.single { grid-template-columns: 1fr; }
.finance-chart-card, .finance-management-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.finance-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.finance-card-heading h3 { margin: 0; font-size: 16px; }
.finance-card-heading small { display: block; margin-top: 4px; }
.legend { display: inline-block; width: 12px; height: 5px; margin: 0 4px 2px 10px; border-radius: 999px; background: var(--primary); }
.legend.expense { background: #ef8d38; }
.finance-line-chart { width: 100%; overflow-x: auto; }
.finance-line-chart svg { display: block; width: 100%; min-width: 520px; height: 235px; overflow: visible; }
.finance-chart-grid line { stroke: #e6edf5; stroke-width: 1; }
.finance-chart-grid text { fill: #8796aa; font-size: 9px; text-anchor: end; }
.finance-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.income-line { stroke: #1677ff; }
.expense-line { stroke: #ff7a00; }
.finance-chart-point { stroke: white; stroke-width: 2; vector-effect: non-scaling-stroke; }
.income-point { fill: #1677ff; }
.expense-point { fill: #ff7a00; }
.finance-chart-date { fill: #718197; font-size: 9px; text-anchor: middle; }
.finance-donut-layout { display: grid; min-height: 235px; grid-template-columns: minmax(150px, .8fr) minmax(190px, 1.2fr); align-items: center; gap: 18px; }
.finance-donut { position: relative; width: min(190px, 100%); margin: auto; aspect-ratio: 1; }
.finance-donut svg { display: block; width: 100%; height: 100%; }
.donut-track, .donut-segment { fill: none; stroke-width: 6; }
.donut-track { stroke: #edf2f7; }
.donut-segment { transform: rotate(-90deg); transform-origin: center; transition: stroke-width .15s ease; }
.donut-segment:hover { stroke-width: 7; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { font-size: 19px; }
.donut-center span { margin-top: 3px; color: #687a90; font-size: 11px; }
.donut-legend { display: grid; gap: 12px; }
.donut-legend > div { display: grid; grid-template-columns: 10px minmax(90px, 1fr) auto; align-items: center; gap: 7px; }
.donut-legend > div i { width: 9px; height: 9px; border-radius: 50%; }
.donut-legend > div span { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend > div strong { color: #4c5d72; font-size: 12px; }
.donut-legend > div small { grid-column: 2 / 4; color: #8090a4; font-size: 11px; }
.mix-1 { stroke: #397dff; background: #397dff; }
.mix-2 { stroke: #18b9d1; background: #18b9d1; }
.mix-3 { stroke: #735ee8; background: #735ee8; }
.mix-4 { stroke: #ffa11a; background: #ffa11a; }
.mix-5 { stroke: #48ad5c; background: #48ad5c; }
.mix-6 { stroke: #f06455; background: #f06455; }
.template-library { margin-top: 14px; }
.template-library-note { margin: 16px 0 0; }
.finance-pending-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 22px; }
.finance-pending-strip a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfc; color: #33434f; }
.finance-pending-strip strong { display: grid; min-width: 27px; height: 27px; place-items: center; border-radius: 50%; background: #eaf6fb; color: var(--primary-dark); }
.finance-ledger-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.finance-ledger-heading h3 { margin: 0 0 5px; }
.finance-ledger-heading p { margin: 0; }
.finance-filter-form { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.finance-filter-form input:first-child { width: 220px; }
.finance-ledger-table { min-width: 980px; margin-top: 12px; }
.finance-management-card { margin-top: 0; }
.inflow-actions { display: grid; min-width: 330px; gap: 7px; }
.inflow-actions form { display: flex; gap: 7px; }
.inflow-actions input { min-width: 0; flex: 1; }
.finance-addresses { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfc; }
.finance-addresses summary { cursor: pointer; font-weight: 750; }
.address-create-form { display: grid; grid-template-columns: minmax(170px, .6fr) minmax(320px, 1.4fr) auto; gap: 8px; margin: 14px 0; }
.finance-dialog { width: min(470px, 100vw); height: 100vh; max-width: none; max-height: none; margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid var(--line); background: white; box-shadow: -12px 0 40px rgba(23,33,43,.18); }
.finance-dialog::backdrop { background: rgba(23,33,43,.34); }
.finance-entry-form { display: grid; gap: 15px; min-height: 100%; padding: 24px; overflow-y: auto; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin: 0; font-size: 22px; }
.dialog-heading button { width: 38px; height: 38px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 25px; }
.finance-entry-form .form-actions { justify-content: flex-end; margin-top: auto; padding-top: 15px; border-top: 1px solid var(--line); }
.floating-section-nav { position: fixed; z-index: 50; top: 50%; right: 16px; width: 44px; transform: translateY(-50%); border: 1px solid #b9ddeb; border-radius: 12px; background: white; box-shadow: 0 10px 30px rgba(23, 33, 43, .18); }
.floating-section-nav[open] { width: min(300px, calc(100vw - 32px)); }
.floating-section-nav summary { display: grid; min-height: 116px; place-items: center; padding: 10px 7px; color: var(--primary-dark); font-size: 14px; font-weight: 800; line-height: 1.25; text-align: center; writing-mode: vertical-rl; cursor: pointer; list-style: none; user-select: none; }
.floating-section-nav summary::-webkit-details-marker { display: none; }
.floating-section-nav[open] summary { min-height: 44px; border-bottom: 1px solid var(--line); writing-mode: horizontal-tb; }
.floating-section-nav nav { display: grid; max-height: min(68vh, 620px); overflow-y: auto; padding: 8px; }
.floating-section-nav nav a { padding: 9px 10px; border-radius: 8px; color: #243441; font-size: 13px; line-height: 1.35; }
.floating-section-nav nav a:hover { background: #eaf6fb; color: var(--primary-dark); }
.breadcrumbs { display: flex; gap: 9px; margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.compact { max-height: 420px; overflow: auto; }
.positive { color: var(--success); }
.negative { color: var(--danger); }
.flash { padding: 12px 15px; margin-bottom: 18px; border-radius: 9px; background: #e1f5eb; color: var(--success); }
.flash.error { background: #fde8ea; color: var(--danger); }
.stack-sections { display: grid; gap: 18px; }
.support-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.support-summary div { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfc; }
.support-summary strong { font-size: 19px; }
.support-summary span { color: var(--muted); font-size: 12px; }
.support-agent-create { margin-bottom: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfc; }
.support-agent-table td:first-child { min-width: 210px; }
.support-agent-table td:first-child small { display: block; margin-top: 5px; }
.support-agent-form { display: grid; grid-template-columns: minmax(150px, 1fr) 105px 105px; gap: 8px; align-items: end; min-width: 560px; }
.support-agent-form label { gap: 4px; color: var(--muted); font-size: 12px; }
.support-agent-form .button-row { grid-column: 1 / -1; }
.subpanel { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfc; }
.subpanel h3, .template-grid + h3 { margin-top: 0; }
.toggle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.switch-card { flex-direction: row; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; font-weight: 550; }
.switch-card input { width: 17px; height: 17px; flex: none; }
.moderation-values { margin-bottom: 18px; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.template-card { position: relative; padding: 10px; border: 2px solid var(--line); border-radius: 12px; background: white; cursor: pointer; }
.template-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(34,158,217,.12); }
.template-card.auto-template { cursor: default; opacity: .58; }
.template-card.auto-template.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(34,158,217,.12); opacity: 1; }
.template-card input { position: absolute; top: 15px; left: 15px; width: 18px; height: 18px; }
.template-card img { display: block; width: 100%; aspect-ratio: 3.55 / 1; object-fit: contain; background: #05070a; border-radius: 8px; }
.template-card span { margin-top: 8px; }
.stepper { display: grid; grid-template-columns: 40px 1fr 40px; }
.stepper input { border-radius: 0; text-align: center; }
.stepper button:first-child { border-radius: 8px 0 0 8px; }
.stepper button:last-child { border-radius: 0 8px 8px 0; }
.ad-list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 12px; }
.ad-review-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pending-review-link strong { display: inline-grid; min-width: 22px; height: 22px; place-items: center; margin-left: 4px; padding: 0 5px; border-radius: 999px; color: #fff; background: #ff7a00; }
.ad-list-toolbar .search-form { flex-wrap: wrap; justify-content: flex-end; }
.ad-list { margin-top: 0; }
.ad-thumb { width: 150px; aspect-ratio: 3.55 / 1; object-fit: cover; background: #05070a; border-radius: 7px; }
.action-stack { display: flex; flex-wrap: wrap; gap: 7px; min-width: 220px; }
.compact-award { display: grid; grid-template-columns: 84px auto; gap: 7px; }
.compact-award input { width: 84px; }
.paste-zone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px; border: 2px dashed #9fb5c3; border-radius: 12px; background: #f7fbfd; color: var(--muted); cursor: copy; }
.paste-zone:focus, .paste-zone.dragging { outline: 3px solid rgba(34, 158, 217, .14); border-color: var(--primary); background: #eef8fc; }
.image-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.preview-item { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: white; }
.preview-item img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.preview-item span { display: block; overflow: hidden; padding: 7px 9px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.preview-remove { position: absolute; top: 7px; right: 7px; z-index: 2; width: 28px; height: 28px; padding: 0; border: 2px solid white; border-radius: 50%; background: var(--danger); color: white; font-size: 20px; font-weight: 800; line-height: 1; box-shadow: 0 2px 8px rgba(0,0,0,.28); }
.preview-remove:hover { background: #a72f3c; }
.existing-preview-item { cursor: pointer; }
.existing-preview-item input { position: absolute; opacity: 0; pointer-events: none; }
.existing-preview-item:has(input:checked) img { opacity: .28; }
.existing-preview-item:has(input:checked) .existing-image-remove { background: #17212b; }
.existing-preview-item:has(input:checked)::after { content: "保存后删除"; position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 32px; color: var(--danger); font-weight: 800; pointer-events: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.telegram-preview-section { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #eef5e5; }
.telegram-preview-section h3 { margin: 0 0 5px; }
.telegram-preview-section .muted { margin: 0 0 16px; }
.tg-preview-chat { width: min(460px, 100%); padding: 10px; border-radius: 14px; background: #a8c48d; background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,.18) 0 3px, transparent 4px); background-size: 34px 34px; }
.tg-preview-bubble { position: relative; overflow: hidden; border-radius: 16px 16px 16px 5px; background: white; box-shadow: 0 2px 7px rgba(23,33,43,.16); }
.tg-preview-author { padding: 10px 12px 8px; color: #8c36d9; font-weight: 750; }
.tg-preview-author span { float: right; padding: 2px 7px; border-radius: 999px; background: #e7f5e3; color: #3d9b4c; font-size: 12px; font-weight: 600; }
.tg-preview-media img { display: block; width: 100%; height: auto; object-fit: contain; background: white; }
#tg-preview-custom-media { display: grid; grid-template-columns: 1fr; gap: 2px; background: white; }
#tg-preview-custom-media.media-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#tg-preview-custom-media.media-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#tg-preview-custom-media img { width: 100%; height: 100%; object-fit: contain; }
.tg-preview-caption { padding: 12px 13px 24px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.tg-preview-time { position: absolute; right: 12px; bottom: 57px; color: #8b99a4; font-size: 11px; }
.tg-preview-buttons { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #dce7ed; }
.tg-preview-buttons span { padding: 12px 6px; color: var(--primary-dark); font-weight: 750; text-align: center; }
.tg-preview-buttons span + span { border-left: 1px solid #dce7ed; }
.empty-state { text-align: center; padding: 64px 24px; margin-top: 26px; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #17212b, #21475f); }
.login-card { width: min(420px, 100%); padding: 32px; border-radius: 16px; background: white; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card h1 { font-size: 26px; }
.stack-form { display: grid; gap: 17px; margin-top: 24px; }
code { background: #eaf0f4; padding: 2px 6px; border-radius: 5px; }
.back-to-top { position: fixed; z-index: 60; right: 18px; bottom: 18px; display: grid; width: 52px; height: 52px; padding: 5px; place-items: center; gap: 0; border: 0; border-radius: 15px; background: var(--primary); color: white; box-shadow: 0 9px 24px rgba(22,134,188,.32); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .18s ease, transform .18s ease, background .18s ease; }
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); }
.back-to-top span { margin-bottom: -3px; font-size: 20px; line-height: 1; }
.back-to-top small { color: white; font-size: 10px; font-weight: 750; }

@media (max-width: 1100px) {
  .business-nav { display: flex; overflow-x: auto; padding-bottom: 3px; }
  .business-nav a { min-width: 112px; flex: 0 0 auto; }
}

@media (max-width: 820px) {
  .settings-grid, .two-columns { grid-template-columns: 1fr; }
  .page-heading, .section-heading { align-items: flex-start; flex-direction: column; }
  .search-form { width: 100%; }
  .search-form input { flex: 1; width: auto; }
  .ad-list-toolbar { align-items: stretch; flex-direction: column; }
  .ad-list-toolbar .search-form { justify-content: stretch; }
  .topbar { padding: 0 16px; }
  .toggle-grid, .template-grid { grid-template-columns: 1fr; }
  .ad-thumb { width: 110px; }
  .bulk-toolbar { align-items: flex-start; flex-direction: column; }
  .bulk-toolbar small { margin-left: 0; }
  .runtime-summary, .support-summary { grid-template-columns: 1fr 1fr; }
  .takeover-form, .bot-profile-form { grid-template-columns: 1fr; }
  .member-pagination-controls { gap: 6px; }
  .page-button { min-width: 34px; padding: 0 9px; }
  .invitation-heading-actions { justify-items: start; }
  .floating-section-nav { top: auto; right: 10px; bottom: 82px; transform: none; }
  .floating-section-nav[open] { width: min(300px, calc(100vw - 20px)); }
  .floating-section-nav summary { min-height: 96px; }
  .floating-section-nav[open] summary { min-height: 42px; }
  .business-workbench { padding: 16px; }
  .business-workbench-heading, .business-module-context { align-items: flex-start; flex-direction: column; }
  .business-workbench-heading p { line-height: 1.5; }
  .business-nav { display: flex; }
  .finance-overview-heading, .finance-ledger-heading { align-items: stretch; flex-direction: column; }
  .finance-heading-actions, .finance-filter-form { justify-content: stretch; }
  .range-tabs { width: 100%; }
  .range-tabs a { flex: 1; text-align: center; }
  .finance-kpis { grid-template-columns: 1fr 1fr; }
  .finance-visual-grid, .finance-management-grid { grid-template-columns: 1fr; }
  .finance-donut-layout { grid-template-columns: minmax(130px, .7fr) minmax(180px, 1.3fr); }
  .finance-pending-strip { grid-template-columns: 1fr 1fr; }
  .finance-filter-form > * { flex: 1 1 145px; }
  .finance-filter-form input:first-child { width: auto; flex-basis: 100%; }
  .address-create-form { grid-template-columns: 1fr; }
  .finance-dialog { width: min(100vw, 470px); }
}


/* PREMIUM_V20_STYLE */
.premium-grid,.settings-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;align-items:start}
.premium-grid label,.settings-grid label{display:flex;flex-direction:column;gap:8px;min-width:0}
.premium-grid input,.premium-grid select,.premium-grid textarea,.settings-grid input,.settings-grid select,.settings-grid textarea{width:100%;box-sizing:border-box;min-height:48px}
.premium-grid .full-width,.settings-grid .full-width{grid-column:1/-1}
.segmented-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0}
.segmented-tabs a,.segmented-tabs button{border:1px solid #c6d8e6;background:#f7fbfe;color:#176aa0;padding:10px 16px;border-radius:10px;text-decoration:none;font-weight:700}
.segmented-tabs a:hover,.segmented-tabs button:hover,.segmented-tabs button.active{background:#209fd4;color:#fff}
.badge.premium{background:linear-gradient(135deg,#3d1a78,#b98cff);color:#fff}
.tier-form select{min-width:180px}
.admin-toast{position:fixed;right:24px;top:84px;z-index:10000;background:#10243a;color:white;border-left:5px solid #f2b84b;padding:16px 20px;border-radius:12px;box-shadow:0 14px 40px #0004;font-weight:700}
.ad-price-image-manager{display:grid;gap:10px;padding:14px;border:1px dashed #9fc5e8;border-radius:12px;background:#f8fcff;outline:none}
.ad-price-image-manager:focus,.ad-price-image-manager.dragging{border-color:#1f9ed7;box-shadow:0 0 0 3px rgba(31,158,215,.12)}
.ad-price-image-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}
.ad-price-image-card{display:grid;gap:6px;margin:0;padding:8px;border:1px solid #dce7ef;border-radius:10px;background:#fff}
.ad-price-image-card img{width:100%;height:110px;object-fit:cover;border-radius:8px}
.ad-price-image-card span{display:flex;gap:6px;align-items:center;font-size:13px}
@media (max-width:1000px){.premium-grid,.settings-grid{grid-template-columns:1fr 1fr}}
@media (max-width:700px){.premium-grid,.settings-grid{grid-template-columns:1fr}.premium-grid .full-width,.settings-grid .full-width{grid-column:auto}.segmented-tabs>*{flex:1;text-align:center}}
.web-support-desk {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.web-support-thread {
  overflow: hidden;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #fff;
}

.web-support-thread__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #e7edf3;
  background: #f7fafc;
}

.web-support-thread__identity strong,
.web-support-thread__identity span {
  display: block;
}

.web-support-thread__identity span {
  margin-top: 3px;
  color: #637487;
  font-size: 12px;
}

.web-support-thread__badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.web-support-thread__badge {
  padding: 5px 8px;
  border-radius: 999px;
  color: #476077;
  background: #e9f0f6;
  font-size: 12px;
  font-weight: 700;
}

.web-support-thread__badge--unread {
  color: #8a5200;
  background: #fff0c7;
}

.web-support-thread__messages {
  display: grid;
  gap: 9px;
  max-height: 360px;
  padding: 16px;
  overflow-y: auto;
  background: #f7f9fc;
}

.web-support-thread__message {
  max-width: 78%;
  padding: 10px 12px;
  border: 1px solid #dce5ee;
  border-radius: 5px 13px 13px 13px;
  background: #fff;
}

.web-support-thread__message--agent {
  margin-left: auto;
  border-color: #bdd8ff;
  border-radius: 13px 5px 13px 13px;
  background: #eaf3ff;
}

.web-support-thread__message p {
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.web-support-thread__message small {
  display: block;
  margin-top: 5px;
  color: #76889a;
}

.web-support-thread__reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid #e7edf3;
}

.web-support-thread__reply textarea {
  min-height: 76px;
  resize: vertical;
}

.web-support-thread__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .web-support-thread__head,
  .web-support-thread__reply {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .web-support-thread__message {
    max-width: 92%;
  }

  .web-support-thread__actions {
    flex-direction: row;
  }
}
