:root {
  color-scheme: light;
  --ink: #17221b;
  --muted: #68736b;
  --paper: #f4f1e8;
  --surface: #fbfaf6;
  --white: #fffef9;
  --line: #dcd9ce;
  --line-dark: #c9c6ba;
  --forest: #214c35;
  --forest-dark: #153624;
  --lime: #c9f265;
  --terracotta: #c86846;
  --danger: #9c3f38;
  --warning: #b66b1b;
  --shadow: 0 18px 50px rgb(31 43 35 / 9%);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Avenir Next", Avenir, Inter, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgb(255 255 255 / 75%), transparent 34rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgb(33 76 53 / 28%);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.9rem;
  color: white;
  background: var(--forest-dark);
  border-radius: 0.5rem;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--forest);
  font-family: var(--mono);
  font-size: 0.71rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.welcome {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(22rem, 0.96fr);
  min-height: 100vh;
  overflow: hidden;
  background: #ece8dc;
}

.welcome__texture {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgb(23 34 27 / 3%) 1px, transparent 1px),
    linear-gradient(rgb(23 34 27 / 3%) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, black, transparent 75%);
}

.welcome__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: clamp(3rem, 8vw, 9rem);
}

.welcome__mark,
.brand__mark {
  display: grid;
  place-items: center;
  width: 4.5rem;
  aspect-ratio: 1;
  margin-bottom: 1.65rem;
  color: var(--lime);
  background: var(--forest);
  border-radius: 50% 50% 45% 55% / 48% 54% 46% 52%;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.08em;
  box-shadow: 0 12px 30px rgb(33 76 53 / 18%);
  transform: rotate(-3deg);
}

.welcome__mark span,
.brand__mark span {
  display: inline-block;
  margin: 0 0.08rem;
  font-size: 0.72em;
}

.welcome h1 {
  max-width: 44rem;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(4rem, 8vw, 7.7rem);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.07em;
}

.welcome__lede {
  max-width: 39rem;
  margin: 2rem 0;
  color: #566158;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.75;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-dark);
  border-radius: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgb(20 34 26 / 10%);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.button--primary {
  color: white;
  background: var(--forest);
  border-color: var(--forest);
}

.button--primary:hover:not(:disabled) {
  background: var(--forest-dark);
}

.button--large {
  min-height: 3.8rem;
  padding: 0.9rem 1.4rem;
  border-radius: 1rem;
  font-size: 1rem;
}

.button--quiet {
  background: var(--surface);
}

.button--danger {
  color: white;
  background: var(--danger);
  border-color: var(--danger);
}

.button--small {
  min-height: 2.25rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0.55rem;
  font-size: 0.79rem;
}

.welcome__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.4rem;
  color: #6d756e;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.welcome__facts span::before {
  content: "✓";
  margin-right: 0.42rem;
  color: var(--forest);
  font-weight: 700;
}

.welcome__aside {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 30%, rgb(201 242 101 / 24%), transparent 32%),
    var(--forest-dark);
}

.welcome__aside::before,
.welcome__aside::after {
  position: absolute;
  content: "";
  width: 30rem;
  height: 30rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 45% 55% 62% 38% / 49% 42% 58% 51%;
}

.welcome__aside::before {
  top: -8rem;
  right: -8rem;
  transform: rotate(24deg);
}

.welcome__aside::after {
  bottom: -11rem;
  left: -8rem;
  transform: rotate(-14deg);
}

.receipt-card {
  position: relative;
  z-index: 2;
  width: min(69%, 29rem);
  min-height: 29rem;
  padding: 2.2rem;
  background: #fffdf4;
  border-radius: 0.35rem;
  box-shadow: 0 30px 80px rgb(0 0 0 / 33%);
  transform: rotate(3deg);
}

