/* BudTrader design tokens and base components.
   Single source: shared/bt-base.css. The build copies it into the theme and (from Phase 1B) the core plugin, and
   tools/parity.py fails if a copy differs.
   The greens come from the logo: "Bud" is #009349 and "Trader" is #22BE73. The logo is never recolored. White text on
   #009349 is 3.99:1, under the 4.5:1 that labels need, so light-mode actions use it deepened by 10% (#008442, 4.80:1) and
   links by 20% (#00763A, 5.25:1 even on the soft background). The bright green is used as it is in dark mode and on
   dark bands (7.5:1). Color carries meaning and is never swapped: green = BudTrader and actions, permit blue = license
   and compliance status, placard amber = paid placement and warnings. */
:root{
  --bt-paper:#FFFFFF;--bt-bond:#F4F5F2;--bt-carbon:#1D2622;--bt-band:#16201C;
  --bt-logo-deep:#009349;--bt-logo-bright:#22BE73;
  --bt-brand:#008442;--bt-brand-ink:#FFFFFF;--bt-permit:#1F4E8C;--bt-placard:#8A5200;
  --bt-bg:var(--bt-paper);--bt-bg-soft:var(--bt-bond);--bt-surface:#FFFFFF;--bt-text:var(--bt-carbon);--bt-muted:#55625B;
  --bt-line:#D8DDD6;--bt-ctl-line:#7F8A83;--bt-accent:var(--bt-brand);--bt-accent-ink:var(--bt-brand-ink);--bt-accent-soft:#E5F4EC;--bt-link:#00763A;
  --bt-permit-soft:#E8EFF8;--bt-placard-soft:#FFF3DC;--bt-error:#A8281F;--bt-error-soft:#FBEAE8;
  --bt-band-text:#E7ECE8;--bt-band-muted:#A9B5AF;--bt-band-line:#2C3933;--bt-band-accent:#22BE73;--bt-band-accent-ink:#06170E;
  --bt-r-tag:3px;--bt-r-ctl:6px;--bt-r-box:10px;
  --bt-shadow:0 1px 2px rgba(22,32,28,.08),0 10px 28px rgba(22,32,28,.08);
  --bt-font:"Public Sans",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --bt-display:"Outfit","Avenir Next","Century Gothic",var(--bt-font);
  --bt-focus:#0B57D0;
}
/* Dark tokens appear twice on purpose: once for the explicit toggle, once for visitors whose browser asks for dark and
   whose script has not run. tools/parity.py checks that the two blocks are identical. */
:root[data-theme="dark"]{
  --bt-bg:#111614;--bt-bg-soft:#171D1A;--bt-surface:#1B2320;--bt-text:#E7ECE8;--bt-muted:#A5B1AB;
  --bt-line:#2A3530;--bt-ctl-line:#73807A;--bt-accent:#22BE73;--bt-accent-ink:#06170E;--bt-accent-soft:#11291C;--bt-link:#22BE73;
  --bt-permit:#9CC2F5;--bt-permit-soft:#15202E;--bt-placard:#F0B55A;--bt-placard-soft:#2A2110;--bt-error:#FF9388;--bt-error-soft:#2E1614;
  --bt-band:#0C110F;--bt-shadow:0 1px 2px rgba(0,0,0,.45),0 12px 32px rgba(0,0,0,.4);--bt-focus:#8AB4F8;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bt-bg:#111614;--bt-bg-soft:#171D1A;--bt-surface:#1B2320;--bt-text:#E7ECE8;--bt-muted:#A5B1AB;
  --bt-line:#2A3530;--bt-ctl-line:#73807A;--bt-accent:#22BE73;--bt-accent-ink:#06170E;--bt-accent-soft:#11291C;--bt-link:#22BE73;
  --bt-permit:#9CC2F5;--bt-permit-soft:#15202E;--bt-placard:#F0B55A;--bt-placard-soft:#2A2110;--bt-error:#FF9388;--bt-error-soft:#2E1614;
  --bt-band:#0C110F;--bt-shadow:0 1px 2px rgba(0,0,0,.45),0 12px 32px rgba(0,0,0,.4);--bt-focus:#8AB4F8;
}}
.screen-reader-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.bt-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.bt-no-scroll{overflow:hidden}
[class^="bt-"],[class^="bt-"] *{box-sizing:border-box}
:where(a,button,summary,input,select,textarea):focus-visible{outline:3px solid var(--bt-focus);outline-offset:2px;border-radius:4px}

