:root {
  color-scheme: light;
  --bg: #eef1ea;
  --bg-deep: #111815;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --ink: #101815;
  --muted: #647069;
  --soft: #edf3ed;
  --line: rgba(22, 39, 32, 0.13);
  --accent: #17a36b;
  --accent-dark: #0d6847;
  --cyan: #2f9bb5;
  --gold: #d1a33b;
  --rose: #b84e65;
  --danger: #a13d31;
  --shadow: 0 18px 60px rgba(19, 31, 24, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(17, 24, 21, 0.96) 0 260px, transparent 260px),
    linear-gradient(90deg, rgba(47, 155, 181, 0.18), transparent 32%, rgba(209, 163, 59, 0.13) 68%, transparent),
    repeating-linear-gradient(90deg, rgba(16, 24, 21, 0.05) 0 1px, transparent 1px 72px),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 18%, rgba(23, 163, 107, 0.10) 18% 18.5%, transparent 18.5% 58%, rgba(184, 78, 101, 0.08) 58% 58.4%, transparent 58.4%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.36), transparent 28%);
}

.shell {
  position: relative;
  width: min(1220px, calc(100vw - 40px));
  margin: 24px auto 42px;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 156px;
  margin-bottom: 18px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(17, 24, 21, 0.98), rgba(21, 45, 37, 0.93)),
    linear-gradient(90deg, rgba(23, 163, 107, 0.24), rgba(47, 155, 181, 0.15));
  box-shadow: var(--shadow);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 24px auto auto calc(50% - 80px);
  width: min(520px, 42vw);
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--cyan), var(--gold), var(--rose));
}

.brandBlock {
  display: grid;
  gap: 8px;
}

h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 6px 10px;
  color: #d8efe3;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 760;
}

h1 {
  color: #f7fbf5;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.02;
  font-weight: 820;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 780;
}

#inputPath {
  max-width: min(720px, 78vw);
  overflow: hidden;
  color: rgba(241, 248, 242, 0.72);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topActions {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.languageSwitch {
  display: grid;
  grid-template-columns: repeat(2, 48px);
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

button,
.download {
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 730;
  text-decoration: none;
  cursor: pointer;
}

button {
  min-height: 42px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 10px 28px rgba(23, 163, 107, 0.22);
}

button:hover {
  filter: brightness(0.96);
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.langButton {
  min-height: 32px;
  padding: 0;
  color: #d9e8df;
  background: transparent;
  box-shadow: none;
}

.langButton.active {
  color: #0e1915;
  background: #f6fbf5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0 18px;
}

.source {
  margin-bottom: 16px;
}

.sourceGrid {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 1fr;
  gap: 12px;
  padding: 16px;
}

.sourceFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 12px;
}

.sourceHint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.activeSource {
  padding: 0 16px 16px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 760;
}

button.secondary {
  min-height: 34px;
  padding: 0 12px;
  border-color: var(--line);
  background: #f8fbf7;
  color: var(--ink);
  box-shadow: none;
}

button.secondary:hover {
  background: #edf4ec;
}

.metric {
  position: relative;
  min-height: 118px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 247, 0.84));
  box-shadow: 0 12px 34px rgba(19, 31, 24, 0.08);
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent), var(--cyan), var(--gold));
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 790;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1;
}

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

.panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(19, 31, 24, 0.08);
  backdrop-filter: blur(18px);
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.68), rgba(237, 246, 238, 0.46));
}

.panelHeader span,
#statusText {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

tbody tr {
  transition: background 0.16s ease;
}

tbody tr:hover {
  background: rgba(23, 163, 107, 0.06);
}

td:first-child {
  width: 190px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.side {
  padding: 16px;
}

.side h2 {
  margin-bottom: 14px;
}

.download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin-bottom: 10px;
  padding: 0 12px;
  border-color: rgba(20, 35, 28, 0.09);
  color: var(--ink);
  background: #fbfdf9;
}

.download::after {
  content: attr(data-action-label);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.download:hover {
  border-color: rgba(23, 163, 107, 0.28);
  background: #f3faf2;
}

.download.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.targets,
.uploader {
  margin-top: 16px;
}

.uploader {
  padding-bottom: 16px;
}

.targetGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

.targetGrid article {
  position: relative;
  min-height: 178px;
  padding: 18px 16px;
  border-right: 1px solid var(--line);
}

.targetGrid article::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin-bottom: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

.targetGrid article:nth-child(2)::before {
  background: linear-gradient(90deg, var(--cyan), var(--gold));
}

.targetGrid article:nth-child(3)::before {
  background: linear-gradient(90deg, var(--gold), var(--rose));
}

.targetGrid article:nth-child(4)::before {
  background: linear-gradient(90deg, var(--rose), var(--accent));
}

.targetGrid article:last-child {
  border-right: 0;
}

.targetGrid h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.targetGrid p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.uploaderGrid {
  display: grid;
  grid-template-columns: 1.4fr 0.5fr 0.5fr;
  gap: 12px;
  padding: 16px;
}

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

.connectorFields.hidden {
  display: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 790;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(20, 35, 28, 0.14);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: #fbfdf9;
  font: inherit;
  text-transform: none;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(23, 163, 107, 0.52);
  box-shadow: 0 0 0 4px rgba(23, 163, 107, 0.13);
}

.checkboxLabel {
  align-content: end;
  grid-template-columns: auto 1fr;
  gap: 10px;
  min-height: 42px;
  color: var(--ink);
  text-transform: none;
}

.checkboxLabel input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  gap: 10px;
  padding: 0 16px 14px;
}

button.danger {
  background: linear-gradient(135deg, var(--danger), #6f211b);
  box-shadow: 0 10px 28px rgba(161, 61, 49, 0.20);
}

pre {
  min-height: 156px;
  max-height: 360px;
  margin: 0 16px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(20, 30, 25, 0.98), rgba(8, 13, 11, 0.98)),
    #101510;
  color: #e8f0e8;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .shell {
    width: min(100vw - 24px, 1180px);
    margin: 14px auto 28px;
  }

  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topActions {
    justify-items: stretch;
  }

  .languageSwitch {
    width: fit-content;
  }

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

  .sourceGrid,
  .uploaderGrid,
  .connectorFields {
    grid-template-columns: 1fr;
  }

  .sourceFooter {
    align-items: stretch;
    flex-direction: column;
  }

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

  .targetGrid article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

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

  th,
  td {
    padding: 11px 10px;
    font-size: 13px;
  }

  td:first-child {
    width: auto;
  }
}
