:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

/* The shared site CSS scrolls smoothly; the iOS keyboard reset in work_area_core.js must be instant. */
html {
  scroll-behavior: auto;
}

body {
  overflow: hidden;
  background: rgba(0, 17, 38, 1);
  font-family: Mulish, system-ui, sans-serif;
}

.work-area-shell {
  position: relative;
  width: 100%;
  height: 100vh;
  height: var(--work-area-viewport-height, 100dvh);
  min-height: 0;
  overflow: hidden;
  background: rgba(0, 17, 38, 1);
}

.work-area-page .site-header--shared {
  background: transparent;
}

body.work-area-page {
  display: flex;
  flex-direction: column;
  height: var(--work-area-viewport-height, 100dvh);
  min-height: 0;
}

.work-area-page .work-area-shell {
  flex: 1 1 0;
  height: auto;
  min-height: 0;
  background: transparent;
}

.work-area-page .work-area-layout {
  height: calc(100% - 32px);
}

/* The existing header help link replaces the floating icon only in these mobile work areas. */
@media (max-width: 1056px) {
  .work-area-page:not(.twinmotion-page):has(.work-area-layout:is([data-work-area-active-mode="video"], [data-work-area-active-mode="image"], [data-work-area-active-mode="audio"])) .header__actions {
    gap: 8px;
  }

  .work-area-page:not(.twinmotion-page):has(.work-area-layout:is([data-work-area-active-mode="video"], [data-work-area-active-mode="image"], [data-work-area-active-mode="audio"])) .site-support-nav {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #35bda2;
    border-radius: 50%;
    background: #102e3d;
  }

  .work-area-page:not(.twinmotion-page):has(.work-area-layout:is([data-work-area-active-mode="video"], [data-work-area-active-mode="image"], [data-work-area-active-mode="audio"])) .site-support-nav svg {
    width: 22px;
    height: 22px;
  }

  .work-area-page:not(.twinmotion-page):has(.work-area-layout:is([data-work-area-active-mode="video"], [data-work-area-active-mode="image"], [data-work-area-active-mode="audio"])) .site-support-nav span,
  .work-area-page:not(.twinmotion-page):has(.work-area-layout:is([data-work-area-active-mode="video"], [data-work-area-active-mode="image"], [data-work-area-active-mode="audio"])) .site-support-float {
    display: none;
  }
}

/* Modes are available in the shared site header; retain the slider's controller hooks. */
.work-area-page .work-area-right-panel__mode-slider,
.work-area-sidebar__button[hidden] {
  display: none !important;
}

