:root {
  --p: #2848e8;
  --p-d: #1e39c4;
  --tint: #eef1fe;
  --bg: #f5f7fb;
  --ink: #151b38;
  --mute: #667091;
  --line: #e3e7f2;
  --ok: #12805c;
  --bad: #c8283a;
  --r: 14px;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font:
    15px/1.8 Vazirmatn,
    Tahoma,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  min-height: 100vh;
}
h1,
h2,
h3,
p {
  margin: 0;
}
:focus-visible {
  outline: 3px solid rgba(40, 72, 232, 0.35);
  outline-offset: 2px;
}
/* sidebar */
aside {
  width: 250px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 22px;
}
.logo b {
  font-size: 1rem;
}
.mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--p);
  color: #fff;
  display: grid;
  place-items: center;
}
.mark.inv {
  background: #fff;
  color: var(--p);
}
nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--mute);
  text-decoration: none;
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
}
nav a:hover {
  background: var(--bg);
  color: var(--ink);
}
nav a.on {
  background: var(--tint);
  color: var(--p);
  font-weight: 700;
}
nav a.out {
  margin-top: auto;
}
/* main */
main {
  flex: 1;
  min-width: 0;
  padding: 34px 40px 60px;
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 26px;
}
header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.4;
}
header p {
  color: var(--mute);
  margin-top: 4px;
  max-width: 60ch;
}
.chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.85rem;
  color: var(--mute);
  white-space: nowrap;
}
.muted,
small {
  color: var(--mute);
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow:
    0 1px 2px rgba(21, 27, 56, 0.04),
    0 10px 28px -16px rgba(21, 27, 56, 0.12);
}
.card.flush {
  padding: 0;
  overflow: hidden;
}
.pad {
  padding: 22px;
}
/* stats */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 16px;
  margin-bottom: 20px;
}
.stats .card {
  margin: 0;
}
.stat {
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat b {
  display: block;
  font-size: 1.9rem;
  line-height: 1.2;
  font-weight: 700;
}
.stat small {
  font-size: 0.85rem;
}
.ico {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--tint);
  color: var(--p);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.rh {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.rc {
  font-size: 0.85rem;
  color: var(--mute);
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin: 18px 22px 0;
  padding: 4px;
  background: #eef1f8;
  border-radius: 12px;
  width: max-content;
  max-width: calc(100% - 44px);
}
.tab {
  border: 0;
  background: none;
  padding: 8px 18px;
  border-radius: 9px;
  font: inherit;
  font-weight: 500;
  color: var(--mute);
  cursor: pointer;
}
.tab.on {
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(21, 27, 56, 0.12);
}
#p-json {
  padding-top: 18px;
}
/* sections */
.sec {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 26px 22px;
  border-top: 1px solid var(--line);
}
.tabs + form .sec:first-child,
.tabs + #p-json + form .sec:first-child {
  margin-top: 18px;
}
.sec-h h3 {
  font-size: 1rem;
  font-weight: 700;
}
.sec-h p {
  font-size: 0.85rem;
  color: var(--mute);
  margin-top: 4px;
  line-height: 1.7;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
label,
.lbl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 500;
}
input:not([type='checkbox']):not([type='file']),
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  color: var(--ink);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input::placeholder,
textarea::placeholder {
  color: #a6adc6;
}
input:focus,
textarea:focus {
  outline: 0;
  border-color: var(--p);
  box-shadow: 0 0 0 4px rgba(40, 72, 232, 0.12);
}
textarea {
  resize: vertical;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.7;
}
.file {
  position: relative;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border: 1.5px dashed #c6ceea;
  border-radius: 10px;
  padding: 9px 14px;
  background: #fafbff;
  color: var(--p);
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  font-weight: 500;
}
.file:hover,
.file:focus-within {
  border-color: var(--p);
  background: var(--tint);
}
.file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}
.fn {
  font-size: 0.85rem;
  color: var(--mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: plaintext;
}
.fn:empty::before {
  content: 'فایلی انتخاب نشده';
}
.cover {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#prev {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.chk {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-weight: 400;
}
.chk input {
  width: 18px;
  height: 18px;
  accent-color: var(--p);
}
/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--p);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    transform 0.1s;
  box-shadow: 0 6px 16px -8px rgba(40, 72, 232, 0.7);
}
.btn:hover {
  background: var(--p-d);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}
.btn.ghost {
  background: var(--tint);
  color: var(--p);
  box-shadow: none;
}
.btn.ghost:hover {
  background: #e0e6fd;
}
.big {
  padding: 13px 34px;
  font-size: 1rem;
}
.actions,
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.actions {
  padding: 20px 22px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}
