/* =================================================================
   ЦИФРУС · Курьер · main.css
   Aesthetic: Industrial Brutalism / Cargo Manifest
   Палитра — бренд Цифрус (#6e419e / #2aad6f), кремовый фон,
   sharp corners, hard shadows, big condensed display type.
   ================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700;800&family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap");

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* surface */
  --bg:        #f4efe6;
  --surface:   #ffffff;
  --ink:       #0a0a0a;
  --ink-2:     #2c2620;
  --sub:       #6f6962;
  --rule:      #0a0a0a;
  --shadow:    4px 4px 0 0 #0a0a0a;
  --shadow-sm: 2px 2px 0 0 #0a0a0a;

  /* brand */
  --purple:        #6e419e;
  --purple-deep:   #5a3382;
  --green:         #2aad6f;
  --green-bright:  #26D07C;

  /* status */
  --st-assigned:    #475569;
  --st-accepted:    #6e419e;
  --st-en-route:    #d97706;
  --st-arrived:     #84cc16;
  --st-delivered:   #2aad6f;
  --st-failed:      #b91c1c;
  --st-rescheduled: #6d28d9;

  /* type */
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body:    "Manrope", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "Courier New", monospace;
}

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

/* Бумажная сетка фона. */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(to right, rgba(10,10,10,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10,10,10,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}

/* ---------- topbar (общий для app/order) ---------- */
.topbar {
  background: var(--ink);
  color: var(--bg);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; z-index: 5;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 800; font-size: 22px;
  letter-spacing: 0.02em; line-height: 1;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.wordmark .dot { width: 12px; height: 12px; background: var(--green-bright); }

.me {
  font-family: var(--font-display);
  font-weight: 800; font-size: 16px;
  text-transform: uppercase; letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 8px;
}
.me .avatar {
  width: 28px; height: 28px;
  background: var(--green-bright);
  color: var(--ink);
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.me .logout {
  background: transparent; border: 2px solid var(--bg); color: var(--bg);
  font-family: var(--font-body); font-weight: 700; font-size: 11px;
  padding: 4px 8px; min-height: 0;
  text-transform: uppercase; letter-spacing: 0.08em;
  cursor: pointer; border-radius: 0; margin-left: 4px;
}
.me .logout:active { background: var(--bg); color: var(--ink); }

/* C7: правая группа топбара — «История» + sync-pill (В сети остаётся). */
.top-actions { display: flex; align-items: center; gap: 8px; }
.topbtn {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; color: var(--bg);
  border: 2px solid var(--bg);
  font-family: var(--font-display); font-weight: 800; font-size: 12px;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 8px 3px; cursor: pointer; border-radius: 0;
  white-space: nowrap; text-decoration: none;
}
.topbtn:active { background: var(--bg); color: var(--ink); }
/* Длинное имя курьера сжимается с эллипсисом, чтобы топбар не переполнялся. */
.me { min-width: 0; }
.me #me-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- back button ---------- */
.backbtn {
  background: transparent; border: 2px solid var(--bg); color: var(--bg);
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
  padding: 6px 10px;
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; border-radius: 0;
}
.backbtn::before { content: "← "; }

/* ---------- sheet wrap (контент страницы) ---------- */
.sheet {
  flex: 1;
  padding: 20px 16px 96px;
  display: flex; flex-direction: column;
}

/* ---------- doc-meta ---------- */
.doc-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--sub);
  text-transform: uppercase;
  display: flex; justify-content: space-between;
  border-bottom: 1px dashed var(--ink);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

/* ---------- screen title ---------- */
.screen-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: 40px;
  line-height: 0.92; letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.screen-title em {
  font-style: normal; color: var(--purple);
  display: inline-block; border-bottom: 4px solid var(--purple);
}
.screen-sub {
  font-size: 15px;
  color: var(--ink-2);
  margin: 0 0 24px;
  max-width: 28em;
}

/* ---------- step (login flow) ---------- */
.step {
  background: var(--surface);
  border: 2px solid var(--rule);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
  position: relative;
}
.step.is-disabled { opacity: 0.4; box-shadow: var(--shadow-sm); pointer-events: none; }

.step-num {
  position: absolute; top: -2px; left: -2px;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-display);
  font-weight: 800; font-size: 22px; line-height: 1;
  padding: 8px 12px 6px;
  letter-spacing: 0.02em;
}
.step-title {
  font-family: var(--font-body);
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--sub);
  margin: 0 0 14px;
  padding-left: 56px;
  min-height: 32px;
  display: flex; align-items: center;
}

/* ---------- field ---------- */
.field {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--ink);
  padding: 16px 14px;
  font-family: var(--font-mono);
  font-weight: 500; font-size: 22px; line-height: 1;
  color: var(--ink);
  letter-spacing: 0.04em;
  -webkit-appearance: none; appearance: none;
  border-radius: 0; outline: none;
  transition: box-shadow 80ms linear, transform 80ms linear;
}
.field::placeholder { color: var(--sub); letter-spacing: 0.04em; }
.field:focus { box-shadow: var(--shadow-sm); transform: translate(-2px, -2px); }
.field-otp { font-size: 30px; letter-spacing: 0.45em; text-align: center; padding-left: 0.45em; }

