/* UI Cards: the site's tokens and type come from ../style.css. These are the page layout (same as motion-design)
   and one live demo per section. Each demo's states hang off its .stage: a class from a toggle, a data attribute
   from a segmented control, or a custom property from a slider (script.js sets them). */
:root {
  --stage-pad: 2rem;
  --demo-r: 0.75rem;
  --demo-r-s: 0.5rem;
  --line: oklch(0.5 0 264 / 0.25);
  --placeholder: oklch(0.35 0 264);
  --gap-mark: oklch(0.65 0.15 264 / 0.35);
  --on-primary: oklch(0.15 0 264);
}
.light {
  --line: oklch(0.5 0 264 / 0.2);
  --placeholder: oklch(0.85 0 264);
  --gap-mark: oklch(0.9 0.17 100 / 0.5);
  --on-primary: oklch(1 0 264);
}

/* ---------- layout, same as motion-design ---------- */
.container {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}
main {
  margin-bottom: 10rem;
  flex-grow: 1;
  min-width: 0;
}
.sidebar-container {
  display: flex;
  gap: 1rem;
  position: sticky;
  top: 2rem;
  align-self: flex-start;
  width: 15rem;
  flex-shrink: 0;
  overflow: hidden;
  transition: var(--transition);
}
.sidebar-container.sidebar-collapsed {
  width: 2rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: max-content;
  transition: var(--transition);
}
.sidebar-container.sidebar-collapsed .sidebar-nav {
  pointer-events: none;
  opacity: 0;
}
.sidebar-links {
  color: var(--text-muted);
}
.sidebar-links:hover {
  color: var(--primary);
}
.sidebar-icon {
  position: absolute;
  top: 0;
  right: 0;
  height: 1.5rem;
  width: 1.5rem;
  stroke: var(--text-muted);
  border-radius: 0.25rem;
  transition: var(--transition);
}
.sidebar-icon:hover {
  stroke: var(--text);
  background: var(--bg);
  cursor: pointer;
}
.sidebar-icon-mobile {
  display: none;
  position: fixed;
  top: 4rem;
  right: 5vw;
  height: 2.5rem;
  width: 2.5rem;
  stroke: var(--text-muted);
  background: var(--bg-light);
  box-shadow: var(--shadow-m);
  filter: drop-shadow(0 0 30px var(--bg-dark));
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 3;
}
@media (max-width: 50rem) {
  .sidebar-container {
    position: fixed;
    top: 5rem;
    right: -15rem;
    width: fit-content;
    max-height: calc(100vh - 7rem);
    overflow: auto;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 1rem;
    box-shadow: var(--shadow-m);
    filter: drop-shadow(0 0 60px var(--bg-dark));
    z-index: 2;
    opacity: 0;
    pointer-events: none;
  }
  .sidebar-icon {
    display: none;
  }
  .sidebar-icon-mobile {
    display: block;
  }
  .sidebar-container.sidebar-collapsed {
    width: fit-content;
  }
  .sidebar-container.sidebar-collapsed .sidebar-nav {
    pointer-events: auto;
    opacity: 1;
  }
}
.sidebar-container.sidebar-mobile {
  right: 5vw;
  opacity: 1;
  pointer-events: auto;
}

/* ---------- sections ---------- */
section {
  margin: 3rem 0;
  padding: 1.5rem;
  background: var(--bg);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-s);
}
section > p + p {
  margin-top: 0.75rem;
}
.rule {
  margin-top: 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--primary);
  color: var(--text);
  font-weight: 700;
}
.note {
  margin-top: 1rem;
  font: var(--small);
}
pre {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  background: var(--bg-dark);
  border-radius: 1rem;
  color: var(--text);
  font: 400 0.875rem/1.6 ui-monospace, Consolas, monospace;
}
pre span {
  color: var(--primary);
}
.credits {
  margin-top: 3rem;
  font: var(--small);
}
.rules-list {
  display: grid;
  padding-left: 1.5rem;
  gap: 0.75rem;
  margin-top: 1rem;
  color: var(--text);
}

