/* Reading, help and support pages share the restrained home-page palette. */
:is(.guide-page, .legal-page, .faq-page-browser, .support-page-shell, .editorial-error-page) {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto 88px;
    padding: 64px 0 0;
    color: var(--ui-text, #edf3f5);
    font-size: 16px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

:is(.guide-page, .legal-page, .faq-page-browser, .support-page-shell, .editorial-error-page) .section-kicker {
    margin: 0 0 18px;
    color: var(--ui-accent, #77e0c4);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.5;
    letter-spacing: .12em;
}

:is(.guide-hero, .guide-article-hero, .legal-hero, .support-hero, .editorial-error-hero),
.faq-page-browser .faq-compact-hero {
    padding: 0 0 42px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--ui-line, #293b43);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    overflow: visible;
}

:is(.guide-hero, .guide-article-hero, .legal-hero, .support-hero, .editorial-error-hero) h1,
.faq-page-browser .faq-compact-hero h1 {
    max-width: 900px;
    margin: 0 0 20px;
    color: var(--ui-text, #edf3f5);
    background: none;
    -webkit-text-fill-color: currentColor;
    font-size: clamp(40px, 4.6vw, 56px);
    font-weight: 650;
    line-height: 1.12;
    letter-spacing: -.035em;
    text-wrap: balance;
}

:is(.guide-hero, .guide-article-hero) > div > p:last-of-type,
:is(.legal-hero, .support-hero, .editorial-error-hero) p:not(.section-kicker),
.faq-page-browser .faq-compact-hero p:not(.section-kicker) {
    max-width: 720px;
    margin: 0;
    color: var(--ui-muted, #a5b3bd);
    font-size: 16px;
    line-height: 1.75;
}

.guide-hero,
.guide-article-hero {
    grid-template-columns: minmax(0, 1fr) minmax(240px, .43fr);
    align-items: center;
    gap: 48px;
}

.guide-hero .section-actions { margin-top: 26px; }

:is(.guide-hero-status, .guide-article-meta, .guide-signal-flow, .guide-sidebar,
    .guide-card, .guide-callout, .guide-note, .guide-success-box, .guide-next,
    .support-guide-card, .support-form-card, .guest-ticket-access-card,
    .guest-ticket-summary, .guest-ticket-thread, .guest-ticket-reply-card,
    .guest-ticket-closed-note),
.guide-article > section,
.guide-number-grid article {
    border: 1px solid var(--ui-line, #293b43);
    border-radius: 12px;
    background: var(--ui-surface, #101b23);
    box-shadow: none;
    backdrop-filter: none;
}

:is(.guide-hero-status, .guide-article-meta, .guide-signal-flow) { padding: 22px; }
.guide-hero-status li { color: var(--ui-text, #edf3f5); font-weight: 550; }
.guide-hero-status > span,
.guide-article-meta > span,
.guide-signal-flow > span { color: var(--ui-muted, #a5b3bd); font-weight: 550; }
.guide-article-meta > span { border-color: var(--ui-line, #293b43); padding: 9px 0; }
.guide-hero-status b { border-color: var(--ui-line, #293b43); color: var(--ui-accent, #77e0c4); }
.guide-signal-flow b { color: var(--ui-accent, #77e0c4); }

.guide-layout { grid-template-columns: 236px minmax(0, 1fr); gap: 32px; margin-top: 36px; }
.guide-sidebar { top: 24px; padding: 18px 12px; }
.guide-sidebar > p { color: var(--ui-muted, #a5b3bd); font-size: 11px; font-weight: 600; }
.guide-sidebar nav a { min-height: 44px; padding: 10px 12px; border-radius: 9px; color: var(--ui-muted, #a5b3bd); font-weight: 500; }
.guide-sidebar nav a:hover { color: var(--ui-text, #edf3f5); background: var(--ui-raised, #15232c); }
.guide-sidebar nav a.active { color: var(--ui-accent, #77e0c4); background: var(--ui-raised, #15232c); box-shadow: inset 2px 0 var(--ui-accent, #77e0c4); }
.guide-sidebar-help { margin: 20px 8px 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--ui-line, #293b43); border-radius: 0; background: none; }
.guide-sidebar-help strong { font-weight: 600; }
.guide-sidebar-help span { color: var(--ui-muted, #a5b3bd); line-height: 1.65; }
.guide-sidebar-help a { color: var(--ui-accent, #77e0c4); font-weight: 550; line-height: 1.65; }

.guide-card-grid { gap: 18px; }
.guide-card { min-height: 280px; padding: 28px; transition: border-color 150ms ease, background-color 150ms ease; }
.guide-card:hover { transform: none; background: var(--ui-raised, #15232c); border-color: var(--ui-accent, #77e0c4); box-shadow: none; }
.guide-card > span,
.guide-card:is(.violet, .magenta, .amber, .red) > span { color: var(--ui-accent, #77e0c4); font-weight: 550; }
.guide-card h2 { margin: 28px 0 12px; font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.guide-card p { color: var(--ui-muted, #a5b3bd); font-size: 15px; line-height: 1.7; }
.guide-card b { color: var(--ui-text, #edf3f5); font-weight: 550; }
.guide-callout { padding: 28px; align-items: start; flex-direction: column; gap: 22px; }
.guide-callout h2 { font-size: 28px; font-weight: 600; line-height: 1.25; }
.guide-callout p:not(.section-kicker) { color: var(--ui-muted, #a5b3bd); line-height: 1.75; }

.guide-article { gap: 24px; }
.guide-article > section { padding: 32px; scroll-margin-top: 28px; }
.guide-step-heading,
.guide-problem-title { gap: 16px; margin-bottom: 20px; }
.guide-step-heading > span,
.guide-problem-title > span,
.guide-troubleshooting .guide-problem-title > span {
    width: 38px;
    height: 38px;
    border: 1px solid var(--ui-line, #293b43);
    border-radius: 9px;
    color: var(--ui-accent, #77e0c4);
    background: var(--ui-raised, #15232c);
    font-size: 14px;
    font-weight: 550;
}
.guide-step-heading p,
.guide-problem-title p { color: var(--ui-muted, #a5b3bd); font-size: 11px; font-weight: 550; line-height: 1.7; }
.guide-step-heading h2,
.guide-problem-title h2 { color: var(--ui-text, #edf3f5); font-size: clamp(23px, 2.5vw, 30px); font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.guide-article > section > p,
.guide-article li,
.guide-note p,
.guide-success-box li { color: var(--ui-muted, #a5b3bd); font-size: 16px; line-height: 1.75; }
.guide-article strong { color: var(--ui-text, #edf3f5); font-weight: 600; }
.guide-article :is(ul, ol) { padding-left: 22px; }
.guide-article li::marker { color: var(--ui-accent, #77e0c4); }
.guide-note,
.guide-note.important,
.guide-success-box { border-left: 3px solid var(--ui-accent, #77e0c4); background: var(--ui-raised, #15232c); }
.guide-note.warning { border-left: 3px solid #e6c184; background: var(--ui-raised, #15232c); }
.guide-number-grid article { padding: 20px; }
.guide-number-grid b { color: var(--ui-accent, #77e0c4); font-weight: 550; }
.guide-number-grid strong { line-height: 1.4; }
.guide-number-grid p { color: var(--ui-muted, #a5b3bd); font-size: 15px; line-height: 1.7; }
.guide-figure { border-color: var(--ui-line, #293b43); border-radius: 9px; background: var(--ui-bg, #090f15); }
.guide-figure figcaption { border-color: var(--ui-line, #293b43); color: var(--ui-muted, #a5b3bd); font-size: 13px; line-height: 1.6; }
.guide-next { gap: 16px; padding: 22px 26px; }
.guide-next span { color: var(--ui-muted, #a5b3bd); font-size: 11px; font-weight: 550; }
.guide-next a { color: var(--ui-accent, #77e0c4); font-weight: 550; }

/* A stable reading measure makes policy text easier to follow. */
.legal-page { max-width: 880px; }
.legal-hero { padding-bottom: 32px; }
.legal-content { padding: 4px 0 0; color: var(--ui-muted, #a5b3bd); font-size: 16px; line-height: 1.8; }
.legal-content h2 { margin: 34px 0 14px; padding-top: 26px; border-top: 1px solid var(--ui-line, #293b43); color: var(--ui-text, #edf3f5); font-size: 22px; font-weight: 600; line-height: 1.4; }
.legal-content > h2:first-child { border-top: 0; padding-top: 0; }
.legal-content p,
.legal-content li { color: var(--ui-muted, #a5b3bd); }
.legal-content strong { color: var(--ui-text, #edf3f5); font-weight: 600; }
.legal-content li + li { margin-top: 8px; }
.legal-content a { color: var(--ui-accent, #77e0c4); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.legal-content a:hover { color: var(--ui-text, #edf3f5); }
.legal-page-nav { display: flex; flex-wrap: wrap; gap: 18px 28px; padding-top: 28px; margin-top: 40px; border-top: 1px solid var(--ui-line, #293b43); }
.legal-page-nav a { color: var(--ui-accent, #77e0c4); font-size: 14px; text-underline-offset: 4px; }

/* Keep questions, filters and answers in one accessible knowledge browser. */
.faq-page-browser .faq-compact-hero { margin-bottom: 32px; }
.faq-page-browser .faq-knowledge-base { border: 1px solid var(--ui-line, #293b43); border-radius: 12px; background: var(--ui-surface, #101b23); box-shadow: none; backdrop-filter: none; overflow: visible; }
.faq-page-browser .faq-kb-toolbar { gap: 24px; padding: 28px; border-color: var(--ui-line, #293b43); }
.faq-page-browser .faq-topic-list { gap: 8px; }
.faq-page-browser .faq-folder { min-height: 44px; padding: 9px 13px; border-color: var(--ui-line, #293b43); border-radius: 9px; background: transparent; color: var(--ui-muted, #a5b3bd); font-size: 14px; font-weight: 500; line-height: 1.5; }
.faq-page-browser .faq-folder:hover,
.faq-page-browser .faq-question:hover { border-color: #58716f; background: var(--ui-raised, #15232c); color: var(--ui-text, #edf3f5); }
.faq-page-browser .faq-folder.active,
.faq-page-browser .faq-question.active { border-color: var(--ui-accent, #77e0c4); background: var(--ui-raised, #15232c); color: var(--ui-accent, #77e0c4); }
.faq-page-browser .faq-folder strong { color: inherit; font-size: 12px; font-weight: 500; }
.faq-page-browser .faq-search { max-width: 660px; }
.faq-page-browser .faq-search span { color: var(--ui-text, #edf3f5); font-size: 14px; font-weight: 550; }
.faq-page-browser .faq-search input { min-height: 48px; border: 1px solid var(--ui-line, #293b43); border-radius: 9px; background: var(--ui-bg, #090f15); color: var(--ui-text, #edf3f5); font: inherit; }
.faq-page-browser .faq-search input::placeholder { color: var(--ui-muted, #a5b3bd); opacity: 1; }
.faq-page-browser .faq-search input:focus { border-color: var(--ui-accent, #77e0c4); box-shadow: 0 0 0 3px #77e0c41a; }
.faq-page-browser .faq-kb-grid { grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); min-height: 440px; }
.faq-page-browser .faq-question-pane,
.faq-page-browser .faq-answer-pane { padding: 28px; border-color: var(--ui-line, #293b43); }
.faq-page-browser .faq-question-pane { border-right: 1px solid var(--ui-line, #293b43); }
.faq-page-browser .faq-pane-title { color: var(--ui-muted, #a5b3bd); font-size: 12px; font-weight: 500; flex-wrap: wrap; }
.faq-page-browser .faq-pane-title span { color: var(--ui-muted, #a5b3bd); font-weight: 500; letter-spacing: .04em; }
.faq-page-browser .faq-question-list { max-height: 540px; padding: 3px 7px 3px 3px; gap: 8px; scrollbar-color: #3e585c transparent; scrollbar-width: thin; }
.faq-page-browser .faq-question { padding: 15px; border-color: var(--ui-line, #293b43); border-radius: 9px; background: transparent; color: var(--ui-text, #edf3f5); font-size: 15px; line-height: 1.5; }
.faq-page-browser .faq-question[hidden],
.faq-page-browser .faq-empty[hidden] { display: none; }
.faq-page-browser .faq-question span { font-weight: 550; }
.faq-page-browser .faq-question small { color: var(--ui-muted, #a5b3bd); font-size: 12px; font-weight: 400; }
.faq-page-browser .faq-answer-pane { background: none; scroll-margin-top: 24px; }
.faq-page-browser .faq-answer-pane h2 { color: var(--ui-text, #edf3f5); font-size: clamp(24px, 2.8vw, 32px); font-weight: 600; line-height: 1.28; letter-spacing: -.02em; }
.faq-page-browser .faq-answer-pane p { color: var(--ui-muted, #a5b3bd); font-size: 16px; font-weight: 400; line-height: 1.8; white-space: pre-line; }
.faq-page-browser .faq-answer-pane .faq-answer-lead { color: var(--ui-text, #edf3f5); font-size: 16px; font-weight: 500; }
.faq-page-browser .faq-tags span { border-color: var(--ui-line, #293b43); border-radius: 6px; background: var(--ui-raised, #15232c); color: var(--ui-muted, #a5b3bd); font-size: 12px; }
.faq-page-browser .faq-empty { border-color: var(--ui-line, #293b43); background: var(--ui-raised, #15232c); color: var(--ui-muted, #a5b3bd); }
.faq-page-browser .faq-help-link { margin: 24px 0 0; color: var(--ui-muted, #a5b3bd); }
.faq-page-browser .faq-help-link a { color: var(--ui-accent, #77e0c4); text-underline-offset: 4px; }

.support-hero { gap: 28px; align-items: end; }
.support-hero-actions { gap: 10px; }
.support-layout { grid-template-columns: minmax(230px, .62fr) minmax(0, 1.38fr); gap: 28px; margin-top: 32px; }
.support-guide-card { padding: 28px; }
.support-form-card { padding: 32px; }
.support-guide-card h2 { color: var(--ui-text, #edf3f5); font-size: 25px; font-weight: 600; line-height: 1.3; }
.support-page-shell .card-kicker { color: var(--ui-accent, #77e0c4); font-size: 11px; font-weight: 550; letter-spacing: .1em; }
.support-guide-card ul { color: var(--ui-muted, #a5b3bd); font-size: 15px; line-height: 1.75; }
.support-guide-card li::before { background: var(--ui-accent, #77e0c4); box-shadow: none; }
.support-guide-note { padding: 18px 0 0; border: 0; border-top: 1px solid var(--ui-line, #293b43); border-radius: 0; background: none; }
.support-guide-note strong { color: var(--ui-text, #edf3f5); }
.support-guide-note span { color: var(--ui-muted, #a5b3bd); }
.support-form { gap: 22px; }
.support-form-row { gap: 20px; }
.support-form label { color: var(--ui-text, #edf3f5); font-size: 14px; font-weight: 500; }
.support-form input,
.support-form select,
.support-form textarea { border-color: var(--ui-line, #293b43); border-radius: 9px; background: var(--ui-bg, #090f15); color: var(--ui-text, #edf3f5); font-size: 16px; line-height: 1.6; }
.support-form input:focus,
.support-form select:focus,
.support-form textarea:focus { border-color: var(--ui-accent, #77e0c4); box-shadow: 0 0 0 3px #77e0c41a; }
.support-form ::placeholder { color: var(--ui-muted, #a5b3bd); opacity: .8; }
.support-privacy-note { color: var(--ui-muted, #a5b3bd); font-size: 13px; line-height: 1.7; }
.support-privacy-note a { color: var(--ui-accent, #77e0c4); text-underline-offset: 3px; }
.support-page-shell .field-error { color: #f0a6a6; font-size: 13px; }
.support-page-shell .form-error { border-color: #b47777; border-radius: 9px; color: #f0b3b3; background: #281e23; }
.guest-ticket-access-card { max-width: 700px; margin: 32px auto 0; }
.guest-ticket-access-card,
.guest-ticket-reply-card { padding: 32px; }
.guest-ticket-access-card > p:not(.card-kicker) { color: var(--ui-muted, #a5b3bd); font-size: 15px; }
.guest-ticket-access-card h2,
.guest-ticket-reply-card h2,
.guest-ticket-summary h2 { color: var(--ui-text, #edf3f5); font-size: 26px; font-weight: 600; line-height: 1.35; }
.guest-ticket-summary { margin-top: 32px; padding: 26px; gap: 20px; }
.guest-ticket-reference { color: var(--ui-muted, #a5b3bd); }
.guest-ticket-status { border-color: #54786b; background: #172c28; color: var(--ui-accent, #77e0c4); font-weight: 550; }
.guest-ticket-thread { padding: 24px; background: transparent; }
.guest-ticket-message,
.guest-ticket-message.user { border: 1px solid var(--ui-line, #293b43); border-radius: 9px; background: var(--ui-surface, #101b23); }
.guest-ticket-message.admin { border-left: 3px solid var(--ui-accent, #77e0c4); }
.guest-ticket-message header { gap: 12px; flex-wrap: wrap; }
.guest-ticket-message strong { color: var(--ui-text, #edf3f5); font-weight: 550; }
.guest-ticket-message time,
.guest-ticket-message p { color: var(--ui-muted, #a5b3bd); }
.guest-ticket-message p { font-size: 15px; line-height: 1.75; }
.guest-ticket-closed-note { padding: 22px; color: var(--ui-muted, #a5b3bd); }

.editorial-error-page { max-width: 780px; padding-top: 90px; }
.editorial-error-details { margin-top: 30px; padding: 22px; border: 1px solid var(--ui-line, #293b43); border-radius: 12px; background: var(--ui-surface, #101b23); color: var(--ui-muted, #a5b3bd); }
.editorial-error-details p { margin: 0; }
.editorial-error-details code { color: var(--ui-text, #edf3f5); overflow-wrap: anywhere; }
.editorial-error-page .section-actions { margin-top: 30px; }

:is(.guide-page, .legal-page, .faq-page-browser, .support-page-shell, .editorial-error-page) :is(a, button, input, textarea, select):focus-visible {
    outline: 2px solid var(--ui-accent, #77e0c4);
    outline-offset: 4px;
}

@media (max-width: 980px) {
    .guide-hero,
    .guide-article-hero { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .guide-layout { grid-template-columns: minmax(0, 1fr); }
    .guide-sidebar { position: static; }
    .guide-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .guide-sidebar-help { grid-template-columns: 1fr; }
    .faq-page-browser .faq-kb-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .faq-page-browser .faq-question-pane { border-right: 0; border-bottom: 1px solid var(--ui-line, #293b43); }
    .faq-page-browser .faq-answer-pane { border-top: 0; }
    .faq-page-browser .faq-question-list { max-height: 320px; }
    .support-layout { grid-template-columns: minmax(0, 1fr); }
    .support-guide-card { padding: 24px; }
    .support-hero { align-items: start; flex-direction: column; }
}

@media (max-width: 640px) {
    :is(.guide-page, .legal-page, .faq-page-browser, .support-page-shell, .editorial-error-page) { width: calc(100% - 32px); margin-bottom: 60px; padding-top: 36px; }
    :is(.guide-hero, .guide-article-hero, .legal-hero, .support-hero, .editorial-error-hero),
    .faq-page-browser .faq-compact-hero { padding: 0 0 28px; }
    :is(.guide-hero, .guide-article-hero, .legal-hero, .support-hero, .editorial-error-hero) h1,
    .faq-page-browser .faq-compact-hero h1 { font-size: 32px; line-height: 1.2; letter-spacing: -.03em; }
    .guide-layout { gap: 24px; margin-top: 24px; }
    .guide-sidebar { padding: 16px 10px; }
    .guide-sidebar nav { grid-template-columns: minmax(0, 1fr); }
    .guide-sidebar-help { margin-top: 14px; padding-top: 14px; }
    .guide-card-grid,
    .guide-number-grid,
    .guide-number-grid.compact { grid-template-columns: minmax(0, 1fr); }
    .guide-card { min-height: 0; padding: 24px; }
    .guide-card h2 { margin-top: 22px; }
    .guide-article > section { padding: 22px 18px; }
    .guide-step-heading,
    .guide-problem-title { gap: 12px; }
    .guide-step-heading h2,
    .guide-problem-title h2 { font-size: 23px; }
    .guide-step-heading > span,
    .guide-problem-title > span { width: 32px; height: 32px; }
    .guide-note,
    .guide-success-box { padding: 16px; }
    .guide-callout { padding: 24px; }
    .guide-callout h2 { font-size: 25px; }
    .guide-next { padding: 20px; align-items: start; flex-direction: column; }
    .legal-content h2 { font-size: 21px; }
    .faq-page-browser .faq-kb-toolbar,
    .faq-page-browser .faq-question-pane,
    .faq-page-browser .faq-answer-pane { padding: 20px 16px; }
    .faq-page-browser .faq-topic-list { gap: 7px; }
    .faq-page-browser .faq-folder { padding: 8px 11px; gap: 8px; font-size: 13px; }
    .faq-page-browser .faq-question-list { max-height: 280px; }
    .faq-page-browser .faq-answer-pane h2 { font-size: 25px; }
    .support-form-row { grid-template-columns: minmax(0, 1fr); }
    .support-form-card,
    .support-guide-card,
    .guest-ticket-access-card,
    .guest-ticket-reply-card,
    .guest-ticket-summary,
    .guest-ticket-thread { padding: 22px 18px; }
    .support-hero-actions { align-items: stretch; width: 100%; }
    .support-hero-actions .button { width: 100%; }
    .guest-ticket-summary { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .guide-card { transition: none; }
}

/* Flexible Turnstile needs 300px; retain that real width even on a 320px phone. */
@media (max-width: 380px) {
    .support-page-shell.support-with-challenge { width: 100%; }
    .support-with-challenge > .support-hero,
    .support-with-challenge .support-guide-card { margin-right: 16px; margin-left: 16px; }
    .support-with-challenge .support-form-card { padding-right: 9px; padding-left: 9px; border-radius: 0; }
}
