:root {
  --ink: #12201e;
  --muted: #526662;
  --soft: rgba(255, 255, 255, 0.76);
  --solid: rgba(255, 255, 255, 0.94);
  --line: rgba(18, 32, 30, 0.12);
  --teal: #087c72;
  --teal-dark: #07554f;
  --mint: #e8f8f3;
  --gold: #b68134;
  --rose: #aa414d;
  --rose-soft: #fff0f2;
  --shadow: 0 26px 80px rgba(13, 38, 35, 0.18);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #eaf6f2;
  font-family: "IBM Plex Sans Arabic", "Dubai", "Segoe UI", Tahoma, Arial, sans-serif;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 30%, rgba(255, 243, 190, 0.68), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(166, 229, 219, 0.62), transparent 34%),
    linear-gradient(120deg, #f7f2df 0%, #f7fbf8 48%, #d7f0ec 100%);
}

.ambient-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(241, 250, 247, 0.36), rgba(248, 252, 250, 0.9) 50%, rgba(248, 252, 250, 0.64)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(226, 244, 239, 0.84));
}

.noor-stream {
  position: absolute;
  inset: -24% auto auto 16%;
  width: min(46vw, 36rem);
  height: 130vh;
  background: linear-gradient(115deg, transparent 14%, rgba(255, 255, 255, 0.44), rgba(182, 129, 52, 0.16), transparent 74%);
  transform: rotate(9deg);
  animation: noorSweep 14s ease-in-out infinite;
}

.ripple-field {
  position: absolute;
  left: 7vw;
  bottom: 8vh;
  width: min(42vw, 34rem);
  aspect-ratio: 1;
}

.ripple-field span {
  position: absolute;
  inset: 36%;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  animation: ripple 6s ease-out infinite;
}

.ripple-field span:nth-child(2) {
  animation-delay: 1.4s;
}

.ripple-field span:nth-child(3) {
  animation-delay: 2.8s;
}

.floating-dots {
  position: absolute;
  inset: 0;
}

.floating-dots span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 22px rgba(8, 124, 114, 0.22);
  animation: drift 9s ease-in-out infinite;
}

.floating-dots span:nth-child(1) {
  right: 18%;
  top: 22%;
}

.floating-dots span:nth-child(2) {
  right: 42%;
  top: 14%;
  animation-delay: 1.8s;
}

.floating-dots span:nth-child(3) {
  left: 16%;
  top: 42%;
  animation-delay: 3.1s;
}

.floating-dots span:nth-child(4) {
  left: 34%;
  bottom: 18%;
  animation-delay: 4.6s;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 46px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(30px, 7vh, 82px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, var(--teal), var(--gold));
  box-shadow: 0 14px 26px rgba(8, 124, 114, 0.24);
  font-size: 0.92rem;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.04rem;
  font-weight: 900;
}

.brand small {
  color: var(--muted);
  font-size: 0.82rem;
}

.server-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(13, 38, 35, 0.07);
  backdrop-filter: blur(18px);
  font-size: 0.92rem;
  font-weight: 800;
}

.server-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(182, 129, 52, 0.13);
}

.server-pill.is-ready .server-dot {
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(8, 124, 114, 0.13);
}

.server-pill.is-error .server-dot {
  background: var(--rose);
  box-shadow: 0 0 0 5px rgba(170, 65, 77, 0.14);
}

.decision-overlay {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 30;
  width: min(760px, calc(100% - 24px));
  max-height: calc(100dvh - 28px);
  display: grid;
  gap: 12px;
  overflow: auto;
  border: 1px solid rgba(170, 65, 77, 0.24);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 240, 242, 0.96), rgba(255, 255, 255, 0.98) 58%),
    rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 90px rgba(49, 18, 23, 0.22);
  backdrop-filter: blur(24px);
  transform: translateX(-50%);
  animation: decisionDrop 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.decision-overlay[hidden] {
  display: none;
}

.decision-overlay h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  line-height: 1.35;
}

.decision-overlay p {
  margin: 0;
  line-height: 1.85;
}

.decision-overlay .hadith {
  background: rgba(255, 255, 255, 0.78);
}

.decision-overlay .danger-button {
  width: 100%;
}

.decision-light {
  position: absolute;
  inset: auto auto -45px -20px;
  width: 180px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(170, 65, 77, 0.14), transparent 68%);
  pointer-events: none;
}

body.has-decision-overlay .shell {
  padding-top: clamp(260px, 30vh, 340px);
}

.hero {
  max-width: 800px;
  margin-bottom: 28px;
}

.kicker,
.panel-head p,
.notice-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 13ch;
  margin-bottom: 16px;
  font-size: clamp(2.35rem, 7.4vw, 5.4rem);
  line-height: 1.04;
  font-weight: 900;
}

