* { box-sizing: border-box; }

:root {
  color-scheme: dark;
  --bg: #06110d;
  --panel: rgba(8, 26, 20, .76);
  --panel-2: rgba(6, 18, 15, .72);
  --line: rgba(125, 166, 145, .28);
  --text: #f2fff8;
  --muted: #aac2b5;
  --accent: #4ee0a2;
  --accent-2: #d5b35a;
  --danger: #ff6b6b;
  --shadow: rgba(0, 0, 0, .28);
}

/* Stitch Cinematic Precision account/settings layer */
:root {
  --studio-bg: #0a0a0a;
  --studio-surface: #131313;
  --studio-low: #1c1b1b;
  --studio-container: #201f1f;
  --studio-high: #2a2a2a;
  --studio-highest: #353534;
  --studio-text: #e5e2e1;
  --studio-muted: #bacbbd;
  --studio-outline: #849588;
  --studio-outline-soft: #3b4a40;
  --studio-primary: #00e38f;
  --studio-primary-soft: #2ef8a0;
  --studio-on-primary: #002111;
}

body.is-signed-in .signedOutOnly,
body.is-signed-out .signedInOnly {
  display: none !important;
}

.accountView {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 148px);
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(19, 19, 19, .82);
  backdrop-filter: blur(20px);
  border-radius: 8px;
  overflow: hidden;
}

.accountCanvas {
  padding: 24px;
  min-width: 0;
}

.accountHero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.accountHero span,
.dialogEyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--studio-primary);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.accountHero h2 {
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
}

.accountHero p {
  margin: 8px 0 0;
  max-width: 560px;
  color: var(--studio-muted);
  line-height: 1.5;
}

.secondaryIconAction {
  width: auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-color: rgba(255, 255, 255, .12);
  background: rgba(28, 27, 27, .86);
}

.secondaryIconAction .material-symbols-outlined {
  margin: 0;
  font-family: "Material Symbols Outlined";
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.accountGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 16px;
  align-items: start;
}

.studioCard {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(28, 27, 27, .85);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .24);
}

.accountProfileCard,
.signedOutOnly.studioCard {
  grid-column: span 2;
}

.accountIdentity,
.signedOutHero,
.studioCardHeader {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profilePhotoControl {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.profilePhotoControl input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.accountPageAvatar {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 2px solid var(--studio-primary);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  font-size: 22px;
  box-shadow: 0 0 0 1px rgba(0, 227, 143, .18), 0 16px 34px rgba(0, 0, 0, .35);
}

.photoBadge {
  position: absolute;
  right: -8px;
  bottom: -7px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--studio-primary-soft);
  color: var(--studio-on-primary);
  border: 1px solid rgba(0, 0, 0, .2);
  pointer-events: none;
  z-index: 2;
}

.accountIdentity h2,
.signedOutHero h2 {
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 28px;
  line-height: 1.2;
}

.accountIdentity p,
.signedOutHero p,
.studioCardHeader p,
.studioCard small {
  color: var(--studio-muted);
}

.providerPill,
.activeBadge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(45, 77, 66, .52);
  color: var(--studio-primary);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rolePill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  margin-left: 8px;
  padding: 5px 10px;
  border: 1px solid rgba(132, 149, 136, .24);
  border-radius: 999px;
  color: var(--studio-muted);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rolePill .material-symbols-outlined {
  color: currentColor;
  font-size: 16px;
}

.rolePill[data-role="developer"] {
  border-color: rgba(0, 227, 143, .34);
  color: var(--studio-primary);
}

.rolePill[data-role="owner"] {
  border-color: rgba(46, 248, 160, .5);
  background: rgba(46, 248, 160, .1);
  color: var(--studio-primary);
}

.syncStatusRow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: var(--studio-text);
}

.syncStatusRow .material-symbols-outlined {
  color: var(--studio-primary);
}

.syncStatusRow i {
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--studio-primary);
  box-shadow: 0 0 16px rgba(0, 227, 143, .75);
}

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

.accountActionRow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.accountActionRow button {
  width: auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 16px;
}

.signedOutHero > .material-symbols-outlined {
  font-size: 56px;
  color: var(--studio-primary);
}

.accessList {
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  overflow: hidden;
}

.accessList button,
.preferenceRows button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  border-radius: 0;
  background: rgba(42, 42, 42, .45);
  text-align: left;
}

.accessList button:last-child,
.preferenceRows button:last-child {
  border-bottom: 0;
}

.accessList button::after,
.preferenceRows button::after {
  content: "chevron_right";
  font-family: "Material Symbols Outlined";
  color: var(--studio-muted);
  font-size: 22px;
}

.googleAccessButton {
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: center;
  color: var(--studio-text);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: .08em;
}

.googleAccessButton::after {
  content: none !important;
}

.studioCardHeader {
  align-items: flex-start;
  margin-bottom: 12px;
}

.studioCardHeader > .material-symbols-outlined {
  color: var(--studio-primary);
}

.studioCardHeader h3 {
  margin: 0 0 4px;
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 15px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.studioCardHeader p {
  margin: 0;
  font-size: 13px;
}

.preferenceRows {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  overflow: hidden;
}

.preferenceRows strong {
  color: var(--studio-text);
}

.preferenceRows em {
  color: var(--studio-primary);
  font-style: normal;
  justify-self: end;
}

.activeBadge {
  margin: 0 0 0 auto;
  border-radius: 4px;
}

.activeBadge.inactive {
  color: var(--studio-muted);
  background: rgba(53, 53, 52, .68);
}

.storageMeter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.storageMeter span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--studio-primary);
}

.settingsStudioDialog .authPanel {
  width: min(840px, calc(100vw - 28px));
}

.settingsStudioPanel {
  gap: 16px;
}

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

.settingsStudioCard {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(28, 27, 27, .86);
}

.settingsStudioCard h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--studio-muted);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.settingsStudioCard h3 .material-symbols-outlined {
  color: var(--studio-primary);
}

.settingsStudioCard small {
  color: var(--studio-muted);
  font-style: italic;
}

.settingsInfoRows {
  display: grid;
  gap: 8px;
}

.settingsInfoRows p,
.settingsStorageStatus {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 9px 10px;
  border-radius: 4px;
  background: rgba(53, 53, 52, .55);
}

.settingsInfoRows span,
.settingsStorageStatus span {
  color: var(--studio-primary);
}

.dangerLite {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  color: var(--danger);
  border-color: rgba(255, 180, 171, .22);
}

.settingsActionBar {
  display: flex;
  justify-content: flex-end;
}

.settingsActionBar .primary {
  width: auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 18px;
}

@media (max-width: 900px) {
  .accountView {
    display: block;
    min-height: auto;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .accountView .historySideNav {
    display: none;
  }

  .accountCanvas {
    padding: 0 14px calc(116px + env(safe-area-inset-bottom));
  }

  .accountHero {
    align-items: flex-start;
    padding-inline: 0;
  }

  .accountHero h2 {
    font-size: 26px;
  }

  .secondaryIconAction {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    font-size: 0;
    overflow: hidden;
  }

  .secondaryIconAction .buttonText {
    display: none;
  }

  .secondaryIconAction .material-symbols-outlined {
    font-size: 22px;
  }

  .accountGrid,
  .accountEditGrid,
  .settingsCardGrid {
    grid-template-columns: 1fr;
  }

  .accountProfileCard,
  .signedOutOnly.studioCard {
    grid-column: auto;
  }

  .accountIdentity {
    align-items: flex-start;
  }

  .accountPageAvatar {
    width: 72px;
    height: 72px;
  }

  .accountIdentity h2,
  .signedOutHero h2 {
    font-size: 24px;
  }

  .accountActionRow {
    display: grid;
    grid-template-columns: 1fr;
  }

  .accountActionRow button {
    width: 100%;
  }

  .settingsStudioDialog .authPanel {
    width: min(100vw - 18px, 520px);
    max-height: min(86vh, 760px);
    overflow: auto;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf5ef;
  --panel: rgba(255, 255, 255, .82);
  --panel-2: rgba(246, 250, 247, .78);
  --line: rgba(38, 88, 67, .22);
  --text: #10221a;
  --muted: #52675b;
  --accent: #087f5b;
  --accent-2: #9a6b10;
  --danger: #c92a2a;
  --shadow: rgba(31, 57, 45, .14);
}

body {
  margin: 0;
  overflow-x: hidden;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.auth-loading #accountStatus,
.auth-loading #accountBtn,
.auth-loading .signedInOnly,
.auth-loading .signedOutOnly {
  visibility: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -22px;
  z-index: -2;
  background:
    url("https://images.unsplash.com/photo-1448375240586-882707db888b?auto=format&fit=crop&w=1800&q=80")
    center / cover no-repeat;
  filter: blur(14px) saturate(1.05);
  transform: scale(1.04);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(3, 14, 10, .92), rgba(8, 36, 27, .72) 44%, rgba(5, 13, 16, .9)),
    radial-gradient(circle at 82% 12%, rgba(78, 224, 162, .16), transparent 32%);
  pointer-events: none;
}

:root[data-theme="light"] body::after {
  background:
    linear-gradient(135deg, rgba(240, 249, 243, .9), rgba(230, 244, 235, .68) 46%, rgba(247, 251, 249, .88)),
    radial-gradient(circle at 82% 12%, rgba(8, 127, 91, .12), transparent 32%);
}

.appShell {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px 0 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.downloadHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -4px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(78, 224, 162, .24);
  border-radius: 8px;
  background: rgba(6, 18, 15, .82);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .18);
  backdrop-filter: blur(16px);
}

.downloadHeader div {
  min-width: 0;
}

.downloadHeaderKicker {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.downloadHeader strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.downloadHeaderActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.downloadHeaderActions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid rgba(78, 224, 162, .36);
  border-radius: 8px;
  color: var(--accent);
  background: rgba(78, 224, 162, .08);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.downloadHeaderActions a:hover {
  color: #03110b;
  background: var(--accent);
}

.brandBlock {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.appLogo {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(126, 240, 189, .45);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .24);
}

.brandText {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 800;
}

h1, h2 {
  margin: 0;
  letter-spacing: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

.accountArea {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: min(100%, 330px);
}

.accountStatus {
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.accountStatus.signedOutStatus {
  display: none;
}

.avatarButton {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  border-color: var(--accent);
  background: var(--panel-2);
  background-position: center;
  background-size: cover;
  color: var(--accent);
  display: inline-grid;
  place-items: center;
  font-size: 13px;
}

.avatarButton.signedOut {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  border-color: transparent;
  background: transparent;
  background-image: none !important;
  color: var(--text);
  font-weight: 850;
  box-shadow: none;
}

.settingsButton {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  font-weight: 850;
  box-shadow: none;
}

.iconButton {
  display: inline-grid;
  place-items: center;
  line-height: 1;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.settingsButton:hover,
.avatarButton.signedOut:hover {
  background: rgba(78, 224, 162, .12);
  transform: translateY(-1px);
}

.settingsButton:focus-visible,
.avatarButton.signedOut:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.iconButton svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.avatarButton::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -6px;
}

.avatarButton.hasImage::after {
  content: none;
}

.avatarButton.signedOut::after {
  content: none;
}

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

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 18px 50px var(--shadow);
  backdrop-filter: blur(18px);
}

.controls {
  display: grid;
  gap: 16px;
}

.result {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.sectionHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.authPanel > .sectionHeader {
  flex-direction: row;
  align-items: center;
}

.sectionHeader span,
small {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  font-weight: 520;
  line-height: 1.35;
}

.apiKeyHelp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.apiKeyHelp a {
  color: var(--accent);
  font-weight: 850;
  text-decoration: none;
}

.apiKeyHelp a:hover {
  text-decoration: underline;
}

.inlineHelpBtn {
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 750;
  font-size: 14px;
}

.tip {
  position: relative;
}

.tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(260px, calc(100vw - 36px));
  max-width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 16, 12, .96);
  box-shadow: 0 14px 34px var(--shadow);
  color: var(--text);
  font-size: 12px;
  font-style: italic;
  font-weight: 560;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
}

button.tip::after,
.modelActions .tip::after {
  left: auto;
  right: 0;
  max-width: min(260px, calc(100vw - 36px));
}

button.tip::before,
.modelActions .tip::before {
  left: auto;
  right: 18px;
}

.tip::before {
  content: "";
  position: absolute;
  left: 16px;
  bottom: calc(100% + 2px);
  z-index: 21;
  width: 10px;
  height: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 16, 12, .96);
  opacity: 0;
  pointer-events: none;
  transform: rotate(45deg) translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
}

.tip:hover::after,
.tip:hover::before,
.tip:focus::after,
.tip:focus::before,
.tip:focus-within::after,
.tip:focus-within::before {
  opacity: 1;
  transform: translateY(0);
}

.tip:hover::before,
.tip:focus::before,
.tip:focus-within::before {
  transform: rotate(45deg) translateY(0);
}

.twoCol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.controlGroup {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.optionStack {
  display: grid;
  gap: 9px;
}

.modelActions {
  display: grid;
  grid-template-columns: minmax(180px, auto) 1fr;
  gap: 10px;
  align-items: center;
}

.modelActions button {
  width: 100%;
}

.captureGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(220px, .92fr);
  gap: 16px;
  align-items: start;
}

.captureColumn {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.compactHeader h2 {
  font-size: 15px;
}

.check {
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  font-weight: 650;
  line-height: 1.25;
}

input, select, textarea, button {
  min-width: 0;
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 11px 12px;
}

input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  padding: 0;
  display: grid;
  place-content: center;
  border: 1.5px solid color-mix(in srgb, var(--muted), white 20%);
  border-radius: 6px;
  background: rgba(3, 12, 9, .7);
  accent-color: var(--accent);
}

input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #03120c;
  border-bottom: 2px solid #03120c;
  opacity: 0;
  transform: rotate(-45deg) translateY(-1px);
}

