.page.ref-order-screen {
  display: block;
  min-height: calc(100svh - 44px - env(safe-area-inset-top));
  padding: 0 0 28px;
  color: #303030;
  background: #f3f3f3;
}

#app:has(.ref-order-screen) > .topbar.subpage {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: calc(44px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 45px 0;
  border: 0;
  background: #fff;
  color: #191919;
}

#app:has(.ref-order-screen) > .topbar.subpage strong { font-size: 18px; }
#app:has(.ref-order-screen) > .topbar.subpage .back { position: absolute; inset-inline-start: 0; margin: 0; }

.ref-order-settlement .ref-settlement-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #fff;
  color: #616161;
  text-align: center;
}

.ref-settlement-tabs a { min-height: 36px; display: grid; place-items: stretch center; }
.ref-settlement-tabs span { min-width: 97px; padding-top: 7px; border-bottom: 2px solid transparent; }
.ref-settlement-tabs a[aria-current='page'] span { border-color: #4899c5; color: #358ab8; }

.ref-settlement-products {
  min-height: 203px;
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  gap: 12px;
  background: #fff;
  padding: 16px;
  margin-block: 12px;
}

.ref-settlement-item { display: grid; gap: 5px; flex: 0 0 98px; min-width: 0; }
.ref-settlement-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; margin-bottom: 2px; }
.ref-settlement-item span { font-size: 13px; overflow-wrap: anywhere; }
.ref-settlement-item strong { font-size: 16px; font-weight: 500; color: #d94d53; }
.ref-settlement-products > p, .ref-settlement-lines > p { margin: auto; color: #666; text-align: center; }
.ref-settlement-lines { display: grid; gap: 7px; margin-bottom: 65px; }
.ref-settlement-lines > p { padding: 12px; }

.ref-payment-card { background: #fff; padding: 6px 16px 9px; min-width: 0; }
.ref-payment-row {
  min-height: 31px;
  display: grid;
  grid-template-columns: minmax(78px, 1fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 5px;
}

.ref-payment-row > span { color: #666; }
.ref-payment-row > div { min-width: 0; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.ref-payment-row:last-of-type > div { font-size: 13px; }
.ref-payment-proof { min-height: 46px; padding-block: 4px; }
.ref-payment-proof:has(.ref-proof-preview) { min-height: 73px; }
.ref-proof-preview { display: block; margin-inline-start: auto; border: 0; padding: 0; background: none; }
.ref-proof-preview .protected-image { width: 49px; height: 65px; border: 1px solid #eee; border-radius: 1px; object-fit: contain; }
.ref-full-proof { max-height: 65svh; max-width: 100%; object-fit: contain; margin-inline: auto; }

.ref-payment-action, .ref-payment-state {
  display: inline-flex;
  justify-content: center;
  min-height: 24px;
  min-width: 68px;
  padding: 3px 9px;
  border: 0;
  border-radius: 5px;
  align-items: center;
  font-size: 13px;
  line-height: 1.3;
  color: #fff;
  background: #cecece;
}

.ref-payment-state { color: #414141; }
.ref-payment-action { background: #488d73; }
.ref-payment-action:hover { background: #39785e; }
.ref-payment-action:disabled { opacity: .65; }
.ref-payment-note { margin-top: 8px; color: #a1252e; font-size: 13px; overflow-wrap: anywhere; }
.ref-payment-deadline { margin-top: 6px; color: #676767; font-size: 13px; }
.ref-payment-deadline summary { cursor: pointer; }
.ref-payment-upload { margin-top: 10px; border-top: 1px solid #eee; padding-top: 12px; font-size: 13px; }
.ref-payment-upload p { margin-bottom: 4px; }
.ref-payment-upload .compact-form { margin-top: 8px; }
.ref-payment-upload .ref-payment-action { min-height: 36px; }

.ref-settlement-result,
.ref-order-actions {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, var(--ref-app-width, 520px));
  background: #fff;
  border-top: 1px solid #ededed;
}

.ref-settlement-result {
  min-height: calc(57px + env(safe-area-inset-bottom));
  padding: 8px 15px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 8px;
}

.ref-settlement-result span { font-size: 13px; }
.ref-settlement-result strong { color: #d94d53; font-size: 16px; font-weight: 500; white-space: nowrap; }

.page.ref-order-records { background: #f3f3fc; padding: 11px 10px 24px; }
.ref-order-records .ref-payment-card { margin-bottom: 11px; padding-inline: 11px; border-radius: 6px; }
.ref-order-records .ref-payment-row { min-height: 39px; border-bottom: 1px solid #f0f0f0; }
.ref-order-records .ref-payment-row:last-of-type { border-bottom: 0; }
.ref-order-records .ref-payment-proof { min-height: 76px; }
.ref-order-records .ref-payment-state, .ref-order-records .ref-payment-action { min-width: 100px; }
.ref-order-records .ref-payment-row:nth-of-type(n + 5) > div { font-size: 13px; }

#app:has(.ref-order-book, .ref-order-detail) > .topbar.subpage {
  min-height: calc(58px + env(safe-area-inset-top));
  background: #f5f3ed;
  color: #203b34;
}

.page.ref-order-book, .page.ref-order-detail {
  --jade: #17483c;
  --sage: #e9eee8;
  --muted: #63736b;
  min-height: calc(100svh - 58px - env(safe-area-inset-top));
  padding: 6px 20px 34px;
  background: #f5f3ed;
  color: #203b34;
}

.ref-order-tabs { display: flex; align-items: center; justify-content: space-between; gap: 1px; }
.ref-order-tabs a { min-height: 36px; display: inline-grid; place-items: center; padding: 4px clamp(6px, 2vw, 13px); border-radius: 30px; color: #566960; font-size: 13px; white-space: nowrap; }
.ref-order-tabs a[aria-current='page'] { background: #17483c; color: #fff; font-weight: 700; }
.ref-order-group { margin-top: 15px; }
.ref-order-group > header { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; margin-bottom: 10px; }
.ref-order-group > header h2 { font-size: 18px; }
.ref-order-group > header > span { color: #63736b; font-size: 12px; white-space: nowrap; }
.ref-order-card { margin-bottom: 9px; padding: 10px 14px; border-radius: 14px; background: #fff; }
.ref-order-card header, .ref-order-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  color: #566960;
  font-size: 12px;
}

.ref-order-card header span, .ref-order-info .value-row strong { overflow-wrap: anywhere; }
.ref-order-card header strong { flex: none; min-width: 70px; padding: 4px 10px; border-radius: 30px; color: #17483c; background: #e9eee8; text-align: center; font-size: 11px; }
.ref-order-card header strong.ref-order-pending { background: #f5edda; color: #785123; }
.ref-order-item { display: grid; grid-template-columns: 65px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding-block: 10px; }
.ref-order-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.ref-order-item h3 { font-size: 15px; margin: 3px 0 5px; overflow-wrap: anywhere; }
.ref-order-item span { color: #63736b; font-size: 12px; }
.ref-order-item > strong { align-self: end; padding-bottom: 4px; color: #8b6b37; font-size: 15px; font-weight: 650; white-space: nowrap; }
.ref-order-card footer { border-top: 1px solid #e3e8df; padding-top: 8px; }
.ref-order-link { display: inline-grid; place-items: center; min-height: 32px; padding: 4px 13px; border: 1px solid #b6caba; border-radius: 8px; background: #fff; white-space: nowrap; font-size: 12px; font-weight: 700; color: #17483c; }
.ref-order-primary { background: #17483c; border-color: #17483c; color: #fff; }
.ref-order-primary:disabled { background: #74877e; border-color: #74877e; }
.ref-order-empty { padding-top: 96px; }
.ref-order-empty > .empty { border: 0; background: transparent; }

.page.ref-order-detail {
  --serif: 'Noto Serif SC', 'Songti SC', SimSun, serif;
  padding-bottom: 95px;
}
.ref-order-detail-state { display: flex; gap: 14px; align-items: flex-start; margin: 15px 0 24px; }
.ref-order-detail-state > div:first-child { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e8eee7; }
.ref-order-detail-state h1 { color: #19473c; font: 600 25px/1.2 var(--serif); }
.ref-order-detail-state p, .ref-order-notes { font-size: 12px; color: #62746d; line-height: 1.7; }
.ref-order-detail-state p { margin-top: 6px; }
.ref-order-detail-item { display: grid; grid-template-columns: minmax(65px, 36%) minmax(0, 1fr); gap: 16px; align-items: center; border-radius: 14px; padding: 14px; background: #fff; }
.ref-order-detail-item h2 { font-size: 18px; overflow-wrap: anywhere; }
.ref-order-detail-item p { color: #62746d; font-size: 13px; margin-block: 7px; }
.ref-order-detail-item strong { display: block; margin-top: 12px; color: #8b6b37; font-size: clamp(17px, 5vw, 24px); overflow-wrap: anywhere; }
.ref-order-section-title { margin-block: 21px 14px; font: 500 20px/1.25 var(--serif); }
.ref-order-info { padding: 6px 15px; background: #fff; border-radius: 14px; }
.ref-order-info .value-row { border-bottom: 1px solid #e3e8df; padding-block: 10px; font-size: 13px; }
.ref-order-info .value-row:last-child { border: 0; }
.ref-order-notes { margin-top: 16px; }
.ref-order-notes p + p { margin-top: 8px; }
.ref-order-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); }
.ref-order-actions .ref-order-link { min-height: 42px; font-size: 15px; }

@media (max-width: 359px) {
  .page.ref-order-book, .page.ref-order-detail { padding-inline: 12px; }
  .ref-order-item { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .ref-order-item > strong { font-size: 12px; }
}