.receipt-card::after {
  position: absolute;
  right: 0;
  bottom: -0.65rem;
  left: 0;
  height: 0.8rem;
  content: "";
  background: linear-gradient(135deg, #fffdf4 0 50%, transparent 50% 100%) 0 0 / 1.2rem 1.2rem repeat-x;
}

.receipt-card--back {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 23rem;
  color: white;
  background: var(--terracotta);
  transform: translate(-18%, 7%) rotate(-11deg);
}

.receipt-card--back span {
  font-family: var(--mono);
  font-size: 0.72rem;
}

.receipt-card--back strong {
  margin-top: 0.4rem;
  font-family: var(--serif);
  font-size: 2rem;
}

.receipt-card__top,
.receipt-card__items {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 2.1;
}

.receipt-card__top {
  font-weight: 500;
  text-transform: uppercase;
}

.receipt-card__line {
  margin: 1.4rem 0;
  border-top: 1px dashed #a9a69d;
}

.receipt-card__stamp {
  position: absolute;
  right: 2.4rem;
  bottom: 3rem;
  padding: 0.6rem 0.85rem;
  color: var(--terracotta);
  border: 3px double var(--terracotta);
  border-radius: 0.3rem;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.15em;
  transform: rotate(-9deg);
}

.app-shell {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  grid-template-rows: 4.8rem minmax(calc(100vh - 4.8rem), auto);
  min-height: 100vh;
}

.app-shell[hidden],
.welcome[hidden] {
  display: none;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4rem;
  background: rgb(251 250 246 / 93%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  width: 2.65rem;
  margin: 0;
  font-size: 0.72rem;
  box-shadow: none;
}

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

.brand strong {
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1;
}

.brand small {
  margin-top: 0.22rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.61rem;
  text-transform: uppercase;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--forest);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.session-chip i {
  width: 0.48rem;
  height: 0.48rem;
  background: #48a06b;
  border-radius: 50%;
  box-shadow: 0 0 0 0.22rem rgb(72 160 107 / 14%);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--ink);
  background: #eeece4;
}

.sidebar {
  position: sticky;
  top: 4.8rem;
  display: flex;
  height: calc(100vh - 4.8rem);
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem 1rem;
  background: #ebe7dc;
  border-right: 1px solid var(--line);
}

.sidebar nav {
  display: grid;
  gap: 0.2rem;
}

.nav-label {
  margin: 1.15rem 0 0.4rem 0.7rem;
  color: #838980;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-label:first-child {
  margin-top: 0;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  min-height: 2.7rem;
  padding: 0.55rem 0.7rem;
  color: #556058;
  border-radius: 0.65rem;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.sidebar nav a > span {
  display: grid;
  place-items: center;
  width: 1.25rem;
  color: #768078;
  font-size: 1rem;
}

.sidebar nav a:hover,
.sidebar nav a[aria-current="page"] {
  color: var(--forest-dark);
  background: var(--surface);
}

.sidebar nav a[aria-current="page"] > span {
  color: var(--forest);
}

.nav-count {
  min-width: 1.25rem;
  margin-left: auto;
  padding: 0.13rem 0.35rem;
  color: var(--forest-dark);
  background: var(--lime);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-align: center;
}

.sidebar__note {
  display: flex;
  gap: 0.7rem;
  padding: 0.85rem;
  background: rgb(255 255 255 / 45%);
  border: 1px solid rgb(33 76 53 / 10%);
  border-radius: 0.8rem;
}

.sidebar__note-icon {
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--forest);
  background: var(--lime);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
}

.sidebar__note strong {
  font-size: 0.73rem;
}

.sidebar__note p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.5;
}

.main {
  min-width: 0;
  padding: clamp(1.5rem, 3.2vw, 3.4rem);
}

.page {
  width: min(100%, 82rem);
  margin: 0 auto;
  animation: page-in 240ms ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.page-heading h1,
.page-heading h2,
.empty-state h2,
.confirm-dialog h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}

.page-heading p:not(.eyebrow) {
  max-width: 37rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.catalog-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(15rem, 0.9fr);
  min-height: 19rem;
  margin-bottom: 2rem;
  overflow: hidden;
  color: white;
  background: var(--forest);
  border-radius: 1.3rem;
}

.catalog-hero__copy {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: clamp(2rem, 5vw, 4rem);
}

.catalog-hero .eyebrow {
  color: var(--lime);
}

