:root {
  color-scheme: light;
  --background: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --line: #dfe4ea;
  --accent: #2458e6;
  --accent-strong: #1948c7;
  --accent-soft: #eaf0ff;
  --success: #087a55;
  --success-soft: #e8f7f0;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --warning: #9a6700;
  --warning-soft: #fff8e7;
  --shadow: 0 22px 55px rgba(16, 24, 40, 0.09);
}

[data-theme="dark"] {
  color-scheme: dark;
  --background: #0d1117;
  --surface: #161b22;
  --surface-soft: #0f141b;
  --text: #f1f5f9;
  --muted: #9aa6b2;
  --line: #30363d;
  --accent: #7395ff;
  --accent-strong: #90aaff;
  --accent-soft: #202d51;
  --success: #5ad4a5;
  --success-soft: #14382d;
  --danger: #ff8c85;
  --danger-soft: #3b1d1d;
  --warning: #f2c14e;
  --warning-soft: #382f18;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 5% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 30rem),
    var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color 180ms ease, color 180ms ease;
}

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

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

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 40px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.intro {
  max-width: 690px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.icon-button,
.text-button,
.secondary-button,
.download-button,
.primary-button {
  border: 0;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.icon-button {
  flex: none;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.privacy-note {
  display: flex;
  gap: 13px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--success) 30%, var(--line));
  border-radius: 14px;
  background: var(--success-soft);
  color: var(--success);
}

.privacy-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.privacy-dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 13%, transparent);
}

.panel {
  margin-bottom: 18px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-number {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.text-button {
  padding: 6px 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

textarea,
input,
select {
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
}

textarea:focus,
input:focus,
select:focus,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  outline: none;
}

textarea {
  width: 100%;
  min-height: 220px;
  padding: 17px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
}

textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr 1.2fr;
  gap: 12px;
  margin-top: 15px;
}

.field,
.switch-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.field > span,
.switch-field > span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  height: 43px;
  padding: 0 12px;
}

.switch-field {
  position: relative;
  flex-direction: row;
  align-items: center;
  align-self: end;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  cursor: pointer;
}

.switch-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--line);
  transition: background-color 150ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  content: "";
  transition: transform 150ms ease;
}

.switch-field input:checked + .switch {
  background: var(--accent);
}

.switch-field input:checked + .switch::after {
  transform: translateX(14px);
}

.switch-field input:focus-visible + .switch {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.warning {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 13px;
  line-height: 1.5;
}

.is-hidden {
  display: none;
}

.primary-button,
.secondary-button,
.download-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  font-weight: 750;
}

.primary-button {
  width: 100%;
  margin-top: 18px;
  background: var(--accent);
  color: white;
}

.primary-button:hover,
.download-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.status {
  min-height: 20px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.status.success {
  color: var(--success);
}

.status.error {
  color: var(--danger);
}

.result-count {
  color: var(--muted);
  font-size: 13px;
}

.output {
  min-height: 330px;
  background: var(--surface-soft);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.download-button {
  background: var(--accent);
  color: white;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

footer {
  padding: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

footer p {
  margin-bottom: 0;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
}

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 980px);
    padding-top: 28px;
  }

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

  .hero {
    gap: 12px;
  }

  .icon-button {
    margin-top: 4px;
  }
}

@media (max-width: 480px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .switch-field {
    align-self: auto;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }

  .section-heading {
    align-items: flex-start;
  }
}

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