/* Кабинет опта Blue Hawaii Roast. Стиль — монохром в духе Surf Coffee (обжарка Blue Hawaii — производство Surf).
   Точные цвета и шрифт из брендбука подставляются только здесь, в токенах :root. */
:root {
  --bg: #f3f3f1; --card: #ffffff; --card-2: #f7f7f5; --text: #111111; --muted: #6e6e6a; --faint: #a3a39e; --text-secondary: #62625f;
  --line: #e4e4e0; --primary: #111111; --primary-ink: #ffffff; --primary-soft: #ededea; --primary-line: #cfcfca; --accent-text: #111111;
  --ok: #1d7a45; --ok-soft: #e3f3e8; --warn: #9a6512; --warn-soft: #fbefd6; --danger: #c0281f; --danger-soft: #fbe6e4;
  --p-washed: #2bb39a; --p-natural: #e07bab; --p-anaerobic: #9d7fd6; --p-blend: #b4bcc3;
  --radius: 8px; --radius-sm: 6px; --shadow: none;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --tabbar-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0b0b; --card: #161616; --card-2: #1d1d1d; --text: #f2f2f0; --muted: #9a9a95; --faint: #6b6b67; --text-secondary: #acaca7;
  --line: #2a2a2a; --primary: #f2f2f0; --primary-ink: #111111; --primary-soft: #262626; --primary-line: #3a3a3a; --accent-text: #f2f2f0;
  --ok: #4cc27f; --ok-soft: #173326; --warn: #e2b04a; --warn-soft: #3a2d12; --danger: #f07a70; --danger-soft: #3d1c1a;
  --shadow: none; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0b; --card: #161616; --card-2: #1d1d1d; --text: #f2f2f0; --muted: #9a9a95; --faint: #6b6b67; --text-secondary: #acaca7;
    --line: #2a2a2a; --primary: #f2f2f0; --primary-ink: #111111; --primary-soft: #262626; --primary-line: #3a3a3a; --accent-text: #f2f2f0;
    --ok: #4cc27f; --ok-soft: #173326; --warn: #e2b04a; --warn-soft: #3a2d12; --danger: #f07a70; --danger-soft: #3d1c1a;
    --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
.wordmark { font-family: var(--font-display); font-weight: 900; letter-spacing: .04em; font-size: 15px; }
.boot { padding: 40vh 16px; text-align: center; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .xs { font-size: 12px; }
.bold { font-weight: 600; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; } .row.between { justify-content: space-between; }
.row.top { align-items: flex-start; } .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page, #content, .card, .modal, .page-h > *, .card-h > * { min-width: 0; }
.page, .modal { overflow-wrap: anywhere; }
.page .btn, .modal .btn { max-width: 100%; white-space: normal; text-align: center; padding-top: 8px; padding-bottom: 8px; }
.card-h { flex-wrap: wrap; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card);
  cursor: pointer; font-weight: 500; white-space: nowrap; color: var(--text); transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: none; opacity: .88; }
.btn.soft { background: var(--primary-soft); border-color: var(--primary-line); color: var(--accent-text); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.block { width: 100%; } .btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 5px; font-size: 11px; font-weight: 600; background: color-mix(in srgb, var(--primary-ink) 18%, transparent); border: 1px solid color-mix(in srgb, var(--primary-ink) 30%, transparent); }
.btn:not(.primary) .kbd { background: var(--card-2); border-color: var(--line); color: var(--muted); }
.link { color: var(--accent-text); background: none; border: 0; padding: 0; cursor: pointer; font-weight: 500; }
.iconbtn { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; cursor: pointer; color: var(--text); }
.iconbtn:hover { background: var(--card-2); }

/* Действия повторного заказа не сжимаются соседними кнопками. */
.repeat-order-card .card-h { flex-wrap: wrap; align-items: flex-start; }
.repeat-order-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.repeat-order-actions > .btn { width: 100%; min-width: 0; white-space: normal; padding: 10px 14px; }
.repeat-order-actions > .link { justify-self: start; display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.repeat-order-note { margin-top: 8px; }

/* ---------- чипы и статусы ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); } .chip.info { background: var(--primary-soft); color: var(--accent-text); }
.chip.badge-hit { background: var(--text); color: var(--bg); } .chip.badge-new { background: var(--ok-soft); color: var(--ok); }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.p-мытая { background: var(--p-washed); } .p-натуральная { background: var(--p-natural); }
.p-анаэробная { background: var(--p-anaerobic); } .p-смесь { background: var(--p-blend); }
.pill { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.pill.on { background: var(--primary-soft); border-color: var(--primary-line); color: var(--accent-text); font-weight: 600; }
.pill .cnt { color: var(--muted); font-weight: 500; font-size: 12px; }
[hidden] { display: none !important; }
.counter { min-width: 18px; height: 18px; border-radius: 9px; background: var(--primary); color: var(--primary-ink); font-size: 11px;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ---------- карточки ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.card-b { padding: 14px 16px; } .card-f { padding: 12px 16px; border-top: 1px solid var(--line); }
.list > * + * { border-top: 1px solid var(--line); }
.li { padding: 12px 16px; display: flex; gap: 12px; align-items: center; }
.big { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.label { font-size: 12px; color: var(--muted); }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--primary-soft); border: 1px solid var(--primary-line); color: var(--text); cursor: pointer; }
.banner.warn { background: var(--warn-soft); border-color: transparent; }
.banner.danger { background: var(--danger-soft); border-color: transparent; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.section-title { font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted);
  padding: 18px 16px 8px; display: flex; justify-content: space-between; }

/* ---------- статусная лента ---------- */
.lent { margin: 10px 0 4px; }
.lent-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: relative; }
.lent-step { position: relative; text-align: center; font-size: 11.5px; color: var(--muted); padding-top: 16px; }
.lent-step::before { content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 2px; background: var(--line); }
.lent-step:first-child::before { left: 50%; } .lent-step:last-child::before { right: 50%; }
.lent-step.done::before, .lent-step.cur::before { background: var(--primary); }
.lent-step.cur::before { right: 50%; }
.lent-step:first-child.cur::before { display: none; }
.lent-step i { position: absolute; top: 0; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: var(--line); }
.lent-step.done i, .lent-step.cur i { background: var(--primary); }
.lent-step.cur i { box-shadow: 0 0 0 4px var(--primary-soft); }
.lent-step.cur { color: var(--text); font-weight: 600; }
.lent-note { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- формы ---------- */
.input { width: 100%; height: 46px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card); outline: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.search { position: relative; } .search .icon { position: absolute; left: 13px; top: 13px; color: var(--muted); }
.search .input { padding-left: 42px; }
.field { display: block; } .field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- степпер ---------- */
.stepper { display: inline-flex; align-items: center; height: 40px; border-radius: 10px; background: var(--primary);
  color: var(--primary-ink); overflow: hidden; flex: none; }
.stepper button { width: 38px; height: 40px; border: 0; background: transparent; color: var(--primary-ink); cursor: pointer; font-size: 20px; }
.stepper button:hover { background: color-mix(in srgb, var(--primary-ink) 14%, transparent); }
.stepper input { width: 40px; height: 40px; border: 0; background: transparent; color: var(--primary-ink); text-align: center;
  font-weight: 650; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.add-btn { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--primary-line); background: var(--card);
  color: var(--accent-text); font-weight: 600; cursor: pointer; flex: none; white-space: nowrap; }

/* ---------- каталог ---------- */
.product { display: flex; gap: 12px; align-items: center; padding: 12px 16px; }
.thumb { width: 48px; height: 48px; border-radius: 10px; flex: none; display: flex; align-items: flex-end; overflow: hidden;
  background: var(--card-2); border: 1px solid var(--line); }
.thumb b { display: block; width: 100%; height: 30%; }
.product.off { opacity: .55; }
.product .name { font-weight: 550; }
.product .meta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.product .desc { font-size: 12.5px; color: var(--text-secondary); }
.price { font-weight: 650; white-space: nowrap; text-align: right; min-width: 74px; }
.cat-head { padding: 16px 16px 6px; display: flex; justify-content: space-between; font-size: 12px; font-weight: 650;
  letter-spacing: 0; color: var(--muted); }
.cartbar { position: sticky; bottom: 0; z-index: 5; background: var(--card); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -6px 20px rgba(0,0,0,.05); }
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; text-align: left; width: 100%; }
.choice.on { border: 2px solid var(--primary); padding: 13px; background: var(--primary-soft); }
.choice .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--faint); flex: none; margin-top: 2px; }
.choice.on .radio { border: 6px solid var(--primary); }
.slots { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.slot { flex: none; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  text-align: left; cursor: pointer; min-width: 116px; }
.slot.on { border: 2px solid var(--primary); padding: 9px 13px; background: var(--primary-soft); }
.slot b { display: block; } .slot span { font-size: 12px; color: var(--muted); }
.step-n { width: 24px; height: 24px; border-radius: 7px; background: var(--card-2); display: inline-flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 650; color: var(--muted); }

/* ---------- каркас: мобильный ---------- */
.shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px;
  background: var(--card); border-bottom: 1px solid var(--line); padding-top: calc(10px + env(safe-area-inset-top)); }
