/* Single-task audio tool pages (/tools/ringtone-maker/, volume-booster, audio-joiner,
   fade-audio, audio-converter). Builds on /css/clean-home.css tokens; pages scroll normally. */

body.audio-task { overflow-x: hidden; }
.audio-task [hidden] { display: none !important; }
.audio-task .home-shell { max-width: 880px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Breadcrumbs + hero ---------------------------------------------------------------- */
.at-crumbs { font-size: 13px; color: var(--et-mute); margin: 4px 0 18px; }
.at-crumbs a { color: var(--et-mute); text-decoration: none; }
.at-crumbs a:hover { color: var(--et-purple-dark); text-decoration: underline; }
.at-crumbs span[aria-hidden] { margin: 0 6px; }
.at-hero { padding: 4px 0 22px; max-width: 720px; }
.at-hero h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; margin: 12px 0; }
.at-hero p { font-size: 1.06rem; color: var(--et-mute); }

/* Tool card ------------------------------------------------------------------------- */
.at-tool {
  background: #fff; border: 1px solid #F1ECF9; border-radius: var(--et-card-radius);
  box-shadow: var(--et-card-shadow); padding: clamp(16px, 4vw, 28px); min-width: 0;
}
.at-tool h2 { font-size: 1.05rem; font-weight: 800; margin: 0 0 10px; letter-spacing: -0.01em; }
.at-tool fieldset { border: 0; min-width: 0; }
.at-tool legend { font-weight: 800; font-size: 0.95rem; margin-bottom: 8px; }
.at-step + .at-step { margin-top: 20px; padding-top: 18px; border-top: 1px solid #F1ECF9; }
.at-note { font-size: 13px; color: var(--et-mute); margin-top: 10px; }
.at-privacy-inline { font-size: 13px; color: var(--et-mute); margin-top: 12px; }
.at-privacy-inline strong { color: var(--et-ink); }

.at-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 26px 16px; border: 2px dashed #DCCFF5; border-radius: 16px;
  background: #FCFAFF; transition: border-color .15s ease, background .15s ease;
}
.at-drop.is-over { border-color: var(--et-purple); background: var(--et-purple-soft); }
.at-drop p { color: var(--et-mute); font-size: 14px; }
.at-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.at-fileinfo { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 14px; color: var(--et-mute); margin-bottom: 12px; min-width: 0; }
.at-fileinfo strong { color: var(--et-ink); overflow-wrap: anywhere; }