/* ---------- controls ---------- */
.copy-btn {
  padding: 0.25rem 0.75rem;
  margin: 0.5rem 0;
  background: var(--bg-light);
}
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.controls button {
  padding: 0.4rem 0.9rem;
  background: var(--bg-light);
  font: var(--small);
  font-size: 0.875rem;
  letter-spacing: 0;
}
.controls [aria-pressed="true"] {
  background: var(--primary);
  color: var(--on-primary);
}
.controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--bg-light);
  box-shadow: none;
}
section > .controls + p {
  margin-top: 1.25rem;
}
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg-dark);
  border-radius: 0.75rem;
}
.seg button {
  box-shadow: none;
  background: transparent;
}
.range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font: var(--small);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.range input {
  width: 8rem;
  accent-color: var(--primary);
}
.range output {
  min-width: 1.5rem;
  text-align: right;
  color: var(--primary);
  font-weight: 700;
}
.fields-count,
.click-log {
  font: var(--small);
  font-size: 0.875rem;
}
.fields-count output,
.click-log b {
  color: var(--primary);
}

/* ---------- the stage every demo sits on ---------- */
.stage {
  display: grid;
  place-items: center;
  margin-top: 1rem;
  padding: var(--stage-pad);
  overflow: hidden;
  background: var(--bg-dark);
  border-radius: 1rem;
}
.stage h3,
.stage h4,
.stage p {
  margin: 0;
}
.stage img {
  display: block;
  width: 100%;
  object-fit: cover;
}
.stage b {
  color: var(--text);
}
@media (max-width: 40rem) {
  .stage {
    --stage-pad: 1rem;
  }
  section {
    padding: 1rem;
  }
}

/* what a card is: a list, then the same list in boxes */
.rooms {
  display: grid;
  gap: 1.5rem;
  width: min(100%, 16rem);
}
.room {
  display: grid;
  gap: 0.25rem;
  border-radius: var(--demo-r);
  transition: var(--transition);
}
.boxed .room {
  padding: 1rem;
  background: var(--bg);
  box-shadow: var(--shadow-s);
}

/* rule 1: a box of labels next to a real card */
.pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1.5rem;
  width: min(100%, 34rem);
}
.weak,
.strong {
  position: relative;
  padding: 1rem;
  border-radius: var(--demo-r);
  transition: var(--transition);
}
.boxed .weak,
.boxed .strong {
  background: var(--bg);
  box-shadow: var(--shadow-s);
}
.weak {
  display: grid;
  justify-items: start;
  gap: 0.5rem;
  color: var(--text);
}
.weak-btn {
  padding: 0.4rem 1.25rem;
  border-radius: 0.375rem;
  background: oklch(0.6 0.18 264);
  color: oklch(1 0 0);
}
/* the gaps between the labels, every one the same */
.weak span:not(.weak-btn) {
  transition: var(--transition);
}
.gaps .weak span:not(.weak-btn) {
  color: var(--primary);
  box-shadow: 0 0.5rem 0 var(--gap-mark);
}
.strong {
  display: grid;
  align-content: start;
  gap: 1rem;
}
.strong-price b {
  font-size: 1.25rem;
}
.strong-act {
  display: grid;
  gap: 0.5rem;
  text-align: center;
}
.strong-btn,
.booking-btn,
.worry-btn,
.dash-btn {
  display: block;
  padding: 0.5rem;
  border-radius: var(--demo-r-s);
  background: var(--text);
  color: var(--bg-dark);
  font-weight: 700;
  text-align: center;
}

/* rule 2: the form gets the strongest card */
.page {
  display: grid;
  grid-template-columns: 1fr minmax(11rem, 14rem);
  align-items: start;
  gap: 1.5rem;
  width: min(100%, 38rem);
}
.page-info {
  display: grid;
  gap: 0.75rem;
}
.host {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--demo-r);
}
.host-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--on-primary);
  font-weight: 700;
}
.booking {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--demo-r);
  transition: var(--transition);
}
[data-form="border"] .booking {
  border: 1px solid var(--line);
}
[data-form="strong"] .booking {
  background: var(--bg-light);
  box-shadow: var(--shadow-m);
}
.booking-price b {
  font-size: 1.25rem;
}
.booking-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--demo-r-s);
  color: var(--text);
  font: var(--small);
}
.booking-dates span {
  display: grid;
  padding: 0.4rem 0.6rem;
}
.booking-dates span + span {
  border-left: 1px solid var(--line);
}
.booking-dates small {
  font-size: 0.6rem;
}
.booking-note,
.worry-note {
  font: var(--small);
  text-align: center;
}
@media (max-width: 40rem) {
  .page {
    grid-template-columns: 1fr;
  }
}

