/* ════════════════════════════════════════════════════════════════════════
   desk.css — СТІЛ: вікно «Головної», таблиця рейсів, аркуші, папери.
   Усе всередині #desk > .desk-window. #desk і його псевдоелементи — не наші.
   Значення — лише з tokens.css (відтінки — color-mix від токенів).
   ════════════════════════════════════════════════════════════════════════ */

.desk-window {
  --cols: 200px 100px 244px 116px 120px 96px 84px 150px 90px;
  --row-h: 36px;
  --sec-h: 32px;
  --head-h: 32px;
  --chrome-h: 44px;
  --tabs-h: 40px;
  --foot-h: 36px;
  --c1: 200px;
  --pad: 12px;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--r-window);
  background: var(--surface);
  box-shadow: var(--sh-window), inset 0 0 0 1px var(--line);
  display: flex;
  flex-direction: column;
  color: var(--ink-1);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.3;
  font-feature-settings: 'ss01', 'cv11';
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  isolation: isolate;
}
html[data-layout='compact'] .desk-window {
  --cols: minmax(0, 1fr) 154px 96px;
  --row-h: 40px;
  --sec-h: 26px;
  --head-h: 28px;
  --c1: auto;
  --pad: 10px;
}
html[data-layout='compact'] .desk-window .dk-wide {
  display: none !important;
}
.desk-window.no-tr,
.desk-window.no-tr * {
  transition: none !important;
}

/* ── тони: колір = стадія ─────────────────────────────────────────────── */
.desk-window .t-crimson { --tone: var(--crimson); --tone-ink: var(--crimson-ink); }
.desk-window .t-cobalt { --tone: var(--cobalt); --tone-ink: var(--cobalt-ink); }
.desk-window .t-slate { --tone: var(--slate); --tone-ink: var(--slate-ink); }
.desk-window .t-raspberry { --tone: var(--raspberry); --tone-ink: var(--raspberry-ink); }
.desk-window .t-copper { --tone: var(--copper); --tone-ink: var(--copper-ink); }
.desk-window .t-gold { --tone: var(--gold); --tone-ink: var(--gold-ink); }
.desk-window .t-petrol { --tone: var(--petrol); --tone-ink: var(--petrol-ink); }
.desk-window .t-amethyst { --tone: var(--amethyst); --tone-ink: var(--amethyst-ink); }
.desk-window .t-emerald { --tone: var(--emerald); --tone-ink: var(--emerald-ink); }
.desk-window .t-indigo { --tone: var(--indigo); --tone-ink: var(--indigo-ink); }
.desk-window .t-neutral { --tone: var(--ink-4); --tone-ink: var(--ink-2); }

.dk-i {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dk-dim {
  color: var(--ink-4);
}

/* ── хром 44 ──────────────────────────────────────────────────────────── */
.dk-chrome {
  flex: none;
  height: var(--chrome-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 16px;
  background: var(--sunken);
  box-shadow: inset 0 -1px 0 var(--line);
}
.dk-chrome-l,
.dk-chrome-c,
.dk-chrome-r {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dk-chrome-r {
  justify-content: flex-end;
}
.dk-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-1);
  font-size: 13px;
}
.dk-home b {
  font-weight: 650;
}
.dk-home .dk-i {
  color: var(--ink-3);
}
.dk-period {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--r-md);
  background: var(--fill-1);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 560;
  white-space: nowrap;
}
.dk-period .dk-i {
  width: 13px;
  height: 13px;
}
.dk-mchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  background: var(--fill-1);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dk-mchip i {
  font-style: normal;
  color: var(--ink-4);
}
.dk-inbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--fill-1);
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 560;
}
.dk-inbox b {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--fill-3);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dk-inbox.is-hot {
  background: color-mix(in srgb, var(--crimson) 28%, var(--sunken));
  color: var(--crimson-ink);
}
.dk-inbox.is-hot b {
  background: var(--crimson);
  color: var(--ink-1);
}
.dk-inbox::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 2px var(--crimson);
  opacity: 0;
  pointer-events: none;
}
.dk-inbox.is-ping::after {
  animation: dk-ping 1.5s var(--ease-out) 3;
}
@keyframes dk-ping {
  0% { opacity: 0.85; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.35, 1.7); }
}

/* ── вкладки 40 ───────────────────────────────────────────────────────── */
.dk-tabs {
  flex: none;
  height: var(--tabs-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  background: var(--frame);
  box-shadow: inset 0 -1px 0 var(--line);
}
.dk-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 540;
}
.dk-tab.is-active {
  background: color-mix(in srgb, var(--raspberry) 28%, var(--frame));
  color: var(--raspberry-ink);
}
.dk-tabs-r {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-right: 6px;
  color: var(--ink-3);
  font-size: 12.5px;
}
html[data-layout='compact'] .dk-tabs,
html[data-layout='compact'] .dk-chrome-c {
  display: none;
}
html[data-layout='compact'] .dk-chrome {
  grid-template-columns: 1fr auto;
  padding: 0 10px 0 12px;
}
html[data-layout='compact'] .dk-period .dk-dim {
  display: none;
}

