:root {
  color-scheme: dark;

  --bg: #070b10;
  --bg-deep: #04070a;
  --panel: rgba(16, 25, 36, 0.86);
  --panel-soft: rgba(10, 17, 25, 0.72);
  --panel-solid: #0e1721;
  --field: #070e16;

  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.26);

  --text: #e9f0f8;
  --text-soft: #c6d2e0;
  --muted: #8b9bb0;
  --faint: #617188;

  --accent: #5eead4;
  --accent-strong: #2dd4bf;
  --accent-2: #818cf8;
  --accent-3: #f472b6;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;

  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 13px;

  --shadow-card: 0 30px 80px -38px rgba(0, 0, 0, 0.95);
  --shadow-accent: 0 18px 44px -18px rgba(94, 234, 212, 0.55);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono",
    monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(94, 234, 212, 0.26);
  color: #ffffff;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

code {
  padding: 0.12em 0.38em;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 6px;
  background: rgba(6, 12, 19, 0.7);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.is-hidden {
  display: none !important;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(54rem 32rem at 12% -12%, rgba(94, 234, 212, 0.13), transparent 62%),
    radial-gradient(46rem 30rem at 92% -4%, rgba(129, 140, 248, 0.16), transparent 64%),
    radial-gradient(42rem 36rem at 50% 108%, rgba(244, 114, 182, 0.06), transparent 70%),
    linear-gradient(180deg, #070b10 0%, #060a0e 60%, #05080b 100%);
}

.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 42% at 50% 0%, #000 20%, transparent 72%);
}

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */

.site-header {
  width: min(1080px, 100% - 40px);
  margin: 0 auto;
  padding: 24px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background:
    linear-gradient(145deg, rgba(94, 234, 212, 0.24), rgba(129, 140, 248, 0.16)),
    #0a141d;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 26px -14px rgba(94, 234, 212, 0.8);
  color: var(--accent);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-arrow {
  margin: 0 0.2em;
  color: var(--faint);
  font-weight: 400;
}

.brand-accent {
  color: var(--accent);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.ghost-button:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.06);
  text-decoration: none;
}

.ghost-button svg {
  width: 15px;
  height: 15px;
}

.support-link svg {
  color: #f6c177;
}

.support-link:hover {
  border-color: rgba(246, 193, 119, 0.3);
}

.lang-picker {
  position: relative;
  flex: none;
}

.lang-button {
  gap: 6px;
  padding: 0 10px;
  border-color: var(--border);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.lang-button:hover,
.lang-button[aria-expanded="true"] {
  color: var(--text);
  border-color: rgba(94, 234, 212, 0.4);
  background: rgba(148, 163, 184, 0.06);
}

.lang-flag-stack {
  display: inline-grid;
  flex: none;
  width: 20px;
  height: 14px;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.lang-flag-stack .lang-flag {
  display: none;
  grid-area: 1 / 1;
  width: 20px;
  height: 14px;
}

.lang-button[data-lang="en"] .lang-flag-stack [data-flag="en"],
.lang-button[data-lang="pl"] .lang-flag-stack [data-flag="pl"],
.lang-button[data-lang="de"] .lang-flag-stack [data-flag="de"] {
  display: block;
}

.lang-code {
  min-width: 17px;
  text-align: center;
}

.lang-button .lang-chevron {
  width: 11px;
  height: 11px;
  opacity: 0.55;
  transition: transform 0.18s ease;
}

.lang-button[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 192px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(9, 15, 22, 0.97);
  box-shadow:
    0 22px 55px -12px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform-origin: top right;
  animation: lang-menu-in 0.16s ease both;
}

.lang-menu[hidden] {
  display: none;
}

@keyframes lang-menu-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.97);
  }

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

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition:
    color 0.14s ease,
    background 0.14s ease;
}

.lang-option:hover,
.lang-option:focus-visible {
  color: var(--text);
  background: rgba(148, 163, 184, 0.1);
  outline: none;
}

.lang-option[aria-selected="true"] {
  color: var(--text);
  background: rgba(94, 234, 212, 0.08);
}

.lang-option .lang-flag {
  flex: none;
  width: 21px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.lang-option-text {
  flex: 1;
  white-space: nowrap;
}

.lang-option .lang-check {
  width: 13px;
  height: 13px;
  flex: none;
  color: var(--accent);
  opacity: 0;
}

.lang-option[aria-selected="true"] .lang-check {
  opacity: 1;
}

/* -------------------------------------------------------------------------- */
/* Layout & hero                                                              */
/* -------------------------------------------------------------------------- */

.page {
  width: min(1080px, 100% - 40px);
  margin: 0 auto;
  padding: 0 0 96px;
}

.hero {
  padding: 72px 0 46px;
  max-width: 860px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero .eyebrow {
  padding: 7px 12px 7px 10px;
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.05);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.5);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.45);
  }
  60% {
    box-shadow: 0 0 0 8px rgba(94, 234, 212, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(94, 234, 212, 0);
  }
}

