/* Page-specific layout alignment for history, prompts and text-video. */

#page-history .collection-page-hero,
#page-prompts .collection-page-hero,
#page-text-video .collection-page-hero {
  margin-bottom: 1.05rem;
  padding-bottom: 0;
}

#page-history .collection-page-hero__copy,
#page-prompts .collection-page-hero__copy,
#page-text-video .collection-page-hero__copy {
  display: grid;
  gap: 0.45rem;
  max-width: min(100%, 58rem);
}

#page-history .collection-page-hero .guest-discovery-hero__title,
#page-prompts .collection-page-hero .guest-discovery-hero__title,
#page-text-video .collection-page-hero .guest-discovery-hero__title {
  margin: 0;
  max-width: min(100%, 38ch);
}

#page-history .collection-page-hero .subpage-lede,
#page-prompts .collection-page-hero .subpage-lede,
#page-text-video .collection-page-hero .subpage-lede,
#page-history .collection-page-hero__text,
#page-prompts .collection-page-hero__text,
#page-text-video .collection-page-hero__text {
  max-width: 56ch;
}

#page-history .collection-page-hero__text,
#page-prompts .collection-page-hero__text,
#page-text-video .collection-page-hero__text {
  margin-top: 0.08rem;
  margin-bottom: 0.15rem;
}

#page-history .collection-page-shell,
#page-prompts .collection-page-shell,
#page-text-video .collection-page-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 1.2rem;
  padding: 1.45rem;
  border-radius: calc(var(--radius) + 6px);
  border-color: rgba(255, 255, 255, 0.1);
  /* Full-height stack only — avoids a hard “shelf” where a fixed-height ::before ended */
  background:
    radial-gradient(ellipse 95% 48% at 8% -8%, rgba(255, 255, 255, 0.09), transparent 62%),
    radial-gradient(ellipse 80% 42% at 94% 4%, rgba(255, 255, 255, 0.055), transparent 58%),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.07) 0%,
      rgba(255, 255, 255, 0.042) 18%,
      rgba(255, 255, 255, 0.028) 42%,
      rgba(255, 255, 255, 0.022) 65%,
      rgba(255, 255, 255, 0.028) 100%
    ),
    rgba(10, 12, 20, 0.76);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

#page-history .collection-page-shell > *,
#page-prompts .collection-page-shell > *,
#page-text-video .collection-page-shell > * {
  position: relative;
  z-index: 1;
}

#page-history .collection-page-shell__head,
#page-prompts .collection-page-shell__head,
#page-text-video .collection-page-shell__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.2rem;
  position: relative;
  z-index: 1;
}

#page-history .collection-page-shell__intro,
#page-prompts .collection-page-shell__intro,
#page-text-video .collection-page-shell__intro {
  min-width: 0;
  max-width: 48rem;
  gap: 0.46rem;
}

#page-history .collection-page-shell__title,
#page-prompts .collection-page-shell__title,
#page-text-video .collection-page-shell__title {
  margin: 0.05rem 0 0;
}

#page-history .collection-page-shell__lede,
#page-prompts .collection-page-shell__lede,
#page-text-video .collection-page-shell__lede {
  margin: 0;
  color: color-mix(in srgb, var(--text) 84%, transparent);
  font-size: 0.97rem;
  line-height: 1.58;
}

#page-history .collection-page-shell__section,
#page-prompts .collection-page-shell__section,
#page-text-video .collection-page-shell__section {
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

#page-history .collection-page-shell__section--list,
#page-prompts .collection-page-shell__section--list,
#page-text-video .collection-page-shell__section--list {
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#page-history .collection-page-shell > .guest-discovery-shell:not([hidden]),
#page-prompts .collection-page-shell > .guest-discovery-shell:not([hidden]),
#page-text-video .collection-page-shell .guest-discovery-shell:not([hidden]) {
  margin-top: 0.3rem;
}

#page-history .collection-page-shell:has(.guest-discovery-shell:not([hidden])) .collection-page-shell__head,
#page-prompts .collection-page-shell:has(.guest-discovery-shell:not([hidden])) .collection-page-shell__head,
#page-text-video .collection-page-shell:has(.guest-discovery-shell:not([hidden])) .collection-page-shell__head {
  display: none;
}

#page-history .collection-page-shell:has(.guest-discovery-shell:not([hidden])) .collection-page-shell__section--list,
#page-prompts .collection-page-shell:has(.guest-discovery-shell:not([hidden])) .collection-page-shell__section--list,
#page-text-video .collection-page-shell:has(.guest-discovery-shell:not([hidden])) .collection-page-shell__section--list {
  border-top: 0;
  padding-top: 0;
}

#page-history .kling-history-list,
#page-prompts .prompt-history-list,
#page-text-video .text-video-history-list {
  margin-top: 0;
}

/* Videohistorik: uniform SaaS/Envato-liknande media-grid (kort = full media-behållare) */
#page-history #kling-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 1rem;
  align-items: stretch;
  justify-content: stretch;
}

#page-history #kling-history-list > .kling-history-item {
  width: auto;
  max-width: none;
  flex: unset;
  min-width: 0;
}

#page-history .kling-history-card--gallery.user-history-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  min-height: 0;
  cursor: pointer;
  border-radius: 20px;
  overflow: hidden;
  background: #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

#page-history .kling-history-item:hover .kling-history-card--gallery.user-history-card,
#page-history .kling-history-item:focus-within .kling-history-card--gallery.user-history-card {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.16);
}

#page-history .kling-history-card--gallery.user-history-card:focus-visible {
  outline: none;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.55),
    inset 0 0 0 2px color-mix(in srgb, var(--accent) 72%, transparent);
}

#page-history .kling-history-gallery__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0c10;
}

#page-history .kling-history-preview--gallery {
  position: absolute;
  inset: 0;
  aspect-ratio: unset;
  border-radius: 0;
  border: 0;
}

#page-history .kling-history-gallery__media .kling-history-preview__media,
#page-history .kling-history-gallery__media .kling-history-preview__media--img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 0;
  pointer-events: none;
}

#page-history .kling-history-preview--broken.kling-history-preview--gallery {
  background: linear-gradient(145deg, #1a2230 0%, #0a0c10 100%);
}

#page-history .kling-history-gallery__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.02) 0%, rgba(6, 8, 12, 0.12) 45%, rgba(6, 8, 12, 0.42) 100%);
  opacity: 0.55;
  transition: opacity 0.28s ease;
}

#page-history .kling-history-item:hover .kling-history-gallery__scrim,
#page-history .kling-history-item:focus-within .kling-history-gallery__scrim,
#page-history .kling-history-item--preview-on .kling-history-gallery__scrim {
  opacity: 0.78;
}

#page-history .kling-history-gallery__warn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(245, 166, 35, 0.95);
  box-shadow: 0 0 0 2px rgba(8, 10, 16, 0.65);
  z-index: 5;
}

#page-history .kling-history-gallery__chrome {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

#page-history .kling-history-gallery__chrome > * {
  pointer-events: auto;
}

/* Chips ska inte fånga klick (helt kort = modal); starkare selector än .chrome > * */
#page-history .kling-history-gallery__chrome > .kling-history-gallery__chips {
  pointer-events: none;
}

/* Chips överst: vänster primär (Populär / stil-modell), höger sekundär vid Populär */
#page-history .kling-history-gallery__chips {
  position: absolute;
  top: 0.42rem;
  left: 0.42rem;
  right: 2.55rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  z-index: 5;
}

#page-history .kling-history-gallery__chips-left,
#page-history .kling-history-gallery__chips-right {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}

#page-history .kling-history-gallery__chips-right:empty {
  display: none;
}

#page-history .kling-history-gallery__chips .kling-history-gallery__chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page-history .kling-history-gallery__chips .inspiration-chip {
  font-size: 0.68rem;
  padding: 0.22rem 0.52rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

