:root {
  color-scheme: light;
  --page: #f0efeb;
  --paper: #f9f8f5;
  --white: #fff;
  --ink: #191918;
  --muted: #65645d;
  --line: #d9d7d0;
  --accent: #bc361f;
  --space: clamp(12px, 3vw, 28px);
  font-family: Arial, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 290px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); }
img { display: block; width: 100%; }
h1, h2, h3, p { margin: 0; }
.masthead { position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 1px solid var(--line); }
.mast-inner, .shell { max-width: 1200px; margin: 0 auto; padding-inline: var(--space); }
.mast-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.mast-inner nav { display: flex; align-items: center; gap: 10px; }
.brand { padding: 0; border: 0; background: none; font-weight: 950; line-height: .95; font-size: clamp(28px, 7vw, 36px); letter-spacing: -.11em; }
.brand span { color: var(--accent); margin-left: 2px; }
.nav-item { min-height: 40px; border: 0; border-radius: 3px; background: transparent; padding: 4px 6px; font-size: 14px; font-weight: 700; }
.cart-link { display: inline-flex; align-items: center; gap: 7px; }
#cart-count { display: grid; place-items: center; min-width: 25px; padding: 4px; background: var(--ink); color: var(--white); border-radius: 20px; font-size: 11px; }
.shell { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
.page-title { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin: 28px 0 15px; }
.page-title h1 { font-size: clamp(32px, 8vw, 63px); letter-spacing: -.075em; line-height: 1; font-weight: 900; }
.page-title p { color: var(--muted); white-space: nowrap; font-size: 13px; }
.browse-tools { display: grid; grid-template-columns: minmax(125px, 1fr) minmax(125px, 40%); gap: 8px; margin-bottom: 12px; }
.query { position: relative; }
.query::before { content: ''; position: absolute; width: 12px; height: 12px; border: 1.6px solid var(--ink); border-radius: 50%; left: 13px; top: 14px; pointer-events: none; }
.query::after { content: ''; position: absolute; left: 23px; top: 25px; width: 6px; height: 1.6px; background: var(--ink); transform: rotate(45deg); pointer-events: none; }
.query input, .sort, .form input, .form textarea { min-width: 0; width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 0; padding: 10px; font-size: 16px; }
.query input, .sort { min-height: 42px; }
.query input { padding-left: 35px; }
.sort { color: var(--ink); }
.categories { display: flex; gap: 7px; overflow-x: auto; padding: 2px 1px 7px; margin-bottom: 12px; scrollbar-width: thin; }
.chip { flex-shrink: 0; white-space: nowrap; padding: 8px 12px; min-height: 36px; border: 1px solid var(--line); border-radius: 20px; background: transparent; font-size: 13px; }
.chip[aria-pressed="true"], .size[aria-pressed="true"] { color: var(--white); background: var(--ink); border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(8px, 2vw, 18px); align-items: stretch; }
.product { min-width: 0; background: var(--paper); display: flex; flex-direction: column; }
.product-image { border: 0; padding: 0; background: #e5e4e1; width: 100%; }
.product-image img { aspect-ratio: 1 / 1.16; object-fit: cover; }
.card-info { padding: 9px 10px 10px; flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
.sku { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .085em; }
.card-name { font-size: clamp(13px, 3.4vw, 17px); line-height: 1.22; letter-spacing: -.025em; font-weight: 800; min-height: 2.44em; }
.card-footer { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-top: auto; }
.price { font-size: clamp(14px, 3.8vw, 19px); font-weight: 850; letter-spacing: -.045em; color: var(--accent); }
.quick { background: var(--ink); color: var(--white); border: 0; border-radius: 50%; min-width: 37px; min-height: 37px; padding: 0; line-height: 1; font-size: 23px; }
.button, .back { min-height: 43px; padding: 10px 13px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.primary { min-height: 47px; background: var(--ink); color: var(--white); border-color: var(--ink); }
.accent { background: var(--accent); border-color: var(--accent); }
.back { margin-top: 16px; min-height: 33px; padding: 5px 8px; }
.page-narrow { max-width: 690px; margin: 0 auto; }
.surface, .notice { background: var(--paper); padding: 17px; border: 1px solid var(--line); }
.notice { line-height: 1.45; }
.notice.error { color: #8e2414; }
.stack { display: grid; gap: 12px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.row p, .small { color: var(--muted); font-size: 13px; }
.item { display: grid; grid-template-columns: 77px minmax(0, 1fr); gap: 12px; padding: 10px; background: var(--paper); border: 1px solid var(--line); }
.item img { height: 88px; object-fit: contain; background: #e7e6e4; }
.item-info { display: grid; align-content: center; gap: 7px; min-width: 0; }
.item-info h2, .item-info h3 { font-size: 15px; overflow-wrap: anywhere; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button, .close { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--white); font-size: 19px; }
.totals { display: grid; gap: 12px; margin-top: 12px; }
.totals strong, .amount { font-size: 23px; }
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; }
.form textarea { min-height: 65px; resize: vertical; }
.fields-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .65fr); gap: 8px; }
.status { color: var(--muted); font-size: 13px; }
.status[data-state="review"] { color: #8b4d09; }
.status[data-state="confirmed"] { color: #246146; }
.receipt-img { width: auto; max-width: 100%; max-height: 420px; object-fit: contain; }
.order-button { text-align: left; width: 100%; }
#sheet { max-width: min(100% - 16px, 475px); width: 100%; max-height: 90dvh; padding: 0; border: 0; background: var(--paper); color: var(--ink); }
#sheet::backdrop { background: rgb(20 20 17 / 60%); }
.sheet-photo { max-height: 40dvh; object-fit: contain; background: #e6e5e2; }
.sheet-body { padding: 16px; }
.sheet-body h2 { font-size: clamp(19px, 6vw, 29px); letter-spacing: -.045em; }
.sheet-body p { line-height: 1.4; }
.sheet-head { position: relative; }
.close { position: absolute; top: 8px; right: 8px; }
.sizes { display: flex; gap: 8px; }
.size { min-width: 47px; min-height: 38px; border: 1px solid var(--line); background: var(--white); }
#toast { position: fixed; z-index: 5; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); background: var(--ink); color: white; padding: 12px 16px; text-align: center; font-size: 14px; }

@media (min-width: 680px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .browse-tools { max-width: 570px; }
  .mast-inner { min-height: 76px; }
  .page-title { margin-top: 36px; }
}
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .card-info { padding: 12px; }
}