.hint { margin-top: 10px; font-size: 13px; color: var(--sub); line-height: 1.4; }
.hint strong { color: var(--ink); font-weight: 600; }

/* ---------- btn ---------- */
.btn {
  display: block;
  width: 100%;
  background: var(--purple); color: #fff;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 18px;
  min-height: 56px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 22px;
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; border-radius: 0;
  transition: transform 80ms linear, box-shadow 80ms linear;
  margin-top: 14px;
}
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 0 #0a0a0a; }
.btn[disabled] { background: var(--sub); color: var(--bg); cursor: not-allowed; box-shadow: var(--shadow-sm); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:active { background: var(--ink); color: var(--bg); }

/* timer строка под OTP */
.timer {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.04em;
  color: var(--sub); text-align: center; text-transform: uppercase;
}
.timer b { color: var(--ink); }
.timer a { color: var(--ink); text-decoration: underline; }

/* ---------- footer ---------- */
.foot { margin-top: auto; padding-top: 32px; text-align: center; }
.stamp {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800; font-size: 18px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--purple); border: 2px solid var(--purple);
  padding: 6px 14px 4px;
  transform: rotate(-2deg);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}
.tag { margin-top: 14px; font-style: italic; font-size: 13px; color: var(--ink-2); }
.tag::before, .tag::after { content: "— "; color: var(--sub); }
.tag::after { content: " —"; }

/* ---------- shake ---------- */
.shake { animation: shake 0.32s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* =================================================================
   ORDER LIST CARD (app.html)
   ================================================================= */

.order-list { display: flex; flex-direction: column; gap: 14px; }

.order-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 14px 14px 14px 22px;
  text-decoration: none;
  color: inherit;
  display: block;
}
.order-card::before {
  content: "";
  position: absolute;
  top: -2px; left: -2px; bottom: -2px;
  width: 10px;
  background: var(--st-color, var(--st-assigned));
}
.order-card[data-status="assigned"]    { --st-color: var(--st-assigned); }
.order-card[data-status="accepted"]    { --st-color: var(--st-accepted); }
.order-card[data-status="en_route"]    { --st-color: var(--st-en-route); }
.order-card[data-status="arrived"]     { --st-color: var(--st-arrived); }
.order-card[data-status="delivered"]   { --st-color: var(--st-delivered); }
.order-card[data-status="failed"]      { --st-color: var(--st-failed); }
.order-card[data-status="rescheduled"] { --st-color: var(--st-rescheduled); }
/* legacy */
.order-card[data-status="new"],
.order-card[data-status="imported"],
.order-card[data-status="sms_sent"] { --st-color: var(--st-assigned); }

