:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #171717; background: #f7f7f5; font-synthesis: none; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid #171717; outline-offset: 3px; }
body { margin: 0; min-height: 100vh; background: #f7f7f5; }
main { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 72px; }
header { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 38px; }
.brand h1 { margin: 0; font-size: 24px; letter-spacing: -.045em; }
.brand p { margin: 2px 0 0; color: #777; font-size: 12px; }
.project-links { margin-left: auto; display: flex; align-items: flex-end; gap: 3px; }
.project-links a { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: #333; text-decoration: none; transition: color .16s ease, background .16s ease, transform .16s ease; }
.project-links a:hover { color: #000; background: #e9e9e6; transform: translateY(-2px); }
.project-links svg { width: 17px; height: 17px; fill: currentColor; }
.project-links img { width: 19px; height: 18px; object-fit: contain; }

.model-loader { min-height: calc(100vh - 190px); display: grid; place-items: center; }
.loader-content { width: min(320px, 80vw); display: flex; flex-direction: column; align-items: center; text-align: center; }
.loader-content strong { margin-top: 17px; font-size: 14px; }
.loader-content > span { margin-top: 5px; color: #858585; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.loader-wave { height: 46px; display: flex; align-items: center; gap: 4px; color: #222; }
.loader-wave i { width: 3px; height: 12px; border-radius: 3px; background: currentColor; animation: breathe .9s ease-in-out infinite alternate; }
.loader-wave i:nth-child(2), .loader-wave i:nth-child(6) { animation-delay: -.6s; }
.loader-wave i:nth-child(3), .loader-wave i:nth-child(5) { animation-delay: -.3s; }
.loader-wave i:nth-child(4) { animation-delay: -.75s; }
@keyframes breathe { to { height: 42px; opacity: .42; } }
.model-progress { width: 100%; height: 3px; margin-top: 18px; overflow: hidden; background: #dededb; }
.model-progress i { display: block; width: 0; height: 100%; background: #171717; transition: width .2s ease; }
.model-progress i.busy { width: 36%; animation: scan 1.3s ease-in-out infinite; }
#app { animation: reveal .28s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }

.drop { min-height: 96px; padding: 19px 20px; border: 1px dashed #c8c8c4; border-radius: 10px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 17px; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.drop:hover, .drop.drag { border-color: #777; background: #f1f1ef; }
.drop.recording { border-style: solid; border-color: #999; }
.drop strong, .drop span { display: block; }
.drop strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.drop .reference-copy > span { color: #858585; font-size: 11px; margin-top: 4px; }
.reference-wave { height: 38px; display: flex; align-items: center; gap: 3px; color: #303030; }
.reference-wave i { width: 3px; height: 13px; border-radius: 3px; background: currentColor; }
.reference-wave i:nth-child(2), .reference-wave i:nth-child(6) { height: 25px; }
.reference-wave i:nth-child(3), .reference-wave i:nth-child(5) { height: 35px; }
.reference-wave i:nth-child(4) { height: 20px; }
.reference-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.reference-actions button { height: 34px; border: 1px solid #c9c9c5; border-radius: 8px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; color: #252525; background: transparent; font-size: 11px; font-weight: 650; cursor: pointer; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.reference-actions button:hover:not(:disabled) { color: #fff; background: #171717; border-color: #171717; transform: translateY(-1px); }
.reference-actions button:disabled { opacity: .35; cursor: default; }
.reference-actions svg { width: 14px; height: 14px; fill: currentColor; }
#record.recording { color: #fff; background: #171717; border-color: #171717; }
#record.recording svg { animation: record-pulse .8s ease-in-out infinite alternate; }
@keyframes record-pulse { to { opacity: .35; transform: scale(.85); } }

.card { margin-top: 14px; border: 1px solid #d8d8d4; border-radius: 14px; background: #fff; box-shadow: 0 8px 26px #00000008; }
.compose { padding: 22px; }
.compose > label { color: #727272; font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; }
textarea { width: 100%; resize: vertical; border: 0; outline: 0; background: transparent; color: #171717; font: 500 24px/1.35 inherit; letter-spacing: -.03em; padding: 9px 0 13px; }
.toolbar { border-top: 1px solid #dededb; padding-top: 15px; display: flex; justify-content: space-between; align-items: center; }
.segmented { height: 36px; padding: 3px; display: flex; gap: 2px; border-radius: 9px; background: #ededeb; }
.segmented button { height: 30px; border: 0; padding: 0 10px; border-radius: 7px; background: transparent; color: #888; font: 650 11px inherit; cursor: pointer; transition: color .15s ease, background .15s ease, box-shadow .15s ease; }
.segmented button:hover { color: #171717; }
.segmented button.active { color: #171717; background: #fff; box-shadow: 0 1px 4px #00000012; }
.toolbar-actions { display: flex; align-items: center; gap: 7px; }
.select-toggle { position: relative; height: 36px; display: flex; align-items: center; border-radius: 8px; background: #ededeb; }
.select-toggle::after { content: ""; position: absolute; right: 9px; top: 50%; width: 5px; height: 5px; border-right: 1.5px solid #777; border-bottom: 1.5px solid #777; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select-toggle select { height: 100%; appearance: none; border: 0; outline: 0; border-radius: inherit; padding: 0 23px 0 10px; color: #444; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.select-toggle:hover { background: #e3e3e0; }
.primary { height: 36px; border: 1px solid #171717; border-radius: 8px; color: #fff; background: #171717; padding: 0 12px 0 16px; display: flex; align-items: center; gap: 16px; font: 650 12px inherit; cursor: pointer; transition: color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease; }
.primary:hover:not(:disabled) { color: #171717; background: transparent; transform: translateY(-1px); box-shadow: 0 5px 14px #00000012; }
.primary:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.primary:disabled { opacity: .3; cursor: not-allowed; }
.primary kbd { font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; color: inherit; opacity: .65; }

.settings { padding: 0 20px; }
.settings summary { cursor: pointer; list-style: none; padding: 17px 0; font-size: 12px; font-weight: 650; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary span { float: right; color: #999; font-weight: 400; }
.grid { border-top: 1px solid #e0e0dd; padding: 19px 0 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 24px; }
.grid label { position: relative; color: #747474; font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.grid output { float: right; color: #292929; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.grid input, .grid select { width: 100%; margin-top: 7px; border: 1px solid #d4d4d0; border-radius: 7px; background: transparent; padding: 8px 9px; color: #303030; font: 11px inherit; }
.grid input[type=range] { padding: 0; accent-color: #171717; }

.output { padding: 17px 20px; }
.status-row { display: flex; justify-content: space-between; gap: 14px; color: #696969; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.progress { height: 2px; margin: 14px 0; background: #dededb; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: #171717; transition: width .25s; }
.progress i.busy { width: 36%; animation: scan 1.3s ease-in-out infinite; }
@keyframes scan { 50% { transform: translateX(175%); } }
.audio-player { height: 54px; display: flex; align-items: center; gap: 11px; }
.audio-player button, .audio-player a { border: 0; color: #303030; background: transparent; cursor: pointer; }
.play { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50% !important; background: #e7e7e4 !important; transition: background .15s ease; }
.play:hover { background: #dcdcd8 !important; }
.play svg { grid-area: 1/1; width: 15px; height: 15px; fill: currentColor; }
.play .icon-pause, .play.playing .icon-play { display: none; }
.play.playing .icon-pause { display: block; }
.wave-track { min-width: 0; flex: 1; height: 42px; padding: 0 !important; }
#waveform { display: block; width: 100%; height: 42px; }
.audio-time { flex: 0 0 auto; color: #777; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
#download { width: 25px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; }
#download svg { width: 15px; height: 15px; fill: currentColor; }
audio { display: none; }

@media (max-width: 580px) {
  main { padding-top: 28px; }
  header { margin-bottom: 28px; }
  .drop { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 17px; }
  .reference-wave { display: none; }
  .reference-actions button { padding: 0 9px; }
  .compose { padding: 19px 16px; }
  .toolbar { gap: 8px; }
  .segmented button { padding-inline: 8px; }
  .primary { gap: 0; padding-inline: 13px; }
  .primary kbd { display: none; }
  .settings { padding-inline: 16px; }
  .output { padding-inline: 16px; }
  .grid { grid-template-columns: 1fr; }
  textarea { font-size: 20px; }
  .audio-player { gap: 7px; }
  .audio-time { display: none; }
}
