@font-face {
  font-family: Geist;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/geist-400.woff2) format("woff2");
}
@font-face {
  font-family: Geist;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/geist-500.woff2) format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-weight: 400;
  font-display: swap;
  src: url(fonts/geist-mono-400.woff2) format("woff2");
}
:root {
  --bg: #fafafa;
  --ink: #1a1a1a;
  --muted: #737373;
  --line: #e5e5e5;
  --chip: #efefef;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Geist, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
body {
  position: fixed;
  inset: 0;
  touch-action: none;
}
canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
header {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top));
  left: calc(24px + env(safe-area-inset-left));
  right: 64px; /* clear of the source link */
  pointer-events: none;
}
/* source link: a quiet 44px target aligned with the title */
.gh {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.gh svg {
  width: 18px;
  height: 18px;
}
@media (hover: hover) {
  .gh:hover {
    color: var(--ink);
  }
}
h1 {
  margin: 0;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
header p {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
  text-wrap: balance;
}
/* two stacked containers: the prompt, then the controls. No dividers inside either. */
.bar {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ask,
.row {
  padding: 4px;
  background: rgba(250, 250, 250, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.ask {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ask input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: none;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
}
.ask input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.ask input:focus-visible {
  outline: none;
  background: var(--chip);
}
.status {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  padding-right: 4px;
}
.status:empty {
  display: none;
}
.busy .status {
  color: transparent;
  background: linear-gradient(100deg, var(--muted) 34%, var(--ink) 50%, var(--muted) 66%) 100% 0/250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 1.8s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: 0 0;
  }
}
.go {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--ink);
  flex: none;
  transition: opacity 0.15s;
}
.go:disabled {
  opacity: 0.3;
  cursor: default;
}
.go svg {
  width: 18px;
  height: 18px;
}
.row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.seg {
  display: flex;
  gap: 2px;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.seg button {
  height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
  transition:
    background-color 0.15s,
    color 0.15s;
}
.seg button[aria-pressed="true"],
.seg button.on {
  background: var(--chip);
  color: var(--ink);
}
@media (hover: hover) {
  .seg button:hover {
    color: var(--ink);
  }
}
.waves {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 0 12px;
}
.out {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 16ch;
  text-align: right;
}
.out b {
  font-weight: 400;
  color: var(--ink);
}
input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 44px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  --p: 0%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 / var(--p) 100% no-repeat,
    var(--line);
}
input[type="range"]::-moz-range-track {
  height: 2px;
  border-radius: 1px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 / var(--p) 100% no-repeat,
    var(--line);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--ink);
  border: 0;
  box-shadow: 0 0 0 4px var(--bg);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  border: 0;
  box-shadow: 0 0 0 4px var(--bg);
}
.snd {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: none;
  transition:
    background-color 0.15s,
    color 0.15s;
}
.snd[aria-pressed="true"] {
  background: var(--chip);
  color: var(--ink);
}
.snd svg {
  width: 18px;
  height: 18px;
}
.snd .on {
  display: none;
}
.snd[aria-pressed="true"] .on {
  display: inline;
}
.snd[aria-pressed="true"] .off {
  display: none;
}
.tune {
  width: 0;
  margin-left: -4px;
  opacity: 0;
  overflow: hidden;
  transition:
    width 0.18s cubic-bezier(0.23, 1, 0.32, 1),
    margin 0.18s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.18s cubic-bezier(0.23, 1, 0.32, 1),
    background-color 0.15s,
    color 0.15s;
}
.snd[aria-pressed="true"] ~ .tune {
  width: 44px;
  margin-left: 0;
  opacity: 1;
}
.tune[aria-expanded="true"] {
  background: var(--chip);
  color: var(--ink);
}
.pop {
  position: absolute;
  left: 0;
  width: min(340px, 100%);
  bottom: calc(100% + 8px);
  background: var(--bg); /* solid: the drawing never shows through a menu */
  border: 1px solid var(--line);
  border-radius: 14px;
  transform-origin: 40% 100%;
  opacity: 0;
  transform: scale(0.96);
  visibility: hidden;
  transition:
    opacity 0.12s ease-out,
    transform 0.12s ease-out,
    visibility 0s 0.12s;
}
.pop.open {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition:
    opacity 0.18s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.18s cubic-bezier(0.23, 1, 0.32, 1);
}
.tuner {
  padding: 6px 12px 8px;
}
.tuner label,
.tuner .t {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
}
.tuner .k {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  width: 78px;
  flex: none;
}
.tuner .v {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 7ch;
  text-align: right;
}
.tuner input[type="range"] {
  height: 36px;
}
.opts {
  flex: 1;
  display: flex;
  gap: 2px;
}
.opts button {
  flex: 1;
  height: 30px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  transition:
    background-color 0.15s,
    color 0.15s;
}
.opts button[aria-pressed="true"] {
  background: var(--chip);
  color: var(--ink);
}
.foot {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}
.reset,
.expand {
  height: 30px;
  padding: 0 4px;
  font-size: 12px;
  color: var(--muted);
  transition: color 0.15s;
}
.expand {
  display: none;
}
@media (hover: hover) {
  .opts button:hover,
  .reset:hover,
  .expand:hover {
    color: var(--ink);
  }
}
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
input[type="range"]:focus-visible {
  outline: none;
}
input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 6px var(--ink);
}
/* saved shapes */
.shelf {
  --row: 40px;
  padding: 4px;
}
.keep {
  display: flex;
  align-items: center;
  gap: 4px;
}
.keep input {
  flex: 1;
  min-width: 0;
  height: var(--row);
  border: 0;
  background: none;
  padding: 0 8px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  border-radius: 8px;
  -webkit-user-select: text;
  user-select: text;
  -webkit-appearance: none;
  appearance: none;
}
.keep input:focus-visible {
  outline: none;
  background: var(--chip);
}
.save {
  height: var(--row);
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--chip);
  color: var(--ink);
  flex: none;
}
.keep:not([hidden]) + .none + .list:not(:empty) {
  margin-top: 4px;
}
.none {
  margin: 0;
  padding: 10px 8px;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: calc(var(--row) * 4.5); /* a half row shows that the list scrolls */
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.list :focus-visible {
  outline-offset: -2px; /* the list scrolls, so an outside ring would be clipped */
}
.list li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}
.item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--row);
  padding: 0 8px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  transition:
    background-color 0.15s,
    color 0.15s;
}
.item[aria-current="true"] {
  background: var(--chip);
  color: var(--ink);
}
.item svg {
  width: 20px;
  height: 20px;
  flex: none;
  overflow: visible;
}
.item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.del {
  width: var(--row);
  height: var(--row);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
  flex: none;
  transition: color 0.15s;
}
.del svg {
  width: 14px;
  height: 14px;
}
.del .confirm {
  display: none;
}
.del.armed .confirm {
  display: grid;
  place-items: center;
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--chip);
  color: var(--ink);
  white-space: nowrap;
}
@media (hover: hover) {
  .item:hover,
  .del:hover {
    color: var(--ink);
  }
}

@media (max-width: 600px) {
  .row {
    flex-wrap: wrap;
  }
  .seg {
    flex: 1;
  }
  .seg button {
    flex: 1;
    padding: 0 6px;
  }
  /* two rows at every width: shapes and speaker, then waves with the tuner at its end */
  .waves {
    order: 3;
    flex: 1 1 calc(100% - 48px);
    padding: 0 8px 0 12px;
  }
  .tune {
    order: 4;
  }
  .out {
    min-width: 0;
  }
  .expand {
    display: block;
    margin-left: auto;
  }
  .tuner:not(.full) .more {
    display: none;
  }
  .pop {
    width: 100%;
  }
  .shelf {
    --row: 44px;
  }
}
/* the smallest phones: give the placeholder the room to show in full */
@media (max-width: 360px) {
  .ask {
    gap: 0;
    padding-right: 0;
  }
  .ask input {
    padding: 0 0 0 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  .busy .status {
    animation: none;
    color: var(--muted);
    background: none;
  }
}