.order-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px;
  border-bottom: 1px dashed var(--ink);
  padding-bottom: 8px; margin-bottom: 8px;
}
.order-num {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 700; letter-spacing: 0.03em;
}
.order-status-tag {
  font-family: var(--font-display);
  font-weight: 800; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: #fff;
  background: var(--st-color);
  padding: 3px 7px 1px;
  white-space: nowrap;
}
.order-card.is-pending {
  border-style: dashed;
}
.order-card.is-pending .order-status-tag::after {
  content: " · ⌛";
}
.order-addr {
  font-family: var(--font-display);
  font-weight: 700; font-size: 20px; line-height: 1.1;
  margin: 0 0 5px;
}
.order-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 13px; color: var(--ink-2);
}
.order-meta b { color: var(--ink); font-weight: 600; }
.order-window {
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.02em;
}
/* C4: чип даты доставки — срочность цветом (сегодня/завтра/прошлое/дальше). */
.order-date {
  font-family: var(--font-mono);
  font-weight: 700; font-size: 11px; letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 7px 1px;
  border: 1.5px solid var(--ink); background: var(--surface);
  white-space: nowrap; align-self: center;
}
.order-date.is-today    { background: var(--green);        color: #fff; border-color: var(--green); }
.order-date.is-tomorrow { background: var(--st-en-route);  color: #fff; border-color: var(--st-en-route); }
.order-date.is-past     { color: var(--st-failed); border-color: var(--st-failed); }
.order-date.is-future   { color: var(--sub); }

/* C5: маркер выбора + отмеченная карточка + нижний bulk-бар. */
.oh-num-wrap { display: inline-flex; align-items: center; gap: 10px; }
.mk {
  width: 24px; height: 24px; flex: none; padding: 0;
  border: 2px solid var(--ink); background: var(--surface);
  box-shadow: var(--shadow-sm); cursor: pointer; border-radius: 0;
  position: relative;
}
.mk.on { background: var(--purple); border-color: var(--purple); }
.mk.on::after { content: ""; position: absolute; inset: 5px; background: #fff; }

.order-card.is-marked { border-color: var(--purple); box-shadow: 5px 5px 0 0 var(--purple); background: #f0eaf6; }
.order-card.is-marked::before { background: var(--purple); }

.bulk-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--ink); padding: 13px 16px;
  display: flex; gap: 11px;
}
.bulk-bar.hidden { display: none; }
.bulk-btn {
  flex: 1; border-radius: 0; cursor: pointer; color: #fff;
  font-family: var(--font-display); font-weight: 900; font-size: 16px;
  letter-spacing: 0.03em; text-transform: uppercase;
  padding: 14px 8px; border: 2px solid var(--surface);
}
.bulk-btn.hidden { display: none; }
.bulk-btn .cnt { font-family: var(--font-mono); font-size: 13px; }
.b-acc { background: var(--st-accepted); border-color: var(--st-accepted); }
.b-route { background: var(--st-en-route); border-color: var(--st-en-route); }
body.has-bulk-bar .sheet { padding-bottom: 84px; }

.empty-list {
  text-align: center; padding: 40px 16px;
  color: var(--sub);
  font-family: var(--font-display);
  font-weight: 700; font-size: 22px;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* =================================================================
   ORDER DETAIL (order.html)
   ================================================================= */

.order-detail {
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.order-detail header {
  background: var(--ink); color: var(--bg);
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px;
}
.order-detail header .num {
  font-family: var(--font-mono);
  font-weight: 700; font-size: 14px;
  letter-spacing: 0.06em;
}
.order-detail header .stage {
  font-family: var(--font-display);
  font-weight: 800; font-size: 16px;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 10px 1px;
  background: var(--st-color, var(--st-assigned)); color: #fff;
}
.order-detail .body { padding: 16px; }
.order-detail h1 {
  font-family: var(--font-display);
  font-weight: 800; font-size: 28px; line-height: 1.05;
  margin: 0 0 8px;
}
.order-detail .row {
  display: flex; gap: 12px;
  padding: 9px 0;
  border-top: 1px dashed var(--ink);
  font-size: 15px;
}
.order-detail .row:first-of-type { border-top: 0; }
.order-detail .row .k {
  font-family: var(--font-body);
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--sub);
  width: 86px; flex: none;
}
.order-detail .row .v { flex: 1; color: var(--ink); word-break: break-word; }
.order-detail .row .v.mono { font-family: var(--font-mono); font-weight: 500; }
.order-detail .row .v a { color: var(--purple); text-decoration: underline; }

/* =================================================================
   STATUS PILLS (order.html)
   ================================================================= */

.status-block {
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 22px;
}
.status-block h2 {
  font-family: var(--font-body);
  font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--sub);
  margin: 0 0 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.status-block h2 .now {
  font-family: var(--font-display);
  font-weight: 800; font-size: 14px; letter-spacing: 0.04em;
  color: var(--st-color, var(--st-accepted));
  border: 2px solid currentColor;
  padding: 1px 7px 0;
}

.pill-primary {
  display: block; width: 100%;
  background: var(--st-color, var(--st-accepted));
  color: #fff;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  min-height: 64px;
  padding: 14px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 24px;
  text-transform: uppercase; letter-spacing: 0.03em;
  cursor: pointer; border-radius: 0;
  margin-bottom: 12px;
  text-align: center;
  transition: transform 80ms linear, box-shadow 80ms linear;
}
.pill-primary:active { transform: translate(4px, 4px); box-shadow: 0 0 0 0 #0a0a0a; }

.pill-more {
  margin-top: 12px;
  width: 100%;
  background: transparent; color: var(--ink);
  border: 2px dashed var(--ink);
  box-shadow: none;
  font-family: var(--font-body);
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 12px; min-height: 48px;
  cursor: pointer; border-radius: 0;
}
.pill-more:active { background: var(--ink); color: var(--bg); }

/* C2: аккордеон «Другие статусы» — проблемные (Отказ/Перенос) + возврат на пройденный */
.pill-more .chev { display: inline-block; transition: transform 0.2s; }
.pill-more.is-open .chev { transform: rotate(180deg); }

.other-wrap {
  border: 2px solid var(--ink); border-top: none;
  background: var(--surface);
  padding: 13px;
  margin-top: -2px;
}
.other-wrap.hidden { display: none; }

.other-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 13px;
}
.obtn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px 8px;
  border: 2px solid var(--ink); background: var(--bg);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-weight: 800; font-size: 18px;
  letter-spacing: 0.03em; text-transform: uppercase;
  cursor: pointer; border-radius: 0; min-height: 52px;
  transition: transform 80ms linear, box-shadow 80ms linear;
}
.obtn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 0 #0a0a0a; }
.obtn .dot { width: 12px; height: 12px; flex: none; }
.obtn.danger { color: var(--st-failed); } .obtn.danger .dot { background: var(--st-failed); }
.obtn.warn { color: var(--st-rescheduled); } .obtn.warn .dot { background: var(--st-rescheduled); }

.other-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; color: var(--sub);
  text-transform: uppercase; margin-bottom: 8px;
}
.back-row { display: flex; flex-wrap: wrap; gap: 8px; }
.back-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 8px 11px;
  border: 2px solid var(--ink); background: var(--bg);
  box-shadow: var(--shadow-sm);
  cursor: pointer; border-radius: 0; color: var(--ink);
}
.back-pill:active { transform: translate(2px, 2px); box-shadow: 0 0 0 0 #0a0a0a; }
.back-pill .dot { width: 9px; height: 9px; background: var(--pc, var(--st-assigned)); flex: none; }

/* =================================================================
   SYNC PILL (header)
   ================================================================= */

.sync {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--ink);
  padding: 5px 8px 3px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.06em;
  cursor: pointer; border-radius: 0;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.sync .led {
  width: 9px; height: 9px;
  background: var(--sub);
  flex: none; position: relative;
}
.sync .count {
  font-family: var(--font-mono);
  font-weight: 700; font-size: 12px; letter-spacing: 0.02em;
  background: var(--ink); color: var(--bg);
  padding: 0 5px;
  margin-left: 2px;
}

.sync.is-online .led { background: var(--green-bright); }
.sync.is-online .led::after {
  content: "";
  position: absolute; inset: -3px;
  background: var(--green-bright);
  opacity: 0.4;
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2.6); opacity: 0; }
}

