:root {
  color-scheme: light;
  --ink: #071b49;
  --ink-2: #12244a;
  --muted: #64718d;
  --line: #dce6f5;
  --paper: #f7fbff;
  --panel: #ffffff;
  --blue: #0b64f6;
  --blue-2: #2f8cff;
  --blue-soft: #eef6ff;
  --red: #f02f26;
  --word: #2468d8;
  --txt: #eef2f7;
  --shadow: 0 24px 70px rgba(13, 45, 96, 0.16);
  --soft-shadow: 0 14px 34px rgba(22, 70, 130, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.eleven-form { display: grid; gap: 12px; padding: 16px 0; }
.eleven-form label { display: grid; gap: 6px; }
.eleven-form input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
#elevenSettings { grid-column: 1 / -1; }
#elevenSettings[hidden] { display: none; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 58%, #eef6ff 100%),
    var(--paper);
}

body::before,
body::after {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
}

body::before {
  height: 190px;
  background:
    repeating-linear-gradient(
      166deg,
      rgba(21, 101, 216, 0.18) 0 1px,
      transparent 1px 18px
    ),
    linear-gradient(135deg, rgba(221, 239, 255, 0.34), rgba(4, 92, 238, 0.16));
  clip-path: polygon(0 42%, 26% 28%, 52% 48%, 76% 18%, 100% 34%, 100% 100%, 0 100%);
}

body::after {
  height: 90px;
  background: linear-gradient(112deg, rgba(255, 255, 255, 0.1), rgba(4, 92, 238, 0.72));
  clip-path: polygon(0 64%, 34% 42%, 66% 62%, 100% 12%, 100% 100%, 0 100%);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  width: min(1680px, calc(100vw - 72px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 54px 0 64px;
}

.hero-copy {
  position: relative;
  display: grid;
  align-content: start;
  gap: 20px;
  min-width: 0;
  min-height: 800px;
  overflow: hidden;
  padding: 34px 32px 28px;
  border: 2px solid rgba(209, 230, 255, 0.86);
  border-radius: 8px;
  background:
    radial-gradient(circle at 82% 18%, rgba(218, 243, 255, 0.98), transparent 34%),
    radial-gradient(circle at 72% 52%, rgba(206, 229, 255, 0.82), transparent 36%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(238, 247, 255, 0.96));
  box-shadow: 0 22px 62px rgba(22, 92, 180, 0.14);
}

.hero-orbits {
  position: absolute;
  right: -120px;
  top: 88px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 44px, rgba(255, 255, 255, 0.72) 45px 47px),
    radial-gradient(circle, rgba(70, 158, 255, 0.12), transparent 64%);
  opacity: 0.9;
}

.brand-row,
.top-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.hero-copy > *:not(.hero-orbits):not(.hero-illustration) {
  position: relative;
  z-index: 2;
}

.brand-row strong,
.top-brand strong {
  color: var(--ink);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

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

.brand-row em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 1.18rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.25;
  word-break: keep-all;
}

.top-brand strong {
  font-size: 1.45rem;
}

.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 6px);
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 80px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: linear-gradient(135deg, #075ff0, #45a7ff);
  box-shadow: 0 14px 28px rgba(10, 93, 232, 0.22);
}

.brand-mark::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 50%;
  width: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  content: "";
}

