:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #475569;
  --soft: #64748b;
  --line: rgba(148, 163, 184, 0.34);
  --panel: #ffffff;
  --wash: #f8fafc;
  --teal: #0f766e;
  --teal-bright: #14b8a6;
  --sky: #0ea5e9;
  --sun: #fbbf24;
  --pink: #f9a8d4;
  --orange: #ea580c;
  --red: #991b1b;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(236, 254, 255, 0.92) 46%, rgba(255, 247, 237, 0.92) 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  border: 0;
}

.studio-page {
  min-height: 100vh;
  padding: 28px;
}

.studio-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.studio-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 2px;
}

.header-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: 260px;
}

.account-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  max-width: 620px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.account-name {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.usage-summary {
  display: block;
  margin-top: 3px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.studio-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-size: 56px;
  line-height: 1.08;
  letter-spacing: 0;
}

.studio-title::before {
  content: "";
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: block;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.24)),
    linear-gradient(135deg, var(--pink) 0%, #fde68a 42%, #99f6e4 100%);
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.studio-title::after {
  content: "";
  position: absolute;
}

.studio-header .studio-title {
  position: relative;
}

.studio-header .studio-title::after {
  left: 23px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid var(--teal);
  transform: translateX(2px);
}

.studio-subtitle {
  margin: 10px 0 0;
  max-width: 690px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.status-pill,
#jobState {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.status-pill[data-state="running"],
#jobState[data-state="running"],
#jobState[data-state="queued"] {
  border-color: rgba(20, 184, 166, 0.38);
  color: var(--teal);
  background: #ecfeff;
}

.status-pill[data-state="completed"],
#jobState[data-state="completed"] {
  border-color: rgba(16, 185, 129, 0.38);
  color: #047857;
  background: #f0fdf4;
}

.status-pill[data-state="failed"],
#jobState[data-state="failed"] {
  border-color: #fecaca;
  color: var(--red);
  background: #fef2f2;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.auth-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  border: 1px solid rgba(125, 211, 252, 0.58);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.auth-form {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.auth-form h2 {
  margin-bottom: 2px;
}

.studio-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.studio-footer {
  padding: 2px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 750;
}