.sync.is-syncing { background: #fff5e0; }
.sync.is-syncing .led {
  background: #d97706;
  animation: blink 0.6s steps(2, end) infinite;
}
@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

.sync.is-offline-queue {
  background: #ffe8e3;
  border-color: var(--st-failed);
  color: var(--st-failed);
}
.sync.is-offline-queue .led { background: var(--st-failed); }
.sync.is-offline-queue .count { background: var(--st-failed); }

.sync.is-offline { background: var(--bg); color: var(--sub); }
.sync.is-offline .led { background: var(--sub); }

/* =================================================================
   TOAST (низ экрана)
   ================================================================= */
.toast-wrap {
  position: fixed; left: 16px; right: 16px; bottom: 24px;
  z-index: 50;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--ink); color: var(--bg);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 0;
  animation: toast-in 0.18s ease-out both;
}
.toast.is-error { background: var(--st-failed); border-color: var(--st-failed); }
.toast.is-ok    { background: var(--green); border-color: var(--ink); }
@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* =================================================================
   MODAL (для comment при failed/rescheduled)
   ================================================================= */
.modal-back {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(10,10,10,0.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: 0 -4px 0 0 var(--ink);
  padding: 18px 16px 24px;
  width: 100%;
  max-width: 600px;
}
.modal h3 {
  font-family: var(--font-display);
  font-weight: 800; font-size: 24px;
  text-transform: uppercase; letter-spacing: 0.02em;
  margin: 0 0 12px;
}
.modal textarea {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--ink);
  font-family: var(--font-body); font-size: 16px;
  padding: 12px; min-height: 80px;
  border-radius: 0; resize: vertical; outline: none;
}
.modal textarea:focus { box-shadow: var(--shadow-sm); transform: translate(-2px, -2px); }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn { margin-top: 0; }

/* small helpers */
.small { font-size: 13px; color: var(--sub); }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* =================================================================
   PUSH-BANNER (бэклог 2026-05-11) — contextual prompt
   Виден ТОЛЬКО при actionable state. granted+subscribed = молчит.
   ================================================================= */
.push-banner {
  display: flex; align-items: stretch; gap: 0;
  margin: 12px 16px 0;
  border: 2px solid var(--ink);
  background: #fff5e0;
  box-shadow: var(--shadow-sm);
}
.push-banner[hidden] { display: none !important; }
.push-banner.is-denied,
.push-banner.is-unsupported {
  background: var(--surface);
  box-shadow: none;
  border-color: var(--ink-2);
}
.push-banner-text {
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px;
}
.push-banner-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--st-en-route);
}
.push-banner.is-denied .push-banner-eyebrow,
.push-banner.is-unsupported .push-banner-eyebrow {
  color: var(--ink-2);
}
.push-banner-body {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
}
.push-banner-btn {
  background: var(--ink);
  color: var(--bg);
  border: 0; border-left: 2px solid var(--ink);
  padding: 0 14px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  min-width: 96px;
  border-radius: 0;
}
.push-banner-btn:active {
  transform: translate(1px, 1px);
}
.push-banner.is-denied .push-banner-btn,
.push-banner.is-unsupported .push-banner-btn {
  background: var(--ink-2);
}
.push-banner-btn[hidden] { display: none !important; }

.is-pending-banner {
  background: #fff5e0;
  border: 2px solid var(--ink);
  padding: 8px 12px;
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* =================================================================
   CALL BLOCK (Шаг 5)
   ================================================================= */

.call-block {
  margin-top: 24px;
  margin-bottom: 24px;
}
.call-btn {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  width: 100%;
  background: var(--green);
  color: #fff;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  min-height: 64px;
  padding: 14px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 22px;
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; border-radius: 0;
  transition: transform 80ms linear, box-shadow 80ms linear;
}
.call-btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 0 #0a0a0a; }
.call-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.call-btn .call-icon {
  font-size: 26px;
  line-height: 1;
  transform: rotate(-12deg);
  display: inline-block;
}
.call-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--sub);
  margin: 8px 2px 0;
  text-transform: uppercase;
}

/* =================================================================
   PROOF BLOCK (Шаг 4)
   ================================================================= */

.proof-block {
  border: 2px solid var(--ink);
  background: var(--surface);
  padding: 18px;
  margin-top: 24px;
  box-shadow: var(--shadow);
}
.proof-block h2 {
  font-family: var(--font-display);
  font-weight: 800; font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.proof-hint {
  font-family: var(--font-body); font-size: 14px;
  color: var(--sub);
  margin: 0 0 14px;
}

.proof-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 6px;
}

