@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url(assets/nunito-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url(assets/nunito-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url(assets/nunito-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  font-family: Nunito, ui-rounded, "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  --ink: #0f101a;
  --muted: #605a72;
  --white: #fff;
  --pink: #ff54bb;
  --purple: #6337ba;
  --pink-dark: #a91a76;
  --line: #e5dff1;
  --lavender: #eee8fb;
  --error: #a2224a;
  --shadow: 0 18px 44px -24px #5e43965c, 0 3px 10px -6px #5e439620;
  --page-width: min(1160px, calc(100% - 64px));
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 95% 13%, #fff0fa 0%, transparent 42%),
    linear-gradient(180deg, #e4f6ff 0, #f0eaff 285px, #f8f6fc 580px, #fbfbfe);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

.wrap, .app { width: var(--page-width); margin-inline: auto; }
.site-header {
  border-bottom: 1px solid #e2ddf470;
  background: #ffffffbf;
}
.site-header .wrap { display: flex; min-height: 66px; align-items: center; }
.site-logo { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; }
.site-logo .logo-icon { width: 37px; height: 43px; object-fit: contain; }
.site-logo span { display: grid; gap: 4px; line-height: 1; }
.site-logo b { font-size: 1.025rem; font-weight: 900; }
.site-logo span img { width: auto; height: 13px; display: block; }

.app { padding-bottom: 26px; }
.hero {
  display: flex;
  min-height: 218px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px 5% 27px 2px;
}
.hero-copy { min-width: 0; }
.hero h1 {
  margin: 0;
  font-size: clamp(2.35rem, 4.6vw, 3.65rem);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -.05em;
}
.hero h1 span { display: block; color: var(--purple); }
.hero p { max-width: 570px; margin: 12px 0 0; color: var(--muted); font-size: 1.075rem; line-height: 1.42; }
.hero-art {
  position: relative;
  display: grid;
  flex: 0 0 220px;
  place-items: center;
  height: 170px;
  isolation: isolate;
}
.hero-art::before {
  position: absolute;
  z-index: -1;
  width: 164px;
  height: 147px;
  border: 1px solid #ffffffb0;
  border-radius: 49% 51% 45% 55%;
  background: radial-gradient(ellipse at 23% 15%, #fff 0, #ffd8ed 42%, #e5ceff 100%);
  transform: rotate(-11deg);
  content: "";
}
.hero-art img {
  display: block;
  width: 153px;
  height: auto;
  transform: rotate(-12deg);
  filter: drop-shadow(0 15px 14px #70469d37);
}
.art-note { position: absolute; font-size: 2rem; font-weight: 900; line-height: 1; }
.art-note-first { top: 19px; left: 8px; color: #c4378d; transform: rotate(-13deg); }
.art-note-second { right: 5px; bottom: 19px; color: var(--purple); transform: rotate(13deg); }

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.editor-toolbar h2 { margin: 0 0 0 2px; font-size: 1.4rem; font-weight: 900; letter-spacing: -.025em; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 30px;
  text-decoration: none;
  font-size: .94rem;
  line-height: 1.24;
  font-weight: 850;
  text-align: center;
  transition: background-color .16s, box-shadow .16s;
}
.primary { color: #27112a; background: var(--pink); box-shadow: inset 0 -2px #ab2b7b36, 0 7px 17px -10px #be318e; }
.primary:hover:not(:disabled) { background: #ff79c9; }
.primary:disabled { background: #e9e0f5; color: #6c607b; box-shadow: none; }
.secondary { color: #442e70; background: #f3eefc; border-color: #ded3ef; }
.secondary:hover:not(:disabled) { background: #ebe0fc; }
.text-button { background: transparent; color: #504667; }
.text-button:hover:not(:disabled) { color: #3e265f; background: #f1ebfa; }
.text-button:disabled { opacity: .55; }
.download-icon { display: block; position: relative; width: 14px; height: 14px; border-bottom: 1.7px solid currentColor; border-radius: 1px; flex: none; }
.download-icon::before { content: ""; position: absolute; width: 1.7px; height: 9px; top: -1px; left: 6px; background: currentColor; }
.download-icon::after { content: ""; position: absolute; width: 6px; height: 6px; top: 3px; left: 3.3px; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(45deg); }

.workspace { display: grid; grid-template-columns: minmax(255px, 290px) minmax(0, 1fr); gap: 15px; align-items: stretch; }
.track-panel, .editor-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.editor-panel { min-height: 380px; padding: 22px; }
.track-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 68px;
  padding: 13px 14px 13px 17px;
  border-bottom: 1px solid var(--line);
}
.track-panel-header h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1rem; font-weight: 900; }
.track-panel-header h2 span {
  min-width: 24px;
  border-radius: 20px;
  padding: 2px 6px;
  text-align: center;
  background: var(--lavender);
  color: #58368b;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.add-button { min-height: 36px; padding: 6px 10px; }
.add-button span { font-size: 1.2rem; line-height: 1; }
.list-empty { margin: 16px 17px; color: var(--muted); font-size: .95rem; }
.track-list { list-style: none; margin: 0; padding: 8px; max-height: 410px; overflow-y: auto; }
.track-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding-right: 4px;
  border: 1px solid transparent;
  border-radius: 13px;
}
.track-row:hover { background: #f6f2fc; }
.track-row.selected { background: #f0e9ff; border-color: #dfccff; }
.track-item {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 8px 6px 8px 8px;
  border-radius: 13px;
  min-height: 48px;
}
.track-item:focus-visible { outline-offset: -3px; }
.track-icon {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  background: #f1ebfa;
  color: #613e96;
  border-radius: 9px;
  font-weight: 900;
}
.track-item[aria-current="true"] .track-icon, .track-item.edited .track-icon { background: #ffd8ef; color: #8e225e; }
.track-item.failed .track-icon { background: #ffedf2; color: var(--error); }
.track-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-size: .94rem; font-weight: 800; }
.track-time { color: var(--muted); font-size: .83rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.track-download { gap: 4px; min-height: 36px; padding: 5px 8px; border-radius: 10px; background: transparent; color: #563887; font-size: .81rem; }
.track-download:hover:not(:disabled) { background: #e8dbfa; }
.track-download:disabled { opacity: .45; }
.track-download .download-icon { transform: scale(.86); }

.empty-panel { display: flex; }
.drop-zone {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1.5px dashed #bea6e9;
  border-radius: 18px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 22%, #faeefe 0%, #f9f5ff 52%, #fdfbff 100%);
}
.empty-panel h2 { margin: 12px 0 0; font-size: 1.55rem; font-weight: 900; line-height: 1.2; letter-spacing: -.02em; }
.empty-panel p { margin: 9px 0 18px; color: var(--muted); }
.empty-wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 60px; }
.empty-wave span { width: 4px; border-radius: 3px; background: #9570e2; }
.empty-wave span:nth-child(3n) { background: #f065b9; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.app.dragging .editor-panel:not(.empty-panel) { outline: 2px dashed var(--purple); outline-offset: -6px; }
.app.dragging .drop-zone { border-color: var(--purple); background: #f0e4ff; }

.song-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.song-heading { min-width: 0; }
.song-heading h2 { margin: 0; font-size: clamp(1.25rem, 2.7vw, 1.55rem); font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.song-heading p { color: var(--muted); font-size: .93rem; margin: 5px 0 0; overflow-wrap: anywhere; }
.song-message { display: grid; place-items: center; min-height: 209px; padding: 20px; text-align: center; color: var(--muted); border-radius: 14px; background: #f7f4fd; }
.song-message.error, .field-error { color: var(--error); }

.timeline { padding: 0 14px 12px; border-radius: 15px; border: 1px solid #e2d8f5; background: #f8f4fe; }
.time-scale { height: 33px; display: flex; justify-content: space-between; align-items: center; color: #615378; font-size: .83rem; font-variant-numeric: tabular-nums; user-select: none; }
.wave {
  --wave-line: #e5daf1;
  --wave-inactive: #a598bc;
  --wave-start: #ac277d;
  --wave-end: #6f40cc;
  position: relative;
  height: 131px;
  border-radius: 6px;
  isolation: isolate;
  cursor: crosshair;
  touch-action: pan-y;
  background: repeating-linear-gradient(to right, #e7def5 0 1px, transparent 1px var(--tick-step, 20%));
}
.wave canvas { display: block; width: 100%; height: 100%; border-radius: inherit; }
.selection { position: absolute; inset-block: 0; pointer-events: none; border-block: 1px solid #c856a96e; background: #ed67b824; }
.handle { position: absolute; z-index: 2; top: 0; bottom: 0; width: 26px; min-height: 0; padding: 0; transform: translateX(-50%); border: 0; background: transparent; cursor: ew-resize; touch-action: none; --handle-color: var(--pink-dark); }
.handle#end-handle { --handle-color: var(--purple); }
.handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 12px; width: 2px; background: var(--handle-color); }
.handle i { position: absolute; left: 5px; width: 16px; height: 26px; top: calc(50% - 13px); border-radius: 6px; background: var(--handle-color); box-shadow: 0 3px 7px #41276935; }
.handle i::before, .handle i::after { content: ""; position: absolute; top: 7px; width: 1px; height: 12px; border-radius: 2px; background: #fff; }
.handle i::before { left: 5px; }
.handle i::after { right: 5px; }
.handle:focus-visible { z-index: 3; outline-offset: 0; }
.playhead { position: absolute; inset-block: 0; z-index: 1; width: 2px; background: #2c2446; opacity: .76; pointer-events: none; }

.trim-values { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 11px; margin-top: 14px; }
.trim-values label, .clip-duration { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; font-size: .875rem; color: var(--muted); }
.trim-values input, .clip-duration strong { width: 100%; padding: 8px 11px; min-height: 41px; border: 1px solid #ded5eb; border-radius: 10px; color: var(--ink); line-height: 1.4; font-size: 1rem; font-variant-numeric: tabular-nums; }
.trim-values input { background: #fdfbff; }
.clip-duration strong { border-color: transparent; background: #f0e9ff; color: #542b95; font-weight: 900; }
.field-error { font-size: .875rem; margin: 8px 0 0; }
.play-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 15px; }
.cursor-time { min-width: 6ch; margin-inline: 4px; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.reset { margin-left: auto; }
.play-icon { width: 0; height: 0; border-block: 5px solid transparent; border-left: 8px solid currentColor; }
.play-icon.pause { width: 8px; height: 11px; border: 0; border-inline: 2px solid currentColor; }
.privacy-note { display: flex; align-items: center; gap: 9px; margin: 15px 2px 0; color: var(--muted); font-size: .9rem; }
.privacy-icon { position: relative; margin-top: 4px; width: 12px; height: 9px; border: 1.5px solid currentColor; border-radius: 3px; }
.privacy-icon::before { content: ""; position: absolute; top: -6px; left: 1.4px; width: 6px; height: 5px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; box-sizing: border-box; }
.song-guide {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding: 15px 24px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: #f6f0fe;
}
.song-guide img { display: block; width: auto; height: 100px; object-fit: contain; }
.song-guide p { max-width: 845px; margin: 0; color: #504667; line-height: 1.55; }

.export-panel, .notice { margin: 0 0 13px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); box-shadow: var(--shadow); }
.export-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.export-row p, .notice { line-height: 1.4; overflow-wrap: anywhere; min-width: 0; }
.export-row p { margin: 0; }
.export-panel progress { width: 100%; height: 9px; margin-top: 9px; accent-color: var(--purple); }
.export-errors { margin: 9px 0 0; padding-left: 22px; color: var(--error); font-size: .9rem; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.embedded body { background: transparent; }
.embedded .standalone-only { display: none; }
.embedded .app { width: min(1160px, 100%); margin-inline: auto; padding: 12px; }

@media (max-width: 800px) {
  :root { --page-width: calc(100% - 36px); }
  .workspace { grid-template-columns: 230px minmax(0, 1fr); gap: 11px; }
  .hero { gap: 12px; padding-right: 2%; }
  .hero-art { flex-basis: 174px; }
  .editor-panel { padding: 16px; }
  .reset { margin-left: 0; }
}

@media (max-width: 670px) {
  .site-header .wrap { min-height: 56px; }
  .site-logo .logo-icon { width: 32px; height: 37px; }
  .hero { min-height: auto; padding: 22px 0 23px; }
  .hero h1 { font-size: clamp(1.73rem, 6.8vw, 2.5rem); letter-spacing: -.04em; }
  .hero p { margin-top: 10px; font-size: .99rem; }
  .hero-art { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .track-panel, .editor-panel { border-radius: 18px; }
  .track-panel-header { min-height: 54px; padding: 8px 11px 8px 13px; }
  .list-empty { margin: 10px 13px 6px; }
  .track-list { max-height: 154px; }
  .track-download { min-height: 44px; }
  .editor-panel { min-height: auto; padding: 12px; }
  .drop-zone { min-height: 267px; padding: 20px 12px; }
  .timeline { padding-inline: 13px; }
  .wave { height: 112px; }
  .song-guide { gap: 12px; padding: 14px; border-radius: 18px; }
  .song-guide img { height: 73px; }
}

@media (max-width: 430px) {
  :root { --page-width: calc(100% - 26px); }
  .editor-toolbar h2 { font-size: 1.18rem; }
  .editor-toolbar .button { min-height: 39px; font-size: .88rem; padding-inline: 10px; }
  .trim-values { gap: 6px; }
  .trim-values label, .clip-duration { font-size: .82rem; }
  .trim-values input, .clip-duration strong { padding-inline: 7px; }
  .play-actions .button { min-height: 44px; padding-inline: 10px; font-size: .88rem; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
