/* Скрапбук в духе lera.fans, но спокойный: чернильный контур, «твёрдые» тени, неровные скругления.
   Приглушённые цвета без розового фона, бежевого, зелёного и красного:
   чернила, лаванда, слива, пыльная лазурь, горчица. */
:root {
  --ink: #36324f;
  --ink-2: #565270;
  --ink-3: #74708a;
  --sheet: #eef0f4;
  --white: #fff;
  --wash: #f4f5f8;

  --violet: #625c99;
  --lilac: #cac8df;
  --lilac-soft: #e9e8f2;
  --plum: #80466f;
  --urgent-soft: #dacfe0;
  --cyan: #6c9db2;
  --sky: #c3d9e2;
  --sky-soft: #e4eef2;
  --mustard: #d9b765;
  --mustard-soft: #ebdca9;
  --lemon: #e9df9f;
  --lemon-soft: #f3eecb;

  --line: 2px solid var(--ink);
  --r1: 22px 14px 26px 16px;
  --r2: 14px 20px 15px 22px;
  --r-s: 16px 10px 18px 12px;
  --font: 'Balsamiq Sans', 'Comic Sans MS', 'Comic Neue', cursive;
  --top-h: 64px;
  --tabs-h: calc(64px + env(safe-area-inset-bottom));
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--sheet); }
html.locked { overflow: hidden; }
body { color: var(--ink); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
ul, ol { list-style: none; }
h1, h2, h3 { line-height: 1.22; }
em { font-style: normal; font-weight: 700; color: var(--violet); }
:focus-visible { outline: 3px dashed var(--violet); outline-offset: 3px; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- каркас ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; min-height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 14px 0 16px; background: var(--white); border-bottom: 2px solid var(--ink); }
.top-back { display: grid; place-items: center; width: 40px; height: 44px; margin-left: -12px; }
.top-title { flex: 1; min-width: 0; }
.top-title h1 { display: inline-block; max-width: 100%; font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; padding: 0 5px; margin-left: -5px; background: linear-gradient(transparent 58%, var(--sky) 58% 90%, transparent 90%); }
.top-title small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .btn-icon { background: var(--lemon); }
.user { display: flex; align-items: center; gap: 4px; height: 42px; padding: 0 12px 0 8px; border: var(--line); border-radius: var(--r-s); background: var(--sky); box-shadow: 3px 3px 0 var(--ink); font-size: 13px; font-weight: 700; }
.user .i { width: 18px; height: 18px; }
.view { padding: 14px 16px calc(var(--tabs-h) + 36px); max-width: 720px; margin: 0 auto; }

.tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; height: var(--tabs-h); padding-bottom: env(safe-area-inset-bottom); background: var(--white); border-top: 2px solid var(--ink); }
.tabs a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.tabs a .i { width: 46px; height: 30px; padding: 3px 11px; border: 2px solid transparent; border-radius: var(--r-s); }
.tabs a.on { color: var(--ink); }
.tabs a.on .i { background: var(--lilac); border-color: var(--ink); transform: rotate(-4deg); }
.tabs a i { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 20px; height: 20px; padding: 0 4px; border: 2px solid var(--ink); border-radius: 50% 45% 50% 45%; background: var(--plum); color: var(--white); font: 700 11px/16px var(--font); font-style: normal; text-align: center; }
.brand { display: none; }