/* ── шапка колонок ────────────────────────────────────────────────────── */
.dk-head {
  flex: none;
  height: var(--head-h);
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line-2);
}
.dk-hc {
  padding: 0 var(--pad);
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 10px;
  font-weight: 640;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: var(--head-h);
  box-shadow: inset 1px 0 0 var(--line);
}
.dk-hc:first-child {
  box-shadow: none;
  padding-left: calc(var(--pad) + 4px);
}
.dk-hc.is-right {
  text-align: right;
}

/* ── тіло таблиці ─────────────────────────────────────────────────────── */
.dk-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}
.dk-gridbg {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: var(--cols);
  pointer-events: none;
}
.dk-gridbg i {
  box-shadow: inset 1px 0 0 var(--line);
}
.dk-gridbg i:first-child {
  box-shadow: none;
}
.dk-sec {
  position: relative;
}
.dk-sec.is-empty {
  display: none;
}
.dk-sec-head {
  position: relative;
  z-index: 1;
  height: var(--sec-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--pad) 0 calc(var(--pad) + 4px);
  background: color-mix(in srgb, var(--tone) 10%, var(--surface));
  box-shadow: inset 0 -1px 0 var(--line);
}
.dk-sec-t {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: calc(var(--c1) - var(--pad) - 4px);
  flex: none;
  color: var(--tone-ink);
  font-size: 11px;
  font-weight: 640;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dk-ring {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--tone);
  flex: none;
}
.dk-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--tone) 28%, var(--surface));
  color: var(--tone-ink);
  font-size: 11px;
  font-weight: 700;
}
.dk-sum {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 560;
}
html[data-layout='compact'] .dk-sec-t {
  width: auto;
  font-size: 10px;
}

/* ── рядок ────────────────────────────────────────────────────────────── */
.dk-row {
  position: relative;
  height: var(--row-h);
  display: grid;
  grid-template-columns: var(--cols);
  align-items: stretch;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
}
.dk-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--tone);
  z-index: 2;
}
.dk-row:hover {
  background: color-mix(in srgb, var(--tone) 7%, var(--surface));
}
.dk-row--hero {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.dk-row--hero:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.dk-row--hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
  opacity: 0;
  transition: opacity var(--t-scene) var(--ease-out);
  pointer-events: none;
  z-index: 1;
}
.dk-row--hero.is-lit::after {
  opacity: 1;
  transition-duration: var(--t-slow);
}
.dk-row--hero.is-moving {
  z-index: 5;
  box-shadow: var(--sh-pop);
}
.dk-cell {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  box-shadow: inset 1px 0 0 var(--line);
}
.dk-cell:first-child {
  box-shadow: none;
  padding-left: calc(var(--pad) + 4px);
}
.dk-cv {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: 100%;
  height: 100%;
}
.dk-cv.is-old {
  position: absolute;
  inset: 0;
  padding: inherit;
  pointer-events: none;
}
.dk-cell.is-right .dk-cv {
  justify-content: flex-end;
}
.dk-client {
  font-size: 13px;
  font-weight: 560;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dk-new-dot {
  display: none;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--crimson);
  box-shadow: 0 0 8px var(--crimson);
}
.dk-row.is-new .dk-new-dot {
  display: block;
}
.dk-row.is-new .dk-client {
  font-weight: 700;
}
.dk-bus {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}
.dk-dash {
  color: var(--ink-4);
}
.dk-dates {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
}
.dk-dates-ar {
  width: 12px;
  height: 12px;
  color: var(--ink-4);
}
.dk-amt {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-1);
  white-space: nowrap;
}
.dk-amt i {
  font-style: normal;
  font-weight: 500;
  color: var(--ink-3);
}

/* ── бейджі ───────────────────────────────────────────────────────────── */
.dk-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  max-width: 100%;
  min-width: 0;
  padding: 0 9px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--tone) 28%, var(--surface));
  color: var(--tone-ink);
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
}
.dk-badge .dk-i {
  width: 13px;
  height: 13px;
}
.dk-bl {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dk-term {
  font-variant-numeric: tabular-nums;
  padding: 0 8px;
}
.dk-term--done {
  padding: 0 7px;
}
.dk-doc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  max-width: 100%;
  padding: 0 7px;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--slate) 20%, var(--surface));
  color: var(--slate-ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
}
.dk-doc .dk-i {
  width: 12px;
  height: 12px;
  color: var(--indigo);
}
.dk-doc span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.dk-waitlbl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--amethyst-ink);
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
}

