/* Светлые темы опираются на спокойные цвета генератора паролей. */
body.theme-style-lavender,
body.theme-style-ocean {
  --bg-darkest: #dedbe5;
  --bg-sidebar: #e9e6ee;
  --bg-content: #e6e3eb;
  --bg-card: #f2eff5;
  --bg-card-hover: #eae5f1;
  --bg-modal: #f2eff5;
  --bg-modal-header: #e9e6ee;
  --bg-input: #eae7f0;
  --text-white: #211a35;
  --text-normal: #352e48;
  --text-muted: #625b73;
  --text-dim: #777084;
  --border-subtle: #e5deef;
  --border-strong: #d5cbe5;
  --blurple-subtle: #7045dc1a;
  --shadow-sm: 0 2px 8px #35254b12;
  --shadow-md: 0 8px 22px #35254b16;
  --shadow-lg: 0 20px 48px #35254b20;
  --appearance-surface: #f2eff5;
  --appearance-border: #e5deef;
  --appearance-selected: #f2ecff;
  --appearance-title: #211a35;
  --appearance-muted: #625b73;
  --appearance-accent: #7045dc;
}

body.theme-style-ocean {
  --bg-darkest: #dce5ed;
  --bg-sidebar: #e7edf3;
  --bg-content: #e3eaf1;
  --bg-card: #f0f4f8;
  --bg-card-hover: #e8f0f7;
  --bg-modal: #f0f4f8;
  --bg-modal-header: #e7edf3;
  --bg-input: #e6edf4;
  --appearance-surface: #f0f4f8;
  --border-subtle: #d7e6f5;
  --border-strong: #bdd7ef;
  --blurple-subtle: #2876d21a;
  --appearance-border: #d7e6f5;
  --appearance-selected: #e8f3ff;
  --appearance-accent: #2876d2;
}

body.theme-style-lavender .main-wrapper,
body.theme-style-ocean .main-wrapper {
  background: radial-gradient(ellipse 75% 56% at 112% 16%, color-mix(in srgb, var(--appearance-accent) 15%, transparent), transparent 78%), var(--bg-content);
}

body.theme-style-lavender .sidebar,
body.theme-style-ocean .sidebar,
body.theme-style-lavender .top-bar,
body.theme-style-ocean .top-bar {
  background: var(--bg-sidebar);
  border-color: var(--appearance-border);
  box-shadow: 0 2px 16px #3924520a;
}

body.theme-style-lavender .project-card,
body.theme-style-ocean .project-card,
body.theme-style-lavender .user-card-widget,
body.theme-style-ocean .user-card-widget,
body.theme-style-lavender .modal-card,
body.theme-style-ocean .modal-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--appearance-border) !important;
  box-shadow: 0 12px 32px #39245216 !important;
  color: var(--text-normal);
}

body.theme-style-lavender .project-card:hover,
body.theme-style-ocean .project-card:hover {
  background: var(--bg-card-hover) !important;
  box-shadow: 0 16px 36px #39245223 !important;
  border-color: var(--appearance-accent) !important;
}

body.theme-style-lavender .hero-banner,
body.theme-style-ocean .hero-banner {
  background: linear-gradient(125deg, var(--bg-card) 0%, var(--appearance-selected) 100%) !important;
  border: 1px solid var(--appearance-border) !important;
  box-shadow: 0 14px 40px #39245212;
}

body.theme-style-lavender .hero-banner:hover,
body.theme-style-ocean .hero-banner:hover {
  background: linear-gradient(125deg, var(--bg-card) 0%, var(--appearance-selected) 100%) !important;
  border-color: var(--appearance-accent) !important;
  box-shadow: 0 18px 42px #3924521d !important;
  filter: none;
}

body.theme-style-lavender .search-box,
body.theme-style-ocean .search-box,
body.theme-style-lavender .btn-secondary,
body.theme-style-ocean .btn-secondary {
  background: var(--bg-card);
  color: var(--text-normal);
  border: 1px solid var(--appearance-border);
  box-shadow: none;
}

body.theme-style-lavender .btn-secondary:hover,
body.theme-style-ocean .btn-secondary:hover {
  background: var(--appearance-selected);
  border-color: var(--appearance-accent);
  box-shadow: none;
}

body.theme-style-lavender .nav-item.active,
body.theme-style-ocean .nav-item.active {
  background: var(--appearance-selected);
  color: var(--appearance-title);
}

