/* Leadership Cards - cards.stone-leadership.com
   The livery is the Stone Leadership theme (navy #002b41, the logo pink as an accent, Barlow 600
   headings, square buttons, the diagonal cut with a pink stripe). The cards themselves keep the
   printed design: Lato, the six category colours, and every size given in cqi (1% of the card's
   width) so the card on screen is the printed A6 card scaled, and its text fits the same way. */

/* --- Fonts, self-hosted ------------------------------------------------------------------------ */
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('../fonts/barlow-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('../fonts/barlow-500-latin.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('../fonts/barlow-600-latin.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-display: swap; src: url('../fonts/barlow-700-latin.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 300; font-display: swap; src: url('../fonts/lato-300-latin.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 400; font-display: swap; src: url('../fonts/lato-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 700; font-display: swap; src: url('../fonts/lato-700-latin.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 900; font-display: swap; src: url('../fonts/lato-900-latin.woff2') format('woff2'); }

:root {
    --ink: #002b41;
    --ink-soft: #3f6172;
    --muted: #758f9d;
    --line: #dce3e7;
    --ground: #f3f3f3;
    --surface: #ffffff;
    --navy: #002b41;
    --navy-strong: #01405f;
    --navy-deep: #001a28;
    --pink: #de3163;
    --pink-strong: #bf2452;
    --pink-soft: #f7a8bf;
    --on-navy: #d5e0e6;
    --font: 'Barlow', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --card-font: 'Lato', "Segoe UI", sans-serif;
    --radius: 2px;
    --gutter: clamp(1rem, 3vw, 2.5rem);
    --page: 68rem;
    --focus: 2px solid var(--pink);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--ground);
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { font-weight: 600; line-height: 1.3; text-wrap: balance; margin: 0; }
img { max-width: 100%; }
a { color: var(--ink); text-underline-offset: 0.15em; }
a:hover { color: var(--pink); }
:where(a[href], button, [tabindex]:not([tabindex="-1"])):focus-visible { outline: var(--focus); outline-offset: 2px; }
.draw:focus { outline: none; }

.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; top: 1rem; }

/* --- Buttons: navy fill and the inverse outline, square, as on her site ----------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    padding: .7rem 1.3rem;
    border-radius: var(--radius);
    border: 1px solid var(--navy);
    background: var(--navy);
    color: #fff;
    font: inherit; font-weight: 500; line-height: 1.3;
    text-decoration: none; cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--navy-strong); border-color: var(--navy-strong); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--navy); }
.btn-secondary:hover { background: var(--navy); color: #fff; }
.btn-sm { padding: .45rem .9rem; font-size: 1rem; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: .15em; cursor: pointer; }
.btn-link:hover { color: var(--pink); }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.button-row.center { justify-content: center; }

.eyebrow {
    display: block;
    font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    color: var(--pink-soft);
    margin-bottom: .75rem;
}
.eyebrow-dark { color: var(--pink); }

/* --- Header ---------------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; gap: 1.5rem; padding: .75rem var(--gutter); }
.site-header .brand { display: flex; flex: 0 0 auto; }
.site-header .brand img { display: block; height: 2.6rem; width: auto; }
.site-header .spacer { flex: 1; }
@media (max-width: 30rem) { .site-header .brand img { height: 2rem; } .site-header .btn-sm { padding: .4rem .7rem; } }

/* --- Hero: the navy panel for the words, a deck of cards fanned on the right, and the diagonal
       cut between them carrying the pink stripe --------------------------------------------------- */
.hero {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: clamp(30rem, 70vh, 42rem);
    background: var(--navy);
    color: #fff;
    overflow: hidden;
}
.hero-panel { display: flex; align-items: center; padding: 4rem clamp(1.5rem, 5vw, 5rem); position: relative; z-index: 1; }
.hero-text { max-width: 34rem; margin-left: auto; }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3rem); line-height: 1.12; letter-spacing: -.01em; margin-bottom: 1.25rem; }
.hero-sub { color: var(--on-navy); font-size: 1.25rem; margin: 0 0 1.25rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0 0 2rem; color: #fff; font-weight: 600; }
.hero-facts span::before { content: ""; display: inline-block; width: .5rem; height: .5rem; background: var(--pink); margin-right: .55rem; vertical-align: .12em; }
.hero .btn-primary { background: var(--pink); border-color: var(--pink); }
.hero .btn-primary:hover { background: var(--pink-strong); border-color: var(--pink-strong); }
.hero .btn-secondary { background: transparent; border-color: rgba(255, 255, 255, .7); color: #fff; }
.hero .btn-secondary:hover { background: #fff; border-color: #fff; color: var(--navy); }

.hero-deck {
    position: relative;
    margin-left: -7rem;
    background: radial-gradient(120% 90% at 60% 55%, #0b5478 0%, var(--navy-strong) 45%, var(--navy-deep) 100%);
    clip-path: polygon(7rem 0, 100% 0, 100% 100%, 0 100%);
    display: grid; place-items: center;
    padding: 3rem 2rem 3rem 8rem;
}
.hero-deck::before {
    content: ""; position: absolute; inset: 0; background: var(--pink);
    clip-path: polygon(7rem 0, calc(7rem + 10px) 0, 10px 100%, 0 100%);
}
.fan { position: relative; width: clamp(11rem, 17vw, 15rem); aspect-ratio: 105 / 148; }
.fan .card { position: absolute; inset: 0; width: 100%; transform-origin: 50% 110%; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55); }
.fan .card:nth-child(1) { transform: translateX(-38%) rotate(-14deg); }
.fan .card:nth-child(2) { transform: translateY(-4%); }
.fan .card:nth-child(3) { transform: translateX(38%) rotate(14deg); }
@media (prefers-reduced-motion: no-preference) {
    .fan .card { animation: deal .9s cubic-bezier(.2, .8, .2, 1) both; }
    .fan .card:nth-child(1) { animation-delay: .1s; }
    .fan .card:nth-child(2) { animation-delay: .25s; }
    .fan .card:nth-child(3) { animation-delay: .4s; }
}
@keyframes deal { from { opacity: 0; transform: translateY(30%) rotate(0); } }

@media (max-width: 56rem) {
    .hero { grid-template-columns: 1fr; min-height: 0; }
    .hero-text { margin-left: 0; }
    .hero-panel { padding: 3rem var(--gutter) 2.5rem; }
    .hero-deck {
        margin: -2.5rem 0 0; height: 21rem; padding: 4rem 1rem 2rem;
        clip-path: polygon(0 2.5rem, 100% 0, 100% 100%, 0 100%);
    }
    .hero-deck::before { clip-path: polygon(0 2.5rem, 100% 0, 100% 8px, 0 calc(2.5rem + 8px)); }
    .fan { width: 9.5rem; }
}

/* --- The draw ---------------------------------------------------------------------------------- */
.draw { padding: 4.5rem var(--gutter) 4rem; text-align: center; scroll-margin-top: 4rem; }
.draw-head { max-width: 40rem; margin: 0 auto 2.25rem; }
.draw h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
.filter-note { margin: .75rem 0 0; color: var(--ink-soft); font-size: 1rem; }
.filter-note strong { color: var(--ink); }
.filter-note .btn-link { margin-left: .6rem; }

.table { display: flex; justify-content: center; perspective: 1800px; }
.scene { width: min(25rem, 92vw); transition: transform .28s ease, opacity .28s ease; }
.scene.out { opacity: 0; transform: translateX(-12%) rotate(-4deg); }
.scene.in { opacity: 0; transform: translateX(12%) rotate(4deg); transition: none; }

.flip {
    position: relative; display: block; width: 100%; aspect-ratio: 105 / 148;
    padding: 0; border: 0; background: none; cursor: pointer; color: inherit; font: inherit;
    transform-style: preserve-3d;
    transition: transform .7s cubic-bezier(.3, .7, .2, 1);
    border-radius: 4.5%/3.2%;
}
.flip.flipped { transform: rotateY(180deg); }
.flip.instant { transition: none; }

.face { position: absolute; inset: 0; display: block; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face-back { transform: rotateY(180deg); }
@media (prefers-reduced-motion: reduce) { .flip, .scene { transition: none; } }

.flip-hint { margin: 1.5rem 0 1.25rem; color: var(--muted); font-size: 1rem; }
.flip-hint i { margin-right: .3rem; }
.card-meta { margin: 1.25rem 0 0; color: var(--muted); font-size: .9375rem; min-height: 1.5em; }

/* --- The card, as printed ---------------------------------------------------------------------- */
.card {
    container-type: inline-size;
    display: block;
    width: 100%;
    aspect-ratio: 105 / 148;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--card-font);
    border-radius: 4.5%/3.2%;
    box-shadow: 0 1px 2px rgba(0, 43, 65, .08), 0 22px 45px -20px rgba(0, 43, 65, .45);
    overflow: hidden;
    position: relative;
    text-align: center;
}
.card .safe { position: absolute; inset: 5.7cqi; display: flex; flex-direction: column; }
.card .front-safe { align-items: center; }
.card .brand-line { font-size: 2.69cqi; letter-spacing: .22em; text-transform: uppercase; opacity: .85; margin-top: 1cqi; }
.card .cat { font-size: 5.71cqi; font-weight: 300; margin-top: 2.4cqi; line-height: 1.1; }
.card .icon {
    width: 28.6cqi; height: 28.6cqi; border-radius: 50%; margin-top: 8.6cqi; flex: none;
    display: grid; place-items: center; font-size: 14.3cqi;
    background: color-mix(in srgb, var(--fg) 14%, transparent);
}
.card .topic { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; padding: 1.9cqi 0; }
.card .topic h3 { font-family: var(--card-font); font-size: 8.4cqi; font-weight: 900; line-height: 1.05; }
.card .topic p { font-size: 4.7cqi; line-height: 1.25; margin: 3.8cqi 0 0; }
.card .badge {
    width: 21.9cqi; height: 21.9cqi; flex: none; border-radius: 3.33cqi; background: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.card .badge img { width: 11.4cqi; height: auto; display: block; }
.card .badge span { font-size: 1.88cqi; letter-spacing: .12em; margin-top: 1cqi; color: var(--pink); }

.card .back-safe { text-align: left; }
.card .fit { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; font-size: 3.36cqi; line-height: 1.28; }
.card .points { list-style: none; margin: 0; padding: 0; }
.card .points li { margin-bottom: .75em; }
.card .points b { font-weight: 900; display: block; }
.card .watch { margin-top: auto; padding: 2.5cqi 2.9cqi; border-radius: 1.9cqi; background: color-mix(in srgb, var(--fg) 13%, transparent); }
.card .watch-title { font-weight: 900; font-size: 1.15em; margin-bottom: .25em; }
.card .watch-title i { font-size: .9em; margin-right: .3em; }
.card .watch p { font-weight: 700; margin: 0; }
.card .foot {
    flex: none; display: flex; justify-content: space-between; align-items: center; gap: 3.8cqi;
    font-size: 2.1cqi; letter-spacing: .08em; text-transform: uppercase; opacity: .8;
    padding-top: 2.1cqi; margin-top: 2.4cqi;
    border-top: max(1px, .24cqi) solid color-mix(in srgb, var(--fg) 35%, transparent);
}
.card .foot i { margin-right: .4em; }

/* --- How to use them ---------------------------------------------------------------------------- */
.inner { max-width: var(--page); margin: 0 auto; }
.how { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4rem var(--gutter); }
.how h2, .categories h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); margin-bottom: 2rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem; counter-reset: step; }
.steps li {
    position: relative; padding: 1.5rem 1.5rem 1.6rem; background: var(--ground);
    border-top: 1px solid var(--pink); border-left: 1px solid var(--pink);
}
.steps li > i { font-size: 1.6rem; color: var(--pink); margin-bottom: .9rem; display: block; }
.steps h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 1rem; }

/* --- Categories --------------------------------------------------------------------------------- */
.categories { padding: 4rem var(--gutter) 4.5rem; }
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 56rem) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 34rem) { .cat-grid { grid-template-columns: 1fr; } }
.cat-tile {
    width: 100%; height: 100%; text-align: left; cursor: pointer;
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 1rem; row-gap: .1rem;
    padding: 1.2rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink); font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.cat-tile:hover { border-color: var(--bg); box-shadow: 0 10px 24px -16px rgba(0, 43, 65, .5); transform: translateY(-2px); }
