:root {
  color-scheme: light;
  --bg: oklch(0.975 0.006 168);
  --surface: oklch(0.995 0.004 168);
  --surface-2: oklch(0.956 0.008 168);
  --panel: oklch(0.948 0.008 168);
  --ink: oklch(0.235 0.018 168);
  --muted: oklch(0.49 0.02 168);
  --faint: oklch(0.66 0.017 168);
  --border: oklch(0.86 0.012 168);
  --accent: oklch(0.58 0.12 162);
  --accent-dark: oklch(0.38 0.1 162);
  --accent-soft: oklch(0.92 0.045 162);
  --warning: oklch(0.66 0.12 78);
  --danger: oklch(0.56 0.16 30);
  --shadow-sm: 0 1px 2px oklch(0.32 0.03 168 / 0.08);
  --shadow-md: 0 16px 42px oklch(0.32 0.025 168 / 0.11);
  --radius: 8px;
  --chat-track: min(1040px, calc(100% - 68px));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.office-panel {
  display: grid;
  gap: 18px;
  align-content: start;
  background: linear-gradient(180deg, oklch(0.988 0.006 168), oklch(0.964 0.008 168));
}

.office-panel-title {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  background: var(--surface);
}

.office-capability-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: var(--panel);
}

.office-capability-tabs button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 720;
  cursor: pointer;
}

.office-capability-tabs button.active {
  border-color: oklch(0.77 0.04 162);
  background: oklch(0.94 0.028 162);
  color: var(--accent-dark);
}

.office-workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(0, 1.14fr);
  gap: 18px;
  align-items: start;
}

.office-form,
.office-result-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 12px 26px oklch(0.24 0.02 168 / 0.06);
}

.office-wechat-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.office-wechat-fields[hidden] {
  display: none;
}

.office-wechat-fields .studio-field:nth-child(3) {
  grid-column: 1 / -1;
}

.office-wechat-options {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.office-wechat-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.office-safety-note {
  margin: 0;
  border: 1px solid oklch(0.82 0.04 76);
  border-radius: 10px;
  padding: 10px 12px;
  background: oklch(0.965 0.026 76);
  color: oklch(0.42 0.07 76);
  font-size: 0.82rem;
  line-height: 1.45;
}

.office-image-field[hidden] {
  display: none;
}

.office-image-actions,
.office-resource-actions,
.office-result-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.office-image-actions input,
.office-resource-actions input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.office-context-bar {
  display: grid;
  gap: 10px;
  max-width: 100%;
  border: 1px solid oklch(0.8 0.04 162);
  border-radius: 8px;
  padding: 10px;
  background: oklch(0.965 0.026 162);
}

.office-context-bar[hidden],
.office-pending-resource-panel[hidden] {
  display: none;
}

.office-context-bar > div:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}

.office-context-bar strong {
  color: var(--accent-dark);
  font-size: 0.86rem;
}

.office-context-bar span,
.office-context-chip small,
.office-pending-resource-panel span,
.office-pending-resource-panel small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.office-context-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.office-context-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  border: 1px solid oklch(0.78 0.035 162);
  border-radius: 8px;
  padding: 7px 8px;
  background: var(--surface);
}

.office-context-chip > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.office-context-chip strong,
.office-pending-resource-list strong {
  min-width: 0;
  max-width: 100%;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.office-context-chip button {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}

.office-pending-resource-panel {
  display: grid;
  gap: 10px;
  max-width: 100%;
  border: 1px solid oklch(0.82 0.04 76);
  border-radius: 8px;
  padding: 10px;
  background: oklch(0.968 0.024 76);
}

.office-pending-resource-head,
.office-pending-resource-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.office-pending-resource-head strong {
  color: oklch(0.42 0.07 76);
  font-size: 0.86rem;
}

.office-pending-resource-list span {
  display: grid;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}

.office-image-asset-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 8px;
}

.office-image-asset {
  display: grid;
  gap: 7px;
  min-height: 132px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.office-image-asset.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.office-image-asset img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: var(--panel);
}

.office-image-asset span,
.office-image-empty,
.office-image-preview span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.office-image-preview {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 76px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-2);
}

