:where([data-customize="page"]) {
  width: min(100%, 96rem);
}

:where([data-customize="header"]) {
  max-width: 56rem;
}

:where([data-customize="header"] > [data-nk="button-group"]) {
  margin-block-start: 0.75rem;
}

:where([data-customize="customizer-errors"]) {
  margin: 0;
  padding: 0.75rem 1rem;
  color: var(--nk-color-danger-content);
  background: color-mix(
    in oklab,
    var(--nk-color-danger) 10%,
    var(--nk-color-surface)
  );
  border-inline-start: 0.25rem solid var(--nk-color-danger);
  border-radius: var(--nk-radius-sm);
  line-height: var(--nk-leading-normal);
}

:where(
    [data-customize="customizer-preview-section"],
    [data-customize="customizer-controls-section"],
    [data-customize="customizer-exports"]
  ) {
  display: grid;
  gap: 1.25rem;
  min-inline-size: 0;
}

:where([data-customize="customizer-section-header"]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 28rem);
  gap: 1rem 2rem;
  align-items: end;
}

:where([data-customize="customizer-section-header"] *) {
  margin: 0;
}

:where([data-customize="customizer-section-header"] > div) {
  display: grid;
  gap: 0.35rem;
}

:where([data-customize="customizer-section-header"] h2) {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}

:where([data-customize="customizer-section-header"] > p) {
  color: var(--nk-color-muted-foreground);
  font-size: 0.9rem;
  line-height: 1.55;
  text-wrap: pretty;
}

:where([data-customize="theme-preview"]) {
  min-inline-size: 0;
  overflow: clip;
  color: var(--nk-color-foreground);
  font-family: var(--nk-font-sans);
  background: var(--nk-color-canvas);
  border: var(--nk-border-width) solid var(--nk-color-border);
  border-radius: var(--nk-radius-xl);
  box-shadow: var(--nk-shadow-md);
  color-scheme: light;
}

:where([data-customize="theme-preview"][data-theme="dark"]) {
  color-scheme: dark;
}

:where([data-customize="theme-preview"] [data-customize-shell]) {
  --nk-app-shell-sidebar-width: 14rem;
  --nk-app-shell-topbar-height: 3.25rem;

  block-size: 52rem;
  min-block-size: 52rem;
  overflow: hidden;
}

@media (min-width: 48.0625rem) {
  :where(
      [data-customize="theme-preview"]
        [data-customize-shell]
        > [data-slot="app-shell-sidebar"]
    ) {
    position: relative;
    inset-block-start: auto;
    block-size: auto;
    min-block-size: 0;
  }
}

:where(
    [data-customize="theme-preview"]
      [data-customize-shell]
      > [data-slot="app-shell-main"]
  ) {
  overflow: auto;
}

:where([data-customize="customizer-brand"]) {
  display: grid;
  min-inline-size: 0;
  line-height: 1.15;
}

:where([data-customize="customizer-brand"] strong) {
  overflow: hidden;
  text-overflow: ellipsis;
}

:where([data-customize="customizer-brand"] small) {
  color: var(--nk-color-muted-foreground);
  font-size: var(--nk-text-xs);
}

:where([data-customize="customizer-application"]) {
  min-block-size: 100%;
  padding: clamp(1rem, 3vw, 2rem);
}

:where([data-customize="customizer-preview-grid"]) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(var(--nk-space) * 4);
  align-items: start;
}

:where([data-customize="customizer-preview-grid"] [data-slot="card-body"]) {
  min-inline-size: 0;
}

:where([data-customize="customizer-pro"]) {
  display: grid;
  gap: calc(var(--nk-space) * 4);
}

:where([data-customize="customizer-pro"] > header) {
  display: grid;
  gap: calc(var(--nk-space) * 1.5);
}

:where([data-customize="customizer-pro"] > header > *) {
  margin: 0;
}

:where([data-customize="customizer-pro"] > header h2) {
  font-size: var(--nk-text-lg);
  line-height: var(--nk-leading-tight);
}

