/* Free audio tools and the homepage. Loads after styles.css and reuses its
   tokens, header, footer and buttons; pages opt in with body.tools. */

.tools .site-header,
.tools main,
.tools footer { width: min(760px, calc(100% - 32px)); }
.tools main { padding: 24px 0 48px; }

.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; font-size: .88rem; }
.site-nav a {
  padding: 6px 10px;
  border-radius: 9px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--panel-2); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 650; }

.eyebrow { margin: 0; color: var(--primary); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.tool-hero h1 {
  margin: 6px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.02em;
}
.tool-hero p { margin: 0; max-width: 60ch; color: var(--ink-soft); }

.tool-panel {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 150px;
  padding: 22px 16px;
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--panel-2);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--primary); background: var(--primary-soft); }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone strong { font-family: var(--font-display); font-size: 1.15rem; }
.dropzone span { color: var(--muted); font-size: .85rem; }
.dropzone svg { width: 30px; height: 30px; color: var(--primary); }
.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  font-size: .9rem;
}
.file-chip .file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-chip .file-size { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }

.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.field { display: grid; gap: 4px; font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.field select,
.field input[type="number"],
.field input[type="text"] {
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}
.field select:focus, .field input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px var(--primary-soft); }
.field .hint { color: var(--muted); font-weight: 400; font-size: .78rem; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-soft); }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.tool-actions .submit-button { height: 48px; }
.ghost-button {
  height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
}
.ghost-button:hover { border-color: var(--primary); }
.ghost-button:disabled { opacity: .45; cursor: not-allowed; }

.progress { height: 8px; margin-top: 14px; overflow: hidden; border-radius: 4px; background: var(--line); }
.progress > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.progress.indeterminate > i { width: 35%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.tool-status { min-height: 22px; margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.tool-status.error { color: var(--bad); }
.tool-status.success { color: var(--good); }
.download-link { color: var(--primary); font-weight: 700; text-underline-offset: 3px; }

/* trimmer */
.wave-editor { position: relative; margin-top: 16px; user-select: none; touch-action: none; }
.wave-editor canvas { display: block; width: 100%; height: 140px; border-radius: 10px; background: var(--panel-2); cursor: crosshair; }
.wave-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 22px;
  margin-left: -11px;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
}
.wave-handle::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: var(--primary); }
.wave-handle::after {
  content: "";
  position: absolute;
  left: 4px; top: 50%;
  width: 15px; height: 28px;
  margin-top: -14px;
  border-radius: 6px;
  background: var(--primary);
  box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
}
.wave-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: .7; pointer-events: none; }
.selection-readout { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip-button { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel); color: var(--ink-soft); font-size: .85rem; cursor: pointer; }
.chip-button:hover { border-color: var(--primary); color: var(--ink); }

/* BPM */
.bpm-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; }
.bpm-card { padding: 14px; border-radius: 12px; background: var(--panel-2); text-align: center; }
.bpm-card strong { display: block; font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.bpm-card > span { display: block; margin-top: 6px; color: var(--muted); font-size: .8rem; }
.bpm-card.secondary strong { font-size: 1.6rem; color: var(--ink); }
.tap-pad {
  width: 100%;
  min-height: 120px;
  margin-top: 12px;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .06s, border-color .15s;
}
.tap-pad:active, .tap-pad.hit { transform: scale(.985); border-color: var(--primary); }

/* SEO copy under each tool */
.tool-copy { margin-top: 36px; color: var(--ink-soft); }
.tool-copy h2 { margin: 28px 0 8px; font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--ink); }
.tool-copy p, .tool-copy li { line-height: 1.65; }
.tool-copy ol, .tool-copy ul { padding-left: 1.3em; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 650; color: var(--ink); }
.faq details p { margin: 8px 0 0; }

