/* Common theme controls. Dark remains the default for existing users. */
.theme-toggle { gap: 8px; padding: 6px 9px; font-size: 11px; }
.theme-toggle svg { flex-shrink: 0; }
.theme-moon, [data-theme="light"] .theme-sun { display: none; }
[data-theme="light"] .theme-moon { display: block; }
.login-theme-switch { position: absolute; top: 24px; right: 28px; }
.brand small { font-size: 10px; letter-spacing: 1px; }
.brand-mark { background: transparent; overflow: hidden; flex-shrink: 0; }
.brand-image { display: block; width: 100%; height: 100%; object-fit: contain; }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5ef;
  --panel: #ffffff;
  --panel-alt: #f2f5ef;
  --line: #dbe2d6;
  --text: #1c281d;
  --muted: #65725f;
  --accent: #365b22;
  --green: #267847;
  --red: #b63d4f;
}
[data-theme="light"] .button.primary { background: #c5f879; color: #182319; }
[data-theme="light"] .button.primary:hover { background: #b9ec6d; }
[data-theme="light"] .brand-light { color: #657660; }
[data-theme="light"] .avatar { background: #edf4e7; border-color: #c8d8bb; }
[data-theme="light"] .button.secondary { border-color: #ccd8c2; }
[data-theme="light"] .button.secondary:hover { border-color: #90a77c; }
[data-theme="light"] .count-badge { background: #edf3e7; color: #506945; }
[data-theme="light"] .status-badge { background: #fff5da; color: #7b5b16; }
[data-theme="light"] .status-badge.online { background: #e9f3df; color: #365b22; }
[data-theme="light"] .status-badge.offline { background: #fbeaed; color: #b63d4f; }
[data-theme="light"] th { background: #f7f9f5; }
[data-theme="light"] .sort-button span { color: #91a087; }
[data-theme="light"] .sort-button.active span { color: var(--accent); }
[data-theme="light"] .coin-avatar { background: #f1f5ec; border-color: #d6e0ce; color: #48633c; }
[data-theme="light"] .change-cell.positive span { background: #eaf4e5; }
[data-theme="light"] .change-cell.negative span { background: #fceef0; }
[data-theme="light"] .table-note { color: #69795e; }
[data-theme="light"] .empty-icon { background: #f0f6e9; border-color: #d4e3c6; }
[data-theme="light"] .notification-callout { background: linear-gradient(110deg, #edf5e5, #f9fcf5); }
[data-theme="light"] .page-footer { color: #75826e; }
[data-theme="light"] .section-number { border-color: #d1dfc5; }
[data-theme="light"] .bot-card { background: #f7faf3; }
[data-theme="light"] .telegram-symbol { background: #e5f2f6; color: #2f788b; }
[data-theme="light"] .toggle { background: #cbd4c5; }
[data-theme="light"] .toggle:before { background: #fff; }
[data-theme="light"] .toggle:checked { background: #93bf6b; }
[data-theme="light"] .toggle:checked:before { background: #355125; }
[data-theme="light"] label { color: #566a4c; }
[data-theme="light"] input:not([type="checkbox"]) { background: #fafcf8; border-color: #cbd7c2; }
[data-theme="light"] input::placeholder { color: #87927f; }
[data-theme="light"] input:focus { border-color: #7e9b68; }
[data-theme="light"] .inline-note { background: #fff8e4; border-color: #ebdfb7; color: #7b641e; }
[data-theme="light"] .event-state { background: #eef1ea; color: #65725d; }
[data-theme="light"] .event-state.sent { background: #e8f2e0; color: #426926; }
[data-theme="light"] .event-state.failed { background: #fcecef; color: #b63d4f; }
[data-theme="light"] .event-state.cancelled { background: #f0f2ed; color: #798373; }
[data-theme="light"] .event-state.pending { background: #fff5dc; color: #8b691c; }
[data-theme="light"] .flash.success { background: #edf6e5; border-color: #cddfbc; color: #3d6428; }
[data-theme="light"] .flash.error { background: #fff0f1; border-color: #edced3; color: #9e3d4a; }
[data-theme="light"] dialog { border-color: #c8d7bb; box-shadow: 0 30px 100px #24351e33; }
[data-theme="light"] dialog::backdrop { background: #1c2a1d55; }
[data-theme="light"] .search-result { background: #f1f7eb; border-color: #d4e1c8; }
[data-theme="light"] .search-result:hover { border-color: var(--accent); }
[data-theme="light"] .login-art span { background: #edf5e4; border-color: #d5e1c8; }
[data-theme="light"] .login-art span:nth-child(2) { background: #fff0f2; border-color: #ead0d6; }

@media (max-width: 1100px) {
  .account .theme-label { display: none; }
}
@media (max-width: 500px) {
  .account { gap: 6px; }
  .account form { margin-left: 0; }
  .theme-toggle { padding: 6px; }
  .brand small { font-size: 9px; }
  .login-theme-switch { top: 16px; right: 18px; }
}
