@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,800&family=Inter+Tight:wght@400;500;600&family=JetBrains+Mono:wght@500;700&display=swap");

body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 14px; }
.cs-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-4); }
.cs-stack { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.cs-kicker { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.cs-section-label { padding: 4px 12px 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); }
.cs-kbd { padding: 2px 6px; border-radius: 5px; border: 1px solid var(--raised-border); background: var(--surface); font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }

button { font-family: inherit; }
.cs-btn, .cs-seg button, .cs-chip, .cs-tag, .cs-pill, .cs-cond button, .cs-sugg, .cs-step button { -webkit-tap-highlight-color: transparent; }
.cs-btn:focus-visible, .cs-seg button:focus-visible, .cs-chip:focus-visible, .cs-tag:focus-visible, .cs-pill:focus-visible,
.cs-cond button:focus-visible, .cs-sugg:focus-visible, .cs-step button:focus-visible, .cs-search input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Button */
.cs-btn { height: var(--control-md); padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); border-radius: var(--radius-md); border: 1px solid transparent; font-size: 13px; font-weight: 600; cursor: pointer; }
.cs-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cs-btn-primary { height: var(--control-lg); padding: 0 var(--space-4); border-radius: var(--radius-lg); border: 0; background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 700; }
.cs-btn-secondary { background: transparent; border-color: var(--field-border); color: var(--text-2); }
.cs-btn-ghost { width: var(--control-md); padding: 0; background: transparent; color: var(--text-muted); }
.cs-btn-block { width: 100%; }

/* SegmentedControl */
.cs-seg { display: inline-flex; gap: var(--space-1); padding: var(--space-1); border-radius: var(--radius-xl); border: 1px solid var(--field-border); background: var(--field); }
.cs-seg button { height: var(--control-md); padding: 0 var(--space-4); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.cs-seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* Chip */
.cs-chip { height: var(--control-md); padding: 0 var(--space-4); border-radius: var(--radius-full); border: 1px solid var(--field-border); background: var(--field); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.cs-chip[aria-pressed="true"] { border-color: var(--chip-on-bg); background: var(--chip-on-bg); color: var(--chip-on-text); }

/* FilterTag */
.cs-tag { height: 36px; padding: 0 var(--space-2) 0 var(--space-3); display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-sm); border: 1px solid var(--raised-border); background: var(--raised); color: var(--text); font-family: var(--font-mono); font-size: 12px; cursor: pointer; }
.cs-tag svg { color: var(--text-muted); }

/* OptionPill */
.cs-pill { height: var(--control-sm); padding: 0 14px; border-radius: var(--radius-md); border: 1px solid var(--raised-border); background: var(--raised); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.cs-pill[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

/* ConditionPicker */
.cs-cond { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-1); }
.cs-cond button { height: var(--control-cond); padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: var(--radius-cond); border: 1px solid var(--raised-border); background: var(--raised); color: var(--text); font-family: var(--font-mono); font-size: 11px; font-weight: 700; cursor: pointer; }
.cs-cond button.is-empty { color: var(--text-faint); }
.cs-cond button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.cs-cond .q { font-size: 10px; font-weight: 500; opacity: 0.85; }

/* StockBadge */
.cs-badge { display: inline-block; padding: 5px 9px; border-radius: var(--radius-badge); border: 1px solid var(--surface-border); background: var(--badge-bg); color: var(--text); font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.cs-badge.is-none { color: var(--bad); }

/* SearchBox */
.cs-search { position: relative; display: flex; align-items: center; }
.cs-search > .icon { position: absolute; left: 20px; color: var(--text-faint); }
.cs-search input { width: 100%; height: var(--control-xl); box-sizing: border-box; padding: 0 60px 0 56px; border-radius: var(--radius-xl); border: 1px solid var(--field-border); background: var(--field); color: var(--text-strong); font-family: var(--font-body); font-size: 18px; box-shadow: var(--shadow-card); }
.cs-search input::placeholder { color: var(--text-faint); }
.cs-search input::-webkit-search-cancel-button { display: none; }
.cs-search[data-open="true"] input { border-color: var(--accent); }
.cs-search > .cs-btn-ghost { position: absolute; right: 10px; }
.cs-drop { position: absolute; top: 70px; left: 0; right: 0; z-index: 30; padding: 12px 8px 8px; display: flex; flex-direction: column; gap: 2px; border-radius: var(--radius-2xl); border: 1px solid var(--raised-border); background: var(--surface); box-shadow: var(--shadow-drop); overflow: hidden; }

/* SuggestionRow */
.cs-sugg { width: 100%; min-height: 48px; padding: 8px 12px; display: flex; align-items: center; gap: var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.cs-sugg[aria-selected="true"] { background: var(--hover); box-shadow: inset 3px 0 0 var(--accent); }
.cs-sugg .thumb { width: 36px; height: 50px; flex: none; border-radius: var(--radius-xs); object-fit: cover; display: flex; align-items: center; justify-content: center; color: var(--on-tint); font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.cs-sugg .main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cs-sugg .name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-sugg mark { background: transparent; color: var(--accent-text); font-weight: 700; }
.cs-sugg .meta { font-size: 12px; color: var(--text-muted); }
.cs-sugg .side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.cs-sugg .price { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.cs-sugg .stock { font-size: 12px; color: var(--ok); }
.cs-sugg .stock.is-none { color: var(--bad); }

/* CardTile */
.cs-tile { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-card); border: 1px solid var(--surface-border); background: var(--surface); box-shadow: var(--shadow-card); color: var(--text); }
.cs-tile-head { min-height: 58px; padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.cs-tile-name { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; text-wrap: pretty; }
.cs-tile-set { font-size: 12px; color: var(--text-muted); }
.cs-stage { position: relative; height: 320px; display: flex; align-items: center; justify-content: center; border-top: 1px solid var(--stage-border); border-bottom: 1px solid var(--stage-border); background: var(--stage); }
.cs-stage img { width: 212px; height: 296px; object-fit: cover; border-radius: var(--radius-img); box-shadow: var(--shadow-image); }
.cs-stage .placeholder { width: 212px; height: 296px; box-sizing: border-box; border-radius: var(--radius-img); border: 1px dashed var(--placeholder-border); background: var(--placeholder-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); color: var(--text-faint); font-size: 12px; }
.cs-stage .cs-badge { position: absolute; left: 12px; top: 12px; }
.cs-tile-body { flex: 1 1 auto; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: var(--space-3); }
.cs-field { display: flex; flex-direction: column; gap: 6px; }
.cs-field-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-price-row { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.cs-price-note { font-size: 12px; color: var(--text-muted); }
.cs-price { font-family: var(--font-mono); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* QtyStepper */
.cs-step { display: inline-flex; align-items: center; gap: 2px; border-radius: var(--radius-md); border: 1px solid var(--raised-border); }
.cs-step button { width: 32px; height: var(--control-sm); border: 0; background: transparent; color: var(--text); font-size: 16px; cursor: pointer; }
.cs-step span { min-width: 20px; text-align: center; font-family: var(--font-mono); font-weight: 700; }