#page-history .kling-history-gallery__chip--popular {
  border-color: color-mix(in srgb, var(--accent) 52%, rgba(255, 255, 255, 0.18));
  background: color-mix(in srgb, rgba(255, 255, 255, 0.09) 65%, var(--accent) 35%);
  color: #f8fafc;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent),
    0 6px 20px color-mix(in srgb, var(--accent) 28%, rgba(0, 0, 0, 0.35));
}

#page-history .kling-history-gallery__chip--ttv,
#page-history .inspiration-chip--ttv {
  border-color: color-mix(in srgb, var(--accent) 38%, rgba(255, 255, 255, 0.18));
  background: color-mix(in srgb, var(--accent) 14%, rgba(13, 17, 24, 0.62));
  color: color-mix(in srgb, #fff 88%, var(--accent) 12%);
  backdrop-filter: blur(6px);
}

#page-history .kling-history-gallery__icon-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0.45rem 0.5rem 0.5rem;
  background: linear-gradient(180deg, transparent 0%, rgba(4, 6, 10, 0.55) 55%, rgba(4, 6, 10, 0.82) 100%);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  pointer-events: none;
}

#page-history .kling-history-gallery__icon-strip--desktop {
  pointer-events: none;
}

#page-history .kling-history-gallery__icon-strip .kling-history-gallery__toolbar {
  pointer-events: auto;
}

#page-history .kling-history-item:hover .kling-history-gallery__icon-strip--desktop,
#page-history .kling-history-item:focus-within .kling-history-gallery__icon-strip--desktop,
#page-history .kling-history-item--preview-on .kling-history-gallery__icon-strip--desktop {
  opacity: 1;
  transform: translateY(0);
}

#page-history .kling-history-gallery__toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0.2rem 0.28rem;
  border-radius: 10px;
  background: rgba(6, 8, 14, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

#page-history .kling-history-gallery__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.14s ease;
}

#page-history .kling-history-gallery__icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 6px 18px rgba(0, 0, 0, 0.28);
  color: #fff;
}

#page-history .kling-history-gallery__icon-btn:active:not(:disabled) {
  transform: scale(0.96);
}

#page-history .kling-history-gallery__icon-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

#page-history .kling-history-gallery__svg {
  display: block;
  flex-shrink: 0;
}

#page-history .kling-history-gallery__svg--dots {
  display: block;
  opacity: 0.88;
}

#page-history .kling-history-gallery__more {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: none;
}

#page-history .kling-history-gallery__more-trigger {
  list-style: none;
  cursor: pointer;
  width: 1.95rem;
  height: 1.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 8, 14, 0.38);
  color: rgba(255, 255, 255, 0.9);
  line-height: 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

#page-history .kling-history-gallery__more-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

#page-history .kling-history-gallery__more-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

#page-history .kling-history-gallery__more-trigger::-webkit-details-marker {
  display: none;
}

#page-history .kling-history-gallery__menu--icons {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 2.75rem;
  padding: 0.4rem;
  border-radius: calc(var(--radius-sm) + 2px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 14, 22, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  z-index: 8;
}

#page-history .kling-history-gallery__menu--icons .kling-history-gallery__toolbar {
  flex-direction: column;
  align-items: stretch;
  gap: 0.12rem;
  padding: 0.28rem;
}

#page-history .kling-history-gallery__menu--icons .kling-history-gallery__icon-btn {
  width: 2.1rem;
  height: 2.1rem;
}

#page-history .kling-history-card-extend-msg {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 2.85rem;
  margin: 0;
  font-size: 0.75rem;
  max-width: none;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  #page-history .kling-history-gallery__more {
    display: none;
  }

  #page-history .kling-history-gallery__chips {
    right: 0.42rem;
  }
}

@media (hover: none), (pointer: coarse) {
  #page-history .kling-history-gallery__warn {
    right: auto;
    left: 0.45rem;
  }

  #page-history .kling-history-gallery__icon-strip--desktop {
    display: none;
  }

  #page-history .kling-history-gallery__more {
    display: block;
  }

  #page-history .kling-history-item:hover .kling-history-gallery__scrim,
  #page-history .kling-history-item:focus-within .kling-history-gallery__scrim {
    opacity: 0.82;
  }
}

@media (max-width: 640px) {
  #page-history #kling-history-list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
  }
}

#page-text-video .text-video-stage {
  gap: 1.25rem;
}

#page-history .kling-history-panel,
#page-prompts .prompts-history-panel,
#page-text-video .text-video-stage {
  margin-bottom: 2rem;
}

#page-history .collection-page-shell__head .btn,
#page-prompts .collection-page-shell__head .btn {
  align-self: flex-start;
}

#page-history .kling-history-header,
#page-prompts .prompts-history-header {
  margin-bottom: 0;
}

#page-history .kling-history-details,
#page-prompts .prompts-history-details {
  margin: 0;
}

#page-history .kling-history-details,
#page-prompts .prompts-history-details,
#page-text-video .text-video-history > .hint,
#page-text-video .text-video-hint {
  max-width: 48rem;
}

#page-history .kling-history-action-msg {
  margin-top: 0;
}

#page-text-video .text-video-stage .text-video-layout {
  margin: 0;
  gap: 1.4rem;
}

#page-text-video .collection-page-shell__head {
  padding-bottom: 0.25rem;
}

#page-text-video .text-video-stage .guest-discovery-shell:not([hidden]) {
  grid-column: 1 / -1;
}

#page-text-video .text-video-panel,
#page-text-video .text-video-history {
  height: 100%;
  position: relative;
  border-color: rgba(255, 255, 255, 0.1);
  /* Match shell: soft vertical wash + brand glow that fades deep into the card (no mid-card band) */
  background:
    radial-gradient(ellipse 115% 80% at 18% -12%, color-mix(in srgb, var(--brand-purple) 12%, transparent), transparent 65%),
    radial-gradient(ellipse 95% 62% at 92% 2%, color-mix(in srgb, var(--brand-magenta) 9%, transparent), transparent 60%),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.055) 0%,
      rgba(255, 255, 255, 0.032) 28%,
      rgba(255, 255, 255, 0.02) 55%,
      rgba(255, 255, 255, 0.026) 100%
    ),
    rgba(10, 12, 20, 0.78);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

#page-text-video .text-video-panel__title,
#page-text-video .text-video-history__title {
  margin-bottom: 0.45rem;
  font-size: 1.08rem;
}

#page-text-video .text-video-hint {
  margin: 0.7rem 0 1rem;
}

#page-text-video .text-video-progress {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
}

#page-text-video .text-video-result {
  margin-top: 1.35rem;
  padding-top: 1.05rem;
}

#page-text-video .text-video-history > .hint {
  margin: 0 0 0.95rem;
}

#page-text-video .text-video-history__lede {
  margin: 0 0 0.85rem;
  max-width: 40rem;
}

#page-text-video .text-video-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

#page-text-video .text-video-flow__step {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.28rem 0.62rem 0.28rem 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: color-mix(in srgb, var(--muted) 92%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

#page-text-video .text-video-flow__step--current {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: color-mix(in srgb, var(--text) 90%, transparent);
}

#page-text-video .text-video-flow__step--done {
  border-color: color-mix(in srgb, var(--accent) 35%, rgba(255, 255, 255, 0.1));
}

#page-text-video .text-video-flow__step--done .text-video-flow__dot {
  background: color-mix(in srgb, var(--accent) 72%, #1a2230);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
}

#page-text-video .text-video-flow__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

#page-text-video .text-video-canvas {
  margin: 0 0 0.85rem;
  padding: 0;
  border: none;
  background: transparent;
}

#page-text-video .text-video-canvas__label {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 88%, transparent);
}

#page-text-video .text-video-textarea--canvas {
  min-height: 11.5rem;
  padding: 1rem 1.05rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, transparent 42%),
    rgba(8, 10, 16, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 40px rgba(0, 0, 0, 0.25);
  font-size: 1.02rem;
  line-height: 1.5;
  resize: vertical;
}