:where([data-customize="customizer-pro"] > header p) {
  color: var(--nk-color-muted-foreground);
  font-size: var(--nk-text-sm);
}

:where([data-customize="customizer-pro-grid"]) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(var(--nk-space) * 4);
  align-items: start;
}

:where([data-customize="customizer-pro-grid"] [data-nk="progressive-image"]) {
  display: grid;
  min-block-size: 7rem;
  place-items: center;
  color: var(--nk-color-muted-foreground);
  background: var(--nk-color-muted);
}

:where([data-customize="customizer-controls"]) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  min-inline-size: 0;
}

:where([data-customize="customizer-control"]) {
  min-inline-size: 0;
  margin: 0;
  padding: 1rem;
  background: color-mix(in oklab, currentColor 2.5%, var(--nk-color-surface));
  border: var(--nk-border-width) solid var(--nk-color-border);
  border-radius: var(--nk-radius-lg);
}

:where([data-customize="customizer-control"] legend) {
  padding: 0;
  color: var(--nk-color-foreground);
  font-size: 0.9rem;
  font-weight: var(--nk-font-weight-semibold);
}

:where([data-customize="customizer-control"] > p) {
  min-block-size: 2.5em;
  margin: 0.35rem 0 0.75rem;
  color: var(--nk-color-muted-foreground);
  font-size: 0.75rem;
  line-height: 1.35;
  text-wrap: pretty;
}

:where([data-customize="customizer-options"]) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

:where([data-customize="customizer-option"]) {
  min-inline-size: 0;
  min-block-size: 2.5rem;
  padding: 0.3rem 0.45rem;
  border-radius: var(--nk-radius-md);
}

:where([data-customize="customizer-option"]:has(input:checked)) {
  background: color-mix(in oklab, var(--nk-color-primary) 9%, transparent);
}

:where(
    [data-customize="customizer-option"] > [data-slot="radio-button-label"]
  ) {
  min-block-size: 2.5rem;
}

:where(
    [data-customize="customizer-option"] [data-slot="radio-button-label-text"]
  ) {
  display: flex;
  min-inline-size: 0;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
}

:where(
    [data-customize="customizer-option"]
      [data-slot="radio-button-label-text"]
      > span:last-child
  ) {
  overflow: hidden;
  text-overflow: ellipsis;
}

:where([data-customize="customizer-swatch"]) {
  position: relative;
  display: inline-grid;
  flex: none;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  place-items: center;
  overflow: hidden;
  color: var(--nk-color-foreground);
  background: var(--nk-color-muted);
  border: var(--nk-border-width) solid
    color-mix(in oklab, currentColor 20%, transparent);
  border-radius: var(--nk-radius-sm);
  font-size: 0.65rem;
  font-weight: var(--nk-font-weight-semibold);
  line-height: 1;
}

:where([data-customize-swatch-kind="accent"][data-customize-swatch="blue"]) {
  background: oklch(0.546 0.245 262.881);
}

:where([data-customize-swatch-kind="accent"][data-customize-swatch="indigo"]) {
  background: oklch(0.511 0.262 276.966);
}

:where([data-customize-swatch-kind="accent"][data-customize-swatch="violet"]) {
  background: oklch(0.541 0.281 293.009);
}

:where([data-customize-swatch-kind="accent"][data-customize-swatch="rose"]) {
  background: oklch(0.56 0.253 17.585);
}

:where([data-customize-swatch-kind="accent"][data-customize-swatch="amber"]) {
  background: oklch(0.666 0.179 58.318);
}

:where([data-customize-swatch-kind="accent"][data-customize-swatch="emerald"]) {
  background: oklch(0.527 0.154 150.069);
}

:where([data-customize-swatch-kind="accent"][data-customize-swatch="neutral"]) {
  background: oklch(0.269 0 0);
}

:where([data-customize-swatch-kind="neutral"][data-customize-swatch="slate"]) {
  background: oklch(0.554 0.046 257.417);
}