.office-image-preview img {
  width: 88px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

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

.office-image-preview strong,
.office-image-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.office-image-url-field {
  color: var(--muted);
  font-size: 0.82rem;
}

.office-image-url-field input {
  margin-top: 8px;
  width: 100%;
}

.office-empty-result {
  display: grid;
  gap: 8px;
  min-height: 220px;
  align-content: center;
  color: var(--muted);
}

.office-empty-result strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.office-empty-result.error {
  color: var(--danger);
}

.office-result-card {
  display: grid;
  gap: 14px;
}

.office-result-card header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.office-result-card header div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.office-result-card header strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.office-result-card header small,
.office-result-card footer,
.office-result-card p {
  color: var(--muted);
  line-height: 1.5;
}

.office-pptx-deliverable {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid oklch(0.78 0.045 162);
  border-radius: 8px;
  padding: 12px;
  background: oklch(0.955 0.026 162);
}

.office-pptx-deliverable div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.office-pptx-deliverable span {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.office-pptx-deliverable strong {
  overflow-wrap: anywhere;
}

.office-pptx-deliverable p {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.office-pptx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.office-final-delivery {
  position: relative;
}

.office-final-delivery small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.office-progress-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.office-progress-step {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-2);
}

.office-progress-step span {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.office-progress-step strong {
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.office-progress-step[data-status="active"] span,
.office-progress-step[data-status="processing"] span,
.office-progress-step[data-status="running"] span {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.office-progress-step[data-status="done"] span {
  border-color: var(--accent);
  background: var(--accent);
}

.office-progress-step[data-status="done"] strong {
  color: var(--ink);
}

.office-progress-step[data-status="error"] {
  border-color: rgba(185, 28, 28, 0.35);
  background: rgba(254, 242, 242, 0.78);
}

.office-progress-step[data-status="error"] span {
  border-color: #b91c1c;
  background: #b91c1c;
}

.office-progress-step[data-status="error"] strong {
  color: #991b1b;
}

.office-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.office-progress-steps li {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.office-progress-steps span {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: oklch(0.92 0.018 175);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.office-progress-steps li[data-progress-state="done"] {
  border-color: oklch(0.78 0.045 162);
  background: oklch(0.965 0.02 162);
  color: var(--ink);
}

.office-progress-steps li[data-progress-state="done"] span {
  background: var(--accent);
  color: oklch(0.99 0.004 162);
}

.office-progress-steps li[data-progress-state="error"] {
  border-color: oklch(0.72 0.12 28);
  background: oklch(0.96 0.025 28);
  color: oklch(0.42 0.11 28);
}

.office-process-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.office-process-details summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.office-process-details .office-result-sections {
  padding: 0 12px 12px;
}

.office-result-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.office-result-sections section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.office-result-sections h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.office-result-sections ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.office-report-preview {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-2);
}

.office-report-sections {
  display: grid;
  gap: 12px;
}

.office-report-sections section,
.office-research-process section {
  display: grid;
  gap: 6px;
}

.office-report-sections h3,
.office-research-process h3 {
  margin: 0;
  font-size: 0.92rem;
}

.office-report-sections ul,
.office-research-process ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.office-research-process {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.office-research-process summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.86rem;
}

.recharge-redeem-panel {
  display: grid;
  gap: 18px;
  align-content: start;
  background: linear-gradient(180deg, oklch(0.988 0.006 168), oklch(0.964 0.008 168));
}

.recharge-redeem-title {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.recharge-redeem-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.14fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.recharge-balance-card,
.recharge-input-card,
.recharge-help-card,
.recharge-activity-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: 0 10px 24px oklch(0.24 0.02 168 / 0.05);
}

.recharge-balance-card {
  background:
    linear-gradient(135deg, oklch(0.985 0.008 168), oklch(0.945 0.03 162)),
    var(--surface);
}

.recharge-balance-card span,
.recharge-balance-card small,
.recharge-help-card li,
.recharge-activity-row span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.recharge-balance-card strong {
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1.1;
}

.recharge-input-card {
  grid-row: span 2;
}

.recharge-input-card textarea {
  min-height: 136px;
  resize: vertical;
  overflow-wrap: anywhere;
}

.recharge-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.recharge-form-actions .inline-action-status {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.recharge-help-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.recharge-activity-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.recharge-activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
}

.recharge-activity-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.recharge-activity-row strong,
.recharge-activity-row span {
  overflow-wrap: anywhere;
}

.recharge-activity-row em {
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 760;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

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

button,
a,
textarea,
input,
select {
  outline-color: var(--accent);
}

button:focus,
a:focus,
textarea:focus,
input:focus,
select:focus {
  outline: none;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

body [hidden] {
  display: none !important;
}

.workbench-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 48px;
  overflow: hidden;
  color: oklch(0.23 0.02 168);
  background:
    radial-gradient(circle at 52% 44%, oklch(0.96 0.026 162 / 0.72), transparent 35%),
    radial-gradient(circle at 18% 82%, oklch(0.88 0.04 92 / 0.34), transparent 28%),
    linear-gradient(140deg, oklch(0.984 0.006 168), oklch(0.936 0.013 154) 58%, oklch(0.955 0.018 88));
  isolation: isolate;
  pointer-events: auto;
  transition:
    opacity 520ms cubic-bezier(0.19, 1, 0.22, 1),
    transform 620ms cubic-bezier(0.19, 1, 0.22, 1),
    clip-path 620ms cubic-bezier(0.19, 1, 0.22, 1);
}

.workbench-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, oklch(0.44 0.025 168 / 0.08) 1px, transparent 1px),
    linear-gradient(180deg, oklch(0.44 0.025 168 / 0.07) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(circle at 50% 45%, black, transparent 72%);
  opacity: 0.72;
}

.workbench-splash::after {
  content: "";
  position: absolute;
  inset: 10% 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, oklch(0.58 0.12 162 / 0.38), transparent);
  opacity: 0.72;
  transform: translateY(34vh);
  animation: workbenchSplashScan 1700ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.workbench-splash-canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.92;
  pointer-events: none;
}

.workbench-splash-canvas canvas {
  display: block;
}

.workbench-splash-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.workbench-splash-field span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(38vw, 520px);
  height: 1px;
  background: linear-gradient(90deg, transparent, oklch(0.42 0.08 162 / 0.42), transparent);
  opacity: 0.38;
  transform-origin: center;
  animation: workbenchFieldLock 1700ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.workbench-splash-field span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(0deg) scaleX(0.42);
}

.workbench-splash-field span:nth-child(2) {
  transform: translate(-50%, -50%) rotate(62deg) scaleX(0.34);
  animation-delay: 110ms;
}

.workbench-splash-field span:nth-child(3) {
  transform: translate(-50%, -50%) rotate(-58deg) scaleX(0.36);
  animation-delay: 180ms;
}

.workbench-splash-core {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(430px, calc(100vw - 48px));
  min-width: 0;
  text-align: center;
  transform: translateY(-3vh);
}

.workbench-splash-core::before {
  content: "";
  position: absolute;
  inset: -38px -46px;
  z-index: -1;
  border: 1px solid oklch(0.72 0.03 162 / 0.36);
  background:
    linear-gradient(90deg, transparent 0 18%, oklch(0.99 0.006 168 / 0.72) 47% 53%, transparent 82% 100%),
    oklch(0.985 0.006 168 / 0.62);
  box-shadow: 0 24px 60px oklch(0.24 0.025 168 / 0.12);
}

.workbench-splash-kicker {
  color: oklch(0.42 0.08 162);
  font-size: 0.8rem;
  font-weight: 780;
  letter-spacing: 0;
}

.workbench-splash h2 {
  margin: 0;
  color: oklch(0.24 0.025 168);
  font-size: 2.25rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.workbench-splash p {
  margin: 0;
  color: oklch(0.45 0.025 168);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0;
}

.workbench-splash-progress {
  width: min(260px, 72vw);
  height: 3px;
  margin-top: 12px;
  overflow: hidden;
  background: oklch(0.78 0.018 168 / 0.56);
}

.workbench-splash-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, oklch(0.38 0.1 162), oklch(0.68 0.12 86));
  transform-origin: left;
  animation: workbenchSplashPulse 1650ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.workbench-splash-skip {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  min-height: 36px;
  border: 1px solid oklch(0.68 0.024 168 / 0.72);
  padding: 7px 12px;
  background: oklch(0.99 0.004 168 / 0.74);
  color: oklch(0.36 0.025 168);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 720;
  cursor: pointer;
  box-shadow: 0 8px 18px oklch(0.26 0.025 168 / 0.08);
}

.workbench-splash-skip:hover,
.workbench-splash-skip:focus-visible {
  border-color: oklch(0.54 0.08 162);
  color: oklch(0.28 0.07 162);
  outline: 2px solid oklch(0.76 0.065 162 / 0.62);
  outline-offset: 2px;
}

.workbench-splash-skip[disabled] {
  cursor: default;
  opacity: 0.56;
}

.workbench-splash.workbench-splash-fallback .workbench-splash-canvas {
  display: none;
}

.workbench-splash.is-exiting {
  clip-path: inset(0 0 100% 0);
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
}

body.workbench-splash-active .product-workbench-shell {
  filter: saturate(0.95);
  transform: translateY(12px) scale(0.992);
}

body.workbench-splash-revealing .product-workbench-shell {
  animation: workbenchPageReveal 680ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

body.workbench-splash-short .workbench-splash::after,
body.workbench-splash-short .workbench-splash-field span {
  animation-duration: 220ms;
}

body.workbench-splash-short .workbench-splash-progress span {
  animation-duration: 220ms;
}

@keyframes workbenchSplashPulse {
  0% {
    transform: scaleX(0.08);
    opacity: 0.28;
  }

  62% {
    transform: scaleX(0.78);
    opacity: 0.92;
  }

  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes workbenchSplashScan {
  0% {
    transform: translateY(34vh) scaleX(0.18);
    opacity: 0;
  }

  48% {
    opacity: 0.72;
  }

  100% {
    transform: translateY(0) scaleX(1);
    opacity: 0.28;
  }
}

@keyframes workbenchFieldLock {
  0% {
    opacity: 0;
    filter: saturate(0.8);
  }

  58% {
    opacity: 0.52;
  }

  100% {
    opacity: 0.26;
    filter: saturate(1);
  }
}

@keyframes workbenchPageReveal {
  0% {
    filter: saturate(0.95);
    opacity: 0.86;
    transform: translateY(12px) scale(0.992);
  }

  100% {
    filter: saturate(1);
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.session-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-action {
  min-height: 32px;
  padding: 6px 10px;
}

.auth-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 14px;
}

.auth-panel[hidden] {
  display: none;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 240px) minmax(150px, 220px) auto;
  align-items: end;
  gap: 12px;
}

.auth-card h2 {
  margin: 2px 0 0;
  font-size: 1.05rem;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.auth-card input {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  padding: 8px 10px;
}

.auth-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-status[data-status-tone="pending"] {
  color: oklch(0.44 0.08 78);
}

.auth-status[data-status-tone="success"] {
  color: var(--accent-dark);
}

.auth-status[data-status-tone="error"] {
  color: var(--danger);
}

.admin-auth-panel {
  margin: 18px auto 0;
  width: min(1040px, calc(100% - 36px));
}

.signed-out-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 0 34px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.signed-out-panel[hidden] {
  display: none;
}

.signed-out-panel h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.signed-out-panel p:last-child {
  max-width: 62ch;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.signed-out-actions,
.auth-secondary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-page-shell {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(390px, 1.1fr);
  gap: 0;
  min-height: 100vh;
}

.product-auth-shell {
  background:
    linear-gradient(90deg, var(--panel), var(--panel) 45%, var(--bg) 45%, var(--bg));
}

.auth-product-panel,
.auth-workspace-panel {
  display: grid;
  align-content: center;
  gap: 24px;
  min-width: 0;
  padding: 44px;
}

.auth-product-panel {
  border-right: 1px solid var(--border);
  background: oklch(0.948 0.008 168 / 0.92);
}

.auth-product-copy {
  display: grid;
  gap: 12px;
}

.auth-product-copy h1 {
  max-width: 14ch;
  margin: 0;
  font-size: 2.05rem;
  line-height: 1.14;
  letter-spacing: 0;
}

.phrase-nowrap {
  white-space: nowrap;
}

.auth-product-copy p:last-child {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-checklist {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-checklist li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
  min-height: 46px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.auth-checklist li > span {
  grid-row: span 2;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.auth-checklist strong,
.auth-checklist small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-checklist strong {
  font-size: 0.9rem;
}

.auth-checklist small {
  color: var(--muted);
  font-size: 0.78rem;
}

.auth-infra-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-infra-strip div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.auth-infra-strip span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-infra-strip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.auth-trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.auth-trust-strip article {
  display: grid;
  gap: 3px;
  min-height: 62px;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: var(--bg);
}

.auth-trust-strip span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-trust-strip strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-workspace-panel {
  align-content: center;
  width: min(540px, 100%);
  justify-self: center;
}

.auth-workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.auth-workspace-header h2 {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.2;
}

.auth-mode-tabs {
  display: inline-flex;
  width: 100%;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  background: var(--surface-2);
}

.auth-mode-tab {
  flex: 1;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 720;
}

.auth-mode-tab.active {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.product-auth-shell .auth-mode-tabs {
  display: none;
}

.register-method-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  background: var(--surface-2);
}

.register-method-tab {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 720;
}

.register-method-tab:hover,
.register-method-tab.active {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.register-contact-panel {
  display: grid;
  gap: 10px;
}

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

.auth-stack {
  display: grid;
  gap: 14px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.auth-stack[hidden] {
  display: none;
}

.auth-form-heading h2,
.auth-form-heading h3 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.25;
}

.auth-form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.auth-form-heading .eyebrow {
  margin-bottom: 6px;
}

.auth-form-switch {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: nowrap;
}

.auth-text-switch {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 760;
}

.auth-text-switch:hover {
  color: var(--ink);
}

.field-help {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.verification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.verification-button {
  min-height: 36px;
  padding-inline: 12px;
}

.verification-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.auth-submit {
  width: 100%;
}

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

.product-workbench-shell {
  background: var(--bg);
}

body.conversation-mode .product-workbench-shell {
  grid-template-columns: 224px minmax(390px, 1fr) 310px;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

body.conversation-mode .rail {
  height: 100vh;
  overflow: auto;
}

body.conversation-mode .studio-panel {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.conversation-mode .conversation-shell {
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.mobile-workbench-topbar {
  display: none;
}

.mobile-primary-tabs {
  display: none;
}

.mobile-model-control {
  display: none;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px;
  border-right: 1px solid var(--border);
  background: oklch(0.948 0.01 168 / 0.96);
}

.brand-block {
  display: flex;
  gap: 11px;
  align-items: center;
  min-height: 46px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--surface);
  font-weight: 760;
}

.brand-logo-mark {
  width: 84px;
  overflow: hidden;
  background: oklch(0.12 0.01 168);
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.brand-block strong {
  display: block;
  font-size: 0.96rem;
}

.brand-block small,
.rail-note span,
.topbar-meta,
.session-summary,
.message-meta,
.row-meta,
.model-count {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.rail-nav,
.compact-model-list {
  display: grid;
  gap: 6px;
}

.rail-link,
.compact-model {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.rail-link:hover,
.compact-model:hover,
.rail-link.current,
.compact-model.active {
  border-color: var(--border);
  background: var(--surface);
}

.compact-model {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 9px;
  row-gap: 0;
  width: 100%;
}

.compact-model small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.75rem;
}

.rail-section {
  display: grid;
  gap: 10px;
}

.rail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rail-label {
  margin: 0;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.icon-text-button {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 680;
}

.icon-text-button:hover {
  border-color: var(--accent);
}

.conversation-list {
  display: grid;
  gap: 6px;
}

.conversation-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.conversation-item:hover,
.conversation-item.active {
  border-color: var(--border);
  background: var(--surface);
}

.conversation-item span,
.conversation-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item span {
  font-size: 0.85rem;
  font-weight: 650;
}

.conversation-item small,
.conversation-empty {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.rail-note {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: oklch(0.965 0.008 168);
}

.conversation-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.conversation-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 20px;
  padding: 24px 34px 12px;
}

.topbar-title {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.conversation-topbar h1 {
  margin: 0;
  font-size: 1.62rem;
  line-height: 1.18;
}

.workspace-context-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(140px, 1fr));
  gap: 8px;
  padding: 0 34px 12px;
}

.context-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 74px;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.context-cell-primary {
  background: oklch(0.966 0.016 168);
}

.context-cell span,
.support-lane span,
.resource-summary-grid span {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.context-cell strong,
.context-cell small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-cell strong {
  font-size: 0.94rem;
}

.context-cell small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.conversation-flow-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: min(860px, calc(100% - 68px));
  margin: 0 auto;
  padding: 4px 0;
}

.conversation-flow-bar article {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
}

.conversation-flow-bar span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.conversation-flow-bar strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-stage {
  display: grid;
  align-content: center;
  overflow: auto;
  min-height: 0;
  padding: 8px 0 150px;
}

body.conversation-mode .workspace-panel {
  min-height: 0;
}

body.conversation-mode .workspace-home {
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  padding-bottom: 0;
}

body.conversation-mode .conversation-stage {
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 18px;
  padding-bottom: 24px;
  scroll-padding-bottom: 24px;
}

body.conversation-mode .messages {
  min-height: 0;
}

.start-panel {
  display: grid;
  gap: 28px;
  width: min(820px, 100%);
  margin: 0 auto;
}

.start-copy {
  display: grid;
  gap: 10px;
}

.start-copy h2 {
  max-width: 740px;
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.start-copy p {
  max-width: 64ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.prompt-chip {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: oklch(0.99 0.005 76 / 0.78);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease-out, border-color 180ms ease-out, background 180ms ease-out;
}

.prompt-chip:hover {
  transform: translateY(-2px);
  border-color: oklch(0.72 0.045 142);
  background: var(--surface);
}

.prompt-chip span {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 740;
}

.prompt-chip strong {
  align-self: end;
  font-size: 0.95rem;
  line-height: 1.35;
}

.workspace-panel,
.admin-section {
  min-width: 0;
}

.workspace-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  overflow: auto;
  min-height: 0;
  padding: 0 34px 132px;
}

.workspace-panel[hidden],
.admin-section[hidden] {
  display: none;
}

.workspace-section-title,
.admin-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.workspace-section-title h2,
.admin-section-heading h2 {
  margin: 0;
  font-size: 1.16rem;
  line-height: 1.25;
}

.workspace-section-title span,
.admin-section-heading span {
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: right;
}

.resource-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  background:
    linear-gradient(180deg, oklch(0.985 0.005 168), oklch(0.966 0.008 168));
}

.member-center-panel {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  align-items: start;
  background:
    linear-gradient(180deg, oklch(0.986 0.005 168), oklch(0.968 0.008 168));
}

.member-benefits-section {
  grid-column: 1 / -1;
}

.resource-summary-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.resource-summary-grid article {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 94px;
  align-content: end;
  overflow: hidden;
  border: 1px solid oklch(0.86 0.012 168);
  border-radius: 14px;
  padding: 18px 18px 16px 58px;
  background:
    linear-gradient(180deg, oklch(0.997 0.004 168), oklch(0.972 0.007 168));
  box-shadow:
    0 14px 30px oklch(0.26 0.022 168 / 0.08),
    inset 0 1px 0 oklch(1 0 0 / 0.82);
}

.resource-summary-grid article::before {
  position: absolute;
  top: 20px;
  left: 18px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: oklch(0.92 0.035 162);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  content: "●";
}

.resource-summary-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.42rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.usage-dashboard {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
  overflow: hidden;
  border: 1px solid oklch(0.86 0.012 168);
  border-radius: 18px;
  padding: 22px;
  background:
    linear-gradient(180deg, oklch(0.997 0.004 168), oklch(0.972 0.007 168));
  box-shadow: 0 18px 44px oklch(0.24 0.022 168 / 0.09);
}

.resource-storage-dashboard {
  padding: 18px;
}

.usage-dashboard::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), oklch(0.62 0.11 236), oklch(0.72 0.12 76));
  content: "";
}

.usage-dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.usage-dashboard-header h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.usage-dashboard-header > span {
  color: var(--muted);
  font-size: 0.78rem;
}

.usage-bill-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(206px, 1fr));
  gap: 14px;
}

.usage-bill-summary article {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value"
    "meta meta";
  gap: 5px 10px;
  min-width: 0;
  min-height: 110px;
  align-content: center;
  border: 1px solid oklch(0.86 0.012 168);
  border-radius: 14px;
  padding: 16px;
  background: oklch(0.992 0.004 168);
  box-shadow: 0 9px 20px oklch(0.25 0.02 168 / 0.06);
}

.usage-bill-summary article.primary {
  border-color: oklch(0.76 0.055 162);
  background: oklch(0.955 0.022 162);
}

.usage-metric-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: oklch(0.91 0.038 162);
  color: var(--accent-dark);
  font-size: 0.92rem;
  font-style: normal;
  font-weight: 900;
}

.usage-bill-summary article:nth-child(3) .usage-metric-icon {
  background: oklch(0.93 0.028 236);
  color: oklch(0.48 0.11 236);
}

.usage-bill-summary article:nth-child(4) .usage-metric-icon {
  background: oklch(0.94 0.045 76);
  color: oklch(0.5 0.09 76);
}

.usage-bill-summary article:nth-child(5) .usage-metric-icon {
  background: oklch(0.93 0.036 300);
  color: oklch(0.52 0.13 300);
}

.usage-bill-summary span,
.usage-bill-summary small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.usage-bill-summary span {
  grid-area: label;
}

.usage-bill-summary small {
  grid-area: meta;
  padding-top: 3px;
}

.usage-bill-summary strong {
  grid-area: value;
  color: var(--ink);
  font-size: 1.24rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.usage-bill-summary article.primary strong {
  font-size: 1.5rem;
}

.usage-dashboard-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -2px;
}

.usage-dashboard-highlights span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 720;
}

.usage-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(310px, 0.82fr);
  align-items: start;
  gap: 16px;
}

.usage-dashboard-column {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.resource-storage-grid {
  grid-template-columns: 1fr;
}

.resource-storage-panel {
  grid-column: 1 / -1;
}

.usage-chart-panel,
.usage-ranking-panel,
.usage-resource-panel,
.usage-category-panel,
.usage-recent-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid oklch(0.86 0.012 168);
  border-radius: 16px;
  padding: 16px;
  background: oklch(0.985 0.006 168);
  box-shadow: 0 10px 24px oklch(0.25 0.02 168 / 0.055);
}

.resource-storage-grid .resource-storage-panel {
  grid-column: 1 / -1;
}
.usage-trend-chart {
  display: grid;
  gap: 8px;
  min-height: 174px;
  align-content: center;
}

.usage-trend-chart svg {
  display: block;
  width: 100%;
  min-height: 150px;
}

.usage-empty-chart {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 144px;
  border: 1px dashed oklch(0.78 0.014 168);
  border-radius: var(--radius);
  padding: 18px;
  background: oklch(0.985 0.005 168);
  text-align: center;
}

.usage-empty-chart strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.usage-empty-chart span {
  max-width: 42ch;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.usage-grid-line {
  fill: none;
  stroke: oklch(0.82 0.012 168);
  stroke-width: 1;
}

.usage-spend-line,
.usage-token-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.usage-spend-line {
  stroke: var(--accent-dark);
}

.usage-token-line {
  stroke: oklch(0.56 0.11 236);
}

.usage-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.usage-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.usage-chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.legend-spend {
  background: var(--accent-dark);
}

.legend-token {
  background: oklch(0.56 0.11 236);
}

.usage-ranking-list,
.usage-recent-list,
.usage-resource-grid,
.usage-category-breakdown {
  display: grid;
  gap: 8px;
}

.usage-ranking-row,
.usage-category-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
  border: 1px solid oklch(0.86 0.012 168);
  border-radius: 12px;
  padding: 12px 13px 14px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.74);
}

.usage-ranking-row i,
.usage-category-row i {
  position: absolute;
  right: auto;
  bottom: 0;
  left: 0;
  width: var(--usage-width);
  max-width: 100%;
  height: 4px;
  background: var(--accent);
}

.usage-ranking-row strong,
.usage-ranking-row span,
.usage-category-row strong,
.usage-category-row span,
.usage-recent-row strong,
.usage-recent-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-ranking-row strong,
.usage-category-row strong,
.usage-recent-row strong {
  font-size: 0.86rem;
}

.usage-ranking-row span,
.usage-category-row span,
.usage-recent-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.usage-ranking-row em,
.usage-category-row em {
  color: var(--ink);
  font-style: normal;
  font-weight: 760;
}

.usage-resource-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.usage-resource-grid article {
  position: relative;
  display: grid;
  gap: 4px;
  overflow: hidden;
  border: 1px solid oklch(0.86 0.012 168);
  border-radius: 12px;
  padding: 13px;
  background: var(--surface);
}

.usage-resource-grid .usage-resource-wide {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.usage-resource-grid .usage-resource-wide i {
  position: absolute;
  right: auto;
  bottom: 0;
  left: 0;
  width: var(--usage-width);
  max-width: 100%;
  height: 4px;
  background: var(--accent);
}

.usage-resource-grid span {
  color: var(--muted);
  font-size: 0.72rem;
}

.usage-resource-grid strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.usage-recent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid oklch(0.86 0.012 168);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}

.usage-recent-row em {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--danger);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 760;
}

.usage-recent-row em[data-ok="true"] {
  color: var(--accent-dark);
}

.video-task-row[data-pending="true"] {
  border-color: oklch(0.76 0.04 162);
  background: oklch(0.965 0.016 162);
}

.video-task-running {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid oklch(0.74 0.045 162);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 780;
  white-space: nowrap;
}

.video-task-running::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px oklch(0.62 0.1 162 / 0.12);
  content: "";
}

.image-studio {
  gap: 18px;
}

.video-studio {
  gap: 18px;
}

.image-generation-form,
.video-generation-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.image-studio-main,
.image-result-section,
.video-studio-main,
.video-result-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.image-studio-main,
.video-studio-main {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.video-creation-shell {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: linear-gradient(180deg, oklch(0.992 0.005 168), var(--surface));
  box-shadow: var(--shadow-sm);
}

.video-creation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.video-creation-header h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.25;
}

.video-creation-header > span {
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: right;
}

.video-workflow-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  width: min(100%, 520px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  background: var(--surface-2);
}

.video-workflow-tabs button {
  display: grid;
  gap: 1px;
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-radius: calc(var(--radius) - 3px);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
}

.video-workflow-tabs button:hover,
.video-workflow-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px oklch(0.3 0.02 168 / 0.08);
}

.video-workflow-tabs button[data-video-workflow-pending]:not(.active) {
  color: oklch(0.58 0.012 168);
}

.video-workflow-tabs button span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 720;
}

.video-creation-shell .video-studio-main {
  grid-template-columns: minmax(320px, 0.96fr) minmax(360px, 1.04fr);
  align-items: stretch;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.video-stage-preview,
.video-prompt-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface);
}

.video-stage-preview {
  position: relative;
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto;
  overflow: visible;
}

.video-stage-preview::before {
  position: absolute;
  inset: 8% 10% 16%;
  z-index: 0;
  border-radius: 34px;
  background:
    radial-gradient(ellipse at 18% 48%, oklch(0.7 0.07 160 / 0.16), transparent 48%),
    radial-gradient(ellipse at 82% 45%, oklch(0.62 0.05 204 / 0.11), transparent 46%),
    linear-gradient(90deg, transparent 4%, oklch(0.86 0.024 168 / 0.14) 22%, transparent 38%, transparent 62%, oklch(0.78 0.03 198 / 0.12) 78%, transparent 96%);
  filter: blur(30px);
  opacity: 0;
  transform: translate3d(0, 4px, 0) scale(0.985);
  content: "";
  pointer-events: none;
}

.video-stage-preview > * {
  position: relative;
  z-index: 1;
}

.video-stage-screen {
  position: relative;
  display: grid;
  min-height: 280px;
  padding: 14px;
  background:
    radial-gradient(circle at 24% 18%, oklch(0.86 0.03 168 / 0.34), transparent 28%),
    linear-gradient(135deg, oklch(0.972 0.008 168), oklch(0.934 0.011 190));
  overflow: hidden;
}

.video-stage-screen::before,
.video-stage-screen::after {
  position: absolute;
  inset: 16px;
  z-index: 0;
  border-radius: 18px;
  content: "";
  pointer-events: none;
}

.video-stage-screen::before {
  border: 1px solid oklch(0.9 0.02 168 / 0.5);
  box-shadow:
    0 0 30px oklch(0.68 0.06 166 / 0.1),
    inset 0 0 30px oklch(0.96 0.012 168 / 0.18);
}

.video-stage-screen::after {
  background:
    linear-gradient(90deg, oklch(0.99 0.006 168 / 0.14), transparent 15%, transparent 85%, oklch(0.99 0.006 168 / 0.11)),
    linear-gradient(180deg, oklch(0.99 0.006 168 / 0.12), transparent 20%, transparent 82%, oklch(0.32 0.018 168 / 0.06));
  opacity: 0.62;
}

.video-stage-screen > * {
  position: relative;
  z-index: 1;
}

.video-stage-frame {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: 100%;
  min-height: 100%;
  border: 1px solid oklch(0.82 0.014 168);
  border-radius: calc(var(--radius) - 2px);
  color: var(--ink);
  text-align: center;
  background:
    linear-gradient(90deg, oklch(0.82 0.01 168 / 0.22) 1px, transparent 1px),
    linear-gradient(0deg, oklch(0.82 0.01 168 / 0.22) 1px, transparent 1px),
    oklch(0.992 0.004 168 / 0.72);
  background-size: 34px 34px;
  overflow: hidden;
}

.video-stage-frame::before {
  position: absolute;
  inset: -40%;
  z-index: 0;
  background:
    linear-gradient(110deg, transparent 34%, oklch(0.7 0.08 168 / 0.24) 48%, transparent 62%);
  opacity: 0;
  transform: translateX(-32%);
  content: "";
  pointer-events: none;
}

.video-stage-frame > * {
  position: relative;
  z-index: 1;
}

.video-stage-media {
  position: absolute;
  inset: 10px;
  z-index: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid oklch(0.76 0.014 168);
  border-radius: 16px;
  background: oklch(0.12 0.008 168);
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.08);
}

.video-stage-media[hidden] {
  display: none;
}

.video-stage-media video {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: oklch(0.12 0.008 168);
  object-fit: contain;
}

.video-stage-media div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 9px 11px;
  background: oklch(0.98 0.005 168 / 0.94);
  color: var(--ink);
}

.video-stage-media strong,
.video-stage-media span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-stage-media span {
  color: var(--muted);
  font-size: 0.76rem;
}

.video-stage-frame.has-video-preview > .video-stage-play,
.video-stage-frame.has-video-preview > strong,
.video-stage-frame.has-video-preview > small {
  opacity: 0;
}

.video-stage-frame.is-generating::before {
  opacity: 1;
  animation: videoStageSweep 1.8s ease-out infinite;
}

.video-stage-frame.is-generating .video-stage-play {
  border-color: oklch(0.62 0.1 168);
  box-shadow:
    0 0 0 9px oklch(0.72 0.08 168 / 0.12),
    0 18px 34px oklch(0.32 0.025 168 / 0.14);
}

.video-stage-status {
  position: absolute;
  top: 18px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100% - 32px));
  border: 1px solid oklch(0.76 0.04 168 / 0.74);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 760;
  background: oklch(0.995 0.004 168 / 0.92);
  box-shadow: 0 12px 28px oklch(0.28 0.025 168 / 0.12);
  transform: translateX(-50%);
}