@media (max-width: 1024px) {
  .work-area-page .work-area-layout {
    height: calc(100% - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) {
  .work-area-page .work-area-layout {
    height: calc(100% - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}

body.work-area-page:has(.work-area-shell--glow-active) {
  background:
    radial-gradient(circle at 50% 40%, rgba(0, 120, 154, 0.3) 0, rgba(0, 120, 154, 0.16) 20%, rgba(0, 120, 154, 0.08) 34%, rgba(0, 17, 38, 0) 58%),
    rgba(0, 17, 38, 1);
}

.work-area-layout {
  --work-area-side-panel-width: 310px;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--work-area-side-panel-width) minmax(0, 1fr) var(--work-area-side-panel-width);
  gap: 32px;
  width: min(100% - 32px, 1958px);
  height: calc(var(--work-area-viewport-height, 100dvh) - 32px);
  margin: 16px auto;
  transition: grid-template-columns 0.35s ease;
}

/* The collapsed history rail keeps only its own width: the centre gets the freed space.
   1025–1199px: the centre would drop below ~480px next to an open history, so the rail stays
   in the grid and the opened history covers the centre instead of squeezing it (work_area.js). */
@media (min-width: 1025px) {
  .work-area-layout:has(.work-area-sidebar:not(.is-expanded)) {
    grid-template-columns: 66px minmax(0, 1fr) var(--work-area-side-panel-width);
  }

  /* The mode chooser has no settings panel: centre it across all space beside history. */
  .work-area-layout:has(.work-area-center-intro:not([hidden])) .work-area-panel--center {
    grid-column: 2 / -1;
  }

  .work-area-layout:has(.work-area-center-intro:not([hidden])) .work-area-panel--right {
    display: none;
  }

  .work-area-sidebar:not(.is-expanded) .work-area-sidebar__new-chat-row {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .work-area-sidebar:not(.is-expanded) .work-area-sidebar__button-action {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border-radius: 4px;
    background: rgba(26, 42, 59, 1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
}

@media (min-width: 1025px) and (max-width: 1199px) {
  .work-area-layout {
    grid-template-columns: 66px minmax(0, 1fr) var(--work-area-side-panel-width);
  }

  .work-area-sidebar.is-expanded {
    position: relative;
    z-index: 5;
  }
}

.work-area-tablet-topbar {
  display: none;
}

.work-area-tablet-topbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.work-area-tablet-topbar__menu-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(26, 42, 59, 1);
  color: rgba(72, 222, 170, 1);
  cursor: pointer;
}

.work-area-tablet-topbar__menu-button[hidden] {
  display: none !important;
}

/* Open settings: "← Настройки ↻" instead of ☰ and + (mockup 375_PO / 768_PO).
   Open menu: only the "collapse menu" icon in place of ☰ (it used to sit in the «На главную» row; team chat 07.10). */
.work-area-tablet-topbar__back,
.work-area-tablet-topbar__title,
.work-area-tablet-topbar__reset,
.work-area-tablet-topbar__menu-icon.work-area-tablet-topbar__collapse-icon {
  display: none;
}

.work-area-layout--menu-open [data-work-area-tablet-menu-button] .work-area-tablet-topbar__menu-icon,
.work-area-layout--menu-open [data-work-area-tablet-filters-button] {
  display: none;
}

.work-area-layout--menu-open [data-work-area-tablet-menu-button] .work-area-tablet-topbar__collapse-icon {
  display: block;
}

.work-area-tablet-topbar__title {
  position: absolute;
  left: 64px;
  right: 64px;
  overflow: hidden;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 28px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-area-layout--filters-open .work-area-tablet-topbar__menu-button:not(.work-area-tablet-topbar__back):not(.work-area-tablet-topbar__reset) {
  display: none;
}

.work-area-layout--filters-open .work-area-tablet-topbar__back,
.work-area-layout--filters-open .work-area-tablet-topbar__reset {
  display: inline-flex;
}

/* Nothing to reset when the panel shows no model parameters (projects filters, templates, models without settings). */
.work-area-layout:has([data-work-area-settings][hidden]) [data-work-area-settings-reset] {
  display: none;
}

.work-area-layout--filters-open .work-area-tablet-topbar__title {
  display: block;
}

.work-area-tablet-topbar__menu-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.work-area-drawer-backdrop {
  display: none;
}

.work-area-drawer-backdrop[hidden] {
  display: none !important;
}

.work-area-responsive-panel-heading {
  display: none;
}

.work-area-responsive-panel-heading__close {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(72, 222, 170, 0.6);
  border-radius: 8px;
  background: rgba(26, 42, 59, 1);
  color: rgba(72, 222, 170, 1);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.work-area-panel {
  min-width: 0;
  min-height: 0;
}

.work-area-panel--left {
  display: flex;
  justify-content: flex-start;
}

.work-area-panel--right {
  display: flex;
  align-items: stretch;
  min-height: 0;
}

.work-area-sidebar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 66px;
  max-width: var(--work-area-side-panel-width);
  height: 100%;
  padding: 8px;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  background: rgba(7, 27, 46, 1);
  overflow: hidden;
  cursor: pointer;
  transition: width 0.35s ease, max-width 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, background-color 0.35s ease;
}

.work-area-sidebar.is-expanded {
  width: var(--work-area-side-panel-width);
  max-width: var(--work-area-side-panel-width);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  cursor: default;
}

.work-area-sidebar__button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px;
  border: 0;
  border-radius: 4px;
  background: rgba(26, 42, 59, 1);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s ease;
}

a.work-area-sidebar__button {
  color: inherit;
  text-decoration: none;
}

.work-area-sidebar__button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(42, 64, 87, 1);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.work-area-sidebar__button:hover::before,
.work-area-sidebar__button:focus-visible::before {
  transform: scaleX(1);
}

.work-area-sidebar__button:disabled {
  background: rgba(26, 42, 59, 0.55);
  cursor: default;
}

.work-area-sidebar__button:disabled .work-area-sidebar__button-label {
  color: rgba(168, 179, 194, 0.75);
}

.work-area-sidebar__button:disabled .work-area-sidebar__button-icon {
  filter: grayscale(1);
  opacity: 0.6;
}

.work-area-sidebar__button:disabled::before {
  display: none;
}

.work-area-sidebar__soon {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(168, 179, 194, 0.12);
  color: rgba(168, 179, 194, 0.85);
  font-size: 10px;
  line-height: 14px;
}

.work-area-sidebar__button-icon {
  flex: 0 0 auto;
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.work-area-sidebar__button-label {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  color: rgba(72, 222, 170, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.1px;
  text-align: center;
  transition: max-width 0.3s ease, margin-left 0.3s ease, opacity 0.22s ease, transform 0.3s ease;
}

.work-area-sidebar.is-expanded .work-area-sidebar__button-label {
  max-width: 160px;
  margin-left: 12px;
  opacity: 1;
  transform: translateX(0);
}

.work-area-sidebar__button-action {
  position: absolute;
  top: 12px;
  right: 12px;
  flex: 0 0 auto;
  margin-left: auto;
  width: 0;
  height: 24px;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  transform: scale(0.9);
  transition: width 0.3s ease, opacity 0.22s ease, transform 0.3s ease;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.work-area-sidebar__new-chat-row {
  position: relative;
  flex: 0 0 auto;
}

.work-area-sidebar.is-expanded [data-work-area-new-chat] {
  padding-right: 48px;
}

.work-area-sidebar__button-action img {
  display: block;
  width: 24px;
  height: 24px;
}

.work-area-sidebar.is-expanded .work-area-sidebar__button-action {
  width: 24px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

.work-area-sidebar__search {
  flex: 0 0 auto;
  width: 100%;
  margin-bottom: 16px;
}

.work-area-sidebar__button--search {
  margin-bottom: 0;
}

.work-area-sidebar__search-field {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px;
  border: 1px solid rgba(72, 222, 170, 0.72);
  border-radius: 4px;
  background: rgba(26, 42, 59, 1);
  box-sizing: border-box;
  box-shadow: 0 0 0 2px rgba(72, 222, 170, 0.08);
}

.work-area-sidebar__search-field[hidden] {
  display: none !important;
}

.work-area-sidebar__button[hidden] {
  display: none !important;
}

.work-area-sidebar__search-input {
  min-width: 0;
  flex: 1 1 auto;
  margin-left: 12px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.1px;
}

.work-area-sidebar__search-input::placeholder {
  color: rgba(168, 179, 194, 0.78);
  opacity: 1;
}

.work-area-sidebar__search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(168, 179, 194, 1);
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 20px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.work-area-sidebar__search-close:hover,
.work-area-sidebar__search-close:focus-visible {
  color: rgba(72, 222, 170, 1);
  transform: scale(1.08);
}

.work-area-sidebar__history {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 16px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.work-area-sidebar.is-expanded .work-area-sidebar__history {
  opacity: 1;
  pointer-events: auto;
}

.work-area-sidebar__history-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.work-area-sidebar__history-section + .work-area-sidebar__history-section {
  margin-top: 16px;
}

.work-area-sidebar__history-title {
  margin: 0 0 8px;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.15px;
}

.work-area-sidebar__history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.work-area-sidebar__history-item {
  position: relative;
  z-index: 0;
  isolation: isolate;
  min-width: 0;
}

.work-area-sidebar__history-item.is-menu-open {
  z-index: 4;
}

.work-area-sidebar__history-link {
  position: relative;
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: 10px;
  padding: 10px 40px 10px 10px;
  border-radius: 8px;
  background: transparent;
  isolation: isolate;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.5px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s ease;
}

.work-area-sidebar__history-thumbnail,
.work-area-sidebar__history-audio-icon {
  display: flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(91, 119, 148, 0.48);
  border-radius: 7px;
  background: rgba(17, 35, 55, 0.82);
}

.work-area-sidebar__history-thumbnail {
  object-fit: cover;
}

.work-area-sidebar__history-audio-icon {
  color: rgba(72, 222, 170, 1);
  font-size: 23px;
  line-height: 1;
}

.work-area-sidebar__history-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-area-sidebar__history-profile {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid rgba(72, 222, 170, 0.55);
  border-radius: 4px;
  color: #48deaa;
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0;
}

.work-area-sidebar__history-name-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 3px 5px;
  border: 1px solid rgba(72, 222, 170, 0.72);
  border-radius: 5px;
  outline: none;
  background: rgba(7, 27, 46, 1);
  color: rgba(230, 233, 237, 1);
  font: inherit;
  letter-spacing: inherit;
  box-sizing: border-box;
}

.work-area-sidebar__history-name-input:focus {
  box-shadow: 0 0 0 2px rgba(72, 222, 170, 0.12);
}

.work-area-sidebar__history-name-input[aria-invalid="true"] {
  border-color: rgba(255, 139, 139, 1);
}

.work-area-sidebar__history-item.is-renaming .work-area-sidebar__history-actions {
  visibility: hidden;
  pointer-events: none;
}

.work-area-sidebar__history-item[aria-busy="true"] .work-area-sidebar__history-name-input {
  opacity: 0.65;
}

.work-area-sidebar__history-rename-error {
  margin: 0 10px 6px;
  color: rgba(255, 139, 139, 1);
  font: 12px/16px Mulish, system-ui, sans-serif;
}

.work-area-sidebar__history-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(42, 64, 87, 1);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.work-area-sidebar__history-link:hover,
.work-area-sidebar__history-link:focus-visible {
  color: rgba(230, 233, 237, 1);
}

.work-area-sidebar__history-item.is-active .work-area-sidebar__history-link {
  color: rgba(72, 222, 170, 1);
}

.work-area-sidebar__history-link:hover::before,
.work-area-sidebar__history-link:focus-visible::before,
.work-area-sidebar__history-item.is-active .work-area-sidebar__history-link::before {
  transform: scaleX(1);
}

.work-area-sidebar__history-actions {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
}

.work-area-sidebar__history-menu-toggle {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(17, 35, 55, 0.88);
  color: rgba(190, 204, 219, 1);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.work-area-sidebar__history-item:hover .work-area-sidebar__history-menu-toggle,
.work-area-sidebar__history-item:focus-within .work-area-sidebar__history-menu-toggle,
.work-area-sidebar__history-menu-toggle[aria-expanded="true"] {
  opacity: 1;
  pointer-events: auto;
}

.work-area-sidebar__history-menu-toggle:hover,
.work-area-sidebar__history-menu-toggle:focus-visible,
.work-area-sidebar__history-menu-toggle[aria-expanded="true"] {
  border-color: rgba(87, 117, 146, 0.62);
  background: rgba(42, 64, 87, 1);
  color: rgba(72, 222, 170, 1);
  outline: none;
}

.work-area-sidebar__history-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  display: flex;
  width: 196px;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(91, 119, 148, 0.55);
  border-radius: 10px;
  background: rgba(12, 28, 46, 0.98);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
  box-sizing: border-box;
  overflow-y: auto;
}

.work-area-sidebar__history-menu.is-above {
  top: auto;
  bottom: calc(100% + 5px);
}

.work-area-sidebar__history-menu[hidden] {
  display: none;
}

.work-area-sidebar__history-menu-action {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(220, 229, 238, 1);
  cursor: pointer;
  font: inherit;
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.work-area-sidebar__history-menu-action:hover,
.work-area-sidebar__history-menu-action:focus-visible {
  background: rgba(42, 64, 87, 1);
  color: rgba(72, 222, 170, 1);
  outline: none;
}

.work-area-sidebar__history-menu-action--danger,
.work-area-sidebar__history-menu-action--danger:hover,
.work-area-sidebar__history-menu-action--danger:focus-visible {
  color: rgba(255, 139, 139, 1);
}

.work-area-sidebar__history-menu-action--danger:hover,
.work-area-sidebar__history-menu-action--danger:focus-visible {
  background: rgba(106, 45, 55, 0.45);
}

.work-area-history-confirm {
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(91, 119, 148, 0.72);
  border-radius: 16px;
  background: rgba(13, 29, 47, 0.99);
  color: rgba(230, 233, 237, 1);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  font-family: Mulish, system-ui, sans-serif;
}

.work-area-history-confirm::backdrop {
  background: rgba(1, 10, 20, 0.72);
  backdrop-filter: blur(3px);
}

.work-area-history-confirm__content {
  padding: 24px;
}

.work-area-history-confirm__title {
  margin: 0;
  color: rgba(245, 248, 251, 1);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

.work-area-history-confirm__message {
  margin: 12px 0 22px;
  color: rgba(174, 190, 206, 1);
  font-size: 15px;
  line-height: 23px;
  overflow-wrap: anywhere;
}

.work-area-history-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.work-area-history-confirm__button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgba(91, 119, 148, 0.75);
  border-radius: 9px;
  background: rgba(42, 64, 87, 0.72);
  color: rgba(230, 233, 237, 1);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.work-area-history-confirm__button:hover,
.work-area-history-confirm__button:focus-visible {
  border-color: rgba(72, 222, 170, 0.8);
  background: rgba(42, 88, 89, 0.78);
  outline: none;
}

.work-area-history-confirm__button--danger {
  border-color: rgba(207, 82, 95, 0.8);
  background: rgba(145, 49, 62, 0.9);
  color: #fff;
}

.work-area-history-confirm__button--danger:hover,
.work-area-history-confirm__button--danger:focus-visible {
  border-color: rgba(255, 139, 139, 1);
  background: rgba(174, 54, 69, 1);
}

@media (hover: none) {
  .work-area-sidebar__history-menu-toggle {
    opacity: 1;
    pointer-events: auto;
  }
}

.work-area-sidebar__history-empty {
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0.25px;
}

.work-area-sidebar__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5px 9px;
  border-radius: 8px;
  background: rgba(42, 64, 87, 1);
  transition: padding 0.3s ease, justify-content 0.3s ease;
}

.work-area-sidebar__footer {
  cursor: pointer;
}

.work-area-sidebar.is-expanded .work-area-sidebar__footer {
  padding: 9px;
  justify-content: flex-start;
}

.work-area-sidebar__status-dot {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(72, 222, 170, 1);
}

.work-area-sidebar__status-dot--image {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.work-area-sidebar__footer-meta {
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: max-width 0.3s ease, margin-left 0.3s ease, opacity 0.22s ease, transform 0.3s ease;
}

.work-area-sidebar.is-expanded .work-area-sidebar__footer-meta {
  max-width: 220px;
  margin-left: 10px;
  opacity: 1;
  transform: translateX(0);
}

.work-area-sidebar__footer-name {
  margin-bottom: 2px;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.1px;
}

.work-area-sidebar__footer-login {
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.5px;
}

.work-area-sidebar__footer-balance {
  max-width: 0;
  margin-left: auto;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: max-width 0.3s ease, opacity 0.22s ease, transform 0.3s ease;
}

.work-area-sidebar.is-expanded .work-area-sidebar__footer-balance {
  max-width: 180px;
  opacity: 1;
  transform: translateX(0);
}

.work-area-sidebar__footer-balance-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 4px;
}

.work-area-sidebar__footer-balance-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.work-area-sidebar__footer-balance-value {
  color: rgba(72, 222, 170, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.1px;
  text-align: right;
}

.work-area-sidebar__footer-balance-plan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 188, 138, 1);
  color: rgba(0, 17, 38, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.5px;
  text-align: right;
}

.work-area-panel--center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-area-layout[data-work-area-view="projects"] .work-area-panel--center {
  align-items: stretch;
  justify-content: stretch;
}

.work-area-projects {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  overflow-anchor: none;
}

.work-area-projects__drafts-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 12px;
  margin: 0 0 14px;
  border: 1px solid #35516a;
  border-radius: 8px;
  background: #10263a;
  color: #e6e9ed;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.work-area-projects__drafts-link::before {
  content: "";
  flex: 0 0 18px;
  height: 18px;
  background: url("/static/front-home/assets/img/collections_bookmark.webp") center / contain no-repeat;
}

.work-area-projects__drafts-link:hover {
  border-color: #48deaa;
  background: #16344a;
}

.work-area-projects__drafts-link:focus-visible {
  outline: 2px solid #48deaa;
  outline-offset: -2px;
}

/* Columns follow the centre's own width: up to 4, each at least ~160px. */
.work-area-projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(160px, (100% - 48px) / 4)), 1fr));
  gap: 16px;
  align-content: start;
  min-height: 100%;
}

.work-area-projects__load-more-sentinel {
  grid-column: 1 / -1;
  width: 100%;
  height: 1px;
  min-height: 1px;
  pointer-events: none;
  visibility: hidden;
}

.work-area-project-item {
  position: relative;
  min-width: 0;
}

.work-area-project-card {
  width: 100%;
  min-width: 0;
  height: 295px;
  border-radius: 4px;
  background: rgba(26, 42, 59, 1);
  display: block;
  overflow: hidden;
  position: relative;
  text-decoration: none;
}

.work-area-project-card--filled {
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  background: rgba(26, 42, 59, 1);
  cursor: pointer;
}

.work-area-project-card__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: rgba(26, 42, 59, 1);
}

.work-area-project-card__media--video {
  pointer-events: none;
}

.work-area-project-item--audio {
  align-self: start;
}

.work-area-project-card--audio {
  height: 295px;
  aspect-ratio: auto;
}

.work-area-project-card__media--audio {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(72, 222, 170, 0.14), transparent 35%),
    #3C4A5E;
}

.work-area-project-card__audio-waveform {
  position: absolute;
  inset: 20% 0;
  z-index: 1;
  pointer-events: none;
}

.work-area-project-card__audio-wave-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
}

.work-area-project-card__audio-wave-layer--base {
  opacity: 0.42;
}

.work-area-project-card__audio-wave-layer--played {
  overflow: hidden;
  clip-path: inset(0 calc(100% - var(--work-area-project-audio-progress, 0%)) 0 0);
  opacity: 1;
}

.work-area-project-card__audio-wave-bar {
  display: block;
  flex: 1 1 0;
  min-width: 1px;
  height: var(--work-area-project-audio-wave-height, 30%);
  max-height: 100%;
  border-radius: 999px;
  background: rgba(230, 233, 237, 0.82);
  transform-origin: center;
}

.work-area-project-card__audio-wave-layer--played .work-area-project-card__audio-wave-bar {
  background: linear-gradient(180deg, rgba(72, 222, 170, 1), rgba(72, 222, 170, 0.56));
}

.work-area-project-card__audio-play {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(230, 233, 237, 0.78);
  border-radius: 50%;
  background: rgba(7, 27, 46, 0.86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.work-area-project-card__audio-play:hover,
.work-area-project-card__audio-play:focus-visible {
  border-color: #48DEAA;
  background: rgba(22, 57, 76, 0.96);
  transform: scale(1.06);
}

.work-area-project-card__audio-play:focus-visible {
  outline: 2px solid rgba(72, 222, 170, 0.9);
  outline-offset: 3px;
}

.work-area-project-card__audio-play.is-loading {
  cursor: wait;
}

.work-area-project-card__audio-play.is-loading::after {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-top-color: #48DEAA;
  border-radius: 50%;
  content: "";
  animation: work-area-project-audio-spin 0.8s linear infinite;
}

.work-area-project-card__audio-play.is-loading .work-area-project-card__audio-play-icon {
  opacity: 0.18;
}

@keyframes work-area-project-audio-spin {
  to {
    transform: rotate(360deg);
  }
}

.work-area-project-card__audio-play-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}

.work-area-project-card__audio-element {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  border: 0;
  opacity: 0;
  pointer-events: none;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.work-area-projects .work-area-project-card__media--audio {
  display: block;
  background:
    linear-gradient(180deg, rgba(3, 13, 25, 0.08) 42%, rgba(3, 13, 25, 0.44) 68%, rgba(3, 13, 25, 0.96) 100%),
    url("/static/front-home/assets/img/audio_project_cover.webp") center / cover no-repeat;
}

.work-area-projects .work-area-project-card__audio-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: grid;
  gap: 8px;
  padding: 12px 14px 10px;
  border-top: 1px solid rgba(105, 151, 184, 0.3);
  background: rgba(7, 27, 46, 0.9);
  backdrop-filter: blur(10px);
}

.work-area-projects .work-area-project-card__audio-title {
  overflow: hidden;
  color: rgba(244, 248, 252, 0.98);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-area-projects .work-area-project-card__audio-playback-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.work-area-projects .work-area-project-card__audio-time {
  min-width: 34px;
  color: rgba(211, 222, 233, 0.88);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 16px;
  white-space: nowrap;
}

.work-area-projects .work-area-project-card__audio-seek-track {
  position: relative;
  min-width: 0;
  height: 26px;
}

.work-area-projects .work-area-project-card__audio-waveform {
  position: absolute;
  inset: 0;
  height: 100%;
}

.work-area-projects .work-area-project-card__audio-wave-layer {
  gap: 2px;
}

.work-area-projects .work-area-project-card__audio-seek {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.work-area-projects .work-area-project-card__audio-seek:disabled {
  cursor: default;
}

.work-area-projects .work-area-project-card__audio-seek:focus-visible {
  border-radius: 5px;
  outline: 2px solid rgba(72, 222, 170, 0.9);
  outline-offset: 2px;
}

.work-area-projects .work-area-project-card__audio-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.94);
  transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease,
    background-color 160ms ease, border-color 160ms ease;
}

.work-area-projects .work-area-project-card--audio:hover .work-area-project-card__audio-play,
.work-area-projects .work-area-project-card--audio:focus-within .work-area-project-card__audio-play {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.work-area-projects .work-area-project-card--audio .work-area-project-card__audio-play:hover,
.work-area-projects .work-area-project-card--audio .work-area-project-card__audio-play:focus-visible {
  transform: translate(-50%, -50%) scale(1.06);
}

@media (hover: none) {
  .work-area-projects .work-area-project-card--audio .work-area-project-card__audio-play {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%);
  }
}

.work-area-project-card--audio.is-audio-playing .work-area-project-card__audio-waveform {
  opacity: 1;
}

.work-area-project-card__actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 6px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(4px);
  transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
}

.work-area-project-item:hover .work-area-project-card__actions,
.work-area-project-card:focus-visible + .work-area-project-card__actions,
.work-area-project-item:focus-within .work-area-project-card__actions {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

@media (hover: none) {
  .work-area-project-card__actions {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

.work-area-project-card__action {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(119, 143, 169, 0.72);
  border-radius: 8px;
  color: rgba(230, 233, 237, 1);
  background: rgba(7, 27, 46, 0.88);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.work-area-project-card__action:hover,
.work-area-project-card__action:focus-visible {
  border-color: rgba(72, 222, 170, 0.95);
  color: rgba(72, 222, 170, 1);
  background: rgba(22, 57, 76, 0.96);
  transform: translateY(-1px);
}

.work-area-project-card__action:focus-visible {
  outline: 2px solid rgba(72, 222, 170, 0.8);
  outline-offset: 2px;
}

.work-area-project-card__action:disabled {
  opacity: 0.52;
  cursor: wait;
  transform: none;
}

.work-area-project-card__action-icon {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
  pointer-events: none;
}

.work-area-project-card__action-check {
  color: rgba(168, 179, 194, 0.86);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.work-area-project-card__action[aria-pressed="true"] {
  border-color: rgba(72, 222, 170, 0.92);
  background: rgba(23, 77, 75, 0.94);
}

.work-area-project-card__action[aria-pressed="true"] .work-area-project-card__action-check {
  color: rgba(72, 222, 170, 1);
}

.work-area-right-panel {
  box-sizing: border-box;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 16px;
  background: rgba(7, 27, 46, 1);
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  /* A "?" tooltip near the bottom made the panel scrollable; the scrollbar then shifted the
     content, the cursor left the "?", the tooltip closed and the scrollbar went away — a loop. */
  scrollbar-gutter: stable;
}

.work-area-right-panel {
  position: relative;
}

.work-area-project-item--loading .work-area-project-card {
  background:
    linear-gradient(100deg, rgba(26, 42, 59, 1) 30%, rgba(53, 73, 94, 0.9) 50%, rgba(26, 42, 59, 1) 70%),
    rgba(26, 42, 59, 1);
  background-size: 220% 100%;
  animation: work-area-project-card-loading 1.3s ease-in-out infinite;
}

@keyframes work-area-project-card-loading {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

.work-area-right-panel.is-loading > :not(.work-area-right-panel__title):not(.work-area-right-panel__loading) {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.work-area-right-panel__loading {
  position: absolute;
  inset: 72px 16px 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 160px;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
}

.work-area-right-panel__loading[hidden] {
  display: none;
}

.work-area-right-panel__loading-spinner {
  display: block;
  width: 36px;
  height: 36px;
  border: 4px solid rgba(72, 222, 170, 0.18);
  border-top-color: rgba(72, 222, 170, 1);
  border-radius: 50%;
  animation: work-area-right-panel-loading-spin 0.8s linear infinite;
}

@keyframes work-area-right-panel-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.work-area-layout.work-area-layout--detail-open .work-area-right-panel {
  display: block;
}

.work-area-right-panel__reset {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(26, 42, 59, 1);
  color: rgba(72, 222, 170, 1);
  cursor: pointer;
}

.work-area-right-panel__reset svg {
  width: 24px;
  height: 24px;
}

/* Desktop: "Настройки ↻" header above the mode chips (Figma Settings component). */
@media (min-width: 1025px) {
  .work-area-responsive-panel-heading--settings {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
  }

  .work-area-responsive-panel-heading--settings .work-area-right-panel__title {
    margin: 0;
  }

  .work-area-responsive-panel-heading--settings .work-area-responsive-panel-heading__close {
    display: none;
  }
}

.work-area-right-panel__title {
  margin: 0 0 32px;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 28px;
  letter-spacing: 0;
}

.work-area-right-panel__select {
  position: relative;
  margin-bottom: 24px;
}

.work-area-right-panel__select[hidden] {
  display: none !important;
}

.work-area-right-panel__select-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 17px 16px;
  border: 0;
  border-radius: 8px;
  background: rgba(26, 42, 59, 1);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s ease;
}

.work-area-right-panel__select-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(72, 222, 170, 0.2);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.work-area-right-panel__select-button:hover::before,
.work-area-right-panel__select-button:focus-visible::before,
.work-area-right-panel__select.is-open .work-area-right-panel__select-button::before {
  transform: scaleX(1);
}

.work-area-right-panel__select-button:focus-visible {
  outline: none;
}

.work-area-right-panel__select-button-label {
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.1px;
}

.work-area-right-panel__model-route {
  margin: -14px 0 20px;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 11px;
  line-height: 16px;
  overflow-wrap: anywhere;
}

.work-area-right-panel__model-route[hidden] {
  display: none !important;
}

.work-area-right-panel__model-route:not([hidden]) + .work-area-right-panel__video-input-hint {
  margin-top: -12px;
}

.work-area-right-panel__select-button-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
  transition: transform 0.25s ease;
}

.work-area-right-panel__select.is-open .work-area-right-panel__select-button-icon {
  transform: rotate(90deg);
}

.work-area-right-panel__settings {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.work-area-right-panel__settings[hidden] {
  display: none !important;
}

.work-area-right-panel__video-generation-settings {
  width: 100%;
}

.work-area-right-panel__video-generation-settings-title {
  margin: 0 0 14px;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.1px;
}

.work-area-right-panel__video-generation-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
  width: 100%;
}

.work-area-right-panel__video-generation-settings--three-image-controls .work-area-right-panel__video-generation-settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.work-area-right-panel__video-generation-settings--three-image-controls .work-area-right-panel__video-setting-summary-title {
  font-size: 11px;
}

.work-area-right-panel__video-generation-settings--three-image-controls .work-area-right-panel__video-setting-summary-value {
  font-size: 15px;
}

.work-area-right-panel__video-generation-settings-grid .work-area-right-panel__setting-group--video-summary {
  display: contents;
}

.work-area-right-panel__video-generation-settings-grid [data-work-area-setting-group="duration_seconds"] .work-area-right-panel__video-setting-summary {
  grid-column: 1;
  grid-row: 1;
}

.work-area-right-panel__video-generation-settings-grid [data-work-area-setting-group="aspect_ratio"] .work-area-right-panel__video-setting-summary {
  grid-column: 1;
  grid-row: 1;
}

.work-area-right-panel__video-generation-settings-grid [data-work-area-setting-group="resolution"] .work-area-right-panel__video-setting-summary {
  grid-column: 2;
  grid-row: 1;
}

.work-area-right-panel__video-generation-settings-grid .work-area-right-panel__video-setting-options {
  grid-column: 1 / -1;
  grid-row: 2;
}

.work-area-right-panel__video-setting-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 96px;
  padding: 12px 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(26, 42, 59, 1);
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.work-area-right-panel__video-setting-summary:hover,
.work-area-right-panel__setting-group--video-summary.is-expanded .work-area-right-panel__video-setting-summary,
.work-area-right-panel__video-setting-summary:focus-visible {
  border-color: rgba(72, 222, 170, 0.75);
  background: rgba(34, 53, 73, 1);
}

.work-area-right-panel__video-setting-summary:focus-visible {
  outline: 2px solid rgba(72, 222, 170, 0.9);
  outline-offset: 2px;
}

.work-area-right-panel__setting-group--video-summary-readonly .work-area-right-panel__video-setting-summary {
  position: relative;
  cursor: default;
  color: rgba(168, 179, 194, 1);
}

.work-area-right-panel__setting-group--video-summary-readonly .work-area-right-panel__video-setting-summary:hover {
  border-color: transparent;
  background: rgba(26, 42, 59, 1);
}

.work-area-right-panel__setting-group--video-summary-readonly .work-area-right-panel__video-setting-summary-value {
  font-size: 16px;
  overflow-wrap: normal;
  word-break: normal;
}

.work-area-right-panel__video-setting-summary-title {
  display: block;
  max-width: 100%;
  color: rgba(168, 179, 194, 1);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.work-area-right-panel__video-setting-summary-value {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  color: rgba(230, 233, 237, 1);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.work-area-right-panel__video-setting-options {
  margin-top: 0;
}

.work-area-right-panel__setting-list.work-area-right-panel__setting-dropdown {
  flex-direction: column;
  flex-wrap: nowrap;
  max-height: 300px;
  overflow-y: auto;
  background: #1a2a3b;
  border: 1px solid #34475e;
  border-radius: 12px;
  padding: 4px;
}
.work-area-right-panel__setting-option { width: 100%; min-height: 44px; }
.work-area-right-panel__setting-option .work-area-right-panel__setting-chip-label { flex: 1; text-align: left; }
.work-area-duration-control { width: 100%; padding: 12px 4px; box-sizing: border-box; }
.work-area-duration-control output { display: block; margin-bottom: 4px; color: #e6e9ed; font-size: 16px; }
.work-area-duration-control input { width: 100%; height: 36px; margin: 0; accent-color: #48deaa; cursor: pointer; }
.work-area-duration-control__bounds { display: flex; justify-content: space-between; gap: 12px; color: #a8b3c2; font-size: 13px; }
.work-area-right-panel__setting-group--duration { margin-top: 18px; }
.work-area-right-panel__setting-group--duration .work-area-duration-control { padding-top: 0; }
.work-area-right-panel__setting-group--duration output { text-align: right; margin-top: -26px; font-size: 18px; }
.work-area-generation-error { width: 100%; padding: 10px 12px; box-sizing: border-box; border-radius: 10px; background: #1a2a3b; color: #e6e9ed; font-size: 14px; }
.work-area-generation-error summary { color: #dbb5b5; cursor: pointer; min-height: 24px; }
.work-area-generation-error p { margin: 10px 0 0; overflow-wrap: anywhere; }

@media (max-width: 360px) {
  .work-area-right-panel__video-generation-settings-title {
    font-size: 20px;
  }

  .work-area-right-panel__video-generation-settings-grid {
    gap: 6px;
  }

  .work-area-right-panel__video-setting-summary {
    min-height: 88px;
    padding: 10px 4px;
  }

  .work-area-right-panel__video-setting-summary-title {
    font-size: 12px;
  }

  .work-area-right-panel__video-setting-summary-value {
    font-size: 16px;
  }
}

.work-area-right-panel__frames {
  width: 100%;
  margin-top: 0;
}

.work-area-right-panel__frames[hidden] {
  display: none !important;
}

.work-area-right-panel__frames-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.work-area-right-panel__frames-head .work-area-right-panel__frames-title {
  margin: 0;
}

/* «Очистить»: same look as «Очистить все» in the mockup's Settings component. */
.work-area-right-panel__frames-clear {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 0;
  border-radius: 4px;
  background: rgba(26, 42, 59, 1);
  color: rgba(72, 222, 170, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}

.work-area-right-panel__frames-clear[hidden] {
  display: none;
}

.work-area-right-panel__frames-title {
  margin: 0 0 16px;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.15px;
}

.work-area-right-panel__frames-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.work-area-right-panel__reference-videos {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.work-area-right-panel__reference-videos[hidden] {
  display: none !important;
}

.work-area-right-panel__reference-video-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.work-area-right-panel__reference-video-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(79, 227, 194, 0.75);
  border-radius: 8px;
  background: rgba(29, 43, 61, 1);
}

.work-area-right-panel__reference-video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-area-right-panel__reference-video-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(2, 15, 30, 0.85);
  cursor: pointer;
}

.work-area-ref-tag {
  position: absolute;
  left: 2px;
  bottom: 2px;
  z-index: 2;
  min-width: 18px;
  padding: 1px 4px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: rgba(2, 15, 30, 0.85);
  font: 700 10px/14px Mulish, system-ui, sans-serif;
  cursor: pointer;
}

.work-area-prompt-box__file-chip .work-area-ref-tag {
  position: static;
  margin-left: 4px;
}

.work-area-ref-tag:hover,
.work-area-ref-tag:focus-visible {
  color: rgba(72, 222, 170, 1);
  outline: none;
}

.work-area-right-panel__reference-video-add:disabled {
  opacity: 0.5;
  cursor: default;
}

.work-area-right-panel__reference-media-empty[hidden],
.work-area-right-panel__reference-video-list[hidden],
.work-area-right-panel__ref-media-counts[hidden],
.work-area-right-panel__ref-media-error[hidden] {
  display: none;
}

.work-area-right-panel__reference-media-empty:disabled,
.work-area-right-panel__ref-media-add:disabled {
  opacity: 0.5;
  cursor: default;
}

.work-area-right-panel__reference-video-card audio {
  display: none;
}

.work-area-right-panel__reference-video-card[data-work-area-reference-kind] {
  cursor: pointer;
}

.work-area-right-panel__ref-media-add {
  aspect-ratio: 1 / 1;
}

.work-area-right-panel__ref-media-type {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(2, 15, 30, 0.85);
  color: rgba(230, 233, 237, 1);
}

.work-area-right-panel__ref-media-type svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.work-area-right-panel__ref-media-dur {
  position: absolute;
  left: 2px;
  bottom: 20px;
  z-index: 2;
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(2, 15, 30, 0.85);
  color: #fff;
  font: 700 10px/16px Mulish, system-ui, sans-serif;
}

.work-area-right-panel__ref-media-wave {
  position: absolute;
  left: 0;
  right: 0;
  top: 32%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 36px;
}

.work-area-right-panel__ref-media-wave i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: rgba(79, 227, 194, 0.85);
}

.work-area-right-panel__ref-media-play {
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(230, 233, 237, 1);
  color: rgba(7, 27, 46, 1);
  cursor: pointer;
}

.work-area-right-panel__ref-media-play svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

.work-area-right-panel__ref-media-play .is-pause,
.work-area-right-panel__reference-video-card.is-playing .work-area-right-panel__ref-media-play .is-play {
  display: none;
}

.work-area-right-panel__reference-video-card.is-playing .work-area-right-panel__ref-media-play .is-pause {
  display: block;
}

.work-area-right-panel__ref-media-counts {
  display: grid;
  gap: 2px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(230, 233, 237, 1);
  font: 600 12px/18px Mulish, system-ui, sans-serif;
}

.work-area-right-panel__ref-media-counts span {
  color: rgba(168, 179, 194, 1);
  font-weight: 500;
}

.work-area-right-panel__ref-media-counts small {
  color: rgba(168, 179, 194, 0.8);
  font-size: 11px;
  font-weight: 500;
}

/* A type whose count or seconds are used up. */
.work-area-right-panel__ref-media-counts .is-full span {
  color: rgba(255, 196, 102, 1);
}

.work-area-right-panel__ref-media-error.is-note {
  border-color: rgba(72, 222, 170, 0.45);
  background: rgba(72, 222, 170, 0.08);
  color: rgba(230, 233, 237, 1);
}

.work-area-right-panel__ref-media-error {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 128, 128, 0.55);
  border-radius: 6px;
  background: rgba(120, 30, 40, 0.28);
  color: rgba(255, 190, 190, 1);
  font: 500 12px/17px Mulish, system-ui, sans-serif;
}

/* Trim editor: the Figma frame — preview, round play button, filmstrip with a window and a playhead. */
.work-area-trim {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 12px;
  background: rgba(7, 27, 46, 1);
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
}

.work-area-trim::backdrop {
  background: rgba(0, 10, 22, 0.72);
}

.work-area-trim__form {
  display: grid;
  gap: 10px;
}

.work-area-trim__title {
  margin: 0;
  font: 700 18px/26px Mulish, system-ui, sans-serif;
}

.work-area-trim__file,
.work-area-trim__limit {
  margin: 0;
  color: rgba(168, 179, 194, 1);
  font: 500 13px/18px Mulish, system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.work-area-trim__stage {
  display: grid;
  place-items: center;
  height: min(46dvh, 360px);
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  background: rgba(2, 15, 30, 1);
}

.work-area-trim__stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.work-area-trim__stage audio {
  display: none;
}

/* The hidden video that draws strip frames: in the page (iOS decodes only those), never seen. */
.work-area-trim__grabber {
  position: fixed;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
}

.work-area-trim__stage.is-audio {
  height: 150px;
}

.work-area-trim__stage.is-audio svg {
  width: 72px;
  height: 72px;
  fill: rgba(72, 222, 170, 0.9);
}

.work-area-trim__stage.is-queue-loading {
  height: 150px;
  align-content: center;
  gap: 14px;
  color: rgba(168, 179, 194, 1);
  font: 600 13px/18px Mulish, system-ui, sans-serif;
}

.work-area-trim__stage.is-queue-loading::before {
  content: "";
  width: 30px;
  height: 30px;
  border: 3px solid rgba(72, 222, 170, 0.22);
  border-top-color: rgba(72, 222, 170, 1);
  border-radius: 50%;
  animation: work-area-trim-spin 0.8s linear infinite;
}

.work-area-trim.is-queue-loading :is(.work-area-trim__bar, .work-area-trim__overview, .work-area-trim__meta, .work-area-trim__help) {
  display: none;
}

.work-area-trim.is-queue-loading .work-area-trim__actions {
  justify-content: flex-start;
}

.work-area-trim.is-queue-loading .work-area-trim__button.is-primary {
  display: none;
}

@keyframes work-area-trim-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .work-area-trim__stage.is-queue-loading::before { animation: none; }
}

.work-area-trim__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 18px;
}

.work-area-trim__play {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(40, 58, 82, 1);
  color: #fff;
  cursor: pointer;
}

.work-area-trim__play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.work-area-trim__pause-icon,
.work-area-trim__play.is-playing .work-area-trim__play-icon {
  display: none;
}

.work-area-trim__play.is-playing .work-area-trim__pause-icon {
  display: block;
}

.work-area-trim__timeline {
  position: relative;
  flex: 1 1 auto;
  height: 48px;
  min-width: 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.work-area-trim__track {
  position: absolute;
  inset: 0;
}

/* Frames and the dimming are clipped to the strip; the window and its handles above are not. */
.work-area-trim__strip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(72, 222, 170, 0.75);
  border-radius: 6px;
  background: rgba(12, 32, 52, 1);
}

.work-area-trim__cutout {
  position: absolute;
  top: 0;
  bottom: 0;
  box-shadow: 0 0 0 9999px rgba(2, 15, 30, 0.62);
  pointer-events: none;
}

.work-area-trim__frames {
  position: absolute;
  inset: 0;
  display: flex;
}

.work-area-trim__frames span {
  flex: 1 1 0;
  min-width: 0;
  border-left: 1px solid rgba(72, 222, 170, 0.35);
  background-position: center;
  background-size: cover;
}

.work-area-trim__frames span:first-child {
  border-left: 0;
}

.work-area-trim__frames.is-wave {
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
}

.work-area-trim__frames.is-wave i {
  flex: 1 1 0;
  height: 12%;
  min-width: 1px;
  border-radius: 1px;
  background: rgba(72, 222, 170, 0.6);
}

/* The window is the kept part; the shadow dims the rest of the strip (clipped by the track). */
/* The window is exactly the fragment: frame lines top and bottom, the handles stand outside its edges,
   so the playhead at the fragment's start or end is seen inside the fragment. */
.work-area-trim__window {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 2px;
  border-top: 2px solid rgba(72, 222, 170, 1);
  border-bottom: 2px solid rgba(72, 222, 170, 1);
  cursor: grab;
}

.work-area-trim__window:focus-visible,
.work-area-trim__handle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.work-area-trim__handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 14px;
  background: rgba(72, 222, 170, 1);
  cursor: ew-resize;
}

.work-area-trim__handle::after {
  content: "";
  width: 2px;
  height: 16px;
  border-radius: 1px;
  background: rgba(7, 27, 46, 1);
}

.work-area-trim__handle.is-start {
  left: -14px;
  border-radius: 6px 0 0 6px;
}

.work-area-trim__handle.is-end {
  right: -14px;
  border-radius: 0 6px 6px 0;
}

.work-area-trim__playhead {
  position: absolute;
  top: -10px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  background: rgba(72, 222, 170, 1);
  pointer-events: none;
}

.work-area-trim__playhead[hidden] {
  display: none;
}

.work-area-trim__playhead-grip {
  position: absolute;
  top: -8px;
  left: -10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: ew-resize;
  pointer-events: auto;
  touch-action: none;
}

.work-area-trim__playhead-grip:focus-visible {
  outline: 2px solid #fff;
}

.work-area-trim__playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -6px;
  border: 7px solid transparent;
  border-top: 9px solid rgba(72, 222, 170, 1);
  border-bottom: 0;
}

.work-area-trim__time {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(168, 179, 194, 1);
  font: 500 11px/16px Mulish, system-ui, sans-serif;
}

.work-area-trim__overview {
  position: relative;
  height: 22px;
  margin: -6px 0 14px 58px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.work-area-trim__overview[hidden],
.work-area-trim__zoom[hidden] {
  display: none;
}

.work-area-trim__overview-track {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 4px;
  background: rgba(12, 32, 52, 1);
}

.work-area-trim__overview .work-area-trim__frames {
  opacity: 0.55;
}

.work-area-trim__overview .work-area-trim__frames.is-wave {
  padding: 3px 2px;
  gap: 1px;
}

/* The part shown up close (thin frame) and the fragment itself (filled). */
.work-area-trim__overview-view {
  position: absolute;
  top: 0;
  bottom: 0;
  border: 1px solid rgba(230, 233, 237, 0.7);
  border-radius: 3px;
}

.work-area-trim__overview-window {
  position: absolute;
  top: 2px;
  bottom: 2px;
  min-width: 3px;
  border-radius: 2px;
  background: rgba(72, 222, 170, 0.85);
}

.work-area-trim__overview-playhead {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  margin-left: -1px;
  background: #fff;
}

.work-area-trim__overview-time {
  position: absolute;
  top: 100%;
  left: 0;
  color: rgba(168, 179, 194, 1);
  font: 500 10px/14px Mulish, system-ui, sans-serif;
}

.work-area-trim__overview-time.is-end {
  left: auto;
  right: 0;
}

.work-area-trim__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.work-area-trim__zoom {
  display: flex;
  gap: 6px;
}

.work-area-trim__zoom-button {
  width: 32px;
  height: 28px;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 6px;
  background: rgba(26, 42, 59, 1);
  color: rgba(230, 233, 237, 1);
  font: 700 16px/1 Mulish, system-ui, sans-serif;
  cursor: pointer;
}

.work-area-trim__zoom-button:disabled {
  opacity: 0.4;
  cursor: default;
}

.work-area-trim__help {
  margin: 0;
  color: rgba(168, 179, 194, 1);
  font: 500 12px/17px Mulish, system-ui, sans-serif;
}

.work-area-trim__range {
  margin: 0;
  color: rgba(230, 233, 237, 1);
  font: 600 13px/18px Mulish, system-ui, sans-serif;
}

.work-area-trim__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.work-area-trim__button {
  min-width: 96px;
  padding: 9px 20px;
  border: 1px solid rgba(72, 222, 170, 0.85);
  border-radius: 6px;
  background: transparent;
  color: rgba(72, 222, 170, 1);
  font: 700 13px/18px Mulish, system-ui, sans-serif;
  cursor: pointer;
}

.work-area-trim__button.is-primary {
  background: rgba(0, 190, 140, 1);
  border-color: rgba(0, 190, 140, 1);
  color: rgba(2, 15, 30, 1);
}

:is(.work-area-right-panel__frame-card, .work-area-right-panel__ref-media-add) {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  background: rgba(29, 43, 61, 1);
  cursor: pointer;
}

.work-area-right-panel__frame-card {
  position: relative;
  min-height: 128px;
  padding: 16px 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

:is(.work-area-right-panel__frame-card, .work-area-right-panel__ref-media-add):where(:hover:not(:disabled), :focus-visible) {
  border-color: rgba(230, 233, 237, 1);
  outline: none;
}

.work-area-right-panel__frame-card:where(:hover:not(:disabled), :focus-visible) {
  transform: translateY(-1px);
}

.work-area-right-panel__frame-card.is-disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.work-area-right-panel__frame-card.is-conflict {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

/* A model without a last frame says so on the card instead of only in its tooltip (team chat 08.10). */
.work-area-right-panel__frame-unsupported,
.work-area-right-panel__frame-card.is-disabled .work-area-right-panel__frame-plus {
  display: none;
}

.work-area-right-panel__frame-card.is-disabled .work-area-right-panel__frame-unsupported {
  display: block;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
}

.work-area-right-panel__frame-card.is-filled {
  border-width: 2px;
  border-color: rgba(79, 227, 194, 0.9);
}

.work-area-right-panel__frame-card.is-filled:focus-visible {
  outline: 2px solid rgba(230, 233, 237, 1);
  outline-offset: 2px;
}

.work-area-right-panel__frame-placeholder {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.work-area-right-panel__frame-label {
  color: rgba(230, 233, 237, 1);
  font: 600 14px/20px Mulish, system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.work-area-right-panel__frame-sub {
  color: rgba(168, 179, 194, 1);
  font: 400 11px/16px Mulish, system-ui, sans-serif;
}

.work-area-right-panel__frame-plus {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  color: rgba(230, 233, 237, 1);
  font-size: 0;
}

.work-area-right-panel__frame-placeholder .work-area-right-panel__frame-plus {
  margin-top: 4px;
}

.work-area-right-panel__frame-plus::before,
.work-area-right-panel__frame-plus::after {
  position: absolute;
  content: "";
  display: block;
  border-radius: 1px;
  background: currentColor;
}

.work-area-right-panel__frame-plus::before {
  top: 7px;
  left: 0;
  width: 16px;
  height: 2px;
}

.work-area-right-panel__frame-plus::after {
  top: 0;
  left: 7px;
  width: 2px;
  height: 16px;
}

.work-area-right-panel__frame-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-area-right-panel__frame-preview[hidden] {
  display: none !important;
}

.work-area-right-panel__frame-card.has-preview .work-area-right-panel__frame-placeholder {
  display: none;
}

.work-area-right-panel__concurrency {
  width: 100%;
  margin-top: 24px;
}

.work-area-right-panel__concurrency[hidden] {
  display: none !important;
}

.work-area-right-panel__concurrency-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.work-area-right-panel__concurrency-label {
  flex: 1 1 auto;
  max-width: 168px;
  margin: 0;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.15px;
}

.work-area-right-panel__concurrency-controls {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  gap: 12px;
  align-self: center;
}

.work-area-right-panel__concurrency-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(168, 179, 194, 1);
  font-size: 0;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.work-area-right-panel__concurrency-button::before,
.work-area-right-panel__concurrency-button::after {
  content: "";
  position: absolute;
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.work-area-right-panel__concurrency-button::after {
  width: 2px;
  height: 14px;
}

.work-area-right-panel__concurrency-button[data-work-area-concurrency-action="decrease"]::after {
  display: none;
}

.work-area-right-panel__concurrency-button:hover,
.work-area-right-panel__concurrency-button:focus-visible {
  color: rgba(230, 233, 237, 1);
  outline: none;
  transform: translateY(-1px);
}

.work-area-right-panel__concurrency-button:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.work-area-right-panel__concurrency-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.15px;
  text-align: center;
}

.work-area-sidebar > .work-area-right-panel__text-type,
.work-area-sidebar > .work-area-right-panel__settings {
  display: none;
}

.work-area-right-panel__setting-group,
.work-area-right-panel__text-type {
  width: 100%;
}

.work-area-right-panel__setting-title-row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 24px;
  margin: 0 0 8px;
  gap: 8px;
}

.work-area-right-panel__setting-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  order: 2;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(168, 179, 194, 1);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.work-area-right-panel__setting-toggle span {
  display: block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.work-area-right-panel__setting-toggle[aria-expanded="true"] span {
  transform: translateY(2px) rotate(225deg);
}

.work-area-right-panel__setting-toggle:hover,
.work-area-right-panel__setting-toggle:focus-visible {
  background: rgba(42, 64, 87, 0.85);
  color: rgba(72, 222, 170, 1);
  outline: none;
}

.work-area-right-panel__setting-toggle:focus-visible {
  outline: 2px solid rgba(72, 222, 170, 0.9);
  outline-offset: 2px;
}

.work-area-right-panel__setting-title,
.work-area-right-panel__text-type-title {
  margin: 0;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.15px;
}

.work-area-right-panel__setting-title {
  cursor: pointer;
}

.work-area-right-panel__setting-title-row .work-area-right-panel__setting-title {
  flex: 1 1 auto;
  min-width: 0;
}

.work-area-right-panel__setting-title-row .work-area-right-panel__setting-help-button {
  order: 3;
}

.work-area-right-panel__setting-group:not(.is-expanded) .work-area-right-panel__setting-title-row {
  margin-bottom: 0;
}

.work-area-right-panel__setting-help-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(168, 179, 194, 0.7);
  border-radius: 50%;
  background: rgba(42, 64, 87, 0.95);
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.work-area-right-panel__setting-help-button:hover,
.work-area-right-panel__setting-help-button:focus-visible,
.work-area-right-panel__setting-help-button[aria-expanded="true"] {
  border-color: rgba(72, 222, 170, 1);
  background: rgba(60, 74, 94, 1);
  color: rgba(72, 222, 170, 1);
}

.work-area-right-panel__setting-help-button:focus-visible {
  outline: 2px solid rgba(72, 222, 170, 0.9);
  outline-offset: 2px;
}

.work-area-right-panel__setting-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: none;
  width: min(280px, calc(100vw - 56px));
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(168, 179, 194, 0.45);
  border-radius: 8px;
  background: rgba(17, 35, 53, 0.98);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.1px;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}

.work-area-right-panel__setting-help-button:not([data-help-dismissed]):hover .work-area-right-panel__setting-tooltip,
.work-area-right-panel__setting-help-button:not([data-help-dismissed]):focus-visible .work-area-right-panel__setting-tooltip,
.work-area-right-panel__setting-help-button[aria-expanded="true"] .work-area-right-panel__setting-tooltip {
  display: block;
}

/* The bottom settings open their tooltip upwards so it stays inside the panel. */
.work-area-right-panel__setting-group:nth-last-child(-n+2) .work-area-right-panel__setting-tooltip {
  top: auto;
  bottom: calc(100% + 8px);
}

/* Without JS placement: anchor the tooltip to its row, not to the 18px button,
   so a narrow panel does not clip it. work_area.js then pins it to the viewport. */
.work-area-right-panel__setting-title-row .work-area-right-panel__setting-help-button,
.work-area-right-panel__frames-head .work-area-right-panel__setting-help-button {
  position: static;
}

.work-area-right-panel__setting-title-row .work-area-right-panel__setting-tooltip,
.work-area-right-panel__frames-head .work-area-right-panel__setting-tooltip {
  width: min(280px, 100%);
}

.work-area-right-panel__prompt-enhancer {
  width: 100%;
  margin-top: 24px;
}

.work-area-right-panel__prompt-enhancer[hidden] {
  display: none !important;
}

.work-area-right-panel__prompt-enhancer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.work-area-right-panel__prompt-enhancer-label {
  flex: 1 1 auto;
  margin: 0;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.15px;
}

.work-area-right-panel__prompt-enhancer-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  flex: 0 0 44px;
  width: 44px;
  height: 24px;
  padding: 2px;
  border: 0;
  border-radius: 6px;
  background: #2A4057;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.work-area-right-panel__prompt-enhancer-toggle:focus-visible {
  outline: 2px solid rgba(77, 218, 181, 0.9);
  outline-offset: 2px;
}

.work-area-right-panel__prompt-enhancer-thumb {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 6px;
  background: #48DEAA;
  transform: translateX(0);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.work-area-right-panel__prompt-enhancer-toggle.is-active .work-area-right-panel__prompt-enhancer-thumb {
  background: #2A4057;
  transform: translateX(20px);
}

.work-area-right-panel__prompt-enhancer-toggle.is-active {
  background: #48DEAA;
}

.work-area-right-panel__setting-list,
.work-area-right-panel__text-type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-area-right-panel__setting-list[hidden],
.work-area-right-panel__setting-help[hidden] {
  display: none !important;
}

.work-area-right-panel__setting-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(168, 179, 194, 0.35);
  border-radius: 8px;
  background: rgba(7, 24, 40, 0.92);
  color: rgba(230, 233, 237, 1);
  font: inherit;
}

.work-area-right-panel__setting-input--multiline {
  min-height: 74px;
  resize: vertical;
}

.work-area-right-panel__setting-input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  height: 20px;
  padding: 0;
  accent-color: rgba(72, 222, 170, 1);
}

.work-area-right-panel__setting-input-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(230, 233, 237, 1);
  font: inherit;
}

.work-area-right-panel__setting-help {
  display: block;
  margin-top: 6px;
  color: rgba(168, 179, 194, 1);
  font-size: 12px;
  line-height: 1.35;
}

.work-area-right-panel__setting-chip,
.work-area-right-panel__text-type-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(26, 42, 59, 1);
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.1px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.work-area-right-panel__setting-chip::before,
.work-area-right-panel__text-type-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(230, 233, 237, 0.2);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.work-area-right-panel__setting-chip:hover,
.work-area-right-panel__setting-chip:focus-visible,
.work-area-right-panel__setting-chip.is-active,
.work-area-right-panel__text-type-chip:hover,
.work-area-right-panel__text-type-chip:focus-visible,
.work-area-right-panel__text-type-chip.is-active {
  border-color: rgba(168, 179, 194, 1);
  outline: none;
}

.work-area-right-panel__setting-chip:hover::before,
.work-area-right-panel__setting-chip:focus-visible::before,
.work-area-right-panel__setting-chip.is-active::before,
.work-area-right-panel__text-type-chip:hover::before,
.work-area-right-panel__text-type-chip:focus-visible::before,
.work-area-right-panel__text-type-chip.is-active::before {
  transform: scaleX(1);
}

.work-area-right-panel__setting-chip[data-work-area-setting-key="aspect_ratio"] {
  flex: 0 0 calc((100% - 24px) / 4);
  width: calc((100% - 24px) / 4);
  min-width: 0;
  min-height: 94px;
  box-sizing: border-box;
  flex-direction: column;
  gap: 12px;
  padding: 10px 4px 11px;
  border-radius: 8px;
}

.work-area-right-panel__aspect-preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: min(58px, 100%);
  height: 44px;
}

.work-area-right-panel__aspect-preview {
  display: block;
  flex: 0 0 auto;
  max-width: 58px;
  max-height: 44px;
  border-radius: 2px;
  background: #3C4A5E;
}

.work-area-right-panel__setting-chip-label {
  display: block;
  line-height: 1.2;
  white-space: nowrap;
}

.work-area-right-panel__select-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  z-index: 12;
  padding: 8px;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  background: rgba(13, 36, 56, 0.98);
  box-shadow: 0 18px 40px rgba(0, 8, 18, 0.38);
  max-height: 304px;
  overflow-y: auto;
  overflow-x: hidden;
}

.work-area-right-panel__select-dropdown[hidden] {
  display: none;
}

.work-area-right-panel__select-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 100%;
}

.work-area-right-panel__select-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(60, 74, 94, 0.72);
  border-radius: 8px;
  background: rgba(26, 42, 59, 1);
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.1px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.work-area-right-panel__select-option::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(72, 222, 170, 0.2);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.work-area-right-panel__select-option:hover::before,
.work-area-right-panel__select-option:focus-visible::before,
.work-area-right-panel__select-option.is-active::before {
  transform: scaleX(1);
}

.work-area-right-panel__select-option:hover,
.work-area-right-panel__select-option:focus-visible,
.work-area-right-panel__select-option.is-active {
  border-color: rgba(72, 222, 170, 1);
}

.work-area-right-panel__select-option:focus-visible {
  outline: none;
}

.work-area-right-panel__select-option-check {
  flex: 0 0 auto;
  color: rgba(72, 222, 170, 1);
  font-size: 15px;
  line-height: 1;
}

.work-area-center-intro {
  width: 100%;
  display: flex;
  justify-content: center;
}

.work-area-center-intro[hidden],
.work-area-create-screen[hidden] {
  display: none !important;
}

.work-area-initial-editor { display: none; }
.work-area-layout[data-work-area-initializing="editor"] .work-area-initial-editor {
  display: grid;
  align-content: start;
  gap: 16px;
  width: min(100%, 820px);
  margin: 24px auto;
  padding: 0 16px;
  color: #aab9cb;
  font-size: 14px;
}
.work-area-layout[data-work-area-initializing="editor"] .work-area-create-screen { display: none; }
.work-area-initial-editor__media { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; }
.work-area-initial-editor__prompt { width: 100%; height: 96px; border-radius: 12px; }

.work-area-center-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.work-area-center-intro:has(> .work-area-template-feed) {
  height: 100%;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow-y: auto;
}

.work-area-center-intro:has(> .work-area-template-feed) .work-area-center-stack {
  flex: none;
  min-height: max(250px, calc(100% - clamp(184px, 31%, 248px)));
  justify-content: center;
  padding: 16px;
}

.work-area-template-feed {
  flex: none;
  width: 100%;
  padding: 0 clamp(12px, 2vw, 24px) 24px;
  color: #e6e9ed;
  font: 600 14px/1.5 Mulish, system-ui, sans-serif;
}

.work-area-template-feed__heading { margin: 0 0 12px; font-size: 18px; }
.work-area-template-feed__jump {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  min-height: 44px;
  margin: auto;
  padding: 4px 12px;
  color: inherit;
  text-decoration: none;
}

.work-area-template-feed__jump:hover { color: #48deaa; }
.work-area-template-feed__jump span {
  width: 8px;
  height: 8px;
  border: solid #48deaa;
  border-width: 0 2px 2px 0;
  rotate: 45deg;
}

@media (prefers-reduced-motion: no-preference) {
  .work-area-center-intro:has(> .work-area-template-feed) { scroll-behavior: smooth; }
  .work-area-template-feed__jump span { animation: template-feed-nudge 650ms ease-in-out 2; }
  @keyframes template-feed-nudge { 50% { translate: 0 3px; } }
}

.work-area-template-feed__tabs { display: flex; gap: 8px; flex-wrap: wrap; scroll-margin-top: 12px; }
.work-area-template-feed__tabs a { margin-inline-start: auto; }
.work-area-template-feed__tabs :is(button, a), .work-area-template-feed__more {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  color: inherit;
  background: #10283e;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.work-area-template-feed__tabs button[aria-pressed="true"] { background: #25455b; }
.work-area-template-feed__tabs :is(button, a):focus-visible,
.work-area-template-feed__more:focus-visible {
  outline: 2px solid #48deaa;
  outline-offset: 2px;
}
@media (hover: hover) {
  .work-area-template-feed__tabs :is(button, a):hover,
  .work-area-template-feed__more:hover {
    background: #254f62;
    color: #48deaa;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .work-area-template-feed__tabs :is(button, a),
  .work-area-template-feed__more {
    transition: background-color 160ms ease, color 160ms ease;
  }
}
.work-area-template-feed__more { margin-top: 14px; }
.work-area-template-feed [data-template-feed-status]:empty { display: none; }
.work-area-template-feed .work-area-templates-screen__grid {
  --template-columns: 2;
  --template-feed-gap: 12px;
  position: relative;
  grid-template-columns: repeat(var(--template-columns), minmax(0, 1fr));
  gap: var(--template-feed-gap);
  margin-top: 12px;
}
.work-area-template-feed .work-area-templates-screen__grid[data-masonry] { display: block; }
.work-area-template-feed [data-masonry] > .work-area-templates-card {
  position: absolute;
  width: calc((100% - (var(--template-columns) - 1) * var(--template-feed-gap)) / var(--template-columns));
}
.work-area-template-feed .work-area-templates-card {
  padding: 10px;
  background: #10283e;
  text-decoration: none;
}
.work-area-template-feed .work-area-templates-card:not(.work-area-template-feed__skeleton) { padding: 0; }
.work-area-template-feed .work-area-templates-card__preview { position: relative; display: block; aspect-ratio: auto; }
.work-area-template-feed .work-area-templates-card__preview:not(:has(> img)) { aspect-ratio: 4 / 3; }
.work-area-template-feed .work-area-templates-card__image { height: auto; aspect-ratio: auto 4 / 3; object-fit: contain; }
.work-area-template-feed .work-area-templates-card__title {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  margin-top: 0;
  padding: 24px 10px 10px;
  background: linear-gradient(transparent, #001126ed);
  color: #e6e9ed;
  white-space: normal;
  overflow-wrap: anywhere;
}
.work-area-template-feed :is(.feature-card__author, .feature-card__rating) {
  top: 8px;
  background: #071b2ee0;
  letter-spacing: normal;
}
.work-area-template-feed .feature-card__author { left: 8px; max-width: calc(100% - 55px); padding: 3px 7px; }
.work-area-template-feed .feature-card__rating { right: 8px; }
.work-area-template-feed .feature-card__rating.is-liked { background: #0b3b37e6; }
.work-area-template-feed .feature-card__rating.is-interactive:is(:hover, :focus-visible) { background: #1d3a52f0; }
.work-area-template-feed .work-area-templates-card.is-example { cursor: default; border-color: #244455; }
.work-area-template-feed .work-area-template-feed__skeleton { cursor: default; pointer-events: none; }
.work-area-template-feed__skeleton .ui-skeleton__line { margin-top: 10px; }
@media (min-width: 760px) {
  .work-area-template-feed .work-area-templates-screen__grid { --template-columns: 4; }
}

.work-area-center-title {
  margin: 0 0 32px;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 28px;
  font-style: normal;
  font-weight: 400;
  line-height: 36px;
  letter-spacing: 0;
  text-align: center;
}

.work-area-create-screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* The chat ends right above the prompt box, and its edges fade instead of cutting works in half;
   the inner padding keeps the first and the last work clear of the fade at the scroll ends. */
.work-area-create-screen__content {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  margin-bottom: 8px;
  position: relative;
  overflow-y: auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 32px, #000 calc(100% - 16px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 32px, #000 calc(100% - 16px), transparent 100%);
}

.work-area-create-screen.is-generating .work-area-create-screen__content {
  display: block;
}

.work-area-create-screen__content.is-loading .work-area-create-screen__content-inner {
  display: none;
}

.work-area-create-screen__content-inner {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  min-height: 100%;
  padding: 32px 0 16px;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.5px;
}

.work-area-create-screen__content-text {
  margin: 0;
  white-space: pre-wrap;
}

.work-area-create-screen__messages {
  display: flex;
  flex-direction: column;
  gap: 64px;
  width: 100%;
  margin-top: auto;
}

.work-area-create-screen__message {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.work-area-create-screen__message--assistant {
  background: transparent;
}

.work-area-create-screen__message--loading {
  align-items: center;
  justify-content: center;
  min-height: 132px;
  border-style: dashed;
}

.work-area-create-screen__message-role {
  color: rgba(72, 222, 170, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.5px;
}

.work-area-create-screen__message-body {
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0.25px;
  word-break: break-word;
}

.work-area-create-screen__message-body > span.work-area-create-screen__message-heading,
.work-area-create-screen__message-body > p,
.work-area-create-screen__message-body > ul,
.work-area-create-screen__message-body > ol,
.work-area-create-screen__message-body > hr,
.work-area-create-screen__message-body > pre {
  display: block;
}

/* Wide centre (history hidden, large screens): text keeps a readable line length;
   media, cards and code still use the full width. */
.work-area-create-screen__message-body > span.work-area-create-screen__message-heading,
.work-area-create-screen__message-body > p,
.work-area-create-screen__message-body > ul,
.work-area-create-screen__message-body > ol {
  max-width: 900px;
}

.work-area-create-screen__message-body > * + * {
  margin-top: 16px;
}

.work-area-create-screen__message-paragraph {
  margin: 0;
}

.work-area-create-screen__message-list {
  margin: 0;
  padding-left: 24px;
}

.work-area-create-screen__message-body > .work-area-create-screen__message-list:first-child {
  margin-top: 0;
}

.work-area-create-screen__message-heading + .work-area-create-screen__message-list,
.work-area-create-screen__message-heading + .work-area-create-screen__message-paragraph,
.work-area-create-screen__message-paragraph + .work-area-create-screen__message-heading,
.work-area-create-screen__message-paragraph + .work-area-create-screen__message-list,
.work-area-create-screen__message-list + .work-area-create-screen__message-paragraph,
.work-area-create-screen__message-list + .work-area-create-screen__message-heading {
  margin-top: 16px;
}

.work-area-create-screen__message-paragraph + .work-area-create-screen__message-list,
.work-area-create-screen__message-list + .work-area-create-screen__message-paragraph,
.work-area-create-screen__message-heading + .work-area-create-screen__message-list,
.work-area-create-screen__message-list + .work-area-create-screen__message-heading {
  margin-top: 16px;
}

.work-area-create-screen__message-list li + li {
  margin-top: 8px;
}

.work-area-create-screen__message-divider {
  display: block;
  width: 100%;
  height: 1px;
  margin: 16px 0;
  border: 0;
  background: rgba(60, 74, 94, 1);
}

.work-area-create-screen__message-body strong {
  font-weight: 700;
}

.work-area-create-screen__message-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.work-area-create-screen__image-source-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  cursor: pointer;
  user-select: none;
}

.work-area-create-screen__image-source-toggle input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: rgba(72, 222, 170, 1);
  cursor: pointer;
}

.work-area-create-screen__image-source-toggle:hover,
.work-area-create-screen__image-source-toggle:has(input:checked) {
  color: rgba(72, 222, 170, 1);
}

.work-area-create-screen__message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.work-area-create-screen__message-attachment {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  background: rgba(26, 42, 59, 1);
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0.2px;
  text-decoration: none;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.work-area-create-screen__message-attachment:hover,
.work-area-create-screen__message-attachment:focus-visible {
  border-color: rgba(72, 222, 170, 1);
  background: rgba(42, 64, 87, 1);
  outline: none;
}

.work-area-create-screen__message-attachment-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-area-create-screen__message-download svg {
  width: 20px;
  height: 20px;
  color: rgba(72, 222, 170, 1);
}

.work-area-create-screen__message-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.work-area-create-screen__message-download:focus-visible {
  outline: none;
}

.work-area-create-screen__message-download-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* The «⋯» panel takes the card's width without widening it: a long operation name in the select
   used to push the page sideways (on phones the whole Work Area scrolled horizontally). */
.work-area-video-operation {
  width: 0;
  min-width: 100%;
  margin-top: 0;
}

.work-area-video-operation__panel label {
  display: flex;
  flex: 1 1 100%;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.work-area-video-operation__panel select,
.work-area-video-operation__panel input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.work-area-video-operation button,
.work-area-video-operation select,
.work-area-video-operation input {
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  background: rgba(26, 42, 59, 1);
  color: rgba(230, 233, 237, 1);
  font: 600 13px Mulish, system-ui, sans-serif;
  padding: 9px 12px;
}

.work-area-video-operation button { cursor: pointer; }

.work-area-video-operation .work-area-video-operation__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
}
.work-area-video-operation button:hover,
.work-area-video-operation button:focus-visible { border-color: rgba(72, 222, 170, 1); }
.work-area-video-operation button:disabled { opacity: 0.6; cursor: wait; }
.work-area-video-operation__panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.work-area-video-operation__panel[hidden],
.work-area-video-operation__panel input[hidden] { display: none; }
.work-area-video-operation__panel label { display: flex; align-items: center; gap: 8px; }
.work-area-video-operation__panel input { flex: 1 1 240px; min-width: 0; }
.work-area-video-operation__panel [role="alert"] { color: #ffb2a4; }

.work-area-create-screen__message-code {
  margin: 12px 0;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  background: rgba(0, 17, 38, 0.88);
}

.work-area-create-screen__message-code code {
  display: block;
  color: rgba(230, 233, 237, 1);
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.work-area-create-screen__message-heading {
  display: block;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
}

.work-area-create-screen__message-heading--md {
  font-size: 28px;
  line-height: 36px;
}

.work-area-create-screen__message-heading--sm {
  font-size: 24px;
  line-height: 32px;
}

.work-area-create-screen__loading-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.work-area-create-screen__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.work-area-create-screen__content:not(.is-loading) .work-area-create-screen__loading {
  display: none;
}

.work-area-create-screen__loading-spinner {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background:
    conic-gradient(
      from 0deg,
      rgba(72, 222, 170, 0) 0deg,
      rgba(72, 222, 170, 0.22) 30deg,
      rgba(72, 222, 170, 0.72) 110deg,
      rgba(72, 222, 170, 1) 179.9deg,
      rgba(72, 222, 170, 0) 180deg,
      rgba(72, 222, 170, 0) 360deg
    ),
    rgba(8, 40, 59, 1);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 11px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 11px));
  will-change: transform;
  animation: work-area-spin 1.1s linear infinite;
}

.work-area-create-screen__loading-label {
  margin: 16px 0 0;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.5px;
  text-align: center;
}

.work-area-create-screen__image-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  margin-top: 16px;
}

/* Up to 5 columns by the chat's own width, each at least ~160px (phones: one column, below). */
.work-area-create-screen__messages--image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(160px, (100% - 64px) / 5)), 1fr));
  align-items: start;
  gap: 24px 16px;
}

.work-area-create-screen__messages--image-gallery .work-area-create-screen__image-grid {
  display: contents;
}

.work-area-create-screen__messages--image-gallery .work-area-create-screen__image-card {
  width: 100%;
  max-width: none;
  min-width: 0;
  gap: 8px;
}

.work-area-create-screen__messages--image-gallery .work-area-create-screen__image-preview {
  display: block;
  width: 100%;
  height: 350px;
  background: rgba(26, 42, 59, 1);
}

.work-area-create-screen__messages--image-gallery .work-area-create-screen__image-preview img {
  width: 100%;
  height: 350px;
  max-height: none;
  object-fit: cover;
}

.work-area-create-screen__messages--image-gallery .work-area-create-screen__message-actions {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  gap: 8px;
  margin-top: 0;
}

.work-area-create-screen__messages--image-gallery .work-area-create-screen__image-source-toggle {
  flex: 1 1 100%;
  width: 100%;
}

.work-area-create-screen__messages--image-gallery .work-area-create-screen__message-error {
  grid-column: 1 / -1;
}

/* Video gallery: responsive tiles, with the full frame visible at every aspect ratio. */
.work-area-create-screen__generation-entry {
  display: contents;
}

.work-area-create-screen__messages--video-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  align-items: start;
  gap: 24px 16px;
}

.work-area-create-screen__messages--video-gallery .work-area-create-screen__video-grid {
  display: contents;
}

.work-area-create-screen__messages--video-gallery .work-area-create-screen__video-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.work-area-create-screen__messages--video-gallery .work-area-create-screen__video-player {
  width: 100%;
  height: 240px;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
}

.work-area-create-screen__messages--video-gallery > :not(.work-area-create-screen__video-grid),
.work-area-create-screen__messages--video-gallery > .work-area-create-screen__generation-entry > :not(.work-area-create-screen__video-grid) {
  grid-column: 1 / -1;
}

.work-area-create-screen__message-error-prompt {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: rgba(168, 179, 194, 1);
  font-size: 13px;
  line-height: 18px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.work-area-video-prompt {
  position: fixed;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 16px));
  max-height: min(60vh, 520px);
  padding: 14px;
  overflow-y: auto;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  background: rgba(7, 27, 46, 1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
}

.work-area-video-prompt .work-area-create-screen__video-meta {
  font-size: 13px;
}

.work-area-video-prompt__text {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  white-space: pre-wrap;
}

.work-area-create-screen__video-input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 2px;
}

.work-area-video-prompt__use {
  padding: 4px 10px;
  border: 0;
  border-radius: 4px;
  background: rgba(26, 42, 59, 1);
  color: rgba(72, 222, 170, 1);
  font: 600 12px/16px Mulish, system-ui, sans-serif;
  cursor: pointer;
}

.work-area-video-prompt__copy {
  align-self: flex-start;
  padding: 8px 14px;
  border: 0;
  border-radius: 4px;
  background: rgba(26, 42, 59, 1);
  color: rgba(72, 222, 170, 1);
  font: 600 13px/18px Mulish, system-ui, sans-serif;
  cursor: pointer;
}

.work-area-create-screen__image-gallery-pending {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 350px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  background: rgba(26, 42, 59, 0.48);
}

.work-area-create-screen__image-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: auto;
  max-width: 100%;
  margin: 0;
}

.work-area-create-screen__image-preview {
  display: block;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.work-area-create-screen__image-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 520px;
  height: auto;
  object-fit: contain;
}

.work-area-create-screen__image-card .work-area-create-screen__message-actions {
  margin-top: 4px;
}

.work-area-create-screen__image-sources {
  margin-top: 12px;
}

.work-area-create-screen__image-sources-label {
  margin: 0 0 8px;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.2px;
}

.work-area-create-screen__image-sources-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.work-area-create-screen__image-source-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 112px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  background: rgba(26, 42, 59, 1);
  color: rgba(230, 233, 237, 1);
  text-decoration: none;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.work-area-create-screen__image-source-card:hover,
.work-area-create-screen__image-source-card:focus-visible {
  border-color: rgba(72, 222, 170, 1);
  background: rgba(42, 64, 87, 1);
  outline: none;
}

.work-area-create-screen__image-source-preview {
  display: block;
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 5px;
  background: rgba(8, 40, 59, 1);
}

.work-area-create-screen__image-source-name {
  display: block;
  overflow: hidden;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 500;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-area-create-screen__video-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  margin-top: 16px;
}

.work-area-create-screen__video-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 10px;
  margin-top: 12px;
}

.work-area-create-screen__video-input-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  background: rgba(26, 42, 59, 1);
  color: rgba(230, 233, 237, 1);
  text-decoration: none;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.work-area-create-screen__video-input-card:hover,
.work-area-create-screen__video-input-card:focus-visible {
  border-color: rgba(72, 222, 170, 1);
  background: rgba(42, 64, 87, 1);
  outline: none;
}

.work-area-create-screen__video-input-preview {
  display: block;
  width: 100%;
  height: 104px;
  object-fit: cover;
  border-radius: 5px;
  background: rgba(8, 40, 59, 1);
}

.work-area-create-screen__video-input-label {
  display: block;
  overflow: hidden;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-area-create-screen__video-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: min(100%, 920px);
  max-width: 100%;
  margin: 0;
}

/* Own proportions, at most half the screen: a vertical video no longer takes more than a screen
   and a square one is not letterboxed to the chat width (team chat 08.10). */
.work-area-create-screen__video-player {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(50dvh, 520px);
  border-radius: 12px;
  background: rgba(0, 17, 38, 1);
}

.work-area-create-screen__video-card .work-area-create-screen__message-actions {
  margin-top: 0;
}

.work-area-create-screen__video-meta {
  margin: 0;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0.25px;
}

.work-area-create-screen__audio-messages {
  gap: 32px;
}

.work-area-create-screen__audio-card {
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  background: #1A2A3B;
  box-sizing: border-box;
}

.work-area-create-screen__audio-cover {
  position: relative;
  flex: 0 0 112px;
  width: 112px;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #3C4A5E url("/static/front-home/assets/img/audio_project_cover.webp") center / cover no-repeat;
  cursor: pointer;
}

.work-area-create-screen__audio-cover.is-audio-loading {
  cursor: wait;
}

.work-area-create-screen__audio-cover.is-audio-loading::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  box-sizing: border-box;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: #48DEAA;
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
  animation: work-area-audio-loading-spin 0.8s linear infinite;
  pointer-events: none;
}

.work-area-create-screen__audio-cover.is-audio-loading .work-area-create-screen__audio-play {
  opacity: 0.18;
}

@keyframes work-area-audio-loading-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.work-area-create-screen__audio-play {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
  opacity: 0;
  transition: opacity 160ms ease;
}

.work-area-create-screen__audio-card:hover .work-area-create-screen__audio-play,
.work-area-create-screen__audio-card:focus-within .work-area-create-screen__audio-play,
.work-area-create-screen__audio-cover[aria-pressed="true"] .work-area-create-screen__audio-play {
  opacity: 1;
}

.work-area-create-screen__audio-card .work-area-create-screen__audio-cover.is-audio-loading .work-area-create-screen__audio-play {
  opacity: 0.18;
}

@media (hover: none) {
  .work-area-create-screen__audio-play {
    opacity: 1;
  }
}

.work-area-create-screen__audio-main {
  flex: 1 1 auto;
  min-width: 0;
}

.work-area-create-screen__audio-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0 0 16px;
}

.work-area-create-screen__audio-title {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin: 0;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 32px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-area-create-screen__audio-rename {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.work-area-create-screen__audio-rename img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
}

.work-area-create-screen__audio-rename:hover,
.work-area-create-screen__audio-rename:focus-visible {
  border-color: #48DEAA;
  background: rgba(72, 222, 170, 0.1);
}

.work-area-create-screen__audio-rename:focus-visible {
  outline: 2px solid #48DEAA;
  outline-offset: 2px;
}

.work-area-create-screen__audio-card.is-renaming-audio .work-area-create-screen__audio-rename {
  visibility: hidden;
}

.work-area-create-screen__audio-title-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 0 4px;
  border: 1px solid #48DEAA;
  border-radius: 5px;
  outline: none;
  color: inherit;
  background: #071B2E;
  font: inherit;
}

.work-area-create-screen__audio-title-input[readonly] {
  opacity: 0.65;
}

.work-area-create-screen__audio-title-input[aria-invalid="true"] {
  border-color: #FF8585;
}

.work-area-create-screen__audio-title-error {
  margin: 0 0 12px;
  color: #FF8585;
  font-size: 13px;
  line-height: 18px;
}

.work-area-create-screen__audio-mode {
  margin: 2px 0 10px;
  color: rgba(168, 179, 194, 1);
  font-size: 13px;
}

.work-area-create-screen__audio-element {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  border: 0;
  opacity: 0;
  pointer-events: none;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.work-area-create-screen__audio-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 16px;
}

.work-area-create-screen__audio-current-time,
.work-area-create-screen__audio-duration {
  color: #FFFFFF;
  font-family: Mulish, system-ui, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
}

.work-area-create-screen__audio-progress {
  position: relative;
  display: block;
  align-self: center;
  width: 100%;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  outline: 0;
  background: #071B2E;
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
}

.work-area-create-screen__audio-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 10px;
  background: #48DEAA;
  pointer-events: none;
  transition: width 80ms linear;
}

.work-area-create-screen__audio-progress:focus-visible {
  outline: 2px solid #48DEAA;
  outline-offset: 2px;
}

.work-area-create-screen__audio-transcript {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(13, 36, 56, 0.82);
  color: rgba(230, 233, 237, 1);
}

.work-area-create-screen__audio-transcript > span {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 640px) {
  .work-area-create-screen__audio-card {
    gap: 10px;
    padding: 16px;
  }

  .work-area-create-screen__audio-cover {
    flex-basis: 112px;
    width: 112px;
    min-height: 112px;
  }

  .work-area-create-screen__audio-status {
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .work-area-create-screen__messages--image-gallery {
    gap: 20px 12px;
  }
}

@media (max-width: 520px) {
  .work-area-create-screen__messages--image-gallery {
    grid-template-columns: 1fr;
  }
}

.work-area-create-screen__message-error {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 110, 110, 0.28);
  border-radius: 12px;
  background: rgba(77, 24, 30, 0.28);
}

.work-area-create-screen__message-error-text {
  margin: 0;
  color: rgba(255, 196, 196, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0.15px;
}

@keyframes work-area-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.work-area-create-screen__inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 0 0 auto;
  width: min(100%, 960px);
  align-self: center;
  margin-inline: auto;
  transform-origin: center top;
  transition: width 0.35s ease, transform 0.35s ease, opacity 0.25s ease;
}

.work-area-create-screen__title {
  display: none;
}

.work-area-create-screen__heading {
  margin: 0 0 32px;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 28px;
  font-style: normal;
  font-weight: 400;
  line-height: 36px;
  letter-spacing: 0;
  text-align: left;
  transition: opacity 0.25s ease, visibility 0.25s ease, margin 0.35s ease;
}

.work-area-create-screen.is-generating {
  justify-content: flex-start;
}

.work-area-create-screen.is-dropping .work-area-create-screen__inner {
  transform: translateY(32px);
}

/* In the chat the empty heading used to keep its 36 px between the messages and the prompt box. */
.work-area-create-screen.is-generating .work-area-create-screen__heading {
  height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  margin: 0;
}

.work-area-create-screen.is-generating.is-expanded .work-area-create-screen__inner {
  width: 100%;
}

.work-area-prompt-box {
  width: 100%;
}

.work-area-prompt-box.is-drop-target {
  border-radius: 8px;
}

.work-area-prompt-box__top {
  height: 150px;
  padding: 8px;
  border-top: 1px solid rgba(60, 74, 94, 1);
  border-left: 1px solid rgba(60, 74, 94, 1);
  border-right: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px 8px 0 0;
  background: rgba(0, 17, 38, 1);
}

.work-area-prompt-box__top.is-invalid {
  border-top-color: rgba(255, 180, 171, 1);
  border-left-color: rgba(255, 180, 171, 1);
  border-right-color: rgba(255, 180, 171, 1);
}

.work-area-prompt-box__input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0.25px;
  resize: none;
  overflow-y: auto;
  outline: none;
}

.work-area-prompt-box__input:focus-visible {
  outline: none;
}

.work-area-prompt-box__input.is-invalid,
.work-area-prompt-box__input.is-invalid::placeholder {
  color: rgba(255, 180, 171, 1);
}

.work-area-prompt-box__input::placeholder {
  color: rgba(107, 122, 143, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0.25px;
}

.work-area-prompt-box__bottom {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 72px;
  padding: 8px;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 0 0 8px 8px;
  background: rgba(7, 27, 46, 1);
}

/* Buttons keep their size. When the row does not fit (long text-price range, error, attachments),
   work_area.js sets is-price-wrapped and the price takes its own row above the buttons. */
.work-area-prompt-box__attach,
.work-area-prompt-box__estimate,
.work-area-prompt-box__voice,
.work-area-prompt-box__generate {
  flex-shrink: 0;
}

.work-area-prompt-box__bottom.is-price-wrapped {
  flex-wrap: wrap;
  row-gap: 8px;
}

.work-area-prompt-box__bottom.is-price-wrapped .work-area-prompt-box__estimate {
  order: -1;
  flex: 1 0 100%;
  justify-content: flex-end;
  margin-left: 0;
}

.work-area-prompt-box__bottom.is-price-wrapped .work-area-prompt-box__voice {
  margin-left: auto;
}

.work-area-prompt-box__attach {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid rgba(72, 222, 170, 1);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s ease;
}

.work-area-prompt-box__attach::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(72, 222, 170, 0.2);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.work-area-prompt-box__attach[hidden] {
  display: none;
}

.work-area-prompt-box__attach:hover::before,
.work-area-prompt-box__attach:focus-visible::before {
  transform: scaleX(1);
}

.work-area-prompt-box__attach-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.work-area-prompt-box__image-source {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  margin-left: 12px;
}

.work-area-prompt-box__files .work-area-prompt-box__image-source {
  margin-left: 0;
}

.work-area-prompt-box__image-source[hidden] {
  display: none !important;
}

.work-area-prompt-box__image-source-frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  border: 1px solid rgba(72, 222, 170, 1);
  border-radius: 6px;
  background: rgba(26, 42, 59, 1);
}

.work-area-prompt-box__image-source-preview {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 5px;
  object-fit: cover;
}

.work-area-prompt-box__image-source-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(7, 27, 46, 1);
  border-radius: 50%;
  background: rgba(60, 74, 94, 1);
  color: rgba(230, 233, 237, 1);
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 16px;
  cursor: pointer;
}

.work-area-prompt-box__image-source-remove:hover,
.work-area-prompt-box__image-source-remove:focus-visible {
  border-color: rgba(72, 222, 170, 1);
  background: rgba(42, 64, 87, 1);
  outline: none;
}

.work-area-prompt-box__file-preview {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
}

.work-area-prompt-box__file-preview-frame {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  overflow: visible;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 6px;
  background: rgba(26, 42, 59, 1);
}

.work-area-prompt-box__file-preview-image {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 5px;
  object-fit: cover;
}

.work-area-prompt-box__preview-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: zoom-in;
}