/* outer radius: one radius on a wide card and a small one */
#radius .stage {
  --r: 12px;
}
.radius-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}
.radius-card {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--r);
  box-shadow: var(--shadow-s);
}
.radius-wide {
  width: min(100%, 22rem);
}
.radius-small {
  width: 9rem;
  padding: 0;
  overflow: hidden;
}
.radius-small img {
  aspect-ratio: 1;
}
.radius-small h4 {
  padding: 0 0.75rem 0.75rem;
}
.bars {
  display: flex;
  align-items: end;
  gap: 0.4rem;
  height: 4rem;
}
.bars i {
  flex: 1;
  height: calc(var(--h) * 1%);
  border-radius: 0.2rem;
  background: var(--secondary);
}
.bars i:nth-child(1) { --h: 40; }
.bars i:nth-child(2) { --h: 55; }
.bars i:nth-child(3) { --h: 35; }
.bars i:nth-child(4) { --h: 70; }
.bars i:nth-child(5) { --h: 60; }
.bars i:nth-child(6) { --h: 85; }
.bars i:nth-child(7) { --h: 100; }

/* inner radius: a photo inside a card, and the two corner circles */
#inner-radius .stage {
  --r: 24px;
  --p: 12px;
  --inner: max(8px, calc(var(--r) - var(--p)));
}
#inner-radius .stage[data-mode="same"] {
  --inner: var(--r);
}
#inner-radius .stage[data-mode="formula"] {
  --inner: max(0px, calc(var(--r) - var(--p)));
}
.nest {
  position: relative;
  display: grid;
  gap: 0.25rem;
  width: min(100%, 16rem);
  padding: var(--p);
  background: var(--bg-light);
  border-radius: var(--r);
  box-shadow: var(--shadow-m);
}
.nest img {
  aspect-ratio: 4 / 3;
  margin-bottom: 0.5rem;
  border-radius: var(--inner);
}
/* each corner is part of a circle: the card's centered r in from its corner, the photo's p + inner in */
.nest::before,
.nest::after {
  content: "";
  display: none;
  position: absolute;
  border: 1.5px dashed var(--primary);
  border-radius: 50%;
  pointer-events: none;
}
.nest::before {
  top: 0;
  left: 0;
  width: calc(var(--r) * 2);
  height: calc(var(--r) * 2);
}
.nest::after {
  top: var(--p);
  left: var(--p);
  width: calc(var(--inner) * 2);
  height: calc(var(--inner) * 2);
  border-color: var(--secondary);
}
.circles .nest::before,
.circles .nest::after {
  display: block;
}

/* rule 3: big corners need big padding */
#padding .stage {
  --r: 64px;
  --p: 12px;
}
.poke {
  display: grid;
  gap: 0.5rem;
  width: min(100%, 18rem);
  padding: var(--p);
  background: var(--bg-light);
  border-radius: var(--r);
  box-shadow: var(--shadow-m);
}
.squircle .poke {
  corner-shape: squircle;
}
.poke-price b {
  font-size: 1.25rem;
}

/* text-box: equal padding that looks equal */
.tb-card {
  width: min(100%, 18rem);
  padding: 24px;
  background: var(--bg-light);
  border-radius: var(--demo-r);
  box-shadow: var(--shadow-m);
}
.tb-card h3 {
  font-size: 1.75rem;
  line-height: 1.5;
}
.tb-card p {
  margin-top: 0.75rem;
}
.trim .tb-card {
  text-box: trim-both cap alphabetic;
}
.lines .tb-card > * {
  background: var(--gap-mark);
}

/* rule 4: the answer under the button */
.worry-card {
  display: grid;
  gap: 0.75rem;
  width: min(100%, 16rem);
  padding: 1.25rem;
  background: var(--bg-light);
  border-radius: var(--demo-r);
  box-shadow: var(--shadow-m);
}
.worry-price b {
  font-size: 1.25rem;
}
.worry-note {
  visibility: hidden;
}
.answered .worry-note {
  visibility: visible;
  color: var(--primary);
}

