:root {
  color-scheme: dark;
  --bg: #05080f;
  --sidebar: #070b13;
  --panel: rgba(18, 23, 35, 0.92);
  --panel-2: rgba(24, 29, 44, 0.94);
  --panel-3: rgba(255, 255, 255, 0.045);
  --line: rgba(158, 171, 207, 0.17);
  --line-strong: rgba(141, 103, 255, 0.76);
  --text: #f4f7ff;
  --muted: #a0a8ba;
  --dim: #6e7688;
  --purple: #8d5cff;
  --purple-2: #6f82ff;
  --cyan: #5ed7ff;
  --amber: #f6bd58;
  --danger: #ff6e8d;
  --radius: 8px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 28% 8%, rgba(95, 113, 255, 0.14), transparent 24%),
    radial-gradient(circle at 80% 0%, rgba(94, 215, 255, 0.08), transparent 22%),
    linear-gradient(135deg, #05080f 0%, #070b14 48%, #080b12 100%);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.66;
}

select,
textarea,
input[type="search"] {
  color: var(--text);
  outline: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 8, 14, 0.68);
}

select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
}

textarea {
  width: 100%;
  min-height: 126px;
  padding: 18px 18px 12px;
  resize: vertical;
  line-height: 1.72;
  font-size: 15px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--purple);
}

.app-frame {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px 14px;
  background: rgba(5, 9, 17, 0.9);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 8px;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
}

.brand-mark span {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #6f82ff, #8d5cff);
  box-shadow: 0 8px 24px rgba(113, 100, 255, 0.35);
}

.brand-mark span:nth-child(1) {
  top: 3px;
  left: 0;
}

.brand-mark span:nth-child(2) {
  top: 0;
  right: 2px;
  transform: rotate(45deg) scale(0.74);
  background: #9b65ff;
}

.brand-mark span:nth-child(3) {
  right: 0;
  bottom: 2px;
  transform: rotate(45deg) scale(0.7);
  background: #5ed7ff;
}

.brand-mark span:nth-child(4) {
  left: 5px;
  bottom: 0;
  transform: rotate(45deg) scale(0.58);
  background: #4f67ff;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-link {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  color: #d2d8e8;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
}

.side-link span {
  color: #c8d0e4;
  text-align: center;
}

.side-link.active,
.side-link:hover {
  color: #fff;
  border-color: rgba(129, 101, 255, 0.28);
  background: linear-gradient(90deg, rgba(117, 88, 255, 0.38), rgba(117, 88, 255, 0.12));
}

.quota-card,
.invite-card,
.stage-card,
.prompt-card,
.workflow-card,
.template-row,
.settings-card,
.rail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 25, 38, 0.94), rgba(11, 15, 24, 0.94));
  box-shadow: var(--shadow);
}

.quota-card {
  margin-top: auto;
  padding: 15px;
}

.quota-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.quota-top b {
  color: #ffb46a;
  font-size: 11px;
  border: 1px solid rgba(255, 180, 106, 0.46);
  border-radius: 999px;
  padding: 2px 7px;
}

.quota-card strong {
  display: block;
  margin-top: 12px;
  font-size: 22px;
}

.quota-meter {
  height: 5px;
  margin: 10px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

.quota-meter span {
  display: block;
  width: 74%;
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
}

.quota-card small {
  color: var(--dim);
}

.invite-card {
  position: relative;
  min-height: 96px;
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(117, 88, 255, 0.36), rgba(79, 103, 255, 0.16)),
    linear-gradient(180deg, rgba(20, 25, 38, 0.94), rgba(11, 15, 24, 0.94));
}

.invite-card strong,
.invite-card span {
  display: block;
}

.invite-card span {
  margin: 5px 0 12px;
  color: #c8d0e4;
  font-size: 12px;
}

