/* Atomic Labs - Wavetable generator. Prefix: wt-  (dark luxe grey, lime / cyan / violet; mobile first). Uses the site tokens from site.css. */
.wt-app { --wt-bg: #121417; --wt-panel: #1b1f24; --wt-deep: #101215; --wt-r: 14px; color: var(--text); }
.wt-app *, .wt-app *::before, .wt-app *::after { box-sizing: border-box; }
.wt-app :focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.wt-layout { display: grid; gap: 18px; }
.wt-layout > * { min-width: 0; }
.wt-stage, .wt-side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.wt-card { background: linear-gradient(180deg, #1d2126, #181b20); border: 1px solid rgba(255,255,255,.07); border-radius: var(--wt-r); padding: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 34px rgba(0,0,0,.28); min-width: 0; }
.wt-h { margin: 0 0 10px; font: 700 .74rem/1.2 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--lime); }
.wt-fine { font-size: .84rem; color: var(--dim); margin: 8px 0 0; }

/* the 3D waterfall */
.wt-fallbox { position: relative; border-radius: var(--wt-r); overflow: hidden; border: 1px solid rgba(255,255,255,.08);
  background: radial-gradient(120% 90% at 50% 110%, rgba(160,124,245,.16), transparent 60%), radial-gradient(90% 70% at 30% 0%, rgba(184,240,60,.07), transparent 60%), linear-gradient(180deg, #16191d, #0f1114); }
.wt-fall { display: block; width: 100%; aspect-ratio: 4 / 3; }
.wt-hud { position: absolute; left: 12px; right: 12px; top: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: space-between; pointer-events: none;
  font: 600 .78rem/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace; color: #cfd6dd; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.wt-hud b { color: var(--lime); font-weight: 700; }
.wt-hud #wt-hudsrc { color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-scrub { display: flex; gap: 10px; align-items: center; }
.wt-scrub .at-range { flex: 1; min-width: 0; }

/* mini views */
.wt-views { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wt-mini { margin: 0; background: var(--wt-deep); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 8px; min-width: 0; }
.wt-mini figcaption { font: 700 .66rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin: 2px 2px 6px; }
.wt-mini canvas { display: block; width: 100%; height: 96px; }

/* buttons, segments, tabs */
.wt-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text);
  font: 600 .9rem/1 var(--font); padding: 10px 14px; border-radius: 10px; cursor: pointer; min-height: 42px; transition: border-color .15s, background .15s, box-shadow .15s; white-space: nowrap; }
.wt-btn:hover { border-color: var(--cyan); }
.wt-btn.on, .wt-btn[aria-pressed="true"] { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime) inset, 0 0 14px rgba(184,240,60,.18); color: #f1ffd6; }
.wt-go { background: linear-gradient(180deg, #cbf86a, #a3dc2c); color: #141b07; border-color: #cbf86a; box-shadow: 0 0 20px rgba(184,240,60,.3); }
.wt-go:hover { border-color: #ecffb8; }
.wt-go.on, .wt-go[aria-pressed="true"] { background: linear-gradient(180deg, #d9c8ff, #a07cf5); border-color: #c9b5ff; color: #160f29; box-shadow: 0 0 22px rgba(160,124,245,.45); }
.wt-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--wt-deep); border: 1px solid var(--line); max-width: 100%; }
.wt-seg button { appearance: none; border: 1px solid transparent; background: transparent; color: var(--muted); font: 600 .86rem/1.1 var(--font); padding: 8px 12px; border-radius: 9px; cursor: pointer; min-height: 38px; }
.wt-seg button:hover { color: var(--text); }
.wt-seg button.on { background: var(--panel2); color: var(--text); border-color: var(--lime); }
.wt-seg button b { color: var(--lime); margin-right: 4px; }
.wt-tabs { display: flex; gap: 6px; margin: 12px 0 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wt-tabs button { appearance: none; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 600 .92rem/1 var(--font); padding: 10px 10px 11px; cursor: pointer; margin-bottom: -1px; min-height: 40px; }
.wt-tabs button:hover { color: var(--text); }
.wt-tabs button.on { color: var(--text); border-image: var(--grad) 1; border-bottom: 2px solid; }
.wt-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wt-row + .wt-row { margin-top: 10px; }
.wt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wt-chip { appearance: none; font: 500 .82rem/1 var(--font); padding: 8px 10px; border-radius: 999px; border: 1px solid var(--line2); background: var(--wt-deep); color: var(--muted); cursor: pointer; min-height: 34px; }
.wt-chip:hover { color: var(--text); border-color: var(--lime); }

/* editors */
.wt-edit { display: block; width: 100%; height: 150px; border-radius: 10px; background: var(--wt-deep); border: 1px solid var(--line2); touch-action: none; cursor: crosshair; }
.wt-edit:focus-visible { border-color: var(--cyan); }
.wt-expr { width: 100%; min-width: 0; background: var(--wt-deep); border: 1px solid var(--line2); border-radius: 10px; color: var(--lime); padding: 12px 14px;
  font: 600 .95rem/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.wt-expr:focus { border-color: var(--lime); outline: none; box-shadow: 0 0 0 3px rgba(184,240,60,.15); }
.wt-expr[aria-invalid="true"] { border-color: var(--amber); }
.wt-ferr { min-height: 1.3em; font-size: .84rem; color: var(--muted); margin: 8px 0 0; }
.wt-ferr.bad { color: var(--amber); }
.wt-ref { margin-top: 10px; font-size: .84rem; color: var(--muted); }
.wt-ref summary { cursor: pointer; color: var(--text); font-weight: 600; }
.wt-ref code { color: var(--cyan); font-size: .82rem; }
.wt-sel { background: var(--wt-deep); border: 1px solid var(--line2); color: var(--text); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: .9rem; min-height: 40px; max-width: 100%; }
.wt-sel:focus { border-color: var(--lime); outline: none; }
.wt-field { display: grid; gap: 5px; min-width: 0; }
.wt-field > span { font: 700 .66rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.wt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wt-check { display: inline-flex; gap: 8px; align-items: center; font-size: .92rem; color: var(--text); cursor: pointer; min-height: 40px; }
.wt-check input { width: 18px; height: 18px; accent-color: var(--lime); }
.wt-name { width: 100%; min-width: 0; background: var(--wt-deep); border: 1px solid var(--line2); border-radius: 10px; color: var(--text); padding: 10px 12px; font: inherit; }
.wt-name:focus { border-color: var(--lime); outline: none; }
.wt-file { position: relative; overflow: hidden; }
.wt-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.wt-file:focus-within { outline: 2px solid var(--cyan); outline-offset: 2px; }
.wt-status { min-height: 2.6em; font-size: .86rem; color: var(--muted); margin: 10px 0 0; }
.wt-stats { font: 600 .78rem/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--dim); margin: 0; min-height: 1.3em; }

/* audition bar + meter */
.wt-aud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wt-meter { --wt-lvl: 0; position: relative; width: 70px; height: 8px; border-radius: 6px; background: var(--wt-deep); border: 1px solid var(--line); overflow: hidden; }
.wt-meter::after { content: ""; position: absolute; inset: 0; background: var(--grad); transform-origin: left; transform: scaleX(var(--wt-lvl)); transition: transform .08s linear; }

/* page mount: the tool's markup is pre-rendered, so nothing jumps when the script starts */
.wt-mount { min-height: 400px; }
.wt-ftable code { color: var(--cyan); }

@media (min-width: 700px) {
  .wt-mini canvas { height: 120px; }
  .wt-edit { height: 170px; }
}
@media (min-width: 1080px) {
  .wt-layout { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
  .wt-fall { aspect-ratio: 16 / 11; }
}
@media (prefers-reduced-motion: reduce) { .wt-app * { transition: none !important; } }