.studio-footer a,
.legal-document a {
  color: var(--teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.legal-page {
  min-height: 100vh;
  padding: 32px 20px;
}

.legal-document {
  width: min(820px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(24px, 5vw, 48px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.legal-back-link {
  display: inline-flex;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 850;
}

.legal-document h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.05;
  letter-spacing: 0;
}

.legal-document h2 {
  margin: 30px 0 10px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.legal-document p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.legal-updated {
  color: var(--soft);
  font-weight: 800;
}

.studio-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.72fr);
  gap: 18px;
  align-items: stretch;
  padding: 26px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.58);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 253, 250, 0.94) 58%, rgba(255, 251, 235, 0.96) 100%);
  box-shadow:
    0 28px 70px rgba(15, 23, 42, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.studio-form::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, #a78bfa 0%, #67e8f9 32%, #fde68a 66%, var(--pink) 100%);
}

.studio-topic-panel,
.studio-control-panel {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.studio-topic-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.studio-control-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

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

.studio-field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.studio-field-head {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.studio-field--video-style {
  grid-column: 1 / -1;
}

.studio-toggle--wide {
  grid-column: 1 / -1;
}

.studio-field--languages {
  grid-column: 1 / -1;
}

.studio-field--voice .studio-label {
  min-height: 28px;
  display: flex;
  align-items: center;
}

.studio-label,
.section-kicker {
  color: #334155;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

textarea,
select,
.auth-form input {
  width: 100%;
  min-height: 56px;
  border: 1px solid rgba(129, 140, 248, 0.38);
  border-radius: 16px;
  padding: 13px 15px;
  color: var(--ink);
  background: #ffffff;
  outline: 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 22px rgba(99, 102, 241, 0.07);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

textarea {
  min-height: 180px;
  resize: vertical;
  color-scheme: light;
  font-size: 20px;
  line-height: 1.45;
}

select {
  height: 54px;
  min-height: 54px;
  appearance: none;
  padding: 0 36px 0 14px;
  font-size: 15px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 20px) 23px / 7px 7px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 15px) 23px / 7px 7px no-repeat,
    #ffffff;
}

textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}

textarea:focus,
select:focus,
.auth-form input:focus {
  border-color: var(--teal-bright);
  box-shadow:
    0 0 0 4px rgba(45, 212, 191, 0.18),
    0 12px 28px rgba(20, 184, 166, 0.12);
  transform: translateY(-1px);
}

.language-options {
  min-height: 56px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.language-option {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(129, 140, 248, 0.34);
  border-radius: 14px;
  padding: 8px 10px;
  color: #334155;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 20px rgba(99, 102, 241, 0.06);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.language-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--teal);
}

.language-option:has(input:checked) {
  border-color: rgba(20, 184, 166, 0.58);
  color: #115e59;
  background: #ecfeff;
  box-shadow:
    0 0 0 3px rgba(20, 184, 166, 0.1),
    0 10px 22px rgba(20, 184, 166, 0.1);
}

.language-option:has(input:focus-visible) {
  outline: 3px solid rgba(20, 184, 166, 0.28);
  outline-offset: 3px;
}

.language-option:hover {
  transform: translateY(-1px);
}

.toggle-row {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(129, 140, 248, 0.38);
  border-radius: 16px;
  padding: 10px 14px;
  color: var(--ink);
  background: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 22px rgba(99, 102, 241, 0.07);
  cursor: pointer;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.toggle-control {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #cbd5e1;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.toggle-control::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.22);
  transition: transform 160ms ease;
}

.toggle-row input:checked + .toggle-control {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
}

.toggle-row input:checked + .toggle-control::after {
  transform: translateX(22px);
}

.toggle-row input:focus-visible + .toggle-control {
  outline: 3px solid rgba(20, 184, 166, 0.28);
  outline-offset: 3px;
}

.toggle-text {
  min-width: 0;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.studio-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
}

.studio-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 0 16px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}

.studio-button--primary {
  min-height: 56px;
  gap: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--teal) 0%, #2f8f83 55%, var(--sky) 100%);
  box-shadow: 0 18px 32px rgba(15, 118, 110, 0.24);
}

.studio-button--primary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.studio-button--soft {
  min-height: 56px;
  border: 1px solid #5eead4;
  color: #115e59;
  background: #ccfbf1;
  box-shadow: 0 8px 18px rgba(20, 184, 166, 0.12);
}

.studio-button--preview {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 13px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(20, 184, 166, 0.1);
}

.studio-button--compact {
  min-height: 36px;
  border: 1px solid #bae6fd;
  color: #075985;
  background: #f0f9ff;
}

.studio-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: saturate(1.05);
}

.studio-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  box-shadow: none;
}

.disclosure {
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

.active-job,
.history {
  border: 1px solid rgba(219, 234, 254, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.active-job {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.job-head,
.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-kicker {
  display: block;
  margin: 0 0 8px;
  color: var(--teal);
}

h2,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

#jobTitle {
  overflow-wrap: anywhere;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

#progressBar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal-bright), #60a5fa, var(--pink), var(--sun));
  transition: width 220ms ease;
}

#currentStep {
  margin-bottom: 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
}

.error {
  margin: 0;
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--red);
  background: #fef2f2;
  font-size: 14px;
  font-weight: 750;
}

.assets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.asset-video-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.asset-link,
.asset-empty,
.asset-share-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
}

.asset-link {
  border: 1px solid #99f6e4;
  color: #115e59;
  background: #ccfbf1;
  text-decoration: none;
}

.asset-link[data-asset="video"] {
  border-color: #bae6fd;
  color: #075985;
  background: #f0f9ff;
}

.asset-link[data-asset="music"],
.asset-link[data-asset="audio"] {
  border-color: #fed7aa;
  color: #9a3412;
  background: #ffedd5;
}

.asset-share-button {
  border: 1px solid #c4b5fd;
  color: #5b21b6;
  background: #f5f3ff;
  cursor: pointer;
}

.asset-share-button:hover {
  background: #ede9fe;
}

.asset-empty {
  border: 1px dashed #cbd5e1;
  color: var(--soft);
  background: #f8fafc;
}