#page-text-video .text-video-textarea--canvas::placeholder {
  color: color-mix(in srgb, var(--muted) 82%, transparent);
  line-height: 1.45;
}

#page-text-video .text-video-textarea--canvas:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 45%, rgba(255, 255, 255, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent),
    0 14px 44px rgba(0, 0, 0, 0.35);
}

#page-text-video .text-video-actions--hub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

#page-text-video .text-video-actions--hub .btn.secondary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

#page-text-video .text-video-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr));
  gap: 1rem;
  margin-top: 0.15rem;
  align-items: stretch;
}

#page-text-video .text-video-history-list > .hint {
  grid-column: 1 / -1;
}

#page-text-video .text-video-history-item {
  min-width: 0;
}

#page-text-video .text-video-gallery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  cursor: pointer;
  border-radius: 20px;
  overflow: hidden;
  background: #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

#page-text-video .text-video-gallery-card:focus-visible {
  outline: none;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.55),
    inset 0 0 0 2px color-mix(in srgb, var(--accent) 72%, transparent);
}

#page-text-video .text-video-history-item:hover .text-video-gallery-card,
#page-text-video .text-video-history-item:focus-within .text-video-gallery-card {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.16);
}

#page-text-video .text-video-gallery-card__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  flex: 0 0 auto;
  overflow: hidden;
  background: #0a0c10;
}

#page-text-video .text-video-gallery-card__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#page-text-video .text-video-gallery-card__video,
#page-text-video .text-video-gallery-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  transform: scale(1);
  transition: transform 0.38s ease;
}

#page-text-video .text-video-gallery-card__placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #1a2230 0%, #0a0c10 100%);
}

#page-text-video .text-video-gallery-card__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.02) 0%, rgba(6, 8, 12, 0.38) 100%);
  opacity: 0.55;
  transition: opacity 0.28s ease;
}

#page-text-video .text-video-history-item:hover .text-video-gallery-card__scrim,
#page-text-video .text-video-history-item:focus-within .text-video-gallery-card__scrim,
#page-text-video .text-video-history-item--preview-on .text-video-gallery-card__scrim {
  opacity: 0.78;
}

#page-text-video .text-video-history-item:hover .text-video-gallery-card__video,
#page-text-video .text-video-history-item:focus-within .text-video-gallery-card__video,
#page-text-video .text-video-history-item:hover .text-video-gallery-card__img,
#page-text-video .text-video-history-item:focus-within .text-video-gallery-card__img,
#page-text-video .text-video-history-item--preview-on .text-video-gallery-card__video {
  transform: scale(1.045);
}

#page-text-video .text-video-gallery-card__chrome {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

#page-text-video .text-video-gallery-card__chrome > .text-video-gallery-card__chips {
  pointer-events: none;
}

#page-text-video .text-video-gallery-card__chips {
  position: absolute;
  top: 0.42rem;
  left: 0.42rem;
  right: 2.55rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  z-index: 5;
}

#page-text-video .text-video-gallery-card__chips-left,
#page-text-video .text-video-gallery-card__chips-right {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}

#page-text-video .text-video-gallery-card__chips-right:empty {
  display: none;
}

#page-text-video .text-video-gallery-card__chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.62rem;
  padding: 0.14rem 0.44rem;
}

#page-text-video .text-video-gallery-card__chip--status {
  color: color-mix(in srgb, var(--muted) 92%, transparent);
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(8, 10, 16, 0.45);
  font-weight: 500;
}

#page-text-video .text-video-gallery-card__icon-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  padding: 0.45rem 0.5rem;
  background: linear-gradient(180deg, transparent 0%, rgba(4, 6, 10, 0.55) 55%, rgba(4, 6, 10, 0.82) 100%);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  pointer-events: none;
}

#page-text-video .text-video-gallery-card__icon-strip .text-video-gallery-card__toolbar {
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  #page-text-video .text-video-history-item:hover .text-video-gallery-card__icon-strip--desktop,
  #page-text-video .text-video-history-item:focus-within .text-video-gallery-card__icon-strip--desktop {
    opacity: 1;
    transform: translateY(0);
  }
}

#page-text-video .text-video-gallery-card__toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.06rem;
  padding: 0.2rem 0.28rem;
  border-radius: 10px;
  background: rgba(6, 8, 14, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

#page-text-video .text-video-gallery-card__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font: inherit;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.14s ease;
}

#page-text-video .text-video-gallery-card__icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 6px 18px rgba(0, 0, 0, 0.28);
}

#page-text-video .text-video-gallery-card__svg {
  display: block;
}

#page-text-video .text-video-gallery-card__caption {
  margin: 0;
  padding: 0.55rem 0.65rem 0.65rem;
  display: grid;
  gap: 0.2rem;
  background: linear-gradient(180deg, rgba(10, 12, 18, 0.95) 0%, #0b0d12 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#page-text-video .text-video-gallery-card__caption-text {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  color: color-mix(in srgb, var(--text) 90%, transparent);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#page-text-video .text-video-gallery-card__caption-meta {
  font-size: 0.68rem;
  color: color-mix(in srgb, var(--muted) 90%, transparent);
}

@media (hover: none), (pointer: coarse) {
  #page-text-video .text-video-gallery-card__icon-strip--desktop {
    display: flex;
    opacity: 1;
    transform: none;
    top: auto;
    bottom: auto;
    inset: 0.42rem 0.42rem auto auto;
    left: auto;
    padding: 0;
    background: transparent;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-text-video .text-video-history-item:hover .text-video-gallery-card__video,
  #page-text-video .text-video-history-item:focus-within .text-video-gallery-card__video,
  #page-text-video .text-video-history-item:hover .text-video-gallery-card__img,
  #page-text-video .text-video-history-item:focus-within .text-video-gallery-card__img,
  #page-text-video .text-video-history-item--preview-on .text-video-gallery-card__video {
    transform: none;
  }

  #page-text-video .text-video-history-item:hover .text-video-gallery-card,
  #page-text-video .text-video-history-item:focus-within .text-video-gallery-card {
    transform: none;
  }
}

@media (max-width: 720px) {
  #page-history .collection-page-shell,
  #page-prompts .collection-page-shell,
  #page-text-video .collection-page-shell {
    padding: 1rem;
    border-radius: calc(var(--radius) + 4px);
  }

  #page-history .collection-page-hero .guest-discovery-hero__title,
  #page-prompts .collection-page-hero .guest-discovery-hero__title,
  #page-text-video .collection-page-hero .guest-discovery-hero__title {
    max-width: none;
  }

  #page-text-video .text-video-stage .text-video-layout {
    gap: 1rem;
  }

  #page-text-video .text-video-history-list {
    grid-template-columns: 1fr;
  }
}

/* Videohistorik: stjärnbetyg i inspirations-modalen (ingen ny CSS i style.css) */
.motionlinq-modal--inspiration-preview .kling-history-modal-rating {
  margin: 0.65rem 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 10, 16, 0.45);
}

.motionlinq-modal--inspiration-preview .kling-history-modal-rating__label {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--text) 88%, transparent);
  letter-spacing: 0.01em;
}

.motionlinq-modal--inspiration-preview .kling-history-modal-rating__stars {
  display: flex;
  align-items: center;
  gap: 0.12rem;
}

.motionlinq-modal--inspiration-preview .kling-history-modal-rating__star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.18rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  cursor: pointer;
  line-height: 0;
  transition:
    color 0.14s ease,
    background 0.14s ease,
    transform 0.12s ease;
}

.motionlinq-modal--inspiration-preview .kling-history-modal-rating__star:hover {
  background: rgba(255, 255, 255, 0.06);
  color: color-mix(in srgb, var(--text) 78%, transparent);
}

.motionlinq-modal--inspiration-preview .kling-history-modal-rating__star:active {
  transform: scale(0.94);
}

.motionlinq-modal--inspiration-preview .kling-history-modal-rating__star-icon {
  display: block;
}

