/* ==========================================================================
   mp4wav.com — transcription pages. Loaded after index.css and reuses its
   tokens (--brand, --surface, --r, …), header, footer, .hero and .usp.
   ========================================================================== */

.tx-main { padding-bottom: 24px; }
.tx-h1 span { display: inline-block; }  /* wrap between phrases, never a lone character */
.tx-lede { max-width: 38em; margin: 0 auto; font-size: .97rem; }
.tx-br-wide { display: none; }
.tx-small { font-size: .8125rem; color: var(--text-3); }

/* ---------- buttons ---------- */
.tx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.tx-btn:focus-visible { outline: 3px solid rgba(109, 74, 255, .4); outline-offset: 2px; }
.tx-btn:disabled { opacity: .55; cursor: not-allowed; }
.tx-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 18px -8px rgba(109, 74, 255, .65);
}
.tx-btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(109, 74, 255, .7); }
.tx-btn-ghost { color: var(--text); background: var(--surface); border-color: var(--line); }
.tx-btn-ghost:hover:not(:disabled) { border-color: #cfd5e6; background: var(--surface-2); }
.tx-btn-sm { min-height: 38px; padding: 7px 13px; font-size: .875rem; border-radius: 10px; }
.tx-link {
  border: 0;
  background: none;
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 6px 2px;
}
.tx-link:hover { color: var(--text); }
.tx.is-paid .tx-badge { display: none; }
.tx-badge {
  font-size: .6875rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--brand-ink);
  background: var(--brand-wash);
}

/* ---------- tool card ---------- */
.tx {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px 14px 18px;
  margin-bottom: 18px;
  overflow: hidden;
}
.tx::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), #34d399);
}

.tx-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 210px;
  padding: 26px 16px;
  border: 2px dashed #cdd3e4;
  border-radius: var(--r);
  background: linear-gradient(180deg, #fbfcff, var(--surface-2));
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.tx-drop:hover, .tx-drop:focus-visible, .tx-drop.is-dragover { border-color: var(--brand); background: var(--brand-wash); }
.tx-drop:focus-visible { outline: 3px solid rgba(109, 74, 255, .35); outline-offset: 2px; }
.tx-drop.is-dragover { transform: scale(1.01); }
.tx-drop-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  color: var(--brand-ink);
  background: var(--brand-wash);
  box-shadow: inset 0 0 0 1px rgba(109, 74, 255, .14);
}
.tx-drop-label { font-size: 1.125rem; font-weight: 800; letter-spacing: -.015em; color: var(--text); }
.tx-drop-hint { font-size: .8125rem; line-height: 1.5; color: var(--text-2); max-width: 30em; }
.tx-drop-hint span { display: inline-block; }  /* wrap between phrases, not mid-word */
.tx-drop-btn { margin-top: 6px; min-width: 180px; }

.tx-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 12px 0 0;
  font-size: .8125rem;
  color: var(--text-2);
}
.tx-facts li { display: inline-flex; align-items: center; gap: 5px; }
.tx-facts li::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0f9f6e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 6.2l2.2 2.2 4.6-4.8' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.tx-facts #tx-quota { font-weight: 700; color: var(--brand-ink); }
.tx-facts #tx-quota::before { background-color: var(--brand); }

/* ---------- file bar ---------- */
.tx-filebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line-soft);
}
.tx-file-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  color: var(--brand-ink);
  background: var(--brand-wash);
}
.tx-file-text { flex: 1; min-width: 0; }
.tx-file-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-file-meta { font-size: .8125rem; color: var(--text-3); word-break: keep-all; }  /* wrap at spaces, not inside 日本語 */

/* ---------- progress ---------- */
.tx-progress { padding: 16px 0 4px; }
.tx-steps {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  font-size: .78125rem;
  font-weight: 600;
  color: var(--text-3);
}
.tx-steps li { display: flex; align-items: center; gap: 6px; }
.tx-steps li:not(:last-child)::after { content: ""; width: 18px; height: 1px; background: var(--line); }
.tx-steps li::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}
.tx-steps li.is-active { color: var(--brand-ink); }
.tx-steps li.is-active::before { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-wash); }
.tx-steps li.is-done { color: #0b7f57; }
.tx-steps li.is-done::before { background: #0f9f6e; }

.tx-bar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.tx-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), #34d399);
  transition: width .4s ease;
}
.tx-bar.is-indeterminate span { width: 35%; animation: tx-slide 1.2s ease-in-out infinite; }
@keyframes tx-slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.tx-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.tx-status { margin: 0; font-size: .875rem; font-weight: 600; color: var(--text-2); }
.tx-status.is-done { color: #0b7f57; }

/* ---------- notices (limits, fallback, errors) ---------- */
.tx-notice {
  margin: 14px 0 4px;
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid #dcd2ff;
  background: var(--brand-wash);
  text-align: left;
}
.tx-notice.is-warn { border-color: #f5d9a8; background: #fff8eb; }
.tx-notice.is-error { border-color: #f6c9c9; background: #fff3f3; }
.tx-notice h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--text);
}
.tx-notice p { margin: 0 0 12px; font-size: .875rem; }
.tx-notice .tx-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tx-meter { height: 6px; margin: 0 0 10px; border-radius: 999px; background: rgba(109, 74, 255, .15); overflow: hidden; }
.tx-meter span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s ease; }

