:root {
  --ink: #202124;
  --muted: #667085;
  --line: #d7dde7;
  --panel: #ffffff;
  --bg: #f5f7fb;
  --brand: #15616d;
  --brand-strong: #0d3f49;
  --accent: #ff7d3b;
  --mint: #d6f2e1;
  --rose: #ffe0dc;
  --yellow: #ffe7a3;
  --shadow: 0 18px 50px rgba(30, 41, 59, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  background: #112b31;
  color: #f8fbfc;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--accent);
  color: #231f20;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #b8c8cc;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #dce8eb;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.nav-item span {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #1f1f1f;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-note span,
.sidebar-note strong {
  display: block;
}

.sidebar-note span {
  color: #b8c8cc;
  font-size: 12px;
  text-transform: uppercase;
}

main {
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
}

h2 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 0.98;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.ghost-button,
.icon-button,
.filter {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: var(--brand);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--brand-strong);
}

.ghost-button,
.filter {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.filter.active,
.ghost-button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.icon-button {
  width: 42px;
  padding: 0;
  border-color: var(--line);
  background: #ffffff;
  font-size: 20px;
}

.full {
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: end;
  gap: 24px;
  margin-bottom: 28px;
  padding: 34px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.72) 46%, rgba(255, 255, 255, 0.08) 100%),
    url("https://images.unsplash.com/photo-1607083206968-13611e3d76db?auto=format&fit=crop&w=1800&q=80") center/cover;
  box-shadow: var(--shadow);
}

.product-grid + .hero {
  margin-top: 28px;
}

.hero-copy p:last-child {
  max-width: 650px;
  color: #41515a;
  font-size: 18px;
  line-height: 1.55;
}

.hero-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(30, 41, 59, 0.08);
}

.hero-panel {
  padding: 20px;
}

.hero-panel span {
  color: var(--muted);
}

.hero-panel strong {
  display: block;
  margin: 8px 0 16px;
  font-size: 34px;
}

.meter {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e8edf2;
}

.meter span {
  display: block;
  width: 72%;
  height: 100%;
  background: var(--accent);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}

.section-header.compact {
  align-items: center;
}

.section-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(30, 41, 59, 0.06);
}

.search-field input {
  padding-left: 40px;
  background:
    linear-gradient(transparent, transparent),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 13px center / 18px no-repeat #ffffff;
}

.price-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-count {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(30, 41, 59, 0.08);
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.product-meta strong {
  font-size: 18px;
}

.product-meta span {
  color: var(--brand);
  font-weight: 900;
}

.product-card p {
  min-height: 44px;
  color: var(--muted);
  line-height: 1.4;
}

.content-grid.two,
.checkout-layout,
.tracking-wrap,
.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.doc-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  padding: 22px;
}

.cart-items {
  display: grid;
  gap: 12px;
}

.cart-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cart-row img {
  width: 76px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}

.cart-row h4,
.cart-row p {
  margin: 0;
}

.cart-row p {
  color: var(--muted);
}

.qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.summary dl {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.summary dl div,
.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.summary dt {
  color: var(--muted);
}

.summary dd {
  margin: 0;
  font-weight: 900;
}

.summary .total {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.empty-state:empty::before {
  content: "Your cart is empty. Add a fantasy purchase from the catalog.";
  display: block;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.catalog-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
}

.catalog-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 18px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.step {
  padding: 10px;
  border-radius: 8px;
  background: #edf2f5;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.step.active {
  background: var(--mint);
  color: var(--brand-strong);
}

.checkout-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.checkbox-row {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
}

.checkbox-row input {
  min-height: auto;
  margin-top: 2px;
}

.receipt {
  align-self: start;
}

.receipt-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.receipt-row span:last-child {
  font-weight: 900;
}

.tracking-card {
  overflow: hidden;
}

.tracking-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.tracking-head h3 {
  overflow-wrap: anywhere;
}

.status-pill {
  align-self: start;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--yellow);
  font-weight: 900;
  white-space: nowrap;
}

.package-visual {
  overflow: hidden;
  margin: 12px 0 18px;
  border-radius: 8px;
}

.package-visual img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.progress-line {
  overflow: hidden;
  height: 12px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: #e8edf2;
}

.progress-line span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--brand);
  transition: width 260ms ease;
}

.tracking-events {
  display: grid;
  gap: 12px;
  padding-left: 22px;
}

.tracking-events li {
  padding-left: 4px;
  line-height: 1.4;
}

.tracking-events strong {
  display: block;
}

.tracking-events span {
  color: var(--muted);
  font-size: 13px;
}

.tracking-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.flow-map {
  display: grid;
  gap: 10px;
}

.flow-map span,
.arch-diagram span,
.screen-list div,
.strategy-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.flow-map span {
  position: relative;
  font-weight: 900;
}

.flow-map span:not(:last-child)::after {
  content: "↓";
  position: absolute;
  right: 14px;
  color: var(--accent);
}

.doc-panel p {
  color: #41515a;
  line-height: 1.65;
}

.strategy-grid,
.screen-list {
  display: grid;
  gap: 12px;
}

.strategy-grid div,
.screen-list div {
  display: grid;
  gap: 6px;
}

.strategy-grid span,
.screen-list span {
  color: var(--muted);
  line-height: 1.45;
}

.arch-diagram {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.arch-diagram span {
  min-height: 58px;
  display: grid;
  place-items: center;
  background: #f9fbfc;
  font-weight: 900;
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 14px 16px;
  border-radius: 8px;
  background: #202124;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero,
  .content-grid.two,
  .checkout-layout,
  .tracking-wrap,
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  main {
    padding: 18px;
  }

  .topbar,
  .section-header,
  .tracking-head {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-list,
  .product-grid,
  .field-row,
  .price-fields,
  .stepper,
  .arch-diagram {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 520px;
    align-items: end;
    padding: 22px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.82) 56%, rgba(255, 255, 255, 0.32) 100%),
      url("https://images.unsplash.com/photo-1607083206968-13611e3d76db?auto=format&fit=crop&w=1200&q=80") center/cover;
  }

  .cart-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .qty {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}
