:root, [data-theme="light"] {
  --bg: #f7f6f2;
  --surface: #f9f8f5;
  --surface2: #fbfbf9;
  --offset: #f3f0ec;
  --divider: #dcd9d5;
  --border: #d4d1ca;
  --text: #28251d;
  --muted: #7a7974;
  --faint: #bab9b4;
  --primary: #01696f;
  --primary-h: #0c4e54;
  --success: #437a22;
  --warn: #964219;
  --blue: #006494;
  --gold: #d19900;
  --orange: #da7101;
  --error: #a12c7b;
  --sh-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
  --sh-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
  --r-sm: 0.375rem;
  --r-md: 0.5rem;
  --r-lg: 0.75rem;
  --r-xl: 1rem;
  --r-full: 9999px;
  --fd: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --fb: 'Satoshi', 'Inter', sans-serif;
  --fm: 'JetBrains Mono', 'Courier New', monospace;
  --ease: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #171614;
  --surface: #1c1b19;
  --surface2: #201f1d;
  --offset: #1d1c1a;
  --divider: #262523;
  --border: #393836;
  --text: #cdccca;
  --muted: #797876;
  --faint: #5a5957;
  --primary: #4f98a3;
  --primary-h: #227f8b;
  --success: #6daa45;
  --warn: #bb653b;
  --blue: #5591c7;
  --gold: #e8af34;
  --orange: #fdab43;
  --error: #d163a7;
  --sh-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --sh-md: 0 4px 12px oklch(0 0 0 / 0.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

body {
  min-height: 100dvh;
  font-family: var(--fb);
  font-size: 1rem;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3 {
  text-wrap: balance;
  line-height: 1.15;
}

p,
li {
  text-wrap: pretty;
  max-width: 72ch;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

::selection {
  background: color-mix(in oklch, var(--primary) 25%, transparent);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

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

a,
button,
[role="button"],
input,
textarea,
select {
  transition:
    color var(--ease),
    background var(--ease),
    border-color var(--ease),
    box-shadow var(--ease);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--sh-sm);
}

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

.logo-text {
  font-family: var(--fd);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-chip {
  font-size: 0.7rem;
  background: color-mix(in oklch, var(--primary) 15%, var(--surface));
  color: var(--primary);
  padding: 2px 0.6rem;
  border-radius: var(--r-full);
  font-weight: 600;
}

.theme-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--offset);
  color: var(--muted);
}

.theme-btn:hover {
  background: var(--divider);
  color: var(--text);
}

main {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.hero h1 {
  font-family: var(--fd);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--primary);
}

.hero p {
  color: var(--muted);
  max-width: 55ch;
  font-size: 0.9rem;
}

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  box-shadow: var(--sh-sm);
}

.panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel-title {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.badge {
  font-size: 0.68rem;
  padding: 2px 0.6rem;
  border-radius: var(--r-full);
  font-weight: 600;
  font-family: var(--fm);
}

.b-blue {
  background: color-mix(in oklch, var(--blue) 14%, var(--surface));
  color: var(--blue);
}

.b-gold {
  background: color-mix(in oklch, var(--gold) 14%, var(--surface));
  color: var(--gold);
}

textarea {
  width: 100%;
  min-height: 88px;
  background: var(--offset);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 18%, transparent);
}

textarea::placeholder {
  color: var(--faint);
}

.controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  align-items: center;
}

select {
  background: var(--offset);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

select:focus {
  border-color: var(--primary);
}

.btn-p {
  background: var(--primary);
  color: #fff;
  padding: 0.45rem 1.2rem;
  border-radius: var(--r-md);
  font-size: 0.88rem;
  font-weight: 700;
}

.btn-p:hover {
  background: var(--primary-h);
}

.btn-p:active {
  transform: scale(0.97);
}

.btn-p:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-s {
  background: var(--offset);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-md);
  font-size: 0.85rem;
}

.btn-s:hover {
  background: var(--divider);
}

.prog {
  width: 100%;
  height: 5px;
  background: var(--offset);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-top: 1rem;
}

.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--blue));
  width: 0%;
  border-radius: var(--r-full);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  box-shadow: var(--sh-sm);
}

.lang-title {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.lang-title em {
  font-style: normal;
  color: var(--primary);
}

.lang-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.lang-input-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
  position: relative;
}

.lang-search-wrap {
  flex: 1;
  position: relative;
}

.lang-search {
  width: 100%;
  background: var(--offset);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  outline: none;
}

.lang-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 18%, transparent);
}

.lang-search::placeholder {
  color: var(--faint);
}

.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.suggestions.open {
  display: block;
}

.suggestion-item {
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: color-mix(in oklch, var(--primary) 10%, var(--surface));
}

.s-flag {
  font-size: 16px;
}

.s-name {
  flex: 1;
}

.s-code {
  font-family: var(--fm);
  font-size: 0.68rem;
  color: var(--muted);
}