/* Buttons + fields ------------------------------------------------------------------ */
.at-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-width: 0; }
.at-row + .at-row { margin-top: 12px; }
.at-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 18px; border-radius: 999px; border: 0; font: inherit; font-weight: 800; font-size: .95rem;
  cursor: pointer; text-decoration: none; background: var(--et-purple); color: #fff;
  box-shadow: 0 8px 20px rgba(130, 87, 230, .25); transition: background .15s ease, transform .15s ease;
}
.at-btn:hover { background: var(--et-purple-dark); }
.at-btn:active { transform: translateY(1px); }
.at-btn--secondary { background: var(--et-purple-soft); color: var(--et-purple-dark); box-shadow: none; }
.at-btn--secondary:hover { background: #E9E1FA; }
.at-btn--ghost { background: transparent; color: var(--et-purple-dark); box-shadow: none; border: 1.5px solid #E2D9F5; }
.at-btn--ghost:hover { background: #FBF9FF; }
.at-btn--small { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.at-btn[disabled], .at-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.at-btn[aria-pressed="true"] { background: var(--et-purple); color: #fff; }
.at-icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 1.5px solid #E7E1F4; background: #fff; color: var(--et-purple-dark); font: inherit;
  font-weight: 800; font-size: 1rem; cursor: pointer;
}
.at-icon-btn:hover { border-color: var(--et-purple); }
.at-icon-btn[disabled] { opacity: .35; cursor: not-allowed; }

.at-tool button:focus-visible, .at-tool input:focus-visible, .at-tool select:focus-visible,
.at-tool [role="slider"]:focus-visible, .at-tool label.at-btn:focus-within {
  outline: 3px solid rgba(130, 87, 230, .45); outline-offset: 2px;
}

.at-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
@media (max-width: 620px) { .at-grid { grid-template-columns: minmax(0, 1fr); } }
.at-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 14px; font-weight: 700; }
.at-field small { font-weight: 500; color: var(--et-mute); }
.at-field > .at-btn { align-self: flex-start; }
.at-field-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.at-field-row input[type="range"] { flex: 1; min-width: 0; }
.at-tool input[type="range"] { accent-color: var(--et-purple); height: 28px; }
.at-tool input[type="number"], .at-tool select {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--et-ink); background: #fff;
  border: 1.5px solid #E2D9F5; border-radius: 10px; padding: 8px 10px; min-height: 40px; min-width: 0;
}
.at-tool input[type="number"] { width: 6.5em; }
.at-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.at-check input { width: 18px; height: 18px; accent-color: var(--et-purple); }
.at-unit { color: var(--et-mute); font-weight: 600; font-size: 13px; }
.at-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.at-seg label { position: relative; }
.at-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.at-seg span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px; border-radius: 999px;
  border: 1.5px solid #E2D9F5; font-size: 14px; font-weight: 700; color: var(--et-purple-dark); background: #fff;
}
.at-seg input:checked + span { background: var(--et-purple); border-color: var(--et-purple); color: #fff; }
.at-seg input:focus-visible + span { outline: 3px solid rgba(130, 87, 230, .45); outline-offset: 2px; }

/* Waveform -------------------------------------------------------------------------- */
.at-wave {
  position: relative; height: 150px; border-radius: 14px; background: #FBF9FF; border: 1px solid #EEE7FA;
  overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer;
}
.at-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.at-wave--short { height: 110px; }
.at-sel {
  position: absolute; top: 0; bottom: 0; background: rgba(130, 87, 230, .14);
  border-left: 2px solid var(--et-purple); border-right: 2px solid var(--et-purple); cursor: grab; touch-action: none;
}
.at-sel:active { cursor: grabbing; }
.at-handle {
  position: absolute; top: 0; bottom: 0; width: 24px; margin-left: -12px; cursor: ew-resize; touch-action: none;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.at-handle::before {
  content: ''; width: 12px; height: 38px; border-radius: 6px; background: var(--et-purple);
  box-shadow: 0 2px 8px rgba(70, 40, 140, .35); border: 2px solid #fff;
}
.at-handle:focus-visible { outline: none; }
.at-handle:focus-visible::before { box-shadow: 0 0 0 4px rgba(130, 87, 230, .45); }
.at-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--et-coral); pointer-events: none; z-index: 3; }
.at-wave-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--et-mute); margin-top: 4px; font-variant-numeric: tabular-nums; }
.at-readout { font-variant-numeric: tabular-nums; font-weight: 800; }

