:root {
  color-scheme: dark;
  /* Cinema-grade palette: warm paper-white text on near-black, one amber accent
     that reads as a projector glow, not a UI blue. */
  --bg: #0b0b0d;
  --panel: #131316;
  --raised: #1b1b20;
  --line: #26262c;
  --muted: #8f8f98;
  --text: #f2f0ea;
  --accent: #e8b04b;
  --accent-ink: #1a1408;
  --sidebar: 218px;
  /* Emil Kowalski easing: exponential ease-out, never ease-in. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast: 160ms;
  --dur-med: 220ms;
  --dur-slow: 320ms;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
  border: 0;
  cursor: pointer;
  background: none;
}
button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
a {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input,
textarea,
select {
  color: inherit;
}
input::placeholder,
textarea::placeholder {
  color: #838383;
}
button {
  transition:
    background var(--dur-fast) var(--ease-out),
    opacity var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
button:hover:not(:disabled) {
  filter: brightness(1.12);
}
/* Emil: pressable elements give instant tactile feedback — scale to 0.97 on
   :active, never an ambiguous brightness flash. */
button:active:not(:disabled) {
  transform: scale(0.97);
  transition-duration: 60ms;
}
.icon {
  height: 20px;
  width: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon-button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.icon-button:hover {
  background: #ffffff12;
}
.muted {
  color: var(--muted);
  line-height: 1.6;
}
.small {
  font-size: 12px;
}
.header-end {
  display: flex;
  gap: 9px;
  align-items: center;
}
.pool-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 12px;
  color: #d9d6cd;
}
.pool-pill:hover {
  border-color: #3a3a42;
}
.status-dot {
  height: 6px;
  width: 6px;
  background: #6a6a72;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px #7dd78a55;
}
.avatar {
  border: 1px solid #535353;
  width: 34px;
  height: 34px;
  background: #2c323d;
  border-radius: 50%;
  color: #dce9ff;
  font-size: 14px;
}
.home-header {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4.8vw;
  border-bottom: 1px solid var(--panel);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 22px;
  letter-spacing: -0.5px;
  font-weight: 650;
}
.brand .icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
}
.brand-light {
  font-weight: 300;
  color: var(--muted);
}
.home-main {
  max-width: 1312px;
  padding: 70px 40px 28px;
  margin: auto;
}
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #909090;
  display: block;
}
.home-title h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  letter-spacing: -2.5px;
  font-weight: 300;
  margin: 14px 0;
  line-height: 1.05;
  color: var(--text);
}
.home-title p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 46ch;
}
.create-project {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 22px;
  width: 100%;
  min-height: 122px;
  border: 1px solid #2b2b32;
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 0% 0%, #1d1c22 0%, #131316 60%),
    linear-gradient(115deg, #1a1a20, #101013);
  padding: 28px 34px;
  margin: 12px 0 56px;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out),
    transform var(--dur-med) var(--ease-out);
}
.create-project:hover {
  border-color: var(--accent);
  box-shadow:
    0 8px 32px #00000055,
    0 0 0 1px #e8b04b22 inset;
  transform: translateY(-1px);
}
.create-plus {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 16px;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.create-plus .icon {
  width: 26px;
  height: 26px;
}
.create-project strong {
  display: block;
  font-size: 20px;
  letter-spacing: -0.4px;
  font-weight: 550;
}
.create-project small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
.create-arrow {
  margin-left: auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #3a3a42;
  border-radius: 50%;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.create-project:hover .create-arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: translateX(4px);
}
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-bar h2 {
  font-size: 19px;
  font-weight: 550;
  margin: 0;
  letter-spacing: -0.3px;
}
.section-bar h2 span {
  margin-left: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}
.home-search {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8b8b8b;
}
.home-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 175px;
  font-size: 12px;
}
.home-search .icon {
  width: 16px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
}
.project-card {
  min-width: 0;
  position: relative;
}
.project-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid #ffffff38;
  border-radius: 10px;
  background: #171717ed;
  color: #f1f1f1;
  font-size: 12px;
}
.project-delete .icon {
  width: 16px;
  height: 16px;
}
.project-delete:hover {
  background: #472727;
  color: #ffc5c5;
}
.project-delete:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.project-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16/10;
  background: #191919;
  position: relative;
  border: 1px solid var(--raised);
  border-radius: 15px;
  overflow: hidden;
  padding: 0;
}
.project-cover img,
.project-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform var(--dur-slow) var(--ease-out),
    filter var(--dur-slow) var(--ease-out);
}
.project-cover:hover img,
.project-cover:hover video {
  transform: scale(1.03);
  filter: brightness(1.06);
}
.project-cover.empty-cover {
  background: radial-gradient(
    ellipse at 70% 0%,
    #323538 0%,
    #1b1d1f 38%,
    #131313 80%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.empty-cover > .icon {
  width: 40px;
  height: 40px;
  color: #8d9297;
  z-index: 1;
  stroke-width: 1;
}
.cover-caption {
  font-size: 12px;
  color: #757a80;
  margin-top: 15px;
  z-index: 1;
}
.cover-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    120deg,
    transparent 0,
    transparent 44px,
    #ffffff03 45px,
    transparent 46px
  );
}
.project-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #00000088, transparent 62%);
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-out);
}
.open-project {
  position: absolute;
  bottom: 18px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity var(--dur-med) var(--ease-out),
    transform var(--dur-med) var(--ease-out);
}
.project-cover:hover .project-cover-shade,
.project-cover:hover .open-project {
  opacity: 1;
  transform: none;
}
/* Stagger cards on load — Emil: 30–80ms between items, never block interaction. */
.project-card {
  animation: card-in 360ms var(--ease-out) both;
}
.project-card:nth-child(1) {
  animation-delay: 0ms;
}
.project-card:nth-child(2) {
  animation-delay: 55ms;
}
.project-card:nth-child(3) {
  animation-delay: 110ms;
}
.project-card:nth-child(4) {
  animation-delay: 165ms;
}
.project-card:nth-child(5) {
  animation-delay: 220ms;
}
.project-card:nth-child(6) {
  animation-delay: 275ms;
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-card {
    animation: none;
  }
  .project-cover img,
  .project-cover video {
    transition: none;
  }
}
.project-info {
  padding: 12px 3px;
}
.project-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.project-name > button:first-child {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0;
}
.project-name .icon-button {
  width: 28px;
  height: 28px;
}
.project-name .icon {
  width: 16px;
}
.project-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}
.project-meta > span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.project-meta .icon {
  height: 14px;
  width: 14px;
}
.project-meta .created {
  margin-left: auto;
  color: #7d7d7d;
}
.last-generation {
  font-size: 12px;
  color: #6d6d6d;
  margin-top: 12px;
}
.no-projects {
  grid-column: 1/-1;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed #2e2e35;
  border-radius: 16px;
  color: #77777f;
  background:
    radial-gradient(90% 100% at 50% 0%, #15151810, transparent), var(--panel);
}
.no-projects > .icon {
  width: 30px;
  height: 30px;
  color: #626262;
}
.no-projects h3 {
  font-size: 15px;
  color: #adadad;
  font-weight: 400;
  margin: 15px 0 0;
}
.no-projects p {
  font-size: 12px;
  margin-top: 9px;
}
.home-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--raised);
  margin-top: 75px;
  padding-top: 23px;
  color: #666;
  font-size: 12px;
}
.home-footer > span:first-child {
  font-size: 13px;
  letter-spacing: -0.3px;
}
.workspace {
  height: 100dvh;
  background: var(--canvas);
  --header: 64px;
}
.workspace-header {
  height: var(--header);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px 0 13px;
  background: #0b0b0dcc;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #1c1c21;
  z-index: 4;
}
.project-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 230px;
  max-width: 30%;
}
.project-title {
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px;
  max-width: 220px;
}
.project-heading > .icon-button:last-child {
  margin-left: 10px;
}
.workspace-header .header-end {
  margin-left: auto;
}
.search-tools {
  display: flex;
  gap: 8px;
  width: 440px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  height: 36px;
  padding: 0 13px;
  flex: 1;
  min-width: 0;
  color: var(--muted);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #e8b04b1a;
}
.search-box input {
  width: 100%;
  background: transparent;
  outline: 0;
  border: 0;
  font-size: 12px;
}
.search-box .icon {
  width: 17px;
}
.circle {
  background: var(--panel);
  border: 1px solid var(--line);
  width: 36px;
  height: 36px;
  transition: background var(--dur-fast) var(--ease-out);
}
.circle:hover {
  background: var(--raised);
}
.sidebar {
  width: var(--sidebar);
  position: fixed;
  left: 0;
  top: var(--header);
  bottom: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 14px 8px;
  z-index: 3;
  background: transparent;
}
.nav-item {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  border-radius: 12px;
  padding: 0 13px;
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: #b9b7b0;
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.nav-item > .icon {
  width: 18px;
  height: 18px;
  color: #8f8d87;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-item:hover {
  background: var(--raised);
  color: var(--text);
}
.nav-item.active {
  background: var(--raised);
  color: var(--text);
}
.nav-item.active > .icon {
  color: var(--accent);
}
.nav-divider {
  height: 1px;
  background: var(--raised);
  margin: 19px 0 14px;
}
.soon-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #727272;
  margin-left: auto;
}
.sidebar-bottom .nav-item {
  margin-top: 7px;
}
.trash-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface, var(--panel));
}
.trash-tools > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.trash-tools > .muted {
  font-size: 12px;
}
.trash-choice {
  position: absolute;
  z-index: 5;
  left: 10px;
  top: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--subtle);
  border-radius: 7px;
  background: #222c;
  color: white;
  cursor: pointer;
}
.trash-choice[aria-checked="true"] {
  background: var(--text);
  color: var(--canvas);
}
.gallery-main {
  position: absolute;
  top: var(--header);
  left: var(--sidebar);
  right: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 18px 18px 190px 6px;
  scrollbar-width: thin;
  scrollbar-color: #2c2c33 transparent;
}
.gallery-main::-webkit-scrollbar {
  width: 8px;
}
.gallery-main::-webkit-scrollbar-thumb {
  background: #2c2c33;
  border-radius: 4px;
}
.gallery-main::-webkit-scrollbar-thumb:hover {
  background: #3d3d46;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  align-content: start;
}
.gallery.large {
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.media-card {
  position: relative;
  min-width: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid #1e1e24;
  aspect-ratio: 4/3;
  animation: card-in 320ms var(--ease-out) both;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out);
}
.media-card:hover {
  border-color: #34343c;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px #00000044;
}
.media-open {
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
}
.media-open img,
.media-open video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform var(--dur-slow) var(--ease-out),
    filter var(--dur-slow) var(--ease-out);
}
.media-card:hover .media-open img,
.media-card:hover .media-open video {
  transform: scale(1.035);
  filter: brightness(1.05);
}
.video-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  border-radius: 50%;
  background: #fff;
  color: #191919;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
}
.video-badge .icon {
  height: 12px;
  width: 12px;
  fill: currentColor;
  stroke-width: 0;
}
.media-hover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  background: linear-gradient(#0004, transparent 40%, #000a);
}
.media-card:hover .media-hover,
.media-card:focus-within .media-hover {
  opacity: 1;
}
.media-top {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  pointer-events: none;
}
.media-top > :not(.card-trash) {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.media-card:hover .media-top > :not(.card-trash),
.media-card:focus-within .media-top > :not(.card-trash) {
  opacity: 1;
  pointer-events: auto;
}
.media-card:hover .video-badge,
.media-card:focus-within .video-badge {
  opacity: 0;
}
.media-top .card-trash {
  position: static;
}
.card-trash {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  width: 29px;
  height: 29px;
  color: #fff;
  background: #171717b8;
  backdrop-filter: blur(10px);
}
.card-trash .icon {
  width: 16px;
  height: 16px;
}
.card-trash:hover {
  background: #713634;
}
.toast-undo {
  margin-left: 16px;
  text-decoration: underline;
  font-weight: 600;
}
.media-top button,
.media-top a,
.media-bottom button {
  pointer-events: auto;
  background: #171717b8;
  backdrop-filter: blur(10px);
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  color: #fff;
}
.media-top > :not(.card-trash) {
  pointer-events: none;
}
.media-top .card-trash:hover {
  background: #713634;
}
.media-top > :not(.card-trash):hover {
  background: #343434e8;
}
.media-top .icon,
.media-bottom .icon {
  height: 16px;
  width: 16px;
}
.media-bottom {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 11px;
  font-size: 12px;
}
.media-bottom > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.is-favorite .favorite .icon {
  fill: #ff5a65;
  stroke: #ff5a65;
}
.is-favorite .media-top > .favorite {
  opacity: 1;
  pointer-events: auto;
}
.gallery-empty {
  grid-column: 1/-1;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text);
}
.gallery-empty > .icon {
  width: 36px;
  height: 36px;
  color: #5d5d66;
  stroke-width: 1.1;
}
.gallery-empty h2 {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.7px;
  margin: 22px 0 0;
}
.gallery-empty p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin: 12px 0 24px;
  max-width: 42ch;
}
.empty-suggestions {
  display: flex;
  gap: 9px;
}
.empty-suggestions button {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 10px 15px;
  font-size: 12px;
  color: #b9b7b0;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.empty-suggestions button:hover {
  background: var(--raised);
  border-color: #3c3c46;
  color: var(--text);
}
.composer-wrap {
  position: fixed;
  z-index: 5;
  bottom: 12px;
  left: calc(50% + var(--sidebar) / 2);
  transform: translateX(-50%);
  width: 600px;
  max-width: calc(100% - var(--sidebar) - 48px);
}
.composer {
  background: var(--panel);
  border: 1px solid var(--raised);
  box-shadow: 0 12px 70px #000b;
  border-radius: 23px;
  padding: 16px 15px 10px;
  position: relative;
}
.composer textarea {
  display: block;
  resize: none;
  background: none;
  border: 0;
  outline: none !important;
  width: 100%;
  font-size: 13px;
  line-height: 1.65;
  min-height: 45px;
  max-height: 230px;
  padding: 0 3px 8px;
  scrollbar-width: thin;
}
.composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.composer-left,
.composer-right {
  display: flex;
  gap: 7px;
  align-items: center;
}
.add-button {
  width: 31px;
  height: 31px;
  background: var(--raised);
  color: #969696;
}
.add-button > .icon {
  height: 18px;
  width: 18px;
}
.mode-hint {
  background: var(--raised);
  padding: 9px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.settings-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 22px;
  padding: 9px 11px;
  background: var(--raised);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
  min-height: 31px;
}
.aspect-icon {
  display: inline-block;
  width: 12px;
  height: 8px;
  border: 1px solid var(--muted);
  border-radius: 1px;
}
.aspect-icon.portrait {
  width: 7px;
  height: 12px;
}
.generate-button {
  background: #e2e2e2;
  color: var(--raised);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.generate-button > .icon {
  height: 19px;
  width: 19px;
}
.generate-button:disabled {
  background: var(--line);
  color: var(--muted);
  opacity: 0.6;
}
.composer-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  color: #626262;
  margin-top: 9px;
}
.composer-footnote .icon {
  height: 10px;
  width: 10px;
}
.settings-popover {
  position: absolute;
  bottom: 54px;
  right: 48px;
  width: 291px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid #262626;
  border-radius: 19px;
  box-shadow: 0 15px 50px #000a;
}
.settings-popover[hidden] {
  display: none;
}
.segmented {
  display: flex;
  gap: 2px;
  background: var(--raised);
  border-radius: 13px;
  padding: 2px;
  margin-bottom: 5px;
  min-height: 35px;
}
.segmented button {
  flex: 1;
  padding: 7px 3px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.segmented .icon {
  width: 15px;
  height: 15px;
}
.segmented .selected {
  background: #444;
  color: #fff;
}
.segmented:first-child .selected,
.segmented:nth-child(2) .selected {
  background: var(--text);
  color: var(--raised);
}
.model-select {
  position: relative;
  display: block;
  background: var(--line);
  border-radius: 12px;
  margin-bottom: 6px;
}
.model-select select {
  appearance: none;
  width: 100%;
  padding: 9px 30px 9px 10px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.model-select option {
  background: var(--raised);
}
.model-select > .icon {
  position: absolute;
  right: 7px;
  top: 7px;
  pointer-events: none;
  height: 19px;
  width: 19px;
}
.cost-note {
  text-align: center;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.5;
  margin: 12px 5px 5px;
}
.attachments {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.attachments:not(:empty) {
  margin: 0 0 12px;
}
.attachment {
  position: relative;
  width: 73px;
  height: 66px;
  border-radius: 8px;
  border: 1px solid #494949;
}
.attachment img,
.attachment video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.attachment button {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  background: var(--line);
  border: 1px solid #666;
  border-radius: 50%;
  padding: 0;
}
.attachment button > .icon {
  width: 12px;
  height: 12px;
}
.attachment > span:not(:empty) {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0009;
  font-size: 12px;
  padding: 4px;
  text-align: center;
  white-space: nowrap;
}
.dragover {
  border-color: var(--muted);
  background: var(--raised);
}
.job-card {
  background: linear-gradient(135deg, var(--panel), var(--canvas));
  border: 1px solid var(--raised);
  border-radius: 13px;
  min-height: 175px;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.job-center {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  padding: 20px;
  text-align: center;
}
.job-center strong {
  font-size: 12px;
  font-weight: 500;
}
.job-center p {
  font-size: 12px;
  line-height: 1.6;
  color: #747474;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
  overflow-wrap: anywhere;
}
.job-percent {
  font-size: 12px;
  color: var(--muted);
}
.spinner {
  width: 22px;
  height: 22px;
  border: 1.5px solid #444;
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.job-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--muted);
}
.job-failed {
  border-color: #513232;
}
.job-failed .job-center > .icon {
  color: #c79191;
}
.job-center .subtle-button {
  font-size: 12px;
  padding: 5px 10px;
  min-height: 24px;
}
.collapsed {
  --sidebar: 66px;
}
.collapsed .sidebar {
  padding-left: 10px;
  padding-right: 10px;
}
.collapsed .nav-item {
  padding: 0;
  justify-content: center;
}
.collapsed .nav-item span {
  display: none;
}
.collapsed .project-heading {
  min-width: 210px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: #000a;
  backdrop-filter: blur(7px);
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal {
  width: 460px;
  max-width: 100%;
  max-height: 90dvh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 30px 100px #000b;
  outline: none;
}
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.modal h2 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.4px;
  margin: 0;
}
.modal-heading > .icon-button {
  margin: -8px -8px -8px 0;
}
.modal > .muted {
  font-size: 12px;
  margin: 15px 0 25px;
}
.field-label {
  display: block;
  color: var(--subtle);
  font-size: 12px;
  margin: 20px 0 10px;
}
.text-input {
  height: 45px;
  width: 100%;
  padding: 12px;
  border-radius: 11px;
  border: 1px solid #464646;
  background: var(--raised);
  outline: none;
}
.text-input:focus {
  border-color: #aab6c9;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 27px;
}
.primary-button {
  background: var(--text);
  color: var(--panel);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
}
.primary-button .icon {
  height: 16px;
  width: 16px;
}
.subtle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 13px;
  min-height: 39px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 12px;
}
.subtle-button .icon {
  width: 15px;
  height: 15px;
}
.danger {
  color: #e4a7a7;
}
.menu-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 5px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}
.menu-row:first-of-type {
  margin-top: 20px;
}
.account-list {
  margin: 22px 0;
}
.pool-modal {
  width: min(580px, calc(100vw - 32px));
}
.account-email {
  color: #d0d0d0 !important;
  overflow-wrap: anywhere;
}
.account-check {
  color: #b0b0b0;
  font-size: 12px;
  margin-top: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.account-check:disabled {
  opacity: 0.4;
  cursor: default;
}
.account-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.account-row > div {
  flex: 1;
  min-width: 0;
}
.account-row strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.account-row small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.account-detail {
  overflow-wrap: anywhere;
}
.account-avatar {
  height: 33px;
  width: 33px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--line);
  font-size: 12px;
}
.account-balance {
  font-size: 12px;
  color: var(--muted);
}
.budget-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  gap: 12px;
  margin: 12px 0;
}
.budget-line strong {
  font-weight: 500;
}
.empty-pool {
  font-size: 12px;
  color: var(--subtle);
  line-height: 1.8;
  padding: 20px 0;
}
.preview-modal {
  width: min(1300px, 95vw);
  height: min(780px, 90dvh);
  padding: 0;
  border-radius: 19px;
  display: flex;
  flex-direction: column;
}
.preview-top {
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.preview-top > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  min-height: 0;
  flex: 1;
}
.preview-stage {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  padding: 15px;
}
.preview-stage > img,
.preview-stage > video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.preview-details {
  padding: 24px;
  overflow: auto;
  border-left: 1px solid var(--line);
}
.preview-details h2 {
  font-size: 16px;
  overflow-wrap: anywhere;
  margin-top: 12px;
  line-height: 1.5;
}
.preview-details > .subtle-button,
.preview-details > .primary-button {
  width: 100%;
  margin-top: 12px;
}
.saved-prompt {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 270px;
  overflow: auto;
}
.library-modal {
  width: 750px;
}
.library-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0;
  font-size: 12px;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-height: 50vh;
  overflow: auto;
}
.library-item {
  display: block;
  position: relative;
  min-width: 0;
  padding: 0;
  border-radius: 10px;
  background: var(--raised);
  border: 1px solid transparent;
  overflow: hidden;
  text-align: left;
}
.library-item > img,
.library-item > video {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}
.library-item > span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  padding: 10px;
}
.library-item > .icon {
  position: absolute;
  right: 5px;
  top: 5px;
  background: #0008;
  border-radius: 50%;
  padding: 3px;
  width: 22px;
  height: 22px;
}
.library-item.chosen {
  border-color: var(--text);
}
.placeholder-content {
  padding: 20px 0 38px;
  text-align: center;
}
.placeholder-content > .icon {
  width: 42px;
  height: 42px;
  color: #949494;
  margin-bottom: 27px;
  stroke-width: 1;
}
.placeholder-content .eyebrow {
  font-size: 12px;
}
.placeholder-content h2 {
  font-size: 27px;
  margin: 17px 0;
}
.placeholder-content p {
  font-size: 13px;
  color: #939393;
  line-height: 1.8;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 15px);
  background: #ededed;
  color: #191919;
  padding: 13px 20px;
  border-radius: 13px;
  box-shadow: 0 5px 40px #0008;
  font-size: 12px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 220ms var(--ease-out);
  max-width: min(600px, 90vw);
  line-height: 1.5;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
