:root {
  --new-shell-border: rgba(157, 46, 197, 0.14);
  --new-surface: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(248, 241, 255, 0.9)
  );
  --new-surface-soft: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.94),
    rgba(250, 245, 255, 0.9)
  );
  --new-copy-muted: #665d77;
}

body {
  position: relative;
  overflow-x: clip;
  background: #fbf9ff;
}

body::before {
  content: "";
  position: fixed;
  inset: -10% -8%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(220, 200, 255, 0.72), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 220, 238, 0.42), transparent 20%),
    radial-gradient(circle at 20% 74%, rgba(220, 200, 255, 0.24), transparent 20%),
    radial-gradient(circle at 82% 68%, rgba(255, 220, 238, 0.18), transparent 18%),
    linear-gradient(180deg, #fcfbff 0%, #f5efff 44%, #fbf9ff 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(157, 46, 197, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 46, 197, 0.03) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.6;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 78%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 78%);
}

header#header {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: 0;
  padding: 22px 20px 28px;
  background: transparent;
}

#header .topbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: 24px;
  border: 1px solid var(--new-shell-border);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 20px 48px rgba(95, 64, 148, 0.12);
  backdrop-filter: blur(18px);
}

#header .left-wrap {
  gap: 28px;
}

#header .brand {
  gap: 14px;
}

#header .brand-logo {
  width: 52px;
  height: 52px;
}

#header .nav {
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(157, 46, 197, 0.08);
  background: rgba(157, 46, 197, 0.05);
}

#header .nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: #635a76;
  font-weight: 600;
}

#header .nav-link:hover {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(157, 46, 197, 0.14);
  box-shadow: 0 10px 22px rgba(157, 46, 197, 0.1);
}

#header .nav-link.active {
  color: var(--brand);
  border-color: rgba(157, 46, 197, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 238, 255, 0.96));
  box-shadow:
    0 10px 24px rgba(157, 46, 197, 0.12),
    inset 0 -2px 0 var(--brand);
}

#header .actions {
  gap: 12px;
}

#header .header-btn,
#header .notif-btn,
#header .avatar,
#header .mobile-menu-btn {
  border-radius: 999px;
}

#header .header-btn {
  padding: 11px 16px;
}

#header .header-btn-ghost,
#header .notif-btn,
#header .mobile-menu-btn {
  border-color: rgba(157, 46, 197, 0.14);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 20px rgba(157, 46, 197, 0.08);
}

#header .header-btn-ghost:hover,
#header .notif-btn:hover,
#header .mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(157, 46, 197, 0.22);
}

#header .notif-btn,
#header .avatar {
  width: 40px;
  height: 40px;
}

#header .avatar {
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  box-shadow: 0 12px 28px rgba(157, 46, 197, 0.24);
}

#header .notif-menu,
#header .menu {
  top: calc(100% + 12px);
  border-radius: 20px;
  border-color: rgba(157, 46, 197, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 48px rgba(73, 48, 120, 0.16);
  backdrop-filter: blur(18px);
}

.page-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 88px;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 18px;
  align-items: stretch;
}

.head-left,
.progress-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--new-shell-border);
  box-shadow:
    0 24px 56px rgba(112, 77, 173, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.head-left {
  padding: 34px 34px 30px;
  border-radius: 30px;
  background: var(--new-surface);
}

.head-left::before,
.progress-wrap::before,
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.head-left::before {
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.74), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(157, 46, 197, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 40%);
}

.head-left > * {
  position: relative;
  z-index: 1;
}