.work-area-prompt-box__preview-open:focus-visible {
  outline: 2px solid #48deaa;
  outline-offset: 2px;
}

.work-area-prompt-box__file-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(7, 27, 46, 1);
  border-radius: 50%;
  background: rgba(60, 74, 94, 1);
  color: rgba(230, 233, 237, 1);
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 16px;
  cursor: pointer;
}

.work-area-prompt-box__file-preview-remove:hover,
.work-area-prompt-box__file-preview-remove:focus-visible {
  border-color: rgba(72, 222, 170, 1);
  background: rgba(42, 64, 87, 1);
  outline: none;
}

.work-area-prompt-box__files {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: min(100%, 420px);
  margin-left: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(42, 64, 87, 1) transparent;
}

.work-area-prompt-box__files::-webkit-scrollbar {
  height: 4px;
}

.work-area-prompt-box__files::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(42, 64, 87, 1);
}

.work-area-prompt-box__file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 999px;
  background: rgba(26, 42, 59, 1);
}

.work-area-prompt-box__file-chip-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.25px;
}

.work-area-prompt-box__file-chip-remove {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(72, 222, 170, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.work-area-prompt-box__estimate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.work-area-prompt-box__estimate-icon {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.work-area-prompt-box__estimate.is-unavailable .work-area-prompt-box__estimate-icon {
  filter: brightness(0) saturate(100%) invert(58%) sepia(75%) saturate(3165%) hue-rotate(325deg) brightness(105%) contrast(104%);
}

/* Текст оценивается диапазоном «от — до». Вопросик объясняет почему — тот же, что у настроек,
   только открывается вверх: блок цены стоит внизу поля ввода. */
.work-area-prompt-box__estimate-help[hidden] {
  display: none;
}

.work-area-prompt-box__estimate-help {
  position: static;
}

.work-area-prompt-box__estimate .work-area-right-panel__setting-tooltip {
  top: auto;
  bottom: calc(100% + 8px);
  right: 8px;
  width: min(280px, calc(100% - 16px));
  z-index: 40;
}

.work-area-prompt-box__estimate-value {
  white-space: nowrap;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.1px;
}

.work-area-prompt-box__estimate-value.is-recalculating {
  animation: work-area-estimate-pulse 1.4s ease-in-out infinite;
}

@keyframes work-area-estimate-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  .work-area-prompt-box__estimate-value.is-recalculating {
    animation: none;
    opacity: 0.55;
  }
}

.work-area-prompt-box__voice {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 32px;
  padding: 12px;
  border: 1px solid rgba(72, 222, 170, 1);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s ease;
}

.work-area-prompt-box__voice::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(72, 222, 170, 0.2);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.work-area-prompt-box__voice::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(72, 222, 170, 0.28);
  border-top-color: rgba(72, 222, 170, 1);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.work-area-prompt-box__voice:hover::before,
.work-area-prompt-box__voice:focus-visible::before {
  transform: scaleX(1);
}

.work-area-prompt-box__voice.is-listening {
  background: rgba(72, 222, 170, 0.2);
  border-color: rgba(72, 222, 170, 1);
}

.work-area-prompt-box__voice.is-listening::before {
  transform: scaleX(1);
}

.work-area-prompt-box__voice.is-processing {
  background: rgba(42, 64, 87, 1);
  border-color: rgba(72, 222, 170, 1);
  cursor: wait;
}

.work-area-prompt-box__voice.is-processing::before {
  transform: scaleX(1);
}

.work-area-prompt-box__voice.is-processing::after {
  opacity: 1;
  transform: scale(1);
  animation: work-area-voice-spinner 0.8s linear infinite;
}

.work-area-prompt-box__voice-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.work-area-prompt-box__voice.is-processing .work-area-prompt-box__voice-icon {
  opacity: 0;
}

.work-area-prompt-box__voice:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.work-area-prompt-box__voice:disabled::before {
  transform: scaleX(0);
}

.work-area-prompt-box__generate {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-left: 16px;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 188, 138, 1);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s ease;
}

.work-area-prompt-box__generate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 17, 38, 0.2);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.work-area-prompt-box__generate:hover::before,
.work-area-prompt-box__generate:focus-visible::before {
  transform: scaleX(1);
}

