/**
 * Context Sheet — shared premium-offer slide-over (2026-07-12).
 *
 * Spec: docs/superpowers/specs/2026-07-12-postmap-incremental-track-design.md (§ 02)
 * Mockup: dev-assets/postmap-incremental-mockups-2026-07-12/02-pricing-sheet.html
 * Loaded DYNAMICALLY by js/upgrade.src.js (indirect loader — when bumping,
 * bump the SHEET_CSS ?v= constant there AND the one static <link> on
 * grant-gameplan.html, which loads this file directly).
 *
 * Component-scoped: every selector is .gc-csh*; tokens are --gccsh-* so the
 * sheet renders identically on both palette generations (legacy blue main.css
 * pages and warm-editorial .gcx/grant pages) without touching either file.
 * Font stacks fall back gracefully on pages that don't load Fraunces/DM Sans.
 */

.gc-csh-root {
    --gccsh-cream: #FAF7F2;
    --gccsh-paper: #FFFEFB;
    --gccsh-ink: #2B2620;
    --gccsh-ink-soft: #6B6259;
    --gccsh-ink-faint: #998F84;
    --gccsh-forest: #2D6A4F;
    --gccsh-forest-deep: #1F4D39;
    --gccsh-forest-tint: #E8F1EC;
    --gccsh-forest-line: #BFD8CC;
    --gccsh-sienna: #C4532B;
    --gccsh-sienna-deep: #A64322;
    --gccsh-line: #E8E1D7;
    --gccsh-line-soft: #F0EAE0;
    --gccsh-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --gccsh-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --gccsh-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    position: fixed;
    inset: 0;
    z-index: 10500; /* above sticky-cta (900), AI-arrival (9000), .gc-sticky-bar (9998) */
    font-family: var(--gccsh-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--gccsh-ink);
}
/* [hidden] display-override gotcha: any later display rule would silently win. */
.gc-csh-root[hidden] { display: none; }

/* While the sheet is open, competing bottom bars stay down (never z-index-race
   them). Real class names verified 2026-07-13 (live-QA catch: the original
   .sticky-cta/.gc-aa-bar selectors matched NOTHING): sticky-cta.js renders
   .gc-sticky-cta, seo-conversion renders .gc-sticky-bar, ai-arrival renders
   .gc-aia — same trio ai-arrival's own suppression rule targets. */
body.gc-csheet-open .gc-sticky-cta,
body.gc-csheet-open .gc-sticky-bar,
body.gc-csheet-open .gc-aia { display: none !important; }
body.gc-csheet-open { overflow: hidden; }

.gc-csh-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(43, 38, 32, .38);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    opacity: 0;
    transition: opacity .22s ease-out;
}
.gc-csh-root.gc-csh--in .gc-csh-backdrop { opacity: 1; }

.gc-csh {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    background: var(--gccsh-paper);
    border-left: 1px solid var(--gccsh-line);
    box-shadow: -14px 0 48px -14px rgba(43, 38, 32, .35);
    display: flex;
    flex-direction: column;
    transform: translateX(28px);
    opacity: 0;
    transition: transform .26s cubic-bezier(.22, .8, .32, 1), opacity .2s ease-out;
}
.gc-csh-root.gc-csh--in .gc-csh { transform: none; opacity: 1; }
/* The dialog container receives programmatic focus on open (screen-reader
   entry point) — suppress the default ring there; interactive children keep
   their own focus styles. */
.gc-csh:focus { outline: none; }
.gc-csh-x:focus-visible, .gc-csh-ob:focus-visible {
    outline: 2px solid var(--gccsh-forest);
    outline-offset: 2px;
}

/* Scrollable middle: everything between the header row and the footer. */
.gc-csh-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 14px;
}
.gc-csh-body > * { flex-shrink: 0; }

.gc-csh-drag { display: none; }

.gc-csh-top {
    padding: 16px 22px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.gc-csh-trig {
    font-family: var(--gccsh-mono);
    font-size: 9.5px;
    letter-spacing: .04em;
    line-height: 1.5;
    color: var(--gccsh-ink-soft);
}
.gc-csh-trig b {
    color: var(--gccsh-sienna);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    display: block;
    margin-bottom: 2px;
}
.gc-csh-x {
    flex-shrink: 0;
    width: 44px;   /* live-QA 2026-07-13: dismiss controls must be ≥40px touch targets */
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--gccsh-line);
    background: var(--gccsh-paper);
    display: grid;
    place-items: center;
    font-size: 15px;
    line-height: 1;
    color: var(--gccsh-ink-soft);
    cursor: pointer;
    padding: 0;
}
.gc-csh-x:hover { border-color: var(--gccsh-ink-faint); color: var(--gccsh-ink); }

.gc-csh-hero { padding: 14px 22px 4px; }
.gc-csh-eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--gccsh-mono);
    font-size: 9.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gccsh-forest);
    font-weight: 600;
    margin-bottom: 8px;
}
.gc-csh-eyebrow::before {
    content: "✓";
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--gccsh-forest);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 9px;
    flex-shrink: 0;
}
.gc-csh-eyebrow--plain::before { content: none; }
.gc-csh-hero h2 {
    font-family: var(--gccsh-serif);
    font-weight: 600;
    font-size: 23px;
    letter-spacing: -.012em;
    line-height: 1.18;
    margin: 0;
    color: var(--gccsh-ink);
}
.gc-csh-hero h2 em { font-style: italic; color: var(--gccsh-sienna); }
.gc-csh-sub { font-size: 12.5px; color: var(--gccsh-ink-soft); margin: 6px 0 0; }

