/* AC46 — Stateful visual integrity / premium interaction hardening
   Canonical target: founder-approved 1024x1536 editorial concept.
   Runtime semantics and JS are untouched. */

:root{
  --ac46-paper:#f8f5ef;
  --ac46-paper-2:#f3eee7;
  --ac46-ink:#1d2023;
  --ac46-soft:#675e56;
  --ac46-muted:#827a73;
  --ac46-bronze:#9a7555;
  --ac46-champagne:#e0cab3;
  --ac46-line:rgba(103,94,86,.22);
}

/* ------------------------------------------------------------------
   1. Recovery / pre-purchase — answer rows, not SaaS cards
   ------------------------------------------------------------------ */
body.instrument-v1--recovery .cfa-question h2,
body.instrument-v1--before_purchase .cfa-question h2,
body.instrument-v1--recovery .cfa-sheet h2,
body.instrument-v1--before_purchase .cfa-sheet h2{
  font-family:Georgia,"Times New Roman",serif!important;
  font-weight:400!important;
  letter-spacing:-.028em!important;
  line-height:1.02!important;
  color:var(--ac46-ink)!important;
}
body.instrument-v1--recovery .cfa-options,
body.instrument-v1--before_purchase .cfa-options{
  gap:0!important;
  margin-top:30px!important;
  border-top:1px solid var(--ac46-line)!important;
}
body.instrument-v1--recovery .cfa-option,
body.instrument-v1--before_purchase .cfa-option{
  position:relative!important;
  grid-template-columns:minmax(0,1fr) 34px!important;
  min-height:62px!important;
  padding:16px 4px!important;
  border:0!important;
  border-bottom:1px solid var(--ac46-line)!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  transform:none!important;
  transition:background-color .16s ease,padding-left .16s ease,color .16s ease!important;
}
body.instrument-v1--recovery .cfa-option:hover,
body.instrument-v1--recovery .cfa-option:focus-visible,
body.instrument-v1--before_purchase .cfa-option:hover,
body.instrument-v1--before_purchase .cfa-option:focus-visible,
body.instrument-v1--recovery .cfa-option.is-selected,
body.instrument-v1--before_purchase .cfa-option.is-selected{
  background:rgba(224,202,179,.16)!important;
  padding-left:12px!important;
  outline:0!important;
}
body.instrument-v1--recovery .cfa-option span,
body.instrument-v1--before_purchase .cfa-option span{
  font-family:Arial,sans-serif!important;
  font-size:15px!important;
  font-weight:600!important;
  line-height:1.42!important;
  color:var(--ac46-ink)!important;
}
body.instrument-v1--recovery .cfa-option small,
body.instrument-v1--before_purchase .cfa-option small{
  display:grid!important;
  place-items:center!important;
  width:30px!important;
  height:30px!important;
  overflow:hidden!important;
  color:transparent!important;
  font-size:0!important;
}
body.instrument-v1--recovery .cfa-option small::after,
body.instrument-v1--before_purchase .cfa-option small::after{
  content:"→";
  color:var(--ac46-bronze)!important;
  font:400 20px/1 Georgia,serif!important;
}
body.instrument-v1--recovery .cfa-nav,
body.instrument-v1--before_purchase .cfa-nav{
  border-top:0!important;
  padding-top:22px!important;
}
body.instrument-v1--recovery .cfa-text-action,
body.instrument-v1--before_purchase .cfa-text-action{
  min-height:44px!important;
}

/* ------------------------------------------------------------------
   2. Contract review — editorial rails instead of rounded selections
   ------------------------------------------------------------------ */
body.ac-review-page .acr-option-list{gap:0!important;border-top:1px solid var(--ac46-line)!important}
body.ac-review-page .acr-option{
  min-height:62px!important;
  padding:15px 4px!important;
  border:0!important;
  border-bottom:1px solid var(--ac46-line)!important;
  border-radius:0!important;
  background:transparent!important;
}
body.ac-review-page .acr-option:hover,
body.ac-review-page .acr-option:has(input:checked){background:rgba(224,202,179,.14)!important}
body.ac-review-page .acr-option strong{font-size:15px!important;color:var(--ac46-ink)!important}
body.ac-review-page .acr-option small{font-size:13px!important;color:var(--ac46-soft)!important}
body.ac-review-page :where(input:not([type=checkbox]):not([type=radio]),select,textarea){border-radius:2px!important}