.work-area-prompt-box__generate:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.work-area-prompt-box__generate:disabled::before {
  transform: scaleX(0);
}

.work-area-prompt-box__generate-label {
  color: rgba(0, 17, 38, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.1px;
}

.work-area-prompt-box__generate-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

@keyframes work-area-voice-spinner {
  from {
    transform: scale(1) rotate(0deg);
  }
  to {
    transform: scale(1) rotate(360deg);
  }
}

.work-area-mode-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
}

.work-area-twinmotion-entry {
  display: flex;
  width: fit-content;
  max-width: 100%;
  flex-direction: column;
  gap: 2px;
  margin: 25px auto 0;
  padding: 12px 18px;
  border: 1px solid rgba(72, 222, 170, 0.7);
  border-radius: 10px;
  background: rgba(12, 91, 82, 0.7);
  color: #fff;
  text-align: center;
  text-decoration: none;
}

.work-area-twinmotion-entry:hover,
.work-area-twinmotion-entry:focus-visible {
  background: rgba(12, 125, 108, 0.9);
  outline: 2px solid #48deaa;
  outline-offset: 2px;
}

.work-area-twinmotion-entry__title { font-weight: 700; }
.work-area-twinmotion-entry__description { font-size: 12px; color: rgba(168, 179, 194, 1); }