.video-stage-status[hidden] {
  display: none;
}

.video-stage-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px oklch(0.64 0.11 168 / 0.14);
}

.video-stage-frame.is-generating .video-stage-status-dot {
  animation: videoStagePulse 1.15s ease-out infinite;
}

@keyframes videoStageSweep {
  0% {
    transform: translateX(-34%) rotate(0.001deg);
  }

  100% {
    transform: translateX(34%) rotate(0.001deg);
  }
}

@keyframes videoStagePulse {
  0%,
  100% {
    opacity: 0.54;
    transform: scale(0.86);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes videoTheaterGlowDrift {
  0% {
    opacity: 0.2;
    transform: translate3d(-1.2%, 5px, 0) scale(0.985);
  }

  50% {
    opacity: 0.3;
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    opacity: 0.24;
    transform: translate3d(1.2%, 3px, 0) scale(0.99);
  }
}

.video-stage-frame strong {
  font-size: 0.96rem;
  font-weight: 820;
}

.video-stage-frame small {
  color: var(--muted);
  font-size: 0.75rem;
}

.video-stage-actions {
  position: static;
  display: inline-flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.video-stage-actions[hidden] {
  display: none !important;
}

.video-stage-play {
  position: relative;
  width: 48px;
  height: 48px;
  border: 1px solid oklch(0.72 0.03 168);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 10px 22px oklch(0.32 0.025 168 / 0.1);
}

.video-stage-play::after {
  position: absolute;
  top: 50%;
  left: 52%;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid var(--accent-dark);
  transform: translate(-40%, -50%);
  content: "";
}

.video-stage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.video-prompt-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
}

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

.video-preset-grid button {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 3px);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 760;
}

.video-preset-grid button:hover {
  border-color: oklch(0.72 0.045 168);
  background: oklch(0.968 0.012 168);
}

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

.video-reference-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid oklch(0.84 0.014 168);
  border-radius: calc(var(--radius) - 1px);
  padding: 10px 11px;
  background: oklch(0.985 0.006 168);
}

.video-reference-workbench span,
.video-reference-workbench strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-reference-workbench span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.video-reference-workbench strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.86rem;
}

.video-reference-workbench-actions {
  display: inline-flex;
  gap: 7px;
}

.video-reference-workbench-actions button {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 780;
}

.video-reference-workbench-actions button:hover {
  border-color: oklch(0.7 0.055 168);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.video-frame-slot {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px dashed oklch(0.78 0.018 168);
  border-radius: calc(var(--radius) - 2px);
  padding: 12px;
  background: oklch(0.982 0.007 168);
}

.video-frame-slot span {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 820;
}

.video-frame-slot strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-frame-slot small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.video-frame-slot.has-asset {
  position: relative;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  border-style: solid;
  border-color: oklch(0.72 0.045 168);
  background: oklch(0.972 0.014 168);
}

.video-frame-slot.has-asset img {
  width: 46px;
  height: 46px;
  border-radius: calc(var(--radius) - 5px);
  object-fit: cover;
}

.video-frame-slot.has-asset div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.video-slot-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-color: oklch(0.8 0.018 168);
  border-radius: 999px;
  background: oklch(0.99 0.004 168);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1;
}

.video-slot-clear:hover {
  color: var(--danger);
}

.video-director-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-mobile-model-control {
  display: none;
  min-width: 0;
}

.video-stage-badge {
  position: absolute;
  top: 13px;
  left: 13px;
  z-index: 3;
  border: 1px solid oklch(0.78 0.026 168);
  border-radius: 999px;
  padding: 4px 9px;
  background: oklch(0.98 0.007 168 / 0.92);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 820;
  box-shadow: 0 6px 14px oklch(0.32 0.025 168 / 0.09);
}

.video-composer-dock {
  position: relative;
  gap: 13px;
  border-color: oklch(0.82 0.018 168);
  padding: 13px;
  background:
    linear-gradient(180deg, oklch(0.997 0.004 168), oklch(0.976 0.008 168));
  box-shadow: 0 10px 28px oklch(0.32 0.025 168 / 0.08);
}

.video-composer-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.video-composer-mode {
  justify-self: start;
  min-height: 34px;
  border: 1px solid oklch(0.78 0.026 168);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--surface);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 820;
  white-space: nowrap;
  box-shadow: 0 1px 2px oklch(0.32 0.02 168 / 0.06);
}

.video-composer-mode:hover {
  border-color: oklch(0.68 0.055 168);
  background: oklch(0.97 0.014 168);
}

.video-composer-mode::after {
  display: inline-block;
  margin-left: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  transform: translateY(-1px);
  content: "⌄";
}

.video-composer-pills {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.video-composer-pills::-webkit-scrollbar {
  display: none;
}

.video-composer-pills span,
.video-composer-pills button,
.video-parameter-popover button,
.video-reference-source-menu button,
.video-mode-menu button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 760;
}

.video-composer-pills span,
.video-composer-pills button {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: var(--muted);
  cursor: pointer;
}

.video-actor-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 1px);
  padding: 9px;
  background: oklch(0.982 0.007 168);
  scrollbar-width: thin;
}

.video-actor-strip[hidden] {
  display: none;
}

.video-actor-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px 5px 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 760;
}

.video-actor-chip:hover,
.video-actor-chip.active {
  border-color: oklch(0.68 0.055 168);
  background: oklch(0.965 0.016 168);
  color: var(--accent-dark);
}

.video-actor-chip span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 860;
}

.video-actor-chip.add-actor {
  border-style: dashed;
  padding: 6px 12px;
  color: var(--accent-dark);
}

.video-mode-menu,
.video-reference-source-menu,
.video-parameter-popover,
.video-reference-asset-picker,
.video-effect-gallery {
  z-index: 35;
  border: 1px solid oklch(0.82 0.018 168);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.video-mode-menu[hidden],
.video-reference-source-menu[hidden],
.video-parameter-popover[hidden],
.video-reference-asset-picker[hidden],
.video-effect-gallery[hidden] {
  display: none;
}

.video-mode-menu,
.video-reference-source-menu,
.video-reference-asset-picker,
.video-parameter-popover {
  position: absolute;
}

.video-mode-menu,
.video-reference-source-menu {
  top: 56px;
  left: 13px;
  display: grid;
  gap: 6px;
  min-width: 210px;
  padding: 8px;
}

.video-reference-source-menu {
  top: auto;
  bottom: 58px;
}

.video-reference-asset-picker {
  right: 13px;
  bottom: 58px;
  display: grid;
  gap: 10px;
  width: min(520px, calc(100% - 26px));
  max-height: 360px;
  padding: 12px;
  overflow: auto;
}

.video-reference-picker-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.video-reference-picker-head strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
}

.video-reference-picker-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.video-picker-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-color: oklch(0.84 0.014 168);
  border-radius: 999px;
  background: oklch(0.99 0.004 168);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.video-picker-close:hover {
  border-color: oklch(0.72 0.05 168);
  color: var(--ink);
}

.video-reference-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-reference-picker-tab {
  min-height: 30px;
  border: 1px solid oklch(0.82 0.014 168);
  border-radius: 999px;
  padding: 6px 11px;
  background: oklch(0.99 0.004 168);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 780;
}

.video-reference-picker-tab:hover,
.video-reference-picker-tab.active {
  border-color: oklch(0.68 0.06 168);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.video-reference-picker-tab.subtle {
  margin-left: auto;
  color: var(--danger);
}

.video-reference-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

.video-reference-picker-grid .image-result-empty {
  grid-column: 1 / -1;
  align-self: stretch;
  min-height: 78px;
  place-content: center;
}

.video-reference-asset {
  display: grid;
  grid-template-rows: 84px auto auto;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 7px;
  background: oklch(0.99 0.004 168);
  text-align: left;
}

.video-reference-asset.selected {
  border-color: oklch(0.64 0.09 162);
  background: oklch(0.964 0.018 168);
}

.video-reference-asset img {
  width: 100%;
  height: 84px;
  border-radius: calc(var(--radius) - 5px);
  object-fit: cover;
}

.video-reference-asset span,
.video-reference-asset small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-reference-asset span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 760;
}

.video-reference-asset small {
  color: var(--muted);
  font-size: 0.7rem;
}

.video-mode-menu button,
.video-reference-source-menu button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  border-radius: calc(var(--radius) - 2px);
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
}

.video-mode-menu button:hover,
.video-reference-source-menu button:hover,
.video-mode-menu button.active,
.video-reference-source-menu button.active {
  border-color: oklch(0.72 0.045 168);
  background: oklch(0.968 0.012 168);
  color: var(--accent-dark);
}

.video-mode-menu small,
.video-reference-source-menu small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
}

.video-parameter-popover {
  top: 56px;
  right: 13px;
  display: grid;
  gap: 13px;
  width: min(460px, calc(100vw - 32px));
  padding: 13px;
}

.video-parameter-popover section,
.video-parameter-row,
.video-parameter-slider {
  display: grid;
  gap: 8px;
}

.video-parameter-popover h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 830;
}

.video-parameter-row {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
}

.video-parameter-row > span,
.video-parameter-slider > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.video-parameter-row button {
  justify-self: start;
}

.video-parameter-popover .parameter-options,
.video-parameter-popover .video-parameter-options,
.video-parameter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.video-parameter-popover button {
  min-height: 32px;
  padding: 6px 10px;
  cursor: pointer;
}

.video-parameter-popover button:hover,
.video-parameter-popover button.active {
  border-color: oklch(0.68 0.055 168);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

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

.video-parameter-popover select {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 7px 10px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
}

.video-parameter-popover input[type="number"],
.video-parameter-popover textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
}

.video-parameter-popover textarea {
  resize: vertical;
}

.video-parameter-popover label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.video-parameter-director-grid,
.video-parameter-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.video-parameter-director-grid .video-parameter-row {
  grid-column: 1 / -1;
}

.video-parameter-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-parameter-textarea {
  grid-column: 1 / -1;
}

.video-effect-gallery {
  display: grid;
  gap: 12px;
  width: min(760px, calc(100vw - 32px));
  max-height: min(620px, calc(100dvh - 96px));
  overflow: auto;
  padding: 14px;
}

.video-effect-gallery header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.video-effect-gallery h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.video-effect-gallery nav,
.video-effect-gallery .effect-tabs,
.video-effect-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.video-effect-gallery nav button,
.video-effect-gallery .effect-tabs button,
.video-effect-tabs button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 760;
}

.video-effect-gallery nav button:hover,
.video-effect-gallery nav button.active,
.video-effect-gallery .effect-tabs button:hover,
.video-effect-gallery .effect-tabs button.active,
.video-effect-tabs button:hover,
.video-effect-tabs button.active {
  border-color: oklch(0.68 0.055 168);
  background: var(--surface);
  color: var(--accent-dark);
}

.video-effect-gallery .effect-grid,
.video-effect-gallery [data-effect-grid],
.video-effect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 10px;
}

.video-effect-gallery article,
.video-effect-gallery .effect-card,
.video-effect-grid button {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 1px);
  padding: 9px;
  background: oklch(0.985 0.006 168);
  cursor: pointer;
}

.video-effect-gallery article:hover,
.video-effect-gallery .effect-card:hover,
.video-effect-grid button:hover {
  border-color: oklch(0.68 0.055 168);
  background: oklch(0.97 0.014 168);
}

.video-effect-gallery img,
.video-effect-gallery video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: calc(var(--radius) - 2px);
  object-fit: cover;
  background: var(--panel);
}

.video-effect-gallery strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-effect-gallery small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.video-stage-screen {
  position: relative;
}

body.video-mode .product-workbench-shell {
  grid-template-columns: 224px minmax(0, 1fr);
}

body.video-mode .product-workbench-shell .studio-panel {
  display: none;
}

body.video-mode .conversation-shell {
  background:
    radial-gradient(circle at 50% 26%, oklch(0.78 0.024 168 / 0.22), transparent 34%),
    linear-gradient(180deg, oklch(0.975 0.006 168), oklch(0.928 0.011 168));
}

body.video-mode {
  overflow: hidden;
}

body.video-mode .conversation-topbar {
  align-items: center;
  padding: 8px 28px 4px;
}

body.video-mode .conversation-topbar .eyebrow {
  display: none;
}

body.video-mode .conversation-topbar h1 {
  font-size: 1.1rem;
  line-height: 1.12;
}

body.video-mode .topbar-meta {
  font-size: 0.78rem;
}

body.video-mode .video-studio {
  height: calc(100dvh - 51px);
  gap: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 28px 34px;
}

body.video-mode .video-studio.composer-locked {
  overflow-y: hidden;
}

body.video-mode .video-generation-form {
  display: grid;
  align-items: stretch;
  height: calc(100dvh - 80px);
  min-height: 0;
  scroll-margin-top: 0;
}

body.video-mode .video-creation-shell {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

body.video-mode .video-creation-header {
  display: none;
}

body.video-mode .video-creation-header h2 {
  font-size: 1rem;
  line-height: 1.18;
}

body.video-mode .video-creation-header .eyebrow {
  margin-bottom: 3px;
  font-size: 0.68rem;
}

body.video-mode .video-creation-header > span {
  max-width: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
  text-align: left;
}

body.video-mode .video-mobile-model-control {
  display: grid;
  gap: 6px;
  align-self: start;
  width: min(520px, 100%);
  min-width: 0;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

body.video-mode .video-mobile-model-control select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.84rem;
}

body.video-mode .video-task-toolbar {
  display: none;
}

.video-task-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto;
  width: min(1120px, 100%);
}

.video-creation-filter,
.video-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  background: var(--surface);
  box-shadow: 0 1px 2px oklch(0.32 0.02 168 / 0.05);
}

.video-creation-filter span {
  padding-left: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.video-creation-filter button,
.video-view-toggle button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 5px 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 780;
}

.video-creation-filter button,
.video-view-toggle button.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

body.video-mode .video-workflow-tabs {
  align-self: start;
  margin: 0 auto;
  width: min(520px, 100%);
  height: 46px;
}

body.video-mode .video-workflow-tabs button {
  align-content: center;
  min-height: 36px;
  font-size: 0.78rem;
  line-height: 1.12;
}

body.video-mode .video-creation-shell .video-studio-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(360px, 1fr) minmax(96px, 292px);
  gap: 12px;
  align-items: stretch;
  margin: 0 auto;
  width: min(1120px, 100%);
  height: 100%;
  min-height: 0;
}

body.video-mode .video-stage-preview {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  border: 1px solid oklch(0.78 0.018 168);
  border-radius: 30px;
  padding: 12px;
  background:
    linear-gradient(180deg, oklch(0.965 0.008 168), oklch(0.89 0.014 168));
  box-shadow:
    0 28px 70px oklch(0.22 0.022 168 / 0.15),
    inset 0 1px 0 oklch(1 0 0 / 0.7);
}