input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

input[type="checkbox"]:checked::before {
  opacity: 1;
}

textarea {
  width: 100%;
  min-height: clamp(150px, 28dvh, 240px);
  resize: vertical;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.scriptBox {
  min-height: 110px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent), transparent 55%);
  border-color: var(--accent);
}

button {
  cursor: pointer;
  font-weight: 850;
  white-space: normal;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #03120c;
}

.googleBtn {
  background: #f8fafc;
  color: #172033;
}

.recordBox {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
}

#recordStatus {
  color: var(--muted);
  font-size: 13px;
}

.recordingList {
  display: grid;
  gap: 8px;
}

.recordingItem {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.recordingItem.active {
  border-color: var(--accent);
}

.recordingName {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.miniBtn {
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--accent);
  font-size: 12px;
}

.status {
  min-height: 22px;
  margin: 0;
  color: var(--accent);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.advancedBlock {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.advancedBlock summary,
.originalBlock summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 850;
}

.betaBadge {
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 45%);
  border-radius: 999px;
  color: var(--accent-2);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
}

.advancedBlock label {
  margin-top: 12px;
}

.originalBlock {
  margin: 0;
}

.originalBlock textarea {
  min-height: 140px;
  margin-top: 10px;
}

.llmFixBox {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-2);
  backdrop-filter: blur(14px);
}

.llmFixBox h2 {
  font-size: 16px;
}

.llmButtons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hinglishPasteBox {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 227, 143, .24);
  border-radius: 8px;
  background: rgba(0, 227, 143, .05);
}

.hinglishPasteBox label {
  gap: 8px;
}

.hinglishPasteBox textarea {
  min-height: 150px;
  font-family: Geist, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre;
}

.hinglishPasteActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hinglishPasteActions button {
  width: auto;
  min-height: 40px;
}

.authDialog {
  width: min(430px, calc(100% - 28px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 22px 60px var(--shadow);
  backdrop-filter: blur(18px);
}

.promptDialog {
  width: min(780px, calc(100% - 28px));
}

.hinglishPasteDialog {
  width: min(820px, calc(100% - 28px));
}

.hinglishPastePanel {
  gap: 16px;
}

.dialogEyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hinglishPasteDialog .hinglishPasteBox {
  margin: 0;
}

.hinglishPasteDialog .hinglishPasteBox textarea {
  min-height: min(46dvh, 360px);
  max-height: 52dvh;
  resize: vertical;
}

.guideDialog {
  width: min(520px, calc(100% - 28px));
}

.promptDialog textarea {
  min-height: min(360px, 48dvh);
}

.mutedText {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.guideSteps {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.65;
}

.guideLink {
  display: block;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  padding: 11px 12px;
  font-weight: 850;
}

.docLink {
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}

.docLink:hover {
  text-decoration: underline;
}

.authDialog::backdrop {
  background: rgba(2, 12, 8, .72);
}

.authPanel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.settingsSection {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.accountProfileSection {
  border-top: 0;
  padding-top: 0;
}

.avatarPreview {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--panel-2);
  background-position: center;
  background-size: cover;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.authTabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.authTabs button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.closeDialogBtn {
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .result textarea {
    min-height: clamp(160px, 24dvh, 230px);
  }
}

@media (max-width: 720px) {
  .appShell {
    width: min(100% - 20px, 1320px);
    padding-top: 14px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
  }

  .brandBlock {
    gap: 10px;
  }

  .appLogo {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-radius: 14px;
  }

  .accountArea {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: end;
    align-items: center;
    min-width: 0;
  }

  .accountStatus {
    display: none;
  }

  .sectionHeader {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .authPanel > .sectionHeader {
    align-items: center;
    flex-direction: row;
  }

  .twoCol,
  .captureGrid,
  .modelActions,
  .recordBox,
  .llmButtons {
    grid-template-columns: 1fr;
  }

  #recordStatus {
    grid-column: auto;
  }

  #downloadBtn,
  #editSubtitlesBtn,
  .authTabs button,
  .recordBox button,
  .llmButtons button {
    width: 100%;
  }

  .panel,
  .authPanel,
  .llmFixBox {
    padding: 14px;
  }

  h1 {
    font-size: 26px;
  }
}

@media (max-width: 460px) {
  .appShell {
    width: min(100% - 22px, 1320px);
    padding-top: 10px;
    padding-bottom: 20px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: center;
    gap: 8px;
    position: relative;
    padding: 8px 0 14px;
    margin-bottom: 14px;
  }

  .brandBlock {
    align-items: center;
    gap: 10px;
    padding-right: 108px;
  }

  .appLogo {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    border-radius: 14px;
  }

  .eyebrow {
    max-width: 180px;
    font-size: 11px;
    line-height: 1.25;
  }

  h1 {
    font-size: 24px;
    line-height: 1.05;
  }

  .accountArea {
    display: grid;
    grid-template-columns: 48px 48px;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    justify-content: end;
    align-items: center;
    gap: 10px;
    width: auto;
  }

  .accountStatus {
    display: none;
  }

  .settingsButton,
  .avatarButton.signedOut {
    width: 48px;
    min-width: 48px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }

  .iconButton svg {
    width: 21px;
    height: 21px;
  }

  input,
  select,
  textarea,
  button {
    padding: 11px 12px;
  }

  .panel {
    padding: 16px;
  }

  .sectionHeader {
    gap: 6px;
  }

  .controlGroup {
    gap: 14px;
    padding-top: 16px;
  }

  .captureGrid,
  .twoCol {
    gap: 14px;
  }

  .check {
    align-items: start;
  }

  .authDialog {
    width: min(100% - 14px, 430px);
  }
}

@media (max-width: 360px) {
  .brandBlock {
    padding-right: 96px;
  }

  .appLogo {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .eyebrow {
    max-width: 150px;
    font-size: 10px;
  }

  h1 {
    font-size: 22px;
  }

  .settingsButton,
  .avatarButton.signedOut {
    width: 44px;
    min-width: 44px;
  }

  .accountArea {
    grid-template-columns: 44px 44px;
    gap: 6px;
  }
}

/* Stitch-inspired editor redesign */
:root {
  --bg: #131313;
  --panel: rgba(28, 27, 27, .86);
  --panel-2: rgba(14, 14, 14, .82);
  --surface-low: #1c1b1b;
  --surface-mid: #201f1f;
  --surface-high: #2a2a2a;
  --line: rgba(132, 149, 136, .22);
  --text: #e5e2e1;
  --muted: #bacbbd;
  --accent: #00e38f;
  --accent-2: #53ffab;
  --danger: #ffb4ab;
  --shadow: rgba(0, 0, 0, .32);
}

:root[data-theme="light"] {
  --bg: #eef6f1;
  --panel: rgba(255, 255, 255, .88);
  --panel-2: rgba(247, 251, 249, .86);
  --surface-low: #ffffff;
  --surface-mid: #eff7f2;
  --surface-high: #e5f0ea;
  --line: rgba(45, 77, 66, .22);
  --text: #16231d;
  --muted: #50685c;
  --accent: #007c4d;
  --accent-2: #00a86b;
  --danger: #a22b25;
  --shadow: rgba(25, 58, 43, .14);
}

body {
  min-height: 100dvh;
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  overflow: visible;
  max-width: none;
}

.material-symbols-outlined,
button .material-symbols-outlined,
.outputHeaderActions .material-symbols-outlined {
  font-style: normal !important;
}

body::before {
  background:
    radial-gradient(circle at 52% 46%, rgba(0, 227, 143, .12), transparent 58%),
    linear-gradient(135deg, #111615, #0b1712 44%, #131313);
  filter: none;
  transform: none;
}

body::after {
  background:
    linear-gradient(135deg, rgba(19, 19, 19, .94), rgba(8, 33, 25, .78) 48%, rgba(19, 19, 19, .96)),
    radial-gradient(circle at 82% 16%, rgba(0, 227, 143, .1), transparent 28%);
}

.appShell {
  width: 100%;
  min-height: 100dvh;
  padding: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 48px;
  margin: 0;
  padding: 0 24px;
  border-bottom: 1px solid rgba(132, 149, 136, .24);
  background: rgba(19, 19, 19, .88);
  backdrop-filter: blur(18px);
}

.brandBlock {
  gap: 12px;
}

.appLogo {
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  object-fit: cover;
}

.brandBlock::before {
  content: none;
  display: none;
}

.eyebrow {
  display: none;
}

h1 {
  font-size: 20px;
  line-height: 1.1;
  font-family: Geist, Inter, system-ui, sans-serif;
}

h2 {
  font-size: 17px;
  font-family: Geist, Inter, system-ui, sans-serif;
}

.accountArea {
  min-width: 0;
  gap: 14px;
}

.accountStatus {
  font-size: 12px;
}

.settingsButton,
.avatarButton,
.avatarButton.signedOut {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 999px;
}

.settingsButton:hover,
.avatarButton.signedOut:hover,
.avatarButton:hover {
  background-color: rgba(0, 227, 143, .1);
}

.iconButton svg {
  width: 20px;
  height: 20px;
}

.workspace {
  height: calc(100dvh - 48px);
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  overflow: hidden;
}

.panel {
  border-radius: 0;
  border: 0;
  background: var(--panel);
  box-shadow: none;
  backdrop-filter: blur(20px);
}

.controls {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 16px 16px 118px;
  border-right: 1px solid rgba(132, 149, 136, .22);
}

.result {
  height: 100%;
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 52px minmax(0, 1fr) auto;
  gap: 0;
  background: rgba(19, 19, 19, .92);
}

.result > .sectionHeader {
  grid-column: 1 / -1;
  padding: 0 22px;
  border-bottom: 1px solid rgba(132, 149, 136, .2);
  background: rgba(19, 19, 19, .58);
}

.result > label {
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  border-bottom: 1px solid rgba(132, 149, 136, .16);
  color: transparent;
  font-size: 0;
}

.result > label:has(#transcriptText) {
  border-right: 1px solid rgba(132, 149, 136, .16);
}

.result > label:has(#srtText) {
  border-right: 0;
}

.result > .outputPane {
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  border-bottom: 1px solid rgba(132, 149, 136, .16);
  overflow: hidden;
}

.outputPaneTranscript {
  border-right: 1px solid rgba(132, 149, 136, .16);
}

.outputPaneSrt {
  border-right: 0;
}

.outputPaneHeader {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(132, 149, 136, .1);
}

.outputPaneHeader h3 {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.outputPaneDelete {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-high), transparent 18%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.outputPaneDelete .material-symbols-outlined {
  font-size: 17px;
}

.outputPaneDelete:not(:disabled):hover {
  border-color: rgba(255, 180, 171, .42);
  color: var(--danger);
  background: rgba(255, 180, 171, .08);
}

.outputPaneDelete:disabled {
  opacity: .38;
}

.result > label::before {
  content: attr(for);
}

.result > label:has(#transcriptText)::before {
  content: "Raw Transcript";
}

.result > label:has(#srtText)::before {
  content: "Subtitles (SRT)";
}

.result > label::before,
.compactHeader span,
.sectionHeader > span {
  padding: 10px 18px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.result textarea {
  min-height: 0;
  height: 100%;
  align-self: start;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 18px 22px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 520;
}

.result textarea::placeholder {
  color: color-mix(in srgb, var(--muted), transparent 28%);
  font-size: 14px;
}

.result textarea[hidden] {
  display: none;
}

.outputPreviewText {
  min-height: 0;
  height: 100%;
  margin: 0;
  overflow: auto;
  align-self: start;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 18px 22px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 520;
}

.outputPreviewText:empty::before,
.outputPreviewText.empty::before {
  content: attr(data-placeholder);
  color: color-mix(in srgb, var(--muted), transparent 28%);
}

.is-generating .outputPreviewText.empty {
  position: relative;
  overflow: hidden;
}

.is-generating .outputPreviewText.empty::before {
  content: "";
  display: block;
  width: min(82%, 520px);
  height: 16px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(78, 224, 162, .12), rgba(78, 224, 162, .34), rgba(78, 224, 162, .12));
  background-size: 220% 100%;
  animation: skeletonSweep 1.18s ease-in-out infinite;
  box-shadow:
    0 30px 0 rgba(78, 224, 162, .11),
    0 60px 0 rgba(78, 224, 162, .09),
    0 90px 0 rgba(78, 224, 162, .12),
    0 120px 0 rgba(78, 224, 162, .08);
}

.isGenerating .material-symbols-outlined,
.mobileSubmitButton.isGenerating .material-symbols-outlined {
  animation: aiSpin 1.15s linear infinite;
}

.llmFixBox {
  grid-column: 1 / -1;
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
  background: rgba(14, 14, 14, .92);
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, auto);
  align-items: center;
  padding: 14px 18px;
}

.llmButtons {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px;
}

.llmFixBox .status {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.llmButtons button,
#downloadBtn,
#editTranscriptBtn,
#editSubtitlesBtn {
  padding: 8px 14px;
  border-radius: 7px;
  background: var(--surface-high);
}

.controlGroup,
.advancedBlock {
  border-color: rgba(132, 149, 136, .16);
}

.sectionHeader {
  min-width: 0;
}

label {
  font-size: 13px;
  font-weight: 760;
}

input,
select,
textarea,
button {
  border-radius: 7px;
  border-color: rgba(132, 149, 136, .28);
  background: rgba(14, 14, 14, .72);
}

input:focus,
select:focus,
textarea:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #003920;
}

.primary:hover,
.primary:focus-visible,
#submitBtn:hover,
#submitBtn:focus-visible,
.mobileSubmitButton:hover,
.mobileSubmitButton:focus-visible {
  background: #53ffab;
  border-color: #53ffab;
  color: #002111;
  transform: translateY(-1px);
  box-shadow: 0 -12px 38px rgba(0, 0, 0, .45), 0 0 28px rgba(0, 227, 143, .26);
}

.primary:active,
#submitBtn:active,
.mobileSubmitButton:active {
  transform: translateY(0) scale(.99);
}

#submitBtn {
  position: static;
  margin-top: 18px;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid rgba(46, 248, 160, .75);
  font-size: 16px;
  box-shadow: 0 0 22px rgba(0, 227, 143, .18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.waveformPreview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 72px;
  margin: 2px 0 6px;
  overflow: hidden;
  border: 1px solid rgba(59, 74, 64, .18);
  border-radius: 4px;
  background: #0e0e0e;
}

.waveformPreview::before,
.waveformPreview::after {
  content: "";
  position: absolute;
  inset-block: 0;
  width: 32%;
  pointer-events: none;
}

.waveformPreview::before {
  left: 0;
  background: linear-gradient(90deg, #0e0e0e, transparent);
}

.waveformPreview::after {
  right: 0;
  background: linear-gradient(270deg, #0e0e0e, transparent);
}

.waveformPreview span {
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  opacity: .72;
  animation: wavePulse 1.05s ease-in-out infinite;
}

.waveformPreview span:nth-child(2n) { height: 28px; animation-delay: .12s; }
.waveformPreview span:nth-child(3n) { height: 36px; animation-delay: .22s; }
.waveformPreview span:nth-child(4n) { height: 22px; animation-delay: .32s; }

#recordBtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

#recordBtn::before {
  content: "mic";
  font-family: "Material Symbols Outlined";
  margin-right: 8px;
  font-size: 20px;
  font-feature-settings: "liga";
}

.newRecordingAction {
  position: relative;
  overflow: hidden;
}

.recordingDot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ff3b30;
  box-shadow: 0 0 0 0 rgba(255, 59, 48, .58);
  animation: redRecordPulse 1.18s ease-out infinite;
}

.newRecordingAction .recordingLabel {
  color: #003920;
  font-style: normal;
  transition: opacity .18s ease, transform .18s ease;
}

body.is-recording .newRecordingAction .recordingDot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
}

body.is-recording .newRecordingAction .recordingLabel {
  opacity: .08;
  transform: translateY(2px);
}

body.is-recording #recordBtn {
  color: transparent;
  opacity: 1;
}

body.is-recording #recordBtn::before {
  content: "";
  position: absolute;
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #ff3b30;
  box-shadow: 0 0 0 0 rgba(255, 59, 48, .58);
  opacity: 1;
  transform: translate(-50%, -50%);
  animation: redRecordPulse 1.18s ease-out infinite;
}

body.is-recording #recordBtn::after {
  content: "Recording";
  color: #003920;
  opacity: .16;
  font-family: Geist, Inter, system-ui, sans-serif;
  text-transform: uppercase;
}

.mobileBottomNav {
  display: none;
}

.mobileSubmitButton {
  display: none;
}

.mobileSubmitButton.isVisible {
  display: inline-flex;
}

/* Restored .controls #submitBtn to be visible on desktop */


.mobileSubmitButton {
  position: fixed;
  left: 20px;
  bottom: 18px;
  z-index: 65;
  width: min(372px, calc(100vw - 40px));
  height: 54px;
  border-radius: 8px;
  font-size: 16px;
  box-shadow: 0 -10px 34px rgba(0, 0, 0, .42), 0 0 22px rgba(0, 227, 143, .18);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
}

.mobileStatusToast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  width: min(440px, calc(100vw - 40px));
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(46, 248, 160, .5);
  border-radius: 16px;
  background: rgba(14, 14, 14, .95);
  color: var(--text);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .42), 0 0 26px rgba(0, 227, 143, .16);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.mobileStatusToast[hidden] {
  display: none !important;
}

