body[data-tool="audio-to-text"] {
  --at-ink: #1a1428;
  --at-muted: #6b6578;
  --at-line: rgba(88, 60, 140, 0.12);
  --at-soft: rgba(124, 58, 237, 0.07);
  --at-panel: rgba(255, 255, 255, 0.72);
  --at-surface: #fff;
  --at-surface-alt: #faf9fc;
}

body[data-tool="audio-to-text"] .tool-workspace {
  padding: 0 0 2rem !important;
  background:
    radial-gradient(ellipse 90% 55% at 8% -10%, rgba(124, 58, 237, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 45% at 100% 0%, rgba(99, 102, 241, 0.1), transparent 50%),
    linear-gradient(180deg, #f7f5fb 0%, #f3f0f9 45%, #faf9fc 100%) !important;
}

body[data-tool="audio-to-text"] .at-top {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem 1.35rem;
}

body[data-tool="audio-to-text"] .at-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
body[data-tool="audio-to-text"] .at-title-row h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--at-ink);
}
body[data-tool="audio-to-text"] .at-title-row p {
  margin: 0.35rem 0 0;
  max-width: 34rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--at-muted);
}
body[data-tool="audio-to-text"] .at-meta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--at-muted);
  white-space: nowrap;
  padding-bottom: 0.15rem;
}

/* One studio shell instead of two loud cards */
body[data-tool="audio-to-text"] .at-studio {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
body[data-tool="audio-to-text"] .at-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  min-height: min(640px, calc(100vh - 12rem));
  border: 1px solid var(--at-line);
  border-radius: 22px;
  background: var(--at-panel);
  backdrop-filter: blur(14px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 18px 50px rgba(70, 40, 120, 0.07);
  overflow: hidden;
  animation: atFade 0.45s ease both;
}
@keyframes atFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

body[data-tool="audio-to-text"] .at-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.2rem 1.35rem;
  border-right: 1px solid var(--at-line);
  background: linear-gradient(165deg, rgba(124, 58, 237, 0.05), transparent 55%);
  min-width: 0;
}
body[data-tool="audio-to-text"] .at-side-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

body[data-tool="audio-to-text"] .at-side .upload-zone {
  min-height: 148px;
  border-radius: 16px;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.55);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
body[data-tool="audio-to-text"] .at-side .upload-zone:hover,
body[data-tool="audio-to-text"] .at-side .upload-zone.dragover {
  transform: translateY(-1px);
  border-color: rgba(124, 58, 237, 0.45);
  background: rgba(124, 58, 237, 0.04);
}
body[data-tool="audio-to-text"] .at-side .upload-icon {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}
body[data-tool="audio-to-text"] .at-side .upload-placeholder p {
  margin: 0.2rem 0;
  font-size: 0.88rem;
}
body[data-tool="audio-to-text"] .at-side .file-chip {
  border-radius: 12px;
  border: 1px solid var(--at-line);
  background: var(--at-surface);
  min-width: 0;
  max-width: 100%;
  margin-bottom: 0;
  padding: 0.55rem 0.6rem;
  gap: 0.55rem;
  align-items: center;
}

body[data-tool="audio-to-text"] .at-side .file-list {
  width: 100%;
  min-width: 0;
}

body[data-tool="audio-to-text"] .at-side .file-list .file-chip-body {
  min-width: 0;
  overflow: hidden;
}

body[data-tool="audio-to-text"] .at-side .file-list .file-chip-body strong {
  font-size: 0.8125rem;
  line-height: 1.35;
}

body[data-tool="audio-to-text"] .at-side .file-list .file-chip-icon {
  width: 36px;
  height: 36px;
  font-size: 0.58rem;
  box-shadow: none;
}

body[data-tool="audio-to-text"] .at-side .file-list .file-chip-actions button {
  width: 28px;
  height: 28px;
  font-size: 0.875rem;
}

body[data-tool="audio-to-text"] .at-main-bar > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

body[data-tool="audio-to-text"] #status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

body[data-tool="audio-to-text"] .at-field {
  display: grid;
  gap: 0.35rem;
}
body[data-tool="audio-to-text"] .at-field label {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--at-muted);
}
body[data-tool="audio-to-text"] .at-field .form-control {
  border-radius: 12px;
  border-color: var(--at-line);
  background: var(--at-surface);
}
body[data-tool="audio-to-text"] .at-side .btn-primary {
  border-radius: 12px;
  margin-top: 0.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
body[data-tool="audio-to-text"] .at-side .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(124, 58, 237, 0.32);
}
body[data-tool="audio-to-text"] .at-note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--at-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-tool="audio-to-text"] .at-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--at-surface);
}
body[data-tool="audio-to-text"] .at-main-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--at-line);
  background: linear-gradient(180deg, var(--at-surface-alt), var(--at-surface));
}
body[data-tool="audio-to-text"] .at-main-bar h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 720;
  letter-spacing: -0.02em;
  color: var(--at-ink);
}
body[data-tool="audio-to-text"] #status {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--at-muted);
  min-height: 1.1em;
}
body[data-tool="audio-to-text"] #status.is-err,
body[data-tool="audio-to-text"] #status[data-tone="err"] {
  color: #b42318;
}
body[data-tool="audio-to-text"] .at-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
body[data-tool="audio-to-text"] .at-actions .btn {
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 650;
}

body[data-tool="audio-to-text"] .at-progress {
  height: 2px;
  background: transparent;
  overflow: hidden;
}
body[data-tool="audio-to-text"] .at-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  transition: width 0.25s ease;
}
body[data-tool="audio-to-text"] .at-progress.is-on > span {
  animation: atPulse 1.1s ease-in-out infinite;
}
@keyframes atPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