body.video-mode .video-stage-preview::before {
  opacity: 0.24;
  animation: videoTheaterGlowDrift 18s ease-out infinite alternate;
}

body.video-mode .video-stage-screen {
  min-height: 100%;
  border: 1px solid oklch(0.72 0.018 168);
  border-radius: 24px;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 50% 46%, oklch(0.97 0.006 168 / 0.8), oklch(0.9 0.01 168 / 0.58) 42%, oklch(0.77 0.014 168 / 0.26) 100%),
    linear-gradient(90deg, oklch(0.82 0.01 168 / 0.24) 1px, transparent 1px),
    linear-gradient(0deg, oklch(0.82 0.01 168 / 0.24) 1px, transparent 1px),
    oklch(0.954 0.006 168);
  background-size: auto, 44px 44px, 44px 44px, auto;
  box-shadow:
    inset 0 0 0 1px oklch(1 0 0 / 0.56),
    inset 0 -46px 90px oklch(0.3 0.02 168 / 0.07);
}

body.video-mode .video-stage-screen::before {
  opacity: 0.86;
}

body.video-mode .video-stage-screen::after {
  opacity: 0.58;
}

body.video-mode .video-stage-frame {
  background: transparent;
  border-color: transparent;
  border-radius: 18px;
  min-height: 0;
}

body.video-mode .video-stage-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  position: static;
  z-index: auto;
  margin: 10px 4px 0;
  border: 1px solid oklch(0.86 0.012 168 / 0.86);
  border-radius: 14px;
  padding: 8px 8px 8px 13px;
  background: oklch(0.995 0.004 168 / 0.94);
  box-shadow: 0 8px 18px oklch(0.28 0.025 168 / 0.07);
}

body.video-mode .video-stage-footer.has-stage-actions {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

body.video-mode .video-stage-footer > span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

body.video-mode .video-stage-footer .compact-action {
  min-height: 34px;
  padding: 6px 11px;
}

body.video-mode .video-composer-dock {
  z-index: 2;
  justify-self: center;
  align-self: end;
  width: min(1040px, 100%);
  margin: 0 auto;
  max-height: 292px;
  overflow: hidden;
  border: 1px solid oklch(0.74 0.022 168);
  border-radius: 26px;
  padding: 12px 14px;
  gap: 9px;
  background:
    linear-gradient(180deg, oklch(0.997 0.004 168), oklch(0.968 0.009 168));
  box-shadow:
    0 26px 60px oklch(0.22 0.023 168 / 0.16),
    inset 0 1px 0 oklch(1 0 0 / 0.82);
  transition:
    border-radius 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

body.video-mode .video-composer-dock.has-reference-picker {
  max-height: 292px;
  height: min(292px, 100%);
}

body.video-mode .video-composer-dock:not(.is-expanded):not(.has-reference-picker) {
  display: grid;
  grid-template-columns: auto minmax(300px, 1fr) auto auto;
  grid-template-areas: "mode prompt pills action";
  align-items: center;
  column-gap: 10px;
  min-height: 68px;
  max-height: 76px;
  border-radius: 999px;
  padding: 10px 10px 10px 16px;
}

body.video-mode .video-composer-dock.is-expanded {
  align-self: start;
  max-height: 292px;
}

body.video-mode .video-composer-topline {
  grid-template-columns: auto minmax(0, 1fr);
}

body.video-mode .video-composer-pills {
  justify-content: flex-end;
}

body.video-mode .video-reference-workbench {
  padding: 7px 9px;
}

body.video-mode .video-composer-dock:not(.is-expanded):not(.has-reference-picker) .video-reference-workbench,
body.video-mode .video-composer-dock:not(.is-expanded):not(.has-reference-picker) .video-frame-strip,
body.video-mode .video-composer-dock:not(.is-expanded):not(.has-reference-picker) .video-preset-grid {
  display: none;
}

body.video-mode .video-composer-dock.is-expanded {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  grid-template-areas:
    "top top"
    "ref prompt"
    "frames prompt"
    "picker prompt"
    "presets actions";
  grid-template-rows: auto 46px 70px minmax(0, 1fr) 38px;
  align-items: stretch;
  align-self: start;
  height: min(292px, 100%);
  min-height: 0;
  max-height: 292px;
  overflow: hidden;
  border-radius: 26px;
  padding: 12px 14px;
}

body.video-mode .video-composer-dock.is-expanded .video-composer-topline {
  grid-area: top;
}

body.video-mode .video-composer-dock.is-expanded .video-reference-workbench {
  grid-area: ref;
}

body.video-mode .video-composer-dock.is-expanded .video-frame-strip {
  grid-area: frames;
  min-height: 0;
}

body.video-mode .video-reference-asset-picker {
  position: relative;
  inset: auto;
  grid-area: picker;
  align-self: stretch;
  display: grid;
  gap: 8px;
  width: 100%;
  max-height: none;
  min-height: 0;
  border-color: oklch(0.82 0.018 168);
  border-radius: 18px;
  padding: 8px;
  overflow: hidden;
  box-shadow: none;
}

body.video-mode .video-reference-asset-picker[hidden] {
  display: none;
}

body.video-mode .video-reference-picker-head {
  align-items: center;
}

body.video-mode .video-reference-picker-head span {
  display: none;
}

body.video-mode .video-reference-picker-actions {
  gap: 6px;
}

body.video-mode .video-reference-picker-tab {
  min-height: 26px;
  padding: 4px 9px;
  font-size: 0.72rem;
}

body.video-mode .video-reference-picker-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow-y: auto;
}

body.video-mode .video-reference-asset {
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  padding: 6px;
}

body.video-mode .video-reference-asset img {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
}

body.video-mode .video-composer-dock.has-reference-picker {
  display: grid;
  grid-template-areas:
    "top top"
    "frames prompt"
    "picker prompt"
    "picker actions";
  grid-template-rows: auto 50px minmax(0, 1fr) 38px;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  align-items: stretch;
  align-self: start;
  height: min(292px, 100%);
  max-height: 292px;
  min-height: 0;
  border-radius: 26px;
  padding: 12px 14px;
}

body.video-mode .video-composer-dock.has-reference-picker .video-reference-asset-picker {
  min-height: 0;
}

body.video-mode .video-composer-dock.has-reference-picker .video-prompt-field {
  grid-area: prompt;
  min-height: 0;
}

body.video-mode .video-composer-dock.has-reference-picker #videoPromptInput {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  resize: none;
}

body.video-mode .video-composer-dock.has-reference-picker .video-prompt-field textarea {
  min-height: 0;
}

body.video-mode .video-composer-dock.has-reference-picker .video-prompt-actions {
  grid-area: actions;
}

body.video-mode .video-composer-dock.is-expanded .video-prompt-field {
  grid-area: prompt;
  min-height: 0;
}

body.video-mode .video-composer-dock.is-expanded .video-preset-grid {
  grid-area: presets;
  min-width: 0;
}

body.video-mode .video-composer-dock.is-expanded .video-prompt-actions {
  grid-area: actions;
}

body.video-mode .video-composer-dock.is-expanded .video-reference-workbench,
body.video-mode .video-composer-dock.is-expanded .video-frame-strip,
body.video-mode .video-composer-dock.is-expanded .video-preset-grid,
body.video-mode .video-composer-dock.is-expanded .video-reference-asset-picker:not([hidden]) {
  display: grid;
}

body.video-mode .video-composer-dock.has-reference-picker .video-reference-workbench,
body.video-mode .video-composer-dock.has-reference-picker .video-preset-grid {
  display: none;
}

body.video-mode .video-composer-dock:not(.is-expanded):not(.has-reference-picker) .video-composer-topline {
  display: contents;
}

body.video-mode .video-composer-dock:not(.is-expanded):not(.has-reference-picker) .video-composer-mode {
  grid-area: mode;
  justify-self: start;
}

body.video-mode .video-composer-dock:not(.is-expanded):not(.has-reference-picker) .video-prompt-field {
  grid-area: prompt;
  min-width: 0;
}

body.video-mode .video-composer-dock:not(.is-expanded):not(.has-reference-picker) .video-prompt-actions {
  grid-area: action;
  display: flex;
  justify-content: flex-end;
}

body.video-mode .video-composer-dock:not(.is-expanded):not(.has-reference-picker) .video-composer-pills {
  grid-area: pills;
  justify-content: flex-end;
  max-width: 340px;
}

body.video-mode .video-reference-workbench span {
  display: none;
}

body.video-mode .video-reference-workbench strong {
  margin: 0;
  font-size: 0.8rem;
}

body.video-mode .video-reference-workbench-actions button {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 0.74rem;
}

body.video-mode .video-frame-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

body.video-mode .video-frame-slot {
  min-height: 42px;
  border-style: solid;
  padding: 6px 8px;
  background: oklch(0.985 0.006 168);
}

body.video-mode .video-frame-slot small {
  display: none;
}

body.video-mode .video-actor-strip {
  display: none;
}

body.video-mode .video-actor-strip::-webkit-scrollbar {
  display: none;
}

body.video-mode .video-prompt-field {
  margin: 0;
}

body.video-mode .video-prompt-field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

body.video-mode #videoPromptInput {
  height: 64px;
  min-height: 64px;
  border: 0;
  border-radius: 18px;
  padding: 12px 13px;
  background: oklch(0.985 0.005 168);
  resize: vertical;
  box-shadow: inset 0 0 0 1px var(--border);
}

body.video-mode .video-composer-dock:not(.is-expanded):not(.has-reference-picker) #videoPromptInput {
  height: 42px;
  min-height: 42px;
  resize: none;
  border-radius: 999px;
  padding: 11px 13px;
  overflow: hidden;
}

body.video-mode .video-composer-dock.is-expanded #videoPromptInput {
  height: 100%;
  min-height: 0;
  resize: none;
  overflow-y: auto;
}

body.video-mode .video-composer-dock:not(.is-expanded):not(.has-reference-picker) #videoPromptInput::placeholder {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.video-mode #videoPromptInput:focus {
  box-shadow: inset 0 0 0 2px oklch(0.68 0.055 168);
}

body.video-mode .video-preset-grid {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

body.video-mode .video-preset-grid button {
  flex: 0 0 auto;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
}

body.video-mode .video-prompt-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

body.video-mode .video-prompt-actions span {
  display: none;
}

body.video-mode .video-generate-button {
  min-width: 132px;
  border-radius: 999px;
}

body.video-mode .video-result-section {
  margin-top: 84px;
}

.image-studio-controls,
.video-studio-controls {
  display: grid;
  gap: 14px;
}

.video-model-status {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.video-model-status[data-state="ready"] {
  border-color: oklch(0.78 0.045 162);
  background: oklch(0.965 0.02 162);
  color: var(--accent-dark);
}

.video-model-status[data-state="warning"] {
  border-color: oklch(0.82 0.04 76);
  background: oklch(0.968 0.024 76);
  color: oklch(0.42 0.07 76);
}

.image-setting-grid,
.video-setting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.image-setting-grid .studio-field:first-child,
.video-setting-grid .studio-field:first-child {
  grid-column: 1 / -1;
}

.image-studio-title span,
.video-studio-title span {
  text-align: right;
}

.image-mode-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 2px;
  width: min(100%, 460px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  background: var(--surface-2);
}

.image-mode-tabs button {
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-radius: calc(var(--radius) - 3px);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 760;
}

.image-mode-tabs button:hover,
.image-mode-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px oklch(0.3 0.02 168 / 0.08);
}

.image-mode-tabs button[aria-disabled="true"] {
  cursor: default;
  color: oklch(0.58 0.012 168);
}

.image-mode-tabs button[aria-disabled="true"]:hover {
  background: transparent;
  color: oklch(0.58 0.012 168);
  box-shadow: none;
}

.image-mode-tabs button span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.image-mode-unavailable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid oklch(0.84 0.018 168);
  border-radius: var(--radius);
  padding: 12px 13px;
  background: oklch(0.972 0.01 168);
}

.image-mode-unavailable[hidden] {
  display: none;
}

.image-mode-unavailable strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.image-mode-unavailable p {
  max-width: 58ch;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.image-generation-body {
  display: grid;
  gap: 14px;
}

.image-generation-body[aria-disabled="true"] {
  opacity: 0.58;
  pointer-events: none;
}

.image-reference-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-2);
}

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

.image-reference-header,
.image-reference-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-reference-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.image-prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
}

.image-prompt-actions span {
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.image-prompt-actions .image-generate-button {
  flex: 0 0 auto;
  min-width: 142px;
  min-height: 42px;
  border-radius: 999px;
}

.video-prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
}

.video-prompt-actions span {
  max-width: 58ch;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.video-prompt-actions .video-generate-button {
  flex: 0 0 auto;
  min-width: 142px;
  min-height: 42px;
  border-radius: 999px;
}

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

.video-reference-grid article {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
}

.video-reference-grid strong,
.video-reference-grid span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-reference-grid strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.video-reference-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.image-reference-source-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(360px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.image-reference-source-card,
.image-reference-slot,
.image-inpaint-controls {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface);
}

.image-reference-source-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 12px;
}

.image-reference-source-card strong,
.image-reference-source-card span,
.image-reference-slot-heading strong,
.image-reference-slot-heading span {
  display: block;
}

.image-reference-source-card strong,
.image-reference-slot-heading strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.image-reference-source-card span,
.image-reference-slot-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.image-reference-upload-card {
  align-content: space-between;
}

.image-reference-upload-card .secondary-button {
  justify-self: start;
}

.image-reference-library-panel {
  gap: 10px;
}

.image-reference-workflow-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1fr);
  gap: 12px;
  align-items: start;
}

.image-reference-slot {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.image-inpaint-controls {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.image-inpaint-controls[hidden] {
  display: none;
}

.image-inpaint-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.image-inpaint-heading strong,
.image-inpaint-heading span {
  display: block;
}

.image-inpaint-heading strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.image-inpaint-heading span,
.image-inpaint-editor p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.image-inpaint-editor {
  display: grid;
  gap: 8px;
}

.image-inpaint-editor[hidden] {
  display: none;
}

.image-inpaint-canvas {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  max-height: min(46vh, 430px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background:
    linear-gradient(45deg, oklch(0.93 0.006 168) 25%, transparent 25%),
    linear-gradient(-45deg, oklch(0.93 0.006 168) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, oklch(0.93 0.006 168) 75%),
    linear-gradient(-45deg, transparent 75%, oklch(0.93 0.006 168) 75%),
    var(--surface);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.image-inpaint-canvas[data-empty="true"] {
  min-height: 132px;
  cursor: default;
}

.image-inpaint-canvas[data-empty="true"]::before {
  content: "先选择或上传一张原图";
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
}

.image-inpaint-canvas img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(46vh, 430px);
  object-fit: contain;
  pointer-events: none;
}

.image-inpaint-canvas[data-empty="true"] img {
  display: none;
}

.image-inpaint-selection {
  position: absolute;
  border: 2px solid oklch(0.62 0.13 162);
  border-radius: 6px;
  background: oklch(0.68 0.12 162 / 0.18);
  box-shadow:
    0 0 0 999px oklch(0.18 0.018 168 / 0.36),
    0 8px 26px oklch(0.2 0.02 168 / 0.24);
  pointer-events: none;
}

.image-reference-header strong,
.image-reference-preview strong,
.image-reference-header span,
.image-reference-preview span {
  display: block;
}

.image-reference-header strong,
.image-reference-preview strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.image-reference-header span,
.image-reference-preview span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.image-reference-preview {
  justify-content: flex-start;
  min-height: 72px;
  border: 1px dashed oklch(0.8 0.018 168);
  border-radius: calc(var(--radius) - 2px);
  padding: 8px;
  background: var(--surface);
}

.image-reference-preview img {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: calc(var(--radius) - 3px);
  object-fit: cover;
  background: var(--panel);
}

.image-reference-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.image-reference-asset {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 7px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.image-reference-asset:hover,
.image-reference-asset.selected {
  border-color: oklch(0.62 0.095 162);
  box-shadow: 0 0 0 2px oklch(0.7 0.08 162 / 0.16);
}

.image-reference-asset img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: calc(var(--radius) - 4px);
  object-fit: cover;
  background: var(--panel);
}

.image-reference-asset span,
.image-reference-asset small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-reference-asset span {
  font-size: 0.78rem;
  font-weight: 760;
}

.image-reference-asset small {
  color: var(--muted);
  font-size: 0.7rem;
}

.image-prompt-field textarea {
  min-height: 210px;
  resize: vertical;
}

.video-prompt-field textarea {
  min-height: 230px;
  resize: vertical;
}

.image-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-quick-prompts button {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 11px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.image-quick-prompts button:hover {
  border-color: oklch(0.74 0.06 142);
  color: var(--ink);
}

.image-control-group {
  display: grid;
  gap: 8px;
}

.image-control-group > span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
}

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

.image-aspect-option {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 760;
}

.image-aspect-option:hover,
.image-aspect-option.active {
  border-color: oklch(0.74 0.06 142);
  background: var(--accent-soft);
  color: var(--ink);
}

.image-cost-estimate {
  display: flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid oklch(0.84 0.018 168);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: oklch(0.965 0.014 162);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 760;
}

.image-advanced-drawer {
  border-top: 1px solid var(--border);
  padding-top: 2px;
}

.image-advanced-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  cursor: pointer;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 760;
}

.image-advanced-drawer summary small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.image-advanced-body {
  display: grid;
  gap: 12px;
  padding-top: 10px;
}

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

.image-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.image-advanced-workflow-card {
  display: grid;
  gap: 13px;
  margin-top: 12px;
  border: 1px solid oklch(0.86 0.012 168);
  border-radius: var(--radius);
  padding: 15px 18px 16px;
  background: oklch(0.992 0.004 168);
  box-shadow: var(--shadow-sm);
}

.image-advanced-workflow-heading {
  align-items: start;
  gap: 12px;
}

.image-advanced-workflow-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 840;
}

.image-advanced-workflow-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.advanced-workflow-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 372px));
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}

