:root {
  --bg: #0c0f14;
  --bg-elevated: #141a24;
  --bg-input: #0e131c;
  --border: rgba(94, 234, 212, 0.12);
  --accent: #5eead4;
  --accent-dim: rgba(94, 234, 212, 0.55);
  --text: #e8edf5;
  --text-muted: #8b98ab;
  --danger: #f87171;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --radius: 12px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(94, 234, 212, 0.08), transparent),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(56, 189, 248, 0.06), transparent),
    var(--bg);
}

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

header.hero {
  text-align: center;
  margin-bottom: 2.25rem;
}

header.hero h1 {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #f0fdfa 0%, var(--accent) 55%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

header.hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.15rem;
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 1.25rem;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 0.45rem;
}

textarea#dnaInput {
  width: 100%;
  min-height: 140px;
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea#dnaInput:focus {
  outline: none;
  border-color: rgba(94, 234, 212, 0.45);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
}

textarea#dnaInput::placeholder {
  color: var(--text-muted);
  opacity: 0.65;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-top: 1rem;
}

.field-inline {
  flex: 1 1 180px;
}

select#cutFilter {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235eead4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2rem;
}

select#cutFilter:focus {
  outline: none;
  border-color: rgba(94, 234, 212, 0.45);
}

.btn-analyze {
  flex: 0 0 auto;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: #042f2e;
  background: linear-gradient(135deg, #5eead4 0%, #2dd4bf 50%, #22d3ee 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(45, 212, 191, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-analyze:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(45, 212, 191, 0.4);
}

.btn-analyze:active {
  transform: translateY(0);
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stats-row strong {
  color: var(--accent);
  font-weight: 600;
}

.stats-row .error {
  color: var(--danger);
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table.results thead {
  background: rgba(94, 234, 212, 0.06);
}

table.results th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dim);
  border-bottom: 1px solid var(--border);
}

table.results td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(94, 234, 212, 0.06);
  vertical-align: top;
}

table.results tbody tr:last-child td {
  border-bottom: none;
}

table.results tbody tr:hover td {
  background: rgba(94, 234, 212, 0.04);
}

table.results .mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

table.results .pos {
  font-variant-numeric: tabular-nums;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

footer.note {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 520px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-analyze {
    width: 100%;
  }
}