body.theme-style-lavender .btn-primary,
body.theme-style-ocean .btn-primary {
  background: linear-gradient(120deg, color-mix(in srgb, var(--blurple) 80%, white), var(--blurple));
  border-color: transparent;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--blurple) 24%, transparent);
}

body.theme-style-lavender .btn-primary:hover,
body.theme-style-ocean .btn-primary:hover {
  box-shadow: 0 8px 22px color-mix(in srgb, var(--blurple) 32%, transparent);
}

/* Оригинал берёт базовые стили сайта без новых переопределений. */
body.theme-style-classic {
  --appearance-surface: #2b2d31;
  --appearance-border: #44464d;
  --appearance-selected: #393b52;
  --appearance-title: #ffffff;
  --appearance-muted: #cbd5e1;
  --appearance-accent: #8d96ff;
}

body.theme-style-classic.theme-light {
  --bg-darkest: #dce0e8;
  --bg-sidebar: #e8ebf2;
  --bg-content: #e3e6ed;
  --bg-card: #f1f2f6;
  --bg-card-hover: #e8eaf2;
  --bg-modal: #f1f2f6;
  --bg-modal-header: #e8eaf2;
  --bg-input: #e9eaf1;
  --appearance-surface: #f1f2f6;
  --appearance-border: #cbd2df;
  --appearance-selected: #e1e5fb;
  --appearance-title: #182033;
  --appearance-muted: #4b5568;
  --appearance-accent: #4555cb;
}
body.theme-style-classic.theme-light :is(.sidebar, .top-bar, .project-card, .user-card-widget, .mini-post-card, .modal-card, .appearance-settings) {
  background: var(--bg-card) !important;
  border-color: var(--appearance-border) !important;
}
body.theme-style-classic.theme-light .main-wrapper { background: var(--bg-content); }

body.theme-style-noris-dark {
  --bg-darkest: #13121b;
  --bg-sidebar: #1a1824;
  --bg-content: #17151f;
  --bg-card: #23202e;
  --bg-card-hover: #2d293a;
  --bg-modal: #23202e;
  --bg-modal-header: #1a1824;
  --bg-input: #2b2737;
  --text-white: #f1eef7;
  --text-normal: #e5e0ee;
  --text-muted: #b6adc5;
  --text-dim: #968ca8;
  --border-subtle: #3b354a;
  --border-strong: #544a67;
  --appearance-surface: #23202e;
  --appearance-border: #4b425b;
  --appearance-selected: #332947;
  --appearance-title: #f1eef7;
  --appearance-muted: #b6adc5;
  --appearance-accent: #aa92ee;
}
body.theme-style-noris-dark :is(.sidebar, .top-bar, .project-card, .user-card-widget, .mini-post-card, .modal-card, .appearance-settings) {
  background: var(--bg-card) !important;
  border-color: var(--appearance-border) !important;
  color: var(--text-normal);
}
body.theme-style-noris-dark .main-wrapper { background: var(--bg-content); }

.appearance-settings {
  grid-column: 1 / -1;
  width: min(100%, 920px);
  margin: 16px auto 40px;
  padding: clamp(20px, 4vw, 36px);
  background: var(--appearance-surface, var(--bg-card));
  border: 1px solid var(--appearance-border, var(--border-subtle));
  border-radius: 24px;
  box-shadow: 0 18px 45px #35254b18;
  color: var(--appearance-title, var(--text-white));
}