.motionlinq-modal--inspiration-preview .kling-history-modal-rating__star:not(.kling-history-modal-rating__star--on) .kling-history-modal-rating__star-icon {
  fill: none;
}

.motionlinq-modal--inspiration-preview .kling-history-modal-rating__star--on {
  color: color-mix(in srgb, var(--accent) 82%, #f8fafc 18%);
}

.motionlinq-modal--inspiration-preview .kling-history-modal-rating__star--on .kling-history-modal-rating__star-icon {
  fill: currentColor;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 35%, transparent));
}

/* Senaste prompts: bibliotekskort (media + prompt, overlay som videohistorik) */
#page-prompts #prompt-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 1rem;
  align-items: stretch;
}

#page-prompts #prompt-history-list > .prompt-history-item {
  min-width: 0;
}

@media (max-width: 1100px) {
  #page-prompts #prompt-history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #page-prompts #prompt-history-list {
    grid-template-columns: 1fr;
  }
}

#page-prompts .prompt-library-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  cursor: pointer;
  border-radius: 20px;
  overflow: hidden;
  background: #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

#page-prompts .prompt-history-item:hover .prompt-library-card,
#page-prompts .prompt-history-item:focus-within .prompt-library-card {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.16);
}

#page-prompts .prompt-library-card:focus-visible {
  outline: none;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.55),
    inset 0 0 0 2px color-mix(in srgb, var(--accent) 72%, transparent);
}

#page-prompts .prompt-library-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  flex: 0 0 auto;
  overflow: hidden;
  background: #0a0c10;
}

#page-prompts .prompt-library-card__media-inner {
  position: absolute;
  inset: 0;
}

#page-prompts .prompt-library-card__media-chips {
  position: absolute;
  top: 0.42rem;
  left: 0.45rem;
  right: 0.45rem;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  pointer-events: none;
}

#page-prompts .prompt-library-card__media-chips-left,
#page-prompts .prompt-library-card__media-chips-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  min-width: 0;
}

#page-prompts .prompt-library-card__media-chips-left:empty + .prompt-library-card__media-chips-right {
  margin-left: auto;
}

#page-prompts .prompt-library-card__media-chips .prompt-library-card__chip {
  font-size: 0.62rem;
  padding: 0.14rem 0.42rem;
  letter-spacing: 0.01em;
}

#page-prompts .prompt-library-card__chip--status {
  color: color-mix(in srgb, var(--muted) 92%, transparent);
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(8, 10, 16, 0.45);
  font-weight: 500;
}

#page-prompts .prompt-library-card__img,
#page-prompts .prompt-library-card__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  transform: scale(1);
  transition: transform 0.38s ease;
}

#page-prompts .prompt-library-card__placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #1a2230 0%, #0a0c10 100%);
}

#page-prompts .prompt-library-card__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.02) 0%, rgba(6, 8, 12, 0.35) 100%);
  opacity: 0.55;
  transition: opacity 0.28s ease;
}

#page-prompts .prompt-history-item:hover .prompt-library-card__scrim,
#page-prompts .prompt-history-item:focus-within .prompt-library-card__scrim {
  opacity: 0.78;
}

#page-prompts .prompt-history-item:hover .prompt-library-card__img,
#page-prompts .prompt-history-item:focus-within .prompt-library-card__img,
#page-prompts .prompt-history-item:hover .prompt-library-card__video,
#page-prompts .prompt-history-item:focus-within .prompt-library-card__video {
  transform: scale(1.045);
}

#page-prompts .prompt-history-item--preview-on .prompt-library-card__scrim {
  opacity: 0.82;
}

#page-prompts .prompt-library-card__placeholder--empty {
  padding: 0;
}

#page-prompts .prompt-library-card__chrome {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

#page-prompts .prompt-library-card__icon-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  padding: 0.45rem 0.5rem;
  background: linear-gradient(180deg, transparent 0%, rgba(4, 6, 10, 0.55) 55%, rgba(4, 6, 10, 0.82) 100%);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  pointer-events: none;
}

#page-prompts .prompt-library-card__icon-strip .prompt-library-card__toolbar {
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  #page-prompts .prompt-history-item:hover .prompt-library-card__icon-strip--desktop,
  #page-prompts .prompt-history-item:focus-within .prompt-library-card__icon-strip--desktop {
    opacity: 1;
    transform: translateY(0);
  }
}

#page-prompts .prompt-library-card__toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.06rem;
  padding: 0.2rem 0.28rem;
  border-radius: 10px;
  background: rgba(6, 8, 14, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

#page-prompts .prompt-library-card__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.14s ease;
}

#page-prompts .prompt-library-card__icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 6px 18px rgba(0, 0, 0, 0.28);
}

#page-prompts .prompt-library-card__svg {
  display: block;
}

#page-prompts .prompt-library-card__more {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: none;
  pointer-events: auto;
}

#page-prompts .prompt-library-card__more-trigger {
  list-style: none;
  width: 1.95rem;
  height: 1.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 8, 14, 0.38);
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#page-prompts .prompt-library-card__more-trigger::-webkit-details-marker {
  display: none;
}

#page-prompts .prompt-library-card__menu--icons {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 14, 22, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 8;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

#page-prompts .prompt-library-card__menu--icons .prompt-library-card__toolbar {
  flex-direction: column;
}

@media (hover: none), (pointer: coarse) {
  #page-prompts .prompt-library-card__icon-strip--desktop {
    display: none;
  }

  #page-prompts .prompt-library-card__more {
    display: block;
  }
}

@media (hover: hover) and (pointer: fine) {
  #page-prompts .prompt-library-card__more {
    display: none;
  }
}

#page-prompts .prompt-library-card__prompt-block {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.65rem 0.75rem 0.75rem;
  background: linear-gradient(180deg, rgba(10, 12, 18, 0.92) 0%, #0b0d12 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#page-prompts .prompt-library-card__prompt-text {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  color: color-mix(in srgb, var(--text) 92%, transparent);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#page-prompts .prompt-library-card__chip {
  font-size: 0.65rem;
  padding: 0.18rem 0.48rem;
}

@media (prefers-reduced-motion: reduce) {
  #page-prompts .prompt-history-item:hover .prompt-library-card__img,
  #page-prompts .prompt-history-item:focus-within .prompt-library-card__img,
  #page-prompts .prompt-history-item:hover .prompt-library-card__video,
  #page-prompts .prompt-history-item:focus-within .prompt-library-card__video {
    transform: none;
  }
}

.motionlinq-modal--inspiration-preview:has(#inspiration-preview-prompt-library-bar:not([hidden])) .inspiration-preview__unlock {
  display: none;
}

.motionlinq-modal--inspiration-preview .inspiration-preview-prompt-video-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.5rem 0 0.35rem;
}