/* sticky: a page scrolling under its booking card */
.stage-scroll {
  padding: 0;
}
.scroller {
  width: 100%;
  height: 22rem;
  overflow-y: auto;
  padding: var(--stage-pad);
}
.listing {
  display: grid;
  grid-template-columns: 1fr minmax(10rem, 13rem);
  gap: 1.5rem;
  max-width: 38rem;
  margin: 0 auto;
}
.listing-body {
  display: grid;
  gap: 0.75rem;
}
.listing-body img {
  aspect-ratio: 16 / 9;
  border-radius: var(--demo-r);
}
.listing-body h4 {
  margin-top: 0.75rem;
}
.listing-body ul {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.25rem;
}
.listing-book {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: var(--demo-r);
  box-shadow: var(--shadow-m);
  align-self: start;
}
.stuck .listing-book {
  position: sticky;
  top: 0;
}
@media (max-width: 40rem) {
  .listing {
    grid-template-columns: 1fr 9rem;
    gap: 1rem;
  }
}

/* rule 5: click a field to cut it */
.crammed {
  display: grid;
  justify-items: start;
  gap: 0.25rem;
  width: min(100%, 17rem);
  padding: 0.75rem;
  background: var(--bg-light);
  border-radius: var(--demo-r);
  box-shadow: var(--shadow-m);
}
.crammed-photo {
  position: relative;
  width: 100%;
  margin-bottom: 0.5rem;
}
.crammed-photo img {
  aspect-ratio: 4 / 3;
  border-radius: var(--demo-r-s);
}
.field {
  padding: 0.1rem 0.3rem;
  margin-left: -0.3rem;
  background: none;
  box-shadow: none;
  border-radius: 0.25rem;
  color: var(--text-muted);
  font: var(--small);
  font-size: 0.875rem;
  letter-spacing: 0;
  text-align: left;
}
.field:hover {
  background: var(--bg);
  box-shadow: none;
}
.crammed-title {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
}
.crammed-price {
  color: var(--text);
}
.crammed-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.8rem;
  padding: 0.15rem 0.6rem;
  background: oklch(0.15 0 0 / 0.65);
  border-radius: 1rem;
  color: oklch(1 0 0);
}
.crammed-badge:hover {
  background: oklch(0.15 0 0 / 0.85);
}
.field.cut {
  text-decoration: line-through;
  opacity: 0.35;
}
.hide-cut .field.cut {
  display: none;
}

/* box or no box: three tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
  gap: 1rem;
  width: min(100%, 36rem);
}
.tile {
  border-radius: var(--demo-r);
  transition: var(--transition);
}
.tile-photo {
  position: relative;
}
.tile-photo img {
  aspect-ratio: 1;
  border-radius: var(--demo-r);
}
.tile-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.1rem 0.5rem;
  background: oklch(0.15 0 0 / 0.65);
  border-radius: 1rem;
  color: oklch(1 0 0);
  font: var(--small);
}
.tile-text {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 0.5rem;
  padding: 0.5rem 0.25rem 0;
}
.tile-text p {
  grid-column: 1 / -1;
}
.tile-rating {
  color: var(--text);
}
[data-box="box"] .tile,
[data-box="edge"] .tile {
  background: var(--bg-light);
  box-shadow: var(--shadow-s);
}
[data-box="box"] .tile {
  padding: 0.75rem;
}
[data-box="box"] .tile-photo img {
  border-radius: var(--demo-r-s);
}
[data-box="edge"] .tile-photo img {
  border-radius: var(--demo-r) var(--demo-r) 0 0;
}
[data-box="edge"] .tile-text {
  padding: 0.75rem;
}

/* real content: missing photo, no reviews, a bright photo */
.real {
  width: min(100%, 15rem);
}
.real-photo {
  position: relative;
}
.real-img {
  aspect-ratio: 4 / 3;
  border-radius: var(--demo-r);
}
.real .real-bright,
[data-photo="bright"] .real .real-normal,
[data-photo="missing"] .real .real-img {
  display: none;
}
[data-photo="bright"] .real .real-bright {
  display: block;
}
/* no photo: without the fix the card collapses, with it a placeholder holds the space */
.fixed[data-photo="missing"] .real-photo {
  aspect-ratio: 4 / 3;
  background: var(--placeholder);
  border-radius: var(--demo-r);
}
[data-photo="missing"]:not(.fixed) .bookmark {
  display: none;
}
.bookmark {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 1.75rem;
  height: 1.75rem;
  fill: none;
  stroke: oklch(1 0 0);
  stroke-width: 2;
  stroke-linejoin: round;
}
.fixed .bookmark {
  fill: oklch(0 0 0 / 0.5);
}
.real-text {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 0.5rem;
  padding-top: 0.5rem;
}
.real-text p {
  grid-column: 1 / -1;
}
.real-rating {
  color: var(--text);
}
.real-zero,
.real-new,
[data-reviews="none"] .real-some,
.fixed[data-reviews="none"] .real-zero {
  display: none;
}
[data-reviews="none"] .real-zero,
.fixed[data-reviews="none"] .real-new {
  display: inline;
}