.invite-card button:not(.dismiss) {
  min-height: 34px;
  padding: 0 15px;
  border-radius: 7px;
  background: linear-gradient(135deg, #5c7fff, #9b48ff);
  font-weight: 700;
}

.invite-card i {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-style: normal;
  font-size: 34px;
  opacity: 0.86;
}

.dismiss {
  position: absolute;
  top: 8px;
  right: 10px;
  color: #c6ccdb;
  background: transparent;
}

.sidebar-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.sidebar-footer button,
.round-tool,
.player-icon {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-footer button {
  height: 36px;
}

.collapse-button {
  background: rgba(255, 255, 255, 0.08) !important;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 220px minmax(360px, 640px) auto;
  gap: 18px;
  align-items: center;
  height: 68px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 15, 0.76);
  backdrop-filter: blur(18px);
}

.workspace-switch,
.search-box,
.points-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.workspace-switch {
  justify-content: space-between;
  padding: 0 14px;
}

.workspace-switch span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(135deg, #6378ff, #8d5cff);
}

.workspace-switch b {
  color: var(--muted);
}

.search-box {
  padding: 0 10px 0 14px;
  color: var(--muted);
}

.search-box input {
  flex: 1;
  height: 38px;
  min-width: 120px;
  padding: 0;
  border: 0;
  background: transparent;
}

.search-box kbd {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  font-family: inherit;
  font-size: 12px;
}

.account-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}

.recharge-button,
.primary-button {
  min-height: 44px;
  border-radius: 7px;
  font-weight: 800;
  background: linear-gradient(135deg, #5f81ff, #a23cff);
  box-shadow: 0 12px 34px rgba(125, 88, 255, 0.36);
}

.recharge-button {
  padding: 0 20px;
}

.points-pill {
  padding: 0 14px;
  color: #f5dfad;
  font-weight: 700;
}

.round-tool {
  width: 40px;
  height: 40px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 31%, #ffe2d2 0 20%, transparent 21%),
    linear-gradient(180deg, #202637 0 32%, #f2bfae 33% 62%, #273147 63%);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas:
    "center settings"
    "rail rail";
  gap: 16px;
  padding: 16px 18px 22px;
  align-items: start;
  overflow: clip;
}

.center-column,
.settings-column,
.right-rail {
  min-width: 0;
}

.center-column {
  grid-area: center;
}

.settings-column {
  grid-area: settings;
}

.right-rail {
  grid-area: rail;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.center-column,
.settings-column,
.right-rail {
  display: grid;
  align-content: start;
  gap: 14px;
}

.mode-tabs {
  display: flex;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.mode-tab {
  min-height: 46px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e2e7f7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 19, 30, 0.86);
  white-space: nowrap;
}

.mode-tab span {
  font-weight: 900;
}

.mode-tab.active {
  color: #fff;
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(141, 103, 255, 0.42), 0 0 22px rgba(120, 86, 255, 0.28);
}

.stage-card {
  padding: 0;
  overflow: hidden;
  max-width: 100%;
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 0;
  max-height: 660px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 42%, rgba(99, 121, 255, 0.16), transparent 38%),
    linear-gradient(135deg, #111725, #050811);
}

.poster-fallback,
.preview-image,
.preview-video,
.canvas-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-fallback {
  z-index: 1;
  filter: saturate(1.08) contrast(1.04);
}

.preview-image {
  z-index: 2;
  display: none;
}

.preview-video {
  z-index: 4;
  display: none;
  background: #05080f;
}

.preview-video[src]:not([src=""]) {
  display: block;
}

.preview-video[src]:not([src=""]) + canvas + .preview-overlay {
  display: none;
}

.preview-image[src]:not([src=""]) {
  display: block;
}

.canvas-wrap canvas {
  z-index: 0;
  opacity: 0;
}

.preview-overlay {
  position: absolute;
  inset: auto 0 0;
  z-index: 5;
  padding: 34px 18px 12px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
}

.preview-status {
  position: absolute;
  right: 16px;
  bottom: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 800;
}

.preview-status button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
}

.player-bar {
  display: grid;
  grid-template-columns: 38px 30px auto minmax(180px, 1fr) 30px 30px;
  gap: 10px;
  align-items: center;
  color: #fff;
}

.play-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #0d1119;
  border-radius: 50%;
  background: #fff;
  font-weight: 900;
}

.player-icon {
  width: 30px;
  height: 30px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
}

.shot-list {
  display: flex;
  gap: 10px;
  min-width: 0;
  min-height: 92px;
  overflow-x: auto;
  padding: 1px 2px 4px;
}

.shot-card {
  position: relative;
  flex: 0 0 150px;
  min-height: 90px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.shot-card.active {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(141, 103, 255, 0.42);
}

.shot-thumb,
.shot-thumb img,
.shot-thumb-placeholder {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
}

.shot-thumb-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.54)),
    linear-gradient(135deg, rgba(91, 215, 255, 0.28), rgba(141, 92, 255, 0.35));
}