#login-form > .primary-button {
  margin-top: 20px;
  width: 100%;
}
.startup-error {
  padding: 100px;
  text-align: center;
}
.startup-error button {
  background: var(--line);
  padding: 12px 20px;
  border-radius: 10px;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: #414141;
  border-radius: 5px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1800px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  }
}
@media (max-width: 1200px) {
  .search-tools {
    position: static;
    transform: none;
    flex: 1;
    width: auto;
    margin-left: 25px;
    max-width: 350px;
  }
  .pool-label {
    display: none;
  }
  .workspace-header {
    gap: 10px;
  }
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  }
  .home-title h1 {
    font-size: 45px;
  }
  .home-main {
    padding-top: 50px;
  }
}
@media (max-width: 900px) {
  :root {
    --sidebar: 68px;
  }
  .sidebar {
    padding-left: 10px;
    padding-right: 10px;
  }
  .nav-item {
    justify-content: center;
    padding: 0;
  }
  .nav-item span {
    display: none;
  }
  .project-heading {
    min-width: 190px;
    max-width: 38%;
  }
  .project-title {
    max-width: 150px;
  }
  .project-heading > .icon-button:last-child {
    margin-left: 0;
  }
  .workspace-header > .search-tools {
    margin-left: 0;
  }
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-main {
    padding: 40px 25px;
  }
  .preview-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
  .preview-details {
    padding: 18px;
  }
  .workspace-header .pool-pill {
    display: none;
  }
}
@media (max-width: 600px) {
  .home-header {
    height: 74px;
    padding: 0 20px;
  }
  .brand {
    font-size: 22px;
  }
  .home-title h1 {
    font-size: 34px;
    letter-spacing: -1.3px;
  }
  .home-title p {
    font-size: 12px;
  }
  .home-title .eyebrow {
    font-size: 12px;
    letter-spacing: 1.5px;
  }
  .home-main {
    padding: 36px 20px 20px;
  }
  .create-project {
    height: 105px;
    padding: 20px;
    gap: 15px;
    margin-bottom: 34px;
  }
  .create-plus {
    height: 44px;
    width: 44px;
    border-radius: 12px;
  }
  .create-project strong {
    font-size: 16px;
  }
  .create-project small {
    font-size: 12px;
  }
  .create-arrow {
    width: 30px;
    height: 30px;
  }
  .create-arrow .icon {
    width: 17px;
  }
  .section-bar h2 {
    font-size: 15px;
  }
  .home-search input {
    width: 110px;
    font-size: 12px;
  }
  .project-grid {
    gap: 15px;
    grid-template-columns: 1fr;
  }
  .project-cover {
    aspect-ratio: 16/9;
  }
  .project-name > button:first-child {
    font-size: 15px;
  }
  .home-footer {
    margin-top: 40px;
  }
  .workspace-header {
    height: 56px;
    padding: 0 9px;
    gap: 4px;
  }
  .workspace {
    --header: 56px;
  }
  .workspace-header .search-tools {
    display: none;
  }
  .project-heading {
    min-width: 0;
    max-width: 68%;
  }
  .project-title {
    max-width: 180px;
    font-size: 12px;
  }
  .workspace-header .header-end {
    gap: 2px;
  }
  .workspace-header .header-end > [data-action="grid"] {
    display: none;
  }
  .avatar {
    height: 29px;
    width: 29px;
  }
  .sidebar {
    width: 52px;
    padding: 0 5px;
    bottom: 12px;
  }
  .nav-item {
    height: 40px;
  }
  .nav-item > .icon {
    width: 17px;
    height: 17px;
  }
  .gallery-main {
    left: 54px;
    padding: 0 9px 210px 0;
  }
  .gallery {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gallery.large {
    grid-template-columns: 1fr;
  }
  .media-card {
    aspect-ratio: 3/4;
    border-radius: 10px;
  }
  .gallery-empty {
    min-height: 55vh;
    padding: 20px 8px;
  }
  .gallery-empty h2 {
    font-size: 19px;
  }
  .gallery-empty p {
    font-size: 12px;
  }
  .empty-suggestions {
    flex-direction: column;
  }
  .empty-suggestions button {
    font-size: 12px;
  }
  .composer-wrap {
    left: calc(50% + 22px);
    max-width: calc(100% - 72px);
    bottom: 12px;
  }
  .composer {
    border-radius: 19px;
    padding: 13px 10px 9px;
  }
  .composer textarea {
    font-size: 12px;
  }
  .mode-hint {
    display: none;
  }
  .settings-trigger {
    font-size: 12px;
    padding: 8px;
  }
  .composer-right {
    gap: 4px;
  }
  .composer-left {
    gap: 0;
  }
  .settings-popover {
    width: 275px;
    right: 0;
  }
  .composer-footnote {
    font-size: 12px;
  }
  .gallery-empty > .icon {
    width: 28px;
    height: 28px;
  }
  .job-card {
    min-height: 160px;
    aspect-ratio: 3/4;
  }
  .job-center {
    padding: 10px;
    gap: 7px;
  }
  .job-center strong {
    font-size: 12px;
  }
  .job-center p {
    font-size: 12px;
  }
  .modal-overlay {
    padding: 13px;
  }
  .modal {
    padding: 21px;
    border-radius: 18px;
  }
  .modal h2 {
    font-size: 19px;
  }
  .preview-modal {
    height: 93dvh;
    padding: 0;
  }
  .preview-layout {
    display: flex;
    flex-direction: column;
    overflow: auto;
  }
  .preview-stage {
    height: 45vh;
    min-height: 250px;
    flex-shrink: 0;
  }
  .preview-details {
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .preview-details h2 {
    font-size: 15px;
  }
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .library-tools {
    font-size: 12px;
  }
  .library-tools .subtle-button {
    font-size: 12px;
  }
  .media-hover {
    opacity: 1;
  }
  .media-bottom > span {
    display: none;
  }
  .media-bottom {
    justify-content: flex-end;
  }
  .media-top button,
  .media-top a {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }
  .media-top {
    top: 6px;
    right: 6px;
  }
  .media-top > :not(.card-trash) {
    opacity: 1;
    pointer-events: auto;
  }
  .media-card .video-badge {
    opacity: 0;
  }
}

/* Preserve media composition, as in the Flow gallery. */
.gallery {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
}
.gallery-empty {
  width: 100%;
}
.media-card,
.job-card {
  flex: 0 0 auto;
  height: 250px;
  width: calc(250px * var(--ratio, 1.33333));
  max-width: 100%;
  aspect-ratio: auto;
}
.gallery.large .media-card,
.gallery.large .job-card {
  height: 340px;
  width: calc(340px * var(--ratio, 1.33333));
}
.media-open img,
.media-open video {
  object-fit: contain;
}
.job-card {
  min-width: 180px;
}
.account-row > .subtle-button {
  flex-shrink: 0;
  font-size: 12px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #4c4c4c;
}
.account-balance:empty {
  display: none;
}
@media (max-width: 600px) {
  .media-card,
  .job-card {
    height: 180px;
    width: calc(180px * var(--ratio, 1.33333));
    max-width: 100%;
  }
  .gallery.large .media-card,
  .gallery.large .job-card {
    width: 100%;
    height: auto;
    aspect-ratio: var(--ratio, 1.33333);
  }
  .account-row {
    gap: 8px;
  }
}

.frame-slot {
  width: 84px;
  height: 66px;
  border: 1px dashed #494949;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.frame-slot .icon {
  width: 15px;
  height: 15px;
}
.frame-swap {
  width: 20px;
  height: 66px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  color: #c4c4c4;
}
.frame-swap .icon {
  width: 18px;
  height: 18px;
}
.frame-swap:disabled {
  opacity: 1;
  cursor: default;
  color: #909090;
}
.pool-connection.connected {
  color: #9cd4b5;
  font-size: 12px;
  margin: 14px 0;
}
.pool-remote {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin: 16px 0;
  border: 1px solid var(--border, #34373d);
  border-radius: 12px;
  background: var(--surface, #191c21);
}
.pool-remote strong {
  font-size: 14px;
}
.pool-remote p,
.pool-remote small {
  color: var(--text-muted, #b4b6bc);
  font-size: 12px;
  line-height: 1.6;
  margin: 6px 0 0;
}
.pool-remote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.pool-remote-actions a {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  text-decoration: none;
}
.pool-remote-actions svg {
  width: 16px;
  height: 16px;
}
.pool-block-reason {
  color: #e5bd7f;
}
/* Keep diagnostics readable without extending the whole workspace. */
.progress-events {
  max-height: 18rem;
  overflow: auto;
  padding-left: 1.4rem;
}
.progress-events li {
  margin: 0.45rem 0;
  overflow-wrap: anywhere;
}
.progress-events time {
  color: var(--muted);
  margin-right: 0.4rem;
}
#studio-progress-log > div {
  max-height: 28rem;
  overflow: auto;
}
#job-log-content {
  max-height: 70vh;
  overflow: auto;
}
.artifact-expiry {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 3;
  max-width: calc(100% - 16px);
  padding: 4px 7px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 7px;
  background: rgb(13 15 18 / 88%);
  color: var(--text-muted, #b4b6bc);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.artifact-expiry.expired .expiry-label {
  display: none;
}
.media-card:has(.artifact-expiry) .media-hover {
  padding-bottom: 32px;
}
.is-expired .media-open > img,
.is-expired .media-open > video,
.is-expired .video-badge {
  visibility: hidden;
}
.expired-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted, #b4b6bc);
  padding: 12px;
  font-size: 12px;
}
.expired-placeholder svg {
  width: 18px;
  flex-shrink: 0;
}
.media-card.is-expired .media-open::after {
  content: "Срок хранения истёк";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--text-muted, #b4b6bc);
  font-size: 12px;
  background: var(--surface, #191c21);
}
.media-card.is-expired .expired-placeholder {
  visibility: hidden;
}
@media (max-width: 600px) {
  .artifact-expiry .expiry-label {
    display: none;
  }
}