h1 {
  margin: 24px 0 0;
  font-size: clamp(2.65rem, 7.6vw, 4.9rem);
  font-weight: 720;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.gradient-text {
  display: inline-block;
  padding-bottom: 0.08em;
  background: linear-gradient(100deg, var(--accent) 4%, #a5b4fc 48%, var(--accent-2) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 640px;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(0.98rem, 2.3vw, 1.08rem);
  line-height: 1.7;
}

.lede code {
  color: var(--text-soft);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
}

.hero-point {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 0.76rem;
  font-weight: 500;
}

.hero-point::before {
  content: "✓";
  color: var(--accent);
  font-weight: 800;
  font-size: 0.72rem;
}

/* -------------------------------------------------------------------------- */
/* Workspace & cards                                                          */
/* -------------------------------------------------------------------------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 8px;
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(20, 30, 43, 0.9), rgba(9, 15, 23, 0.94)),
    var(--panel-solid);
  box-shadow: var(--shadow-card);
  padding: 24px;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent);
  pointer-events: none;
}

.card:not(.is-hidden) {
  animation: rise 0.5s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

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

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-head h2 {
  margin-top: 2px;
  font-size: 1.22rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.step-label {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.file-name {
  max-width: 300px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Drop card ---------------------------------------------------------------- */

.drop-card {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  min-height: 372px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 24px;
  border-style: dashed;
  border-color: var(--border-strong);
  background:
    radial-gradient(28rem 16rem at 50% 0%, rgba(94, 234, 212, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(18, 28, 40, 0.92), rgba(8, 14, 21, 0.96));
  text-align: center;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease;
}

.drop-card.is-dragging {
  border-color: var(--accent);
  transform: translateY(-2px);
  background:
    radial-gradient(30rem 18rem at 50% 0%, rgba(94, 234, 212, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(20, 34, 46, 0.96), rgba(8, 14, 21, 0.98));
}

.drop-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px 12px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  outline: none;
}

.drop-target:focus-visible {
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.24);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-bottom: 4px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(94, 234, 212, 0.2), rgba(129, 140, 248, 0.12)),
    rgba(9, 17, 25, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 40px -20px rgba(94, 234, 212, 0.7);
  color: var(--accent);
  transition: transform 0.2s ease;
}

.drop-target:hover .drop-icon {
  transform: translateY(-2px) scale(1.02);
}

.drop-icon svg {
  width: 30px;
  height: 30px;
}

.drop-title {
  font-size: 1.32rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.drop-hint {
  color: var(--muted);
  font-size: 0.88rem;
}

.drop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.drop-formats {
  margin-top: 14px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

.text-button {
  margin-top: 12px;
  padding: 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
  text-decoration: underline;
  text-decoration-color: rgba(148, 163, 184, 0.35);
  text-underline-offset: 4px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* Buttons ------------------------------------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  background: linear-gradient(110deg, var(--accent) 0%, #7ce8d5 42%, #93a5ff 100%);
  color: #041310;
  box-shadow: var(--shadow-accent);
}

.button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 50px -18px rgba(94, 234, 212, 0.7);
}

.button.secondary {
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.07);
  color: var(--text-soft);
}

.button.secondary:hover {
  border-color: var(--border-strong);
  background: rgba(148, 163, 184, 0.11);
  color: var(--text);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.05);
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.icon-button:hover {
  border-color: rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.08);
  color: var(--danger);
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

/* -------------------------------------------------------------------------- */
/* Editor                                                                    */
/* -------------------------------------------------------------------------- */

.editor-card {
  width: 100%;
}

.field {
  margin-top: 22px;
}

.field-label {
  display: block;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.field-hint {
  margin-top: 7px;
  color: var(--faint);
  font-size: 0.7rem;
  line-height: 1.5;
}

.select-wrap {
  position: relative;
  margin-top: 8px;
}

.select-wrap select {
  width: 100%;
  height: 44px;
  padding: 0 42px 0 14px;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--field);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.select-wrap select:focus-visible {
  border-color: rgba(94, 234, 212, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.14);
}

.select-wrap > svg {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--field);
}

.segmented button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.segmented button:hover {
  color: var(--text-soft);
}

.segmented button[aria-pressed="true"] {
  background: rgba(94, 234, 212, 0.12);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.26);
  color: var(--accent);
}

.source-details {
  margin-top: 22px;
  border-top: 1px solid var(--border);
}

.source-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 550;
  list-style: none;
  cursor: pointer;
  transition: color 0.16s ease;
}

.source-details summary:hover {
  color: var(--text-soft);
}

.source-details summary::-webkit-details-marker {
  display: none;
}

.source-details summary::after {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.source-details[open] summary::after {
  transform: rotate(-135deg);
}

.source-summary-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.source-summary-left svg {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.char-count {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.source-details textarea {
  display: block;
  width: 100%;
  min-height: 230px;
  margin: 2px 0 6px;
  padding: 14px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--field);
  color: #d6e2f1;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  line-height: 1.7;
  tab-size: 2;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.source-details textarea:focus-visible {
  border-color: rgba(94, 234, 212, 0.5);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.chips:empty {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.045);
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 550;
  white-space: nowrap;
}

.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--chip-dot, var(--accent));
}

.chip.muted {
  color: var(--faint);
}

.chip.muted::before {
  background: var(--faint);
}

.chip.preamp {
  --chip-dot: var(--warning);
  color: #d9c89d;
}

.chip.off {
  --chip-dot: var(--faint);
}

.inline-error {
  margin-top: 16px;
  padding: 14px 15px;
  border: 1px solid rgba(251, 113, 133, 0.28);
  border-radius: var(--radius-md);
  background: rgba(251, 113, 133, 0.07);
}

.inline-error h4 {
  margin: 0 0 4px;
  color: #fecdd3;
  font-size: 0.8rem;
  font-weight: 650;
}

.inline-error p {
  color: #cfa6ae;
  font-size: 0.76rem;
  line-height: 1.55;
}

.warnings {
  margin-top: 16px;
  padding: 14px 15px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: var(--radius-md);
  background: rgba(251, 191, 36, 0.055);
}

.warnings-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  color: #fcdba0;
  font-size: 0.76rem;
  font-weight: 650;
}

.warnings-title svg {
  width: 14px;
  height: 14px;
}

.warning-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 190px;
  overflow-y: auto;
}