.shot-card h3,
.shot-card p,
.shot-card .shot-debug {
  margin: 0;
}

.shot-card h3,
.shot-card .shot-title {
  position: absolute;
  top: 7px;
  left: 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 14px);
  padding: 2px 6px;
  overflow: hidden;
  color: #fff;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.62);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-card p,
.shot-card .shot-text {
  position: absolute;
  right: 7px;
  bottom: 7px;
  max-width: calc(100% - 14px);
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.86);
  white-space: nowrap;
}

.shot-debug {
  display: none;
}

.mode-badge {
  display: none;
}

.creation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.prompt-card,
.workflow-card,
.template-row,
.settings-card,
.rail-card {
  min-width: 0;
  padding: 16px;
  overflow: hidden;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-heading strong {
  font-size: 16px;
}

.card-heading span {
  color: var(--muted);
  font-size: 12px;
}

.prompt-tools,
.prompt-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.assistant-button,
.utility-button,
.model-tile,
.guide-button,
.segmented button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.assistant-button {
  min-height: 32px;
  padding: 0 12px;
  color: #d7c9ff;
}

.reference-image-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.reference-upload {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 1px dashed rgba(144, 117, 255, 0.62);
  border-radius: var(--radius);
  background: rgba(122, 92, 255, 0.08);
  cursor: pointer;
}

.reference-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.reference-upload span {
  color: #fff;
  font-weight: 800;
}

.reference-upload small,
.reference-preview span {
  color: var(--muted);
  font-size: 12px;
}

.reference-preview {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.reference-preview[hidden] {
  display: none;
}

.reference-preview img {
  width: 72px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: #05080f;
}

.reference-preview div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.reference-preview strong {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-preview button {
  width: max-content;
  min-height: 28px;
  padding: 0 10px;
  color: #f4d7ff;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.mini-switch,
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.mini-switch input,
.toggle input {
  position: absolute;
  opacity: 0;
}

.mini-switch i,
.toggle i {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.mini-switch i::after,
.toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.mini-switch input:checked + i,
.toggle input:checked + i {
  background: linear-gradient(90deg, #5e7fff, #9a55ff);
}

.mini-switch input:checked + i::after,
.toggle input:checked + i::after {
  transform: translateX(16px);
}

.prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--dim);
  font-size: 12px;
}

.utility-button {
  min-height: 38px;
  padding: 0 14px;
  color: #dfe6f8;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.model-tile {
  min-height: 70px;
  padding: 11px;
  text-align: left;
}

.model-tile strong,
.model-tile span {
  display: block;
}

.model-tile span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.model-tile.active {
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(141, 103, 255, 0.34);
}

.template-scroll {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
}

.template-card {
  position: relative;
  min-height: 86px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-position: center;
  background-size: cover;
}

.template-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, 0.78));
}

.template-card strong,
.template-card span,
.template-card b {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.82);
}

.template-card span {
  color: #d9def1;
  font-size: 12px;
}

.template-card b {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 5px;
  color: #fff;
  border-radius: 4px;
  background: #ff4f5e;
  font-size: 11px;
}

