  .page { padding: 26px 0 0; }
  .crumbs { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: rgba(61,27,36,0.55); margin-bottom: 18px; flex-wrap: wrap; }
  .crumbs a { text-decoration: none; color: inherit; }
  .crumbs a:hover { color: var(--rust); }
  .crumbs .icon { width: 12px; height: 12px; opacity: 0.5; }

  .orders-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
  .orders-head h1 { font-size: clamp(1.85rem, 3.4vw, 2.6rem); letter-spacing: -0.035em; }
  .orders-head h1 em { font-family: var(--font-editorial); font-style: italic; color: var(--rust); font-weight: 400; }
  .orders-head p { font-size: 0.9rem; color: var(--espresso); opacity: 0.78; margin-top: 6px; }
  .orders-head .btn-outline { white-space: nowrap; }

  .mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
  .mini-stat { padding: 16px 18px; border-radius: 18px; background: rgba(255,255,255,0.72); border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 12px; transition: all 0.28s ease; }
  .mini-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(212,175,55,0.3); }
  .mini-stat .ms-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(245,166,35,0.16), rgba(194,90,42,0.1)); color: var(--rust); flex: none; }
  .mini-stat b { display: block; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: -0.02em; }
  .mini-stat span { font-size: 0.73rem; color: rgba(61,27,36,0.55); }

  .toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
  .tabs { display: flex; gap: 6px; padding: 5px; border-radius: 50px; background: rgba(249,244,232,0.95); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { border: none; background: none; cursor: pointer; white-space: nowrap; padding: 9px 16px; border-radius: 50px; font-size: 0.82rem; font-weight: 600; color: var(--espresso); transition: all 0.28s ease; display: inline-flex; align-items: center; gap: 7px; }
  .tabs button .n { font-size: 0.68rem; padding: 1px 7px; border-radius: 50px; background: rgba(61,27,36,0.08); font-weight: 700; }
  .tabs button.active { background: linear-gradient(135deg, var(--rust), var(--mustard)); color: #fff; box-shadow: 0 4px 14px rgba(194,90,42,0.28); }
  .tabs button.active .n { background: rgba(255,255,255,0.26); color: #fff; }
  .order-search { position: relative; margin-left: auto; flex: 1 1 240px; max-width: 320px; }
  .order-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: rgba(61,27,36,0.4); }
  .order-search input { padding: 11px 14px 11px 40px; border-radius: 50px; font-size: 0.84rem; }

  .orders-list { display: grid; gap: 16px; padding-bottom: 60px; }
  .order-card { background: #fff; border: 1px solid var(--line-soft); border-radius: 22px; box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow 0.32s ease, border-color 0.32s ease, transform 0.32s ease; animation: fadeUp 0.45s ease both; }
  .order-card:hover { box-shadow: var(--shadow-md); border-color: rgba(212,175,55,0.26); transform: translateY(-2px); }

  .oc-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: linear-gradient(135deg, rgba(255,245,230,0.7), rgba(249,244,232,0.55)); border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
  .oc-id { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
  .oc-label { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: rgba(61,27,36,0.45); }
  .oc-id b { font-family: var(--font-display); font-size: 0.98rem; letter-spacing: -0.01em; }
  .oc-head .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
  .oc-total { text-align: right; }
  .oc-total b { font-family: var(--font-display); font-size: 1.05rem; display: block; line-height: 1.2; }
  .oc-total span { font-size: 0.7rem; color: rgba(61,27,36,0.5); }
  .oc-btn { border: 1px solid var(--line); background: #fff; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--espresso); transition: all 0.25s ease; }
  .oc-btn:hover { border-color: rgba(245,166,35,0.5); color: var(--rust); background: rgba(255,245,230,0.6); }
  .oc-btn .icon { width: 15px; height: 15px; transition: transform 0.3s ease; }
  .oc-btn[aria-expanded="true"] .icon { transform: rotate(180deg); }

  .oc-body { padding: 18px 20px 20px; }
  .oc-items { display: grid; gap: 12px; }
  .oc-item { display: flex; align-items: center; gap: 14px; }
  .oc-thumb { position: relative; width: 62px; height: 62px; border-radius: 14px; overflow: hidden; flex: none; background: linear-gradient(135deg, #F7E7C8, #EFD3A5 55%, #E7C098); }
  .oc-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .oc-thumb .q { position: absolute; bottom: 3px; right: 3px; background: rgba(45,31,20,0.82); color: #fff; font-size: 0.62rem; font-weight: 700; padding: 1px 6px; border-radius: 50px; backdrop-filter: blur(4px); }
  .oc-item-body { min-width: 0; flex: 1; }
  .oc-item-body h3 { font-family: var(--font-display); font-size: 0.98rem; letter-spacing: -0.01em; margin-bottom: 2px; }
  .oc-item-body h3 a { text-decoration: none; color: inherit; }
  .oc-item-body h3 a:hover { color: var(--rust); }
  .oc-item-body p { font-size: 0.76rem; color: rgba(61,27,36,0.55); }
  .oc-item-price { font-size: 0.9rem; font-weight: 700; white-space: nowrap; }
  .oc-more { font-size: 0.78rem; color: var(--rust); font-weight: 600; padding-top: 2px; }

  .oc-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
  .oc-foot .btn-sm { display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; border-radius: 50px; font-size: 0.79rem; font-weight: 600; cursor: pointer; transition: all 0.25s ease; border: 1px solid transparent; text-decoration: none; }
  .btn-solid { background: linear-gradient(135deg, var(--rust), var(--mustard)); color: #fff; box-shadow: 0 3px 14px rgba(194,90,42,0.24); }
  .btn-solid:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(194,90,42,0.32); }
  .btn-line { background: #fff; color: var(--espresso); border-color: rgba(61,27,36,0.14); }
  .btn-line:hover { border-color: rgba(245,166,35,0.5); color: var(--rust); background: rgba(255,245,230,0.5); }
  .oc-foot .icon { width: 14px; height: 14px; }
  .oc-delivered-on { font-size: 0.76rem; color: rgba(61,27,36,0.5); display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
  .oc-delivered-on .icon { color: #2e7d54; }

  /* tracking timeline */
  .track-panel { padding: 0 20px 20px; animation: fadeUp 0.4s ease both; }
  .track-inner { padding: 20px; border-radius: 16px; background: rgba(249,244,232,0.75); border: 1px solid var(--line-soft); }
  .track-inner h4 { font-family: var(--font-body); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rust); margin-bottom: 16px; font-weight: 700; }
  .timeline { list-style: none; display: grid; gap: 0; }
  .timeline li { display: grid; grid-template-columns: 26px 1fr; gap: 14px; padding-bottom: 18px; position: relative; }
  .timeline li:last-child { padding-bottom: 0; }
  .tl-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1.5px solid rgba(61,27,36,0.14); color: rgba(61,27,36,0.3); font-size: 0; position: relative; z-index: 2; }
  .tl-dot .icon { width: 13px; height: 13px; stroke-width: 2.6; }
  .timeline li:not(:last-child)::before { content: ''; position: absolute; left: 12.5px; top: 26px; bottom: 0; width: 1.5px; background: rgba(61,27,36,0.12); }
  .timeline li.done .tl-dot { background: linear-gradient(135deg, var(--rust), var(--mustard)); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(194,90,42,0.26); }
  .timeline li.done:not(:last-child)::before { background: linear-gradient(180deg, var(--mustard), rgba(212,175,55,0.3)); }
  .timeline li.current .tl-dot { background: #fff; border-color: var(--mustard); color: var(--rust); box-shadow: 0 0 0 4px rgba(245,166,35,0.16); animation: pulseDot 2s ease-in-out infinite; }
  @keyframes pulseDot { 0%,100% { box-shadow: 0 0 0 4px rgba(245,166,35,0.14); } 50% { box-shadow: 0 0 0 8px rgba(245,166,35,0.06); } }
  .tl-body b { display: block; font-size: 0.87rem; font-family: var(--font-body); font-weight: 600; }
  .tl-body span { font-size: 0.76rem; color: rgba(61,27,36,0.55); }
  .timeline li:not(.done):not(.current) .tl-body b { color: rgba(61,27,36,0.4); font-weight: 500; }
  .track-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(212,175,55,0.4); flex-wrap: wrap; }
  .track-foot .awb { font-size: 0.78rem; color: var(--espresso); }
  .track-foot .awb b { letter-spacing: 0.04em; }
  .cancel-note { display: flex; gap: 10px; padding: 14px 16px; border-radius: 14px; background: rgba(194,90,42,0.07); border: 1px solid rgba(194,90,42,0.2); font-size: 0.82rem; color: var(--espresso); line-height: 1.6; }
  .cancel-note .icon { color: var(--rust); flex: none; margin-top: 2px; }

  /* rating widget */
  .rate-panel { margin-top: 12px; padding: 16px 18px; border-radius: 16px; background: rgba(255,245,230,0.7); border: 1px dashed rgba(212,175,55,0.45); animation: fadeUp 0.35s ease both; }
  .rate-panel p { font-size: 0.82rem; color: var(--espresso); margin-bottom: 10px; }
  .rate-stars { display: flex; gap: 6px; margin-bottom: 12px; }
  .rate-stars button { border: none; background: none; cursor: pointer; color: rgba(61,27,36,0.18); padding: 0; transition: transform 0.2s ease, color 0.2s ease; }
  .rate-stars button .icon { width: 26px; height: 26px; fill: currentColor; stroke: none; }
  .rate-stars button.on { color: var(--mustard); transform: translateY(-2px); }
  /* How the money stands, next to how the parcel stands. */
  .pay-chip {
    font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 4px 9px; border-radius: 50px; white-space: nowrap;
  }
  .pay-chip.paid { color: #2e7d54; background: rgba(46,125,84,0.12); }
  .pay-chip.due { color: #b45309; background: rgba(245,166,35,0.16); }
  .pay-chip.failed { color: #b3261e; background: rgba(179,38,30,0.12); }

  .rate-panel textarea { min-height: 70px; resize: vertical; font-size: 0.85rem; }
  .rate-actions { display: flex; gap: 8px; margin-top: 10px; }

  .empty-state { text-align: center; padding: 64px 24px; border-radius: 24px; background: rgba(255,255,255,0.7); border: 1px solid var(--line); }
  .empty-state .art { width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, rgba(245,166,35,0.16), rgba(194,90,42,0.1)); border: 1px solid rgba(212,175,55,0.3); color: var(--rust); }
  .empty-state h2 { font-size: 1.4rem; margin-bottom: 8px; }
  .empty-state p { font-size: 0.9rem; color: var(--espresso); opacity: 0.75; margin-bottom: 20px; }

  @media (max-width: 900px) { .mini-stats { grid-template-columns: 1fr 1fr; } }
  @media (max-width: 640px) {
    .orders-head { align-items: flex-start; }
    .oc-head { padding: 14px 16px; }
    .oc-body { padding: 14px 16px 16px; }
    .track-panel { padding: 0 16px 16px; }
    .order-search { max-width: none; width: 100%; }
    .oc-item { gap: 10px; }
    .oc-thumb { width: 52px; height: 52px; border-radius: 12px; }
    .oc-item-body h3 { font-size: 0.9rem; }
    .oc-foot .btn-sm { flex: 1 1 45%; justify-content: center; }
    .oc-delivered-on { margin-left: 0; width: 100%; }
  }

/* ---------------------------------------------------------------- invoice
   Read out of the order record: address, each line's snapshot price, and the
   server's own totals. Print hides the shop and leaves the paper. */
.invoice-backdrop { position: fixed; inset: 0; z-index: 220; background: rgba(45,31,20,0.55);
  backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; overflow-y: auto;
  animation: fadeIn 0.22s ease both; }
.invoice-panel { width: min(720px, 100%); max-height: 90vh; overflow-y: auto; background: #fff;
  border-radius: 20px; box-shadow: var(--shadow-lg); padding: 24px 26px; animation: fadeUp 0.3s ease both; }
.inv-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  border-bottom: 1px solid var(--line-soft); padding-bottom: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.inv-head .logo { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: -0.02em; color: var(--espresso); text-decoration: none; }
.inv-head .logo em { font-family: var(--font-editorial); font-style: italic; color: var(--rust); }
.inv-head p { font-size: 0.72rem; color: rgba(61,27,36,0.55); margin-top: 3px; }
.inv-meta { text-align: right; display: grid; gap: 2px; }
.inv-meta b { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rust); }
.inv-meta span { font-size: 0.8rem; color: var(--espresso); }
.inv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.inv-cols h5 { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(61,27,36,0.45); margin-bottom: 6px; }
.inv-cols p { font-size: 0.82rem; line-height: 1.65; color: var(--espresso); }
.inv-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.inv-table th { text-align: left; font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(61,27,36,0.45); padding: 8px 6px; border-bottom: 1px solid var(--line-soft); }
.inv-table td { padding: 10px 6px; border-bottom: 1px solid rgba(61,27,36,0.06); color: var(--espresso); vertical-align: top; }
.inv-table td small { display: block; font-size: 0.68rem; color: rgba(61,27,36,0.45); }
.inv-table .n { text-align: right; white-space: nowrap; }
.inv-totals { margin: 14px 0 0 auto; width: min(300px, 100%); }
.inv-row { display: flex; justify-content: space-between; gap: 14px; font-size: 0.82rem; padding: 5px 0; color: var(--espresso); }
.inv-row.strong { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px;
  font-family: var(--font-display); font-size: 1rem; }
.inv-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px;
  margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.inv-foot > span:first-child { font-size: 0.68rem; color: rgba(61,27,36,0.5); max-width: 320px; line-height: 1.6; }
.inv-actions { display: flex; gap: 8px; margin-left: auto; }

@media (max-width: 560px) {
  .inv-cols { grid-template-columns: 1fr; }
  .inv-meta { text-align: left; }
}

@media print {
  body > *:not(.invoice-backdrop) { display: none !important; }
  .invoice-backdrop { position: static; background: #fff; backdrop-filter: none; padding: 0; display: block; }
  .invoice-panel { box-shadow: none; border-radius: 0; max-height: none; width: 100%; padding: 0; }
  .inv-actions { display: none; }
}

/* ------------------------------------------------------------- rate a purchase
   One line per product, each with its own stars: a five-star thali and a
   three-star incense can be said in one visit. */
.rate-lines { display: grid; gap: 10px; margin-bottom: 12px; }
.rate-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line-soft); }
.rate-line .rl-name { font-family: var(--font-display); font-size: 0.88rem; color: var(--espresso);
  min-width: 0; flex: 1 1 160px; }
.rate-line .rl-name small { display: block; font-family: var(--font-body, inherit); font-size: 0.7rem;
  color: rgba(61,27,36,0.5); margin-top: 1px; }
.rate-line .rate-stars { margin-bottom: 0; }
.rate-line .rate-stars button .icon { width: 22px; height: 22px; }