/* ---------- result ---------- */
.tx-result { padding-top: 14px; }
.tx-media video { display: block; width: 100%; max-height: 240px; border-radius: var(--r-sm); background: #000; }
.tx-media audio { display: block; width: 100%; }
.tx-media:empty { display: none; }
.tx-toolbar { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 6px; margin: 12px 0 6px; }
.tx-toolbar .tx-btn { padding-inline: 12px; }
.tx-hint { margin: 0 0 8px; font-size: .78125rem; color: var(--text-3); }

.tx-transcript {
  position: relative;  /* rows' offsetTop is measured from here for auto-scroll */
  max-height: min(68vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  padding: 6px;
  -webkit-overflow-scrolling: touch;
}
.tx-seg {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: start;
  padding: 8px 8px;
  border-radius: 10px;
  transition: background-color .15s ease;
}
.tx-seg + .tx-seg { margin-top: 2px; }
.tx-seg:hover { background: var(--surface); }
.tx-seg.is-active { background: var(--brand-wash); }
.tx-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 68px;
  min-height: 30px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: .78125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-ink);
  cursor: pointer;
}
.tx-time svg { flex: none; opacity: .8; }
.tx-time:hover { border-color: var(--brand); background: var(--brand-wash); }
.tx-seg.is-active .tx-time { color: #fff; background: var(--brand); border-color: var(--brand); }

/* ---------- account bar (paid plans) ---------- */
.tx-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 12px;
  margin: -4px 0 12px;
  font-size: .8125rem;
  color: var(--text-2);
}
.tx-account:empty { display: none; }
.tx-account .tx-link { padding: 4px 2px; }
.tx-account-label { overflow-wrap: anywhere; }
.tx-account-label strong {
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .75rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.tx-login { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; justify-content: flex-end; }
.tx-input {
  flex: 1 1 220px;
  max-width: 320px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: .9375rem;
  color: var(--text);
  background: var(--surface);
}
.tx-input:focus { outline: 3px solid rgba(109, 74, 255, .3); outline-offset: 1px; border-color: var(--brand); }
.tx-plan .tx-btn + .tx-btn { margin-top: 12px; }

/* ---------- language picker ---------- */
.tx-langbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-2);
}
.tx-select {
  min-height: 40px;
  padding: 7px 34px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%235b6580' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 10px center / 12px no-repeat;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.tx-select:hover { border-color: #cfd5e6; }
.tx-select:focus-visible { outline: 3px solid rgba(109, 74, 255, .35); outline-offset: 2px; }
.tx-time:disabled { color: var(--text-3); cursor: default; border-color: var(--line-soft); }
.tx-text {
  margin: 0;
  padding: 3px 4px;
  border-radius: 6px;
  font-size: .9688rem;
  line-height: 1.75;
  color: var(--text);
  outline: none;
  overflow-wrap: anywhere;
}
.tx-text:focus { background: var(--surface); box-shadow: 0 0 0 2px rgba(109, 74, 255, .35); }
.tx-text.is-empty { color: var(--text-3); font-style: italic; }

.tx-skeleton { padding: 10px 8px; }
.tx-skeleton span {
  display: block;
  height: 12px;
  margin: 8px 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--line-soft), #e3e7f3, var(--line-soft));
  background-size: 200% 100%;
  animation: tx-shimmer 1.3s linear infinite;
}
.tx-skeleton span:nth-child(2) { width: 82%; }
.tx-skeleton span:nth-child(3) { width: 64%; }
@keyframes tx-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.tx-turnstile:empty { display: none; }
.tx-turnstile { display: flex; justify-content: center; margin-top: 12px; }

/* ---------- toast ---------- */
.tx-toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 50;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}

/* ---------- content cards ---------- */
.tx-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 18px;
  margin: 0 0 14px;
}
.tx-card h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--text);
  margin: 0 0 4px;
}

