[hidden] { display: none !important; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.dashboard-grid, .folder-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.dashboard-panel, .folder-admin-card { min-width: 0; min-height: 150px; padding: 20px; }
.dashboard-panel h3, .folder-admin-card h3 { margin: 0 0 14px; overflow-wrap: anywhere; }
.dashboard-panel > p { font-size: 12px; }
.dashboard-row { display: block; width: 100%; border: 0; border-top: 1px solid #2b3d52; padding: 13px 0; background: transparent; color: #dcebf4; text-align: left; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; }
.dashboard-row:hover { color: #8ef0df; }
.folder-admin-card p { margin: 8px 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.folder-add-panel { min-height: 0; padding: 22px; margin-bottom: 16px; display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); gap: 20px; }
.folder-add-panel h3 { margin: 0 0 10px; font-size: 19px; }
.folder-add-panel p { font-size: 12px; line-height: 1.5; }
.folder-add-panel form { display: grid; gap: 9px; }
.folder-add-panel label { color: #a9bdd0; font-size: 12px; font-weight: 700; }
.folder-add-panel input, .folder-add-panel select { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; }
.folder-add-panel button { justify-self: start; }
.folder-sync-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.folder-sync-bar p { margin: 0; font-size: 12px; }
.folder-ok { color: #81ddbd; }
.folder-warning { color: #f1c184; }
.folder-error { color: #ffad9f; }
.account-health-summary { margin: -4px 0 18px; padding: 12px 15px; border: 1px solid #30465b; border-radius: 11px; background: #152334; color: #b7cbda; font-size: 12px; line-height: 1.5; }
.account-health { font-weight: 800; }
.account-health.healthy { color: #81ddbd; }
.account-health.attention, .account-pending { color: #f6cc78; }
.account-health.error, .account-health.disconnected { color: #ffad9f; }
.mini-status.pending, .status-pill.pending { background: #4b391c; color: #ffdc88; }
.mini-status.issue, .status-pill.issue { background: #4a2927; color: #ffb5a6; }
.folder-card.pending, .manual-detail .manual-folder.pending { border-color: #a27632; background: #2c261b; }
.folder-card.issue, .manual-detail .manual-folder.issue { border-color: #ad6058; background: #30201f; }
.manual-detail .manual-status.pending, .manual-detail .manual-folder.pending span { color: #ffdc88; }
.manual-detail .manual-status.issue, .manual-detail .manual-folder.issue span,
.manual-detail .manual-status.expired { color: #ffb5a6; }
.account-panel { max-width: 560px; min-height: 0; padding: 24px; }
.account-panel p { margin-top: 0; font-size: 13px; line-height: 1.5; }
.account-panel form { display: grid; gap: 10px; }
.account-panel label { color: #a9bdd0; font-size: 12px; font-weight: 700; }
.account-panel input { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; }
.account-panel button { margin-top: 8px; }
.system-account-panel { grid-column: 1 / -1; width: 100%; max-width: none; min-height: 0; }
.system-account-panel form { width: min(100%, 560px); }
.stat-button { color: inherit; text-align: left; font: inherit; cursor: pointer; }
.stat-button:hover { border-color: #69d8c5; background: #183042; }
.stat-button strong { color: #ffd28a; }
.filters { flex-wrap: wrap; }
.filters input { flex: 1 1 180px; }
.filters select { flex: 1 1 130px; max-width: none; }
.list-count { margin: -5px 17px 14px; color: #8ea3b8; font-size: 11px; }
.issue-button { display: block; width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.issue-button:hover { color: #fff; text-decoration: underline; }
.detail-remaining { margin: 10px 24px 0; color: #98dacf; font-size: 12px; font-weight: 700; }
.manage-divider { height: 1px; background: #355268; margin: 8px 0; }
.ticket-filters { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.ticket-filters input, .ticket-filters select { min-width: 0; padding: 10px 12px; border: 1px solid #2b3b51; border-radius: 9px; background: #0c1420; color: #edf3fb; }
.ticket-filters input { flex: 1 1 230px; }
.ticket-filters select { flex: 0 1 190px; }
.ticket-filters span { color: #8ea3b8; font-size: 11px; }
.ticket-subscriber { margin: 10px 0 4px; }
.manual-intro { max-width: 760px; margin: -4px 0 18px; color: #9eb2c7; font-size: 13px; line-height: 1.55; }
.manual-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 16px; }
.manual-list, .manual-detail { min-height: 220px; min-width: 0; }
.manual-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 18px; border: 0; border-bottom: 1px solid #2b3d52; background: transparent; color: #e4edf8; text-align: left; }
.manual-item:hover, .manual-item.selected { background: #1b2d40; }
.manual-item-copy { display: grid; flex: 1; min-width: 0; gap: 4px; }
.manual-item strong { overflow-wrap: anywhere; font-size: 13px; }
.manual-item span { color: #9eb2c7; font-size: 12px; }
.manual-item small { color: #8294ae; font-size: 11px; line-height: 1.4; }
.manual-item .mini-status { flex: 0 0 auto; max-width: 130px; color: #71debf; background: #183a35; text-align: center; line-height: 1.25; }
.manual-item .mini-status.pending { color: #ffdc88; background: #4b391c; }
.manual-item .mini-status.issue { color: #ffb5a6; background: #4a2927; }
.manual-item .mini-status.expired { color: #d4af86; background: #38302a; }
.manual-detail { padding: 22px; }
.manual-detail h3 { margin: 0; overflow-wrap: anywhere; }
.manual-detail .manual-email { margin: 6px 0 0; color: #a9bdd0; font-size: 13px; overflow-wrap: anywhere; }
.manual-detail .manual-status { margin: 8px 0 18px; color: #a9bdd0; font-size: 12px; }
.manual-detail .manual-folder { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid #355268; border-radius: 9px; margin: 8px 0; font-size: 12px; }
.manual-detail .manual-folder span { color: #a9bdd0; }
.manual-detail .manual-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 17px 0; }
.manual-detail .manual-note { display: grid; gap: 8px; margin-top: 16px; }
.manual-detail .manual-note label { color: #a9bdd0; font-size: 12px; font-weight: 700; }
.manual-detail .manual-note textarea { width: 100%; min-height: 75px; resize: vertical; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; padding: 11px; font: inherit; }
.manual-detail .manual-note input { width: 100%; min-height: 44px; padding: 11px; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; font: inherit; }
.manual-detail .danger-button { margin-top: 16px; }
.telegram-detail .manual-email { margin-top: 8px; }
.telegram-detail .manual-status { line-height: 1.55; }
.telegram-detail .manual-status strong { color: #8ee5c9; }
.telegram-detail .manual-status.pending strong { color: #ffdc88; }
.telegram-detail .manual-status.issue strong, .telegram-detail .manual-status.expired strong { color: #ffb1a4; }
.telegram-detail-kind { margin: -10px 0 16px; font-size: 12px; }
.trial-usage { margin: -8px 0 16px; color: #a9c8d0; font-size: 12px; font-weight: 650; }
.trial-usage.limit { color: #f0bb83; }
.telegram-folders-heading { margin: 20px 0 6px; font-size: 14px; }
.telegram-detail .folder-list { margin: 0; gap: 0; }
.telegram-detail .manual-folder .folder-meta { flex-wrap: wrap; }
.telegram-detail .transfer-note { margin: 0 0 14px; }
.telegram-detail .error-text { margin: 12px 0; }
.telegram-detail .advanced-actions { margin: 18px 0 0; }
.telegram-detail .advanced-actions-content input { width: 100%; min-width: 0; padding: 11px; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; font: inherit; }
.telegram-detail .advanced-actions-content p { margin: 0; color: #9eb2c7; font-size: 12px; line-height: 1.55; }
.telegram-detail .telegram-danger-actions { margin-bottom: 0; }
.telegram-detail .telegram-danger-actions .danger-button { margin-top: 0; }
.panel-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 20px; }
.panel-tabs button { min-width: 0; min-height: 44px; border: 1px solid #2b3d52; border-radius: 10px; background: #142536; color: #93a9bf; padding: 9px 10px; font-size: 12px; line-height: 1.25; font-weight: 700; }
.panel-tabs button.active { border-color: #78dfd0; background: #173b3e; color: #d9fff9; }
.panel-tabs span { display: inline-block; margin-left: 4px; border-radius: 12px; background: #345060; padding: 1px 6px; font-size: 10px; }
.list-tools, .manage-inline, .manage-buttons, .dialog-actions { display: flex; gap: 8px; align-items: center; }
.list-tools .primary-button { white-space: nowrap; }
.manage-card { margin: 24px; padding: 20px; border: 1px solid #355268; border-radius: 14px; background: #142536; display: grid; gap: 11px; }
.manage-card h3 { margin: 0; font-size: 16px; }
.manage-card p { margin: 0 0 5px; color: #9eb2c7; font-size: 12px; line-height: 1.5; }
.manage-card label, .action-dialog label, .ticket-reply-form label { display: block; color: #a9bdd0; font-size: 12px; font-weight: 700; }
.manage-card input { width: 100%; min-width: 0; }
.manage-card textarea { width: 100%; resize: vertical; min-height: 70px; background: #0e1826; color: #e8f4ff; border: 1px solid #38516a; border-radius: 9px; padding: 11px; font: inherit; }
.manage-card #save-note { justify-self: start; }
.advanced-actions { border-top: 1px solid #355268; margin-top: 4px; padding-top: 10px; }
.advanced-actions summary { color: #c7e4e0; font-size: 13px; font-weight: 700; cursor: pointer; }
.advanced-actions-content { display: grid; gap: 11px; padding-top: 15px; }
.advanced-actions-content .danger-button { justify-self: start; }
.manage-inline input { flex: 1; }
.manage-inline button, .manage-buttons button { white-space: nowrap; }
.danger-button { justify-self: start; margin-top: 7px; padding: 11px 15px; border: 1px solid #c56b64; border-radius: 10px; background: #452d32; color: #ffc6bc; font-weight: 800; }
.danger-button:hover { background: #61343a; }
button:disabled { opacity: .55; cursor: not-allowed; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0 16px; }
.section-heading h2 { margin: 2px 0 0; font-size: 23px; }
.support-grid { display: grid; grid-template-columns: minmax(270px, .8fr) minmax(0, 1.2fr); gap: 16px; }
.ticket-list, .ticket-detail, .audit-list { min-height: 350px; }
.ticket-item { display: grid; gap: 6px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #2b3d52; background: transparent; color: #e4edf8; padding: 16px 18px; }
.ticket-item:hover, .ticket-item.selected { background: #1b2d40; }
.ticket-item strong { font-size: 13px; overflow-wrap: anywhere; }
.ticket-item span { color: #b5c7d9; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ticket-item small, .ticket-date { color: #8ea3b8; font-size: 11px; }
.ticket-detail { padding: 24px; }
.ticket-detail h3 { margin: 6px 0; overflow-wrap: anywhere; }
.ticket-message, .ticket-reply { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; padding: 14px; border-radius: 10px; background: #1b2e3f; }
.ticket-reply { border-left: 3px solid #67cabb; background: #1a353b; }
.ticket-reply-form { display: grid; gap: 10px; margin-top: 24px; }
.ticket-reply-form textarea { width: 100%; resize: vertical; min-height: 90px; background: #0e1826; color: #e8f4ff; border: 1px solid #38516a; border-radius: 9px; padding: 12px; font: inherit; }
.ticket-reply-form button { justify-self: start; }
.ticket-delete { margin-top: 22px; }
.audit-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid #2b3d52; padding: 15px 20px; font-size: 12px; }
.audit-row strong { min-width: 170px; color: #d8f8ee; }
.audit-row span { flex: 1; overflow-wrap: anywhere; }
.audit-row small { color: #8ea3b8; }
.system-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.system-panel { min-height: 210px; padding: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.system-grid, .system-panel { min-width: 0; }
.system-panel h3 { margin: 0; font-size: 19px; }
.system-panel p { margin: 0; line-height: 1.55; }
.system-panel label { font-size: 12px; font-weight: 700; color: #a9bdd0; }
.system-panel select { width: 100%; max-width: 420px; padding: 11px 12px; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; }
.system-panel strong { overflow-wrap: anywhere; }
.system-folder-list { width: 100%; display: grid; gap: 9px; }
.system-folder { display: grid; gap: 4px; padding: 11px 13px; border: 1px solid #355268; border-radius: 9px; background: #142536; }
.system-folder span, .system-meta { color: #9eb2c7; font-size: 12px; }
.action-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; padding: 0; border: 1px solid #3d5f70; border-radius: 18px; background: #142435; color: #e8f4ff; box-shadow: 0 25px 100px #000a; }
.action-dialog::backdrop { background: #020a12bf; }
.action-dialog form { display: grid; gap: 11px; padding: 26px; }
#create-avito-field:not([hidden]) { display: grid; gap: 11px; }
.action-dialog h2 { margin: 0; }
.action-dialog p { margin: 0 0 5px; font-size: 12px; line-height: 1.5; color: #9fb4c7; }
.action-dialog input, .action-dialog select { width: 100%; }
.action-dialog input, .action-dialog select { min-width: 0; padding: 11px 12px; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; }
.action-dialog input:focus, .action-dialog select:focus { outline: 2px solid #66d9c9; outline-offset: 1px; }
.action-dialog .email-address-control { display: grid; grid-template-columns: minmax(0, 1fr) 142px; gap: 8px; min-width: 0; }
.action-dialog .email-address-control input, .action-dialog .email-address-control select { min-width: 0; margin: 0; }
.action-dialog .email-address-control select { padding-inline: 10px; cursor: pointer; }
.subscription-preview { padding: 12px; border: 1px solid #356656; border-radius: 10px; background: #183b36; color: #d8fff4 !important; }
.create-status { padding: 12px; border: 1px solid #4a7188; border-radius: 10px; background: #193244; color: #d9efff !important; }
.create-status.error { border-color: #a35d56; background: #422a2a; color: #ffe0da !important; }
.dialog-actions { justify-content: flex-end; margin-top: 12px; }
@media (max-width: 1000px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .main-area { min-width: 0; }
  .folder-add-panel { grid-template-columns: 1fr; }
}
@media (max-width: 730px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 18px; border: 0; overflow: visible; }
  .panel-tabs button { min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #2b3d52; border-radius: 10px; background: #142536; font-size: 12px; white-space: normal; }
  .panel-tabs button.active { border-color: #78dfd0; background: #173b3e; }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dashboard-grid, .folder-admin-grid { grid-template-columns: 1fr; }
  .dashboard-panel, .folder-admin-card { min-height: 0; padding: 17px; }
  .folder-add-panel { padding: 17px; }
  .folder-add-panel input, .folder-add-panel select { font-size: 16px; }
  .folder-add-panel button, .folder-sync-bar button { width: 100%; }
  .list-tools .primary-button { padding: 9px 10px; font-size: 11px; }
  .filters input { flex: 1 1 100%; }
  .filters select { flex: 1 1 calc(50% - 4px); }
  .list-panel, .ticket-list, .ticket-detail, .audit-list, .manual-list, .manual-detail { min-height: 160px; }
  .manage-card { margin: 16px; padding: 15px; }
  .manage-inline, .manage-buttons { flex-direction: column; align-items: stretch; }
  .manage-inline button, .manage-buttons button, .danger-button { width: 100%; }
  .support-grid { grid-template-columns: 1fr; }
  .manual-grid { grid-template-columns: 1fr; }
  .ticket-detail { padding: 18px; }
  .ticket-filters select { flex: 1 1 140px; }
  .system-grid { grid-template-columns: 1fr; }
  .action-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .action-dialog form { padding: 18px; }
  .dialog-actions { flex-direction: column-reverse; align-items: stretch; }
  .dialog-actions button { width: 100%; }
  .action-dialog input, .action-dialog select, .ticket-filters input, .ticket-filters select,
  .filters input, .filters select, .manage-card input, .manage-card textarea,
  .ticket-reply-form textarea, .manual-note textarea { font-size: 16px; }
  .primary-button, .secondary-button, .ghost-button, .danger-button,
  .icon-button, .ticket-item, .manual-item { min-height: 44px; }
  .account-panel input { font-size: 16px; }
}
@media (max-width: 420px) {
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-heading > button { width: 100%; }
  .panel-head { padding: 18px 16px 14px; }
  .detail-info { grid-template-columns: 1fr; }
  .detail-info > div + div { border-left: 0; border-top: 1px solid #2a394d; }
  .manual-detail { padding: 16px; }
  .manual-detail .manual-actions button, .manual-detail .manual-note button { width: 100%; }
}

/* Consistent type and spacing across the dashboard and forms. */
:root { font-family: system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", Arial, sans-serif; font-synthesis: none; }
body { line-height: 1.45; }
button, input, select, textarea { font-family: inherit; }
button { line-height: 1.35; }
.main-area { max-width: 1540px; }
.topbar { margin-bottom: 22px; }
.topbar h1 { line-height: 1.15; }
.auto-refresh-status { margin: 7px 0 0; color: #92a9bc; font-size: 11px; line-height: 1.4; }
.auto-refresh-status.error { color: #ffb5a6; }
.panel-tabs button { font-size: 13px; line-height: 1.35; }
.section-heading h2, .panel-head h2, .dashboard-panel h3, .folder-admin-card h3 { line-height: 1.25; }
.manual-intro, .dashboard-row, .dashboard-panel > p, .folder-admin-card p,
.folder-add-panel p, .folder-sync-bar p, .account-panel p, .manage-card p,
.system-panel p, .ticket-message, .ticket-reply { font-size: 13px; line-height: 1.55; }
.folder-add-panel label, .account-panel label, .manage-card label,
.action-dialog label, .ticket-reply-form label, .system-panel label { font-size: 13px; }
.stat-card span { font-size: 13px; }
.stat-card small, .list-count, .ticket-filters span, .ticket-item small,
.ticket-date, .system-folder span, .system-meta, .action-note { font-size: 12px; }
.primary-button, .secondary-button, .ghost-button, .danger-button { font-size: 13px; }
.sidebar-bottom, .nav-caption, .brand-row span { line-height: 1.4; }
.folder-add-panel { grid-template-columns: minmax(220px, .6fr) minmax(0, 1.4fr); }
.folder-add-panel form { gap: 10px; }
.folder-add-panel input, .folder-add-panel select, .account-panel input,
.system-panel select, .action-dialog input, .action-dialog select { min-height: 44px; }
.workspace { grid-template-columns: minmax(360px, 410px) minmax(0, 1fr); }
.list-panel .panel-head { flex-wrap: wrap; }
.list-panel .panel-head > div:first-child { min-width: 0; }
.list-panel .list-tools { width: 100%; justify-content: flex-start; }
.list-panel .list-tools .primary-button { min-width: 180px; }
.list-panel .list-tools .icon-button { flex: 0 0 44px; width: 44px; height: 44px; }
.list-panel .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.list-panel .filters input { grid-column: 1 / -1; }
.list-panel .filters select { width: 100%; max-width: none; }
.subscriber-copy small { font-size: 12px; line-height: 1.4; }
.subscriber-copy strong, .manual-item strong, .ticket-item strong { font-size: 14px; }
.mini-status { font-size: 11px; }
.filters select { text-overflow: ellipsis; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid #78dfd0;
  outline-offset: 2px;
}
@media (max-width: 1100px) {
  .dashboard-stats, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .folder-add-panel { grid-template-columns: 1fr; }
  .main-area { padding: 26px 22px 48px; }
}
@media (max-width: 860px) {
  .workspace { display: block; }
  .workspace .list-panel { min-height: 0; }
  .workspace .detail-panel { display: none; }
  .workspace.show-detail .list-panel { display: none; }
  .workspace.show-detail .detail-panel { display: block; }
  .mobile-close { display: grid; }
  .dashboard-grid, .folder-admin-grid, .system-grid,
  .manual-grid, .support-grid { grid-template-columns: 1fr; }
}
@media (max-width: 730px) {
  .main-area { padding: 20px 14px 38px; }
  .panel-tabs button { font-size: 13px; }
  .stat-card { min-height: 118px; padding: 16px; }
  .stat-card span { font-size: 12px; }
  .stat-card small { font-size: 11px; line-height: 1.35; }
  .dashboard-panel, .folder-admin-card, .folder-add-panel { padding: 18px; }
  .list-tools .primary-button { font-size: 13px; }
  .filters input, .filters select { font-size: 16px; }
  .list-panel .panel-head { padding: 20px 18px 16px; }
}
@media (max-width: 420px) {
  .panel-tabs { gap: 8px; }
  .panel-tabs button { padding: 9px 7px; }
  .stat-card { padding: 14px; }
  .subscriber-item { display: grid; grid-template-columns: 37px minmax(0, 1fr); }
  .subscriber-avatar { grid-row: 1 / span 2; }
  .subscriber-copy strong { white-space: normal; overflow-wrap: anywhere; }
  .mini-status { grid-column: 2; justify-self: start; }
  .list-panel .list-tools .primary-button { flex: 1; min-width: 0; }
}
@media (max-width: 360px) {
  .list-panel .filters { grid-template-columns: 1fr; }
  .list-panel .filters input { grid-column: auto; }
}

/* Login card uses one clear type scale on both desktop and narrow phones. */
.login-screen { min-height: 100dvh; padding: 20px; }
.login-card {
  width: min(420px, 100%);
  min-width: 0;
  padding: 30px;
  font-family: "Segoe UI", Arial, sans-serif;
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-brand .brand-mark { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 15px; }
.login-brand-copy { min-width: 0; }
.login-brand-copy strong { display: block; font-size: 20px; line-height: 1.15; letter-spacing: -.025em; }
.login-brand-copy span { display: block; margin-top: 4px; color: #a9bdd0; font-size: 11px; font-weight: 700; letter-spacing: .08em; line-height: 1.35; }
.login-card h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.025em; }
.login-card form { gap: 0; margin-top: 24px; }
.login-card label { margin-bottom: 7px; font-size: 14px; line-height: 1.35; }
.login-card input { height: 48px; margin-bottom: 18px; padding: 0 14px; font-size: 16px; }
.login-card button { min-height: 48px; margin-top: 2px; font-size: 15px; }
.login-card .error-text { min-height: 0; margin: 14px 0 0; font-size: 13px; }
.login-card .error-text:empty { display: none; }
@media (max-width: 420px) {
  .login-screen { padding: 14px; }
  .login-card { padding: 24px; }
  .login-brand { gap: 12px; margin-bottom: 24px; }
  .login-brand-copy strong { font-size: 19px; }
  .login-card h1 { font-size: 23px; }
}

/* Add a Yandex folder by account and browser address. */
.folder-add-guide ol { margin: 18px 0; padding-left: 22px; color: #d5e5f0; font-size: 14px; line-height: 1.55; }
.folder-add-guide li { padding-left: 4px; margin-bottom: 10px; }
.folder-add-guide li::marker { color: #7de2d4; font-weight: 800; }
.folder-guide-note { padding: 12px 14px; border: 1px solid #48526a; border-radius: 10px; background: #1a2938; color: #c8d8e9; }
.folder-add-panel form > p { margin: 0; }
.folder-field-hint { color: #a7bad0; }
.folder-preview { min-width: 0; padding: 13px 14px; border: 1px solid #36685e; border-radius: 10px; background: #16332f; color: #d6f8ed; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.folder-preview-warning { border-color: #745b3e; background: #31271f; color: #f4d2a0; }
.folder-add-impact { color: #b5c7d9; font-size: 13px; line-height: 1.5; }
.folder-add-panel .error-text { padding: 11px 13px; border: 1px solid #885153; border-radius: 9px; background: #39272d; }

.account-add-panel { min-height: 0; padding: 22px; margin-bottom: 16px; display: grid; grid-template-columns: minmax(220px, .6fr) minmax(0, 1.4fr); gap: 20px; }
.account-add-panel h3 { margin: 0 0 10px; font-size: 19px; }
.account-add-panel p { margin: 0; font-size: 13px; line-height: 1.55; }
.account-add-panel form { display: grid; align-content: start; gap: 10px; }
.account-add-panel label { color: #a9bdd0; font-size: 13px; font-weight: 700; }
.account-add-panel input { width: 100%; min-width: 0; min-height: 44px; padding: 11px 12px; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; }
.account-add-panel button { justify-self: start; }
.account-email { color: #d8f8ee; overflow-wrap: anywhere; }
.account-connect-button { margin-top: 12px; }
.account-login-content { display: grid; justify-items: center; gap: 14px; padding: 26px; text-align: center; }
.account-login-content .eyebrow { margin: 0; }
.account-login-content h2 { margin: 0; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.account-login-content p { margin: 0; max-width: 410px; font-size: 13px; line-height: 1.55; color: #b7cbe0; }
.account-login-form { display: grid; width: min(312px, 100%); gap: 10px; text-align: left; }
.account-login-form[hidden] { display: none; }
.account-login-form label { color: #d8e9f4; font-size: 13px; font-weight: 700; }
.account-login-form input { width: 100%; min-width: 0; min-height: 44px; padding: 11px 12px; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; }
.account-login-content button { width: 100%; max-width: 312px; }
.mailing-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.mailing-oauth-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); gap:16px 24px; align-items:start; margin-top:16px; padding:22px; }
.mailing-oauth-panel h3 { margin:0 0 10px; font-size:19px; color:#f0f8fc; }
.mailing-oauth-panel .mailing-sender { max-width:420px; margin-bottom:12px; }
.mailing-oauth-panel .muted { margin:0; line-height:1.5; }
.mailing-oauth-actions { display:grid; gap:12px; min-width:0; }
.mailing-oauth-actions > button { justify-self:start; }
#mailing-oauth-settings { min-width:0; padding:14px 16px; border:1px solid #345266; border-radius:11px; background:#102231; }
#mailing-oauth-settings summary { color:#d9f7ef; font-weight:800; cursor:pointer; }
#mailing-oauth-settings[open] summary { margin-bottom:12px; }
#mailing-oauth-settings p { margin-bottom:12px; font-size:13px; overflow-wrap:anywhere; }
#mailing-oauth-settings a { color:#80e3d7; }
#mailing-oauth-client-form { display:grid; gap:8px; }
#mailing-oauth-client-form label { color:#bed2e1; font-size:13px; font-weight:700; }
#mailing-oauth-client-form input { width:100%; min-width:0; min-height:44px; padding:11px 12px; border:1px solid #38516a; border-radius:9px; background:#0e1826; color:#e8f4ff; }
#mailing-oauth-client-form button { justify-self:start; margin-top:4px; }
#mailing-oauth-status { margin:0; color:#bed2e1; font-size:13px; }
.mailing-sender-remove { justify-self: start; }
#mailing-sender-status { width: fit-content; max-width: 100%; margin: 0; padding: 7px 10px; border: 1px solid #785b42; border-radius: 12px; background: #38291e; color: #ffd393; font-size: 12px; font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; }
#mailing-sender-status.connected { border-color: #418a7a; background: #173a34; color: #9ef0dc; }
.mailing-panel { display: grid; gap: 10px; min-width: 0; min-height: 0; padding: 22px; }
.mailing-panel .eyebrow { margin: 0 0 4px; }
.mailing-panel label { color: #bed2e1; font-size: 13px; font-weight: 700; }
.mailing-sender { padding: 11px 12px; border: 1px solid #36685e; border-radius: 9px; background: #16332f; color: #d6f8ed; font-weight: 700; overflow-wrap: anywhere; }
.mailing-panel input, .mailing-panel select, .mailing-panel textarea { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; }
.mailing-panel input, .mailing-panel select { min-height: 44px; }
.mailing-panel textarea { resize: vertical; line-height: 1.55; }
.mailing-panel p { margin: 0; }
.mailing-panel a { color: #80e3d7; }
.mailing-preview { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; color: #c5dedf; }
.mailing-preview strong { color: #80e3d7; font-size: 30px; line-height: 1; }
.mailing-selection-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mailing-selection-actions button { flex: 1 1 140px; }
.mailing-recipients { max-height: 370px; overflow: auto; display: grid; align-content: start; gap: 7px; color: #bfd0df; font-size: 13px; overflow-wrap: anywhere; }
.mailing-recipient-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 11px; border: 1px solid #2a4557; border-radius: 9px; background: #102131; cursor: pointer; }
.mailing-recipient-row:hover, .mailing-recipient-row:has(input:checked) { border-color: #66cbbd; background: #173b3c; }
.mailing-recipient-row input { flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: #78e6d4; }
.mailing-recipient-info { min-width: 0; }
.mailing-recipient-info strong, .mailing-recipient-info small { display: block; overflow-wrap: anywhere; }
.mailing-recipient-info strong { color: #eff9fa; font-size: 13px; }
.mailing-recipient-info small { margin-top: 3px; color: #a9beca; font-size: 11px; }
#mailing-channel-note { color: #a8cbd0; font-size: 12px; line-height: 1.45; }
.mailing-history-panel { min-height: 0; margin-top: 16px; padding: 22px; }
.mailing-history-panel h3 { margin: 0 0 12px; }
.mailing-history-item { padding: 12px 0; border-top: 1px solid #314459; color: #c4d5e2; overflow-wrap: anywhere; }
.mailing-history-item strong { display: block; color: #edf8fb; }
#mailing-job { margin-bottom: 10px; color: #d7f7ef; }
#mailing-form-status { min-height: 20px; color: #c3d3df; }
#mailing-send-note { color: #a8c0cb; font-size: 12px; }
.dashboard-mailing-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; min-height: 0; margin: 0 0 18px; padding: 16px 20px; border-color: #37766f; background: #143135; color: #e8fffa; text-align: left; }
.dashboard-mailing-link:hover, .dashboard-mailing-link:focus-visible { border-color: #84e9d8; background: #1c4445; }
.dashboard-mailing-link strong, .dashboard-mailing-link small { display: block; }
.dashboard-mailing-link strong { font-size: 15px; }
.dashboard-mailing-link small { margin-top: 4px; color: #b1d5d0; font-size: 12px; }
.dashboard-mailing-link > span:last-child { flex: 0 0 auto; font-size: 13px; font-weight: 800; }
@media (max-width: 1000px) {
  .account-add-panel { grid-template-columns: 1fr; }
}
@media (max-width: 730px) {
  .mailing-oauth-panel { grid-template-columns:1fr; padding:18px; }
  .mailing-oauth-actions > button, #mailing-oauth-client-form button { width:100%; }
  #mailing-oauth-client-form input { font-size:16px; }
  .mailing-sender-remove { width: 100%; }
  .dashboard-mailing-link { align-items: flex-start; padding: 15px 16px; }
  .account-add-panel { padding: 18px; }
  .account-add-panel input { font-size: 16px; }
  .account-add-panel button, .account-connect-button { width: 100%; }
  .account-login-content { padding: 18px; }
  .mailing-grid { grid-template-columns: 1fr; }
  .mailing-panel, .mailing-history-panel { padding: 18px; }
  .mailing-panel input, .mailing-panel textarea { font-size: 16px; }
  .mailing-panel button { width: 100%; }
}

/* Layout and type system for the working area. */
:root {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}
html { font-size: 14px; }
body { font-size: 14px; line-height: 1.5; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; }
.app-shell { display: block; }
.main-area { max-width: 1440px; padding: 30px 32px 64px; }
.topbar { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #24354a; }
.topbar-identity { display: flex; align-items: center; min-width: 0; gap: 16px; }
.topbar-identity > div:last-child { min-width: 0; }
.topbar-identity .brand-mark { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 14px; }
.topbar .eyebrow { margin-bottom: 4px; }
.topbar h1 { font-size: clamp(24px, 2.3vw, 30px); font-weight: 730; line-height: 1.18; letter-spacing: -.025em; }
.auto-refresh-status { margin-top: 5px; font-size: 12px; }
.eyebrow { color: #91abc2; font-size: 11px; letter-spacing: .11em; }
.top-actions { flex: 0 0 auto; }
.mobile-navigation, .mobile-list-back { display: none; }
.panel-tabs {
  display: flex; flex-wrap: wrap; gap: 7px; overflow: visible;
  margin: 0 0 28px; padding: 0 0 11px;
  border-bottom: 1px solid #24354a;
}
.panel-tabs button {
  flex: 0 0 auto; min-height: 44px; padding: 10px 14px; border-radius: 10px;
  color: #b9ccdc; font-size: 13px; font-weight: 650; white-space: nowrap;
}
.panel-tabs button:hover { border-color: #6db8b1; color: #f2fffc; }
.panel-tabs button.active { background: #174345; border-color: #6bd2c4; color: #edfffa; }
.panel-tabs span { margin-left: 5px; }
.section-heading { margin: 4px 0 18px; }
.section-heading h2 { font-size: clamp(21px, 2vw, 25px); font-weight: 700; letter-spacing: -.02em; }
.panel, .stat-card { border-color: #2a3b50; }
.panel { min-width: 0; }
.dashboard-grid, .folder-admin-grid, .manual-grid, .support-grid, .system-grid { gap: 18px; }
.dashboard-panel, .folder-admin-card { padding: 22px; }
.dashboard-panel h3, .folder-admin-card h3 { font-size: 18px; font-weight: 700; }
.dashboard-row { font-size: 14px; line-height: 1.5; }
.stat-card { min-height: 112px; padding: 19px 21px; }
.stat-card span { font-size: 13px; line-height: 1.4; }
.stat-card strong { font-size: 30px; line-height: 1.15; }
.stat-card small { font-size: 12px; line-height: 1.4; }
.workspace { grid-template-columns: minmax(330px, 390px) minmax(0, 1fr); gap: 18px; }
.panel-head h2 { font-size: 20px; }
.subscriber-item, .manual-item, .ticket-item { padding: 16px 18px; }
.subscriber-copy strong, .manual-item strong, .ticket-item strong { font-size: 14px; line-height: 1.4; }
.subscriber-copy small, .manual-item span, .ticket-item span { font-size: 13px; line-height: 1.45; }
.ticket-item small, .ticket-date, .list-count, .action-note { font-size: 12px; line-height: 1.45; }
.mini-status { flex: 0 0 auto; font-size: 10px; letter-spacing: .02em; }
.manual-intro, .folder-admin-card p, .folder-add-panel p, .account-panel p,
.manage-card p, .system-panel p, .ticket-message, .ticket-reply { font-size: 14px; line-height: 1.55; }
.primary-button, .secondary-button, .ghost-button, .danger-button { font-size: 14px; font-weight: 700; }
.primary-button, .secondary-button, .ghost-button { min-height: 42px; }
.ticket-filters input, .ticket-filters select, .filters input, .filters select,
.account-panel input, .manage-card input, .manage-card textarea,
.action-dialog input, .action-dialog select { font-size: 14px; }
.account-panel label, .manage-card label, .folder-add-panel label,
.action-dialog label, .ticket-reply-form label, .system-panel label { font-size: 13px; }
.action-dialog { width: min(560px, calc(100vw - 28px)); }
.action-dialog form { gap: 12px; padding: 28px; }
.action-dialog h2 { font-size: 23px; line-height: 1.25; }
.action-dialog p { font-size: 13px; line-height: 1.55; }
.ticket-detail, .manual-detail { min-width: 0; }
.ticket-detail h3, .manual-detail h3 { font-size: 19px; }
.ticket-message, .ticket-reply { margin: 10px 0; }
.login-screen { background: radial-gradient(circle at 50% 0%, #1b3b4a 0, #0b101a 52%); }
.login-card { border-color: #345064; background: #111e2d; box-shadow: 0 28px 70px #0008; }
.login-card h1 { font-size: 27px; }
.login-card label { font-size: 13px; }
.login-card input { border-color: #38516a; }

@media (max-width: 900px) {
  .main-area { padding: 24px 22px 52px; }
  .dashboard-stats, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .folder-admin-grid, .manual-grid, .support-grid, .system-grid { grid-template-columns: 1fr; }
}
@media (max-width: 730px) {
  .main-area { padding: 18px 14px 42px; }
  .panel-tabs { display: none; }
  .mobile-navigation { display: grid; gap: 7px; margin: 0 0 22px; color: #a9c0d3; font-size: 12px; font-weight: 700; }
  .mobile-navigation select {
    width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #588f91;
    border-radius: 11px; background: #142c37; color: #edfffa; font-size: 16px; font-weight: 700;
  }
  .section-heading { gap: 10px; }
  .section-heading h2 { font-size: 21px; }
  .section-heading > button { min-width: 96px; }
  .dashboard-stats, .stats { gap: 10px; }
  .stat-card { min-height: 104px; padding: 15px; }
  .stat-card strong { font-size: 27px; }
  .dashboard-panel, .folder-admin-card, .folder-add-panel, .account-add-panel { padding: 18px; }
  .dashboard-panel h3, .folder-admin-card h3 { font-size: 18px; }
  .support-grid.show-detail .ticket-list, .manual-grid.show-detail .manual-list { display: none; }
  .support-grid.show-detail .ticket-detail, .manual-grid.show-detail .manual-detail { display: block; }
  .mobile-list-back { display: inline-flex; align-items: center; margin: 0 0 18px; }
  .ticket-filters { display: grid; grid-template-columns: 1fr auto; }
  .ticket-filters input { grid-column: 1 / -1; width: 100%; }
  .ticket-filters select { width: 100%; }
  .ticket-filters span { align-self: center; }
  .action-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .action-dialog form { padding: 20px; }
  .action-dialog input, .action-dialog select, .ticket-filters input, .ticket-filters select,
  .filters input, .filters select, .manage-card input, .manage-card textarea,
  .ticket-reply-form textarea, .manual-note textarea { font-size: 16px; }
  .login-card { padding: 26px; }
}
@media (max-width: 420px) {
  .section-heading { align-items: flex-start; }
  .ticket-filters { grid-template-columns: 1fr; }
  .ticket-filters input { grid-column: auto; }
  .ticket-filters span { justify-self: start; }
}

/* 2026 panel refresh: one visual system for dashboard, lists, forms and mobile. */
:root {
  --surface: #111d2a;
  --surface-raised: #162536;
  --line: #304356;
  --text: #edf6fb;
  --secondary: #afc2d0;
  --accent: #75e5d3;
  --amber: #ffd18a;
}
html { background: #0a121d; }
body {
  color: var(--text);
  background: radial-gradient(ellipse 820px 390px at 8% -100px, #173943 0, transparent 68%),
    linear-gradient(180deg, #0b1420 0, #0a111b 440px);
}
.main-area { max-width: 1540px; padding-inline: clamp(18px, 3vw, 48px); }
.topbar { border-color: var(--line); }
.topbar .eyebrow { color: #8ccbbf; }
.topbar h1 { color: #f4fbff; font-weight: 750; }
.auto-refresh-status { color: #9db5c7; }
.brand-mark { background: linear-gradient(145deg, #8cf2d9, #50b4d5); box-shadow: 0 10px 28px #38bfb231; }
.panel-tabs { border-color: var(--line); }
.panel-tabs button {
  border-color: #30475b; background: #162536; color: #c2d2de;
  transition: transform .16s ease;
}
.panel-tabs button:hover { background: #1d3445; transform: translateY(-1px); }
.panel-tabs button.active {
  background: #75e5d3; border-color: #a8f8e8; color: #092b2d;
  font-weight: 800; box-shadow: 0 0 0 2px #75e5d330, 0 8px 18px #030a1340;
}
.panel-tabs button.active:hover { background: #93f1e2; color: #092b2d; transform: none; }
.panel-tabs button.active::before {
  content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px;
  border-radius: 50%; background: #0b4444; vertical-align: 1px;
}
.panel-tabs button.active span { color: #092b2d; }
.panel-tabs span:empty { display: none; }
.topbar { flex-wrap: nowrap; gap: 12px; }
.topbar-identity { flex: 1 1 0; min-width: 0; }
.top-actions { position: relative; flex: 0 0 auto; gap: 8px; margin-left: auto; }
.runtime-widget { position: static; }
.runtime-toggle {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px;
  padding: 8px 11px; border: 1px solid #4a928b; border-radius: 10px;
  background: #163639; color: #dafbf4; cursor: pointer;
  list-style: none; white-space: nowrap;
}
.runtime-toggle::-webkit-details-marker { display: none; }
.runtime-toggle::after { content: '⌄'; color: #8fdbd0; font-size: 16px; line-height: 1; }
.runtime-widget[open] .runtime-toggle { border-color: #8bf1de; background: #20514c; }
.runtime-widget[open] .runtime-toggle::after { transform: rotate(180deg); }
.runtime-toggle:hover { background: #20514c; }
.runtime-toggle strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.runtime-compact-cpu { padding-left: 8px; border-left: 1px solid #4d817d; color: #a5dcd2; font-size: 11px; font-weight: 700; }
.runtime-indicator { width: 7px; height: 7px; border-radius: 50%; background: #75e5d3; box-shadow: 0 0 0 3px #75e5d328; }
.runtime-bar {
  position: absolute; z-index: 30; top: calc(100% + 9px); right: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px; width: min(344px, calc(100vw - 28px)); padding: 10px;
  border: 1px solid #49777c; border-radius: 14px; background: #0e1e2b;
  box-shadow: 0 20px 45px #020910b8;
}
.runtime-item {
  display: grid; align-content: center; gap: 2px; min-width: 0; min-height: 57px;
  padding: 8px 10px; border: 1px solid #355467; border-radius: 9px;
  background: #142737;
}
.runtime-item span { color: #83c5ba; font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.runtime-item strong { color: #f1fbff; font-size: 17px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.runtime-item small { color: #9fb9c6; font-size: 10px; line-height: 1.25; }
.runtime-time { grid-column: 1 / -1; border-color: #4a928b; background: #163639; }
.runtime-time strong { color: #9af1de; }
.runtime-bar.stale .runtime-item:not(.runtime-time) { opacity: .62; }
.runtime-widget:has(.runtime-bar.stale) .runtime-indicator { background: #f2c77e; box-shadow: 0 0 0 3px #f2c77e28; }

.section-heading { margin-top: 8px; }
.section-heading .eyebrow { color: #8ccbbf; }
.section-heading h2 { color: #f4fbff; font-weight: 750; }
.manual-intro { max-width: 850px; color: var(--secondary); }
.panel, .stat-card {
  background: linear-gradient(160deg, #142231, var(--surface) 70%);
  border-color: var(--line);
  box-shadow: 0 14px 38px #030a1326;
}
.stat-card { position: relative; overflow: hidden; border-radius: 17px; }
.stat-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: #668b9d;
}
.stat-card:first-child::before { background: var(--accent); }
.stat-card:nth-child(2)::before { background: var(--amber); }
.stat-card:nth-child(3)::before { background: #eea989; }
.stat-card:nth-child(4)::before { background: #8db3ee; }
.stat-card span { color: #bed0dc; font-weight: 650; }
.stat-card strong { color: #f1fbfc; font-variant-numeric: tabular-nums; }
.stat-card small { color: #9cb1c2; }
.stat-card:nth-child(2) strong, .stat-card:nth-child(3) strong,
.stat-card:nth-child(4) strong { color: var(--amber); }
.stat-button:hover { background: #1b3040; box-shadow: 0 16px 34px #030a1340; }
.dashboard-panel { min-height: 150px; }
.dashboard-panel h3 { margin-bottom: 10px; color: #f0f8fc; }
.dashboard-row { border-color: #35485a; padding: 12px 9px; border-radius: 7px; }
.dashboard-row:hover { background: #203848; color: #d7fff4; }
.dashboard-panel .empty-note { color: #a9becd; }
.account-health-summary {
  background: #182b3b; border-color: #385064; color: #c0d3df;
}
.manual-item, .subscriber-item, .ticket-item { border-color: #304255; }
.manual-item:hover, .manual-item.selected,
.subscriber-item:hover, .subscriber-item.selected,
.ticket-item:hover, .ticket-item.selected { background: #203646; }
.manual-item.selected, .subscriber-item.selected, .ticket-item.selected { box-shadow: inset 3px 0 var(--accent); }
.manual-item strong, .subscriber-copy strong, .ticket-item strong { color: #f0f8fc; }
.manual-item span, .ticket-item span { color: #b7cbd8; }
.manual-item small, .subscriber-copy small, .ticket-item small { color: #9db4c5; }
.manual-item .mini-status { font-size: 11px; letter-spacing: .025em; }
.manual-detail > .empty-note, .ticket-detail > .empty-note {
  min-height: 170px; margin: 0; display: grid; place-items: center;
  text-align: center; color: #b7cbd8; font-size: 14px;
}
.manual-detail > .empty-note::before, .ticket-detail > .empty-note::before {
  content: '↗'; display: grid; place-items: center; width: 44px; height: 44px;
  margin: 0 auto 12px; border: 1px solid #447b78; border-radius: 13px;
  color: var(--accent); font-size: 22px;
}
.primary-button { background: var(--accent); border-color: var(--accent); color: #092323; }
.primary-button:hover { background: #9af1de; }
.secondary-button, .ghost-button, .icon-button {
  background: #1a2b3b; border-color: #385064; color: #e1eff5;
}
.secondary-button:hover, .ghost-button:hover, .icon-button:hover { background: #253f50; }
input, select, textarea { color-scheme: dark; }
.filters input, .filters select, .ticket-filters input, .ticket-filters select,
.folder-add-panel input, .folder-add-panel select, .account-add-panel input,
.manual-detail textarea, .manual-detail input, .ticket-reply-form textarea {
  border-color: #3b5368; background: #0e1a27; color: #edf6fb;
}
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.folder-admin-card, .account-add-panel, .folder-add-panel, .system-panel { min-height: 0; }
.action-dialog { border-color: #56827e; background: #132333; }
.login-screen {
  background: radial-gradient(ellipse 550px 390px at 50% 10%, #1c4a4a 0, transparent 70%), #0a121d;
}
.login-card { background: linear-gradient(160deg, #182c3b, #101b29); border-color: #436a72; }
.login-brand-copy span { color: #9ec2c5; }
.login-card h1 { color: #f3fbff; }
.login-card label { color: #c8dce5; }
.login-card input { min-height: 48px; background: #0d1b28; border-color: #436071; }
.login-card .primary-button { min-height: 48px; font-size: 15px; }
@media (max-width: 900px) {
  .main-area { padding-inline: 18px; }
}
@media (max-width: 730px) {
  .main-area { padding: 18px 14px 42px; }
  .manual-grid:not(.show-detail) .manual-detail,
  .support-grid:not(.show-detail) .ticket-detail { display: none; }
  .manual-grid.show-detail .manual-list,
  .support-grid.show-detail .ticket-list { display: none; }
  .manual-grid.show-detail .manual-detail,
  .support-grid.show-detail .ticket-detail { display: block; }
  .mobile-navigation select {
    background: #1c4845; border: 2px solid #75e5d3;
    box-shadow: 0 0 0 3px #75e5d31c; font-weight: 800;
  }
  .mobile-current-view {
    display: inline-flex; align-items: center; gap: 5px; width: fit-content;
    margin-top: 3px; padding: 7px 11px; border: 1px solid #4f9b91;
    border-radius: 999px; background: #173a3a; color: #b8d9d6;
    font-size: 12px; line-height: 1.3;
  }
  .mobile-current-view::before {
    content: ''; width: 7px; height: 7px; margin-right: 3px;
    border-radius: 50%; background: #75e5d3; box-shadow: 0 0 0 3px #75e5d324;
  }
  .mobile-current-view strong { color: #edfffa; font-weight: 800; }
  .dashboard-stats, .stats { gap: 9px; }
  .dashboard-panel { min-height: 0; }
  .manual-item, .ticket-item, .subscriber-item { min-height: 68px; }
  .manual-item .mini-status { max-width: 115px; }
}
@media (max-width: 420px) {
  .stat-card { padding: 14px 13px; }
  .stat-card span { font-size: 11px; }
  .stat-card strong { font-size: 26px; }
  .manual-item { gap: 8px; padding-inline: 13px; }
}

.global-search {
  margin: -8px 0 24px; padding: 15px 17px;
  border: 1px solid #355468; border-radius: 15px;
  background: #122333;
}
.global-search label { display: block; margin-bottom: 8px; color: #b5d4d6; font-size: 12px; font-weight: 800; }
.global-search-control { display: flex; gap: 9px; }
.global-search-control input {
  flex: 1; min-width: 0; min-height: 46px; padding: 10px 14px;
  border: 1px solid #477082; border-radius: 10px; background: #0d1a28;
  color: #f2fbff; font: inherit; font-size: 14px;
}
.global-search-control input::placeholder { color: #91aebe; }
.global-search-results {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px; max-height: 330px; overflow-y: auto; margin-top: 11px;
  padding-top: 11px; border-top: 1px solid #355468;
}
.global-search-result {
  display: grid; gap: 3px; min-width: 0; padding: 11px 13px;
  border: 1px solid #355468; border-radius: 10px; background: #192d3d;
  color: #f0f8fc; text-align: left; cursor: pointer;
}
.global-search-result:hover, .global-search-result:focus-visible { border-color: #75e5d3; background: #21463f; }
.global-search-result strong { overflow-wrap: anywhere; font-size: 13px; }
.global-search-result span { color: #afc5d1; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.global-search-empty, .global-search-more { margin: 5px; color: #b6ccd6; font-size: 13px; }

.access-summary { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.access-summary span {
  padding: 9px 12px; border: 1px solid #3b5368; border-radius: 9px;
  background: #172a3a; color: #c3d3dd; font-size: 12px;
}
.access-summary strong { color: #f2fbff; }
.access-filters input { flex: 1 1 260px; }
.access-filters select { flex: 0 1 190px; }
.access-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.access-task { display: flex; justify-content: space-between; gap: 18px; min-width: 0; min-height: 0; padding: 19px; }
.access-task.error { border-color: #8c5858; }
.access-task.review { border-color: #947747; }
.access-task-info { min-width: 0; }
.access-task h3 { margin: 9px 0 5px; font-size: 16px; overflow-wrap: anywhere; }
.access-task p { margin: 5px 0; overflow-wrap: anywhere; line-height: 1.45; }
.access-task-meta { color: #bbccd7; font-size: 12px; }
.access-task-reason { color: #f1d4c0; font-size: 13px; }
.access-task-time { color: #9fb7c5; font-size: 11px; }
.access-folder-failure { display: block; margin: 8px 0 0; color: #ffb1a4; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.access-state { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.access-state.error { background: #4a2927; color: #ffc0b4; }
.access-state.review { background: #4b391c; color: #ffdc88; }
.access-state.pending { background: #204041; color: #a8e7dc; }
.access-task-actions { display: flex; flex: 0 0 150px; flex-direction: column; align-items: stretch; gap: 8px; }
.access-task-actions button { min-height: 42px; white-space: normal; line-height: 1.3; }
.access-empty { grid-column: 1 / -1; min-height: 0; padding: 32px 20px; color: #bdced9; text-align: center; }
.search-highlight { border-color: #8bf1de !important; box-shadow: 0 0 0 3px #75e5d339 !important; }
@media (max-width: 1100px) {
  .access-list { grid-template-columns: 1fr; }
}
@media (max-width: 730px) {
  .global-search { margin: -4px 0 22px; padding: 13px; }
  .global-search-results { grid-template-columns: 1fr; }
  .access-task { flex-direction: column; }
  .access-task-actions { flex: auto; flex-direction: row; }
  .access-task-actions button { flex: 1; }
}
@media (max-width: 420px) {
  .global-search-control { flex-wrap: wrap; }
  .global-search-control button { width: 100%; }
  .access-task-actions { flex-direction: column; }
}

.topbar-mobile-brand, .runtime-mobile-label { display: none; }

/* Mobile content spacing and controls. */
@media (max-width: 730px) {
  .main-area { padding: 14px 14px 40px; }

  .mobile-navigation { margin: 0 0 15px; gap: 6px; }
  .mobile-navigation select { min-height: 46px; }
  .mobile-current-view {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .global-search { margin: 0 0 20px; }
  .global-search-control input { font-size: 16px; }
  .section-heading { align-items: center; gap: 10px; }
  .section-heading > div { min-width: 0; }
  .section-heading h2 { overflow-wrap: anywhere; }
  .section-heading > button { min-height: 44px; }

  .dashboard-stats, .stats { gap: 9px; }
  .stat-card { min-height: 108px; padding: 13px; }
  .stat-card > span:first-child { min-height: 2.8em; font-size: 12px; }
  .stat-card strong { font-size: 27px; }
  .stat-card small { font-size: 11px; }
  .dashboard-panel, .folder-admin-card, .folder-add-panel, .account-add-panel,
  .mailing-panel, .mailing-history-panel { padding: 16px; }
  .panel-head { flex-wrap: wrap; padding: 18px 16px 14px; }
  .panel-head > div { min-width: 0; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filters input { grid-column: 1 / -1; }
  .filters select { width: 100%; max-width: none; }
  .primary-button, .secondary-button, .ghost-button, .danger-button { min-height: 44px; }
  .login-card { padding: 24px 20px; }
}

@media (min-width: 360px) and (max-width: 730px) {
  .section-heading { flex-direction: row; justify-content: space-between; }
  .section-heading > button { width: auto; flex: 0 0 auto; }
}

@media (max-width: 359px) {
  .section-heading { align-items: stretch; }
  .section-heading > button { width: 100%; }
}

.promo-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.promo-panel { min-width: 0; min-height: 0; padding: 22px; }
.promo-panel h3 { margin: 0 0 18px; }
.promo-panel label { display: block; margin: 12px 0 7px; color: #c4dce3; font-size: 13px; font-weight: 700; }
.promo-panel input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; }
.promo-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.promo-panel .field-help { color: #a6bdc9; font-size: 12px; line-height: 1.5; }
.promo-panel .form-status { min-height: 1.4em; color: #9debd9; overflow-wrap: anywhere; }
.promo-panel .primary-button { margin-top: 8px; }
.promo-list { display: grid; gap: 10px; }
.promo-card { min-width: 0; padding: 14px; border: 1px solid #345266; border-radius: 12px; background: #102131; }
.promo-card-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.promo-code { color: #eafffb; font-size: 17px; letter-spacing: .04em; overflow-wrap: anywhere; }
.promo-state { padding: 5px 8px; border-radius: 999px; background: #263748; color: #c4d8e4; font-size: 11px; font-weight: 800; }
.promo-state-active { background: #173c37; color: #94f0dc; }
.promo-card p { margin: 9px 0 4px; color: #d0e1e9; }
.promo-card small { display: block; color: #a8c0cc; }
.promo-card button { margin-top: 11px; min-height: 44px; padding: 8px 12px; }
.promo-history-panel { grid-column: 1 / -1; }
.promo-history-heading, .promo-redemption-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.promo-history-heading h3 { margin-bottom: 0; }
.promo-redemption-list { display: grid; gap: 8px; margin-top: 16px; }
.promo-redemption { min-width: 0; padding: 12px 14px; border: 1px solid #345266; border-radius: 11px; background: #102131; }
.promo-redemption strong { color: #eafffb; overflow-wrap: anywhere; }
.promo-redemption-code { color: #94f0dc; font-size: 12px; font-weight: 800; letter-spacing: .04em; overflow-wrap: anywhere; }
.promo-redemption small { margin-top: 6px; overflow-wrap: anywhere; }
.promo-history-panel > button { margin-top: 14px; }
.promo-history-panel > button[hidden] { display: none; }
.payment-settings { min-height: 0; margin: 22px 0; }
.payment-settings summary { cursor: pointer; font-weight: 800; color: #e9fcf6; }
.payment-settings form { display: grid; gap: 5px; margin-top: 18px; max-width: 600px; }
.payment-settings select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #38516a; border-radius: 9px; background: #0e1826; color: #e8f4ff; }
.payment-settings label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.payment-settings input[type="checkbox"] { width: 19px; height: 19px; min-height: 0; flex: 0 0 19px; padding: 0; accent-color: #77e0cf; }
.telegram-subtabs { display: flex; gap: 10px; margin: 0 0 20px; }
.telegram-subtabs button { min-height: 44px; padding: 10px 18px; border: 1px solid #38516a; border-radius: 12px; background: #162536; color: #c6d9e4; font: inherit; font-weight: 700; cursor: pointer; }
.telegram-subtabs button:hover { border-color: #78dfd0; color: #effffb; }
.telegram-subtabs button.active { border-color: #93eddf; background: #23504d; color: #f2fffc; box-shadow: 0 0 0 2px #75e5d32b; }
@media (max-width: 730px) {
  .telegram-subtabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .telegram-subtabs button { min-width: 0; padding-inline: 8px; font-size: 13px; }
}

/* Access checks can take several seconds while Yandex Disk loads. */
.detail-empty.checking .empty-icon,
.check-spinner {
  width: 46px;
  height: 46px;
  border: 3px solid #335964;
  border-top-color: #78e6d3;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 5px #62d8c111;
  animation: access-check-spin .8s linear infinite;
}
.detail-empty.checking .empty-icon { font-size: 0; }
.check-progress { display: flex; align-items: center; justify-content: center; gap: 15px; min-height: 170px; color: #c6e9e5; font-size: 14px; font-weight: 700; text-align: center; }
.check-spinner { flex: 0 0 46px; display: inline-block; }
.subscriber-item.is-checking,
.manual-item.is-checking { background: #1a3a3c; opacity: 1; }
.is-checking .mini-status { display: inline-flex; align-items: center; gap: 6px; color: #bff9ec; background: #24514b; }
.is-checking .mini-status::before { content: ''; display: inline-block; width: 11px; height: 11px; border: 2px solid #a6e9dc; border-top-color: transparent; border-radius: 50%; animation: access-check-spin .8s linear infinite; }
.access-task-actions button.is-checking::before,
.manual-actions button.is-checking::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -2px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: access-check-spin .8s linear infinite; }
.detail-check-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
@keyframes access-check-spin { to { transform: rotate(360deg); } }
@media (max-width: 730px) { .check-progress { flex-direction: column; padding: 28px 12px; } .detail-check-actions { flex-direction: column; width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .detail-empty.checking .empty-icon, .check-spinner, .is-checking .mini-status::before,
  .access-task-actions button.is-checking::before, .manual-actions button.is-checking::before { animation-duration: 1.8s; }
}
.capacity-card progress { display: block; width: 100%; height: 8px; margin: 6px 0 2px; border: 0; border-radius: 999px; overflow: hidden; accent-color: #70e5d3; }
.capacity-card progress::-webkit-progress-bar { background: #183344; border-radius: 999px; }
.capacity-card progress::-webkit-progress-value { background: #70e5d3; border-radius: 999px; }
.capacity-card.capacity-warning progress { accent-color: #f6c97d; }
.capacity-card.capacity-warning progress::-webkit-progress-value { background: #f6c97d; }
.capacity-card.capacity-full { border-color: #e89c84; }
.capacity-card.capacity-full progress { accent-color: #e89c84; }
.capacity-card.capacity-full progress::-webkit-progress-value { background: #e89c84; }
@media (max-width: 730px) {
  .promo-grid { grid-template-columns: 1fr; }
  .promo-panel { padding: 18px; }
  .promo-panel input { font-size: 16px; }
}

/* Phone controls and content layout. Header layout is defined below with the mobile navigation. */
@media (max-width: 730px) {
  .main-area { min-width: 0; }

  .mobile-navigation {
    display: block; margin-bottom: 10px;
    font-size: 0; line-height: 0;
  }
  .mobile-navigation select {
    min-height: 46px; padding: 8px 13px;
    border: 1px solid #68c6b7; border-radius: 12px;
    background: #1a3c3d; box-shadow: 0 0 0 2px #75e5d315;
    font-size: 16px; line-height: normal;
  }
  .global-search {
    position: relative;
    margin: 0 0 19px; padding: 0;
    border: 0; border-radius: 0; background: transparent;
  }
  .global-search > label {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
  .global-search-control input {
    min-height: 46px; border-color: #45657a; border-radius: 12px;
    background: #102030;
  }
  select {
    -webkit-appearance: none; appearance: none;
    padding-right: 34px !important; font-size: 16px;
    background-image: linear-gradient(45deg, transparent 50%, #b5dcd5 50%),
      linear-gradient(135deg, #b5dcd5 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 2px),
      calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px; background-repeat: no-repeat;
  }
  .global-search-results {
    position: relative; z-index: 5;
    margin-top: 7px; padding: 8px;
    border: 1px solid #355468; border-radius: 12px;
    background: #102131;
  }
  .manual-intro { margin: 0 0 13px; font-size: 12px; line-height: 1.45; }
  .section-heading {
    flex-direction: row; justify-content: space-between;
    margin: 0 0 14px; align-items: flex-end;
  }
  .section-heading .eyebrow { margin-bottom: 4px; font-size: 10px; }
  .section-heading h2 { margin: 0; font-size: clamp(18px, 5vw, 21px); line-height: 1.18; }
  .section-heading > button {
    flex: 0 0 auto; width: auto; min-width: 0;
    min-height: 42px; padding: 8px 12px; font-size: 12px;
  }
  .dashboard-stats, .stats { gap: 9px; margin-bottom: 18px; }
  .stat-card {
    min-height: 106px; padding: 12px 13px;
    display: flex; flex-direction: column; align-items: flex-start;
    border-radius: 15px;
  }
  .stat-card > span:first-child {
    min-height: 0; font-size: 12px; line-height: 1.25;
  }
  .stat-card strong { margin: auto 0 3px; font-size: 28px; line-height: 1; }
  .stat-card small { font-size: 11px; line-height: 1.3; }
  .capacity-card progress { margin: 5px 0 3px; }
  .dashboard-mailing-link {
    min-height: 0; margin-bottom: 18px; padding: 14px 16px;
    border-radius: 15px;
  }
  .dashboard-mailing-link strong { font-size: 14px; }
  .dashboard-mailing-link small { font-size: 11px; line-height: 1.35; }
  .dashboard-grid { gap: 12px; }
  .dashboard-panel { padding: 16px; border-radius: 15px; }
  .dashboard-panel h3 { font-size: 17px; line-height: 1.25; }
  .dashboard-row { font-size: 13px; overflow-wrap: anywhere; }
  .mailing-oauth-panel { min-height: 0; align-content: start; row-gap: 15px; }
  .mailing-oauth-actions { align-content: start; }
  .workspace .panel, .dashboard-grid .panel { min-height: 0; }
}

@media (max-width: 359px) {
  .stat-card { padding-inline: 11px; }
}

.mobile-bottom-nav { display: none; }

/* Mobile workspace: compact header, direct access to common sections, and a full section sheet. */
@media (max-width: 730px) {
  .main-area { padding: 12px 12px calc(94px + env(safe-area-inset-bottom, 0px)); }
  .mobile-navigation { display: none; }
  .global-search { margin: 0 0 19px; }
  .global-search-control input { min-height: 48px; }
  .section-heading { margin-top: 2px; }
  .dashboard-stats, .stats { gap: 10px; }
  .stat-card { min-height: 112px; }
  .stat-card > span:first-child { font-size: 12px; }
  .stat-card small { font-size: 11px; }

  .mobile-bottom-nav {
    position: fixed; z-index: 25; inset: auto 0 0;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
    padding: 7px max(7px, env(safe-area-inset-right, 0px))
      calc(7px + env(safe-area-inset-bottom, 0px)) max(7px, env(safe-area-inset-left, 0px));
    border-top: 1px solid #426577; background: #0d1b29;
    box-shadow: 0 -12px 30px #03091185;
  }
  .mobile-bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    min-width: 0; min-height: 53px; padding: 3px 2px;
    border: 1px solid transparent; border-radius: 11px;
    background: transparent; color: #a7bfce;
    font-size: 10px; font-weight: 700; line-height: 1.2; white-space: nowrap;
  }
  .mobile-bottom-nav button svg {
    display: block; width: 22px; height: 22px; fill: none;
    stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  }
  .mobile-bottom-nav button.active {
    border-color: #5bbcaf; background: #1c4445; color: #e9fffa;
  }
  .mobile-bottom-nav button:active { transform: scale(.96); }
  .mobile-sections-dialog {
    position: fixed; inset: auto 12px calc(74px + env(safe-area-inset-bottom, 0px));
    width: min(440px, calc(100vw - 24px)); max-height: min(72dvh, 620px);
    margin: 0 auto; padding: 18px; overflow: auto;
    border: 1px solid #578b8d; border-radius: 18px;
    background: #132938; color: #edf8fb; box-shadow: 0 24px 70px #02080ed9;
  }
  .mobile-sections-dialog::backdrop { background: #030913a6; }
  .mobile-sections-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .mobile-sections-heading h2 { margin: 0; font-size: 18px; }
  .mobile-sections-heading button {
    width: 44px; height: 44px; border: 1px solid #537487; border-radius: 9px;
    background: #1c3748; color: #edf8fb; font-size: 25px; line-height: 1;
  }
  .mobile-sections-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .mobile-sections-grid button {
    min-width: 0; min-height: 54px; padding: 10px 12px;
    border: 1px solid #385d70; border-radius: 11px;
    background: #193448; color: #e4f1f7; font-size: 13px; font-weight: 700;
    text-align: left; line-height: 1.25;
  }
  .mobile-sections-grid button.active { border-color: #8ae8d7; background: #24554f; color: #fff; }
}

@media (max-width: 359px) {
  .action-dialog .email-address-control { grid-template-columns: minmax(0, 1fr) 125px; gap: 6px; }
  .action-dialog .email-address-control select { padding-inline: 6px; }
  .mobile-bottom-nav button { font-size: 9px; }
}

/* Mobile polish: keep the working area readable without hiding controls. */
.mobile-guide { display: none; }
.dialog-close { display: none; }
@media (max-width: 730px) {
  .main-area { padding-inline: 12px; }
  .global-search { margin-bottom: 14px; }
  .global-search-control input { min-height: 46px; }
  .global-search-results { max-height: 42dvh; overflow-y: auto; }
  .section-heading { margin-bottom: 12px; }
  .manual-intro { margin-bottom: 12px; font-size: 13px; line-height: 1.45; }
  .mobile-guide-source { display: none; }
  .mobile-guide {
    display: block; margin: -2px 0 13px; padding: 0;
    color: #b7d0dc; font-size: 13px;
  }
  .mobile-guide summary {
    display: list-item; width: fit-content; min-height: 34px;
    padding: 7px 0; color: #96e4d8; font-weight: 700;
    cursor: pointer;
  }
  .mobile-guide p { margin: 5px 0 0; line-height: 1.5; }
  .dashboard-stats, .stats { gap: 8px; margin-bottom: 16px; }
  .stat-card { min-height: 102px; padding: 12px; }
  .stat-card strong { font-size: 26px; }
  .dashboard-grid { gap: 10px; }
  .dashboard-panel { padding: 15px; }
  .ticket-filters { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .ticket-filters input { grid-column: 1 / -1; }
  .ticket-filters select { min-width: 0; }
  .ticket-filters button { width: auto; min-width: 92px; }
  .ticket-filters span { min-width: 0; }
  .subscriber-item, .manual-item, .ticket-item { padding: 13px 14px; }
  .manual-detail, .ticket-detail { padding: 16px; }
  .manual-detail h3, .ticket-detail h3 { overflow-wrap: anywhere; }
  .action-dialog {
    width: calc(100vw - 16px); max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
  .action-dialog form { padding: 18px; }
  .action-dialog #create-form { position: relative; padding-top: 18px; }
  .action-dialog #create-title { padding-right: 42px; }
  .dialog-close {
    display: grid; place-items: center; position: absolute;
    top: 12px; right: 12px; width: 44px; height: 44px;
    padding: 0; border: 1px solid #486b7c; border-radius: 10px;
    background: #1b3547; color: #e9f7fb; font-size: 27px;
    line-height: 1;
  }
  .toast {
    z-index: 35; right: 12px; left: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }
}

@media (max-width: 359px) {
  .section-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .section-heading > button[id^="refresh-"] {
    width: 44px; min-width: 44px; height: 44px;
    padding: 0; font-size: 0;
  }
  .section-heading > button[id^="refresh-"]::after {
    content: '↻'; font-size: 23px; line-height: 1;
  }
  .action-dialog form { padding: 16px; }
  .action-dialog .email-address-control {
    grid-template-columns: minmax(0, 1fr) 125px; gap: 6px;
  }
  .action-dialog .email-address-control select { padding-inline: 6px; font-size: 14px; }
}


/* One mobile header layout: the service control stays directly below sign-out. */
@media (max-width: 730px) {
  .topbar {
    display: grid; grid-template-columns: minmax(0, 1fr) 108px;
    grid-template-areas: 'brand logout' 'identity runtime';
    align-items: center; column-gap: 10px; row-gap: 12px;
    position: relative; margin: 0 0 16px; padding: 14px;
    border: 1px solid #416c77; border-radius: 18px;
    background: linear-gradient(145deg, #193b45, #122a3a 60%, #101e2d);
  }
  .topbar-mobile-brand {
    grid-area: brand; display: flex; align-items: center; gap: 8px;
    min-width: 0; color: #e6fcf7; line-height: 1.1;
  }
  .topbar-mobile-brand strong {
    min-width: 0; font-size: clamp(18px, 5.2vw, 23px); font-weight: 750;
    letter-spacing: -.035em; white-space: nowrap;
  }
  .topbar-mobile-brand .brand-mark {
    flex: 0 0 38px; width: 38px; height: 38px;
    border-radius: 11px; font-size: 18px; box-shadow: none;
  }
  .topbar-identity { grid-area: identity; display: block; min-width: 0; }
  .topbar-identity > .brand-mark, .topbar .eyebrow { display: none; }
  .topbar-identity > div:last-child { min-width: 0; }
  .topbar h1 {
    margin: 0; font-size: 17px; line-height: 1.25;
    letter-spacing: -.02em; white-space: normal; overflow-wrap: anywhere;
  }
  .auto-refresh-status {
    margin: 4px 0 0; padding: 0; color: #adc5d0;
    font-size: 11px; line-height: 1.35;
  }
  .top-actions { display: contents; }
  .topbar #logout {
    grid-area: logout; width: 100%; min-width: 0; min-height: 44px;
    padding: 8px 10px; border-radius: 10px; font-size: 12px;
  }
  .runtime-widget {
    grid-area: runtime; position: relative; align-self: end;
    width: 100%; min-width: 0;
  }
  .runtime-toggle {
    display: flex; justify-content: center; gap: 5px;
    width: 100%; min-height: 44px; padding: 8px 6px;
    border-radius: 10px;
  }
  .runtime-toggle::after { font-size: 14px; }
  .runtime-toggle strong { font-size: 11px; }
  .runtime-mobile-label { display: inline; color: #c5eee6; font-size: 10px; font-weight: 650; }
  .runtime-compact-cpu { display: none; }
  .runtime-indicator { flex: 0 0 7px; }
  .runtime-bar {
    right: 0; width: min(320px, calc(100vw - 54px));
    max-height: min(65dvh, 460px); overflow-y: auto; overscroll-behavior: contain;
  }
  .runtime-item strong { font-size: 15px; }
}
@media (max-width: 359px) {
  .topbar { grid-template-columns: minmax(0, 1fr) 84px; column-gap: 8px; padding: 12px; }
  .topbar-mobile-brand .brand-mark { flex-basis: 34px; width: 34px; height: 34px; font-size: 16px; }
  .topbar-mobile-brand strong { font-size: 18px; }
  .topbar h1 { font-size: 16px; }
  .runtime-mobile-label { display: none; }
  .runtime-toggle strong { font-size: 12px; }
  .section-heading > button[id^="refresh-"].is-refreshing::after { content: none; }
  .section-heading > button[id^="refresh-"].is-refreshing::before { margin-right: 0; }
}

/* Keep lengthy customer data readable and modal scrolling local to the dialog. */
.action-dialog, .mobile-sections-dialog, .mailing-recipients, .global-search-results {
  overscroll-behavior: contain;
}
.manual-item-copy, .subscriber-copy { overflow-wrap: anywhere; }
.is-refreshing::before {
  content: ''; display: inline-block; width: 12px; height: 12px;
  margin-right: 7px; vertical-align: -2px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: access-check-spin .8s linear infinite;
}
.manual-detail .manual-actions, .list-tools { min-width: 0; }
@media (max-width: 730px) {
  .manual-detail .manual-note input, .payment-settings select,
  .system-panel select, .telegram-detail .advanced-actions-content input { font-size: 16px; }
  .list-tools .primary-button, .manual-actions button,
  .manage-inline button, .manage-buttons button { white-space: normal; overflow-wrap: anywhere; }
  .mailing-recipient { min-height: 48px; }
  .mobile-guide summary { min-height: 44px; padding-block: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .is-refreshing::before { animation: none; }
  .panel-tabs button { transition: none; }
  .panel-tabs button:hover, .mobile-bottom-nav button:active { transform: none; }
  .detail-empty.checking .empty-icon, .check-spinner, .is-checking .mini-status::before,
  .access-task-actions button.is-checking::before, .manual-actions button.is-checking::before { animation: none; }
}