/* the whole card clicks, the bookmark sits on top */
.click-card {
  position: relative;
  display: grid;
  gap: 0.25rem;
  width: min(100%, 15rem);
  padding: 0.75rem;
  background: var(--bg-light);
  border-radius: var(--demo-r);
  box-shadow: var(--shadow-s);
  transition: var(--transition);
}
.click-card:hover {
  box-shadow: var(--shadow-m);
}
.click-card img {
  aspect-ratio: 4 / 3;
  margin-bottom: 0.5rem;
  border-radius: var(--demo-r-s);
}
.click-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--demo-r);
}
.show-link .click-link::after {
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
}
.click-save {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1;
  padding: 0.4rem;
  background: oklch(0 0 0 / 0.5);
  border-radius: 50%;
  box-shadow: none;
}
.click-save:hover {
  background: oklch(0 0 0 / 0.7);
  box-shadow: none;
}
.click-save svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: oklch(1 0 0);
  stroke-width: 2;
  stroke-linejoin: round;
}
.click-save.saved svg {
  fill: oklch(1 0 0);
}
.show-link .click-save {
  outline: 2px dashed var(--secondary);
}

/* grid gaps */
.gap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 1rem;
  row-gap: 1rem;
  width: min(100%, 34rem);
  transition: var(--transition);
}
[data-gap="double"] .gap-grid {
  row-gap: 2rem;
}
.gap-tile img {
  aspect-ratio: 16 / 9;
  margin-bottom: 0.4rem;
  border-radius: var(--demo-r-s);
}
.gap-tile h4 {
  font-size: 0.875rem;
}
.gap-tile p {
  font: var(--small);
}

