@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap");

:root {
  --navy: #0e1331;
  --navy-2: #0e397b;
  --ink: #0e1331;
  --muted: #516078;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --accent: #0e397b;
  --accent-2: #d7bc61;
  --border: rgba(14, 19, 49, 0.12);
  --shadow: 0 20px 50px rgba(14, 19, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Zen Kaku Gothic New", "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(14, 57, 123, 0.08), transparent 55%),
    radial-gradient(circle at 82% 6%, rgba(215, 188, 97, 0.12), transparent 48%),
    linear-gradient(180deg, #ffffff 0%, #f7f8fb 80%);
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  padding: 0 20px 140px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--accent);
  margin: 0 0 6px;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(14, 57, 123, 0.12);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(14, 19, 49, 0.08);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary.small {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.logo-mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.icon-button {
  border: none;
  background: var(--surface);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(14, 19, 49, 0.08);
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.view {
  display: none;
  animation: fadeUp 0.4s ease;
}

.view.active {
  display: block;
}

#homeView.view.active {
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.section {
  margin-top: 16px;
}

.section-header h2 {
  margin: 0;
  font-size: 18px;
}

.section-header p {
  margin: 4px 0 0;
  font-size: 12px;
}

.list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

#userHistoryList {
  max-height: 320px;
  overflow: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th,
.history-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(26, 54, 93, 0.08);
  text-align: left;
}

.history-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.list-item {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid rgba(26, 54, 93, 0.08);
  cursor: pointer;
  text-align: left;
}

.list-item h3 {
  margin: 0;
  font-size: 16px;
}

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

.queue-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.home-notices {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.home-notice-item {
  border: 1px solid rgba(14, 19, 49, 0.12);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}

.home-notice-item summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.home-notice-item summary::-webkit-details-marker {
  display: none;
}

.home-notice-date {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.home-notice-title {
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.home-notice-detail {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: #24364f;
  white-space: pre-wrap;
  word-break: break-word;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(26, 54, 93, 0.08);
}

.queue-item button {
  background: transparent;
  border: none;
  color: var(--navy);
  cursor: pointer;
}

.cta {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--navy-2));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(59, 120, 198, 0.2);
}

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--navy-2));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(59, 120, 198, 0.18);
}

button.ghost {
  background: transparent;
  border: 1px dashed rgba(26, 54, 93, 0.3);
  color: var(--navy);
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
}

button.danger {
  border-color: rgba(192, 57, 43, 0.5);
  color: #b03a2e;
}

button,
input,
select {
  font-family: inherit;
}

textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(26, 54, 93, 0.2);
  padding: 10px 12px;
  font-family: inherit;
}

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

.accent {
  border: none;
  background: linear-gradient(135deg, #f7d774 0%, #d6a32e 100%);
  color: #3a2a05;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(166, 116, 0, 0.25);
  border-radius: 999px;
  cursor: pointer;
}

.accent:hover {
  filter: brightness(0.98);
}

.current-plan {
  opacity: 0.7;
  cursor: not-allowed;
}

.plan-max {
  box-shadow: 0 10px 22px rgba(14, 57, 123, 0.35);
  transform: translateY(-1px);
}

.plan-pro {
  border-style: solid !important;
  border-width: 1.5px !important;
  border-color: rgba(14, 57, 123, 0.45) !important;
  background: rgba(14, 57, 123, 0.08) !important;
  font-weight: 700;
}

.plan-pro:hover {
  background: rgba(14, 57, 123, 0.14) !important;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(14, 57, 123, 0.12);
  border: 1px solid rgba(14, 57, 123, 0.2);
}

.banner-title {
  margin: 0;
  font-weight: 600;
}

.banner-text {
  margin: 4px 0 0;
  font-size: 13px;
}

.processing-card {
  display: grid;
  gap: 14px;
}

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

.processing-progress {
  display: grid;
  gap: 8px;
}

.processing-detail {
  margin-left: 6px;
}

.upload-progress {
  margin: 6px 0 8px;
}

.processing-header .processing-progress {
  margin-top: 10px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(26, 54, 93, 0.12);
  overflow: hidden;
}

.progress-value {
  height: 100%;
  width: 0%;
  min-width: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}

.file-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px dashed rgba(26, 54, 93, 0.2);
}

.file-card input {
  flex: 1;
}

.file-name {
  margin: 0;
  font-weight: 600;
}

.file-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(26, 54, 93, 0.05);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
}

.notice p {
  margin: 0;
}

.mode-context {
  display: grid;
  gap: 8px;
}

.mode-context p {
  font-size: 15px;
  color: #1b2f52;
  line-height: 1.5;
}

.mode-context strong,
.mode-context #modePointBasis {
  color: #0b1f3f;
  font-weight: 700;
}

.mode-context.loading {
  border-left: 4px solid rgba(14, 57, 123, 0.45);
}