:where([data-customize-swatch-kind="neutral"][data-customize-swatch="gray"]) {
  background: oklch(0.551 0.027 264.364);
}

:where([data-customize-swatch-kind="neutral"][data-customize-swatch="zinc"]) {
  background: oklch(0.552 0.016 285.938);
}

:where(
    [data-customize-swatch-kind="neutral"][data-customize-swatch="neutral"]
  ) {
  background: oklch(0.556 0 0);
}

:where([data-customize-swatch-kind="neutral"][data-customize-swatch="stone"]) {
  background: oklch(0.553 0.013 58.071);
}

:where([data-customize-swatch-kind="radius"]) {
  background: color-mix(
    in oklab,
    var(--nk-color-primary) 18%,
    var(--nk-color-surface)
  );
}

:where([data-customize-swatch-kind="radius"][data-customize-swatch="none"]) {
  border-radius: 0;
}

:where([data-customize-swatch-kind="radius"][data-customize-swatch="sm"]) {
  border-radius: 0.125rem;
}

:where([data-customize-swatch-kind="radius"][data-customize-swatch="md"]) {
  border-radius: 0.375rem;
}

:where([data-customize-swatch-kind="radius"][data-customize-swatch="lg"]) {
  border-radius: 0.625rem;
}

:where([data-customize-swatch-kind="density"]) {
  background-color: transparent;
  background-image: repeating-linear-gradient(
    to bottom,
    currentColor 0 1px,
    transparent 1px 4px
  );
  background-position: center;
  background-size: 0.9rem 0.75rem;
  background-repeat: no-repeat;
}

:where(
    [data-customize-swatch-kind="density"][data-customize-swatch="comfortable"]
  ) {
  background-size: 0.9rem 1rem;
  background-image: repeating-linear-gradient(
    to bottom,
    currentColor 0 1px,
    transparent 1px 6px
  );
}

:where([data-customize-swatch-kind="font"]) {
  inline-size: 1.65rem;
  background: transparent;
}

:where([data-customize-swatch-kind="font"][data-customize-swatch="humanist"]) {
  font-family: Optima, Candara, "Noto Sans", source-sans-pro, sans-serif;
}

:where([data-customize-swatch-kind="font"][data-customize-swatch="serif"]) {
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

:where([data-customize-swatch-kind="font"][data-customize-swatch="mono"]) {
  font-family: var(--nk-font-mono);
}

:where([data-customize-swatch-kind="shell"]) {
  background-color: transparent;
  background-image: linear-gradient(
      to right,
      currentColor 0 28%,
      transparent 28%
    ),
    linear-gradient(to bottom, currentColor 0 22%, transparent 22%);
  opacity: 0.72;
}

:where([data-customize-swatch-kind="shell"][data-customize-swatch="sidebar"]) {
  background-image: linear-gradient(
    to right,
    currentColor 0 32%,
    transparent 32%
  );
}

:where([data-customize-swatch-kind="shell"][data-customize-swatch="topbar"]) {
  background-image: linear-gradient(
    to bottom,
    currentColor 0 30%,
    transparent 30%
  );
}

:where([data-customize-swatch-kind="appearance"]) {
  border-radius: var(--nk-radius-full);
}

:where(
    [data-customize-swatch-kind="appearance"][data-customize-swatch="light"]
  ) {
  background: oklch(0.985 0 0);
}

:where(
    [data-customize-swatch-kind="appearance"][data-customize-swatch="dark"]
  ) {
  background: oklch(0.205 0 0);
}

:where(
    [data-customize-swatch-kind="appearance"][data-customize-swatch="system"]
  ) {
  background: linear-gradient(
    135deg,
    oklch(0.985 0 0) 0 50%,
    oklch(0.205 0 0) 50% 100%
  );
}

:where([data-customize="customizer-exports"] > [data-nk="tabs"]) {
  min-inline-size: 0;
}

:where([data-customize="customizer-export"]) {
  min-inline-size: 0;
  overflow: hidden;
  background: color-mix(in oklab, currentColor 2.5%, var(--nk-color-surface));
  border: var(--nk-border-width) solid var(--nk-color-border);
  border-radius: var(--nk-radius-lg);
}

:where([data-customize="customizer-export"] > header) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.8rem;
  border-block-end: var(--nk-border-width) solid var(--nk-color-border);
}

