/*
  AV LÜ™ Site Finish compatibility layer v2.4.0
  Designed, created, and owned by AVLU.
  © 2026 AVLU. All rights reserved.
*/

/* Keep signature controls singular instead of adding a second disclosure icon. */
body.avlu-site-finish details.guided-sample > summary::after,
body.avlu-site-finish details[data-guided-sample] > summary::after,
body.avlu-site-finish details:has(> summary .guided-sample__summary-icon) > summary::after {
  display: none;
}

body.avlu-site-finish details[open] .guided-sample__summary-icon {
  transform: rotate(45deg);
}

/* Signature modules already carry their own edge language. */
body.avlu-site-finish :is(
  .guided-sample,
  .avlu-intake-console,
  .avlu-intake-readiness,
  .avlu-intake-rail,
  .avlu-answer-rail,
  .avlu-decision-stage,
  .craft-workbench,
  .client-decision-strip,
  .review-tabs,
  .review-meta-strip
)::before {
  content: none;
}

/* Do not let the shared button treatment flatten signature physical controls. */
body.avlu-site-finish :is(
  .avlu-answer-snap__trigger,
  .avlu-intake-console__dial,
  .avlu-answer-rail button,
  .avlu-decision-step,
  .craft-tab,
  .craft-proof-toggle
) {
  isolation: auto;
}

/* Ensure sticky utilities remain below menus and above ordinary content. */
body.avlu-site-finish .v13-header,
body.avlu-site-finish [data-site-header] {
  isolation: isolate;
}

body.avlu-site-finish .v13-nav {
  z-index: 3;
}

/* Keep route labels and long legal URLs from causing narrow-screen overflow. */
body.avlu-site-finish :is(
  .v13-legal-panel,
  .ref-panel,
  .v13-card,
  .source-query-item,
  .review-history-card
) {
  min-width: 0;
}

body.avlu-site-finish :is(
  .v13-legal-panel,
  .ref-panel,
  .v13-card,
  .source-query-item,
  .review-history-card
) :is(p, li, a, code, strong, span) {
  overflow-wrap: anywhere;
}

/* Preserve readable select arrows and date controls in dark theme. */
html[data-theme="dark"] body.avlu-site-finish select {
  color-scheme: dark;
}

html[data-theme="dark"] body.avlu-site-finish input[type="date"] {
  color-scheme: dark;
}

/* Keep footer ownership and navigation above the decorative wordmark. */
body.avlu-site-finish :is(.ref-footer, .v13-footer, footer) > * {
  position: relative;
  z-index: 1;
}

/* Mobile signature surfaces need the entire viewport, not inherited card overflow. */
@media (max-width: 700px) {
  body.avlu-site-finish :is(
    .avlu-answer-snap,
    .avlu-decision-sequence,
    .avlu-intake-ignition-hero,
    .client-decision-strip
  ) {
    max-width: 100%;
  }

  body.avlu-site-finish .v13-nav a[aria-current="page"]::before {
    flex: 0 0 auto;
  }

  body.avlu-site-finish :is(.ref-panel, .v13-card) {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.avlu-site-finish details .guided-sample__summary-icon {
    transition: none;
  }
}

/*
  AV LÜ™ Editorial Polish v2.7.0
  Adobe reference pass: restrained navy, cream, pale blue, hard rules,
  editorial type, strong numbers, and minimal decorative chrome.
*/

body.avlu-site-finish:not(.route-presentation):not(.route-login) {
  --avlu-polish-navy: #071426;
  --avlu-polish-navy-2: #0b1b32;
  --avlu-polish-navy-3: #10243e;
  --avlu-polish-cream: #f7f3eb;
  --avlu-polish-paper: #fffdf8;
  --avlu-polish-ink: #17253d;
  --avlu-polish-copy: #4c586a;
  --avlu-polish-blue: #7eaeef;
  --avlu-polish-blue-strong: #2f70df;
  --avlu-polish-rule: rgba(126, 169, 237, 0.34);
  --avlu-polish-rule-light: rgba(23, 37, 61, 0.16);
  --avlu-polish-serif: "Source Serif 4", Georgia, serif;
  --avlu-polish-sans: "Source Sans 3", Arial, sans-serif;
  --avlu-polish-mono: "IBM Plex Mono", ui-monospace, monospace;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login),
body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(button, input, select, textarea) {
  font-family: var(--avlu-polish-sans) !important;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
  .ref-page-hero h1,
  .v13-page-hero h1,
  .about-hero h1,
  .authority-hero h1,
  .simulation-hero h1,
  .case-hero h1,
  .avlu-intake-ignition-hero h1,
  .ref-section h2,
  .v13-section h2,
  .simulation-section h2,
  .authority-section h2
) {
  font-family: var(--avlu-polish-serif) !important;
  font-weight: 650 !important;
  letter-spacing: -0.038em !important;
  text-wrap: balance;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
  .ref-lead,
  .v13-page-hero__lead,
  .about-hero__lead,
  .authority-hero__lead,
  .simulation-lead,
  .client-panel p,
  .ref-panel p,
  .v13-card p,
  .simulation-detail p
) {
  font-family: var(--avlu-polish-sans) !important;
  letter-spacing: -0.006em;
  line-height: 1.58 !important;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
  .ref-eyebrow,
  .simulation-kicker,
  .avlu-intake-section-state,
  .v13-data-badge,
  .simulation-label,
  .case-number,
  code,
  kbd
) {
  font-family: var(--avlu-polish-mono) !important;
}

/* Keep technical type technical. Ordinary labels should not look like a terminal. */
body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
  label,
  legend,
  .v13-nav a,
  .v13-login,
  .v13-btn,
  .ref-actions a,
  .client-panel__header,
  .simulation-record-button,
  .simulation-reset-button
) {
  font-family: var(--avlu-polish-sans) !important;
  letter-spacing: 0.01em !important;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) .v13-header {
  border-bottom: 1px solid var(--avlu-polish-rule) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] body.avlu-site-finish:not(.route-presentation):not(.route-login) .v13-header {
  background: #061321 !important;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) .v13-header__inner {
  min-height: 64px !important;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(.v13-nav a, .v13-login) {
  border-radius: 2px !important;
  font-size: 0.78rem !important;
  font-weight: 650 !important;
  text-transform: none !important;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(.v13-btn, button:not(.v13-theme-toggle)) {
  border-radius: 3px !important;
  box-shadow: none !important;
}

/* Quiet the decorative system so content does the work. */
body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
  .avlu-route-plate,
  .avlu-page-signal,
  .avlu-section-index,
  .avlu-section-nav,
  .avlu-page-spine,
  .avlu-footer-version
) {
  display: none !important;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) main > :first-child::after {
  display: none !important;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
  .ref-card,
  .ref-step-card,
  .ref-help-card,
  .ref-benefit,
  .v13-card,
  .v13-process-card,
  .v13-proof-box,
  .client-panel,
  .ref-panel,
  .simulation-table-card,
  .simulation-detail,
  .simulation-boundary-card,
  .authority-map-card
) {
  border-radius: 4px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
  .ref-card,
  .ref-step-card,
  .ref-help-card,
  .ref-benefit,
  .v13-card,
  .v13-process-card,
  .v13-proof-box,
  .client-panel,
  .ref-panel,
  .simulation-table-card,
  .simulation-detail,
  .simulation-boundary-card,
  .authority-map-card
) {
  border-color: var(--avlu-polish-rule) !important;
}

/* Stronger, cleaner section rhythm. */
body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
  .ref-section,
  .v13-section,
  .simulation-section,
  .authority-section
) {
  border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
  .ref-page-hero,
  .v13-page-hero,
  .about-hero,
  .authority-hero,
  .simulation-hero,
  .avlu-intake-ignition-hero
) {
  background-image: none !important;
}