.warning-list li {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  color: #c9b58a;
  font-size: 0.72rem;
  line-height: 1.5;
}

.warning-list li + li {
  border-top: 1px solid rgba(251, 191, 36, 0.09);
}

.warning-line {
  flex: 0 0 auto;
  color: rgba(251, 191, 36, 0.72);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding-top: 2px;
}

.warning-list code {
  font-size: 0.66rem;
}

/* -------------------------------------------------------------------------- */
/* Result                                                                    */
/* -------------------------------------------------------------------------- */

.result-card {
  width: 100%;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(52, 211, 153, 0.24);
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.08);
  color: var(--success);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.chart-card {
  margin-top: 18px;
  padding: 12px 10px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(20rem 10rem at 50% 0%, rgba(94, 234, 212, 0.05), transparent 72%),
    rgba(5, 10, 15, 0.62);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 2px 6px 8px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 0.65rem;
  font-weight: 500;
}

.legend-swatch {
  width: 15px;
  height: 3px;
  border-radius: 3px;
}

.swatch-original {
  background: repeating-linear-gradient(90deg, #7c8ba1 0 4px, transparent 4px 7px);
}

.swatch-wavelet {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.5);
}

.chart-shell {
  position: relative;
  width: 100%;
  min-height: 220px;
  touch-action: pan-y;
}

#chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: rgba(8, 14, 21, 0.96);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.9);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.4;
  pointer-events: none;
  transform: translate(-50%, -112%);
  white-space: nowrap;
}

.chart-tooltip strong {
  color: var(--text);
  font-weight: 650;
}

.chart-tooltip .tip-wavelet {
  color: var(--accent);
}

.chart-tooltip .tip-original {
  color: #94a3b8;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.stat {
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(6, 12, 19, 0.55);
}

.stat-label {
  display: block;
  overflow: hidden;
  color: var(--faint);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.stat-value {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.stat-value.accent {
  color: var(--accent);
}

.stat-value.warn {
  color: #fda4af;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.result-actions .download-button {
  flex: 1 1 220px;
}

.result-actions .button.secondary {
  flex: 0 1 auto;
}

.preview {
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

.preview summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 550;
  list-style: none;
  cursor: pointer;
}

.preview summary::-webkit-details-marker {
  display: none;
}

.preview summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.preview[open] summary::after {
  transform: rotate(-135deg);
}

.preview-badge {
  margin-left: auto;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  white-space: nowrap;
}

.preview pre {
  max-height: 170px;
  margin: 2px 0 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--field);
  color: #b8c8db;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.result-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 12px;
  color: var(--faint);
  font-size: 0.66rem;
  line-height: 1.5;
}

.result-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
}

/* -------------------------------------------------------------------------- */
/* How it works                                                              */
/* -------------------------------------------------------------------------- */

.how {
  margin-top: 76px;
}

