/* 
 * Design cues aligned with readability & attention research:
 * — Lexend: typeface tuned for reading comfort on screens
 * — ~7:1+ contrast on body text (WCAG AAA where possible)
 * — Cool deep background: lower visual noise, supports sustained focus
 * — Single warm CTA (amber): salient without alarm-associated reds
 * — Teal accents: calm, associated with clarity in many UX palettes
 */

:root {
  --bg-deep: #0a0f1a;
  --bg-panel: rgba(18, 26, 42, 0.72);
  --bg-elevated: rgba(28, 40, 62, 0.85);
  --border-subtle: rgba(148, 163, 184, 0.12);
  --text: #e8edf5;
  --text-muted: #94a3b8;
  --teal: #2dd4bf;
  --teal-dim: rgba(45, 212, 191, 0.15);
  --amber: #fbbf24;
  --amber-hover: #fcd34d;
  --danger: #f87171;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-soft: 0 24px 48px rgba(0, 0, 0, 0.35);
  --font: "Lexend", system-ui, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-weight: 400;
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.55;
}

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

/* Ambient gradient orbs — gentle motion draws attention without overload */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 15% 20%, rgba(45, 212, 191, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 10%, rgba(251, 191, 36, 0.08), transparent 50%),
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(56, 189, 248, 0.06), transparent 45%);
}

@media (prefers-reduced-motion: no-preference) {
  .ambient {
    animation: ambient-shift 28s ease-in-out infinite alternate;
  }
}

@keyframes ambient-shift {
  from {
    opacity: 0.85;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.03);
  }
}

.app {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem 1.5rem;
}

.header {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.35rem;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.header-auth {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.header-auth[hidden] {
  display: none !important;
}

.btn-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--bg-deep);
  text-decoration: none;
  background: var(--text);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-auth:hover {
  opacity: 0.92;
}

.btn-auth.secondary {
  color: var(--text);
  background: transparent;
  border-color: var(--border-subtle);
}

.btn-auth.secondary:hover {
  border-color: rgba(148, 163, 184, 0.35);
}

.auth-user {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Auth shell: loading / gate / signed-in app --- */
body.auth-resolving .main-workspace {
  display: none !important;
}

body.auth-resolving .auth-gate {
  display: none !important;
}

body.auth-resolving .auth-loading {
  display: flex;
}

body:not(.auth-resolving) .auth-loading {
  display: none !important;
}

.auth-loading {
  position: fixed;
  inset: 0;
  z-index: 40;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
}

.auth-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.auth-loading-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--teal), #38bdf8);
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.25);
}

.auth-loading-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

body.auth-needs-login .main-workspace {
  display: none !important;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: var(--bg-deep);
}

.auth-gate[hidden] {
  display: none !important;
}

.auth-gate-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.auth-gate-error {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: var(--radius-md);
}

.auth-gate-error[hidden] {
  display: none !important;
}

.auth-gate-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.auth-gate-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-gate-tagline {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-gate-lead {
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
}

.btn-google-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn-google-primary:hover {
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-google-primary:active {
  transform: scale(0.99);
}

.btn-google-icon {
  display: flex;
  flex-shrink: 0;
}

.auth-gate-foot {
  margin: 1.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

/* Scrolls with chat so it does not permanently steal height from the video area */
.chat > .chat-header {
  flex-shrink: 0;
  margin-bottom: 1rem;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--teal), #38bdf8);
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.25);
}

.brand-text h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

.header-hint {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.config-banner {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-md);
}

.config-banner[hidden] {
  display: none !important;
}

.chat {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 0.5rem;
  scroll-behavior: smooth;
}

.msg {
  max-width: 92%;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  animation: msg-in 0.35s var(--transition) both;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .msg {
    animation: none;
  }
  .ambient {
    animation: none;
  }
}

.msg.assistant {
  align-self: flex-start;
  background: var(--bg-elevated);
  border-left: 3px solid var(--teal);
}

.msg.user {
  align-self: flex-end;
  background: var(--teal-dim);
  border-color: rgba(45, 212, 191, 0.35);
}

.msg-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin-bottom: 0.45rem;
}

.msg-body {
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-body strong {
  color: var(--text);
  font-weight: 600;
}

.result-card {
  margin-top: 0.75rem;
  padding: 1rem;
  background: rgba(10, 15, 26, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.result-section {
  margin-top: 0.75rem;
}

.result-section:first-child {
  margin-top: 0;
}

.result-section h3 {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber);
}

.result-section ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.result-section li {
  margin: 0.25rem 0;
}

.badge {
  display: inline-block;
  margin-top: 0.65rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.video-wrap {
  margin-top: 1rem;
  border-radius: var(--radius-md);
  /* overflow:visible so native controls (incl. fullscreen) are not clipped */
  overflow: visible;
  border: 1px solid var(--border-subtle);
  background: #000;
}

.video-wrap video {
  display: block;
  width: 100%;
  vertical-align: middle;
  max-height: min(62vh, 520px);
  border-radius: var(--radius-md);
  background: #000;
}

.video-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.btn-video-fs {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.45);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.btn-video-fs:hover {
  background: rgba(45, 212, 191, 0.22);
  border-color: rgba(45, 212, 191, 0.65);
}

.btn-video-fs:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bg-deep);
  background: var(--teal);
  border: none;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.btn-link:hover {
  background: #5eead4;
  transform: translateY(-1px);
}

.btn-link.secondary {
  background: transparent;
  color: var(--teal);
  border: 1px solid rgba(45, 212, 191, 0.45);
}

.btn-link.secondary:hover {
  background: var(--teal-dim);
  transform: translateY(-1px);
}

.msg.error {
  border-left: 3px solid var(--danger);
  background: rgba(248, 113, 113, 0.08);
}

.msg.error .msg-label {
  color: var(--danger);
}

.typing {
  display: flex;
  gap: 0.35rem;
  padding: 0.5rem 0;
}

.typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  opacity: 0.4;
  animation: bounce 1.2s ease-in-out infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .typing span {
    animation: none;
    opacity: 0.7;
  }
}

.composer-wrap {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  padding-top: 0.75rem;
  margin-top: auto;
  background: linear-gradient(to top, var(--bg-deep) 85%, transparent);
}

.composer {
  padding: 1.1rem 1.15rem;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  contain: layout;
}

.composer-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}

