/* Glue for the built page. Tokens only; no new visual style. The UI pack's tokens.css, card.css, card-designs.css and components.css are used
   unchanged (UI pack v1.2). This file holds only what the static markup needs and the pack has no rule for:
   - icon colours as classes (so the shipped markup and script carry no inline style text; this helps the later strict style rule, AWS doc 10),
   - the two script-filled slots take no space while empty. */
.mk-a { fill: var(--color-ui-primary); }
.mk-b { fill: var(--color-ui-surface); }
.ic-wheel { stroke: var(--color-theme-t-cars-tint); }
.ic-cut { stroke: var(--color-ui-surface); }
#bim-status:empty { display: none; }

/* ---- step 1: a pattern on each theme tile (tint colours from the tokens; the name sits on a plain chip so it stays easy to read).
   --tile-bg is set per theme and re-applied for hover and selected, so the pattern never disappears; selected still shows the tick, the thick border and bold text. */
.choices-themes .choice { --tile-bg: var(--color-ui-surface); }
.choices-themes .choice[data-theme="T-PRINCESS"] { --tile-bg: radial-gradient(circle, var(--color-theme-t-princess-tint) 2.5px, transparent 3px) 0 0 / 16px 16px, linear-gradient(135deg, var(--color-theme-t-princess-tint) 0, var(--color-ui-surface) 70%); }
.choices-themes .choice[data-theme="T-ANIMALS"] { --tile-bg: repeating-linear-gradient(135deg, var(--color-theme-t-animals-tint) 0 9px, var(--color-ui-surface) 9px 18px); }
.choices-themes .choice[data-theme="T-CARS"] { --tile-bg: conic-gradient(var(--color-theme-t-cars-tint) 25%, var(--color-ui-surface) 0 50%, var(--color-theme-t-cars-tint) 0 75%, var(--color-ui-surface) 0) 0 0 / 20px 20px; }
.choices-themes .choice[data-theme="T-HERO"] { --tile-bg: repeating-conic-gradient(from 0deg at 100% 0, var(--color-theme-t-hero-tint) 0 10deg, var(--color-ui-surface) 10deg 20deg); }
.choices-themes .choice .choice-box,
.choices-themes .choice:hover .choice-box,
.choices-themes .choice input:checked + .choice-box { background: var(--tile-bg); }
.choices-themes .emblem { background: var(--color-ui-surface); }
.choices-themes .choice-name { background: var(--color-ui-surface); padding: 2px var(--space-2); border-radius: var(--radius-sm); }

/* ---- step 2: the small right-aligned "View all designs" link-button next to the heading */
#bim-design > legend { float: left; margin-right: var(--space-3); }
.gallery-cta { float: right; margin-top: var(--space-1); display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--size-target-min); padding: var(--space-1) var(--space-3); font: inherit; font-size: var(--font-size-100); font-weight: var(--font-weight-bold); color: var(--color-ui-primary); background: var(--color-ui-surface); border: var(--border-width-control) solid var(--color-ui-border-strong); border-radius: var(--radius-pill); cursor: pointer; }
#bim-design-body, #bim-design-err { clear: both; }
.gallery-cta svg { width: 16px; height: 16px; flex: none; }
.gallery-cta:hover { background: var(--color-ui-sunken); }
.gallery-cta:focus-visible { outline: var(--border-width-focus) solid var(--color-ui-focus); outline-offset: var(--border-width-focus-gap); }

/* ---- the gallery: one panel with every design, grouped by theme */
.gallery { width: min(760px, calc(100% - 2 * var(--layout-gutter))); max-height: calc(100% - 2 * var(--layout-gutter)); padding: var(--space-4); color: var(--color-ui-ink); background: var(--color-ui-paper); border: var(--border-width-control) solid var(--color-ui-border-strong); border-radius: var(--radius-lg); overflow: auto; }
.gallery::backdrop { background: rgb(42 31 61 / 0.55); }
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.gallery-head h2 { margin: 0; font-family: var(--font-family-heading); font-weight: var(--font-weight-medium); font-size: var(--font-size-400); }
.gallery-close { min-height: var(--size-target); padding: var(--space-2) var(--space-4); font-size: var(--font-size-200); }
.gallery-theme { margin-top: var(--space-4); }
.gallery-theme-name { margin: 0 0 var(--space-2); font-family: var(--font-family-heading); font-weight: var(--font-weight-medium); font-size: var(--font-size-300); }
.gallery-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.gtile { position: relative; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2); font: inherit; text-align: left; color: inherit; background: var(--color-ui-surface); border: var(--border-width-control) solid var(--color-ui-border); border-radius: var(--radius-md); cursor: pointer; }
.gtile:hover { background: var(--color-ui-sunken); border-color: var(--color-ui-border-strong); }
.gtile[aria-pressed="true"] { background: var(--color-ui-sunken); border-color: var(--color-ui-border-strong); outline: var(--border-width-control) solid var(--color-ui-border-strong); font-weight: var(--font-weight-bold); }
.gtile:focus-visible { outline: var(--border-width-focus) solid var(--color-ui-focus); outline-offset: var(--border-width-focus-gap); }
.gtile .thumb { display: block; width: 100%; max-width: 170px; margin: 0 auto; border-radius: var(--radius-sm); overflow: hidden; border: var(--border-width-thin) solid var(--color-ui-border); }
.gtile .choice-label { font-size: var(--font-size-100); line-height: var(--font-lineheight-tight); display: flex; flex-direction: column; }
.gtile .choice-label span { color: var(--color-ui-ink-muted); font-weight: var(--font-weight-regular); overflow-wrap: anywhere; }
.gtile[aria-pressed="true"] .tick { display: flex; }
.gtile .tick { top: var(--space-3); right: var(--space-3); }