/* ---------- кнопки, чипы, поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 6px 16px; border: var(--line); border-radius: var(--r-s); background: var(--white); box-shadow: 3px 3px 0 var(--ink); font-weight: 700; font-size: 14px; line-height: 1.25; text-align: center; transition: transform .12s, box-shadow .12s; }
@media (hover: hover) { .btn:hover { transform: translate(-1px, -1px) rotate(-1deg); box-shadow: 4px 4px 0 var(--ink); } }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-main { background: var(--violet); color: var(--white); }
.btn-ghost { background: var(--white); border-style: dashed; box-shadow: none; }
.btn-ghost:active { box-shadow: none; }
.btn-small { min-height: 38px; padding: 2px 12px; font-size: 13px; flex: none; box-shadow: 2px 2px 0 var(--ink); background: var(--sky-soft); }
.btn-icon { width: 44px; padding: 0; flex: none; }
.btn-wide { width: 100%; margin-top: 18px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: 3px 14px; border: 2px solid var(--ink); border-radius: var(--r-s); background: var(--white); font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip:nth-child(even) { border-radius: var(--r2); }
.chip small { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; margin-left: 2px; }
.chip.on { background: var(--violet); color: var(--white); box-shadow: 2px 2px 0 var(--ink); transform: rotate(-1.5deg); }
.chip.on small { color: var(--white); }
.chip-ok { background: var(--sky); }
.note { margin-top: 10px; padding: 8px 12px; border: 2px dashed var(--ink); border-radius: var(--r-s); background: var(--lemon-soft); font-size: 12.500px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-top: 8px; font-weight: 700; }
.check input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--violet); }
.selectable { user-select: text; -webkit-user-select: text; white-space: pre-wrap; }

input, textarea, select { width: 100%; min-height: 46px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 14px; background: var(--white); font-size: 16px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { resize: vertical; line-height: 1.4; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--violet); outline-offset: 1px; }
.field { display: block; margin-top: 12px; }
.field > span { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field + .chips { padding-top: 8px; }
.search { margin-bottom: 8px; box-shadow: 3px 3px 0 var(--lilac); }

/* номер заказа – как номерной знак */
.plate { display: inline-block; flex: none; padding: 0 6px; border: 2px solid var(--ink); border-radius: 6px 4px 7px 5px; background: var(--lemon); font: 700 12px/17px var(--font); letter-spacing: .03em; color: var(--ink); white-space: nowrap; }
.tag { display: inline-block; padding: 0 8px; border: 1.500px solid var(--ink); border-radius: 10px 6px 11px 7px; background: var(--wash); font-size: 12px; font-style: normal; font-weight: 700; color: var(--ink); white-space: nowrap; }
.tag-red { background: var(--plum); color: var(--white); transform: rotate(-2deg); }
.tag-amber { background: var(--mustard); transform: rotate(1.5deg); }
.ch { display: inline-block; padding: 0 4px; border: 1.500px solid var(--ink); border-radius: 6px 4px 6px 4px; background: var(--lilac); color: var(--ink); font: 700 9px/13px var(--font); font-style: normal; }
.ch-tg { background: var(--sky); }
.ch-wx { background: var(--lemon); }

