:root {
  color-scheme: light;
  --ink: #162f43;
  --quiet: #4f6273;
  --line: #cedbe5;
  --blue: #0a608c;
  --page: #eef4f8;
  --paper: #fff;
  --accent: #1c658e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 system-ui, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
button, input, select { font: inherit; }
button, input, select, summary { touch-action: manipulation; }
button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  min-height: 46px;
  padding: 9px 14px;
  font-weight: 700;
}
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #e59221;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.hero {
  color: #fff;
  background: radial-gradient(ellipse at 95% 10%, #286580, transparent 60%), #123953;
  border-bottom: 5px solid #79cbcf;
  padding: 0 20px;
}
.header-inner { max-width: 780px; margin: auto; padding: 23px 0 25px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 14px; letter-spacing: .08em; }
.brand img {
  display: block;
  width: 94px;
  height: 31px;
  object-fit: cover;
  object-position: center;
  background: white;
  border-radius: 5px;
}
.hero h1 { margin: 17px 0 3px; font-size: clamp(25px, 6vw, 35px); letter-spacing: .035em; }
.hero p { margin: 0; color: #e0f1f6; }
main { max-width: 820px; margin: 0 auto; padding: 14px 16px 42px; }
.identity {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--quiet);
  min-height: 46px;
  margin-bottom: 12px;
  font-size: 14px;
}
#role { margin-left: 8px; font-size: 13px; }
details { position: relative; flex-shrink: 0; }
summary { cursor: pointer; }
.account-info {
  position: absolute;
  z-index: 2;
  right: 0;
  top: 30px;
  width: min(300px, 85vw);
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 10px 30px #12395324;
}
.account-info p { overflow-wrap: anywhere; margin: 8px 0; }
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: start;
  text-align: left;
  min-width: 0;
  padding: 12px 10px;
  background: #fff;
  gap: 5px;
  --tile: #e7f2ff;
  --tone: #105e91;
}
.step[data-mode="ship"] { --tile: #fff1df; --tone: #94500d; }
.step[data-mode="supplier"] { --tile: #f1eafb; --tone: #604295; }
.step[data-mode="inbound"] { --tile: #dff3ee; --tone: #146951; }
.step[aria-pressed="true"] {
  background: var(--tile);
  border-color: var(--tone);
  box-shadow: inset 0 -3px var(--tone);
}
.step span:last-child { font-size: 13px; font-weight: 500; color: var(--quiet); }
.step-mark {
  background: var(--tile);
  color: var(--tone);
  display: grid;
  place-items: center;
  border-radius: 9px;
  width: 30px;
  height: 30px;
  font-size: 21px;
  line-height: 1;
}
.workflow, .results {
  background: white;
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 15px;
}
.workflow { border-top: 4px solid var(--accent); }
h2 { font-size: 22px; margin: 0 0 5px; }
#modeHelp { margin: 0 0 15px; color: var(--quiet); }
.scan {
  display: flex;
  align-items: center;
  text-align: left;
  justify-content: center;
  gap: 17px;
  width: 100%;
  min-height: 74px;
  border: 1.5px dashed #377799;
  background: #ecf6fc;
  color: #124f72;
  margin-bottom: 16px;
}
.scan small { display: block; font-weight: 500; color: var(--quiet); }
.scan-mark {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 7px;
  display: grid;
  place-items: center;
}
.scan-mark i { height: 2px; width: 18px; background: currentColor; }
label { display: block; font-weight: 700; margin: 0 0 6px; }
input:not([type=checkbox]), select {
  min-height: 50px;
  width: 100%;
  min-width: 0;
  border-radius: 9px;
  border: 1px solid #9bb1c1;
  padding: 9px 11px;
  color: var(--ink);
  background: white;
}
#palletId { font-family: ui-monospace, monospace; }
.id-field { display: flex; gap: 8px; }
.id-field button { flex: 0 0 auto; }
#supplierField { margin-top: 13px; }
.primary { background: var(--accent); border: 1px solid var(--accent); color: white; }
#review { width: 100%; margin-top: 16px; min-height: 49px; }
.notice { margin: 12px 0 0; border-radius: 9px; padding: 10px 12px; background: #ebf4f8; }
.notice[data-kind="error"] { background: #ffedeb; color: #8b2724; }
.notice[data-kind="success"] { background: #def4e9; color: #145839; }
.results { margin-top: 15px; }
dl {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: minmax(6ch, auto) minmax(0, 1fr);
  gap: 5px 12px;
}
dt { color: var(--quiet); }
dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }
h3 { font-size: 17px; margin: 16px 0 7px; }
ol { list-style: none; padding: 0; margin: 0; }
li { border-top: 1px solid var(--line); padding: 9px 0; }
li p { margin: 2px 0 0; font-size: 14px; color: var(--quiet); overflow-wrap: anywhere; }
dialog {
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  width: min(90vw, 480px);
  padding: 18px;
}
dialog::backdrop { background: #12314988; }
.dialog-buttons { display: flex; justify-content: space-between; gap: 8px; margin-top: 15px; }
.exception { margin-top: 13px; background: #fff4de; border-radius: 9px; padding: 11px; }
.exception p { margin: 4px 0; }
.exception label { display: flex; gap: 8px; align-items: start; margin: 8px 0 0; }
.exception input { width: 19px; height: 19px; flex: 0 0 auto; accent-color: var(--blue); }
@media (max-width: 530px) {
  .steps { grid-template-columns: 1fr 1fr; gap: 8px; }
  .step { padding: 9px 11px; display: grid; column-gap: 8px; row-gap: 2px; grid-template-columns: 30px 1fr; }
  .step-mark { grid-row: span 2; align-self: center; }
  .step span:last-child { grid-column: 2; }
  .workflow, .results { padding: 14px; }
}