/* перелив у підписах наступної дії (хіро) */
.dk-badge.dk-act::after,
.dk-gloss::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--ink-1) 17%, transparent) 50%, transparent 70%);
  transform: translateX(-130%);
  pointer-events: none;
}
.desk-window.is-live .dk-badge.dk-act::after {
  animation: dk-sheen 4.2s var(--ease-io) infinite;
  animation-delay: calc(var(--i, 0) * 0.55s);
}
@keyframes dk-sheen {
  0%, 52% { transform: translateX(-130%); }
  86%, 100% { transform: translateX(130%); }
}

/* ── «озброєна» кнопка: бейдж у тоні + німб індиго + перелив ───────────── */
.dk-armed {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 30px;
  max-width: 100%;
  min-width: 0;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.dk-armed .dk-face {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  min-width: 0;
  max-width: 100%;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--tone) 28%, var(--surface));
  color: var(--tone-ink);
  font-size: 12px;
  font-weight: 620;
  white-space: nowrap;
}
.dk-armed .dk-face .dk-i {
  width: 13px;
  height: 13px;
}
.dk-gloss {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.dk-armed .dk-face::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--r-sm) + 3px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 16px var(--accent-glow);
  opacity: 0;
  pointer-events: none;
}
.dk-armed.is-armed {
  cursor: pointer;
}
.dk-armed.is-armed .dk-face::before {
  opacity: 0.6;
}
.dk-armed.is-armed .dk-face::before {
  animation: dk-halo 2.4s var(--ease-io) infinite;
}
.dk-armed.is-armed .dk-gloss::after {
  animation: dk-sheen 3s var(--ease-io) infinite 0.6s;
}
.dk-armed.is-armed:hover .dk-face {
  background: color-mix(in srgb, var(--tone) 40%, var(--surface));
  color: var(--ink-1);
}
.dk-armed.is-armed:active .dk-face {
  transform: scale(0.97);
}
.dk-armed:not(.is-armed) .dk-face {
  opacity: 0.5;
}
@keyframes dk-halo {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.035); }
}
html[data-layout='compact'] .dk-row .dk-armed {
  height: 36px;
}
html[data-layout='compact'] .dk-row .dk-armed .dk-face {
  height: 28px;
}

/* ── міні-маршрут ─────────────────────────────────────────────────────── */
.dk-route {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100%;
}
.dk-route-cap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--cobalt-ink);
  white-space: nowrap;
}
.dk-route-cap .dk-i {
  width: 11px;
  height: 11px;
}
.dk-route.is-done .dk-route-cap {
  color: var(--emerald-ink);
}
.dk-route-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  line-height: 1;
  color: var(--ink-2);
  white-space: nowrap;
}
.dk-route-track {
  position: relative;
  flex: 1;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--fill-3);
}
.dk-route-track::before,
.dk-route-track::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
}
.dk-route-track::before {
  left: -3px;
  background: var(--cobalt);
}
.dk-route-track::after {
  right: -3px;
  box-shadow: inset 0 0 0 1.5px var(--emerald);
  background: var(--surface);
}
.dk-route-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--cobalt);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.dk-route-rail {
  position: absolute;
  inset: 0;
}
.dk-route-dot {
  position: absolute;
  left: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--cobalt-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 35%, transparent), 0 0 12px var(--cobalt);
}
.dk-route.is-done .dk-route-fill {
  transform: scaleX(1);
}
.dk-route.is-done .dk-route-rail {
  transform: translateX(100%);
}

/* ── підсумок ─────────────────────────────────────────────────────────── */
.dk-foot {
  flex: none;
  height: var(--foot-h);
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  background: var(--frame);
  box-shadow: inset 0 1px 0 var(--line);
}
.dk-foot-l {
  grid-column: 1 / 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
}
.dk-foot-n {
  color: var(--ink-2);
  font-size: 13px;
}
.dk-newtrip {
  height: 24px;
}
.dk-foot-sum {
  grid-column: 5;
  justify-self: end;
  padding-right: var(--pad);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-1);
}
html[data-layout='compact'] .dk-foot-l {
  grid-column: 1 / 3;
  padding-left: 10px;
}
html[data-layout='compact'] .dk-foot-sum {
  grid-column: 3;
}

/* ── шари поверх таблиці ──────────────────────────────────────────────── */
.dk-scrim,
.dk-sheet,
.dk-ov,
.dk-msg,
.dk-bank,
.dk-wait {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.dk-scrim.is-on,
.dk-sheet.is-on,
.dk-ov.is-on,
.dk-msg.is-on,
.dk-bank.is-on,
.dk-wait.is-on {
  opacity: 1;
  visibility: visible;
}
.dk-sheet.is-on,
.dk-wait.is-on {
  pointer-events: auto;
}
.dk-scrim {
  inset: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--void) 64%, transparent);
}
.dk-fx {
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}
.dk-ghost {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform, opacity;
}
.g-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--indigo) 34%, var(--surface));
  color: var(--indigo-ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--sh-pop), 0 0 18px var(--accent-glow);
}
.g-chip .dk-i {
  width: 13px;
  height: 13px;
}
.g-field {
  font-size: 12.5px;
}
.g-plane {
  color: var(--accent-ink);
  filter: drop-shadow(0 0 10px var(--accent-glow));
}
.g-plane .dk-i {
  width: 40px;
  height: 40px;
  stroke-width: 1.5;
}
.dk-trail {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}
.dk-trail.is-down {
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 16%, transparent));
}
.dk-trail.is-up {
  background: linear-gradient(to top, transparent, color-mix(in srgb, var(--accent) 16%, transparent));
}
.dk-beam-paid {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
}
.dk-beam-paid i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--emerald) 38%, transparent) 70%, color-mix(in srgb, var(--emerald-ink) 60%, transparent) 96%, transparent);
}