.mobileStatusToast .material-symbols-outlined {
  color: var(--accent);
  font-size: 24px;
}

.mobileStatusToast strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 850;
}

.mobileStatusToast.isError {
  border-color: rgba(255, 180, 171, .5);
}

.mobileStatusToast.isError .material-symbols-outlined {
  color: #ffb4ab;
}

.desktopNav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-inline: auto;
}

.desktopNav a {
  height: 48px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.desktopNav a.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.uploadField {
  position: relative;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px 18px;
  border: 2px dashed rgba(132, 149, 136, .32);
  border-radius: 8px;
  background: rgba(53, 53, 52, .12);
  text-align: center;
  cursor: pointer;
}

.uploadField::before {
  content: "cloud_upload";
  font-family: "Material Symbols Outlined";
  color: var(--accent);
  font-size: 34px;
  line-height: 1;
  font-feature-settings: "liga";
}

.uploadTitle {
  display: block;
  width: 100%;
  text-align: center;
}

.uploadPicker {
  display: flex;
  width: 100%;
  justify-content: center;
}

.uploadField input {
  width: max-content;
  max-width: min(100%, 280px);
  border: 0;
  background: transparent;
  padding: 0;
  text-align: center;
  color: var(--text);
}

.uploadField input::file-selector-button {
  margin-right: 8px;
  border: 0;
  border-radius: 5px;
  background: rgba(229, 226, 225, .22);
  color: var(--text);
  font: inherit;
  padding: 4px 8px;
}

.sectionHeader h2 .material-symbols-outlined,
#editTranscriptBtn .material-symbols-outlined,
#editSubtitlesBtn .material-symbols-outlined,
#downloadBtn .material-symbols-outlined,
#submitBtn .material-symbols-outlined,
.mobileSubmitButton .material-symbols-outlined {
  margin-right: 7px;
  vertical-align: -4px;
}

#downloadBtn,
#editTranscriptBtn,
#editSubtitlesBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.systemStatus {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.systemStatus strong {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-style: normal;
}

.systemStatus i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.appView[hidden] {
  display: none !important;
}

.siteFeedbackFooter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 18px auto 24px;
  width: min(100% - 48px, 1320px);
  padding: 18px 20px;
  border: 1px solid rgba(132, 149, 136, .22);
  border-radius: 10px;
  background: rgba(14, 14, 14, .78);
  backdrop-filter: blur(18px);
}

.siteFeedbackFooter strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
}

.footerKicker {
  color: var(--accent);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.footerFeedbackActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.footerFeedbackActions button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 8px;
  background: var(--surface-high);
  color: var(--text);
  font-weight: 850;
}

.footerFeedbackActions button:hover,
.footerFeedbackActions button:focus-visible {
  border-color: rgba(46, 248, 160, .42);
  color: var(--accent);
  background: rgba(46, 248, 160, .08);
}

.feedbackDialog .feedbackPanel {
  max-width: 560px;
}

.feedbackTabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.feedbackTabs button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--surface-high);
  color: var(--muted);
  font-weight: 850;
}

.feedbackTabs button.active {
  border-color: rgba(46, 248, 160, .58);
  background: rgba(46, 248, 160, .12);
  color: var(--accent);
}

.feedbackPanel textarea {
  min-height: 132px;
  resize: vertical;
}

.historyView {
  min-height: calc(100dvh - 48px);
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  background: rgba(19, 19, 19, .82);
}

.historySideNav {
  min-height: calc(100dvh - 48px);
  padding: 14px 0;
  border-right: 1px solid rgba(132, 149, 136, .18);
  background: rgba(28, 27, 27, .72);
  backdrop-filter: blur(20px);
}

.historySideBrand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 22px 24px;
}

.historySideBrand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
}

.historySideBrand strong,
.historySideBrand span {
  display: block;
}

.historySideBrand strong {
  color: var(--text);
  font-family: Geist, Inter, system-ui, sans-serif;
}

.historySideBrand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.historySideNav button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

.historySideNav button:hover,
.historySideNav button.active {
  background: rgba(46, 248, 160, .08);
  color: var(--accent);
}

.historySideNav button.active {
  border-right: 2px solid var(--accent);
}

.historyCanvas {
  min-width: 0;
  padding: 28px 24px 32px;
  overflow-y: auto;
}