/* Meters ---------------------------------------------------------------------------- */
.at-meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
@media (max-width: 560px) { .at-meters { grid-template-columns: minmax(0, 1fr); } }
.at-meter { background: #FBF9FF; border: 1px solid #F1ECF9; border-radius: 14px; padding: 12px 14px; min-width: 0; }
.at-meter span { display: block; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--et-mute); }
.at-meter strong { display: block; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.at-meter small { display: block; font-size: 12.5px; color: var(--et-mute); margin-top: 2px; }
.at-meter.is-bad strong { color: #C2352B; }
.at-meter.is-good strong { color: #1B7F5B; }

/* Messages -------------------------------------------------------------------------- */
.at-msg { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.at-msg--error { background: #FFECEA; color: #8A2219; }
.at-msg--warn { background: #FFF4E0; color: #6E4A0E; }
.at-msg--info { background: var(--et-purple-soft); color: #3D2A75; }
.at-msg--ok { background: #E8F6EF; color: #165C42; }
.at-msg p + .at-row { margin-top: 10px; }
.at-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; background: #E8F6EF; color: #165C42; }
.at-badge--warn { background: #FFF4E0; color: #6E4A0E; }
.at-badge--bad { background: #FFECEA; color: #8A2219; }

/* Progress -------------------------------------------------------------------------- */
.at-progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--et-mute); }
.at-progress progress, .at-item progress { flex: 1; min-width: 0; height: 8px; accent-color: var(--et-purple); }

/* File lists (joiner, converter) ---------------------------------------------------- */
.at-list { list-style: none; display: grid; gap: 8px; margin: 14px 0 0; counter-reset: at-item; }
.at-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: center;
  background: #FBF9FF; border: 1px solid #EEE7FA; border-radius: 14px; padding: 10px 12px;
}
.at-item.is-dragging { opacity: .6; border-style: dashed; }
.at-item.is-drop-target { border-color: var(--et-purple); box-shadow: 0 0 0 2px rgba(130, 87, 230, .25); }
.at-item-num { font-weight: 800; color: var(--et-purple-dark); font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: center; }
.at-item-main { min-width: 0; }
.at-item-name { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.at-item-meta { font-size: 13px; color: var(--et-mute); font-variant-numeric: tabular-nums; }
.at-item-meta.is-error { color: #8A2219; }
.at-item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.at-item-status { grid-column: 2 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.at-grip { cursor: grab; touch-action: none; }
@media (max-width: 520px) {
  .at-item { grid-template-columns: auto minmax(0, 1fr); }
  .at-item-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.at-total { margin-top: 12px; font-size: 15px; }
.at-total strong { font-variant-numeric: tabular-nums; }

/* Ads (outside the tool only) ------------------------------------------------------- */
.at-ad { margin: 28px 0 0; min-height: 0; }
.at-ad .adsbygoogle { display: block; width: 100%; }
.at-ad:has(.adsbygoogle[data-ad-status="unfilled"]) { margin: 0; }
.at-ad .adsbygoogle[data-ad-status="unfilled"] { display: none; }

/* Article --------------------------------------------------------------------------- */
.at-article { max-width: 760px; margin: 36px 0 0; }
.at-article h2 { font-size: clamp(1.3rem, 3.6vw, 1.65rem); letter-spacing: -0.02em; font-weight: 800; margin: 36px 0 12px; }
.at-article h2:first-child { margin-top: 0; }
.at-article h3 { font-size: 1.08rem; font-weight: 800; margin: 22px 0 8px; }
.at-article p, .at-article li { font-size: 1.02rem; line-height: 1.75; color: #2E2742; }
.at-article p { margin: 0 0 14px; }
.at-article ol, .at-article ul { padding-left: 1.4em; margin: 0 0 14px; display: grid; gap: 6px; }
.at-article a { color: var(--et-purple-dark); }
.at-article code { font-size: .92em; background: var(--et-purple-soft); padding: 1px 6px; border-radius: 6px; }
.at-table-wrap { overflow-x: auto; margin: 0 0 16px; -webkit-overflow-scrolling: touch; }
.at-article table { width: 100%; border-collapse: collapse; font-size: .95rem; background: #fff; border-radius: 12px; overflow: hidden; }
.at-article th, .at-article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #F1ECF9; vertical-align: top; line-height: 1.5; }
.at-article th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--et-purple-dark); background: #FBF9FF; }
.at-faq dt { font-weight: 800; font-size: 1.04rem; margin: 18px 0 6px; }
.at-faq dd { color: #2E2742; line-height: 1.7; }
.at-sources { padding-left: 1.3em; display: grid; gap: 8px; font-size: .93rem !important; line-height: 1.55; }
.at-sources li { font-size: .93rem !important; }
.at-sources a { word-break: break-word; }
.at-privacy {
  margin: 22px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--et-purple-soft);
  color: #3D2A75; font-weight: 600; line-height: 1.6;
}

.at-related { margin: 44px 0 0; }
.at-related .home-grid { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  .audio-task *, .audio-task *::before, .audio-task *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .audio-task .home-card:hover { transform: none; }
}
