:root {
  --bg: #f4ede4;
  --paper: #fffaf4;
  --ink: #2b2420;
  --muted: #8a7d72;
  --line: #e6dbcf;
  --accent: #b5502f;
  --accent-soft: #f3dccf;
  --sage: #5f7a63;
  --sage-soft: #dfe8dc;
  --gold: #b9862c;
  --gold-soft: #f4e6c8;
  --out: #f1d9c9;
  --in: #ffffff;
  --r: 14px;
  --nav: 64px;
  --top: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; }
body { overflow: hidden; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--accent); }
.hidden { display: none !important; }

/* ---------- вход ---------- */
.login { height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; }
.login h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 40px; margin: 0 0 4px; letter-spacing: -0.5px; }
.login h1 em { color: var(--accent); font-style: italic; }
.login p { color: var(--muted); margin: 0 0 28px; }
.login input { width: 100%; padding: 16px; font-size: 20px; letter-spacing: 3px; text-align: center; font-family: ui-monospace, Menlo, monospace;
  border: 1.5px solid var(--line); border-radius: var(--r); background: var(--paper); outline: none; }
.login input:focus { border-color: var(--accent); }
.login .err { color: var(--accent); min-height: 22px; margin-top: 10px; font-size: 14px; }

/* ---------- каркас ---------- */
.shell { height: 100%; display: flex; flex-direction: column; }
.top { flex: 0 0 auto; height: calc(var(--top) + var(--safe-t)); padding: var(--safe-t) 14px 0; display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-bottom: 1px solid var(--line); }
.top h2 { margin: 0; font-family: Georgia, serif; font-weight: 400; font-size: 23px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wish-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 99px; background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; }
.wish-btn svg { width: 16px; height: 16px; }
.main { flex: 1; min-height: 0; display: flex; }
.pane { flex: 1; min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.nav { flex: 0 0 auto; height: calc(var(--nav) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; background: var(--paper); border-top: 1px solid var(--line); }
.nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; color: var(--muted); position: relative; }
.nav button svg { width: 23px; height: 23px; }
.nav button.on { color: var(--accent); }
.nav .dot { position: absolute; top: 9px; left: calc(50% + 7px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.5px; line-height: 17px; font-weight: 700; }

/* ---------- чаты ---------- */
.chips { display: flex; gap: 7px; padding: 10px 12px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.chips::-webkit-scrollbar { display: none; }
/* Одна строка; на компьютере колёсико листает вбок, а по краям стрелки ‹ › (0.3.2, пожелание сестры; перенос строк из 0.3.1 убран). */
.chipbar { position: sticky; top: 0; z-index: 2; background: var(--bg); }
.chipbar .chips { position: static; }
.cnav { display: none; position: absolute; top: 0; bottom: 0; width: 44px; border: 0; padding: 0; font-size: 24px; line-height: 1; color: var(--ink); cursor: pointer; }
.cnav.l { left: 0; background: linear-gradient(to right, var(--bg) 55%, transparent); text-align: left; padding-left: 8px; }
.cnav.r { right: 0; background: linear-gradient(to left, var(--bg) 55%, transparent); text-align: right; padding-right: 8px; }
.chipbar.can-l .cnav.l, .chipbar.can-r .cnav.r { display: block; }
@media (hover: none), (pointer: coarse) { .cnav { width: 28px; pointer-events: none; font-size: 0; } }
.chip { flex: 0 0 auto; padding: 7px 13px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.search { margin: 0 12px 6px; display: block; width: calc(100% - 24px); padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); outline: none; }
.row { display: flex; gap: 12px; padding: 10px 14px; align-items: center; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:active, .row.on { background: var(--accent-soft); }
.ava { flex: 0 0 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: #fff; font-size: 17px; }
.row .mid { flex: 1; min-width: 0; }
.row .nm { display: flex; gap: 6px; align-items: baseline; }
.row .nm b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.row .nm time { color: var(--muted); font-size: 12.5px; flex: 0 0 auto; }
.row .sub { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.row .sub span { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.badge { flex: 0 0 auto; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; background: var(--sage); color: #fff; font-size: 12px; font-weight: 700; line-height: 21px; text-align: center; }
.tag { flex: 0 0 auto; font-size: 11px; padding: 2px 7px; border-radius: 6px; font-weight: 600; }
.st-new { background: #ebe4dc; color: #6f6157; }
.st-work { background: var(--accent-soft); color: var(--accent); }
.st-wait { background: var(--gold-soft); color: #8a6115; }
.st-client { background: var(--sage-soft); color: var(--sage); }
.st-archive { background: #eee; color: #999; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); line-height: 1.5; }

/* ---------- переписка ---------- */
.chat { display: flex; flex-direction: column; height: 100%; background: var(--bg); }
.chat-head { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--paper); }
.chat-head .ava { flex-basis: 38px; height: 38px; font-size: 15px; }
.chat-head .who { flex: 1; min-width: 0; }
.chat-head .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .who small { color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.icon-btn:active { background: var(--line); }
.icon-btn svg { width: 22px; height: 22px; }
.card-btn { padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; }
.msgs { flex: 1; overflow-y: auto; padding: 12px 10px 6px; display: flex; flex-direction: column; gap: 4px; }
.more { align-self: center; color: var(--muted); font-size: 13px; padding: 6px 12px; }
.day { align-self: center; font-size: 12px; color: var(--muted); background: var(--paper); padding: 3px 10px; border-radius: 99px; margin: 8px 0; }
.b { max-width: min(80%, 520px); padding: 7px 11px 6px; border-radius: 16px; background: var(--in); align-self: flex-start; box-shadow: 0 1px 0 rgba(0,0,0,.04); word-wrap: break-word; white-space: pre-wrap; line-height: 1.38; font-size: 15.5px; }
.b.o { align-self: flex-end; background: var(--out); }
.b .snd { font-size: 12.5px; font-weight: 600; color: var(--accent); margin-bottom: 1px; }
.b .meta { font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }
.b img { display: block; max-width: 100%; max-height: 300px; border-radius: 10px; margin: 2px 0; }
.b audio { width: 240px; max-width: 100%; height: 38px; display: block; }
.b .lbl { color: var(--muted); }
.tr-btn { margin-top: 4px; font-size: 13px; color: var(--accent); font-weight: 600; padding: 2px 0; }
.tr { margin-top: 5px; padding: 6px 9px; background: rgba(0,0,0,.035); border-radius: 9px; font-size: 14.5px; font-style: italic; }
.composer { flex: 0 0 auto; display: flex; gap: 8px; padding: 8px 10px calc(8px + var(--safe-b)); background: var(--paper); border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 20px; padding: 10px 14px; background: var(--bg); outline: none; max-height: 140px; font-size: 16px; line-height: 1.35; }
.send { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.send svg { width: 20px; height: 20px; }
.send:disabled { opacity: .45; }

/* ---------- задачи и формы ---------- */
.sec { padding: 14px 14px 4px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.sec.red { color: var(--accent); }
.task { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; background: var(--paper); }
.chk { flex: 0 0 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; margin-top: 1px; }
.chk.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.task .tt { flex: 1; min-width: 0; }
.task .tt b { font-weight: 500; display: block; }
.task.done .tt b { text-decoration: line-through; color: var(--muted); }
.task .tt small { color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.task .tt small a { text-decoration: none; }
.task .del { color: var(--muted); font-size: 20px; line-height: 1; padding: 0 4px; }
.add { margin: 12px; padding: 12px; background: var(--paper); border-radius: var(--r); border: 1px solid var(--line); display: grid; gap: 8px; }
.add .r { display: flex; gap: 8px; }
.add .r > * { flex: 1; min-width: 0; }
.inp { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); outline: none; font-size: 16px; }
.inp:focus { border-color: var(--accent); }
textarea.inp { resize: vertical; min-height: 70px; }
.btn { padding: 11px 16px; border-radius: 11px; background: var(--accent); color: #fff; font-weight: 600; }
.btn.ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.btn.sage { background: var(--sage); }
.btn:disabled { opacity: .5; }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; padding: 7px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.box { margin: 12px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.box h3 { margin: 0 0 6px; font-size: 17px; }
.box p { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.box .r { display: flex; gap: 8px; }
.small { font-size: 13px; color: var(--muted); }

/* ---------- лист снизу ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(43,36,32,.38); z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 560px; max-height: 92%; overflow-y: auto; background: var(--paper); border-radius: 22px 22px 0 0; padding: 8px 18px calc(18px + var(--safe-b)); animation: up .2s ease-out; }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { margin: 0 0 4px; font-family: Georgia, serif; font-weight: 400; font-size: 24px; }
.sheet .lead { color: var(--muted); margin: 0 0 14px; font-size: 14.5px; }
.sheet label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
.sheet .acts { display: flex; gap: 8px; margin-top: 16px; }
.sheet .acts .btn { flex: 1; }
.stbar { display: flex; flex-wrap: wrap; gap: 6px; }
.stbar button { padding: 7px 12px; border-radius: 99px; font-size: 14px; border: 1px solid var(--line); }
.stbar button.on { border-color: transparent; font-weight: 600; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- запись пожелания ---------- */
.rec { display: grid; place-items: center; gap: 10px; margin: 10px 0 4px; }
.rec-btn { width: 92px; height: 92px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(181,80,47,.35); }
.rec-btn svg { width: 38px; height: 38px; }
.rec-btn.live { animation: pulse 1.3s infinite; background: #9b3a1e; }
.rec .t { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 15px; min-height: 20px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(181,80,47,.5); } 70% { box-shadow: 0 0 0 22px rgba(181,80,47,0); } 100% { box-shadow: 0 0 0 0 rgba(181,80,47,0); } }
.wish { padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.wish .h { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.wish .h span { flex: 1; }
.wish p { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.4; }
.wish audio { margin-top: 6px; width: 100%; height: 36px; }
.wish select { font-size: 13px; padding: 3px 6px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav) + 18px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; z-index: 40; font-size: 14.5px; max-width: 90%; animation: fade .2s; }

/* ---------- дела: календарь и карточка (0.4.0) ---------- */
.vw { display: flex; align-items: center; gap: 10px; padding: 10px 12px 8px; background: var(--bg); }
.vw .tview { flex: 1; }
.vw .btn { flex: 0 0 auto; padding: 8px 14px; }
.thead { position: sticky; top: 0; z-index: 3; background: var(--bg); }
.strip { display: flex; align-items: center; gap: 2px; padding: 0 6px 8px; }
.ar { flex: 0 0 auto; color: var(--muted); font-size: 22px; line-height: 1; }
.strip .ar { width: 24px; padding: 8px 0; }
.dd { flex: 1; min-width: 0; display: grid; justify-items: center; gap: 2px; padding: 6px 0 5px; border-radius: 12px; font-size: 11.5px; color: var(--muted); }
.dd b { font-size: 17px; font-weight: 500; color: var(--ink); }
.dd.now-d b { color: var(--accent); font-weight: 700; }
.dd.we b { color: var(--muted); }
.dd.on { background: var(--accent); color: #fff; }
.dd.on b { color: #fff; font-weight: 700; }
.dots { display: flex; gap: 2px; height: 5px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.dots i.c { background: var(--gold); }
.dd.on .dots i { background: #fff; }
.dayline { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 4px 14px 6px; border-bottom: 1px solid var(--line); }
.dayline b { font-weight: 600; font-size: 15px; }
.tbtn { flex: 0 0 auto; padding: 5px 12px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); font-size: 14px; }
.allday { padding: 10px 12px 4px; display: grid; gap: 5px; }
.lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; padding: 0 2px; }
.ev { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; font-size: 14.5px; background: var(--accent-soft); color: #7c3219; min-width: 0; cursor: pointer; }
.ev .chk, .blk .chk { flex: 0 0 18px; width: 18px; height: 18px; border-radius: 5px; border-color: #d9a48d; background: rgba(255,255,255,.5); margin: 0; font-size: 12px; }
.ev .chk.on, .blk .chk.on { background: var(--sage); border-color: var(--sage); }
.ev.cc { background: var(--gold-soft); color: #72500f; }
.ev.done .tx { text-decoration: line-through; opacity: .6; }
.ev .tx { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hours { position: relative; margin: 14px 12px 14px 50px; }
.hr { height: 52px; border-top: 1px solid var(--line); position: relative; cursor: pointer; }
.hr span { position: absolute; left: -40px; top: -9px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.blk { position: absolute; display: flex; gap: 6px; align-items: flex-start; border-radius: 10px; padding: 6px 8px 6px 10px; background: var(--accent-soft); color: #7c3219; border-left: 4px solid var(--accent); font-size: 14.5px; overflow: hidden; line-height: 1.25; cursor: pointer; }
.blk.sm { padding-top: 2px; padding-bottom: 2px; align-items: center; }
.blk.sm .bt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk.sm small { display: none; }
.blk.done { opacity: .55; }
.blk.done .bt { text-decoration: line-through; }
.bt { flex: 1; min-width: 0; }
.bt small { display: block; font-size: 12.5px; opacity: .85; margin-top: 1px; }
.now { position: absolute; left: -6px; right: 0; height: 2px; background: #d2452f; z-index: 2; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -3px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #d2452f; }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav) + var(--safe-b) + 14px); width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 31px; line-height: 1; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(181,80,47,.4); z-index: 4; }
.fab-gap { height: 76px; }
.tail { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 12px 12px; }
.tail button { flex: 1 1 40%; padding: 11px 10px; border-radius: 11px; background: var(--paper); border: 1px solid var(--line); font-size: 14px; }
.tail b { color: var(--accent); font-weight: 700; }
.tail .late { color: var(--accent); font-weight: 600; }
.mhead { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 2px 14px 8px; }
.vw .mhead { padding: 0; }
.mhead h3 { flex: 1; min-width: 0; margin: 0; font-family: Georgia, serif; font-weight: 400; font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mhead .ar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); }
.wk, .mg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wk div { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.mg { border-top: 1px solid var(--line); background: var(--paper); }
.mc { min-height: 56px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 3px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 14px; min-width: 0; }
.mc:nth-child(7n) { border-right: 0; }
.mc.out { background: var(--bg); color: #bdb1a6; }
.mc .n { width: 25px; height: 25px; line-height: 25px; text-align: center; border-radius: 50%; }
.mc.we .n { color: var(--muted); }
.mc.sel { background: var(--accent-soft); }
.mc.td .n { background: var(--accent); color: #fff; font-weight: 700; }
.cal { height: 100%; display: flex; flex-direction: column; }
.big { flex: 1 0 auto; display: flex; flex-direction: column; }
.big .mg { flex: 1; grid-auto-rows: minmax(104px, 1fr); }
.big .mc { align-items: stretch; padding: 5px; gap: 2px; font-size: 13px; overflow: hidden; text-align: left; }
.big .mc.sel { background: var(--paper); box-shadow: inset 0 0 0 2px var(--accent); }
.big .mc .n { align-self: flex-end; width: 24px; height: 24px; line-height: 24px; flex: 0 0 auto; font-size: 13.5px; }
.it { font-size: 12.5px; line-height: 1.3; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: #7c3219; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 0 auto; }
.it.cc { background: var(--gold-soft); color: #72500f; }
.it.late { background: var(--accent); color: #fff; }
.mcm { font-size: 11px; color: var(--muted); padding-left: 6px; }
.dayhead { padding: 14px 16px 2px; }
.dayhead h3 { margin: 0; font-family: Georgia, serif; font-weight: 400; font-size: 24px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); padding: 8px 14px; border-top: 1px solid var(--line); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.r2 { display: flex; gap: 8px; margin-top: 2px; }
.r2 > * { flex: 1; min-width: 0; }
.r2 > :first-child { flex: 1.35; }
.r2 .inp { padding-left: 8px; padding-right: 4px; }
.tshare { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; color: var(--ink) !important; font-size: 14.5px !important; margin-top: 14px !important; cursor: pointer; }
.tshare input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: var(--accent); }
.tcard-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 14px; }
.tcard-links button { color: var(--muted); padding: 4px 0; }
.tcard-links #kx { color: var(--sage); font-weight: 600; }
.pnl { padding: 14px 16px 20px; }
.pnl h3 { margin: 0 0 2px; font-family: Georgia, serif; font-weight: 400; font-size: 24px; }
.pnl label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
.pnl .acts { display: flex; gap: 8px; margin-top: 16px; }
.pnl .acts .btn { flex: 1; }
@media (min-width: 900px) {
  .main.split.tcal .pane { flex: 1 1 auto; }
  .main.split.tcal .side { flex: 0 0 400px; overflow-y: auto; background: var(--bg); }
}

/* ---------- Google Календарь (0.5.0) ---------- */
:root { --g: #3f6fa8; --g-soft: #dfe8f3; }
.dots i.g { background: var(--g); }
.ev.gg { background: var(--g-soft); color: #264a75; }
.blk.gg { background: var(--g-soft); color: #264a75; border-left-color: var(--g); }
.it.gg { background: var(--g-soft); color: #264a75; }
.gmark { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.6); color: var(--g); }
.gl { padding: 3px 12px; }
.gwarn { display: block; width: calc(100% - 24px); margin: 10px 12px 0; padding: 9px 12px; border-radius: 10px; background: var(--gold-soft); color: #72500f; font-size: 13.5px; text-align: left; }
.ginfo { display: grid; gap: 10px; margin-top: 10px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.gnote { white-space: pre-wrap; padding-top: 10px; border-top: 1px solid var(--line); }
a.btn { display: block; text-align: center; text-decoration: none; }
.acts a.btn { white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.gcals { display: grid; gap: 2px; }
.gc-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.gc-row .tx { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; overflow-wrap: anywhere; }
.gc-row input { width: 18px; height: 18px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--g); }
.gc-row .del { color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 8px; }
.gc-row b { font-weight: 600; font-size: 15px; }
.gc-row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.gc-row small.bad { color: var(--accent); }
.ghow { margin-bottom: 12px; font-size: 14.5px; line-height: 1.45; }
.ghow summary { cursor: pointer; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.ghow ol { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 6px; }
.ghow p { margin: 0 0 8px; font-size: 13.5px; }
.ghow code { font-size: 13px; }

/* ---------- широкий экран: список + переписка рядом ---------- */
.side { display: none; }
@media (min-width: 900px) {
  .main.split .pane { flex: 0 0 380px; border-right: 1px solid var(--line); }
  .main.split .side { display: block; flex: 1; min-width: 0; }
  .main.split .side .chat-back { display: none; }
  .shell { max-width: 1400px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
.overlay-chat { position: fixed; inset: 0; z-index: 10; }

/* ---------- звонок ---------- */
.call-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; background: var(--sage-soft); color: var(--sage); font-weight: 600; font-size: 14px; }
.call-btn svg { width: 16px; height: 16px; }
@media (max-width: 420px) { .call-btn span { display: none; } }
.call { position: fixed; inset: 0; z-index: 90; background: #231d1a; color: #fff; display: flex; flex-direction: column; }
.call-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.call-stage video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.call-stage video.contain { object-fit: contain; }
.call-stage.has-video .call-ava { display: none; }
.call-stage video.pip { position: absolute; left: 14px; top: calc(var(--safe-t) + 74px); width: 104px; height: auto; aspect-ratio: 3/4; border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.4); z-index: 2; }
@media (min-width: 900px) { .call-stage video.pip { width: 200px; aspect-ratio: 4/3; } }
.call-ava .ava { width: 128px; height: 128px; font-size: 44px; box-shadow: 0 0 0 10px rgba(255,255,255,.06), 0 0 0 22px rgba(255,255,255,.03); }
.call-self { position: absolute; right: 14px; top: calc(var(--safe-t) + 74px); width: 104px; aspect-ratio: 3/4; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 6px 20px rgba(0,0,0,.4); z-index: 2; }
.call-self video { width: 100%; height: 100%; object-fit: cover; }
.call-self video.mirror { transform: scaleX(-1); }
@media (min-width: 900px) { .call-self { width: 200px; aspect-ratio: 4/3; } }
.call-head { position: relative; z-index: 2; padding: calc(var(--safe-t) + 22px) 20px 30px; text-align: center; background: linear-gradient(rgba(0,0,0,.45), transparent); }
.call-head b { display: block; font-family: Georgia, serif; font-weight: 400; font-size: 28px; }
.call-head span { display: block; margin-top: 4px; opacity: .75; font-size: 15px; font-variant-numeric: tabular-nums; }
.call-sound { position: relative; z-index: 2; align-self: center; padding: 10px 16px; border-radius: 99px; background: #fff; color: var(--ink); font-weight: 600; }
.call-bar { position: relative; z-index: 2; margin-top: auto; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 26px 14px calc(var(--safe-b) + 26px); background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.cb { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; font-size: 12px; background: none; min-width: 64px; }
.cb svg { box-sizing: content-box; width: 24px; height: 24px; padding: 16px; border-radius: 50%; background: rgba(255,255,255,.16); }
.cb.off svg { background: #fff; color: var(--ink); }
.cb.on svg { background: var(--sage); }
.cb.green svg { background: #3f9b5a; }
.cb.red svg { background: #d2452f; }
#cNo svg, #cEnd svg { transform: rotate(135deg); }
.cb[hidden] { display: none; }

/* свёрнутый звонок (0.2.7): полоса сверху, сайт под ней */
.call-min-btn { position: absolute; left: 10px; top: calc(var(--safe-t) + 14px); padding: 8px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; }
.call-min-btn svg { display: block; width: 26px; height: 26px; }
.call-min-btn[hidden] { display: none; }
.call-mini { display: none; }
.call.min { inset: 0 0 auto 0; height: calc(var(--safe-t) + 52px); padding-top: var(--safe-t); background: #2f7d47; flex-direction: row; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.call.min > :not(.call-mini) { display: none; }
.call.min .call-mini { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 8px 0 4px; }
.cm-open { flex: 1; min-width: 0; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 10px; color: #fff; text-align: left; }
.cm-open i { width: 9px; height: 9px; border-radius: 50%; background: #fff; flex: 0 0 auto; animation: cmpulse 1.6s infinite; }
@keyframes cmpulse { 50% { opacity: .3; } }
.cm-open b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-open span { opacity: .85; font-variant-numeric: tabular-nums; font-size: 14px; }
.cm-open span::after { content: " · развернуть"; opacity: .7; }
.cm-b { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); color: #fff; flex: 0 0 auto; }
.cm-b svg { width: 20px; height: 20px; }
.cm-b.off { background: #fff; color: var(--ink); }
.cm-b.red { background: #d2452f; }
.cm-b.red svg { transform: rotate(135deg); }
body.call-min #app, body.call-min .overlay-chat { --safe-t: 0px; position: fixed; left: 0; right: 0; bottom: 0; top: calc(env(safe-area-inset-top, 0px) + 52px); height: auto; }

/* Возможные предложения (0.5.1) */
.ideas summary { font-weight: 600; font-size: 17px; cursor: pointer; }
.ideas .ideas-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); color: var(--muted); }
.ideas h4 { margin: 18px 0 2px; font-size: 15px; }
.ideas .small { margin: 0; color: var(--muted); }
.ideas ul { margin: 6px 0 0; padding-left: 18px; }
.ideas li { margin: 5px 0; line-height: 1.4; }
.idea-shots { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.idea-shot { flex: 0 0 150px; width: 150px; padding: 0; text-align: left; }
.idea-shot img { display: block; width: 100%; height: auto; aspect-ratio: 780 / 1440; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.idea-shot span { display: block; margin-top: 5px; font-size: 13px; line-height: 1.25; color: var(--muted); }
.idea-big { display: block; width: auto; max-width: 100%; max-height: calc(100vh - 225px); height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; }

/* запись звонка (0.7.0) */
.call-head .call-rec { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 99px; background: #d2452f; color: #fff; font-style: normal; font-size: 13px; font-weight: 600; }
.call-head .call-rec[hidden], .cm-open .call-rec[hidden] { display: none; }
.cm-open .call-rec { color: #ffb4a6; font-style: normal; animation: cmpulse 1.6s infinite; }
.cb.rec-on svg { background: #d2452f; animation: cmpulse 1.6s infinite; }
.cb:disabled { opacity: .45; }
.rec-row { padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.rec-row .h { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.rec-row .h span { flex: 1; }
.rec-row video, .rec-row audio { width: 100%; margin-top: 8px; border-radius: 8px; background: #000; }
.rec-row .acts { display: flex; gap: 8px; margin-top: 8px; }

/* 0.8.0: поиск по Telegram, вложения дел, промо */
.gsearch { display: block; width: calc(100% - 24px); margin: 10px 12px 14px; padding: 11px; border: 1px dashed var(--line); border-radius: 12px; color: var(--accent); font-weight: 600; font-size: 14px; background: var(--paper); }
.gsearch:disabled { opacity: .6; }
.promo-btn { padding: 8px 10px; }
@media (max-width: 420px) { .promo-btn span { display: none; } }
.prow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.prow .btn { flex: 1 1 auto; text-align: center; text-decoration: none; }
.tfiles { display: flex; flex-wrap: wrap; gap: 8px; }
.tf { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 120px; max-width: 100%; padding: 8px 30px 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); text-decoration: none; font-size: 13.5px; }
.tf span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf small { color: var(--muted); font-size: 12px; }
.tf.img { padding: 0; width: 104px; height: 104px; min-width: 0; overflow: hidden; }
.tf.img img, .tf.img video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tf.pend { opacity: .7; border-style: dashed; padding-right: 10px; }
.tf .fx { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 12px; background: rgba(43,36,32,.6); color: #fff; font-size: 16px; line-height: 22px; }
.pwork { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--gold-soft); font-size: 14.5px; display: flex; gap: 10px; align-items: center; }
.pwork.bad { background: var(--accent-soft); color: var(--accent); }
.spin { flex: 0 0 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--gold); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.promo h4 { margin: 14px 0 0; font-size: 18px; }
.psum { white-space: pre-wrap; font-size: 14.5px; line-height: 1.5; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sl { aspect-ratio: 16/9; overflow: hidden; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 6px 8px; background: #fff; font-size: 9.5px; line-height: 1.3; }
.sl b { display: block; color: var(--accent); font-size: 11px; margin-bottom: 2px; }
.sl ul { margin: 0; padding-left: 12px; }
.sl small { display: block; color: var(--muted); margin-top: 2px; }
.sl.cover { background: var(--accent); color: #fff; border-color: var(--accent); }
.sl.cover b { color: #fff; font-size: 13px; }
.sl.cover small { color: #f3dccf; }
.phi { display: block; width: 100%; text-align: left; padding: 9px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 13.5px; color: var(--ink); }
.phi.wide { width: calc(100% - 24px); margin: 6px 12px; background: var(--paper); }

/* ---------- «Неделя» в «Делах» (0.10.0) ---------- */
.wgrid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--paper); min-height: 420px; }
.wcol { border-right: 1px solid var(--line); padding: 6px 5px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; }
.wcol:last-child { border-right: 0; }
.wcol.we { background: #fcf9f5; }
.wcol.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.wh { font-size: 13px; color: var(--muted); text-align: center; padding: 2px 0 6px; text-transform: lowercase; }
.wh b { display: inline-block; min-width: 26px; height: 26px; line-height: 26px; border-radius: 50%; font-size: 15px; color: var(--ink); }
.wcol.td .wh b { background: var(--accent); color: #fff; }
.wcol .it { white-space: normal; overflow: visible; }
.it.done { opacity: .5; text-decoration: line-through; }
.wsec { display: block; width: 100%; text-align: left; }
.wsec.td { color: var(--accent); }