.page-head h1 {
  margin: 0 0 10px;
  font-size: clamp(2.5rem, 5vw, 4.1rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.muted,
.form-note,
.note,
.hint-text {
  color: var(--new-copy-muted);
  line-height: 1.75;
}

.progress-wrap {
  display: flex;
  align-items: center;
  padding: 24px;
  border-radius: 28px;
  background: var(--new-surface-soft);
}

.progress-wrap::before {
  background:
    radial-gradient(circle at 82% 16%, rgba(157, 46, 197, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 44%);
}

.progress-bar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 14px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(157, 46, 197, 0.12);
  box-shadow: inset 0 1px 3px rgba(120, 86, 177, 0.16);
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #d39aff);
  box-shadow: 0 10px 24px rgba(157, 46, 197, 0.24);
  transition: width 0.35s ease;
}

.container {
  padding-top: 22px;
  display: grid;
  gap: 20px;
}

.card {
  position: relative;
  overflow: hidden;
  margin-top: 0;
  padding: 30px 28px;
  border-radius: 30px;
  border: 1px solid rgba(157, 46, 197, 0.14);
  background: var(--new-surface);
  box-shadow:
    0 18px 40px rgba(90, 61, 140, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(157, 46, 197, 0.92), rgba(157, 46, 197, 0));
}

.card::after {
  background:
    radial-gradient(circle at 88% 16%, rgba(157, 46, 197, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 40%);
}

.card > * {
  position: relative;
  z-index: 1;
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 24px;
}

.step-header h2 {
  margin: 0;
  font-size: 1.58rem;
  letter-spacing: -0.03em;
}

.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(157, 46, 197, 0.14);
  background: rgba(157, 46, 197, 0.08);
  color: var(--brand);
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 700;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease;
}

.help-btn:hover {
  background: rgba(157, 46, 197, 0.12);
  border-color: rgba(157, 46, 197, 0.2);
}

.form-group {
  margin-bottom: 20px;
}

.form-label,
.label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text);
}