.hero-copy {
  max-width: 68ch;
  margin-bottom: 0;
  color: #314844;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.95;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-badges span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid rgba(8, 124, 114, 0.14);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 28px rgba(13, 38, 35, 0.06);
  font-size: 0.9rem;
  font-weight: 900;
  backdrop-filter: blur(16px);
}

.console {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 18px;
  align-items: start;
  padding: clamp(14px, 2.4vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
  animation: reveal 420ms ease both;
}

.source-panel,
.job-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.source-panel {
  padding: clamp(16px, 2.5vw, 24px);
}

.job-panel {
  display: grid;
  gap: 16px;
  padding: clamp(16px, 2.5vw, 24px);
}

.panel-head {
  margin-bottom: 18px;
}

.job-panel .panel-head {
  margin-bottom: 0;
}

.panel-head h2 {
  margin: 6px 0 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.35;
  font-weight: 900;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 32, 30, 0.05);
}

.mode-tab {
  min-height: 43px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  transition: 180ms ease;
}

.mode-tab.is-selected {
  color: var(--teal-dark);
  background: #fff;
  box-shadow: 0 10px 22px rgba(18, 32, 30, 0.08);
}

.hosting-note {
  margin: -6px 0 18px;
  border: 1px solid rgba(182, 129, 52, 0.22);
  border-radius: 8px;
  padding: 11px 13px;
  color: #6e4b17;
  background: rgba(255, 248, 226, 0.78);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.8;
}

.hosting-note[hidden] {
  display: none;
}

.media-form,
.mode-pane {
  display: grid;
  gap: 12px;
}

.mode-pane {
  display: none;
}

.mode-pane.is-visible {
  display: grid;
}

label {
  color: #263d39;
  font-weight: 900;
}

input[type="url"] {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(18, 32, 30, 0.16);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  direction: ltr;
  text-align: left;
  outline: 0;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input[type="url"]:focus-visible {
  border-color: rgba(8, 124, 114, 0.72);
  box-shadow: 0 0 0 4px rgba(8, 124, 114, 0.13);
  background: #fff;
}

.file-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.file-trigger,
.secondary-button,
.primary-button,
.danger-button,
.download-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.file-trigger,
.secondary-button {
  color: var(--teal-dark);
  background: rgba(8, 124, 114, 0.1);
}

.primary-button,
.download-button {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  box-shadow: 0 14px 30px rgba(8, 124, 114, 0.22);
}

.danger-button {
  color: #fff;
  background: linear-gradient(135deg, var(--rose), #7e2d37);
  box-shadow: 0 14px 30px rgba(170, 65, 77, 0.22);
}

.file-trigger:hover,
.secondary-button:hover,
.primary-button:hover,
.danger-button:hover,
.download-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.danger-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.file-picker span,
.record-line span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

audio {
  width: 100%;
}

.form-error {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(170, 65, 77, 0.24);
  border-radius: 8px;
  color: #7e2d37;
  background: var(--rose-soft);
  line-height: 1.8;
}

.source-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.source-insights div {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(8, 124, 114, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(232, 248, 243, 0.86), rgba(255, 255, 255, 0.72));
}

.source-insights strong {
  font-size: 0.78rem;
  color: var(--gold);
}

.source-insights span {
  color: var(--ink);
  font-weight: 900;
}

.stage-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.stage-step {
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(18, 32, 30, 0.08);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
  font-size: 0.84rem;
  font-weight: 900;
  text-align: center;
  transition: 220ms ease;
}

.stage-step.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
}

.stage-step.is-complete {
  color: var(--teal-dark);
  background: var(--mint);
}

.status-box,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--solid);
}

.status-box {
  display: grid;
  gap: 14px;
  justify-items: center;
  min-height: 286px;
  padding: clamp(18px, 3vw, 28px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.status-box::before {
  content: "";
  position: absolute;
  inset: -30% -12% auto auto;
  width: 16rem;
  height: 16rem;
  border: 1px solid rgba(8, 124, 114, 0.12);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(8, 124, 114, 0.13), transparent 62%);
  animation: softSpin 12s linear infinite;
}

.status-box > * {
  position: relative;
}

.purify-orb {
  position: relative;
  width: 92px;
  aspect-ratio: 1;
}

.purify-orb::before {
  content: "";
  position: absolute;
  inset: 30%;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(8, 124, 114, 0.18));
  box-shadow: 0 12px 38px rgba(8, 124, 114, 0.18);
}

.purify-orb span {
  position: absolute;
  inset: 32%;
  border: 1px solid rgba(8, 124, 114, 0.55);
  border-radius: 999px;
  animation: ripple 2.9s ease-out infinite;
}

.purify-orb span:nth-child(2) {
  animation-delay: 0.58s;
}

.purify-orb span:nth-child(3) {
  animation-delay: 1.16s;
}

