:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  color: #18332e;
  background: #f3f5f0;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: #205b4b;
  text-underline-offset: 3px;
}
header {
  padding: 24px max(24px, calc((100vw - 1180px) / 2));
  background: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #dce3dc;
}
header > a {
  margin-left: auto;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.mark {
  width: 48px;
  height: 48px;
  background: #205b4b;
  color: #fff;
  border-radius: 14px;
  font-weight: 750;
  display: grid;
  place-content: center;
  font-size: 24px;
  position: relative;
}
.mark span {
  position: absolute;
  right: 4px;
  top: 0;
  font-size: 16px;
}
h1 {
  font-size: 22px;
  line-height: 1.2;
  margin: 4px 0;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.15em;
  font-weight: 750;
  color: #688176;
  margin: 0 0 8px;
}
main {
  max-width: 1180px;
  margin: auto;
  padding: 40px 24px;
}
h2 {
  font-size: 42px;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 12px 0 18px;
  font-weight: 650;
}
h3 {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0;
}
p {
  font-size: 14px;
  line-height: 1.65;
  color: #617269;
  max-width: 720px;
}
p code {
  font-size: 12px;
}
.intro {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 70px;
  align-items: center;
  margin: 10px 0 36px;
}
.flow {
  background: #e4ece1;
  border: 1px solid #d1ddce;
  padding: 22px 26px;
  border-radius: 18px;
  display: grid;
  gap: 12px;
  font-size: 14px;
}
.flow span {
  background: #fff;
  padding: 14px;
  border-radius: 8px;
}
.flow b {
  font-size: 11px;
  color: #688176;
  font-weight: 550;
  padding-left: 16px;
}
.panel {
  background: white;
  border: 1px solid #dce3dc;
  border-radius: 18px;
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px #19362d04;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.badge {
  background: #edf3eb;
  border: 1px solid #dce7d8;
  color: #466a55;
  padding: 7px 10px;
  font-size: 11px;
  border-radius: 20px;
  white-space: nowrap;
}
.setup {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 15px;
  background: #f6f8f4;
  border-radius: 10px;
  margin: 18px 0;
}
.setup div {
  font-size: 12px;
  color: #6b7e72;
}
.setup strong {
  display: block;
  font-size: 13px;
  color: #234b3d;
  margin-top: 4px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
form {
  display: flex;
  gap: 14px;
  align-items: end;
  margin: 14px 0;
}
label {
  display: block;
  font-size: 12px;
  color: #506c5d;
  font-weight: 550;
}
input,
select,
textarea {
  font: inherit;
  border: 1px solid #cdd8ce;
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
  color: #193c2e;
  width: 100%;
  margin-top: 6px;
  min-width: 0;
}
input:focus,
select:focus {
  outline: 2px solid #8dbda1;
  outline-offset: 1px;
}
button,
.button {
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid #205b4b;
  background: #205b4b;
  color: #fff;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.button:hover {
  filter: brightness(0.95);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.secondary,
.button.secondary {
  background: #fff;
  color: #315b46;
  border-color: #cdd8ce;
}
.checkbox {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-bottom: 10px;
  white-space: nowrap;
  font-size: 12px;
}
.checkbox input {
  width: auto;
  margin: 0;
}
.grow {
  flex: 1;
  min-width: 220px;
}
.muted {
  font-size: 12px;
  color: #728478;
  line-height: 1.8;
}
.product {
  border-top: 1px solid #e7ece5;
  padding-top: 18px;
  margin-top: 24px;
}
.product-head {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}
.product-head form {
  margin: 0;
  flex: 1;
}
.product-head input[type='text'] {
  min-width: 150px;
}
.product-head .badge {
  margin-left: auto;
}
.variant {
  background: #f7f9f5;
  border: 1px solid #e2e9df;
  border-radius: 10px;
  padding: 16px;
  margin: 10px 0;
}
.variant-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 650;
}
.variant-head small {
  font-size: 11px;
  color: #708373;
  font-weight: 400;
}
.fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 15px;
}
.field form {
  gap: 6px;
  margin: 5px 0;
  align-items: end;
}
.field button {
  padding: 10px;
  font-size: 11px;
}
.field input {
  font-size: 13px;
}
.field select {
  margin-top: 0;
}
.field .secondary {
  padding: 8px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e4eae1;
}
.primary {
  margin-left: auto;
  background: #b4d77d;
  border-color: #b4d77d;
  color: #264328;
}
.metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.metric {
  padding: 12px 18px;
  background: #f5f8f2;
  border-radius: 10px;
  min-width: 120px;
}
.metric strong {
  display: block;
  font-size: 26px;
  font-weight: 550;
}
.metric span {
  font-size: 11px;
  color: #6c7e6e;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  min-width: 700px;
}
th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #738575;
  padding: 12px 8px;
  border-bottom: 1px solid #dbe5d7;
}
td {
  padding: 12px 8px;
  border-bottom: 1px solid #edf1e9;
}
td small {
  display: block;
  color: #7c8c7e;
  font-size: 10px;
  margin-top: 4px;
}
.status {
  display: inline-block;
  font-size: 10px;
  border-radius: 5px;
  padding: 5px 7px;
  background: #eef2ea;
  color: #697e60;
}
.status.applied {
  background: #e0f1e6;
  color: #236643;
}
.status.blocked,
.status.failed {
  background: #fff0dc;
  color: #906129;
}
details {
  margin-top: 20px;
  font-size: 12px;
  color: #6c8071;
  cursor: pointer;
}
pre {
  background: #122f27;
  color: #d0e7ce;
  border-radius: 10px;
  padding: 20px;
  max-height: 360px;
  overflow: auto;
  cursor: text;
  font-size: 11px;
  line-height: 1.6;
}
footer {
  padding: 4px 8px;
  font-size: 12px;
  color: #6f8272;
}
footer p {
  font-size: 11px;
  margin-top: 8px;
}
#notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #173e30;
  color: #fff;
  max-width: calc(100vw - 32px);
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 32px #142d3333;
  z-index: 3;
}
#notice.error {
  background: #883d32;
}
@media (max-width: 760px) {
  header {
    padding: 16px;
    gap: 10px;
  }
  header > a {
    font-size: 11px;
  }
  h1 {
    font-size: 18px;
  }
  .eyebrow {
    font-size: 9px;
  }
  main {
    padding: 24px 14px;
  }
  .intro {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
  }
  h2 {
    font-size: 34px;
  }
  .flow {
    display: none;
  }
  .panel {
    padding: 20px 16px;
  }
  h3 {
    font-size: 19px;
  }
  .section-head {
    align-items: start;
  }
  .badge {
    font-size: 10px;
  }
  form {
    flex-wrap: wrap;
    align-items: end;
  }
  .grow {
    min-width: 100%;
  }
  .checkbox {
    padding: 6px 0;
  }
  .product-head {
    flex-wrap: wrap;
  }
  .product-head form {
    flex-wrap: wrap;
  }
  .fields {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .product-head .badge {
    margin-left: 0;
  }
  .toolbar > * {
    flex: 1;
    text-align: center;
  }
  .primary {
    margin-left: 0;
  }
  .metric {
    flex: 1;
    min-width: 90px;
    padding: 10px 12px;
  }
  .metric strong {
    font-size: 22px;
  }
}

.overrides {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 760px) {
  .overrides {
    grid-template-columns: 1fr;
  }
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.create-panel {
  background: #f6f9f3;
  border: 1px solid #d5e1ce;
  border-radius: 12px;
  padding: 22px;
  margin: 22px 0;
}
.create-panel h4 {
  margin: 0;
  font-size: 17px;
}
.create-panel h5 {
  margin: 2px 0 10px;
  font-size: 12px;
  color: #506c5d;
}
#add-product-form {
  display: block;
  margin-bottom: 0;
}
.create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.create-grid label {
  min-width: 0;
}
.create-wide {
  grid-column: 1 / -1;
}
.create-stock {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
textarea {
  resize: vertical;
}
@media (max-width: 760px) {
  .section-actions {
    align-items: flex-end;
    gap: 8px;
  }
  .create-panel {
    padding: 18px 14px;
  }
  .create-grid,
  .create-stock {
    grid-template-columns: 1fr;
  }
  .create-actions {
    flex-wrap: wrap;
  }
  .create-actions button {
    flex: 1;
  }
}

.login {
  max-width: 540px;
  margin: 10vh auto;
  padding: 16px;
}
.login form {
  display: grid;
  gap: 16px;
}
#source-form fieldset {
  border: 0;
  padding: 0;
}
#login-error {
  color: #a22;
}
