:root {
  color-scheme: light;
  --ink: #1f2a2e;
  --muted: #66737c;
  --line: #d9e1e4;
  --panel: #ffffff;
  --field: #f6f8f8;
  --green: #0b8f54;
  --lime: #01A452;
  --focus: #1769aa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef3f1;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.workspace {
  width: min(980px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(26, 44, 48, 0.12);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  border-top: 4px solid var(--lime);
  border-bottom: 1px solid var(--line);
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 750;
}

.topbar p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.status-pill {
  border: 1px solid #bcd7c9;
  color: var(--green);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  min-height: 420px;
}

.upload-panel,
.settings-panel {
  padding: 28px;
}

.upload-panel {
  border-right: 1px solid var(--line);
}

.dropzone {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  min-height: 300px;
  border: 1.5px dashed #9cb8ad;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdfc, #f3f7f5);
  text-align: center;
  padding: 28px;
}

.drop-title {
  display: block;
  font-size: 30px;
  font-weight: 780;
}

.file-picker {
  width: min(360px, 100%);
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.drop-detail {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.template-row,
.field-row,
.range-grid label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.template-row {
  margin-top: 16px;
}

.template-row summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.template-row label {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

input[type="file"],
select,
input[type="number"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.segmented legend {
  grid-column: 1 / -1;
  padding: 0 4px 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented label {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented label:has(input:checked) {
  background: #ffffff;
  color: var(--green);
  box-shadow: 0 1px 4px rgba(15, 42, 36, 0.12);
}

.range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-button {
  min-height: 46px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button-icon {
  display: inline-block;
  margin-right: 8px;
  font-weight: 900;
}

.primary-button[disabled] {
  cursor: wait;
  opacity: 0.72;
}

@media (max-width: 760px) {
  .shell {
    padding: 12px;
    place-items: stretch;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

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

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

  .upload-panel,
  .settings-panel {
    padding: 20px;
  }

  .dropzone {
    min-height: 220px;
  }
}
