:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #647067;
  --line: #d9ded8;
  --panel: #ffffff;
  --soft: #f4f6f3;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #9a3412;
  --bad: #991b1b;
  --ok: #166534;
}

* {
  box-sizing: border-box;
}

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

body.locked {
  overflow: hidden;
}

body.locked > :not(.access-gate) {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

.access-gate {
  position: fixed;
  z-index: 100;
  display: grid;
  inset: 0;
  place-items: center;
  padding: 24px;
  background: rgba(18, 40, 35, 0.64);
  backdrop-filter: blur(10px);
}

.access-gate[hidden] {
  display: none;
}

.access-card {
  display: grid;
  width: min(430px, 100%);
  min-width: 0;
  overflow: hidden;
  gap: 14px;
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 26px 76px rgba(9, 30, 24, 0.3);
}

.access-card h2 {
  max-width: 100%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 6vw, 35px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.access-card > * {
  min-width: 0;
}

.access-card > p:not(.access-eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.access-mark {
  margin-bottom: 8px;
}

.access-eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.access-field {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 800;
}

.access-card input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid #bfcac3;
  border-radius: 8px;
  background: #fff;
}

.access-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
  outline: none;
}

.access-error {
  color: var(--bad);
  font-size: 13px;
  font-weight: 700;
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 310px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}

.brand {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid #abc3bb;
  border-radius: 8px;
  color: var(--accent-dark);
  background: #e9f3ef;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
  line-height: 1.25;
}

.brand p,
.topbar p,
.upload-zone p,
.metric span {
  color: var(--muted);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.nav-item.active {
  color: var(--ink);
  border-color: var(--line);
  background: var(--soft);
  font-weight: 700;
}

.run-card {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.run-state {
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e2e7e1;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 250ms ease;
}

.primary-action {
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.workspace {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

h2 {
  font-size: 24px;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.pill.ok {
  color: var(--ok);
  border-color: #bbdfc4;
  background: #f0f8f1;
}

.pill.warn {
  color: var(--warn);
  border-color: #fed7aa;
  background: #fff7ed;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 14px;
}

.upload-zone {
  position: relative;
  display: grid;
  min-height: 170px;
  align-content: center;
  gap: 10px;
  justify-items: center;
  border: 1px dashed #a7b2aa;
  border-radius: 8px;
  background: #fafbf9;
  text-align: center;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone.ready {
  border-style: solid;
  border-color: #7fb8ad;
  background: #f0f8f6;
}

.upload-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #e5ece8;
  color: var(--accent-dark);
  font-weight: 900;
}

.muted-panel {
  background: #f9faf8;
}

.field-block {
  display: grid;
  gap: 8px;
}

label,
.section-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.text-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.inline-control {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 8px;
}

.inline-control input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.inline-control button {
  height: 42px;
  border: 1px solid #9bc9c1;
  border-radius: 8px;
  color: var(--accent-dark);
  background: #eef8f5;
  font-weight: 800;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

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

.check-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}

.check-code {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--accent-dark);
  background: #e7f4f1;
  font-size: 12px;
  font-weight: 900;
}

.check-card strong {
  font-size: 14px;
}

.check-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.result-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.metric strong {
  font-size: 30px;
}

.artifact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.artifact-list [data-artifact] {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.artifact-list [data-artifact].ready {
  border-color: #8ac1b7;
  color: var(--accent-dark);
  font-weight: 800;
}

.upload-zone.compact {
  min-height: 150px;
}

.upload-zone small {
  color: var(--muted);
  font-size: 12px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  margin-top: 14px;
  padding: 0 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .grid-two,
  .grid-three,
  .settings-grid,
  .check-grid,
  .result-layout,
  .artifact-list {
    grid-template-columns: 1fr;
  }

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