/* Скрываем «системный» file-input, показываем кастомную плашку */
.proof-photo {
  display: block;
  margin-bottom: 10px;
}
.proof-photo input[type="file"] {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.proof-photo-preview {
  display: flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 12px 14px;
  background: var(--bg);
  border: 2px dashed var(--ink);
  font-family: var(--font-mono);
  font-size: 14px; letter-spacing: 0.04em;
  color: var(--ink);
  text-align: center;
  word-break: break-all;
}
.proof-photo-preview[data-empty="true"] {
  font-family: var(--font-display);
  font-weight: 700; font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.proof-photo input[type="file"]:focus + .proof-photo-preview {
  box-shadow: var(--shadow-sm);
  transform: translate(-2px, -2px);
}

.proof-online-only {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--st-failed);
  background: #ffecec;
  border: 1px solid var(--st-failed);
  padding: 6px 10px;
  margin: -6px 0 12px;
  text-transform: uppercase;
}

.proof-field-wrap {
  display: block;
  margin-bottom: 12px;
}
.proof-block .field {
  /* у глобального .field высота 56px, для proof оставляем рабочей */
  font-size: 16px;
}
.proof-block textarea.field {
  resize: vertical;
  min-height: 56px;
  height: auto;
  letter-spacing: 0;
  padding: 12px 14px;
}
.proof-block .pill-primary {
  margin-top: 6px;
}

/* ============================================================
   Шаг 7 / правки v0.4.0 — компактификация login/app/order.
   ============================================================ */

/* — login: helper-classes — */
.screen-title-compact {
  font-size: 38px;
  line-height: 1.0;
  letter-spacing: -0.02em;
  white-space: nowrap;
  margin: 8px 0 4px;
}

/* — login без прокрутки на iPhone (390×844) — */
.sheet-login {
  padding: 16px 16px 12px;
}
.sheet-login .screen-sub {
  margin-bottom: 14px;
  font-size: 14px;
}
.sheet-login .step {
  padding: 14px 14px 14px 14px;
  margin-bottom: 12px;
}
.sheet-login .step-title {
  margin-bottom: 10px;
}
/* убрать нижний bottom-padding sheet (96 → 0), чтобы поместилось */
body:has(.sheet-login) {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* — order: помещаемое на 1 экран — */
.sheet-order {
  padding: 16px 16px 12px;
  gap: 12px;
}
.sheet-order .order-detail {
  margin-bottom: 0;
}
.sheet-order .status-block {
  margin-top: 12px;
  padding: 14px;
}
.sheet-order .pill-primary {
  min-height: 56px;
  font-size: 18px;
  margin-top: 10px;
}
.sheet-order .pill-more {
  min-height: 40px;
  margin-top: 8px;
  padding: 8px 12px;
}

/* — компактный stamp в подвале app/order — */
.foot-compact {
  padding-top: 16px;
  padding-bottom: 12px;
  margin-top: auto;
  text-align: center;
}
.stamp-sm {
  display: inline-block;
  padding: 8px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--purple);
  border: 2px solid var(--purple);
  background: var(--surface);
  transform: rotate(-2deg);
  text-transform: uppercase;
}
.foot-compact .tag {
  margin-top: 8px;
}

/* — версия в Mono — */
.tag .ver {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--sub);
  text-transform: uppercase;
}
.tag {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--sub);
  text-transform: uppercase;
}
.tag::before, .tag::after { content: ""; }

/* — компактные адреса в карточках/списке (правка v0.4.4) — */
.order-addr {
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: var(--font-body) !important;
  line-height: 1.3 !important;
}
.order-detail h1 {
  font-size: 16px !important;
  font-weight: 600 !important;
  font-family: var(--font-body) !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* =================================================================
   v0.6.0 — frontend redesign (2026-05-19):
   - сумма заказа в строке-акцент
   - аккордеон «Подробности» (товары + комментарий)
   - кнопка «Из офиса» + селектор внутреннего номера
   - сводка «доставлено сегодня» на списке
   ================================================================= */

/* ---- СУММА (акцент-строка в карточке) ---- */
.order-detail .row.row-amount {
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  margin: 0 -16px;
  padding: 12px 16px;
}
.order-detail .row.row-amount .v.amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1;
}
.order-detail .row.row-amount .v.amount .cur {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--sub);
  margin-left: 4px;
}

/* ---- АККОРДЕОН «Подробности» ---- */
details.details-accordion {
  margin: 12px -16px -16px;
  border-top: 2px solid var(--ink);
  background: var(--bg);
}
details.details-accordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
details.details-accordion > summary::-webkit-details-marker { display: none; }
details.details-accordion > summary::after {
  content: "▾";
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--purple);
  transition: transform 120ms linear;
}
details.details-accordion[open] > summary::after { transform: rotate(180deg); }
details.details-accordion > .details-body {
  padding: 4px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.details-section { display: flex; flex-direction: column; gap: 6px; }
.details-section h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sub);
  margin: 0;
}