/* ── повідомлення водія ───────────────────────────────────────────────── */
.dk-msg {
  right: 16px;
  bottom: calc(var(--foot-h) + 12px);
  z-index: 25;
  width: 280px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--r-card);
  background: var(--raised);
  box-shadow: var(--sh-sheet), inset 0 0 0 1px var(--line-2);
}
.msg-thumb {
  flex: none;
  display: block;
}
.cmr-mini {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 46px;
  height: 58px;
  padding: 6px 6px;
  border-radius: 3px;
  background: var(--paper);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--void) 50%, transparent);
  transform: rotate(-3deg);
}
.cmr-mini b {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--crimson);
}
.cmr-mini i {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--paper-line);
}
.cmr-mini i.s {
  width: 60%;
}
.cmr-mini u {
  position: absolute;
  right: 5px;
  bottom: 6px;
  width: 14px;
  height: 8px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px var(--paper-blue);
  opacity: 0.6;
}
.msg-txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.msg-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-3);
}
.msg-who i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}
.msg-txt b {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-1);
}
.msg-sub {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-4);
}
.msg-sub .dk-i {
  width: 12px;
  height: 12px;
}
html[data-layout='compact'] .dk-msg {
  left: 10px;
  right: 10px;
  width: auto;
  bottom: calc(var(--foot-h) + 8px);
}

/* ── банківська пігулка ───────────────────────────────────────────────── */
.dk-bank {
  top: 50px;
  right: 16px;
  z-index: 26;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px 0 12px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--emerald) 24%, var(--raised));
  color: var(--emerald-ink);
  font-size: 12.5px;
  font-weight: 560;
  white-space: nowrap;
  box-shadow: var(--sh-pop), 0 0 24px color-mix(in srgb, var(--emerald) 30%, transparent);
}
.dk-bank i {
  font-style: normal;
  opacity: 0.6;
}
.dk-bank b {
  color: var(--ink-1);
  font-weight: 700;
}
html[data-layout='compact'] .dk-bank {
  top: 50px;
  left: 10px;
  right: 10px;
  justify-content: center;
}

