/* =============================================================================
   Reflex — the gallery every interaction page shares (ds/gen/reflex.py), and the few things every component wants.
   A page is a grid of cards; a card is a live stage, then the component's name, what it does and its markup. The stage is where the component lives
   and is built from the system's surfaces, so it follows light and dark, the accent and the face.
   ============================================================================= */
.kin-grid { display: grid; grid-template-columns: repeat(var(--kin-cols, 3), minmax(0, 1fr)); gap: 16px; }
.kin-card { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-width: 0; border-radius: var(--pw-radius-3xl); background: var(--sp-card, var(--pw-bg-surface)); box-shadow: 0 0 0 1px var(--pw-border-subtle); overflow: hidden; }
.kin-card--2 { grid-column: span 2; } .kin-card--3 { grid-column: 1 / -1; }
.kin-stage {
  position: relative; display: grid; place-items: center; min-height: 176px; margin: 6px 6px 0; padding: 20px; overflow: hidden; border-radius: calc(var(--pw-radius-3xl) - 6px);
  background: var(--pw-bg-subtle); isolation: isolate;
}
.kin-stage--tall { min-height: 260px; } .kin-stage--wide { place-items: stretch; padding: 0; }
.kin-stage--dark { background: #0B0C0F; color: #F4F4F5; color-scheme: dark; }
.kin-stage--row { grid-auto-flow: column; gap: 14px; place-content: center; }
.kin-foot { display: grid; gap: 4px; padding: 14px 18px 16px; align-content: start; }
.kin-name { font-size: var(--pw-text-sm-size); font-weight: var(--pw-font-weight-semibold); color: var(--pw-fg-primary); }
.kin-desc { margin: 0; font-size: var(--pw-text-xs-size); line-height: 1.45; color: var(--pw-fg-tertiary); text-wrap: pretty; }
.kin-note { margin: 4px 0 0; font-size: 11.5px; color: var(--pw-fg-quaternary, var(--pw-fg-tertiary)); }
.kin-code { margin-top: 8px; }
.kin-code summary { display: inline-block; padding: 3px 10px; border-radius: var(--pw-radius-pill); background: var(--pw-bg-muted); color: var(--pw-fg-secondary); font-size: 11.5px; font-weight: var(--pw-font-weight-semibold); cursor: pointer; list-style: none; }
.kin-code summary::-webkit-details-marker { display: none; }
.kin-code summary:hover { color: var(--pw-fg-primary); }
.kin-code pre { margin: 8px 0 0; padding: 12px 14px; max-height: 260px; overflow: auto; border-radius: var(--pw-radius-lg); background: var(--pw-bg-muted); font: 11.5px/1.55 var(--pw-font-mono); color: var(--pw-fg-secondary); white-space: pre; tab-size: 2; }
/* the small round replay control a one-shot demo carries in its corner */
.kin-replay { position: absolute; z-index: 5; top: 8px; inset-inline-end: 8px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--pw-bg-surface-raised, var(--pw-bg-surface)); color: var(--pw-fg-secondary); box-shadow: 0 0 0 1px var(--pw-border-subtle); cursor: pointer; }
.kin-replay:hover { color: var(--pw-fg-primary); }
.kin-replay:focus-visible { outline: none; box-shadow: var(--pw-focus-ring); }
.kin-replay .pw-icon { width: 14px; height: 14px; }
/* one component to a row: the stage takes the width, what it is and its markup sit beside it */
.kin-grid--rows { grid-template-columns: minmax(0, 1fr); }
.kin-grid--rows .kin-card { grid-template-columns: minmax(0, 7fr) minmax(250px, 4fr); grid-template-rows: none; }
.kin-grid--rows .kin-card--2, .kin-grid--rows .kin-card--3 { grid-column: auto; }
/* a block (size 3) is a whole view: it takes the full width and its description goes underneath */
.kin-grid--rows .kin-card--3 { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
.kin-grid--rows .kin-card--3 .kin-stage { margin: 6px 6px 0; min-height: 360px; }
.kin-grid--rows .kin-card--3 .kin-foot { padding: 14px 18px 16px; }
.kin-grid--rows .kin-stage { margin: 6px 0 6px 6px; min-height: 230px; }
.kin-grid--rows .kin-foot { padding: 20px 24px 20px 20px; align-content: center; }
@media (max-width: 820px) {
  .kin-grid--rows .kin-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .kin-grid--rows .kin-stage { margin: 6px 6px 0; }
  .kin-grid--rows .kin-foot { padding: 14px 18px 16px; }
}
@media (max-width: 980px) { .kin-grid:not(.kin-grid--rows) { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kin-card--3 { grid-column: 1 / -1; } }
@media (max-width: 620px) { .kin-grid:not(.kin-grid--rows) { grid-template-columns: minmax(0, 1fr); } .kin-card--2, .kin-card--3 { grid-column: auto; } }