.work-area-mode-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.work-area-mode-button__icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  border: 1px solid rgba(52, 152, 219, 1);
  border-radius: 8px;
  background: rgba(52, 152, 219, 0.3);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.work-area-mode-button--image .work-area-mode-button__icon-wrap {
  border-color: rgba(155, 89, 182, 1);
  background: rgba(155, 89, 182, 0.3);
}

.work-area-mode-button--text .work-area-mode-button__icon-wrap {
  border-color: rgba(243, 156, 18, 1);
  background: rgba(243, 156, 18, 0.3);
}

.work-area-mode-button--audio .work-area-mode-button__icon-wrap {
  border-color: rgba(46, 204, 113, 1);
  background: rgba(46, 204, 113, 0.3);
}

.work-area-mode-button__icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.work-area-mode-button__label {
  margin-top: 8px;
  color: rgba(168, 179, 194, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.5px;
  text-align: center;
}

.work-area-mode-button:hover .work-area-mode-button__icon-wrap,
.work-area-mode-button:focus-visible .work-area-mode-button__icon-wrap {
  background: rgba(52, 152, 219, 0.7);
}

.work-area-mode-button--image:hover .work-area-mode-button__icon-wrap,
.work-area-mode-button--image:focus-visible .work-area-mode-button__icon-wrap {
  background: rgba(155, 89, 182, 0.7);
}

.work-area-mode-button--text:hover .work-area-mode-button__icon-wrap,
.work-area-mode-button--text:focus-visible .work-area-mode-button__icon-wrap {
  background: rgba(243, 156, 18, 0.7);
}

.work-area-mode-button--audio:hover .work-area-mode-button__icon-wrap,
.work-area-mode-button--audio:focus-visible .work-area-mode-button__icon-wrap {
  background: rgba(46, 204, 113, 0.7);
}

.work-area-right-panel__mode-slider {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0 0 24px;
  padding: 0 0 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  cursor: grab;
  user-select: none;
}

.work-area-right-panel__mode-slider::-webkit-scrollbar {
  display: none;
}

.work-area-right-panel__mode-slider.is-dragging {
  cursor: grabbing;
}

.work-area-right-panel__mode-slider .work-area-mode-button {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: 8px 16px;
  border: 1px solid rgba(72, 222, 170, 1);
  border-radius: 8px;
  background: rgba(72, 222, 170, 0.05);
  transition: background-color 0.25s ease;
}

.work-area-right-panel__mode-slider .work-area-mode-button__icon-wrap {
  display: none;
}

.work-area-right-panel__mode-slider .work-area-mode-button__label {
  margin: 0;
  color: rgba(72, 222, 170, 1);
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.1px;
  text-align: center;
  white-space: nowrap;
}

.work-area-right-panel__mode-slider .work-area-mode-button:hover,
.work-area-right-panel__mode-slider .work-area-mode-button:focus-visible,
.work-area-right-panel__mode-slider .work-area-mode-button.is-active {
  background: #48DEAA33;
}

.work-area-right-panel__mode-slider .work-area-mode-button:focus-visible {
  outline: 2px solid rgba(72, 222, 170, 0.7);
  outline-offset: 2px;
}

.work-area-glow {
  position: fixed;
  inset: 50% auto auto 50%;
  width: 388px;
  height: 388px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 50, 102, 1);
  filter: blur(150px);
  opacity: 0.95;
  pointer-events: none;
}