/* Buttons: squared and stamped, never pills. Every target is at least 44px tall, including the small size. */
.bt-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:48px;padding:.6rem 1.2rem;border-radius:var(--bt-r-ctl);border:1.5px solid transparent;font:600 1rem/1.2 var(--bt-font);text-decoration:none;cursor:pointer;transition:background-color .15s,border-color .15s,color .15s}
.bt-btn--primary{background:var(--bt-accent);color:var(--bt-accent-ink)}
.bt-btn--primary:hover{background:color-mix(in srgb,var(--bt-accent) 86%,#000)}
.bt-btn--ghost{background:transparent;color:var(--bt-text);border-color:var(--bt-ctl-line)}
.bt-btn--ghost:hover{border-color:var(--bt-accent);color:var(--bt-link)}
.bt-btn--block{display:flex;width:100%}
.bt-btn--sm{min-height:44px;padding:.4rem .85rem;font-size:.875rem}
.bt-btn:active{transform:translateY(1px)}
.bt-btn[disabled]{opacity:.55;cursor:progress}
.bt-link{background:none;border:0;padding:0;color:var(--bt-link);font:inherit;text-decoration:underline;text-underline-offset:.15em;cursor:pointer}

/* Fields. Control borders meet the 3:1 non-text contrast rule; decorative hairlines use --bt-line. */
.bt-field{display:grid;gap:.35rem;min-width:0;border:0;padding:0;margin:0;align-content:start}
.bt-field__label{font:600 .875rem/1.3 var(--bt-font);color:var(--bt-text)}
.bt-field__help{font-size:.875rem;color:var(--bt-muted);margin:0}
.bt-field input,.bt-field select,.bt-field textarea{width:100%;min-height:48px;padding:.6rem .75rem;border:1.5px solid var(--bt-ctl-line);border-radius:var(--bt-r-ctl);background:var(--bt-surface);color:var(--bt-text);font:400 1rem/1.4 var(--bt-font)}
.bt-field input:hover,.bt-field select:hover,.bt-field textarea:hover{border-color:var(--bt-text)}
.bt-field [aria-invalid="true"]{border-color:var(--bt-error)}
.bt-check{display:flex;gap:.6rem;align-items:flex-start;font-size:.95rem;line-height:1.45}
.bt-check input{width:1.15rem;height:1.15rem;margin-top:.15rem;accent-color:var(--bt-accent);flex:none}

/* Notices and tags */
.bt-notice{padding:.85rem 1rem;border-radius:var(--bt-r-ctl);background:var(--bt-placard-soft);color:var(--bt-text);border-left:4px solid var(--bt-placard)}
.bt-notice--ok{background:var(--bt-accent-soft);border-left-color:var(--bt-accent)}
.bt-notice--permit{background:var(--bt-permit-soft);border-left-color:var(--bt-permit)}
.bt-tag{display:inline-flex;align-items:center;gap:.35rem;padding:.15rem .5rem;border-radius:var(--bt-r-tag);border:1px solid currentColor;font:600 .8rem/1.4 var(--bt-font);white-space:nowrap}
.bt-tag--permit{color:var(--bt-permit);background:var(--bt-permit-soft)}
.bt-tag--paid{color:var(--bt-placard);background:var(--bt-placard-soft)}
.bt-disclaimer{font-size:.875rem;line-height:1.55;color:var(--bt-muted);max-width:75ch}
.bt-intro{font-size:clamp(1.05rem,2.2vw,1.22rem);line-height:1.55;color:var(--bt-muted);max-width:none}

/* Tiles: two-up on phones so a long list never becomes a long stack. Flex rather than grid, so whatever the count, the
   last row's tiles widen to fill the row and no tile is ever left stranded beside a hole. */
.bt-tiles{list-style:none;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:.6rem}
.bt-tiles>li{flex:1 1 calc(50% - .3rem);min-width:0}
.bt-tile{display:flex;align-items:center;min-height:48px;height:100%;padding:.6rem .8rem;border:1px solid var(--bt-line);border-radius:var(--bt-r-ctl);background:var(--bt-surface);color:var(--bt-text);text-decoration:none;font-weight:600;font-size:.875rem;line-height:1.3}
.bt-tile{transition:border-color .15s,color .15s;min-width:0;overflow-wrap:anywhere}
.bt-tile>span{min-width:0}
.bt-tile:hover{border-color:var(--bt-accent);color:var(--bt-link)}
@media (min-width:700px){.bt-tiles>li{flex-basis:calc(33.333% - .4rem)}.bt-tile{min-height:52px;padding:.7rem 1rem;font-size:.95rem}}
@media (min-width:1000px){.bt-tiles>li{flex-basis:calc(25% - .45rem)}}

/* Ruled lists: hairlines instead of boxes */
.bt-ruled{list-style:none;padding:0;margin:0;display:grid;gap:2rem 2.5rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr))}
.bt-ruled>li{border-top:2px solid var(--bt-accent);padding-top:1rem}
.bt-ruled h3{margin:0 0 .4rem;font:700 1.25rem/1.2 var(--bt-display)}
.bt-ruled p{margin:0;color:var(--bt-muted)}
/* Three items stack until three fit, so none is left beside a hole */
@media (max-width:899px){.bt-ruled--3{grid-template-columns:minmax(0,1fr)}}
@media (min-width:900px){.bt-ruled--2{grid-template-columns:repeat(2,minmax(0,1fr))}.bt-ruled--3{grid-template-columns:repeat(3,minmax(0,1fr))}.bt-ruled--4{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Cards and grids (articles now; listing cards arrive with the core plugin) */
.bt-grid{display:grid;gap:1.25rem;grid-template-columns:repeat(auto-fill,minmax(min(100%,18rem),1fr))}
/* Small sets must never leave one card stranded: three cards go 1 then 3 across, four go 1, 2 then 4 across. */
.bt-grid:has(>:nth-child(3):last-child){grid-template-columns:minmax(0,1fr)}
@media (min-width:641px){.bt-grid:has(>:nth-child(4):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (min-width:760px){.bt-grid:has(>:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (min-width:1100px){.bt-grid:has(>:nth-child(4):last-child){grid-template-columns:repeat(4,minmax(0,1fr))}}
.bt-card{display:flex;flex-direction:column;gap:.6rem;min-width:0;padding:1.15rem;border:1px solid var(--bt-line);border-radius:var(--bt-r-box);background:var(--bt-surface)}
.bt-card__title{margin:0;font:700 1.3rem/1.18 var(--bt-display)}
.bt-card__title a{color:var(--bt-text);text-decoration:none}
.bt-card__title a:hover{color:var(--bt-link);text-decoration:underline}
.bt-card p{margin:0;color:var(--bt-muted);font-size:.95rem}
.bt-card img{border-radius:var(--bt-r-ctl);aspect-ratio:1200/630;object-fit:cover;width:100%}
.bt-card .bt-card__meta{margin-top:auto;padding-top:.35rem;font-size:.875rem}

/* FAQ: ruled, not boxed */
.bt-faq{display:grid;gap:0;max-width:52rem;border-top:1px solid var(--bt-line)}
.bt-faq details{border-bottom:1px solid var(--bt-line)}
.bt-faq summary{cursor:pointer;padding:1rem 0;min-height:48px;font:600 1.0625rem/1.4 var(--bt-font);list-style:none;display:flex;justify-content:space-between;align-items:center;gap:1rem}
.bt-faq summary::-webkit-details-marker{display:none}
.bt-faq summary::after{content:"";flex:none;width:.6rem;height:.6rem;border:solid var(--bt-link);border-width:0 2px 2px 0;transform:rotate(45deg);margin-right:.35rem;transition:transform .2s}
/* Answers open smoothly where the browser can animate to an automatic height; elsewhere they simply open. */
@supports (interpolate-size:allow-keywords){@media (prefers-reduced-motion:no-preference){.bt-faq{interpolate-size:allow-keywords}.bt-faq details::details-content{block-size:0;overflow:hidden;transition:block-size .25s ease,content-visibility .25s allow-discrete}.bt-faq details[open]::details-content{block-size:auto}}}
.bt-faq details[open] summary::after{transform:rotate(-135deg)}
.bt-faq__a{padding:0 2rem 1.15rem 0;color:var(--bt-muted)}
.bt-faq__a p{margin:0}

/* Call to action: the logo's bright green, with dark text (7.6:1). It is the one place the brand's second color is used
   at full strength, and it keeps the closing band from stacking dark on dark against the footer. */
.bt-cta{padding:clamp(2rem,6vw,3.5rem) clamp(1.25rem,5vw,3.5rem);border-radius:var(--bt-r-box);background:var(--bt-logo-bright);color:#06170E}
.bt-cta h2{margin:0 0 .6rem;font:700 clamp(1.8rem,4.4vw,2.75rem)/1.08 var(--bt-display);letter-spacing:-.012em;color:#06170E;max-width:22ch}
.bt-cta p{margin:0 0 1.5rem;max-width:58ch;color:#0B2A1A}
.bt-cta__actions{display:flex;flex-wrap:wrap;gap:.75rem}
.bt-cta .bt-btn--primary{background:#06170E;color:#fff}
.bt-cta .bt-btn--primary:hover{background:#143524}
.bt-cta .bt-btn--ghost{color:#06170E;border-color:#06170E}
.bt-cta .bt-btn--ghost:hover{background:rgba(6,23,14,.1);color:#06170E;border-color:#06170E}

/* Empty state: says what happened and what to do next */
.bt-empty{padding:clamp(1.5rem,5vw,3rem);border:1px dashed var(--bt-ctl-line);border-radius:var(--bt-r-box);background:var(--bt-bg-soft);display:grid;gap:.75rem;justify-items:start}
.bt-empty h1,.bt-empty h2{margin:0}
.bt-empty p{margin:0;color:var(--bt-muted);max-width:60ch}
.bt-empty__actions{display:flex;flex-wrap:wrap;gap:.75rem;margin-top:.5rem}

/* Every field label, listing count and search field ends in a colon; H1s capitalise every word (owner, 22 September 2026) */
.bt-field__label::after,.bt-filters .bt-field__label::after{content:":"}
.bt-stats li{display:flex;flex-direction:column-reverse}
.bt-stats li span::after{content:":"}
h1{text-transform:capitalize}

/* ---- Motion: fintech-quiet. Transforms and opacity only, 120–200ms, never a dimension change, and none at all for reduced motion ---- */
:root{--bt-ease:cubic-bezier(.2,.7,.2,1);--bt-fast:140ms;--bt-med:200ms}
.bt-btn{transition:background-color var(--bt-fast) var(--bt-ease),border-color var(--bt-fast) var(--bt-ease),color var(--bt-fast) var(--bt-ease),box-shadow var(--bt-fast) var(--bt-ease),transform var(--bt-fast) var(--bt-ease)}
.bt-btn:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,.08)}
.bt-btn:active{transform:translateY(0);box-shadow:none;transition-duration:60ms}
.bt-btn[aria-busy="true"]{position:relative;color:transparent!important;pointer-events:none}
.bt-btn[aria-busy="true"]::after{content:"";position:absolute;inset:0;margin:auto;width:1.1rem;height:1.1rem;border:2px solid currentColor;border-color:var(--bt-bg) transparent var(--bt-bg) transparent;border-radius:50%;animation:bt-spin .8s linear infinite;color:var(--bt-bg)}
.bt-btn--ghost[aria-busy="true"]::after{border-color:var(--bt-text) transparent var(--bt-text) transparent}
.bt-tile,.bt-row,.bt-item,.bt-plan,.bt-affil,.bt-tag,.bt-check input,.bt-field input,.bt-field select,.bt-field textarea,.bt-dash__nav a,.bt-seg a,.btt-menu>li>a,.btt-footer a,.btt-card,.btt-index li>div{transition:background-color var(--bt-fast) var(--bt-ease),border-color var(--bt-fast) var(--bt-ease),color var(--bt-fast) var(--bt-ease),box-shadow var(--bt-fast) var(--bt-ease),transform var(--bt-fast) var(--bt-ease)}
.bt-tile:hover,.bt-plan:hover,.btt-card:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(0,0,0,.07)}
.bt-row:hover,.bt-item:hover{background:color-mix(in srgb,var(--bt-bg-soft) 60%,transparent)}
.bt-field input:focus-visible,.bt-field select:focus-visible,.bt-field textarea:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb,var(--bt-accent) 25%,transparent);border-color:var(--bt-accent)}
.bt-notice,.bt-dash__main>section,.bt-search .bt-results,.bt-listing,.bt-store{animation:bt-rise var(--bt-med) var(--bt-ease) both}
.bt-notice{animation-duration:var(--bt-fast)}
.btt-mega.is-open,.btt-nav.is-open{animation:bt-fade var(--bt-fast) var(--bt-ease) both}
details>*:not(summary){animation:bt-rise var(--bt-fast) var(--bt-ease) both}
.bt-market__line{stroke-dasharray:2000;stroke-dashoffset:2000;animation:bt-draw 900ms var(--bt-ease) 100ms forwards}
.bt-market__dot{opacity:0;animation:bt-fade var(--bt-fast) var(--bt-ease) 700ms forwards}
.bt-stats strong{animation:bt-rise var(--bt-med) var(--bt-ease) both}
@keyframes bt-rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes bt-fade{from{opacity:0}to{opacity:1}}
@keyframes bt-spin{to{transform:rotate(360deg)}}
@keyframes bt-draw{to{stroke-dashoffset:0}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}.bt-btn:hover,.bt-tile:hover,.bt-plan:hover,.btt-card:hover{transform:none}.bt-market__line{stroke-dashoffset:0}.bt-market__dot{opacity:1}}
/* ---- No layout shift on state: constant border widths, weight never changes on selection, space reserved for validation ---- */
.bt-check{align-items:flex-start;gap:.65rem;min-height:1.8rem;padding:.2rem 0}
.bt-check input{margin-top:calc((1.45em - 1.15rem)/2);width:1.15rem;height:1.15rem}
.bt-check>span{flex:1 1 auto;min-width:0}
.bt-row--sponsored{border:1px solid var(--bt-line);box-shadow:inset 0 0 0 2px var(--bt-placard),0 0 0 4px color-mix(in srgb,var(--bt-placard) 12%,transparent)}
.bt-dash__nav a{font-weight:500}
.bt-dash__nav a[aria-current="page"]{font-weight:500;box-shadow:inset 3px 0 0 var(--bt-accent)}
.bt-seg a[aria-current="page"]{font-weight:inherit}
.bt-field{position:relative}
.bt-field__error{display:block;min-height:1.3rem;font-size:.875rem;color:var(--bt-danger,#B42318);margin-top:.25rem}
/* Checkboxes and radios are never sized like text inputs, wherever they sit (a fieldset's rule gave them 48px) */
.bt-check input[type="checkbox"],.bt-check input[type="radio"],.bt-field input[type="checkbox"],.bt-field input[type="radio"],.bt-plan h2 input[type="radio"]{min-height:0;height:1.15rem;width:1.15rem;padding:0;margin:calc((1.45em - 1.15rem)/2) 0 0}
.bt-plan h2 input[type="radio"]{margin:0}

/* Featured and sponsored placements, the quiet way: a warm tint on the card, a thin accent at its left edge, and a small
   pill that names the placement (O33 keeps every paid position labelled). No frame, no ribbon. */
.bt-row--sponsored,.bt-row--featured{border-color:color-mix(in srgb,var(--bt-placard) 28%,var(--bt-line));background:color-mix(in srgb,var(--bt-placard) 6%,var(--bt-surface));box-shadow:inset 3px 0 0 color-mix(in srgb,var(--bt-placard) 55%,transparent)}
.bt-row--sponsored:hover,.bt-row--featured:hover{background:color-mix(in srgb,var(--bt-placard) 9%,var(--bt-surface))}
.bt-row__placement{margin:0 0 .4rem}
.bt-row__placement .bt-tag--paid,.btt-ccard .bt-tag--paid,.bt-plan--marked .bt-tag--paid{display:inline-flex;align-items:center;gap:.3rem;padding:.1rem .55rem .1rem .45rem;border:0;border-radius:1rem;background:color-mix(in srgb,var(--bt-placard) 14%,var(--bt-surface));color:color-mix(in srgb,var(--bt-placard) 85%,#000);font-size:.78rem;font-weight:600;letter-spacing:.01em;text-transform:none}
.bt-row__placement .bt-tag--paid::before,.btt-ccard .bt-tag--paid::before{content:"";width:.5rem;height:.5rem;border-radius:50%;background:var(--bt-placard);flex:none}
[data-theme="dark"] .bt-row--sponsored,[data-theme="dark"] .bt-row--featured{background:color-mix(in srgb,var(--bt-placard) 12%,var(--bt-surface))}
[data-theme="dark"] .bt-row__placement .bt-tag--paid,[data-theme="dark"] .btt-ccard .bt-tag--paid{background:color-mix(in srgb,var(--bt-placard) 24%,var(--bt-surface));color:#F3D9A8}

/* Required fields: a mark after the label, and one note per form */
.bt-req{color:var(--bt-danger,#B42318);margin-left:.2rem;font-weight:700}
.bt-req-note{margin:0 0 1rem}
/* Sign-in, sign-up, forgot and reset: the form sits centred on the page with its heading above it */
.bt-auth{margin-left:auto;margin-right:auto}
.btt-auth .btt-pagehead h1,.btt-auth .btt-pagehead .bt-intro{text-align:center;max-width:32rem;margin-left:auto;margin-right:auto}
.btt-auth .btt-content--page{max-width:34rem;margin-left:auto;margin-right:auto}
.btt-auth .bt-form--narrow{max-width:32rem}