/* ---------- лента маршрута ---------- */
.route { position: relative; padding: 4px 0; --here: var(--violet); }
.route-late { --here: var(--mustard); }
.route-done { --here: var(--cyan); }
.route .road { position: absolute; left: 5px; right: 5px; top: 8px; height: 3px; background: repeating-linear-gradient(90deg, var(--ink-3) 0 5px, transparent 5px 10px); }
.route .road b { display: block; height: 100%; border-radius: 2px; background: var(--ink); }
.route-done .road b { background: var(--cyan); }
.route ol { position: relative; display: flex; justify-content: space-between; align-items: center; height: 11px; }
.route li { position: relative; width: 11px; height: 11px; border-radius: 50%; background: var(--white); border: 2px solid var(--ink); }
.route li.past { background: var(--ink); }
.route-done li.past { background: var(--cyan); }
.route li.here { width: 26px; height: 15px; margin: 0 -7px; border-radius: 9px 6px 10px 7px; background: var(--here); transform: rotate(-6deg); }
.route-late li.here::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(54, 50, 79, .5) 4px 6px); }
.route-full { padding-bottom: 24px; margin-top: 12px; }
.route-full li span { position: absolute; top: 13px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.route-full li.here span { top: 14px; transform: translateX(-50%) rotate(6deg); color: var(--ink); font-weight: 700; }
.route-full li:first-child span { left: -2px; transform: none; }
.route-full li:last-child span { left: auto; right: -2px; transform: none; }
@media (max-width: 400px) { .route-full li:nth-child(even):not(.here) span { display: none; } .route-full li.here + li span, .route-full li:has(+ li.here) span { display: none; } }

/* ---------- Сегодня ---------- */
.pulse { margin-bottom: 10px; }
.pulse-nums { display: flex; gap: 10px; font-size: 12.500px; }
.pulse-nums > span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 6px; border: var(--line); border-radius: var(--r-s); background: var(--lemon-soft); transform: rotate(1deg); white-space: nowrap; }
.pulse-nums b { font-size: 24px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.pulse-nums .n-hot { background: var(--urgent-soft); transform: rotate(-1.5deg); border-radius: var(--r2); }
.pulse-nums .n-done { background: var(--sky); transform: rotate(-.5deg); border-radius: var(--r2); }
.meter { height: 12px; margin-top: 10px; border: 2px solid var(--ink); border-radius: 8px 6px 9px 7px; background: var(--white); overflow: hidden; }
.meter i { display: block; height: 100%; background: repeating-linear-gradient(135deg, var(--cyan) 0 6px, var(--sky) 6px 12px); transition: width .25s ease-out; }

.now { position: relative; margin: 20px 4px 16px 0; padding: 22px 16px 18px; border: 2px solid var(--ink); border-radius: 28px 18px 32px 14px / 18px 30px 16px 28px; background: var(--white); box-shadow: 7px 7px 0 var(--lilac); transform: rotate(-.4deg); }
.now.p1 { box-shadow: 7px 7px 0 var(--urgent-soft); }
.now-label { position: absolute; top: -14px; left: 14px; padding: 2px 12px; border: var(--line); border-radius: var(--r-s); background: var(--lemon); font-size: 12px; font-weight: 700; transform: rotate(-2deg); white-space: nowrap; }
.now.p1 .now-label { background: var(--plum); color: var(--white); }
.now h2 { font-size: 23px; margin: 2px 0 8px; }
.now-why { margin-top: 8px; color: var(--ink-2); }
.now-actions { display: flex; gap: 10px; margin-top: 12px; }
.now-actions .btn { flex: 1; }
.now-actions .btn-icon { flex: none; background: var(--sky-soft); }

.task-sub { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.task-sub > span:last-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.group { display: flex; align-items: center; gap: 8px; margin: 24px 0 10px; font-size: 16px; }
.group h3 { font-size: 16px; }
h3.group { width: fit-content; padding: 0 6px; margin-left: -4px; background: linear-gradient(transparent 55%, var(--lilac) 55% 92%, transparent 92%); }
.orders .group h3 { padding: 0 6px; margin-left: -4px; background: linear-gradient(transparent 55%, var(--sky) 55% 92%, transparent 92%); }
.group small { font-size: 12px; font-weight: 700; padding: 0 6px; border: 1.500px solid var(--ink); border-radius: 10px 7px 11px 8px; background: var(--white); white-space: nowrap; }

.tasks, .plain, .threads, .events, .bars { margin-right: 4px; border: var(--line); border-radius: var(--r1); background: var(--white); box-shadow: 5px 5px 0 var(--lilac); overflow: hidden; }
.tasks:has(.p1) { box-shadow: 5px 5px 0 var(--urgent-soft); }
.task { position: relative; display: flex; align-items: center; gap: 4px; padding-right: 12px; }
.task + .task, .plain > li + li, .threads li + li, .ev + .ev { border-top: 2px dashed var(--lilac); }
.task::before { content: ''; position: absolute; left: 6px; top: 16px; width: 11px; height: 11px; border: 2px solid var(--ink); border-radius: 50% 40% 50% 40%; background: var(--lemon); }
.task.p1::before { background: var(--plum); }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 6px 12px 24px; }
.task-title { font-weight: 700; font-size: 14.500px; line-height: 1.3; }
.task-title time { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 9px 6px 10px 7px; background: var(--lilac-soft); font-size: 11.500px; color: var(--plum); white-space: nowrap; }
.task-why { font-size: 13px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.btn-row { max-width: 108px; min-height: 40px; padding: 4px 10px; font-size: 13px; background: var(--lemon); box-shadow: 2px 2px 0 var(--ink); }
.task.p1 .btn-row { background: var(--sky); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 20px 0; padding: 32px 16px; border: 3px dashed var(--ink); border-radius: var(--r1); background: var(--white); text-align: center; color: var(--ink-2); }
.empty b { color: var(--ink); font-size: 17px; }
.empty .i { width: 40px; height: 40px; color: var(--violet); }
.snoozed { margin-top: 20px; }
.snoozed summary { min-height: 44px; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; cursor: pointer; }

/* ---------- списки ---------- */
.plain > li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 60px; }
.plain li > div:first-child, .plain li > a:not(.btn) { flex: 1; min-width: 0; }
.plain li b { display: block; font-size: 14.500px; }
.plain li div > span { display: block; font-size: 12.500px; color: var(--ink-3); }
.plain li.is-late { background: var(--urgent-soft); }
.plain li.is-late b, .plain li.is-late div > span { color: var(--ink); }
.plain li.is-paid { background: var(--sky-soft); }
.paid-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 50% 44% 50% 44%; background: var(--cyan); }
.paid-mark .i { width: 20px; height: 20px; }
.menu > li { padding: 0; }
.menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; min-height: 64px; }
.menu a .i { width: 18px; }
.plain .btn-ghost { width: 100%; }