.logo { width: 36px; height: 36px; flex: none; }
.co-btn { display: flex; flex-direction: column; align-items: flex-start; border: 0; background: none; padding: 0; cursor: pointer;
  min-width: 0; text-align: left; }
.co-btn b { font-size: 15px; display: flex; align-items: center; gap: 4px; max-width: 100%; }
.co-btn span { font-size: 12px; color: var(--muted); max-width: 100%; }
.page { padding: 16px; padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); max-width: 1320px; margin: 0 auto; }
.page.with-cart { padding-bottom: calc(var(--tabbar-h) + 110px + env(safe-area-inset-bottom)); }
.page-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.page-h h1 { font-family: var(--font-display); font-size: 24px; margin: 0; letter-spacing: -.02em; font-weight: 650; }
.page-h .date { color: var(--muted); font-size: 14px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; height: var(--tabbar-h); justify-content: center;
  font-size: 11.5px; color: var(--muted); position: relative; }
.tabbar a.on { color: var(--accent-text); font-weight: 600; }
.tabbar .counter { position: absolute; top: 8px; left: calc(50% + 6px); }
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
.sidebar, .desk-only { display: none; }
.docs-aside { order: -1; }
.mob-cartbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 15; }

/* ---------- каркас: десктоп ---------- */
@media (min-width: 900px) {
  .tabbar, .mob-only { display: none !important; }
  .desk-only { display: block; }
  .page.with-cart { padding-bottom: 40px; }
  .docs-aside { order: 0; }
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
  .topbar { grid-column: 1 / -1; padding: 12px 20px; gap: 14px; }
  .topbar .search { flex: 1; max-width: 560px; }
  .topbar .search { min-width: 120px; }
  .topbar > .desk-only:last-child { flex: 0 1 600px; min-width: 0; }
  .topbar > .desk-only:last-child > .row { min-width: 0; }
  .topbar .sel:not(tr) { min-width: 0; flex: 1 1 0; }
  .topbar .sel > .ellipsis { min-width: 0; }
  .topbar .iconbtn { flex: none; }
  .topbar .search .input { height: 40px; }
  .topbar .search .icon { top: 10px; }
  .topbar .search .kbd { position: absolute; right: 10px; top: 10px; color: var(--muted); background: var(--card-2); border-color: var(--line); }
  .sel:not(tr) { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--card); cursor: pointer; max-width: 320px; font-size: 14px; }
  .sidebar { display: block; border-right: 1px solid var(--line); background: var(--card); padding: 14px 12px; position: sticky;
    top: 65px; height: calc(100vh - 65px); overflow: auto; }
  .nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text); }
  .nav a:hover { background: var(--card-2); }
  .nav a.on { background: var(--primary-soft); color: var(--accent-text); font-weight: 600; }
    .nav a .hk { margin-left: auto; font-size: 11px; color: var(--faint); letter-spacing: .1em; }
  .nav a .counter { margin-left: auto; }
  .side-block { border-top: 1px solid var(--line); margin-top: 14px; padding: 14px 12px 0; font-size: 13.5px; }
  .side-block .label { letter-spacing: 0; font-size: 12px; margin-bottom: 4px; }
  .page { padding: 24px 28px 40px; width: 100%; }
  .page-h h1 { font-size: 26px; }
  .grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.g2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .mob-cartbar { position: sticky; bottom: 0; left: auto; right: auto; }
  .cartbar { border: 1px solid var(--line); border-radius: var(--radius); margin-top: 14px; }
  .product .desc { display: block; }
}
.buy { display: flex; align-items: center; gap: 12px; flex: none; }
@media (max-width: 899px) {
  .co-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .co-line .co-name { grid-column: 1; grid-row: 1; }
  .co-line .stepper { grid-column: 1; grid-row: 2; margin-right: 0; justify-self: start; }
  .co-line > .right { grid-column: 2; grid-row: 2; min-width: 0 !important; }
  .co-line > .iconbtn { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; }
  .cartbar > .btn { max-width: 50%; min-width: 0; flex-shrink: 0; overflow-wrap: normal; }
  .product .desc { display: block; margin-top: 5px; font-size: 13px; line-height: 1.45; }
  .buy { flex-direction: column; align-items: flex-end; gap: 6px; }
  .buy .price { min-width: 0; }
}