body[data-tool="audio-to-text"] .at-transcript {
  flex: 1;
  min-height: 320px;
  margin: 0;
  padding: 1.25rem 1.35rem 1.5rem;
  overflow: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--at-ink);
  background:
    linear-gradient(180deg, transparent, transparent 2.6rem),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent calc(1.75em - 1px),
      rgba(124, 58, 237, 0.04) calc(1.75em - 1px),
      rgba(124, 58, 237, 0.04) 1.75em
    );
  border: 0;
  border-radius: 0;
  box-shadow: none;
  resize: none;
}
body[data-tool="audio-to-text"] .at-transcript:empty::before {
  color: #9a93a8;
  font-style: normal;
}

body[data-tool="audio-to-text"] .protocol-banner {
  display: none;
  max-width: 1180px;
  margin: 0 auto 0.85rem;
  padding: 0.65rem 1rem;
}
body[data-tool="audio-to-text"] .protocol-banner.is-on { display: block; }

/* Avoid inherited dual-card chrome */
body[data-tool="audio-to-text"][data-cat="media"] .tool-panel {
  border-top: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  border: 0 !important;
}

body[data-tool="audio-to-text"] .at-note-mob {
  display: none;
}

@media (max-width: 768px) {
  body[data-tool="audio-to-text"] .tool-workspace {
    padding-top: 0.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  body[data-tool="audio-to-text"] .at-top {
    padding: 0.65rem 1rem 1.125rem;
  }

  body[data-tool="audio-to-text"] .at-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  body[data-tool="audio-to-text"] .at-title-row h1 {
    font-size: clamp(1.28rem, 5.2vw, 1.5rem);
    line-height: 1.2;
  }

  body[data-tool="audio-to-text"] .at-title-row p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 0.35rem;
  }

  body[data-tool="audio-to-text"] .at-meta {
    white-space: normal;
    align-self: stretch;
    margin-top: 0.15rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--at-soft);
    border: 1px solid var(--at-line);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
  }

  body[data-tool="audio-to-text"] .at-studio {
    padding: 0 1rem 0.25rem;
  }

  body[data-tool="audio-to-text"] .at-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(70, 40, 120, 0.07);
    overflow: hidden;
  }

  body[data-tool="audio-to-text"] .at-side {
    gap: 0.875rem;
    padding: 1rem 1rem 1.125rem;
    border-right: 0;
    border-bottom: 1px solid var(--at-line);
    overflow: hidden;
  }

  body[data-tool="audio-to-text"] .at-side .upload-zone.has-file {
    display: none !important;
  }

  body[data-tool="audio-to-text"] .at-side .file-list .file-chip {
    padding: 0.5rem 0.55rem;
    gap: 0.5rem;
  }

  body[data-tool="audio-to-text"] .at-field .form-control {
    padding: 0.45rem 0.65rem;
    font-size: 0.875rem !important;
  }

  body[data-tool="audio-to-text"] .at-side-label {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--at-ink);
    margin: 0 0 0.15rem;
  }

  body[data-tool="audio-to-text"] .at-side .upload-zone {
    min-height: 104px;
    padding: 0.85rem 0.75rem;
  }

  body[data-tool="audio-to-text"] .at-side .upload-placeholder p {
    font-size: 0.8125rem;
  }

  body[data-tool="audio-to-text"] .at-field {
    gap: 0.45rem;
  }

  body[data-tool="audio-to-text"] .at-side .btn-primary {
    margin-top: 0.15rem;
    padding: 0.52rem 0.85rem;
    font-size: 0.8125rem;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.2);
  }

  body[data-tool="audio-to-text"] .at-note {
    margin-top: 0.15rem;
    font-size: 0.6875rem;
    text-align: center;
    line-height: 1.4;
    padding: 0 0.15rem;
  }

  body[data-tool="audio-to-text"] .at-note-desk {
    display: none;
  }

  body[data-tool="audio-to-text"] .at-note-mob {
    display: block;
  }

  body[data-tool="audio-to-text"] .at-main {
    background: var(--at-surface-alt);
  }

  body[data-tool="audio-to-text"] .at-main-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0.65rem 0.85rem;
  }

  body[data-tool="audio-to-text"] .at-main-bar h2 {
    font-size: 0.875rem;
  }

  body[data-tool="audio-to-text"] #status {
    font-size: 0.75rem;
    margin-top: 0.15rem;
  }

  body[data-tool="audio-to-text"] .at-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
    margin: 0;
  }

  body[data-tool="audio-to-text"] .at-actions #copyResultBtn {
    flex: 1 1 auto;
  }

  body[data-tool="audio-to-text"] .at-actions .btn {
    width: auto;
    flex: 1 1 auto;
    min-height: 0 !important;
    min-width: 0;
    margin: 0;
    justify-content: center;
    padding: 0.3rem 0.55rem !important;
    font-size: 0.75rem !important;
    font-weight: 650;
    border-radius: 999px;
    white-space: nowrap;
  }

  body[data-tool="audio-to-text"] .at-transcript {
    min-height: 180px;
    max-height: min(55vh, 480px);
    padding: 0.875rem 1rem 1.125rem;
    font-size: 0.9375rem;
    line-height: 1.65;
    background: var(--at-surface);
  }
}

@media (max-width: 860px) {
  body[data-tool="audio-to-text"] .at-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  body[data-tool="audio-to-text"] .at-side {
    border-right: 0;
    border-bottom: 1px solid var(--at-line);
  }
  body[data-tool="audio-to-text"] .at-transcript {
    min-height: 260px;
    max-height: 55vh;
  }
}