.motionlinq-modal--inspiration-preview .prompt-lib-modal-video__el {
  width: 100%;
  max-height: min(280px, 40vh);
  border-radius: 12px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.motionlinq-modal--inspiration-preview:has(#inspiration-preview-prompt-video-gallery:not([hidden])) .inspiration-preview__unlock {
  display: none;
}

/* History / videoklipp modal: hero video vänster + action rail höger; prompt under videon (clamp + expand) */
.motionlinq-modal--inspiration-preview .inspiration-preview {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
  min-height: 0;
}

.motionlinq-modal--inspiration-preview .inspiration-preview__hero-row {
  display: grid;
  /* Video takes remaining width; narrow rail so hero is wider (labels still single-line at ~14.5rem) */
  grid-template-columns: minmax(0, 1fr) minmax(12.5rem, 14.5rem);
  gap: 1rem 1.1rem;
  align-items: stretch;
  min-width: 0;
}

.motionlinq-modal--inspiration-preview .inspiration-preview__hero-media {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  min-height: 0;
}

.motionlinq-modal--inspiration-preview .inspiration-preview__action-rail {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  flex-shrink: 0;
}

.motionlinq-modal--inspiration-preview .inspiration-preview__action-rail .inspiration-preview__body {
  flex: 1 1 auto;
  min-height: 0;
}

.motionlinq-modal--inspiration-preview .inspiration-preview__description-band {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-top: 0.35rem;
  margin-top: 0.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.motionlinq-modal--inspiration-preview .inspiration-preview__media-column {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  justify-self: stretch;
}

.motionlinq-modal--inspiration-preview .inspiration-preview__prompt-panel {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.motionlinq-modal--inspiration-preview .inspiration-preview-prompt-lib-bar {
  margin: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0.45rem;
}

.motionlinq-modal--inspiration-preview .inspiration-preview-prompt-lib-bar .btn {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
  padding-inline: 0.55rem;
}

.motionlinq-modal--inspiration-preview .inspiration-preview__prompt-wrap--preview {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.72rem 0.85rem;
  margin: 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.motionlinq-modal--inspiration-preview .inspiration-preview__prompt-wrap--preview:not(.is-expanded) .inspiration-preview__prompt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.875rem;
  line-height: 1.52;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.motionlinq-modal--inspiration-preview .inspiration-preview__prompt-wrap--preview.is-expanded .inspiration-preview__prompt {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  max-height: min(46vh, 20rem);
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.52;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
}

.motionlinq-modal--inspiration-preview .inspiration-preview__prompt-expand {
  align-self: flex-start;
}

.motionlinq-modal--inspiration-preview .inspiration-preview__prompt-wrap--preview .inspiration-preview__prompt.prompt-fade::after {
  display: none;
}

.motionlinq-modal--inspiration-preview .motionlinq-modal__actions--inspiration {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
}

.motionlinq-modal--inspiration-preview .motionlinq-modal__actions--inspiration .btn {
  width: 100%;
  white-space: nowrap;
  justify-content: center;
  padding-inline: 0.55rem;
}

/* Hero media fills the left grid track; video scales with column width (not a tiny fixed height box) */
.motionlinq-modal--inspiration-preview .inspiration-preview__media-wrap {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
}

.motionlinq-modal--inspiration-preview .inspiration-preview__hero-media .inspiration-preview__hero-stack {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: var(--insp-modal-ar, 1.777778);
  max-height: min(58vh, 560px);
  box-sizing: border-box;
}

.motionlinq-modal--inspiration-preview:has(#inspiration-preview-prompt-library-bar:not([hidden]))
  .inspiration-preview__hero-media
  .inspiration-preview__hero-stack {
  max-height: min(62vh, 600px);
}

/* Scrollbars: dark lilac/black to match modal shell */
.motionlinq-modal--inspiration-preview .motionlinq-modal__panel--inspiration > .inspiration-preview {
  scrollbar-width: thin;
  scrollbar-color: rgba(118, 88, 152, 0.55) rgba(10, 8, 16, 0.98);
}

.motionlinq-modal--inspiration-preview .motionlinq-modal__panel--inspiration > .inspiration-preview::-webkit-scrollbar {
  width: 8px;
}

.motionlinq-modal--inspiration-preview .motionlinq-modal__panel--inspiration > .inspiration-preview::-webkit-scrollbar-track {
  background: rgba(10, 8, 16, 0.98);
  border-radius: 4px;
}

.motionlinq-modal--inspiration-preview .motionlinq-modal__panel--inspiration > .inspiration-preview::-webkit-scrollbar-thumb {
  background: rgba(118, 88, 152, 0.52);
  border-radius: 4px;
}

.motionlinq-modal--inspiration-preview .motionlinq-modal__panel--inspiration > .inspiration-preview::-webkit-scrollbar-thumb:hover {
  background: rgba(138, 108, 172, 0.62);
}

.motionlinq-modal--inspiration-preview
  .inspiration-preview__prompt-wrap--preview.is-expanded
  .inspiration-preview__prompt {
  scrollbar-width: thin;
  scrollbar-color: rgba(118, 88, 152, 0.55) rgba(10, 8, 16, 0.98);
}

.motionlinq-modal--inspiration-preview
  .inspiration-preview__prompt-wrap--preview.is-expanded
  .inspiration-preview__prompt::-webkit-scrollbar {
  width: 8px;
}

.motionlinq-modal--inspiration-preview
  .inspiration-preview__prompt-wrap--preview.is-expanded
  .inspiration-preview__prompt::-webkit-scrollbar-track {
  background: rgba(10, 8, 16, 0.98);
  border-radius: 4px;
}

.motionlinq-modal--inspiration-preview
  .inspiration-preview__prompt-wrap--preview.is-expanded
  .inspiration-preview__prompt::-webkit-scrollbar-thumb {
  background: rgba(118, 88, 152, 0.52);
  border-radius: 4px;
}

.motionlinq-modal--inspiration-preview
  .inspiration-preview__prompt-wrap--preview.is-expanded
  .inspiration-preview__prompt::-webkit-scrollbar-thumb:hover {
  background: rgba(138, 108, 172, 0.62);
}

@media (max-width: 720px) {
  .motionlinq-modal--inspiration-preview .inspiration-preview__hero-row {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .motionlinq-modal--inspiration-preview .inspiration-preview__description-band {
    max-width: 100%;
    padding-top: 0.25rem;
    margin-top: 0;
    border-top: none;
  }

  .motionlinq-modal--inspiration-preview .motionlinq-modal__actions--inspiration {
    flex-wrap: wrap;
  }

  .motionlinq-modal--inspiration-preview .motionlinq-modal__actions--inspiration .btn {
    white-space: normal;
  }
}

/* --- Guest inspiration showcase (history / prompts / text-video, logged out) --- */
#page-history .guest-showcase,
#page-prompts .guest-showcase,
#page-text-video .guest-showcase {
  display: grid;
  gap: 1.35rem;
}

#page-history .guest-showcase__intro,
#page-prompts .guest-showcase__intro,
#page-text-video .guest-showcase__intro {
  display: grid;
  gap: 0.55rem;
  max-width: min(100%, 52rem);
}

#page-history .guest-showcase__title,
#page-prompts .guest-showcase__title,
#page-text-video .guest-showcase__title {
  margin: 0;
}

#page-history .guest-showcase__actions,
#page-prompts .guest-showcase__actions,
#page-text-video .guest-showcase__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0;
}

#page-history .guest-showcase__section,
#page-prompts .guest-showcase__section,
#page-text-video .guest-showcase__section {
  gap: 0.75rem;
}

#page-history .guest-showcase__section-title,
#page-prompts .guest-showcase__section-title,
#page-text-video .guest-showcase__section-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--text) 88%, transparent);
}

#page-history .guest-showcase-grid,
#page-prompts .guest-showcase-grid,
#page-text-video .guest-showcase-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 1rem;
  align-items: stretch;
}

#page-history .guest-showcase-item,
#page-prompts .guest-showcase-item,
#page-text-video .guest-showcase-item {
  min-width: 0;
}

#page-history .guest-showcase-grid .guest-showcase-card.inspiration-card,
#page-prompts .guest-showcase-grid .guest-showcase-card.inspiration-card,
#page-text-video .guest-showcase-grid .guest-showcase-card.inspiration-card {
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
  flex: unset;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition:
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

/* Block style.css .inspiration-card hover/focus transforms (loads after this file) — no layout shift */
#page-history .guest-showcase-grid .guest-showcase-card.inspiration-card:hover,
#page-history .guest-showcase-grid .guest-showcase-card.inspiration-card:focus-visible,
#page-prompts .guest-showcase-grid .guest-showcase-card.inspiration-card:hover,
#page-prompts .guest-showcase-grid .guest-showcase-card.inspiration-card:focus-visible,
#page-text-video .guest-showcase-grid .guest-showcase-card.inspiration-card:hover,
#page-text-video .guest-showcase-grid .guest-showcase-card.inspiration-card:focus-visible {
  transform: none;
}