.mode-context .loading-text {
  color: #355b8e;
  animation: modePulse 1.1s ease-in-out infinite;
}

@keyframes modePulse {
  0% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.45;
  }
}

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


.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.player-tabs {
  margin-top: 6px;
}

.mode-tabs .tab {
  border: 1px solid rgba(26, 54, 93, 0.15);
  background: #f8fafc;
  color: var(--navy);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.mode-tabs .tab.active {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  border-color: transparent;
}

.mode-tabs .tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mode-card.hidden {
  display: none;
}
.mode-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.mode-actions .field {
  min-width: 220px;
  flex: 1 1 220px;
}

.mode-actions .output-lang-field {
  min-width: 0;
  flex: 0 0 auto;
}

.output-lang-select {
  width: auto;
  min-width: 0;
}
.mode-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mode-card {
  position: relative;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(26, 54, 93, 0.15);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 6px;
}

.mode-card.selected {
  border-color: var(--accent);
  box-shadow: 0 16px 30px rgba(14, 57, 123, 0.2);
}

.mode-card h3 {
  margin: 0;
}

.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(26, 54, 93, 0.08);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--navy);
  font-weight: 600;
}

.mode-card[data-paid="true"] {
  border-color: rgba(26, 54, 93, 0.2);
}

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

select {
  border: 1px solid rgba(26, 54, 93, 0.2);
  background: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink);
}


.steps {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 8px;
}

.step {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid rgba(26, 54, 93, 0.08);
  font-size: 14px;
}

.step.active {
  border-color: var(--accent);
  background: rgba(14, 57, 123, 0.12);
  font-weight: 600;
}

.step.done {
  border-color: rgba(14, 57, 123, 0.2);
  color: var(--muted);
}

.player-card {
  display: grid;
  gap: 16px;
}

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

.text-display {
  display: grid;
  gap: 12px;
  font-size: 17px;
  line-height: 1.9;
  max-width: 920px;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.text-display details {
  border-radius: 12px;
  border: 1px solid rgba(26, 54, 93, 0.12);
  padding: 10px 12px;
  background: #fff;
}

.text-display summary {
  cursor: pointer;
  font-weight: 600;
}

.text-display summary::-webkit-details-marker {
  display: none;
}

.text-display .full-toc {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(26, 54, 93, 0.12);
  background: #f6f8fc;
  display: grid;
  gap: 10px;
}

.text-display .full-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.text-display .full-toc-title {
  font-weight: 700;
  color: var(--navy);
}

.text-display .full-toc-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.text-display .full-toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-display .toc-chip {
  border-radius: 999px;
  border: 1px solid rgba(26, 54, 93, 0.2);
  background: #fff;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}

.text-display .full-section {
  margin-bottom: 12px;
}

.text-display .block {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid rgba(26, 54, 93, 0.08);
  line-height: 1.7;
}

.text-display .section-title {
  font-weight: 800;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--navy);
  margin-bottom: 8px;
}

.text-display .section-card {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid rgba(26, 54, 93, 0.08);
  margin-bottom: 12px;
}

.text-display .section-card.active {
  border-color: var(--accent);
  background: rgba(14, 57, 123, 0.12);
}

.text-display .section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.text-display .section-body {
  font-size: 15.5px;
  line-height: 1.95;
  letter-spacing: 0.01em;
  color: #24364f;
  margin-bottom: 8px;
  white-space: pre-wrap;
  writing-mode: horizontal-tb;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.text-display .section-play {
  white-space: nowrap;
}

.text-display .block.active {
  border-color: var(--accent);
  background: rgba(14, 57, 123, 0.12);
}

.summary-pack-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--navy);
}

.points {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  line-height: 1.6;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 57, 123, 0.12);
  border: 1px solid rgba(14, 57, 123, 0.22);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
}

.player-controls {
  display: grid;
  gap: 12px;
}

.player-controls.compact {
  gap: 12px;
}

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

.player-advanced {
  border: 1px solid rgba(26, 54, 93, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
}

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

.speed-panel {
  display: grid;
  gap: 8px;
}

.seek-panel {
  display: grid;
  gap: 6px;
}

#seekBar {
  width: 100%;
}

.seek-time {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12px;
}

#ttsModeSelectPlayer,
#voiceSelect,
#bgmSelect {
  min-height: 40px;
  border: 1px solid rgba(14, 57, 123, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--navy);
  font-weight: 600;
}

.bgm-panel .inline-field {
  align-items: center;
}

#bgmVolume {
  width: 100%;
}

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

.download-actions {
  display: flex;
  gap: 8px;
}

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

.inline-field {
  display: flex;
  gap: 10px;
  align-items: center;
}

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

