:root {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --light-page: #f7f3f7;
  --light-surface: #ffffff;
  --light-surface-soft: #fbf7fa;
  --light-surface-muted: #f3edf2;
  --light-border: #d9ced8;
  --light-border-soft: #e7dfe6;
  --light-text: #281e29;
  --light-muted: #6d626f;
  --light-accent: #c91f6b;
  --light-accent-strong: #94164f;
  --light-accent-soft: #fff0f6;
  --light-positive: #28663a;
  --light-positive-soft: #edf8f0;
  --light-shadow: 0 14px 38px #32182a0d;
}

/* Public account forms use light surfaces in both theme states. Keep native
   controls and typed values aligned with that surface instead of inheriting
   the application's default dark color scheme. */
.auth-shell {
  color-scheme: light;
}

.auth-shell .form-card :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
  border-color: #cfc3c8;
  color: #21171e;
  background: #fff;
  caret-color: #c91f6b;
  -webkit-text-fill-color: #21171e;
  opacity: 1;
}

.auth-shell .form-card :is(input, textarea)::placeholder {
  color: #756a72;
  -webkit-text-fill-color: #756a72;
  opacity: 1;
}

.auth-shell .form-card :is(input, textarea):-webkit-autofill,
.auth-shell .form-card :is(input, textarea):-webkit-autofill:hover,
.auth-shell .form-card :is(input, textarea):-webkit-autofill:focus {
  border-color: #cfc3c8;
  -webkit-text-fill-color: #21171e;
  caret-color: #c91f6b;
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 9999s ease-out 0s;
}

.auth-shell .form-card :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select):focus {
  border-color: #c91f6b;
  outline: 3px solid #c91f6b24;
  outline-offset: 1px;
  box-shadow: 0 0 0 1px #c91f6b;
}

.auth-shell .form-card select:disabled {
  color: #756a72;
  background: #f4eff1;
  opacity: 1;
}

.auth-shell .form-card select option {
  color: #21171e;
  background: #fff;
}

.auth-shell .form-card input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  accent-color: #c91f6b;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  padding: 0;
  display: grid;
  place-content: center;
  border: 1.5px solid #7d7078;
  border-radius: 5px;
  color: #fff;
  background: #fff;
  box-shadow: inset 0 0 0 1px #fff;
  cursor: pointer;
}

.auth-shell .form-card input[type="checkbox"]::before {
  content: "";
  width: 5px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg) scale(0);
  transition: transform .14s ease;
}

.auth-shell .form-card input[type="checkbox"]:checked {
  border-color: #c91f6b;
  background: #c91f6b;
  box-shadow: none;
}

.auth-shell .form-card input[type="checkbox"]:checked::before {
  transform: translateY(-1px) rotate(45deg) scale(1);
}

.auth-shell .form-card input[type="checkbox"]:focus-visible {
  outline: 3px solid #c91f6b35;
  outline-offset: 3px;
}

.theme-quick-toggle {
  color: #d7ff32;
  cursor: pointer;
}

.theme-quick-toggle span {
  display: block;
  font-size: 18px;
  line-height: 1;
  transition: transform .25s ease;
}

.theme-quick-toggle:hover span { transform: rotate(22deg) scale(1.06); }

.appearance-choice {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid #ffffff10;
  border-radius: 14px;
  background: #0d0b11;
}