.products-list {
  margin: 0; padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--ink);
  background: var(--surface);
}
.products-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px 10px;
  align-items: baseline;
  padding: 10px 12px;
  border-top: 1px dashed var(--ink);
  font-size: 14px;
}
.products-list li:first-child { border-top: 0; }
.products-list .p-name {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  word-break: break-word;
}
.products-list .p-art {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--sub);
  margin-top: 2px;
  text-transform: uppercase;
}
.products-list .p-qty {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}
.products-list .p-sum {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}
/* Доп. доставка («премия курьеру в карман») — выделена en-route оранжевым,
   подсказка под названием объясняет: эти деньги в офис не сдавать. */
.products-list li.p-extra {
  background: color-mix(in srgb, var(--st-en-route) 8%, var(--surface));
  border-top: 2px solid var(--ink);
}
.products-list li.p-extra .p-name {
  color: var(--st-en-route);
  font-weight: 700;
}
.products-list li.p-extra .p-name .p-art {
  color: var(--ink-2);
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 500;
  font-style: italic;
}
.products-list li.p-extra .p-sum {
  color: var(--st-en-route);
  font-size: 14px;
}

/* C3: контролы возврата позиций в «Подробностях» */
.products-list li.is-returned .p-name,
.products-list li.is-returned .p-sum { text-decoration: line-through; color: var(--sub); }

.ret-btn {
  grid-column: 1 / -1; justify-self: start;
  display: inline-flex; align-items: center; gap: 7px; margin-top: 8px;
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 8px 12px;
  border: 2px dashed var(--sub); background: var(--surface); color: var(--sub);
  cursor: pointer; border-radius: 0;
}
.ret-btn.on {
  border-style: solid; border-color: var(--st-failed);
  background: var(--st-failed); color: #fff; box-shadow: var(--shadow-sm);
}
.ret-counter {
  grid-column: 1 / -1; justify-self: start;
  display: inline-flex; align-items: stretch; margin-top: 8px;
  border: 2px solid var(--st-failed); box-shadow: var(--shadow-sm); background: var(--surface);
}
.ret-counter .rlab {
  display: flex; align-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 10px;
  letter-spacing: 0.07em; text-transform: uppercase;
  background: var(--st-failed); color: #fff; padding: 0 10px;
}
.ret-counter button {
  width: 36px; border: none; background: var(--surface);
  font-family: var(--font-display); font-weight: 900; font-size: 20px;
  cursor: pointer; color: var(--ink); line-height: 1;
}
.ret-counter button:first-of-type { border-left: 2px solid var(--st-failed); border-right: 2px solid var(--st-failed); }
.ret-counter button:last-of-type { border-left: 2px solid var(--st-failed); }
.ret-counter .rc {
  display: flex; align-items: center; justify-content: center; min-width: 52px;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  padding: 8px 4px; color: var(--st-failed);
}
.ret-line {
  grid-column: 1 / -1;
  font-family: var(--font-mono); font-size: 11px; color: var(--st-failed);
  font-weight: 700; margin-top: 5px;
}
.sum-strip {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding: 12px 14px;
  background: var(--surface); border: 2px solid var(--ink); box-shadow: var(--shadow-sm);
}
.sum-strip .ss-lab {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em;
  color: var(--sub); text-transform: uppercase;
}
.sum-strip .ss-vals { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.sum-strip .ss-old { font-family: var(--font-mono); font-size: 13px; color: var(--sub); text-decoration: line-through; }
.sum-strip .ss-new { font-family: var(--font-display); font-weight: 900; font-size: 22px; color: var(--green); line-height: 1; }

.comment-block {
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  white-space: pre-wrap;
}
.empty-data {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--sub);
  text-transform: uppercase;
}

/* ---- «ИЗ ОФИСА» — кнопка + селектор внутреннего номера ---- */
.call-office-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}
.call-btn-office {
  background: var(--purple);
  color: #fff;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  min-height: 64px;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  line-height: 1;
  transition: background 80ms linear, color 80ms linear, box-shadow 80ms linear;
}
.call-btn-office:disabled,
.call-btn-office[aria-disabled="true"] {
  background: var(--bg);
  color: var(--sub);
  box-shadow: var(--shadow-sm);
  cursor: not-allowed;
}
.call-btn-office .call-icon {
  font-size: 22px;
  transform: rotate(-12deg);
  display: inline-block;
}

.ext-selector {
  position: relative;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  min-width: 130px;
  min-height: 64px;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 80ms linear, color 80ms linear;
}
.ext-selector.is-picked {
  background: var(--purple);
  color: #fff;
}
.ext-selector .ext-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 2px;
  line-height: 1;
}
.ext-selector.is-picked .ext-label {
  color: rgba(255,255,255,0.7);
}
.ext-selector .ext-value {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.ext-selector .ext-value::after {
  content: "▾";
  font-size: 14px;
  color: var(--purple);
}
.ext-selector.is-picked .ext-value::after { color: #fff; }
.ext-selector:not(.is-picked) {
  border-style: dashed;
  background: var(--bg);
}
.ext-selector:not(.is-picked) .ext-value {
  color: var(--sub);
  font-size: 26px;
  font-weight: 700;
}
.ext-selector:not(.is-picked) .ext-value::after {
  color: var(--purple);
  font-size: 18px;
  animation: nudge 1.6s ease-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}
@media (prefers-reduced-motion: reduce) {
  .ext-selector:not(.is-picked) .ext-value::after { animation: none; }
}

.ext-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: -2px;
  right: -2px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  z-index: 10;
  display: none;
  flex-direction: column;
}
.ext-selector.is-open .ext-menu { display: flex; }
.ext-menu button {
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--ink);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-align: center;
  cursor: pointer;
  color: var(--ink);
}
.ext-menu button:last-child { border-bottom: 0; }
.ext-menu button:hover,
.ext-menu button.is-active {
  background: var(--ink);
  color: var(--bg);
}