.template-card.city {
  background-image: linear-gradient(135deg, #1d2d69, #f147be);
}

.template-card.car {
  background-image: linear-gradient(135deg, #121921, #d5d9e0 56%, #344461);
}

.template-card.presenter {
  background-image: linear-gradient(135deg, #203146, #c4a2a1 55%, #101827);
}

.template-card.travel {
  background-image: linear-gradient(135deg, #375d50, #e2c663);
}

.template-card.effect {
  background-image: radial-gradient(circle, #ff96f2, #10122b 58%, #04070e);
}

.template-card.pet {
  background-image: linear-gradient(135deg, #5a3a1d, #e2c0a0);
}

.settings-card {
  position: sticky;
  top: 84px;
}

.settings-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: -16px -16px 16px;
  border-bottom: 1px solid var(--line);
}

.settings-tabs button {
  min-height: 48px;
  color: var(--muted);
  background: transparent;
}

.settings-tabs button.active {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--purple);
}

.setting-block {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
}

.setting-label,
.voice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #dfe6f8;
  font-size: 14px;
}

.setting-label b {
  color: #d8dfff;
  font-size: 13px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.segmented button {
  min-height: 38px;
  color: #cbd3e6;
}

.segmented button.active,
.segmented button:hover {
  color: #fff;
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(141, 103, 255, 0.28);
}

.ratio-grid button {
  display: grid;
  place-items: center;
  gap: 4px;
  font-size: 12px;
}

.ratio-grid i {
  width: 16px;
  height: 11px;
  display: block;
  border: 2px solid currentColor;
  border-radius: 2px;
  opacity: 0.78;
}

.ratio-grid button[data-value="9:16"] i,
.ratio-grid button[data-value="3:4"] i {
  width: 10px;
  height: 16px;
}

.ratio-grid button[data-value="1:1"] i {
  width: 13px;
  height: 13px;
}

.select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.toggle.muted-toggle i {
  background: rgba(255, 255, 255, 0.18);
}

.muted-text {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  font-size: 16px;
}

.estimate-line {
  min-height: 26px;
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.estimate-line.ready {
  color: #83e5ad;
}

.estimate-line.busy {
  color: #f6d28d;
}

.estimate-line.error,
.error {
  color: #ffb0c0;
}

.rail-card {
  padding: 16px;
}

.trend-list,
.tip-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trend-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.trend-list span,
.tip-list li {
  color: var(--muted);
  font-size: 12px;
}

.trend-list b {
  color: #836bff;
  letter-spacing: 2px;
  font-size: 12px;
}

.tip-list li {
  position: relative;
  padding-left: 12px;
  line-height: 1.7;
}

.tip-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d8def2;
}

.guide-button {
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  color: #e2e8f8;
}

.history-card {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
}

.history-item img {
  width: 52px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
}

.history-item strong,
.history-item small {
  display: block;
}

.history-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.history-item small,
.history-item time {
  color: var(--muted);
  font-size: 11px;
}

.hidden-controls,
.sr-only-control {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

@media (min-width: 1880px) {
  .studio-grid {
    grid-template-columns: minmax(0, 1fr) 360px 300px;
    grid-template-areas: "center settings rail";
  }

  .right-rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1520px) {
  .app-frame {
    grid-template-columns: 212px minmax(0, 1fr);
  }

  .studio-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .creation-grid {
    grid-template-columns: 1fr;
  }

  .model-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  .studio-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "center"
      "settings"
      "rail";
  }

  .settings-card {
    position: static;
  }

  .right-rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .side-nav {
    display: flex;
    min-width: max-content;
  }

  .quota-card,
  .invite-card,
  .sidebar-footer {
    display: none;
  }

  .topbar,
  .studio-grid,
  .creation-grid,
  .right-rail {
    grid-template-columns: 1fr;
  }

  .settings-card {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: auto;
    grid-template-columns: 1fr;
  }

  .studio-grid {
    padding: 12px;
  }

  .canvas-wrap {
    min-height: 220px;
  }

  .player-bar {
    grid-template-columns: 36px 30px auto 30px;
  }

  .player-bar .progress-track,
  .player-bar .player-icon:last-child {
    grid-column: 1 / -1;
  }

  .model-grid,
  .template-scroll {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}