.advanced-workflow-capsule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 60px;
  border: 1px solid oklch(0.82 0.016 168);
  border-radius: 11px;
  padding: 10px 12px;
  background: oklch(0.978 0.007 168);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.advanced-workflow-capsule-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid oklch(0.78 0.026 158);
  border-radius: 9px;
  background: oklch(0.94 0.026 158);
  color: oklch(0.34 0.07 158);
  font-size: 0.78rem;
  font-weight: 860;
  line-height: 1;
}

.advanced-workflow-capsule:hover,
.advanced-workflow-capsule.active {
  border-color: oklch(0.69 0.058 158);
  background: oklch(0.968 0.014 162);
  box-shadow: 0 8px 18px oklch(0.42 0.035 168 / 0.06);
}

.advanced-workflow-capsule.active .advanced-workflow-capsule-icon {
  border-color: oklch(0.62 0.09 158);
  background: oklch(0.9 0.036 158);
}

.advanced-workflow-capsule-text {
  display: grid;
  gap: 4px;
  align-content: center;
  min-width: 0;
}

.advanced-workflow-capsule-text strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 840;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advanced-workflow-capsule-text span,
.advanced-workflow-empty span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.advanced-workflow-capsule-state {
  display: inline-flex;
  align-self: center;
  justify-self: end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.advanced-workflow-capsule-hint {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid oklch(0.83 0.018 168);
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface);
  color: oklch(0.42 0.06 158);
  font-size: 0.68rem;
  font-weight: 780;
  line-height: 1;
  white-space: nowrap;
}

.advanced-workflow-capsule-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid oklch(0.48 0.042 158);
  border-bottom: 2px solid oklch(0.48 0.042 158);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 160ms ease;
}

.advanced-workflow-capsule[aria-expanded="true"] .advanced-workflow-capsule-chevron {
  transform: rotate(225deg) translateY(-1px);
}

.advanced-workflow-empty,
.advanced-workflow-panel {
  min-width: 0;
  border-top: 1px solid oklch(0.88 0.01 168);
  padding-top: 14px;
}

.advanced-workflow-empty {
  display: grid;
  gap: 4px;
  padding-bottom: 2px;
}

.advanced-workflow-empty[hidden],
.advanced-workflow-panel[hidden] {
  display: none;
}

.advanced-workflow-empty strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 820;
}

.advanced-workflow-panel {
  display: grid;
  gap: 14px;
}

.clothing-workflow-shell {
  display: grid;
  gap: 13px;
  min-width: 0;
}

.clothing-workflow-intro,
.clothing-workflow-footer,
.clothing-workflow-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.clothing-workflow-intro strong {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 840;
}

.clothing-workflow-upload > div,
.clothing-workflow-library > div,
.clothing-workflow-selected-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.clothing-workflow-intro p,
.clothing-workflow-selected span,
.clothing-workflow-footer span,
.clothing-workflow-upload span,
.clothing-workflow-library span {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.clothing-workflow-source-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.clothing-workflow-upload,
.clothing-workflow-library {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  border: 1px solid oklch(0.84 0.014 168);
  border-radius: var(--radius);
  padding: 14px;
  background: oklch(0.976 0.006 168);
}

.clothing-workflow-upload strong,
.clothing-workflow-library strong,
.clothing-workflow-selected strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.clothing-workflow-selected {
  justify-content: flex-start;
  border: 1px solid oklch(0.84 0.018 168);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: oklch(0.982 0.006 168);
}

.clothing-workflow-selected img {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
}

.clothing-workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.clothing-workflow-field-grid .studio-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(42px, auto);
  gap: 7px;
  min-width: 0;
}

.clothing-workflow-field-grid .studio-field > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.2;
}

.clothing-workflow-field-grid select {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.clothing-workflow-extra textarea {
  min-height: 86px;
}

.clothing-workflow-asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 188px;
  overflow-y: auto;
}

.clothing-workflow-asset {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 4px 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.clothing-workflow-asset:hover,
.clothing-workflow-asset.selected {
  border-color: oklch(0.72 0.07 150);
  background: var(--accent-soft);
}

.clothing-workflow-asset img {
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.clothing-workflow-asset span,
.clothing-workflow-asset small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clothing-workflow-asset span {
  font-size: 0.78rem;
  font-weight: 760;
}

.clothing-workflow-asset small {
  color: var(--muted);
  font-size: 0.68rem;
}

.clothing-workflow-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.clothing-workflow-stages li {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
}

.clothing-workflow-stages li[data-status="active"] {
  border-color: oklch(0.72 0.07 150);
  background: var(--accent-soft);
  color: var(--ink);
}

.clothing-workflow-stages li[data-status="done"] {
  border-color: oklch(0.74 0.07 150);
  background: oklch(0.94 0.03 154);
  color: oklch(0.34 0.07 154);
}

.clothing-workflow-result {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  border: 1px solid oklch(0.82 0.02 168);
  border-radius: var(--radius);
  padding: 10px;
  background: oklch(0.982 0.008 168);
}

.clothing-workflow-result[hidden] {
  display: none;
}

.clothing-workflow-result img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: var(--panel);
  object-fit: cover;
}

.clothing-workflow-result strong {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 840;
}

.clothing-workflow-result span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.clothing-workflow-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.image-result-section,
.video-result-section {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.image-gallery-toolbar,
.video-gallery-toolbar {
  align-items: center;
  gap: 10px;
}

.image-gallery-toolbar > div:first-child,
.video-gallery-toolbar > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.image-gallery-filter {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: var(--panel);
}

.image-gallery-filter button {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 730;
  white-space: nowrap;
}

.image-gallery-filter button:hover,
.image-gallery-filter button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.image-result-grid,
.video-result-grid {
  display: grid;
  gap: 12px;
}

.image-result-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  min-height: 120px;
  align-content: center;
  justify-items: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.image-result-empty strong {
  color: var(--ink);
}

.image-result-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--surface-2);
}

.video-result-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.58fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-2);
}

.video-result-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: oklch(0.24 0.012 168);
  object-fit: contain;
}

.video-result-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.image-creation-record {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(260px, 1fr);
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
}

.image-record-prompt {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
  border-right: 1px solid var(--border);
  padding-right: 12px;
}

.image-record-prompt span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.image-record-prompt p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.52;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
}

.image-output-panel {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.image-result-preview-button,
.image-result-actions,
.image-result-title,
.image-result-meta {
  width: 100%;
  min-width: 0;
}

.video-result-preview-button,
.video-result-actions {
  width: 100%;
  min-width: 0;
}

.image-result-preview-button,
.video-result-preview-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: var(--panel);
  cursor: zoom-in;
  overflow: hidden;
}

.image-result-preview-button:hover img,
.video-result-preview-button:hover video {
  transform: scale(1.025);
}

.image-result-preview-button img,
.video-result-preview-button video,
.image-result-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--panel);
  transition: transform 180ms ease-out;
}

.video-result-preview-button video {
  aspect-ratio: 16 / 9;
}

.video-result-preview-button span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-radius: 999px;
  padding: 4px 8px;
  background: oklch(0.995 0.004 168 / 0.9);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 780;
  box-shadow: 0 8px 18px oklch(0.22 0.022 168 / 0.14);
}

.video-result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.image-output-panel .image-result-preview-button img {
  max-height: 360px;
}

.image-result-card strong,
.image-result-card span,
.video-result-card strong,
.video-result-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-result-card strong,
.video-result-card strong {
  font-size: 0.86rem;
}

.image-result-card span,
.video-result-card span {
  color: var(--muted);
  font-size: 0.74rem;
}

.image-result-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-top: 1px;
}

.image-result-meta p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.image-result-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.image-result-actions .compact-action {
  min-width: 0;
  min-height: 34px;
  padding-right: 6px;
  padding-left: 6px;
  font-size: 0.78rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-result-actions .danger-action {
  grid-column: auto;
}

.image-task-list,
.video-task-list {
  display: grid;
  gap: 8px;
}

.video-task-empty {
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: oklch(0.982 0.007 168);
  text-align: center;
}

.video-task-empty strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.video-task-empty span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.image-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
}

.image-task-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.image-task-row strong,
.image-task-row small,
.image-task-row p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-task-row small,
.image-task-row p {
  color: var(--muted);
  font-size: 0.76rem;
}

.image-task-status {
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.image-task-status[data-status="succeeded"] {
  border-color: oklch(0.78 0.08 162);
  color: var(--accent);
}

.image-task-status[data-status="failed"] {
  border-color: oklch(0.82 0.09 28);
  color: var(--danger);
}

.image-task-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, auto));
  gap: 6px;
}

.image-preview-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-preview-dialog[hidden] {
  display: none !important;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.2 0.018 168 / 0.62);
}

.image-preview-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(980px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  border: 1px solid oklch(0.82 0.014 168);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: 0 24px 80px oklch(0.16 0.02 168 / 0.28);
}

.image-preview-header,
.image-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.image-preview-header h2 {
  overflow: hidden;
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-canvas {
  display: grid;
  place-items: center;
  min-height: 260px;
  overflow: auto;
  border-radius: var(--radius);
  background: oklch(0.935 0.008 168);
}

.image-preview-canvas img {
  display: block;
  max-width: 100%;
  max-height: min(68vh, 680px);
  border-radius: 6px;
  object-fit: contain;
}

.video-preview-player {
  display: block;
  width: 100%;
  max-height: min(68vh, 680px);
  border-radius: 6px;
  background: oklch(0.13 0.01 168);
}

.image-preview-footer p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.image-preview-open {
  overflow: hidden;
}

.business-resource-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.resource-content-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  align-items: start;
  gap: 16px;
}

.resource-content-column {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.business-lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 86px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.business-lane-primary {
  background: oklch(0.966 0.016 168);
}

.business-lane span,
.studio-summary-strip span,
.studio-preview-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.business-lane strong,
.business-lane small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.business-lane strong {
  margin-top: 4px;
  font-size: 0.94rem;
}

.business-lane small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.resource-main-column > .studio-section:first-child,
.resource-side-column > .studio-section:first-child {
  min-height: 260px;
}

.member-account-facts,
.member-benefit-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.member-account-facts article,
.member-benefit-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px;
  background: oklch(0.99 0.005 168);
}

.member-account-facts span,
.member-benefit-item span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
}

.member-account-facts strong,
.member-benefit-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.member-benefit-item small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.member-empty-state {
  display: grid;
  gap: 5px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
}

.member-empty-state span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.workspace-home {
  grid-template-rows: auto minmax(0, 1fr);
}

.workspace-recommendations {
  display: grid;
  gap: 14px;
}

.mobile-empty-start,
.mobile-case-grid {
  display: none;
}

.workspace-focus-panel {
  display: grid;
  gap: 14px;
  min-height: 0;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  padding: 6px 0 14px;
}

.home-capability-matrix {
  display: grid;
  gap: 10px;
}

.home-capability-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.home-capability-header span {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 780;
}

.home-capability-header small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.home-capability-entry {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 86px;
  align-content: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: background 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out;
}

.home-capability-entry:hover,
.home-capability-entry:focus-visible {
  border-color: oklch(0.74 0.06 142);
  background: oklch(0.968 0.018 162);
  transform: translateY(-1px);
}

.home-capability-entry:focus-visible {
  outline: 2px solid oklch(0.7 0.11 162 / 0.5);
  outline-offset: 2px;
}

.home-capability-entry span,
.home-capability-entry small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-capability-entry span {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 760;
}

.home-capability-entry strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-capability-entry small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.support-lane {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 62px;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: background 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out;
}

.support-lane:hover {
  border-color: oklch(0.74 0.06 142);
  background: oklch(0.968 0.018 162);
  transform: translateY(-1px);
}

.support-lane strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.workspace-examples-panel,
.studio-drawer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.studio-drawer summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 9px 13px;
  cursor: pointer;
  list-style: none;
}

.studio-drawer summary::-webkit-details-marker {
  display: none;
}

.studio-drawer summary::after {
  content: "+";
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 720;
}

.studio-drawer[open] summary::after {
  content: "−";
}

.studio-drawer summary > span {
  min-width: 0;
  font-weight: 740;
}

.studio-drawer summary small {
  grid-column: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-drawer-body {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding: 10px 12px 12px;
}

.workspace-examples-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px 10px;
}

.workspace-examples-header > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workspace-examples-header h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.workspace-examples-header small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.workspace-examples-body {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding: 12px 14px 14px;
}

.recommendation-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.recommendation-column {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.workspace-home .case-grid,
.workspace-home .prompt-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-home .case-card,
.workspace-home .prompt-card {
  align-content: start;
  min-height: 106px;
}

.workspace-home .case-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.workspace-home .case-card > div:first-child,
.workspace-home .prompt-card > div:first-child {
  grid-column: 1 / -1;
}

.workspace-home .case-card .card-meta {
  align-self: end;
}

.workspace-home .prompt-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
}

.workspace-home .prompt-card .mini-label,
.workspace-home .prompt-card p {
  display: none;
}

.workspace-home .prompt-card strong {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-home .prompt-card .secondary-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.78rem;
}

.workspace-home .case-card p,
.workspace-home .prompt-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.feature-banner article {
  min-height: 84px;
}

.discovery-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.discovery-toolbar {
  display: grid;
  gap: 10px;
}

.discovery-toolbar input[type="search"] {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-tab {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 680;
}

.category-tab:hover,
.category-tab.active {
  border-color: oklch(0.74 0.06 142);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.discovery-banner article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 96px;
  border: 1px solid oklch(0.8 0.036 142);
  border-radius: var(--radius);
  padding: 16px;
  background: oklch(0.94 0.035 142);
}

.discovery-banner span,
.mini-label {
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 760;
}

.discovery-banner strong,
.case-card strong,
.prompt-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
  line-height: 1.35;
}

.discovery-banner p,
.case-card p,
.prompt-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.template-card-spec {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.template-card-spec span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  color: oklch(0.36 0.045 245);
  background: oklch(0.96 0.018 245);
  font-size: 0.72rem;
  font-weight: 720;
  line-height: 1.15;
}

.discovery-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.discovery-columns > section {
  display: grid;
  gap: 10px;
}