#page-history .guest-showcase-item:hover .guest-showcase-card,
#page-history .guest-showcase-item:focus-within .guest-showcase-card,
#page-prompts .guest-showcase-item:hover .guest-showcase-card,
#page-prompts .guest-showcase-item:focus-within .guest-showcase-card,
#page-text-video .guest-showcase-item:hover .guest-showcase-card,
#page-text-video .guest-showcase-item:focus-within .guest-showcase-card {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.14);
}

#page-history .guest-showcase-card:focus-visible,
#page-prompts .guest-showcase-card:focus-visible,
#page-text-video .guest-showcase-card:focus-visible {
  outline: none;
  transform: none;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.5),
    inset 0 0 0 2px color-mix(in srgb, var(--accent) 72%, transparent);
}

/* Same media ratio as live #kling-history-list / #page-prompts .prompt-library-card__media */
#page-history .guest-showcase-card__frame,
#page-prompts .guest-showcase-card__frame,
#page-text-video .guest-showcase-card__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  flex-shrink: 0;
  overflow: hidden;
  background: #0a0c10;
}

#page-history .guest-showcase-card__media,
#page-prompts .guest-showcase-card__media,
#page-text-video .guest-showcase-card__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#page-history .guest-showcase-card__img,
#page-prompts .guest-showcase-card__img,
#page-text-video .guest-showcase-card__img,
#page-history .guest-showcase-card__video,
#page-prompts .guest-showcase-card__video,
#page-text-video .guest-showcase-card__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

#page-history .guest-showcase-card__video,
#page-prompts .guest-showcase-card__video,
#page-text-video .guest-showcase-card__video {
  pointer-events: none;
  z-index: 1;
}

#page-history .guest-showcase-card__placeholder,
#page-prompts .guest-showcase-card__placeholder,
#page-text-video .guest-showcase-card__placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #1a2230 0%, #0a0c10 100%);
}

#page-history .guest-showcase-card__scrim,
#page-prompts .guest-showcase-card__scrim,
#page-text-video .guest-showcase-card__scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.05) 0%, rgba(6, 8, 12, 0.42) 100%);
  opacity: 0.62;
  transition: opacity 0.28s ease;
}

#page-history .guest-showcase-item--preview-on .guest-showcase-card__scrim,
#page-prompts .guest-showcase-item--preview-on .guest-showcase-card__scrim,
#page-text-video .guest-showcase-item--preview-on .guest-showcase-card__scrim {
  opacity: 0.82;
}

#page-history .guest-showcase-item:hover:not(.guest-showcase-item--preview-on) .guest-showcase-card__scrim,
#page-history .guest-showcase-item:focus-within:not(.guest-showcase-item--preview-on) .guest-showcase-card__scrim,
#page-prompts .guest-showcase-item:hover:not(.guest-showcase-item--preview-on) .guest-showcase-card__scrim,
#page-prompts .guest-showcase-item:focus-within:not(.guest-showcase-item--preview-on) .guest-showcase-card__scrim,
#page-text-video .guest-showcase-item:hover:not(.guest-showcase-item--preview-on) .guest-showcase-card__scrim,
#page-text-video .guest-showcase-item:focus-within:not(.guest-showcase-item--preview-on) .guest-showcase-card__scrim {
  opacity: 0.78;
}

#page-history .guest-showcase-card__chrome,
#page-prompts .guest-showcase-card__chrome,
#page-text-video .guest-showcase-card__chrome {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  padding: 0.42rem 0.48rem;
}

#page-history .guest-showcase-card__chips,
#page-prompts .guest-showcase-card__chips,
#page-text-video .guest-showcase-card__chips {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
}

#page-history .guest-showcase-card__chip,
#page-prompts .guest-showcase-card__chip,
#page-text-video .guest-showcase-card__chip {
  font-size: 0.65rem;
  padding: 0.2rem 0.52rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

#page-history .guest-showcase-card__sheet,
#page-prompts .guest-showcase-card__sheet,
#page-text-video .guest-showcase-card__sheet {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.62rem 0.72rem 0.72rem;
  background: linear-gradient(180deg, rgba(10, 12, 18, 0.94) 0%, #0b0d12 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#page-history .guest-showcase-card__heading,
#page-prompts .guest-showcase-card__heading,
#page-text-video .guest-showcase-card__heading {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
  color: #f4f6ff;
}

#page-history .guest-showcase-card__excerpt,
#page-prompts .guest-showcase-card__excerpt,
#page-text-video .guest-showcase-card__excerpt {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.38;
  color: color-mix(in srgb, var(--text) 90%, transparent);
}

#page-history .guest-showcase-card__sheet .prompt-fade::after,
#page-prompts .guest-showcase-card__sheet .prompt-fade::after,
#page-text-video .guest-showcase-card__sheet .prompt-fade::after {
  background: linear-gradient(to bottom, rgba(11, 13, 18, 0), #0b0d12);
}

#page-history .guest-showcase-card__footer,
#page-prompts .guest-showcase-card__footer,
#page-text-video .guest-showcase-card__footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

#page-history .guest-showcase-card__hint,
#page-prompts .guest-showcase-card__hint,
#page-text-video .guest-showcase-card__hint {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--text) 60%, transparent);
  line-height: 1.3;
  text-align: center;
}

#page-history .guest-showcase-card__pill,
#page-prompts .guest-showcase-card__pill,
#page-text-video .guest-showcase-card__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, rgba(255, 255, 255, 0.14));
  background: color-mix(in srgb, var(--accent) 18%, rgba(255, 255, 255, 0.04));
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#page-history .guest-showcase-card__subcta,
#page-prompts .guest-showcase-card__subcta,
#page-text-video .guest-showcase-card__subcta {
  margin-top: 0.1rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--accent) 78%, #fff 22%);
  text-decoration: none;
  pointer-events: auto;
  text-align: center;
  align-self: center;
}

#page-history .guest-showcase-card__subcta:hover,
#page-prompts .guest-showcase-card__subcta:hover,
#page-text-video .guest-showcase-card__subcta:hover {
  text-decoration: underline;
}

#page-history .guest-showcase__empty,
#page-prompts .guest-showcase__empty,
#page-text-video .guest-showcase__empty {
  margin: 0.35rem 0 0;
  max-width: 42rem;
}

#page-history .guest-showcase__panel-cta,
#page-prompts .guest-showcase__panel-cta,
#page-text-video .guest-showcase__panel-cta {
  margin-top: 0.25rem;
  padding: 1.05rem 1.1rem 1.15rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(8, 10, 16, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#page-history .guest-showcase__panel-cta-title,
#page-prompts .guest-showcase__panel-cta-title,
#page-text-video .guest-showcase__panel-cta-title {
  margin: 0 0 0.28rem;
  font-size: 1.02rem;
  font-weight: 700;
}

#page-history .guest-showcase__panel-cta-text,
#page-prompts .guest-showcase__panel-cta-text,
#page-text-video .guest-showcase__panel-cta-text {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  line-height: 1.52;
  color: color-mix(in srgb, var(--text) 86%, transparent);
}

#page-history .guest-showcase__panel-cta-actions,
#page-prompts .guest-showcase__panel-cta-actions,
#page-text-video .guest-showcase__panel-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

@media (prefers-reduced-motion: reduce) {
  #page-history .guest-showcase-grid .guest-showcase-card.inspiration-card,
  #page-prompts .guest-showcase-grid .guest-showcase-card.inspiration-card,
  #page-text-video .guest-showcase-grid .guest-showcase-card.inspiration-card,
  #page-history .guest-showcase-card__scrim,
  #page-prompts .guest-showcase-card__scrim,
  #page-text-video .guest-showcase-card__scrim {
    transition: none;
  }
}

/* Text till video: utloggat showcase — samma tvåkolumns-grid som live (.text-video-layout) */
#page-text-video .guest-text-video-showcase.text-video-layout {
  margin: 0;
  width: 100%;
  max-width: 100%;
}

/* Stegvisare: längre etiketter på desktop, korta (Idé / Bild) på mobil */
#page-text-video .guest-text-video-showcase__stepper-label--mobile {
  display: none;
}