.appearance-header h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2rem); letter-spacing: -.035em; }
.appearance-header p { margin: 7px 0 0; color: var(--appearance-muted, var(--text-muted)); }
.appearance-section { padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--appearance-border, var(--border-subtle)); }
.appearance-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.appearance-section-heading h3 { margin: 0; font-size: 1.05rem; }
.appearance-section-heading span { color: var(--appearance-muted, var(--text-muted)); font-size: .82rem; }
.appearance-style-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.appearance-style { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 132px; padding: 12px; border: 1px solid var(--appearance-border, var(--border-subtle)); border-radius: 16px; background: var(--appearance-surface, var(--bg-card)); color: inherit; text-align: left; cursor: pointer; font: inherit; transition: border-color .2s, transform .2s, box-shadow .2s; }
.appearance-style:hover { transform: translateY(-2px); border-color: var(--appearance-accent, var(--blurple)); box-shadow: 0 8px 22px #35254b15; }
.appearance-style.is-selected { border: 2px solid var(--appearance-accent, var(--blurple)); background: var(--appearance-selected, var(--bg-card-hover)); padding: 11px; }
.appearance-style:focus-visible, .appearance-choice:focus-visible, .appearance-reset:focus-visible { outline: 3px solid var(--appearance-accent, var(--blurple)); outline-offset: 2px; }
.appearance-style-name { font-weight: 750; line-height: 1.25; }
.appearance-style-detail { color: var(--appearance-muted, var(--text-muted)); font-size: .76rem; line-height: 1.35; }
.appearance-swatch { width: 100%; height: 44px; display: flex; align-items: flex-end; gap: 5px; padding: 7px; border-radius: 9px; background: linear-gradient(120deg, var(--swatch-a), var(--swatch-b)); }
.appearance-swatch span { width: 24%; height: 100%; border-radius: 4px; background: #ffffffc7; }
.appearance-swatch span:last-child { width: 50%; height: 68%; }
.appearance-swatch-lavender { --swatch-a: #f6f3ff; --swatch-b: #7045dc; }
.appearance-swatch-ocean { --swatch-a: #f0f7ff; --swatch-b: #2876d2; }
.appearance-swatch-classic { --swatch-a: #2b2d31; --swatch-b: #5865f2; }
.appearance-swatch-classic-light { --swatch-a: #e8ebf2; --swatch-b: #b8c1ec; }
.appearance-swatch-classic-dark { --swatch-a: #23252d; --swatch-b: #4655b6; }
.appearance-swatch-classic-blue { --swatch-a: #252730; --swatch-b: #5865f2; }
.appearance-swatch-classic-purple { --swatch-a: #25212e; --swatch-b: #7045dc; }
.appearance-swatch-classic-gray { --swatch-a: #282a2e; --swatch-b: #64748b; }
.appearance-swatch-noris-light { --swatch-a: #e9e6ee; --swatch-b: #aa8bea; }
.appearance-swatch-noris-dark { --swatch-a: #1a1824; --swatch-b: #8b72dd; }
.site-beta-note { margin: 8px 0 18px; color: var(--text-muted); font-size: .86rem; line-height: 1.45; }
.appearance-swatch-ios { --swatch-a: #6674a3; --swatch-b: #aa8bd0; }
.appearance-swatch-emerald { --swatch-a: #022019; --swatch-b: #10b981; }
.appearance-swatch-sakura { --swatch-a: #381832; --swatch-b: #f472b6; }
.appearance-swatch-space { --swatch-a: #050c23; --swatch-b: #2563eb; }
.appearance-swatch-synthwave { --swatch-a: #1f153b; --swatch-b: #ef4899; }
.appearance-swatch-minecraft { --swatch-a: #1b3020; --swatch-b: #4ade80; }
.appearance-swatch-web2000 { --swatch-a: #d5e8ff; --swatch-b: #2563eb; }
.appearance-swatch-retro99 { --swatch-a: #b8b8b8; --swatch-b: #687687; }
.appearance-color-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.appearance-color { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--appearance-border, var(--border-subtle)); border-radius: 12px; }
.appearance-color input { width: 38px; height: 32px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.appearance-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.appearance-color-grid + .appearance-actions { margin-top: 12px; }
.appearance-choice, .appearance-reset { padding: 8px 12px; border: 1px solid var(--appearance-border, var(--border-subtle)); border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: .84rem; cursor: pointer; transition: background .2s, border-color .2s; }
.appearance-choice:hover, .appearance-reset:hover { background: var(--appearance-selected, var(--bg-card-hover)); }
.appearance-choice.is-selected { border-color: var(--appearance-accent, var(--blurple)); color: var(--appearance-accent, var(--blurple)); background: var(--appearance-selected, var(--bg-card-hover)); font-weight: 700; }
.appearance-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--appearance-border, var(--border-subtle)); }
.appearance-setting-row:first-of-type { border-top: 0; }
.appearance-setting-row > span { font-weight: 650; }
.appearance-footer { display: flex; justify-content: flex-end; margin-top: 28px; }
body.motion-off *, body.motion-off *::before, body.motion-off *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
#theater-controls-toggle-btn[hidden] { display: none !important; }
body.view-settings #hero-banner,
body.view-settings .sort-controls { display: none; }
body.view-settings .section-header > div:last-child { display: none !important; }
body.has-custom-bg .main-wrapper { background: var(--custom-bg-color) !important; }

/* Страница входа использует существующие формы Noris. */
body.auth-page { background: #f7f5fb !important; min-height: 100vh; }
html:has(body.auth-page) { background: #f7f5fb !important; }
body.auth-page::before { content: ""; position: fixed; inset: 0 0 0 50%; z-index: 1; border-radius: 50% 0 0 50%; background: linear-gradient(145deg,#aa8bf2,#7045dc 72%,#6039bd); box-shadow: inset 20px 0 70px #ffffff24; transition: inset .7s cubic-bezier(.22,.7,.2,1),border-radius .7s ease; }
body.auth-page.auth-register::before { inset: 0 50% 0 0; border-radius: 0 50% 50% 0; }
body.auth-page .sidebar, body.auth-page .main-wrapper { display: none !important; }
body.auth-page #auth-modal { display: block !important; position: fixed !important; inset: 0 !important; min-height: 100vh; padding: 0; background: transparent !important; backdrop-filter: none !important; z-index: 3; }
body.auth-page #auth-modal .modal-card { position: absolute; left: clamp(20px,8vw,120px); top: 50%; transform: translateY(-50%); animation: none !important; transition: left .85s cubic-bezier(.22,.7,.2,1), top .85s cubic-bezier(.22,.7,.2,1), box-shadow .3s ease; width: min(calc(100% - 40px),460px); max-height: calc(100vh - 64px); overflow-y: auto; border: 1px solid #e7e0f2 !important; border-radius: 24px; background: #fffffff2 !important; box-shadow: 0 24px 70px #35205230 !important; color: #211a35 !important; }
body.auth-page.auth-register #auth-modal .modal-card { left: calc(100% - min(calc(100% - 40px),460px) - clamp(20px,8vw,120px)); }
body.auth-page #auth-modal .modal-header { background: transparent !important; border-color: #e7e0f2 !important; }
body.auth-page #auth-modal :is(label,.modal-title) { color: #211a35 !important; }
body.auth-page #auth-modal input { background: #faf8ff !important; border: 1px solid #dcd2ed !important; color: #211a35 !important; }
body.auth-page #auth-modal .btn-primary { background: #7045dc !important; border: 0 !important; color: white !important; box-shadow: none !important; }
body.auth-page #auth-modal a { color: #7045dc !important; }
body.auth-page #auth-modal .auth-toggle-btn.active { color: #7045dc !important; }
@media (max-width:700px) { body.auth-page::before { inset: 0 0 52% 0; border-radius: 0 0 50% 50%; } body.auth-page.auth-register::before { inset: 52% 0 0 0; border-radius: 50% 50% 0 0; } body.auth-page #auth-modal .modal-card, body.auth-page.auth-register #auth-modal .modal-card { left: 50%; transform: translate(-50%,-50%); } body.auth-page #auth-modal .modal-card { top: 67%; } body.auth-page.auth-register #auth-modal .modal-card { top: 33%; } }
body:is(.theme-style-lavender, .theme-style-ocean) {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
body:is(.theme-style-lavender, .theme-style-ocean) .yt-banner-title { font-weight: 750; letter-spacing: -.04em; }
body:is(.theme-style-lavender, .theme-style-ocean) .yt-title-blue { color: var(--appearance-accent); }
body:is(.theme-style-lavender, .theme-style-ocean) .yt-banner-badge { background: var(--appearance-selected); color: var(--appearance-accent); box-shadow: none; }
body:is(.theme-style-lavender, .theme-style-ocean) .yt-btn { box-shadow: none; font-weight: 650; }
body:is(.theme-style-lavender, .theme-style-ocean) .yt-btn-blue { background: var(--appearance-accent); color: white; }
body:is(.theme-style-lavender, .theme-style-ocean) .yt-btn-dark { background: var(--bg-card); color: var(--appearance-title); border: 1px solid var(--appearance-border); }
body:is(.theme-style-lavender, .theme-style-ocean) .yt-visual-card { background: var(--bg-card); transform: none; border: 1px solid var(--appearance-border); box-shadow: 0 12px 30px #39245212; }
body:is(.theme-style-lavender, .theme-style-ocean) :is(.yt-visual-big-number, .yt-visual-label, .yt-mini-pill) { color: var(--appearance-title); text-shadow: none; }
body:is(.theme-style-lavender, .theme-style-ocean) :is(.yt-mini-pill, .yt-visual-tag) { background: var(--appearance-selected); color: var(--appearance-accent); border-color: var(--appearance-border); }
body:is(.theme-style-lavender, .theme-style-ocean) .nav-item.active .nav-count { color: var(--appearance-accent); }
body:is(.theme-style-lavender, .theme-style-ocean) .mini-post-text { color: var(--text-normal) !important; }
body:is(.theme-style-lavender, .theme-style-ocean) .top-bar .btn-secondary { background: var(--bg-card) !important; color: var(--appearance-title) !important; box-shadow: none !important; }

/* При тёмном пользовательском фоне панели тоже становятся тёмными. */
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) {
  --bg-sidebar: #211f29;
  --bg-card: #292631;
  --bg-card-hover: #332f3e;
  --bg-darkest: #1b1922;
  --bg-input: #302c39;
  --bg-modifier-hover: #ffffff12;
  --bg-modifier-selected: #7045dc40;
  --text-white: #f4f0fa !important;
  --text-normal: #e2dce9 !important;
  --text-muted: #c2b9ce !important;
  --text-dim: #a99eb8 !important;
  --border-subtle: #494251;
  --appearance-surface: #292631;
  --appearance-border: #494251;
  --appearance-selected: #40334e;
  --appearance-title: #f4f0fa;
  --appearance-muted: #c2b9ce;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) :is(.sidebar, .top-bar) {
  background: #211f29 !important;
  border-color: #494251 !important;
  box-shadow: none !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) .app-layout {
  background: var(--custom-bg-color) !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) :is(.nav-text, .nav-section-label, .sidebar-brand-title, .user-name, .section-title, .card-title, .project-title, .appearance-header h2, .appearance-section-heading h3) {
  color: #f4f0fa !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) :is(.nav-item, .sidebar-brand-tagline, .user-role, .sub-counter, .appearance-header p, .appearance-style-detail, .section-subtitle, .card-desc, .project-desc, .results-count, .tags-label, .filter-label, .stat-mini-lbl) {
  color: #c2b9ce !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) :is(.appearance-color, .appearance-section-heading span) {
  color: #e2dce9 !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) .nav-item.active {
  background: #40334e !important;
  color: #f4f0fa !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) :is(.search-box, .top-bar .btn-secondary, .user-card-widget, .mini-post-card, .project-card, .hero-banner, .appearance-settings, .appearance-style) {
  background: #292631 !important;
  color: #e2dce9 !important;
  border-color: #494251 !important;
  box-shadow: none !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) :is(.search-box input, .search-box input::placeholder, .project-desc, .section-subtitle, .mini-post-text, .mini-post-user, .mini-post-date) {
  color: #c2b9ce !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) .appearance-style.is-selected {
  background: #40334e !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) :is(.yt-title-dark, .yt-banner-title) {
  color: #f4f0fa !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) :is(.yt-title-blue, .yt-banner-desc) {
  color: #cbb7ff !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) :is(.yt-banner-badge, .yt-visual-tag, .yt-mini-pill) {
  background: #40334e !important;
  color: #e8dfff !important;
  border-color: #5a4a6a !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) .yt-visual-card {
  background: #1b1922 !important;
  color: #f4f0fa !important;
  border-color: #494251 !important;
  box-shadow: none !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) .yt-btn-dark {
  background: #40334e !important;
  color: #f4f0fa !important;
  border-color: #5a4a6a !important;
}

/* Пользовательский фон перекрашивает весь интерфейс, а не только середину страницы. */
body.theme-light.has-custom-bg:is(.theme-style-lavender, .theme-style-ocean) :is(.sidebar, .top-bar) {
  background: var(--custom-panel-color) !important;
  border-color: var(--custom-border-color) !important;
  box-shadow: none !important;
}
body.theme-light.has-custom-bg:is(.theme-style-lavender, .theme-style-ocean) .app-layout {
  background: var(--custom-bg-color) !important;
}
body.theme-light.has-custom-bg:is(.theme-style-lavender, .theme-style-ocean) :is(.search-box, .top-bar .btn-secondary, .user-card-widget, .mini-post-card, .project-card, .hero-banner, .appearance-settings, .appearance-style) {
  background: var(--custom-raised-color) !important;
  border-color: var(--custom-border-color) !important;
  color: var(--custom-panel-text) !important;
  box-shadow: none !important;
}
body.theme-light.has-custom-bg:not(.has-custom-text-color):is(.theme-style-lavender, .theme-style-ocean) :is(.nav-text, .nav-section-label, .sidebar-brand-title, .user-name, .section-title, .card-title, .project-title, .appearance-header h2, .appearance-section-heading h3, .appearance-style-name, .appearance-color) {
  color: var(--custom-panel-text) !important;
}
body.theme-light.has-custom-bg:not(.has-custom-text-color):is(.theme-style-lavender, .theme-style-ocean) :is(.nav-item, .sidebar-brand-tagline, .user-role, .sub-counter, .appearance-header p, .appearance-style-detail, .section-subtitle, .card-desc, .project-desc, .results-count, .tags-label, .filter-label, .stat-mini-lbl, .appearance-section-heading span) {
  color: var(--custom-panel-muted) !important;
}
body.theme-light.has-custom-bg:is(.theme-style-lavender, .theme-style-ocean) .appearance-style.is-selected {
  background: color-mix(in srgb, var(--appearance-accent) 14%, var(--custom-raised-color)) !important;
}
@media (max-width: 600px) {
  .appearance-color-grid { grid-template-columns: 1fr; }
  .appearance-section-heading span { display: none; }
  .appearance-setting-row { align-items: flex-start; flex-direction: column; }
  .appearance-style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .appearance-style { transition: none; }
  .appearance-style:hover { transform: none; }
}

/* Светлая тема: мягкие поверхности и читаемый текст во всех панелях. */
body.theme-light:not(.has-custom-bg) {
  --bg-darkest: #dedbe5;
  --bg-sidebar: #e9e6ee;
  --bg-content: #e6e3eb;
  --bg-card: #f2eff5;
  --bg-card-hover: #eae5f1;
  --bg-modal: #f2eff5;
  --bg-modal-header: #e9e6ee;
  --bg-input: #eae7f0;
  --border-subtle: #d5cede;
  --border-strong: #c6bccf;
}
body.theme-light:not(.has-custom-bg):is(.theme-style-lavender, .theme-style-ocean) :is(.user-card-widget, .mini-post-card, .project-card, .modal-card, .appearance-settings, .appearance-style, .search-box) {
  background: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-normal) !important;
}
body.theme-light:not(.has-custom-bg):is(.theme-style-lavender, .theme-style-ocean) :is(.sidebar, .top-bar) {
  background: var(--bg-sidebar) !important;
  border-color: var(--border-subtle) !important;
}
body.theme-light:not(.has-custom-bg):is(.theme-style-lavender, .theme-style-ocean) :is(.subcategories-filter-bar, .select-control, .tag-pill:not(.active), .appearance-color, .appearance-choice:not(.is-selected), .appearance-reset) {
  background: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
  color: #252237 !important;
}
body.theme-light:not(.has-custom-bg):is(.theme-style-lavender, .theme-style-ocean) :is(.section-title, .section-subtitle, .results-count, .tags-label, .project-desc, .card-desc, .appearance-style-detail, .appearance-section-heading span) {
  color: #383247 !important;
}
body.theme-light:not(.has-custom-bg):is(.theme-style-lavender, .theme-style-ocean) :is(.search-box input, .search-box input::placeholder, .select-control, .subcat-label) {
  color: #383247 !important;
}
body.theme-light:not(.has-custom-bg):is(.theme-style-lavender, .theme-style-ocean) #auth-modal :is(input, textarea, select) {
  background: var(--bg-input) !important;
  color: #252237 !important;
}

/* Повторяющиеся фильтры скрыты на компьютере: те же разделы есть в меню. */
@media (min-width: 701px) {
  #tags-filter-row { display: none !important; }
}
.sidebar-extra { margin: 6px 0; }
.sidebar-extra summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text-normal);
  font-weight: 650;
}
.sidebar-extra summary::-webkit-details-marker { display: none; }
.sidebar-extra summary::after { content: '⌄'; float: right; }
.sidebar-extra[open] summary::after { content: '⌃'; }
.sidebar-extra summary:hover, .sidebar-extra summary:focus-visible { background: var(--bg-card-hover); }
.sidebar-extra .nav-section-label { display: block; }
.sidebar-stats, .live-sync-indicator { display: none !important; }
.sidebar-theme-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px 8px 16px; color: var(--text-muted); font-size: 13px; }
.sidebar-theme-row .quick-theme-control { flex-shrink: 0; }
.sidebar-online-visitors { width: 100%; margin-top: 12px; justify-content: center; }
.sidebar-online-visitors span:last-child { display: inline; }
#top-notifications-btn .nav-badge { background: #b93854; color: #fff; }
body.theme-light:is(.theme-style-lavender, .theme-style-ocean) .yt-visual-big-number {
  background: none;
  color: var(--appearance-title);
  -webkit-text-fill-color: var(--appearance-title);
}
body.theme-light:is(.theme-style-lavender, .theme-style-ocean) .sidebar-brand-banner {
  filter: drop-shadow(0 2px 2px #35254b55);
}
.sidebar-header[hidden] { display: none !important; }
body.theme-light:is(.theme-style-lavender, .theme-style-ocean) .nav-item.active .nav-badge,
body.theme-light:is(.theme-style-lavender, .theme-style-ocean) .nav-item:hover .nav-badge {
  background: #dcd3ec;
  color: #29213c;
}
body.theme-light:is(.theme-style-lavender, .theme-style-ocean) .category-badge {
  color: #fff !important;
}
body.theme-light:is(.theme-style-lavender, .theme-style-ocean) .category-badge.subcat-badge {
  background: #d8e9f2 !important;
  color: #174a68 !important;
  border-color: #8eb8cc !important;
}
body.theme-light:is(.theme-style-lavender, .theme-style-ocean) .card-author strong {
  color: #3b327c !important;
}
body.theme-light:is(.theme-style-lavender, .theme-style-ocean) .card-id-badge {
  color: #4d35a7;
  background: #e9e1f7;
}

/* Публичный профиль берёт цвета из выбранной темы. */
#user-profile-modal .profile-public-name,
#user-profile-modal .profile-public-game [style*="color: #fff"] { color: var(--text-white) !important; }
#user-profile-modal .profile-public-panel,
#user-profile-modal .profile-public-post,
#user-profile-modal .profile-public-game {
  background: var(--bg-card-hover) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-normal) !important;
}
#user-profile-modal .profile-public-bio,
#user-profile-modal .profile-public-empty {
  background: var(--bg-card-hover) !important;
  color: var(--text-normal) !important;
}
#user-profile-modal .profile-public-panel [style*="color: #94a3b8"],
#user-profile-modal .profile-public-post [style*="color: #94a3b8"],
#user-profile-modal .profile-public-post [style*="color: #64748b"],
#user-profile-modal .profile-public-game [style*="color: #94a3b8"] { color: var(--text-muted) !important; }
#user-profile-modal .profile-public-panel [style*="color: #ffffff"],
#user-profile-modal .profile-public-game [style*="color: #fff"] { color: var(--text-white) !important; }
#user-profile-modal .profile-public-post [style*="color: #cbd5e1"] { color: var(--text-normal) !important; }
body.theme-light #user-profile-modal [style*="color: #38bdf8"],
body.theme-light #user-profile-modal [style*="color: #34d399"],
body.theme-light #user-profile-modal [style*="color: #fbbf24"],
body.theme-light #user-profile-modal [style*="color: #10b981"] { color: var(--appearance-accent) !important; }
#user-profile-modal .profile-public-game > div:first-child { min-width: 0; }
#user-profile-modal .profile-public-game .btn { white-space: nowrap; }
@media (max-width: 600px) {
  #user-profile-modal .profile-public-game { flex-wrap: wrap; }
  #user-profile-modal .profile-public-game > div:last-child { margin-left: auto; }
}

/* Главная страница: четыре понятные подборки без лишних кнопок. */
.home-sections { display: grid; gap: 26px; }
.home-section { min-width: 0; }
.home-section-heading { margin-bottom: 12px; }
.home-section-heading h3 { margin: 0 0 2px; color: var(--text-white); font-size: 21px; }
.home-section-heading p { margin: 0; color: var(--text-muted); font-size: 13px; }
.home-project-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 12px; }
.home-project-card { padding: 0; overflow: hidden; text-align: left; font: inherit; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px; color: var(--text-normal); cursor: pointer; transition: transform .15s, border-color .15s; }
.home-project-card:hover, .home-project-card:focus-visible { transform: translateY(-2px); border-color: var(--appearance-accent, var(--blurple)); outline: none; }
.home-project-card img { display: block; width: 100%; height: 120px; object-fit: cover; background: var(--bg-card-hover); }
.home-project-info { display: grid; gap: 3px; padding: 10px 12px 12px; min-width: 0; }
.home-project-info strong { color: var(--text-white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.home-project-info small { color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-empty { color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 18px; margin: 0; }
@media (max-width: 600px) { .home-project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-project-card img { height: 92px; } }

/* В списке друзей и авторов раньше оставались жёстко заданные тёмные карточки. */
body.theme-light:is([data-view="friends"], [data-view="authors"]) #projects-grid [style*="background: rgba(15, 23, 42"],
body.theme-light:is([data-view="friends"], [data-view="authors"]) #projects-grid [style*="background: linear-gradient(135deg, rgba(15, 23, 42"],
body.theme-light:is([data-view="friends"], [data-view="authors"]) #projects-grid [style*="background: rgba(255, 255, 255, 0.02)"] {
  background: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
}
body.theme-light:is([data-view="friends"], [data-view="authors"]) #projects-grid [style*="color: #fff"],
body.theme-light:is([data-view="friends"], [data-view="authors"]) #projects-grid [style*="color: #ffffff"] {
  color: var(--text-white) !important;
}
body.theme-light:is([data-view="friends"], [data-view="authors"]) #projects-grid [style*="color: #94a3b8"],
body.theme-light:is([data-view="friends"], [data-view="authors"]) #projects-grid [style*="color: #64748b"] {
  color: var(--text-muted) !important;
}
#user-profile-modal .profile-public-panel [style*="color: #64748b"] {
  color: var(--text-muted) !important;
}

/* Контраст текста в светлых темах и в окнах с пользовательским фоном. */
body.theme-light { --text-dim: #5b5269; }
body.theme-style-lavender,
body.theme-style-ocean { --text-dim: #5b5269; }
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) {
  --text-dim: #b8afc6 !important;
}
body.theme-light.dark-custom-bg:is(.theme-style-lavender, .theme-style-ocean) .modal-card :is(h1, h2, h3, h4) {
  color: var(--text-white) !important;
}

/* Список авторов: внутренняя статистика должна следовать теме карточки. */
body.theme-light[data-view="authors"] #projects-grid [style*="background: #161c2c"] {
  background: var(--bg-card-hover) !important;
  border: 1px solid var(--border-subtle);
}
body.theme-light[data-view="authors"] #projects-grid [style*="color: #38bdf8"] {
  color: var(--appearance-accent, var(--blurple)) !important;
}

/* Отзывы: убираем бледные строки на светлой карточке. */
#reviews-modal #reviews-modal-list > div[style] {
  background: var(--bg-card-hover) !important;
  border-color: var(--border-subtle) !important;
}
#reviews-modal #reviews-modal-list [style*="color: #e2e8f0"],
#reviews-modal #reviews-modal-list [style*="color: #ffffff"] {
  color: var(--text-normal) !important;
}
#reviews-modal #reviews-modal-list [style*="color: #94a3b8"],
#reviews-modal #reviews-modal-list [style*="color: #64748b"] {
  color: var(--text-muted) !important;
}
#reviews-modal #reviews-modal-list [style*="color: #38bdf8"],
#reviews-modal #dedicated-review-guest-prompt [style*="color: #38bdf8"] {
  color: var(--appearance-accent, var(--blurple)) !important;
}
#reviews-modal #dedicated-review-guest-prompt [style*="color: #94a3b8"] {
  color: var(--text-muted) !important;
}

/* Описание обновления читается в любой выбранной теме. */
#release-notes-modal .modal-body { color: var(--text-normal) !important; }
#release-notes-modal .modal-body [style*="color: #fff"] {
  color: var(--text-white) !important;
}
#release-notes-modal .modal-body [style*="color: #cbd5e1"],
#release-notes-modal .modal-body [style*="color: #94a3b8"] {
  color: var(--text-muted) !important;
}
#release-notes-modal .modal-body :is(h4, a)[style*="color:"] {
  color: var(--appearance-accent, var(--blurple)) !important;
}

/* Пустые уведомления и чат не теряют заголовок в светлой теме. */
body.theme-light #notifications-modal [style*="color: #fff"] {
  color: var(--text-white) !important;
}
