:root {
  color: #1b2430;
  background: #f4f6f8;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f4f6f8; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.topbar { height: 68px; padding: 0 28px; background: #fff; border-bottom: 1px solid #dfe4ea; display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 20; }
.brand, .top-actions, .filters, .selection-bar, .dialog-head, .dialog-actions, .result-header { display: flex; align-items: center; }
.brand { gap: 11px; min-width: 175px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: #16745a; border-radius: 7px; font-size: 18px; font-weight: 800; }
.brand div { display: grid; gap: 2px; }
.brand strong { font-size: 16px; }
.brand span:last-child { color: #707b89; font-size: 12px; }
.top-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.connection { display: inline-flex; align-items: center; gap: 6px; color: #687483; margin-right: 8px; }
.connection svg { width: 9px; height: 9px; fill: currentColor; }
.connection.online { color: #147a55; }
.connection.offline { color: #be3d37; }
.button, .icon-button { border: 1px solid transparent; border-radius: 6px; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.button { padding: 0 14px; font-weight: 600; }
.button svg, .icon-button svg { width: 17px; height: 17px; }
.button.primary { color: #fff; background: #16745a; }
.button.primary:hover { background: #0f624b; }
.button.secondary { color: #283440; background: #fff; border-color: #cfd6de; }
.button.secondary:hover, .icon-button:hover { background: #f0f3f5; }
.button.danger { color: #fff; background: #c83e38; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.icon-button { width: 36px; padding: 0; color: #51606f; background: #fff; border-color: #cfd6de; }
.workspace { width: 100%; max-width: 1720px; min-height: calc(100vh - 68px); margin: 0 auto; display: grid; grid-template-columns: 214px minmax(0, 1fr); }
.sidebar { padding: 24px 14px; border-right: 1px solid #dfe4ea; background: #fff; }
.side-nav { position: sticky; top: 92px; display: grid; gap: 5px; }
.nav-item { width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 6px; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 9px; color: #596674; background: transparent; text-align: left; font-weight: 650; }
.nav-item:hover { color: #24313d; background: #f0f3f5; }
.nav-item.active { color: #12684f; background: #e6f2ee; }
.nav-item svg { width: 18px; height: 18px; }
.nav-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; color: #5f6c79; background: #e1e6ea; font-size: 11px; }
.nav-item.active .nav-count { color: #12684f; background: #cbe4dc; }
.content { min-width: 0; padding: 24px 28px 50px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 1px; border: 1px solid #dfe4ea; background: #dfe4ea; border-radius: 7px; overflow: hidden; }
.stat { min-height: 92px; padding: 18px 20px; background: #fff; border-top: 3px solid #687483; display: grid; align-content: center; gap: 6px; }
.stat span { color: #687483; font-size: 13px; }
.stat strong { font-size: 28px; line-height: 1; }
.stat.groups { border-color: #16745a; }.stat.webhook { border-color: #3774a8; }.stat.healthy { border-color: #22834f; }.stat.danger { border-color: #c83e38; }
.view { display: none; padding-top: 22px; }.view.active { display: block; }
.filters { gap: 9px; padding: 18px 0; flex-wrap: wrap; }
.search { width: min(380px, 100%); position: relative; }
.search svg { position: absolute; width: 17px; left: 11px; top: 10px; color: #7d8794; }
input, select { height: 38px; border: 1px solid #c9d1da; border-radius: 6px; background: #fff; color: #1b2430; padding: 0 11px; outline: none; }
input:focus, select:focus { border-color: #16745a; box-shadow: 0 0 0 3px rgba(22,116,90,.12); }
.search input { width: 100%; padding-left: 36px; }
#countryFilter { width: 120px; text-transform: uppercase; }
.selection-bar { min-height: 52px; justify-content: space-between; padding: 8px 12px; background: #eaf4f1; border: 1px solid #b9d8cf; border-radius: 6px 6px 0 0; }
.table-wrap { overflow-x: auto; border: 1px solid #d8dee5; background: #fff; }
table { width: 100%; min-width: 1100px; border-collapse: collapse; table-layout: fixed; }
th { height: 43px; color: #697583; background: #f6f8fa; font-size: 12px; text-align: left; font-weight: 700; }
th, td { padding: 9px 12px; border-bottom: 1px solid #e6eaee; vertical-align: middle; }
td { height: 60px; color: #344150; }
tbody tr:hover { background: #f8fafb; }
th:nth-child(2) { width: 190px; } th:nth-child(3) { width: 90px; } th:nth-child(4) { width: 260px; } th:nth-child(5) { width: 70px; } th:nth-child(6) { width: 90px; } th:nth-child(7) { width: 105px; } th:nth-child(8) { width: 175px; }
.check-cell { width: 44px; text-align: center; }.check-cell input { width: 16px; height: 16px; }
.actions-cell { width: 96px; text-align: right; }.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.app-name { display: grid; gap: 3px; }.app-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.app-name span, .muted { color: #7a8592; font-size: 12px; }
.package { overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.inline-group { width: 100%; max-width: 150px; height: 32px; padding: 0 7px; font-size: 12px; }
.schedule-time { font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.country-edit { height: 32px; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 5px; color: #344150; background: transparent; }.country-edit:hover { border-color: #c9d1da; background: #f6f8fa; }.country-edit svg { width: 13px; height: 13px; color: #73808d; }
.badge { display: inline-flex; min-width: 62px; height: 25px; padding: 0 8px; align-items: center; justify-content: center; border-radius: 4px; font-size: 12px; font-weight: 700; }
.badge.own { color: #106349; background: #dff1eb; }.badge.competitor { color: #815c08; background: #f7edcf; }
.status { display: inline-flex; align-items: center; gap: 6px; }.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #8793a0; }
.status.available::before { background: #21834f; }.status.unavailable::before { background: #c83e38; }.status.unknown::before { background: #8793a0; }
.table-footer { padding: 12px 2px; color: #687483; }
.empty { min-height: 240px; display: grid; place-items: center; align-content: center; gap: 10px; color: #7b8693; }.empty svg { width: 34px; height: 34px; }.hidden { display: none !important; }
.result-header { justify-content: space-between; gap: 20px; padding: 0 0 16px; }.result-header h2, .dialog-head h2 { margin: 0 0 5px; font-size: 18px; }.result-header p, .dialog-head p { margin: 0; color: #6d7886; }
.progress { height: 5px; overflow: hidden; background: #dfe4e8; }.progress span { display: block; width: 35%; height: 100%; background: #16745a; animation: progress 1.2s ease-in-out infinite alternate; }
@keyframes progress { to { transform: translateX(190%); } }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding-top: 16px; }
.result-card { background: #fff; border: 1px solid #d9dfe6; border-radius: 7px; overflow: hidden; }.result-card img { display: block; width: 100%; aspect-ratio: 1200/630; object-fit: cover; background: #eef1f4; }.result-card footer { padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; }.result-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.result-card span { color: #6d7886; font-size: 12px; white-space: nowrap; }
dialog { width: min(640px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 18px 60px rgba(19,31,43,.25); }.token-dialog { width: min(430px, calc(100vw - 30px)); } dialog::backdrop { background: rgba(26,34,43,.48); }
.compact-dialog { width: min(430px, calc(100vw - 30px)); }.country-edit-label { margin-top: 20px; }
dialog form { padding: 22px; }.dialog-head { align-items: flex-start; justify-content: space-between; gap: 20px; }.dialog-head .close { flex: 0 0 auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }.form-grid .wide { grid-column: 1 / -1; }
dialog label { display: grid; gap: 7px; color: #4a5664; font-weight: 600; } dialog label input, dialog label select { width: 100%; }
.dialog-actions { justify-content: flex-end; gap: 8px; margin-top: 22px; }
.file-drop { min-height: 150px; margin-top: 20px; padding: 20px; border: 1px dashed #9ca8b4; border-radius: 7px; place-items: center; align-content: center; text-align: center; background: #f8fafb; cursor: pointer; }.file-drop:hover { border-color: #16745a; }.file-drop svg { width: 30px; height: 30px; color: #16745a; }.file-drop span { font-size: 12px; color: #798592; }.file-drop input { display: none; }
fieldset { border: 0; padding: 0; margin: 18px 0 0; } legend { margin-bottom: 8px; font-weight: 700; }.radio { grid-template-columns: 18px 1fr; align-items: center; padding: 9px 0; }.radio input { width: 16px; height: 16px; }.radio span { font-weight: 400; }.radio strong { margin-right: 8px; }
.import-group { margin-top: 16px; }
.toggle-row { grid-template-columns: 20px 1fr; align-items: center; }.toggle-row input { width: 17px; height: 17px; }
.group-table { min-width: 900px; }.group-table th:nth-child(1) { width: 220px; }.group-table th:nth-child(2) { width: 85px; }.group-table th:nth-child(3) { width: 110px; }.group-table th:nth-child(4) { width: 180px; }.group-table th:nth-child(5) { width: 130px; }.group-table th:nth-child(6) { width: 240px; }
.discovery-total { flex: 0 0 auto; color: #687483; }.discovery-total strong { margin-left: 4px; color: #16745a; font-size: 22px; }
.discovery-controls { min-height: 74px; padding: 12px 0; display: flex; align-items: end; gap: 10px; flex-wrap: wrap; border-top: 1px solid #dfe4ea; }
.discovery-controls > label { display: grid; gap: 6px; color: #556270; font-size: 12px; font-weight: 650; }
.discovery-controls > label input { width: 110px; text-transform: uppercase; }
.channel-fieldset { height: 38px; margin: 0; padding: 0 4px; border: 1px solid #c9d1da; border-radius: 6px; display: flex; align-items: center; background: #fff; }
.channel-fieldset legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.check-option { height: 30px; padding: 0 9px; display: flex; align-items: center; gap: 6px; color: #3d4a57; font-weight: 600; cursor: pointer; }
.check-option input { width: 15px; height: 15px; }
.selection-actions { display: flex; gap: 8px; align-items: center; }
.discovery-selection { margin-bottom: -1px; }
.discovery-table { min-width: 1040px; }
.discovery-table th:nth-child(2) { width: 70px; }.discovery-table th:nth-child(3) { width: 210px; }.discovery-table th:nth-child(4) { width: 150px; }.discovery-table th:nth-child(5) { width: 260px; }.discovery-table th:nth-child(6) { width: 75px; }.discovery-table th:nth-child(7) { width: 175px; }
.store-link { color: #16745a; display: inline-flex; align-items: center; justify-content: center; }.store-link svg { width: 17px; height: 17px; }
.empty span { color: #8a949f; font-size: 12px; }
.import-preview { margin-top: 16px; padding: 12px; background: #eef4f2; border-left: 3px solid #16745a; }.preview-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }.preview-numbers span { display: grid; gap: 3px; color: #6e7986; }.preview-numbers strong { color: #1b2430; font-size: 20px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: min(420px, calc(100vw - 44px)); padding: 12px 16px; color: #fff; background: #26323e; border-radius: 6px; box-shadow: 0 8px 28px rgba(0,0,0,.2); transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s; z-index: 50; }.toast.show { transform: translateY(0); opacity: 1; }.toast.error { background: #a8332f; }
html[data-theme="dark"] { color-scheme: dark; color: #edf3ef; background: #101512; }
html[data-theme="dark"] body { background: #101512; }
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sidebar { color: #edf3ef; background: #171e1a; border-color: #303b35; }
html[data-theme="dark"] .content { background: #111713; }
html[data-theme="dark"] .brand span:last-child,
html[data-theme="dark"] .connection,
html[data-theme="dark"] .stat span,
html[data-theme="dark"] .app-name span,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .table-footer,
html[data-theme="dark"] .result-header p,
html[data-theme="dark"] .dialog-head p,
html[data-theme="dark"] .result-card span,
html[data-theme="dark"] .discovery-total,
html[data-theme="dark"] .empty { color: #aab6af; }
html[data-theme="dark"] .stats { border-color: #303b35; background: #303b35; }
html[data-theme="dark"] .stat,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] dialog,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] .channel-fieldset { color: #edf3ef; background: #1a221e; border-color: #39463f; }
html[data-theme="dark"] th { color: #b5c0ba; background: #202a25; }
html[data-theme="dark"] th,
html[data-theme="dark"] td,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .discovery-controls,
html[data-theme="dark"] .sidebar { border-color: #303b35; }
html[data-theme="dark"] td { color: #dce5e0; }
html[data-theme="dark"] tbody tr:hover { background: #202a25; }
html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] .icon-button { color: #dce5e0; background: #1a221e; border-color: #425048; }
html[data-theme="dark"] .button.secondary:hover,
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .country-edit:hover { color: #f4f8f5; background: #27322c; }
html[data-theme="dark"] .nav-item { color: #bdc7c1; }
html[data-theme="dark"] .nav-item.active { color: #8de0bf; background: #213a30; }
html[data-theme="dark"] .nav-count { color: #bdc7c1; background: #303b35; }
html[data-theme="dark"] .nav-item.active .nav-count { color: #a5e8cd; background: #315646; }
html[data-theme="dark"] .selection-bar { color: #dff5ec; background: #1c352c; border-color: #315646; }
html[data-theme="dark"] .import-preview { background: #1c3029; }
html[data-theme="dark"] .preview-numbers span { color: #aab6af; }
html[data-theme="dark"] .preview-numbers strong { color: #edf3ef; }
html[data-theme="dark"] .file-drop { background: #1d2521; border-color: #65736b; }
html[data-theme="dark"] .result-card img { background: #222c27; }
html[data-theme="dark"] dialog::backdrop { background: rgba(4,8,6,.72); }
html[data-theme="dark"] .check-option { color: #dce5e0; }
html[data-theme="dark"] .country-edit { color: #dce5e0; }
@media (max-width: 900px) { .topbar { height: auto; min-height: 68px; padding: 12px 16px; align-items: flex-start; }.connection { display: none; }.workspace { min-height: 0; display: block; }.sidebar { padding: 8px 16px 0; border-right: 0; border-bottom: 1px solid #dfe4ea; overflow-x: auto; }.side-nav { position: static; display: flex; gap: 4px; width: max-content; }.nav-item { width: auto; min-width: max-content; grid-template-columns: 18px auto auto; }.content { padding: 18px 16px 40px; }.stats { grid-template-columns: repeat(2, 1fr); }.stat:last-child { grid-column: 1 / -1; }.result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .topbar { display: grid; }.top-actions { justify-content: flex-start; }.top-actions .button { flex: 1 1 auto; }.stats { grid-template-columns: 1fr 1fr; }.stat { min-height: 78px; padding: 13px; }.filters > * { flex: 1 1 130px; }.search { flex-basis: 100%; }.result-grid { grid-template-columns: 1fr; }.form-grid { grid-template-columns: 1fr; }.form-grid .wide { grid-column: auto; }.result-header { align-items: flex-start; }.preview-numbers { grid-template-columns: repeat(2, 1fr); }.discovery-controls > * { flex: 1 1 140px; }.discovery-controls > label input { width: 100%; }.channel-fieldset { flex-basis: 100%; }.selection-bar.discovery-selection { align-items: flex-start; gap: 10px; flex-direction: column; }.selection-actions { width: 100%; }.selection-actions select { min-width: 0; flex: 1; } }
