/* Inner-page palette. The shared header and all messenger controls keep their own styles. */
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) {
  --ip-surface: linear-gradient(118deg, #07151e, #0c1024 53%, #1d0c31);
  --ip-inner: linear-gradient(118deg, #0b1c2a, #11162c 53%, #221136);
  --ip-rim: linear-gradient(108deg, #38dcf49c, #4697f47a 38%, #934cff91 70%, #e256f2a1);
  --ip-inner-rim: linear-gradient(108deg, #38dcf452, #4697f44d 38%, #934cff60 70%, #e256f270);
  --ip-text: linear-gradient(100deg, #39d6f4, #9e9afa 56%, #d378ef);
  --ip-button: linear-gradient(112deg, #10415b, #24336c 48%, #51266f);
  --ip-button-hover: linear-gradient(112deg, #145670, #344580 48%, #693588);
}

/* Paint existing panels without adding frames to transparent page wrappers. */
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) .doc-card:not(.radio-page):not(.rules-page):not(.instruction-page),
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(
  .page-hero, .rules-content, .faq-link-block, .playlist-panel, .seo-panel,
  .reviews-intro, .reviews-panel, .instruction-hero, .instruction-steps li,
  .instruction-benefit, .instruction-faq, .action-tile
) {
  border-width: 1px;
  border-color: transparent;
  background: var(--ip-surface) padding-box, var(--ip-rim) border-box;
  box-shadow: 0 12px 30px #00000026;
}
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(
  .doc-card .page-hero, .reviews-intro, .instruction-page .instruction-hero
) {
  background: url("/assets/home-palette-waves.svg?v=20261019-home-palette-1") center / 100% 100% no-repeat padding-box,
    var(--ip-surface) padding-box, var(--ip-rim) border-box;
}
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(
  .feature-info-box, .feature-info-box-warn, .feature-faq-item, .feature-links,
  .feature-plain-block, .faq-category, .reviews-auth-prompt,
  .review-reply-editor, .reviews-admin-toolbar
) {
  border-color: transparent;
  background: var(--ip-inner) padding-box, var(--ip-inner-rim) border-box;
  box-shadow: 0 6px 20px #00000018;
}
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(.feature-note-block, .review-admin-reply) {
  background: var(--ip-inner);
  border-color: #8067b76b;
}

/* Reuse the homepage text accents where a gradient already exists. */
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(
  .page-hero-title span, .reviews-intro h1 span, .instruction-hero h1 .instruction-title-accent
) { background-image: var(--ip-text); }
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(
  .page-eyebrow, .reviews-intro .theme-eyebrow, .instruction-eyebrow, .instruction-section-label
) { color: #7acbf0; }
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(.page-eyebrow, .instruction-eyebrow)::before,
body.max-theme.radio-modern main[data-site-page="reviews"] .reviews-dot { background: #65bff1; box-shadow: 0 0 10px #50c9f429; }
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(
  .rules-content, .feature-source, .seo-panel, .faq-short-links, .feature-links,
  .doc-card:not(.rules-page):not(.instruction-page):not(.radio-page)
) a:not(.cta):not(.theme-button):not(.max-cta):not(.telegram-cta) {
  color: #53d4f4;
  border-bottom-color: #53d4f44d;
}
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(
  .rules-content, .feature-source, .seo-panel, .faq-short-links, .feature-links,
  .doc-card:not(.rules-page):not(.instruction-page):not(.radio-page)
) a:not(.cta):not(.theme-button):not(.max-cta):not(.telegram-cta):hover { color: #c09af4; }

/* Ordinary actions only: never match messenger classes or their descendants. */
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(
  .theme-button, .cta, .playlist-toggle-btn, .doc-nav a, .instruction-related-links a
):not(.max-cta):not(.telegram-cta) {
  --action-bg: var(--ip-button);
  --action-hover: var(--ip-button-hover);
  --action-border: #6b69bb80;
  --action-hover-border: #88b9dd;
  --action-shadow: inset 0 1px 0 #bdd2ff12;
}
body.max-theme.radio-modern main[data-site-page="reviews"] .reviews-button:not(.reviews-button-danger) {
  border-color: #6b69bb80;
  background: var(--ip-button);
  box-shadow: inset 0 1px 0 #bdd2ff12;
}
body.max-theme.radio-modern main[data-site-page="reviews"] .reviews-button:not(.reviews-button-danger):is(:hover, :focus-visible) {
  border-color: #88b9dd;
  background: var(--ip-button-hover);
}

/* FAQ shortcuts reuse the homepage cards, including their hover and text tones. */
body.max-theme.radio-modern main[data-site-page="faq"] .action-tile {
  font-weight: 400;
  --action-hover: var(--ip-inner);
  --action-hover-border: #6d80c1;
  --action-shadow: 0 8px 20px #00000026;
  --action-muted: #c4c9dc;
}

/* FAQ selection remains clearly distinct from the other category cards. */
body.max-theme.radio-modern main[data-site-page="faq"] .doc-card.faq-page .faq-category[aria-selected="true"] {
  border-color: transparent;
  background: linear-gradient(118deg, #12384b, #202147 53%, #40235d) padding-box,
    linear-gradient(108deg, #49dcf4, #8877f5 58%, #cf79ef) border-box;
  box-shadow: 0 0 18px #579dd91f, inset 0 1px 0 #ffffff0d;
}
body.max-theme.radio-modern main[data-site-page="faq"] .doc-card.faq-page .faq-category:is(:hover, :focus-visible) { border-color: #8ca4dc; }

/* Controls retain their dimensions and their meaning in selected/error states. */
body.max-theme.radio-modern main[data-site-page="playlist"] #playlistDateFilters.playlist-dates--line {
  --dates-text: #e1e4f1;
  --dates-muted: #b6bed1;
  --dates-active: #53d4f4;
  --dates-line: var(--ip-text);
}
body.max-theme.radio-modern main[data-site-page="playlist"] :is(.playlist-sort-select, .playlist-time-input),
body.max-theme.radio-modern main[data-site-page="reviews"] :is(#reviewComment, .review-reply-editor textarea) {
  border-color: #6380ae78;
  background: var(--ip-inner);
  background-color: #11162c;
}
body.max-theme.radio-modern main[data-site-page="reviews"] #reviewComment[aria-invalid="true"] { border-color: #ff95ab; }
body.max-theme.radio-modern main[data-site-page="playlist"] .history-title-link { color: #53d4f4; }
body.max-theme.radio-modern main[data-site-page="playlist"] .history-item { border-color: #69759a2e; }
body.max-theme.radio-modern main[data-site-page="reviews"] .review-distribution-track > span { background: var(--ip-text); }
body.max-theme.radio-modern main[data-site-page="reviews"] .review-author-avatar { background: var(--ip-button); }
body.max-theme.radio-modern main[data-site-page="reviews"] .reviews-page,
body.max-theme.radio-modern main[data-site-page="reviews"] { --review-line: #69759a3b; }
body.max-theme.radio-modern main[data-site-page="document"] .instruction-steps li::before {
  border-color: #7192c38c;
  background: var(--ip-button);
}
body.max-theme.radio-modern main[data-site-page="document"] .instruction-benefit-icon {
  background: linear-gradient(118deg, #0b3a50, #311b50);
  color: #b7adfa;
}
body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) .doc-actions-bar { border-top-color: #62577b52; }

/* Keep the wave horizontal on narrow, tall introductions. */
@media (max-width: 599px) {
  body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(
    .doc-card .page-hero, .reviews-intro, .instruction-page .instruction-hero
  ) {
    background-size: 800px 280px, auto, auto;
    background-position: center top, center, center;
  }
}

@media (forced-colors: active) {
  body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(
    .doc-card:not(.radio-page):not(.rules-page):not(.instruction-page), .page-hero,
    .rules-content, .faq-link-block, .playlist-panel, .seo-panel, .reviews-intro,
    .reviews-panel, .instruction-hero, .instruction-steps li, .instruction-benefit,
    .instruction-faq, .faq-category, .action-tile
  ) { background: Canvas; border-color: CanvasText; box-shadow: none; }
  body.max-theme.radio-modern main[data-site-page]:not([data-site-page="home"]) :is(
    .page-hero-title span, .reviews-intro h1 span, .instruction-title-accent
  ) { background: none; color: CanvasText; -webkit-text-fill-color: CanvasText; }
}