.section-heading h2 {
  margin-top: 8px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 680;
  letter-spacing: -0.04em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.step-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(16, 25, 36, 0.7), rgba(8, 13, 20, 0.7));
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.step-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 10px;
  background: rgba(94, 234, 212, 0.07);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.step-card h3 {
  margin-top: 14px;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.step-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.65;
}

.step-card code {
  font-size: 0.64rem;
}

.privacy-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 34px;
  padding: 20px 22px;
  border: 1px solid rgba(94, 234, 212, 0.18);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(26rem 10rem at 0% 0%, rgba(94, 234, 212, 0.09), transparent 70%),
    rgba(10, 18, 26, 0.7);
}

.privacy-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid rgba(94, 234, 212, 0.24);
  border-radius: 12px;
  background: rgba(94, 234, 212, 0.07);
  color: var(--accent);
}

.privacy-icon svg {
  width: 21px;
  height: 21px;
}

.privacy-card h3 {
  font-size: 0.9rem;
  font-weight: 650;
}

.privacy-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

/* -------------------------------------------------------------------------- */
/* Footer, toast                                                             */
/* -------------------------------------------------------------------------- */

.site-footer {
  width: min(1080px, 100% - 40px);
  margin: 0 auto;
  padding: 24px 0 34px;
  border-top: 1px solid rgba(148, 163, 184, 0.09);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  color: var(--faint);
  font-size: 0.68rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--text);
  text-decoration: none;
}

.footer-link svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.footer-support,
.site-footer .footer-support {
  color: #f6c177;
}

.footer-support:hover,
.site-footer .footer-support:hover {
  color: #ffd79a;
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.02em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 100;
  padding: 10px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(10, 18, 26, 0.97);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 550;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 12px 16px;
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: 12px;
  background: #1a0c11;
  color: #fecdd3;
  font-size: 0.8rem;
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                */
/* -------------------------------------------------------------------------- */

@media (min-width: 900px) {
  .workspace.has-result {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
    align-items: start;
  }

  .workspace.has-result .editor-card,
  .workspace.has-result .result-card {
    max-width: none;
  }
}

@media (max-width: 899px) {
  .editor-card,
  .result-card {
    max-width: 820px;
    margin-inline: auto;
  }
}

@media (max-width: 760px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding-top: 54px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-header {
    width: calc(100% - 32px);
    padding-top: 18px;
  }

  .page {
    width: calc(100% - 32px);
  }

  .brand-text {
    font-size: 0.82rem;
  }

  .nav-link span {
    display: none;
  }

  .nav-link {
    min-width: 38px;
    justify-content: center;
    padding: 0 10px;
  }

  .hero {
    padding: 44px 0 32px;
  }

  h1 {
    font-size: clamp(2.35rem, 12vw, 3.15rem);
  }

  .hero-points {
    gap: 6px 14px;
  }

  .hero-point {
    font-size: 0.7rem;
  }

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

  .drop-card {
    min-height: 340px;
    padding: 24px 16px;
  }

  .drop-icon {
    width: 58px;
    height: 58px;
    border-radius: 17px;
  }

  .drop-title {
    font-size: 1.16rem;
  }

  .drop-hint {
    font-size: 0.8rem;
  }

  .drop-actions {
    width: 100%;
  }

  .drop-actions .button {
    flex: 1 1 150px;
  }

  .segmented {
    display: flex;
    width: 100%;
    border-radius: 14px;
  }

  .segmented button {
    flex: 1 1 auto;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 0.61rem;
  }

  .card-head h2 {
    font-size: 1.1rem;
  }

  .file-name {
    max-width: 210px;
  }

  .result-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .result-actions .download-button {
    grid-column: 1 / -1;
  }

  .result-actions .button {
    width: 100%;
  }

  .result-actions .button.secondary {
    padding-inline: 10px;
  }

  .stat {
    padding: 9px 10px;
  }

  .stat-value {
    font-size: 0.82rem;
  }

  .chart-card {
    padding: 10px 6px 6px;
  }

  .how {
    margin-top: 54px;
  }

  .privacy-card {
    padding: 17px;
    gap: 12px;
  }

  .site-footer {
    width: calc(100% - 32px);
    padding-bottom: max(26px, env(safe-area-inset-bottom));
  }

  .toast {
    white-space: normal;
    text-align: center;
    max-width: calc(100% - 32px);
  }
}

@media (max-width: 420px) {
  .site-header {
    gap: 8px;
  }

  .brand-text {
    font-size: 0.76rem;
  }

  .header-tools {
    gap: 6px;
  }

  .lang-button {
    padding: 0 8px;
  }
}

@media (max-width: 380px) {
  .brand-arrow,
  .brand-accent {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Scrollbars ---------------------------------------------------------------- */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}