.cat-swatch { grid-row: 1 / span 3; width: 2.6rem; aspect-ratio: 105 / 148; border-radius: 4px; background: var(--bg); align-self: center; box-shadow: 0 2px 6px -2px rgba(0,0,0,.35); }
.cat-name { font-weight: 600; font-size: 1.125rem; line-height: 1.3; }
.cat-count { color: var(--muted); font-size: .9375rem; }
.cat-go { color: var(--pink); font-size: .9375rem; font-weight: 600; }
.cat-go i { margin-left: .25rem; transition: transform .15s ease; }
.cat-tile:hover .cat-go i { transform: translateX(3px); }

/* --- Footer: her navy, so the page has a floor ----------------------------------------------- */
.site-footer { background: var(--navy); color: #c9d8e0; font-size: .9375rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; align-items: center; justify-content: space-between; padding: 2rem var(--gutter); }
.footer-brand { display: flex; gap: .75rem; align-items: center; }
.footer-brand img { width: 2.5rem; height: 2.5rem; border-radius: 999px; background: #fff; padding: .3rem; }
.footer-brand div { display: flex; flex-direction: column; line-height: 1.25; }
.footer-brand strong { color: #fff; font-weight: 600; font-size: 1.25rem; }
.footer-brand span { color: #8fa9b7; font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; }
.footer-link { color: #c9d8e0; text-decoration: none; }
.footer-link:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--pink); }
.footer-link i { font-size: .8em; margin-left: .25rem; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .12); padding: 1rem var(--gutter); color: #8fa9b7; font-size: .8125rem; }

@media (max-width: 47.9375rem) {
    body { font-size: 1rem; }
    .hero-sub { font-size: 1.125rem; }
    .draw { padding-top: 3rem; }
}

/* --- Dealt by the API: the deck's cover, loading, disabled ----------------------------------- */
.btn:disabled, .btn:disabled:hover { background: var(--ground); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.flip { touch-action: pan-y; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.flip.loading .face-front .card { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .flip.loading .face-front .card { animation: none; } }

.card-cover { --bg: var(--pink); --fg: var(--pink); }
.card-cover .cover-panel {
    position: absolute; inset: 6.5cqi; background: #fff; border-radius: 5.5cqi;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4cqi;
    padding: 8cqi 7cqi; color: var(--pink); text-align: center;
}
.card-cover .cover-title { font-size: 10cqi; font-weight: 900; line-height: 1.05; text-wrap: balance; }
.card-cover .cover-text { font-size: 4.4cqi; line-height: 1.35; margin: 0; color: var(--ink-soft); }
.card-cover .cover-logo { width: 16cqi; margin-top: 4cqi; }
.card-cover .cover-name { font-size: 2.4cqi; letter-spacing: .12em; margin-top: -3cqi; }

/* --- Phones ---------------------------------------------------------------------------------
   The printed back scaled to a phone's width would be about 11px text. Instead the back keeps
   a readable size and scrolls inside the card, with a fade at the bottom while there is more. */
@media (max-width: 34rem) {
    .scene { width: min(25rem, calc(100vw - 2rem)); }
    .draw { padding-left: 1rem; padding-right: 1rem; }
    .card .fit {
        font-size: 4.1cqi; line-height: 1.32;
        overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
        user-select: text; -webkit-user-select: text;
    }
    .card .watch { margin-top: 1.2em; }
    .card .fit.scrolls:not(.at-end) { -webkit-mask-image: linear-gradient(#000 85%, transparent); mask-image: linear-gradient(#000 85%, transparent); }
    .card .foot { font-size: 2.6cqi; }
    .button-row.center .btn { flex: 1 1 9rem; min-height: 3rem; }
    .flip-hint { margin-top: 1.1rem; }
}

/* --- How to get access: below the hero, in the place the card takes once signed in. Two cards
       from the deck on the left, the words on a white panel with her pink corner edges ------------- */
.access {
    max-width: 58rem; margin: 0 auto; text-align: left;
    display: grid; grid-template-columns: 17rem 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center;
}
.access-deck { position: relative; width: 13rem; aspect-ratio: 105 / 148; justify-self: center; }
.access-deck .card { position: absolute; inset: 0; box-shadow: 0 18px 40px -16px rgba(0, 43, 65, .55); }
.access-deck .card:nth-child(1) { transform: translateX(-16%) rotate(-9deg); }
.access-deck .card:nth-child(2) { transform: translateX(16%) rotate(6deg); }
.access-box {
    background: var(--surface); padding: clamp(1.75rem, 4vw, 2.75rem);
    border-top: 1px solid var(--pink); border-left: 1px solid var(--pink);
    box-shadow: 0 20px 45px -30px rgba(0, 43, 65, .45);
}
.access-box h2 { margin-bottom: 1rem; }
.access-box p { margin: 0 0 1rem; color: var(--ink-soft); }
.access-box h3 { font-size: 1.2rem; margin: 1.75rem 0 .4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.access-box a { font-weight: 600; }
.access-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.5rem !important; }
.access-cta span { flex: 1 1 14rem; font-size: 1rem; }
.access .btn-primary { background: var(--pink); border-color: var(--pink); min-height: 3rem; }
.access .btn-primary:hover { background: var(--pink-strong); border-color: var(--pink-strong); }

/* --- The sign-in: a dialog in the middle of the screen, the page dimmed behind it --------------- */
.signin-modal {
    width: min(34rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 0; margin: auto;
    border: 0; border-top: 3px solid var(--pink); border-radius: var(--radius);
    background: var(--surface); color: var(--ink);
    box-shadow: 0 30px 70px -20px rgba(0, 26, 40, .6);
    overflow: auto; overscroll-behavior: contain;
}
.signin-modal::backdrop { background: rgba(0, 26, 40, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-body { position: relative; padding: clamp(1.75rem, 5vw, 2.5rem); text-align: left; }
.modal-body h2 { font-size: clamp(1.5rem, 4vw, 1.9rem); margin-bottom: 1rem; padding-right: 2.5rem; }
.modal-close {
    position: absolute; top: .75rem; right: .75rem; width: 2.75rem; height: 2.75rem;
    display: grid; place-items: center; background: none; border: 0; border-radius: var(--radius);
    font-size: 1.4rem; color: var(--ink-soft); cursor: pointer;
}
.modal-close:hover { color: var(--pink); background: var(--ground); }
@media (prefers-reduced-motion: no-preference) {
    .signin-modal[open] { animation: modal-in .22s ease-out; }
    .signin-modal[open]::backdrop { animation: fade-in .22s ease-out; }
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
body:has(.signin-modal[open]) { overflow: hidden; }
.form-lead { margin: 0 0 1.25rem; color: var(--ink-soft); }
.form-lead strong { color: var(--ink); overflow-wrap: anywhere; }
.signin-modal label, .admin label { display: block; font-weight: 600; font-size: 1rem; margin-bottom: .4rem; }
.field-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.field-row input { flex: 1 1 14rem; min-width: 0; }
input[type="email"], input[type="text"], input[type="search"], textarea {
    font: inherit; color: var(--ink); background: var(--surface);
    border: 1px solid #a9bac4; border-radius: var(--radius); padding: .65rem .85rem; min-height: 3rem;
}
input:focus-visible, textarea:focus-visible { outline: var(--focus); outline-offset: 0; border-color: var(--pink); }
#code { letter-spacing: .3em; font-weight: 600; font-variant-numeric: tabular-nums; max-width: 12rem; flex: 0 1 12rem; }
.signin-modal .btn-primary, .admin .btn-primary { background: var(--pink); border-color: var(--pink); min-height: 3rem; }
.signin-modal .btn-primary:hover, .admin .btn-primary:hover { background: var(--pink-strong); border-color: var(--pink-strong); }
form.busy .btn-primary { opacity: .7; cursor: progress; }
.form-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 1rem 0 0; font-size: 1rem; }
.form-message { margin: 1.25rem 0 0; padding: .85rem 1rem; font-size: 1rem; border-left: 3px solid var(--pink); background: #fdf0f4; }
.form-message.info { border-left-color: var(--navy); background: #edf3f6; }
.form-message a { font-weight: 600; }
.form-note { margin: 1.5rem 0 0; font-size: .9375rem; color: var(--muted); }
.form-note i { margin-right: .35rem; }
.account-line { margin: .5rem 0 0; color: var(--muted); font-size: .9375rem; }
.account-line strong { color: var(--ink-soft); font-weight: 500; overflow-wrap: anywhere; }
.account-line .btn-link { margin-left: .5rem; color: var(--ink-soft); }

@media (max-width: 47.9375rem) {
    .access { grid-template-columns: 1fr; gap: 1.5rem; }
    .access-deck { width: 7.5rem; margin-bottom: .5rem; }
    .access-box { padding: 1.5rem 1.25rem; }
    .access-cta .btn { flex: 1 1 100%; }
    .field-row .btn { flex: 1 1 100%; }
    #code { max-width: none; flex: 1 1 100%; }
}

/* Header account links */
.account { display: flex; align-items: center; gap: 1.25rem; }
.account-link { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 0; padding: .3rem 0; font: inherit; font-size: 1rem; color: var(--ink-soft); text-decoration: none; cursor: pointer; }
.account-link:hover { color: var(--pink); }
.account[hidden], [hidden] { display: none !important; }
@media (max-width: 40rem) {
    .site-header .bar { gap: 1rem; }
    .account-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .account-link { font-size: 1.25rem; padding: .3rem; }
    .account { gap: .5rem; }
}
@media (max-width: 30rem) { .header-draw { display: none; } }

/* --- Admin page ------------------------------------------------------------------------------ */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.admin-page { display: flex; flex-direction: column; min-height: 100vh; }
.admin { flex: 1; padding: 3rem var(--gutter) 4rem; }
.admin .inner { max-width: 56rem; }
.admin h1 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); margin-bottom: 1rem; }
.admin-intro { color: var(--ink-soft); margin: 0 0 2rem; max-width: 42rem; }
.admin-gate { padding: 1.25rem 1.4rem; background: var(--surface); border-left: 3px solid var(--navy); }
.admin-box { background: var(--surface); padding: clamp(1.25rem, 3vw, 2rem); margin-bottom: 1.75rem; border-top: 1px solid var(--pink); border-left: 1px solid var(--pink); }
.admin-box h2 { font-size: 1.375rem; margin-bottom: 1rem; }
.admin textarea { display: block; width: 100%; resize: vertical; min-height: 7rem; }
.field-help { color: var(--muted); font-size: .9375rem; margin: .5rem 0 1rem; }
.list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem; }
.list-head .count { color: var(--muted); font-weight: 500; }
#search { width: 100%; margin-bottom: 1rem; }
.users { width: 100%; border-collapse: collapse; font-size: 1rem; }
.users th { text-align: left; font-weight: 600; font-size: .875rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: .5rem .75rem .5rem 0; border-bottom: 1px solid var(--line); }
.users td { padding: .7rem .75rem .7rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.users .email { overflow-wrap: anywhere; font-weight: 500; }
.users .muted { color: var(--muted); }
.users .actions { text-align: right; white-space: nowrap; padding-right: 0; }
.users .remove { color: var(--ink-soft); font-size: .9375rem; }
.users .remove:hover { color: var(--pink-strong); }
.admin .empty { color: var(--muted); margin: .5rem 0 1rem; }
.admin-page .site-footer { margin-top: auto; }
@media (max-width: 40rem) {
    .users thead { display: none; }
    .users, .users tbody, .users tr, .users td { display: block; width: 100%; }
    .users tr { padding: .75rem 0; border-bottom: 1px solid var(--line); }
    .users td { border: 0; padding: .1rem 0; font-size: .9375rem; }
    .users td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); }
    .users .actions { text-align: left; padding-top: .4rem; }
}

/* --- Signed in: a short hero, so the card sits on the first screen, with the category picker
       beside it. Signed out, the full hero and the sections below stay as they are. ------------- */
.title-short, .hero-line { display: none; }
.signed-in .hero { grid-template-columns: 1fr minmax(8rem, 24rem); min-height: 0; }
.signed-in .hero-panel { padding: 1.25rem clamp(1.5rem, 5vw, 5rem) 1.4rem; }
.signed-in .hero-text { max-width: 40rem; }
@media (min-width: 56.0625rem) {
    .signed-in .hero-panel { padding-left: var(--pick-left, clamp(1.5rem, 5vw, 5rem)); padding-right: 2rem; }
    .signed-in .hero-text { margin-left: 0; }
}
.signed-in .hero .eyebrow, .signed-in .title-full, .signed-in .hero-sub, .signed-in .hero-facts, .signed-in .fan { display: none; }
.signed-in .title-short { display: inline; }
.signed-in .hero h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); margin-bottom: .3rem; }
.signed-in .hero-line { display: block; color: var(--on-navy); margin: 0 0 .9rem; }
.signed-in .hero .btn { padding: .55rem 1.1rem; }
.signed-in .hero-deck { padding: 0; }
.signed-in .categories, .signed-in .header-draw { display: none; }
.signed-in .draw { padding-top: 1.5rem; padding-bottom: 2.5rem; }

.deal-grid { display: grid; grid-template-columns: minmax(16rem, 21rem) auto; justify-content: center; align-items: start; gap: clamp(2rem, 5vw, 4.5rem); }
.deal-main { min-width: 0; }
.picker { text-align: left; padding-top: .25rem; }
.pick-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pick-tile, .pick-all {
    width: 100%; height: 100%; cursor: pointer; font: inherit; color: var(--ink); text-align: left;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.pick-tile {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .7rem;
    align-content: center; padding: .7rem .75rem; min-height: 4.6rem;
}
.pick-tile .cat-swatch { grid-row: 1 / span 2; width: 1.5rem; }
.pick-name { font-weight: 600; font-size: .9375rem; line-height: 1.25; }
.pick-count { color: var(--muted); font-size: .8125rem; }
.pick-tile:hover { border-color: var(--bg); box-shadow: 0 8px 20px -14px rgba(0, 43, 65, .5); }
.pick-tile[aria-pressed="true"] { border-color: var(--bg); box-shadow: inset 0 0 0 1px var(--bg); background: color-mix(in srgb, var(--bg) 9%, var(--surface)); }
.pick-all { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: .6rem; padding: .65rem; font-weight: 600; font-size: .9375rem; }
.pick-all:hover { border-color: var(--navy); }
.pick-all[aria-pressed="true"] { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: #edf3f6; }
.pick-tile:disabled, .pick-all:disabled { cursor: progress; }
.deal .filter-note { display: none; }

/* The card is sized from the screen's height, so it and its buttons fit below the short hero. */
.signed-in .scene { width: clamp(17rem, calc((100svh - 24rem) * 105 / 148), 25rem); }
.signed-in .flip-hint { margin: .8rem 0 .7rem; }

@media (max-width: 56rem) {
    .signed-in .hero { grid-template-columns: 1fr; }
    .signed-in .hero-deck { display: none; }
    .signed-in .hero-panel { padding: 1.4rem var(--gutter) 1.5rem; }
    .deal-grid { grid-template-columns: 1fr; gap: 2rem; }
    .picker { order: 2; max-width: 34rem; width: 100%; justify-self: center; }
    .deal .filter-note { display: block; margin: 0 0 1rem; }
    .signed-in .scene { width: min(25rem, calc(100vw - 2rem)); }
}
