/* WAV ↔ MP3: page-local work surface; shared late CSS owns fixed partials. */
.tn-wm-page {
  --wm-paper: #faf6ee;
  --wm-wash: #f5efdf;
  --wm-ink: #1a1208;
  --wm-muted: #5a4a30;
  --wm-line: #b8a888;
  --wm-soft: #ddd4be;
  --wm-button: #ede6d4;
  --wm-hover: #dfd4bb;
  --wm-primary: #382311;
  --wm-primary-hover: #633511;
  --wm-primary-text: #f7ead1;
  --wm-accent: #a43d00;
  --wm-sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", system-ui, sans-serif;
  --wm-mono: "Courier New", Courier, monospace;
  min-width: 0;
  color: var(--wm-ink);
  -webkit-text-fill-color: var(--wm-ink);
  color-scheme: light;
}
body:is([data-scheme="dark"], [data-scheme="inverse"], [data-scheme="auto"][data-d="dark"], [data-scheme="auto"][data-l="dark"]) .tn-wm-page,
html[data-scheme="dark"] body:not([data-scheme="light"]) .tn-wm-page {
  --wm-paper: #241d12;
  --wm-wash: #322a1a;
  --wm-ink: #f7ead1;
  --wm-muted: #c3b492;
  --wm-line: #826744;
  --wm-soft: #574a37;
  --wm-button: #2f2115;
  --wm-hover: #3a2a1b;
  --wm-primary: #6a3b1f;
  --wm-primary-hover: #824826;
  --wm-primary-text: #f7ead1;
  --wm-accent: #f09656;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  body[data-scheme="auto"] .tn-wm-page {
    --wm-paper: #241d12;
    --wm-wash: #322a1a;
    --wm-ink: #f7ead1;
    --wm-muted: #c3b492;
    --wm-line: #826744;
    --wm-soft: #574a37;
    --wm-button: #2f2115;
    --wm-hover: #3a2a1b;
    --wm-primary: #6a3b1f;
    --wm-primary-hover: #824826;
    --wm-primary-text: #f7ead1;
    --wm-accent: #f09656;
    color-scheme: dark;
  }
}
.tn-wm-page [hidden] { display: none !important; }
.tn-wm-page .tn-wm-tool {
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--wm-ink);
  -webkit-text-fill-color: var(--wm-ink);
  font: 14px/1.65 var(--wm-sans);
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
}
.tn-wm-tool, .tn-wm-tool *, .tn-wm-tool *::before, .tn-wm-tool *::after { box-sizing: border-box; }
.tn-wm-tool :is(p, label, strong) { margin: 0; padding: 0; }
.tn-wm-tool .tn-wm-workspace { min-width: 0; border: 1px solid var(--wm-line); background: var(--wm-paper); }
.tn-wm-tool :is(.tn-wm-directions, .tn-wm-modebar) {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
  border-bottom: 1px solid var(--wm-line);
}
.tn-wm-page .tn-wm-tool :is(button, .tn-wm-download) {
  appearance: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-width: 40px;
  min-height: 42px;
  margin: 0;
  padding: 12px 17px;
  border: 1px solid var(--wm-line);
  border-radius: 0;
  background: var(--wm-button);
  color: var(--wm-ink);
  -webkit-text-fill-color: var(--wm-ink);
  font: 900 13px/1 var(--wm-mono);
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  box-shadow: none;
  outline: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.tn-wm-page .tn-wm-tool :is(button, .tn-wm-download):hover:not(:disabled) { background: var(--wm-hover); }
.tn-wm-page .tn-wm-tool :is(button, select, .tn-wm-download):focus-visible,
.tn-wm-page .tn-wm-tool .tn-wm-drop:focus-visible { outline: 2px solid var(--wm-accent); outline-offset: 2px; }
.tn-wm-page .tn-wm-tool :is(button, select):disabled { opacity: .48; cursor: not-allowed; }
.tn-wm-page .tn-wm-tool :is(.tn-wm-primary, #tnWavMp3Pick, .tn-wm-download) {
  border-color: var(--wm-primary);
  background: var(--wm-primary);
  color: var(--wm-primary-text);
  -webkit-text-fill-color: var(--wm-primary-text);
}
.tn-wm-page .tn-wm-tool :is(.tn-wm-primary, #tnWavMp3Pick, .tn-wm-download):hover:not(:disabled) { background: var(--wm-primary-hover); border-color: var(--wm-primary-hover); }
.tn-wm-page .tn-wm-tool :is(#tnWavMp3DirectionWav, #tnWavMp3DirectionMp3) {
  flex: 1 1 50%;
  flex-direction: column;
  min-height: 76px;
  gap: 7px;
  border: 0;
  border-right: 1px solid var(--wm-line);
  background: transparent;
  font-size: 15px;
  line-height: 1.3;
}
.tn-wm-page .tn-wm-tool #tnWavMp3DirectionMp3 { border-right: 0; }
.tn-wm-tool .tn-wm-mode strong { font-size: 16px; line-height: 1.35; }
.tn-wm-tool .tn-wm-mode small { font: 400 12px/1.5 var(--wm-sans); }
.tn-wm-page .tn-wm-tool :is(#tnWavMp3DirectionWav, #tnWavMp3DirectionMp3):is([aria-pressed="true"], [aria-selected="true"]) {
  background: var(--wm-wash);
  color: var(--wm-accent);
  -webkit-text-fill-color: var(--wm-accent);
  box-shadow: inset 0 -3px var(--wm-accent);
}
.tn-wm-tool :is(.tn-wm-mode-hint, .tn-wm-mode-note) {
  flex: 1 1 220px;
  align-self: center;
  padding: 14px 20px;
  color: var(--wm-muted);
  -webkit-text-fill-color: var(--wm-muted);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.tn-wm-tool .tn-wm-drop {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 13px;
  min-width: 0;
  min-height: 274px;
  margin: 20px;
  padding: 28px 20px;
  border: 1px dashed var(--wm-line);
  background: var(--wm-wash);
  text-align: center;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.tn-wm-tool .tn-wm-drop.is-dragging { border: 2px solid var(--wm-accent); padding: 27px 19px; background: var(--wm-button); }
.tn-wm-tool :is(.tn-wm-drop-icon, .tn-wm-drop-mark) { display: block; width: 36px; height: 36px; color: var(--wm-accent); -webkit-text-fill-color: var(--wm-accent); font: 400 32px/36px var(--wm-sans); }
.tn-wm-tool .tn-wm-drop-icon svg { display: block; width: 100%; height: 100%; }
.tn-wm-tool .tn-wm-drop-kicker { color: var(--wm-muted); -webkit-text-fill-color: var(--wm-muted); font: 700 12px/1.4 var(--wm-mono); letter-spacing: .08em; }
.tn-wm-tool .tn-wm-drop-title { color: var(--wm-ink); -webkit-text-fill-color: var(--wm-ink); font-size: clamp(19px, 2vw, 25px); font-weight: 800; line-height: 1.45; text-wrap: balance; overflow-wrap: anywhere; }
.tn-wm-tool :is(.tn-wm-hint, .tn-wm-drop-copy, .tn-wm-file-detail, .tn-wm-emptyhint) { color: var(--wm-muted); -webkit-text-fill-color: var(--wm-muted); font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
html body .tn-wm-page #tnWavMp3Tool :is(.tn-wm-mode-hint, .tn-wm-hint, .tn-wm-file-detail, .tn-wm-emptyhint, .tn-wm-note) {
  color: var(--wm-muted) !important;
  -webkit-text-fill-color: var(--wm-muted) !important;
}
.tn-wm-tool .tn-wm-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; min-width: 0; padding: 16px 20px; border-top: 1px solid var(--wm-line); border-bottom: 1px solid var(--wm-soft); }
.tn-wm-tool :is(.tn-wm-settings, .tn-wm-field, .tn-wm-actions, .tn-wm-file-actions) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.tn-wm-tool .tn-wm-settings { gap: 12px 24px; }
.tn-wm-tool label { color: var(--wm-ink); -webkit-text-fill-color: var(--wm-ink); font-size: 12px; font-weight: 600; line-height: 1.5; }
.tn-wm-tool select { appearance: auto; display: block; width: 130px; max-width: 100%; min-width: 0; height: 42px; margin: 0; padding: 0 9px; border: 1px solid var(--wm-line); border-radius: 0; background: var(--wm-paper); color: var(--wm-ink); -webkit-text-fill-color: var(--wm-ink); font: 600 16px/normal var(--wm-sans); font-variant-numeric: lining-nums tabular-nums; box-shadow: none; outline: none; cursor: pointer; }
.tn-wm-tool .tn-wm-quality { padding: 12px 20px; }
.tn-wm-tool .tn-wm-feedback { padding: 0 20px; }
.tn-wm-tool #tnWavMp3Progress { appearance: none; display: block; width: 100%; height: 6px; margin: 4px 0 10px; border: 0; border-radius: 0; accent-color: var(--wm-accent); background: var(--wm-wash); }
.tn-wm-tool #tnWavMp3Progress::-webkit-progress-bar { background: var(--wm-wash); }
.tn-wm-tool #tnWavMp3Progress::-webkit-progress-value { background: var(--wm-accent); }
.tn-wm-tool #tnWavMp3Progress::-moz-progress-bar { background: var(--wm-accent); }
.tn-wm-tool :is(#tnWavMp3Status, #tnWavMp3Error):not(:empty) { padding-bottom: 14px; }
.tn-wm-tool :is(#tnWavMp3Status, #tnWavMp3Error):empty { display: none; }
.tn-wm-tool .tn-wm-error { color: var(--wm-accent); -webkit-text-fill-color: var(--wm-accent); font-size: 13px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.tn-wm-tool .tn-wm-queue-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 0; padding: 12px 20px; border-top: 1px solid var(--wm-line); background: var(--wm-wash); color: var(--wm-muted); -webkit-text-fill-color: var(--wm-muted); font: 700 12px/1.5 var(--wm-mono); }
.tn-wm-tool .tn-wm-queue { min-width: 0; }
.tn-wm-tool .tn-wm-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 20px; min-width: 0; padding: 18px 20px; border-top: 1px solid var(--wm-soft); background: var(--wm-paper); }
.tn-wm-tool .tn-wm-file > * { min-width: 0; max-width: 100%; }
.tn-wm-tool :is(.tn-wm-file-name, .tn-wm-file-detail, .tn-wm-file-status) { grid-column: 1; }
.tn-wm-tool .tn-wm-file-name { color: var(--wm-ink); -webkit-text-fill-color: var(--wm-ink); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.tn-wm-tool .tn-wm-file-status { color: var(--wm-ink); -webkit-text-fill-color: var(--wm-ink); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.tn-wm-tool .tn-wm-file-actions { grid-column: 2; grid-row: 1 / span 3; justify-content: flex-end; }
.tn-wm-tool audio { display: block; grid-column: 1 / -1; width: 100%; min-width: 0; max-width: 100%; height: 44px; margin: 8px 0 0; color-scheme: inherit; }
.tn-wm-tool .tn-wm-emptyhint { padding: 18px 20px; border-top: 1px solid var(--wm-soft); }
.tn-wm-tool :is(.tn-wm-note, noscript p) { margin-top: 14px; color: var(--wm-muted); -webkit-text-fill-color: var(--wm-muted); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.tn-wm-page .tn-wm-table-wrap { min-width: 0; max-width: 100%; margin: 16px 0; overflow-x: auto; }
.tn-wm-page .tn-wm-size-table { width: 100%; min-width: 0; margin: 0; table-layout: fixed; border-collapse: collapse; color: var(--wm-ink); -webkit-text-fill-color: var(--wm-ink); font: 13px/1.65 var(--wm-sans); font-variant-numeric: lining-nums tabular-nums; }
.tn-wm-page .tn-wm-size-table caption { margin-bottom: 8px; color: var(--wm-muted); -webkit-text-fill-color: var(--wm-muted); font-size: 12px; text-align: left; }
.tn-wm-page .tn-wm-size-table :is(th, td) { padding: 10px 8px; border: 1px solid var(--wm-line); color: var(--wm-ink); -webkit-text-fill-color: var(--wm-ink); text-align: left; overflow-wrap: anywhere; }
.tn-wm-page .tn-wm-size-table th { background: var(--wm-wash); font-weight: 700; }
.tn-wm-page .tn-wm-size-table td { background: var(--wm-paper); }
/* These wrappers reserve space, never constrain a served creative. */
.tn-wm-page .tn-wm-ad { width: 100%; max-width: 900px; min-height: 90px; height: auto; max-height: none; margin-right: auto; margin-left: auto; border: 0; background: transparent; overflow: visible; }
.tn-wm-page .tn-wm-ad--top { margin-top: 54px; margin-bottom: 24px; }
.tn-wm-page .tn-wm-ad--bottom { margin-top: 24px; margin-bottom: 30px; }
@media (max-width: 720px) {
  .tn-wm-page .tn-wm-ad--top { margin-top: 48px; margin-bottom: 20px; }
  .tn-wm-page .tn-wm-tool :is(#tnWavMp3DirectionWav, #tnWavMp3DirectionMp3) { flex: 1 1 50%; min-width: 0; min-height: 72px; padding: 12px 8px; font-size: 14px; }
  .tn-wm-page .tn-wm-tool #tnWavMp3DirectionMp3 { border-right: 0; }
  .tn-wm-tool :is(.tn-wm-mode-hint, .tn-wm-mode-note) { flex-basis: 100%; padding: 10px 14px; border-top: 1px solid var(--wm-soft); }
  .tn-wm-tool .tn-wm-drop { min-height: 250px; margin: 12px; padding: 22px 12px; gap: 12px; }
  .tn-wm-tool .tn-wm-drop.is-dragging { padding: 21px 11px; }
  .tn-wm-tool .tn-wm-toolbar { gap: 14px; padding: 14px 12px; }
  .tn-wm-tool .tn-wm-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 12px; }
  .tn-wm-tool .tn-wm-field { display: grid; gap: 6px; }
  .tn-wm-tool .tn-wm-field select { width: 100%; }
  .tn-wm-tool .tn-wm-actions { gap: 6px; }
  .tn-wm-page .tn-wm-tool .tn-wm-actions button { padding-right: 12px; padding-left: 12px; }
  .tn-wm-tool .tn-wm-quality { padding: 10px 12px; }
  .tn-wm-tool .tn-wm-feedback { padding: 0 12px; }
  .tn-wm-tool .tn-wm-queue-heading { padding: 12px; }
  .tn-wm-tool .tn-wm-file { grid-template-columns: minmax(0, 1fr); padding: 14px 12px; gap: 6px; }
  .tn-wm-tool .tn-wm-file-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: 5px; }
  .tn-wm-tool .tn-wm-emptyhint { padding: 14px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .tn-wm-tool *, .tn-wm-tool *::before, .tn-wm-tool *::after { animation: none; transition: none; scroll-behavior: auto; }
}