/* ---- СВОДКА «доставлено сегодня» (app.html) ---- */
.today-summary {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 14px 16px 14px 26px;
  margin: 16px 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: baseline;
}
.today-summary::before {
  content: "";
  position: absolute;
  top: -2px; left: -2px; bottom: -2px;
  width: 12px;
  background: var(--st-delivered);
}
.today-summary .ts-label {
  grid-column: 1 / 3;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sub);
}
.today-summary .ts-amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.today-summary .ts-amount .cur {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--sub);
  margin-left: 4px;
}
.today-summary .ts-count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--st-delivered);
  text-transform: uppercase;
  padding: 4px 8px;
  border: 2px solid var(--st-delivered);
  justify-self: end;
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
}
/* C7: «N заказов» кликабельно → история (фокус «сегодня»). */
.today-summary .ts-count::after { content: " →"; }
.today-summary .ts-count:active { background: var(--st-delivered); color: #fff; }

/* ---- Сумма на карточке списка (app.html) ---- */
.order-amount {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink);
}

/* =================================================================
   Касса: handover (app.html, 2026-06-03)
   - Кнопка фиксированного размера в 3 состояниях (idle / armed / pending).
   - Жёлтая «Вам начислено» приклеена к низу .today-summary.
   - Mobile-first: touch-target >= 44px (WCAG 2.5.5).
   ================================================================= */

/* Контейнер кнопки внутри грид-карточки сводки */
.today-summary .hand-slot {
  grid-column: 1 / -1;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.today-summary .hand-slot[hidden] { display: none; }

/* Базовая кнопка — общий каркас для idle / armed / pending.
   padding(10+10)+border(3+3)+content(~18px) = ~44px → 44px touch-target. */
.hand-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--green-deep);
  border: 3px solid var(--green);
  padding: 10px 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 3px 3px 0 0 var(--green-deep);
  position: relative;
  min-height: 44px;
  min-width: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.hand-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.hand-btn .ic-coin {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--green);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}
.hand-btn .arr {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--green);
  flex-shrink: 0;
}

/* ARMED — тот же размер, цвет на бренд-фиолетовый, лёгкий пульс */
.hand-btn--armed {
  color: var(--purple);
  border-color: var(--purple);
  box-shadow: 3px 3px 0 0 var(--purple-deep);
  animation: hand-armed-pulse 0.9s ease-in-out infinite;
}
.hand-btn--armed .ic-coin { background: var(--purple); color: #fff; }
.hand-btn--armed .arr { color: var(--purple); }
@keyframes hand-armed-pulse {
  0%, 100% { box-shadow: 3px 3px 0 0 var(--purple-deep); }
  50%      { box-shadow: 3px 3px 0 0 var(--purple-deep), 0 0 0 3px rgba(110, 65, 158, 0.25); }
}

/* Countdown-полоса 4с под кнопкой */
.hand-btn--armed .countdown {
  position: absolute;
  left: -3px;
  right: -3px;
  bottom: -3px;
  height: 4px;
  background: rgba(110, 65, 158, 0.18);
  overflow: hidden;
}
.hand-btn--armed .countdown::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: var(--st-en-route);
  animation: hand-cd-shrink 4s linear forwards;
}
@keyframes hand-cd-shrink {
  from { width: 100%; }
  to   { width: 0%;   }
}

/* PENDING — чёрный fill, моно-шрифт, 2 строки. Не интерактивна.
   Размер совпадает с idle/armed (та же высота paddings + height). */
.hand-btn--pending {
  cursor: default;
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 0 var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  gap: 9px;
  padding: 8px 12px;
  animation: none;
}
.hand-btn--pending .ic-coin {
  width: 10px;
  height: 10px;
  background: var(--st-en-route);
  color: transparent;
  font-size: 0;
  animation: hand-pulse-dot 1.4s infinite;
}
.hand-btn--pending .lbl {
  display: grid;
  gap: 3px;
  line-height: 1.05;
  min-width: 0;
}
.hand-btn--pending .lbl b {
  font-weight: 700;
  color: var(--green-bright);
  letter-spacing: 0;
}
.hand-btn--pending .arr {
  color: var(--st-en-route);
  letter-spacing: 0.4em;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  animation: hand-blink 1.4s infinite steps(3, end);
}

@keyframes hand-pulse-dot {
  0%, 100% { opacity: 1;    transform: scale(1);    }
  50%      { opacity: 0.35; transform: scale(0.85); }
}
@keyframes hand-blink {
  0%   { opacity: 0.3; }
  50%  { opacity: 1;   }
  100% { opacity: 0.3; }
}