.form-control,
.dropdown-btn {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(157, 46, 197, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.form-control:focus,
.dropdown.open .dropdown-btn,
.dropdown-btn:hover {
  outline: none;
  border-color: rgba(157, 46, 197, 0.22);
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 0 4px rgba(157, 46, 197, 0.08);
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23665d77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  padding-right: 42px;
  cursor: pointer;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(157, 46, 197, 0.12);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-weight: 600;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.radio-label:has(input:checked) {
  border-color: rgba(157, 46, 197, 0.24);
  background: rgba(157, 46, 197, 0.08);
  box-shadow: 0 12px 24px rgba(157, 46, 197, 0.1);
}

.radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.label-spacing {
  margin-top: 24px;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.task-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  min-height: 164px;
  padding: 22px 20px;
  border-radius: 24px;
  border: 1px solid rgba(157, 46, 197, 0.12);
  background: rgba(255, 255, 255, 0.74);
  text-align: left;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.task-card::after {
  content: "";
  position: absolute;
  top: -24px;
  right: -34px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 46, 197, 0.14), transparent 70%);
  pointer-events: none;
}

.task-card:hover {
  transform: translateY(-3px);
  border-color: rgba(157, 46, 197, 0.18);
  box-shadow: 0 18px 34px rgba(90, 61, 140, 0.14);
}

.task-card[aria-checked="true"] {
  border-color: rgba(157, 46, 197, 0.3);
  background: rgba(157, 46, 197, 0.08);
  box-shadow:
    0 22px 40px rgba(157, 46, 197, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.task-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(157, 46, 197, 0.12);
  color: var(--brand);
}

.task-title {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}

.actions-row .error {
  margin-right: auto;
}

.error {
  color: #b42318;
  font-weight: 600;
}

.new-task-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 16px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    transform 0.12s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.new-task-btn:active {
  transform: translateY(1px);
}

.new-task-btn-solid {
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  color: #fff;
  box-shadow: 0 14px 30px rgba(157, 46, 197, 0.18);
}

.new-task-btn-solid:hover {
  background: linear-gradient(135deg, #8e23b5, #b33fe0);
  box-shadow: 0 18px 34px rgba(157, 46, 197, 0.24);
}

.new-task-btn-ghost {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(157, 46, 197, 0.14);
  color: var(--brand);
}

.new-task-btn-ghost:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(157, 46, 197, 0.2);
}

.dropzone {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  border-radius: 24px;
  border: 1.5px dashed rgba(157, 46, 197, 0.26);
  background: linear-gradient(180deg, rgba(244, 235, 255, 0.94), rgba(255, 255, 255, 0.84));
  color: #4b3a8b;
  outline: none;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.dropzone::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 24%, rgba(157, 46, 197, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 44%);
}

.dropzone:focus,
.dropzone.dragover {
  border-color: rgba(157, 46, 197, 0.38);
  box-shadow: 0 22px 42px rgba(157, 46, 197, 0.14);
  transform: translateY(-1px);
}

.dz-inner {
  position: relative;
  z-index: 1;
  max-width: 360px;
  text-align: center;
}

.dz-title {
  margin-top: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dz-sub {
  font-size: 0.92rem;
}

.file-info {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(157, 46, 197, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

#fileName {
  font-weight: 700;
}

.target-column-group {
  width: 100%;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(157, 46, 197, 0.1);
}

.link-btn {
  border: none;
  background: none;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

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

.field {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(157, 46, 197, 0.12);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.field.disabled {
  opacity: 0.55;
}

.dropdown {
  position: relative;
  display: grid;
  gap: 10px;
}

.dropdown-list {
  min-width: 100%;
  max-height: 260px;
  margin: 0;
  padding: 8px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(157, 46, 197, 0.14);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 48px rgba(73, 48, 120, 0.16);
  backdrop-filter: blur(18px);
  list-style: none;
  display: none;
}

.dropdown.open .dropdown-list {
  display: block;
}

.dropdown-list li {
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.dropdown-list li:hover {
  background: rgba(157, 46, 197, 0.08);
}

.dropdown-list li.selected {
  background: rgba(157, 46, 197, 0.12);
  color: var(--brand);
  font-weight: 700;
}

.advanced-controls {
  margin-top: 24px;
  padding: 24px 22px;
  border-radius: 24px;
  border: 1px solid rgba(157, 46, 197, 0.12);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
  animation: fadeIn 0.3s ease;
}

.advanced-controls h3 {
  margin: 0 0 8px;
  font-size: 1.16rem;
  font-weight: 800;
  color: var(--text);
}

.hint-text {
  margin: 0 0 14px;
  font-size: 0.92rem;
}

.model-output-field {
  margin-top: 16px;
}

.flex-gap {
  display: flex;
  gap: 1rem;
  align-items: center;
}

[hidden] {
  display: none;
}

.value-input {
  width: 90px;
  padding: 2px 6px;
  border: 1px dashed transparent;
  border-radius: 8px;
  background: transparent;
  color: #3b2a7a;
  font: inherit;
  font-weight: 800;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
  appearance: textfield;
  -moz-appearance: textfield;
}

.value-input::-webkit-outer-spin-button,
.value-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.value-input:hover {
  border-color: rgba(157, 46, 197, 0.24);
  background-color: rgba(124, 58, 237, 0.05);
}

.value-input:focus {
  outline: none;
  border-color: rgba(157, 46, 197, 0.28);
  background-color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 4px rgba(157, 46, 197, 0.08);
}

input[type="range"] {
  width: 100%;
  height: 8px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(157, 46, 197, 0.12);
  outline: none;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--brand);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--brand);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(25, 15, 40, 0.58);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.modal {
  width: min(92vw, 620px);
  border-radius: 24px;
  border: 1px solid rgba(157, 46, 197, 0.14);
  background: #fff;
  box-shadow: 0 28px 58px rgba(73, 48, 120, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(157, 46, 197, 0.12);
  background: linear-gradient(180deg, rgba(249, 240, 255, 0.84), rgba(255, 255, 255, 0.82));
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.close-modal {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(157, 46, 197, 0.12);
  border-radius: 999px;
  background: rgba(157, 46, 197, 0.08);
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.close-modal:hover {
  color: var(--text);
}

.modal-body {
  padding: 22px;
  max-height: 70vh;
  overflow-y: auto;
  color: #444;
  line-height: 1.7;
}

.modal-body h3,
.modal-body h4 {
  margin: 0 0 12px;
  color: var(--text);
}

.modal-body ul {
  padding-left: 20px;
}

.modal-body li {
  margin-bottom: 8px;
}

.modal-body pre,
.modal-body code {
  display: block;
  margin: 12px 0;
  padding: 12px;
  border-radius: 12px;
  background: #2d2d2d;
  color: #e0e0e0;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html[data-theme="dark"] body {
  background: #0d1524;
}

html[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 50% -4%, rgba(161, 96, 235, 0.12), transparent 16%),
    radial-gradient(circle at top left, rgba(161, 96, 235, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(69, 124, 255, 0.1), transparent 20%),
    radial-gradient(circle at 14% 22%, rgba(44, 68, 108, 0.16), transparent 18%),
    radial-gradient(circle at 86% 26%, rgba(161, 96, 235, 0.1), transparent 18%),
    radial-gradient(circle at 18% 64%, rgba(37, 60, 97, 0.14), transparent 20%),
    radial-gradient(circle at 84% 62%, rgba(161, 96, 235, 0.08), transparent 18%),
    radial-gradient(circle at 52% 92%, rgba(26, 42, 67, 0.16), transparent 24%),
    linear-gradient(180deg, #0b1220 0%, #0e1625 48%, #0d1524 100%);
}

html[data-theme="dark"] body::after {
  opacity: 0.28;
}

html[data-theme="dark"] #header .topbar {
  border-color: #304158;
  background: rgba(13, 20, 34, 0.78);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] #header .nav {
  border-color: rgba(161, 96, 235, 0.16);
  background: rgba(161, 96, 235, 0.08);
}

html[data-theme="dark"] #header .nav-link {
  color: #d1d8e4;
}

html[data-theme="dark"] #header .nav-link:hover {
  background: rgba(22, 32, 48, 0.92);
  border-color: rgba(161, 96, 235, 0.2);
  color: #f2e8ff;
}

html[data-theme="dark"] #header .nav-link.active {
  background: linear-gradient(180deg, rgba(27, 39, 59, 0.96), rgba(19, 28, 43, 0.96));
  border-color: rgba(161, 96, 235, 0.24);
}

html[data-theme="dark"] #header .header-btn-ghost,
html[data-theme="dark"] #header .notif-btn,
html[data-theme="dark"] #header .mobile-menu-btn {
  border-color: #304158;
  background: rgba(18, 28, 44, 0.78);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] #header .header-btn-ghost:hover,
html[data-theme="dark"] #header .notif-btn:hover,
html[data-theme="dark"] #header .mobile-menu-btn:hover {
  background: rgba(24, 36, 56, 0.94);
}

html[data-theme="dark"] #header .notif-menu,
html[data-theme="dark"] #header .menu {
  border-color: #304158;
  background: rgba(16, 24, 39, 0.94);
  box-shadow: 0 28px 54px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .head-left,
html[data-theme="dark"] .progress-wrap,
html[data-theme="dark"] .card,
html[data-theme="dark"] .file-info,
html[data-theme="dark"] .field,
html[data-theme="dark"] .advanced-controls,
html[data-theme="dark"] .dropdown-list,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .modal-header {
  border-color: #304158;
  background: linear-gradient(180deg, rgba(20, 29, 46, 0.94), rgba(13, 20, 34, 0.88));
  box-shadow:
    0 22px 42px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .head-left::before {
  background:
    radial-gradient(circle at 14% 18%, rgba(30, 44, 68, 0.84), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(161, 96, 235, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(17, 25, 39, 0.16), transparent 40%);
}

html[data-theme="dark"] .progress-wrap::before,
html[data-theme="dark"] .card::after {
  background:
    radial-gradient(circle at 82% 16%, rgba(161, 96, 235, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(17, 25, 39, 0.1), transparent 44%);
}

html[data-theme="dark"] .muted,
html[data-theme="dark"] .form-note,
html[data-theme="dark"] .note,
html[data-theme="dark"] .hint-text,
html[data-theme="dark"] .modal-body {
  color: #a7b5c8;
}

html[data-theme="dark"] .progress-bar,
html[data-theme="dark"] input[type="range"] {
  background: #243347;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .dropdown-btn,
html[data-theme="dark"] .value-input,
html[data-theme="dark"] select.form-control,
html[data-theme="dark"] textarea.form-control {
  border-color: #304158;
  background: rgba(17, 25, 39, 0.76);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .dropdown.open .dropdown-btn,
html[data-theme="dark"] .dropdown-btn:hover,
html[data-theme="dark"] .value-input:focus {
  border-color: rgba(161, 96, 235, 0.22);
  background: rgba(24, 36, 56, 0.94);
  box-shadow: 0 0 0 4px rgba(161, 96, 235, 0.08);
}

html[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a7b5c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

html[data-theme="dark"] .radio-label,
html[data-theme="dark"] .task-card {
  border-color: #304158;
  background: rgba(17, 25, 39, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .radio-label:has(input:checked),
html[data-theme="dark"] .task-card[aria-checked="true"] {
  border-color: rgba(161, 96, 235, 0.28);
  background: rgba(161, 96, 235, 0.12);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .task-icon {
  background: rgba(161, 96, 235, 0.12);
  color: #efdfff;
}

html[data-theme="dark"] .new-task-btn-ghost,
html[data-theme="dark"] .help-btn {
  background: rgba(161, 96, 235, 0.12);
  border-color: #304158;
  color: #efdfff;
}

html[data-theme="dark"] .new-task-btn-ghost:hover,
html[data-theme="dark"] .help-btn:hover {
  background: rgba(161, 96, 235, 0.18);
}

html[data-theme="dark"] .dropzone {
  background: linear-gradient(180deg, rgba(22, 32, 48, 0.92), rgba(13, 20, 34, 0.84));
  border-color: #3a4d69;
  color: var(--text);
}

html[data-theme="dark"] .dropzone.dragover,
html[data-theme="dark"] .dropzone:focus {
  border-color: rgba(161, 96, 235, 0.32);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .dropdown-list li:hover {
  background: rgba(161, 96, 235, 0.14);
}

html[data-theme="dark"] .close-modal {
  border-color: #304158;
  background: rgba(161, 96, 235, 0.12);
  color: #c6d2e2;
}

html[data-theme="dark"] .close-modal:hover {
  color: var(--text);
}

html[data-theme="dark"] .modal-body pre,
html[data-theme="dark"] .modal-body code {
  background: #0f1723;
  border: 1px solid #253347;
}

@media (max-width: 980px) {
  .page-head {
    grid-template-columns: 1fr;
  }

  .task-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  header#header {
    padding: 14px 16px 22px;
  }

  #header .topbar {
    padding: 12px 14px;
  }

  #header .nav {
    top: calc(100% + 12px);
    left: 12px;
    right: 12px;
    padding: 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 20px 40px rgba(83, 56, 130, 0.14);
    backdrop-filter: blur(18px);
  }

  html[data-theme="dark"] #header .nav {
    border-color: #304158;
    background: rgba(16, 24, 39, 0.96);
  }

  .page-content {
    padding: 0 16px 72px;
  }

  .head-left {
    padding: 30px 24px 26px;
    border-radius: 26px;
  }

  .progress-wrap {
    padding: 20px;
    border-radius: 24px;
  }

  .card {
    padding: 24px 22px;
    border-radius: 24px;
  }

  .step-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page-head h1 {
    font-size: clamp(2.15rem, 12vw, 3.3rem);
  }

  .card,
  .advanced-controls,
  .dropzone,
  .task-card {
    border-radius: 20px;
  }

  .radio-group,
  .actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-row .error {
    margin-right: 0;
  }

  .new-task-btn,
  .help-btn {
    width: 100%;
    justify-content: center;
  }

  .modal {
    width: calc(100vw - 20px);
    border-radius: 20px;
  }

  .modal-header,
  .modal-body {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .help-btn,
  .task-card,
  .new-task-btn,
  .dropzone,
  .modal {
    transition: none;
  }
}