/* Desktop: vänster panel + preview i två kolumner (CTA ligger i vänster panel under stegvisaren) */
@media (min-width: 900px) {
  #page-text-video .guest-text-video-showcase.text-video-layout > .guest-text-video-showcase__panel {
    grid-column: 1;
    grid-row: 1;
  }

  #page-text-video .guest-text-video-showcase.text-video-layout > .guest-text-video-showcase__result {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
  }
}

#page-text-video .guest-text-video-showcase__cta--after-preview {
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* CTA sits under stepper inside the left panel (not a separate grid row) */
#page-text-video .guest-text-video-showcase__panel .guest-text-video-showcase__cta--after-preview {
  margin-top: 0.5rem;
}

#page-text-video .guest-text-video-showcase__cta--after-preview .text-video-actions.idea-to-video-root__actions {
  margin-top: 0;
}

#page-text-video .guest-text-video-showcase__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}

#page-text-video .guest-text-video-showcase__chips--demo {
  align-items: flex-start;
}

#page-text-video .guest-text-video-showcase__chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}

#page-text-video .guest-text-video-showcase__demo-step {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#page-text-video .guest-text-video-showcase__panel .guest-text-video-showcase__hint,
#page-text-video .guest-text-video-showcase__panel .text-video-hint.guest-text-video-showcase__hint {
  margin: 0.55rem 0 0.85rem;
}

/* Enskild demo-preview (inget separat kort under) */
#page-text-video .guest-text-video-showcase__result--solo-demo .guest-text-video-showcase__demo-rail {
  margin-bottom: 0.25rem;
}

#page-text-video .guest-text-video-showcase__result--solo-demo .guest-text-video-showcase__demo-stage {
  max-height: min(440px, 56vh);
}

#page-text-video .guest-text-video-showcase__result-footer {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  max-width: 40rem;
}

#page-text-video .guest-text-video-showcase textarea[readonly] {
  cursor: default;
  color: color-mix(in srgb, var(--text) 90%, transparent);
}

#page-text-video .guest-text-video-showcase__textarea {
  transition: opacity 0.32s ease, filter 0.32s ease;
}

#page-text-video .guest-text-video-showcase__textarea--swap-out {
  opacity: 0.35;
  filter: blur(1px);
}

#page-text-video .guest-text-video-showcase__textarea--swap-in {
  animation: guestTtvPromptSwapIn 0.52s ease forwards;
}

@keyframes guestTtvPromptSwapIn {
  from {
    opacity: 0.45;
    filter: blur(1px);
  }
  to {
    opacity: 1;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-text-video .guest-text-video-showcase__textarea,
  #page-text-video .guest-text-video-showcase__textarea--swap-out,
  #page-text-video .guest-text-video-showcase__textarea--swap-in {
    transition: none;
    animation: none;
    filter: none;
  }
}

#page-text-video .guest-text-video-showcase__stepper {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.2rem;
  margin: 0 0 0.95rem;
  padding: 0.5rem 0.45rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-elevated, #141820) 88%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

#page-text-video .guest-text-video-showcase__stepper-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 0 0 auto;
  min-width: 4.35rem;
  max-width: 7.2rem;
  min-height: 2.35rem;
  padding: 0.28rem 0.4rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: color-mix(in srgb, var(--text) 58%, transparent);
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

#page-text-video .guest-text-video-showcase__stepper-pill-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
}

#page-text-video .guest-text-video-showcase__stepper-pill--done {
  color: color-mix(in srgb, var(--text) 78%, transparent);
}

#page-text-video .guest-text-video-showcase__stepper-pill--upcoming {
  color: color-mix(in srgb, var(--text) 72%, transparent);
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

#page-text-video .guest-text-video-showcase__stepper-pill--current {
  color: color-mix(in srgb, var(--text) 98%, transparent);
  border-color: rgba(255, 255, 255, 0.14);
  background: color-mix(in srgb, var(--accent, #6ee7ff) 11%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent, #6ee7ff) 16%, transparent),
    0 6px 18px color-mix(in srgb, var(--accent, #6ee7ff) 8%, transparent);
}

#page-text-video .guest-text-video-showcase__stepper-pill--current::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent, #6ee7ff) 55%, transparent),
    transparent
  );
  opacity: 0.85;
  pointer-events: none;
}

#page-text-video .guest-text-video-showcase__stepper--working .guest-text-video-showcase__stepper-pill--current .guest-text-video-showcase__stepper-pill-label::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent, #6ee7ff) 55%, transparent);
  border-top-color: transparent;
  opacity: 0.9;
  animation: guestTtvStepDotSpin 0.85s linear infinite;
  flex-shrink: 0;
}

@keyframes guestTtvStepDotSpin {
  to {
    transform: rotate(360deg);
  }
}

#page-text-video .guest-text-video-showcase__stepper-arrow {
  flex: 0 0 auto;
  width: 0.65rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--text) 44%, transparent);
  opacity: 0.62;
}

#page-text-video .guest-text-video-showcase__stepper-arrow::after {
  content: "";
  display: block;
  width: 0.32rem;
  height: 0.52rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translate(-0.5px, -1px);
  border-radius: 0 0 1px 0;
}

#page-text-video .guest-text-video-showcase__demo-status--pulse {
  animation: guestTtvStatusChipPulse 1.45s ease-in-out infinite;
}

@keyframes guestTtvStatusChipPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent, #6ee7ff) 0%, transparent);
  }
  50% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #6ee7ff) 14%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-text-video .guest-text-video-showcase__stepper--working .guest-text-video-showcase__stepper-pill--current .guest-text-video-showcase__stepper-pill-label::after {
    animation: none;
    border-top-color: color-mix(in srgb, var(--accent, #6ee7ff) 35%, transparent);
    opacity: 0.65;
  }

  #page-text-video .guest-text-video-showcase__demo-status--pulse {
    animation: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #6ee7ff) 10%, transparent);
  }
}

/* Utloggad demo: idé → Smart → startbild → video (en preview-yta) */
#page-text-video .guest-text-video-showcase__demo-rail {
  margin: 0 0 0.15rem;
}

#page-text-video .guest-text-video-showcase__demo-caption {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--text) 72%, transparent);
}

#page-text-video .guest-text-video-showcase__demo-status {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

#page-text-video .guest-text-video-showcase__demo-stage {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: min(340px, 46vh);
  width: 100%;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.32);
}

#page-text-video .guest-text-video-showcase__demo-stage--idle {
  background:
    radial-gradient(120% 80% at 50% 18%, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(165deg, #0c0f14 0%, #080a0e 100%);
}

#page-text-video .guest-text-video-showcase__demo-stage--idle::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.22;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.07) 1px, transparent 0);
  background-size: 14px 14px;
  pointer-events: none;
}

#page-text-video .guest-text-video-showcase__demo-process {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s ease;
  background: linear-gradient(
    108deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.085) 50%,
    transparent 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  background-position: 0% 0;
}

#page-text-video .guest-text-video-showcase__demo-stage--processing .guest-text-video-showcase__demo-process {
  opacity: 1;
  visibility: visible;
  animation: guestTtvDemoShimmer 1.85s ease-in-out infinite;
}

#page-text-video .guest-text-video-showcase__demo-stage--processing-smart .guest-text-video-showcase__demo-process {
  background: linear-gradient(
    108deg,
    transparent 0%,
    rgba(130, 200, 255, 0.06) 45%,
    rgba(255, 255, 255, 0.09) 52%,
    transparent 100%
  );
  background-size: 200% 100%;
}

#page-text-video .guest-text-video-showcase__demo-stage--processing-image .guest-text-video-showcase__demo-process,
#page-text-video .guest-text-video-showcase__demo-stage--processing-video .guest-text-video-showcase__demo-process {
  background: linear-gradient(
    108deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 42%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 58%,
    transparent 100%
  );
  background-size: 200% 100%;
}

@keyframes guestTtvDemoShimmer {
  0% {
    background-position: 130% 0;
  }
  100% {
    background-position: -130% 0;
  }
}