.gc-csh-proof {
    margin: 13px 22px 0;
    border: 1px solid var(--gccsh-line);
    border-radius: 11px;
    overflow: hidden;
}
.gc-csh-pr {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px dashed var(--gccsh-line-soft);
    font-size: 12px;
    color: var(--gccsh-ink-soft);
}
.gc-csh-pr:last-child { border-bottom: none; }
.gc-csh-pr b {
    font-family: var(--gccsh-serif);
    font-size: 14.5px;
    color: var(--gccsh-ink);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.gc-csh-pr b.gc-csh-g { color: var(--gccsh-forest); }
.gc-csh-pr s { color: var(--gccsh-ink-faint); }

.gc-csh-unl {
    margin: 13px 22px 0;
    background: var(--gccsh-forest-tint);
    border: 1px solid var(--gccsh-forest-line);
    border-radius: 11px;
    padding: 11px 14px;
    list-style: none;
}
.gc-csh-unl-k {
    font-family: var(--gccsh-mono);
    font-size: 9px;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--gccsh-forest);
    font-weight: 600;
    margin-bottom: 6px;
}
.gc-csh-unl li {
    font-size: 12px;
    color: var(--gccsh-forest-deep);
    padding: 2px 0 2px 16px;
    position: relative;
}
.gc-csh-unl li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--gccsh-forest);
}

.gc-csh-offers {
    padding: 14px 22px 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.gc-csh-off {
    border: 1.5px solid var(--gccsh-line);
    border-radius: 12px;
    padding: 13px 16px;
    position: relative;
    background: var(--gccsh-paper);
}
.gc-csh-off--main {
    border-color: var(--gccsh-sienna);
    box-shadow: inset 0 0 0 1px var(--gccsh-sienna);
}
.gc-csh-ok {
    position: absolute;
    top: -8px;
    left: 14px;
    font-family: var(--gccsh-mono);
    font-size: 8.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 600;
    background: var(--gccsh-paper);
    padding: 0 7px;
    color: var(--gccsh-ink-faint);
}
.gc-csh-off--main .gc-csh-ok { color: var(--gccsh-sienna); }
.gc-csh-orow {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}
.gc-csh-on { font-family: var(--gccsh-serif); font-weight: 600; font-size: 16.5px; }
.gc-csh-op {
    font-family: var(--gccsh-serif);
    font-weight: 700;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.gc-csh-op small {
    font-family: var(--gccsh-sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--gccsh-ink-soft);
}
.gc-csh-od { font-size: 11.5px; color: var(--gccsh-ink-soft); margin: 3px 0 0; }
.gc-csh-ob {
    margin-top: 9px;
    width: 100%;
    border: none;
    border-radius: 9px;
    padding: 11px;
    font-family: var(--gccsh-sans);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    min-height: 44px;
}
.gc-csh-off--main .gc-csh-ob { background: var(--gccsh-sienna); color: #FFF8F3; }
.gc-csh-off--main .gc-csh-ob:hover { background: var(--gccsh-sienna-deep); }
.gc-csh-off--alt .gc-csh-ob {
    background: none;
    border: 1.5px solid var(--gccsh-line);
    color: var(--gccsh-ink);
}
.gc-csh-off--alt .gc-csh-ob:hover { border-color: var(--gccsh-ink-faint); }

.gc-csh-foot {
    padding: 12px 22px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--gccsh-line-soft);
    background: var(--gccsh-paper);
}
/* Scroll affordance: the body overflows on small viewports — a shadow over the
   footer boundary signals more content beneath (class set at open()). */
.gc-csh--overflow .gc-csh-foot {
    box-shadow: 0 -14px 18px -12px rgba(43, 38, 32, .22);
    position: relative;
    z-index: 1;
}
.gc-csh-mbg {
    font-size: 11.5px;
    color: var(--gccsh-ink-soft);
    display: flex;
    gap: 6px;
    align-items: baseline;
}
.gc-csh-mbg::before { content: "✓"; color: var(--gccsh-forest); font-weight: 700; }
.gc-csh-micro {
    font-family: var(--gccsh-mono);
    font-size: 9px;
    color: var(--gccsh-ink-faint);
    margin-top: 5px;
}

/* ── Mobile: bottom sheet ── */
@media (max-width: 720px) {
    .gc-csh {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 88%;
        border-left: none;
        border-top: 1px solid var(--gccsh-line);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -18px 50px -14px rgba(43, 38, 32, .4);
        transform: translateY(36px);
    }
    .gc-csh-root.gc-csh--in .gc-csh { transform: none; }
    .gc-csh-drag {
        display: block;
        width: 38px;
        height: 4px;
        border-radius: 99px;
        background: var(--gccsh-line);
        margin: 9px auto 0;
        flex-shrink: 0;
    }
    .gc-csh-hero h2 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .gc-csh-backdrop, .gc-csh { transition: none; }
}