/* ------------------------------------------------------------------
   3. Website audit — remove the inherited white-on-paper regression
   ------------------------------------------------------------------ */
body.audit-tool-page .audit-panel{
  color:var(--ac46-ink)!important;
  background:transparent!important;
  border-top:1px solid var(--ac46-line)!important;
  border-bottom:1px solid var(--ac46-line)!important;
  overflow:hidden!important;
}
body.audit-tool-page .audit-panel::after{
  border-color:rgba(154,117,85,.22)!important;
  z-index:0!important;
}
body.audit-tool-page .audit-panel-head,
body.audit-tool-page .audit-url-form,
body.audit-tool-page .audit-status{position:relative!important;z-index:1!important}
body.audit-tool-page .audit-panel-head h2,
body.audit-tool-page .audit-url-form label,
body.audit-tool-page .audit-url-form>div>label,
body.audit-tool-page .audit-url-field>label>span:first-child{
  color:var(--ac46-ink)!important;
}
body.audit-tool-page .audit-panel-head p,
body.audit-tool-page .audit-confirm,
body.audit-tool-page .audit-confirm span,
body.audit-tool-page .audit-form-note{
  color:var(--ac46-soft)!important;
}
body.audit-tool-page .audit-panel .eyebrow,
body.audit-tool-page .audit-status{color:var(--ac46-bronze)!important}
body.audit-tool-page .audit-url-row input{
  color:var(--ac46-ink)!important;
  background:#fffdf9!important;
  border:1px solid rgba(103,94,86,.34)!important;
  border-radius:2px!important;
  min-height:56px!important;
}
body.audit-tool-page .audit-url-row input:focus{
  border-color:var(--ac46-bronze)!important;
  outline:2px solid rgba(154,117,85,.16)!important;
  box-shadow:none!important;
}
body.audit-tool-page .audit-confirm input{width:20px!important;height:20px!important;accent-color:var(--ac46-bronze)!important}
body.audit-tool-page .audit-url-row .btn{min-height:54px!important}

/* ------------------------------------------------------------------
   4. Succession — hard anti-overlap contract for the family editor
   ------------------------------------------------------------------ */
body.inheritance-page .inheritance-app-shell{
  border-radius:0!important;
  border-left:0!important;
  border-right:0!important;
  border-color:var(--ac46-line)!important;
}
body.inheritance-page .ims-choice{
  border-radius:3px!important;
  box-shadow:none!important;
  background:transparent!important;
}
body.inheritance-page .ims-choice:hover,
body.inheritance-page .ims-choice.is-selected{
  box-shadow:none!important;
  transform:none!important;
  background:rgba(224,202,179,.14)!important;
}
body.inheritance-page .ims-person-card{border-radius:3px!important;box-shadow:none!important}
body.inheritance-page .ims-live-preview{z-index:0!important;max-width:100%!important}
body.inheritance-page .ims-editor-pane{position:relative!important;z-index:1!important;min-width:0!important}
body.inheritance-page .ims-family-workspace{min-width:0!important}
body.inheritance-page .ims-status button{min-height:40px!important}

/* ------------------------------------------------------------------
   5. Parent-child — quieter selection geometry, stronger readability
   ------------------------------------------------------------------ */
body.parent-child-page .pc-choice{
  border-radius:3px!important;
  box-shadow:none!important;
  transform:none!important;
}
body.parent-child-page .pc-choice:hover,
body.parent-child-page .pc-choice:has(input:checked){box-shadow:none!important;transform:none!important}
body.parent-child-page .pc-choice strong{font-size:15px!important;color:var(--ac46-ink)!important}
body.parent-child-page .pc-choice small{font-size:13px!important;color:var(--ac46-soft)!important}

