/* Classic WP Light Theme Inspiration */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #f1f1f1;
    color: #3c434a;
    display: flex;
    min-height: 100vh;
}

#wpadminbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 32px;
    background: #23282d;
    color: #ccc;
    z-index: 99999;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
}

#adminmenumain {
    width: 160px;
    background: #1d2327;
    color: #a0a5aa;
    border-right: none;
    padding-top: 32px;
    position: fixed;
    height: 100%;
    overflow-y: auto;
}

#adminmenu {
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

#adminmenu li {
    margin: 0;
    padding: 0;
}

#adminmenu a {
    display: block;
    padding: 12px 16px;
    color: #a0a5aa;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

#adminmenu a:hover {
    color: #72aee6;
}

#adminmenu a.current {
    background: #2271b1;
    color: #fff;
}

#wpcontent {
    margin-left: 160px;
    padding: 50px 20px 20px;
    flex-grow: 1;
}

h1.wp-heading-inline {
    font-size: 23px;
    font-weight: 400;
    margin: 0 0 15px;
    padding: 9px 0 4px;
    line-height: 1.3;
}

.postbox {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin-bottom: 20px;
    padding: 15px;
}

.button-primary {
    background: #0073aa;
    border-color: #006799;
    box-shadow: 0 1px 0 #006799;
    color: #fff;
    text-decoration: none;
    text-shadow: none;
    padding: 5px 14px;
    font-size: 14px;
    border-radius: 3px;
    cursor: pointer;
}

.button,
.button-primary,
button,
input[type="button"],
input[type="submit"] {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    letter-spacing: 0;
}

