.orders-shell {
  width: min(100%, 820px);
  margin: 0 auto;
  padding:
    max(18px, env(safe-area-inset-top))
    clamp(14px, 4vw, 28px)
    max(30px, env(safe-area-inset-bottom));
}

.orders-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(11, 18, 38, .66);
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
}

.back-link:hover { border-color: var(--line-strong); }

.topbar-brand {
  color: var(--faint);
  text-decoration: none;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .14em;
}

.orders-header { padding: 4px 2px 0; }

.user-chip {
  display: inline-flex;
  max-width: 100%;
  margin: 14px 0 0;
  padding: 7px 11px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(11, 18, 38, .62);
  font-size: 11px;
  line-height: 1.4;
}

.user-chip[hidden] { display: none; }

.orders-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 13px;
}

.filter-field {
  flex: 0 1 190px;
  min-width: 0;
}

.select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background-color: rgba(19, 29, 58, .92);
  font: inherit;
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.orders-meta {
  min-width: 0;
  color: var(--faint);
  font-size: 11px;
  text-align: right;
}

.order-list {
  display: grid;
  gap: 12px;
  min-height: 120px;
}

.empty {
  margin: 0;
  padding: 26px 12px;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.my-order-card {
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    radial-gradient(circle at 100% 0%, rgba(93, 125, 255, .12), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow);
}

.my-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.my-order-no {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-status {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: #ffd26d;
  background: rgba(255, 191, 71, .13);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .02em;
}

.order-status.is-active {
  color: #aebfff;
  background: rgba(109, 140, 255, .16);
}

.order-status.is-done {
  color: var(--green);
  background: var(--green-soft);
}

.order-status.is-bad {
  color: #ff9aab;
  background: rgba(255, 103, 126, .14);
}

.my-order-goods {
  margin: 11px 0 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.42;
  letter-spacing: -.015em;
}

.my-order-meta {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.55;
}

.order-progress {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(6, 12, 28, .38);
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #dfe6ff;
  font-size: 11px;
}

.progress-head span { color: var(--muted); }

.progress-head strong {
  color: #ffd26d;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(145, 163, 214, .17);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #83a0ff, #45df9a);
  box-shadow: 0 0 14px rgba(69, 223, 154, .3);
}

.progress-fill.is-bad {
  background: linear-gradient(90deg, #ff8b9b, #ff667e);
  box-shadow: 0 0 14px rgba(255, 103, 126, .3);
}

.progress-hint {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.5;
}

.my-order-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
}

.my-order-amount {
  color: #ffd26d;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.orders-empty,
.orders-error {
  padding: 38px 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel-soft);
  text-align: center;
}

.orders-empty strong,
.orders-error strong {
  display: block;
  font-size: 16px;
}

.orders-empty p,
.orders-error p {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.orders-empty a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 17px;
  border: 1px solid rgba(126, 150, 255, .36);
  border-radius: 999px;
  color: #dfe7ff;
  background: var(--brand-soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
}

.orders-error[hidden] { display: none; }

.orders-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.orders-pager button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  font: inherit;
  font-size: 12px;
}

.orders-pager button:disabled {
  color: var(--faint);
  opacity: .48;
}

.orders-pager span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.orders-footer {
  margin-top: 22px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 359px) {
  .orders-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-field { flex-basis: auto; }
  .orders-meta { text-align: left; }
}
