.deck {
  --color-bg: var(--color-deck-bg);
  --color-surface: var(--color-deck-surface);
  --color-surface-raised: var(--color-deck-surface);
  --color-surface-sunken: var(--color-deck-surface-sunken);
  --color-surface-hover: var(--color-deck-surface-sunken);
  --color-surface-active: var(--color-deck-surface-sunken);
  --color-border: var(--color-deck-line);
  --color-border-subtle: var(--color-deck-line);
  --color-border-strong: var(--color-deck-label);
  --color-text: var(--color-deck-text);
  --color-text-muted: var(--color-deck-text-muted);
  --color-text-subtle: var(--color-deck-text-muted);
  --color-primary: var(--color-deck-accent-strong);
  --color-primary-hover: var(--color-deck-accent-deepest);
  --color-on-primary: var(--color-deck-on-fill);
  --color-accent: var(--color-deck-accent);
  --color-accent-subtle: var(--color-deck-surface);
  --color-series-first: var(--series-blue);
  --color-series-second: var(--series-orange);
  --color-series-third: var(--series-aqua);
  --color-series-fourth: var(--series-yellow);
  --color-series-fifth: var(--series-magenta);
  --color-series-sixth: var(--series-green);
  --color-series-seventh: var(--series-violet);
  --color-series-eighth: var(--series-red);
  --color-series-other: var(--gray-400);
  --color-chart-gain: var(--series-blue);
  --color-chart-loss: var(--series-red);
  --color-chart-line: var(--color-deck-text-muted);
  --color-chart-grid: var(--color-deck-line);
  --color-chart-axis: var(--color-deck-line);

  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
}

.deck__progress {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: var(--z-sticky);
  height: 3px;
  background: var(--color-primary);
  transition: width var(--transition-base);
}

.deck__footer {
  display: grid;
  align-items: center;
  gap: var(--space-4);
  grid-template-columns: 1fr auto 1fr;
  padding: var(--space-2) var(--space-4);
  border-top: var(--border-width) solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.deck__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  font-weight: var(--weight-semibold);
}

.deck__brand_mark {
  width: 1.5rem;
  height: 1.5rem;
}

.deck__footer_title {
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.deck__nav {
  display: flex;
  justify-self: end;
  gap: var(--space-1);
}

.deck__counter {
  align-self: center;
  min-width: 3.5rem;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.deck__track {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.deck__slide {
  display: flex;
  align-items: flex-start;
  min-height: 100%;
  padding: var(--space-16) var(--space-8);
  scroll-snap-align: start;
  background: var(--color-bg);
  border-bottom: var(--border-width) solid var(--color-border-subtle);
}

.deck__slide--cover {
  align-items: center;
  background:
    radial-gradient(
      circle at 15% 12%,
      color-mix(in srgb, var(--color-deck-accent) 12%, transparent),
      transparent 40%
    ),
    radial-gradient(
      circle at 85% 85%,
      color-mix(in srgb, var(--color-deck-bar) 12%, transparent),
      transparent 45%
    ),
    var(--color-deck-bg);
}

.deck__slide--divider {
  align-items: center;
  color: var(--color-deck-on-fill);
}

.deck__slide--housekeeping {
  background: linear-gradient(
    160deg,
    var(--color-deck-housekeeping-deep),
    var(--color-deck-housekeeping) 70%
  );
}

.deck__slide--overview {
  background: linear-gradient(
    160deg,
    var(--color-deck-overview-deep),
    var(--color-deck-overview) 70%
  );
}

.deck__slide--delivery {
  background: linear-gradient(
    160deg,
    var(--color-deck-delivery-deep),
    var(--color-deck-delivery) 70%
  );
}

.deck__slide--log {
  background: linear-gradient(
    160deg,
    var(--color-deck-log-deep),
    var(--color-deck-log) 75%
  );
}

.deck__slide--custom {
  background: linear-gradient(
    160deg,
    var(--color-deck-custom-deep),
    var(--color-deck-custom) 70%
  );
}

.deck__stage {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
}

.deck__running_head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: var(--border-width) solid var(--color-border);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.deck__eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-deck-label);
}

.deck__slide--divider .deck__eyebrow {
  color: inherit;
}

.deck__headline {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.deck__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.deck__sub {
  margin: 0;
  font-size: var(--text-xl);
}

.deck__lede {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--color-text-muted);
}

.deck__mark {
  width: 5rem;
  height: 5rem;
}

.deck__parties {
  display: flex;
  gap: var(--space-12);
  font-size: var(--text-xl);
}

.deck__meta,
.deck__fine {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.deck__kpi {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

.deck__kpi strong {
  color: var(--color-deck-accent-strong);
}

.deck__contents {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-8);
  margin: 0;
  padding: 0;
  list-style: none;
}

.deck__contents_item {
  display: flex;
  gap: var(--space-3);
}

.deck__number {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  color: var(--color-deck-bar);
}

.deck__item_title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-deck-label);
}