.historyHero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.historyHero span {
  color: var(--accent);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.historyHero h2 {
  margin-top: 4px;
  font-size: 32px;
}

.historyHero p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.historyPrimaryAction {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 7px;
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.transcriptNewBatchAction {
  align-self: center;
}

.historyStats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.historyStats article {
  min-height: 128px;
  display: grid;
  align-content: space-between;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(28, 27, 27, .76);
  backdrop-filter: blur(18px);
}

.historyStats span,
.historyStats small {
  color: var(--muted);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.historyStats strong {
  min-width: 0;
  color: var(--text);
  font-size: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.historyStats article:first-child strong {
  color: var(--accent);
  font-size: 32px;
}

.historyStats i {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(59, 74, 64, .6);
  overflow: hidden;
}

.historyStats i::before {
  content: "";
  display: block;
  width: var(--voice-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .22s ease;
}

.historyPanel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(28, 27, 27, .78);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

.historyTableHead,
.voiceTableHead,
.historyRow,
.voiceRow {
  display: grid;
  align-items: center;
  gap: 14px;
}

.historyTableHead,
.historyRow {
  grid-template-columns: minmax(260px, 5fr) minmax(140px, 2fr) minmax(86px, 1fr) minmax(190px, 2fr);
}

.voiceTableHead,
.voiceRow {
  grid-template-columns: minmax(220px, 4fr) minmax(140px, 2fr) 72px minmax(170px, 3fr) minmax(190px, 2fr);
}

.historyTableHead,
.voiceTableHead {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(132, 149, 136, .18);
  background: rgba(14, 14, 14, .38);
}

.historyTableHead span,
.voiceTableHead span {
  color: var(--muted);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.historyList {
  display: grid;
}

.historyRow,
.voiceRow {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(132, 149, 136, .11);
  transition: background .16s ease, border-color .16s ease;
}

.historyRow:hover,
.voiceRow:hover {
  background: rgba(53, 53, 52, .22);
}

.historyRow:last-child,
.voiceRow:last-child {
  border-bottom: 0;
}

.historyFile,
.voiceFile {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.historyIcon,
.voiceIcon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(132, 149, 136, .28);
  border-radius: 7px;
  background: rgba(53, 53, 52, .5);
  color: var(--accent);
}

.historyFile strong,
.voiceFile strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.historyFile p {
  margin: 4px 0 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--muted), transparent 18%);
  font-size: 12px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.historyMeta,
.historyDuration {
  color: var(--muted);
  font-size: 13px;
}

.historyMeta small {
  width: max-content;
  display: block;
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(171, 206, 192, .22);
  border-radius: 999px;
  background: rgba(45, 77, 66, .3);
  color: var(--secondary, #abcec0);
  font-size: 9px;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.historyActions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.historyActions button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.historyActions button:hover {
  background: rgba(46, 248, 160, .1);
  color: var(--accent);
}

.historyActions button.danger:hover {
  background: rgba(255, 180, 171, .1);
  color: var(--danger);
}

.waveBars {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.waveBars span {
  width: 3px;
  min-height: 5px;
  border-radius: 999px;
  background: var(--accent);
  opacity: .72;
}

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

.voiceWaveformHeader {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.voiceProgressTrack {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(132, 149, 136, .18);
}

.voiceProgressTrack i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d5b35a);
  transition: width .08s linear;
}

.voiceRow.playing {
  background: rgba(46, 248, 160, .07);
}

.voiceRow.playing .voiceIcon,
.voiceRow.playing .historyActions [data-history-action="play-voice"] {
  color: var(--accent);
}

.emptyHistory {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.emptyHistory .material-symbols-outlined {
  margin-bottom: 14px;
  color: rgba(132, 149, 136, .52);
  font-size: 58px;
  max-width: none;
}

.emptyHistory strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 18px;
}

.studioAssistant {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 2fr;
  gap: 22px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(28, 27, 27, .76);
  backdrop-filter: blur(18px);
}

.studioImage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #0e0e0e;
}

.studioImage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: contrast(1.04) saturate(.92) brightness(.78);
}

.studioImage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, .66));
  pointer-events: none;
}

.studioImage small {
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 1;
  color: rgba(229, 226, 225, .78);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.studioAssistant h3 {
  margin: 0 0 8px;
  font-family: Geist, Inter, system-ui, sans-serif;
}

.studioAssistant p {
  margin: 0 0 12px;
  color: var(--muted);
}

.studioAssistant button {
  padding: 8px 14px;
  color: var(--accent);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.apiKeyHelp,
small {
  font-size: 11px;
}

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

.recordingItem {
  background: var(--surface-mid);
}

.advancedBlock summary,
.originalBlock summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
}

.advancedBlock summary::-webkit-details-marker,
.originalBlock summary::-webkit-details-marker {
  display: none;
}

.advancedBlock summary::after,
.originalBlock summary::after {
  content: "v";
  color: var(--accent);
  transition: transform .16s ease;
}

.advancedBlock[open] summary::after,
.originalBlock[open] summary::after {
  transform: rotate(180deg);
}

.betaBadge {
  border-radius: 6px;
  color: var(--accent);
  background: rgba(0, 227, 143, .12);
}

.authDialog {
  border-radius: 10px;
  background: rgba(28, 27, 27, .96);
}

@media (min-width: 1180px) {
  .result {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 52px minmax(0, 1fr) auto;
  }

  .result > .sectionHeader,
  .llmFixBox,
  .originalBlock {
    grid-column: 1 / -1;
  }

  .result > label {
    border-right: 1px solid rgba(132, 149, 136, .16);
  }

  .outputPaneTranscript {
    border-right: 1px solid rgba(132, 149, 136, .16);
  }

  .result > label:has(#srtText) {
    border-right: 0;
  }

  .outputPaneSrt {
    border-right: 0;
  }
}

@media (max-width: 1100px) {
  body {
    min-height: 100dvh;
  }

  .topbar {
    position: sticky;
  }

  .workspace {
    height: auto;
    min-height: calc(100dvh - 52px);
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .controls,
  .result {
    height: auto;
    overflow: visible;
    border-right: 0;
  }

  .controls {
    padding-bottom: 24px;
  }

  #submitBtn {
    position: static;
    width: 100%;
  }

  .result {
    min-height: 720px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(220px, 1fr) minmax(260px, 1fr) auto;
  }

  .result > label:has(#transcriptText) {
    border-right: 0;
  }

  .outputPaneTranscript {
    border-right: 0;
  }

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

@media (max-width: 720px) {
  .desktopNav {
    display: none;
  }

  .historyView {
    min-height: 100dvh;
    display: block;
    padding: 64px 16px 92px;
    background: #0a0a0a;
  }

  .historySideNav {
    display: none;
  }

  .historyCanvas {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 0;
    overflow: visible;
  }

  .historyHero {
    display: block;
    margin-bottom: 18px;
  }

  .historyHero h2 {
    font-size: 26px;
  }

  .historyHero p {
    font-size: 14px;
  }

  .historyPrimaryAction {
    width: 100%;
    justify-content: center;
    margin-top: 14px;
  }

  .historyStats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .historyStats article {
    min-height: 94px;
  }

  .historyTableHead,
  .voiceTableHead {
    display: none;
  }

  .historyPanel {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .historyList {
    gap: 12px;
  }

  .historyRow,
  .voiceRow {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(28, 27, 27, .82);
    backdrop-filter: blur(18px);
  }

  .historyFile p {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .historyMeta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  .historyMeta small {
    margin-top: 0;
  }

  .historyDuration::before {
    content: "Duration: ";
  }

  .historyActions {
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(132, 149, 136, .14);
  }

  .historyActions button {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(53, 53, 52, .36);
  }

  .waveBars {
    padding: 10px 12px;
    border: 1px solid rgba(59, 74, 64, .28);
    border-radius: 6px;
    background: #0e0e0e;
  }

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

  .topbar {
    padding: 10px 16px;
  }

  .workspace {
    min-height: 0;
  }

  .controls {
    padding: 14px;
    padding-bottom: 92px;
  }

  .panel {
    border: 1px solid rgba(132, 149, 136, .2);
    border-radius: 8px;
  }

  .result {
    min-height: 760px;
  }

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

  #submitBtn {
    position: static;
    box-shadow: 0 0 20px rgba(0, 227, 143, .12);
  }
}

@media (max-width: 460px) {
  .appShell {
    width: 100%;
    padding: 0;
  }

  .topbar {
    min-height: 64px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 12px;
  }

  .brandBlock {
    padding-right: 0;
  }

  .appLogo {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .eyebrow {
    max-width: none;
    font-size: 9px;
  }

  h1 {
    font-size: 22px;
  }

  .accountArea {
    position: static;
    transform: none;
    grid-template-columns: 36px 36px;
    gap: 8px;
  }

  .settingsButton,
  .avatarButton,
  .avatarButton.signedOut {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .iconButton svg {
    width: 19px;
    height: 19px;
  }

  .workspace {
    min-height: calc(100dvh - 64px);
    gap: 14px;
    padding: 12px;
    background: #0a0a0a;
  }

  .controls {
    display: grid;
    gap: 16px;
  }

  .sectionHeader {
    flex-direction: row;
    align-items: center;
  }

  .result > .sectionHeader {
    padding: 12px 14px;
  }

  .result textarea,
  .outputPreviewText {
    padding: 14px;
  }
}

@media (max-width: 460px) {
  body {
    background: #0a0a0a;
    padding-bottom: 76px;
  }

  .topbar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    min-height: 48px;
    grid-template-columns: 36px minmax(0, 1fr) 76px;
    align-items: center;
    padding: 0 16px;
    background: rgba(19, 19, 19, .9);
    border-bottom: 1px solid rgba(59, 74, 64, .58);
  }

  .brandBlock {
    display: contents;
  }

  .eyebrow {
    display: none;
  }

  .appLogo {
    display: block;
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 8px;
    object-fit: cover;
    justify-self: start;
  }

  .brandBlock::before {
    content: none;
    display: none;
  }

  .uploadField {
    min-height: auto;
    display: grid;
    align-items: stretch;
    justify-items: stretch;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
  }

  .uploadField::before {
    content: none;
  }

  .uploadTitle {
    text-align: left;
  }

  .uploadPicker {
    justify-content: flex-start;
  }

  .uploadField input {
    width: 100%;
    max-width: 100%;
    text-align: left;
  }

  h1 {
    justify-self: center;
    font-size: 22px;
    line-height: 1;
    transform: scale(.92);
    transform-origin: center;
  }

  .accountArea {
    grid-template-columns: 32px 32px;
    gap: 8px;
    justify-self: end;
  }

  .settingsButton,
  .avatarButton,
  .avatarButton.signedOut {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    color: var(--muted);
  }

  .workspace {
    min-height: calc(100dvh - 48px);
    padding: 64px 16px 88px;
    gap: 14px;
    background: #0a0a0a;
  }

  .historyView {
    padding: 64px 16px 88px;
  }

  .controls {
    width: min(100%, 420px);
    margin: 0 auto;
    padding: 16px 16px 96px;
    background: rgba(19, 19, 19, .86);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    backdrop-filter: blur(20px);
  }

  .sectionHeader h2,
  .compactHeader h2 {
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 800;
  }

  input,
  select,
  textarea,
  button {
    min-height: 40px;
    border-radius: 4px;
    background: #0e0e0e;
  }

  .waveformPreview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 62px;
    margin: 2px 0 6px;
    overflow: hidden;
    border: 1px solid rgba(59, 74, 64, .18);
    border-radius: 4px;
    background: #0e0e0e;
  }

  .waveformPreview::before,
  .waveformPreview::after {
    content: "";
    position: absolute;
    inset-block: 0;
    width: 32%;
    pointer-events: none;
  }

  .waveformPreview::before {
    left: 0;
    background: linear-gradient(90deg, #0e0e0e, transparent);
  }

  .waveformPreview::after {
    right: 0;
    background: linear-gradient(270deg, #0e0e0e, transparent);
  }

  .waveformPreview span {
    width: 3px;
    height: 18px;
    border-radius: 999px;
    background: var(--accent);
    opacity: .72;
    animation: wavePulse 1.05s ease-in-out infinite;
  }

  .waveformPreview span:nth-child(2n) { height: 28px; animation-delay: .12s; }
  .waveformPreview span:nth-child(3n) { height: 36px; animation-delay: .22s; }
  .waveformPreview span:nth-child(4n) { height: 22px; animation-delay: .32s; }

  #recordBtn {
    min-height: 58px;
    border-radius: 8px;
    background: #deffe6;
    color: #003920;
    box-shadow: 0 0 20px rgba(0, 227, 143, .18);
    text-transform: uppercase;
    font-size: 20px;
    font-family: Geist, Inter, system-ui, sans-serif;
  }

  #recordBtn::before {
    content: "mic";
    font-family: "Material Symbols Outlined";
    margin-right: 8px;
    font-size: 24px;
    font-feature-settings: "liga";
  }

  .advancedBlock {
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(59, 74, 64, .32);
    border-radius: 8px;
    background: rgba(19, 19, 19, .82);
  }

  .advancedBlock summary {
    padding: 14px;
  }

  .advancedBlock label,
  .advancedBlock .modelActions {
    margin: 12px 14px 0;
  }

  .advancedBlock[open] {
    padding-bottom: 14px;
  }

  .result {
    width: min(100%, 420px);
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    min-height: 520px;
  }

  .controls #submitBtn {
    display: none;
  }

  .mobileSubmitButton {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 78px;
    z-index: 42;
    width: auto;
    height: 54px;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 16px 28px rgba(0, 0, 0, .36);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
  }

  .mobileBottomNav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 64px;
    padding: 6px 10px 8px;
    border-top: 1px solid rgba(59, 74, 64, .5);
    background: rgba(53, 53, 52, .96);
    backdrop-filter: blur(18px);
  }

  .mobileBottomNav button {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    gap: 2px;
    font-family: Geist, Inter, system-ui, sans-serif;
    text-transform: uppercase;
  }

  .mobileBottomNav button.active {
    color: var(--accent);
  }

  .mobileBottomNav small {
    color: currentColor;
    font-size: 9px;
    font-style: normal;
    letter-spacing: .06em;
    white-space: nowrap;
  }
}

@keyframes wavePulse {
  0%, 100% { transform: scaleY(.68); opacity: .48; }
  50% { transform: scaleY(1.16); opacity: .95; }
}

@keyframes redRecordPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, .58);
    filter: brightness(1);
  }
  70% {
    box-shadow: 0 0 0 11px rgba(255, 59, 48, 0);
    filter: brightness(1.18);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    filter: brightness(1);
  }
}