html[data-theme="dark"] body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
  .v13-page-hero,
  .authority-hero,
  .simulation-hero,
  .avlu-intake-ignition-hero
) {
  background-color: var(--avlu-polish-navy) !important;
}

/* Forms should feel like serious intake, not a generated dashboard. */
body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(input, select, textarea) {
  border-radius: 3px !important;
  box-shadow: none !important;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(input, select, textarea):focus-visible {
  outline: 2px solid var(--avlu-polish-blue-strong) !important;
  outline-offset: 2px !important;
}

/* Numbers stay emphatic, with no neon glow. */
body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
  .evidence-scorecard-shell__total > strong,
  .v13-quote-impact strong,
  .simulation-scoreboard strong,
  .simulation-scoreboard b,
  .authority-status__grid b
) {
  font-family: var(--avlu-polish-sans) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em !important;
  text-shadow: none !important;
}

/* Footer: legal and navigation only. */
body.avlu-site-finish:not(.route-presentation):not(.route-login) .v13-footer {
  border-top: 1px solid var(--avlu-polish-rule) !important;
  background: #06101d !important;
}

body.avlu-site-finish:not(.route-presentation):not(.route-login) .v13-footer :is(a, p, span, strong) {
  font-family: var(--avlu-polish-sans) !important;
  letter-spacing: 0 !important;
}

@media (min-width: 1000px) {
  body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
    .ref-page-hero h1,
    .v13-page-hero h1,
    .about-hero h1,
    .authority-hero h1,
    .simulation-hero h1,
    .avlu-intake-ignition-hero h1
  ) {
    max-width: 16ch !important;
    font-size: clamp(3.65rem, 4.9vw, 5.7rem) !important;
    line-height: 0.96 !important;
  }
}

@media (max-width: 760px) {
  body.avlu-site-finish:not(.route-presentation):not(.route-login) .v13-header__inner {
    min-height: 58px !important;
    gap: 8px !important;
  }

  body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
    .ref-page-hero,
    .v13-page-hero,
    .about-hero,
    .authority-hero,
    .simulation-hero,
    .avlu-intake-ignition-hero
  ) {
    padding-top: 44px !important;
    padding-bottom: 44px !important;
  }

  body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
    .ref-page-hero h1,
    .v13-page-hero h1,
    .about-hero h1,
    .authority-hero h1,
    .simulation-hero h1,
    .avlu-intake-ignition-hero h1
  ) {
    max-width: 12ch !important;
    font-size: clamp(2.45rem, 11vw, 3.4rem) !important;
    line-height: 0.98 !important;
  }

  body.avlu-site-finish:not(.route-presentation):not(.route-login) :is(
    .ref-card,
    .ref-step-card,
    .ref-help-card,
    .ref-benefit,
    .v13-card,
    .v13-process-card,
    .v13-proof-box,
    .client-panel,
    .ref-panel,
    .simulation-table-card,
    .simulation-detail
  ) {
    border-radius: 3px !important;
  }

  body.avlu-site-finish:not(.route-presentation):not(.route-login) .v13-footer__grid {
    gap: 16px 12px !important;
  }
}