.composer-row-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
}

.field-lang {
  min-width: 0;
}

@media (min-width: 540px) {
  .composer-row-main {
    grid-template-columns: minmax(140px, auto) minmax(0, 1fr);
    align-items: end;
    gap: 1rem;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.field-grow {
  min-width: 0;
}

.field-label {
  display: block;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.select,
.textarea {
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(10, 15, 26, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.select {
  min-width: 140px;
  cursor: pointer;
}

.textarea {
  width: 100%;
  resize: vertical;
  min-height: 3.25rem;
}

.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}

.composer-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.composer-actions .status {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1.2em;
  min-width: 0;
}

/* Grid: controls always share row 1 with Generate (col 2) — no wrap onto a lone second row. */
.composer-actions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.composer-actions-center {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem 1rem;
  min-width: 0;
}

.field-voice-picker {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 14.5rem;
  position: relative;
}

.field-voice-picker[hidden] {
  display: none !important;
}

.voice-picker {
  position: relative;
  width: 100%;
}

.voice-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  text-align: left;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0.55rem 0.7rem;
}

.voice-picker-trigger-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-picker-chevron {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.75;
}

.voice-picker.is-open .voice-picker-chevron {
  transform: rotate(-135deg) translateY(2px);
}

.voice-picker-panel {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  max-height: min(52vh, 18rem);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.voice-picker-panel[hidden] {
  display: none !important;
}

.voice-picker-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 0.25rem;
  scrollbar-gutter: stable;
}

.voice-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.35rem 0.45rem 0.35rem 0.35rem;
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}

.voice-picker-row:last-child {
  border-bottom: none;
}

.voice-picker-row:hover,
.voice-picker-row:focus-visible {
  background: rgba(45, 212, 191, 0.08);
  outline: none;
}

.voice-picker-row.is-selected {
  background: rgba(251, 191, 36, 0.12);
}

.voice-picker-row-main {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}

.voice-picker-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
  display: flex;
  align-items: center;
}

.voice-picker-gender {
  flex-shrink: 0;
  margin-left: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
  opacity: 0.9;
}

.voice-picker-gender.muted {
  color: var(--text-muted);
  font-weight: 500;
}

.voice-picker-play {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 15, 26, 0.5);
  color: var(--amber);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.voice-picker-play:hover,
.voice-picker-play:focus-visible {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.12);
  outline: none;
}

.voice-picker-play svg {
  width: 0.65rem;
  height: 0.65rem;
  margin-left: 2px;
}

.voice-picker-play.is-playing {
  border-color: rgba(45, 212, 191, 0.55);
  color: var(--teal);
}

.voice-picker-play-placeholder {
  width: 1.75rem;
  flex-shrink: 0;
}

.duration-enhance-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.85rem;
  flex: 0 0 auto;
  min-width: 0;
}

.field-duration-only {
  flex: 0 0 auto;
  min-width: 0;
}

.field-enhance {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}

.field-label-enhance {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
}

.enhance-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

.enhance-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.enhance-switch-track {
  position: relative;
  display: block;
  width: 1.85rem;
  height: 1.05rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  border: 1px solid var(--border-subtle);
  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
  flex-shrink: 0;
}

.enhance-switch-track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: var(--text);
  transform: translate(0, -50%);
  transition: transform var(--transition), background var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.enhance-switch-input:checked + .enhance-switch-track {
  background: rgba(251, 191, 36, 0.35);
  border-color: rgba(251, 191, 36, 0.55);
}

.enhance-switch-input:checked + .enhance-switch-track::after {
  transform: translate(0.82rem, -50%);
  background: var(--amber);
}

.enhance-switch-input:focus-visible + .enhance-switch-track {
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.28);
}

.select-duration {
  min-width: 6.5rem;
}

.composer-logo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.btn-upload-logo {
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.45);
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.btn-upload-logo:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.65);
}

.btn-upload-logo:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25);
}

.logo-filename {
  font-size: 0.68rem;
  color: var(--text-muted);
  max-width: 12rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-actions .btn-primary-composer {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 1.35rem;
  font-size: 0.9rem;
  box-shadow: 0 6px 22px rgba(251, 191, 36, 0.22);
}

@media (max-width: 539px) {
  .composer-actions-row {
    grid-template-columns: 1fr;
    row-gap: 0.75rem;
  }

  .composer-actions-center {
    grid-column: 1;
    grid-row: 1;
    justify-content: center;
  }

  .composer-actions .btn-primary-composer {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
}

.btn-primary {
  position: relative;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: #0a0f1a;
  background: linear-gradient(135deg, var(--amber), var(--amber-hover));
  border: none;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(251, 191, 36, 0.28);
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(251, 191, 36, 0.35);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-primary .btn-spinner {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(10, 15, 26, 0.25);
  border-top-color: #0a0f1a;
  border-radius: 50%;
  margin-left: 0.5rem;
  vertical-align: middle;
  animation: spin 0.7s linear infinite;
}

.btn-primary.loading .btn-text {
  opacity: 0.9;
}

.btn-primary.loading .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary .btn-spinner {
    animation: none;
    border-color: #0a0f1a;
  }
}