/* ------------------------------------------------------------------
   6. Legal question — controls must remain comfortably readable
   ------------------------------------------------------------------ */
body.legal-question-page :where(select,input:not([type=checkbox]):not([type=radio]),textarea){
  min-height:48px!important;
  font-size:15px!important;
  border-radius:2px!important;
}
body.legal-question-page textarea{min-height:132px!important;line-height:1.5!important}

/* ------------------------------------------------------------------
   7. Narrow widths — touch + stacking hard gate
   ------------------------------------------------------------------ */
@media(max-width:760px){
  body.instrument-v1--recovery .cfa-option,
  body.instrument-v1--before_purchase .cfa-option{grid-template-columns:minmax(0,1fr) 32px!important;min-height:58px!important;padding:14px 2px!important}
  body.instrument-v1--recovery .cfa-option small,
  body.instrument-v1--before_purchase .cfa-option small{display:grid!important}
  body.instrument-v1--recovery .cfa-option:hover,
  body.instrument-v1--recovery .cfa-option:focus-visible,
  body.instrument-v1--before_purchase .cfa-option:hover,
  body.instrument-v1--before_purchase .cfa-option:focus-visible{padding-left:8px!important}

  body.inheritance-page .ims-family-workspace{display:block!important;padding:4px 20px 22px!important;overflow:visible!important}
  body.inheritance-page .ims-live-preview{position:relative!important;top:auto!important;width:100%!important;max-width:100%!important;margin-top:22px!important;overflow:hidden!important}
  body.inheritance-page .ims-tree{min-width:0!important;width:100%!important;max-width:100%!important;transform:none!important}
  body.inheritance-page .ims-status button{min-height:44px!important;flex:1 1 calc(50% - 6px)!important}
  body.inheritance-page .ims-add-person,
  body.inheritance-page .ims-mini-action,
  body.inheritance-page .ims-icon-btn{min-height:44px!important}

  body.parent-child-page .pc-choice{min-height:60px!important}
  body.parent-child-page .pc-next,
  body.parent-child-page .pc-start{min-height:46px!important}

  body.audit-tool-page .audit-url-row{grid-template-columns:1fr!important}
  body.audit-tool-page .audit-url-row .btn{width:100%!important}
  body.audit-tool-page .audit-confirm{font-size:14px!important;line-height:1.5!important}
}

@media(max-width:820px){
  body.legal-question-page .question-form-shell,
  body.legal-question-page [data-step]{scroll-margin-top:96px!important}
}

/* AC47 — tablet sticky-header collision hardening.
   Stateful QA found the 768px menu trigger overlapping the active legal-question
   textarea after the runtime scrolled step 2 into view. On compact/tablet legal
   intake the header participates in normal flow instead of floating over controls. */
@media(max-width:820px){
  body.legal-question-page .site-header{
    position:relative!important;
    top:auto!important;
  }
  body.legal-question-page .question-form-shell,
  body.legal-question-page [data-step],
  body.legal-question-page .legal-form-step{
    scroll-margin-top:24px!important;
  }
}

/* AC47 — stateful mobile controls: nothing may sit underneath floating chrome. */
@media(max-width:820px){
  body.inheritance-page .site-header,
  body.ac-review-page .site-header,
  body.parent-child-page .site-header,
  body.audit-tool-page .site-header,
  body.instrument-v1--recovery .site-header,
  body.instrument-v1--before_purchase .site-header{
    position:relative!important;
    top:auto!important;
  }
}
@media(max-width:430px){
  body.inheritance-page .ims-reset{
    display:inline-flex!important;
    align-items:center!important;
    min-height:44px!important;
    padding:8px 0!important;
  }
  body.inheritance-page .ims-icon-btn{
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    min-height:44px!important;
    flex-basis:44px!important;
  }
}
@media(max-width:760px){
  body.inheritance-page .ims-start{
    display:inline-flex!important;
    justify-content:center!important;
    width:calc(100% - 40px)!important;
    max-width:calc(100% - 40px)!important;
    margin-left:20px!important;
    margin-right:20px!important;
    box-sizing:border-box!important;
  }
}