.status-box h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.5;
}

.status-box p {
  max-width: 56ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.status-metrics {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.status-metrics div {
  min-height: 66px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 1px solid rgba(18, 32, 30, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.status-metrics span {
  color: var(--teal-dark);
  font-weight: 900;
}

.status-metrics small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.progress-shell {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(8, 124, 114, 0.12);
}

.progress-shell span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  transition: width 260ms ease;
  position: relative;
  overflow: hidden;
}

.progress-shell span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.6s ease-in-out infinite;
}

.process-log {
  display: grid;
  gap: 8px;
}

.log-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(18, 32, 30, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.9rem;
  line-height: 1.6;
  animation: reveal 220ms ease both;
}

.log-row.is-current {
  color: var(--teal-dark);
  border-color: rgba(8, 124, 114, 0.18);
  background: rgba(232, 248, 243, 0.8);
  font-weight: 800;
}

.notice {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 2.8vw, 26px);
  animation: reveal 280ms ease both;
}

.notice[hidden] {
  display: none;
}

.notice h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2.1vw, 1.75rem);
  line-height: 1.45;
}

.notice p {
  margin: 0;
  line-height: 1.95;
}

.download-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-card {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(8, 124, 114, 0.18);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.choice-card:hover {
  transform: translateY(-2px);
  border-color: rgba(8, 124, 114, 0.36);
  box-shadow: 0 16px 34px rgba(8, 124, 114, 0.14);
  background: #fff;
}

.choice-card strong {
  color: var(--teal-dark);
  font-size: 1.05rem;
}

.choice-card span {
  color: var(--muted);
  line-height: 1.65;
}

.choice-card.is-featured {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  box-shadow: 0 16px 34px rgba(8, 124, 114, 0.2);
}

.choice-card.is-featured strong,
.choice-card.is-featured span {
  color: #fff;
}

.choice-card.is-disabled {
  pointer-events: none;
  opacity: 0.52;
}

.clean-notice,
.complete-notice {
  border-color: rgba(8, 124, 114, 0.2);
  background: linear-gradient(180deg, var(--mint), rgba(255, 255, 255, 0.96));
}

.warning-notice,
.error-notice {
  border-color: rgba(170, 65, 77, 0.22);
  background: linear-gradient(180deg, var(--rose-soft), rgba(255, 255, 255, 0.96));
}

.warning-notice .notice-kicker,
.error-notice .notice-kicker {
  color: var(--rose);
}

.hadith {
  padding: 14px 16px;
  border-right: 4px solid var(--rose);
  border-radius: 8px;
  color: #592a31;
  background: rgba(255, 255, 255, 0.7);
  font-weight: 800;
}

@keyframes noorSweep {
  0%,
  100% {
    opacity: 0.28;
    transform: translateX(-7%) rotate(9deg);
  }
  50% {
    opacity: 0.76;
    transform: translateX(8%) rotate(9deg);
  }
}

@keyframes drift {
  0%,
  100% {
    opacity: 0.3;
    transform: translate3d(0, 0, 0) scale(0.9);
  }
  50% {
    opacity: 0.9;
    transform: translate3d(10px, -18px, 0) scale(1.15);
  }
}

@keyframes ripple {
  0% {
    opacity: 0.86;
    transform: scale(0.48);
  }
  100% {
    opacity: 0;
    transform: scale(2.45);
  }
}

@keyframes softSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes decisionDrop {
  from {
    opacity: 0;
    transform: translate(-50%, -18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@media (max-width: 900px) {
  .shell {
    width: min(100% - 22px, 720px);
    padding-top: 16px;
  }

  body.has-decision-overlay .shell {
    padding-top: 330px;
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 34px;
  }

  .server-pill {
    max-width: 52%;
  }

  .console {
    grid-template-columns: 1fr;
  }

  .stage-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .decision-overlay {
    top: 8px;
    width: calc(100% - 14px);
    padding: 14px;
  }

  .decision-overlay .hadith {
    padding: 12px;
    font-size: 0.92rem;
  }

  body.has-decision-overlay .shell {
    padding-top: min(430px, 72vh);
  }

  .shell {
    width: min(100% - 14px, 440px);
  }

  .topbar {
    display: grid;
  }

  .server-pill {
    max-width: none;
    width: 100%;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  h1 {
    max-width: 12ch;
    font-size: clamp(2rem, 12vw, 3.1rem);
  }

  .console,
  .source-panel,
  .job-panel {
    padding: 12px;
  }

  .mode-tabs,
  .stage-track,
  .file-picker,
  .source-insights,
  .download-choice,
  .status-metrics {
    grid-template-columns: 1fr;
  }

  .record-line {
    display: grid;
  }

  .file-trigger,
  .secondary-button,
  .primary-button,
  .danger-button,
  .download-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