/* «Сегодня доставлено» в обнулённом виде */
.today-summary.is-zeroed::before { background: var(--sub); }
.today-summary.is-zeroed .ts-amount {
  color: var(--sub);
  font-style: italic;
}
.today-summary.is-zeroed .ts-amount .cur { color: var(--sub); }
.today-summary.is-zeroed .ts-count {
  color: var(--sub);
  border-color: var(--sub);
}

/* ---- «Вам начислено сегодня» (extra-credited) ----
   Sticked-к-родителю карточка: вверх перекрывает нижнюю border+shadow
   today-summary (4px shadow + 2px border = 6px), снизу — собственная тень. */
.today-summary:has(+ .extra-credited:not([hidden])) {
  /* убираем нижнюю составляющую тени, оставляя только правую */
  box-shadow: 4px 0 0 0 var(--ink);
}
.extra-credited {
  position: relative;
  margin: -6px 0 16px;
  background: #fff5e0;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 8px 14px 9px 26px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  overflow: hidden;
}
.extra-credited[hidden] { display: none; }
.extra-credited::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 8px;
  background: var(--st-en-route);
}
.extra-credited .ec-label {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--st-en-route);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.extra-credited .ec-label::before {
  content: "+";
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  line-height: 0.8;
  color: var(--st-en-route);
}
.extra-credited .ec-amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.extra-credited .ec-amount .cur {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--sub);
  margin-left: 2px;
}
.extra-credited .ec-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sub);
  justify-self: end;
}

.extra-credited.is-muted::before { background: var(--sub); }
.extra-credited.is-muted .ec-label,
.extra-credited.is-muted .ec-label::before { color: var(--sub); }
.extra-credited.is-muted .ec-amount {
  color: var(--sub);
  font-style: italic;
}
.extra-credited.is-muted .ec-amount .cur { color: var(--sub); }

/* ---- Кнопки управления (Обновить / Очередь) — без inline ---- */
.button-control-row {
  display: flex;
  gap: 10px;
  margin: 10px 0 18px;
}
.button-control-row .btn-control {
  margin-top: 0;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  flex: 1;
}

/* =================================================================
   Mobile-tuning (<= 380px, iPhone SE / маленькие Android)
   ================================================================= */
@media (max-width: 380px) {
  .today-summary { padding: 12px 14px 12px 22px; }
  .today-summary .ts-amount { font-size: 32px; }
  .hand-btn { padding: 9px 11px; font-size: 13px; gap: 8px; }
  .hand-btn .ic-coin { width: 16px; height: 16px; font-size: 12px; }
  .hand-btn .arr { font-size: 14px; }
  .hand-btn--pending { font-size: 10px; padding: 8px 11px; }
  .extra-credited { padding: 8px 12px 9px 24px; }
  .extra-credited .ec-amount { font-size: 24px; }
  .button-control-row .btn-control { padding: 10px 12px; font-size: 13px; }
}

/* C1: контейнер чёрной плашки «На проверке» — независим от зелёной. */
.handover-pending-slot { margin: 14px 0 0; }
.handover-pending-slot[hidden] { display: none; }

/* =================================================================
   C6: ИСТОРИЯ ЗАКАЗОВ (history.html) + read-only сводка (order.html)
   ================================================================= */
.day-h { display: flex; align-items: center; gap: 10px; margin: 18px 0 11px; }
.day-h:first-of-type { margin-top: 4px; }
.day-h .d { font-family: var(--font-display); font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: 0.05em; }
.day-h .ln { flex: 1; height: 2px; background: var(--ink); }
.day-h .cc { font-family: var(--font-mono); font-size: 10.5px; color: var(--sub); letter-spacing: 0.06em; white-space: nowrap; }

.hcard { position: relative; display: block; background: var(--surface); border: 2px solid var(--ink); box-shadow: var(--shadow-sm); padding: 11px 12px 11px 16px; margin-bottom: 10px; text-decoration: none; color: var(--ink); }
.hcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--bar, var(--st-assigned)); }
.hcard:active { transform: translate(2px, 2px); box-shadow: 0 0 0 0 #0a0a0a; }
.hcard .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hcard .num { font-family: var(--font-mono); font-weight: 700; font-size: 12px; }
.hcard .htag { font-family: var(--font-mono); font-weight: 700; font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border: 1.5px solid var(--ink); color: #fff; background: var(--bar, var(--st-assigned)); }
.hcard .addr { font-size: 12.5px; font-weight: 500; color: var(--ink); line-height: 1.3; margin: 6px 0; }
.hcard .bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hcard .time { font-family: var(--font-mono); font-size: 11px; color: var(--sub); }
.hcard .time .ret { color: var(--st-failed); font-weight: 700; }
.hcard .sum { font-family: var(--font-display); font-weight: 800; font-size: 18px; }

.ro-summary { text-align: center; }
.ro-badge { display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 28px; text-transform: uppercase; letter-spacing: 0.02em; color: #fff; background: var(--st-color, var(--st-delivered)); border: 2px solid var(--ink); box-shadow: var(--shadow-sm); padding: 8px 18px; }
.ro-when { font-family: var(--font-mono); font-size: 14px; color: var(--sub); margin-top: 8px; }
