.root {
  --prompt-content-width: var(--conversation-content-width, min(760px, 86%));
  --prompt-title-icon-size: var(--new-chat-title-icon-size, 54px);
  --prompt-title-icon-gap: var(--new-chat-title-icon-gap, 0px);
  --prompt-edge-gutter: var(
    --new-chat-title-edge-gutter,
    var(--prompt-title-icon-size)
  );
  --prompt-content-inset: max(
    var(--prompt-edge-gutter),
    calc((100% - var(--prompt-content-width)) / 2)
  );

  position: relative;
  display: grid;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: calc(100vh - var(--composer-reserve));
  min-height: 0;
  align-content: start;
  gap: var(--space-lg);
  isolation: isolate;
  margin: 0;
  overflow: visible;
  padding: var(--titlebar-height) 0 0;
}

.fluidBackground {
  position: fixed;
  inset: 0 0 0 var(--shell-left-column-target-width, 0);
  z-index: 0;
  width: calc(100vw - var(--shell-left-column-target-width, 0));
  height: 100vh;
  border-radius: var(--workspace-left-radius, 18px) 0 0
    var(--workspace-left-radius, 18px);
  pointer-events: none;
  opacity: 1;
  contain: strict;
}

.header {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(
    var(--prompt-content-width),
    calc(100% - var(--prompt-edge-gutter) - var(--prompt-edge-gutter))
  );
  gap: var(--space-md);
  margin: 0 auto;
  padding: 0;
}

.moment {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-weight: var(--typo-label-weight);
  letter-spacing: 0;
  text-transform: uppercase;
}

.moment::before {
  content: "";
  display: block;
  width: 38px;
  height: 8px;
  border-radius: var(--radius-pill);
  background:
    radial-gradient(
      circle at 4px 4px,
      var(--text-primary) 0 4px,
      transparent 4.5px
    ),
    radial-gradient(
      circle at 19px 4px,
      var(--text-secondary) 0 4px,
      transparent 4.5px
    ),
    radial-gradient(
      circle at 34px 4px,
      var(--line-strong) 0 4px,
      transparent 4.5px
    );
}

.titleRow {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--space-4);
}

.titleRow[data-has-title-icon="true"] {
  min-height: var(--prompt-title-icon-size);
}

.titleIcon {
  position: absolute;
  top: 0;
  right: calc(100% + var(--prompt-title-icon-gap));
  display: block;
  width: var(--prompt-title-icon-size);
  height: var(--prompt-title-icon-size);
  color: var(--text-primary);
}

.titleIcon img,
.titleIcon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.titleIcon img {
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

.titleCopy {
  display: grid;
  min-width: 0;
  gap: var(--space-md);
}

.title {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--typo-new-chat-title-size);
  font-weight: var(--typo-new-chat-title-weight);
  letter-spacing: var(--typo-new-chat-title-letter-spacing);
  line-height: var(--typo-new-chat-title-line-height);
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.description {
  max-width: 560px;
  color: var(--text-secondary);
}

.paletteControl {
  display: flex;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
  gap: var(--space-sm);
  -webkit-app-region: no-drag;
}

.paletteOption {
  display: inline-flex;
  height: var(--control-height-sm);
  align-items: center;
  gap: var(--space-xs);
  padding: 0 var(--space-sm);
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--radius-pill);
  appearance: none;
  background: color-mix(in srgb, var(--surface-raised) 54%, transparent);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.paletteOption:hover,
.paletteOption[data-active="true"] {
  border-color: color-mix(in srgb, var(--text-primary) 20%, var(--line));
  background: color-mix(in srgb, var(--surface-raised) 76%, transparent);
  color: var(--text-primary);
}

.paletteOption:hover {
  transform: translateY(-1px);
}

.paletteSwatches {
  display: inline-flex;
  align-items: center;
}

.paletteSwatch {
  width: 12px;
  height: 12px;
  margin-inline-start: -3px;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 1px
    color-mix(in srgb, var(--surface-raised) 80%, transparent);
}

.paletteSwatch:first-child {
  margin-inline-start: 0;
}

.paletteLabel {
  font-size: var(--font-size-2);
  font-weight: var(--typo-label-weight);
  letter-spacing: 0;
  line-height: var(--line-height-label);
  white-space: nowrap;
}

.railViewport {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
  overflow: auto hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.railViewport::-webkit-scrollbar {
  display: none;
}

.grid {
  display: grid;
  width: max-content;
  min-width: 100%;
  grid-auto-columns: minmax(198px, 224px);
  grid-auto-flow: column;
  gap: var(--space-4);
  padding-block: 0 var(--space-2);
  padding-inline: max(var(--prompt-content-inset), var(--prompt-edge-gutter));
  scroll-padding-inline: max(
    var(--prompt-content-inset),
    var(--prompt-edge-gutter)
  );
  scroll-snap-type: x mandatory;
}

.itemFrame {
  --tinted-glass-bg: color-mix(in srgb, var(--surface-raised) 58%, transparent);
  --tinted-glass-border: color-mix(
    in srgb,
    var(--composer-glass-border) 72%,
    var(--line)
  );
  --tinted-glass-tint: color-mix(
    in srgb,
    var(--surface-raised) 48%,
    transparent
  );
  --tinted-glass-filter: saturate(1.24) blur(var(--tinted-glass-blur));
  --tinted-glass-shadow: none;

  position: relative;
  min-height: 260px;
  scroll-snap-align: start;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.itemFrame:hover:not([data-disabled="true"]) {
  --tinted-glass-bg: color-mix(in srgb, var(--surface-raised) 68%, transparent);
  --tinted-glass-border: color-mix(
    in srgb,
    var(--composer-glass-border) 88%,
    var(--line)
  );

  transform: translateY(-2px);
}

.item {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: inherit;
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: var(--space-5);
  padding: var(--space-4);
  border-radius: inherit;
  background: transparent;
  text-align: left;
}

.item:hover:not([data-disabled="true"]) {
  background: transparent;
}

.itemMeta {
  color: color-mix(in srgb, var(--text-secondary) 62%, transparent);
  font-weight: var(--typo-label-weight);
  letter-spacing: 0;
}

.itemCopy {
  display: grid;
  align-self: end;
  gap: var(--space-2);
  min-width: 0;
}

.itemTitle {
  color: var(--text-primary);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.itemDescription {
  color: var(--text-secondary);
}

@media (width <= 900px) {
  .title {
    font-size: var(--typo-new-chat-title-size-md);
  }

  .grid {
    grid-auto-columns: minmax(194px, 218px);
  }
}

@media (width <= 560px) {
  .root {
    gap: var(--space-lg);
    padding-block-start: var(--titlebar-height);
  }

  .title {
    font-size: var(--typo-new-chat-title-size-sm);
  }

  .titleRow {
    gap: var(--space-3);
  }

  .titleCopy {
    gap: var(--space-sm);
  }

  .grid {
    grid-auto-columns: minmax(200px, 66vw);
  }

  .itemFrame {
    min-height: 238px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fluidBackground {
    opacity: 0.72;
  }

  .itemFrame {
    transition: none;
  }

  .paletteOption {
    transition: none;
  }

  .paletteOption:hover {
    transform: none;
  }

  .itemFrame:hover:not([data-disabled="true"]) {
    transform: none;
  }
}
