:root {
  --ink: #17202a;
  --muted: #637083;
  --line: rgba(23, 32, 42, 0.12);
  --paper: #fffdf8;
  --good: #0f766e;
  --warn: #b45309;
  --bad: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: #f6f8fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

.app-install-button {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10050;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--good);
  box-shadow: 0 16px 36px rgba(15, 118, 110, 0.32);
  font-weight: 950;
  cursor: pointer;
}

.is-installed-app .app-install-button {
  display: none;
}

button,
input,
textarea {
  font: inherit;
}

.orders-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 26px 0 46px;
}

.orders-hero {
  position: relative;
  margin-bottom: 18px;
}

.orders-brand {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--good);
  font-weight: 950;
  text-decoration: none;
}

.orders-nav {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 8px;
}

.orders-nav a,
.orders-tab,
.order-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.orders-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2.4rem, 8vw, 4.8rem);
  line-height: 0.92;
}

.orders-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.orders-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.orders-summary div,
.orders-panel,
.order-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 54px rgba(17, 24, 39, 0.08);
}

.orders-summary div {
  padding: 14px;
  background: #ecfdf5;
  border-color: rgba(15, 118, 110, 0.18);
}

.orders-summary strong,
.orders-summary span {
  display: block;
}

.orders-summary span {
  margin-top: 4px;
  color: #34665d;
  font-size: 0.9rem;
  line-height: 1.4;
}

.orders-panel {
  overflow: hidden;
}

.orders-account {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 850;
}

.orders-toolbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.orders-tab.is-active,
.order-action.primary {
  border-color: transparent;
  color: #ffffff;
  background: var(--good);
}

.orders-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.orders-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.order-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  box-shadow: none;
}

.order-head,
.order-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.order-title {
  display: grid;
  gap: 4px;
}

.order-title strong {
  font-size: 1.05rem;
}

.order-title span,
.order-meta,
.order-items,
.order-status-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.order-total {
  color: var(--good);
  font-size: 1.15rem;
  font-weight: 950;
  white-space: nowrap;
}

.order-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef3fe;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 900;
}

.order-badge.good {
  color: #0f5132;
  background: #dcfce7;
}

.order-badge.warn {
  color: #7c2d12;
  background: #ffedd5;
}

.order-badge.bad {
  color: #7f1d1d;
  background: #fee2e2;
}

.order-items {
  display: grid;
  gap: 8px;
}

.order-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

.order-item img {
  width: 54px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: #e5e7eb;
}

.order-item strong,
.order-item span {
  display: block;
}

.order-actions,
.tracking-form,
.dispute-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tracking-form input,
.dispute-form textarea {
  flex: 1 1 220px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.dispute-form textarea {
  min-height: 78px;
}

.order-action:disabled {
  cursor: wait;
  opacity: 0.68;
}

@media (max-width: 720px) {
  .orders-nav {
    position: static;
    margin: 0 0 16px;
  }

  .orders-summary {
    grid-template-columns: 1fr;
  }

  .order-head,
  .order-foot {
    display: grid;
  }
}