#page-text-video .guest-text-video-showcase__demo-poster,
#page-text-video .guest-text-video-showcase__demo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.55s ease;
  z-index: 0;
}

#page-text-video .guest-text-video-showcase__demo-video {
  z-index: 1;
  pointer-events: none;
}

#page-text-video .guest-text-video-showcase__demo-stage--video .guest-text-video-showcase__demo-video {
  z-index: 4;
}

#page-text-video .guest-text-video-showcase__demo-stage--image .guest-text-video-showcase__demo-poster {
  opacity: 1;
}

#page-text-video .guest-text-video-showcase__demo-stage--video .guest-text-video-showcase__demo-poster {
  opacity: 0.22;
  transition: opacity 0.6s ease;
}

#page-text-video .guest-text-video-showcase__demo-stage--video .guest-text-video-showcase__demo-video {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  #page-text-video .guest-text-video-showcase__demo-poster,
  #page-text-video .guest-text-video-showcase__demo-video {
    transition: none;
  }

  #page-text-video .guest-text-video-showcase__demo-stage--processing .guest-text-video-showcase__demo-process {
    animation: none;
    background-position: 50% 0;
    opacity: 0.92;
  }
}

/* Utloggad text→video: mobil — centrerad kolumn max 520px, tightare padding, preview 4/5 */
#page-text-video .guest-text-video-showcase__scroll-hint {
  display: none;
}

@media (max-width: 768px) {
  /* Yttre shell: lite mer luft mot skärmkant medan kolumnen hålls smal */
  #page-text-video .text-video-stage.collection-page-shell:has(#text-video-guest-discovery:not([hidden])) {
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 0.85rem;
    padding-bottom: 1.1rem;
  }

  /* Layout: smalare än tidigare 520px — hela flödet känns som en medveten mobilkolumn */
  #page-text-video .guest-text-video-showcase.text-video-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.15rem;
    width: 100%;
    max-width: min(100%, 392px);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  /* Korten centrerade och smalare än shell — innehållet fyller inte visuellt hela glas-ytan */
  #page-text-video .guest-text-video-showcase > .text-video-panel.card,
  #page-text-video .guest-text-video-showcase > .text-video-history.card {
    width: 100%;
    max-width: min(100%, 336px);
    margin-left: auto;
    margin-right: auto;
    height: auto;
    min-height: 0;
    padding: 0.5rem 0.58rem;
    box-sizing: border-box;
  }

  #page-text-video .guest-text-video-showcase__panel .text-video-panel__title {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    text-align: center;
  }

  /* Ersätts av kompakt stegvisare (Idé > Smart > Bild > Video) */
  #page-text-video .guest-text-video-showcase__panel .text-video-flow {
    display: none;
  }

  #page-text-video .guest-text-video-showcase__stepper-label--desktop {
    display: none;
  }

  #page-text-video .guest-text-video-showcase__stepper-label--mobile {
    display: inline;
  }

  #page-text-video .guest-text-video-showcase__chips {
    gap: 0.32rem;
    margin: 0 0 0.55rem;
    justify-content: center;
  }

  #page-text-video .guest-text-video-showcase__chip-row {
    gap: 0.32rem;
    justify-content: center;
  }

  #page-text-video .guest-text-video-showcase__panel .text-video-canvas.text-video-field {
    margin: 0;
  }

  #page-text-video .guest-text-video-showcase__panel .text-video-canvas__label {
    margin-bottom: 0.32rem;
    font-size: 0.78rem;
    line-height: 1.3;
    text-align: center;
  }

  /* Tydligt lägre än global .text-video-textarea min-height: 7rem — mer “promptrad” än skrivpanel */
  #page-text-video .guest-text-video-showcase .text-video-textarea--canvas.guest-text-video-showcase__textarea {
    min-height: 96px;
    max-height: 200px;
    padding: 0.42rem 0.52rem;
    font-size: 0.86rem;
    line-height: 1.36;
    box-sizing: border-box;
  }

  #page-text-video .guest-text-video-showcase__panel .guest-text-video-showcase__hint,
  #page-text-video .guest-text-video-showcase__panel .text-video-hint.guest-text-video-showcase__hint {
    display: none;
  }

  /* Kompakt horisontell kedja: Idé > Smart > Bild > Video */
  #page-text-video .guest-text-video-showcase__stepper {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.12rem 0.18rem;
    margin: 0 0 0.45rem;
    padding: 0.28rem 0.42rem;
    overflow-x: visible;
    -webkit-overflow-scrolling: auto;
  }

  #page-text-video .guest-text-video-showcase__stepper-arrow {
    width: 0.5rem;
    height: 1.05rem;
    flex-shrink: 0;
    opacity: 0.55;
  }

  #page-text-video .guest-text-video-showcase__stepper-arrow::after {
    width: 0.26rem;
    height: 0.42rem;
    border-right-width: 1.5px;
    border-bottom-width: 1.5px;
  }

  #page-text-video .guest-text-video-showcase__stepper-pill {
    flex: 0 0 auto;
    min-width: 0;
    width: auto;
    max-width: none;
    min-height: 0;
    padding: 0.2rem 0.34rem;
    font-size: 0.62rem;
    border-radius: 999px;
    box-sizing: border-box;
  }

  #page-text-video .guest-text-video-showcase__cta--after-preview {
    width: 100%;
    max-width: min(100%, 336px);
    margin-left: auto;
    margin-right: auto;
    padding: 0.5rem 0.58rem;
  }

  #page-text-video .guest-text-video-showcase__cta--after-preview .text-video-actions--hub.idea-to-video-root__actions {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    gap: 0.38rem;
  }

  #page-text-video .guest-text-video-showcase__cta--after-preview .text-video-actions--hub.idea-to-video-root__actions .btn {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  #page-text-video .guest-text-video-showcase__scroll-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin: 0.5rem 0 0;
    padding: 0.36rem 0.65rem;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: color-mix(in srgb, var(--text) 88%, transparent);
    cursor: pointer;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: color-mix(in srgb, var(--surface-elevated, #141820) 80%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition:
      border-color 0.2s ease,
      background 0.2s ease,
      color 0.2s ease;
  }

  #page-text-video .guest-text-video-showcase__scroll-hint:hover,
  #page-text-video .guest-text-video-showcase__scroll-hint:focus-visible {
    border-color: rgba(255, 255, 255, 0.18);
    background: color-mix(in srgb, var(--accent, #6ee7ff) 10%, transparent);
    color: color-mix(in srgb, var(--text) 94%, transparent);
    outline: none;
  }

  #page-text-video .guest-text-video-showcase__result--solo-demo {
    scroll-margin-top: 4.5rem;
    margin-top: 0.1rem;
  }

  #page-text-video .guest-text-video-showcase__result--solo-demo .text-video-history__title {
    margin: 0 0 0.4rem;
    font-size: 0.92rem;
    text-align: center;
  }

  #page-text-video .guest-text-video-showcase__result--solo-demo .text-video-history__lede {
    display: none;
  }

  #page-text-video .guest-text-video-showcase__demo-rail {
    margin-top: 0.2rem;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  #page-text-video .guest-text-video-showcase__demo-caption {
    display: none;
  }

  /* Preview: samma smala kolumn, 4/5, inte full viewport-känsla */
  #page-text-video .guest-text-video-showcase__demo-stage {
    aspect-ratio: 4 / 5;
    width: 100%;
    max-width: min(100%, 280px);
    height: auto;
    max-height: min(320px, 48vh);
    margin-left: auto;
    margin-right: auto;
  }

  #page-text-video .guest-text-video-showcase__result--solo-demo .guest-text-video-showcase__demo-stage {
    max-height: min(320px, 48vh);
  }
}

/* Admin: text-video inspirationssektion (samma dashboard som övriga inspirationssidor) */
#page-admin .admin-inspiration-ttv-card {
  margin: 0 0 1.1rem;
}
