:root {
  /* sampled directly from static/img/logo.jpg, so the platform stays uniform with the brand mark */
  --brand-blue: #124d93;
  --brand-blue-deep: #0d3a6e;
  --brand-blue-dark: #0a2a51;
  --brand-blue-mid: #1a5aa8;
  --brand-blue-100: #e3eaf2;
  --brand-blue-050: #f3f6fa;
  --gold: #b09a73;
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #101c30;
  --muted: #5c6c85;
  --line: #dbe3ef;
  --ok: #1f9d6b;
  --ok-bg: #e6f5ee;
  --amber: #a86a06;
  --amber-bg: #fdf3e0;
  --amber-line: #f0deb0;
  --danger: #c13a4a;
  --danger-bg: #fbeaec;
  --mono: ui-monospace, "SFMono-Regular", "Consolas", "Roboto Mono", monospace;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 2px 6px rgba(11,30,57,.06), 0 10px 30px rgba(11,30,57,.09);
  --header-h: 50px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

header {
  background: var(--brand-blue);
  color: #fff;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 4px 16px rgba(6,15,31,.25);
}
/* In-content back navigation: sits right next to what the user is reading,
   rather than in a fixed header corner. */
.backLink {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  background: none; border: none; color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 10px 8px; margin: -10px 0 6px -8px; border-radius: 8px; cursor: pointer;
}
.backLink:hover, .backLink:active { color: var(--brand-blue); background: var(--brand-blue-050); }
.brand { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.brandMark { color: #fff; flex: none; display: flex; }
header .title {
  font-size: 14.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
header .who { font-size: 12px; color: #a9bede; text-align: right; flex: none; }

main {
  max-width: 660px; margin: 0 auto; padding: 16px; padding-bottom: 60px;
  min-height: calc(100vh - var(--header-h));
  display: flex; flex-direction: column;
  justify-content: center; justify-content: safe center;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.orderBar {
  position: sticky; top: 49px; z-index: 4; background: var(--card); border: 1px solid var(--line);
  margin: 0 0 14px; padding: 12px 16px; font-size: 16px; font-weight: 700; font-family: var(--mono);
  letter-spacing: .01em; border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
h2 { font-size: 17px; margin-bottom: 12px; letter-spacing: -.01em; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; text-transform: uppercase; letter-spacing: .03em; }
input[type=text], input[type=password], select {
  width: 100%; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--brand-blue-050); color: var(--ink); transition: border-color .15s, background .15s;
}
input::placeholder { color: #92a1b8; }
input:focus, select:focus { outline: none; border-color: var(--brand-blue); background: #fff; box-shadow: 0 0 0 3px rgba(18,77,147,.15); }

button.primary {
  width: 100%; margin-top: 16px; padding: 16px; font-size: 16px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, var(--brand-blue), var(--brand-blue-deep));
  border: 1px solid var(--brand-blue-deep); border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 14px rgba(18,77,147,.24);
}
button.primary:disabled { opacity: .55; box-shadow: none; }
button.ghost {
  width: 100%; margin-top: 10px; padding: 12px; font-size: 14.5px; font-weight: 600; color: var(--brand-blue);
  background: none; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
button.ghost:active { background: var(--brand-blue-050); }
button.ghost:disabled { opacity: .4; }
.error { color: var(--danger); font-size: 13.5px; margin-top: 10px; min-height: 18px; font-weight: 500; }
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; line-height: 1.45; }
.caption { font-size: 12.5px; color: var(--muted); }

/* advisory / informational banners (replace emoji-prefixed text) */
.tip, .note {
  display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.4;
  border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0;
}
.tip { background: var(--amber-bg); border: 1px solid var(--amber-line); color: #6b5410; }
.tip svg { color: var(--amber); flex: none; margin-top: 1px; }
.note { background: var(--brand-blue-100); border: 1px solid #c7d9ec; color: var(--brand-blue-deep); font-weight: 600; }
.note svg { color: var(--brand-blue); flex: none; margin-top: 1px; }

/* auth screen */
.authWrap { display: flex; justify-content: center; }
.authCard {
  width: 100%; max-width: 480px; background: var(--card); border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.authHead {
  position: relative; background: radial-gradient(120% 140% at 15% 0%, var(--brand-blue-mid), var(--brand-blue-dark));
  color: #fff; padding: 30px 24px 24px; overflow: hidden;
}
.authHead .orbitDecor { position: absolute; top: -40px; right: -50px; width: 220px; height: 220px; color: rgba(120,170,235,.22); }
.authMark {
  width: 42px; height: 42px; border-radius: 11px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center;
  color: #bcd7f7; margin-bottom: 14px; position: relative;
}
.authHead h2 { font-size: 20px; margin-bottom: 6px; position: relative; }
.authHead p { font-size: 13px; color: #b7cbea; line-height: 1.5; position: relative; margin: 0; }
.authBody { padding: 22px 24px 26px; }
.authBody label:first-child { margin-top: 0; }

/* serial list */
.target { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 9px; background: #fff; cursor: pointer; }
.target .ring { width: 44px; height: 44px; flex: none; }
.target .info { flex: 1; min-width: 0; }
.target .serial { font-size: 15.5px; font-weight: 700; font-family: var(--mono); }
.target .serial.plain { font-family: inherit; }
.target .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target .status { font-size: 11.5px; font-weight: 600; color: var(--brand-blue); text-transform: uppercase; letter-spacing: .02em; }
.target.complete .status { color: var(--ok); }
.target .chev { color: #a9b7cc; flex: none; display: flex; }
.groupTitle { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 16px 2px 8px; text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.groupTitle svg { color: var(--brand-blue); }
.groupTitle.sub { margin: 14px 2px 8px 10px; }
.groupTitle.accent { color: var(--brand-blue-deep); }
.orderSection {
  font-size: 15px; font-weight: 700; color: var(--brand-blue-deep); text-transform: none; letter-spacing: normal;
  margin: 20px 2px 6px; border-bottom: 2px solid var(--brand-blue); padding-bottom: 4px;
}

/* home action tiles */
.actionTile {
  width: 100%; display: flex; align-items: center; gap: 13px; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px;
  margin-top: 12px;
}
.actionTile:first-of-type { margin-top: 14px; }
.actionIcon {
  width: 42px; height: 42px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--brand-blue-100); color: var(--brand-blue);
}
.actionTile.alt .actionIcon { background: var(--brand-blue-dark); color: #cfe0f2; }
.actionText { flex: 1; min-width: 0; }
.actionTitle { display: block; font-size: 15px; font-weight: 700; }
.actionSub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.actionTile .chev { color: #a9b7cc; flex: none; }

/* wizard */
.viewHead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.viewHead .titleText { font-size: 17px; font-weight: 700; }
.viewHead .step { font-size: 13px; color: var(--muted); font-weight: 600; font-family: var(--mono); }
.viewLabel { font-size: 23px; font-weight: 700; margin-bottom: 10px; letter-spacing: -.01em; }
.cubeWrap { display: flex; justify-content: center; margin: 8px 0; }
.previewWrap { margin-top: 10px; }
.previewWrap img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.dots { display: flex; gap: 7px; justify-content: center; margin: 14px 0 6px; flex-wrap: wrap; }
.dots span { width: 13px; height: 13px; border-radius: 50%; background: #d7dfeb; }
.dots span.done { background: var(--ok); }
.dots span.cur { background: var(--brand-blue); outline: 2.5px solid var(--brand-blue-100); }
.rowBtns { display: flex; gap: 10px; margin-top: 12px; }
.rowBtns button { flex: 1; margin-top: 0; padding: 15px; font-size: 15px; }
.uploadState { text-align: center; font-size: 13px; margin-top: 10px; min-height: 18px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.uploadState.ok { color: var(--ok); font-weight: 600; }
.uploadState.err { color: var(--danger); font-weight: 600; }
.productChip { display: inline-block; font-size: 12.5px; background: var(--brand-blue-100); color: var(--brand-blue-deep); border-radius: 20px; padding: 4px 12px; margin: 2px 4px 2px 0; border: 1.5px solid transparent; }
.productChip.sel { border-color: var(--brand-blue); background: #d8e8f9; font-weight: 600; }
.reviewGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.reviewItem { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; background: #fff; }
.reviewItem img { width: 100%; height: 110px; object-fit: cover; border-radius: 7px; }
.thumbBox { width: 100%; height: 110px; border-radius: 7px; background: var(--brand-blue-050); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 12px; }
.thumbBox.saved { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.thumbBox.missing { background: var(--danger-bg); color: var(--danger); }
.reviewItem .vlabel { font-size: 12.5px; font-weight: 600; margin-top: 6px; min-height: 32px; }
.reviewItem button {
  width: 100%; margin-top: 6px; padding: 8px; font-size: 12.5px; border-radius: 7px; border: 1.5px solid var(--brand-blue);
  color: var(--brand-blue); background: none; display: flex; align-items: center; justify-content: center; gap: 5px;
}
.doneBanner { text-align: center; padding: 28px 10px; }
.doneBadge {
  width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px; background: var(--ok-bg); color: var(--ok);
}
.doneBadge.warn { background: var(--amber-bg); color: var(--amber); }
.doneBanner h2 { margin-top: 10px; }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2.5px solid #cfd9e6; border-top-color: var(--brand-blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

button { cursor: pointer; font-family: inherit; }
.targetGroup { display: grid; grid-template-columns: 1fr; gap: 9px; margin-bottom: 4px; }
.targetGroup .target { margin-bottom: 0; }

/* Tablet / laptop layout */
@media (min-width: 700px) {
  main { max-width: 1040px; padding: 48px 32px 72px; }
  .narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
  .card { padding: 36px 44px; border-radius: 18px; }
  .backLink { font-size: 14.5px; padding: 10px; margin: -10px 0 8px -10px; }
  .orderBar { padding: 16px 20px; font-size: 18px; }
  h2 { font-size: 20px; }
  .hint { font-size: 14px; }
  label { font-size: 13px; }
  input[type=text], input[type=password], select { padding: 14px 16px; font-size: 16.5px; }
  button.primary { padding: 16px; font-size: 16px; }
  button.ghost { padding: 14px; font-size: 15px; }
  .authCard { max-width: 560px; }
  .authHead { padding: 40px 36px 32px; }
  .authHead h2 { font-size: 24px; }
  .authHead p { font-size: 14.5px; }
  .authBody { padding: 32px 36px 36px; }
  .actionTile { padding: 20px 22px; gap: 16px; }
  .actionIcon { width: 50px; height: 50px; border-radius: 13px; }
  .actionTitle { font-size: 16.5px; }
  .actionSub { font-size: 13.5px; }
  .target { padding: 16px 18px; }
  .target .ring { width: 48px; height: 48px; }
  .target .serial { font-size: 16.5px; }
  .targetGroup { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
  .reviewGrid { grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 14px; }
  .reviewItem img, .thumbBox { height: 170px; }
  .viewLabel { font-size: 27px; margin-bottom: 12px; }
  .viewHead .titleText { font-size: 19px; }
  .viewHead .step { font-size: 14px; }
  .dots span { width: 14px; height: 14px; }
  .rowBtns button { padding: 16px; font-size: 15px; }
  .target { transition: border-color .12s, box-shadow .12s; }
  .target:hover { border-color: var(--brand-blue); box-shadow: 0 2px 8px rgba(18,77,147,.16); }
  .actionTile { transition: border-color .12s, box-shadow .12s; }
  .actionTile:hover { border-color: var(--brand-blue); box-shadow: 0 2px 8px rgba(18,77,147,.16); }
  button.primary:hover:not(:disabled) { filter: brightness(1.05); }
  button.ghost:hover { background: var(--brand-blue-050); }
  .groupTitle { font-size: 13px; }
  header .title { font-size: 15px; }
}