.postbox-header { border-bottom: 1px solid #ccd0d4; padding: 0 12px; }
.postbox-header h2 { font-size: 14px; margin: 0; padding: 12px 0; font-weight: 600; color: #1d2327; }
.postbox .inside { padding: 0 12px 12px; margin-top: 11px; font-size: 14px; color: #3c434a; }
.postbox .inside ul { margin: 0; padding: 0; list-style: none; }
.postbox .inside ul li { padding-bottom: 5px; }

#wpadminbar .quicklinks { display: flex; justify-content: space-between; width: 100%; align-items: center; }
#wpadminbar ul { list-style: none; margin: 0; padding: 0; display: flex; }
#wpadminbar li { margin: 0; position: relative; }
#wpadminbar .ab-item { padding: 0 10px; color: #f0f0f1; text-decoration: none; display: flex; align-items: center; height: 32px; font-size: 14px; }
#wpadminbar .ab-item:hover { background: #1d2327; color: #72aee6; }
#wpadminbar .avatar { border-radius: 50%; margin-left: 8px; }
#wpadminbar .ab-sub-wrapper { display: none; position: absolute; right: 0; top: 32px; background: #2c3338; min-width: 150px; z-index: 100000; box-shadow: 0 3px 5px rgba(0,0,0,.2); }
#wpadminbar .menupop:hover .ab-sub-wrapper { display: block; }
#wpadminbar .ab-submenu li { width: 100%; }
#wpadminbar .ab-submenu a { padding: 8px 10px; display: block; }

#wpadminbar #dashboard-account-switch {
    background: transparent; border: 0; cursor: pointer; font-family: inherit;
    gap: 12px; white-space: nowrap;
}
#wpadminbar #dashboard-account-switch:focus-visible { outline: 2px solid #72aee6; outline-offset: -2px; }
#dashboard-account-switch .greeting-copy { max-width: min(300px, 36vw); overflow: hidden; text-overflow: ellipsis; }
#browser-account-dialog {
    box-sizing: border-box; width: min(460px, calc(100% - 24px));
    max-height: calc(100dvh - 24px); overflow-y: auto;
    border: 1px solid #ccd0d4; border-radius: 6px; padding: 20px;
    background: #fff; color: #2c3338; font-size: 16px; line-height: 1.5;
}
#browser-account-dialog::backdrop { background: rgba(0,0,0,.5); }
#browser-account-dialog h2 { font-size: 20px; line-height: 1.3; margin: 0 0 12px; }
#browser-account-dialog p { margin: 12px 0; }
#browser-account-dialog ol { padding-left: 22px; }
#browser-account-dialog li + li { margin-top: 8px; }
#browser-account-name { overflow-wrap: anywhere; }
.browser-account-note { font-size: 14px; color: #50575e; }
#browser-account-error { color: #b32d2e; }
.browser-account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.browser-account-actions .button { min-height: 40px; font-size: 14px; padding: 6px 12px; cursor: pointer; }
#browser-account-dialog [hidden] { display: none !important; }
body.dark-theme #browser-account-dialog { background: #1e293b; color: #e2e8f0; border-color: #475569; }
body.dark-theme .browser-account-note { color: #cbd5e1; }
body.dark-theme #browser-account-error { color: #fca5a5; }
#landing-page .browser-login-help { max-width: 460px; text-align: left; font-size: 16px; line-height: 1.5; padding: 16px; border: 1px solid #64748b; border-radius: 6px; }
#landing-page .browser-login-help h2 { font-size: 20px; margin-top: 0; }
#auth-attempt-actions .button { min-height: 40px; font-size: 14px; white-space: normal; }

/* --- WordPress Classic Interface Elements --- */
.wrap { margin: 10px 20px 0 2px; }
.page-title-action { display: inline-block; border: 1px solid #2271b1; color: #2271b1; text-decoration: none; font-size: 14px; line-height: 2.15384615; min-height: 30px; margin: 0 0 0 4px; padding: 0 10px; cursor: pointer; border-radius: 3px; background: #f6f7f7; vertical-align: top; }
.page-title-action:hover { background: #f0f0f1; border-color: #0a4b78; color: #0a4b78; }
.account-quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 12px; margin: 4px 0 18px; }
.account-connect-btn {
    --brand: #2271b1; --brand-d: #135e96; --brand-sh: rgba(34,113,177,.30);
    position: relative; display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto;
    column-gap: 12px; align-items: center; min-height: 64px; padding: 12px 16px 12px 14px;
    border: 1px solid #e5eaf0; border-radius: 13px; background: #fff; color: #0f172a;
    font-size: 15px; font-weight: 700; line-height: 1.2; cursor: pointer; text-align: left; overflow: hidden;
    box-shadow: 0 1px 2px rgba(15,23,42,.05);
    transition: transform .18s ease, box-shadow .2s ease, border-color .18s ease;
}
.account-connect-btn::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.account-connect-btn:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 14px 26px -10px var(--brand-sh), 0 2px 6px rgba(15,23,42,.06); }
.account-connect-icon { grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; letter-spacing: .5px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-d)); box-shadow: 0 5px 12px -4px var(--brand-sh); }
.account-connect-note { grid-column: 2 / 3; align-self: start; color: #64748b; font-size: 12px; font-weight: 500; margin-top: 1px; }
.uc-help-dot { position: absolute; top: 9px; right: 10px; width: 17px; height: 17px; border-radius: 999px; background: #eef2f7; color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.account-connect-userbot { --brand: #2AABEE; --brand-d: #1c8fd0; --brand-sh: rgba(42,171,238,.40); }
.account-connect-bot { --brand: #6366F1; --brand-d: #4f46e5; --brand-sh: rgba(99,102,241,.40); }
.account-connect-vk { --brand: #0077FF; --brand-d: #0061d6; --brand-sh: rgba(0,119,255,.40); }
body.dark-theme .account-connect-btn { background: #1e293b; border-color: #334155; color: #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
body.dark-theme .account-connect-note { color: #94a3b8; }
body.dark-theme .uc-help-dot { background: #334155; }
/* Пилюли типа аккаунта в таблице «Подключённые аккаунты» */
.acc-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4; border: 1px solid transparent; }
.acc-pill-tg { background: #e6f2fb; color: #1c6fb0; border-color: #cfe6f8; }
.acc-pill-bot { background: #eef0fe; color: #4f46e5; border-color: #dcdefb; }
.acc-pill-vk { background: #e7f0ff; color: #0056d6; border-color: #cfe0ff; }
.acc-pill-ig { background: #fdeef6; color: #c13584; border-color: #f7d4e6; }
body.dark-theme .acc-pill-tg { background: #16334a; color: #7cc0ef; border-color: #1d4a6b; }
body.dark-theme .acc-pill-bot { background: #26264d; color: #a6a8f7; border-color: #34346b; }
body.dark-theme .acc-pill-vk { background: #16294d; color: #7fb0ff; border-color: #22417a; }
body.dark-theme .acc-pill-ig { background: #471d36; color: #f0a6cd; border-color: #6b2b52; }
/* VK-назначение: чип, бейдж и пикер сообществ */
.peer-tag-vk { background: #f2f7ff; border-color: #cfe0ff; }
.peer-vk-badge { display: inline-flex; align-items: center; vertical-align: middle; margin-right: 5px; line-height: 1; }
.peer-tg-badge { display: inline-flex; align-items: center; vertical-align: middle; margin-right: 5px; line-height: 1; }
.peer-vk-badge svg, .peer-tg-badge svg { display: block; }
#vk-picker-list { font-size: 12px; }
.vk-picker-item { display: flex; align-items: baseline; gap: 8px; padding: 5px 10px; cursor: pointer; border-bottom: 1px solid #eef2fb; line-height: 1.3; }
.vk-picker-item:last-child { border-bottom: none; }
.vk-picker-item:hover { background: #f2f7ff; }
.vk-picker-item.vk-pi-disabled { opacity: .6; cursor: not-allowed; }
.vk-pi-name { flex: 1 1 auto; min-width: 0; font-weight: 600; color: #1d2327; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vk-pi-addr { flex: 0 1 auto; min-width: 0; color: #0056d6; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vk-pi-note { flex: 0 0 auto; color: #8a6d00; font-size: 11px; white-space: nowrap; }
body.dark-theme .peer-tag-vk { background: #16294d; border-color: #22417a; }
body.dark-theme .vk-picker-item { border-bottom-color: #23324d; }
body.dark-theme .vk-picker-item:hover { background: #16294d; }
body.dark-theme .vk-pi-name { color: #e2e8f0; }
body.dark-theme .vk-pi-addr { color: #7fb0ff; }
body.dark-theme #vk-picker-list { background: #1e293b; border-color: #22417a; }
.account-quick-actions.needs-userbot .account-connect-userbot,
.account-quick-actions.needs-bot .account-connect-bot { animation: accountConnectPulse 4s ease-in-out infinite; border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 0 rgba(37, 99, 235, .24), 0 8px 18px rgba(37, 99, 235, .16); }
.account-quick-actions.needs-bot .account-connect-bot { animation-delay: 1.6s; }
@keyframes accountConnectPulse {
    0%, 68%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .24), 0 8px 18px rgba(37, 99, 235, .12); transform: translateY(0); }
    12% { box-shadow: 0 0 0 6px rgba(37, 99, 235, .10), 0 10px 24px rgba(37, 99, 235, .20); transform: translateY(-1px); }
    24% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .05), 0 8px 18px rgba(37, 99, 235, .14); transform: translateY(0); }
}
.account-guide-lead { margin: 0 0 12px; color: #3c434a; }
.account-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 10px; }
.account-guide-card { min-width: 0; padding: 12px 13px; border: 1px solid #dbeafe; border-radius: 8px; background: #f8fbff; }
.account-guide-title { margin-bottom: 5px; color: #1d2327; font-weight: 700; line-height: 1.25; }
.account-guide-text { color: #4b5563; font-size: 13px; line-height: 1.45; }
.account-guide-security { border-color: #fecaca; background: #fffafa; }
.account-guide-footnote { margin: 10px 0 0; color: #64748b; font-size: 13px; line-height: 1.45; }
@media (max-width: 900px) {
    .account-guide-grid { grid-template-columns: 1fr; }
}
.subsubsub { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; float: left; color: #646970; }
.subsubsub li { display: inline-block; }
.subsubsub a { line-height: 2; padding: 0.2em; text-decoration: none; color: #2271b1; }
.subsubsub a:hover { color: #0a4b78; }
.subsubsub a.current { color: #000; font-weight: 600; }
.subsubsub .count { color: #646970; font-weight: 400; }
.search-box { float: right; margin: 0; }
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }
.tablenav { clear: both; height: 30px; margin: 6px 0 4px; vertical-align: middle; }
.tablenav.top { margin-bottom: 5px; }
.tablenav .alignleft { float: left; }
.tablenav .actions { padding: 0 8px 0 0; }
.tablenav select { vertical-align: top; font-size: 15px; padding: 0 24px 0 8px; min-height: 30px; border: 1px solid #8c8f94; border-radius: 3px; background-color: #fff; color: #2c3338; }
.button { display: inline-block; text-decoration: none; font-size: 14px; line-height: 2.15384615; min-height: 30px; margin: 0; padding: 0 10px; cursor: pointer; border: 1px solid #2271b1; border-radius: 3px; color: #2271b1; background: #f6f7f7; vertical-align: top; }
.wp-list-table { border: 1px solid #c3c4c7; box-shadow: 0 1px 1px rgba(0,0,0,.04); background: #fff; width: 100%; clear: both; margin: 0; border-collapse: collapse; }
.wp-list-table th, .wp-list-table td { padding: 10px 12px; font-size: 14px; color: #3c434a; border-bottom: 1px solid #c3c4c7; text-align: left; }
.wp-list-table thead th, .wp-list-table tfoot th { font-weight: 400; color: #2c3338; background: #fff; }
.wp-list-table.striped>tbody>tr:nth-child(odd) { background-color: #f6f7f7; }
.check-column { width: 2.2em; padding: 6px 0 25px; vertical-align: top; }
.column-title strong a { font-size: 15px; color: #2271b1; text-decoration: none; font-weight: 600; }
.row-actions { color: #c3c4c7; font-size: 14px; padding: 2px 0 0; visibility: hidden; }
tr:hover .row-actions { visibility: visible; }
.row-actions a { text-decoration: none; color: #2271b1; }
.row-actions .trash a { color: #d63638; }
.clear { clear: both; }
/* Account operations stay compact while preserving full labels on small screens. */
.table-responsive table.accounts-table { min-width: 1050px !important; }
.accounts-table th:first-child { width: 32px; }
.accounts-table th:last-child { width: 240px; }
.accounts-table td { vertical-align: top; overflow-wrap: anywhere; font-size: 14px; }
.accounts-table td > div { margin-top: 4px; }
.account-state { font-weight: 600; }
.account-state[data-state="authorized"] { color: #008a20; }
.account-state[data-state="imported"], .account-state[data-state="busy"] { color: #996800; }
.account-state[data-state="invalid"], .account-state[data-state="unknown"], .account-state[data-state="frozen"] { color: #b32d2e; }
.account-state[data-state="paused"] { color: #646970; }
.account-list-header, .account-bulk-bar, .account-action-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.account-list-header { justify-content: space-between; padding-block: 8px; }
.account-bulk-bar { padding: 8px 12px; }
.account-bulk-bar[hidden], .account-import-panel button[hidden] { display: none; }
.account-actions > summary { cursor: pointer; list-style: none; }
.account-actions > summary::-webkit-details-marker { display: none; }
.account-actions > summary::after { content: " ▾"; }
.account-action-list { margin-top: 8px; }
.account-action-results { white-space: pre-wrap; overflow-wrap: anywhere; }
.account-action-results:not(:empty) { padding: 6px 12px; }
.account-auth-methods { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
#auth-tab-phone .account-auth-methods > .button { padding-inline: 8px; white-space: normal; }
@media (max-width: 480px) {
    .account-auth-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
    #auth-tab-phone .account-auth-methods > .button { min-width: 0; padding-inline: 4px; }
}
.account-import-panel { margin: 12px 0; font-size: 14px; line-height: 1.5; }
.account-import-panel h4 { margin: 0 0 8px; }
.account-import-panel ul { margin: 8px 0; padding-inline-start: 20px; }
.account-import-panel details { margin: 8px 0; }
.account-import-panel summary { cursor: pointer; font-weight: 600; }
.account-import-panel p { margin: 8px 0; }
.account-toolbar .button { font-size: 14px; }
#account-messages-modal::backdrop, #account-proxy-modal::backdrop { background: rgb(0 0 0 / 45%); }
#account-messages-content { padding: 16px 0; font-size: 14px; line-height: 1.55; }
#account-proxy-modal { font-size: 14px; line-height: 1.5; }
@media screen and (max-width: 600px) {
    #auth-attempt-actions > .button {
        flex: 1 1 0;
        min-width: 0;
        min-height: 44px;
        padding: 6px 8px;
        white-space: normal;
        line-height: 1.35;
    }
}
@media screen and (max-height: 480px) {
    #phone-auth-modal > div:first-child { padding: 12px !important; }
    #phone-auth-modal > div > h3 { margin-bottom: 6px !important; }
    #phone-auth-modal #auth-tab-phone > [role="group"] { margin: 6px 0 !important; }
    #phone-auth-modal #auth-attempt-status { margin-bottom: 6px !important; }
}
body.dark-theme #account-messages-modal, body.dark-theme #account-proxy-modal { background: #2a2a2a; color: #e0e0e0; }
