/* Weather is a scoped overlay over the site's normal palette, including forum interiors. */
body.sv-weather-snow {
  --weather-canvas: #edf5fb;
  --weather-surface: #fbfeff;
  --weather-soft: #e5f0f9;
  --weather-line: #cddfee;
  --weather-ink: #17304d;
  --weather-muted: #60758b;
  --weather-heading: #335b80;
  --weather-header: #eff7fd;
  --weather-cloud: rgba(160, 190, 218, .1);
}
body.sv-weather-rain {
  --weather-canvas: #e8eef3;
  --weather-surface: #f7fafc;
  --weather-soft: #dde7ef;
  --weather-line: #c5d3df;
  --weather-ink: #203549;
  --weather-muted: #5d7285;
  --weather-heading: #36586f;
  --weather-header: #e1eaf1;
  --weather-cloud: rgba(89, 117, 142, .12);
}
[data-theme='dark'] body.sv-weather-snow {
  --weather-canvas: #0f1c2b;
  --weather-surface: #172839;
  --weather-soft: #20354a;
  --weather-line: #354f66;
  --weather-ink: #e5eff8;
  --weather-muted: #adc1d3;
  --weather-heading: #a9cbe6;
  --weather-header: #1b3044;
  --weather-cloud: rgba(137, 179, 211, .08);
}
[data-theme='dark'] body.sv-weather-rain {
  --weather-canvas: #101c26;
  --weather-surface: #182a36;
  --weather-soft: #233946;
  --weather-line: #38515e;
  --weather-ink: #e2edf2;
  --weather-muted: #acc0cb;
  --weather-heading: #a7cbdc;
  --weather-header: #1b303e;
  --weather-cloud: rgba(112, 154, 175, .08);
}
:root body.sv-weather {
  --canvas: var(--weather-canvas);
  --surface: var(--weather-surface);
  --soft: var(--weather-soft);
  --line: var(--weather-line);
  --ink: var(--weather-ink);
  --muted: var(--weather-muted);
  --sv-background: var(--weather-canvas);
  --sv-surface: var(--weather-surface);
  --sv-border: var(--weather-line);
  background: var(--weather-canvas);
  color: var(--weather-ink);
}
:root body.sv-weather .site-content {
  background: radial-gradient(ellipse at 12% 0, var(--weather-soft), transparent 55rem), var(--weather-canvas);
}
:root body.sv-weather .site-header {
  border-color: var(--weather-line);
  border-top-color: var(--sd-primary);
  background: linear-gradient(115deg, var(--weather-header), var(--weather-surface) 68%);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--weather-heading) 9%, transparent);
}
:root body.sv-weather .site-nav { border-color: var(--weather-line); background: var(--weather-surface); }
:root body.sv-weather .header-search { border-color: var(--weather-line); background: var(--weather-soft); }
:root body.sv-weather .site-footer { border-color: var(--weather-line); background: var(--weather-header); }
:root body.sv-weather :is(.forum-panel, .side-panel, .forum-white-panel, .topic-side-card, .content-card, .add-topic-form-card, .add-topic-side-card) {
  border-color: var(--weather-line);
  background: var(--weather-surface);
  color: var(--weather-ink);
}
:root body.sv-weather .forum-topic-panel:not(.is-solution) {
  border-color: var(--weather-line);
  color: var(--weather-ink);
  background: var(--weather-surface);
  box-shadow: 0 5px 22px color-mix(in srgb, var(--weather-heading) 8%, transparent);
}
:root body.sv-weather .topic-heading-card {
  border-color: var(--weather-line);
  border-left: 4px solid var(--sd-primary);
  background: linear-gradient(120deg, var(--weather-soft), var(--weather-surface) 78%);
}
:root body.sv-weather .topic-post:not(.is-solution) .post-author {
  border-color: var(--weather-line);
  background: linear-gradient(180deg, var(--weather-header), var(--weather-surface) 90%);
}
:root body.sv-weather .topic-post:not(.is-solution) :is(.post-meta, .post-actions, .post-author dl) { border-color: var(--weather-line); }
:root body.sv-weather .topic-post:not(.is-solution) .post-meta { background: linear-gradient(90deg, var(--weather-soft), transparent); }
:root body.sv-weather .topic-post:not(.is-solution) .post-copy { color: var(--weather-ink); }
:root body.sv-weather :is(.topic-side-card > h2, .topic-side-card > header, .panel-heading, .ai-topic-toolbar, .add-topic-form-card > header) {
  border-color: var(--weather-line);
  background: var(--weather-header);
  color: var(--weather-ink);
}
:root body.sv-weather :is(.panel-heading h2, .topic-side-card > header h2, .ai-topic-toolbar h2, .add-topic-form-card > header h2) { color: var(--weather-ink); }
:root body.sv-weather :is(.forum-row, .subforum-row, .ai-topic-row, .topic-list-row) { border-color: var(--weather-line); }
:root body.sv-weather :is(.forum-row, .subforum-row, .ai-topic-row, .topic-list-row):hover { background-color: var(--weather-soft); }
:root body.sv-weather :is(.hero-main, .category-hero, .subforum-hero) {
  background-image: linear-gradient(125deg, var(--weather-soft), var(--weather-surface));
}
:root body.sv-weather .sv-composer-skin {
  --composer-surface: var(--weather-surface);
  --composer-soft: var(--weather-soft);
  --composer-line: var(--weather-line);
  --composer-ink: var(--weather-ink);
  --composer-muted: var(--weather-muted);
}
[data-theme='dark'] body.sv-weather :is(.button-primary, .topic-answer-button:not(.is-disabled)) {
  color: #fff;
  background: linear-gradient(135deg, var(--sd-primary), var(--sd-accent));
}
[data-theme='dark'] body.sv-weather .topic-pagination a.active { color: var(--weather-canvas); }
.tone-weather-snow .sv-special-day-symbol { color: #edf8ff; background: linear-gradient(135deg, #7199bd, #466a91); }
.tone-weather-rain .sv-special-day-symbol { color: #e8f6ff; background: linear-gradient(135deg, #627f94, #36576c); }
.tone-weather-snow .sv-special-day-decoration { border-color: rgba(132, 176, 208, .12); box-shadow: -145px 70px 0 -70px rgba(174, 202, 224, .18); }
.tone-weather-rain .sv-special-day-decoration { border: 0; width: 320px; height: 140px; top: -55px; right: -60px; background: radial-gradient(ellipse, var(--weather-cloud), transparent 72%); }
.sv-weather-atmosphere, .sv-weather-particles {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none !important;
  user-select: none;
  contain: strict;
}
.sv-weather-atmosphere { z-index: 34; background: radial-gradient(ellipse at -4% 12%, var(--weather-cloud), transparent 32%), radial-gradient(ellipse at 106% 4%, var(--weather-cloud), transparent 34%); }
.sv-weather-particles { z-index: 35; }
.sv-weather-particles > span {
  position: absolute;
  top: -50px;
  pointer-events: none !important;
  opacity: var(--weather-opacity);
  animation: sv-weather-snowfall var(--weather-duration) var(--weather-delay) linear infinite;
}
.sv-weather-particles.weather-snow > span { width: var(--weather-size); height: var(--weather-size); border-radius: 50%; background: #91b3d1; box-shadow: 0 0 4px rgba(176, 207, 230, .4); }
.sv-weather-particles.weather-snow > .is-crystal { width: auto; height: auto; border-radius: 0; background: none; box-shadow: none; color: #87aac9; font-size: 16px; }
[data-theme='dark'] .sv-weather-particles.weather-snow > span { background: #e3f2ff; }
[data-theme='dark'] .sv-weather-particles.weather-snow > .is-crystal { color: #d9efff; background: none; }
.sv-weather-particles.weather-rain > span { width: 1px; height: var(--weather-length); border-radius: 2px; background: linear-gradient(transparent, #7398b3); animation-name: sv-weather-rainfall; }
[data-theme='dark'] .sv-weather-particles.weather-rain > span { background: linear-gradient(transparent, #accde0); }
.sv-weather-particles.is-paused > span { animation-play-state: paused; }
@keyframes sv-weather-snowfall {
  from { transform: translate3d(0, -50px, 0) rotate(0deg); }
  to { transform: translate3d(var(--weather-drift), calc(100vh + 100px), 0) rotate(100deg); }
}
@keyframes sv-weather-rainfall {
  from { transform: translate3d(0, -50px, 0) rotate(12deg); }
  to { transform: translate3d(var(--weather-drift), calc(100vh + 100px), 0) rotate(12deg); }
}
.sv-weather-topic-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 14px 0 18px;
  padding: 17px 18px;
  border: 1px solid var(--weather-line);
  border-radius: 10px;
  background: linear-gradient(120deg, var(--weather-soft), var(--weather-surface));
}
.sv-weather-topic-card[hidden] { display: none !important; }
.sv-weather-topic-card > span { display: grid; place-items: center; height: 54px; border-radius: 13px; color: var(--weather-heading); background: color-mix(in srgb, var(--weather-surface) 75%, transparent); }
.sv-weather-topic-card .sv-icon { width: 36px; height: 36px; }
.sv-weather-topic-card small { display: block; color: var(--weather-heading); font-size: 9px; letter-spacing: .12em; font-weight: 800; }
.sv-weather-topic-card strong { display: block; margin-top: 4px; color: var(--weather-ink); font-size: 15px; line-height: 1.4; }
.sv-weather-topic-card p { margin: 5px 0 0; color: var(--weather-muted); font-size: 12px; line-height: 1.6; }
.sv-weather-snow .sv-weather-topic-card { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7); }
@media (max-width: 600px) {
  .sv-weather-topic-card { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; padding: 13px 11px; }
  .sv-weather-topic-card > span { height: 38px; border-radius: 9px; }
  .sv-weather-topic-card .sv-icon { width: 28px; height: 28px; }
  .sv-weather-topic-card strong { font-size: 13px; }
  .sv-weather-topic-card p { font-size: 11px; }
  .sv-weather-particles.weather-snow > .is-crystal { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .sv-weather-particles { display: none !important; } }
@media print { .sv-weather-particles, .sv-weather-atmosphere, .sv-weather-topic-card { display: none !important; } }