.work-area-glow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 388px;
  height: 388px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 120, 154, 1);
  filter: blur(150px);
  opacity: 0.62;
}

.work-area-glow::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 120, 154, 0.18) 0, rgba(0, 120, 154, 0.08) 35%, rgba(0, 17, 38, 0) 72%);
  filter: blur(40px);
  opacity: 0.9;
}

.work-area-templates-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

.work-area-templates-screen[hidden],
.work-area-templates-chooser[hidden] {
  display: none !important;
}

.work-area-right-panel__mode-slider[hidden],
.work-area-layout[data-work-area-view="projects"] .work-area-right-panel__mode-slider,
.work-area-layout[data-work-area-view="templates"] .work-area-right-panel__mode-slider {
  display: none !important;
}

.work-area-layout[data-work-area-view="projects"] .work-area-right-panel__concurrency,
.work-area-layout[data-work-area-view="templates"] .work-area-right-panel__settings,
.work-area-layout[data-work-area-view="templates"] .work-area-right-panel__frames,
.work-area-layout[data-work-area-view="templates"] .work-area-right-panel__concurrency,
.work-area-layout[data-work-area-view="templates"] .work-area-right-panel__prompt-enhancer {
  display: none !important;
}

.work-area-templates-screen__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.work-area-templates-screen__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid rgba(38, 213, 177, .72);
  border-radius: 999px;
  color: #5ee7c5;
  text-decoration: none;
  white-space: nowrap;
}

.work-area-templates-screen__action:hover,
.work-area-templates-screen__action:focus-visible {
  background: rgba(38, 213, 177, .12);
  outline: none;
}

.work-area-templates-screen__empty,
.work-area-templates-chooser__title,
.work-area-templates-chooser__selected-title,
.work-area-templates-chooser__hint,
.work-area-templates-chooser__model-group-title,
.work-area-templates-chooser__empty {
  margin: 0;
}

.work-area-templates-screen__title {
  margin: 4px 0 0;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, sans-serif;
  font-size: 28px;
  font-style: normal;
  font-weight: 400;
  line-height: 36px;
  letter-spacing: 0;
}

.work-area-templates-screen__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 16px;
  align-content: start;
}

.work-area-templates-card {
  display: block;
  min-width: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: rgba(168, 179, 194, 1);
  background: transparent;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.work-area-templates-card:hover,
.work-area-templates-card:focus-visible,
.work-area-templates-card.is-selected {
  border-color: rgba(72, 222, 170, 1);
  outline: none;
}

.work-area-templates-card__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(26, 42, 59, 1);
}

.work-area-templates-card__preview.is-placeholder {
  color: rgba(168, 179, 194, 0.82);
  font-size: 26px;
}

.work-area-templates-card__image {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}