.content-center {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.content-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.content-row,
.content-empty {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.content-row strong,
.content-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-row strong {
  margin-bottom: 4px;
  font-size: 0.86rem;
}

.content-row span,
.content-empty {
  color: var(--muted);
  font-size: 0.76rem;
}

.case-grid,
.prompt-grid {
  display: grid;
  gap: 10px;
}

.case-card,
.prompt-card {
  display: grid;
  gap: 12px;
  min-height: 132px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.case-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.case-card > div:first-child {
  align-self: start;
  grid-column: 1 / -1;
}

.case-card .secondary-button,
.prompt-card .secondary-button {
  min-height: 34px;
  padding: 6px 10px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.workspace-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 22px;
  border: 1px solid oklch(0.82 0.08 162);
  border-radius: 999px;
  padding: 2px 8px;
  color: oklch(0.34 0.09 162);
  background: oklch(0.96 0.035 162);
  font-size: 0.74rem;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.prompt-card {
  min-height: 124px;
}

.discovery-empty {
  min-height: 94px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.market-note {
  min-height: 94px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  color: var(--muted);
  line-height: 1.6;
}

.asset-section {
  gap: 10px;
}

.asset-upload-button {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px dashed oklch(0.74 0.06 142);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 740;
}

.asset-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.asset-list {
  display: grid;
  gap: 8px;
}

.asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
}

.asset-row[data-asset-source="generation"] {
  border-color: oklch(0.80 0.04 162);
  background:
    linear-gradient(180deg, oklch(0.986 0.008 162), oklch(0.966 0.012 162));
}

.asset-row-highlight {
  border-color: oklch(0.68 0.14 162) !important;
  box-shadow: 0 0 0 3px oklch(0.86 0.08 162 / 0.34);
}

.asset-row-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.asset-row strong,
.asset-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-row strong {
  margin-bottom: 3px;
  font-size: 0.88rem;
}

.asset-row-title strong {
  margin-bottom: 0;
}

.asset-kind-pill {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--surface);
  color: var(--accent-dark);
  font-size: 0.7rem;
  font-weight: 760;
}

.asset-row span,
.asset-empty {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.asset-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.asset-actions .secondary-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.76rem;
}

.asset-generated-actions {
  padding-top: 8px;
  border-top: 1px solid oklch(0.86 0.012 168);
}

.asset-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.personal-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.personal-stats article {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.personal-stats span {
  color: var(--muted);
  font-size: 0.74rem;
}

.personal-stats strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.94rem;
}

.password-change-form {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.password-change-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.password-change-heading strong {
  font-size: 0.9rem;
}

.password-change-heading span,
.inline-action-status {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

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

.studio-field.stacked {
  grid-template-columns: 1fr;
}

.studio-field.stacked input:not([type="range"]),
.studio-field.stacked select {
  grid-column: 1 / -1;
}

.password-change-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inline-action-status {
  min-width: 0;
}

.inline-action-status[data-status-tone="working"] {
  color: var(--accent-dark);
}

.inline-action-status[data-status-tone="success"] {
  color: var(--accent-dark);
}

.inline-action-status[data-status-tone="error"] {
  color: var(--danger);
}

.asset-overview {
  display: grid;
  gap: 12px;
}

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

.asset-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--bg);
}

.asset-stat span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.asset-stat strong {
  font-size: 1.12rem;
}

.asset-user-list {
  display: grid;
  gap: 8px;
}

.order-section {
  gap: 12px;
}

.order-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.order-list {
  display: grid;
  gap: 8px;
}

.order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
}

.order-status-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.order-pay-button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 0.78rem;
}

.order-row strong,
.order-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-row strong {
  margin-bottom: 3px;
  font-size: 0.88rem;
}

.order-row span,
.order-empty {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.order-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.referral-section {
  gap: 12px;
}

.referral-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.referral-code-box span {
  color: var(--muted);
  font-size: 0.78rem;
}

.referral-code-box strong {
  font-size: 0.95rem;
  letter-spacing: 0;
}

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

.support-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
  gap: 12px;
  align-items: start;
}

.support-side-panel {
  position: sticky;
  top: 12px;
}

.support-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.support-facts div {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.support-facts div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.support-facts dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.support-facts dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.referral-form {
  display: grid;
  gap: 8px;
}

.distribution-settings,
.distribution-totals {
  margin-top: 12px;
}

.distribution-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.distribution-subhead strong {
  font-size: 0.9rem;
}

.distribution-settings-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.distribution-settings-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.distribution-settings-grid input[type="number"] {
  width: 132px;
  min-height: 34px;
}

.toggle-line {
  grid-auto-flow: column;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  background: var(--bg);
  color: var(--ink);
}

.toggle-line input {
  accent-color: var(--accent);
}

.messages {
  display: grid;
  gap: 18px;
  width: var(--chat-track);
  margin: 0 auto;
}

.message {
  display: grid;
  gap: 7px;
}

.message.streaming .message-bubble {
  border-color: oklch(0.76 0.055 162);
  background: oklch(0.975 0.014 168);
}

.message.error .message-bubble {
  border-color: oklch(0.78 0.075 28);
  background: oklch(0.972 0.012 28);
}

.message.user {
  justify-items: end;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  width: fit-content;
  max-width: min(760px, 100%);
}

.message.user .message-meta {
  justify-content: flex-end;
  justify-self: end;
  text-align: right;
}

.message-meta small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.message-bubble {
  width: fit-content;
  max-width: min(760px, 100%);
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  line-height: 1.7;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}

.message-bubble.markdown-body {
  white-space: normal;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre,
.markdown-body table {
  margin: 0 0 0.8rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 0.95rem 0 0.45rem;
  color: var(--ink);
  line-height: 1.32;
  letter-spacing: 0;
}

.markdown-body h1 {
  font-size: 1.12rem;
}

.markdown-body h2 {
  font-size: 1.03rem;
}

.markdown-body h3 {
  font-size: 0.96rem;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.25rem;
}

.markdown-body li + li {
  margin-top: 0.28rem;
}

.markdown-body code {
  padding: 0.1rem 0.32rem;
  border-radius: 6px;
  background: oklch(0.93 0.008 168);
  color: oklch(0.31 0.04 168);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.markdown-body pre {
  overflow: auto;
  padding: 12px;
  border: 1px solid oklch(0.84 0.012 168);
  border-radius: 8px;
  background: oklch(0.965 0.006 168);
}

.markdown-body pre code {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
  white-space: pre;
}

.markdown-body blockquote {
  padding: 0.05rem 0 0.05rem 0.75rem;
  border-left: 1px solid oklch(0.72 0.035 162);
  color: var(--muted);
}

.markdown-body a {
  color: oklch(0.43 0.105 162);
  font-weight: 650;
}

.markdown-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.markdown-body th,
.markdown-body td {
  padding: 7px 9px;
  border: 1px solid var(--border);
  text-align: left;
}

.markdown-body th {
  background: oklch(0.95 0.01 168);
  font-weight: 750;
}

.message-bubble .katex {
  color: var(--ink);
  font-size: 1.02em;
}

.message-bubble .katex-display {
  max-width: 100%;
  margin: 0.7rem 0 0.9rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15rem 0;
}

.message-bubble .katex-display > .katex {
  white-space: nowrap;
}

.message.user .message-bubble {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.message-error-actions {
  display: flex;
  justify-content: flex-start;
  width: min(760px, 100%);
}

.message:last-child {
  scroll-margin-bottom: 24px;
}

.studio-composer {
  width: var(--chat-track);
  margin: 0 auto 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.floating-composer {
  position: fixed;
  left: calc(224px + 34px);
  right: calc(310px + 34px);
  bottom: 22px;
  z-index: 20;
  width: auto;
  margin: 0;
  border-color: oklch(0.78 0.03 168);
}

body.conversation-mode .floating-composer {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  width: var(--chat-track);
  margin: 0 auto 18px;
  box-shadow: var(--shadow-sm);
}

.floating-composer .model-switcher {
  grid-template-columns: auto minmax(220px, 320px) 1fr;
  padding-bottom: 8px;
}

.floating-composer textarea {
  min-height: 48px;
  max-height: 96px;
}

.floating-composer .composer-footer {
  padding-top: 4px;
}

.floating-composer-anchor {
  position: absolute;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.model-switcher {
  display: grid;
  grid-template-columns: auto minmax(180px, 320px) 1fr;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 10px;
  border-bottom: 1px solid var(--border);
}

.model-switcher label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 680;
}

select,
input[type="number"] {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  background: var(--surface-2);
  color: var(--ink);
}

.studio-field input:not([type="range"]) {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  background: var(--surface-2);
  color: var(--ink);
}

textarea {
  resize: vertical;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.55;
}

.studio-composer textarea {
  min-height: 112px;
  border-color: transparent;
  background: transparent;
  font-size: 1rem;
}

.studio-composer textarea:focus-visible {
  outline-offset: 4px;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 0;
}

.composer-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.composer-flow-row {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.composer-flow-row p,
.composer-flow-row span,
.composer-flow-row strong {
  min-width: 0;
}

.composer-flow-row span {
  display: inline-flex;
  align-items: center;
  max-width: 230px;
}

.composer-flow-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button-row,
.header-actions,
.sidebar-actions {
  display: flex;
  gap: 8px;
}

.composer-footer .button-row {
  flex: 0 0 auto;
}

.primary-button,
.secondary-button,
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: var(--radius);
  padding: 8px 13px;
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out, transform 160ms ease-out;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: oklch(0.99 0.006 142);
  font-weight: 740;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.secondary-button,
.nav-link {
  background: var(--surface);
  color: var(--ink);
}

.secondary-button:hover,
.nav-link:hover,
.nav-link.current {
  border-color: var(--accent);
}

.selected-action {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.danger-action {
  color: var(--danger);
}

.danger-action:hover {
  border-color: oklch(0.72 0.09 30);
  background: oklch(0.97 0.018 30);
}

.studio-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 100vh;
  overflow: auto;
  padding: 22px 18px;
  border-left: 1px solid var(--border);
  background: oklch(0.955 0.01 168 / 0.96);
}

.studio-mode-panel {
  display: grid;
  gap: 14px;
}

[data-studio-panel][hidden] {
  display: none !important;
}

body.image-mode [data-studio-panel="chat"],
body:not(.image-mode) [data-studio-panel="image"] {
  display: none !important;
}

.studio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
}

.studio-header h2,
.section-heading h3,
.admin-header h1 {
  margin: 0;
}

.studio-header h2 {
  font-size: 1.16rem;
}

.studio-summary-strip {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.studio-summary-strip div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.studio-summary-strip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
}

.status-badge {
  flex: 0 0 auto;
  border: 1px solid oklch(0.78 0.065 78);
  border-radius: 999px;
  padding: 5px 9px;
  background: oklch(0.93 0.035 78);
  color: oklch(0.42 0.08 78);
  font-size: 0.76rem;
  font-weight: 700;
}

.status-badge.live {
  border-color: oklch(0.74 0.06 142);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-badge.pending {
  border-color: oklch(0.78 0.065 78);
  background: oklch(0.93 0.035 78);
  color: oklch(0.42 0.08 78);
}

.status-badge.approved {
  border-color: oklch(0.74 0.06 142);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-badge.rejected,
.danger-button {
  border-color: oklch(0.72 0.08 28);
  color: oklch(0.48 0.13 28);
}

.status-badge.rejected {
  background: oklch(0.94 0.035 28);
}

.status-badge.neutral {
  border-color: var(--border);
  background: var(--panel);
  color: var(--muted);
}

.compact-model.disabled,
select option:disabled {
  opacity: 0.55;
}

.studio-section,
.admin-panel,
.kpi-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.studio-section {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.generation-control-section {
  gap: 12px;
}

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

.section-heading h2,
.section-heading h3 {
  font-size: 0.92rem;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.78rem;
}

.studio-preset-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  background: var(--surface-2);
}

.studio-preset-tab {
  min-width: 0;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 720;
}

.studio-preset-tab:hover,
.studio-preset-tab.active {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.studio-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.studio-field input[type="range"],
.studio-field textarea,
.studio-field input[type="number"] {
  grid-column: 1 / -1;
}

.studio-field span {
  font-weight: 650;
}

.studio-field output {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

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

.studio-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.studio-preview-grid article {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 54px;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px;
  background: var(--bg);
}

.studio-preview-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.model-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.studio-drawer > .model-facts {
  border-top: 1px solid var(--border);
  padding: 12px;
}

.model-facts div {
  display: grid;
  gap: 3px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}

.model-facts div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.model-facts dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.model-facts dd {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.status-dot.demo,
.status-dot.pending {
  background: var(--warning);
}

.admin-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 40px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.admin-action-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  max-width: 220px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-action-status.working {
  color: var(--accent-dark);
}

.admin-action-status.success {
  border-color: oklch(0.78 0.07 162);
  background: oklch(0.966 0.016 168);
  color: var(--accent-dark);
}

.admin-action-status.error {
  border-color: oklch(0.78 0.08 28);
  background: oklch(0.97 0.018 28);
  color: var(--danger);
}

.admin-header p,
.config-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.admin-section-nav {
  padding: 0 0 18px;
}

.admin-section {
  display: grid;
  gap: 14px;
}

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

.kpi-card {
  padding: 16px;
}

.kpi-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.kpi-card strong {
  font-size: 1.45rem;
  line-height: 1;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.admin-panel {
  padding: 16px;
}

.admin-filter-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.45fr) auto;
  align-items: end;
  gap: 8px;
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel);
}

.admin-filter-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.admin-filter-toolbar label span,
.filter-summary {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-filter-toolbar input,
.admin-filter-toolbar select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
}

.admin-filter-toolbar input:focus,
.admin-filter-toolbar select:focus {
  border-color: var(--accent);
  outline: 2px solid oklch(0.82 0.09 162 / 0.32);
  outline-offset: 1px;
}

.filter-summary {
  align-self: center;
  justify-self: end;
  white-space: nowrap;
}

.admin-row[hidden],
.recent-row[hidden] {
  display: none;
}

.admin-filter-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: oklch(0.982 0.006 168);
}

.admin-filter-empty[hidden] {
  display: none;
}

.admin-filter-empty div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-filter-empty strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.admin-filter-empty span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-section-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.section-summary-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 76px;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-summary-metric span,
.section-summary-metric small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-summary-metric span {
  font-weight: 740;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-summary-metric strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-summary-metric.good strong {
  color: var(--accent-dark);
}

.section-summary-metric.warn strong {
  color: oklch(0.53 0.12 52);
}

.reports-panel {
  display: grid;
  gap: 14px;
}

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

.ops-command-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.ops-lane-list {
  display: grid;
  gap: 7px;
}

.ops-lane {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(70px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 9px;
  background: var(--bg);
}

.ops-lane span,
.ops-lane small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-lane strong {
  color: var(--ink);
  font-size: 0.88rem;
  text-align: right;
  white-space: nowrap;
}

.ops-lane.good strong {
  color: var(--accent-dark);
}

.ops-lane.warn strong {
  color: oklch(0.53 0.12 52);
}

.security-panel,
.security-overview {
  display: grid;
  gap: 12px;
}

.security-stat-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.security-config-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  gap: 10px;
}

.security-config-block {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.security-key-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.security-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.78rem;
}

.audit-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.audit-row .row-meta:last-child {
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

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

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(230px, 0.7fr) minmax(230px, 0.7fr);
  gap: 12px;
}

.report-block {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.report-trends {
  display: grid;
  gap: 8px;
}

.report-trend-row {
  display: grid;
  grid-template-columns: 88px minmax(90px, 1fr) 42px minmax(132px, auto);
  align-items: center;
  gap: 9px;
  min-height: 34px;
  color: var(--muted);
  font-size: 0.8rem;
}

.report-trend-row strong {
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-trend-row em {
  font-style: normal;
  text-align: right;
  white-space: nowrap;
}

.report-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel);
}

.report-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.report-rank-row {
  background: var(--surface);
}

.traffic-panel {
  display: grid;
  gap: 12px;
}

.traffic-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.traffic-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.traffic-grid input[type="number"] {
  width: 100%;
}

.traffic-grid .toggle-line {
  align-items: center;
  align-self: center;
  min-height: 34px;
}

.storage-settings {
  margin-top: 10px;
}

.storage-settings-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 10px;
}

.storage-settings-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.storage-settings-grid input,
.storage-settings-grid select {
  width: 100%;
}

.storage-provider-rows {
  margin-bottom: 10px;
}

.admin-list {
  display: grid;
  border-top: 1px solid var(--border);
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  min-height: 58px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.admin-row strong {
  display: block;
  margin-bottom: 4px;
}

.admin-row.empty-row {
  grid-template-columns: 1fr;
}

.editable-row {
  align-items: start;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.admin-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}

.admin-controls label span {
  line-height: 1;
}

.admin-controls input,
.admin-controls select {
  width: 118px;
  min-height: 34px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
  white-space: nowrap;
}

.state-pill.active {
  border-color: oklch(0.74 0.06 142);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.state-pill.muted {
  background: var(--panel);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.88rem;
}

th {
  color: var(--muted);
  font-weight: 650;
}

.provider-list,
.recent-list {
  display: grid;
  gap: 10px;
}

.provider-row,
.recent-row {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.withdrawal-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.withdrawal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.provider-row strong,
.recent-row strong {
  font-size: 0.92rem;
}

.config-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.config-panel div {
  min-width: 220px;
  flex: 1 1 280px;
}

code {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--accent-dark);
  font-size: 0.82rem;
}

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

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 166px minmax(330px, 1fr) 270px;
  }

  body.conversation-mode .product-workbench-shell {
    grid-template-columns: 166px minmax(330px, 1fr) 270px;
  }

  .rail {
    padding: 14px 10px;
  }

  .brand-block small,
  .rail-note span,
  .compact-model small {
    display: none;
  }

  .compact-model {
    grid-template-columns: auto 1fr;
  }

  .conversation-topbar,
  .workspace-context-bar,
  .conversation-stage {
    padding-left: 24px;
    padding-right: 24px;
  }

  .signed-out-panel {
    margin-left: 24px;
    margin-right: 24px;
  }

  .workspace-panel {
    padding-left: 24px;
    padding-right: 24px;
  }

  .conversation-topbar {
    display: grid;
    gap: 8px;
    padding-top: 22px;
    padding-bottom: 10px;
  }

  .workspace-context-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conversation-topbar h1 {
    font-size: 1.34rem;
  }

  .start-copy h2 {
    font-size: 1.66rem;
  }

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

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

  .conversation-flow-bar,
  .support-quick-grid,
  .business-resource-grid,
  .resource-content-grid,
  .support-panel-grid {
    grid-template-columns: 1fr;
  }

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

  .model-count {
    display: none;
  }

  .studio-composer {
    width: 100%;
  }

  .floating-composer {
    left: calc(166px + 24px);
    right: calc(270px + 24px);
    bottom: 18px;
    width: auto;
  }

  body.conversation-mode .floating-composer {
    left: auto;
    right: auto;
    width: var(--chat-track);
  }

  .studio-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .studio-section {
    padding: 12px;
  }

  .resource-summary-grid,
  .usage-bill-summary,
  .member-account-facts,
  .member-benefit-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .usage-dashboard {
    padding: 18px;
  }
}

@media (max-width: 1180px) {
  .video-creation-shell .video-studio-main {
    grid-template-columns: 1fr;
  }

  .video-stage-preview {
    grid-template-rows: minmax(210px, 1fr) auto;
  }

  .video-stage-screen {
    min-height: 240px;
  }

  .video-preset-grid,
  .video-frame-strip {
    grid-template-columns: 1fr;
  }

  body.video-mode .video-frame-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  body.video-mode .video-frame-slot {
    flex: 0 0 76%;
    min-height: 58px;
  }

  .video-frame-slot strong {
    white-space: normal;
  }

  .video-composer-dock {
    box-shadow: var(--shadow-sm);
  }

  .video-effect-gallery {
    width: min(640px, calc(100vw - 32px));
  }
}

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

  .product-workbench-shell,
  body.conversation-mode .product-workbench-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body:has(.product-workbench-shell) {
    min-height: 100dvh;
    overflow: hidden;
  }

  body.conversation-mode .conversation-shell {
    height: auto;
  }

  .mobile-workbench-topbar {
    min-width: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    min-height: 58px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  .mobile-primary-tabs {
    z-index: 65;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 7px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    scrollbar-width: none;
  }

  .mobile-primary-tabs::-webkit-scrollbar {
    display: none;
  }

  .mobile-primary-tabs button {
    flex: 0 0 auto;
    min-height: 32px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 760;
  }

  .mobile-primary-tabs button.active {
    border-color: var(--border);
    background: var(--surface-2);
    color: var(--ink);
  }

  .mobile-workbench-topbar .brand-mark {
    width: 64px;
    height: 30px;
    border-radius: 8px;
    font-size: 0.78rem;
  }

  .mobile-workbench-topbar .brand-block,
  .mobile-workbench-topbar .brand-block span:last-child {
    min-width: 0;
  }

  .mobile-workbench-topbar .brand-block {
    gap: 8px;
    min-height: 36px;
  }

  .mobile-workbench-topbar .brand-block strong {
    overflow: hidden;
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-workbench-topbar .brand-block small {
    display: none;
  }

  .mobile-model-control {
    display: grid;
    align-items: center;
    gap: 2px;
    min-width: 92px;
  }

  .mobile-model-control span {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 720;
    line-height: 1;
  }

  .mobile-model-select {
    width: min(34vw, 138px);
    min-height: 32px;
    border-radius: 999px;
    padding: 5px 26px 5px 10px;
    background: var(--surface-2);
    font-size: 0.82rem;
    font-weight: 720;
  }

  .mobile-session-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .mobile-session-actions .session-summary {
    display: none;
  }

  .mobile-session-actions .compact-action {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
  }

  .mobile-session-actions .nav-link {
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .product-workbench-shell .rail {
    display: none;
  }

  .product-workbench-shell .rail-nav {
    display: none;
  }

  .product-workbench-shell .rail-link {
    justify-content: center;
    min-height: 36px;
    padding: 7px 8px;
    text-align: center;
    font-size: 0.88rem;
  }

  .product-workbench-shell .rail-section,
  .product-workbench-shell .rail-note {
    display: none;
  }

  .brand-block small,
  .rail-note span,
  .compact-model small,
  .compact-model span:not(.status-dot) {
    display: revert;
  }

  .rail-link {
    padding: 8px 10px;
  }

  .compact-model {
    display: grid;
    grid-template-columns: auto 1fr;
    place-items: initial;
    width: 100%;
    height: auto;
    min-height: 38px;
    padding: 8px 10px;
  }

  .compact-model-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .product-workbench-shell .studio-panel {
    display: none;
  }

  body.image-mode .product-workbench-shell,
  body.video-mode .product-workbench-shell {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  body.image-mode .product-workbench-shell .studio-panel,
  body.video-mode .product-workbench-shell .studio-panel {
    display: grid;
    grid-row: 4;
    max-height: min(32dvh, 240px);
    overflow-y: auto;
    border-top: 1px solid var(--border);
    border-left: 0;
    padding: 0;
    background: var(--surface);
  }

  body.video-mode .product-workbench-shell .video-settings-panel {
    display: none;
  }

  body.image-mode .image-settings-panel .studio-header,
  body.video-mode .video-settings-panel .studio-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    padding: 12px 18px 8px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  body.image-mode .image-settings-panel .studio-header h2,
  body.video-mode .video-settings-panel .studio-header h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.25;
  }

  body.image-mode .studio-panel .studio-section {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .conversation-topbar,
  .workspace-context-bar,
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-workbench-shell .conversation-topbar {
    display: none;
  }

  .product-workbench-shell .conversation-shell {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }

  .product-workbench-shell .workspace-panel {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0;
    overflow: hidden;
    min-height: 0;
    align-content: stretch;
    padding: 0;
  }

  .product-workbench-shell .resource-panel,
  .product-workbench-shell .member-center-panel,
  .product-workbench-shell .market-panel,
  .product-workbench-shell .office-panel,
  .product-workbench-shell .recharge-redeem-panel {
    display: block;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px;
  }

  .product-workbench-shell .resource-panel > * + *,
  .product-workbench-shell .member-center-panel > * + *,
  .product-workbench-shell .market-panel > * + *,
  .product-workbench-shell .office-panel > * + *,
  .product-workbench-shell .recharge-redeem-panel > * + * {
    margin-top: 12px;
  }

  .product-workbench-shell .workspace-panel:not(.workspace-home):not(.image-studio):not(.video-studio):not(.resource-panel):not(.member-center-panel):not(.market-panel):not(.office-panel):not(.recharge-redeem-panel) {
    display: none;
  }

  .product-workbench-shell .image-studio,
  .product-workbench-shell .video-studio {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0;
    overflow: hidden;
  }

  body.image-mode .product-workbench-shell .image-studio,
  body.video-mode .product-workbench-shell .video-studio {
    display: block;
    min-height: 0;
    overflow-y: auto;
  }

  body.image-mode .product-workbench-shell .image-studio {
    display: block;
    min-height: 0;
    overflow-y: auto;
  }

  body.video-mode .product-workbench-shell .video-studio {
    display: block;
    min-height: 0;
    overflow-y: auto;
  }

  .product-workbench-shell .image-studio[hidden],
  .product-workbench-shell .video-studio[hidden] {
    display: none;
  }

  .image-generation-form,
  .video-generation-form {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 0;
    overflow-y: auto;
  }

  .image-studio-main,
  .image-result-section,
  .video-studio-main,
  .video-result-section {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .image-studio-main,
  .video-studio-main {
    gap: 14px;
    padding: 24px 18px 14px;
  }

  .image-studio-title,
  .video-studio-title {
    display: grid;
    gap: 6px;
  }

  .image-studio-title h2,
  .video-studio-title h2 {
    font-size: 1.48rem;
    line-height: 1.18;
  }

  .image-studio-title span,
  .video-studio-title span {
    max-width: 30ch;
    text-align: left;
  }

  .video-creation-shell {
    gap: 12px;
    border: 0;
    border-radius: 0;
    padding: 18px;
    box-shadow: none;
  }

  .video-creation-header {
    display: grid;
    gap: 6px;
  }

  .video-creation-header h2 {
    font-size: 1.28rem;
  }

  .video-creation-header > span {
    max-width: 34ch;
    text-align: left;
  }

  .video-workflow-tabs {
    width: 100%;
  }

  .video-workflow-tabs button {
    min-height: 38px;
    font-size: 0.76rem;
  }

  .video-workflow-tabs button span {
    font-size: 0.62rem;
  }

  .video-creation-shell .video-studio-main {
    grid-template-columns: 1fr;
  }

  body.video-mode .video-creation-shell .video-studio-main,
  body.video-mode .video-stage-preview,
  body.video-mode .video-stage-screen {
    min-height: 0;
  }

  body.video-mode .video-stage-screen {
    min-height: 156px;
    border-radius: 18px;
  }

  body.video-mode .video-stage-frame {
    aspect-ratio: 16 / 10;
  }

  body.video-mode .video-stage-footer {
    display: grid;
  }

  body.video-mode .video-composer-dock {
    width: 100%;
    margin: 0;
    border-radius: 18px;
  }

  body.video-mode #videoPromptInput {
    height: 112px;
  }

  body.video-mode .video-composer-dock.is-expanded {
    max-height: none;
    height: auto;
    overflow: visible;
  }

  body.video-mode .video-task-toolbar {
    display: none;
  }

  .video-stage-preview,
  .video-prompt-panel {
    border-radius: 16px;
  }

  .video-stage-screen {
    min-height: 210px;
    padding: 10px;
  }

  .video-stage-footer,
  body.video-mode .video-stage-footer.has-stage-actions {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .video-stage-badge {
    top: 10px;
    left: 10px;
    max-width: calc(100% - 132px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .video-composer-dock {
    gap: 11px;
    padding: 12px;
  }

  .video-composer-topline {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .video-composer-mode {
    justify-self: start;
  }

  .video-composer-pills {
    justify-content: flex-start;
    margin-right: -2px;
    padding-bottom: 2px;
  }

  .video-actor-strip {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    margin-right: -18px;
    margin-left: -18px;
    padding: 9px 18px;
  }

  .video-mode-menu,
  .video-reference-source-menu,
  .video-parameter-popover,
  .video-reference-asset-picker,
  .video-effect-gallery {
    width: min(100%, calc(100vw - 28px));
    max-width: none;
    border-radius: var(--radius);
  }

  .video-mode-menu,
  .video-reference-source-menu {
    min-width: 0;
  }

  .video-parameter-popover {
    gap: 11px;
    padding: 12px;
  }

  .video-reference-asset-picker {
    right: 14px;
    left: 14px;
    bottom: 58px;
    max-height: min(68dvh, 520px);
    padding: 12px;
  }

  body.video-mode .video-reference-asset-picker {
    right: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    max-height: none;
  }

  .video-reference-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-effect-gallery {
    max-height: min(72dvh, 560px);
    padding: 12px;
  }

  .video-effect-gallery header {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-effect-gallery .effect-grid,
  .video-effect-gallery [data-effect-grid] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-preset-grid,
  .video-frame-strip {
    grid-template-columns: 1fr;
  }

  .video-frame-slot strong {
    white-space: normal;
  }

  .image-mode-tabs {
    width: 100%;
  }

  .image-mode-tabs button {
    min-height: 32px;
    font-size: 0.76rem;
  }

  .image-mode-tabs button span {
    display: block;
    margin: 1px 0 0;
    font-size: 0.64rem;
  }

  .image-mode-unavailable {
    display: grid;
    gap: 10px;
  }

  .image-mode-unavailable .secondary-button {
    width: 100%;
  }

  .image-reference-header,
  .image-inpaint-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .image-prompt-actions,
  .video-prompt-actions,
  .image-reference-preview {
    align-items: stretch;
    flex-direction: column;
  }

  .image-prompt-actions .image-generate-button,
  .video-prompt-actions .video-generate-button {
    width: 100%;
  }

  .image-reference-actions {
    display: grid;
    width: 100%;
  }

  .image-reference-actions .secondary-button,
  .image-inpaint-heading .secondary-button,
  .image-reference-upload-card .secondary-button {
    width: 100%;
  }

  .image-reference-source-grid,
  .image-reference-workflow-grid {
    grid-template-columns: 1fr;
  }

  .image-advanced-workflow-card {
    margin-top: 10px;
    padding: 12px;
  }

  .advanced-workflow-picker {
    display: grid;
    grid-template-columns: 1fr;
  }

  .advanced-workflow-capsule {
    width: 100%;
    min-height: 64px;
    border-radius: 12px;
    padding-right: 10px;
  }

  .advanced-workflow-capsule-hint {
    align-self: start;
    margin-top: 1px;
  }

  .advanced-workflow-capsule-text strong {
    white-space: normal;
  }

  .clothing-workflow-intro,
  .clothing-workflow-footer,
  .clothing-workflow-selected {
    align-items: stretch;
    flex-direction: column;
  }

  .clothing-workflow-intro .primary-button,
  .clothing-workflow-upload .secondary-button {
    width: 100%;
  }

  .clothing-workflow-source-grid,
  .clothing-workflow-grid,
  .clothing-workflow-result {
    grid-template-columns: 1fr;
  }

  .clothing-workflow-field-grid .studio-field {
    grid-template-rows: auto auto;
  }

  .clothing-workflow-asset-grid {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .clothing-workflow-stages {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clothing-workflow-stages li {
    text-align: center;
  }

  .clothing-workflow-result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .image-reference-asset-grid {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .image-inpaint-canvas {
    min-height: 198px;
    max-height: 36vh;
  }

  .image-inpaint-canvas img {
    max-height: 36vh;
  }

  .image-prompt-field textarea {
    min-height: 138px;
    border-radius: 16px;
    font-size: 0.98rem;
  }

  .video-prompt-field textarea {
    min-height: 156px;
    border-radius: 16px;
    font-size: 0.98rem;
  }

  .video-reference-grid {
    grid-template-columns: 1fr;
  }

  .image-quick-prompts {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .image-quick-prompts button {
    flex: 0 0 auto;
  }

  .image-studio-controls,
  .video-studio-controls {
    gap: 12px;
    padding: 10px 18px 18px;
  }

  body.video-mode .video-mobile-model-control {
    display: grid;
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 760;
  }

  body.video-mode .video-mobile-model-control select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 10px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.84rem;
  }

  .image-studio-controls > .studio-field:first-child,
  .video-studio-controls > .studio-field:first-child {
    order: 1;
  }

  .video-model-status {
    order: 2;
  }

  .image-cost-estimate {
    order: 2;
  }

  #videoCostEstimate {
    order: 3;
  }

  body.image-mode .image-setting-grid,
  body.video-mode .video-setting-grid {
    order: 4;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  body.image-mode .image-setting-grid .studio-field:first-child,
  body.image-mode .image-setting-grid .studio-field:nth-child(5),
  body.video-mode .video-setting-grid .studio-field:first-child {
    grid-column: auto;
  }

  body.image-mode .image-advanced-grid,
  body.video-mode .image-advanced-grid {
    grid-template-columns: 1fr;
  }

  .image-aspect-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .image-control-group {
    order: 5;
  }

  .image-toggle-row {
    order: 6;
  }

  .image-advanced-drawer {
    order: 7;
  }

  .image-advanced-drawer summary small {
    display: none;
  }

  .image-result-section,
  .video-result-section {
    min-height: 0;
    max-height: 42vh;
    overflow-y: auto;
    border-top: 1px solid var(--border);
    padding: 12px 18px max(14px, env(safe-area-inset-bottom));
  }

  body.image-mode .image-result-section,
  body.video-mode .video-result-section {
    max-height: none;
    overflow: visible;
  }

  body.image-mode .image-result-section {
    max-height: none;
    overflow: visible;
  }

  .image-gallery-toolbar,
  .video-gallery-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .image-gallery-toolbar h3,
  .video-gallery-toolbar h3 {
    font-size: 0.98rem;
  }

  .image-gallery-toolbar span,
  .video-gallery-toolbar span {
    display: none;
  }

  .image-gallery-filter button {
    min-height: 30px;
    padding: 4px 9px;
  }

  .image-result-grid,
  .video-result-grid {
    gap: 9px;
  }

  .image-creation-record {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .image-record-prompt {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 9px;
  }

  .image-record-prompt p {
    -webkit-line-clamp: 3;
  }

  .image-result-card {
    gap: 7px;
    max-width: none;
    padding: 7px;
  }

  .video-result-card {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 8px;
  }

  .video-result-card .compact-action {
    width: 100%;
  }

  .image-result-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-task-row {
    grid-template-columns: 1fr;
  }

  .image-task-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-workbench-shell .workspace-recommendations {
    display: grid;
    align-content: start;
    gap: 18px;
    min-height: 0;
    overflow-y: auto;
    padding: 0 18px 24px;
  }

  body.conversation-mode .product-workbench-shell .workspace-recommendations {
    display: none;
  }

  body:not(.conversation-mode) .product-workbench-shell .conversation-stage {
    display: none;
  }

  .product-workbench-shell .workspace-focus-panel {
    display: grid;
  }

  .product-workbench-shell .workspace-examples-panel {
    display: none;
  }

  .mobile-empty-start {
    display: grid;
    gap: 9px;
    padding-top: 12px;
  }

  .mobile-empty-start h2 {
    margin: 0;
    font-size: 1.92rem;
    line-height: 1.14;
    letter-spacing: 0;
  }

  .mobile-empty-start p:last-child {
    max-width: 28ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .mobile-case-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .home-capability-matrix {
    gap: 9px;
  }

  .home-capability-header {
    align-items: start;
    flex-direction: column;
    gap: 3px;
  }

  .home-capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .home-capability-entry {
    min-height: 78px;
    padding: 10px;
  }

  .mobile-case-card {
    display: grid;
    gap: 4px;
    min-height: 62px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 11px 12px;
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    box-shadow: var(--shadow-sm);
  }

  .mobile-case-card span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 720;
  }

  .mobile-case-card strong {
    overflow: hidden;
    font-size: 0.94rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .conversation-stage {
    align-content: start;
    overflow-y: auto;
    padding: 14px 12px 16px;
    scroll-padding-bottom: 18px;
  }

  body.conversation-mode .conversation-stage {
    padding: 14px 12px 16px;
  }

  .messages {
    gap: 14px;
    width: 100%;
  }

  .message {
    max-width: 100%;
  }

  .message-meta {
    display: none;
  }

  .message-bubble,
  .message-error-actions {
    max-width: 86%;
    width: fit-content;
  }

  .message-bubble {
    padding: 10px 13px;
    border-radius: 18px;
    background: oklch(0.955 0.006 168);
    box-shadow: none;
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .message.assistant .message-bubble {
    border-color: transparent;
    border-bottom-left-radius: 6px;
  }

  .message.user .message-bubble {
    border-bottom-right-radius: 6px;
    background: var(--accent);
    color: oklch(0.99 0.006 142);
  }

  .message.user .message-bubble.markdown-body h1,
  .message.user .message-bubble.markdown-body h2,
  .message.user .message-bubble.markdown-body h3,
  .message.user .message-bubble .katex {
    color: oklch(0.99 0.006 142);
  }

  .compact-start-panel {
    align-content: center;
    justify-items: center;
    gap: 10px;
    min-height: 100%;
    width: min(100%, 360px);
    color: var(--muted);
    text-align: center;
  }

  .compact-start-panel::before {
    content: "想聊什么？";
    color: var(--ink);
    font-size: 1.28rem;
    font-weight: 780;
    letter-spacing: 0;
  }

  .compact-start-panel::after {
    content: "选择模型后直接输入，按 Enter 发送。";
    max-width: 24ch;
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .workspace-focus-panel .start-copy h2 {
    font-size: 1.28rem;
    line-height: 1.25;
  }

  .workspace-focus-panel .start-copy p {
    display: none;
  }

  .product-workbench-shell .model-switcher {
    display: none;
  }

  .studio-composer,
  .floating-composer,
  body.conversation-mode .floating-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 8px;
    position: static;
    width: 100%;
    margin: 0;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: var(--surface);
    box-shadow: 0 -8px 22px oklch(0.32 0.025 168 / 0.06);
  }

  .studio-composer textarea,
  .floating-composer textarea {
    min-height: 44px;
    height: 44px;
    max-height: 108px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface-2);
    font-size: 0.96rem;
    line-height: 1.45;
    resize: none;
  }

  .studio-composer textarea:focus-visible {
    outline-offset: 2px;
  }

  .composer-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
  }

  .composer-flow-row {
    display: none;
  }

  .composer-footer .button-row {
    width: auto;
  }

  .composer-footer .primary-button {
    flex: 0 0 auto;
    min-width: 74px;
    min-height: 36px;
    border-radius: 999px;
    padding: 7px 16px;
  }

  .auth-page-shell {
    grid-template-columns: 1fr;
  }

  .auth-page-shell.product-auth-shell {
    align-content: start;
    min-height: 100dvh;
    overflow-y: auto;
  }

  .product-auth-shell {
    background:
      radial-gradient(circle at 82% 22%, oklch(0.905 0.05 162 / 0.64), transparent 34%),
      linear-gradient(180deg, oklch(0.952 0.012 168) 0 260px, var(--bg) 260px);
  }

  .auth-product-panel {
    border-right: 0;
    border-bottom: 0;
    background: transparent;
  }

  .auth-product-panel .auth-checklist,
  .auth-product-copy p:last-child,
  .product-auth-shell .auth-workspace-header,
  .product-auth-shell .auth-mode-tabs {
    display: none;
  }

  .auth-product-panel {
    align-content: start;
    gap: 20px;
    min-height: 248px;
    padding: 30px 22px 52px;
  }

  .auth-product-copy {
    gap: 7px;
  }

  .auth-product-copy h1 {
    max-width: 11ch;
    font-size: 1.82rem;
    line-height: 1.18;
  }

  .auth-workspace-panel {
    align-content: start;
    gap: 0;
    margin-top: -26px;
    padding: 0 22px 32px;
  }

  .auth-workspace-panel {
    justify-self: stretch;
    width: 100%;
  }

  .product-auth-shell .auth-stack {
    gap: 15px;
    padding: 22px 18px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  .product-auth-shell .auth-form-heading {
    align-items: flex-start;
    gap: 12px;
  }

  .product-auth-shell .auth-form-switch {
    font-size: 0.8rem;
  }

  .auth-field-grid,
  .verification-row {
    grid-template-columns: 1fr;
  }

  .auth-card {
    grid-template-columns: 1fr;
  }

  .suggestion-grid,
  .discovery-columns,
  .recommendation-layout,
  .office-workspace-grid,
  .office-wechat-fields,
  .office-result-sections,
  .recharge-redeem-grid,
  .resource-panel,
  .member-center-panel,
  .resource-summary-grid,
  .usage-bill-summary,
  .member-account-facts,
  .member-benefit-list,
  .usage-dashboard-grid,
  .resource-content-grid,
  .business-resource-grid,
  .content-list,
  .kpi-grid,
  .report-overview,
  .report-grid,
  .admin-ops-command-center,
  .admin-section-summary-strip,
  .traffic-grid,
  .security-stat-grid,
  .security-config-grid,
  .storage-settings-grid,
  .admin-filter-toolbar,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .office-progress-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .usage-dashboard-header,
  .usage-recent-row,
  .usage-ranking-row,
  .usage-category-row {
    grid-template-columns: 1fr;
  }

  .filter-summary {
    justify-self: start;
  }

  .admin-filter-empty {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-filter-empty .secondary-button {
    width: 100%;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-controls,
  .row-actions {
    justify-content: flex-start;
  }

  .admin-controls label,
  .admin-controls input,
  .admin-controls select {
    width: min(100%, 150px);
  }

  .asset-row,
  .business-lane,
  .order-row,
  .audit-row,
  .asset-stat-grid {
    grid-template-columns: 1fr;
  }

  .ops-lane {
    grid-template-columns: 1fr;
  }

  .ops-lane strong {
    text-align: left;
  }

  .report-trend-row {
    grid-template-columns: 82px minmax(90px, 1fr) 38px;
  }

  .report-trend-row em {
    grid-column: 2 / -1;
    text-align: left;
  }

  .order-actions {
    grid-template-columns: 1fr;
  }

  .studio-composer {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .image-advanced-workflow-heading {
    align-items: flex-start;
  }

  .clothing-workflow-stages {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .workbench-splash {
    padding: 18px;
  }

  .workbench-splash-core {
    width: calc(100vw - 34px);
    transform: translateY(0);
  }

  .workbench-splash-core::before {
    inset: -28px -12px;
  }

  .workbench-splash h2 {
    font-size: 1.82rem;
    line-height: 1.1;
  }

  .workbench-splash p {
    font-size: 0.94rem;
  }

  .workbench-splash-progress {
    width: min(220px, calc(100vw - 96px));
  }

  .workbench-splash-skip {
    top: 14px;
    right: 14px;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .workbench-splash-field span {
    width: 76vw;
  }

  .rail,
  .conversation-topbar,
  .workspace-context-bar,
  .studio-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .workspace-panel {
    padding-bottom: 0;
  }

  .signed-out-panel {
    grid-template-columns: 1fr;
    margin-left: 16px;
    margin-right: 16px;
  }

  .signed-out-actions {
    width: 100%;
  }

  .signed-out-actions .primary-button,
  .signed-out-actions .secondary-button,
  .auth-secondary-row .nav-link {
    flex: 1;
  }

  .auth-workspace-header,
  .auth-infra-strip,
  .auth-trust-strip {
    grid-template-columns: 1fr;
  }

  .auth-workspace-header {
    display: none;
  }

  .auth-workspace-header .nav-link {
    width: 100%;
  }

  .auth-checklist strong,
  .auth-checklist small,
  .auth-infra-strip strong {
    white-space: normal;
  }

  .workspace-context-bar,
  .conversation-flow-bar,
  .password-change-grid,
  .support-quick-grid,
  .support-panel-grid {
    grid-template-columns: 1fr;
  }

  .password-change-heading,
  .password-change-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-workbench-shell .rail-nav {
    display: none;
  }

  .workspace-section-title,
  .admin-section-heading {
    display: grid;
  }

  .workspace-section-title span,
  .admin-section-heading span {
    text-align: left;
  }

  .start-copy h2 {
    font-size: 1.72rem;
  }

  .auth-workspace-panel .model-switcher,
  .studio-panel .model-switcher {
    grid-template-columns: 1fr;
  }

  .workspace-home .case-grid,
  .workspace-home .prompt-grid,
  .recommendation-column-wide .case-grid {
    grid-template-columns: 1fr;
  }

  .button-row,
  .header-actions {
    width: 100%;
  }

  .composer-flow-row {
    width: 100%;
  }

  .primary-button,
  .secondary-button,
  .nav-link {
    flex: 1;
  }

  .image-preview-footer .secondary-button,
  .mobile-session-actions .nav-link,
  .mobile-session-actions .secondary-button,
  .composer-footer .primary-button {
    flex: 0 0 auto;
  }

  .image-preview-dialog {
    padding: 12px;
  }

  .image-preview-panel {
    max-height: calc(100vh - 24px);
    padding: 10px;
  }

  .image-preview-header,
  .image-preview-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .image-preview-header .secondary-button,
  .image-preview-footer .secondary-button {
    width: 100%;
  }

  .admin-shell {
    width: min(100% - 24px, 1180px);
  }

  .admin-action-status {
    width: 100%;
    max-width: none;
  }
}

.short-drama-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100dvh - 72px);
}

body.short-drama-mode .product-workbench-shell {
  grid-template-columns: 224px minmax(0, 1fr);
}

body.short-drama-mode .product-workbench-shell .studio-panel {
  display: none;
}

.short-drama-title {
  align-items: center;
}

.short-drama-workbench {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(280px, 340px);
  gap: 14px;
  min-height: 0;
}

.short-drama-column {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: oklch(0.992 0.004 168);
  padding: 14px;
}

.short-drama-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.short-drama-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.short-drama-mode-toggle label,
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted);
  background: var(--surface);
}

.short-drama-number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.short-drama-batch-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: oklch(0.965 0.008 168);
}

.short-drama-model-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.short-drama-model-line select {
  min-width: 0;
  width: 100%;
}

.short-drama-model-line strong {
  color: var(--ink);
}

.short-drama-model-line span,
.short-drama-continuity-summary,
.short-drama-progress-row + span {
  overflow-wrap: anywhere;
}

.short-drama-continuity-summary {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.short-drama-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.short-drama-progress-row progress {
  width: 100%;
  height: 9px;
  accent-color: var(--accent);
}

.short-drama-board,
.short-drama-video-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.short-drama-series-summary,
.short-drama-empty {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: oklch(0.965 0.008 168);
}

.short-drama-series-summary strong {
  color: var(--ink);
}

.short-drama-episode-list,
.short-drama-shot-list {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.short-drama-episode-list {
  max-height: calc(100dvh - 230px);
}

.short-drama-shot-list {
  max-height: 260px;
}

.short-drama-episode-card {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  cursor: pointer;
}

.short-drama-episode-card.selected,
.short-drama-shot-card.selected {
  border-color: oklch(0.58 0.12 162);
  box-shadow: 0 0 0 2px oklch(0.88 0.05 162);
}

.short-drama-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.short-drama-card-head span,
.short-drama-episode-card small,
.short-drama-shot-card small {
  color: var(--muted);
  font-size: 0.82rem;
}

.short-drama-episode-card h4,
.short-drama-episode-card p {
  margin: 0;
}

.short-drama-episode-card h4 {
  font-size: 1rem;
}

.short-drama-episode-card p,
.short-drama-episode-card strong {
  overflow-wrap: anywhere;
}

.short-drama-shot-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  background: var(--surface);
  color: var(--ink);
}

.short-drama-shot-card small {
  grid-column: 1 / -1;
}

.short-drama-shot-card em {
  justify-self: end;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 760;
}

.short-drama-shot-card[data-shot-status="running"] em {
  border-color: oklch(0.76 0.04 162);
  color: var(--accent-dark);
}

.short-drama-shot-card[data-shot-status="completed"] em {
  color: var(--accent-dark);
}

.short-drama-shot-card[data-shot-status="failed"] em {
  border-color: oklch(0.78 0.08 28);
  color: var(--danger);
}

.short-drama-video-preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: oklch(0.22 0.014 168);
  color: oklch(0.88 0.012 168);
  overflow: hidden;
}

.short-drama-video-preview video {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: contain;
  background: oklch(0.2 0.012 168);
}

.short-drama-video-params {
  min-height: 96px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: oklch(0.965 0.008 168);
}

.short-drama-video-params dl,
.short-drama-video-params div {
  display: grid;
  gap: 4px;
  margin: 0;
}

.short-drama-video-params dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.short-drama-video-params dd {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .short-drama-workbench {
    grid-template-columns: 1fr;
  }

  .short-drama-episode-list,
  .short-drama-shot-list {
    max-height: none;
    overflow: visible;
  }

  .short-drama-number-grid,
  .short-drama-mode-toggle {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .recharge-redeem-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .recharge-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .recharge-form-actions .primary-button {
    width: 100%;
  }

  body.short-drama-mode .product-workbench-shell {
    grid-template-columns: 1fr;
  }

  body.short-drama-mode .product-workbench-shell .short-drama-panel {
    display: flex !important;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
  }

  .short-drama-title {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workbench-splash {
    transition:
      opacity 120ms linear,
      transform 120ms linear,
      clip-path 120ms linear;
  }

  .workbench-splash-canvas,
  .workbench-splash-field {
    display: none;
  }

  .workbench-splash::after,
  .workbench-splash-progress span {
    animation-duration: 0.01ms !important;
  }

  body.workbench-splash-active .product-workbench-shell {
    filter: none;
    transform: none;
  }

  body.video-mode .video-stage-preview::before {
    animation: videoTheaterGlowDrift 0.01ms linear 1 both !important;
    opacity: 0.18;
    transform: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.short-drama-reference-kit {
  display: grid;
  gap: 12px;
}

.short-drama-reference-group,
.short-drama-first-frame-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  min-width: 0;
}

.short-drama-reference-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.short-drama-reference-candidate-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.short-drama-reference-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.short-drama-reference-group-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.short-drama-reference-group-head strong,
.short-drama-reference-group-head span,
.short-drama-reference-candidate strong,
.short-drama-reference-candidate small {
  overflow-wrap: anywhere;
}

.short-drama-reference-group-head span,
.short-drama-reference-candidate small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.short-drama-reference-candidate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.short-drama-reference-candidate {
  display: grid;
  grid-template-rows: auto auto minmax(2.7em, 1fr);
  gap: 7px;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: oklch(0.992 0.004 168);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.short-drama-reference-candidate:hover,
.short-drama-reference-candidate:focus-visible {
  border-color: oklch(0.62 0.1 162);
  box-shadow: 0 0 0 2px oklch(0.9 0.04 162);
}

.short-drama-reference-candidate.selected {
  border-color: oklch(0.54 0.13 162);
  background: oklch(0.96 0.03 162);
  box-shadow: inset 0 0 0 1px oklch(0.54 0.13 162);
}

.short-drama-reference-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 9 / 12;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: oklch(0.94 0.006 168);
  color: var(--muted);
  overflow: hidden;
}

.short-drama-reference-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.short-drama-reference-candidate strong {
  min-height: 2.4em;
  font-size: 0.82rem;
  line-height: 1.25;
}

.short-drama-reference-candidate small {
  display: -webkit-box;
  max-height: 4.05em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.short-drama-reference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.short-drama-reference-actions .compact-action,
.short-drama-reference-group-head .compact-action {
  min-width: 0;
  white-space: normal;
}

.short-drama-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.short-drama-first-frame-card {
  display: grid;
  gap: 6px;
}

@media (max-width: 900px) {
  .short-drama-control-grid,
  .short-drama-reference-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .short-drama-reference-candidate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .short-drama-reference-group-head {
    display: grid;
  }

  .short-drama-reference-candidate-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .short-drama-reference-candidate {
    grid-template-columns: 86px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: start;
  }

  .short-drama-reference-candidate .short-drama-reference-thumb {
    grid-row: 1 / span 2;
  }

  .short-drama-reference-candidate strong {
    min-height: 0;
  }
}