/* ── смуга терміну ────────────────────────────────────────────────────── */
.dk-wait {
  left: 0;
  right: 0;
  bottom: var(--foot-h);
  z-index: 15;
  height: 80px;
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr) 118px 176px;
  align-items: center;
  gap: 22px;
  padding: 0 18px 0 20px;
  background: var(--frame);
  box-shadow: inset 0 1px 0 var(--line-2), 0 -14px 30px color-mix(in srgb, var(--void) 35%, transparent);
}
.wt-l {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wt-cap {
  font-size: 10px;
  font-weight: 640;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--amethyst-ink);
}
.wt-l b {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink-1);
}
.wt-sub {
  font-size: 11px;
  color: var(--ink-4);
}
.wt-scale {
  position: relative;
  height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.wt-marks {
  position: relative;
  height: 18px;
}
.wt-mk {
  position: absolute;
  bottom: 2px;
  width: 0;
}
.wt-mk-l {
  position: absolute;
  bottom: 0;
  right: -1px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--ink-3);
  transform: translateX(50%);
}
.wt-mk-d .wt-mk-l {
  transform: none;
  color: var(--copper-ink);
}
.wt-mk-r .wt-mk-l {
  color: var(--amethyst-ink);
  transition: opacity var(--t) var(--ease-out);
}
.dk-wait.is-reminded .wt-mk-r .wt-mk-l {
  opacity: 0;
}
.wt-callout {
  position: absolute;
  bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--amethyst) 30%, var(--frame));
  color: var(--amethyst-ink);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--sh-sm);
  opacity: 0;
  visibility: hidden;
}
.wt-callout.is-on {
  opacity: 1;
  visibility: visible;
}
.wt-callout .dk-i {
  width: 12px;
  height: 12px;
}
.wt-track {
  position: relative;
  height: 12px;
  margin-top: 2px;
}
.wt-ticks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--ink-4);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.wt-ticks path {
  vector-effect: non-scaling-stroke;
}
.wt-base,
.wt-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: var(--r-pill);
}
.wt-base {
  background: var(--fill-3);
}
.wt-fill {
  background: var(--amethyst);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.dk-wait.is-soon .wt-fill {
  background: var(--copper);
}
.wt-mk-r::after,
.wt-mk-d::after {
  content: '';
  position: absolute;
  top: 2px;
  left: -1px;
  width: 2px;
  height: 14px;
  border-radius: 1px;
}
.wt-mk-r::after {
  background: var(--amethyst);
}
.wt-mk-d::after {
  background: var(--copper);
}
.wt-rail {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.wt-marker {
  position: absolute;
  left: -6px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amethyst) 45%, transparent), 0 0 14px var(--amethyst);
}
.dk-wait.is-soon .wt-marker {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--copper) 45%, transparent), 0 0 14px var(--copper);
}
.wt-marker span {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.wt-zero {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  height: 12px;
  font-size: 10px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  visibility: hidden;
}
.wt-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}
.wt-count b {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--amethyst-ink);
}
.dk-wait.is-soon .wt-count b {
  color: var(--copper-ink);
}
.wt-count span {
  margin-top: 5px;
  font-size: 11px;
  color: var(--ink-3);
}
.wt-act {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 36px;
}
.wt-ff {
  height: 36px;
}
.wt-ff .dk-face {
  height: 32px;
  padding: 0 14px;
  font-size: 12.5px;
}
.dk-wait.is-armed .wt-ff {
  visibility: hidden;
}
.wt-paid {
  position: absolute;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--emerald-ink);
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0;
  /* підпис лежить поверх кнопки «Промотати час» — кліки має пропускати крізь себе */
  pointer-events: none;
  transition: opacity var(--t-slow) var(--ease-out);
}
.dk-wait.is-armed .wt-paid {
  opacity: 1;
}
html[data-layout='compact'] .dk-wait {
  bottom: 0;
  height: 96px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 30px 1fr;
  column-gap: 14px;
  row-gap: 4px;
  align-items: center;
  padding: 8px 12px 10px;
}
html[data-layout='compact'] .wt-l {
  grid-column: 1;
  grid-row: 1;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
}
html[data-layout='compact'] .wt-sub {
  display: none;
}
html[data-layout='compact'] .wt-l b {
  font-size: 13px;
}
html[data-layout='compact'] .wt-count {
  grid-column: 2;
  grid-row: 1;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
}
html[data-layout='compact'] .wt-count b {
  font-size: 22px;
}
html[data-layout='compact'] .wt-count span {
  margin: 0;
}
html[data-layout='compact'] .wt-scale {
  grid-column: 1;
  grid-row: 2;
  height: 52px;
  padding-right: 10px;
}
html[data-layout='compact'] .wt-act {
  grid-column: 2;
  grid-row: 2;
}
html[data-layout='compact'] .wt-ff .dk-face {
  padding: 0 11px;
  font-size: 12px;
}
html[data-layout='compact'] .wt-mk-r .wt-mk-l {
  display: none;
}