.threads a { display: flex; gap: 14px; padding: 12px; }
.ava { position: relative; flex: none; display: grid; place-items: center; width: 46px; height: 46px; border: var(--line); border-radius: 50% 45% 48% 52% / 52% 48% 50% 46%; background: var(--lilac); font-weight: 700; font-size: 14px; }
.threads li:nth-child(3n+2) .ava { background: var(--lemon-soft); }
.threads li:nth-child(3n) .ava { background: var(--sky); }
.threads .ava-sup, .ava-sup { border-radius: 14px 18px 12px 20px; background: var(--mustard-soft); }
.ava .ch { position: absolute; right: -7px; bottom: -4px; }
.th-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.th-top { display: flex; justify-content: space-between; gap: 8px; }
.th-top b { font-size: 14.500px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-top time { flex: none; font-size: 12px; color: var(--ink-3); }
.th-text { font-size: 13.500px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-text em { font-weight: 400; color: var(--ink-3); }
.th-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.th-tags small { font-size: 12px; color: var(--ink-3); }

/* ---------- переписка ---------- */
.in-thread .tabs { display: none; }
@media (max-width: 480px) { .in-thread .user { width: 44px; justify-content: center; padding: 0; } .in-thread .user span { display: none; } }
.in-thread .view { padding-bottom: 160px; }
.context { display: block; margin-right: 4px; padding: 10px 12px; border: var(--line); border-radius: var(--r1); background: var(--white); box-shadow: 5px 5px 0 var(--sky); }
.context-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.context-top b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.context-top .i { width: 16px; height: 16px; }
.context .route { margin: 6px 0 4px; }
.context-info { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-2); }
.alert { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 8px 10px 8px 12px; border: var(--line); border-radius: var(--r-s); background: var(--urgent-soft); font-size: 13px; font-weight: 700; }
.alert span { flex: 1; }
.alert .btn { background: var(--white); }
.msgs { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.msgs .day { align-self: center; margin: 8px 0 2px; padding: 0 10px; border: 1.500px solid var(--ink); border-radius: 10px 7px 11px 8px; background: var(--lemon-soft); font-size: 12px; font-weight: 700; transform: rotate(-1.5deg); }
.msg { max-width: 84%; padding: 8px 12px; border: 2px solid var(--ink); font-size: 14.500px; }
.msg-in { align-self: flex-start; background: var(--white); border-radius: 18px 18px 18px 4px; }
.msg-out { align-self: flex-end; background: var(--lilac-soft); border-radius: 18px 18px 4px 18px; }
.msg p { white-space: pre-wrap; }
.msg-ru { margin-top: 4px; padding-top: 4px; border-top: 2px dashed var(--lilac); color: var(--ink-2); font-size: 13px; }
.msg small { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-3); text-align: right; }
.composer { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; padding: 4px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--white); border-top: 2px solid var(--ink); }
.composer .chips { padding-top: 8px; }
.composer-row { display: flex; align-items: flex-end; gap: 10px; max-width: 688px; margin: 0 auto; }
.composer textarea { resize: none; min-height: 46px; overflow-y: hidden; }