.history {
  overflow: visible;
  padding: 18px;
}

.job-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.history-page-summary {
  color: var(--soft);
  font-size: 13px;
  font-weight: 750;
}

.history-page-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.history-page-button,
.history-page-gap {
  min-width: 36px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
}

.history-page-button {
  border: 1px solid #cbd5e1;
  padding: 0 10px;
  color: #334155;
  background: #ffffff;
  cursor: pointer;
}

.history-page-button:hover:not(:disabled),
.history-page-button:focus-visible {
  border-color: var(--teal-bright);
  color: var(--teal);
  background: #ecfeff;
}

.history-page-button:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.24);
  outline-offset: 2px;
}

.history-page-button.is-active {
  border-color: var(--teal-bright);
  color: #ffffff;
  background: var(--teal);
}

.history-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.history-page-gap {
  color: var(--soft);
}

.job-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  border: 1px solid rgba(219, 234, 254, 0.95);
  border-radius: 18px;
  padding: 14px;
  color: inherit;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.job-item:hover,
.job-item:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.5);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.1);
}

.job-item:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.25);
  outline-offset: 3px;
}

.job-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 24%),
    linear-gradient(135deg, #ecfeff 0%, #fefce8 48%, #f0fdf4 100%);
}

.job-thumb--playable {
  cursor: pointer;
}

.job-thumb--playable:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.32);
  outline-offset: 3px;
}

.job-thumb--playable::before {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.job-thumb--playable::after {
  content: "";
  position: absolute;
  right: 27px;
  bottom: 24px;
  z-index: 3;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #ffffff;
}

.job-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.job-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.job-body strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.job-meta {
  display: block;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.job-video-button,
.job-share-button,
.job-delete-button {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.job-video-button {
  border: 1px solid #bae6fd;
  color: #075985;
  background: #f0f9ff;
}

.job-video-button:hover {
  background: #e0f2fe;
}

.job-share-button {
  border: 1px solid #c4b5fd;
  color: #5b21b6;
  background: #f5f3ff;
}

.job-share-button:hover {
  background: #ede9fe;
}

.job-delete-button {
  border: 1px solid #fecaca;
  color: #991b1b;
  background: #fee2e2;
}

.job-delete-button:hover {
  background: #fecaca;
}

.style-picker-button {
  width: 100%;
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  border: 1px solid rgba(129, 140, 248, 0.38);
  border-radius: 16px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 22px rgba(99, 102, 241, 0.07);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.style-picker-button:hover {
  border-color: var(--teal-bright);
  transform: translateY(-1px);
}

.style-picker-button:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.28);
  outline-offset: 2px;
}

.style-picker-button-thumb {
  position: relative;
  width: 136px;
  aspect-ratio: 3 / 2;
  flex: 0 0 136px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.62);
  border-radius: 12px;
  background:
    linear-gradient(135deg, #ecfeff 0%, #fefce8 48%, #f0fdf4 100%);
}

.style-picker-button-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.style-picker-button-thumb--failed::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(236, 254, 255, 0.92), rgba(248, 250, 252, 0.92)),
    repeating-linear-gradient(45deg, transparent 0 5px, rgba(20, 184, 166, 0.16) 5px 7px);
}

.style-picker-button-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-picker-button-hint {
  margin-left: auto;
  flex: 0 0 auto;
  border: 1px solid #5eead4;
  border-radius: 999px;
  padding: 4px 12px;
  color: #115e59;
  background: #ccfbf1;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.style-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
}

.style-modal.is-open {
  display: flex;
}

.style-modal-card {
  width: min(1080px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.5);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.4);
}

.style-modal-bar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.style-modal-title {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.style-modal-close {
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 12px;
  color: #334155;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.style-modal-body {
  display: grid;
  gap: 22px;
  padding: 20px;
  overflow-y: auto;
  background: var(--wash);
}

.style-group-title {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.style-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.style-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.4);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.style-card:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.32);
  outline-offset: 2px;
}

.style-card.is-selected {
  border-color: var(--teal);
  box-shadow:
    0 0 0 3px rgba(20, 184, 166, 0.18),
    0 14px 28px rgba(20, 184, 166, 0.18);
}