/* ── аркуш «Новий рейс» ───────────────────────────────────────────────── */
.dk-sheet {
  inset: 16px;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 48px minmax(0, 1fr) 64px;
  grid-template-areas: 'head head' 'main paper' 'foot paper';
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--sh-sheet), inset 0 0 0 1px var(--line-2);
  overflow: hidden;
  transform-origin: 0 0;
}
.sh-head {
  grid-area: head;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 20px;
  background: var(--sunken);
  box-shadow: inset 0 -1px 0 var(--line);
}
.sh-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  white-space: nowrap;
}
.sh-title .dk-i {
  color: var(--accent);
}
.sh-title b {
  font-size: 14px;
  font-weight: 650;
}
.sh-title span {
  color: var(--ink-3);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sh-x {
  display: inline-flex;
  gap: 14px;
  color: var(--ink-3);
}
.sh-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 0 20px;
  min-height: 0;
}
.sh-sum {
  flex: none;
  padding: 14px 18px 12px;
  border-radius: var(--r-card);
  background: var(--frame);
}
.sh-sum-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 16px;
}
.sh-cap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 640;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sh-cap i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--ink-3);
}
.sh-nr {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}
.sh-sum-route {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 10px 0 10px;
  min-height: 38px;
}
.sh-end {
  position: relative;
  min-width: 0;
}
.sh-end .sh-p {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sh-end b {
  font-size: 14.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sh-end small {
  font-size: 11.5px;
  color: var(--ink-3);
}
.sh-amt {
  text-align: right;
}
.sh-amt b {
  font-size: 17px;
  font-weight: 700;
}
.sh-amt b small {
  font-size: 11px;
  font-weight: 560;
  color: var(--ink-3);
}
.sh-skel {
  position: absolute;
  left: 0;
  top: 50%;
  width: 70%;
  height: 8px;
  margin-top: -4px;
  border-radius: var(--r-pill);
  background: var(--fill-2);
  transition: opacity var(--t-slow) var(--ease-out);
}
.sh-amt .sh-skel {
  left: auto;
  right: 0;
  width: 80px;
}
.sh-p.is-on + .sh-skel {
  opacity: 0;
}
.sh-line {
  position: relative;
  display: flex;
  align-items: center;
  height: 10px;
}
.sh-line .d {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
}
.sh-line .d.a {
  left: 0;
  background: var(--cobalt);
}
.sh-line .d.b {
  right: 0;
  box-shadow: inset 0 0 0 1.5px var(--emerald);
}
.sh-line .sh-p {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 0;
  border-top: 1.5px dashed var(--ink-4);
}
.sh-sum-foot {
  padding-top: 9px;
  min-height: 26px;
  box-shadow: inset 0 1px 0 var(--line-2);
  font-size: 12.5px;
  color: var(--ink-2);
}
.sh-sum-foot .sh-p {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.sh-sum-foot .dk-i {
  color: var(--ink-3);
}
.sh-nip {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}
.sh-p {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-move) var(--ease-out);
}
.sh-p.is-on {
  opacity: 1;
  transform: none;
}
.sh-fields {
  flex: none;
  border-radius: var(--r-card);
  background: var(--frame);
  padding: 4px 0;
}
.sh-f {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  align-items: center;
  height: 44px;
  padding: 0 12px 0 16px;
  box-shadow: inset 0 -1px 0 var(--line);
}
.sh-f:last-child {
  box-shadow: none;
}
.sh-fl {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 540;
  color: var(--ink-2);
  white-space: nowrap;
}
.sh-fl .dk-i {
  color: var(--ink-3);
}
.sh-fv {
  position: relative;
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-md);
  background: var(--fill-1);
  overflow: hidden;
}
.sh-ph {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 34%;
  height: 7px;
  margin-top: -3.5px;
  border-radius: var(--r-pill);
  background: var(--fill-3);
  transition: opacity var(--t) var(--ease-out);
}
.sh-val {
  font-size: 13px;
  font-weight: 560;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-out);
}
.sh-mono {
  font-family: var(--mono);
  font-size: 12.5px;
}
.sh-flash {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--indigo) 26%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--indigo) 70%, transparent);
  opacity: 0;
  pointer-events: none;
}
.sh-f.is-filled .sh-ph {
  opacity: 0;
}
.sh-f.is-filled .sh-val {
  opacity: 1;
}
.sh-foot {
  grid-area: foot;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px 0 20px;
}
.sh-reject {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--crimson) 24%, var(--surface));
  color: var(--crimson-ink);
  font-size: 12.5px;
  font-weight: 600;
}
.sh-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-out);
}
.sh-status .dk-i {
  color: var(--emerald);
}
.sh-status.is-on {
  opacity: 1;
}
.sh-bus {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-md);
  background: var(--fill-1);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-1);
}
.sh-bus .dk-i:first-child {
  color: var(--ink-3);
}
.sh-create {
  height: 36px;
}
.sh-create .dk-face {
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: var(--r-md);
}
.sh-create .dk-face::before {
  border-radius: calc(var(--r-md) + 3px);
}
.sh-paper {
  grid-area: paper;
  padding: 16px 16px 12px 0;
}
.zl-wrap {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--sh-pop);
}

/* папір злеценя (470×598, масштаб — js/desk.js) */
.zl {
  position: absolute;
  left: 0;
  top: 0;
  width: 470px;
  height: 598px;
  padding: 22px 22px;
  transform-origin: 0 0;
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--font);
  font-size: 8.5px;
  line-height: 1.38;
  overflow: hidden;
}
.zl-b {
  position: relative;
}
.zl-b::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--indigo) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--indigo) 65%, transparent);
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-out);
  pointer-events: none;
}
.zl-b.is-read::after {
  opacity: 1;
  transition-duration: var(--t-fast);
}
.zl-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.zl-co {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.zl-logo {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 5px;
  background: var(--paper-blue);
  color: var(--paper);
  font-size: 11px;
  font-weight: 800;
}
.zl-co b {
  display: block;
  font-size: 10px;
  font-weight: 700;
}
.zl-co small {
  display: block;
  font-size: 6.5px;
  color: var(--paper-ink-2);
}
.zl-title {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  flex: none;
}
.zl-title b {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.zl-nr {
  font-family: var(--mono);
  font-size: 9px;
}
.zl-title small {
  font-size: 6.5px;
  color: var(--paper-ink-2);
}
.zl-rule {
  height: 1.5px;
  margin: 12px 0 12px;
  background: var(--paper-ink);
}
.zl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.zl-box {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 9px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--paper-line);
}
.zl-wide {
  grid-column: 1 / -1;
}
.zl-box em {
  font-style: normal;
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-ink-2);
  margin-bottom: 2px;
}
.zl-box b {
  font-weight: 700;
}
.zl-box span {
  color: var(--paper-ink);
}
.zl-box .m,
.zl-tab .m {
  font-family: var(--mono);
}
.zl-tab {
  display: grid;
  grid-template-columns: 1fr 58px 58px 34px;
  box-shadow: inset 0 0 0 1px var(--paper-line);
  border-radius: 2px;
}
.zl-tab span {
  padding: 3px 6px;
  box-shadow: inset 0 -1px 0 var(--paper-line);
}
.zl-tab span:nth-child(-n + 4) {
  font-size: 6.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--paper-ink-2);
  background: var(--paper-2);
}
.zl-tab span:nth-child(n + 5) {
  box-shadow: none;
}
.zl-notes {
  margin: 12px 0 0;
  padding-left: 12px;
  font-size: 6.8px;
  color: var(--paper-ink-2);
}
.zl-sign {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 14px;
  padding: 0 4px;
}
.zl-sign svg {
  width: 110px;
  height: 38px;
  fill: none;
  stroke: var(--paper-blue);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.zl-stamp {
  padding: 6px 12px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1.5px var(--paper-blue);
  color: var(--paper-blue);
  font-size: 6.5px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  transform: rotate(-4deg);
  opacity: 0.85;
}
.zl-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--indigo) 22%, transparent) 85%, var(--indigo) 98%, transparent);
  opacity: 0;
  pointer-events: none;
}
.zl-beam.is-on {
  opacity: 1;
}