.no-result {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.btn-add {
  background: var(--primary);
  color: #fff;
  padding: 0.55rem 1.2rem;
  border-radius: var(--r-lg);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn-add:hover {
  background: var(--primary-h);
}

.btn-add:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.selected-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  min-height: 36px;
  align-items: center;
}

.sel-empty {
  font-size: 0.82rem;
  color: var(--faint);
  font-style: italic;
}

.lang-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: color-mix(in oklch, var(--primary) 14%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--primary) 30%, var(--border));
  color: var(--primary);
  border-radius: var(--r-full);
  padding: 0.25rem 0.75rem 0.25rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.lang-tag .tag-remove {
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0.6;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
}

.lang-tag .tag-remove:hover {
  opacity: 1;
  background: color-mix(in oklch, var(--error) 20%, transparent);
  color: var(--error);
}

.lang-count {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

.lang-count span {
  color: var(--primary);
  font-weight: 700;
}

.warn-box {
  font-size: 0.78rem;
  color: var(--warn);
  background: color-mix(in oklch, var(--warn) 8%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--warn) 25%, var(--border));
  border-radius: var(--r-md);
  padding: 0.5rem 0.9rem;
  margin-top: 0.6rem;
  display: none;
}

.sec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  box-shadow: var(--sh-sm);
}

.sec-title {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.sec-title em {
  font-style: normal;
  color: var(--primary);
}

.pipe {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  gap: 0;
}

.pipe-stage {
  flex: 1;
  min-width: 148px;
}

.scard {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem;
  margin: 0 0.4rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.scard.active.s1 {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--blue) 30%, transparent);
}

.scard.active.s2 {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--gold) 30%, transparent);
}

.scard.active.s3 {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--orange) 30%, transparent);
}

.scard.active.s4 {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--primary) 30%, transparent);
}

.scard.active.s5 {
  border-color: var(--success);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--success) 30%, transparent);
}

.sicon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 0.6rem;
}

.s1 .sicon {
  background: color-mix(in oklch, var(--blue) 14%, var(--surface));
}

.s2 .sicon {
  background: color-mix(in oklch, var(--gold) 14%, var(--surface));
}

.s3 .sicon {
  background: color-mix(in oklch, var(--orange) 14%, var(--surface));
}

.s4 .sicon {
  background: color-mix(in oklch, var(--primary) 14%, var(--surface));
}

.s5 .sicon {
  background: color-mix(in oklch, var(--success) 14%, var(--surface));
}

.sname {
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.sdesc {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.45;
}

.sstatus {
  font-size: 0.65rem;
  font-family: var(--fm);
  margin-top: 0.6rem;
  padding: 2px 0.5rem;
  border-radius: var(--r-sm);
  background: var(--offset);
  color: var(--faint);
  display: inline-block;
  transition: all 0.3s;
}

.sstatus.running {
  color: var(--gold);
  background: color-mix(in oklch, var(--gold) 10%, var(--surface));
}

.sstatus.done {
  color: var(--success);
  background: color-mix(in oklch, var(--success) 10%, var(--surface));
}

.arrow {
  color: var(--faint);
  padding: 0 0.2rem;
  align-self: center;
  margin-top: -18px;
  font-size: 18px;
  flex-shrink: 0;
}

.flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}

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

.fcard {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem;
}

.fcard-title {
  font-size: 0.65rem;
  font-family: var(--fm);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.code {
  font-family: var(--fm);
  font-size: 0.7rem;
  background: var(--offset);
  border-radius: var(--r-md);
  padding: 0.7rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 90px;
  border: 1px solid var(--divider);
}

.ck {
  color: var(--blue);
}

.cs {
  color: var(--orange);
}

.cn {
  color: var(--gold);
}

.cc {
  color: var(--faint);
}

.tgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.lcard {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem;
  opacity: 0.2;
  transform: translateY(8px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lcard.loaded {
  opacity: 1;
  transform: translateY(0);
}

.lflag {
  font-size: 22px;
  margin-bottom: 0.4rem;
}

.lname {
  font-size: 0.65rem;
  font-family: var(--fm);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.ltext {
  font-size: 0.85rem;
  line-height: 1.6;
  font-style: italic;
  min-height: 38px;
}

.lconf {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.cbar {
  flex: 1;
  height: 3px;
  background: var(--offset);
  border-radius: var(--r-full);
}

.cfill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--success);
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.cval {
  font-size: 0.65rem;
  font-family: var(--fm);
  color: var(--muted);
}

.mgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

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

.mc {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem;
}

.ml {
  font-size: 0.65rem;
  color: var(--muted);
  font-family: var(--fm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.mv {
  font-family: var(--fd);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ms {
  font-size: 0.65rem;
  color: var(--faint);
  margin-top: 0.2rem;
}

.md {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

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

.dn {
  color: var(--error);
}

.logs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.log {
  display: flex;
  gap: 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.35s;
}

.log.vis {
  opacity: 1;
  transform: translateY(0);
}

.ldot {
  width: 9px;
  height: 9px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  margin-top: 5px;
}

.dw {
  background: var(--warn);
}

.dk {
  background: var(--success);
}

.di {
  background: var(--blue);
}

.lbody {
  flex: 1;
}

.lt {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.lb {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}

.lf {
  font-size: 0.7rem;
  color: var(--primary);
  margin-top: 0.35rem;
  font-style: italic;
}

footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--faint);
  font-size: 0.7rem;
  border-top: 1px solid var(--divider);
}