/* ---------- заказы ---------- */
.orders { display: flex; flex-direction: column; gap: 12px; }
.orders .group { margin: 12px 0 0; }
.order { display: block; margin-right: 4px; padding: 12px 14px; border: var(--line); border-radius: var(--r1); background: var(--white); box-shadow: 5px 5px 0 var(--lilac); }
.orders li:nth-child(4n+1) .order { box-shadow: 5px 5px 0 var(--sky); }
.orders li:nth-child(4n+2) .order { box-shadow: 5px 5px 0 var(--urgent-soft); border-radius: var(--r2); }
.orders li:nth-child(4n+3) .order { box-shadow: 5px 5px 0 var(--mustard-soft); }
.order:active { transform: translate(2px, 2px); }
.order-top { display: flex; align-items: center; gap: 8px; }
.order-top b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border: 2px solid var(--ink); border-radius: 50% 45% 50% 45%; background: var(--lemon); font: 700 12px var(--font); font-style: normal; }
.count-hot { background: var(--plum); color: var(--white); }
.order-sub { display: block; margin: 3px 0 7px; font-size: 13px; color: var(--ink-3); }
.order-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.500px; color: var(--ink-2); }
.order-foot > span:first-child { margin-right: auto; }
.fab { position: fixed; z-index: 15; right: 16px; bottom: calc(var(--tabs-h) + 14px); display: flex; align-items: center; gap: 6px; height: 54px; padding: 0 20px 0 14px; border: 2px solid var(--ink); border-radius: 28px 18px 30px 20px; background: var(--violet); color: var(--white); font-weight: 700; box-shadow: 4px 4px 0 var(--ink); transform: rotate(-2deg); }

.head, .card { margin-right: 4px; padding: 16px; border: 2px solid var(--ink); border-radius: 28px 18px 32px 14px / 18px 30px 16px 28px; background: var(--white); box-shadow: 6px 6px 0 var(--sky); }
.card { box-shadow: 6px 6px 0 var(--lilac); }
.card + .card { margin-top: 14px; }
.head .order-top { justify-content: space-between; font-weight: 700; font-size: 15px; }
.head h2 { margin-top: 8px; font-size: 25px; }
.head > p { color: var(--ink-3); font-size: 13.500px; }
.head .stage-now { margin-top: 4px; color: var(--ink-2); }
.card > p { margin-top: 10px; font-size: 14px; }
.card > .btn { width: 100%; margin-top: 14px; background: var(--sky-soft); }
.card .plain { margin-top: 10px; box-shadow: none; border-width: 2px; }
.eta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.eta > div { padding: 6px; border: 2px solid var(--ink); border-radius: var(--r-s); background: var(--wash); text-align: center; }
.eta span { display: flex; align-items: center; justify-content: center; font-size: 11.500px; color: var(--ink-2); line-height: 1.2; min-height: 28px; }
.eta b { font-size: 15px; font-variant-numeric: tabular-nums; }
.eta > .late { background: var(--mustard); }
.eta > .late span { color: var(--ink); }
.warn { width: fit-content; padding: 0 8px; border-radius: 10px 7px 11px 8px; background: var(--urgent-soft); font-weight: 700; }
.ok { width: fit-content; padding: 0 8px; border-radius: 10px 7px 11px 8px; background: var(--sky); }
.meter-pay { margin: 0 0 12px; height: 16px; }
.history { margin-right: 4px; padding: 4px 12px; border: 2px dashed var(--ink); border-radius: var(--r1); background: var(--white); }
.history li { display: flex; gap: 12px; padding: 7px 0; font-size: 13px; color: var(--ink-2); }
.history li + li { border-top: 2px dashed var(--lilac-soft); }
.history time { flex: none; width: 88px; font-size: 11.500px; line-height: 19px; color: var(--ink-3); }