@keyframes skeletonSweep {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

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

.avatarPreview.accountPageAvatar {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  border: 2px solid var(--studio-primary);
  color: var(--studio-primary);
}

.settingsStudioDialog .authPanel.settingsStudioPanel {
  width: min(840px, calc(100vw - 28px));
  padding: 18px;
}

@media (max-width: 900px) {
  .avatarPreview.accountPageAvatar {
    width: 72px;
    height: 72px;
  }

  .settingsStudioDialog .authPanel.settingsStudioPanel {
    width: min(100vw - 18px, 520px);
    max-height: min(86vh, 760px);
    overflow: auto;
  }
}

/* Stitch light mode integration */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f0fdf2;
  --panel: rgba(255, 255, 255, .94);
  --panel-2: rgba(234, 247, 237, .88);
  --surface-low: #eaf7ed;
  --surface-mid: #e4f1e7;
  --surface-high: #deebe1;
  --line: rgba(110, 122, 113, .34);
  --text: #131e18;
  --muted: #3e4942;
  --accent: #005f3b;
  --accent-2: #007a4d;
  --secondary: #006d42;
  --danger: #ba1a1a;
  --shadow: rgba(27, 58, 43, .12);
  --studio-bg: #f0fdf2;
  --studio-surface: #ffffff;
  --studio-low: #eaf7ed;
  --studio-container: #e4f1e7;
  --studio-high: #deebe1;
  --studio-highest: #d9e6dc;
  --studio-text: #131e18;
  --studio-muted: #3e4942;
  --studio-outline: #6e7a71;
  --studio-outline-soft: #becabf;
  --studio-primary: #005f3b;
  --studio-primary-soft: #6dfdb0;
  --studio-on-primary: #ffffff;
}

:root[data-theme="light"] body {
  background: #f0fdf2;
  color: #131e18;
}