.row {
  margin-top: 16px;
}
/* progress */
.ph {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.barw {
  height: 8px;
  background: #e8ecf8;
  border-radius: 99px;
  overflow: hidden;
}
#bar {
  height: 100%;
  width: 0;
  background: var(--p);
  border-radius: 99px;
  transition: width 0.35s ease;
}
#log {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 6px;
}
#log li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}
#log li::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c6ceea;
  flex-shrink: 0;
}
#log li.run::before {
  background: none;
  border: 2px solid var(--p);
  border-top-color: transparent;
  width: 14px;
  height: 14px;
  animation: sp 0.8s linear infinite;
}
#log li.ok::before {
  background: var(--ok);
}
#log li.err::before {
  background: var(--bad);
}
@keyframes sp {
  to {
    transform: rotate(360deg);
  }
}
.ok {
  color: var(--ok);
}
.err {
  color: var(--bad);
}
#jmsg {
  font-size: 0.88rem;
}
.alert {
  background: #fdecee;
  color: var(--bad);
  border: 1px solid #f6cbd0;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 0.9rem;
}
.alert.ok {
  background: #e6f5ee;
  color: var(--ok);
  border-color: #bfe5d3;
}
/* result */
#res h3 {
  margin-bottom: 14px;
}
.resg {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.resg img {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.resg > div {
  flex: 1;
  min-width: 260px;
}
.resg > div > p:first-child {
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.resg > div > p {
  margin: 8px 0;
  line-height: 1.7;
}
.resg small {
  word-break: break-all;
}
.resg .btn {
  margin: 2px 0 6px;
}
.jout {
  margin: 16px 0;
}
.jout pre {
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px 0 10px;
  max-height: 260px;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.6;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-all;
}

/* file browser (read-only) */
.fm-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fafbff;
  font-size: 0.88rem;
}
.fm-bar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--p);
  text-decoration: none;
  font-weight: 600;
}
.fm-bar a:hover {
  text-decoration: underline;
}
.fm-bar .sep {
  color: var(--mute);
}
.fm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.fm-row:last-child {
  border-bottom: 0;
}
a.fm-row:hover {
  background: var(--tint);
}
.fm-ic {
  color: var(--mute);
  display: grid;
  flex-shrink: 0;
}
.fm-row.dir .fm-ic {
  color: var(--p);
}
.fm-n {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.fm-m {
  color: var(--mute);
  font-size: 0.8rem;
  white-space: nowrap;
}
.fm-empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--mute);
}
.btn.sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: 8px;
}
@media (max-width: 700px) {
  .fm-row {
    flex-wrap: wrap;
  }
  .fm-n {
    flex-basis: calc(100% - 40px);
  }
}