.style-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #ecfeff 0%, #fefce8 48%, #f0fdf4 100%);
}

.style-card-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.style-card-thumb--failed::after {
  content: "Preview unavailable";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--soft);
  background: var(--wash);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.style-card-label {
  padding: 0 4px 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
}

.video-modal.is-open {
  display: flex;
}

.video-modal-card {
  width: min(1040px, 100%);
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.35);
  border-radius: 20px;
  background: #0f172a;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.45);
}

.video-modal-bar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px 0 18px;
  background: #ffffff;
}

.video-modal-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-modal-close {
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 12px;
  color: #334155;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.video-modal-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.72);
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);
  background: #ffffff;
}

.video-language-button {
  min-height: 34px;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 0 12px;
  color: #075985;
  background: #f0f9ff;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.video-language-button:hover,
.video-language-button:focus-visible {
  background: #e0f2fe;
}

.video-language-button:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.24);
  outline-offset: 2px;
}

.video-language-button.is-active {
  border-color: var(--teal-bright);
  color: #ffffff;
  background: var(--teal);
}

.video-modal-player {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
}

.share-modal.is-open {
  display: flex;
}

.share-modal-card {
  width: min(600px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.5);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.42);
}

.share-modal-bar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.share-modal-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-modal-close {
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 12px;
  color: #334155;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.share-modal-body {
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow-y: auto;
  background: var(--wash);
}

.share-platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.share-platform {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 14px 8px 10px;
  color: #334155;
  background: #ffffff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.share-platform-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 10px;
  font-weight: 900;
}

.share-platform-logo svg {
  width: 28px;
  height: 28px;
  display: block;
}

.share-platform-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-platform:hover,
.share-platform:focus-visible {
  border-color: var(--teal-bright);
  color: var(--teal);
  background: #ecfeff;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(20, 184, 166, 0.12);
}

.share-platform:disabled,
.share-platform:disabled:hover {
  border-color: #cbd5e1;
  color: #64748b;
  background: #f1f5f9;
  cursor: progress;
  transform: none;
  box-shadow: none;
}

.share-platform:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.24);
  outline-offset: 2px;
}

.share-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.share-link-input {
  min-width: 0;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 0 12px;
  color: #334155;
  background: #ffffff;
  font-size: 13px;
}

.share-copy-button {
  min-height: 40px;
  border: 1px solid #c4b5fd;
  border-radius: 12px;
  padding: 0 14px;
  color: #5b21b6;
  background: #f5f3ff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.share-copy-button:hover,
.share-copy-button:focus-visible {
  background: #ede9fe;
}

.share-copy-button:focus-visible,
.share-link-input:focus-visible {
  outline: 3px solid rgba(124, 58, 237, 0.22);
  outline-offset: 2px;
}

.history-empty {
  margin: 0;
  border: 1px dashed #94a3b8;
  border-radius: 16px;
  padding: 24px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

@media (max-width: 900px) {
  .studio-page {
    padding: 16px;
  }

  .studio-header {
    display: grid;
    align-items: start;
  }

  .studio-title {
    font-size: 42px;
  }

  .studio-title::before {
    width: 48px;
    height: 48px;
  }

  .studio-header .studio-title::after {
    left: 20px;
    top: 17px;
  }

  .studio-subtitle {
    font-size: 16px;
  }

  .studio-form,
  .auth-panel,
  .studio-control-grid,
  .studio-actions,
  .language-options {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .account-bar {
    width: 100%;
    min-width: 0;
    justify-items: stretch;
  }

  .account-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .studio-form {
    padding: 18px;
  }

  .studio-topic-panel {
    padding: 16px;
  }

  textarea {
    min-height: 148px;
    font-size: 18px;
  }

  .job-head,
  .history-head {
    display: grid;
  }

  .history-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-page-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .studio-title {
    font-size: 34px;
  }

  .job-item {
    grid-template-columns: 1fr;
  }

  .share-modal {
    padding: 16px;
  }

  .share-platform-grid,
  .share-link-row {
    grid-template-columns: 1fr;
  }
}