.tx-steps-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.tx-steps-list li {
  position: relative;
  counter-increment: step;
  padding-left: 42px;
  margin-bottom: 16px;
  color: var(--text-2);
}
.tx-steps-list li:last-child { margin-bottom: 0; }
.tx-steps-list strong { color: var(--text); }
.tx-steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--brand-wash);
  color: var(--brand-ink);
  font-size: .875rem;
  font-weight: 700;
}

.tx-feature-grid { display: grid; gap: 16px; }
.tx-feature-grid p { margin: 0; font-size: .9375rem; }

.tx-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tx-chips li {
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--text-2);
}

.tx-plans { display: grid; gap: 12px; margin-top: 14px; }
.tx-plan {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
}
.tx-plan-featured { border-color: #cbbcff; background: linear-gradient(180deg, #f7f4ff, var(--surface)); box-shadow: var(--shadow); }
.tx-price { margin: 2px 0 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.tx-price span { font-size: .875rem; font-weight: 600; color: var(--text-3); margin-left: 2px; }
.tx-price-alt { margin: 0; font-size: .8125rem; color: #0b7f57; font-weight: 600; }
.tx-plan ul { list-style: none; margin: 12px 0 16px; padding: 0; flex: 1; }
.tx-plan li { position: relative; padding-left: 20px; margin-bottom: 6px; font-size: .875rem; color: var(--text-2); }
.tx-plan li::before { content: "✓"; position: absolute; left: 0; color: #0f9f6e; font-weight: 800; }
.tx-plan .tx-btn { width: 100%; }

#faq details { border-top: 1px solid var(--line-soft); }
#faq details:last-of-type { border-bottom: 1px solid var(--line-soft); }
#faq summary {
  position: relative;
  padding: 14px 32px 14px 0;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
#faq summary::-webkit-details-marker { display: none; }
#faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-3);
}
#faq details[open] summary::after { content: "−"; }
#faq details p { margin: 0 0 14px; }

.tx-history-list { list-style: none; margin: 10px 0 0; padding: 0; }
.tx-history-list li { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); }
.tx-history-open {
  flex: 1;
  min-width: 0;
  padding: 12px 4px;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tx-history-open strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.tx-history-open span { display: block; font-size: .78125rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-history-open:hover strong { color: var(--brand-ink); }

/* ---------- share row (deliberately quiet, below the FAQ) ---------- */
.tx-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin: 22px 0 6px;
  font-size: .8125rem;
  color: var(--text-3);
}
.tx-share-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tx-share-btn {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
}
.tx-share-btn:hover { border-color: #cfd5e6; color: var(--text); }
.tx-share-btn[hidden] { display: none; }

/* ---------- legal pages (terms, privacy, refund, 特商法) ---------- */
.tx-legal h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
.tx-legal h2 { margin: 1.6rem 0 .5rem; font-size: 1.125rem; }
.tx-legal h3 { margin-top: 1.2rem; }
.tx-legal ul { margin: 0 0 1.05rem; padding-left: 1.2rem; color: var(--text-2); }
.tx-legal li { margin-bottom: .35rem; }
.tx-legal code { font-size: .875em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }
.tx-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.tx-table th, .tx-table td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.tx-table th { width: 32%; font-weight: 700; color: var(--text); background: var(--surface-2); }
.tx-table td { color: var(--text-2); }
@media (max-width: 560px) {
  .tx-table th, .tx-table td { display: block; width: auto; }
  .tx-table th { padding-bottom: 4px; border-bottom: 0; }
}

/* ---------- tablet / desktop ---------- */
@media (min-width: 720px) {
  .tx-br-wide { display: inline; }
  .tx { padding: 30px 30px 26px; margin-bottom: 26px; }
  .tx-drop { min-height: 250px; }
  .tx-card { padding: 30px 32px; margin-bottom: 18px; }
  .tx-feature-grid { grid-template-columns: 1fr 1fr; gap: 22px 28px; }
  .tx-plans { grid-template-columns: repeat(3, 1fr); }
  .tx-seg { grid-template-columns: 78px 1fr; padding: 8px 10px; }

  /* With a video, show it beside the transcript. */
  .tx-result.has-video {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 0 20px;
  }
  .tx-result.has-video .tx-media { grid-column: 1; grid-row: 1; }
  .tx-result.has-video .tx-toolbar { grid-column: 1; grid-row: 2; align-content: start; }
  .tx-result.has-video .tx-hint { grid-column: 1; grid-row: 3; }
  .tx-result.has-video .tx-transcript { grid-column: 2; grid-row: 1 / span 3; }
}

@media (prefers-reduced-motion: reduce) {
  .tx-bar.is-indeterminate span, .tx-skeleton span { animation: none; }
}