:root[data-theme="light"] body::before {
  background:
    radial-gradient(circle at 84% 12%, rgba(0, 122, 77, .12), transparent 28%),
    radial-gradient(circle at 12% 18%, rgba(109, 253, 176, .16), transparent 32%),
    linear-gradient(135deg, #f0fdf2, #f5f8f5 44%, #eaf7ed);
  filter: none;
  transform: none;
}

:root[data-theme="light"] body::after {
  background:
    linear-gradient(135deg, rgba(240, 253, 242, .92), rgba(245, 248, 245, .74) 48%, rgba(234, 247, 237, .88)),
    radial-gradient(circle at 86% 14%, rgba(0, 95, 59, .08), transparent 30%);
}

:root[data-theme="light"] .topbar {
  border-bottom-color: rgba(190, 202, 191, .82);
  background: rgba(240, 253, 242, .86);
  box-shadow: 0 4px 12px rgba(27, 58, 43, .06);
}

:root[data-theme="light"] .appLogo,
:root[data-theme="light"] .historySideBrand img {
  border-color: rgba(0, 95, 59, .22);
  box-shadow: 0 4px 12px rgba(27, 58, 43, .08);
}

:root[data-theme="light"] .desktopNav a,
:root[data-theme="light"] .mobileBottomNav button,
:root[data-theme="light"] .historySideNav button,
:root[data-theme="light"] .accountStatus {
  color: #3e4942;
}

:root[data-theme="light"] .desktopNav a:hover,
:root[data-theme="light"] .desktopNav a.active,
:root[data-theme="light"] .mobileBottomNav button.active,
:root[data-theme="light"] .historySideNav button:hover,
:root[data-theme="light"] .historySideNav button.active {
  color: #005f3b;
}

:root[data-theme="light"] .settingsButton,
:root[data-theme="light"] .avatarButton,
:root[data-theme="light"] .avatarButton.signedOut {
  color: #005f3b;
}

:root[data-theme="light"] .settingsButton:hover,
:root[data-theme="light"] .avatarButton:hover,
:root[data-theme="light"] .avatarButton.signedOut:hover {
  background-color: rgba(0, 95, 59, .08);
}

:root[data-theme="light"] .workspace,
:root[data-theme="light"] .historyView {
  background: rgba(240, 253, 242, .58);
}

:root[data-theme="light"] .downloadHeader {
  border-color: rgba(0, 95, 59, .16);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 4px 12px rgba(27, 58, 43, .06);
}

:root[data-theme="light"] .downloadHeaderActions a {
  border-color: rgba(0, 95, 59, .22);
  background: rgba(0, 227, 143, .1);
  color: #007a4d;
}

:root[data-theme="light"] .downloadHeaderActions a:hover {
  color: #ffffff;
  background: #007a4d;
}

:root[data-theme="light"] .panel,
:root[data-theme="light"] .controls,
:root[data-theme="light"] .result,
:root[data-theme="light"] .siteFeedbackFooter,
:root[data-theme="light"] .accountView,
:root[data-theme="light"] .studioCard,
:root[data-theme="light"] .historyPanel,
:root[data-theme="light"] .historyStats article,
:root[data-theme="light"] .studioAssistant,
:root[data-theme="light"] .authDialog,
:root[data-theme="light"] .settingsStudioDialog .authPanel.settingsStudioPanel {
  border-color: rgba(190, 202, 191, .88);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 4px 12px rgba(27, 58, 43, .06);
}

:root[data-theme="light"] .controls {
  border-right-color: rgba(190, 202, 191, .88);
}

:root[data-theme="light"] .result {
  background: rgba(255, 255, 255, .94);
}

:root[data-theme="light"] .result > .sectionHeader,
:root[data-theme="light"] .historyTableHead,
:root[data-theme="light"] .voiceTableHead,
:root[data-theme="light"] .settingsActionBar {
  border-color: rgba(190, 202, 191, .76);
  background: rgba(234, 247, 237, .78);
}

:root[data-theme="light"] .result > label,
:root[data-theme="light"] .result > label:has(#transcriptText),
:root[data-theme="light"] .result > .outputPane,
:root[data-theme="light"] .controlGroup,
:root[data-theme="light"] .advancedBlock,
:root[data-theme="light"] .settingsSection,
:root[data-theme="light"] .historyRow,
:root[data-theme="light"] .voiceRow,
:root[data-theme="light"] .syncStatusRow,
:root[data-theme="light"] .historyActions,
:root[data-theme="light"] .settingsStudioCard {
  border-color: rgba(190, 202, 191, .76);
}

:root[data-theme="light"] .result textarea,
:root[data-theme="light"] .outputPreviewText {
  color: #25352d;
  background: transparent;
}

:root[data-theme="light"] .outputPaneHeader {
  border-bottom-color: rgba(190, 202, 191, .58);
}

:root[data-theme="light"] .outputPaneDelete {
  border-color: rgba(190, 202, 191, .88);
  background: #ffffff;
  color: #526258;
}

:root[data-theme="light"] .outputPaneDelete:not(:disabled):hover {
  border-color: rgba(147, 0, 10, .3);
  background: #fff1ef;
  color: #93000a;
}

:root[data-theme="light"] .outputPreviewText:empty::before,
:root[data-theme="light"] .outputPreviewText.empty::before,
:root[data-theme="light"] .result textarea::placeholder {
  color: rgba(62, 73, 66, .62);
}

:root[data-theme="light"] .llmFixBox,
:root[data-theme="light"] .hinglishPasteBox,
:root[data-theme="light"] .advancedBlock[open],
:root[data-theme="light"] .originalBlock,
:root[data-theme="light"] .recordingItem,
:root[data-theme="light"] .preferenceRows button,
:root[data-theme="light"] .accessList button,
:root[data-theme="light"] .settingsStudioCard,
:root[data-theme="light"] .storageMeter,
:root[data-theme="light"] .settingsStorageStatus,
:root[data-theme="light"] .uploadField,
:root[data-theme="light"] .waveBars,
:root[data-theme="light"] .studioImage {
  border-color: rgba(190, 202, 191, .78);
  background: rgba(234, 247, 237, .72);
}

:root[data-theme="light"] .llmFixBox {
  background: rgba(255, 255, 255, .9);
}

:root[data-theme="light"] .hinglishPasteBox {
  border-color: rgba(0, 95, 59, .24);
  background: rgba(109, 253, 176, .12);
}

:root[data-theme="light"] .uploadField {
  border-style: dashed;
}

:root[data-theme="light"] .uploadField:hover,
:root[data-theme="light"] .uploadField:focus-within {
  border-color: rgba(0, 95, 59, .55);
  background: rgba(234, 247, 237, .96);
}

:root[data-theme="light"] .waveformPreview {
  border-color: rgba(190, 202, 191, .72);
  background: #ffffff;
}

:root[data-theme="light"] .waveformPreview::before {
  background: linear-gradient(90deg, #ffffff, transparent);
}

:root[data-theme="light"] .waveformPreview::after {
  background: linear-gradient(270deg, #ffffff, transparent);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea,
:root[data-theme="light"] button {
  border-color: rgba(110, 122, 113, .36);
  background: #ffffff;
  color: #131e18;
}

:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder {
  color: rgba(62, 73, 66, .58);
}

:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus {
  outline: 2px solid rgba(0, 95, 59, .18);
  border-color: #005f3b;
  box-shadow: 0 0 0 3px rgba(0, 95, 59, .08);
}

:root[data-theme="light"] input[type="checkbox"] {
  background: #ffffff;
  border-color: rgba(110, 122, 113, .62);
}

:root[data-theme="light"] input[type="checkbox"]:checked {
  background: #007a4d;
  border-color: #007a4d;
}

:root[data-theme="light"] input[type="checkbox"]::before {
  border-color: #ffffff;
}

:root[data-theme="light"] input::file-selector-button {
  border: 0;
  border-radius: 8px;
  background: #deebe1;
  color: #131e18;
  font-family: Geist, Inter, system-ui, sans-serif;
  font-weight: 700;
}

:root[data-theme="light"] .primary,
:root[data-theme="light"] #submitBtn,
:root[data-theme="light"] .mobileSubmitButton,
:root[data-theme="light"] .historyPrimaryAction,
:root[data-theme="light"] .guideLink {
  border-color: #007a4d;
  background: #007a4d;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 95, 59, .14);
}

:root[data-theme="light"] .primary:hover,
:root[data-theme="light"] #submitBtn:hover,
:root[data-theme="light"] .mobileSubmitButton:hover,
:root[data-theme="light"] .historyPrimaryAction:hover {
  background: #005f3b;
  border-color: #005f3b;
}

:root[data-theme="light"] #recordBtn {
  border-color: rgba(190, 202, 191, .9);
  background: #ffffff;
  color: #005f3b;
  box-shadow: none;
}

:root[data-theme="light"] #recordBtn:hover {
  border-color: rgba(0, 95, 59, .4);
  background: #eaf7ed;
}

:root[data-theme="light"] body.is-recording #recordBtn::after {
  color: #131e18;
}

:root[data-theme="light"] .newRecordingAction .recordingLabel {
  color: #ffffff;
}

:root[data-theme="light"] #downloadBtn,
:root[data-theme="light"] #editTranscriptBtn,
:root[data-theme="light"] #editSubtitlesBtn,
:root[data-theme="light"] .footerFeedbackActions button,
:root[data-theme="light"] .feedbackTabs button,
:root[data-theme="light"] .llmButtons button,
:root[data-theme="light"] .hinglishPasteActions button:not(.primary),
:root[data-theme="light"] .miniBtn,
:root[data-theme="light"] .settingsStudioCard button:not(.primary),
:root[data-theme="light"] .secondaryIconAction,
:root[data-theme="light"] .authTabs button,
:root[data-theme="light"] .historyActions button {
  border-color: rgba(190, 202, 191, .88);
  background: #ffffff;
  color: #131e18;
}

:root[data-theme="light"] #downloadBtn:not(:disabled):hover,
:root[data-theme="light"] #editTranscriptBtn:not(:disabled):hover,
:root[data-theme="light"] #editSubtitlesBtn:not(:disabled):hover,
:root[data-theme="light"] .footerFeedbackActions button:hover,
:root[data-theme="light"] .feedbackTabs button.active,
:root[data-theme="light"] .llmButtons button:hover,
:root[data-theme="light"] .historyActions button:hover,
:root[data-theme="light"] .accessList button:hover,
:root[data-theme="light"] .preferenceRows button:hover {
  border-color: rgba(0, 95, 59, .32);
  background: #eaf7ed;
  color: #005f3b;
}

:root[data-theme="light"] .status,
:root[data-theme="light"] .apiKeyHelp a,
:root[data-theme="light"] .inlineHelpBtn,
:root[data-theme="light"] .docLink,
:root[data-theme="light"] .compactHeader span,
:root[data-theme="light"] .sectionHeader > span,
:root[data-theme="light"] .dialogEyebrow,
:root[data-theme="light"] .historyHero span,
:root[data-theme="light"] .historyStats article:first-child strong,
:root[data-theme="light"] .providerPill,
:root[data-theme="light"] .activeBadge,
:root[data-theme="light"] .syncStatusRow .material-symbols-outlined,
:root[data-theme="light"] .studioImage .material-symbols-outlined,
:root[data-theme="light"] .historyIcon,
:root[data-theme="light"] .voiceIcon {
  color: #005f3b;
}

:root[data-theme="light"] .sectionHeader span,
:root[data-theme="light"] small,
:root[data-theme="light"] .historyHero p,
:root[data-theme="light"] .historyMeta,
:root[data-theme="light"] .historyDuration,
:root[data-theme="light"] .historyFile p,
:root[data-theme="light"] .voiceWaveformHeader,
:root[data-theme="light"] .accountHero p,
:root[data-theme="light"] .studioCardHeader p,
:root[data-theme="light"] .studioCard small,
:root[data-theme="light"] .signedOutHero p,
:root[data-theme="light"] .accountIdentity p {
  color: #3e4942;
}

:root[data-theme="light"] .tip::after,
:root[data-theme="light"] .tip::before {
  border-color: rgba(110, 122, 113, .28);
  background: rgba(255, 255, 255, .98);
  color: #131e18;
  box-shadow: 0 8px 24px rgba(27, 58, 43, .12);
}

:root[data-theme="light"] .advancedBlock summary,
:root[data-theme="light"] .originalBlock summary {
  color: #005f3b;
}

:root[data-theme="light"] .betaBadge {
  border-color: rgba(0, 95, 59, .32);
  background: rgba(109, 253, 176, .18);
  color: #005f3b;
}

:root[data-theme="light"] .historySideNav {
  border-right-color: rgba(190, 202, 191, .76);
  background: rgba(234, 247, 237, .82);
}

:root[data-theme="light"] .historySideNav button:hover,
:root[data-theme="light"] .historySideNav button.active {
  background: rgba(0, 95, 59, .08);
}

:root[data-theme="light"] .historyRow:hover,
:root[data-theme="light"] .voiceRow:hover,
:root[data-theme="light"] .voiceRow.playing {
  background: rgba(234, 247, 237, .86);
}

:root[data-theme="light"] .historyIcon,
:root[data-theme="light"] .voiceIcon,
:root[data-theme="light"] .avatarPreview,
:root[data-theme="light"] .accountPageAvatar {
  border-color: rgba(0, 95, 59, .28);
  background: #ffffff;
}

:root[data-theme="light"] .providerPill,
:root[data-theme="light"] .activeBadge,
:root[data-theme="light"] .historyMeta small {
  border: 1px solid rgba(0, 95, 59, .18);
  background: rgba(109, 253, 176, .16);
}

:root[data-theme="light"] .storageMeter span,
:root[data-theme="light"] .historyStats i,
:root[data-theme="light"] .voiceProgressTrack i {
  background: linear-gradient(90deg, #005f3b, #00b873);
}

:root[data-theme="light"] .photoBadge {
  border-color: rgba(0, 95, 59, .16);
  background: #007a4d;
  color: #ffffff;
}

:root[data-theme="light"] .authDialog::backdrop {
  background: rgba(19, 30, 24, .28);
}

:root[data-theme="light"] .mobileBottomNav {
  border-top-color: rgba(190, 202, 191, .9);
  background: rgba(217, 230, 220, .96);
  box-shadow: 0 -12px 28px rgba(27, 58, 43, .08);
}

:root[data-theme="light"] .mobileBottomNav button {
  background: transparent;
}

:root[data-theme="light"] .emptyHistory .material-symbols-outlined {
  color: rgba(110, 122, 113, .5);
}

@media (max-width: 720px) {
  .downloadHeader {
    align-items: stretch;
    flex-direction: column;
    margin-top: -6px;
  }

  .downloadHeaderActions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .downloadHeaderActions a {
    width: 100%;
    padding-inline: 10px;
    white-space: normal;
  }

  :root[data-theme="light"] .historyView {
    background: #f0fdf2;
  }

  :root[data-theme="light"] .historyPanel {
    background: transparent;
    box-shadow: none;
  }

  :root[data-theme="light"] .historyRow,
  :root[data-theme="light"] .voiceRow {
    border-color: rgba(190, 202, 191, .86);
    background: rgba(255, 255, 255, .92);
  }

  :root[data-theme="light"] .historyActions button {
    background: #eaf7ed;
  }
}

@media (max-width: 460px) {
  :root[data-theme="light"] body {
    background: #f0fdf2;
  }

  :root[data-theme="light"] .topbar {
    background: rgba(240, 253, 242, .94);
    border-bottom-color: rgba(190, 202, 191, .82);
  }

  :root[data-theme="light"] .workspace {
    background: #f0fdf2;
  }

  :root[data-theme="light"] .controls,
  :root[data-theme="light"] .result {
    border-color: rgba(190, 202, 191, .86);
    background: rgba(255, 255, 255, .94);
  }

  :root[data-theme="light"] input,
  :root[data-theme="light"] select,
  :root[data-theme="light"] textarea,
  :root[data-theme="light"] button {
    background: #ffffff;
  }

  :root[data-theme="light"] .waveformPreview,
  :root[data-theme="light"] .waveBars {
    background: #ffffff;
  }

  :root[data-theme="light"] .advancedBlock {
    border-color: rgba(190, 202, 191, .86);
    background: rgba(234, 247, 237, .7);
  }

  :root[data-theme="light"] .mobileSubmitButton {
    box-shadow: 0 12px 28px rgba(0, 95, 59, .18);
  }
}

/* Responsive fit pass: prevent sideways scrolling on narrow desktop and mobile. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.appShell,
.topbar,
.workspace,
.historyView,
.accountView {
  width: 100%;
  max-width: 100vw;
}

.brandBlock,
.brandText,
.desktopNav,
.accountArea,
.panel,
.controls,
.result,
.historyCanvas,
.accountCanvas,
.studioCard,
.historyPanel,
.historyRow,
.voiceRow,
.settingsStudioCard,
.settingsInfoRows p,
.settingsStorageStatus {
  min-width: 0;
}

.topbar {
  column-gap: clamp(10px, 1.8vw, 24px);
}

.desktopNav {
  flex: 1 1 auto;
  justify-content: center;
  gap: clamp(12px, 2vw, 28px);
  overflow: hidden;
}

.desktopNav a {
  flex: 0 1 auto;
  white-space: nowrap;
}

.workspace {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.settingsStudioDialog {
  width: min(900px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  overflow-x: hidden;
}

.settingsStudioDialog .authPanel,
.settingsStudioDialog .authPanel.settingsStudioPanel {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.settingsCardGrid {
  min-width: 0;
}

.settingsStudioCard label,
.settingsStudioCard input,
.settingsStudioCard select,
.settingsStudioCard button,
.settingsInfoRows p,
.settingsStorageStatus {
  max-width: 100%;
}

input[type="checkbox"],
:root[data-theme="light"] input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  max-width: 22px;
  max-height: 22px;
  padding: 0;
  flex: 0 0 22px;
  aspect-ratio: 1 / 1;
}

@media (max-width: 1180px) {
  .accountStatus {
    display: none;
  }

  .topbar {
    padding-inline: 18px;
  }
}

@media (max-width: 1100px) {
  .workspace {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
  }

  .controls {
    padding-bottom: 24px;
  }

  .result {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .settingsStudioDialog {
    width: min(520px, calc(100vw - 18px));
    max-width: calc(100vw - 18px);
  }
}

@media (max-width: 720px) {
  .appShell {
    width: 100%;
    max-width: 100vw;
  }

  .topbar {
    max-width: 100vw;
  }

  .settingsInfoRows p,
  .settingsStorageStatus {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 460px) {
  .settingsStudioDialog {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    max-height: calc(100dvh - 14px);
  }

  .settingsStudioDialog .authPanel.settingsStudioPanel {
    padding: 14px;
  }

  .check {
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
  }

  input[type="checkbox"],
  :root[data-theme="light"] input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    border-radius: 6px;
  }

  .controls {
    max-width: 100%;
    padding-bottom: 156px;
  }

  .mobileSubmitButton {
    left: 16px;
    right: 16px;
    bottom: calc(66px + env(safe-area-inset-bottom));
    width: auto;
    max-width: calc(100vw - 32px);
  }
}

/* Local desktop narrow-window mode: collapse chrome to symbols before text can clip. */
@media (max-width: 480px) {
  .appShell {
    width: 100%;
    max-width: 100vw;
    padding: 8px 8px 18px;
  }

  .topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    z-index: 35;
    border: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
    background: rgba(19, 19, 19, .92);
    backdrop-filter: blur(18px);
  }

  .brandHomeButton,
  .brandBlock {
    width: auto;
    min-width: 0;
  }

  .brandBlock {
    gap: 0;
    padding-right: 0 !important;
  }

  .brandText {
    display: none;
  }

  .appLogo {
    width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px !important;
    border-radius: 10px;
  }

  .accountArea {
    position: static !important;
    display: flex;
    grid-template-columns: none;
    justify-content: flex-end;
    gap: 6px;
    width: auto;
    min-width: 0;
    transform: none !important;
  }

  .settingsButton,
  .avatarButton,
  .avatarButton.signedOut {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 10px;
  }

  .downloadHeader {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 9px 10px;
  }

  .downloadHeader strong {
    display: none;
  }

  .downloadHeaderKicker {
    margin: 0;
    font-size: 10px;
    line-height: 1.2;
  }

  .downloadHeaderActions {
    display: flex;
    gap: 7px;
    width: auto;
  }

  .downloadHeaderActions a {
    width: 42px;
    min-width: 42px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 10px;
  }

  .downloadHeaderActions .downloadLabel {
    display: none;
  }

  .downloadHeaderActions .material-symbols-outlined {
    margin: 0;
    font-size: 23px;
  }

  .workspace,
  .panel,
  .controls,
  .result {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

@media (max-width: 350px) {
  .downloadHeader {
    grid-template-columns: auto;
  }

  .downloadHeaderKicker {
    display: none;
  }

  .downloadHeaderActions {
    justify-content: center;
  }
}

/* Final polish pass: responsive history, editable profile settings, and transcript editing. */
.brandHomeButton {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  text-align: left;
  cursor: pointer;
}

.brandHomeButton:hover,
.brandHomeButton:focus-visible {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.brandHomeButton:focus-visible .appLogo {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.outputHeaderActions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.compactOutputControl {
  display: none;
}

.outputHeaderActions button {
  width: auto;
  min-height: 38px;
  padding-inline: 12px;
  white-space: nowrap;
}

@media (min-width: 721px) {
  #editTranscriptBtn,
  #editSubtitlesBtn {
    min-width: 158px;
  }

  #downloadBtn {
    min-width: 148px;
  }
}

.is-transcript-editing #transcriptText {
  background: rgba(0, 227, 143, .035);
  box-shadow: inset 0 0 0 1px rgba(0, 227, 143, .42);
}

.is-transcript-editing #transcriptText:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 2px rgba(0, 227, 143, .12);
}

.originalBlock {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(132, 149, 136, .16);
  background: color-mix(in srgb, var(--panel-2), transparent 20%);
}

.originalBlock label {
  margin-top: 12px;
}

.historyTableHead,
.historyRow {
  grid-template-columns: minmax(0, 5fr) minmax(118px, 1.6fr) minmax(58px, .75fr) minmax(148px, 1.4fr);
}

.voiceTableHead,
.voiceRow {
  grid-template-columns: minmax(0, 3.7fr) minmax(118px, 1.35fr) 58px minmax(138px, 2.1fr) minmax(148px, 1.35fr);
}

.historyFile > div,
.voiceFile > div,
.historyMeta,
.historyDuration,
.historyActions,
.voiceWaveform {
  min-width: 0;
}

.historyFile p {
  max-width: min(54ch, 100%);
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  text-overflow: clip;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.historyActions {
  min-width: 148px;
}

.preferenceEditorRows {
  overflow: hidden;
  border: 1px solid rgba(132, 149, 136, .18);
  border-radius: 8px;
}

.preferenceEditRow {
  min-height: 76px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(190px, auto);
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(132, 149, 136, .16);
  background: rgba(53, 53, 52, .32);
}

.preferenceEditRow:last-child {
  border-bottom: 0;
}

.preferenceEditRow > .material-symbols-outlined {
  color: var(--accent);
}

.preferenceEditRow select {
  width: 100%;
  min-width: 0;
}

.preferenceActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.preferenceActions button {
  width: auto;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 6px;
}

.dangerAccount {
  border-color: rgba(255, 180, 171, .36);
  background: rgba(255, 180, 171, .06);
  color: var(--danger);
}

.dangerAccount:hover {
  border-color: rgba(255, 180, 171, .66);
  background: rgba(255, 180, 171, .12);
}

.transcriptEditDialog::backdrop {
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(8px);
}

.transcriptEditPanel {
  width: min(760px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  overflow: auto;
}

.transcriptEditPanel label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 850;
}

#transcriptEditText,
#subtitleEditText {
  min-height: min(48vh, 430px);
  resize: vertical;
  font-size: 15px;
  line-height: 1.65;
}

#subtitleEditText {
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
}

.dialogActionRow {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dialogActionRow button {
  width: auto;
  min-height: 42px;
  padding-inline: 16px;
}

.avatarButton.hasImage,
.avatarButton.hasImage:hover,
.avatarButton.hasImage:focus-visible {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.avatarButton.hasImage:hover {
  filter: brightness(1.08);
}

.profilePhotoControl:hover .accountPageAvatar.hasImage {
  opacity: 1;
  filter: brightness(1.08);
}

.photoBadge {
  right: -6px;
  bottom: -6px;
  width: 32px;
  height: 32px;
  border: 2px solid var(--panel);
  font-size: 18px;
  line-height: 1;
}

:root[data-theme="light"] .settingsButton,
:root[data-theme="light"] .avatarButton,
:root[data-theme="light"] .avatarButton.signedOut {
  border-color: rgba(0, 95, 59, .28);
  background: rgba(255, 255, 255, .94);
  color: #005f3b;
  box-shadow: 0 4px 12px rgba(27, 58, 43, .08);
}

:root[data-theme="light"] .avatarButton.hasImage {
  background-color: #ffffff;
}

:root[data-theme="light"] .preferenceEditRow {
  border-color: rgba(190, 202, 191, .78);
  background: rgba(234, 247, 237, .72);
}

:root[data-theme="light"] .dangerAccount {
  border-color: rgba(186, 26, 26, .28);
  background: rgba(186, 26, 26, .05);
  color: #ba1a1a;
}

@media (max-width: 1180px) {
  .historyTableHead,
  .historyRow,
  .voiceTableHead,
  .voiceRow {
    gap: 10px;
  }

  .historyRow,
  .voiceRow {
    padding-inline: 14px;
  }

  .historyActions {
    min-width: 132px;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 76px;
    display: flex;
    flex-direction: column;
  }

  .appShell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .appShell > .siteFeedbackFooter {
    margin-top: auto;
  }

  .accountCanvas {
    padding-bottom: 24px;
  }

  .mobileBottomNav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 64px;
    padding: 6px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(59, 74, 64, .5);
    background: rgba(53, 53, 52, .96);
    backdrop-filter: blur(18px);
  }

  .mobileBottomNav button {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    gap: 2px;
    font-family: Geist, Inter, system-ui, sans-serif;
    text-transform: uppercase;
  }

  .mobileBottomNav button.active {
    color: var(--accent);
  }

  .mobileBottomNav small {
    color: currentColor;
    font-size: 9px;
    font-style: normal;
    letter-spacing: .06em;
    white-space: nowrap;
  }

  .mobileSubmitButton {
    z-index: 72;
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .historyView,
  .accountView,
  .workspace {
    padding-bottom: calc(178px + env(safe-area-inset-bottom));
  }

  .historyTableHead,
  .voiceTableHead {
    display: none;
  }

  .historyRow,
  .voiceRow {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .historyActions {
    min-width: 0;
  }

  .outputHeaderActions {
    width: 100%;
    justify-content: stretch;
  }

  .outputHeaderActions button {
    flex: 1 1 148px;
  }

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

  .preferenceEditRow select,
  .preferenceActions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

/* Compact output mode: narrow desktop/mobile should not reserve giant blank transcript space. */
@media (max-width: 1100px) {
  .result {
    min-height: 0 !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    align-content: start;
  }

  .result > .sectionHeader {
    min-height: 0;
    padding: 12px 14px;
    align-items: stretch;
  }

  .compactOutputControl {
    width: 100%;
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .compactOutputControl select {
    width: 100%;
    min-height: 42px;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
  }

  .result > label {
    height: auto !important;
    min-height: 0 !important;
    max-height: none;
    grid-template-rows: auto auto !important;
  }

  .result > .outputPane {
    height: auto !important;
    min-height: 0 !important;
    max-height: none;
    grid-template-rows: auto auto !important;
  }

  .outputPreviewText,
  .result textarea {
    height: auto !important;
    min-height: 112px;
    max-height: clamp(170px, 34dvh, 320px);
    overflow: auto;
  }

  .result[data-output-mode="transcript"] > label:has(#srtText),
  .result[data-output-mode="srt"] > label:has(#transcriptText) {
    display: none;
  }

  .result[data-output-mode="transcript"] > .outputPaneSrt,
  .result[data-output-mode="srt"] > .outputPaneTranscript {
    display: none;
  }

  .result[data-output-mode="transcript"] .llmFixBox {
    display: none;
  }
}

@media (max-width: 720px) {
  .result {
    border-radius: 8px;
  }

  .outputHeaderActions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .outputHeaderActions button {
    width: 100%;
    min-height: 42px;
    flex: none;
  }

  .outputPreviewText,
  .result textarea {
    min-height: 96px;
    max-height: 240px;
    padding: 14px;
  }

  .outputPaneDelete {
    width: 34px;
    min-height: 32px;
    padding: 0;
  }

  .outputPaneDelete .deleteText {
    display: none;
  }
}

@media (max-width: 480px) {
  .mobileBottomNav {
    height: 56px;
    padding-top: 6px;
  }

  .mobileBottomNav small {
    display: none;
  }

  .mobileBottomNav button {
    gap: 0;
  }

  .mobileBottomNav .material-symbols-outlined {
    font-size: 25px;
  }
}

/* Phone fit pass: keep the editor usable without giant empty output panels. */
[hidden] {
  display: none !important;
}

body:not(.has-output) .llmFixBox {
  display: none !important;
}

@media (max-width: 720px) {
  .siteFeedbackFooter {
    width: min(100% - 24px, 430px);
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 16px;
    padding: 16px;
  }

  .footerFeedbackActions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-view="editor"] .appShell {
    padding-top: 6px !important;
  }

  body[data-view="editor"] .topbar {
    margin-bottom: 10px !important;
  }

  body[data-view="editor"] .workspace {
    padding-top: 0 !important;
  }

  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  }

  .appShell {
    padding-bottom: 0 !important;
  }

  .workspace {
    min-height: 0 !important;
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
    align-content: start !important;
  }

  .controls,
  .result {
    width: min(100%, 430px) !important;
    max-width: calc(100vw - 24px) !important;
    margin-inline: auto !important;
  }

  .controls {
    padding-bottom: 118px !important;
  }

  .result {
    min-height: 0 !important;
    margin-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    overflow: hidden !important;
  }

  .result > .sectionHeader {
    min-height: 0 !important;
    gap: 10px !important;
  }

  .result > label {
    min-height: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-template-rows: auto auto !important;
  }

  .result > .outputPane {
    min-height: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-template-rows: auto auto !important;
  }

  .outputPaneHeader {
    min-height: 40px !important;
    padding: 9px 14px !important;
  }

  .result textarea,
  .outputPreviewText {
    height: auto !important;
    min-height: 132px !important;
    max-height: min(36dvh, 260px) !important;
    overflow: auto !important;
  }

  .outputPreviewText.empty {
    min-height: 112px !important;
    max-height: 112px !important;
  }

  .result[data-output-mode="srt"] .outputPreviewText,
  .result[data-output-mode="transcript"] .outputPreviewText {
    min-height: 180px !important;
    max-height: min(42dvh, 320px) !important;
  }

  .result[data-output-mode="srt"] .outputPreviewText.empty,
  .result[data-output-mode="transcript"] .outputPreviewText.empty {
    min-height: 132px !important;
    max-height: 132px !important;
  }

  .result[data-output-mode="transcript"] > label:has(#srtText),
  .result[data-output-mode="srt"] > label:has(#transcriptText) {
    display: none !important;
  }

  .result[data-output-mode="transcript"] > .outputPaneSrt,
  .result[data-output-mode="srt"] > .outputPaneTranscript {
    display: none !important;
  }

  .result[data-output-mode="transcript"] .llmFixBox {
    display: none !important;
  }

  .llmFixBox {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 16px !important;
  }

  .llmButtons {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .llmButtons button {
    min-height: 46px !important;
    padding: 0 10px !important;
  }

  .systemStatus {
    justify-content: flex-end !important;
  }

  .mobileBottomNav {
    height: 58px !important;
    padding: 5px 16px calc(7px + env(safe-area-inset-bottom)) !important;
    z-index: 80 !important;
  }

  .mobileSubmitButton {
    left: max(12px, env(safe-area-inset-left)) !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: calc(58px + env(safe-area-inset-bottom)) !important;
    z-index: 79 !important;
    width: auto !important;
    max-width: none !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 14px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    line-height: 1 !important;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, .36), 0 0 18px rgba(0, 227, 143, .18) !important;
  }

  .mobileSubmitButton .material-symbols-outlined {
    font-size: 23px !important;
  }
}

@media (max-width: 420px) {
  .workspace {
    padding-inline: 10px !important;
  }

  .controls,
  .result {
    max-width: calc(100vw - 20px) !important;
  }

  .outputHeaderActions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
  }

  .compactOutputControl {
    grid-column: 1 / -1 !important;
  }

  .outputHeaderActions button {
    min-height: 40px !important;
    padding-inline: 8px !important;
    font-size: 13px !important;
  }

  .llmButtons {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile chrome polish: show brand, hide desktop-only setup, keep actions icon-only. */
@media (max-width: 720px) {
  body[data-view="editor"] .appShell {
    padding-top: 6px !important;
  }

  body[data-view="editor"] .topbar {
    margin-bottom: 10px !important;
  }

  body[data-view="editor"] .workspace {
    padding-top: 0 !important;
  }

  .downloadHeader {
    display: none !important;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
  }

  .brandHomeButton,
  .brandBlock {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .brandText {
    display: block !important;
    min-width: 0 !important;
  }

  .brandText .eyebrow {
    display: none !important;
  }

  .brandText h1,
  h1 {
    display: block !important;
    max-width: 46vw !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    justify-self: auto !important;
    transform: none !important;
    font-size: 18px !important;
    line-height: 1 !important;
  }

  .appLogo {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px !important;
  }

  .accountArea {
    width: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
  }

  .outputHeaderActions {
    grid-template-columns: 1fr auto auto auto !important;
    align-items: stretch !important;
  }

  .compactOutputControl {
    grid-column: auto !important;
    min-width: 0 !important;
  }

  .compactOutputControl select {
    min-width: 0 !important;
    width: 74px !important;
    padding: 8px 22px 8px 8px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    text-align: left !important;
  }

  #editTranscriptBtn,
  #editSubtitlesBtn,
  #downloadBtn {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    font-size: 0 !important;
    display: inline-grid !important;
    place-items: center !important;
  }

  #editTranscriptBtn .material-symbols-outlined,
  #editSubtitlesBtn .material-symbols-outlined,
  #downloadBtn .material-symbols-outlined {
    margin: 0 !important;
    font-size: 21px !important;
    font-style: normal !important;
  }

}

@media (max-width: 360px) {
  .brandText h1,
  h1 {
    max-width: 38vw !important;
    font-size: 16px !important;
  }

  .appLogo {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
  }

  #editTranscriptBtn,
  #editSubtitlesBtn,
  #downloadBtn {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
  }
}

/* Mobile generation dock: natural button plus floating fallback. */
@media (max-width: 720px) {
  .mobileSubmitButton {
    display: none !important;
    left: max(12px, env(safe-area-inset-left)) !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: calc(74px + env(safe-area-inset-bottom)) !important;
    z-index: 79 !important;
    width: auto !important;
    max-width: none !important;
    height: 52px !important;
    min-height: 52px !important;
    padding: 0 14px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    line-height: 1 !important;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, .36), 0 0 18px rgba(0, 227, 143, .18) !important;
  }

  .mobileSubmitButton.isVisible {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  .controls #submitBtn {
    position: static !important;
    bottom: auto !important;
    z-index: auto !important;
    display: inline-flex !important;
    width: 100% !important;
    min-height: 58px !important;
    margin: 18px 0 0 !important;
    padding: 0 16px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    box-shadow: 0 0 18px rgba(0, 227, 143, .16) !important;
  }

  .controls #submitBtn .material-symbols-outlined {
    font-size: 24px !important;
  }

  .controls #status {
    display: none !important;
  }

  body,
  .appShell {
    padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  }

  .workspace {
    padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
  }

  .controls {
    padding-bottom: 8px !important;
  }

  .result {
    margin-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
  }

  .llmFixBox {
    padding: 12px !important;
    gap: 8px !important;
  }

  .mobileStatusToast {
    position: fixed;
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 90;
    width: auto;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 12px 14px;
    border: 1px solid rgba(46, 248, 160, .34);
    border-radius: 16px;
    background: rgba(14, 14, 14, .94);
    color: var(--text);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .46), 0 0 24px rgba(0, 227, 143, .14);
    backdrop-filter: blur(18px);
    transform: none;
  }

  .mobileStatusToast[hidden] {
    display: none !important;
  }

  .mobileStatusToast .material-symbols-outlined {
    color: var(--accent);
    font-size: 24px;
  }

  .mobileStatusToast strong {
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 850;
  }

  .mobileStatusToast.isError {
    border-color: rgba(255, 180, 171, .46);
  }

  .mobileStatusToast.isError .material-symbols-outlined {
    color: #ffb4ab;
  }

  body[data-view="editor"],
  body[data-view="editor"] .appShell {
    padding-bottom: 0 !important;
  }

  body[data-view="editor"] .workspace {
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }

  body[data-view="editor"] .result {
    margin-bottom: 0 !important;
  }
}

/* Stitch-style dark backdrop: soft center glow with black edges. */
:root:not([data-theme="light"]),
:root:not([data-theme="light"]) body {
  background: #0a0a0a !important;
}

:root:not([data-theme="light"]) {
  --bg: #0a0a0a;
  --panel: rgba(28, 27, 27, .86);
  --panel-2: rgba(14, 14, 14, .86);
}

:root:not([data-theme="light"]) body::before {
  inset: 0 !important;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(0, 227, 143, .18) 0%, rgba(0, 227, 143, .08) 27%, rgba(0, 0, 0, 0) 58%),
    #0a0a0a !important;
  filter: none !important;
  transform: none !important;
}

