:root {
  --red: #d31218;
  --red-dark: #9d0d12;
  --blue: #2a45a0;
  --blue-dark: #1c3278;
  --ink: #1c1916;
  --muted: #5f584f;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #e3dbcf;
  --ok: #1d7a46;
  --warn: #8a5a00;
  --bad: #8d1d22;
  --shadow: 0 10px 30px rgba(40, 28, 16, 0.08);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue-dark); }
img { max-width: 100%; display: block; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: #fff;
  padding: 8px 12px;
  z-index: 5;
}
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 4px solid var(--blue);
  padding: 12px 16px 14px;
}
.top-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.brand {
  font-family: "Lilita One", "Arial Black", sans-serif;
  color: var(--red);
  text-decoration: none;
  font-size: 1.7rem;
  letter-spacing: 0.01em;
  line-height: 1;
}
.ribbon {
  margin: 0;
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 0.92rem;
  flex: 1 1 100%;
}
.cart-link {
  text-decoration: none;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cart-link span {
  background: #fff;
  color: var(--blue-dark);
  border-radius: 999px;
  min-width: 1.4rem;
  text-align: center;
  padding: 0 6px;
}
.search { display: flex; gap: 8px; margin-top: 12px; }
.search input, .field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid #cfc4b4;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 48px;
}
.search input { flex: 1; }
.search button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--red);
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  min-height: 48px;
  cursor: pointer;
  text-decoration: none;
}
.panel .btn { margin-top: 12px; }
.btn.blue { background: var(--blue); }
.btn.ghost { background: transparent; color: var(--blue-dark); border: 1px solid #c9c1e6; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.small { min-height: 40px; padding: 8px 12px; }

.shell { display: block; padding: 16px; max-width: 1180px; margin: 0 auto; }
.panel, .item, .line, .order-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.panel { padding: 18px; }
.lede { margin-top: 0; color: var(--muted); font-size: 1.05rem; }
h1 { font-size: 1.7rem; line-height: 1.15; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0; }

.gate { max-width: 440px; margin: 24px auto; }
.brand-lock {
  font-family: "Lilita One", sans-serif;
  color: var(--red);
  font-size: 2.2rem;
  margin: 0;
}

.depts { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 12px; }
.chip, .status-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
  cursor: pointer;
  min-height: 40px;
}
.chip[aria-pressed="true"], .status-chip[aria-pressed="true"] {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 14px; color: var(--muted); }
.toolbar label { display: flex; gap: 6px; align-items: center; }
.list { display: grid; gap: 12px; }
.item { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px; }
.item.is-out { opacity: 0.72; }
.thumb {
  width: 84px;
  height: 84px;
  border-radius: 14px;
  background: linear-gradient(160deg, #f7e6e4, #e7ebf8);
  display: grid;
  place-items: center;
  font-family: "Lilita One", sans-serif;
  color: var(--blue-dark);
  font-size: 1.4rem;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { margin: 0; color: var(--blue); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.meta, .stock { margin: 4px 0; color: var(--muted); }
.price { margin: 4px 0; font-weight: 700; font-size: 1.15rem; }
.stock.ok { color: var(--ok); font-weight: 700; }
.stock.warn { color: var(--warn); font-weight: 700; }
.stock.bad { color: var(--bad); font-weight: 700; }
.buy { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.stepper { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; flex: 0 0 auto; }
.stepper button { width: 44px; height: 44px; border: 0; background: #f6f2ea; cursor: pointer; }
.stepper input { width: 56px; border: 0; text-align: center; height: 44px; padding: 0; }
[hidden] { display: none !important; }

.pager { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.banner { border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.banner.bad { background: #fde8e6; color: var(--bad); }
.banner.ok { background: #e5f6ec; color: var(--ok); }
.skeleton { height: 110px; border-radius: 18px; background: linear-gradient(90deg, #efe8dc, #f7f3ec, #efe8dc); background-size: 200% 100%; animation: shine 1.2s infinite; }
@keyframes shine { to { background-position: -200% 0; } }

.line { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 14px; margin-bottom: 10px; }
.fields { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; font-weight: 600; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice label { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; font-weight: 600; }
.choice input { margin-right: 6px; }
.big-number { font-family: "Lilita One", sans-serif; font-size: 2.2rem; color: var(--red); margin: 8px 0; letter-spacing: 0.02em; }
.cart-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: var(--blue-dark);
  color: #fff;
  text-decoration: none;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 700;
  box-shadow: var(--shadow);
  z-index: 3;
}
.foot { padding: 28px 16px 88px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; max-width: 1180px; margin: 0 auto; }
.order-card { padding: 14px; margin-bottom: 10px; }
.order-card a { font-weight: 700; text-decoration: none; }
.status { display: inline-block; border-radius: 999px; padding: 2px 8px; background: #ece7f8; color: var(--blue-dark); font-size: 0.85rem; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pick-check { width: 18px; height: 18px; }

@media (min-width: 960px) {
  .top { padding: 16px 28px; }
  .top-row { display: grid; grid-template-columns: auto 1fr auto; }
  .ribbon { flex: unset; }
  .search { margin-top: 0; grid-column: 1 / -1; }
  .shell { display: grid; grid-template-columns: 240px 1fr; gap: 22px; padding: 22px 28px 40px; }
  .shell:has(#depts[hidden]) { grid-template-columns: 1fr; }
  .depts { display: grid; align-content: start; position: sticky; top: 132px; max-height: calc(100vh - 160px); overflow: auto; }
  .chip { text-align: left; white-space: normal; }
  .item { grid-template-columns: 96px 1fr auto; align-items: center; }
  .buy { grid-column: auto; margin-top: 0; }
  .cart-bar { left: auto; width: 360px; right: 28px; }
}

@media print {
  .top, .depts, .foot, .cart-bar, .no-print, .search { display: none !important; }
  body { background: #fff; }
  .panel, .line, .order-card { box-shadow: none; }
  .shell { display: block; max-width: none; padding: 0; }
}
