/* HowieKnows.ai — bounded earned-result composition follow-through.
   Founder signature Home keeps its full calm first-use stage before intent.
   Once a real Set List exists and the reviewed Plan Board is visible, the earned marquee
   remains the branded success moment but stops monopolizing ~100svh: the actual plan must
   enter the same first viewport. This file intentionally changes result-state composition
   only; it does not change routing, PlanReadiness, Set List truth, or pre-intent behavior.

   Selector note (evidence 2026-08-29, freeze a035a6a5): stay-on-Home grounded Ask writes the
   one H.SetList anchor and reveals #homePlanBoard, but does not add body.has-plan. That class
   is the inherited views.js floating-planbar signal. Keying the fold on body.has-plan therefore
   never fired. Result-state is the visible Plan Board host, not the planbar class. */

body:has(#homePlanBoard.home-plan-board:not([hidden])) .home-signature-shell {
  min-height: 0;
  max-width: 100%;
  padding-top: clamp(16px, 2.4vw, 28px);
  padding-bottom: clamp(12px, 2vw, 22px);
}

body:has(#homePlanBoard.home-plan-board:not([hidden])) .home-signature.is-lit .hs-frame {
  min-height: clamp(330px, 48svh, 440px);
  max-width: 100%;
  box-sizing: border-box;
  padding-top: clamp(32px, 4vw, 48px);
  padding-bottom: clamp(28px, 3.8vw, 44px);
}

body:has(#homePlanBoard.home-plan-board:not([hidden])) .hs-rule {
  margin-top: clamp(15px, 2vw, 22px);
  margin-bottom: clamp(15px, 2vw, 22px);
}

body:has(#homePlanBoard.home-plan-board:not([hidden])) .hs-asked {
  margin-top: clamp(15px, 2vw, 20px);
}

body:has(#homePlanBoard.home-plan-board:not([hidden])) .home-plan-board {
  padding-top: clamp(14px, 2.4vw, 28px);
}

@media (max-width: 600px) {
  body:has(#homePlanBoard.home-plan-board:not([hidden])) .home-signature-shell {
    min-height: 0;
    padding: 8px 6px 8px;
  }

  body:has(#homePlanBoard.home-plan-board:not([hidden])) .home-signature {
    padding-top: 8px;
    padding-bottom: 8px;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* 390 evidence 2026-09-05: a 52svh min-height on the earned marquee pushed
     YOU ASKED / UNDERSTOOD under the bottom tabs. Size the frame to its copy. */
  body:has(#homePlanBoard.home-plan-board:not([hidden])) .home-signature.is-lit .hs-frame {
    min-height: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 22px 16px 14px;
  }

  body:has(#homePlanBoard.home-plan-board:not([hidden])) .hs-brand {
    font-size: clamp(28px, 9vw, 40px);
  }

  body:has(#homePlanBoard.home-plan-board:not([hidden])) .hs-plan-title {
    font-size: clamp(28px, 8.4vw, 40px);
  }

  body:has(#homePlanBoard.home-plan-board:not([hidden])) .hs-bulbs {
    display: none;
  }

  body:has(#homePlanBoard.home-plan-board:not([hidden])) .home-plan-board {
    padding-top: 8px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  /* The real add/place journey deliberately restores focus to the edited row. On a long Set
     List that leaves the single primary Share action more than a viewport above the consumer
     (exact-head founder-matrix 34927870257: y=-1719.5 at 360 and y=-1673.75 at 390).
     The first container-level :has() draft remained in document flow in the served browser.
     Bind the existing button itself to the explicit editable Set List route instead. This keeps
     Saved, shared-recipient and trip actions out of scope without cloning a control or handler. */
  body[data-view="setlist"] #app.setlist .js-share {
    position: fixed !important;
    left: 12px;
    right: 12px;
    /* The current mobile tab rail is 82px tall; keep the whole 46px
       control and its focus ring above it with a 12px gap. */
    bottom: calc(94px + env(safe-area-inset-bottom, 0px));
    z-index: 59;
    box-sizing: border-box;
    width: auto !important;
    min-height: 46px;
    margin: 0;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .34);
  }

  /* NI-2026-09-16: box-shadow is one property -- the sticky-bar shadow above and the global
     :focus-visible moat ring (shell.css) cannot both apply from separate rules; whichever
     selector wins takes the whole declaration, so on this exact fixed mobile bar the focus
     ring never rendered at all (measured 1.13:1, found live re-verifying the deploy candidate
     against verify-focus-ring-contrast.js). Restated together so focus keeps both the bar's
     own separation shadow and a real accessible ring. */
  body[data-view="setlist"] #app.setlist .js-share:focus-visible {
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .34), 0 0 0 2px var(--bg), 0 0 0 4px var(--hb-blue);
  }

  /* Later composed-Set-List CSS owns #app's ordinary padding. This route-specific compensation
     must survive that cascade so the final edit controls are not hidden behind Share and tabs. */
  body[data-view="setlist"] #app.setlist {
    padding-bottom: calc(176px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:has(#homePlanBoard.home-plan-board:not([hidden])) .home-signature-shell,
  body:has(#homePlanBoard.home-plan-board:not([hidden])) .home-signature.is-lit .hs-frame {
    transition: none !important;
  }
}