:where([data-customize="customizer-export"] > header > div) {
  display: grid;
  min-inline-size: 0;
  gap: 0.1rem;
}

:where([data-customize="customizer-export"] > header strong) {
  font-size: 0.8rem;
}

:where([data-customize="customizer-export"] > header small) {
  overflow: hidden;
  color: var(--nk-color-muted-foreground);
  font-family: var(--nk-font-mono);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where([data-customize="customizer-export"] pre) {
  max-block-size: 32rem;
  margin: 0;
  overflow: auto;
  padding: 1rem;
  font-family: var(--nk-font-mono);
  font-size: 0.78rem;
  font-variant-ligatures: none;
  line-height: 1.65;
  tab-size: 2;
}

:where([data-customize="customizer-export"] code) {
  display: block;
  inline-size: max-content;
  min-inline-size: 100%;
  font: inherit;
}

:where([data-customize="customizer-status"]) {
  position: fixed;
  z-index: 100;
  inset-block-end: 1rem;
  inset-inline-end: 1rem;
  max-inline-size: min(24rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.65rem 0.8rem;
  color: var(--nk-color-foreground);
  background: var(--nk-color-elevated);
  border: var(--nk-border-width) solid var(--nk-color-border);
  border-radius: var(--nk-radius-md);
  box-shadow: var(--nk-shadow-md);
  font-size: 0.8rem;
  line-height: 1.4;
}

:where([data-customize="customizer-status"]:empty) {
  display: none;
}

:where([data-customize="customizer-status"][data-state="success"]) {
  color: var(--nk-color-success-content);
}

:where([data-customize="customizer-status"][data-state="error"]) {
  color: var(--nk-color-danger-content);
}

@media (max-width: 64rem) {
  :where([data-customize="customizer-controls"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :where([data-customize="customizer-preview-grid"]) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 48rem) {
  :where([data-customize="customizer-section-header"]) {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  :where([data-customize="theme-preview"]) {
    border-radius: var(--nk-radius-lg);
  }

  :where([data-customize="theme-preview"] [data-customize-shell]) {
    block-size: 42rem;
    min-block-size: 42rem;
  }

  :where([data-customize="customizer-application"]) {
    padding: 1rem;
  }

  :where([data-customize="customizer-pro-grid"]) {
    grid-template-columns: minmax(0, 1fr);
  }

  :where([data-customize="customizer-controls"]) {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(13rem, 78vw);
    gap: 0.6rem;
    overflow-x: auto;
    padding-block-end: 0.5rem;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
  }

  :where([data-customize="customizer-control"]) {
    scroll-snap-align: start;
  }

  :where([data-customize="customizer-export"] > header) {
    align-items: flex-start;
  }

  :where([data-customize="customizer-status"]) {
    inset-block-end: 0.75rem;
    inset-inline: 0.75rem;
    max-inline-size: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where([data-customize="customizer-controls"]) {
    scroll-behavior: auto;
  }
}

body:has([data-customize="page"]) main.page-width {
  max-width: none;
}

[data-customize="page"] {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem) 6rem;
}

[data-customize="page"] h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1;
  margin-block: 1rem 1.25rem;
  text-wrap: balance;
}

[data-customize="header"] > p {
  color: var(--nk-color-muted-foreground);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.6;
  margin: 0;
  text-wrap: pretty;
}

[data-customize="eyebrow"] {
  color: var(--nk-color-muted-foreground);
  font-size: var(--nk-text-xs);
  font-weight: var(--nk-font-weight-semibold);
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}