/* аркуш на телефоні: одна колонка */
html[data-layout='compact'] .dk-sheet {
  inset: 0;
  border-radius: var(--r-window);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 40px auto minmax(0, 1fr) 56px;
  grid-template-areas: 'head' 'paper' 'main' 'foot';
}
html[data-layout='compact'] .sh-head {
  padding: 0 12px;
}
html[data-layout='compact'] .sh-title span {
  display: none;
}
html[data-layout='compact'] .sh-paper {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
  background: var(--sunken);
}
html[data-layout='compact'] .sh-main {
  padding: 8px 10px 0;
}
html[data-layout='compact'] .sh-sum {
  display: none;
}
html[data-layout='compact'] .sh-fields {
  padding: 2px 0;
}
html[data-layout='compact'] .sh-f {
  grid-template-columns: 112px minmax(0, 1fr);
  height: 34px;
  padding: 0 6px 0 10px;
}
html[data-layout='compact'] .sh-fl {
  gap: 7px;
  font-size: 11.5px;
}
html[data-layout='compact'] .sh-fl .dk-i {
  width: 12px;
  height: 12px;
}
html[data-layout='compact'] .sh-fv {
  height: 26px;
  padding: 0 9px;
}
html[data-layout='compact'] .sh-val {
  font-size: 12px;
}
html[data-layout='compact'] .sh-mono {
  font-size: 11.5px;
}
html[data-layout='compact'] .sh-foot {
  gap: 8px;
  padding: 0 10px;
  background: var(--sunken);
  box-shadow: inset 0 1px 0 var(--line);
}
html[data-layout='compact'] .sh-status {
  display: none;
}
html[data-layout='compact'] .sh-reject {
  height: 36px;
  width: 36px;
  padding: 0;
  justify-content: center;
}
html[data-layout='compact'] .sh-reject span {
  display: none;
}
html[data-layout='compact'] .sh-bus {
  height: 36px;
}