.work-area-templates-card__title {
  display: block;
  min-height: 20px;
  margin-top: 8px;
  overflow: hidden;
  color: rgba(168, 179, 194, 1);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-area-templates-card__subtitle {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: rgba(168, 179, 194, 0.78);
  font-size: 11px;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-area-templates-screen__empty {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed rgba(108, 127, 151, 0.8);
  border-radius: 6px;
  color: rgba(168, 179, 194, 1);
  text-align: center;
}

.work-area-templates-chooser {
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
  padding: 20px 16px 24px;
  border-bottom: 1px solid rgba(60, 74, 94, 0.72);
  background: rgba(15, 36, 58, 0.52);
}

.work-area-templates-chooser__title {
  color: rgba(72, 222, 170, 1);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}

.work-area-templates-chooser__selected-title {
  margin-top: 8px;
  color: rgba(230, 233, 237, 1);
  font-size: 15px;
  font-weight: 600;
  line-height: 21px;
}

.work-area-templates-chooser__hint {
  margin-top: 8px;
  margin-bottom: 18px;
  color: rgba(168, 179, 194, 1);
  font-size: 13px;
  line-height: 18px;
}

.work-area-templates-chooser__model-group + .work-area-templates-chooser__model-group {
  margin-top: 18px;
}

.work-area-templates-chooser__model-group-title {
  margin-bottom: 8px;
  color: rgba(72, 222, 170, 1);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.work-area-templates-model {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 3px;
  margin-top: 7px;
  padding: 10px 11px;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 5px;
  color: rgba(230, 233, 237, 1);
  background: rgba(26, 42, 59, 1);
  text-align: left;
  cursor: pointer;
}

.work-area-templates-model:hover,
.work-area-templates-model:focus-visible {
  border-color: rgba(72, 222, 170, 1);
  background: rgba(42, 64, 87, 1);
  outline: none;
}

.work-area-templates-model strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.work-area-templates-model span {
  color: rgba(168, 179, 194, 1);
  font-size: 11px;
  line-height: 15px;
}

.work-area-templates-chooser__empty {
  padding: 24px;
  border: 1px dashed rgba(108, 127, 151, 0.8);
  border-radius: 6px;
  color: rgba(168, 179, 194, 1);
  text-align: center;
}

/* Long work titles stay compact; the complete prompt is available below. */
.work-area-lightbox__info-title {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

@media (max-width: 920px) {
  .work-area-lightbox__close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 3;
  }
}

/* Desktop viewer: close in the info panel's top-right corner. */
@media (min-width: 921px) {
  .work-area-lightbox__info {
    position: relative;
  }

  .work-area-lightbox__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
  }

  .work-area-lightbox__info-header {
    align-items: flex-start;
    padding-right: 40px;
  }
}

/* Viewer metadata shares the close row; the full prompt appears only once. */
.work-area-lightbox:not(.work-area-lightbox--editing) .work-area-lightbox__info-title {
  display: none;
}

.work-area-lightbox:not(.work-area-lightbox--editing) .work-area-lightbox__info-header {
  align-items: center;
  gap: 12px;
  padding: 0 0 12px;
  margin: 0;
}

.work-area-lightbox:not(.work-area-lightbox--editing) .work-area-lightbox__meta {
  flex: 1 1 auto;
  margin: 0;
}

.work-area-lightbox:not(.work-area-lightbox--editing) .work-area-lightbox__close {
  position: static;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

.work-area-lightbox--prompt-preview .work-area-lightbox__layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.work-area-lightbox--prompt-preview .work-area-lightbox__stage {
  grid-column: 1;
  grid-row: 1;
}

.work-area-lightbox--prompt-preview .work-area-lightbox__info:not(.work-area-lightbox__related) {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.work-area-lightbox--prompt-preview .work-area-lightbox__meta,
.work-area-lightbox--prompt-preview .work-area-lightbox__footer {
  display: none;
}

.work-area-lightbox--prompt-preview:not(.work-area-lightbox--editing) .work-area-lightbox__close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 3;
  pointer-events: auto;
}

.work-area-lightbox__info-body {
  grid-template-rows: minmax(72px, 1fr) auto;
}

@media (min-width: 641px) and (max-width: 920px) {
  .work-area-lightbox__prompt {
    grid-row: 1 / span 2;
  }
}

/* Viewer: ‹ › between the works of the same chat or Projects list. */
.work-area-lightbox__details-toggle {
  display: none;
}

/* Projects on phones: a content-sized filmstrip, a contained work, then details. */
@media (max-width: 920px) {
  .work-area-lightbox--projects:not(.work-area-lightbox--editing) {
    --project-viewer-edge: 10px;
    padding: max(var(--project-viewer-edge), env(safe-area-inset-top)) max(var(--project-viewer-edge), env(safe-area-inset-right)) max(var(--project-viewer-edge), env(safe-area-inset-bottom)) max(var(--project-viewer-edge), env(safe-area-inset-left));
  }

  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__layout {
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(96px, 1fr) auto;
    gap: 10px;
  }

  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .home-image-lightbox__layout--with-related {
    grid-template-rows: auto minmax(96px, 1fr) auto;
  }

  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__related {
    height: 86px;
    min-height: 0;
    max-height: 86px;
    padding: 8px 44px 8px 8px;
    border-color: #294258;
    border-radius: 12px;
  }

  .work-area-lightbox--projects .work-area-lightbox__related-list {
    flex-direction: row;
    gap: 8px;
    padding: 0 0 3px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scroll-padding-inline: 2px;
    overscroll-behavior-x: contain;
  }

  .work-area-lightbox--projects .work-area-lightbox__related-item {
    width: 64px;
    height: 64px;
  }

  .work-area-lightbox--projects .work-area-lightbox__related-status {
    flex: 0 0 auto;
    align-self: center;
    max-width: 160px;
    margin: 0;
    font-size: 12px;
    line-height: 18px;
  }

  .work-area-lightbox--projects .work-area-lightbox__related-status:is([data-state="complete"], [data-state="hint"]) {
    display: none;
  }

  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__stage {
    height: 100%;
    min-height: 0;
  }

  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__image,
  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__video {
    width: auto;
    height: auto;
    max-height: 100%;
    max-width: 100%;
    box-shadow: none;
  }

  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__info:not(.work-area-lightbox__related) {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 48dvh;
    padding: 12px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    border-color: #294258;
    border-radius: 12px;
  }

  .work-area-lightbox--projects .work-area-lightbox__info-header {
    flex: 0 0 auto;
    padding: 0;
    margin-bottom: 6px;
  }

  .work-area-lightbox--projects .work-area-lightbox__info-title {
    font-size: 15px;
    line-height: 20px;
    -webkit-line-clamp: 2;
  }

  .work-area-lightbox--projects .work-area-lightbox__meta {
    flex: 0 0 auto;
    gap: 8px;
    margin-bottom: 8px;
  }

  .work-area-lightbox--projects .work-area-lightbox__author,
  .work-area-lightbox--projects .work-area-lightbox__author-login,
  .work-area-lightbox--projects .work-area-lightbox__rating {
    font-size: 12px;
    line-height: 18px;
  }

  .work-area-lightbox--projects .work-area-lightbox__author-avatar { width: 20px; height: 20px; flex-basis: 20px; }
  .work-area-lightbox--projects .work-area-lightbox__rating-icon { width: 16px; height: 16px; }

  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__info-body {
    display: block;
    flex: 0 0 auto;
    overflow: visible;
    padding: 0;
  }

  .work-area-lightbox--projects .work-area-lightbox__label { font-size: 12px; line-height: 18px; }
  .work-area-lightbox--projects .work-area-lightbox__prompt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: none;
    margin: 4px 0 0;
    padding: 0;
    background: transparent;
    overflow: hidden;
    font-size: 13px;
    line-height: 19px;
  }

  .work-area-lightbox--projects .work-area-lightbox__details-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 36px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: #48deaa;
    font: 500 12px/18px Mulish, sans-serif;
    text-align: left;
    cursor: pointer;
  }
  .work-area-lightbox__details-toggle::after { content: '+'; font-size: 20px; }
  .work-area-lightbox__details-toggle[aria-expanded="true"]::after { content: '−'; }
  .work-area-lightbox__details-toggle:focus-visible { outline: 2px solid #48deaa; outline-offset: 2px; }
  .work-area-lightbox--projects:not(.is-details-open) .work-area-lightbox__parameters { display: none; }
  .work-area-lightbox--projects.is-details-open .work-area-lightbox__prompt { display: block; overflow: visible; }
  .work-area-lightbox--projects .work-area-lightbox__parameter { flex-direction: row; gap: 8px; padding: 8px; font-size: 12px; line-height: 18px; }
  .work-area-lightbox--projects .work-area-lightbox__parameter-value { text-align: right; }
  .work-area-lightbox--projects .work-area-lightbox__parameters { margin-bottom: 10px; }

  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__footer {
    position: static;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    gap: 6px;
    background: transparent;
  }
  .work-area-lightbox--projects .work-area-lightbox__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .work-area-lightbox--projects .work-area-lightbox__action {
    min-height: 44px;
    padding: 8px;
    font-size: 12px;
    line-height: 17px;
    gap: 6px;
  }
  .work-area-lightbox--projects .work-area-lightbox__action img { width: 16px; height: 16px; }
  .work-area-lightbox--projects .work-area-lightbox__actions .work-area-lightbox__rename { grid-column: auto; width: auto; order: 3; }
  .work-area-lightbox--projects .work-area-lightbox__open-chat { order: 0; }
  .work-area-lightbox--projects .work-area-lightbox__actions > a { order: 1; }
  .work-area-lightbox--projects .work-area-lightbox__actions > button:not(.work-area-lightbox__project-action):not(.work-area-lightbox__rename) { order: 2; }
  .work-area-lightbox--projects .work-area-lightbox__delete { order: 4; grid-column: 1 / -1; border-color: #573b4b; color: #e9a9b0; }
  .work-area-lightbox--projects .work-area-lightbox__close { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 40px; height: 40px; }
}

/* Chat / gallery viewer on phones: the work shrinks (down to 28% of the screen) so the details panel
   gets its content height; share + download share a row. */
@media (max-width: 640px) {
  .work-area-lightbox:not(.work-area-lightbox--projects):not(.work-area-lightbox--editing):not(.work-area-lightbox--prompt-preview) .work-area-lightbox__layout:not(.home-image-lightbox__layout--with-related) {
    grid-template-rows: minmax(28dvh, 1fr) minmax(0, max-content);
  }

  .work-area-lightbox:not(.work-area-lightbox--projects):not(.work-area-lightbox--editing) .work-area-lightbox__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-area-lightbox:not(.work-area-lightbox--projects):not(.work-area-lightbox--editing) .work-area-lightbox__footer :is(.work-area-lightbox__action, .work-area-lightbox__edit) {
    min-height: 44px;
    padding-block: 8px;
  }
}

@media (min-width: 600px) and (max-width: 920px) and (max-height: 500px) {
  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, .9fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__related { grid-column: 1 / -1; height: 70px; max-height: 70px; }
  .work-area-lightbox--projects .work-area-lightbox__related-item { width: 48px; height: 48px; }
  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__stage { grid-column: 1; grid-row: 2; }
  .work-area-lightbox--projects:not(.work-area-lightbox--editing) .work-area-lightbox__info:not(.work-area-lightbox__related) { grid-column: 2; grid-row: 2; max-height: 100%; }
}

.work-area-lightbox__figure {
  position: relative;
}

.work-area-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 50%;
  background: rgba(7, 27, 46, 0.8);
  color: rgba(72, 222, 170, 1);
  cursor: pointer;
}

.work-area-lightbox__nav:hover,
.work-area-lightbox__nav:focus-visible {
  background: rgba(26, 42, 59, 0.95);
}

.work-area-lightbox__nav[hidden] {
  display: none;
}

.work-area-lightbox__nav--prev {
  left: 12px;
}

.work-area-lightbox__nav--next {
  right: 12px;
}

.work-area-lightbox__nav svg {
  width: 28px;
  height: 28px;
}

/* «Поделиться» menu (work_area_lightbox.js, openShareMenu). */
.work-area-share-menu {
  position: fixed;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 6px;
  border: 1px solid rgba(60, 74, 94, 1);
  border-radius: 8px;
  background: rgba(7, 27, 46, 1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.work-area-share-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(230, 233, 237, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
}

.work-area-share-menu__item:hover,
.work-area-share-menu__item:focus-visible {
  background: rgba(26, 42, 59, 1);
  outline: none;
}

.work-area-share-menu__item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.work-area-share-menu__item span:only-child {
  margin-left: 34px;
}

.work-area-project-card__action svg {
  display: block;
  width: 18px;
  height: 18px;
  color: rgba(72, 222, 170, 1);
  pointer-events: none;
}

/* Image editor: «← Назад» next to «Редактирование». */
.work-area-lightbox__editor-back {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  height: 28px;
  margin: 0 12px 0 auto;
  padding: 0 12px 0 8px;
  border: 0;
  border-radius: 14px;
  background: #132A3F;
  color: rgba(72, 222, 170, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}

.work-area-lightbox__editor-back[hidden] {
  display: none;
}

/* «Сохранить в чат» waits for a slider to move: show it as off. The shared style only dimmed it to 0.6
   with a «wait» cursor, so it looked like it was still loading rather than unavailable. */
.work-area-lightbox__editor-actions > button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.work-area-lightbox__editor-back svg {
  width: 18px;
  height: 18px;
}

.work-area-shell--glow-hidden .work-area-glow {
  display: none;
}

@media (max-width: 1024px) {
  .work-area-prompt-box__bottom {
    --work-area-compact-submit-size: 48px;
  }

  .work-area-prompt-box__bottom > .work-area-prompt-box__voice {
    display: none;
  }

  .work-area-prompt-box__bottom > .work-area-prompt-box__generate {
    flex: 0 0 var(--work-area-compact-submit-size);
    width: var(--work-area-compact-submit-size);
    height: var(--work-area-compact-submit-size);
    min-height: 0;
    max-width: none;
    gap: 0;
  }

  /* Keep the icon-only button's name available to screen readers. */
  .work-area-prompt-box__bottom > .work-area-prompt-box__generate .work-area-prompt-box__generate-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .work-area-prompt-box__bottom > .work-area-prompt-box__files:not([hidden]) {
    flex: 1 1 0;
    max-width: none;
    margin-right: 12px;
  }

  .work-area-right-panel__setting-input:not([type="checkbox"]):not([type="range"]) {
    font-size: 16px;
  }

  body {
    overflow: hidden;
  }

  .work-area-shell {
    height: 100vh;
    height: var(--work-area-viewport-height, 100dvh);
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .work-area-layout {
    position: relative;
    grid-template-columns: 1fr;
    gap: 0;
    width: auto;
    height: calc(var(--work-area-viewport-height, 100dvh) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 0;
    margin: calc(8px + env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    padding-top: 72px;
  }

  .work-area-tablet-topbar {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 6;
    width: 100%;
    padding: 7px;
    border: 1px solid rgba(60, 74, 94, 1);
    border-radius: 8px;
    background: rgba(7, 27, 46, 1);
  }

  .work-area-drawer-backdrop:not([hidden]) {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(0, 8, 20, 0.72);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .work-area-panel--left,
  .work-area-panel--center,
  .work-area-panel--right {
    width: 100%;
  }

  .work-area-panel--left,
  .work-area-panel--right {
    display: none;
  }

  .work-area-layout.work-area-layout--menu-open .work-area-panel--left {
    position: absolute;
    top: 72px;
    left: 0;
    z-index: 4;
    display: block;
    width: 100%;
    height: calc(100% - 72px);
    min-height: 0;
  }

  .work-area-layout.work-area-layout--filters-open .work-area-panel--right {
    position: absolute;
    top: 72px;
    right: 0;
    z-index: 4;
    display: block;
    width: 100%;
    height: calc(100% - 72px);
    min-height: 0;
  }

  .work-area-layout.work-area-layout--menu-open .work-area-sidebar {
    width: 100%;
    max-width: 100%;
    height: 100%;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    cursor: default;
  }

  .work-area-responsive-panel-heading {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 0 4px 8px;
    color: rgba(230, 233, 237, 1);
    font-family: Mulish, system-ui, sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
  }

  .work-area-responsive-panel-heading--settings {
    margin-bottom: 12px;
  }

  .work-area-responsive-panel-heading .work-area-right-panel__title {
    margin: 0;
  }

  /* The layout margin already keeps the drawer above the safe area; this keeps the last
     setting off the drawer's bottom edge once scrolled to the end. */
  .work-area-layout.work-area-layout--filters-open .work-area-right-panel {
    width: 100%;
    height: 100%;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-bottom: 20px;
  }

  /* The layout margin is 8px (tablet) or only the safe area (phone); the prompt box needs a visible gap. */
  .work-area-create-screen {
    padding-bottom: 16px;
  }

  .work-area-layout.work-area-layout--menu-open .work-area-sidebar .work-area-sidebar__button-label {
    max-width: 160px;
    margin-left: 12px;
    opacity: 1;
    transform: translateX(0);
  }

  .work-area-sidebar .work-area-sidebar__button-action {
    display: none;
  }

  .work-area-layout.work-area-layout--menu-open .work-area-sidebar .work-area-sidebar__history {
    opacity: 1;
    pointer-events: auto;
  }

  .work-area-layout.work-area-layout--menu-open .work-area-sidebar .work-area-sidebar__footer {
    padding: 9px;
    justify-content: flex-start;
  }

  .work-area-layout.work-area-layout--menu-open .work-area-sidebar .work-area-sidebar__footer-meta {
    max-width: 220px;
    margin-left: 10px;
    opacity: 1;
    transform: translateX(0);
  }

  .work-area-layout.work-area-layout--menu-open .work-area-sidebar .work-area-sidebar__footer-balance {
    max-width: 180px;
    opacity: 1;
    transform: translateX(0);
  }

  .work-area-panel--center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
  }

  .work-area-center-intro {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .work-area-layout {
    grid-template-columns: 1fr;
    gap: 0;
    width: auto;
    height: calc(var(--work-area-viewport-height, 100dvh) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 0;
    margin-right: max(8px, env(safe-area-inset-right));
    margin-left: max(8px, env(safe-area-inset-left));
  }

  .work-area-projects {
    padding-right: 0;
  }

  .work-area-projects__grid {
    gap: 12px;
  }

  .work-area-panel--left,
  .work-area-panel--right {
    display: none;
  }

  .work-area-layout.work-area-layout--filters-open .work-area-panel--right {
    position: absolute;
    top: 72px;
    right: 0;
    z-index: 4;
    display: block;
    width: 100%;
    height: calc(100% - 72px);
    min-height: 0;
  }

  .work-area-layout.work-area-layout--filters-open .work-area-right-panel {
    width: 100%;
    height: 100%;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-bottom: 20px;
  }

  .work-area-center-title {
    margin-bottom: 32px;
  }

  .work-area-mode-grid {
    gap: 12px;
  }

  .work-area-right-panel__mode-slider {
    gap: 8px;
  }

  .work-area-glow {
    width: 280px;
    height: 280px;
  }

  .work-area-glow::before {
    width: 280px;
    height: 280px;
  }

  .work-area-glow::after {
    width: 420px;
    height: 420px;
  }

  .work-area-templates-screen {
    padding: 28px 24px 24px;
  }

  .work-area-templates-screen__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .work-area-projects {
    padding-inline: 8px;
  }

  .work-area-layout {
    width: auto;
    height: calc(var(--work-area-viewport-height, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: env(safe-area-inset-top) max(0px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(0px, env(safe-area-inset-left));
    padding: 80px 0 0;
  }

  .work-area-tablet-topbar {
    top: 8px;
    left: 16px;
    right: 16px;
    width: auto;
  }

  .work-area-layout.work-area-layout--menu-open .work-area-panel--left,
  .work-area-layout.work-area-layout--filters-open .work-area-panel--right {
    top: 80px;
    left: 16px;
    right: 16px;
    width: auto;
    height: calc(100% - 80px);
  }

  .work-area-projects__grid {
    gap: 8px;
  }

  .work-area-create-screen {
    padding-inline: 16px;
  }

  .work-area-project-card {
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .work-area-project-card--audio {
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .work-area-prompt-box__top {
    height: clamp(96px, 16dvh, 112px);
  }

  .work-area-prompt-box__input {
    font-size: 16px;
  }

  .work-area-prompt-box__bottom {
    --work-area-compact-submit-size: 44px;
    flex-wrap: nowrap;
    gap: 6px;
    min-height: 0;
    padding: 6px;
  }

  .work-area-prompt-box__bottom > .work-area-prompt-box__files:not([hidden]) {
    margin-inline: 0;
  }

  .work-area-prompt-box__attach,
  .work-area-prompt-box__voice {
    width: 44px;
    height: 44px;
    min-width: 44px;
    margin-left: 0;
    padding: 8px;
  }

  .work-area-prompt-box__voice {
    margin-left: 0;
  }

  .work-area-prompt-box__estimate {
    flex: 0 0 auto;
    gap: 3px;
    margin-left: auto;
  }

  .work-area-prompt-box__estimate-icon {
    width: 16px;
    height: 16px;
  }

  .work-area-prompt-box__estimate-value {
    font-size: 12px;
    line-height: 16px;
  }

  .work-area-prompt-box__generate {
    flex: 0 0 auto;
    width: auto;
    max-width: 48%;
    min-height: 44px;
    margin-left: 0;
    gap: 4px;
    padding: 8px 10px;
  }

  .work-area-prompt-box__generate-label {
    overflow: hidden;
    font-size: 12px;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .work-area-prompt-box__generate-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
  }

  .work-area-create-screen__heading {
    margin-bottom: 14px;
    font-size: 20px;
    line-height: 26px;
  }

  .work-area-right-panel__setting-chip,
  .work-area-right-panel__text-type-chip,
  .work-area-right-panel__setting-toggle,
  .work-area-right-panel__select-option {
    min-height: 44px;
  }

  .work-area-templates-screen {
    padding: 22px 16px 20px;
  }

  .work-area-templates-screen__header {
    align-items: flex-start;
    margin-bottom: 22px;
  }

  .work-area-templates-screen__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 10px;
  }

  .work-area-templates-chooser {
    padding: 16px 14px 20px;
  }
}

@media (max-width: 359px) {
  .work-area-prompt-box__bottom {
    flex-wrap: wrap;
  }

  .work-area-prompt-box__generate {
    flex: 1 0 100%;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 1024px) and (max-height: 520px) {
  .work-area-panel--center {
    align-items: stretch;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .work-area-create-screen {
    flex: 0 0 auto;
    height: auto;
    min-height: 100%;
    justify-content: flex-start;
    overflow: visible;
    padding: 16px;
  }

  .work-area-create-screen__inner {
    flex: 0 0 auto;
  }

  .work-area-prompt-box {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: rgba(0, 17, 38, 1);
  }
}

.work-area-lightbox__debug {
  max-height: 220px;
  margin: 12px 0 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid rgba(120, 164, 198, 0.35);
  border-radius: 8px;
  background: rgba(0, 13, 29, 0.92);
  color: #b9cde0;
  font: 11px/1.45 Consolas, "Cascadia Code", monospace;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Safari repaints large blurred layers on every viewport resize (keyboard,
   browser chrome, and orientation changes). The shell keeps its radial glow. */
@supports (-webkit-backdrop-filter: blur(1px)) {
  .work-area-glow {
    display: none;
  }

  .work-area-history-confirm::backdrop,
  .work-area-projects .work-area-project-card__audio-controls {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Phones and tablets: the top bar already toggles both drawers, so the drawers' own
   title-and-close row only repeated it (team chat 07.10; the mockup has none). */
@media (max-width: 1024px) {
  .work-area-responsive-panel-heading { display: none; }
}

/* Pending video occupies the same grid cell as its future result. */
.work-area-create-screen__video-gallery-pending { min-height: 268px; }
/* Fixed actions popover never changes the card's or chat's dimensions. */
.work-area-video-operation--popover { width: min(440px, calc(100vw - 24px)); min-width: 0; max-height: min(70dvh, 560px); }
.work-area-video-operation__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.work-area-video-operation__header h3 { margin: 0; font-size: 16px; }
.work-area-video-operation__header button { flex: 0 0 36px; min-height: 36px; padding: 0; font-size: 24px; }
.work-area-video-operation--popover .work-area-video-operation__panel { margin-top: 0; }
.work-area-video-operation--popover .work-area-video-operation__panel label { align-items: stretch; }

/* Result images: the action buttons and the reference toggle sit over the picture on its right side,
   like in «Мои работы». Shown on hover and keyboard focus, always on touch screens; a checked reference does not change this. */
.work-area-create-screen__image-card {
  position: relative;
}

.work-area-create-screen__image-card .work-area-create-screen__message-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  width: auto;
  margin: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(4px);
  transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
}

.work-area-create-screen__image-card:hover .work-area-create-screen__message-actions,
.work-area-create-screen__image-card:has(:focus-visible) .work-area-create-screen__message-actions {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

@media (hover: none) {
  .work-area-create-screen__image-card .work-area-create-screen__message-actions {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

.work-area-create-screen__image-card .work-area-create-screen__message-download,
.work-area-create-screen__image-card .work-area-create-screen__image-source-toggle {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(119, 143, 169, 0.72);
  border-radius: 8px;
  color: rgba(230, 233, 237, 1);
  background: rgba(7, 27, 46, 0.88);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.work-area-create-screen__image-card .work-area-create-screen__message-download:hover,
.work-area-create-screen__image-card .work-area-create-screen__message-download:focus-visible,
.work-area-create-screen__image-card .work-area-create-screen__image-source-toggle:hover {
  border-color: rgba(72, 222, 170, 0.95);
  color: rgba(72, 222, 170, 1);
  background: rgba(22, 57, 76, 0.96);
  transform: translateY(-1px);
}

.work-area-create-screen__image-card .work-area-create-screen__message-download:focus-visible {
  outline: 2px solid rgba(72, 222, 170, 0.8);
  outline-offset: 2px;
}

.work-area-create-screen__image-card .work-area-create-screen__message-download-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  pointer-events: none;
}

.work-area-create-screen__image-card .work-area-create-screen__message-download svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

/* Reference: the checkbox uses the existing paperclip; its text stays for screen readers. */
.work-area-create-screen__image-card .work-area-create-screen__image-source-toggle {
  position: relative;
  font-size: 0;
  color: transparent;
}

.work-area-create-screen__image-card .work-area-create-screen__image-source-toggle span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.work-area-create-screen__image-card .work-area-create-screen__image-source-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.work-area-create-screen__image-card .work-area-create-screen__image-source-toggle::after {
  content: "";
  width: 17px;
  height: 17px;
  background: url("/static/front-home/assets/img/skrepkaFrame.webp") center / contain no-repeat;
  pointer-events: none;
}

.work-area-create-screen__image-card .work-area-create-screen__image-source-toggle:has(input:checked) {
  border-color: rgba(72, 222, 170, 0.92);
  background: rgba(23, 77, 75, 0.94);
}

.work-area-create-screen__image-card .work-area-create-screen__image-source-toggle:focus-within {
  outline: 2px solid rgba(72, 222, 170, 0.8);
  outline-offset: 2px;
}

.work-area-create-screen__image-actions-more {
  position: static;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  pointer-events: auto;
}

.work-area-create-screen__image-actions-more-toggle {
  box-sizing: border-box;
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(119, 143, 169, 0.72);
  border-radius: 8px;
  color: rgba(230, 233, 237, 1);
  background: rgba(7, 27, 46, 0.88);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  list-style: none;
}

.work-area-create-screen__image-actions-more-toggle::-webkit-details-marker { display: none; }
.work-area-create-screen__image-actions-more-toggle span { margin-top: -10px; font: 700 27px/24px system-ui, sans-serif; }
.work-area-create-screen__image-actions-more-toggle:hover,
.work-area-create-screen__image-actions-more-toggle:focus-visible,
.work-area-create-screen__image-actions-more[open] > .work-area-create-screen__image-actions-more-toggle,
.work-area-create-screen__video-actions-more[open] > .work-area-create-screen__image-actions-more-toggle {
  border-color: rgba(72, 222, 170, 0.95);
  color: rgba(72, 222, 170, 1);
  background: rgba(22, 57, 76, 0.96);
  outline: none;
}

.work-area-create-screen__image-actions-more-menu {
  position: absolute;
  top: 0;
  right: 42px;
  z-index: 5;
  display: grid;
  width: max-content;
  min-width: 210px;
  max-width: min(280px, calc(100vw - 32px));
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(119, 143, 169, 0.72);
  border-radius: 10px;
  background: rgba(7, 27, 46, 0.98);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

.work-area-create-screen__image-actions-more.is-opening-right .work-area-create-screen__image-actions-more-menu,
.work-area-create-screen__video-actions-more.is-opening-right .work-area-create-screen__image-actions-more-menu {
  right: auto;
  left: 42px;
  width: min(280px, var(--work-area-actions-right-space));
  min-width: 0;
}

.work-area-create-screen__image-actions-more.is-opening-right .work-area-actions-menu__item,
.work-area-create-screen__video-actions-more.is-opening-right .work-area-actions-menu__item {
  white-space: normal;
  overflow-wrap: anywhere;
}

.work-area-create-screen__image-actions-more-menu .work-area-actions-menu__item {
  min-height: 38px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.work-area-create-screen__image-actions-more-menu .work-area-actions-menu__item img,
.work-area-create-screen__image-actions-more-menu .work-area-actions-menu__item svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  object-fit: contain;
  color: rgba(72, 222, 170, 1);
}

.work-area-create-screen__image-actions-more-menu .work-area-create-screen__image-actions-delete {
  color: rgba(255, 148, 148, 1);
}

.work-area-create-screen__image-actions-more-menu .work-area-create-screen__image-actions-touch-item {
  display: none;
}

.work-area-create-screen__image-actions-touch-item input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0 2px 0 1px;
  accent-color: rgba(72, 222, 170, 1);
}

/* Keep the native reference checkbox, but show the same paperclip as on the tile. */
.work-area-create-screen__image-actions-more-menu input[data-work-area-use-image-checkbox] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 0;
  background: url("/static/front-home/assets/img/skrepkaFrame.webp") center / contain no-repeat;
  cursor: pointer;
}

.work-area-create-screen__image-actions-more-menu label:has(> [data-work-area-use-image-checkbox]:checked) {
  background-color: rgba(23, 77, 75, 0.94);
  box-shadow: inset 0 0 0 1px rgba(72, 222, 170, 0.92);
}

.work-area-create-screen__image-actions-more-menu [data-work-area-use-image-checkbox]:focus-visible {
  outline: 2px solid rgba(72, 222, 170, 0.8);
  outline-offset: 2px;
}

@media (hover: none) {
  .work-area-create-screen__image-card .work-area-create-screen__message-actions > .work-area-create-screen__message-download,
  .work-area-create-screen__image-card .work-area-create-screen__message-actions > .work-area-create-screen__image-source-toggle {
    display: none;
  }

  .work-area-create-screen__image-actions-more-menu .work-area-create-screen__image-actions-touch-item {
    display: flex;
  }
}

/* Video cards use the same hover toolbar and overflow menu as image cards. */
/* The menu's own z-index is bounded by its toolbar. Raise the open toolbar above
   later cards so their ellipsis buttons cannot paint or receive taps through it. */
.work-area-create-screen__image-card > .work-area-create-screen__message-actions:has(> details[open]),
.work-area-create-screen__video-card > .work-area-create-screen__message-actions:has(> details[open]) {
  z-index: 4;
}

.work-area-create-screen__video-card {
  position: relative;
}

.work-area-create-screen__video-card .work-area-create-screen__message-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  width: auto;
  margin: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(4px);
  transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
}

.work-area-create-screen__video-card:hover .work-area-create-screen__message-actions,
.work-area-create-screen__video-card:has(:focus-visible) .work-area-create-screen__message-actions {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

@media (hover: none) {
  .work-area-create-screen__video-card .work-area-create-screen__message-actions {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

.work-area-create-screen__video-card .work-area-create-screen__message-download,
.work-area-create-screen__video-card .work-area-create-screen__image-actions-more-toggle {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(119, 143, 169, 0.72);
  border-radius: 8px;
  color: rgba(230, 233, 237, 1);
  background: rgba(7, 27, 46, 0.88);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.work-area-create-screen__video-card .work-area-create-screen__message-download:hover,
.work-area-create-screen__video-card .work-area-create-screen__message-download:focus-visible,
.work-area-create-screen__video-card .work-area-create-screen__image-actions-more-toggle:hover,
.work-area-create-screen__video-card .work-area-create-screen__image-actions-more-toggle:focus-visible,
.work-area-create-screen__video-card .work-area-create-screen__video-actions-more[open] > .work-area-create-screen__image-actions-more-toggle {
  border-color: rgba(72, 222, 170, 0.95);
  color: rgba(72, 222, 170, 1);
  background: rgba(22, 57, 76, 0.96);
  outline: 2px solid rgba(72, 222, 170, 0.8);
  outline-offset: 2px;
}

.work-area-create-screen__video-card .work-area-create-screen__message-download-icon,
.work-area-create-screen__video-card .work-area-create-screen__message-download svg {
  width: 17px;
  height: 17px;
  object-fit: contain;
  pointer-events: none;
}

.work-area-create-screen__video-actions-more {
  position: static;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

.work-area-create-screen__video-actions-more .work-area-create-screen__image-actions-more-toggle {
  list-style: none;
}

.work-area-create-screen__video-actions-more .work-area-create-screen__image-actions-more-toggle::-webkit-details-marker {
  display: none;
}


/* Galleries (chat images and videos in gallery mode, «Мои работы»): justified rows. A row has one height, each work
   takes the width of its own proportions (--r = width / height), nothing is cropped. work_area_gallery_rows.js
   picks the row breaks and sets the widths; until it runs, flex growth proportional to --r gives the same
   kind of rows (::after keeps the last row at the target height, the 1.6 cap stops a sparse row blowing up).
   Audio is a square cover tile. */
.work-area-create-screen__messages--image-gallery,
.work-area-create-screen__messages--video-gallery,
.work-area-projects__grid {
  --work-area-row: 260px;
  --work-area-gallery-gap: 12px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: var(--work-area-gallery-gap);
}

.work-area-create-screen__messages--image-gallery::after,
.work-area-create-screen__messages--video-gallery::after,
.work-area-projects__grid::after {
  content: "";
  flex: 1000000 1 0px;
}

.work-area-create-screen__messages--image-gallery :is(.work-area-create-screen__image-card, .work-area-create-screen__image-gallery-pending),
.work-area-create-screen__messages--video-gallery :is(.work-area-create-screen__video-card, .work-area-create-screen__video-gallery-pending),
.work-area-projects__grid > .work-area-project-item {
  flex: calc(var(--r, 1) * 1000) 1 calc(var(--r, 1) * var(--work-area-row));
  width: auto;
  min-width: 0;
  max-width: min(100%, calc(var(--r, 1) * var(--work-area-row) * 1.6));
  min-height: 0;
}

.work-area-create-screen__messages--video-gallery .work-area-create-screen__video-card {
  --r: 1.7778;
}

.work-area-create-screen__messages--image-gallery .work-area-create-screen__image-preview,
.work-area-create-screen__messages--image-gallery .work-area-create-screen__image-gallery-pending,
.work-area-create-screen__messages--video-gallery .work-area-create-screen__video-player,
.work-area-create-screen__messages--video-gallery .work-area-create-screen__video-gallery-pending,
.work-area-projects__grid .work-area-project-card,
.work-area-projects__grid .work-area-project-card--audio {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: var(--r, 1);
}

.work-area-create-screen__messages--image-gallery .work-area-create-screen__image-preview img,
.work-area-projects__grid .work-area-project-card__media:not(.work-area-project-card__media--audio) {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.work-area-create-screen__messages--video-gallery .work-area-create-screen__message-actions {
  flex-wrap: wrap;
}

/* Non-work children (errors, notices) take a whole line; the paging sentinel takes no room. */
.work-area-create-screen__messages--image-gallery > :not(.work-area-create-screen__generation-entry):not(.work-area-create-screen__image-grid):not(.work-area-create-screen__image-gallery-pending),
.work-area-create-screen__messages--image-gallery .work-area-create-screen__message-error,
.work-area-create-screen__messages--video-gallery > :not(.work-area-create-screen__generation-entry):not(.work-area-create-screen__video-grid):not(.work-area-create-screen__video-gallery-pending),
.work-area-create-screen__messages--video-gallery > .work-area-create-screen__generation-entry > :not(.work-area-create-screen__video-grid):not(.work-area-create-screen__video-gallery-pending) {
  flex: 1 1 100%;
}

.work-area-projects__grid > .work-area-projects__load-more-sentinel {
  flex: 0 0 0px;
  width: 0;
  margin-inline-start: calc(-1 * var(--work-area-gallery-gap));
}

/* Image-chat fallback; the desktop gallery has its compact column below. */
.work-area-create-screen__messages--image-gallery .work-area-create-screen__image-card .work-area-create-screen__message-actions {
  bottom: 10px;
  flex-direction: column;
  flex-wrap: wrap-reverse;
  align-content: flex-start;
}

/* Project actions stay in one column, including «⋯», on short tiles as well. */
.work-area-projects__grid .work-area-project-card__actions {
  bottom: 10px;
  flex-wrap: nowrap;
  gap: var(--work-area-card-action-gap, 6px);
}

.work-area-projects__grid .work-area-project-card__actions > .work-area-project-card__action {
  flex-shrink: 1;
  min-height: 24px;
}

@media (min-width: 769px) {
  .work-area-create-screen__messages--image-gallery .work-area-create-screen__image-card .work-area-create-screen__message-actions { flex-wrap: nowrap; gap: 3px; }
  .work-area-create-screen__messages--image-gallery .work-area-create-screen__image-card .work-area-create-screen__message-actions > * { flex-shrink: 1; min-height: 24px; }
  .work-area-create-screen__messages--image-gallery .work-area-create-screen__image-actions-more-toggle { height: 100%; }
}

@media (max-width: 768px) {
  .work-area-create-screen__messages--image-gallery,
  .work-area-create-screen__messages--video-gallery,
  .work-area-projects__grid {
    --work-area-row: 220px;
    --work-area-gallery-gap: 10px;
  }
}

@media (max-width: 520px) {
  .work-area-create-screen__messages--image-gallery,
  .work-area-create-screen__messages--video-gallery,
  .work-area-projects__grid {
    --work-area-row: 190px;
    --work-area-gallery-gap: 8px;
  }
}

/* Touch screens: the tile shows only «⋯», every action is in its menu (Лёня 06.11; work_area_gallery_rows.js).
   Without this cap the tile keeps as many buttons as fit in one column and «⋯» holds the rest. */
.work-area-project-item > .work-area-project-card__actions {
  --work-area-actions-max: 0;
}

[data-work-area-action-hidden],
[data-work-area-actions-more][hidden] {
  display: none !important;
}

.work-area-actions-menu {
  width: auto;
  min-width: 220px;
  max-width: calc(100vw - 16px);
  gap: 2px;
  padding: 6px;
}

.work-area-actions-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(230, 233, 237, 1);
  font: 500 14px/20px Mulish, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}

.work-area-actions-menu__item:hover,
.work-area-actions-menu__item:focus-visible {
  background: rgba(26, 42, 59, 1);
  outline: none;
}

.work-area-actions-menu__item > :first-child {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: rgba(72, 222, 170, 1);
  text-align: center;
}

.work-area-actions-menu__item > .work-area-project-card__action-check {
  color: rgba(168, 179, 194, 0.86);
}

.work-area-actions-menu__item > .work-area-project-card__action-check[data-work-area-portfolio-checked="true"] {
  color: rgba(72, 222, 170, 1);
}

.work-title-dialog [data-submission-consent] label {
  display: block;
  margin-top: 12px;
}

/* Some touch browsers report hover capability. Keep the action layout in sync with JS detection. */
.work-area-touch-mode .work-area-project-card__actions,
.work-area-touch-mode .work-area-create-screen__image-card .work-area-create-screen__message-actions,
.work-area-touch-mode .work-area-create-screen__video-card .work-area-create-screen__message-actions {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.work-area-touch-mode .work-area-create-screen__image-card .work-area-create-screen__message-actions > .work-area-create-screen__message-download,
.work-area-touch-mode .work-area-create-screen__image-card .work-area-create-screen__message-actions > .work-area-create-screen__image-source-toggle,
.work-area-touch-mode .work-area-create-screen__video-card .work-area-create-screen__message-actions > .work-area-create-screen__message-download {
  display: none;
}

.work-area-touch-mode .work-area-create-screen__image-actions-more-menu .work-area-create-screen__image-actions-touch-item {
  display: flex;
}

/* Private attachment library, using the Work Area palette and font. */
.work-area-library { box-sizing:border-box; width:min(780px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:0; border:1px solid #3c4a5e; border-radius:16px; background:#0b2435; color:#e6e9ed; font:14px/1.5 Mulish,system-ui,sans-serif; box-shadow:0 24px 80px #0008; }
.work-area-library::backdrop { background:#00101fcc; }
.work-area-library header { position:relative; padding:24px 24px 12px; }
.work-area-library h2 { margin:0 40px 4px 0; font-size:24px; }
.work-area-library p { margin:0; color:#a8b3c2; }
.work-area-library button { font:inherit; cursor:pointer; color:inherit; }
.work-area-library button:focus-visible { outline:2px solid #48deaa; outline-offset:2px; }
.work-area-library button:disabled { opacity:.45; cursor:default; }
.work-area-library .work-area-library__close { position:absolute; top:20px; right:24px; display:flex; align-items:center; justify-content:center; width:36px; height:36px; padding:0; border:0; border-radius:8px; background:#1a3445; font-size:0; line-height:1; }
.work-area-library__close::before,.work-area-library__close::after { content:''; position:absolute; top:50%; left:50%; width:16px; height:2px; border-radius:1px; background:currentColor; transform:translate(-50%,-50%) rotate(45deg); pointer-events:none; }
.work-area-library__close::after { transform:translate(-50%,-50%) rotate(-45deg); }
.work-area-library__tabs { display:flex; flex-wrap:wrap; gap:8px; padding:14px 68px 14px 20px; border-bottom:1px solid #3c4a5e; }
.work-area-library--picker .work-area-library__close { top:16px; right:16px; }
.work-area-library__tabs button,.work-area-library__more { border:1px solid transparent; background:transparent; padding:10px 14px; border-radius:8px; }
.work-area-library__tabs button[aria-pressed=true] { color:#48deaa; border-color:#28716b; background:#073e42; }
.work-area-library__body { padding:20px 24px; overflow:auto; max-height:50dvh; }
.work-area-library__hint { margin-bottom:14px!important; }
.work-area-library__grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.work-area-library__tile { position:relative; min-width:0; transition:transform 160ms ease; }
.work-area-library__tile:has(.work-area-library__card[aria-pressed=true]) { transform:scale(.95); }
.work-area-library__card { position:relative; display:block; width:100%; height:160px; padding:0; overflow:hidden; text-align:left; border:1px solid #3c4a5e; border-radius:10px; background:#172e3e; }
.work-area-library__card { isolation:isolate; }
.work-area-library__card::before { content:''; position:absolute; inset:0; z-index:1; background:rgba(0,0,0,.18); opacity:0; transition:opacity 160ms ease; pointer-events:none; }
.work-area-library__card[aria-pressed=true]::before { opacity:1; }
.work-area-library__card::after { content:''; position:absolute; top:8px; right:8px; z-index:2; width:24px; height:24px; box-sizing:border-box; border:1px solid #a8b3c2; border-radius:50%; background:#071b2e; pointer-events:none; }
.work-area-library__card[aria-pressed=true]::after { content:'✓'; position:absolute; top:8px; right:8px; width:24px; height:24px; border-radius:50%; text-align:center; background:#00ba95; color:#001523; }
.work-area-library__card img,.work-area-library__preview { display:flex; align-items:center; justify-content:center; width:100%; height:100%; object-fit:cover; background:#071b2e; }
.work-area-library__tabs button { display:inline-flex; align-items:center; justify-content:center; gap:6px; }
.work-area-library__tab-icon,.work-area-library__tab-icon img,.work-area-library__tab-icon svg { display:block; flex:0 0 18px; width:18px; height:18px; }
.work-area-library__card.is-audio { background:radial-gradient(ellipse at center,rgba(72,222,170,.08),transparent 75%),#071b2e; }
.work-area-library__audio-wave { top:50%; height:48px; gap:4px; transform:translateY(-50%); color:#28716b; pointer-events:none; transition:color 180ms ease; }
.work-area-library__audio-wave i { width:4px; background:currentColor; transform:scaleY(1.4); }
.work-area-library__tile.is-audio-playing .work-area-library__audio-wave { color:#48deaa; }
.work-area-library__audio-player { position:absolute; inset:0; pointer-events:none; }
.work-area-library__audio-controls { position:absolute; bottom:8px; left:12px; right:12px; display:grid; align-items:center; gap:0; }
.work-area-library__audio-controls input { appearance:none; -webkit-appearance:none; width:100%; min-width:0; height:20px; margin:0; background:transparent; cursor:pointer; pointer-events:auto; }
.work-area-library__audio-controls input:disabled { opacity:.35; cursor:default; pointer-events:none; }
.work-area-library__audio-controls input::-webkit-slider-runnable-track { height:3px; border-radius:2px; background:linear-gradient(to right,#48deaa var(--audio-progress,0%),#3c4a5e var(--audio-progress,0%)); }
.work-area-library__audio-controls input::-moz-range-track { height:3px; border-radius:2px; background:linear-gradient(to right,#48deaa var(--audio-progress,0%),#3c4a5e var(--audio-progress,0%)); }
.work-area-library__audio-controls input::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:8px; height:8px; margin-top:-2.5px; border:0; border-radius:50%; background:#48deaa; }
.work-area-library__audio-controls input::-moz-range-thumb { width:8px; height:8px; border:0; border-radius:50%; background:#48deaa; }
.work-area-library__audio-time { text-align:right; font-size:10px; line-height:14px; color:#a8b3c2; }
.work-area-library__audio-player:has(audio:not([src])) .work-area-library__audio-time { visibility:hidden; }
.work-area-library__viewer { width:min(960px,calc(100vw - 32px)); }
.work-area-library__viewer video { display:block; width:100%; max-height:calc(100dvh - 150px); background:#001126; }
.work-area-library button.work-area-library__video-label,.work-area-library button.work-area-library__audio-label { position:absolute; top:8px; left:8px; padding:3px 7px; border:1px solid transparent; border-radius:6px; background:#071b2e; color:#e6e9ed; font-size:12px; pointer-events:auto; }
.work-area-library button.work-area-library__video-label:enabled:hover,.work-area-library button.work-area-library__audio-label:enabled:hover { border-color:#48deaa; color:#48deaa; }
.work-area-library .is-audio-playing button.work-area-library__audio-label { color:#48deaa; }
@media (prefers-reduced-motion:reduce) { .work-area-library__audio-wave,.work-area-library__tile,.work-area-library__card::before { transition:none; } }
.work-area-library footer { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 24px; border-top:1px solid #3c4a5e; }
.work-area-library--picker footer { display:grid; grid-template-columns:minmax(0,140px) minmax(0,1fr) auto; grid-template-rows:44px; gap:12px; }
.work-area-library--picker footer > span { overflow-wrap:anywhere; font-size:12px; line-height:16px; }
.work-area-library .work-area-library__warning { margin:0; padding:0 24px 12px; color:#a8b3c2; font-size:12px; line-height:18px; overflow-wrap:anywhere; }
.work-area-library__warning[hidden] { display:none; }
.work-area-library__add { padding:10px 24px; border:0; border-radius:8px; background:#00ba95; color:#001523!important; }
.work-area-library__selection { display:flex; flex-wrap:nowrap; align-items:center; gap:6px; min-width:0; height:44px; max-width:100%; padding:2px; overflow-x:auto; overflow-y:hidden; overscroll-behavior-inline:contain; scrollbar-width:thin; scrollbar-color:#28716b transparent; }
.work-area-library__selection:empty { visibility:hidden; }
.work-area-library__selected { position:relative; flex:0 0 36px; width:36px; height:36px; overflow:hidden; border:1px solid #28716b; border-radius:6px; padding:0; background:#073e42; }
.work-area-library__selected img { display:block; width:100%; height:100%; object-fit:cover; }
.work-area-library__selected-kind { display:flex; align-items:center; justify-content:center; width:100%; height:100%; font-size:12px; }
/* Keep the disc and cross in one image: Samsung forced dark mode recolours
   separate CSS backgrounds independently and can erase the light strokes. */
.work-area-library__selected-remove { position:absolute; top:1px; right:1px; width:14px; height:14px; border-radius:50%; background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Ccircle cx='7' cy='7' r='7' fill='%23071b2e'/%3E%3Cpath d='m4.2 4.2 5.6 5.6m0-5.6-5.6 5.6' fill='none' stroke='%23e6e9ed' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center/14px 14px no-repeat; pointer-events:none; }
.work-area-library__selected-remove::before,.work-area-library__selected-remove::after { content:none; }
.work-area-prompt-box__attachment-warning {
  position: relative;
  margin: 0;
  padding: 6px 10px 7px 30px;
  max-height: 64px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  border: 0;
  border-inline: 1px solid rgba(60, 74, 94, 1);
  background: rgba(0, 17, 38, 1);
  color: rgba(255, 180, 171, 1);
  font-family: Mulish, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
}
.work-area-prompt-box__attachment-warning::before {
  content: '!';
  position: absolute;
  top: 7px;
  left: 10px;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 50%;
  text-align: center;
  font-size: 10px;
  line-height: 12px;
}
@media(max-width:520px) { .work-area-library__grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .work-area-library header,.work-area-library__body,.work-area-library footer { padding:16px; } .work-area-library__tabs { padding:12px 60px 12px 16px; gap:0; } .work-area-library__tabs button { padding:8px; } .work-area-library--picker footer { grid-template-columns:minmax(0,76px) minmax(0,1fr) auto; gap:8px; } .work-area-library--picker .work-area-library__add { padding-inline:12px; } }
.work-area-layout[data-work-area-guest="1"] [data-work-area-estimate] {
  display: none;
}

/* The hidden guest price no longer supplies the row's automatic left margin. */
.work-area-layout[data-work-area-guest="1"] .work-area-prompt-box__voice {
  margin-left: auto;
}

@media (max-width: 1024px) {
  .work-area-layout[data-work-area-guest="1"] .work-area-prompt-box__generate {
    margin-left: auto;
  }
}