/* ---------- модалки, шторки, тосты ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 14, 20, .45); z-index: 50; display: flex; align-items: flex-end;
  justify-content: center; animation: fade .15s; }
.modal { background: var(--card); width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .2s; }
.modal h2 { margin: 0 0 12px; font-size: 19px; }
@media (min-width: 900px) { .overlay { align-items: center; } .modal { border-radius: 18px; padding: 22px; } }
@keyframes fade { from { opacity: 0 } } @keyframes up { from { transform: translateY(24px); opacity: .6 } }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 16px); z-index: 60;
  display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { background: #111111; color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  animation: up .2s; pointer-events: auto; }
.toast.err { background: var(--danger); }
@media (min-width: 900px) { #toasts { bottom: 24px; } }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 400px; padding: 28px 22px; }
.login h1 { font-size: 22px; margin: 18px 0 6px; }
.hint { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-size: 13px; }

.skeleton { background: var(--card-2); border-radius: var(--radius); min-height: 120px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- таймер отсечки ---------- */
.timing { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.timing.hot { background: var(--text); color: var(--bg); border-color: var(--text); }
.timing.hot .muted { color: color-mix(in srgb, var(--bg) 70%, transparent); }

.assistant-turn { padding: 18px 0; border-bottom: 1px solid var(--line); }
.assistant-question { margin-left: auto; max-width: 90%; padding: 12px 16px; border-radius: 14px; background: var(--primary-soft); white-space: pre-wrap; overflow-wrap: anywhere; }

.client-notice-link { position: relative; flex: none; color: var(--text); }
.client-notice-link .counter { position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; font-size: 10px; background: var(--danger); }
.client-notice-link .counter[hidden] { display: none; }
.notice-unread { border-left: 3px solid var(--accent-text); }

/* Taste: neutral working surfaces; brand colour signals useful states and keyboard focus. */
:root { --brand: #185747; --brand-soft: #eaf3ed; --shadow: none; }
:root[data-theme="dark"] { --brand: #8bd4b6; --brand-soft: #1c332a; --shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --brand: #8bd4b6; --brand-soft: #1c332a; --shadow: none; }
}
.shell { min-height: 100dvh; }
.page-h h1 { text-wrap: balance; }
.row { min-width: 0; }
.card-h h2, .card-h h3 { overflow-wrap: anywhere; }
.card-h h2 { font-size: 17px; margin: 0; }
.section-heading, .card-h .section-heading { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.btn, .iconbtn, .pill, .add-btn, .nav a, .tabbar a {
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.btn.primary { background: var(--primary); border-color: var(--primary); }
.nav a.on, .admin .nav a.on { background: var(--primary-soft); color: var(--text); box-shadow: none; }
.tabbar a.on { color: var(--text); }
:where(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.btn:disabled { cursor: not-allowed; }
#server-cart-status { border-left: 3px solid var(--brand); background: var(--brand-soft); }
#server-cart-status p { margin: 8px 0; }
.product .name, .li .grow { min-width: 0; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover, .pill:hover, .add-btn:hover { border-color: var(--text-secondary); }
  .product:not(.off):hover { background: var(--card-2); }
}
@media (prefers-reduced-motion: no-preference) {
  .reception-panel:not(.reception-inline) { animation: portal-page-in 160ms ease-out; }
}
@keyframes portal-page-in { from { opacity: .65; } to { opacity: 1; } }
@media (max-width: 899px) {
  .page-h > .row, .page .li > .row.between { flex-wrap: wrap; }
  .page-h > .row { row-gap: 6px; }
  .page .li { min-width: 0; }
  .stepper input, .input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.lent-step { font-size: 11px; overflow-wrap: normal; }
@media (min-width: 900px) and (max-width: 1199px) {
  .grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Keep the primary customer actions on the first screen. */
.customer-overview .overview-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
.overview-shipment { margin-bottom: 16px; }
.customer-overview .repeat-order-note { margin-bottom: 0; }
.customer-overview .repeat-order-actions { gap: 12px; }
.customer-overview .repeat-order-actions .link { font-size: 13px; }
.sidebar .hk { display: none; }
.volume-details-link { margin-left: auto; }
#volume-price-notice { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.disclosure > summary, .task-context > summary { cursor: pointer; }
.disclosure > p:last-child { margin-bottom: 0; }
.coffee-feedback-earlier { margin-top: 8px; color: var(--muted); font-size: 12px; }
.coffee-feedback-earlier summary { cursor: pointer; }
.coffee-feedback-earlier .coffee-feedback { margin-top: 8px; }
.reception-privacy summary { cursor: pointer; }
.reception-privacy p { margin: 8px 0 0; }
@media (min-width: 900px) {
  .customer-overview .overview-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
}

/* Usable touch areas without relying on hover or enlarging data labels. */
@media (max-width: 899px), (pointer: coarse) {
  .stepper { height: 44px; }
  .stepper button, .stepper input { width: 44px; height: 44px; }
  .iconbtn { width: 44px; height: 44px; flex-shrink: 0; }
  .pill, .add-btn { min-height: 44px; height: auto; }
  .btn.sm, .seg button, .tabs button { min-height: 44px; height: auto; }
  .task-check-target { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; cursor: pointer; flex-shrink: 0; }
  .task-check { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
}
@media (max-width: 599px) {
  .product { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 6px 12px; align-items: start; }
  .product > .thumb { grid-column: 1; grid-row: 1 / span 2; }
  .product > .grow { display: contents; }
  .product > .grow > .row { grid-column: 2; grid-row: 1; }
  .product .meta { grid-column: 2; grid-row: 2; }
  .product .desc { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; }
  .product > .buy { grid-column: 1 / -1; grid-row: 4; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 4px; }
  .product .buy .price { text-align: left; }
}

/* One type scale for working screens; quantities keep their existing touch areas. */
.nav a, .admin .nav a, .iconbtn, .input, .stepper, .add-btn { border-radius: var(--radius-sm); }
.big { font-weight: 650; font-variant-numeric: tabular-nums; }
.chip { flex-shrink: 0; }
@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):active, .add-btn:not(:disabled):active { opacity: .8; }
}

/* Five delivery stages stay readable on narrow order cards. */
@media(max-width:600px){
  .lent-track:has(>.lent-step:nth-child(5)){grid-auto-flow:row;gap:12px;}
  .lent-track:has(>.lent-step:nth-child(5))>.lent-step{text-align:left;padding:0 0 0 24px;}
  .lent-track:has(>.lent-step:nth-child(5))>.lent-step::before{top:-16px;left:4px;right:auto;width:2px;height:24px;}
  .lent-track:has(>.lent-step:nth-child(5))>.lent-step:first-child::before{display:none;}
  .lent-track:has(>.lent-step:nth-child(5))>.lent-step i{top:3px;left:0;margin-left:0;}
}

/* Accepted order version and its immutable history share one readable composition. */
.order-composition-line { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(90px, auto); align-items: start; }
.order-version-history > summary { cursor: pointer; min-height: 44px; }
.order-version + .order-version { border-top: 1px solid var(--line); }
.order-version p { margin: 6px 0; }
@media (max-width: 600px) {
  .order-composition-line { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .order-composition-line > :first-child { grid-column: 1 / -1; }
}
