:root {
  color-scheme: light;
  --ink: #17231f;
  --muted: #61736d;
  --line: #dce6e1;
  --accent: #0a7a62;
  --accent-soft: #e8f5ef;
  --bg: #f7faf7;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(90deg, #eef7f0 0, #ffffff 48%, #f3eee7 100%);
}

main {
  min-height: 100vh;
  padding: 8px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.ghost {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.8);
  color: var(--ink);
  padding: 10px 18px;
}

.hidden {
  display: none !important;
}

.login {
  display: grid;
  place-items: center;
  min-height: 55vh;
}

.login form {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.88);
}

label span,
.env-title span {
  display: block;
  margin-bottom: 8px;
  color: #455650;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}

.login label + label {
  display: block;
  margin-top: 14px;
}

.login button {
  width: 100%;
  height: 44px;
  margin-top: 18px;
}

.message {
  min-height: 20px;
  color: #b42318;
}

.workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: calc(100vh - 110px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.76);
  overflow: hidden;
}

aside {
  padding: 20px 18px;
  border-right: 1px solid var(--line);
}

.env-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.target-list {
  display: grid;
  gap: 10px;
}

.target {
  width: 100%;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.target.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.target strong,
.target span,
.target em {
  display: block;
}

.target span,
.target em,
.target-summary span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.uploader {
  padding: 20px 18px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 480px) minmax(180px, 1fr);
  align-items: end;
  gap: 24px;
  margin-bottom: 14px;
}

.target-summary {
  text-align: right;
}

.target-summary strong,
.target-summary span {
  display: block;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 356px;
  border: 2px dashed #9ab5aa;
  border-radius: 8px;
  background: rgba(255,255,255,.62);
  text-align: center;
  cursor: pointer;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone input {
  display: none;
}

.drop-zone strong {
  font-size: 22px;
}

.drop-zone span {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.progress,
.result {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.result code,
.result a {
  overflow-wrap: anywhere;
}

.result code {
  color: #455650;
}

.result a {
  color: var(--accent);
}

@media (max-width: 760px) {
  main {
    padding: 10px;
  }

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

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

  .target-summary {
    text-align: left;
  }

  .drop-zone {
    min-height: 260px;
  }
}