/* homepage and related-tools cards */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 22px; }
.tool-card {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.tool-card .tool-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--primary-soft); color: var(--primary); }
.tool-card .tool-icon svg { width: 22px; height: 22px; }
.tool-card h2, .tool-card h3 { margin: 4px 0 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.tool-card p { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.tool-card .card-cta { margin-top: 4px; color: var(--primary); font-size: .88rem; font-weight: 700; }
.game-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--primary-soft);
}
.game-banner h2 { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.game-banner p { margin: 4px 0 0; color: var(--ink-soft); font-size: .92rem; }
.game-banner .submit-button { display: inline-grid; place-items: center; height: 46px; text-decoration: none; }
.related { margin-top: 36px; }
.related h2 { font-family: var(--font-display); font-size: 1.2rem; }
.related .tool-grid { margin-top: 12px; }
.privacy-note { margin-top: 10px; color: var(--muted); font-size: .82rem; }

@media (max-width: 560px) {
  .tools .site-header { flex-wrap: wrap; padding: 8px 0 10px; }
  .site-nav { justify-content: flex-start; }
  .tool-panel { padding: 14px; }
}

/* ---- Studio theme: homepage and tool pages ---- */

.tools .site-header,
.tools footer { width: min(1120px, calc(100% - 40px)); }
.tools main { width: min(760px, calc(100% - 40px)); padding: 52px 0 64px; }
.tools.home main { width: min(1120px, calc(100% - 40px)); padding-top: 88px; }

.site-nav { gap: 4px; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
.site-nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.site-nav a:hover { background: var(--panel-2); color: var(--ink); }
.site-nav a[aria-current="page"] { background: transparent; color: var(--primary); font-weight: 500; box-shadow: inset 0 -2px 0 var(--primary); border-radius: 0; }

.eyebrow, .tool-hero .eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--primary); font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .12em; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.tool-panel .eyebrow { color: var(--muted); }
.tool-panel .eyebrow::before { display: none; }

.tool-hero h1 { margin: 16px 0 12px; font-size: clamp(2.3rem, 6vw, 3.4rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.02; }
.tool-hero p { color: var(--muted); font-size: 1.06rem; line-height: 1.6; }

/* homepage hero: centred, with a live meter under it */
.home .tool-hero { display: grid; justify-items: center; text-align: center; }
.home .tool-hero h1 { max-width: 15ch; margin-top: 22px; font-size: clamp(2.7rem, 7vw, 5.4rem); line-height: .98; letter-spacing: -.045em; }
.home .tool-hero > p:not(.eyebrow) { max-width: 46ch; font-size: clamp(1.05rem, 2vw, 1.2rem); }
.hero-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 30px 0 0; padding: 0; list-style: none; }
.hero-points li { padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-soft); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.hero-wave { width: 100%; height: 120px; display: flex; align-items: center; justify-content: space-between; margin-top: 64px; }
.hero-wave i { flex: 0 0 6px; height: var(--h); min-height: 4px; border-radius: 2px; background: #2a2a2a; }
.hero-wave i:nth-child(n+8):nth-child(-n+22) { background: var(--primary); box-shadow: 0 0 12px rgb(43 255 136 / 55%); }
.hero-wave { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }

/* panels and inputs */
.tool-panel { margin-top: 32px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: none; }
.tool-panel + .tool-panel { margin-top: 16px; }
.dropzone { min-height: 190px; border: 1.5px dashed #4a4a48; border-radius: 12px; background: var(--bg); }
.dropzone:hover, .dropzone.dragging { border-color: var(--primary); background: #07140d; }
.dropzone svg { width: 30px; height: 30px; color: var(--primary); filter: drop-shadow(0 0 8px rgb(43 255 136 / 50%)); }
.dropzone strong { margin-top: 6px; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; }
.dropzone span { font-family: var(--font-mono); font-size: .74rem; }
.file-chip { border-color: var(--line-strong); border-radius: 10px; background: var(--bg); font-family: var(--font-mono); font-size: .8rem; }
.field { color: var(--muted); font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.field select, .field input[type="number"], .field input[type="text"] { height: 46px; border-color: var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: .95rem; letter-spacing: 0; text-transform: none; }
.field select:focus, .field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgb(43 255 136 / 14%); }
.field .hint { text-transform: none; letter-spacing: 0; font-family: var(--font); }
.check { color: var(--ink-soft); }
.check input { accent-color: var(--primary); }
.tool-actions { margin-top: 20px; }
.tool-actions .submit-button { height: 52px; }
.submit-button:disabled { opacity: 1; background: transparent; color: rgb(43 255 136 / 50%); box-shadow: inset 0 0 0 1px rgb(43 255 136 / 35%); }
.ghost-button { height: 52px; border-color: var(--line-strong); border-radius: 12px; background: transparent; font-family: var(--font-display); font-weight: 600; }
.ghost-button:hover { border-color: var(--primary); color: var(--primary); }
.progress { height: 4px; background: var(--line); }
.progress > i { background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.tool-status { font-family: var(--font-mono); font-size: .8rem; }
.tool-status.success { color: var(--primary); }
.download-link { color: var(--primary); }
.privacy-note { color: #a6a6a2; font-size: .84rem; }
.privacy-note a { color: var(--ink-soft); }

.wave-editor canvas { border-radius: 10px; background: var(--bg); }
.wave-handle::before { background: var(--primary); }
.wave-handle::after { background: var(--primary); box-shadow: 0 0 12px rgb(43 255 136 / 55%); }
.wave-playhead { background: var(--ink); }
.selection-readout { font-family: var(--font-mono); font-size: .74rem; }
.chip-button { border-color: var(--line-strong); background: transparent; color: var(--ink-soft); font-family: var(--font-mono); font-size: .74rem; }
.chip-button:hover { border-color: var(--primary); color: var(--primary); }

.bpm-card { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.bpm-card strong { font-family: var(--font-mono); font-weight: 600; letter-spacing: -.04em; color: var(--primary); text-shadow: 0 0 18px rgb(43 255 136 / 45%); }
.bpm-card.secondary strong { color: var(--ink); text-shadow: none; }
.bpm-card > span { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.tap-pad { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg); font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; }
.tap-pad:active, .tap-pad.hit { border-color: var(--primary); box-shadow: inset 0 0 40px rgb(43 255 136 / 18%); }

/* long-form copy */
.tool-copy { margin-top: 72px; color: var(--ink-soft); }
.tool-copy h2 { margin: 44px 0 12px; font-size: 1.55rem; font-weight: 600; letter-spacing: -.03em; }
.tool-copy strong { color: var(--ink); }
.tool-copy li::marker { color: var(--primary); }
.tool-copy a { color: var(--ink); text-decoration-color: var(--primary); text-underline-offset: 4px; }
.faq details { border-bottom-color: var(--line); padding: 16px 0; }
.faq summary { font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-family: var(--font-mono); }
.faq details[open] summary::after { content: "\2212"; }

/* cards */
.tool-grid { gap: 16px; margin-top: 28px; }
.home .tool-grid { grid-template-columns: repeat(3, 1fr); margin-top: 80px; counter-reset: card; }
.tool-card { position: relative; gap: 8px; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: none; }
.tool-card:hover { border-color: var(--primary); transform: none; box-shadow: 0 0 0 1px rgb(43 255 136 / 25%), 0 0 40px rgb(43 255 136 / 8%); }
.tool-card .tool-icon { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--primary); }
.home .tool-card { min-height: 270px; grid-template-rows: auto auto 1fr auto; }
.home .tool-card::before { counter-increment: card; content: "0" counter(card); position: absolute; top: 28px; right: 26px; color: var(--muted); font-family: var(--font-mono); font-size: .72rem; }
.tool-card h2, .tool-card h3 { margin-top: 14px; font-size: 1.3rem; font-weight: 600; letter-spacing: -.025em; }
.tool-card p { color: var(--muted); font-size: .94rem; line-height: 1.55; }
.tool-card .card-cta { margin-top: 12px; color: var(--primary); font-family: var(--font-mono); font-size: .74rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }

.game-banner { margin-top: 16px; padding: 36px 40px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(120deg, #07140d, var(--panel) 55%); }
.game-banner h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; letter-spacing: -.035em; }
.game-banner p { margin-top: 8px; color: var(--muted); font-size: 1rem; }
.game-banner .submit-button { height: 52px; box-shadow: var(--btn-shadow); }

.home .tool-copy { margin-top: 80px; display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: start; border-top: 1px solid var(--line); padding-top: 32px; }
.home .tool-copy h2 { margin: 0; font-size: 1.25rem; }
.home .tool-copy ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 0; padding: 0; list-style: none; }
.home .tool-copy li { border-bottom: 1px solid var(--line); }
.home .tool-copy li a { display: flex; justify-content: space-between; padding: 14px 0; text-decoration: none; font-weight: 500; }
.home .tool-copy li a::after { content: "\2192"; color: var(--muted); }
.home .tool-copy li a:hover { color: var(--primary); }
.home .tool-copy li a:hover::after { color: var(--primary); }

.related { margin-top: 64px; }
.related h2 { font-size: 1.25rem; font-weight: 600; }

@media (max-width: 860px) {
  .home .tool-grid { grid-template-columns: 1fr; }
  .home .tool-card { min-height: 0; }
  .home .tool-copy { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tools .site-header { flex-wrap: nowrap; padding: 0; min-height: 60px; }
  .tools .site-header .brand-text { display: none; }
  .site-nav { flex-wrap: nowrap; gap: 0; font-size: .68rem; }
  .site-nav a { padding: 8px 9px; }
  .tools main { padding-top: 32px; }
  .tools.home main { padding-top: 48px; }
  .hero-wave { margin-top: 44px; height: 80px; }
  .hero-wave i { flex-basis: 3px; }
  .home .tool-grid { margin-top: 52px; }
  .tool-panel { padding: 16px; }
  .game-banner { padding: 26px 22px; }
  .game-banner .submit-button { width: 100%; }
  .home .tool-copy ul { grid-template-columns: 1fr; }
}

.ghost-button { height: 52px; border: 1px solid var(--line-strong); border-radius: 12px; background: transparent; font-family: var(--font-display); font-weight: 600; }
.hero-actions { justify-content: center; }
.hero-actions .submit-button, .hero-actions .ghost-button { height: 52px; padding: 0 26px; }
.related .tool-card .tool-icon { width: 36px; height: 36px; }
.related .tool-card .tool-icon svg { width: 18px; height: 18px; }
.related .tool-card h3 { margin-top: 8px; }
.home .tool-copy ul { margin-top: 4px; }
@media (max-width: 560px) {
  .site-nav { font-size: .76rem; }
  .site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--primary); }
  .hero-points li { flex: 1 1 100%; text-align: center; }
}

/* round 3 */
.submit-button:disabled { opacity: .35; background: var(--primary); color: var(--on-primary); box-shadow: none; }
.hero-points { gap: 0; }
.hero-points li { padding: 0 12px; border: 0; border-radius: 0; color: var(--muted); font-size: .76rem; }
.hero-points li + li { border-left: 1px solid var(--line-strong); }
.guess-item.current { border-color: var(--line-strong); background: transparent; }
.guess-item.current .guess-mark { border-right-color: var(--line-strong); }
.dropzone span { color: #a6a6a2; font-size: .8rem; }
footer, footer a { font-size: .76rem; color: #a6a6a2; }
.home .tool-card::before { font-size: .78rem; color: #a6a6a2; }
.tool-panel .eyebrow { color: #a6a6a2; font-size: .76rem; }
.legal-page h1 { line-height: 1.04; }
.tool-copy h2 { line-height: 1.1; }
.hero-actions .ghost-button { color: var(--ink); }
@media (max-width: 560px) {
  .site-nav { font-size: .8rem; }
  .site-nav a { color: var(--ink-soft); }
  .hero-points li { flex: 0 0 auto; padding: 4px 10px; }
  .hero-points li + li { border-left: 1px solid var(--line-strong); }
}

/* round 4 */
.hero-points { display: none; }
.submit-button:disabled { opacity: 1; background: #1a1a1a; color: #6f6f6c; box-shadow: inset 0 0 0 1px #2a2a2a; }
.dropzone { border: 1.5px dashed #5c5c59; }
.site-nav { font-size: .8rem; }
.site-nav a { color: var(--ink-soft); }
footer, footer a { font-size: .8rem; color: #b4b4b0; }
.dropzone span { color: #b4b4b0; }
.eyebrow, .tool-hero .eyebrow { font-size: .78rem; }
.legal-back { display: inline-block; color: var(--primary); font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.privacy-note a, .tool-copy a { color: var(--primary); text-decoration: none; }
.tap-pad { border: 1.5px solid rgb(43 255 136 / 55%); background: var(--bg); color: var(--primary); }
.tap-readout { font-family: var(--font-mono); font-weight: 600; text-shadow: 0 0 22px rgb(43 255 136 / 45%); }
.tap-hint { color: var(--ink-soft); }

/* round 5 */
.home .tool-copy li a { color: var(--ink); }
.home .tool-copy li a:hover, .home .tool-copy li a:hover::after { color: var(--primary); }
main { width: min(640px, calc(100% - 40px)); }
.tools main { width: min(760px, calc(100% - 40px)); }
.demo-chip { padding: 4px 10px; font-size: .82rem; }
.status-line { margin: 12px 0 8px; }
.tap-pad:not(.has-tempo) .tap-readout { text-shadow: none; }
@media (max-width: 560px) {
  .site-nav { font-size: .74rem; letter-spacing: .04em; }
}

/* round 6 */
main, .tools main { width: min(720px, calc(100% - 40px)); }
.game-banner .submit-button, .submit-button:hover { box-shadow: none; }
.play-button { box-shadow: none; }
.home .tool-hero h1 { margin-bottom: 22px; }
.tap-pad:not(.has-tempo) .tap-readout { color: var(--ink); text-shadow: none; }
.tap-hint { color: #b4b4b0; }

/* round 7 */
.guess-item { min-height: 44px; }
.guess-mark { color: #6f6f6c; }
.guess-item.current { box-shadow: inset 3px 0 0 var(--primary); }
.guess-item.current .guess-mark { color: var(--primary); }
.modal-close { border: 1px solid var(--line-strong); background: transparent; color: var(--ink); }
.dropzone { min-height: 168px; }
.tool-copy h2 { margin-top: 52px; }
@media (max-width: 560px) {
  header.site-header .site-nav { margin-left: 0; margin-right: 0; }
  header.site-header .site-nav a { padding: 0; }
}

/* round 8 */
.dropzone .dropzone-button { border-radius: 12px; font-family: var(--font-display); font-weight: 600; }
.game-banner { background: var(--panel); }
.tool-copy p, .tool-copy li { color: #a6a6a2; }
.tool-copy h2 { font-size: 1.35rem; }
.legend-box.bad { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.guess-item:not(.current):not(.wrong):not(.correct):not(.skip) { border-style: dashed; border-color: #2c2c2c; }
.guess-item:not(.current):not(.wrong):not(.correct):not(.skip) .guess-mark { border-right-style: dashed; border-right-color: #2c2c2c; }

/* round 9 */
:root { --tap-radius: 12px; }
.related .tool-card .tool-icon { width: 44px; height: 44px; }
.related .tool-card .tool-icon svg { width: 22px; height: 22px; }
.guess-mark { border-right: 0; }
.guess-item:not(.current):not(.wrong):not(.correct):not(.skip) { border-color: var(--line); }
.faq summary { font-weight: 500; }
.game-card h1 { font-size: clamp(2.3rem, 6vw, 3.4rem); letter-spacing: -.04em; }
.puzzle-number::before, .puzzle-number::after { content: none; }
.hero-actions .ghost-button { color: var(--ink); }
.hero-actions { align-items: center; }

/* round 10 */
:root { --slot: #111111; --rule: var(--line); }
.tap-pad { border-color: var(--line-strong); }
.tap-pad:hover, .tap-pad.hit, .tap-pad.has-tempo { border-color: rgb(43 255 136 / 60%); }
.tap-pad:not(.has-tempo) .tap-readout { color: var(--primary); }
footer, footer a { color: #a6a6a2; }
.tool-copy > h2:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 560px) {
  header.site-header .site-nav a { border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
  header.site-header .site-nav a[aria-current="page"] { border-color: var(--primary); box-shadow: none; }
}

/* round 11 */
:root { --tap-border: 1px solid var(--line-strong); --slot-line: var(--line); --slot-number: #6f6f6c; }
.tap-pad { background: var(--panel); }
.tap-pad:hover, .tap-pad.hit { border-color: var(--primary); }
.tap-pad .tap-readout { font-family: var(--font-mono); }
.tap-pad.has-tempo .tap-readout { color: var(--primary); }
@media (max-width: 560px) {
  header.site-header .site-nav { display: flex; justify-content: space-between; gap: 0; }
  header.site-header .site-nav a { border: 0; border-radius: 0; padding: 0; font-size: .76rem; }
  header.site-header .site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--primary); }
}

:root { --tap-bg: #07140d; --tap-fg: var(--ink); --tap-hint: #a6a6a2; --tap-border: 1px solid rgb(43 255 136 / 45%); --slot-line: var(--line); }
.legal-page p { color: #b4b4b0; }
.tool-panel .tap-pad:hover { border-color: var(--primary); }

/* ---- Layout shared by every theme ---- */

h1, h2 { text-wrap: balance; }

/* One header everywhere: brand on the left, nav and any page actions on the right. */
.site-header { justify-content: flex-start; }
.site-header .brand { margin-right: auto; }
.site-header .header-actions { margin-left: 12px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-actions .submit-button,
.hero-actions .ghost-button { display: inline-grid; place-items: center; text-decoration: none; }
.ghost-button { display: inline-grid; place-items: center; padding: 0 22px; color: var(--ink); text-decoration: none; }

.field-grid > * { min-width: 0; }
.field select {
  width: 100%;
  padding-right: 38px;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  -webkit-appearance: none;
  appearance: none;
  text-overflow: ellipsis;
}

#tap-reset { height: 40px; padding: 0 16px; font-size: .88rem; }

/* "Popular conversions": heading above a full-width list. */
.home .tool-copy { display: block; }
.home .tool-copy h2 { margin: 0 0 8px; }

/* Game: help and stats live beside the puzzle number, so the header matches every page. */
.game-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.game-top .puzzle-chip { margin: 0; }
.game-actions { display: flex; gap: 8px; }
.play-button.fresh::after { display: none; }
.guess-item.current { box-shadow: none; }
.demo-note { border-style: solid; }

/* The main action is the full-width button in each tool panel; disabled it is the same button, dimmed. */
.tool-panel .tool-actions .submit-button { flex: 1 1 220px; }
.submit-button:disabled, .tool-actions .submit-button:disabled { transform: none; box-shadow: none; }

/* Readable microcopy and long-form text. */
.tool-copy p, .tool-copy li { font-size: 1rem; line-height: 1.65; }
.dropzone span, .privacy-note { font-size: .875rem; }
.faq summary::after { font-size: 1.35rem; line-height: 1; }
.legal-page h1, .tool-copy h2 { line-height: 1.06; }

.related .tool-card { grid-template-rows: auto auto 1fr auto; }

@media (max-width: 560px) {
  footer .footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
  footer .footer-links a { min-height: 36px; display: flex; align-items: center; }
  /* Brand and page actions on the first row, the nav as full-width tabs below. */
  .site-header,
  .tools .site-header { flex-wrap: wrap; row-gap: 0; padding: 10px 0 0; }
  .site-header .brand-text,
  .tools .site-header .brand-text { display: inline; }
  .site-header .brand { min-height: 44px; }
  .site-nav { order: 3; flex: 1 0 100%; display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 4px; margin: 8px 0 10px; }
  .site-nav a { flex: 1 1 0; min-height: 44px; display: grid; place-items: center; padding: 0 4px; text-align: center; }
  .field-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .submit-button, .hero-actions .ghost-button { width: 100%; }
}

/* round 4 */
.tool-hero p, .challenge-note { text-wrap: pretty; }
.home .tool-hero > p:not(.eyebrow) { text-wrap: balance; }
.tool-status:empty { min-height: 0; margin: 0; }
.tool-panel .privacy-note { margin: 16px 0 0; }
.legal-page { width: min(760px, calc(100% - 40px)); }
.legal-page p { max-width: 68ch; }
.field select { height: 52px; font-size: 1rem; }
/* Empty guess slots are quiet; the input below is the one action. */
.guess-item.current .guess-text { opacity: 0; }
.tap-pad { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 160px; }
.tap-readout { font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tap-hint { font-family: var(--font); font-size: .85rem; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: .7; }
.tool-actions:has(> #tap-reset[hidden]) { display: none; }

/* round 5 */
/* Before a file is chosen the dropzone is the only action; Convert appears with the file. */
.tool-panel .tool-actions:has(> .submit-button:disabled:only-child) { display: none; }
.tap-hint { font-size: .9rem; }
@media (max-width: 560px) {
  .site-header .site-nav { justify-content: space-between; }
  .site-header .site-nav a { flex: 0 1 auto; padding: 0 10px; }
}

/* round 6: two widths only, wide for home and one column for everything else */
main, .tools main, .legal-page { width: min(720px, calc(100% - 40px)); }
.tools.home main { width: min(1120px, calc(100% - 40px)); }
.next-soundbyte { margin: 28px 0 0; text-align: center; color: var(--muted); font-size: .88rem; }
.next-soundbyte strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.tool-panel .eyebrow { font-size: .76rem; }
.dropzone > span { text-wrap: balance; }
.legal-page { max-width: none; }
@media (max-width: 560px) {
  .site-header .site-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .site-header .site-nav a { padding: 0 2px; }
}

/* round 7 */
@media (max-width: 560px) {
  footer .footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; width: 100%; }
  .site-header .site-nav { display: flex; justify-content: space-between; gap: 0; margin-left: 0; margin-right: 0; }
  .site-header .site-nav a { flex: 0 0 auto; padding: 0 10px; }
  .home .tool-hero .hero-actions { justify-self: stretch; width: 100%; }
}

/* round 8: the dropzone carries a real button */
.dropzone .dropzone-button {
  display: inline-grid;
  place-items: center;
  height: 44px;
  margin-top: 8px;
  padding: 0 22px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: .95rem;
  font-weight: 650;
  pointer-events: none;
}
.dropzone:hover .dropzone-button { background: var(--primary-dark); }
.dropzone .dropzone-limits { display: block; margin-top: 2px; font: inherit; color: inherit; }
.home .game-banner { margin-top: 48px; }
.guess-item { min-height: 42px; }
.modal-close { top: 18px; right: 18px; }

/* round 9: one frame per tool, a full-size browse button, one helper line */
.tool-panel { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.tool-panel + .tool-panel { margin-top: 40px; }
.dropzone .dropzone-button { height: 48px; padding: 0 26px; font-size: 1rem; }
.dropzone > span:last-of-type { white-space: nowrap; font-size: .875rem; }
.dropzone .dropzone-limits { display: inline; margin: 0; }
.dropzone .dropzone-limits::before { content: " \00b7  "; }
.tap-pad:not(.has-tempo) .tap-readout { opacity: 1; }
.tap-pad { border-radius: var(--tap-radius, 14px); }
.guess-item:not(.current):not(.wrong):not(.correct):not(.skip) { border-style: solid; }
.guess-item:not(.current):not(.wrong):not(.correct):not(.skip) .guess-mark { border-right-style: solid; }
.legal-page h2 { margin-top: 36px; }
@media (max-width: 560px) {
  .site-header .site-nav a { min-height: 44px; }
}

/* round 10 */
/* Empty guess slots are quiet filled bars; the current one carries a green edge. */
.guess-item:not(.wrong):not(.correct):not(.skip) { min-height: 38px; border-color: transparent; background: var(--slot); }
.guess-item:not(.wrong):not(.correct):not(.skip) .guess-mark { border-right-color: transparent; background: transparent; font-size: .82rem; color: var(--muted); }
.guess-item.current { box-shadow: inset 3px 0 0 var(--primary); }
.guess-item.current:not(.wrong):not(.correct):not(.skip) .guess-mark { color: var(--ink); }
/* Long-form copy in ruled sections. */
.tool-copy > h2 { padding-top: 32px; border-top: 1px solid var(--rule); }
.tool-copy p, .tool-copy li { max-width: 68ch; }
@media (max-width: 560px) {
  .dropzone > span:last-of-type { white-space: normal; }
  .dropzone .dropzone-limits { display: block; }
  .dropzone .dropzone-limits::before { content: none; }
  /* Tabs: four equal cells, each a 44px target. */
  .site-header .site-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .site-header .site-nav a { min-height: 44px; padding: 0; font-size: .82rem; }
  .hero-actions .ghost-button { width: 100%; }
}

/* round 11 */
/* The tap pad is the secondary path: a bordered surface, not a slab. */
.tap-pad { min-height: 120px; background: var(--panel); color: var(--ink); border: var(--tap-border); }
.tap-pad .tap-readout { font-size: 2rem; }
.tap-pad .tap-hint { color: var(--muted); opacity: 1; font-size: .9rem; }
.tap-pad.has-tempo .tap-readout { color: var(--primary-ink); }
.tool-panel:has(> .tap-pad) > .eyebrow { margin-bottom: 12px; }
/* Empty guess slots: hairline outline, no fill; the current one is outlined in green. */
.guess-item:not(.wrong):not(.correct):not(.skip) { min-height: 40px; background: transparent; border-color: var(--slot-line); box-shadow: none; }
.guess-item.current:not(.wrong):not(.correct):not(.skip) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.guess-item:not(.wrong):not(.correct):not(.skip) .guess-mark { color: var(--slot-number); }
.guess-item.current:not(.wrong):not(.correct):not(.skip) .guess-mark { color: var(--ink); }
.tool-panel .tap-pad:not(.has-tempo) .tap-readout { color: var(--ink); text-shadow: none; }
.tool-panel .tap-pad .tap-hint { font-family: var(--font); font-stretch: 100%; font-weight: 500; letter-spacing: 0; text-transform: none; }

/* round 12: slots are a read-only list, not fields */
.guess-list { gap: 0; }
.guess-item:not(.wrong):not(.correct):not(.skip),
.guess-item.current:not(.wrong):not(.correct):not(.skip) {
  min-height: 40px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--slot-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.guess-item:not(.wrong):not(.correct):not(.skip) .guess-mark { min-width: 28px; border: 0; justify-content: start; place-items: center start; font-size: .95rem; }
.guess-item.current:not(.wrong):not(.correct):not(.skip) .guess-mark::after { content: ""; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--primary); }
.guess-item.current:not(.wrong):not(.correct):not(.skip) .guess-mark { display: flex; align-items: center; }
.next-soundbyte { text-align: left; }
/* tap pad: a pressable control */
.tool-panel .tap-pad { background: var(--tap-bg); color: var(--tap-fg); border: var(--tap-border); }
.tool-panel .tap-pad:not(.has-tempo) .tap-readout { color: var(--tap-fg); }
.tool-panel .tap-pad .tap-hint { color: var(--tap-hint); }
.tool-panel .tap-pad.has-tempo .tap-readout { color: var(--primary); }
.tool-panel:has(> .tap-pad) > .eyebrow { padding: 0; background: none; color: var(--muted); }
.tool-panel:has(> .tap-pad) > .eyebrow::before { display: none; }
/* readable helper text */
.dropzone > span:last-of-type, .privacy-note { font-size: .9rem; }
.home .tool-card::before { display: none; }
.legal-page p { color: var(--ink-soft); }

/* ---- Studio: final polish ---- */

/* Tap pad: a quiet card that lights up green when touched. */
.tool-panel .tap-pad { background: var(--panel); border: 1px solid var(--line-strong); color: var(--ink); }
.tool-panel .tap-pad:hover,
.tool-panel .tap-pad.hit { border-color: var(--primary); background: #07140d; }
.tool-panel .tap-pad:not(.has-tempo) .tap-readout,
.tool-panel .tap-pad .tap-readout { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.tool-panel .tap-pad.has-tempo .tap-readout { font-family: var(--font-mono); color: var(--primary); }
.tool-panel:has(> .tap-pad) > .eyebrow { margin: 0 0 10px; }
.tool-panel:has(> .tap-pad) { margin-top: 28px; }

/* Dropzone helper in the text face, on one line where it fits. */
.dropzone > span:last-of-type { font-family: var(--font); letter-spacing: 0; color: #b4b4b0; }

/* Hero: no glow, and the cards follow closer. */
.hero-wave i:nth-child(n+8):nth-child(-n+22) { box-shadow: none; }
.hero-wave { margin-top: 48px; }
.home .tool-grid { margin-top: 56px; }

/* Popular conversions: arrows read as links, in the card CTA style. */
.home .tool-copy li a::after { color: var(--primary); font-family: var(--font-mono); }
.home .tool-copy { margin-top: 64px; }

/* One title size on every tool page; the trimmer title fits on one line. */
.tool-hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.1rem); }

/* Privacy reads like the tool pages: grey body, ruled sections. */
.legal-page p { color: #a6a6a2; }
.legal-page h2 { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 1.35rem; }

/* Footer: two links, readable. */
footer, footer a { color: #b4b4b0; }
@media (max-width: 560px) {
  footer .footer-links { display: flex; gap: 0 24px; }
  header.site-header .site-nav { justify-content: flex-start; gap: 28px; }
}

/* ---- Studio: green only where it means something ---- */
.tool-copy li::marker, .tool-copy ol li::marker { color: var(--muted); }
.faq summary::after { color: var(--ink-soft); }
.field, .tool-panel:has(> .tap-pad) > .eyebrow { font-size: .78rem; color: #c9c9c6; }
.privacy-note, .dropzone > span:last-of-type { color: #bdbdb9; }
.dropzone { border: 1.5px dashed #6a6a67; }
.dropzone:hover, .dropzone.dragging { border-color: var(--primary); }
.home .tool-card p { color: #b4b4b0; }
.tool-card .card-cta { letter-spacing: .03em; }
.home main { padding-bottom: 32px; }

/* Tap pad pairs with the dropzone: same dashed frame, a mono readout, green when it counts. */
.tool-panel .tap-pad { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel); }
.tool-panel .tap-pad:not(.has-tempo) .tap-readout { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }
.privacy-note { color: #a6a6a2; }
.tool-panel .tap-pad.hit { border-style: solid; border-color: var(--primary); box-shadow: 0 0 0 4px rgb(43 255 136 / 14%); }
.tool-panel .tap-pad.has-tempo { border-style: solid; border-color: rgb(43 255 136 / 60%); }

/* Phones: header and footer links are full 44px targets. */
@media (max-width: 560px) {
  header.site-header .site-nav { gap: 8px; margin-bottom: 6px; }
  header.site-header .site-nav { gap: 22px; margin-bottom: 0; }
  header.site-header .site-nav a { min-height: 44px; padding: 0; font-size: .82rem; }
  header.site-header .site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--primary); }
  footer .footer-links a { min-height: 44px; font-size: .82rem; }
}

/* slowed + reverb */
.chip-button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.fx-controls { display: grid; gap: 18px; margin-top: 22px; }
.fx-slider { display: grid; gap: 8px; }
.fx-label { display: flex; justify-content: space-between; color: #a6a6a2; font-family: var(--font-mono); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; }
.fx-label output { color: var(--primary); font-variant-numeric: tabular-nums; text-transform: none; }
.fx-slider input, .fx-track input { width: 100%; height: 28px; margin: 0; background: transparent; accent-color: var(--primary); cursor: pointer; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.fx-slider input::-webkit-slider-runnable-track, .fx-track input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
.fx-slider input::-moz-range-track, .fx-track input::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
.fx-slider input::-moz-range-progress, .fx-track input::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--primary); }
.fx-slider input::-webkit-slider-thumb, .fx-track input::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9px; border: 0; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--panel), 0 0 14px rgb(43 255 136 / 55%); -webkit-appearance: none; appearance: none; }
.fx-slider input::-moz-range-thumb, .fx-track input::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--panel), 0 0 14px rgb(43 255 136 / 55%); }
.fx-track input::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5px; background: var(--ink); box-shadow: none; }
.fx-track input::-moz-range-thumb { width: 14px; height: 14px; background: var(--ink); box-shadow: none; }
.fx-player { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.fx-track { flex: 1; min-width: 0; }
.fx-times { display: flex; justify-content: space-between; color: var(--muted); font-family: var(--font-mono); font-size: .72rem; font-variant-numeric: tabular-nums; }
.play-toggle { flex: 0 0 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--primary); color: var(--on-primary); cursor: pointer; box-shadow: 0 0 22px rgb(43 255 136 / 35%); }
.play-toggle svg { width: 22px; height: 22px; fill: currentColor; }
.play-toggle .icon-stop, .play-toggle.playing .icon-play { display: none; }
.play-toggle.playing .icon-stop { display: block; }
.tool-actions #save-button { flex: 1 1 220px; }
.home .tool-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .home .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .home .tool-grid { grid-template-columns: 1fr; } }

/* audiogram maker */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-1.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
.audiogram main { width: min(1120px, calc(100% - 40px)); }
.audiogram .tool-hero, .audiogram .tool-copy, .audiogram .related { max-width: 720px; }
.ag-studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; margin-top: 4px; }
.ag-stage { position: sticky; top: 16px; display: grid; gap: 14px; }
.ag-frame { --ratio: 9 / 16; display: flex; align-items: center; justify-content: center; min-height: 0; height: min(72vh, 760px); padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: repeating-conic-gradient(#0b0b0b 0 25%, #070707 0 50%) 0 0 / 22px 22px; }
.ag-frame canvas { display: block; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; aspect-ratio: var(--ratio); object-fit: contain; border-radius: 6px; box-shadow: 0 18px 50px rgb(0 0 0 / 60%); }
.ag-frame[data-aspect="9:16"] canvas { height: 100%; width: auto; }
.ag-frame[data-aspect="4:5"] canvas, .ag-frame[data-aspect="1:1"] canvas, .ag-frame[data-aspect="16:9"] canvas { width: 100%; height: auto; }
.ag-stage .fx-player { margin-top: 0; }
.ag-play-progress { margin: 8px 0 0; height: 4px; }
.ag-play-progress > i { transition: none; }
.ag-controls { display: grid; gap: 10px; min-width: 0; }
.ag-group { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 0 16px; }
.ag-group[open] { padding-bottom: 16px; }
.ag-group summary { display: flex; justify-content: space-between; padding: 14px 0; color: var(--ink); font-family: var(--font-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; list-style: none; }
.ag-group summary::-webkit-details-marker { display: none; }
.ag-group summary::after { content: "+"; color: var(--primary); }
.ag-group[open] summary::after { content: "\2212"; }
.ag-group .preset-row:first-of-type { margin-top: 0; }
.ag-group .fx-controls { margin-top: 16px; }
.ag-group .field-grid { margin-top: 0; }
.ag-group .check { display: flex; margin-top: 12px; }
.ag-group.locked { pointer-events: none; opacity: .5; }
.ag-wave-picker { position: relative; height: 72px; cursor: pointer; touch-action: none; }
.ag-wave-picker canvas { width: 100%; height: 100%; display: block; border-radius: 8px; background: var(--panel); }
.ag-hint { margin: 8px 0 10px; color: var(--muted); font-size: .82rem; }
.ag-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.ag-color { display: grid; gap: 6px; color: #a6a6a2; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.ag-color input { width: 100%; height: 44px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); cursor: pointer; }
.ag-color input::-webkit-color-swatch-wrapper { padding: 0; }
.ag-color input::-webkit-color-swatch { border: 0; border-radius: 6px; }
.ag-color input::-moz-color-swatch { border: 0; border-radius: 6px; }
.ag-image-actions { margin-top: 0; }
.ag-file-button { position: relative; display: inline-grid; place-items: center; padding: 0 18px; color: var(--ink); cursor: pointer; }
.ag-file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ag-image-actions + .field-grid { margin-top: 14px; }
#make-button { flex: 1 1 220px; }
.ag-result { margin-top: 6px; }
.ag-result video { display: block; width: 100%; max-height: 60vh; border: 1px solid var(--line); border-radius: 12px; background: #000; }
.ag-download { display: inline-grid; place-items: center; flex: 1 1 200px; height: 48px; text-decoration: none; }
@media (max-width: 860px) {
  .ag-studio { grid-template-columns: 1fr; }
  .ag-stage { position: static; }
  .ag-frame { height: auto; max-height: 64vh; }
  .ag-frame[data-aspect="9:16"] canvas { height: min(58vh, 560px); }
}
@media (max-width: 560px) {
  .site-nav { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: none; }
  .ag-colors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.home .tool-grid { grid-template-columns: repeat(3, 1fr); }
.home .tool-card-wide { grid-column: span 2; }
.new-badge { display: inline-block; margin-left: 8px; padding: 3px 8px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-family: var(--font-mono); font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; vertical-align: middle; }
@media (max-width: 1100px) { .home .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .home .tool-grid { grid-template-columns: 1fr; } .home .tool-card-wide { grid-column: auto; } }
/* audiogram fixes: inputs fill their column instead of overflowing it */
.ag-group .field-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.ag-group .field { min-width: 0; }
.ag-group .field select, .ag-group .field input[type="text"] { width: 100%; min-width: 0; box-sizing: border-box; }
.ag-group .ag-backdrop { margin-top: 14px; }
.ag-group input:disabled, .ag-group .check:has(input:disabled) { opacity: .4; cursor: not-allowed; }
.ag-keep-open { color: var(--primary); font-weight: 600; }