/* ---------- календарь ---------- */
.month { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.month b { font-size: 20px; padding: 0 8px; background: linear-gradient(transparent 55%, var(--lilac) 55% 92%, transparent 92%); }
.month .btn-icon { background: var(--sky); }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-right: 4px; padding: 6px; border: 2px solid var(--ink); border-radius: var(--r1); background: var(--white); box-shadow: 6px 6px 0 var(--lilac); }
.dow { padding: 4px 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--violet); }
.cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; border: 2px solid transparent; border-radius: 12px 9px 13px 10px; text-align: center; }
.cell b { font-size: 14px; }
.cell span { display: flex; gap: 1px; height: 7px; }
.cell.out { opacity: .38; }
.cell.today { background: var(--lemon); }
.cell.sel { border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.dot { display: inline-block; width: 7px; height: 7px; border: 1px solid var(--ink); border-radius: 50%; background: var(--k); }
.k-eta { --k: var(--violet); } .k-late { --k: var(--plum); } .k-pay { --k: var(--cyan); } .k-hand { --k: var(--mustard); } .k-rem { --k: var(--white); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 14px; font-size: 12px; color: var(--ink-2); }
.legend span { display: flex; align-items: center; gap: 4px; }
.legend .dot { width: 10px; height: 10px; }
.ev a { position: relative; display: block; padding: 10px 12px 10px 34px; }
.ev a::before { content: ''; position: absolute; left: 10px; top: 14px; width: 13px; height: 13px; border: 2px solid var(--ink); border-radius: 50% 40% 50% 40%; background: var(--k); }
.ev b { display: block; font-size: 14.500px; }
.ev span { font-size: 12.500px; color: var(--ink-3); }
.events + .btn, .muted + .btn { width: calc(100% - 4px); margin-top: 14px; }

/* ---------- команда, правила ---------- */
.person { display: block; width: calc(100% - 4px); margin-bottom: 14px; }
.card.person + .card.person { margin-top: 0; box-shadow: 6px 6px 0 var(--sky); }
.person-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.person-top b { font-size: 17px; }
.person-top > span { font-size: 12.500px; color: var(--ink-3); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 10px; font-size: 11px; text-align: center; }
.stats > span { padding: 3px 2px; border: 2px solid var(--ink); border-radius: var(--r-s); background: var(--wash); }
.stats b { display: block; font-size: 22px; line-height: 1.25; }
.stats .bad { background: var(--urgent-soft); }
.stats .good { background: var(--sky); }
.person-foot { display: block; font-size: 13px; color: var(--ink-2); }
.bars { padding: 8px 12px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 20px; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.bars i { height: 12px; width: calc(var(--w) * 100%); border: 2px solid var(--ink); border-radius: 7px 5px 8px 6px; background: var(--violet); }
.bars li:nth-child(3n+2) i { background: var(--lilac); }
.bars li:nth-child(3n) i { background: var(--cyan); }
.bars b { font-size: 13px; text-align: right; }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.plain .stepper { flex: none; }
.stepper button { width: 40px; height: 40px; border: 2px solid var(--ink); border-radius: var(--r-s); background: var(--lemon); font-size: 20px; font-weight: 700; text-align: center; }
.stepper output { min-width: 56px; text-align: center; font-size: 13px; font-weight: 700; }
.bullets { margin-top: 8px; font-size: 13.500px; color: var(--ink-2); }
.bullets li { padding-left: 16px; position: relative; }
.bullets li::before { content: ''; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border: 1.500px solid var(--ink); border-radius: 50% 40% 50% 40%; background: var(--lilac); }
.muted { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.center { text-align: center; }

/* ---------- нижняя панель и уведомления ---------- */
.backdrop { position: fixed; z-index: 40; inset: 0; background: rgba(54, 50, 79, .55); }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-width: 560px; max-height: 92vh; max-height: 92dvh; margin: 0 auto; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; border: 2px solid var(--ink); border-bottom: 0; border-radius: 30px 22px 0 0; background: var(--white); animation: up .22s ease-out; }
.sheet .btn-wide + .btn-wide { margin-top: 12px; }
.sheet h2 { margin-right: 44px; margin-bottom: 6px; font-size: 20px; }
.sheet .chips { margin: 0 -18px; padding: 10px 18px; }
.sheet-x { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 44px; height: 44px; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.quote { margin-top: 8px; padding: 10px 12px; border: 2px dashed var(--ink); border-radius: var(--r-s); background: var(--lilac-soft); font-size: 14px; }
.translation { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.translation:empty { display: none; }
.option { display: block; width: calc(100% - 3px); margin-top: 12px; padding: 10px 14px; min-height: 56px; border: var(--line); border-radius: var(--r-s); background: var(--white); box-shadow: 3px 3px 0 var(--lilac); }
.option:nth-of-type(even) { box-shadow: 3px 3px 0 var(--sky); border-radius: var(--r2); }
.option:nth-of-type(3n) { box-shadow: 3px 3px 0 var(--mustard-soft); }
.option:active { transform: translate(2px, 2px); box-shadow: none; }
.option b { display: block; font-size: 14.500px; }
.option span { font-size: 12.500px; color: var(--ink-3); }
.toast { position: fixed; z-index: 50; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 8px); max-width: 480px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: var(--line); border-radius: var(--r-s); background: var(--lemon); box-shadow: 4px 4px 0 var(--ink); font-size: 14px; font-weight: 700; opacity: 0; visibility: hidden; transform: translateY(-8px) rotate(-1deg); transition: .2s ease-out; }
.toast.show { opacity: 1; visibility: visible; transform: rotate(-1deg); }
.toast span { flex: 1; }
.toast a { flex: none; padding: 6px 0; text-decoration: underline; color: var(--violet); }

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- компьютер ---------- */
@media (min-width: 900px) {
  :root { --side: 220px; }
  .tabs { top: 0; right: auto; width: var(--side); height: auto; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 18px 14px; border-top: 0; border-right: 2px solid var(--ink); }
  .tabs a { flex: none; flex-direction: row; justify-content: flex-start; gap: 10px; height: 46px; padding: 0 8px; font-size: 15px; }
  .tabs a i { position: static; margin-left: auto; }
  .brand { display: block; padding: 4px 8px 16px; }
  .brand b { display: block; font-size: 19px; }
  .brand small { color: var(--ink-3); font-size: 12px; }
  .in-thread .tabs { display: flex; }
  .top, .composer { left: var(--side); margin-left: var(--side); }
  .composer { margin-left: 0; }
  .composer .chips { max-width: 720px; margin: 0 auto; }
  .top { padding-left: max(24px, calc((100% - var(--side) - 720px) / 2 + 16px)); padding-right: max(24px, calc((100% - var(--side) - 720px) / 2 + 16px)); }
  .view { max-width: none; padding-left: max(calc(var(--side) + 24px), calc(var(--side) + (100% - var(--side) - 720px) / 2 + 16px)); padding-right: max(24px, calc((100% - var(--side) - 720px) / 2 + 16px)); padding-bottom: 48px; }
  .fab { bottom: 24px; right: max(24px, calc((100% - var(--side) - 720px) / 2)); }
  .sheet { bottom: 50%; transform: translateY(50%); border-bottom: 2px solid var(--ink); border-radius: 30px 22px 28px 20px; animation: none; }
  .toast { left: var(--side); }
}