.brand-mark::after {
  position: absolute;
  right: 8px;
  bottom: -6px;
  left: 8px;
  height: 16px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(135deg, #075ff0, #45a7ff);
  clip-path: polygon(0 0, 50% 45%, 100% 0, 100% 70%, 50% 100%, 0 70%);
  content: "";
}

.brand-mark span {
  display: block;
  width: 6px;
  border-radius: 999px;
  background: #ffffff;
}

.brand-mark span:nth-child(1) {
  height: 20px;
}

.brand-mark span:nth-child(2) {
  height: 32px;
}

.brand-mark span:nth-child(3) {
  height: 28px;
}

.brand-mark span:nth-child(4) {
  height: 18px;
}

.brand-mark.small {
  width: 46px;
  height: 38px;
  grid-template-columns: repeat(4, 4px);
  gap: 3px;
  border-radius: 7px;
  box-shadow: 0 10px 22px rgba(10, 93, 232, 0.2);
}

.brand-mark.small span {
  width: 4px;
}

.brand-mark.small span:nth-child(1) {
  height: 12px;
}

.brand-mark.small span:nth-child(2) {
  height: 20px;
}

.brand-mark.small span:nth-child(3) {
  height: 17px;
}

.brand-mark.small span:nth-child(4) {
  height: 11px;
}

.brand-mark.small::after {
  right: 5px;
  bottom: -4px;
  left: 5px;
  height: 10px;
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: var(--ink);
  font-size: 4.9rem;
  font-weight: 950;
  line-height: 1.03;
  word-break: keep-all;
}

h1 span {
  display: block;
}

h1 span:last-child {
  color: var(--blue);
}

.hero-subtitle {
  max-width: 760px;
  color: var(--ink-2);
  font-size: 1.42rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.hero-rule {
  width: 58px;
  height: 4px;
  border-radius: 999px;
  background: var(--blue);
}

.hero-illustration {
  position: absolute;
  top: 92px;
  right: 18px;
  z-index: 1;
  width: min(34%, 270px);
  height: 330px;
  opacity: 0.92;
  pointer-events: none;
}

.folder-back,
.folder-front,
.paper-card,
.headphone-badge {
  position: absolute;
}

.folder-back {
  right: 64px;
  bottom: 74px;
  width: 172px;
  height: 240px;
  border: 8px solid rgba(42, 145, 255, 0.38);
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(231, 246, 255, 0.92), rgba(106, 187, 255, 0.54));
  transform: skewY(9deg);
}

.folder-front {
  right: 28px;
  bottom: 38px;
  width: 258px;
  height: 178px;
  border: 1px solid rgba(0, 90, 214, 0.24);
  border-radius: 26px 26px 24px 24px;
  background: linear-gradient(135deg, #5ec3ff 0%, #1472f8 58%, #0050dd 100%);
  box-shadow:
    inset -18px -22px 32px rgba(2, 51, 166, 0.16),
    0 26px 38px rgba(18, 91, 214, 0.24);
}

.folder-front::before {
  position: absolute;
  left: 0;
  top: -34px;
  width: 124px;
  height: 70px;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(135deg, #87d6ff, #2d8cff);
  content: "";
}

.paper-card {
  right: 54px;
  top: 20px;
  width: 190px;
  height: 248px;
  border: 1px solid rgba(44, 143, 255, 0.28);
  border-radius: 18px;
  background: linear-gradient(160deg, #ffffff, #f2f8ff);
  box-shadow: 12px 18px 22px rgba(23, 91, 176, 0.15);
  transform: rotate(9deg);
}

.paper-card::before {
  position: absolute;
  top: 58px;
  left: 68px;
  width: 54px;
  height: 82px;
  border-radius: 999px;
  background:
    linear-gradient(var(--blue), var(--blue)) center / 8px 82px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 6px center / 8px 42px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 40px center / 8px 54px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 80% center / 8px 32px no-repeat;
  content: "";
}

.paper-card span {
  position: absolute;
  left: 42px;
  height: 7px;
  border-radius: 999px;
  background: #bad8f9;
}

.paper-card span:nth-child(1) {
  right: 36px;
  bottom: 76px;
}

.paper-card span:nth-child(2) {
  right: 54px;
  bottom: 56px;
}

.paper-card span:nth-child(3) {
  right: 64px;
  bottom: 36px;
}

.paper-card span:nth-child(4) {
  display: none;
}

.headphone-badge {
  right: 0;
  bottom: 0;
  width: 104px;
  height: 104px;
  border: 6px solid rgba(155, 210, 255, 0.9);
  border-radius: 50%;
  background: linear-gradient(145deg, #49aaff, #075be9 72%);
  box-shadow: 0 18px 32px rgba(13, 96, 232, 0.26);
}

.headphone-badge::before {
  position: absolute;
  top: 32px;
  left: 28px;
  width: 38px;
  height: 34px;
  border: 6px solid #ffffff;
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  content: "";
}

.headphone-badge::after {
  position: absolute;
  left: 26px;
  bottom: 26px;
  width: 13px;
  height: 25px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 41px 0 0 #ffffff;
  content: "";
}

.hero-subtitle span {
  display: inline;
}

.hero-subtitle span + span::before {
  content: " ";
}

.feature-pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: none;
}

.feature-pill,
.url-pill {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(218, 229, 245, 0.92);
  box-shadow: var(--soft-shadow);
}

.feature-pill {
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: 164px;
  gap: 9px;
  padding: 22px 10px 16px;
  border-radius: 8px;
  font-size: 0.96rem;
  font-weight: 900;
  text-align: center;
  white-space: normal;
}

.feature-pill strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.2;
}

.feature-pill > span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.38;
  word-break: keep-all;
}

.feature-icon-ring {
  position: relative;
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border-radius: 50%;
  background: #eef7ff;
}

.feature-icon-ring .pill-icon {
  width: 34px;
  height: 34px;
}

.feature-icon-ring b {
  position: absolute;
  left: 24px;
  bottom: 16px;
  padding: 1px 6px 2px;
  border-radius: 5px;
  background: var(--blue);
  color: #ffffff;
  font-size: 0.68rem;
  line-height: 1;
}

.feature-pill:focus-visible,
.url-pill:focus-visible,
button:focus-visible,
textarea:focus,
select:focus,
input[type="range"]:focus-visible {
  outline: 3px solid rgba(11, 100, 246, 0.24);
  outline-offset: 3px;
}

.pill-icon {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--blue);
}

.upload-icon::before {
  position: absolute;
  inset: 6px 2px 4px;
  border: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  content: "";
}

.upload-icon::after {
  position: absolute;
  top: 2px;
  left: 9px;
  width: 6px;
  height: 14px;
  border-top: 3px solid currentColor;
  border-left: 3px solid currentColor;
  transform: rotate(45deg);
  content: "";
}

.bars-icon {
  border-radius: 6px;
  background:
    linear-gradient(var(--blue), var(--blue)) 2px center / 4px 12px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 9px center / 4px 22px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 16px center / 4px 16px no-repeat;
}

.bars-icon::before,
.bars-icon::after {
  content: none;
}

.download-icon::before {
  position: absolute;
  right: 3px;
  bottom: 2px;
  left: 3px;
  height: 7px;
  border: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 5px 5px;
  content: "";
}

.download-icon::after {
  position: absolute;
  top: 3px;
  left: 10px;
  width: 4px;
  height: 15px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.download-icon {
  background:
    linear-gradient(45deg, transparent 42%, var(--blue) 43% 58%, transparent 59%) 5px 12px / 14px 14px no-repeat,
    linear-gradient(-45deg, transparent 42%, var(--blue) 43% 58%, transparent 59%) 5px 12px / 14px 14px no-repeat;
}

.repeat-icon::before,
.repeat-icon::after {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 3px solid currentColor;
  border-radius: 50%;
  content: "";
}

.repeat-icon::before {
  top: 1px;
  left: 1px;
  border-right-color: transparent;
}

.repeat-icon::after {
  right: 1px;
  bottom: 1px;
  border-left-color: transparent;
}

.url-pill {
  width: 100%;
  max-width: 100%;
  min-height: 96px;
  justify-content: stretch;
  gap: 16px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #208dff, #075be9 74%);
  box-shadow: 0 24px 38px rgba(7, 91, 233, 0.24);
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 950;
}

.url-pill::before {
  content: none;
}

.url-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.url-copy small {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
  font-weight: 700;
}

.url-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.28rem;
  line-height: 1.1;
}

.url-globe {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background:
    linear-gradient(#ffffff, #ffffff) center / 70% 4px no-repeat,
    linear-gradient(90deg, transparent 32%, #ffffff 32% 40%, transparent 40% 60%, #ffffff 60% 68%, transparent 68%),
    linear-gradient(transparent 31%, #ffffff 31% 39%, transparent 39% 61%, #ffffff 61% 69%, transparent 69%),
    rgba(255, 255, 255, 0.16);
  border: 4px solid rgba(255, 255, 255, 0.56);
}

.url-arrow {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  margin-left: auto;
  background: #ffffff;
  color: var(--blue);
  font-size: 2.2rem;
  line-height: 1;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid rgba(217, 231, 249, 0.96);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 34px rgba(22, 70, 130, 0.1);
}

.trust-strip div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.trust-strip strong,
.trust-strip span:not(.trust-icon) {
  grid-column: 2;
  min-width: 0;
}

.trust-strip strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
  white-space: nowrap;
}

.trust-strip span:not(.trust-icon) {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.trust-icon {
  grid-row: 1 / 3;
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  color: var(--blue);
}

.shield-icon::before {
  position: absolute;
  inset: 4px 7px;
  border: 3px solid currentColor;
  border-radius: 10px 10px 14px 14px;
  content: "";
}

.bolt-icon::before {
  position: absolute;
  inset: 2px 9px;
  background: currentColor;
  clip-path: polygon(56% 0, 12% 52%, 44% 52%, 30% 100%, 88% 38%, 54% 38%);
  content: "";
}

.lock-icon::before {
  position: absolute;
  right: 6px;
  bottom: 4px;
  left: 6px;
  height: 18px;
  border: 3px solid currentColor;
  border-radius: 5px;
  content: "";
}

.lock-icon::after {
  position: absolute;
  top: 2px;
  left: 10px;
  width: 14px;
  height: 16px;
  border: 3px solid currentColor;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  content: "";
}

.device-icon::before,
.device-icon::after {
  position: absolute;
  border: 3px solid currentColor;
  border-radius: 5px;
  content: "";
}

.device-icon::before {
  left: 3px;
  bottom: 6px;
  width: 20px;
  height: 16px;
}

.device-icon::after {
  right: 3px;
  top: 5px;
  width: 13px;
  height: 22px;
}

.workspace {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 740px;
  overflow: hidden;
  border: 1px solid rgba(189, 205, 228, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 92px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.auth-card {
  display: grid;
  grid-template-columns: 34px minmax(118px, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: 370px;
  padding: 8px;
  border: 1px solid rgba(216, 227, 243, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.auth-card strong,
.auth-card span {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-card strong {
  font-size: 0.82rem;
  font-weight: 950;
}

.auth-card span {
  color: var(--muted);
  font-size: 0.72rem;
}

.auth-card.is-signed-in {
  border-color: rgba(11, 100, 246, 0.34);
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 950;
}

.status-pill,
.system-note {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 10px 13px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.panels {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  padding: 18px;
}

.source-panel,
.player-panel {
  min-width: 0;
  border: 1px solid rgba(219, 230, 246, 0.94);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 34px rgba(18, 47, 92, 0.12);
}

.source-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  grid-template-rows: auto auto minmax(132px, 1fr) auto;
  gap: 14px 18px;
  padding: 20px;
}

.player-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(320px, 1.08fr);
  gap: 13px 18px;
  align-items: start;
  padding: 20px;
}

.source-panel .panel-title,
.player-panel .panel-title {
  grid-column: 1 / -1;
}

.drop-zone {
  grid-column: 1;
  grid-row: 2 / 5;
}

.source-actions {
  grid-column: 2;
  grid-row: 2;
}

textarea {
  grid-column: 2;
  grid-row: 3;
}

.metrics {
  grid-column: 2;
  grid-row: 4;
}

.now-reading {
  grid-column: 1;
  grid-row: 2 / 6;
}

.voice-note {
  grid-column: 1;
}

.waveform,
.progress-wrap,
.transport,
.download-row {
  grid-column: 2;
}

.range-grid,
.toggles {
  grid-row: 7;
}

.range-grid {
  grid-column: 1;
}

.toggles {
  grid-column: 2;
}

.system-note {
  grid-column: 1 / -1;
}

.player-panel .system-note {
  margin-top: 0;
}

.panel-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.panel-title span {
  color: var(--blue);
  font-size: 1.45rem;
  font-weight: 950;
}

h2 {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 950;
  line-height: 1.2;
  word-break: keep-all;
}

.flow-arrow {
  z-index: 2;
  display: grid;
  width: 52px;
  height: 52px;
  place-self: center;
  place-items: center;
  margin: -4px auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b64f6, #1a86ff);
  box-shadow: 0 16px 32px rgba(11, 100, 246, 0.3);
  color: #ffffff;
  font-size: 2rem;
  font-weight: 800;
  transform: rotate(90deg);
}

.drop-zone {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 196px;
  padding: 18px;
  border: 2px dashed #c9d8ec;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(242, 247, 255, 0.94)),
    #f8fbff;
}

.drop-zone.is-over {
  border-color: var(--blue);
  background: #f0f7ff;
}

.drop-zone.is-locked {
  border-color: #d1dbe9;
  background: #f1f5fb;
}

.drop-zone.is-locked .upload-cloud,
.drop-zone.is-locked .doc-badges {
  opacity: 0.58;
}

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

.drop-zone strong {
  display: block;
  max-width: 100%;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.45;
  word-break: keep-all;
}

.drop-zone .secondary-button {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: 150px;
}

.drop-zone p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-cloud {
  position: relative;
  width: 68px;
  height: 52px;
  justify-self: center;
  border: 5px solid var(--blue);
  border-bottom-color: transparent;
  border-radius: 34px 34px 18px 18px;
}

.upload-cloud::before {
  position: absolute;
  top: 16px;
  left: 24px;
  width: 8px;
  height: 33px;
  border-radius: 999px;
  background: var(--blue);
  content: "";
}

.upload-cloud::after {
  position: absolute;
  top: 12px;
  left: 17px;
  width: 18px;
  height: 18px;
  border-top: 6px solid var(--blue);
  border-left: 6px solid var(--blue);
  transform: rotate(45deg);
  content: "";
}

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

.doc-badges span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  box-shadow: 0 12px 22px rgba(28, 67, 125, 0.13);
  font-size: 0.78rem;
  font-weight: 950;
}

.pdf-badge {
  background: linear-gradient(135deg, var(--red), #ff6a48);
  color: #ffffff;
}

.word-badge {
  background: linear-gradient(135deg, #1d54c5, #3a91ff);
  color: #ffffff;
  font-size: 1.4rem !important;
}

.txt-badge {
  border: 1px solid #cfd8e6;
  background: var(--txt);
  color: #7a879e;
}

.secondary-button,
.play-button,
.icon-button,
.ghost-button,
.download-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.secondary-button {
  min-height: 42px;
  padding: 0 15px;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(11, 100, 246, 0.2);
  white-space: nowrap;
}

.secondary-button.slim,
.ghost-button.slim {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.secondary-button:hover,
.play-button:hover,
.icon-button:hover,
.ghost-button:hover,
.download-button:hover,
.feature-pill:hover,
.url-pill:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.text-label,
.control-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.source-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.source-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

textarea {
  width: 100%;
  min-height: 146px;
  max-height: 260px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background: #ffffff;
  line-height: 1.58;
  outline: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.metrics div {
  position: relative;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: 0;
}

.metrics div::before {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid #cfdaec;
  border-radius: 50%;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 950;
}

.metrics div:nth-child(1)::before {
  color: #ffffff;
  border-color: var(--blue);
  background: var(--blue);
  content: "1";
}

.metrics div:nth-child(2)::before {
  content: "2";
}

.metrics div:nth-child(3)::before {
  content: "3";
}

.metrics span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.now-reading {
  display: grid;
  grid-template-columns: minmax(118px, 148px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.cover-visual {
  position: relative;
  width: 100%;
  max-width: 148px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(23, 115, 255, 0.28), transparent 46%),
    linear-gradient(135deg, #06163a, #0b2f79 55%, #0f63dc);
  box-shadow: inset 0 -18px 40px rgba(8, 23, 59, 0.46);
}

.cover-glow {
  position: absolute;
  right: 34px;
  bottom: 44px;
  left: 34px;
  height: 70px;
  border-radius: 50%;
  background: rgba(63, 166, 255, 0.38);
  filter: blur(16px);
}

.cover-headphones {
  position: absolute;
  top: 48px;
  left: 50%;
  width: 64px;
  height: 58px;
  border: 8px solid #ffffff;
  border-bottom: 0;
  border-radius: 40px 40px 0 0;
  transform: translateX(-50%);
}

.cover-headphones::before,
.cover-headphones::after {
  position: absolute;
  bottom: -18px;
  width: 12px;
  height: 28px;
  border-radius: 7px;
  background: #ffffff;
  content: "";
}

.cover-headphones::before {
  left: -12px;
}

.cover-headphones::after {
  right: -12px;
}

.cover-book {
  position: absolute;
  right: 28px;
  bottom: 30px;
  left: 28px;
  height: 44px;
  border-radius: 8px 8px 22px 22px;
  background:
    linear-gradient(25deg, transparent 47%, rgba(255, 255, 255, 0.7) 48% 52%, transparent 53%),
    linear-gradient(90deg, #dfeeff 0 48%, #ffffff 50% 100%);
  box-shadow: 0 0 24px rgba(68, 173, 255, 0.56);
}

.player-header {
  display: grid;
  gap: 16px;
  min-width: 0;
}

h3 {
  color: var(--ink);
  font-size: 1.32rem;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.player-header p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}

.voice-chip {
  display: grid;
  gap: 6px;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.voice-note {
  margin-top: -6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.waveform {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  align-items: center;
  gap: 4px;
  height: 54px;
  padding: 4px 0;
}

.waveform span {
  display: block;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #4fb4ff, #0b64f6);
}

.waveform span:nth-child(1),
.waveform span:nth-child(18) {
  height: 14px;
}

.waveform span:nth-child(2),
.waveform span:nth-child(17) {
  height: 22px;
}

.waveform span:nth-child(3),
.waveform span:nth-child(16) {
  height: 34px;
}

.waveform span:nth-child(4),
.waveform span:nth-child(15) {
  height: 46px;
}

.waveform span:nth-child(5),
.waveform span:nth-child(14) {
  height: 28px;
}

.waveform span:nth-child(6),
.waveform span:nth-child(13) {
  height: 58px;
}

.waveform span:nth-child(7),
.waveform span:nth-child(12) {
  height: 38px;
}

.waveform span:nth-child(8),
.waveform span:nth-child(11) {
  height: 24px;
}

.waveform span:nth-child(9),
.waveform span:nth-child(10) {
  height: 50px;
}

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

.range-grid label,
.progress-wrap {
  display: grid;
  gap: 9px;
}

.range-grid label {
  min-width: 0;
}

.range-grid span,
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

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

.transport {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 14px;
  align-items: center;
}

.icon-button {
  display: grid;
  min-height: 52px;
  place-items: center;
  background: #eff5fd;
  color: #52627f;
  font-size: 1.2rem;
}

.icon-button.compact {
  width: 42px;
  min-height: 42px;
  flex: 0 0 auto;
}

.menu-button {
  background: #ffffff;
  color: var(--ink);
}

.play-button {
  min-height: 70px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 24%, #37a2ff, var(--blue) 70%);
  color: #ffffff;
  font-size: 1.8rem;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(11, 100, 246, 0.3);
}

.download-row {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 14px;
}

.download-button {
  min-height: 56px;
  background: #eaf3ff;
  color: var(--blue);
  font-size: 1.06rem;
}

.dots-button {
  min-height: 56px;
  font-size: 1.7rem;
}

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

.toggles label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.toggles input {
  accent-color: var(--blue);
}

.system-note {
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  line-height: 1.45;
  font-size: 0.82rem;
  font-weight: 750;
}

@media (max-width: 1500px) {
  .top-brand strong {
    font-size: 1.24rem;
  }

  .auth-card {
    max-width: 320px;
  }

  .auth-card strong,
  .auth-card span {
    max-width: 130px;
  }

  .status-pill {
    padding: 9px 10px;
    font-size: 0.72rem;
  }
}

/* Keep the centered, stacked layout on desktop as well as mobile. */
@media all {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(1040px, calc(100vw - 48px));
    gap: 30px;
    padding-top: 34px;
  }

  .hero-copy {
    align-content: start;
    min-height: 0;
  }

  h1 {
    font-size: 4.7rem;
  }

  .hero-subtitle {
    font-size: 1.65rem;
  }

  .hero-illustration {
    width: 300px;
  }

  .feature-pill {
    min-height: 174px;
  }
}

@media all {
  .app-shell {
    width: min(100vw - 24px, 720px);
    padding: 20px 0 34px;
  }

  .brand-row strong {
    font-size: 1.9rem;
  }

  .brand-mark {
    width: 58px;
    height: 48px;
  }

  h1 {
    font-size: 3.6rem;
  }

  .hero-subtitle {
    font-size: 1.28rem;
    max-width: 100%;
    word-break: normal;
  }

  .hero-subtitle span {
    display: block;
  }

  .hero-subtitle span + span::before {
    content: "";
  }

  .feature-pills {
    grid-template-columns: 1fr 1fr;
  }

  .feature-pill {
    min-height: 164px;
  }

  .url-pill {
    min-height: 92px;
    padding: 0 18px;
    font-size: 1rem;
  }

  .url-globe,
  .url-arrow {
    width: 54px;
    height: 54px;
  }

  .url-copy strong {
    font-size: 1.35rem;
  }

  .hero-illustration {
    opacity: 0.34;
    right: -40px;
    top: 82px;
    transform: scale(0.82);
    transform-origin: top right;
  }

  .trust-strip {
    grid-template-columns: 1fr 1fr;
  }

  .workspace {
    min-height: 0;
  }

  .topbar {
    display: grid;
    min-height: 0;
    padding: 16px;
  }

  .top-actions {
    display: grid;
    justify-content: stretch;
  }

  .auth-card {
    grid-template-columns: 34px minmax(0, 1fr);
    max-width: none;
  }

  .auth-card .secondary-button,
  .auth-card .icon-button {
    grid-column: 1 / -1;
  }

  .auth-card strong,
  .auth-card span {
    max-width: 100%;
  }

  .status-pill {
    justify-self: start;
  }

  .panels {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .flow-arrow {
    width: 48px;
    height: 48px;
    margin: -10px auto;
    transform: rotate(90deg);
    font-size: 1.7rem;
  }

  .source-panel,
  .player-panel {
    padding: 18px;
  }

  .source-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .source-panel .panel-title,
  .drop-zone,
  .source-actions,
  textarea,
  .metrics {
    grid-column: 1;
    grid-row: auto;
  }

  .player-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .drop-zone {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .doc-badges {
    justify-content: center;
  }

  .source-actions {
    display: grid;
    align-items: stretch;
  }

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

  .now-reading {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .cover-visual {
    width: 132px;
  }

  .range-grid,
  .toggles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100vw - 16px, 430px);
  }

  .hero-copy {
    gap: 22px;
  }

  .brand-row {
    gap: 12px;
  }

  .brand-row strong {
    font-size: 1.45rem;
  }

  h1 {
    font-size: 2.9rem;
  }

  .feature-pills {
    grid-template-columns: 1fr;
  }

  .feature-pill {
    min-height: 150px;
  }

  .url-pill {
    width: 100%;
    justify-content: center;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .hero-copy {
    padding: 26px 18px 22px;
  }

  .hero-illustration {
    display: none;
  }

  .trust-strip {
    grid-template-columns: 1fr;
  }

  .top-brand strong {
    font-size: 1.2rem;
  }

  .source-buttons,
  .metrics,
  .now-reading,
  .download-row {
    grid-template-columns: 1fr;
  }

  .cover-visual {
    width: 100%;
    max-width: 220px;
    justify-self: center;
  }

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

.app-shell > .topbar { border: 1px solid var(--line); border-radius: 8px; }
.workspace { grid-template-rows: 1fr; }
.generation-progress { padding: 14px; border-radius: 10px; background: #eaf2ff; color: #173e75; }
.generation-progress[hidden] { display: none; }
.generation-progress span { display: block; margin-bottom: 8px; font-weight: 600; }
.generation-progress progress { width: 100%; height: 12px; accent-color: #2463eb; }

/* Compact account header: one horizontal row at every viewport width. */
.app-shell > .topbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 16px;
  gap: 12px;
}
.topbar .top-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar .top-brand strong { white-space: nowrap; font-size: 1rem; }
.topbar .top-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.topbar .auth-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  width: auto;
  max-width: 240px;
}
.topbar .auth-card > div:not(.avatar) { min-width: 0; }
.topbar .auth-card strong, .topbar .auth-card span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .auth-card .avatar { width: 30px; height: 30px; flex-shrink: 0; }
.topbar .auth-card .icon-button, .topbar .menu-button { width: 30px; height: 30px; padding: 4px; flex-shrink: 0; }
.topbar .status-pill { white-space: nowrap; padding: 6px 8px; font-size: .65rem; }
@media (max-width: 600px) {
  .app-shell > .topbar { padding: 10px; gap: 6px; min-height: 60px; }
  .topbar .top-brand { gap: 6px; }
  .topbar .top-brand .brand-mark { transform: scale(.8); margin: -4px; }
  .topbar .top-brand strong { font-size: 0; }
  .topbar .top-brand strong::after { content: "BookAudio"; font-size: .85rem; }
  .topbar .top-actions { gap: 5px; }
  .topbar .auth-card { gap: 5px; }
  .topbar .auth-card span { display: none; }
  .topbar .auth-card strong { max-width: 52px; font-size: .7rem; }
  .topbar .auth-card .avatar { width: 26px; height: 26px; font-size: .65rem; }
  .topbar .auth-card:not(.is-signed-in) > div { display: none; }
  .topbar .auth-card .secondary-button { padding: 7px; font-size: .65rem; white-space: nowrap; }
  .topbar .status-pill { padding: 5px; font-size: .55rem; }
  .topbar .auth-card .icon-button, .topbar .menu-button { width: 24px; height: 26px; }
}

.compact-hero {
  position: relative; overflow: hidden; display: flex; align-items: center;
  min-height: 210px; padding: 26px 30px; border: 1px solid #d6e8ff;
  border-radius: 16px; background: linear-gradient(115deg, #fff 5%, #edf9ff 65%, #d9eeff 100%);
}
.compact-hero-copy { position: relative; z-index: 1; }
.compact-hero-brand { color: #0c204e; font-size: 20px; font-weight: 850; letter-spacing: -.6px; }
.compact-hero-tagline { margin: 3px 0 16px; color: #667896; font-size: 13px; font-weight: 650; }
.compact-hero h1 { margin: 0; color: #0c204e; font-size: clamp(27px, 4vw, 38px); line-height: 1.2; letter-spacing: -1.5px; }
.compact-hero h1 span { color: #1265f6; }
.compact-hero-description { margin: 14px 0 0; color: #203758; font-size: 13px; font-weight: 650; line-height: 1.55; }
.compact-hero-art { position: absolute; right: 24px; bottom: -30px; width: 180px; height: 210px; opacity: .75; }
.compact-hero-art::before { content: ""; position: absolute; width: 360px; height: 360px; border: 1px solid white; border-radius: 50%; left: -90px; top: -20px; box-shadow: 0 0 0 34px #ffffff55, 0 0 0 68px #ffffff33; }
.compact-paper { position: absolute; inset: 20px 20px 15px 15px; padding: 64px 22px 20px; border-radius: 18px; background: #ffffffb0; border: 2px solid #b6dfff; transform: rotate(10deg); box-shadow: -15px 18px 0 #91caff66; }
.compact-paper i { display: block; height: 5px; margin: 9px 0; border-radius: 4px; background: #bedfff; }
.compact-paper i:nth-child(2) { width: 80%; }
.compact-paper i:nth-child(3) { width: 60%; }
.compact-paper b { position: absolute; top: 14px; left: 50px; font-size: 36px; color: #76b4ff; }
.compact-sound { position: absolute; right: -5px; bottom: 25px; display: flex; gap: 5px; align-items: center; padding: 18px; border-radius: 50%; background: #62a7fa; border: 5px solid #b0d5ff; }
.compact-sound span { width: 5px; height: 22px; border-radius: 8px; background: white; }
.compact-sound span:nth-child(2) { height: 36px; }
.compact-sound span:nth-child(3) { height: 30px; }
@media (max-width: 480px) {
  .compact-hero { min-height: 190px; padding: 22px 20px; }
  .compact-hero-brand { font-size: 18px; }
  .compact-hero h1 { font-size: 28px; }
  .compact-hero h1 span { display: block; }
  .compact-hero-tagline { font-size: 11px; margin-bottom: 12px; }
  .compact-hero-art { right: -54px; opacity: .42; width: 150px; }
  .compact-hero-description { font-size: 12px; }
}

.saved-panel { min-width: 0; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.saved-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.saved-description, #savedStatus { color: #64748b; font-size: 13px; line-height: 1.6; }
.saved-mp3-list { list-style: none; margin: 12px 0 0; padding: 0; }
.saved-mp3-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; border-top: 1px solid #e6edf5; }
.saved-mp3-list li > div { min-width: 0; }
.saved-mp3-list strong { display: block; overflow-wrap: anywhere; font-size: 14px; color: #193457; }
.saved-mp3-list small { display: block; margin-top: 5px; color: #718096; font-size: 11px; }
.saved-mp3-list button { flex-shrink: 0; font-size: 12px; }
@media (max-width: 480px) { .saved-panel { padding: 16px; } .saved-heading { gap: 6px; } }

.saved-mp3-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.saved-mp3-list li { min-width: 0; flex-wrap: wrap; align-content: space-between; padding: 16px; border: 1px solid #e2eaf5; border-radius: 12px; background: #f8fbff; }
.saved-mp3-list li > div { width: 100%; }
@media (max-width: 600px) { .saved-mp3-list { grid-template-columns: 1fr; } }

.saved-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.saved-pagination:empty { display: none; }
.saved-pagination button { width: 36px; height: 36px; border: 1px solid #d5e2f3; border-radius: 9px; background: white; color: #385477; font-weight: 700; cursor: pointer; }
.saved-pagination button[aria-current="page"] { background: #1765ef; border-color: #1765ef; color: white; }
.saved-pagination button:hover { border-color: #1765ef; }

.saved-mp3-list li > .saved-file-actions { display: flex; align-items: center; gap: 8px; width: auto; }
.saved-play-button { min-width: 36px; color: #1765ef; }
.saved-audio-player { width: 100%; height: 36px; margin-top: 4px; }

.saved-play-button { font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-size: 20px !important; line-height: 1; padding: 8px; min-width: 42px; min-height: 38px; }
#playButton { font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }

#playButton, .saved-play-button { color: #1765ef; font-family: inherit; background: #edf4ff; border: 1px solid #c9dcfb; }
#playButton svg, .saved-play-button svg { display: block; width: 23px; height: 23px; margin: auto; fill: currentColor; }
#playButton:hover, .saved-play-button:hover { color: #104bb7; background: #dceaff; }

.document-title-field { display: grid; gap: 8px; color: #234267; font-size: 14px; font-weight: 700; grid-column: 1 / -1; }
.document-title-field input { width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid #cfdcf0; border-radius: 10px; background: #f8fbff; color: #183455; font: inherit; font-weight: 500; }
.document-title-field input:focus { outline: 2px solid #98bdff; border-color: #1765ef; }