.appearance-choice > div:nth-child(2) { display: grid; gap: 5px; }
.appearance-choice small { color: #ff5aa1; font-size: 7px; font-weight: 900; letter-spacing: .14em; }
.appearance-choice strong { color: #fff; font-size: 17px; }
.appearance-choice p { margin: 0; color: #817984; font-size: 9px; line-height: 1.5; }
.appearance-choice > button { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 16px; color: #08070d; background: #d7ff32; cursor: pointer; }
.appearance-choice > button span { font-size: 17px; }
.appearance-choice > button b { font-size: 9px; }

.theme-preview {
  height: 68px;
  display: grid;
  grid-template-columns: 25px 1fr;
  grid-template-rows: 16px 1fr;
  gap: 5px;
  padding: 7px;
  border: 1px solid #ffffff12;
  border-radius: 10px;
  background: #17131b;
  box-shadow: inset 0 0 20px #0004;
}
.theme-preview i:first-child { grid-row: 1 / 3; border-radius: 5px; background: #27202b; }
.theme-preview i:nth-child(2) { border-radius: 4px; background: #211b25; }
.theme-preview i:nth-child(3), .theme-preview span { border-radius: 5px; background: #211b25; }
.theme-preview span { box-shadow: inset 3px 0 #ff2b86; }

html[data-theme="light"] .dark-app,
html[data-theme="light"] .night-shell,
html[data-theme="light"] .night-main {
  color: #201820;
  background: radial-gradient(circle at 88% 0, #f5d9eb 0, transparent 30%), #f5f1f5;
}

html[data-theme="light"] .night-sidebar,
html[data-theme="light"] .night-top,
html[data-theme="light"] .mobile-dock,
html[data-theme="light"] .friend-drawer {
  border-color: #ded4df;
  background: #fffdfef2;
  box-shadow: 0 12px 36px #3b183114;
}

html[data-theme="light"] .night-top { backdrop-filter: blur(18px); }
html[data-theme="light"] .night-sidebar nav a,
html[data-theme="light"] .pro-nav .nav-item,
html[data-theme="light"] .mobile-dock a,
html[data-theme="light"] .mobile-dock button { color: #6e6470; }
html[data-theme="light"] .night-sidebar nav a:hover,
html[data-theme="light"] .night-sidebar nav a.active,
html[data-theme="light"] .pro-nav .nav-item:hover,
html[data-theme="light"] .pro-nav .nav-item.active { color: #201820; background: #f5edf3; }

html[data-theme="light"] .community-state,
html[data-theme="light"] .side-user,
html[data-theme="light"] .night-top,
html[data-theme="light"] .friend-drawer header,
html[data-theme="light"] .friend-drawer footer { border-color: #e5dce5; }

html[data-theme="light"] .quick-search,
html[data-theme="light"] .round-action,
html[data-theme="light"] .friend-drawer-search,
html[data-theme="light"] .message-search {
  border-color: #ddd2dd;
  color: #5f5561;
  background: #f7f3f7;
}

html[data-theme="light"] :is(.quick-search, .friend-drawer-search, .message-search) input,
html[data-theme="light"] .dark-app input,
html[data-theme="light"] .dark-app textarea,
html[data-theme="light"] .dark-app select {
  color: #241b25;
}

html[data-theme="light"] .theme-quick-toggle { color: #7a4b16; background: #fff4c8; }

html[data-theme="light"] .dark-app :is(h1, h2, h3, h4),
html[data-theme="light"] .dark-app :is(.panel-heading h2, .topic-main h3 a, .thread-original > aside > a:nth-child(2)) {
  color: #201820;
}

html[data-theme="light"] .dark-app :is(p, small, time),
html[data-theme="light"] .dark-app :is(.region-meta, .topic-stats, .conversation-meta, .friend-drawer-copy small) {
  color: #6f6571;
}

html[data-theme="light"] :is(
  .night-top > div:first-child small, .module-hero > span, .module-heading > span,
  .premium-hero > small, .ad-profile-kicker, .ad-profile-card > header > span,
  .ad-stream-heading > span, .forum-hero > span, .regional-heading > div > span,
  .forum-compose-shell > header > span, .thread-replies > header > span,
  .thread-reply-box > header > span, .topic-author > a, .region-number, .region-arrow
) { color: #b5165e; }

html[data-theme="light"] :is(
  .premium-card a, .forum-hero-stat strong, .regional-heading > a:not(.forum-create-button),
  .topic-labels b, .topic-stats i, .thread-breadcrumb a, .ad-profile-card > header > b
) { color: var(--light-accent-strong); }

html[data-theme="light"] :is(
  .dark-composer, .dark-post, .rail-box, .stories article, .media-gallery article,
  .module-hero, .people-cards article, .feature-grid article, .listing-grid article,
  .price-grid article, .plans article, .ledger, .premium-hero, .notification-list article,
  .moderator-alert, .mod-stats article, .report-table, .wallet-hero,
  .ad-profile-card, .ad-profile-stream .dark-post, .ad-profile-nav,
  .settings-section-nav, .dark-settings, .account-tools, .appearance-choice,
  .forum-tabs, .forum-hero, .forum-safety-strip, .regional-forum, .forum-topics,
  .region-link, .topic-row, .forum-compose-shell > header, .forum-compose-form,
  .thread-original, .thread-replies > article, .thread-reply-box,
  .messages-pro, .messages-pro > aside, .chat-pane,
  .friend-drawer-row, .album-admin-list > article, .photo-album-assignments article
) {
  border-color: #dfd4df;
  color: #201820;
  background-color: #fff;
  box-shadow: 0 14px 38px #32182a0a;
}

html[data-theme="light"] :is(.dark-composer, .dark-post, .rail-box, .ad-profile-card, .topic-row, .region-link, .thread-replies > article) {
  background-image: linear-gradient(145deg, #fff, #fcf9fc);
}

html[data-theme="light"] .ad-profile-hero {
  border-color: #dfd4df;
  color: #201820;
  background: radial-gradient(circle at 76% 15%, #ffb6d46b, transparent 29%), radial-gradient(circle at 20% 70%, #d8c5ff69, transparent 32%), #fff;
}
html[data-theme="light"] .ad-profile .profile-avatar { border-color: #fff; }
html[data-theme="light"] .ad-profile-chips span { border-color: #ded3de; color: #5c525e; background: #fffafccc; }
html[data-theme="light"] .ad-profile-stats,
html[data-theme="light"] .ad-profile-stats span,
html[data-theme="light"] .ad-profile-nav a,
html[data-theme="light"] .ad-profile-info p { border-color: #e2d8e2; }
html[data-theme="light"] .ad-profile-nav a.active { color: #201820; background: #f7eff5; }

html[data-theme="light"] .settings-section-nav a { color: #6d636f; }
html[data-theme="light"] .settings-section-nav a:hover,
html[data-theme="light"] .settings-section-nav a[href="#settings-about"] { color: #201820; background: #f7eff5; }
html[data-theme="light"] .dark-settings section,
html[data-theme="light"] .dark-settings footer,
html[data-theme="light"] .session-list article,
html[data-theme="light"] .blocked-list article { border-color: #e1d7e1; background: #fff; }
html[data-theme="light"] .album-admin-list > article,
html[data-theme="light"] .album-current-access,
html[data-theme="light"] .album-security-state {
  border-color: #e1d7e1;
  color: #625864;
  background: #faf6f9;
}
html[data-theme="light"] .album-current-access b { color: #241b25; }
html[data-theme="light"] .album-current-access.access-password,
html[data-theme="light"] .album-security-state.is-locked {
  border-color: #d892b2;
  color: var(--light-accent-strong);
  background: var(--light-accent-soft);
}
html[data-theme="light"] .dark-settings :is(input, textarea, select),
html[data-theme="light"] .forum-compose-form :is(input, textarea, select),
html[data-theme="light"] .thread-reply-box textarea {
  border-color: #dcd1dc;
  color: #241b25;
  background: #f8f4f8;
}
html[data-theme="light"] .theme-preview { border-color: #d9ced9; background: #f7f2f7; box-shadow: inset 0 0 20px #6c4d640f; }
html[data-theme="light"] .theme-preview i:first-child { background: #e9dfe8; }
html[data-theme="light"] .theme-preview i:nth-child(2),
html[data-theme="light"] .theme-preview i:nth-child(3),
html[data-theme="light"] .theme-preview span { background: #fff; }

html[data-theme="light"] .messages-pro { background: #f4eff4; box-shadow: 0 25px 60px #32182a17; }
html[data-theme="light"] .messages-pro > aside { background: #fff; }
html[data-theme="light"] .messages-pro > .chat-pane {
  background: radial-gradient(circle at 50% 0, #f7dfea 0, transparent 30%), #fbf9fb;
}
html[data-theme="light"] .conversation-sidebar,
html[data-theme="light"] .friends-panel,
html[data-theme="light"] .chat-header,
html[data-theme="light"] .chat-composer { border-color: #ded4de; }
html[data-theme="light"] .messages-pro .chat-header {
  color: #241b25;
  background: #fffafcf2;
  box-shadow: 0 8px 24px #4520340b;
}
html[data-theme="light"] .messages-pro .chat-composer {
  border-color: #ded4de;
  background: #fff;
  box-shadow: 0 -10px 28px #4520340c;
}
html[data-theme="light"] .conversation-row,
html[data-theme="light"] .contact-row { color: #241b25; }
html[data-theme="light"] .messages-pro .conversation-row.has-unread .conversation-copy b { color: #241b25; }
html[data-theme="light"] .messages-pro .conversation-row.has-unread .conversation-copy small { color: #514853; }
html[data-theme="light"] .messages-pro .conversation-meta :is(time, em),
html[data-theme="light"] .messages-pro :is(.conversation-copy small, .contact-row small) { color: #6f6571; }
html[data-theme="light"] .conversation-row:hover,
html[data-theme="light"] .contact-row:hover,
html[data-theme="light"] .conversation-row.active { border-color: #e0cbd8; background: #f8eff5; }
html[data-theme="light"] .messages-pro .avatar,
html[data-theme="light"] .messages-pro .typing-avatar {
  border: 3px solid #fff;
  background: #fff;
  box-shadow: 0 0 0 1px #e1c5d5, 0 8px 20px #54203b20;
}
html[data-theme="light"] .messages-pro .presence-dot { border-color: #fff; }
html[data-theme="light"] .messages-pro :is(.contacts-trigger, .chat-options, .mobile-chat-action, .mobile-panel-close) {
  border-color: #dfd4df;
  color: #655b67;
}
html[data-theme="light"] .messages-pro .contacts-trigger { background: #fff; }
html[data-theme="light"] .messages-pro .chat-day::before,
html[data-theme="light"] .messages-pro .chat-day::after { background: #e4d9e2; }
html[data-theme="light"] .messages-pro .typing-bubble {
  border: 1px solid #e6dce5;
  background: #fff;
  box-shadow: 0 5px 18px #32182a10;
}
html[data-theme="light"] .messages-pro :is(.chat-start b, .no-chat h2) { color: #241b25; }
html[data-theme="light"] .messages-pro .chat-composer input { border-color: #d8cdd8; color: #241b25; background: #fff; }
html[data-theme="light"] .messages-pro .chat-composer.is-limit-locked input { color: #796d78; background: #f3edf1; }
html[data-theme="light"] .messages-pro .chat-limit-notice {
  border-color: #df3e49;
  color: #721c24;
  background: #fff0f1;
  box-shadow: 0 8px 24px #6b15231c;
}
html[data-theme="light"] .messages-pro .chat-limit-icon { color: #fff; background: #d92d3a; }
html[data-theme="light"] .messages-pro .chat-limit-copy small { color: #8f3540; }
html[data-theme="light"] .messages-pro .chat-limit-notice a { color: #fff; background: #c91f32; }
html[data-theme="light"] .messages-pro .chat-upload-status.is-error {
  border-color: #df3e49;
  color: #721c24;
  background: #fff0f1;
  box-shadow: 0 8px 24px #6b15231c;
}
html[data-theme="light"] .message-with-report > p:not(.mine),
html[data-theme="light"] .chat p:not(.mine) { color: #241b25; background: #fff; box-shadow: 0 5px 20px #32182a12; }
html[data-theme="light"] .attachment-trigger { color: #c32772; background: #f9eaf2; }
html[data-theme="light"] .attachment-menu { border-color: #d8ccd8; background: #fff; box-shadow: 0 18px 55px #3b21342b; }
html[data-theme="light"] .attachment-menu label { border-color: #e1d6e1; color: #241b25; background: #f8f3f7; }
html[data-theme="light"] .messages-pro .panel-heading h2,
html[data-theme="light"] .messages-pro .attachment-library h2 { color: #241b25; }
html[data-theme="light"] .messages-pro :is(.message-search, .inbox-tabs a, .load-older) {
  border-color: #e0d5df;
  color: #655b67;
  background: #f8f3f7;
}
html[data-theme="light"] .messages-pro .message-search input { color: #241b25; }
html[data-theme="light"] .messages-pro .inbox-tabs a b { color: #655b67; background: #eae1e8; }
html[data-theme="light"] .messages-pro .inbox-tabs a.active { border-color: #e6a8c5; color: #a6195b; background: #fff0f6; }
html[data-theme="light"] .messages-pro .inbox-tabs a.active b { color: #fff; background: #d62778; }
html[data-theme="light"] .messages-pro :is(.chat-menu > div, .attachment-library-grid article, .attachment-selection) {
  border-color: #ddd2dc;
  color: #514853;
  background: #fff;
  box-shadow: 0 14px 38px #32182a17;
}
html[data-theme="light"] .messages-pro .chat-menu button { color: #514853; background: #f7f1f5; }
html[data-theme="light"] .messages-pro .chat-menu button:hover { color: #241b25; background: #eee4eb; }
html[data-theme="light"] .messages-pro .message-bubble.is-deleted { color: #756b76 !important; background: #f2ebf0 !important; border-color: #d7ccd5 !important; }
html[data-theme="light"] .messages-pro :is(.trashed-note, .attachment-library > header) { border-color: #ded4de; background: #fffafc; }
html[data-theme="light"] .messages-pro .attachment-empty h2 { color: #241b25; }

html[data-theme="light"] .forum-hero { background: radial-gradient(circle at 84% 24%, #ffb7d46b, transparent 27%), radial-gradient(circle at 70% 100%, #cbb7f36b, transparent 31%), #fff; }
html[data-theme="light"] .forum-hero-stat { border-color: #ddcfdb; background: #fff9fcce; }
html[data-theme="light"] .forum-search {
  border-color: #dfd4df;
  background: linear-gradient(145deg, #fff, #fbf5f9);
  box-shadow: 0 10px 28px #32182a0b;
}
html[data-theme="light"] .forum-search input[type="search"] {
  border-color: #dcd1dc;
  color: #241b25;
  background: #fff;
}
html[data-theme="light"] .forum-search > a {
  border-color: #dcd1dc;
  color: #5f5561;
  background: #fff;
}
html[data-theme="light"] .region-link:hover,
html[data-theme="light"] .region-link.active,
html[data-theme="light"] .topic-row:hover { border-color: #ed9bc0; color: #201820; background: linear-gradient(135deg, #fff1f7, #fff); }
html[data-theme="light"] .topic-labels span { color: #5f5661; background: #f0e9ef; }
html[data-theme="light"] .topic-avatar {
  border: 3px solid #fff;
  background: #fff;
  box-shadow: 0 0 0 1px #e1c5d5, 0 7px 18px #54203b1c;
}
html[data-theme="light"] .topic-stats {
  border-color: #e4dae3;
  color: #675d69;
}
html[data-theme="light"] .topic-stats span { color: #675d69; }
html[data-theme="light"] .topic-stats b { color: #241b25; }
html[data-theme="light"] .thread-original > aside { border-color: #ded3de; background: #f7f2f7; }
html[data-theme="light"] .thread-original main > p,
html[data-theme="light"] .thread-replies main > p { color: #4f4651; }
html[data-theme="light"] .profile-album.locked {
  border-color: #e2c9d7;
  background: radial-gradient(circle at 90% 10%, #ffb6d44d, transparent 34%), #fff;
}
html[data-theme="light"] .album-password-gate > b { color: #241b25; }
html[data-theme="light"] .album-password-gate input {
  border-color: #dcd1dc;
  color: #241b25;
  background: #fff;
}
html[data-theme="light"] .album-owner-security {
  border-color: #e1d7e1;
  background: #faf6f9;
}
html[data-theme="light"] .album-owner-security summary { color: #241b25; }
html[data-theme="light"] .album-owner-security[open] summary { border-color: #e1d7e1; }
html[data-theme="light"] .album-owner-security :is(select, input) {
  border-color: #dcd1dc;
  color: #241b25;
  background: #fff;
}

html[data-theme="light"] .friend-drawer-row:hover { background: #f8f0f5; }
html[data-theme="light"] .friend-drawer-status { border-color: #e2d8e2; background: #f8f4f7; }

html[data-theme="light"] .post-owner-menu summary,
html[data-theme="light"] .post-menu-popover,
html[data-theme="light"] .post-editor > section {
  border-color: #ddd2dd;
  color: #241b25;
  background: #fff;
}
html[data-theme="light"] .post-menu-popover button { color: #241b25; background: #fff; }
html[data-theme="light"] .post-menu-popover button:hover { background: #f8eff5; }

html[data-theme="light"] .premium-card {
  border-color: #e9abc9;
  background: radial-gradient(circle at 100% 0, #ffb4d050, transparent 45%), #fff7fb;
}
html[data-theme="light"] .premium-card strong { color: #241b25; }

.message.error { border: 1px solid #ff5965; color: #ffe8ea; background: #65141d; }
html[data-theme="light"] .messages { color: #241b25; }
html[data-theme="light"] .message { border: 1px solid #ded4de; color: #241b25; background: #fff; }
html[data-theme="light"] .message.error { border-color: #df3e49; color: #721c24; background: #fff0f1; }

/* Moderation dashboard: keep analytics and case workspaces fully legible in light mode. */
html[data-theme="light"] .dark-app :is(.analytics-panel, .admin-insights, .forum-approval-panel, .moderation-case-panel, .moderation-evidence-panel) {
  border-color: #ded3dd;
  color: #241b25;
  background: linear-gradient(145deg, #fff, #fcf9fc);
  box-shadow: 0 18px 45px #45203412;
}
html[data-theme="light"] .dark-app :is(.analytics-panel, .admin-insights, .forum-approval-panel) > header {
  border-color: #e4dae3;
}
html[data-theme="light"] .dark-app :is(.analytics-panel, .admin-insights, .moderation-section-head) h2 { color: #241b25; }
html[data-theme="light"] .dark-app :is(.analytics-panel, .admin-insights, .moderation-section-head) p { color: #6f6571; }
html[data-theme="light"] .dark-app .analytics-panel > header nav {
  border-color: #ded3dd;
  background: #f5eef3;
}
html[data-theme="light"] .dark-app .analytics-panel > header nav a { color: #655b67; }
html[data-theme="light"] .dark-app .analytics-panel > header nav a.active { color: #fff; background: #c91f6b; }
html[data-theme="light"] .dark-app .analytics-summary article {
  border-color: #e1d7e0;
  background: #fff;
  box-shadow: 0 7px 20px #4520340b;
}
html[data-theme="light"] .dark-app .analytics-summary small { color: #756b77; }
html[data-theme="light"] .dark-app .analytics-summary strong { color: #241b25; }
html[data-theme="light"] .dark-app .analytics-summary span { color: #756b77; }
html[data-theme="light"] .dark-app .analytics-card {
  border-color: #e1d7e0;
  background: linear-gradient(145deg, #fff, #f8f3f7);
  box-shadow: 0 7px 20px #4520340a;
}
html[data-theme="light"] .dark-app .analytics-card::after { border-color: #d9277624; }
html[data-theme="light"] .dark-app .analytics-card > header small { color: #6f6571; }
html[data-theme="light"] .dark-app .analytics-card > header b { color: #8b7080; }
html[data-theme="light"] .dark-app .analytics-card > strong { color: #241b25; }
html[data-theme="light"] .dark-app .analytics-card > p,
html[data-theme="light"] .dark-app .analytics-card > footer small { color: #756b77; }
html[data-theme="light"] .dark-app .analytics-card > footer span { color: #655b67; }
html[data-theme="light"] .dark-app .analytics-card > footer span.up { color: #28753b; }
html[data-theme="light"] .dark-app .analytics-card > footer span.down { color: #c61f4b; }
html[data-theme="light"] .dark-app .analytics-card.admin-metric {
  border-color: #cad7aa;
  background: linear-gradient(145deg, #fff, #f7faed);
}
html[data-theme="light"] .dark-app .analytics-privacy { color: #655b67; background: #f5eef3; }
html[data-theme="light"] .dark-app .admin-insights > header > b,
html[data-theme="light"] .dark-app .moderation-section-head > b { color: #fff; background: #c91f6b; }
html[data-theme="light"] .dark-app .admin-insights > header small { color: #587200; }
html[data-theme="light"] .dark-app .admin-vip-summary article,
html[data-theme="light"] .dark-app .account-status-grid article {
  border-color: #dce4c7;
  color: #241b25;
  background: #fafcf4;
}
html[data-theme="light"] .dark-app .account-status-grid small { color: #6d725f; }
html[data-theme="light"] .dark-app .vip-sources > span { color: #59604c; background: #eef3e2; }
html[data-theme="light"] .dark-app .vip-sources b { color: #587200; }
html[data-theme="light"] .dark-app .daily-analytics-table { border-color: #dbe3c7; background: #fff; }
html[data-theme="light"] .dark-app .daily-analytics-table caption { color: #587200; }
html[data-theme="light"] .dark-app .daily-analytics-table th,
html[data-theme="light"] .dark-app .daily-analytics-table td { border-color: #e4e9d7; }
html[data-theme="light"] .dark-app .daily-analytics-table thead th { color: #656b59; background: #f5f8ed; }
html[data-theme="light"] .dark-app .daily-analytics-table tbody th { color: #5e6554; }
html[data-theme="light"] .dark-app .daily-analytics-table tbody td { color: #241b25; }
html[data-theme="light"] .dark-app .forum-approval-list > article {
  border-color: #e1d7e0;
  color: #241b25;
  background: #fff;
}
html[data-theme="light"] .dark-app .forum-approval-copy > p { color: #655b67; }
html[data-theme="light"] .dark-app .forum-approval-copy footer > a { color: #a6195b; }
html[data-theme="light"] .dark-app .forum-approval-list textarea {
  border-color: #d9ced8;
  color: #241b25;
  background: #fff;
}
html[data-theme="light"] .dark-app .moderator-alert > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid #d892b2;
  border-radius: 18px;
  color: #9e1957;
  background: #fff2f7;
  font-weight: 900;
  line-height: 1;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
html[data-theme="light"] .dark-app .moderator-alert > a:hover {
  border-color: #c91f6b;
  color: #fff;
  background: #c91f6b;
}
html[data-theme="light"] .dark-app .moderator-alert > a:focus-visible {
  outline: 3px solid rgba(201, 31, 107, .24);
  outline-offset: 3px;
}
html[data-theme="light"] .dark-app .report-table {
  border-color: #ded3dd;
  color: #241b25;
  background: #fff;
  box-shadow: none;
}
html[data-theme="light"] .dark-app .report-table > header { color: #655b67; background: #f5eef3; }
html[data-theme="light"] .dark-app .report-table > div { border-color: #e5dce4; }
html[data-theme="light"] .dark-app .report-table > .moderation-case-row:nth-child(odd) { background: #fdfafd; }
html[data-theme="light"] .dark-app .report-table > .moderation-case-row > span > small,
html[data-theme="light"] .dark-app .report-table .report-target-reputation > small,
html[data-theme="light"] .dark-app .evidence-table small { color: #706572; }
html[data-theme="light"] .dark-app .report-table .risk.low { border-color: #71b985; color: #246736; background: #edf8f0; }
html[data-theme="light"] .dark-app .report-table .risk.medium { border-color: #d89b32; color: #79520b; background: #fff7e5; }
html[data-theme="light"] .dark-app .report-table .risk.high { border-color: #dc4c59; color: #8d202b; background: #fff0f1; }
html[data-theme="light"] .dark-app .report-actions :is(input:not([type=checkbox]), select, textarea) {
  border-color: #d8ccd7;
  color: #241b25;
  background: #fff;
}
html[data-theme="light"] .dark-app .report-actions button.secure { border-color: #bd8aa3; color: #8f1c52; background: #fff0f6; }
html[data-theme="light"] .dark-app .report-actions button.remove,
html[data-theme="light"] .dark-app .report-actions button.dismiss { border-color: #dc727b; color: #8d202b; background: #fff0f1; }
html[data-theme="light"] .dark-app .report-actions button.resolve { color: #fff; background: #c91f6b; }
html[data-theme="light"] .dark-app .report-remove-form { border-color: #e5dce4; }
html[data-theme="light"] .dark-app .report-hide-toggle { color: #5f5561; }
html[data-theme="light"] .dark-app .evidence-open { border-color: #d892b2; color: #9e1957; background: #fff5f9; }

html[data-theme="light"] .media-viewer,
html[data-theme="light"] .media-viewer * {
  color-scheme: dark;
}

@media (max-width: 720px) {
  .theme-quick-toggle { width: 36px; height: 36px; }
  .appearance-choice { grid-template-columns: 82px 1fr; }
  .appearance-choice > button { grid-column: 1 / -1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-quick-toggle span { transition: none; }
}

/* Public theme control */
.public-theme-toggle {
  display: none;
}

body.landing-immersive .public-theme-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #ffffff2b;
  border-radius: 50%;
  color: #f7eff5;
  background: #ffffff0a;
  cursor: pointer;
  font-size: 18px;
}

body.landing-immersive .public-theme-toggle:hover {
  border-color: #ff2b86;
  color: #ff76b1;
  background: #ff2b8614;
  transform: translateY(-2px);
}

/* Complete light application shell */
html[data-theme="light"] .night-sidebar.pro-sidebar {
  border-color: #ded4df !important;
  background: linear-gradient(180deg, #fff 0%, #faf5f9 100%) !important;
  box-shadow: 14px 0 45px #3b18310d !important;
}

html[data-theme="light"] .pro-sidebar::before {
  background: radial-gradient(circle at 20% 0, #ff2b8612, transparent 24%);
}

/* A single raster variant avoids Safari scaling the logo and its recolouring mask differently. */
html[data-theme="light"] :is(.topbar .brand, .pro-sidebar > .brand) {
  background-image: url("../images/afterdark-logo-light.png") !important;
}

html[data-theme="light"] .intro-mark,
html[data-theme="light"] .hero-card::before {
  background-image: url("../images/afterdark-logo-light.png");
}

html[data-theme="light"] .footer-brand img {
  content: url("../images/afterdark-logo-light.png");
}

html[data-theme="light"] .community-state {
  border-color: #e5d9e3;
  color: #675d69;
  background: #fff;
}

html[data-theme="light"] .pro-nav section > small { color: #8c818d; }
html[data-theme="light"] .pro-nav .nav-item { color: #665c68 !important; }
html[data-theme="light"] .pro-nav .nav-item > i { color: #786d79 !important; }
html[data-theme="light"] .pro-nav .nav-item:hover {
  color: #241b25 !important;
  background: #f6edf3 !important;
  box-shadow: none;
}
html[data-theme="light"] .pro-nav .nav-item:hover > i {
  color: #241b25 !important;
  background: #fff !important;
}
html[data-theme="light"] .pro-nav .nav-item.active {
  border-color: #ff2b8630 !important;
  color: #241b25 !important;
  background: linear-gradient(90deg, #ff2b8615, #fff) !important;
}

html[data-theme="light"] .pro-premium {
  border-color: #eaa7c7 !important;
  background: radial-gradient(circle at 100% 0, #ffb4d055, transparent 45%), #fff8fb !important;
}
html[data-theme="light"] .pro-premium strong,
html[data-theme="light"] .pro-user .user-copy,
html[data-theme="light"] .pro-user .user-copy > b { color: #241b25; }
html[data-theme="light"] .pro-premium > a { color: var(--light-accent-strong) !important; }
html[data-theme="light"] .pro-sidebar > .pro-user { background: transparent !important; }
html[data-theme="light"] .settings-link,
html[data-theme="light"] .sidebar-logout button {
  border-color: #ddd2dd;
  color: #766b77;
  background: #fff;
}

html[data-theme="light"] .notification-bell,
html[data-theme="light"] .notification-bell.has-notifications {
  border-color: #ddd2dd !important;
  background: #fff !important;
  box-shadow: 0 7px 22px #3b18310d !important;
}
html[data-theme="light"] .notification-bell svg { stroke: #6d626e !important; }
html[data-theme="light"] .notification-bell > b { border-color: #fff !important; }

html[data-theme="light"] .dark-composer footer { border-color: #e4dae3; }
html[data-theme="light"] .dark-composer select,
html[data-theme="light"] .composer-upload,
html[data-theme="light"] .post-comments > form input {
  border-color: #ded3de;
  color: #312733;
  background: #fff;
}
html[data-theme="light"] .composer-upload:hover {
  border-color: #e783b1;
  color: #241b25;
  background: #fff5f9;
  box-shadow: 0 8px 24px #3b183112;
}
html[data-theme="light"] .dark-composer select { color-scheme: light; }
html[data-theme="light"] .feed-tabs { color: #746a76; }
html[data-theme="light"] .feed-tabs b { color: #241b25; }

html[data-theme="light"] .dark-post > footer.post-reactions button {
  border-color: #ded3de;
  color: #5f5561;
  background: #fff;
}
html[data-theme="light"] .dark-post > footer.post-reactions button > span {
  color: #5f5561;
  background: #f0e7ee;
}
html[data-theme="light"] .dark-post > footer.post-reactions button:hover {
  border-color: #e783b1;
  color: #241b25;
  background: #fff5f9;
}
html[data-theme="light"] .dark-post > footer.post-reactions .like-button.reacted {
  border-color: #ff2b8670;
  color: #8c174e;
  background: #ffeaf3;
}

html[data-theme="light"] .story-add {
  border-color: #dfd4df;
  color: #241b25;
  background: radial-gradient(circle at 50% 28%, #ff2b8620, transparent 31%), #fff;
  box-shadow: 0 12px 30px #3b18310b;
}
html[data-theme="light"] .story-add-avatar > .avatar { border-color: #fff !important; }
html[data-theme="light"] .story-add-avatar > i { border-color: #fff; }
html[data-theme="light"] .story-add > small { color: #6f6571; }
html[data-theme="light"] .story-empty {
  border-color: #dfd4df;
  color: #675d69;
  background: #fff;
}
html[data-theme="light"] .empty-feed {
  border-color: #dfd4df;
  color: #241b25;
  background: radial-gradient(circle at 50% 0, #ffb8d43d, transparent 46%), #fff;
  box-shadow: 0 14px 38px #32182a0a;
}
html[data-theme="light"] .empty-feed p { color: #675d69; }

html[data-theme="light"] .people-cards .person-cover {
  border-bottom: 1px solid #e4ceda;
  background: radial-gradient(circle at 72% 24%, #ff8fbc80, transparent 30%), linear-gradient(145deg, #ffe3ef, #fff9fc);
}
html[data-theme="light"] .people-cards .person-cover.c2 {
  background: radial-gradient(circle at 72% 24%, #aa88ef78, transparent 30%), linear-gradient(145deg, #eee6ff, #fff9fc);
}
html[data-theme="light"] .people-cards .person-cover.c3 {
  background: radial-gradient(circle at 72% 24%, #7ab8ef70, transparent 30%), linear-gradient(145deg, #e6f3ff, #fff9fc);
}
html[data-theme="light"] .people-cards .avatar.large {
  border-color: #fff !important;
  background: #fff;
  box-shadow: 0 0 0 1px #e1c5d5, 0 12px 28px #54203b24;
}

/* Discover has its own compact cards and filter panel. */
html[data-theme="light"] .people-filters {
  border-color: #dfd4df;
  color: #241b25;
  background: linear-gradient(180deg, #fff 0%, #fbf7fa 100%);
  box-shadow: 0 16px 38px #32182a0d;
}
html[data-theme="light"] .people-filters header,
html[data-theme="light"] .people-filters fieldset { border-color: #e7dde5; }
html[data-theme="light"] .people-filters h2 { color: #241b25; }
html[data-theme="light"] .people-filters :is(input:not([type="checkbox"]), select) {
  border-color: #dcd1dc;
  color: #241b25;
  background: #fff;
}
html[data-theme="light"] .people-filters .filter-check { color: #625864; }
html[data-theme="light"] .result-tabs a {
  border-color: #ded3de;
  color: #6f6571;
  background: #fff;
}
html[data-theme="light"] .result-tabs a.active { color: #fff; background: var(--light-accent); }
html[data-theme="light"] .people-search-grid > article {
  border-color: #dfd4df;
  color: #241b25;
  background: linear-gradient(145deg, #fff, #fcf9fc);
  box-shadow: 0 14px 38px #32182a0a;
}
html[data-theme="light"] .people-search-grid > article:hover {
  border-color: #ed9bc0;
  box-shadow: 0 18px 45px #54203b18;
}
html[data-theme="light"] .search-person-cover {
  border-right: 1px solid #e4ceda;
  background: radial-gradient(circle at 65% 28%, #ff8fbc70, transparent 31%), linear-gradient(145deg, #ffe3ef, #fff9fc);
}
html[data-theme="light"] .search-person-cover.c2,
html[data-theme="light"] .search-person-cover.c5 {
  background: radial-gradient(circle at 65% 28%, #aa88ef70, transparent 31%), linear-gradient(145deg, #eee6ff, #fff9fc);
}
html[data-theme="light"] .search-person-cover.c3,
html[data-theme="light"] .search-person-cover.c6 {
  background: radial-gradient(circle at 65% 28%, #7ab8ef70, transparent 31%), linear-gradient(145deg, #e6f3ff, #fff9fc);
}
html[data-theme="light"] .search-person-cover i { color: var(--light-accent-strong); background: #ffffffed; }
html[data-theme="light"] .search-person-info header > a { color: #241b25; }
html[data-theme="light"] .search-person-info header small { color: #4d6700; }
html[data-theme="light"] .search-person-info > p { color: #655b67; }
html[data-theme="light"] .profile-meta span { color: #655b67; background: #f2ebf1; }
html[data-theme="light"] .search-person-info footer > a { color: #241b25; background: #f0e8ee; }

/* The artwork is intentionally dark; invert only bundled placeholders in light mode. */
html[data-theme="light"] img.default-profile-avatar,
html[data-theme="light"] img[src*="/default-avatars/"] {
  filter: invert(1) hue-rotate(180deg) saturate(.9) contrast(.96);
}

/* The landing page uses the same saved preference as the application. */
html[data-theme="light"] body.landing-immersive {
  color: #211821;
  background: #fff9fc;
}
html[data-theme="light"] body.landing-immersive .topbar {
  border-color: #e4d5df;
  color: #211821;
  background: linear-gradient(180deg, #fffdfef2, #fffdfed4 72%, transparent);
  backdrop-filter: blur(14px);
}
html[data-theme="light"] body.landing-immersive .topbar nav > a:first-of-type { color: #554a56; }
html[data-theme="light"] body.landing-immersive .nav-cta {
  border-color: #dfbfd0;
  color: #211821;
  background: #fff;
}
html[data-theme="light"] body.landing-immersive .public-theme-toggle {
  border-color: #e2cfd9;
  color: #765019;
  background: #fff3ca;
  box-shadow: 0 9px 28px #5b342012;
}
html[data-theme="light"] .landing-intro {
  color: #211821;
  background: #fff9fc;
}
html[data-theme="light"] .intro-line { background: #3c27351c; }
html[data-theme="light"] .landing-intro p { color: #786c79; }
html[data-theme="light"] .landing-experience { background: #fff9fc; }
html[data-theme="light"] .hero-3d {
  background:
    radial-gradient(circle at 79% 47%, #e4c6f080, transparent 31%),
    radial-gradient(circle at 52% 100%, #ffb9d653, transparent 34%),
    linear-gradient(123deg, #fff 0%, #fff7fb 52%, #f7edf8 100%);
}
html[data-theme="light"] .hero-3d::after { background: linear-gradient(transparent, #fff9fc); }
html[data-theme="light"] .hero-grid { opacity: .12; }
html[data-theme="light"] .hero-copy .eyebrow span { border-color: #34202e24; color: #766b77; }
html[data-theme="light"] .hero-lead { color: #625764; }
html[data-theme="light"] .hero-copy .text-link { color: #312633; }
html[data-theme="light"] .hero-trust { color: #6c616d; }
html[data-theme="light"] .scroll-cue { color: #776c78; }

html[data-theme="light"] .social-card {
  border-color: #dfced9;
  color: #251b26;
  background: linear-gradient(145deg, #fff, #fbf4f8);
  box-shadow: 0 45px 90px #51203b24, -18px 15px 60px #ff2b8612, inset 0 1px #fff;
}
html[data-theme="light"] .landing-immersive .social-card .profile-row small,
html[data-theme="light"] .landing-immersive .social-card .post-meta { color: #6d626e; }
html[data-theme="light"] .landing-immersive .social-card .post-meta b { color: #251b26; }
html[data-theme="light"] .landing-immersive .social-card .post-meta i { border-color: #37233420; }
html[data-theme="light"] .float-card {
  border-color: #ddccd7;
  color: #251b26;
  background: #ffffffd9;
  box-shadow: 0 20px 50px #4a1f3720;
}
html[data-theme="light"] .float-card small,
html[data-theme="light"] .float-label { color: #6e636f; }

html[data-theme="light"] .experience-section {
  color: #251b26;
  background: linear-gradient(180deg, #fff9fc, #f8eef6 70%, #f4e9f3);
}
html[data-theme="light"] .adult-manifesto {
  border-color: #e2d0dc;
  background: radial-gradient(circle at 78% 40%, #ffb6d46e, transparent 29%), linear-gradient(125deg, #fff 0%, #fff4f8 56%, #f7edf6 100%);
  box-shadow: 0 42px 100px #45203418, inset 0 1px #fff;
}
html[data-theme="light"] .adult-manifesto::before {
  opacity: .5;
  background-image: linear-gradient(#5f395215 1px, transparent 1px), linear-gradient(90deg, #5f395215 1px, transparent 1px);
}
html[data-theme="light"] .manifesto-copy p,
html[data-theme="light"] .section-heading p,
html[data-theme="light"] .experience-card p { color: #665b67; }
html[data-theme="light"] .manifesto-copy > div b {
  border-color: #dccbd6;
  color: #4f4551;
  background: #ffffffa8;
}
html[data-theme="light"] .manifesto-copy > div b:first-child { border-color: #a9c530; color: #4d6700; }
html[data-theme="light"] .manifesto-art::after {
  background: linear-gradient(90deg, #fff7fb 0%, transparent 36%), linear-gradient(0deg, #fff7fbb5, transparent 30%);
}
html[data-theme="light"] .experience-card {
  border-color: #dfd0da;
  background: #ffffffad;
  box-shadow: 0 22px 55px #4720370c;
}
html[data-theme="light"] .experience-card::before { color: #4a1f3509; }
html[data-theme="light"] .experience-card:hover { border-color: #ff2b8670; background: #fff4f8; }
html[data-theme="light"] .experience-card.featured {
  border-color: #ff2b8645;
  background: linear-gradient(145deg, #ffeaf3, #fff);
}
html[data-theme="light"] .people-icon i,
html[data-theme="light"] .share-icon i:first-child { border-color: #604b5b73; }
html[data-theme="light"] .final-cta {
  border-color: #dfd0da;
  color: #251b26;
  background: #f4e9f3;
}
html[data-theme="light"] .landing-footer {
  border-color: #dfd0da;
  color: #695e6a;
  background: radial-gradient(circle at 0 100%, #ffb7d43d, transparent 28%), #fff;
}
html[data-theme="light"] .footer-brand p,
html[data-theme="light"] .footer-status > span,
html[data-theme="light"] .footer-status small { color: #695e6a; }
html[data-theme="light"] .landing-footer nav a { color: #4d424e; }
html[data-theme="light"] .landing-footer nav a:hover { color: #b5165e; }

/* Light mode finishing layer: keep application controls and cards visibly separate. */
html[data-theme="light"] .night-content {
  background: linear-gradient(180deg, #fbf8fb 0, var(--light-page) 210px);
}

html[data-theme="light"] .dark-app :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select) {
  border-color: var(--light-border);
  color: var(--light-text);
  background-color: var(--light-surface);
  box-shadow: inset 0 1px 2px #3f24360a;
}

html[data-theme="light"] .dark-app :is(input, textarea)::placeholder {
  color: #958a96;
  opacity: 1;
}

html[data-theme="light"] .dark-app :is(input, textarea, select):focus {
  border-color: #d94a8b;
  box-shadow: 0 0 0 3px #ff2b8614, inset 0 1px 2px #3f243608;
}

html[data-theme="light"] .dark-app :is(input, textarea, select):disabled {
  border-color: #e5dde4;
  color: #958b96;
  background: #f2edf1;
  opacity: .72;
}

html[data-theme="light"] :is(
  .dark-settings section, .security-editor > section, .session-list article,
  .blocked-list article, .album-admin-list > article, .photo-album-assignments article
) {
  border-color: var(--light-border);
  background: var(--light-surface);
  box-shadow: var(--light-shadow);
}

html[data-theme="light"] .settings-section-nav {
  border-color: var(--light-border);
  background: var(--light-surface);
  box-shadow: 0 18px 46px #32182a14;
}

html[data-theme="light"] .settings-section-nav > div { border-color: var(--light-border-soft); }
html[data-theme="light"] .settings-section-nav strong,
html[data-theme="light"] .upload-control,
html[data-theme="light"] .photo-album-assignments h4,
html[data-theme="light"] .account-tools strong { color: var(--light-text); }

html[data-theme="light"] .settings-page-content .dark-settings {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

html[data-theme="light"] .settings-page-content .dark-settings > footer {
  border-top: 0;
  background: transparent;
}

html[data-theme="light"] .settings-page-content input[type="file"] {
  border-color: var(--light-border) !important;
  color: var(--light-muted);
  background: var(--light-surface-soft);
}

html[data-theme="light"] .settings-page-content input[type="file"]::file-selector-button {
  border-color: #e7a5c3;
  color: #8d174f;
  background: #fff0f6;
}

html[data-theme="light"] .avatar-preview {
  border-color: #fff;
  box-shadow: 0 0 0 1px var(--light-border), 0 10px 26px #54203b1c;
}

html[data-theme="light"] .settings-page-content .dark-settings .seeking-options label {
  border-color: var(--light-border);
  color: #5f5561;
  background: var(--light-surface-soft) !important;
}

html[data-theme="light"] .settings-page-content .dark-settings .seeking-options label:hover {
  border-color: #e498bb;
  color: var(--light-text);
  background: #fff3f8 !important;
}

html[data-theme="light"] .settings-page-content .dark-settings .seeking-options label:has(input:checked) {
  border-color: #de78a8;
  color: #8d174f;
  background: #ffeaf3 !important;
  box-shadow: inset 3px 0 #ff2b86;
}

html[data-theme="light"] .planned-feature {
  border-color: #e4b1c8;
  background: linear-gradient(110deg, #fff2f7, #fff8fb);
}

html[data-theme="light"] .planned-feature small,
html[data-theme="light"] .planned-feature > span { color: var(--light-accent-strong); }
html[data-theme="light"] .planned-feature strong { color: var(--light-text); }
html[data-theme="light"] .planned-feature > span { background: #f8dce9; }

html[data-theme="light"] .account-tools button.secondary {
  border: 1px solid var(--light-border);
  color: #554a56;
  background: var(--light-surface-muted);
}

html[data-theme="light"] .account-danger {
  border-color: #e7a3bd !important;
  background: #fffafb;
}

html[data-theme="light"] .appearance-choice {
  border-color: var(--light-border);
  background: linear-gradient(135deg, #fff, #faf4f8);
  box-shadow: inset 0 1px #fff, var(--light-shadow);
}

/* Feed comments and replies must not retain dark bubbles in light mode. */
html[data-theme="light"] .post-comments {
  border-color: var(--light-border-soft);
}

html[data-theme="light"] .post-comments .comment-card > p,
html[data-theme="light"] .post-comments .comment-reply .comment-card > p {
  border-color: var(--light-border);
  color: #4f4551 !important;
  background: linear-gradient(135deg, #fff, var(--light-surface-soft)) !important;
  box-shadow: 0 7px 20px #32182a0b;
}

html[data-theme="light"] body.dark-app .dark-post .post-comments .comment-card > p {
  border-color: var(--light-border) !important;
  color: #4f4551 !important;
  background: #fff !important;
  box-shadow: 0 7px 20px #32182a0b !important;
}

html[data-theme="light"] .comment-card > p b { color: var(--light-text); }
html[data-theme="light"] .comment-card > p small,
html[data-theme="light"] .reply-total { color: #786e79; }
html[data-theme="light"] .comment-replies { border-color: #e5a5c2; }
html[data-theme="light"] .comment-actions button,
html[data-theme="light"] .comment-actions > button { color: #706672; }
html[data-theme="light"] .comment-actions button:hover,
html[data-theme="light"] .comment-actions > button:hover {
  color: var(--light-text);
  background: #f3e9f0;
}

html[data-theme="light"] .js-reply-form input,
html[data-theme="light"] .post-comments > form input,
html[data-theme="light"] .reel-comments .reel-comment-form input {
  border-color: var(--light-border);
  color: var(--light-text);
  background: #fff;
}

html[data-theme="light"] .post-gradient { color-scheme: dark; }
html[data-theme="light"] .post-gradient small { color: #ff9fc6 !important; }
html[data-theme="light"] .post-gradient strong { color: #fff !important; text-shadow: 0 2px 14px #120817a6; }

/* Creation and editing dialogs follow the selected theme; media viewers stay dark. */
html[data-theme="light"] :is(.story-create > section, .post-editor > section, .reel-upload-modal) {
  border-color: var(--light-border);
  color: var(--light-text);
  background: var(--light-surface);
  box-shadow: 0 35px 100px #3e1d3329;
}

html[data-theme="light"] :is(.story-create, .post-editor, .reel-upload-modal) header > button {
  border-color: var(--light-border);
  color: #6b606c;
  background: var(--light-surface-soft);
}

html[data-theme="light"] :is(.story-preview, .post-editor-current, .reel-file-picker) {
  border-color: #e7a5c3;
  color: var(--light-text);
  background: radial-gradient(circle at 50% 25%, #ffbad63d, transparent 42%), #fbf5f9;
}

html[data-theme="light"] :is(.story-file-options label, .post-editor-files label) {
  border-color: var(--light-border);
  color: var(--light-text);
  background: var(--light-surface-soft);
}

html[data-theme="light"] :is(.story-field textarea, .story-field select, .post-editor-field textarea, .post-editor-field select, .reel-caption textarea, .reel-visibility select) {
  border-color: var(--light-border);
  color: var(--light-text);
  background: #fff;
}

html[data-theme="light"] :is(.story-create, .post-editor, .reel-upload-modal) form > footer button:not(:last-child) {
  border-color: var(--light-border);
  color: #635965;
  background: var(--light-surface-muted);
}

html[data-theme="light"] .reel-comments.post-comments {
  border-color: var(--light-border);
  color: var(--light-text);
  background: #fffdfef7;
  box-shadow: -18px 0 50px #32182a21;
}

html[data-theme="light"] .reel-comments > header,
html[data-theme="light"] .reel-comments .reel-comment-form {
  border-color: var(--light-border-soft);
  background: #fff;
}

html[data-theme="light"] .reel-comments > header button {
  border-color: var(--light-border);
  color: #625864;
  background: var(--light-surface-soft);
}

/* In light mode the video stays cinematic, while the surrounding reels UI stays light. */
html[data-theme="light"] .reels-experience {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  box-sizing: border-box;
  padding-top: 62px;
  color: var(--light-text);
  background:
    radial-gradient(circle at 50% 16%, #ffd7e85e 0, transparent 34%),
    linear-gradient(180deg, #fffafd, #f4eef3);
}

html[data-theme="light"] .reels-topbar {
  color: var(--light-text);
  background: linear-gradient(180deg, #fff 0, #fffdfef2 72%, transparent);
}

html[data-theme="light"] .reels-topbar > div { text-shadow: none; }
html[data-theme="light"] .reels-topbar small { color: var(--light-muted); }
html[data-theme="light"] .reels-create {
  border-color: var(--light-border);
  color: var(--light-text);
  background: #fffdfef2;
  box-shadow: 0 8px 24px #32182a12;
}

html[data-theme="light"] .reels-catalog-controls {
  position: relative;
  z-index: 19;
  top: auto;
  left: auto;
  width: min(calc(100% - 40px), 1120px);
  margin: 10px auto 12px;
  transform: none;
}

html[data-theme="light"] .reels-catalog-controls .catalog-controls {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 11px 13px;
  border-color: var(--light-border);
  background: #fffdfef5;
  box-shadow: 0 14px 34px #32182a17;
  backdrop-filter: blur(16px);
}

html[data-theme="light"] .reels-catalog-controls .catalog-filter-form {
  padding-top: 0;
  border-top: 0;
}

html[data-theme="light"] .reels-feed {
  min-height: 0;
  height: auto;
}

html[data-theme="light"] .reel-slide {
  box-sizing: border-box;
  min-height: 0;
  padding: 0 24px 24px;
  background: radial-gradient(circle at 50% 42%, #fff 0, #f7f0f5 58%, transparent 76%);
}

html[data-theme="light"] .reel-player {
  max-height: 100%;
  border: 1px solid #d7cbd5;
  border-radius: 22px;
  box-shadow: 0 22px 58px #3920312e;
}

html[data-theme="light"] .reputation-badge {
  border-color: #d8cdd7;
  color: #5d535f;
  background: #f8f3f7;
}

html[data-theme="light"] .reputation-badge b { color: var(--light-text); }
html[data-theme="light"] .reputation-high { border-color: #a9c33b; color: #486000; background: #f3f9d9; }
html[data-theme="light"] .reputation-good { border-color: #79c6a9; color: #196d51; background: #ecfaf5; }
html[data-theme="light"] .reputation-low { border-color: #e8a3ba; color: #a72d59; background: #fff1f5; }
html[data-theme="light"] .reputation-reviewing { border-color: #e5b665; color: #8a5700; background: #fff7e8; }

/* Lime is a dark-theme accent. On light surfaces use brand pink for actions and
   a deeper green only where colour communicates a positive/online state. */
html[data-theme="light"] .dark-app :is(
  .premium-card a, .pro-premium > a, .people-cards small,
  .listing-grid article > small, .wallet-hero strong i, .vip-status-card strong,
  .profile-visitor-card > header small, .profile-visitor-card > header > span,
  .contacts-empty a, .conversation-empty button, .no-chat button,
  .attachment-library-grid footer a, .media-discovery-hero h2 em,
  .empty-discovery-catalog a, .catalog-pagination a, .forum-destination small,
  .planned-feature small, .planned-feature > span, .partner-grid legend,
  .admin-album-access, .album-owner-security summary::before,
  .album-owner-security summary > b, .forum-hero-stat strong,
  .regional-heading > a:not(.forum-create-button), .topic-labels b,
  .topic-stats i, .thread-breadcrumb a, .forum-review-note b,
  .post-menu-popover button > span, .post-edit-processing, .story-processing,
  .reel-processing, .ad-profile-preferences small,
  .public-partner-grid > article > small, .profile-connections-grid em,
  .profile-identity small, .people-filters header a,
  .search-person-info header small, .ad-profile-card > header > b,
  .media-library-note > span, .empty-media-library a, .friend-drawer-empty a,
  .composer-video-icon, .person-cover i, .messages-ui time,
  .conversation-row time, .forum-compose-form select:disabled
) {
  color: var(--light-accent-strong) !important;
}

html[data-theme="light"] .dark-app :is(
  .appearance-choice > button, .chat-vip-link, .media-discovery-hero > a,
  .catalog-filter-form button, .forum-search button, .forum-create-button,
  .album-password-gate button, .album-lock-form button,
  .album-owner-security footer button, .album-settings form button,
  .empty-feed a, .profile-actions button.following,
  .profile-connections-action, .profile-board-actions button.following,
  .search-person-info footer button.following,
  .ad-profile .profile-board-actions .primary, .js-reply-form button,
  .empty-reels button
) {
  border-color: var(--light-accent);
  color: #fff;
  background: var(--light-accent);
}

html[data-theme="light"] .dark-app :is(
  .chip-row b, .result-tabs a.active, .catalog-scope-tabs a.active,
  .forum-approval-list button.approve, .analytics-panel > header nav a.active,
  .report-actions button.resolve
) {
  border-color: var(--light-accent);
  color: #fff;
  background: var(--light-accent);
}

html[data-theme="light"] .dark-app .thread-vote.active {
  border-color: #d892b2 !important;
  color: var(--light-accent-strong) !important;
  background: var(--light-accent-soft) !important;
}

/* Live studio keeps its controls readable and its call to action unmistakable in light mode. */
html[data-theme="light"] .live-studio {
  border-color: #dfd4df;
  color: #281e29;
  background: linear-gradient(145deg, #fff, #fcf7fb);
  box-shadow: 0 18px 46px #45203412;
}
html[data-theme="light"] .live-studio h2 { color: #281e29; }
html[data-theme="light"] .live-studio label { color: #514653; }
html[data-theme="light"] .live-studio :is(input, select) {
  border-color: #d8cdd8;
  color: #281e29;
  background: #fff;
}
html[data-theme="light"] .live-lobby-actions input {
  border-color: #d8cdd8;
  color: #281e29;
  background: #fff;
}
html[data-theme="light"] .live-lobby-actions button {
  border-color: #c91f6b;
  background: linear-gradient(135deg, #d92776, #b6165e);
  box-shadow: 0 10px 25px #c91f6b2b;
}
html[data-theme="light"] .live-studio .live-studio-actions button {
  color: #fff;
  background: #514653;
}
html[data-theme="light"] .live-studio .studio-go-live {
  border-color: #c91f6b;
  color: #fff;
  background: linear-gradient(135deg, #d92776, #b6165e);
  box-shadow: 0 10px 25px #c91f6b2b;
}
html[data-theme="light"] .studio-go-live small { color: #ffe1ef; }
html[data-theme="light"] .live-studio .studio-back { color: #8d174f; }
html[data-theme="light"] .live-stage:not(.is-locked) {
  border-color: #dfcbd7;
  background: radial-gradient(circle at 68% 35%, #ff83b94d, transparent 21%), radial-gradient(circle at 10% 100%, #d8c8ff61, transparent 28%), linear-gradient(145deg, #fff, #f8eff5);
  box-shadow: 0 18px 46px #45203414;
}
html[data-theme="light"] .live-stage:not(.is-locked)::before { border-color: #eadce5; }
html[data-theme="light"] .live-video-placeholder span { background: #c91f6b; }
html[data-theme="light"] .live-video-placeholder strong { color: #281e29; }
html[data-theme="light"] .live-video-placeholder p { color: #6f6571; }
html[data-theme="light"] .live-stage-goal {
  border-color: #e4a5c3;
  background: #fffdfef2;
  box-shadow: 0 14px 36px #54203b1c;
}
html[data-theme="light"] .live-stage-goal header span { color: #9a1b57; }
html[data-theme="light"] .live-stage-goal header b { color: #281e29; }
html[data-theme="light"] .live-stage-goal header strong { color: #b5165e; }
html[data-theme="light"] .live-stage-goal header strong i,
html[data-theme="light"] .live-stage-goal small { color: #776977; }
html[data-theme="light"] .goal-progress { background: #f2dfe9; box-shadow: inset 0 1px 3px #6c244018; }
html[data-theme="light"] .goal-progress i { background: linear-gradient(90deg, #d92776, #ff84b6); box-shadow: 0 0 14px #d9277654; }
html[data-theme="light"] .live-side-panel { border-color: #dfd4df; background: #fff; box-shadow: 0 14px 38px #32182a0a; }
html[data-theme="light"] .live-side-panel > header,
html[data-theme="light"] .tip-form,
html[data-theme="light"] .live-chat { border-color: #e6dce5; }
html[data-theme="light"] .live-host p,
html[data-theme="light"] .tip-form > small { color: #716672; }
html[data-theme="light"] .live-goal { color: #991c58; background: #fff0f6; }
html[data-theme="light"] .tip-form .tip-presets button { border-color: #e3a0c0; color: #a6195b; background: #fff1f6; }
html[data-theme="light"] .live-card {
  border-color: #dfd4df;
  background: radial-gradient(circle at 68% 35%, #ffb2d15e, transparent 25%), linear-gradient(145deg, #fff, #fcf6fa);
  box-shadow: 0 14px 38px #32182a0c;
}
html[data-theme="light"] .live-card.l2 { background: radial-gradient(circle at 68% 35%, #d7c3ff8a, transparent 25%), linear-gradient(145deg, #fff, #f9f6ff); }
html[data-theme="light"] .live-card.is-private { border-color: #c8d98d; background: radial-gradient(circle at 68% 35%, #ddf58778, transparent 25%), linear-gradient(145deg, #fff, #fbfdf3); }
html[data-theme="light"] .live-card h3 { color: #281e29; }
html[data-theme="light"] .live-card footer small { color: #6f6571; }
html[data-theme="light"] .live-card .public-price { color: #766b78; }
html[data-theme="light"] .live-enter { border-color: #d8cdd8; color: #7d174d; background: #fff; }
html[data-theme="light"] .live-sort a { border-color: #dfd4df; color: #655b67; background: #fff; }
html[data-theme="light"] .live-sort a.active { border-color: #c91f6b; color: #fff; background: #c91f6b; }
html[data-theme="light"] .live-controls .end-live { color: #9c1e55; background: #fff0f5; border: 1px solid #e7a7c5; }
html[data-theme="light"] .dark-app .topic-row.pinned {
  box-shadow: inset 3px 0 var(--light-accent);
}

html[data-theme="light"] .dark-app :is(
  .vip-badge i, .nav-badge.lime, .reels-create span, .story-add-avatar > i,
  .story-cover > em, .discovery-rank, .reel-picker-icon,
  .post-editor-current > span, .post-editor-files label > span,
  .story-file-options label > span, .forum-approval-panel > header > b,
  .forum-approval-empty > span, .moderation-section-head > b,
  .album-current-access.access-password > span
) {
  border-color: var(--light-accent) !important;
  color: #fff !important;
  background: var(--light-accent) !important;
  box-shadow: none;
}
html[data-theme="light"] .dark-app .vip-badge i {
  color: var(--light-accent-strong) !important;
  background: #fff !important;
}

html[data-theme="light"] .dark-app :is(
  .message-receipt[data-receipt="read"], .chat-upload-status:not(.is-error),
  .interaction-status:not(.error), .plans li::before,
  .friend-drawer-status b, .friend-drawer-copy small.online
) {
  color: var(--light-positive) !important;
}

html[data-theme="light"] .dark-app :is(
  .community-state > i, .pro-user .user-copy i,
  .friend-drawer-status i, .friend-drawer-row.is-online .presence-dot,
  .friend-drawer-row .presence-dot.online
) {
  background: #3c8a53;
  box-shadow: 0 0 0 3px #3c8a531c;
}
html[data-theme="light"] .dark-app .friend-panel-trigger .friend-online-badge {
  border-color: #fff;
  color: #fff;
  background: #3c8a53;
  box-shadow: 0 0 0 3px #3c8a531c;
}

html[data-theme="light"] .dark-app .round-action > i {
  border-color: #fff;
  background: var(--light-accent);
}

html[data-theme="light"] .dark-app :is(.vip-status-card, .forum-destination, .forum-review-note) {
  border-color: #e4b1c8;
  color: var(--light-text);
  background: linear-gradient(135deg, var(--light-accent-soft), #fff);
}

html[data-theme="light"] .dark-app .profile-visitor-card {
  border-color: #e4b1c8;
  color: var(--light-text);
  background: linear-gradient(145deg, #fff, #fff4f8);
}
html[data-theme="light"] .dark-app .profile-visitor-card::after {
  background: #ff2b8610;
  box-shadow: 0 0 38px #ff2b8614;
}
html[data-theme="light"] .dark-app .profile-visitor-card > header b,
html[data-theme="light"] .dark-app .profile-visitor-row { color: var(--light-text); }
html[data-theme="light"] .dark-app .profile-visitor-row:hover { background: var(--light-accent-soft); }
html[data-theme="light"] .dark-app .media-library-note > span { background: var(--light-accent-soft); }
html[data-theme="light"] .dark-app .post-menu-popover button > span {
  color: var(--light-accent-strong) !important;
  background: var(--light-accent-soft);
}

html[data-theme="light"] .dark-app :is(.post-edit-processing i, .story-processing i, .reel-processing i) {
  border-color: #e7b0c8;
  border-top-color: var(--light-accent);
}

html[data-theme="light"] .dark-app .story-avatar {
  background: linear-gradient(135deg, #ff2b86, #b44cff, #ff8fbc);
}
html[data-theme="light"] .dark-app .reel-progress i {
  background: linear-gradient(90deg, #ff2b86, #ff8fbc);
}
html[data-theme="light"] .dark-app .reel-action.comment-toggle > span { color: #ff79b3; }
html[data-theme="light"] .dark-app .reel-actions .reel-action.media-love.is-loved > span {
  border-color: #ff2b86;
  color: #fff;
  background: #ff2b86;
  box-shadow: 0 0 24px #ff2b8660;
}
html[data-theme="light"] .profile-avatar-button:focus-visible {
  outline-color: var(--light-accent);
}
html[data-theme="light"] .album-owner-security :is(select, input):focus {
  border-color: #d892b2;
  box-shadow: 0 0 0 3px #c91f6b1c;
}
html[data-theme="light"] .dark-app .album-settings form button:hover {
  box-shadow: 0 8px 22px #c91f6b24;
}
html[data-theme="light"] .reputation-badge .reputation-icon { color: var(--light-accent-strong); }
html[data-theme="light"] .reputation-high .reputation-icon,
html[data-theme="light"] .reputation-good .reputation-icon { color: var(--light-positive); }

html[data-theme="light"] body.landing-immersive { --acid: var(--light-accent); }
html[data-theme="light"] .staging-banner { color: #6f1641; background: #f7d9e7; }

@media (max-width: 1200px) {
  html[data-theme="light"] .reels-catalog-controls .catalog-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  html[data-theme="light"] .reels-catalog-controls .catalog-filter-form {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  html[data-theme="light"] .manifesto-art::after {
    background: linear-gradient(180deg, #fff7fb 0%, #fff7fbef 45%, #fff7fb38 76%), linear-gradient(90deg, #fff7fb, transparent);
  }
}

@media (max-width: 620px) {
  body.landing-immersive .public-theme-toggle { width: 34px; height: 34px; font-size: 15px; }

  html[data-theme="light"] .reels-experience { padding-top: 54px; }
  html[data-theme="light"] .reels-catalog-controls {
    width: calc(100% - 16px);
    margin: 6px auto 8px;
  }

  html[data-theme="light"] .reels-catalog-controls .catalog-controls {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
    padding: 8px;
  }

  html[data-theme="light"] .reels-catalog-controls :is(.catalog-kind-tabs, .catalog-scope-tabs, .catalog-filter-form) {
    grid-column: 1;
  }

  html[data-theme="light"] .reels-catalog-controls .catalog-filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
  }

  html[data-theme="light"] .reel-slide { padding: 0; }
  html[data-theme="light"] .reel-player {
    border-inline: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 430px) {
  html[data-theme="light"] .reels-catalog-controls .catalog-filter-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }

  html[data-theme="light"] .reels-catalog-controls .catalog-filter-form button {
    grid-column: auto;
  }
}

/* Keep every desktop header control on one optical grid. Realtime badges used to
   shrink only the notification button, making it sit below the other actions. */
.night-top > div:last-child {
  min-height: 44px;
  gap: 12px;
}

.night-top .quick-search {
  box-sizing: border-box;
  height: 44px;
  border-radius: 22px;
  padding-inline: 15px;
}

.night-top .quick-search input {
  height: 100%;
  padding: 0;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
}

.night-top .round-action {
  box-sizing: border-box;
  width: 44px !important;
  height: 44px !important;
  flex: 0 0 44px;
  padding: 0;
}

.night-top .round-action svg,
.night-top .notification-bell svg {
  width: 18px !important;
  height: 18px !important;
}

.night-top .round-action > b {
  right: -4px !important;
  top: -5px !important;
  min-width: 18px !important;
  height: 18px !important;
  box-sizing: border-box;
  padding: 0 4px !important;
  border-width: 2px;
  border-style: solid;
  border-radius: 9px !important;
  font-size: 7px !important;
  line-height: 1;
}

.night-top .admin-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0 18px;
  border-radius: 22px;
  white-space: nowrap;
}

html[data-theme="light"] .night-top .round-action > b { border-color: #fff; }

@media (max-width: 720px) {
  .night-top > div:last-child { min-height: 38px; gap: 8px; }
  .night-top .round-action {
    width: 38px !important;
    height: 38px !important;
    flex-basis: 38px;
  }
  .night-top .round-action svg,
  .night-top .notification-bell svg {
    width: 17px !important;
    height: 17px !important;
  }
}