.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.voice-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(26, 54, 93, 0.16);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.voice-card:hover {
  border-color: rgba(14, 57, 123, 0.4);
  box-shadow: 0 8px 18px rgba(26, 54, 93, 0.12);
  transform: translateY(-1px);
}

.voice-card.active {
  border-color: var(--accent);
  background: rgba(14, 57, 123, 0.12);
  box-shadow: inset 0 0 0 1px rgba(14, 57, 123, 0.35);
}

.voice-card.disabled,
.voice-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.voice-card img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(26, 54, 93, 0.08);
}

.voice-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(26, 54, 93, 0.08);
  color: var(--navy);
  font-weight: 700;
  font-size: 16px;
}

.voice-name {
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
}

.voice-meta {
  font-size: 12px;
  color: var(--muted);
}

.inline-field input[type="range"] {
  flex: 1;
}

.toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}

.diagnose {
  border: 1px solid rgba(26, 54, 93, 0.12);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.diagnose-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--navy);
}

.diagnose-row select {
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid rgba(26, 54, 93, 0.2);
  background: #fff;
}

.doc-type {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mode-settings {
  margin: 16px 0;
  display: grid;
  gap: 12px;
}

.bgm-panel {
  display: grid;
  gap: 8px;
}

.volume-panel {
  display: grid;
  gap: 8px;
}

.volume-panel input[type="range"] {
  width: 100%;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.menu {
  position: fixed;
  inset: 0;
  background: rgba(14, 19, 49, 0.45);
  display: flex;
  justify-content: flex-end;
  z-index: 45;
}

.menu-panel {
  background: var(--surface);
  width: min(320px, 86vw);
  height: 100%;
  padding: 16px;
  box-shadow: -20px 0 40px rgba(15, 37, 68, 0.2);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.menu-list {
  display: grid;
  gap: 4px;
}

.menu-item {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(26, 54, 93, 0.12);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.15;
}

.menu-item.active {
  border-color: var(--accent);
  background: rgba(14, 57, 123, 0.12);
}




.speed {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.speed button {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid rgba(26, 54, 93, 0.2);
  background: #fff;
  cursor: pointer;
}

.speed button.active {
  background: rgba(14, 57, 123, 0.12);
  border-color: var(--accent);
}

.statusline {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(26, 54, 93, 0.05);
  border: 1px solid rgba(26, 54, 93, 0.1);
  font-size: 13px;
}

.mini-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 24px;
  background: var(--surface);
  border-top: 1px solid rgba(26, 54, 93, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  z-index: 35;
}

.mini-title {
  margin: 0;
  font-weight: 600;
}

.mini-actions {
  display: flex;
  gap: 8px;
}

.tts-busy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 30, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 46;
  backdrop-filter: blur(2px);
}

.tts-busy-card {
  width: min(640px, calc(100% - 32px));
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(14, 19, 49, 0.15);
  box-shadow: 0 30px 80px rgba(14, 19, 49, 0.28);
  padding: 28px 28px 26px;
}

.tts-busy-label {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.tts-busy-card h3 {
  margin: 0;
  font-size: clamp(24px, 3.5vw, 34px);
  line-height: 1.25;
  color: #0a1b3d;
}

.tts-busy-card .muted {
  margin: 10px 0 0;
  font-size: 14px;
}

.tts-busy-progress {
  margin-top: 18px;
  height: 10px;
  background: rgba(14, 57, 123, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.tts-busy-progress-value {
  height: 100%;
  width: 0%;
  min-width: 18%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0e397b, #d7bc61);
  transition: width 0.35s ease;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 19, 49, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  max-width: 360px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(15, 37, 68, 0.25);
}

.modal-card h3 {
  margin-top: 0;
}

#modalBody {
  white-space: pre-line;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.splash {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f5f6fa 100%);
  color: var(--navy);
  display: grid;
  place-items: center;
  z-index: 50;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.splash.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-inner {
  text-align: center;
  font-family: "Manrope", sans-serif;
}

.splash-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.splash-logo {
  width: 180px;
  max-width: 70vw;
  height: auto;
}

.splash-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--navy);
  margin-bottom: 8px;
}

@media (max-width: 720px) {
  .app {
    padding: 0 16px 160px;
  }

  .topbar {
    padding-top: 12px;
  }

  .logo-mark {
    width: 36px;
    height: 36px;
  }

  .player-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .mini-player {
    flex-direction: column;
    align-items: flex-start;
  }
}

.logo-button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.logo-text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--navy);
}

.topbar-nav {
  display: flex;
  gap: 26px;
  margin: 0 auto;
}

.nav-link {
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 6px 2px;
}

.nav-link.active {
  color: var(--navy);
  border-bottom: 2px solid var(--accent);
}

.credit-pill {
  border: none;
  background: radial-gradient(circle at 30% 25%, #ffe9a8 0%, #f4c14c 45%, #c9931e 100%);
  color: #3a2a05;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(157, 102, 0, 0.25);
  min-width: 54px;
}

.credit-pill strong {
  font-size: 16px;
}

.credit-unit {
  margin-left: 4px;
  font-weight: 700;
}

.settings-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(14, 57, 123, 0.3);
  background: #f4f8ff;
  color: #0e397b;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.settings-button:hover {
  background: #e9f1ff;
}

.settings-icon {
  font-size: 16px;
  line-height: 1;
}

.settings-label {
  font-size: 12px;
  letter-spacing: 0.03em;
}

.topbar-title {
  display: none;
}

.home-hero {
  text-align: center;
  padding: 20px 0 10px;
}

.hero-button {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--navy-2));
  color: #fff;
  padding: 16px 32px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(59, 120, 198, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hero-icon {
  font-size: 20px;
}

.hero-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.link-button {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

.card-list .list-item {
  background: #ffffff;
  border: 1px solid rgba(26, 54, 93, 0.12);
  box-shadow: 0 8px 18px rgba(14, 19, 49, 0.08);
}

#libraryList .list-item {
  background: #ffffff;
  border: 1px solid rgba(26, 54, 93, 0.12);
  box-shadow: 0 8px 18px rgba(14, 19, 49, 0.08);
}

#libraryList .list-item:hover {
  border-color: rgba(14, 57, 123, 0.3);
  box-shadow: 0 10px 20px rgba(14, 57, 123, 0.16);
}

.library-actions button {
  border: 1px solid rgba(14, 57, 123, 0.24);
  background: rgba(14, 57, 123, 0.08);
  color: var(--navy);
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

.library-actions button:hover {
  background: rgba(14, 57, 123, 0.14);
}

.library-actions button.danger {
  border-color: rgba(192, 57, 43, 0.45);
  background: rgba(192, 57, 43, 0.08);
  color: #b03a2e;
}

.library-actions button.danger:hover {
  background: rgba(192, 57, 43, 0.14);
}

.dropzone {
  border: 3px dashed rgba(14, 57, 123, 0.6);
  border-radius: 18px;
  padding: 32px;
  text-align: center;
  background: rgba(14, 57, 123, 0.06);
  position: relative;
}

.dropzone {
  cursor: pointer;
}

.dropzone input[type="file"] {
  display: none;
}

.dropzone-inner {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.cloud-icon {
  font-size: 32px;
  color: var(--accent);
}

.note {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(14, 57, 123, 0.12);
  color: var(--navy);
  font-size: 13px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stepper .step {
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9aa5b1;
}

.stepper .step span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d7dde6;
  color: #fff;
  font-weight: 700;
}

.stepper .step.active {
  color: var(--navy);
  font-weight: 700;
}

.stepper .step.active span {
  background: var(--accent);
}

@media (max-width: 900px) {
  .topbar {
    padding: 12px 16px;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .topbar-nav {
    display: flex !important;
    order: 3;
    flex: 0 0 100%;
    min-width: 100%;
    width: 100%;
    margin: 0;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
  }
  .nav-link {
    display: inline-flex;
    flex: 1 1 0;
    justify-content: center;
    align-items: center;
    min-width: 0;
    padding: 8px 4px;
    font-size: 13px;
    white-space: nowrap;
  }
  .topbar-title {
    display: block;
    font-weight: 600;
  }
  .main {
    max-width: 100%;
  }
  .stepper {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 8px;
  }
}

#menuButton {
  display: none !important;
}


.section-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.quiz-item {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.quiz-item textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(26, 54, 93, 0.2);
  padding: 8px;
  font-size: 14px;
}

.benefits-card {
  max-width: 980px;
  margin: 0 auto;
}

.benefits-title {
  margin: 0 0 14px;
  font-size: 24px;
}

.benefit-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  padding: 14px;
  margin-top: 12px;
  border: 1px solid rgba(26, 54, 93, 0.08);
  border-radius: 14px;
  background: var(--surface-2);
}

.benefit-row:first-of-type {
  margin-top: 0;
}

.benefit-cover {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(14, 19, 49, 0.12);
  box-shadow: 0 6px 14px rgba(14, 19, 49, 0.1);
}

.benefit-body h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--navy);
}

.benefit-body ul {
  margin: 0 0 12px 18px;
  padding: 0;
  display: grid;
  gap: 4px;
}

.benefit-body li {
  font-size: 14px;
  line-height: 1.6;
}

.benefit-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--navy-2));
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(14, 57, 123, 0.2);
}

@media (max-width: 900px) {
  .benefits-title {
    font-size: 20px;
  }
  .benefit-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .benefit-cover {
    max-width: 200px;
  }
  .benefit-body h3 {
    font-size: 17px;
  }
  .benefit-body li {
    font-size: 13px;
  }
  .benefit-download {
    min-width: 0;
    width: 100%;
    font-size: 14px;
  }
}