/* responsive */
@media (max-width: 900px) {
  body {
    flex-direction: column;
  }
  aside {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
  }
  .logo {
    padding: 0;
  }
  .logo b {
    display: none;
  }
  nav {
    flex-direction: row;
    flex: 0;
  }
  nav a {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  nav a.out {
    margin: 0;
  }
  main {
    padding: 20px 14px 40px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stats .recent {
    grid-column: 1/-1;
  }
  .sec {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px 16px;
  }
}
@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
  header h1 {
    font-size: 1.35rem;
  }
  .chip {
    display: none;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .tabs {
    margin: 14px 16px 0;
  }
  .pad {
    padding: 16px;
  }
  .actions {
    padding: 16px;
  }
  .big {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
/* modal */
body.lock {
  overflow: hidden;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 27, 56, 0.5);
  backdrop-filter: blur(5px);
  animation: mf 0.2s ease;
}
.mbox {
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  padding: 30px 28px 24px;
  text-align: center;
  box-shadow: 0 30px 80px -20px rgba(21, 27, 56, 0.5);
  animation: mp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.mbox.sm {
  width: min(400px, 100%);
}
.mbox h3 {
  font-size: 1.2rem;
  margin: 4px 0 6px;
}
.mbox > .muted {
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.mbox .barw {
  margin-top: 18px;
  height: 10px;
}
.mbox .ph {
  margin: 8px 0 0;
  font-size: 0.85rem;
}
.mbox #log {
  text-align: start;
  max-height: 150px;
  overflow: auto;
}
.mact {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
}
.btn.danger {
  background: var(--bad);
  box-shadow: 0 6px 16px -8px rgba(200, 40, 58, 0.7);
}
.btn.danger:hover {
  background: #a91f2e;
}
.mico {
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.eq {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 54px;
}
.eq i {
  width: 7px;
  height: 100%;
  border-radius: 4px;
  background: var(--p);
  transform: scaleY(0.25);
  animation: eq 1s ease-in-out infinite alternate;
}
.eq i:nth-child(2) {
  animation-delay: -0.7s;
}
.eq i:nth-child(3) {
  animation-delay: -0.35s;
}
.eq i:nth-child(4) {
  animation-delay: -0.85s;
}
.eq i:nth-child(5) {
  animation-delay: -0.15s;
}
.okc,
.erc {
  display: none;
  width: 64px;
  height: 64px;
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.okc {
  stroke: var(--ok);
}
.erc {
  stroke: var(--bad);
}
.okc circle,
.erc circle {
  stroke-dasharray: 145;
  stroke-dashoffset: 145;
  animation: dr 0.6s ease forwards;
}
.okc path,
.erc path {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: dr 0.4s 0.45s ease forwards;
}
[data-st='done'] .eq,
[data-st='err'] .eq {
  display: none;
}
[data-st='done'] .okc,
[data-st='err'] .erc {
  display: block;
}
[data-st='done'] #bar {
  background: var(--ok);
}
[data-st='err'] #bar {
  background: var(--bad);
}
#bar {
  position: relative;
  overflow: hidden;
}
[data-st='run'] #bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: sh 1.3s linear infinite;
}
@keyframes eq {
  to {
    transform: scaleY(1);
  }
}
@keyframes dr {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes sh {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}
@keyframes mf {
  from {
    opacity: 0;
  }
}
@keyframes mp {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.94);
  }
}

/* login */
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px #fff inset;
  -webkit-text-fill-color: var(--ink);
}
body.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.bg-wave {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  width: 100%;
  height: 42vh;
  fill: var(--p);
  opacity: 0.08;
  pointer-events: none;
}
.lbox {
  position: relative;
  width: min(400px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 30px 30px;
  box-shadow:
    0 1px 2px rgba(21, 27, 56, 0.04),
    0 24px 60px -24px rgba(21, 27, 56, 0.25);
}
.lbox form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lhead {
  text-align: center;
  margin-bottom: 24px;
}
.lhead .mark {
  margin: 0 auto 14px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
}
.lhead h1 {
  font-size: 1.35rem;
  line-height: 1.5;
}
.lhead p {
  color: var(--mute);
  font-size: 0.85rem;
  margin-top: 2px;
  direction: ltr;
}
.ifield {
  position: relative;
  display: flex;
  align-items: center;
}
.ifield > svg {
  position: absolute;
  inset-inline-start: 14px;
  color: var(--mute);
  pointer-events: none;
}
.ifield input:not([type='checkbox']):not([type='file']) {
  padding-block: 10px;
  padding-inline: 44px;
  height: 46px;
}
.eye {
  position: absolute;
  inset-inline-end: 6px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--mute);
  border-radius: 8px;
  cursor: pointer;
}
.eye:hover {
  background: var(--bg);
  color: var(--p);
}
.lbox .btn.big {
  width: 100%;
  margin-top: 4px;
}
.shake {
  animation: shk 0.4s;
}
@keyframes shk {
  20%,
  60% {
    transform: translateX(-7px);
  }
  40%,
  80% {
    transform: translateX(7px);
  }
}

/* ================= Upload queue ================= */
label.chk {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
label.chk input {
  width: 17px;
  height: 17px;
  accent-color: var(--p);
}
label.fpick {
  flex-direction: row;
  cursor: pointer;
}
.hint {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--mute);
}
textarea.drag {
  border-color: var(--p);
  background: var(--tint);
}
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  color: var(--ink);
}
select:disabled,
.qopts input:disabled {
  opacity: 0.6;
}
.qrest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border-color: #cfd8fb;
  background: var(--tint);
}
.qrest .row {
  margin: 0;
}
.qh {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 22px 4px;
}
.qctl {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.qopts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  padding: 14px 22px;
}
.qprog {
  padding: 4px 22px 14px;
}
.qbarw {
  height: 10px;
  background: #e8ecf8;
  border-radius: 99px;
  overflow: hidden;
}
.qbarw i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--p);
  border-radius: 99px;
  transition: width 0.35s ease;
}
.qstat {
  display: flex;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--mute);
}
.qstat b {
  color: var(--ink);
}
.qtools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 22px;
  border-top: 1px solid var(--line);
  background: #fafbfe;
}
.qcount {
  margin-inline-start: auto;
  font-size: 0.82rem;
}
.qlist {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 560px;
  overflow: auto;
  border-top: 1px solid var(--line);
}
.qi {
  display: grid;
  grid-template-columns: auto 28px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}
