:root {
  color-scheme: light;
  font-family: system-ui, "Leelawadee UI", "Segoe UI", sans-serif;
  color: #172033;
  background: #edf2f7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 280px;
  background: #edf2f7;
  color: #172033;
  font-size: 18px;
  line-height: 1.6;
}

.slip-upload-shell {
  width: min(620px, calc(100% - 32px));
  margin: 24px auto;
  padding: 26px;
  background: #fff;
  border: 1px solid #d5dee8;
  border-radius: 14px;
  box-shadow: 0 14px 42px rgba(23, 32, 51, .12);
}

.upload-header { margin-bottom: 18px; }
.brand-line {
  margin: 0 0 4px;
  color: #176b51;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .12em;
}

h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: clamp(2rem, 7vw, 2.65rem); }
h2 { font-size: clamp(1.55rem, 6vw, 2rem); }

.order-summary { margin: 8px 0 0; font-size: 1.05rem; font-weight: 650; }
.order-card {
  margin: 18px 0;
  padding: 18px;
  background: #f7fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}

label { display: block; margin: 14px 0; font-weight: 700; }
label:first-child { margin-top: 0; }
input, button { font: inherit; }
input[readonly], input[type="file"] {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  padding: 11px 12px;
  color: #172033;
  background: #fff;
  border: 1px solid #9eacba;
  border-radius: 8px;
}

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.file-picker-label { margin-bottom: 4px; font-size: 1.15rem; }
.file-picker-label span { display: block; color: #475569; font-size: .9rem; font-weight: 500; }
.file-details { margin: 8px 0; color: #334155; font-weight: 650; }
.form-note { margin: 10px 0 16px; color: #475569; }
.slip-preview {
  display: block;
  max-width: 100%;
  max-height: 360px;
  margin: 14px auto;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}
.slip-preview[hidden] { display: none; }

.consent {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 14px;
  background: #f0fdf7;
  border: 1px solid #9bd7c3;
  border-radius: 9px;
  font-weight: 600;
}
.consent input { width: 24px; height: 24px; flex: 0 0 auto; margin-top: 3px; }

.button {
  width: 100%;
  min-height: 56px;
  margin-top: 14px;
  padding: 13px 18px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 800;
}
.submit, .close-page { color: #fff; background: #176b51; box-shadow: 0 5px 14px rgba(23,107,81,.22); }
.button:disabled { cursor: not-allowed; opacity: .46; box-shadow: none; }
.button-secondary { color: #172033; background: #e2e8f0; box-shadow: none; }
.delete-slip { margin-top: 18px; min-height: 48px; font-size: .92rem; font-weight: 650; }
progress { width: 100%; height: 18px; margin-top: 14px; }

.result {
  min-height: 0;
  padding: 0;
  border-radius: 9px;
  white-space: pre-wrap;
  font-weight: 700;
}
.result:not(:empty) { margin: 14px 0; padding: 14px; background: #f1f5f9; }
.result.success { color: #115e46; background: #dff7ed; }
.result.error { color: #991b1b; background: #fee2e2; }
.result.manual { color: #78350f; background: #fef3c7; }

.manual-help { margin-top: 22px; padding-top: 6px; border-top: 1px solid #d8e0e8; }
.manual-help summary { cursor: pointer; font-weight: 750; }
.manual-help p { margin: 8px 0 0; }

.upload-success {
  margin-top: 18px;
  padding: 24px 20px;
  text-align: center;
  background: #e6f8ef;
  border: 2px solid #38a37b;
  border-radius: 12px;
}
.success-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  color: #fff;
  background: #176b51;
  border-radius: 50%;
  font-size: 40px;
  font-weight: 900;
  line-height: 64px;
}
.upload-success p { margin: 10px 0; }
.success-reference { font-size: .95rem; }
.return-note { font-size: 1.12rem; font-weight: 800; color: #115e46; }

footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid #d8e0e8; color: #475569; }
footer p { margin: 0 0 6px; }
footer a { color: #176b51; font-weight: 750; }

[hidden] { display: none !important; }

@media (max-width: 680px) {
  body { font-size: 18px; }
  .slip-upload-shell { width: 100%; min-height: 100vh; margin: 0; padding: 18px; border: 0; border-radius: 0; box-shadow: none; }
  .field-pair { grid-template-columns: 1fr; gap: 0; }
  .order-card { padding: 15px; }
  input[readonly], input[type="file"] { min-height: 56px; }
  .button { min-height: 60px; font-size: 1.05rem; }
}

@media (max-width: 380px) {
  .slip-upload-shell { padding: 14px; }
  body { font-size: 17px; }
}