.catalog-hero h1 {
  max-width: 43rem;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 5.5vw, 5.3rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.catalog-hero p:not(.eyebrow) {
  max-width: 35rem;
  margin: 1.2rem 0 0;
  color: rgb(255 255 255 / 66%);
  line-height: 1.65;
}

.catalog-hero__art {
  position: relative;
  min-height: 18rem;
}

.catalog-hero__art::before,
.catalog-hero__art::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.catalog-hero__art::before {
  width: 22rem;
  height: 22rem;
  top: -3rem;
  right: -1rem;
  background: var(--lime);
  opacity: 0.95;
}

.catalog-hero__art::after {
  width: 11rem;
  height: 15rem;
  right: 7rem;
  bottom: -3rem;
  background: var(--terracotta);
  border-radius: 45% 55% 48% 52% / 60% 48% 52% 40%;
  transform: rotate(22deg);
}

.catalog-hero__monogram {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 4rem;
  color: var(--forest-dark);
  font-family: var(--serif);
  font-size: 8rem;
  line-height: 1;
  transform: translateY(-50%) rotate(-9deg);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}

.search-field {
  position: relative;
  flex: 1;
}

.search-field span {
  position: absolute;
  top: 50%;
  left: 0.95rem;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-field input,
.toolbar select,
.field input,
.field select,
.quantity-input,
.restock-input {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.72rem 0.9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.search-field input {
  padding-left: 2.7rem;
}

.toolbar select {
  width: 12rem;
}

.results-copy {
  margin: 0 0 1rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

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

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.product-card__image,
.mini-product-image {
  position: relative;
  display: grid;
  min-height: 12rem;
  place-items: center;
  overflow: hidden;
  color: rgb(255 255 255 / 88%);
  background: var(--accent, var(--forest));
  border-radius: 0.72rem;
  font-family: var(--serif);
  font-size: 5rem;
}

.product-card__image::before,
.mini-product-image::before {
  position: absolute;
  width: 8rem;
  height: 8rem;
  content: "";
  background: rgb(255 255 255 / 12%);
  border-radius: 38% 62% 52% 48% / 54% 43% 57% 46%;
  transform: translate(23%, -17%) rotate(18deg);
}

.product-card__image span,
.mini-product-image span {
  position: relative;
  z-index: 1;
}

.product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem 0.35rem 0.35rem;
}

.product-card__meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.product-card h2 {
  margin: 0.55rem 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.48rem;
  font-weight: 600;
}

.product-card p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1.1rem;
}

.product-card__price {
  font-size: 0.92rem;
  font-weight: 800;
}

.accent-amber { --accent: #c17d37; }
.accent-moss { --accent: #59735a; }
.accent-clay { --accent: #a8553d; }
.accent-sky { --accent: #58808c; }
.accent-plum { --accent: #71546d; }
.accent-cedar { --accent: #855a3e; }
.accent-ocean { --accent: #315d68; }
.accent-berry { --accent: #92495b; }

.panel,
.empty-state,
.stat-card,
.reliability-card,
.order-card,
.checkout-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.panel {
  padding: 1.25rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1.2rem;
}

.stat-card span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 500;
}

.empty-state {
  padding: 4.5rem 2rem;
  text-align: center;
}

.empty-state__icon {
  display: grid;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.4rem;
  place-items: center;
  color: var(--forest);
  background: #edf3de;
  border-radius: 50%;
  font-size: 1.5rem;
}

.empty-state p {
  max-width: 32rem;
  margin: 0.9rem auto 1.5rem;
  color: var(--muted);
  line-height: 1.65;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 1.25rem;
  bottom: 1.25rem;
  display: grid;
  gap: 0.6rem;
  width: min(24rem, calc(100vw - 2.5rem));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  color: white;
  background: var(--forest-dark);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 0.8rem;
  box-shadow: 0 18px 45px rgb(0 0 0 / 22%);
  animation: toast-in 180ms ease both;
}

.toast--error { background: #692f2c; }
.toast--warning { background: #72460f; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.confirm-dialog {
  width: min(31rem, calc(100vw - 2rem));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  box-shadow: 0 30px 80px rgb(20 28 23 / 25%);
}

.confirm-dialog::backdrop {
  background: rgb(13 25 17 / 50%);
  backdrop-filter: blur(3px);
}

.confirm-dialog form {
  padding: 2rem;
}

.confirm-dialog h2 {
  font-size: 2.4rem;
}

.confirm-dialog p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.route-loading {
  padding: 1rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.split-layout,
.checkout-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 23rem);
  align-items: start;
  gap: 1.25rem;
}

.cart-list,
.order-list,
.activity-list,
.fulfillment-list,
.inventory-list {
  display: grid;
  gap: 0.8rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) 6rem 6rem auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.mini-product-image {
  min-height: 4.8rem;
  font-size: 2rem;
}

.mini-product-image::before {
  width: 3rem;
  height: 3rem;
}

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

.item-title strong {
  font-family: var(--serif);
  font-size: 1.2rem;
}

.item-title span {
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.quantity-input {
  min-height: 2.4rem;
  padding: 0.45rem;
}

.line-total {
  font-weight: 800;
  text-align: right;
}

.text-button {
  padding: 0.45rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: var(--danger);
  background: #f8ece8;
}

.summary-card {
  position: sticky;
  top: 6.2rem;
  padding: 1.4rem;
  color: white;
  background: var(--forest-dark);
  border-radius: 1rem;
}

.summary-card .eyebrow {
  color: var(--lime);
}

.summary-card h2 {
  margin: 0 0 1.2rem;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 500;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  color: rgb(255 255 255 / 68%);
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  font-size: 0.8rem;
}

.summary-row strong {
  color: white;
}

.summary-row--total {
  margin-bottom: 1rem;
  color: white;
  border-bottom: 0;
  font-size: 1rem;
}

.summary-card .button {
  width: 100%;
  color: var(--forest-dark);
  background: var(--lime);
  border-color: var(--lime);
}

.checkout-card {
  padding: clamp(1.4rem, 3vw, 2.2rem);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-bottom: 2rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.step::before {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  place-items: center;
  content: attr(data-step);
  background: #e9e7df;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.65rem;
}

.step.is-active,
.step.is-complete {
  color: var(--forest);
}

.step.is-active::before,
.step.is-complete::before {
  color: var(--forest-dark);
  background: var(--lime);
}

.form-section h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
}

.form-section > p {
  margin: 0.5rem 0 1.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

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

.field {
  position: relative;
  display: grid;
  gap: 0.4rem;
}

.field--wide {
  grid-column: 1 / -1;
}

.field > span:first-child,
.choice-group legend {
  color: #4f5a52;
  font-size: 0.71rem;
  font-weight: 700;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  background: #fff7f4;
  border-color: var(--danger);
}

.field-error {
  color: var(--danger);
  font-size: 0.67rem;
}

.form-error {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  color: #702e29;
  background: #f8e7e2;
  border: 1px solid #eac5bb;
  border-radius: 0.7rem;
  font-size: 0.76rem;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.choice-group {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1.2rem;
  padding: 0;
  border: 0;
}

.choice-group legend {
  margin-bottom: 0.25rem;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  cursor: pointer;
}

.choice-card:has(input:checked) {
  background: #f2f7e4;
  border-color: #92a869;
}

.choice-card div {
  flex: 1;
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.payment-note,
.lab-note {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  color: #5e4b23;
  background: #fff5d8;
  border: 1px solid #edd9a8;
  border-radius: 0.7rem;
  font-size: 0.72rem;
  line-height: 1.55;
}

.confirmation {
  padding: 2rem 1rem;
  text-align: center;
}

.confirmation__mark {
  display: grid;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.2rem;
  place-items: center;
  color: var(--forest-dark);
  background: var(--lime);
  border-radius: 50%;
  font-size: 1.6rem;
}

.confirmation h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2.7rem;
  font-weight: 500;
}

.confirmation p {
  max-width: 30rem;
  margin: 0.8rem auto;
  color: var(--muted);
  line-height: 1.65;
}

.order-reference {
  display: inline-block;
  margin: 0.7rem 0 1.3rem;
  padding: 0.55rem 0.8rem;
  color: var(--forest);
  background: #edf3de;
  border-radius: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.order-card {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
}

.order-card__id {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
}

.order-card h2,
.fulfillment-row h2,
.inventory-row h2,
.reliability-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}

.order-card p,
.fulfillment-row p,
.inventory-row p,
.reliability-card p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  color: var(--forest);
  background: #edf3de;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.status::before {
  width: 0.38rem;
  height: 0.38rem;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.status--paid { color: #875b13; background: #fff2ce; }
.status--packed { color: #376377; background: #e3f1f5; }
.status--shipped { color: #46653c; background: #e5f1df; }

.fulfillment-row,
.inventory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}

.fulfillment-row__actions,
.inventory-row__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.inventory-row {
  grid-template-columns: 4rem minmax(0, 1fr) 6rem auto;
}

.inventory-row__stock {
  text-align: right;
}

.inventory-row__stock strong,
.inventory-row__stock span {
  display: block;
}

.inventory-row__stock strong {
  font-family: var(--serif);
  font-size: 1.5rem;
}

.inventory-row__stock span {
  color: var(--muted);
  font-size: 0.64rem;
}

.restock-input {
  width: 4.5rem;
  min-height: 2.3rem;
  padding: 0.4rem;
}

.activity-panel {
  margin-top: 1.5rem;
}

.activity-panel h2 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-size: 1.45rem;
}

.activity-item {
  display: grid;
  grid-template-columns: 0.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
}

.activity-item:last-child { border-bottom: 0; }
.activity-item i { width: 0.45rem; height: 0.45rem; background: var(--forest); border-radius: 50%; }
.activity-item time { color: var(--muted); font-family: var(--mono); font-size: 0.6rem; }

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

.reliability-card {
  display: flex;
  min-height: 19rem;
  flex-direction: column;
  padding: 1.25rem;
}

.reliability-card__icon {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  margin-bottom: 1.2rem;
  place-items: center;
  color: var(--forest);
  background: #edf3de;
  border-radius: 0.7rem;
  font-family: var(--mono);
  font-weight: 700;
}

.reliability-card--error .reliability-card__icon { color: var(--danger); background: #f8e7e2; }
.reliability-card--stalled .reliability-card__icon { color: var(--warning); background: #fff1d9; }

.reliability-card p {
  flex: 1;
  margin-bottom: 1.2rem;
}

.probe-result {
  min-height: 4.2rem;
  margin-top: 0.8rem;
  padding: 0.7rem;
  color: var(--muted);
  background: #eeece5;
  border-radius: 0.55rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.probe-result.is-success { color: #27563b; background: #e8f3e6; }
.probe-result.is-error { color: #7d322e; background: #f8e7e2; }
.probe-result.is-pending { color: #745018; background: #fff1d9; }

@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog-hero { grid-template-columns: 1fr 15rem; }
  .catalog-hero__monogram { right: 2rem; }
  .reliability-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .welcome { grid-template-columns: 1fr; }
  .welcome__content { min-height: 64vh; padding: 4rem 2rem; }
  .welcome__aside { min-height: 36rem; }
  .app-shell { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .sidebar nav a { justify-content: center; padding: 0.55rem; font-size: 0; }
  .sidebar nav a > span { font-size: 1rem; }
  .nav-label, .sidebar__note { display: none; }
  .nav-count { position: absolute; margin: -1.6rem 0 0 1.6rem; font-size: 0.58rem; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-hero { grid-template-columns: 1fr; }
  .catalog-hero__art { display: none; }
  .split-layout, .checkout-shell { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .cart-item { grid-template-columns: 4rem minmax(0, 1fr) 5rem; }
  .cart-item .line-total { display: none; }
  .inventory-row { grid-template-columns: 3.5rem minmax(0, 1fr) auto; }
  .inventory-row__stock { display: none; }
}

@media (max-width: 560px) {
  .app-shell { display: block; padding-bottom: 4.2rem; }
  .topbar { height: 4.2rem; padding: 0 0.8rem; }
  .brand small, .session-chip { display: none; }
  .sidebar { position: fixed; z-index: 30; top: auto; right: 0; bottom: 0; left: 0; display: block; width: auto; height: 4.2rem; padding: 0.45rem; border: 1px solid var(--line); }
  .sidebar nav { display: grid; grid-template-columns: repeat(6, 1fr); }
  .sidebar nav a { min-height: 3.2rem; }
  .main { padding: 1rem; }
  .catalog-hero { min-height: 16rem; }
  .catalog-hero__copy { padding: 2rem; }
  .catalog-hero h1 { font-size: 3.2rem; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar select { width: 100%; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card__image { min-height: 15rem; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .step span { display: none; }
  .order-card { grid-template-columns: 1fr auto; }
  .order-card__id { grid-column: 1 / -1; }
  .fulfillment-row, .inventory-row { align-items: stretch; grid-template-columns: 1fr; }
  .fulfillment-row__actions, .inventory-row__actions { justify-content: flex-start; }
  .welcome h1 { font-size: 4.4rem; }
  .welcome__facts { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