/* rule 6: one card, six steps (script.js adds s2 to s6, one per step reached) */
.dash {
  display: grid;
  gap: 0.75rem;
  width: min(100%, 24rem);
  padding: 1rem;
  background: var(--bg);
  border-radius: 0.25rem;
  color: var(--text);
  transition: var(--transition);
}
.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dash-chip {
  font: var(--small);
}
.dash small {
  font: var(--small);
  letter-spacing: 0.1rem;
  color: var(--text-muted);
}
.dash-lead,
.dash-spark {
  display: none;
}
.dash-stats {
  display: grid;
  gap: 0.25rem;
}
.dash-stats div {
  display: flex;
  gap: 0.4rem;
}
.dash-stats small::after {
  content: ":";
}
.dash-stats b {
  font-weight: 400;
}
.dash-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: var(--small);
}
.dash-btn {
  padding: 0;
  background: none;
  color: var(--text);
  text-decoration: underline;
  font-weight: 400;
}
/* 2: the number users want, big */
.s2 .dash-sentence {
  display: none;
}
.s2 .dash-lead {
  display: grid;
  gap: 0.25rem;
}
.dash-figure {
  display: grid;
  justify-items: start;
}
.dash-figure b {
  font-size: 2.75rem;
  line-height: 1.1;
}
.dash-delta {
  display: grid;
  font: var(--small);
}
.dash-delta strong {
  color: var(--text);
}
/* 3: context beside the number, centered on its digits */
.s3 .dash-figure {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
/* 4: the other numbers in columns */
.s4 .dash-stats {
  grid-template-columns: repeat(3, 1fr);
}
.s4 .dash-stats div {
  display: grid;
}
.s4 .dash-stats small::after {
  content: none;
}
.s4 .dash-stats b {
  font-size: 1.25rem;
  font-weight: 700;
}
/* 5: a line to show progress */
.s5 .dash-spark {
  display: block;
  width: 100%;
  height: 3rem;
}
.dash-spark polyline {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.dash-spark circle {
  fill: var(--text);
}
/* 6: depth, dividers, round corners */
.s6 .dash {
  padding: 1.5rem;
  background: linear-gradient(var(--bg-light), var(--bg));
  border-radius: 1.5rem;
  box-shadow: var(--shadow-m);
}
.s6 .dash-chip {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
}
.s6 .dash-stats {
  padding: 1rem 0;
  border-block: 1px solid var(--line);
}
.s6 .dash-stats div + div {
  padding-left: 0.75rem;
  border-left: 1px solid var(--line);
}
.s6 .dash-btn {
  padding: 0.5rem 1rem;
  background: var(--text);
  border-radius: 2rem;
  color: var(--bg-dark);
  text-decoration: none;
  font-weight: 700;
}

/* rule 7: the same flights as cards or rows */
.flights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr));
  gap: 0.75rem;
  width: min(100%, 36rem);
}
.flight {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  background: var(--bg-light);
  border-radius: var(--demo-r);
  box-shadow: var(--shadow-s);
  font: var(--small);
  font-size: 0.8rem;
  transition: var(--transition);
}
.f-price {
  color: var(--text);
  font-weight: 700;
}
[data-view="rows"] .flights {
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--bg-light);
  border-radius: var(--demo-r);
  box-shadow: var(--shadow-s);
}
[data-view="rows"] .flight {
  grid-template-columns: 7rem 1fr 1fr 4rem;
  align-items: center;
  background: none;
  border-radius: 0;
  box-shadow: none;
}
[data-view="rows"] .flight + .flight {
  border-top: 1px solid var(--line);
}
[data-view="rows"] .f-price {
  text-align: right;
}
.cheapest-on .cheapest {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
@media (max-width: 40rem) {
  [data-view="rows"] .flight {
    grid-template-columns: 1fr 4rem;
  }
  [data-view="rows"] .f-time,
  [data-view="rows"] .f-stops {
    grid-column: 1;
  }
  [data-view="rows"] .f-price {
    grid-column: 2;
    grid-row: 1 / 4;
  }
}

/* pricing: three lifts, then subgrid */
.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: min(100%, 38rem);
}
.plan {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: var(--demo-r);
  text-align: center;
  font: var(--small);
  font-size: 0.8rem;
  transition: var(--transition);
}
.plan-price b {
  font-size: 1.5rem;
}
.plan-btn {
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  color: var(--text);
}
.plan ul {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  text-align: left;
}
.plan-long {
  display: none;
}
.long .plan-long {
  display: inline;
}
.lift-btn .plan-lift .plan-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}
.lift-border .plan-lift {
  border-color: var(--primary);
}
.lift-shade .plan-lift {
  background: linear-gradient(oklch(from var(--bg-light) calc(l + 0.08) c h), var(--bg-light));
  box-shadow: var(--shadow-m);
}
/* subgrid: every plan shares the same five rows, so prices and buttons line up */
.subgrid .plans {
  grid-template-rows: repeat(5, auto);
  row-gap: 0;
}
.subgrid .plan {
  display: grid;
  grid-row: span 5;
  grid-template-rows: subgrid;
}
@media (max-width: 40rem) {
  .plans {
    grid-template-columns: 1fr;
  }
  .subgrid .plans {
    grid-template-rows: none;
  }
}

/* mixed sizes: one bigger card, and a container query that changes its layout */
.posts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}
.post-slot {
  container-type: inline-size;
  transition: var(--transition);
}
.post {
  display: grid;
  gap: 0.5rem;
}
.post img {
  aspect-ratio: 16 / 10;
  border-radius: var(--demo-r-s);
}
.post div {
  display: grid;
  gap: 0.25rem;
  align-content: start;
}
.post h4 {
  font-size: 0.875rem;
}
.post p {
  font: var(--small);
}
.post p,
.post small {
  display: none;
}
.featured .posts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.featured .post-slot:first-child {
  grid-column: 1 / -1;
}
@container (min-width: 30rem) {
  .post {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: center;
  }
  .post h4 {
    font-size: 1.5rem;
  }
  .post p,
  .post small {
    display: block;
  }
}
@media (max-width: 40rem) {
  .posts,
  .featured .posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