/* ── фактура (520×600, масштаб — js/desk.js) ──────────────────────────── */
.dk-ov {
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
}
.dk-inv-wrap {
  position: relative;
  transform-origin: 0 0;
}
.dk-inv {
  position: absolute;
  left: 0;
  top: 0;
  width: 520px;
  height: 600px;
  padding: 30px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform-origin: 0 0;
  border-radius: 4px;
  background: var(--paper);
  color: var(--paper-ink);
  font-size: 10px;
  line-height: 1.45;
  box-shadow: var(--sh-sheet);
}
.inv-l {
  opacity: 0;
}
.inv-l.is-on,
.dk-inv.is-printed .inv-l {
  opacity: 1;
}
.inv-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.inv-h {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
}
.inv-no {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--paper-blue);
}
.inv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 9px;
  color: var(--paper-ink-2);
}
.inv-rule {
  height: 1.5px;
  background: var(--paper-ink);
}
.inv-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.inv-parties > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dk-inv em {
  font-style: normal;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-ink-2);
  margin-bottom: 3px;
}
.inv-parties b {
  font-size: 11.5px;
}
.inv-tab {
  display: grid;
  grid-template-columns: 26px 1fr 70px 38px 70px;
  box-shadow: inset 0 0 0 1px var(--paper-line);
  border-radius: 3px;
}
.inv-tab > span {
  padding: 6px 8px;
}
.inv-tab > span:nth-child(-n + 5) {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--paper-ink-2);
  background: var(--paper-2);
}
.inv-tab .r {
  text-align: right;
}
.dk-inv .m {
  font-family: var(--mono);
}
.inv-sum {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 10.5px;
  color: var(--paper-ink-2);
}
.inv-sum b {
  color: var(--paper-ink);
}
.inv-due {
  margin-top: 6px;
  padding-top: 8px;
  box-shadow: inset 0 1px 0 var(--paper-line);
  font-size: 13px;
  color: var(--paper-ink);
  font-weight: 600;
}
.inv-due b {
  font-size: 16px;
  font-weight: 800;
}
.inv-pay {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 3px;
  background: var(--paper-2);
  font-size: 10.5px;
}
.inv-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  color: var(--paper-ink-2);
}
.inv-slot {
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-out);
}
.inv-slot.is-on {
  opacity: 1;
}
.inv-stamp {
  position: absolute;
  right: 40px;
  bottom: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 16px 8px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2.5px var(--paper-blue);
  color: var(--paper-blue);
  transform: rotate(-8deg);
  opacity: 0;
  visibility: hidden;
}
.inv-stamp.is-on {
  opacity: 0.9;
  visibility: visible;
}
.inv-stamp b {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.inv-stamp span {
  font-family: var(--mono);
  font-size: 9px;
}

/* ── лист ─────────────────────────────────────────────────────────────── */
.dk-ov--mail {
  z-index: 31;
}
.dk-mail {
  width: 420px;
  max-width: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 12px;
  border-radius: var(--r-card);
  background: var(--raised);
  box-shadow: var(--sh-sheet), inset 0 0 0 1px var(--line-2);
}
.ml-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  box-shadow: inset 0 -1px 0 var(--line-2);
}
.ml-head .dk-i {
  color: var(--petrol);
}
.ml-head b {
  font-size: 13.5px;
  font-weight: 650;
}
.ml-head span {
  font-size: 12px;
  color: var(--ink-3);
}
.ml-row {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  min-width: 0;
}
.ml-row span {
  width: 42px;
  flex: none;
  color: var(--ink-3);
}
.ml-row b {
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ml-att {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}
.ml-slot {
  position: relative;
  height: 30px;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--line-2);
  background: var(--fill-1);
}
.ml-chip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--slate) 22%, var(--raised));
  color: var(--slate-ink);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity var(--t) var(--ease-out), transform var(--t-slow) var(--ease-back);
}
.ml-chip .dk-i {
  width: 12px;
  height: 12px;
  color: var(--indigo);
}
.ml-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.ml-slot.is-on .ml-chip {
  opacity: 1;
  transform: none;
}
.ml-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.ml-send {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--petrol) 28%, var(--raised));
  color: var(--petrol-ink);
  font-weight: 600;
}
.g-file {
  font-family: var(--mono);
  font-size: 10.5px;
  height: 24px;
}

.inv-sign {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-top: 36px;
  font-size: 8.5px;
  color: var(--paper-ink-2);
}
.inv-sign span {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 160px;
}
.inv-sign i {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--paper-line);
}

.dk-wait[data-edge='l'] .wt-marker span {
  transform: none;
  left: 0;
}
.dk-wait[data-edge='r'] .wt-marker span {
  left: auto;
  right: 0;
  transform: translateX(8px);
}
html[data-layout='compact'] .wt-callout {
  right: auto !important;
  left: 0;
}
html[data-layout='compact'] .dk-bank {
  top: 6px;
}
html[data-layout='compact'] .dk-wait.is-reminded .wt-mk-d .wt-mk-l {
  opacity: 0;
}
html[data-layout='compact'] .g-field {
  max-width: 236px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
}

/* ── акт II: стіл іде, перехід — вкладка «Логістика» ──────────────────── */
.desk-window.is-away {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.dk-tab--logi {
  padding: 0;
  height: 32px;
  border-radius: var(--r-md);
  cursor: default;
}
.dk-tab--logi .dk-face {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-md);
}
.dk-tab--logi .dk-face::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--r-md) + 3px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 16px var(--accent-glow);
  opacity: 0;
  pointer-events: none;
}
.dk-tab--logi.is-armed {
  cursor: pointer;
}
.dk-tab--logi.is-armed .dk-face {
  background: color-mix(in srgb, var(--indigo) 28%, var(--frame));
  color: var(--indigo-ink);
}
.dk-tab--logi.is-armed .dk-face::before {
  opacity: 0.6;
  animation: dk-halo 2.4s var(--ease-io) infinite;
}
.dk-tab--logi.is-armed .dk-gloss::after {
  animation: dk-sheen 3s var(--ease-io) infinite 0.6s;
}
.dk-tab--logi.is-armed:hover .dk-face {
  background: color-mix(in srgb, var(--indigo) 40%, var(--frame));
  color: var(--ink-1);
}
.desk-window.is-logi .dk-tab.is-active {
  background: transparent;
  color: var(--ink-3);
}
.dk-logi-pill {
  display: none;
  height: 36px;
}
html[data-layout='compact'] .dk-logi-pill.is-armed {
  display: inline-flex;
}
.dk-logi-pill .dk-face {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
}
.dk-logi-pill .dk-face::before {
  border-radius: var(--r-pill);
}
html[data-layout='compact'] .desk-window.is-logi .dk-inbox,
html[data-layout='compact'] .desk-window.is-logi .dk-period {
  display: none;
}