.qi[data-st='run'] {
  background: var(--tint);
}
.qi[data-sel='0'] .qm {
  opacity: 0.5;
}
.ql {
  display: grid;
  gap: 8px;
}
.qlr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfe;
  font-size: 0.78rem;
}
.qli {
  flex: none;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--p);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
.qlt {
  flex: none;
  font-size: 0.7rem;
  padding: 0 8px;
  border-radius: 99px;
  background: #eef1f8;
  color: var(--mute);
}
.qm .qln {
  flex: 1 1 100%;
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: right;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
.qlu {
  flex: 1 1 100%;
  min-width: 0;
  color: var(--p);
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
  text-align: left;
  text-decoration: underline;
}
.qn {
  color: var(--mute);
  font-size: 0.8rem;
  text-align: center;
}
.qm {
  min-width: 0;
}
.qm b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qm small {
  display: block;
}
.qsteps {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.qsteps span {
  font-size: 0.72rem;
  padding: 0 8px;
  border-radius: 99px;
  background: #eef1f8;
  color: var(--mute);
}
.qsteps span.ok {
  background: #e6f5ee;
  color: var(--ok);
}
.qsteps span.err {
  background: #fdecee;
  color: var(--bad);
}
.qsteps span.run {
  background: var(--tint);
  color: var(--p);
}
.qib {
  height: 4px;
  background: #e8ecf8;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}
.qib i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--p);
  transition: width 0.3s;
}
.qi[data-st='ok'] .qib i {
  background: var(--ok);
}
.qi[data-st='err'] .qib i {
  background: var(--bad);
}
.qe {
  color: var(--bad);
  word-break: break-word;
}
.qe.warn {
  color: #a86a00;
}
.qbd {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 99px;
  white-space: nowrap;
  background: #eef1f8;
  color: var(--mute);
}
.qi[data-st='run'] .qbd {
  background: var(--p);
  color: #fff;
}
.qi[data-st='ok'] .qbd {
  background: #e6f5ee;
  color: var(--ok);
}
.qi[data-st='err'] .qbd {
  background: #fdecee;
  color: var(--bad);
}
.qi[data-st='stop'] .qbd,
.qi[data-st='skip'] .qbd {
  background: #fff4dc;
  color: #a86a00;
}
.qa {
  display: flex;
  gap: 4px;
}
.qa button {
  border: 0;
  background: none;
  color: var(--mute);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
}
.qa button:hover:not(:disabled) {
  background: var(--tint);
  color: var(--p);
}
.qa button:disabled {
  opacity: 0.35;
  cursor: default;
}
.qd {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 0 4px;
}
.qd input {
  direction: auto;
}
.qlogw {
  border-top: 1px solid var(--line);
  padding: 10px 22px;
}
.qlogw summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
}
#qlog {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: 200px;
  overflow: auto;
  font-size: 0.8rem;
  display: grid;
  gap: 3px;
}
#qlog li.err {
  color: var(--bad);
}
#qlog li.ok {
  color: var(--ok);
}
#qlog time {
  color: var(--mute);
  margin-inline-end: 8px;
  font-variant-numeric: tabular-nums;
}
.qout {
  border-top: 1px solid var(--line);
  padding: 20px 22px 22px;
}
.qout h3 {
  margin-bottom: 12px;
}
.qpills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.qpills span {
  padding: 3px 14px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
  background: #eef1f8;
}
.qpills .ok {
  background: #e6f5ee;
}
.qpills .err {
  background: #fdecee;
}
.qpills .wr {
  background: #fff4dc;
  color: #a86a00;
}
.qout .row {
  margin: 12px 0 0;
}
@media (max-width: 900px) {
  .qopts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .qh,
  .qopts,
  .qprog,
  .qtools,
  .qout,
  .qlogw {
    padding-inline: 16px;
  }
  .qopts,
  .qd {
    grid-template-columns: 1fr;
  }
  .qi {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px 16px;
  }
  .qn {
    display: none !important;
  }
  .qa {
    grid-column: 2/-1;
  }
}