.deck__columns {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--space-10);
  align-items: start;
}

.deck__columns--wide_first {
  grid-template-columns: 1.6fr 1fr;
}

.deck__columns--wide_last {
  grid-template-columns: 1fr 2fr;
}

.deck__body h1 {
  margin: var(--space-4) 0 var(--space-1);
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}

.deck__body .deck__item_title:not(:first-child) {
  margin-top: var(--space-5);
}

.deck__body h1:first-child {
  margin-top: 0;
}

.deck__body ul,
.deck__body ol {
  margin: 0;
  padding-left: var(--space-5);
}

.deck__bars {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.deck__bar_row {
  display: grid;
  grid-template-columns: 11rem 1fr 3.5rem;
  gap: var(--space-3);
  align-items: center;
  font-size: var(--text-md);
}

.deck__bar_label {
  text-align: right;
}

.deck__bar_track {
  height: 1.25rem;
}

.deck__bar {
  display: block;
  width: var(--share);
  min-width: 3px;
  height: 100%;
  border-radius: var(--radius-sm);
  background: var(--color-deck-bar);
}

.deck__bar--included {
  opacity: var(--opacity-partial);
}

.deck__bar_value {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.deck__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.deck__stat {
  display: flex;
  flex-direction: column;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.deck__stat strong {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  color: var(--color-deck-accent-strong);
}

.deck__numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.deck__callout {
  padding: var(--space-4) var(--space-5);
  border-left: var(--border-width-thick) solid var(--color-accent);
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
}

.deck__callout p {
  margin: 0;
}

.deck__list {
  margin: 0;
  padding-left: var(--space-5);
}

.deck__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-md);
}

.deck__table th,
.deck__table td {
  padding: var(--space-2) var(--space-3) var(--space-2) 0;
  border-bottom: var(--border-width) solid var(--color-border-subtle);
  text-align: left;
  vertical-align: top;
}

.deck__table th {
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.deck__pill {
  display: inline-block;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  color: var(--color-deck-on-fill);
  background: var(--color-deck-planned);
}

.deck__pill--delivered {
  background: var(--color-deck-delivered);
}

.deck__pill--in_progress {
  color: var(--color-deck-text);
  background: var(--color-deck-in-progress);
}

.deck__pill--waiting {
  background: var(--color-deck-waiting);
}

.deck__pill--blocked {
  background: var(--color-deck-blocked);
}

.deck__shot img {
  display: block;
  width: 100%;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

@media (width <= 48rem) {
  .deck__columns,
  .deck__columns--wide_first,
  .deck__columns--wide_last {
    grid-template-columns: 1fr;
  }

  .deck__slide {
    padding: var(--space-8) var(--space-4);
  }
}

@media print {
  .deck {
    position: static;
  }

  .deck__footer,
  .deck__progress {
    display: none;
  }

  .deck__track {
    height: auto;
    overflow: visible;
  }

  .deck__slide {
    min-height: 100vh;
    break-after: page;
  }
}

.deck--embedded {
  position: relative;
  height: clamp(30rem, calc(100vh - var(--topbar-height) - 8rem), 52rem);
  overflow: hidden;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
}

.deck--embedded .deck__slide {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-16) var(--space-12);
}

.deck--embedded .deck__stage {
  font-size: var(--text-md);
}

.deck--embedded .deck__headline {
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.deck--embedded .deck__title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}