:root:not([data-theme="light"]) body::after {
  background:
    linear-gradient(90deg, #0a0a0a 0%, rgba(10, 10, 10, .92) 4%, rgba(10, 10, 10, 0) 16%, rgba(10, 10, 10, 0) 84%, rgba(10, 10, 10, .92) 96%, #0a0a0a 100%),
    linear-gradient(180deg, #0a0a0a 0%, rgba(10, 10, 10, .88) 6%, rgba(10, 10, 10, 0) 18%, rgba(10, 10, 10, 0) 82%, rgba(10, 10, 10, .88) 94%, #0a0a0a 100%) !important;
}

:root:not([data-theme="light"]) .appShell,
:root:not([data-theme="light"]) .workspace {
  background: #0a0a0a !important;
}

@media (max-width: 720px) {
  :root:not([data-theme="light"]) body::before {
    background:
      radial-gradient(ellipse at 50% 38%, rgba(0, 227, 143, .16) 0%, rgba(0, 227, 143, .07) 24%, rgba(0, 0, 0, 0) 54%),
      #0a0a0a !important;
  }

  :root:not([data-theme="light"]) body::after {
    background:
      linear-gradient(90deg, #0a0a0a 0%, #0a0a0a 3%, rgba(10, 10, 10, .9) 8%, rgba(10, 10, 10, 0) 22%, rgba(10, 10, 10, 0) 78%, rgba(10, 10, 10, .9) 92%, #0a0a0a 97%, #0a0a0a 100%),
      linear-gradient(180deg, #0a0a0a 0%, #0a0a0a 4%, rgba(10, 10, 10, .92) 10%, rgba(10, 10, 10, 0) 24%, rgba(10, 10, 10, 0) 76%, rgba(10, 10, 10, .92) 90%, #0a0a0a 96%, #0a0a0a 100%) !important;
  }
}

/* Tutorial page and feedback placement: kept separate from the deployed baseline. */
.result > .siteFeedbackFooter,
.historyCanvas > .siteFeedbackFooter,
.accountCanvas > .siteFeedbackFooter {
  width: 100%;
  margin: 24px 0 0;
}

.result > .siteFeedbackFooter {
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
  padding: 16px;
}

.tutorialCanvas {
  display: grid;
  gap: 22px;
}

.tutorialHero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 22px;
  align-items: stretch;
}

.tutorialHeroCopy,
.tutorialReelCard,
.tutorialStepsCard,
.tutorialTips article,
.tutorialFaq {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(28, 27, 27, .82);
  backdrop-filter: blur(20px);
}

.tutorialHeroCopy,
.tutorialStepsCard,
.tutorialFaq {
  padding: 18px;
}

.tutorialHeroCopy {
  display: grid;
  align-content: center;
  padding: clamp(18px, 3vw, 34px);
}

.tutorialBadge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 10px;
  border: 1px solid rgba(46, 248, 160, .3);
  border-radius: 999px;
  color: var(--accent);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tutorialBadge i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(78, 224, 162, .75);
}

.tutorialHero h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: 0;
}

.tutorialHero p,
.tutorialSectionHeader p,
.tutorialSteps p,
.tutorialTips p,
.tutorialFaq p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.tutorialHeroCopy > p {
  max-width: 620px;
  margin-top: 14px;
  font-size: 16px;
}

.tutorialHeroActions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.tutorialHeroActions button,
.tutorialHeroActions a,
.tutorialReelFooter {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(132, 149, 136, .26);
  border-radius: 8px;
  color: var(--text);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  text-transform: uppercase;
}

.tutorialHeroActions .primary {
  color: var(--studio-on-primary);
}

.tutorialReelCard {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}

.tutorialReelCard:hover {
  transform: translateY(-2px);
  border-color: rgba(46, 248, 160, .34);
}

.tutorialReelVisual {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 260px;
  overflow: hidden;
  background: #050806;
}

.tutorialReelVisual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: .82;
}