/* upload history */
.hl {
  margin-bottom: 14px;
  overflow: hidden;
}
.hl > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}
.hl > summary::-webkit-details-marker {
  display: none;
}
.hl[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #fafbff;
}
.hl-t {
  font-weight: 700;
}
.hl-m {
  color: var(--mute);
  font-size: 0.82rem;
}
.hl-sp {
  flex: 1;
}
.hl-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hl-pills span {
  padding: 1px 10px;
  border-radius: 99px;
  background: var(--tint);
  font-size: 0.78rem;
}
.hl-pills .ok {
  color: var(--ok);
}
.hl-pills .err {
  color: var(--bad);
}
.hl-act {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.hl-it {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}
.hl-it:last-child {
  border-bottom: 0;
}
.hl-n {
  flex: 1;
  min-width: 200px;
  text-align: left;
}
.hl-n small {
  display: block;
  color: var(--mute);
}
.hl-st {
  font-size: 0.8rem;
  color: var(--mute);
}
.hl-st.ok {
  color: var(--ok);
}
.hl-st.err {
  color: var(--bad);
}
.hl-pre {
  margin: 0;
  padding: 14px 18px;
  max-height: 420px;
  overflow: auto;
  background: #0f1530;
  color: #dfe5ff;
  font: 12px/1.6 ui-monospace, Menlo, Consolas, monospace;
  white-space: pre;
  text-align: left;
}

/* default cover uploader (settings) */
.cvup {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fafbfe;
}
.cvup-t {
  font-weight: 700;
  margin-bottom: 12px;
}
.cvup-t small {
  font-weight: 400;
  color: var(--mute);
}
.cvup-b {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.cvup-prev {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: repeating-conic-gradient(#eef1f8 0% 25%, #f8f9fd 0% 50%) 50% / 16px 16px;
  box-shadow: 0 6px 18px rgba(40, 72, 232, 0.1);
  display: grid;
  place-items: center;
  transition: filter 0.2s, opacity 0.2s;
}
.cvup-prev img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cvup-prev img[hidden],
.cvup-ph[hidden] {
  display: none;
}
.cvup-ph {
  width: 56px;
  height: 56px;
  fill: none;
  stroke: #b6bfd9;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.cvup-prev.gone img {
  filter: grayscale(1) blur(1px);
  opacity: 0.45;
}
.cvup-badge {
  position: absolute;
  inset-inline: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--p);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}
.cvup-prev.gone .cvup-badge {
  background: var(--bad);
}
.cvup-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px;
  text-align: center;
  border: 2px dashed #c3cbe6;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.cvup-drop:hover,
.cvup-drop.on {
  border-color: var(--p);
  background: var(--tint);
}
.cvup-drop.on {
  transform: scale(1.01);
}
.cvup-drop svg {
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 50%;
  background: var(--tint);
  fill: none;
  stroke: var(--p);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cvup-drop small {
  color: var(--mute);
  font-size: 0.78rem;
}
.cvup-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.cvup-drop:focus-within {
  outline: 3px solid rgba(40, 72, 232, 0.25);
}
.cvup-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #e6f5ee;
  color: var(--ok);
  font-size: 0.82rem;
}
.cvup-info[hidden],
.cvup-err[hidden],
.cvup-badge[hidden],
.cvup-rm[hidden] {
  display: none;
}
.cvup-fn {
  flex: 1 1 0;
  min-width: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cvup-x,
.cvup-rm {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
}
.cvup-x {
  background: #fff;
  color: var(--mute);
}
.cvup-rm {
  margin-top: 12px;
  background: #fdecee;
  color: var(--bad);
}
.cvup-err {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fdecee;
  color: var(--bad);
  font-size: 0.82rem;
}
@media (max-width: 640px) {
  .cvup-b {
    grid-template-columns: 1fr;
  }
  .cvup-prev {
    margin-inline: auto;
  }
}

/* one queue row = one song: heading + one card per link */
.qlh {
  font-size: 0.9rem;
  font-weight: 800;
  text-align: right;
  padding: 2px 4px;
}
.qlq {
  margin-inline-start: 8px;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--mute);
}
.qlr.ok {
  border-color: #9fd9b4;
  background: #f3fbf6;
}
.qlr.err {
  border-color: #f0b4b4;
  background: #fdf5f5;
}
.qlr.run {
  border-color: var(--p);
}

/* song heading: title + genre badge + file-count badge (kept apart so RTL/LTR text never mixes) */
.qlh {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.qlh .qlt2 {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.qlg,
.qlc {
  flex: none;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  unicode-bidi: isolate;
}
.qlg {
  direction: ltr;
  background: #e8edff;
  color: var(--p);
}
.qlc {
  background: #eef1f8;
  color: var(--mute);
}
