/* Theme switcher UI */
.theme-switcher {
  position: relative;
  flex-shrink: 0;
}

.theme-switcher__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg, #fff);
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.theme-switcher__toggle:hover {
  border-color: var(--logo-blue, #004aad);
  color: var(--logo-blue, #004aad);
}

.theme-switcher--admin .theme-switcher__toggle {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
}

.theme-switcher--admin .theme-switcher__toggle:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.theme-switcher__menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 300;
  min-width: 9.5rem;
  padding: 0.35rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--bg, #fff);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}

.theme-switcher--admin .theme-switcher__menu {
  background: #fff;
  border-color: #e2e8f0;
}

[data-theme="dark"] .theme-switcher--admin .theme-switcher__menu {
  background: var(--surface);
  border-color: var(--border);
}

.theme-switcher__option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text, #0f172a);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.theme-switcher__option:hover {
  background: var(--bg-subtle, #f8fafc);
}

.theme-switcher__option.is-active {
  color: var(--logo-blue, #004aad);
}

.theme-switcher__option .theme-switcher__icon {
  flex-shrink: 0;
}

.theme-switcher__option span:not(.theme-switcher__option-check) {
  flex: 1;
}

.theme-switcher__option-check {
  margin-left: auto;
  color: var(--logo-blue, #004aad);
}

.theme-switcher__option-check[hidden] {
  display: none;
}

/* —— Dark theme: neutral charcoal (easy on the eyes) —— */
/* :root[data-theme] beats :root in styles.css (same element, higher specificity) */
:root[data-theme="dark"],
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --bg-subtle: #1a1a1a;
  --surface: #1e1e1e;
  --surface-raised: #262626;
  --text: #d4d4d4;
  --text-muted: #9a9a9a;
  --text-light: #737373;
  --muted: #9a9a9a;
  --border: #2e2e2e;
  --navy: #d4d4d4;
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.35);
  --hub-bg: #121212;
  --badge-blue: #1a3050;
  --badge-blue-text: #58a6ff;
  --link: #58a6ff;
  --link-hover: #79b8ff;
}

[data-theme="dark"] html {
  background: var(--bg);
}

[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .page,
[data-theme="dark"] main,
[data-theme="dark"] .article-page,
[data-theme="dark"] .page--static,
[data-theme="dark"] .page--newsletter {
  background: var(--bg);
  color: var(--text);
}

/* Site header & search */
[data-theme="dark"] .site-header {
  background: #161616;
  border-bottom-color: var(--border);
}

[data-theme="dark"] .header-search,
[data-theme="dark"] .header-search.is-focused,
[data-theme="dark"] .header-search:focus-within {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: none;
}

[data-theme="dark"] .header-search:focus-within {
  border-color: rgba(88, 166, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.12);
}

[data-theme="dark"] .header-search__input {
  color: var(--text);
}

[data-theme="dark"] .header-search__input::placeholder {
  color: var(--text-light);
}

[data-theme="dark"] .header-search__dropdown {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .header-search__item:hover {
  background: var(--surface-raised);
}

[data-theme="dark"] .header-search__item-title {
  color: var(--text);
}

[data-theme="dark"] .nav-link {
  color: var(--text-muted);
}

[data-theme="dark"] .nav-link.active,
[data-theme="dark"] .nav-link:hover {
  color: var(--link);
  border-bottom-color: var(--link);
}

/* Home & cards */
[data-theme="dark"] .home-more-card__title {
  color: var(--text);
}

[data-theme="dark"] .home-more-card:hover .home-more-card__title {
  color: var(--link);
}

[data-theme="dark"] .story-card {
  background: var(--bg-subtle);
}

[data-theme="dark"] .home-more-card__media {
  background: var(--surface);
}

[data-theme="dark"] .home-more-card__title,
[data-theme="dark"] .story-card__title,
[data-theme="dark"] .latest-stories-label,
[data-theme="dark"] .home-more-stories__title,
[data-theme="dark"] .home-more-card__date,
[data-theme="dark"] .latest-stories-empty {
  color: var(--text);
}

[data-theme="dark"] .home-more-card__meta,
[data-theme="dark"] .home-more-card__date {
  color: var(--text-muted);
}

[data-theme="dark"] .site-footer {
  background: #0e0e0e;
  border-top-color: var(--border);
}

[data-theme="dark"] .site-footer__copy,
[data-theme="dark"] .site-footer__link {
  color: var(--text-muted);
}

[data-theme="dark"] .site-footer__link:hover {
  color: var(--link);
}

/* Newsletter */
[data-theme="dark"] .page--newsletter {
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(88, 166, 255, 0.06) 0%, transparent 55%),
    linear-gradient(180deg, #161616 0%, var(--bg) 45%);
}

[data-theme="dark"] .newsletter-page-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .newsletter-page-card__mark {
  background: linear-gradient(145deg, #1a3050 0%, #243d5c 100%);
  color: var(--link);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .newsletter-page-card__badge {
  background: #1a3050;
  border-color: #2a4570;
  color: var(--link);
}

[data-theme="dark"] .newsletter-page-card__title,
[data-theme="dark"] .newsletter-page-card__lead {
  color: var(--text);
}

[data-theme="dark"] .newsletter-page-card__lead {
  color: var(--text-muted);
}

[data-theme="dark"] .newsletter-page-perk {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .newsletter-page-perk__value {
  color: var(--text-muted);
}

[data-theme="dark"] .newsletter-page-perk__value strong {
  color: var(--link);
}

[data-theme="dark"] .newsletter-page-form {
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.05) 0%, transparent 100%);
  border-color: var(--border);
}

[data-theme="dark"] .newsletter-page-form__heading {
  color: var(--text-muted);
}

[data-theme="dark"] .newsletter-page-topics li {
  background: #1a3050;
  border-color: #2a4570;
  color: var(--link);
}

[data-theme="dark"] .newsletter-hero {
  background: var(--bg-subtle);
}

[data-theme="dark"] .newsletter-hero__title,
[data-theme="dark"] .newsletter-hero__lead {
  color: var(--text);
}

[data-theme="dark"] .newsletter-hero__badge {
  background: var(--surface-raised);
  color: var(--text-muted);
}

[data-theme="dark"] .newsletter-band {
  background: linear-gradient(145deg, #161616 0%, #1a2744 50%, #1e3055 100%);
  border-top: 1px solid var(--border);
}

[data-theme="dark"] .newsletter-form__field {
  background: transparent;
}

[data-theme="dark"] .newsletter-form__input {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

[data-theme="dark"] .newsletter-form__input:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.18);
}

[data-theme="dark"] .newsletter-band .newsletter-form__input {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

[data-theme="dark"] .newsletter-band .newsletter-form__input:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.18);
}

[data-theme="dark"] .newsletter-band .newsletter-form__field-icon {
  color: var(--text-muted);
  opacity: 1;
}

[data-theme="dark"] .newsletter-band .newsletter-form__btn {
  background: var(--link);
  color: #fff;
  box-shadow: none;
}

[data-theme="dark"] .newsletter-band .newsletter-form__btn:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .newsletter-form__hint {
  color: var(--text-muted);
}

[data-theme="dark"] .newsletter-popup__dialog {
  background: var(--surface);
  color: var(--text);
}

[data-theme="dark"] .newsletter-popup__title {
  color: var(--text);
}

[data-theme="dark"] .newsletter-popup__text,
[data-theme="dark"] .newsletter-popup__backdrop {
  color: var(--text-muted);
}

[data-theme="dark"] .newsletter-popup__backdrop {
  background: rgba(0, 0, 0, 0.75);
}

/* Static & search pages */
[data-theme="dark"] .static-page__title,
[data-theme="dark"] .static-page__body {
  color: var(--text);
}

[data-theme="dark"] .static-page__body a {
  color: var(--link);
}

[data-theme="dark"] .search-page__title,
[data-theme="dark"] .search-page__lead {
  color: var(--text);
}

[data-theme="dark"] .search-page__input,
[data-theme="dark"] .search-result-card {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .search-result-card__title {
  color: var(--text);
}

[data-theme="dark"] .search-result-card__meta {
  color: var(--text-muted);
}

/* Article page */
[data-theme="dark"] .article-page,
[data-theme="dark"] .article-body {
  color: var(--text);
}

[data-theme="dark"] .article-body h1,
[data-theme="dark"] .article-body h2,
[data-theme="dark"] .article-body h3,
[data-theme="dark"] .article-title {
  color: var(--text);
}

[data-theme="dark"] .article-body a {
  color: var(--link);
}

[data-theme="dark"] .article-body blockquote {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-muted);
}

[data-theme="dark"] .article-body .embed.is-loading {
  background: linear-gradient(110deg, #1a1a1a 0%, #242424 45%, #1a1a1a 90%);
  background-size: 200% 100%;
}

[data-theme="dark"] .article-meta,
[data-theme="dark"] .more-stories-label {
  color: var(--text-muted);
}

[data-theme="dark"] .more-story-cat {
  color: var(--link);
}

[data-theme="dark"] .article-sidebar,
[data-theme="dark"] .more-story-card {
  color: var(--text);
}

[data-theme="dark"] .more-story-title {
  color: var(--text);
}

[data-theme="dark"] .more-story-card:hover .more-story-title {
  color: var(--link);
}

[data-theme="dark"] .article-carousel,
[data-theme="dark"] .article-carousel__track-wrap {
  background: transparent;
}

[data-theme="dark"] .article-carousel__title {
  color: var(--text);
}

/* Related articles carousel ("Στην ίδια κατηγορία") */
[data-theme="dark"] .article-more-carousel {
  border-top-color: var(--border);
}

[data-theme="dark"] .article-more-carousel__eyebrow,
[data-theme="dark"] .article-more-carousel__cat {
  color: var(--link);
}

[data-theme="dark"] .article-more-carousel__title,
[data-theme="dark"] .article-more-carousel__title a {
  color: var(--text);
}

[data-theme="dark"] .article-more-carousel__title a:hover {
  color: var(--link);
}

[data-theme="dark"] .article-more-carousel__link {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .article-more-carousel__link:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .article-more-carousel__link:hover .article-more-carousel__card-title {
  color: var(--link);
}

[data-theme="dark"] .article-more-carousel__card-title {
  color: var(--text);
}

[data-theme="dark"] .article-more-carousel__date {
  color: var(--text-muted);
}

[data-theme="dark"] .article-more-carousel__btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .article-more-carousel__btn:hover:not(:disabled) {
  border-color: var(--link);
  color: var(--link);
  background: var(--surface-raised);
}

[data-theme="dark"] .article-more-carousel__btn--edge {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .article-preview-banner {
  background: #2a2410;
  border-color: #4a3f18;
  color: #e8d48b;
}

/* Theme switcher in dark */
[data-theme="dark"] .theme-switcher__toggle {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-muted);
}

[data-theme="dark"] .theme-switcher__menu {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.42);
}

[data-theme="dark"] .theme-switcher__option {
  color: var(--text);
}

[data-theme="dark"] .theme-switcher__option:hover {
  background: var(--surface-raised);
}

[data-theme="dark"] .theme-switcher__option.is-active {
  color: var(--link);
}

/* Cookie banner */
[data-theme="dark"] .cookie-notice__panel {
  background: var(--surface);
  color: var(--text);
}

[data-theme="dark"] .cookie-notice__title {
  color: var(--text);
}

[data-theme="dark"] .cookie-notice__text {
  color: var(--text-muted);
}

[data-theme="dark"] .cookie-notice__prefs {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .cookie-notice__pref {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .cookie-notice__btn--ghost,
[data-theme="dark"] .cookie-notice__btn--secondary {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}

/* Admin panel */
[data-theme="dark"] body.admin-hub,
[data-theme="dark"] body.login-page {
  --bg: #121212;
  --bg-subtle: #1a1a1a;
  --surface: #1e1e1e;
  --surface-raised: #262626;
  --border: #2e2e2e;
  --text: #d4d4d4;
  --muted: #9a9a9a;
  --hub-bg: #121212;
  --hub-navy: #e8e8e8;
  --hub-nav: #0a0a0a;
  --link: #58a6ff;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.35);
  background: var(--hub-bg);
  color: var(--text);
}

[data-theme="dark"] .admin-hub-main {
  background: var(--hub-bg);
}

[data-theme="dark"] .login-page {
  background: linear-gradient(160deg, #0a0a0a 0%, #121212 45%, #161616 100%);
}

/* Dashboard */
[data-theme="dark"] .admin-hub-hero h1,
[data-theme="dark"] .admin-hub--content .admin-page-header h1,
[data-theme="dark"] .admin-page-header h1 {
  color: var(--text);
}

[data-theme="dark"] .admin-hub-hero p,
[data-theme="dark"] .admin-hub-sub {
  color: var(--muted);
}

[data-theme="dark"] .admin-stat-card,
[data-theme="dark"] .admin-action-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
  color: var(--text);
}

[data-theme="dark"] .admin-stat-label {
  color: var(--muted);
}

[data-theme="dark"] .admin-stat-value {
  color: var(--text);
}

[data-theme="dark"] .admin-stat-card--revenue .admin-stat-value {
  color: #34d399;
}

[data-theme="dark"] .admin-action-card h2 {
  color: var(--text);
}

[data-theme="dark"] .admin-action-card p {
  color: var(--muted);
}

[data-theme="dark"] .admin-action-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .login-card,
[data-theme="dark"] .card,
[data-theme="dark"] .admin-modal-dialog,
[data-theme="dark"] .ads-item,
[data-theme="dark"] .editor-panel,
[data-theme="dark"] .admin-hub-stat,
[data-theme="dark"] .admin-recent-item,
[data-theme="dark"] .schedule-panel,
[data-theme="dark"] .schedule-day,
[data-theme="dark"] .analytics-card,
[data-theme="dark"] .nl-settings-panel,
[data-theme="dark"] .nl-subscriber-row,
[data-theme="dark"] .ad-type-option,
[data-theme="dark"] .ad-settings-group,
[data-theme="dark"] .ad-settings-chip,
[data-theme="dark"] .file-upload-label,
[data-theme="dark"] .featured-preview-panel {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .admin-modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}

[data-theme="dark"] .admin-input,
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .login-form input,
[data-theme="dark"] .users-form input,
[data-theme="dark"] .articles-search input,
[data-theme="dark"] .articles-filters select,
[data-theme="dark"] .admin-app-dialog__input {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

[data-theme="dark"] .admin-input:hover,
[data-theme="dark"] .articles-search input:hover,
[data-theme="dark"] .articles-filters select:hover {
  border-color: #444;
}

[data-theme="dark"] .admin-input:focus,
[data-theme="dark"] .articles-search input:focus,
[data-theme="dark"] .articles-filters select:focus,
[data-theme="dark"] .login-form input:focus {
  background: var(--surface);
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.18);
}

[data-theme="dark"] .admin-input--slug {
  color: #a5b4fc;
  background: var(--bg-subtle);
}

[data-theme="dark"] .admin-input::placeholder,
[data-theme="dark"] .articles-search input::placeholder {
  color: var(--muted);
}

[data-theme="dark"] .admin-hub-stat__label,
[data-theme="dark"] .admin-hub-stat__hint,
[data-theme="dark"] .muted,
[data-theme="dark"] .field label,
[data-theme="dark"] .login-brand p,
[data-theme="dark"] .upload-hint,
[data-theme="dark"] .ads-item__meta p,
[data-theme="dark"] .articles-results-summary,
[data-theme="dark"] .analytics-bar-label strong {
  color: var(--muted);
}

[data-theme="dark"] .analytics-card h2,
[data-theme="dark"] .analytics-bar-label,
[data-theme="dark"] .login-brand h1 {
  color: var(--text);
}

[data-theme="dark"] .analytics-bar {
  background: #2a2a2a;
}

[data-theme="dark"] .analytics-list > li {
  border-bottom-color: var(--border);
}

[data-theme="dark"] .analytics-range .btn.is-active {
  background: var(--link);
  border-color: var(--link);
  color: #fff;
}

/* Tables */
[data-theme="dark"] th,
[data-theme="dark"] .admin-hub-table th,
[data-theme="dark"] .categories-table thead th {
  background: var(--bg-subtle);
  color: var(--muted);
  border-bottom-color: var(--border);
}

[data-theme="dark"] td,
[data-theme="dark"] .admin-hub-table td {
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] tr:hover td,
[data-theme="dark"] .admin-hub-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .categories-table tbody tr:nth-child(even) td {
  background: transparent;
}

[data-theme="dark"] .categories-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] body.admin-hub--content .card .table-wrap {
  border-color: var(--border);
}

[data-theme="dark"] .article-list-title-text {
  color: var(--text);
}

[data-theme="dark"] .article-list-thumb--empty {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--muted);
}

[data-theme="dark"] .badge {
  background: #1a3050;
  color: #79b8ff;
}

[data-theme="dark"] .badge-draft {
  background: var(--surface-raised);
  color: var(--muted);
}

[data-theme="dark"] .badge-ceo {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

[data-theme="dark"] .view-count {
  background: #1a3050;
  color: #79b8ff;
}

[data-theme="dark"] .categories-table .categories-builtin {
  background: var(--surface-raised);
  color: var(--muted);
}

[data-theme="dark"] .admin-recent-item:hover,
[data-theme="dark"] .schedule-day:hover,
[data-theme="dark"] .ad-type-option:hover,
[data-theme="dark"] .ad-settings-chip:hover {
  background: var(--surface-raised);
}

[data-theme="dark"] .btn-secondary {
  background: #2a2a2a;
  border-color: #444;
  color: var(--text);
}

[data-theme="dark"] .btn-secondary:hover {
  background: #363636;
  border-color: #555;
}

[data-theme="dark"] .table-actions .btn-secondary {
  background: #2a2a2a;
  border-color: #444;
}

[data-theme="dark"] .table-actions .btn-secondary:hover {
  background: #363636;
  border-color: var(--link);
  color: var(--text);
}

[data-theme="dark"] .btn-danger {
  background: #3f1d1d;
  color: #fca5a5;
  border-color: #6b2a2a;
}

[data-theme="dark"] .btn-danger:hover {
  background: #4a2222;
}

[data-theme="dark"] .admin-pagination-num:hover {
  background: var(--surface-raised);
  border-color: var(--border);
}

[data-theme="dark"] .admin-hub-link.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

[data-theme="dark"] .admin-hub-outline {
  border-color: rgba(255, 255, 255, 0.35);
}

/* Newsletter admin */
[data-theme="dark"] .nl-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  color: var(--text);
}

[data-theme="dark"] .nl-hero__title {
  color: var(--text);
}

[data-theme="dark"] .nl-hero__sub {
  color: var(--muted);
}

[data-theme="dark"] .nl-metric {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .nl-metric--primary {
  background: #1a3050;
  border-color: #2a4570;
}

[data-theme="dark"] .nl-metric dt {
  color: var(--muted);
}

[data-theme="dark"] .nl-metric dd {
  color: var(--text);
}

[data-theme="dark"] .nl-panel,
[data-theme="dark"] .nl-switch,
[data-theme="dark"] .nl-switch:hover,
[data-theme="dark"] .nl-list-head,
[data-theme="dark"] .nl-segment__btn.is-active,
[data-theme="dark"] .nl-table thead th,
[data-theme="dark"] .nl-menu__trigger,
[data-theme="dark"] .nl-menu__panel,
[data-theme="dark"] .nl-list-foot,
[data-theme="dark"] .nl-pager__btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .nl-switch {
  background: var(--bg-subtle);
}

[data-theme="dark"] .nl-switch:hover {
  background: var(--surface-raised);
}

[data-theme="dark"] .nl-list-head,
[data-theme="dark"] .nl-list-foot,
[data-theme="dark"] .nl-table thead th {
  background: var(--bg-subtle);
}

[data-theme="dark"] .nl-panel__title,
[data-theme="dark"] .nl-switch__text strong,
[data-theme="dark"] .nl-email-cell__addr,
[data-theme="dark"] .nl-date {
  color: var(--text);
}

[data-theme="dark"] .nl-panel__desc,
[data-theme="dark"] .nl-switch__text small,
[data-theme="dark"] .nl-list-meta,
[data-theme="dark"] .nl-date--muted,
[data-theme="dark"] .nl-pager__label {
  color: var(--muted);
}

[data-theme="dark"] .nl-segment {
  background: #2a2a2a;
}

[data-theme="dark"] .nl-search__input {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .nl-search__icon {
  color: var(--muted);
}

[data-theme="dark"] .nl-search__clear:hover {
  background: var(--surface-raised);
  color: var(--text);
}

[data-theme="dark"] .nl-segment__btn {
  color: var(--muted);
}

[data-theme="dark"] .nl-segment__btn.is-active {
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .nl-table tbody tr {
  border-bottom-color: var(--border);
}

[data-theme="dark"] .nl-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .nl-table tbody tr.nl-row--editing {
  background: rgba(88, 166, 255, 0.08);
}

[data-theme="dark"] .nl-table__state td {
  color: var(--muted);
}

[data-theme="dark"] .nl-table__state--error td {
  background: #3f1d1d;
  color: #fca5a5;
}

[data-theme="dark"] .nl-avatar {
  background: #1a3050;
  color: #79b8ff;
}

[data-theme="dark"] .nl-avatar--muted {
  background: var(--surface-raised);
  color: var(--muted);
}

[data-theme="dark"] .nl-menu__trigger:hover,
[data-theme="dark"] .nl-menu--view[open] .nl-menu__trigger {
  background: var(--surface-raised);
  color: var(--text);
}

[data-theme="dark"] .nl-menu--view[open] .nl-menu__trigger {
  background: #1a3050;
  border-color: var(--link);
  color: var(--link);
}

[data-theme="dark"] .nl-menu__item:hover {
  background: var(--surface-raised);
}

[data-theme="dark"] .nl-menu__item--danger:hover {
  background: #3f1d1d;
}

[data-theme="dark"] .nl-pager__btn:hover:not(:disabled) {
  background: var(--surface-raised);
  border-color: #555;
}

[data-theme="dark"] .nl-status--active {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

[data-theme="dark"] .nl-status--unsubscribed {
  background: var(--surface-raised);
  color: var(--muted);
}

/* Schedule admin */
[data-theme="dark"] .schedule-day {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .schedule-day__head {
  background: var(--bg-subtle);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .schedule-day__head strong {
  color: var(--text);
}

[data-theme="dark"] .schedule-day__head span,
[data-theme="dark"] .schedule-day__empty,
[data-theme="dark"] .schedule-event time,
[data-theme="dark"] .schedule-event__cat {
  color: var(--muted);
}

[data-theme="dark"] .schedule-event a {
  color: var(--text);
}

[data-theme="dark"] .schedule-event a:hover,
[data-theme="dark"] .schedule-day__more a {
  color: var(--link);
}

[data-theme="dark"] .schedule-event--scheduled {
  background: rgba(59, 130, 246, 0.12);
}

[data-theme="dark"] .schedule-event--published {
  background: rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .schedule-quick-btn {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--link);
}

[data-theme="dark"] .schedule-quick-btn:hover,
[data-theme="dark"] .schedule-quick-btn[aria-expanded="true"] {
  background: #1a3050;
  border-color: var(--link);
}

[data-theme="dark"] .schedule-quick-menu {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Ads admin */
[data-theme="dark"] .ads-toolbar,
[data-theme="dark"] .ads-item,
[data-theme="dark"] .ad-editor-modal__dialog,
[data-theme="dark"] .ad-editor-modal__footer,
[data-theme="dark"] .ad-type-option,
[data-theme="dark"] .ad-preview-frame {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .ad-editor-modal__title,
[data-theme="dark"] .ads-item__title {
  color: var(--text);
}

[data-theme="dark"] .ad-type-option.is-selected {
  border-color: var(--link);
  background: #1a3050;
}

/* Article editor (admin/editor.php) */
[data-theme="dark"] body.admin-hub--editor .admin-hub-main {
  background: var(--hub-bg);
}

[data-theme="dark"] .editor-shell {
  color: var(--text);
}

[data-theme="dark"] .editor-toolbar {
  border-bottom-color: var(--border);
}

[data-theme="dark"] .editor-toolbar h1,
[data-theme="dark"] .editor-panel__title,
[data-theme="dark"] .editor-title-field label,
[data-theme="dark"] .editor-url-field label,
[data-theme="dark"] .editor-field-select label,
[data-theme="dark"] .editor-viral-row__label {
  color: var(--text);
}

[data-theme="dark"] .editor-back {
  color: var(--muted);
}

[data-theme="dark"] .editor-back:hover {
  color: var(--link);
  background: rgba(88, 166, 255, 0.1);
}

[data-theme="dark"] .editor-panel {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .editor-panel__title {
  color: var(--muted);
}

[data-theme="dark"] .editor-panel .upload-hint,
[data-theme="dark"] .editor-schedule-field .upload-hint {
  color: var(--muted);
}

[data-theme="dark"] .editor-title-field input,
[data-theme="dark"] .editor-url-field .url-input-wrap,
[data-theme="dark"] .editor-url-field .url-input-wrap input,
[data-theme="dark"] .editor-schedule-field .editor-schedule-input,
[data-theme="dark"] .editor-panel .field textarea,
[data-theme="dark"] .editor-panel .input-readonly--compact {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

[data-theme="dark"] .editor-title-field input:focus,
[data-theme="dark"] .editor-url-field .url-input-wrap input:focus,
[data-theme="dark"] .editor-schedule-field .editor-schedule-input:focus,
[data-theme="dark"] .editor-panel .field textarea:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.18);
}

[data-theme="dark"] .editor-url-field .url-prefix {
  color: var(--muted);
}

[data-theme="dark"] .editor-viral-row {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .editor-select {
  border-color: var(--border);
  box-shadow: none;
}

[data-theme="dark"] .editor-select--status.is-published {
  color: #6ee7b7;
  border-color: #065f46;
  background-color: #14291a;
}

[data-theme="dark"] .editor-select--status.is-draft {
  color: #fcd34d;
  border-color: #92400e;
  background-color: #2a2410;
}

[data-theme="dark"] .editor-select--status.is-scheduled {
  color: #a5b4fc;
  border-color: #4338ca;
  background-color: #1e1b4b;
}

[data-theme="dark"] .editor-select--category {
  color: #79b8ff;
  border-color: #1e40af;
  background-color: #1a3050;
}

[data-theme="dark"] .editor-featured-preview {
  border-color: var(--border);
}

[data-theme="dark"] .editor-panel--featured .file-upload-label {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .editor-panel--featured .file-upload-label:hover {
  border-color: var(--link);
  background: var(--surface-raised);
}

[data-theme="dark"] .editor-panel--featured .file-upload-icon {
  background: #1a3050;
  color: var(--link);
}

[data-theme="dark"] .editor-panel--featured .file-upload-filename {
  color: var(--muted);
}

/* Quill rich-text editor */
[data-theme="dark"] #editor-container,
[data-theme="dark"] .editor-content-panel #editor-container {
  background: var(--bg-subtle);
  border-top-color: var(--border);
}

[data-theme="dark"] .editor-content-panel .ql-toolbar.ql-snow,
[data-theme="dark"] .ql-toolbar.ql-snow {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .editor-content-panel .ql-container.ql-snow,
[data-theme="dark"] .ql-container.ql-snow {
  background: var(--bg-subtle);
  border-color: var(--border) !important;
  color: var(--text);
}

[data-theme="dark"] .editor-content-panel .ql-editor,
[data-theme="dark"] .ql-editor {
  background: var(--bg-subtle);
  color: var(--text);
}

[data-theme="dark"] .ql-editor.ql-blank::before {
  color: var(--muted);
  font-style: normal;
}

[data-theme="dark"] .ql-snow .ql-stroke {
  stroke: var(--text-muted);
}

[data-theme="dark"] .ql-snow .ql-fill {
  fill: var(--text-muted);
}

[data-theme="dark"] .ql-snow .ql-picker {
  color: var(--text-muted);
}

[data-theme="dark"] .ql-snow .ql-picker-label:hover,
[data-theme="dark"] .ql-snow .ql-picker-label.ql-active,
[data-theme="dark"] .ql-snow .ql-picker-item:hover,
[data-theme="dark"] .ql-snow .ql-picker-item.ql-selected {
  color: var(--link);
}

[data-theme="dark"] .ql-snow .ql-picker-options {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .ql-snow.ql-toolbar button:hover,
[data-theme="dark"] .ql-snow .ql-toolbar button:hover,
[data-theme="dark"] .ql-snow.ql-toolbar button.ql-active,
[data-theme="dark"] .ql-snow .ql-toolbar button.ql-active {
  color: var(--link);
}

[data-theme="dark"] .ql-snow.ql-toolbar button:hover .ql-stroke,
[data-theme="dark"] .ql-snow .ql-toolbar button:hover .ql-stroke,
[data-theme="dark"] .ql-snow.ql-toolbar button.ql-active .ql-stroke,
[data-theme="dark"] .ql-snow .ql-toolbar button.ql-active .ql-stroke {
  stroke: var(--link);
}

[data-theme="dark"] .ql-snow.ql-toolbar button:hover .ql-fill,
[data-theme="dark"] .ql-snow .ql-toolbar button:hover .ql-fill,
[data-theme="dark"] .ql-snow.ql-toolbar button.ql-active .ql-fill,
[data-theme="dark"] .ql-snow .ql-toolbar button.ql-active .ql-fill {
  fill: var(--link);
}

[data-theme="dark"] .editor-content-panel .ql-toolbar button.ql-autoBold svg text {
  fill: var(--text-muted);
}

[data-theme="dark"] .editor-content-panel .ql-toolbar button.ql-autoBold:hover svg text,
[data-theme="dark"] .editor-content-panel .ql-toolbar button.ql-autoBold.ql-active svg text {
  fill: var(--link);
}

[data-theme="dark"] .ql-editor blockquote {
  border-left-color: var(--border);
  color: var(--text-muted);
}

[data-theme="dark"] .ql-editor pre.ql-syntax {
  background: #0a0a0a;
  color: #d4d4d4;
}

[data-theme="dark"] .ql-editor a {
  color: var(--link);
}

[data-theme="dark"] .quill-editor .ql-toolbar.ql-snow,
[data-theme="dark"] .quill-editor .ql-container.ql-snow {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

[data-theme="dark"] .quill-editor .ql-editor {
  color: var(--text);
}

[data-theme="dark"] .editor-meta-panel {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .editor-meta-panel h2,
[data-theme="dark"] .editor-toolbar__title {
  color: var(--text);
}

[data-theme="dark"] .editor-meta-row,
[data-theme="dark"] .editor-shell .card {
  background: transparent;
  border-color: var(--border);
}

[data-theme="dark"] .viral-toggle-box {
  background: #444;
}

[data-theme="dark"] .viral-toggle input:checked + .viral-toggle-box {
  background: var(--link);
}

[data-theme="dark"] .share-modal-preview {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .share-modal-preview__text strong {
  color: var(--text);
}

[data-theme="dark"] .share-modal-preview__text p {
  color: var(--muted);
}

[data-theme="dark"] .album-upload-label {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .album-upload-label:hover {
  border-color: var(--link);
}

[data-theme="dark"] .album-empty {
  color: var(--muted);
}

[data-theme="dark"] .album-carousel__stage {
  background: var(--bg-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .album-carousel__caption {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .ql-editor .photo-album--stored {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .ql-editor .photo-album--stored .photo-album__title {
  color: var(--text);
}

[data-theme="dark"] .ql-editor .photo-album--stored .photo-album__count {
  color: var(--muted);
}

[data-theme="dark"] .alert-error {
  background: #3f1d1d;
  border-color: #6b2a2a;
  color: #fecaca;
}

[data-theme="dark"] .alert-success {
  background: #14291a;
  border-color: #1f4d2e;
  color: #86efac;
}

[data-theme="dark"] .login-page .theme-switcher {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
}

@media (min-width: 901px) {
  .theme-switcher--site {
    margin-left: 0.45rem;
  }
}

@media (max-width: 767px) {
  .header-extras__inner {
    flex-wrap: wrap;
  }

  .theme-switcher {
    order: -1;
    margin-left: auto;
  }

  .theme-switcher__menu {
    right: 0;
  }
}