.tutorialReelVisual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .14), rgba(0, 0, 0, .64));
}

.tutorialReelVisual .material-symbols-outlined,
.tutorialReelVisual strong,
.tutorialReelVisual small {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .85);
}

.tutorialReelVisual .material-symbols-outlined {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(46, 248, 160, .38);
  border-radius: 999px;
  color: var(--accent);
  font-size: 40px;
  background: rgba(46, 248, 160, .12);
}

.tutorialReelFooter {
  justify-content: space-between;
  border-width: 1px 0 0;
  border-radius: 0;
  background: rgba(14, 14, 14, .54);
}

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

.tutorialSectionHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.tutorialSectionHeader > .material-symbols-outlined,
.tutorialSteps li > .material-symbols-outlined {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(132, 149, 136, .24);
  border-radius: 8px;
  color: var(--accent);
  background: rgba(46, 248, 160, .08);
}

.tutorialSectionHeader h3,
.tutorialTips h3 {
  margin: 0;
  font-size: 20px;
}

.tutorialSteps {
  list-style: none;
  display: grid;
  margin: 0;
  padding: 0;
}

.tutorialSteps li {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 0 0 22px;
}

.tutorialSteps li::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 42px;
  bottom: 4px;
  border-left: 1px solid rgba(132, 149, 136, .22);
}

.tutorialSteps li:last-child {
  padding-bottom: 0;
}

.tutorialSteps li:last-child::before {
  display: none;
}

.tutorialSteps strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-size: 16px;
}

.tutorialTips {
  display: grid;
  gap: 12px;
}

.tutorialTips article {
  padding: 16px;
}

.tutorialTips .material-symbols-outlined {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 26px;
}

.tutorialFaq details {
  border-top: 1px solid rgba(132, 149, 136, .16);
  padding: 14px 0;
}

.tutorialFaq summary {
  cursor: pointer;
  color: var(--text);
  font-family: Geist, Inter, system-ui, sans-serif;
  font-weight: 800;
}

.tutorialFaq p {
  margin-top: 8px;
}

@media (max-width: 980px) {
  .tutorialHero,
  .tutorialGrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .result > .siteFeedbackFooter,
  .historyCanvas > .siteFeedbackFooter,
  .accountCanvas > .siteFeedbackFooter {
    margin-bottom: calc(116px + env(safe-area-inset-bottom)) !important;
  }

  .tutorialCanvas {
    width: min(100%, 520px);
    margin: 0 auto;
  }

  .tutorialHeroActions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

:root[data-theme="light"] .tutorialHeroCopy,
:root[data-theme="light"] .tutorialReelCard,
:root[data-theme="light"] .tutorialStepsCard,
:root[data-theme="light"] .tutorialTips article,
:root[data-theme="light"] .tutorialFaq {
  border-color: rgba(190, 202, 191, .88);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 4px 12px rgba(27, 58, 43, .06);
}
