/* Kitchen-sink page only: not part of the framework. */

html { scroll-padding-top: 80px; }

.demo-section { margin-bottom: 64px; }
.demo-section > h2 { margin-bottom: 8px; }
.demo-section > h2 + p { margin-bottom: 24px; }
.demo-section h3.h6 { color: var(--md-sys-color-on-surface-variant); margin-bottom: 12px; }

#swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.swatch-group-wide { grid-column: 1 / -1; }
.swatch-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); border-radius: var(--md-sys-shape-corner-medium); overflow: hidden; outline: 1px solid var(--md-sys-color-outline-variant); }
.swatch-group:not(.swatch-group-wide) .swatch-row { grid-template-columns: 1fr 1fr; }
.swatch { min-height: 80px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.swatch-name { font-size: var(--md-sys-typescale-label-medium-size); font-weight: 500; line-height: 1.2; }
.swatch-hex { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11px; opacity: .9; }

.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px; }
.shape-tile, .elev-tile {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 8px;
}
.shape-tile { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.elev-tile { background: var(--md-sys-color-surface-container-low); color: var(--md-sys-color-on-surface); border-radius: var(--md-sys-shape-corner-medium); }

@media (max-width: 575.98px) {
  .demo-section { margin-bottom: 48px; }
  .navbar .btn-tonal { margin-left: 0 !important; }
}

/* ---------- Motion lab ---------- */

.lab-toolbar { position: sticky; top: 72px; z-index: 10; }
.spring-card { cursor: pointer; }
.spring-card:focus-visible { outline: var(--md-focus-ring); outline-offset: var(--md-focus-offset); }

.spring-plot { display: block; width: 100%; height: auto; overflow: visible; }
.spring-plot .sp-axis { stroke: var(--md-sys-color-outline-variant); stroke-width: 1; }
.spring-plot .sp-target { stroke: var(--md-sys-color-outline); stroke-width: 1; stroke-dasharray: 3 3; }
.spring-plot .sp-settle { stroke: var(--md-sys-color-outline-variant); stroke-width: 1; stroke-dasharray: 2 3; }
.spring-plot .sp-curve { fill: none; stroke: var(--md-sys-color-primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spring-plot .sp-label { fill: var(--md-sys-color-on-surface-variant); font-size: 10px; font-family: var(--md-ref-typeface-plain); }
.spring-plot .sp-cross { stroke: var(--md-sys-color-on-surface-variant); stroke-width: 1; }
.spring-plot .sp-dot { fill: var(--md-sys-color-primary); stroke: var(--md-sys-color-surface); stroke-width: 2; }
.spring-plot .sp-tip { fill: var(--md-sys-color-on-surface); font-size: 10px; font-weight: 500; font-family: var(--md-ref-typeface-plain); }

.lab-track {
  position: relative;
  display: block;
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest);
  cursor: pointer;
}
.lab-ball {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  transition: left var(--lab-motion, var(--md-motion-fast-spatial));
}
.lab-track.is-on .lab-ball { left: calc(100% - 38px); }
.lab-swatch {
  height: 44px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest);
  transition: background-color var(--lab-motion);
}
.lab-swatch.is-on { background: var(--md-sys-color-primary); }

.lab-stats { display: flex; gap: 24px; }
.lab-stats dt { font-size: var(--md-sys-typescale-label-medium-size); font-weight: 500; color: var(--md-sys-color-on-surface-variant); }
.lab-stats dd { margin: 0; font-size: var(--md-sys-typescale-title-large-size); font-variant-numeric: tabular-nums; }
.lab-code {
  margin: 0;
  padding: 12px 16px;
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-small);
}

/* ---------- Navigation demos ---------- */
.demo-phone {
  max-width: 412px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  overflow: hidden;
  outline: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface);
}
.demo-phone-wide { max-width: 600px; }
.demo-phone-body { height: 160px; display: grid; place-items: center; }
.demo-rail-frame {
  display: flex;
  height: 460px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  overflow: hidden;
  outline: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface);
}
.demo-rail-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  margin: 12px 12px 12px 0;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container-low);
  text-align: center;
}
.demo-frame { border-radius: var(--md-sys-shape-corner-large); overflow: hidden; outline: 1px solid var(--md-sys-color-outline-variant); }
.demo-scroll { height: 380px; overflow-y: auto; overscroll-behavior: contain; background: var(--md-sys-color-surface); }
.demo-scroll-fab { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; padding-right: 16px; pointer-events: none; }
.demo-scroll-fab > * { pointer-events: auto; }
/* Room above (and below, for -down) so the open menus stay inside the demo */
.demo-fab-menus { display: flex; justify-content: space-between; align-items: center; padding: 200px 8px; border-radius: var(--md-sys-shape-corner-large); background: var(--md-sys-color-surface-container-low); }
.demo-shape-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 20px 12px; }
.demo-shape-library figure { margin: 0; text-align: center; }
.demo-shape-library .demo-shape { width: 72px; aspect-ratio: 1; margin: 0 auto 8px; background-color: var(--md-sys-color-primary-container); }
.demo-shape-library figure:nth-child(3n+2) .demo-shape { background-color: var(--md-sys-color-tertiary-container); }
.demo-shape-library figure:nth-child(3n) .demo-shape { background-color: var(--md-sys-color-secondary-container); }
.demo-shape-library figcaption { font: var(--md-sys-typescale-label-small-weight) var(--md-sys-typescale-label-small-size) / var(--md-sys-typescale-label-small-line-height) var(--md-sys-typescale-label-small-font); color: var(--md-sys-color-on-surface-variant); }
/* Expanding toolbar demo: room for the bars to open */
.demo-toolbars { display: grid; grid-template-columns: 1fr 160px; gap: 16px; padding: 16px; border-radius: var(--md-sys-shape-corner-large); background: var(--md-sys-color-surface-container-low); }
.demo-toolbars-h { display: grid; gap: 12px; }
.demo-toolbar-row { position: relative; display: flex; align-items: center; min-height: 104px; padding: 0 24px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-secondary-container); }
.demo-toolbars-v { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 340px; padding: 16px 0 24px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-secondary-container); }
.demo-toolbar-label { position: absolute; top: 8px; left: 12px; font: var(--md-sys-typescale-label-small-weight) var(--md-sys-typescale-label-small-size) / 1.4 var(--md-sys-typescale-label-small-font); color: var(--md-sys-color-on-surface-variant); }
.demo-toolbars-v > .demo-toolbar-label { right: 8px; text-align: center; }
@media (max-width: 575.98px) { .demo-toolbars { grid-template-columns: 1fr; } }

/* The wordmark: "Boot" in the theme's primary, "erial" in the surrounding text color */
.brand-boot { color: var(--md-sys-color-primary); }
