@font-face {
  font-family: Vazirmatn;
  src: url("Vazirmatn-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  font-family: Vazirmatn, Tahoma, Inter, system-ui, sans-serif;
  font-weight: 700;
  color: #f5f4ff;
  background: #10101a;
  --lilac: #cfbcff;
  --mint: #98e9d8;
  --muted: #bebbd0;
  --line: #ffffff19;
  --radius: 23px;
  --ease: cubic-bezier(.2,.8,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 86% 0, #3430468c 0, transparent 48%),
              radial-gradient(ellipse at 0 46%, #152c3159, transparent 50%), #10101a;
}
main {
  width: min(100%, 550px);
  margin: auto;
  padding: clamp(14px, 3.4vw, 22px);
  display: grid;
  gap: 14px;
}
h1, p { margin: 0; }
button, input, output, label, legend { font: inherit; }
button {
  background: #292835;
  color: inherit;
  border: 1px solid #ffffff17;
  border-radius: 12px;
  min-height: 44px;
  padding: 6px 12px;
  cursor: pointer;
  line-height: 1.45;
  transition: background-color .18s, border-color .18s, transform .16s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
button:active:not(:disabled) { transform: scale(.965); }
@media (hover:hover) { button:hover:not(:disabled) { background-color: #363344; border-color: #d3bfff73; } }
button:focus-visible, input:focus-visible, #stage:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
button:disabled { opacity: .46; cursor: default; }
[hidden], #feedback:empty { display: none !important; }
header, .setting-name, .timeline, .size, .transport, .tools, .pill, .tabs, .tabs button, #submit {
  display: flex;
  align-items: center;
}
header { gap: 11px; min-height: 56px; }
.heading { flex: 1; }
h1 { font-size: clamp(21px, 5.3vw, 29px); line-height: 1.35; }
header p, .trim-hint, #feedback { font-size: 14px; color: var(--muted); line-height: 1.6; }
.brand-mark {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px;
  border: 1px solid #d5c7ff77;
  background: radial-gradient(circle at 22% 12%, #ddccff88, transparent 55%), linear-gradient(145deg,#565373,#302f48);
  box-shadow: inset 0 1px #ffffff40, 0 4px 16px #0003;
}
.brand-mark i, .icon.target { border: 2px dashed currentColor; border-radius: 7px; display: grid; place-items: center; }
.brand-mark i { width: 25px; height: 25px; color: #f1e7ff; transform: rotate(-8deg); }
.brand-mark i::after, .icon.target::after { content: ""; width: 52%; height: 52%; border: 2px solid currentColor; border-radius: 50%; }
.icon { display: inline-block; position: relative; width: 16px; height: 16px; flex: none; }
.icon.cut { border-inline: 2px solid currentColor; }
.icon.cut::after { content: ""; position: absolute; inset: 4px -3px; border-block: 1px solid currentColor; }
.pill { border-radius: 99px; white-space: nowrap; gap: 7px; font-size: 14px; color: #e4d8ff; background: #2b2638; }
.player, .controls {
  border-radius: var(--radius);
  background: linear-gradient(154deg,#292734 0%,#1d1c28 63%,#1c202c);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px #ffffff12, 0 8px 26px #05050c36;
}
.player { overflow: hidden; padding: 6px; }
#stage {
  width: min(100%, 55dvh);
  margin-inline: auto;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: calc(var(--radius) - 5px);
  touch-action: none; user-select: none; background: black;
  isolation: isolate;
}
#clip { position: absolute; max-width: none; max-height: none; pointer-events: none; background: black; }
.ring {
  position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; border-radius: 50%;
  outline: 2px solid #bdeddf;
  box-shadow: 0 0 0 4px #c9acf226, 0 0 0 150vmax #10121cbe;
  pointer-events: none;
}
.cross { position: absolute; top: 50%; left: 50%; width: 13px; height: 13px; transform: translate(-50%,-50%); background: linear-gradient(#fffc,#fffc) center/1px 100% no-repeat, linear-gradient(#fffc,#fffc) center/100% 1px no-repeat; pointer-events: none; }
.show-grid .ring {
  --lines: transparent 33%,#fff7 33%,#fff7 calc(33% + 1px),transparent calc(33% + 1px),transparent 66.6%,#fff7 66.6%,#fff7 calc(66.6% + 1px),transparent calc(66.6% + 1px);
  background-image: linear-gradient(to right,var(--lines)), linear-gradient(to bottom,var(--lines));
}
#status {
  position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 12px;
  background: radial-gradient(ellipse at center,#383246,#1c1b29 70%); padding: 24px; text-align: center;
}
#status.loading::before {
  content: ""; width: 31px; height: 31px; border: 2px solid #ffffff27; border-top-color: var(--mint);
  border-inline-end-color: var(--lilac); border-radius: 50%; animation: spin 1s linear infinite;
}
.playback { display: grid; gap: 5px; padding: 6px 8px 7px; }
.timeline, .size, .transport, .tools { gap: 8px; }
.timeline output, #interval, #factor { direction: ltr; font-variant-numeric: tabular-nums; }
.timeline output { color: #dcd7e7; font-size: 14px; min-width: 32px; text-align: center; }
input[type=range] { --fill: 0%; --start: var(--mint); --stop: #abdecf; appearance: none; min-width: 0; flex: 1; height: 34px; margin: 0; cursor: pointer; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 9px; background: linear-gradient(to right,var(--start),var(--stop) var(--fill),#444254 var(--fill)); }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; margin-top: -5.5px; border: 3px solid var(--stop); border-radius: 50%; background: #f7fff9; box-shadow: 0 0 0 3px #ffffff14; }
input[type=range]::-moz-range-track { height: 5px; border-radius: 9px; background: #454155; }
input[type=range]::-moz-range-progress { height: 5px; background: var(--stop); }
input[type=range]::-moz-range-thumb { background: white; border: 3px solid var(--stop); border-radius: 50%; }
.transport button, .tools button { flex: 1; padding-inline: 4px; font-size: 14px; }
.player-actions { gap: 5px; }
#play { color: #d5f9ef; background: #25413f; }
#play::before { content: "▶"; display: inline-block; font: 700 .7em/1 system-ui; margin-inline-end: 6px; }
#play.playing::before { content: "Ⅱ"; }
.controls { padding: 12px; }
.tabs { padding: 4px; background: #13131d; border: 1px solid #ffffff0f; border-radius: 15px; }
.tabs button { flex: 1; gap: 8px; justify-content: center; color: var(--muted); background: transparent; border-color: transparent; }
.tabs [aria-selected=true] { color: #f4edff; background: #373143; border-color: #d8c6ff32; box-shadow: 0 2px 6px #0004; }
[role=tabpanel] { padding: 12px 2px 0; animation: appear .2s var(--ease); }
.setting-name { justify-content: space-between; font-size: 15px; }
#factor, #interval { border-radius: 7px; padding: 1px 7px; color: var(--lilac); background: #aa85ea16; font-size: 14px; }
.size { margin-block: 7px 10px; }
.size input { --start: #a795df; --stop: #d2bafa; }
.size button { min-width: 42px; padding-inline: 0; font-size: 20px; }
.tools button[aria-pressed=true] { border-color: #b6a1e7; background: #3b324a; color: #e8dbff; }
.trim-hint { margin: 10px 0; }
footer { position: sticky; bottom: 0; z-index: 1; display: grid; gap: 6px; padding-block: 5px max(8px,env(safe-area-inset-bottom)); text-align: center; background: linear-gradient(to bottom,transparent,#10101a 65%); }
#submit {
  position: relative; justify-content: center; gap: 12px; min-height: 53px; width: 100%; border-color: #e8e4ff88; border-radius: 16px;
  color: #211b32; background: linear-gradient(105deg,#a4e5da -8%,#d1c5fb 54%,#b4a1f2);
  box-shadow: inset 0 1px #ffffff70, 0 5px 16px #30234362; font-size: 17px;
}
.confirm { display: grid; place-items: center; width: 23px; height: 23px; border: 1.7px solid currentColor; border-radius: 50%; }
.confirm::after { content: ""; width: 9px; height: 5px; border-inline-start: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); direction: ltr; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes appear { from { opacity: .1; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 359px) { main { padding-inline: 10px; } .brand-mark { width: 34px; height: 36px; } header { gap: 7px; } .pill { padding-inline: 8px; } }
@media (max-height: 650px) { main { gap: 9px; } #stage { width: min(100%,45dvh); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
