/* ============ Tokens ============ */
:root {
  color-scheme: light;
  --bg: #f7f6f3; --bg-2: #ffffff; --dot: #d5d3cf;
  --panel: rgba(255,255,255,.72); --line: rgba(0,0,0,.08); --line-2: rgba(0,0,0,.14);
  --fg: #1c1c1e; --muted: #7b7b84; --hover: rgba(0,0,0,.06);
  --ok: #30c26b;
  --accent: #ff6b45; --accent-2: #ff8a6a; --accent-soft: rgba(255,107,69,.16); --on-accent: #fff;
  --shadow: 0 10px 30px rgba(20,20,30,.16), 0 2px 6px rgba(20,20,30,.08);
  --shadow-lg: 0 24px 60px rgba(20,20,30,.22), 0 4px 10px rgba(20,20,30,.08);
  --glass-shadow: 0 10px 40px rgba(0,0,0,.14), 0 0 0 .5px rgba(0,0,0,.06);
  --radius: 14px;
  --ease: cubic-bezier(.2,.8,.2,1); --spring: cubic-bezier(.34,1.3,.5,1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Helvetica Neue", Arial, sans-serif;
  /* Язык главной — общие значения для входа, оплаты, «Поделиться» и подсказок (#home задаёт те же) */
  --h-line: oklch(0.9 0.004 70); --h-ink: oklch(0.2 0.004 70); --h-mut: oklch(0.5 0.006 70); --h-hov: oklch(0.955 0.004 70); --h-acc: oklch(0.72 0.16 38);
  --h-acc-ink: oklch(0.18 0.02 38); --h-acc-text: oklch(0.56 0.15 38); --h-ring: oklch(0.72 0.16 38 / 0.18);
  --h-bg: oklch(0.975 0.004 80); --h-field: oklch(0.97 0.004 80); --h-field-line: oklch(0.92 0.004 70);
  --h-danger: oklch(0.55 0.18 28); --h-danger-bg: oklch(0.96 0.02 28); --h-soft: oklch(0.965 0.012 60); --h-soft-line: oklch(0.92 0.02 60);
  --h-shadow: 0 16px 40px oklch(0.3 0.01 70 / 0.16); --h-shadow-lg: 0 24px 60px oklch(0.3 0.01 70 / 0.18);
  --h-font: Onest, -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--fg);
  -webkit-font-smoothing: antialiased; overflow: hidden; user-select: none; -webkit-user-select: none; cursor: default;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: default; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.spacer { flex: 1; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
@keyframes popOut { to { opacity: 0; transform: scale(.9); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes toolsIn { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: .9; } }

/* ============ Glass ============ */
.glass {
  background: var(--panel);
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid var(--line); box-shadow: var(--glass-shadow);
}

/* ============ Home ============ */
.btn { padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; transition: transform .15s var(--spring), background .15s, box-shadow .2s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px rgba(255,107,69,.3); }
.btn.primary:hover { background: var(--accent-2); }

/* ============ Home (главная: шапка, входящие, доски, док) ============ */
#home {
  --h-line: oklch(0.9 0.004 70); --h-ink: oklch(0.2 0.004 70); --h-mut: oklch(0.5 0.006 70); --h-hov: oklch(0.955 0.004 70); --h-acc: oklch(0.72 0.16 38);
  height: 100%; overflow: auto; padding: 16px 16px 32px; animation: fade .25s var(--ease); font-family: Onest, var(--font); color: var(--h-ink);
  background-color: oklch(0.975 0.004 80); background-image: radial-gradient(oklch(0.88 0.004 70) 1px, transparent 1.2px); background-size: 24px 24px;
}
#home.dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
#home .mono, #home kbd { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 10px; }
#home button { cursor: pointer; }
html.app #home { padding-top: 32px; }
.h-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; position: relative; z-index: 20; }
.h-pill { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 6px; background: #fff; border: 1px solid var(--h-line); border-radius: 14px; box-shadow: 0 8px 24px oklch(0.3 0.01 70 / 0.08); }
.h-brand { gap: 4px; padding-right: 14px; font-size: 14px; font-weight: 600; }
.h-logo { width: 36px; height: 36px; display: grid; place-items: center; }
.h-logo i { width: 20px; height: 20px; border-radius: 6px 6px 6px 2px; background: var(--h-acc); transform: rotate(-6deg); }
.h-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 9px; background: oklch(0.97 0.004 80); border: 1px solid oklch(0.92 0.004 70); width: 240px; color: oklch(0.55 0.006 70); }
.h-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--h-ink); font: inherit; font-size: 13px; user-select: text; -webkit-user-select: text; }
.h-search kbd { color: oklch(0.6 0.006 70); }
.h-me-wrap { position: relative; }
.h-me { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; }
.h-me:hover { background: var(--h-hov); }
.h-ava { width: 28px; height: 28px; border-radius: 50%; background: var(--h-acc); color: oklch(0.18 0.02 38); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.h-menu, .h-cmenu { position: absolute; z-index: 30; padding: 4px; background: #fff; border: 1px solid var(--h-line); border-radius: 12px; box-shadow: 0 16px 40px oklch(0.3 0.01 70 / 0.16); display: flex; flex-direction: column; gap: 1px; font-size: 13px; animation: pop .16s var(--spring); }
.h-menu { top: 44px; right: 0; width: 240px; }
/* колокольчик (блок 3): значок в шапке, счётчик, список уведомлений в том же меню, что и аккаунт */
.h-bell { position: relative; color: oklch(0.35 0.005 70); }
.h-bell.on, .h-bell:hover { color: var(--h-ink); }
.h-bell-n { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: var(--h-acc); color: var(--h-acc-ink); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px #fff; font-variant-numeric: tabular-nums; }
.h-notes { width: 320px; max-height: min(420px, calc(100vh - 100px)); overflow: auto; padding: 4px; }
.h-notes-h { padding: 8px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--h-mut); }
.h-menu.h-notes button { position: relative; height: auto; min-height: 32px; padding: 9px 10px 9px 24px; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 13px; line-height: 1.35; white-space: normal; text-align: left; }
.h-menu.h-notes button::before { content: ""; position: absolute; left: 9px; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: oklch(0.88 0.004 70); }
.h-notes button small { font-size: 11px; color: var(--h-mut); }
.h-notes button.unread { background: var(--h-soft); }
.h-notes button.unread::before { background: var(--h-acc); }
.h-notes button.unread:hover { background: oklch(0.95 0.016 60); }
.h-notes .h-notes-empty { padding: 22px 12px; font-size: 13px; color: var(--h-mut); text-align: center; }
/* корзина досок (блок 3): строки в языке карточек — миниатюра, название, срок, «Восстановить» */
.h-trash { display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 10px; border: 1px solid var(--h-line); border-radius: 16px; background: #fff; grid-column: 1 / -1; animation: rise .4s var(--ease) backwards; }
.h-trash .h-thumb { width: 72px; flex: none; opacity: .8; filter: saturate(.7); }
.h-trash .h-thumb .h-big { font-size: 10px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: normal; word-break: normal; overflow: hidden; } /* «Чер-новик», а не «Черн / овик» */
.h-trash .h-txt { flex: 1; min-width: 0; }
.h-trash .h-name { white-space: normal; overflow-wrap: anywhere; }
.h-trash button { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 10px; border-radius: 9px; border: 1px solid var(--h-line); background: #fff; font: inherit; font-size: 13px; font-weight: 500; color: var(--h-ink); cursor: pointer; flex: none; transition: transform .15s var(--spring), background .15s; }
.h-trash button svg { flex: none; }
.h-trash button:hover { background: var(--h-hov); }
.h-trash button:active { transform: scale(.96); }
.h-trash button:disabled { opacity: .5; }
.h-cmenu { top: 46px; right: 8px; width: 190px; }
.h-menu-who { padding: 8px 10px 8px; font-size: 12px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; }
.h-menu-who > div:first-child { font-size: 13px; font-weight: 600; color: var(--h-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-menu-who .muted { color: var(--h-mut); }
.h-menu-who .muted:empty { display: none; }
.h-menu button, .h-cmenu button { height: 32px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; border-radius: 8px; text-align: left; }
.h-menu button:hover, .h-cmenu button:hover { background: var(--h-hov); }
.h-menu .danger, .h-cmenu .danger { color: oklch(0.55 0.18 28); }
.h-menu .danger:hover, .h-cmenu .danger:hover { background: oklch(0.96 0.02 28); }
.h-cmenu kbd { color: oklch(0.6 0.006 70); }
.h-sep { display: block; height: 1px; background: oklch(0.92 0.004 70); margin: 3px 6px; }
.h-wrap { max-width: 1280px; margin: 0 auto; padding: 40px 24px 0; }
.invite-out { margin: 0 0 24px; font-size: 14px; }
.invite-out code { font-size: 16px; font-weight: 700; letter-spacing: .06em; background: var(--hover); padding: 4px 10px; border-radius: 8px; user-select: text; -webkit-user-select: text; }
.invite-out a { color: var(--accent); text-decoration: none; margin-left: 8px; }

/* Входящие: веер */
.inbox { display: flex; flex-direction: column; gap: 16px; margin-bottom: 56px; }
.inbox-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.inbox-head b { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.inbox-head .mono { font-size: 11px; color: var(--h-mut); }
.inbox-hint { margin-left: auto; font-size: 13px; color: var(--h-mut); }
.fan { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: flex-start; min-height: 0; }
.fan:empty { display: none; }
.ib-card {
  position: relative; width: 176px; flex: none; padding: 6px; display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--h-line);
  border-radius: 14px; box-shadow: 0 10px 24px oklch(0.3 0.01 70 / 0.1); cursor: grab; touch-action: none; transform: rotate(var(--rot, 0deg));
  transition: transform .75s cubic-bezier(.2,1.5,.35,1), opacity .35s ease, box-shadow .2s;
}
.ib-card:hover { box-shadow: 0 16px 34px oklch(0.3 0.01 70 / 0.16); z-index: 5; }
.ib-card.arriving { transform: translateY(-160px) rotate(calc(var(--rot, 0deg) * 4)) scale(.9); opacity: 0; transition: none; }
.ib-card.dragged { opacity: .2; }
.ib-card.busy { cursor: default; }
.ib-img { position: relative; border-radius: 9px; background: oklch(0.94 0.005 70) center / cover no-repeat; overflow: hidden; }
.ib-load { height: 110px; display: grid; place-items: center; font-size: 12px; color: var(--h-mut); animation: breathe 1.6s ease-in-out infinite; }
.ib-fail { min-height: 110px; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; background: oklch(0.97 0.01 28); font-size: 12px; color: oklch(0.45 0.08 28); }
.ib-fail-t { font-weight: 600; }
.ib-img.ib-broken { min-height: 96px; display: grid; place-items: center; background: oklch(0.97 0.01 28); } /* превью не открылось (медиа-шлюз) */
.ib-broken-t { font-size: 12px; font-weight: 600; color: oklch(0.45 0.08 28); }
.ib-fail-e { color: var(--h-mut); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ib-retry { margin-top: auto; height: 28px; padding: 0 10px; border-radius: 8px; background: #fff; border: 1px solid var(--h-line); font-size: 12px; font-weight: 500; color: var(--h-ink); }
.ib-retry:hover { background: var(--h-hov); }
.ib-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 34px; height: 34px; border-radius: 50%; background: oklch(1 0 0 / 0.92); display: grid; place-items: center; color: var(--h-ink); padding-left: 2px; }
.ib-badge { position: absolute; bottom: 8px; right: 8px; padding: 2px 6px; border-radius: 6px; background: oklch(0 0 0 / 0.6); color: #fff; font: 10px "JetBrains Mono", ui-monospace, monospace; }
.ib-txt { padding: 0 4px 4px; display: flex; flex-direction: column; gap: 3px; }
.ib-cap { font-size: 12.5px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ib-src { color: oklch(0.55 0.006 70); }
.ib-x { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--h-line); display: grid; place-items: center; color: oklch(0.4 0.005 70); opacity: 0; transform: scale(.8); transition: opacity .15s, transform .15s var(--spring); box-shadow: 0 2px 6px oklch(0.3 0.01 70 / 0.12); }
.ib-card:hover .ib-x { opacity: 1; transform: none; }
@media (hover: none) { .ib-x { opacity: 1; transform: none; } }
.ib-ghost { position: fixed; z-index: 60; pointer-events: none; cursor: grabbing; transform: rotate(3deg) scale(1.04); box-shadow: 0 28px 60px oklch(0.3 0.01 70 / 0.28); transition: transform .2s cubic-bezier(.2,1.4,.4,1); }
.ib-ghost.flying { transition: left .38s cubic-bezier(.3,.8,.2,1), top .38s cubic-bezier(.3,.8,.2,1), transform .38s cubic-bezier(.3,.8,.2,1), opacity .3s ease .08s; }
.inbox-empty { min-height: 120px; display: flex; align-items: center; justify-content: center; border: 1px dashed oklch(0.86 0.004 70); border-radius: 16px; font-size: 13px; color: var(--h-mut); text-align: center; padding: 0 24px; }

/* Доски */
.h-boards { transition: opacity .3s; }
#home.dragging .h-boards { opacity: .55; }
.h-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.h-title h1 { margin: 0; font-size: 64px; font-weight: 600; letter-spacing: -.035em; line-height: .95; }
.h-title h1 { cursor: text; outline: none; border-radius: 10px; transition: box-shadow .15s; user-select: text; -webkit-user-select: text; min-width: 1ch; }
.h-title h1:hover { box-shadow: 0 0 0 6px oklch(0.72 0.16 38 / 0.08); }
.h-title h1[contenteditable="true"] { box-shadow: 0 0 0 6px oklch(0.72 0.16 38 / 0.16); }
.h-fonts { z-index: 90; }
.h-fonts .tf-mi.on { background: oklch(0.955 0.004 70); }
.h-new { height: 40px; padding: 0 16px 0 12px; display: flex; align-items: center; gap: 8px; border-radius: 11px; background: var(--h-acc); color: oklch(0.18 0.02 38); font-size: 14px; font-weight: 600; transition: transform .15s var(--spring); }
.h-new:hover { transform: scale(1.04); }
.h-new:active { transform: scale(.97); }
.h-new kbd { opacity: .65; }
.h-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.h-tabs { display: flex; gap: 2px; padding: 4px; background: #fff; border: 1px solid var(--h-line); border-radius: 12px; }
.h-tab { flex: none; white-space: nowrap; height: 30px; padding: 0 12px; display: flex; align-items: center; gap: 6px; border-radius: 8px; font-size: 13px; color: oklch(0.45 0.005 70); }
.h-tab:hover { color: var(--h-ink); }
.h-tab.on { background: oklch(0.2 0.004 70); color: #fff; font-weight: 500; }
.h-tab .mono { opacity: .6; }
.h-sort { height: 32px; padding: 0 10px; display: flex; align-items: center; gap: 6px; border-radius: 9px; font-size: 13px; color: oklch(0.4 0.005 70); }
.h-sort:hover { background: oklch(0.94 0.004 70); }
.h-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 28px 20px; margin-top: 20px; }
.hb-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 8px 8px 12px; border-radius: 18px; cursor: pointer;
  background-image: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), oklch(0.8 0.14 50 / var(--sa, 0)), transparent 70%);
  transition: background-color .2s, box-shadow .25s, opacity .2s, transform .2s; animation: rise .45s var(--ease) backwards;
}
.hb-card:hover { background-color: #fff; --sa: .12; box-shadow: 0 12px 30px oklch(0.3 0.01 70 / 0.08); }
.hb-card.gone { opacity: 0; transform: scale(.95); }
.h-thumb { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; border: 1px solid oklch(0.91 0.004 70); }
.h-ph { position: absolute; border-radius: 6px; background: oklch(0.9 0.005 70) center / cover no-repeat; box-shadow: 0 6px 14px oklch(0.3 0.01 70 / 0.18); }
.h-ph1 { left: 10%; top: 16%; width: 38%; height: 76%; }
.h-ph2 { left: 30%; top: 28%; width: 30%; height: 58%; transform: rotate(4deg); }
.h-big { position: absolute; left: 9%; top: 14%; right: 46%; font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: .95; color: oklch(0.22 0.004 70); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.h-big.long { font-size: 22px; }
.h-thumb.small .h-big.long { font-size: 10px; }
.h-st { position: absolute; right: 9%; width: 34%; padding: 8px 8px 10px; color: oklch(0.25 0.04 70); border-radius: 3px 3px 3px 10px; font-size: 9px; font-weight: 500; line-height: 1.35; box-shadow: 0 6px 14px oklch(0.3 0.01 70 / 0.16); overflow: hidden; max-height: 64%; }
.h-ibtn { position: absolute; top: 8px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #fff; border: 1px solid var(--h-line); color: oklch(0.3 0.005 70); opacity: 0; transition: transform .15s var(--spring), opacity .15s; }
.h-ibtn:hover { transform: scale(1.12); }
.hb-card:hover .h-ibtn, .h-star.on, .hb-card:focus-within .h-ibtn { opacity: 1; }
@media (hover: none) { .h-ibtn { opacity: 1; } }
.h-star { right: 44px; }
.h-star.on { color: var(--h-acc); }
.h-star.on svg path { fill: currentColor; }
.h-more { right: 8px; }
.h-info { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.h-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.h-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-meta { font-size: 12px; color: var(--h-mut); }
.h-people { display: flex; flex: none; padding-left: 7px; }
.h-pp { width: 24px; height: 24px; border-radius: 50%; color: oklch(0.18 0.02 70); font-size: 9px; font-weight: 600; display: grid; place-items: center; border: 2px solid oklch(0.975 0.004 80); margin-left: -7px; }
.h-empty { text-align: center; color: var(--h-mut); font-size: 14px; margin-top: 48px; }
/* без подписки: плашка вместо работы, кнопка «Новая доска» приглушена (по нажатию — тарифы) */
.h-lock { display: flex; align-items: center; gap: 14px; margin: 22px 0 4px; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--glass-shadow); }
.h-lock[hidden] { display: none; }
.h-lock-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.h-lock-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.h-lock-tx span { color: var(--muted); font-size: 13px; }
.h-lock .btn { flex: none; }
#home.locked .h-new { background: var(--hover); color: var(--muted); }
#home.locked .h-title h1 { cursor: default; }
@media (max-width: 560px) { .h-lock { flex-wrap: wrap; } .h-lock .btn { width: 100%; } }

/* Док: куда бросить карточку */
.dock { position: fixed; left: 50%; bottom: 20px; z-index: 40; max-width: calc(100vw - 32px); transform: translateX(-50%); pointer-events: none; display: none; flex-direction: column; gap: 10px; padding: 12px 12px 14px; font-family: Onest, var(--font); }
.dock.shown { display: flex; }
.dock.open { pointer-events: auto; }
.dock-bg { position: absolute; inset: 0; background: oklch(1 0 0 / 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--h-line); border-radius: 22px; box-shadow: 0 24px 60px oklch(0.3 0.01 70 / 0.22); opacity: 0; transform: scale(.94); transition: opacity .2s, transform .2s; }
.dock-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 4px; font-size: 12px; color: var(--h-mut); opacity: 0; transition: opacity .2s; }
.dock.open .dock-bg { opacity: 1; transform: none; transition: opacity .3s ease .25s, transform .45s cubic-bezier(.2,1.3,.4,1) .2s; }
.dock.open .dock-head { opacity: 1; transition: opacity .3s ease .25s; }
.dock-row { position: relative; display: flex; gap: 8px; padding: 10px 4px 2px; overflow-x: auto; scrollbar-width: none; }
.dock-tile { flex: none; width: 112px; }
.dock-fly { transform-origin: 0 0; }
.dock-in { display: flex; flex-direction: column; gap: 6px; transition: transform .22s cubic-bezier(.2,1.5,.4,1); }
.dock-thumb { height: 70px; aspect-ratio: auto; border-radius: 5px; outline: 2px solid transparent; outline-offset: 2px; transition: box-shadow .3s; }
.dock.open .dock-thumb { box-shadow: 0 6px 16px oklch(0.3 0.01 70 / 0.14); }
.dock-new { display: grid; place-items: center; color: var(--h-mut); background: oklch(0.97 0.004 80); }
.h-thumb.small .h-ph { border-radius: 2.5px; box-shadow: 0 2px 6px oklch(0.3 0.01 70 / 0.18); }
.h-thumb.small .h-big { font-size: 12px; }
.h-thumb.small .h-st { padding: 3px 3px 4px; font-size: 3.6px; border-radius: 1px 1px 1px 4px; box-shadow: 0 2px 6px oklch(0.3 0.01 70 / 0.16); }
.dock-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; color: oklch(0.4 0.005 70); opacity: 0; transition: opacity .25s ease 0ms; }
.dock.open .dock-name { opacity: 1; transition-delay: var(--ld, 300ms); }
.dock-tile.hot .dock-in { transform: translateY(-8px) scale(1.1); }
.dock-tile.hot .dock-thumb { outline-color: var(--h-acc); }
.dock-tile.hot .dock-name { font-weight: 600; color: var(--h-ink); }
.dock-tile.bump .dock-in { transform: scale(1.18); }

/* Пасхалка: зажать карточку на главной и потянуть (home.js) */
.hb-card { transform: rotate(var(--r, 0deg)) scale(var(--s, 1)); }
.hb-card:active { --s: .99; }
.hb-card.pressing { --s: .96; transition: transform .45s cubic-bezier(.3,0,.3,1); }
.hb-card.armed { --s: 1.03; background-color: #fff; box-shadow: 0 14px 30px oklch(0.3 0.01 70 / 0.14); transition: transform .5s cubic-bezier(.2,1.6,.4,1), box-shadow .25s; }

/* «Главная» как доска (homeboard.js): карточки досок, подсказка клетки, панель «Теперь это доска», своя шапка */
.item.board { --h-line: oklch(0.9 0.004 70); --h-ink: oklch(0.2 0.004 70); --h-mut: oklch(0.5 0.006 70); --h-acc: oklch(0.72 0.16 38); font-family: Onest, var(--font); color: var(--h-ink); }
.bcard { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; padding: 8px 8px 12px; border-radius: 18px; background: #fff; box-shadow: 0 6px 18px oklch(0.3 0.01 70 / 0.08); }
.bcard .h-thumb { flex: 1; aspect-ratio: auto; min-height: 0; }
.bcard.gone { background: oklch(0.97 0.004 80); box-shadow: none; border: 1px dashed oklch(0.86 0.004 70); align-items: center; justify-content: center; }
.bc-gone { font-size: 13px; color: var(--h-mut); }
.bc-star { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 8px; background: #fff; border: 1px solid var(--h-line); display: grid; place-items: center; color: var(--h-acc); }
.bc-star svg { width: 13px; height: 13px; }
.bc-star svg path { fill: currentColor; }
.hb-slot { position: absolute; z-index: 1; border: 1.5px dashed oklch(0.72 0.16 38 / 0.25); background: oklch(0.72 0.16 38 / 0.03); opacity: 0; pointer-events: none; transition: opacity .2s, left .18s cubic-bezier(.2,1,.3,1), top .18s cubic-bezier(.2,1,.3,1); }
.hb-slot.on { opacity: .7; }
.hb-slot.on.near { opacity: 1; border-color: oklch(0.72 0.16 38 / 0.45); background: oklch(0.72 0.16 38 / 0.06); }
.hb-bar { position: fixed; bottom: 20px; left: 50%; z-index: 60; max-width: calc(100vw - 32px); transform: translateX(-50%) translateY(110px); transition: transform .45s cubic-bezier(.2,1.3,.4,1); display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 6px 0 16px; background: #fff; border: 1px solid oklch(0.9 0.004 70); border-radius: 14px; box-shadow: 0 12px 32px oklch(0.3 0.01 70 / 0.14); white-space: nowrap; font: 13px Onest, var(--font); color: oklch(0.2 0.004 70); }
.hb-bar.on { transform: translateX(-50%); }
#board:has(#tray.show) .hb-bar { bottom: 96px; } /* лента «Входящие» внизу — панель над ней */
.hb-bar b { font-size: 14px; font-weight: 600; }
.hb-bar > span { color: oklch(0.5 0.006 70); }
.hb-revert { height: 36px; padding: 0 12px; display: flex; align-items: center; gap: 6px; border-radius: 9px; color: oklch(0.3 0.005 70); font-size: 13px; cursor: pointer; }
.hb-revert:hover { background: oklch(0.955 0.004 70); }
.hb-apply { height: 36px; padding: 0 16px; border-radius: 9px; background: oklch(0.72 0.16 38); color: oklch(0.18 0.02 38); font-size: 13px; font-weight: 600; cursor: pointer; transition: transform .15s var(--spring); }
.hb-apply:hover { transform: scale(1.04); }
#board.homeboard #back, #board.homeboard #share-btn, #board.homeboard .not-home { display: none !important; }
#board:not(.homeboard) .home-only { display: none !important; }
.invite-out.float { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 80; margin: 0; max-width: calc(100vw - 32px); padding: 12px 16px; background: #fff; border: 1px solid oklch(0.9 0.004 70); border-radius: 14px; box-shadow: 0 16px 40px oklch(0.3 0.01 70 / 0.16); font-family: Onest, var(--font); }

/* Главная поверх доски «Главная»: страница та же, фон прозрачный, нажатия проходят к доске везде, кроме своих элементов */
/* Слои: ни главная, ни доска не образуют своих слоёв (position: absolute без z-index), поэтому холст доски (z auto) — под
   шапкой, «Входящими», заголовком и вкладками (z 15), а панели и меню доски (z 50 и выше) — над ними */
#home.overlay { position: absolute; inset: 0; z-index: auto; height: auto; background: transparent !important; pointer-events: none; animation: none; }
#home.overlay .h-top, #home.overlay .inbox, #home.overlay .h-title, #home.overlay .h-bar, #home.overlay #invite-out, #home.overlay .dock.open, #home.overlay .ib-ghost { pointer-events: auto; }
#home.overlay .inbox, #home.overlay .h-title, #home.overlay .h-bar, #home.overlay #invite-out { position: relative; z-index: 15; }
#home.overlay.sb { pointer-events: auto; } /* мышь у края окна — полосы прокрутки главной нажимаются */
#board.homeboard { position: absolute; animation: none; }
#home.overlay #home-empty { display: none; }
#board.homeboard #topleft, #board.homeboard #topright, #board.homeboard #hint { display: none !important; }
.item.board.dim { opacity: .28; }
/* «Главная» без правки — как обычная страница: стрелка, на карточке — «палец»; рука — только в режиме правки */
#board.homeboard.ro #viewport, #board.homeboard.ro #viewport .item { cursor: default; }
#board.homeboard.ro #viewport .item.board { cursor: pointer; }

html.mobile #home { padding: calc(12px + env(safe-area-inset-top)) 12px 32px; }
#home.dragging { padding-bottom: 160px; } /* пока несут карточку из входящих, снизу стоит док — последний ряд должен прокручиваться выше него */
html.mobile .h-wrap { padding: 28px 4px 0; }
html.mobile .h-search { width: 132px; } html.mobile .h-search kbd { display: none; }
html.mobile .h-title h1 { font-size: 44px; }
html.mobile .h-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; margin-top: 14px; } /* minmax(0) — длинное название не раздувает колонку */
html.mobile .h-bar { margin-top: 4px; }
/* Телефон, библиотека (дизайн «Мобильная версия»): шапка без логотипа, «Новая доска» — последней плиткой сетки */
html.mobile .h-brand, html.mobile .h-new, html.mobile .h-new kbd { display: none; }
html.mobile .h-top { justify-content: flex-end; }
html.mobile .hb-card { padding: 0; gap: 8px; background: none; box-shadow: none; }
html.mobile .h-thumb { aspect-ratio: 1 / 1.08; border-radius: 18px; }
html.mobile .h-big { display: none; } /* название — под плиткой, в плитке не дублируем */
/* порядок как в дизайне: заголовок «Доски», под ним лента входящих, ниже сетка */
html.mobile .h-wrap { display: flex; flex-direction: column; }
html.mobile .h-boards { display: contents; }
html.mobile .h-title { order: -1; }
html.mobile #invite-out { order: -2; }
html.mobile .h-st { width: 46%; font-size: 10px; }
html.mobile .h-info { padding: 0 2px; }
html.mobile .h-people, html.mobile .h-star { display: none; }
html.mobile .h-name { font-size: 15px; }
html.mobile .h-meta { font: 11px "JetBrains Mono", ui-monospace, monospace; color: var(--h-mut); }
html.mobile .h-ibtn { width: 28px; height: 28px; top: 6px; }
html.mobile .h-more { right: 6px; }
.hb-new { display: none; }
html.mobile .hb-new { display: flex; }
html.mobile .hb-new-thumb { display: grid; place-items: center; background: transparent; border: 1.5px dashed oklch(0.82 0.005 70); color: var(--h-mut); }
html.mobile .hb-new .h-info { font-size: 15px; font-weight: 600; color: var(--h-mut); }
/* лента входящих: полоса во всю ширину с прокруткой, новые слева */
html.mobile .inbox { gap: 10px; margin: 18px -16px 22px; }
html.mobile .inbox-head { padding: 0 16px; }
html.mobile .inbox-hint { font-size: 12px; }
html.mobile .fan { flex-direction: row; justify-content: flex-start; align-items: stretch; overflow-x: auto; gap: 10px; padding: 4px 16px 12px; scrollbar-width: none; scroll-snap-type: x proximity; }
html.mobile .fan::-webkit-scrollbar { display: none; }
html.mobile .ib-card { width: 124px; margin: 0; transform: none; touch-action: pan-x pan-y; scroll-snap-align: start; box-shadow: 0 6px 16px oklch(0.3 0.01 70 / 0.08); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.mobile .ib-img { height: 96px !important; }
html.mobile .ib-cap { font-size: 12px; -webkit-line-clamp: 3; }
html.mobile .ib-x { display: none; }
html.mobile .ib-ghost { width: 124px !important; }
/* карточку подняли: сетка — компактные плитки по четыре, плитка под пальцем подсвечена */
html.mobile #home.compact .h-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; }
html.mobile #home.compact .h-thumb { aspect-ratio: 1; border-radius: 12px; transition: transform .2s var(--spring), box-shadow .2s; }
html.mobile #home.compact .h-meta, html.mobile #home.compact .h-ibtn, html.mobile #home.compact .h-st, html.mobile #home.compact .h-big { display: none; }
html.mobile #home.compact .h-name, html.mobile #home.compact .hb-new .h-info { font-size: 11px; text-align: center; }
html.mobile #home.compact .h-txt { align-items: center; }
html.mobile #home.compact .h-info { width: 100%; min-width: 0; }
html.mobile #home.compact .h-name { max-width: 100%; }
html.mobile #home.compact .hb-card:not([data-drop]) { opacity: .35; }
html.mobile #home.compact [data-drop].hot .h-thumb { transform: scale(1.08); box-shadow: 0 0 0 2.5px var(--h-acc), 0 10px 22px oklch(0.3 0.01 70 / 0.16); }
html.mobile #home.compact .hb-new.hot .hb-new-thumb { border-color: var(--h-acc); color: var(--h-acc-text); }
html.mobile #home .hb-card.bump .h-thumb { animation: bump .26s var(--spring); }
html.mobile .h-tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
html.mobile .h-tabs::-webkit-scrollbar { display: none; }
html.mobile .h-title h1 { font-size: 44px; }

/* ============ Вход — макет «Авторизация» (02.11.2026): точечный фон, открытки по краям на широком экране, белая карточка ============ */
#auth { --a-acc: oklch(0.72 0.16 38); --a-acc-h: oklch(0.68 0.16 38); --a-acc-ink: oklch(0.18 0.02 38); --a-link: oklch(0.55 0.16 38); --a-link-h: oklch(0.48 0.16 38);
  --a-ink: oklch(0.2 0.004 70); --a-lab: oklch(0.3 0.005 70); --a-mut: oklch(0.45 0.006 70); --a-faint: oklch(0.48 0.006 70); --a-line: oklch(0.9 0.004 70);
  --a-field: oklch(0.965 0.004 80); --a-err: oklch(0.62 0.17 30); --a-err-ink: oklch(0.52 0.17 30); --a-mono: "JetBrains Mono", ui-monospace, monospace;
  position: relative; height: 100%; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 48px 20px;
  font-family: Onest, var(--h-font); color: var(--a-ink); animation: fade .25s var(--ease);
  background-color: oklch(0.975 0.004 80); background-image: radial-gradient(oklch(0.86 0.004 70) 1px, transparent 1.2px); background-size: 24px 24px; }
#auth > .auth-card { margin-top: auto; } #auth > .auth-legal { margin-bottom: auto; } /* по центру, а если выше экрана — прокрутка от верха */
.auth-card { position: relative; z-index: 1; flex: none; width: 100%; max-width: 440px; padding: 36px 36px 28px; border-radius: 24px; display: flex; flex-direction: column; gap: 24px;
  background: #fff; border: 1px solid var(--a-line); box-shadow: 0 24px 60px oklch(0.3 0.02 70 / 0.12); animation: pop .35s var(--spring); }
.auth-card a, .auth-card .ac-link.acc { color: var(--a-link); text-decoration: none; } .auth-card a:hover, .auth-card .ac-link.acc:hover { color: var(--a-link-h); }
.ac-head { display: flex; flex-direction: column; gap: 18px; }
.ac-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.auth-logo { width: 44px; height: 44px; border-radius: 12px 12px 12px 5px; background: var(--a-acc); transform: rotate(-5deg); }
.ac-back { height: 34px; padding: 0 10px 0 6px; border: 0; border-radius: 9px; background: none; display: flex; align-items: center; gap: 4px; font: inherit; font-size: 13px; color: var(--a-lab); cursor: pointer; }
.ac-back:hover { background: oklch(0.955 0.004 70); }
#auth-title { margin: 0 0 -10px; font-size: 32px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; overflow-wrap: anywhere; }
#auth-sub { margin: 0; font-size: 15px; line-height: 1.45; color: var(--a-mut); text-wrap: pretty; }
#auth-sub.invite { color: var(--a-ink); background: oklch(0.97 0.02 60); border: 1px solid oklch(0.92 0.04 60); border-radius: 12px; padding: 10px 12px; } #auth-sub.invite b { font-weight: 600; }
.auth-error, .auth-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.4; margin: -8px 0 -6px; }
.auth-error { background: oklch(0.96 0.03 30); color: oklch(0.42 0.14 30); } .auth-error svg { flex: none; margin-top: 2px; }
.auth-note { background: oklch(0.965 0.03 150); color: oklch(0.36 0.09 150); }
.auth-error[hidden], .auth-note[hidden] { display: none; }
.ac-fields { display: flex; flex-direction: column; gap: 16px; }
.ac-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; } .ac-field[hidden] { display: none; }
.ac-field label, .ac-lab label { font-size: 14px; font-weight: 500; color: var(--a-lab); }
.ac-lab { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; } .ac-lab a { font-size: 13px; }
.auth-card input:not([type="checkbox"]) { width: 100%; min-width: 0; height: 50px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--a-line); background: var(--a-field);
  font: inherit; font-size: 16px; color: var(--a-ink); outline: none; transition: box-shadow .15s, border-color .15s, background .15s; }
.auth-card input::placeholder { color: oklch(0.62 0.006 70); }
.auth-card input:not([type="checkbox"]):focus { background: #fff; border-color: var(--a-acc); box-shadow: 0 0 0 3px oklch(0.72 0.16 38 / 0.18); }
.ac-field.bad input, .ac-field.bad input:focus { background: #fff; border-color: var(--a-err); box-shadow: 0 0 0 3px oklch(0.62 0.17 30 / 0.14); }
.ac-err { font-size: 13px; line-height: 1.35; color: var(--a-err-ink); } .ac-err:empty { display: none; }
.ac-pw { position: relative; } .ac-pw input { padding-right: 52px !important; }
.ac-eye { position: absolute; right: 6px; top: 6px; width: 38px; height: 38px; border: 0; border-radius: 9px; background: none; display: flex; align-items: center; justify-content: center; color: var(--a-faint); cursor: pointer; }
.ac-eye:hover { background: oklch(0.94 0.004 70); } .ac-eye .ac-eye-x { display: none; } .ac-eye.on .ac-eye-x { display: inline; }
.ac-strength { display: flex; align-items: center; gap: 10px; } .ac-strength[hidden] { display: none; }
.ac-strength > div { flex: 1; display: flex; gap: 4px; } .ac-strength i { flex: 1; height: 4px; border-radius: 2px; background: oklch(0.92 0.004 70); transition: background .2s; }
.ac-strength span { font-family: var(--a-mono); font-size: 11px; color: var(--a-faint); min-width: 64px; text-align: right; }
.ac-btn { margin-top: 6px; height: 52px; border: 0; border-radius: 12px; background: var(--a-acc); color: var(--a-acc-ink); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s; }
.ac-btn[hidden] { display: none; } .ac-btn:hover { background: var(--a-acc-h); }
.ac-btn.danger-fill { background: oklch(0.58 0.19 28); color: #fff; } .ac-btn.danger-fill:hover { background: oklch(0.52 0.19 28); }
.ac-spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid oklch(0.18 0.02 38 / 0.25); border-top-color: var(--a-acc-ink); animation: spin .7s linear infinite; }
.ac-btn.busy { background: oklch(0.78 0.12 38); cursor: default; } .ac-btn.busy .ac-spin { display: block; } .ac-btn.busy span { display: none; }
.ac-code { display: flex; flex-direction: column; gap: 16px; } .ac-code[hidden] { display: none; }
.ac-boxes { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ac-boxes i { height: 58px; border-radius: 12px; border: 1px solid var(--a-line); background: var(--a-field); display: flex; align-items: center; justify-content: center;
  font-family: var(--a-mono); font-style: normal; font-size: 24px; font-weight: 500; transition: all .15s; }
.ac-boxes i.full { background: #fff; } .ac-boxes i.cur { background: #fff; border-color: var(--a-acc); box-shadow: 0 0 0 3px oklch(0.72 0.16 38 / 0.18); }
.ac-boxes.bad i { border-color: var(--a-err); box-shadow: none; }
.ac-boxes input { position: absolute; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; border: 0 !important; cursor: text; font-size: 16px; }
.ac-code-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.ac-link { border: 0; background: none; padding: 0; font: inherit; font-size: 14px; color: var(--a-link); cursor: pointer; } .ac-link:disabled { color: oklch(0.55 0.006 70); cursor: default; }
.auth-card label.auth-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.4; color: var(--a-lab); cursor: pointer; } .auth-card label.auth-check[hidden] { display: none; }
.auth-card .auth-check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: oklch(0.65 0.16 38); }
.auth-captcha { min-height: 100px; } .auth-captcha[hidden] { display: none; }
.ac-switch { margin: 0 -36px -4px; padding: 20px 36px 0; border-top: 1px solid oklch(0.92 0.004 70); display: flex; justify-content: center; gap: 6px; font-size: 15px; }
.ac-switch[hidden] { display: none; } .ac-switch span { color: var(--a-mut); } .ac-switch a { font-weight: 500; }
.ac-switch.ac-minor { font-size: 14px; } .ac-switch.ac-minor a { color: var(--a-mut); font-weight: 400; }
.auth-legal { position: relative; z-index: 1; max-width: 440px; margin: 0; font-size: 12px; line-height: 1.5; color: var(--a-faint); text-align: center; text-wrap: pretty; }
.auth-legal[hidden] { display: none; } .auth-legal a { color: var(--a-faint); text-decoration: none; } .auth-legal a:hover { color: var(--a-lab); }
/* Открытки по краям — только на широком экране (как в макете: больше 1100 px), под карточкой и без касаний */
.ad-decor { display: none; position: absolute; inset: 0; pointer-events: none; min-height: 760px; }
@media (min-width: 1101px) { .ad-decor { display: block; } }
.ad-photo { border-radius: 14px; background: center/cover no-repeat; box-shadow: 0 14px 34px oklch(0.3 0.02 70 / 0.12); }
.ad-shirt { position: absolute; left: 7%; top: 12%; width: 240px; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; transform: rotate(-6deg); }
.ad-shirt .ad-photo { width: 240px; height: 240px; background-image: url(/auth/shirt.webp); opacity: .9; }
.ad-shirt figcaption { font-size: 17px; line-height: 1.35; color: oklch(0.3 0.005 70); text-align: center; }
.ad-room { position: absolute; left: 9%; bottom: 12%; width: 190px; height: 238px; background-image: url(/auth/room.webp); transform: rotate(4deg); opacity: .92; }
.ad-note { position: absolute; left: calc(9% + 150px); bottom: calc(12% + 200px); width: 190px; padding: 18px; border-radius: 5px 5px 5px 18px; background: oklch(0.88 0.11 92); color: oklch(0.25 0.04 92);
  font-size: 16px; font-weight: 500; line-height: 1.35; transform: rotate(3deg); box-shadow: 0 10px 24px oklch(0.3 0.02 70 / 0.08); }
.ad-flow { position: absolute; right: 8%; top: 16%; width: 240px; display: flex; flex-direction: column; align-items: flex-end; }
.ad-video { width: 240px; border-radius: 14px; overflow: hidden; transform: rotate(4deg); line-height: 0; box-shadow: 0 14px 34px oklch(0.3 0.02 70 / 0.14); background: oklch(0.85 0.03 30); }
.ad-video video { display: block; width: 100%; height: 184px; object-fit: cover; object-position: center top; }
.ad-chat { position: relative; margin: -18px -34px 0 0; display: flex; align-items: flex-start; gap: 8px; }
.ad-av, .ad-av2 { flex: none; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 600; }
.ad-av { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; background: var(--a-acc); color: var(--a-acc-ink); font-size: 11px; border: 2px solid #fff; box-shadow: 0 4px 10px oklch(0.3 0.02 70 / 0.15); }
.ad-av2 { width: 22px; height: 22px; border-radius: 50%; background: oklch(0.72 0.16 250); color: oklch(0.18 0.02 250); font-size: 9px; }
.ad-msgs { width: 250px; padding: 12px 14px; border-radius: 4px 14px 14px 14px; background: #fff; border: 1px solid var(--a-line); box-shadow: 0 12px 28px oklch(0.3 0.02 70 / 0.12); display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.ad-msgs b { font-weight: 600; } .ad-msgs time { font-family: var(--a-mono); font-size: 10px; color: var(--a-faint); margin-left: 4px; }
.ad-msgs p { margin: 4px 0 0; line-height: 1.4; color: oklch(0.25 0.005 70); }
.ad-reply { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid oklch(0.93 0.004 70); }
.ad-bill { position: absolute; right: 7%; bottom: 8%; width: 290px; transform: rotate(-2deg); }
.ad-bill-card { border-radius: 14px; background: #fff; border: 1px solid var(--a-line); box-shadow: 0 14px 34px oklch(0.3 0.02 70 / 0.1); overflow: hidden; }
.ad-bill-h { padding: 12px 14px 10px; display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid oklch(0.92 0.004 70); font-size: 14px; }
.ad-bill-h b { font-weight: 600; } .ad-bill-h span { font-family: var(--a-mono); font-size: 10px; color: var(--a-faint); }
.ad-bill dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; font-size: 12px; }
.ad-bill dt, .ad-bill dd { margin: 0; padding: 7px 14px; border-bottom: 1px solid oklch(0.94 0.004 70); } .ad-bill dt { color: oklch(0.35 0.005 70); }
.ad-bill dd { font-family: var(--a-mono); font-size: 11px; text-align: right; }
.ad-bill .t { padding: 9px 14px; border: 0; background: oklch(0.965 0.004 80); font-weight: 600; color: var(--a-ink); } .ad-bill dd.t { font-size: 12px; font-weight: 500; }
.ad-ok { position: absolute; left: -54px; top: -34px; width: 110px; padding: 12px; border-radius: 5px 5px 16px 5px; background: oklch(0.84 0.09 10); color: oklch(0.25 0.05 10);
  font-size: 14px; font-weight: 500; transform: rotate(-6deg); box-shadow: 0 10px 24px oklch(0.3 0.02 70 / 0.1); }
.am-collage, .ac-legal-m, .ac-checking[hidden] { display: none; }
.ac-checking { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--a-mut); }
.ac-checking i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid oklch(0.72 0.16 38 / 0.25); border-top-color: var(--a-acc); animation: spin .7s linear infinite; }
/* Телефон — макет «Авторизация моб»: сверху кусок холста (фото, видео, стикер), снизу белая шторка с формой.
   Поле в фокусе (клавиатура) — коллаж сворачивается, шторка на весь экран и прокручивается к полю (#auth.kb) */
@media (max-width: 600px) {
  #auth { padding: 0; gap: 0; overflow: hidden; height: 100%; height: 100dvh; align-items: stretch; }
  #auth > .auth-card { margin-top: 0; }
  .ac-legal-d { display: none !important; }
  .am-collage { display: block; flex: 1 1 auto; position: relative; min-height: 260px; max-height: 852px; overflow: hidden; pointer-events: none; transition: max-height .34s cubic-bezier(.2,.8,.2,1), min-height .34s cubic-bezier(.2,.8,.2,1), opacity .25s; }
  .am-in { position: absolute; left: 0; right: 0; top: 50%; height: 300px; margin-top: -140px; }
  .am-shirt { position: absolute; left: 22px; top: 70px; width: 150px; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: rotate(-6deg); }
  .am-shirt div { width: 150px; height: 150px; border-radius: 12px; background: url(/auth/shirt.webp) center/cover no-repeat; box-shadow: 0 12px 28px oklch(0.3 0.02 70 / 0.14); }
  .am-shirt figcaption { font-size: 12px; line-height: 1.3; color: oklch(0.3 0.005 70); text-align: center; }
  .am-video { position: absolute; right: 20px; top: 84px; width: 170px; border-radius: 12px; overflow: hidden; transform: rotate(4deg); box-shadow: 0 12px 28px oklch(0.3 0.02 70 / 0.14); line-height: 0; background: oklch(0.85 0.03 30); }
  .am-video video { display: block; width: 100%; height: 130px; object-fit: cover; object-position: center top; }
  .am-note { position: absolute; right: 44px; top: 204px; width: 118px; padding: 10px 12px; border-radius: 4px 4px 4px 12px; background: oklch(0.88 0.11 92); color: oklch(0.25 0.04 92);
    font-size: 12px; font-weight: 500; line-height: 1.3; transform: rotate(-3deg); box-shadow: 0 8px 18px oklch(0.3 0.02 70 / 0.1); }
  .auth-card { flex: 0 1 auto; min-height: 0; max-width: none; overflow-y: auto; overscroll-behavior: contain; gap: 22px; border: 0; border-radius: 28px 28px 0 0; animation: none;
    padding: 26px 22px calc(34px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px oklch(0.3 0.02 70 / 0.08); transition: border-radius .3s, padding .34s cubic-bezier(.2,.8,.2,1); }
  .auth-card::-webkit-scrollbar { display: none; }
  .ac-head { gap: 14px; } .ac-top { min-height: 40px; }
  .auth-logo { width: 38px; height: 38px; border-radius: 11px 11px 11px 4px; }
  .ac-back { height: 40px; padding: 0 10px 0 4px; border-radius: 10px; font-size: 15px; } .ac-back svg { width: 18px; height: 18px; }
  #auth-title { font-size: 28px; line-height: 1.08; margin-bottom: -8px; }
  .ac-fields { gap: 14px; } .ac-field { gap: 6px; } .ac-lab a { font-size: 14px; padding: 4px 0; }
  .ac-eye { right: 3px; top: 3px; width: 44px; height: 44px; border-radius: 10px; }
  .ac-btn { margin-top: 4px; height: 54px; border-radius: 14px; font-size: 17px; }
  .ac-boxes { gap: 7px; } .ac-boxes i { height: 56px; }
  .ac-code { gap: 14px; } .ac-code-foot { flex-direction: column; align-items: flex-start; gap: 4px; } .ac-code-foot .ac-link { height: 40px; font-size: 15px; }
  .ac-switch { margin: auto 0 0; padding: 16px 0 0; } .ac-switch ~ .ac-switch { margin-top: 0; }
  .ac-legal-m { display: block; margin: -8px 0 0; font-size: 11px; color: oklch(0.52 0.006 70); } .ac-legal-m[hidden] { display: none; } .ac-legal-m a { color: oklch(0.52 0.006 70); }
  #auth.kb .am-collage { min-height: calc(env(safe-area-inset-top) + 8px); max-height: calc(env(safe-area-inset-top) + 8px); opacity: 0; }
  #auth.kb .auth-card { flex: 1 1 auto; border-radius: 0; padding: 8px 22px calc(var(--kb, 0px) + 140px); }
  #auth.kb .ac-switch, #auth.kb .ac-legal-m { display: none; }
}

/* ============ Оплата (pay.js): тарифы, «Проверяем оплату», подписка — окно в языке главной ============ */
.bill-wrap { position: fixed; inset: 0; z-index: 300; background: oklch(0.2 0.004 70 / 0.36); display: grid; place-items: center; padding: 16px; animation: fade .2s var(--ease); font-family: var(--h-font); color: var(--h-ink); }
.bill { position: relative; width: min(640px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; padding: 28px; border-radius: 22px; box-sizing: border-box; animation: pop .3s var(--spring);
  background: #fff; border: 1px solid var(--h-line); box-shadow: var(--h-shadow-lg); backdrop-filter: none; -webkit-backdrop-filter: none; }
.bill h2 { margin: 0 0 16px; font-size: 24px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; padding-right: 40px; }
.bill h3 { margin: 24px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--h-mut); }
.bill p { margin: 10px 0; font-size: 14px; line-height: 1.5; }
.bill .muted { color: var(--h-mut); }
.bill-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; font-size: 22px; font-weight: 300; line-height: 1; cursor: pointer; color: var(--h-mut); display: grid; place-items: center; transition: background .15s, color .15s; }
.bill-x:hover { background: var(--h-hov); color: var(--h-ink); }
/* кнопки окна: основная — как «Новая доска», второстепенная — белая с рамкой */
.bill .btn { height: 40px; padding: 0 16px; border-radius: 11px; font-size: 14px; font-weight: 600; background: #fff; border: 1px solid var(--h-line); color: var(--h-ink); box-shadow: none; }
.bill .btn:hover { background: var(--h-hov); }
.bill .btn.primary { background: var(--h-acc); border-color: transparent; color: var(--h-acc-ink); }
.bill .btn.primary:hover { background: oklch(0.745 0.16 38); }
.bill .btn:disabled { background: var(--h-field); color: var(--h-mut); border-color: var(--h-field-line); transform: none; cursor: default; }
/* переключатель периода — как вкладки главной */
.bill-period { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: #fff; border: 1px solid var(--h-line); margin-bottom: 16px; }
.bill-period button { flex: none; white-space: nowrap; height: 30px; padding: 0 12px; display: flex; align-items: center; gap: 6px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 13px; color: oklch(0.45 0.005 70); cursor: pointer; transition: color .15s, background .15s; }
.bill-period button:hover { color: var(--h-ink); }
.bill-period button.on { background: var(--h-ink); color: #fff; font-weight: 500; box-shadow: none; }
.bill-period em { font-style: normal; font-weight: 600; color: var(--h-acc-text); }
.bill-period button.on em { color: oklch(0.85 0.12 50); }
/* карточки тарифов */
.bill-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bill-plan { position: relative; border: 1px solid var(--h-line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: #fff; transition: box-shadow .2s; }
.bill-plan:hover { box-shadow: 0 12px 30px oklch(0.3 0.01 70 / 0.08); }
.bill-plan.hot { border-color: oklch(0.72 0.16 38 / 0.7); box-shadow: 0 0 0 3px var(--h-ring); }
.bill-plan.hot:hover { box-shadow: 0 0 0 3px var(--h-ring), 0 12px 30px oklch(0.3 0.01 70 / 0.08); }
.bill-tag { position: absolute; top: -10px; right: 16px; height: 20px; padding: 0 8px; border-radius: 6px; background: var(--h-acc); color: var(--h-acc-ink); font-size: 11px; font-weight: 600; line-height: 20px; }
.bill-pname { font-weight: 600; font-size: 16px; }
.bill-price { font-size: 30px; font-weight: 600; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.bill-price span { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--h-mut); }
.bill-plan ul { margin: 4px 0 6px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.4; flex: 1; }
.bill-plan li { position: relative; padding-left: 20px; }
.bill-plan li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 8px; height: 5px; border-left: 1.6px solid var(--h-acc-text); border-bottom: 1.6px solid var(--h-acc-text); transform: rotate(-45deg); }
.bill-plan .btn { width: 100%; }
.bill-note { font-size: 12px; line-height: 1.5; color: var(--h-mut); }
.bill-err { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--h-danger-bg); color: oklch(0.45 0.16 28); font-size: 13px; line-height: 1.4; }
/* страница подписки */
.bill-cur { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--h-field); border: 1px solid var(--h-field-line); font-size: 14px; line-height: 1.45; }
.bill-cur b { font-weight: 600; }
.bill-cur .muted { font-size: 13px; }
.bill-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.bill-hist { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.bill-hist td { padding: 9px 8px; border-top: 1px solid var(--h-line); vertical-align: top; }
.bill-hist td:first-child { padding-left: 0; color: var(--h-mut); white-space: nowrap; }
.bill-hist td:nth-child(3) { text-align: right; font-weight: 500; white-space: nowrap; }
.bill-hist td:last-child { padding-right: 0; text-align: right; color: var(--h-mut); }
.bill-hist tr:first-child td { border-top: 0; }
.bill-wait { display: flex; align-items: center; gap: 10px; }
.bill-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--h-ring); border-top-color: var(--h-acc); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 560px) {
  .bill-wrap { padding: 12px; }
  .bill { padding: 22px 18px 18px; border-radius: 20px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .bill h2 { font-size: 22px; }
  .bill-plans { grid-template-columns: 1fr; }
  .bill-hist { font-size: 12px; } .bill-hist td { padding: 8px 5px; }
}

/* ============ Board ============ */
#board { position: fixed; inset: 0; animation: fade .3s var(--ease); }
#viewport {
  position: absolute; inset: 0; overflow: hidden;
  background-color: var(--bg); touch-action: none;
}
#grid { position: absolute; left: 0; top: 0; width: 300%; height: 300%; transform-origin: 0 0; pointer-events: none; will-change: transform;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 24px 24px; }
html.wk #world { will-change: transform; }
/* WebKit: пан — родная прокрутка поля (#scroller), сетка — фон поля */
#scroller { position: absolute; inset: 0; overflow: scroll; overscroll-behavior: none; scrollbar-width: none; }
#scroller::-webkit-scrollbar { display: none; }
#field { position: relative; width: 4000000px; height: 4000000px; background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 24px 24px; }
html.sp #grid { display: none; } /* WebKit: холст — слой всегда; включать и снимать слой на каждый жест = полная перерисовка */
#world.far .item, #world.far .note, #world.far .wcard, #world.far .lcard { box-shadow: none !important; }
#viewport.panning { cursor: grabbing; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; --s: 1; } /* --s на холсте — только начальное значение; дальше её получают отдельные элементы (applyScaleVar) */
#world.live { will-change: transform; }
#inklive { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; pointer-events: none; }
#inklive #cpins { pointer-events: auto; } /* пины в слое штрихов нажимаются, сам слой — нет */
#draglayer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; } /* перетаскиваемые объекты: один слой поверх холста */
#draglayer.multi .item .rs { display: none; }
#dragfix { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; } /* стрелки и пины группы — свой слой: их перерисовка не трогает картинку объектов */
#dragink { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; z-index: 1500000000; }
#dragfix .cpin { z-index: 2000000000; } /* на время пана и зума холст — отдельный слой: браузер двигает готовую картинку (только компьютер) */
#hint {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none;
  font-size: 20px; font-weight: 600; color: var(--muted); line-height: 1.5; animation: breathe 4s ease-in-out infinite;
}
#hint span { font-size: 13px; font-weight: 400; opacity: .7; }
.guide { position: absolute; background: var(--ok); pointer-events: none; opacity: .95; z-index: 45; }
#marquee { position: absolute; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 4px; pointer-events: none; z-index: 40; }
#viewport.grab { cursor: grab; }
#world.multi .item .rs { display: none; }
.gap { position: absolute; background: var(--ok); pointer-events: none; }
.gap.h { height: calc(1px / var(--s)); }
.gap.v { width: calc(1px / var(--s)); }
.gap::before, .gap::after { content: ""; position: absolute; background: var(--ok); }
.gap.h::before, .gap.h::after { top: calc(-5px / var(--s)); width: calc(1px / var(--s)); height: calc(11px / var(--s)); }
.gap.h::before { left: 0; } .gap.h::after { right: 0; }
.gap.v::before, .gap.v::after { left: calc(-5px / var(--s)); height: calc(1px / var(--s)); width: calc(11px / var(--s)); }
.gap.v::before { top: 0; } .gap.v::after { bottom: 0; }
.gap span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--ok); color: #fff; font-size: calc(11px / var(--s)); font-weight: 600; padding: calc(2px / var(--s)) calc(6px / var(--s)); border-radius: calc(5px / var(--s)); white-space: nowrap; font-variant-numeric: tabular-nums; }
.item.sel.snapped { outline-color: var(--ok); }
.item.sel.snapped .rs { border-color: var(--ok); }
.guide.v { width: 1px; top: 0; bottom: 0; }
.guide.h { height: 1px; left: 0; right: 0; }

.pill { padding: 7px 11px; border-radius: 9px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); transition: background .15s, color .15s, transform .15s var(--spring); min-width: 52px; }
.pill:hover { color: var(--fg); }

/* Контекстная панель объекта */
.tools { position: absolute; z-index: 60; border-radius: 13px; padding: 5px; display: flex; align-items: center; gap: 2px; white-space: nowrap; animation: toolsIn .22s var(--ease) both; }
.tools.moving { animation: none; }
.tools button { height: 30px; min-width: 30px; padding: 0 8px; border-radius: 8px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--fg); transition: background .12s, transform .15s var(--spring); }
@media (hover: hover) { .tools button:hover { background: var(--hover); } }
.tools button:active { transform: scale(.92); }
.tools button.on { background: var(--accent-soft); color: var(--accent); }
.tools button svg { width: 16px; height: 16px; }
.tools .sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }
.tools .num { width: 42px; text-align: center; font-variant-numeric: tabular-nums; font-size: 13px; }
.tools .sw { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; margin: 0 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); transition: transform .15s var(--spring), border-color .15s; }
@media (hover: hover) { .tools .sw:hover { transform: scale(1.15); } }
.tools .sw.on { border-color: var(--fg); transform: scale(1.1); }
.tools .danger:hover { background: rgba(255,70,70,.18); color: #e5484d; }

/* ============ Items ============ */
.item { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; animation: pop .3s var(--spring) both; }
.item.still { animation: none; }
.item.leaving { animation: popOut .18s var(--ease) forwards; pointer-events: none; }
.item.sel { outline: calc(2px / var(--s)) solid var(--accent); outline-offset: calc(3px / var(--s)); border-radius: calc(12px / var(--s)); }
.item .rs {
  position: absolute; right: calc(-8px / var(--s)); bottom: calc(-8px / var(--s)); width: calc(16px / var(--s)); height: calc(16px / var(--s));
  border-radius: 50%; background: #fff; border: calc(2px / var(--s)) solid var(--accent); cursor: nwse-resize; display: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.item.sel .rs { display: block; animation: pop .2s var(--spring) both; }
.item.lifted .rs { display: none !important; } /* пока объект несут, ручки нет; после — появляется заново с той же анимацией */
.item.sel .rs:hover { background: var(--accent); }

.item img, .item video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.item img { opacity: 0; transition: opacity .35s var(--ease); }
.item img.ok { opacity: 1; }
.item.image, .item.video, .item.carousel { border-radius: 12px; box-shadow: var(--shadow); background: var(--bg-2); transition: box-shadow .25s var(--ease); }
.item.image:hover, .item.video:hover, .item.carousel:hover { box-shadow: var(--shadow-lg); }
.item.carousel .car { border-radius: 12px; overflow: hidden; }
/* Уровни детализации: превью снизу, оригинал поверх с плавным появлением; обложка видео и плеер так же */
.item.image .thumb, .item.image .full, .item.video .poster, .item .player { position: absolute; inset: 0; border-radius: 12px; }
.item .player { opacity: 0; transition: opacity .25s var(--ease); }
.live > .player { opacity: 1; }
.item.off { visibility: hidden; }
/* вне кадра объекты с заданной высотой не участвуют в раскладке и отрисовке; у текстов высоту меряем, им нельзя */
.item.image.off, .item.video.off, .item.carousel.off, .item.frame.off, .item.doc.off, .item.sticker.off { content-visibility: hidden; }
.play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; transition: opacity .2s, transform .25s var(--spring); }
.play::before { content: ""; width: calc(64px / var(--s)); height: calc(64px / var(--s)); border-radius: 50%; background: rgba(0,0,0,.5); display: block; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.play::after { content: ""; position: absolute; width: 0; height: 0; border-left: calc(22px / var(--s)) solid #fff; border-top: calc(13px / var(--s)) solid transparent; border-bottom: calc(13px / var(--s)) solid transparent; margin-left: calc(6px / var(--s)); }
.live > .play { opacity: 0; transform: scale(1.15); }
.loading > .play { opacity: 1; transform: none; } /* видео грузится: кольцо вместо треугольника */
.loading > .play::after { width: calc(26px / var(--s)); height: calc(26px / var(--s)); margin-left: 0; border: calc(3px / var(--s)) solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.item.video .badge { position: absolute; left: calc(10px / var(--s)); bottom: calc(10px / var(--s)); font-size: calc(11px / var(--s)); font-weight: 600; letter-spacing: .04em; background: rgba(0,0,0,.55); color: #fff; padding: calc(3px / var(--s)) calc(7px / var(--s)); border-radius: calc(6px / var(--s)); pointer-events: none; }

.car { position: relative; width: 100%; height: 100%; }
.car .track { position: absolute; inset: 0; display: flex; transition: transform .5s var(--ease); }
.car .slide { flex: none; width: 100%; height: 100%; position: relative; overflow: hidden; background: var(--bg-2); }
.car .slide img, .car .slide video { position: absolute; inset: 0; }
/* файл не открылся (медиа-шлюз): надпись вместо белого прямоугольника; объект по-прежнему можно выбрать, заменить, удалить */
.item.image.broken > img.thumb, .car .slide.broken > img, .item.link .limg.broken > img, .mf-slide.broken > img { visibility: hidden; }
.item.image.broken::after, .car .slide.broken::after, .item.link .limg.broken::after { content: 'Файл повреждён'; position: absolute; inset: 0; display: grid; place-items: center; padding: 8%; text-align: center; background: oklch(0.96 0.012 28); color: oklch(0.45 0.08 28); font-size: calc(13px / var(--s, 1)); font-weight: 600; border-radius: inherit; pointer-events: none; }
.mf-slide.broken::after { content: 'Файл повреждён'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 600; pointer-events: none; }
/* Пустой слайд «+» у своих каруселей */
.car .slide.add { display: grid; place-items: center; background: var(--bg-2); }
.car .slide.add .sadd { display: flex; flex-direction: column; align-items: center; gap: calc(10px / var(--s)); color: var(--muted); font-size: calc(14px / var(--s)); font-weight: 600; width: 100%; height: 100%; justify-content: center; transition: color .15s; }
.car .slide.add .sadd svg { width: calc(64px / var(--s)); height: calc(64px / var(--s)); padding: calc(14px / var(--s)); border-radius: 50%; background: var(--hover); color: var(--fg); transition: transform .2s var(--spring), background .15s; }
.car .slide.add .sadd:hover { color: var(--fg); } .car .slide.add .sadd:hover svg { transform: scale(1.06); background: var(--accent-soft); }
/* Режим редактирования: кнопка удаления на самом слайде */
.car .slide .sdel { display: none; position: absolute; left: calc(10px / var(--s)); top: calc(10px / var(--s)); width: calc(34px / var(--s)); height: calc(34px / var(--s)); border-radius: 50%; background: rgba(0,0,0,.55); backdrop-filter: blur(8px); color: #fff; place-items: center; z-index: 3; transition: background .15s, transform .15s var(--spring); }
.car .slide .sdel svg { width: calc(18px / var(--s)); height: calc(18px / var(--s)); }
.item.carousel.editing .slide:not(.add) .sdel { display: grid; animation: pop .2s var(--spring); }
.car .slide .sdel:hover { background: #e5484d; } .car .slide .sdel:active { transform: scale(.9); }
.item.carousel.editing { outline-color: var(--ok); }
.car .nav {
  position: absolute; top: 50%; transform: translateY(-50%) scale(.9); width: calc(36px / var(--s)); height: calc(36px / var(--s)); border-radius: 50%;
  background: rgba(0,0,0,.45); backdrop-filter: blur(8px); color: #fff; font-size: calc(22px / var(--s)); line-height: 1; opacity: 0;
  transition: opacity .18s, transform .2s var(--spring), background .15s; display: grid; place-items: center; padding-bottom: calc(3px / var(--s));
}
.car .nav.prev { left: calc(10px / var(--s)); } .car .nav.next { right: calc(10px / var(--s)); }
.item:hover .car .nav { opacity: 1; transform: translateY(-50%) scale(1); }
.car .nav:hover { background: rgba(0,0,0,.7); }
.car .nav:active { transform: translateY(-50%) scale(.9); }
.car .dots { position: absolute; left: 0; right: 0; bottom: calc(10px / var(--s)); display: flex; justify-content: center; gap: calc(5px / var(--s)); pointer-events: none; }
.car .dots i { width: calc(6px / var(--s)); height: calc(6px / var(--s)); border-radius: calc(3px / var(--s)); background: rgba(255,255,255,.45); display: block; transition: width .3s var(--spring), background .2s; }
.car .dots i.on { background: #fff; width: calc(16px / var(--s)); }
.car .cnt { position: absolute; top: calc(10px / var(--s)); right: calc(10px / var(--s)); font-size: calc(11px / var(--s)); font-weight: 600; background: rgba(0,0,0,.5); color: #fff; padding: calc(3px / var(--s)) calc(7px / var(--s)); border-radius: calc(6px / var(--s)); pointer-events: none; font-variant-numeric: tabular-nums; }

.item.text { min-height: 1em; }
/* Текст: три стиля (заголовок / текст / подпись), размер и шрифт задаются у объекта; всё внутри в em — масштабируется с размером */
.item.text .tx {
  font-family: Onest, var(--font); color: #4a4640; white-space: pre-wrap; word-wrap: break-word; outline: none;
  min-height: 1em; padding: .15em .2em; border-radius: .3em; transition: background .2s, color .2s;
}
.item.text.auto .tx { white-space: pre; }
.item.text .tx.s-h { font-weight: 600; letter-spacing: -.035em; line-height: 1; color: #1f1d1a; }
.item.text .tx.s-t { line-height: 1.55; }
.item.text .tx.s-c { font-family: "JetBrains Mono", ui-monospace, monospace; letter-spacing: .04em; text-transform: uppercase; color: #86827a; line-height: 1.4; }
.item.text .tx b, .item.text .tx strong { font-weight: 700; color: #1f1d1a; }
.item.text .tx a { color: #c2552b; text-decoration: underline; text-underline-offset: .12em; }
.item.text .tx ul, .item.text .tx ol { margin: 0; padding-left: 1.35em; }
.item.text .tx li { padding: .06em 0; }
.item.text .tx li::marker { color: #86827a; }
.item.text .tx .todo { display: flex; gap: .56em; align-items: flex-start; padding: .12em 0; }
.item.text .tx .cb { flex: none; width: .95em; height: .95em; margin-top: .3em; border: .09em solid #b5b0a8; border-radius: .25em; cursor: pointer; transition: background .15s, border-color .15s; }
.item.text .tx .todo.done .cb { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none' stroke='white' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.3 5.2l1.8 1.8 3.6-3.8'/%3E%3C/svg%3E") center/70% no-repeat; border-color: var(--accent); }
.item.text .tx .todo .tt { flex: 1; min-width: 1em; }
.item.text .tx .todo.done .tt { text-decoration: line-through; color: #b5b0a8; }
.item.text .tx .tg-head { display: flex; gap: .38em; align-items: baseline; font-weight: 600; color: #1f1d1a; }
.item.text .tx .tg-arrow { flex: none; width: 1em; display: inline-flex; justify-content: center; cursor: pointer; color: #86827a; transition: transform .16s ease; transform: rotate(90deg); }
.item.text .tx .tg-arrow svg { width: .62em; height: .62em; }
.item.text .tx.collapsed .tg-arrow { transform: none; }
.item.text .tx .tg-body { padding-left: 1.38em; }
.item.text .tx.collapsed .tg-body { display: none; }
.item.text .tx.b-quote { position: relative; font-family: "PT Serif", Georgia, serif; font-style: italic; line-height: 1.45; color: #1f1d1a; padding-left: 1.7em; }
.item.text .tx.b-quote::after { content: "«"; position: absolute; left: .2em; top: -.3em; font-family: "PT Serif", Georgia, serif; font-style: normal; font-size: 2.2em; line-height: 1; color: var(--accent); }
/* «Тег»: текст поверх медиа получает обводку и подложку, чтобы читался; .clear — свободен, зелёный контур гаснет */
.item.text.tagged .tx { outline: calc(2px / var(--s)) solid var(--accent); outline-offset: calc(4px / var(--s)); border-radius: .4em; transition: outline-color .3s, background .3s; }
.item.text.tagged:not(.sticker) .tx { background: color-mix(in srgb, var(--bg) 88%, transparent); }
.item.text.tagged.clear .tx { outline-color: var(--ok); }
.item.text.tagged.clear:not(.sticker) .tx { background: transparent; }
.item.text .tx[contenteditable="true"] { cursor: text; user-select: text; -webkit-user-select: text; caret-color: var(--accent); }
.item.text .tx[contenteditable="true"] ::selection, .item.text .tx[contenteditable="true"]::selection { background: rgba(255,107,69,.25); }
.item.text .tx:empty::before { content: attr(data-ph); color: #b5b0a8; }
/* У текста маркер ширины — справа посередине: потянули — ширина зафиксирована, текст переносится */
.item.text .rs { top: 50%; bottom: auto; right: calc(-7px / var(--s)); width: calc(9px / var(--s)); height: calc(18px / var(--s)); margin-top: calc(-9px / var(--s)); border-radius: calc(4px / var(--s)); cursor: ew-resize; }
html.touch .item.text .rs { width: calc(16px / var(--s)); height: calc(28px / var(--s)); right: calc(-10px / var(--s)); margin-top: calc(-14px / var(--s)); bottom: auto; }
#viewport.placing, #viewport.placing .item { cursor: text; }

/* ============ Lightbox ============ */
#lightbox {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 48px;
  background: rgba(0,0,0,.72); backdrop-filter: blur(30px) saturate(1.2); -webkit-backdrop-filter: blur(30px) saturate(1.2);
  animation: fade .2s var(--ease);
}
#lightbox.closing { animation: fade .18s var(--ease) reverse forwards; }
#lightbox .lb { max-width: 100%; max-height: 100%; display: grid; place-items: center; animation: pop .3s var(--spring); position: relative; }
#lightbox img, #lightbox video { max-width: calc(100vw - 96px); max-height: calc(100vh - 96px); border-radius: 12px; box-shadow: var(--shadow-lg); object-fit: contain; }
#lightbox .lbnav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; display: grid; place-items: center; padding-bottom: 3px; transition: background .15s, transform .15s var(--spring); }
#lightbox .lbnav:hover { background: rgba(255,255,255,.26); }
#lightbox .lbnav:active { transform: translateY(-50%) scale(.92); }
#lightbox .lbnav.prev { left: -60px; } #lightbox .lbnav.next { right: -60px; }
#lightbox .lbcnt { position: absolute; bottom: -34px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.7); font-size: 13px; font-variant-numeric: tabular-nums; }

#toast {
  position: fixed; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: 100px; z-index: 300;
  background: var(--fg); color: var(--bg); padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); pointer-events: none; animation: toastIn .3s var(--spring) both;
}
#toast.out { animation: toastOut .2s var(--ease) forwards; }
#toast.progress { display: grid; grid-template-columns: 1fr auto; column-gap: 14px; align-items: center; min-width: 260px; padding: 10px 14px 11px; }
#toast .pct { font-variant-numeric: tabular-nums; opacity: .6; font-size: 12px; }
#toast .bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--bg) 25%, transparent); margin-top: 8px; overflow: hidden; }
#toast .bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--accent); transition: width .4s var(--ease); }

/* ============ Лист вставки ссылки ============ */
.sheet { position: fixed; left: 0; right: 0; margin: 0 auto; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 70; width: min(520px, calc(100% - 24px));
  border-radius: 16px; padding: 10px; display: flex; gap: 8px; align-items: center; animation: toolsIn .22s var(--ease); }
.sheet input { flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--fg); background: var(--hover); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
.sheet input:focus { border-color: var(--accent); }
.sheet .btn { padding: 10px 14px; }

/* ============ Ввод текста на телефоне ============ */
.textsheet { display: none; }
html.mobile .textsheet {
  display: flex; flex-direction: column; gap: 8px; position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom) + var(--kb, 0px)); z-index: 80;
  border-radius: 16px; padding: 10px; animation: toolsIn .2s var(--ease);
}
html.mobile .textsheet textarea { font: inherit; font-size: 17px; line-height: 1.3; color: var(--fg); background: var(--hover); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; resize: none; width: 100%; }
html.mobile .textsheet textarea:focus { border-color: var(--accent); }
html.mobile .textsheet .row { display: flex; align-items: center; gap: 6px; }
html.mobile .textsheet .pill { width: 40px; min-width: 0; height: 36px; padding: 0; font-size: 18px; background: var(--hover); color: var(--fg); }
html.mobile .textsheet .pill.style { width: 36px; font-size: 16px; }
html.mobile .textsheet .pill.on { background: var(--accent); color: var(--on-accent); }
html.mobile .textsheet .row { flex-wrap: wrap; }
html.mobile .textsheet .num { width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
html.mobile .textsheet .btn { padding: 9px 18px; }
html.mobile .tools.behind { display: none; }

/* ============ Сенсорные устройства ============ */
html.touch .item .rs { width: calc(28px / var(--s)); height: calc(28px / var(--s)); right: calc(-14px / var(--s)); bottom: calc(-14px / var(--s)); }
html.touch .car .nav { opacity: 1; transform: translateY(-50%); }
#hint .m { display: none; }

/* ============ Кнопка «+» и лист форматов ============ */
.fab {
  display: none; place-items: center; position: fixed; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 28px rgba(255,107,69,.4), 0 2px 6px rgba(0,0,0,.25); z-index: 65;
  transition: transform .2s var(--spring), opacity .2s, background .15s; animation: pop .35s var(--spring);
}
.fab svg { width: 26px; height: 26px; transition: transform .25s var(--spring); }
.fab:hover { background: var(--accent-2); }
.fab:active { transform: scale(.92); }
.fab.open svg { transform: rotate(45deg); }
.fab.hide { opacity: 0; pointer-events: none; transform: scale(.6); }
.addsheet {
  display: none; flex-direction: column; position: fixed; right: 22px; bottom: calc(92px + env(safe-area-inset-bottom)); width: 320px; z-index: 64;
  border-radius: 18px; padding: 6px; animation: toolsIn .22s var(--ease);
}
.addsheet button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-align: left; font-size: 14px; transition: background .12s; }
.addsheet button:hover, .addsheet button:active { background: var(--hover); }
.addsheet button svg { width: 22px; height: 22px; flex: none; color: var(--accent); }
.addsheet button span { font-weight: 600; }
.addsheet button small { margin-left: auto; color: var(--muted); font-size: 12px; }
html.mobile .fab { display: grid; right: calc(18px + env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); width: 60px; height: 60px; }
html.mobile .addsheet:not([hidden]) { display: flex; }
html.mobile .addsheet { left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right)); width: auto; bottom: calc(90px + env(safe-area-inset-bottom)); border-radius: 20px; padding: 8px; }
html.mobile .addsheet button { padding: 12px 14px; font-size: 16px; }
/* Телефон, «Добавить» (дизайн «Мобильная версия», экран «Добавить»): три главных способа крупно, справа — куда попадёт */
html.mobile .addsheet { flex-direction: column; gap: 10px; padding: 14px 12px 12px; bottom: calc(92px + env(safe-area-inset-bottom)); background: #fff; }
.as-h { display: flex; align-items: baseline; gap: 10px; padding: 0 4px; }
.as-h b { font-size: 17px; font-weight: 600; }
.as-where { margin-left: auto; font: 12px "JetBrains Mono", ui-monospace, monospace; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.as-main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
html.mobile .as-main button { flex-direction: column; justify-content: center; gap: 8px; height: 92px; padding: 0; border-radius: 16px; background: var(--hover); font-size: 14px; text-align: center; }
html.mobile .as-main button svg { width: 26px; height: 26px; }
.as-more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
html.mobile .as-more button { flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 11px; text-align: center; }
html.mobile .as-more button svg { width: 20px; height: 20px; color: var(--muted); }
html.mobile .as-more button span { font-weight: 500; color: var(--muted); }

/* ============ Островки (верх, масштаб) — общий вид и «фонарик» ============ */
.island {
  position: absolute; z-index: 50; display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 6px;
  background: #fff; border: 1px solid #e6e4e0; border-radius: 14px; box-shadow: 0 8px 24px rgba(40, 32, 20, .08);
  overflow: hidden; --x: 0px; --y: 0px; animation: rise .4s var(--ease) both;
}
.island::before, .elbar::before, .spicker::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: 0; top: 0; transform: translate(var(--x), var(--y)); width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; /* ровно под курсором, без догоняния */
  background: radial-gradient(circle, rgba(255, 176, 92, .95) 0%, rgba(255, 122, 69, .55) 30%, rgba(255, 122, 69, 0) 65%);
  opacity: 0; transition: opacity .3s ease;
}
.island.is-lit::before { opacity: 1; }
.island > * { position: relative; z-index: 1; }
.topleft { top: 16px; left: 16px; }
.topright { top: 16px; right: 16px; padding-left: 10px; }
.zoombar { right: 16px; bottom: 16px; height: 40px; padding: 0 4px; gap: 2px; border-radius: 12px; }
.iconbtn { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #4a4741; transition: transform .15s var(--spring); }
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn:active, .ghost:active, .namebtn:active, .primary-dark:active { transform: scale(.95); }
.namebtn { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px 0 6px; border-radius: 9px; color: #1f1e1c; transition: transform .15s var(--spring); }
.namebtn svg { width: 12px; height: 12px; color: #8a8782; flex: none; }
.bname { font-weight: 600; font-size: 15px; outline: none; min-width: 40px; max-width: 40vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.bname[contenteditable="true"] { text-overflow: clip; user-select: text; -webkit-user-select: text; cursor: text; background: var(--hover); border-radius: 6px; padding: 2px 6px; margin: -2px -6px; }
.saved { font-size: 12px; color: var(--muted); padding-right: 6px; }
.saved:empty { display: none; }
.ghost { height: 36px; padding: 0 10px; border-radius: 9px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: #55524c; font-variant-numeric: tabular-nums; transition: transform .15s var(--spring); }
.ghost svg { width: 15px; height: 15px; }
.ghost.is-on { background: #f1efeb; color: #1f1e1c; }
.primary-dark { white-space: nowrap; flex: none; height: 36px; padding: 0 14px; border-radius: 9px; background: #1f1e1c; color: #faf9f7; font-size: 13px; font-weight: 600; display: flex; align-items: center; transition: transform .15s var(--spring), background .15s; }
@media (hover: hover) { .primary-dark:hover { background: #33312d; } }
.divider { width: 1px; height: 20px; background: #e6e4e0; margin: 0 2px; flex: none; }
.people { display: flex; align-items: center; padding-right: 2px; }
.av { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #2a1d12; flex: none; }
.av + .av { margin-left: -7px; }
/* Поповеры под островками */
.pop { position: absolute; z-index: 75; background: #fff; border: 1px solid #e6e4e0; border-radius: 16px; box-shadow: 0 16px 40px rgba(40, 32, 20, .14); animation: toolsIn .18s var(--ease) both; }
.menu { top: 72px; left: 16px; width: 220px; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.menu button { height: 36px; padding: 0 10px; border-radius: 9px; text-align: left; font-size: 13px; color: #2b2925; }
@media (hover: hover) { .menu button:hover { background: #f4f2ee; } }
.menu .danger { color: #d23c32; }
.menu .sep { height: 1px; background: #eeece8; margin: 4px 6px; }
.menu .gpu-row { display: flex; align-items: center; gap: 8px; }
.menu .gpu-row .gpu-st { margin-left: auto; color: #8a867e; font-size: 12px; font-variant-numeric: tabular-nums; }
.menu .gpu-row .sw { flex: none; width: 28px; height: 16px; border-radius: 8px; background: #dcd9d3; position: relative; transition: background .15s; }
.menu .gpu-row .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.menu .gpu-row .sw.on { background: #2b2925; }
.menu .gpu-row .sw.on::after { transform: translateX(12px); }
.menu .gpu-row:disabled { opacity: .5; }
.cpanel { top: 72px; right: 16px; width: 360px; overflow: hidden; }
.cpanel-head { display: flex; align-items: center; padding: 10px 10px 10px 16px; border-bottom: 1px solid #eeece8; }
.cpanel-head .title { font-size: 15px; font-weight: 600; margin-right: auto; }
.cempty { padding: 44px 32px 52px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.cempty b { font-size: 14px; }
.cempty span { font-size: 13px; line-height: 1.5; color: #807c75; max-width: 250px; }
.cempty kbd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 500; color: #1f1e1c; }
/* «Поделиться»: поповер под правым островком — приглашение по почте, участники и гости, доступ по ссылке. Шрифт — как у соседних островков */
.share { top: 72px; right: 16px; width: 420px; padding: 16px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 88px); max-height: calc(100dvh - 88px); overflow: auto; }
.share-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.share-invite { display: flex; flex-wrap: wrap; gap: 8px; }
.share-invite input { flex: 1 1 100%; min-width: 0; height: 38px; font: inherit; font-size: 13px; color: var(--h-ink); background: var(--h-field); border: 1px solid var(--h-field-line); border-radius: 10px; padding: 0 12px; outline: none; user-select: text; -webkit-user-select: text; transition: border-color .15s, box-shadow .15s, background .15s; }
.share-invite input::placeholder { color: oklch(0.66 0.006 70); }
.share-invite input:focus { background: #fff; border-color: var(--h-acc); box-shadow: 0 0 0 3px var(--h-ring); }
.share form select { flex: 1; height: 36px; } /* выше по весу, чем общее правило .share select ниже */
.share-invite .primary-dark { height: 36px; }
.share-invite .primary-dark:disabled { opacity: .6; }
/* выпадающие роли: своя стрелка вместо системной, у участников — без рамки до наведения */
.share select { -webkit-appearance: none; appearance: none; font: inherit; font-size: 13px; height: 32px; max-width: 100%; padding: 0 28px 0 10px; border: 1px solid var(--h-line); border-radius: 9px; color: var(--h-ink); cursor: pointer; transition: border-color .15s, background-color .15s;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23807c75' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E") no-repeat right 9px center; }
.share select:hover { background-color: var(--h-hov); }
.share select:focus-visible { outline: 2px solid var(--h-acc); outline-offset: 1px; }
.share select:disabled { opacity: .55; cursor: default; }
.share-m select { flex: none; height: 30px; font-size: 12px; border-color: transparent; background-color: transparent; color: oklch(0.4 0.005 70); }
.share-m select:hover { background-color: var(--h-hov); }
.share-err { margin: -4px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--h-danger-bg); color: oklch(0.45 0.16 28); font-size: 12px; line-height: 1.4; }
.share-members { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.share-sec { font-size: 11px; font-weight: 600; color: var(--h-mut); text-transform: uppercase; letter-spacing: .04em; padding: 10px 6px 4px; }
.share-sec:first-child { padding-top: 0; }
.share-m { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px; border-radius: 10px; font-size: 13px; }
.share-m:hover { background: oklch(0.975 0.004 80); }
.share-m .w-av { width: 26px; height: 26px; font-size: 9px; box-shadow: none; }
.share-who { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.share-me { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.share-who small { font-size: 11px; color: var(--h-mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-r { font-size: 12px; color: var(--h-mut); flex: none; padding-right: 4px; }
.share-x { flex: none; width: 28px; height: 28px; border: 0; background: none; color: var(--h-mut); font-size: 18px; font-weight: 300; line-height: 1; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.share-x:hover { background: var(--h-hov); color: var(--h-ink); }
.link-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 12px; background: var(--h-field); border: 1px solid var(--h-field-line); }
.link-ico { width: 32px; height: 32px; border-radius: 9px; background: #fff; border: 1px solid var(--h-line); display: grid; place-items: center; flex: none; color: oklch(0.4 0.005 70); }
.link-ico svg { width: 15px; height: 15px; }
.share-txt { flex: 1; min-width: 0; }
.link-row .t { font-size: 13px; font-weight: 500; }
.link-row .s { font-size: 11px; color: var(--h-mut); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#share-role { flex: none; }
.share-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: oklch(0.35 0.005 70); margin-top: -4px; padding: 0 2px; cursor: pointer; }
.share-check input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: oklch(0.65 0.16 38); }
.share-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 2px; }
.share-foot .hint { min-width: 0; font-size: 12px; line-height: 1.4; color: var(--h-mut); }
html.mobile .topleft { top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); height: 44px; }
html.mobile .topright { top: calc(8px + env(safe-area-inset-top)); right: calc(8px + env(safe-area-inset-right)); height: 44px; padding-left: 6px; }
html.mobile #comments-btn, html.mobile .zoombar { display: none; }
/* Телефон, холст (дизайн «Мобильная версия», экран «Доска»): слева круглая «назад», по центру название с числом
   элементов, справа аватары участников — тап открывает доступ; внизу панель «Т · + · комментарии» */
.bcount, .mpeople, .mbar { display: none; }
html.mobile .topleft { left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right)); justify-content: center; background: none; border: 0; box-shadow: none; overflow: visible; padding: 0; pointer-events: none; }
html.mobile .topleft > * { pointer-events: auto; }
html.mobile #back { position: absolute; left: 0; width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 1px solid #e6e4e0; box-shadow: 0 6px 18px rgba(40,32,20,.08); }
html.mobile #bmenu-btn { height: 40px; padding: 0 12px 0 14px; border-radius: 20px; background: #fff; border: 1px solid #e6e4e0; box-shadow: 0 6px 18px rgba(40,32,20,.08); }
html.mobile .bname { max-width: 46vw; }
html.mobile .bcount { display: inline; font: 12px "JetBrains Mono", ui-monospace, monospace; color: #8a8782; }
html.mobile .topright { background: none; border: 0; box-shadow: none; padding: 0; overflow: visible; }
html.mobile #share-btn { display: none; }
html.mobile .mpeople { display: flex; align-items: center; height: 44px; padding: 0 2px; }
html.mobile .mpeople i { width: 32px; height: 32px; margin-left: -9px; border-radius: 50%; border: 2px solid #fff; display: grid; place-items: center; font: normal 600 11px var(--font); color: oklch(0.18 0.02 70); box-shadow: 0 4px 10px rgba(40,32,20,.1); }
html.mobile .mpeople i:first-child { margin-left: 0; }
html.mobile .mpeople .solo { background: #fff; color: #4a4741; border: 1px solid #e6e4e0; width: 40px; height: 40px; }
html.mobile .mpeople .solo svg { width: 18px; height: 18px; }
html.mobile .fab { display: none !important; }
html.mobile .mbar { display: flex; position: absolute; z-index: 55; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); align-items: center; gap: 6px; padding: 6px;
  background: #fff; border: 1px solid #e6e4e0; border-radius: 30px; box-shadow: 0 10px 28px rgba(40,32,20,.12); transition: opacity .2s, transform .25s var(--spring); }
html.mobile .mbar.hide { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px) scale(.9); }
.mbar-b { height: 48px; min-width: 52px; padding: 0 14px; border-radius: 24px; display: flex; align-items: center; justify-content: center; gap: 6px; color: #2b2a27; font-size: 14px; font-weight: 600; }
.mbar-b svg { width: 20px; height: 20px; }
.mbar-b:active { background: var(--hover); }
.mbar-plus { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #1f1e1c; color: #fff; transition: transform .2s var(--spring); }
.mbar-plus svg { width: 24px; height: 24px; transition: transform .25s var(--spring); }
.mbar-plus.open svg { transform: rotate(45deg); }
.mbar-plus:active { transform: scale(.92); }
.mbar-com.on { color: var(--accent); }
html.mobile .share, html.mobile .menu { top: calc(60px + env(safe-area-inset-top)); }
html.mobile .share { left: 8px; right: 8px; width: auto; }
html.mobile .share-foot { flex-direction: column; align-items: stretch; }

/* ============ Панель элементов (компьютер) с «фонариком» ============ */
.elbar {
  position: fixed; left: 16px; top: 50%; transform: translateY(-50%); z-index: 50;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: #fff; border: 1px solid #e6e4e0; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(40, 32, 20, .08); overflow: hidden; /* фонарик не вылезает за панель */
  --x: 26px; --y: 26px;
}

.elbar.is-lit::before { opacity: 1; }
.elbar .tool {
  position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #4a4741; transition: color .2s ease, background-color .2s ease, transform .15s var(--spring);
}
.elbar .tool svg { width: 16px; height: 16px; }
.elbar .tool.is-hot { color: #2a1a10; }
.elbar .tool:active { transform: scale(.92); }
.eltip {
  position: fixed; z-index: 90; pointer-events: none; display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px;
  border-radius: 8px; background: #2b2a27; color: #f8f7f4; font-size: 12px; white-space: nowrap;
  opacity: 0; transform: translateX(-4px); transition: opacity .15s ease, transform .15s ease;
}
.eltip.is-shown { opacity: 1; transform: none; }
.eltip kbd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10px; opacity: .6; }
html.mobile .elbar, html.mobile .eltip { display: none; }

/* ============ Ссылка: мини-окно, «Входящие», перетаскивание ============ */
.elbar .tool.is-on { background: #f08a5d; color: #2a1a10; }
.lpaste { position: fixed; z-index: 76; width: 300px; padding: 10px; background: #fff; border: 1px solid #e6e4e0; border-radius: 14px; box-shadow: 0 16px 40px rgba(40,32,20,.14); display: flex; flex-direction: column; gap: 8px; animation: toolsIn .2s var(--ease) both; }
.lpaste[hidden] { display: none; }
.lpaste::before { content: ""; position: absolute; left: -6px; top: 20px; width: 10px; height: 10px; background: #fff; border-left: 1px solid #e6e4e0; border-bottom: 1px solid #e6e4e0; transform: rotate(45deg); }
.lpaste-field { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 4px 0 10px; border: 1px solid #f08a5d; border-radius: 10px; box-shadow: 0 0 0 3px rgba(240,138,93,.18); }
.lpaste-field input { flex: 1; min-width: 0; border: 0; outline: 0; font: 13px var(--font); color: #1f1e1c; background: transparent; user-select: text; -webkit-user-select: text; }
.lpaste-field input::placeholder { color: #b5b2ac; }
.enter { flex: none; height: 28px; padding: 0 10px; border-radius: 7px; background: #f1efeb; font: 10px ui-monospace, "SF Mono", Menlo, monospace; color: #b5b2ac; }
.enter.ready { background: #1f1e1c; color: #faf9f7; }
.lpaste-hint { font-size: 11px; color: #807c75; padding: 0 2px; }
.lpaste-hint.bad { color: #d4492f; }
.tray { position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 16px; z-index: 55; display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 8px 0 14px;
  background: #fff; border: 1px solid #e6e4e0; border-radius: 16px; box-shadow: 0 10px 28px rgba(40,32,20,.12); transform: translateY(150%); transition: transform .32s var(--ease); }
.tray.show { transform: none; }
.tray-label { display: flex; flex-direction: column; gap: 2px; padding-right: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tray-label span { font: 9px ui-monospace, "SF Mono", Menlo, monospace; color: #807c75; }
.tray-items { display: flex; gap: 8px; }
.tthumb { position: relative; width: 48px; height: 48px; border-radius: 9px; background-size: cover; background-position: center; flex: none; cursor: grab; touch-action: none; transition: transform .15s var(--spring); }
.tthumb:active { cursor: grabbing; transform: scale(.95); }
.tthumb.fresh { outline: 2px solid #f08a5d; outline-offset: 1px; animation: pop .3s var(--spring); }
.tthumb.loading::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); border-top-color: transparent; animation: spin .8s linear infinite; }
.tthumb.loading { filter: saturate(.6); }
.tthumb.error { outline: 2px solid #d4492f; outline-offset: 1px; filter: grayscale(1); }
.tdel { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: #1f1e1c; color: #fff; display: grid; place-items: center;
  opacity: 0; transform: scale(.7); transition: opacity .15s, transform .15s var(--spring); box-shadow: 0 0 0 2px #fff; z-index: 2; }
.tdel svg { width: 8px; height: 8px; }
.tthumb:hover .tdel, .tdel:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .tdel { opacity: 1; transform: none; } }
.tray-items { padding-top: 6px; margin-top: -6px; }
.tthumb b { position: absolute; right: 3px; bottom: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; display: grid; place-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.tray-x { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #807c75; }
.tray-x svg { width: 12px; height: 12px; }
@media (hover: hover) { .tray-x:hover { background: #f4f2ee; } }
.tdrag { position: fixed; z-index: 95; pointer-events: none; width: 52px; height: 52px; border-radius: 10px; background: #e6e4e0 center/cover; transform: rotate(-5deg) scale(1.05); box-shadow: 0 14px 30px rgba(40,32,20,.25); }
.tghost { position: fixed; z-index: 45; pointer-events: none; border: 1.5px dashed #f08a5d; border-radius: 12px; background: rgba(240,138,93,.06); transition: opacity .15s; }
.flyer { position: fixed; z-index: 96; width: 40px; height: 40px; border-radius: 9px; background: #f08a5d; pointer-events: none; transition: transform .42s var(--ease), opacity .42s ease; }
html.mobile .tray, html.mobile .lpaste { display: none; }
/* Карточка-ссылка на доске: размеры в em, font-size задаётся от ширины */
.item.link .lcard { background: #fff; border: 1px solid #e6e4e0; border-radius: .7em; padding: .7em; display: flex; flex-direction: column; gap: .45em; box-shadow: var(--shadow); }
.item.link.sel { border-radius: .7em; }
.item.link .limg { position: relative; aspect-ratio: 1.83; border-radius: .45em; overflow: hidden; background: #f1efeb; }
.item.link .limg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.item.link .lt { font-size: .76em; font-weight: 500; line-height: 1.3; color: #1f1e1c; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item.link .ld { display: flex; align-items: center; gap: .35em; font: .58em ui-monospace, "SF Mono", Menlo, monospace; color: #807c75; }
.item.link .ld i { width: 1.2em; height: 1.2em; border-radius: .3em; flex: none; }

/* ============ Телефон ============ */
html.mobile body { -webkit-touch-callout: none; }
html.mobile .glass { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
html.mobile #hint { font-size: 17px; padding: 0 32px; }
html.mobile #hint .d { display: none; } html.mobile #hint .m { display: inline; } /* текст — одним блоком внутри #hint: сетка не разносит строки по экрану */
html.mobile .bname { max-width: 34vw; font-size: 14px; }
html.mobile #saved { display: none; }
html.mobile .tools {
  left: calc(8px + env(safe-area-inset-left)) !important; right: calc(8px + env(safe-area-inset-right)); top: auto !important; bottom: calc(16px + env(safe-area-inset-bottom) + var(--kb, 0px)); border-radius: 14px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; animation: toolsIn .2s var(--ease);
}
html.mobile .tools::-webkit-scrollbar { display: none; }
html.mobile .tools > * { flex: none; }
html.mobile .tools { justify-content: flex-start; gap: 5px; padding: 7px; }
html.mobile .tools > :first-child { margin-left: auto; } html.mobile .tools > :last-child { margin-right: auto; }
html.mobile .tools.moving { animation: none; }
html.mobile .tools button { height: 44px; min-width: 44px; padding: 0 11px; font-size: 14px; font-weight: 600; border-radius: 12px; background: var(--hover); }
html.mobile .tools button.on { background: var(--accent); color: var(--on-accent); }
html.mobile .tools button.danger { color: #e5484d; }
html.mobile .item .rs { display: none !important; }
html.mobile .item.sel { outline-color: var(--line-2); }
html.mobile .item.movable { outline-color: var(--accent); outline-width: calc(3px / var(--s)); }
html.mobile .item.held { outline-color: var(--accent); outline-width: calc(3px / var(--s)); }
html.mobile .tools button svg { width: 18px; height: 18px; }
html.mobile .tools .sw { width: 22px; height: 22px; }
html.mobile .sheet { bottom: calc(24px + env(safe-area-inset-bottom) + var(--kb, 0px)); flex-wrap: wrap; }
html.mobile .sheet input { flex-basis: 100%; }
html.mobile #toast { bottom: calc(96px + env(safe-area-inset-bottom) + var(--kb, 0px)); max-width: calc(100% - 32px); white-space: normal; text-align: center; }
html.mobile #lightbox { padding: 16px; }
html.mobile #lightbox img, html.mobile #lightbox video { max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); }
html.mobile #lightbox .lbnav { width: 40px; height: 40px; }
html.mobile #lightbox .lbnav.prev { left: 4px; } html.mobile #lightbox .lbnav.next { right: 4px; }
html.mobile #lightbox .lbcnt { bottom: -26px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============ Текст: карточка форматирования и её меню ============ */
.tfmt { position: fixed; z-index: 62; width: 236px; padding: 6px; display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid #e6e4e0; border-radius: 14px; box-shadow: 0 12px 28px rgba(40,32,20,.14); font-size: 14px; color: #1f1d1a; animation: tfRise .16s ease both; }
.tfmt[hidden], .tf-menu[hidden], .tf-scrub[hidden] { display: none; }
@keyframes tfRise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tf-row { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 10px; border-radius: 9px; font-size: 14px; color: #1f1d1a; text-align: left; }
.tf-row:not(.static):hover, .tf-row.open { background: #f3f2ef; }
.tf-ico { width: 18px; display: flex; align-items: center; justify-content: center; color: #4a4640; flex: none; }
.tf-rn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Мини-карточка текста: одна строка — размер, жирный, удалить, раскрыть; остальное появляется по стрелке */
.tf-mini { gap: 6px; padding: 0 2px 0 4px; }
.tf-mini .tf-size { margin-right: auto; }
.tf-num { min-width: 30px; text-align: center; font: 500 12px "JetBrains Mono", ui-monospace, monospace; color: #1f1d1a; }
.tf-mb { width: 36px; height: 36px; flex: none; }
.tf-mdel { color: #c4473a; }
.tf-mdel:hover { background: rgba(229, 72, 77, .08) !important; }
#tf-more svg { transition: transform .2s var(--ease); }
.tfmt:not(.mini) #tf-more svg { transform: rotate(180deg); }
.tfmt.mini > :not(.tf-mini) { display: none !important; }
.tfmt:not(.mini) .tf-row.static, .tfmt:not(.mini) .tf-del, .tfmt:not(.mini) .tf-mini + .tf-row + .tf-row + .tf-row + .tf-hsep { display: none; } /* в раскрытой — без дублей размера и «Удалить» */
.tf-del { color: #c4473a; }
.tf-del:hover { background: rgba(229, 72, 77, .08) !important; }
.tf-del kbd { margin-left: auto; font: 10px "JetBrains Mono", ui-monospace, monospace; color: #86827a; }
.tools.fmt-host { visibility: hidden; pointer-events: none; } /* у текста корзина в карточке оформления */
.tf-chev { color: #86827a; flex: none; margin-right: 4px; }
.tf-size { display: flex; align-items: center; height: 30px; border-radius: 8px; background: #f3f2ef; }
.tf-step { width: 26px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: #4a4640; }
.tf-step:hover { background: #e9e7e3; }
.tf-size input { width: 34px; height: 30px; border: 0; outline: 0; background: transparent; text-align: center; font: 500 12px "JetBrains Mono", ui-monospace, monospace; color: #1f1d1a; cursor: ew-resize; padding: 0; user-select: none; -webkit-user-select: none; }
.tf-size input:focus { cursor: text; background: #fff; box-shadow: inset 0 0 0 1.5px var(--accent); border-radius: 6px; user-select: text; -webkit-user-select: text; }
.tf-hsep { height: 1px; background: #ebe9e5; margin: 4px; }
.tf-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.tf-gb { height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #4a4640; }
.tf-gb:hover { background: #f3f2ef; }
.tf-gb.on { background: #f3f2ef; color: #1f1d1a; }
.tf-chip { width: 24px; height: 24px; border-radius: 7px; border: 1px solid #e6e4e0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.tf-gb.on .tf-chip { border-color: var(--accent); }
.tf-colors { display: flex; gap: 4px; padding: 4px 4px 2px; justify-content: space-around; }
.tf-colors button { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.tf-colors button:hover { background: #f3f2ef; }
.tf-colors i { width: 14px; height: 14px; border-radius: 50%; display: block; }
.tf-colors button.on i { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--accent); }
.tf-linkrow { display: flex; gap: 4px; padding: 4px 2px 2px; }
.tf-linkrow input { flex: 1; min-width: 0; height: 32px; border: 0; outline: 0; border-radius: 8px; background: #f3f2ef; padding: 0 10px; font: 13px var(--font); color: #1f1d1a; user-select: text; -webkit-user-select: text; }
.tf-linkrow input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); background: #fff; }
.tf-linkrow button { height: 32px; padding: 0 12px; border-radius: 8px; background: #f08a5d; color: #2a1a10; font-size: 13px; font-weight: 600; }
.tf-menu { position: fixed; z-index: 63; width: 220px; padding: 6px; background: #fff; border: 1px solid #e6e4e0; border-radius: 12px; box-shadow: 0 16px 40px rgba(40,32,20,.16); display: flex; flex-direction: column; gap: 2px; overflow: auto; animation: tfRise .14s ease both; }
#tf-menu { width: 260px; }
.tf-mi { display: flex; align-items: center; gap: 10px; height: 44px; flex: none; padding: 0 10px; border-radius: 9px; text-align: left; color: #1f1d1a; }
.tf-mi:hover { background: #f3f2ef; }
.tf-prev { width: 28px; flex: none; display: flex; justify-content: center; color: #4a4640; }
.tf-nm { font-size: 13px; }
.tf-mi.on .tf-nm { font-weight: 600; }
.tf-mi kbd { margin-left: auto; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 10px; color: #86827a; white-space: nowrap; }
.tf-msep { height: 1px; background: #ebe9e5; margin: 4px 6px; flex: none; }
.tf-cap { padding: 6px 10px 4px; font: 10px "JetBrains Mono", ui-monospace, monospace; color: #86827a; flex: none; }
.tf-sizes { width: auto; display: grid; grid-template-columns: repeat(5, 44px); }
.tf-sizes[hidden] { display: none; }
.tf-sizes .tf-cap { grid-column: 1 / -1; padding: 4px 6px 6px; }
.tf-sizes button { height: 34px; border-radius: 8px; font: 12px "JetBrains Mono", ui-monospace, monospace; color: #4a4640; }
.tf-sizes button:hover { background: #f3f2ef; }
.tf-sizes button.on { background: #f08a5d; color: #2a1a10; }
.tf-fonts { width: 280px; }
.tf-fonts .tf-mi { height: 42px; }
.tf-fonts .tf-nm { font-size: 17px; }
.tf-fonts .tf-mi kbd { font-size: 9px; }
.tf-emoji { width: 300px; padding: 8px; gap: 6px; }
.tf-em-search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 9px; background: #f3f2ef; color: #86827a; flex: none; }
.tf-em-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 13px var(--font); color: #1f1d1a; user-select: text; -webkit-user-select: text; }
.tf-em-tabs { display: flex; gap: 2px; flex: none; }
.tf-em-tabs button { flex: 1; height: 30px; border-radius: 8px; font-size: 15px; filter: grayscale(1); opacity: .6; }
.tf-em-tabs button:hover { background: #f3f2ef; }
.tf-em-tabs button.on { background: #f3f2ef; filter: none; opacity: 1; }
.tf-emoji .tf-cap { padding: 2px 4px; }
.tf-em-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 200px; overflow: auto; }
.tf-em-grid button { height: 34px; border-radius: 8px; font-size: 20px; line-height: 1; transition: transform .1s; }
.tf-em-grid button:hover { background: #f3f2ef; transform: scale(1.15); }
.tf-em-empty { grid-column: 1 / -1; padding: 16px 4px; font-size: 12px; color: #86827a; text-align: center; }
.tf-scrub { position: fixed; z-index: 90; pointer-events: none; height: 22px; padding: 0 7px; border-radius: 6px; background: #2b2a27; color: #f8f7f4; font: 10px "JetBrains Mono", ui-monospace, monospace; display: flex; align-items: center; }
html.mobile .tfmt, html.mobile .tf-menu { display: none !important; }

/* ============ Панель над выделенным объектом (компьютер): Просмотр · Источник | Скачать · Удалить ============ */
html:not(.mobile) .tools {
  background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; border: 1px solid #e6e4e0; border-radius: 14px; padding: 4px;
  box-shadow: 0 12px 28px rgba(40, 32, 20, .14); overflow: hidden; --x: 0px; --y: 0px;
  animation: barIn .14s ease-out both; transition: opacity .12s ease;
}
html:not(.mobile) .tools::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: 0; top: 0; transform: translate(var(--x), var(--y)); width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 92, .95) 0%, rgba(255, 122, 69, .55) 30%, rgba(255, 122, 69, 0) 65%);
  opacity: 0; transition: opacity .3s ease;
}
html:not(.mobile) .tools.is-lit::before { opacity: 1; }
html:not(.mobile) .tools.is-danger::before { background: radial-gradient(circle, rgba(255, 120, 100, .9) 0%, rgba(229, 72, 60, .45) 30%, rgba(229, 72, 60, 0) 65%); }
html:not(.mobile) .tools > * { position: relative; z-index: 1; }
html:not(.mobile) .tools button {
  width: 40px; height: 40px; min-width: 40px; padding: 0; border-radius: 10px; color: #4a4741; background: none;
  transition: color .16s ease, transform .18s cubic-bezier(.34,1.5,.64,1);
}
html:not(.mobile) .tools button:hover { background: none; }
html:not(.mobile) .tools button svg { width: 18px; height: 18px; transition: transform .18s cubic-bezier(.34,1.5,.64,1); }
html:not(.mobile) .tools button.is-hot { color: #2a1a10; transform: scale(1.12); }
html:not(.mobile) .tools button.is-hot svg { transform: scale(1.06); }
html:not(.mobile) .tools button.del.is-hot { color: #b3261e; }
html:not(.mobile) .tools button:active, html:not(.mobile) .tools button.is-hot:active { transform: scale(.94); }
html:not(.mobile) .tools button.on { color: var(--accent); background: none; }
html:not(.mobile) .tools .sep { background: #e6e4e0; }
html:not(.mobile) .tools .num { width: 34px; font-size: 13px; color: #4a4741; }
html:not(.mobile) .tools.leave { opacity: 0; pointer-events: none; animation: none; }
html:not(.mobile) .tools.moving { animation: barIn .14s ease-out both; transition: none; } /* при перетаскивании панель едет вместе с объектом; та же анимация — после отпускания не проигрывается заново */
@keyframes barIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes btnIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.btip { transform: translateY(3px); height: 26px; padding: 0 9px; border-radius: 7px; }
.btip.is-shown { transform: none; }
.btip kbd[hidden] { display: none; }
/* Меню правого клика */
.ctxmenu { position: fixed; top: 0; left: 0; width: 220px; z-index: 92; animation: toolsIn .12s var(--ease) both; }
.ctxmenu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ctxmenu kbd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; color: #9a958d; }
html.mobile .ctxmenu, html.mobile .btip { display: none !important; }
@media (prefers-reduced-motion: reduce) { html:not(.mobile) .tools { animation-duration: .01ms; } }

/* ============ Стикер-заметка ============ */
.item.sticker .note {
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 18px 18px 14px; border-radius: 4px 4px 4px 16px;
  background: var(--paper); color: var(--ink-st); transform: rotate(var(--rot));
  box-shadow: 0 1px 2px rgba(60, 45, 20, .12), 0 10px 22px rgba(60, 45, 20, .14);
  transition: transform .22s cubic-bezier(.34,1.4,.64,1), box-shadow .22s ease;
}
.item.sticker .note::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 40%); }
@media (hover: hover) { .item.sticker:hover:not(.tearing) .note { transform: rotate(calc(var(--rot) * .6)) translateY(-3px); box-shadow: 0 2px 4px rgba(60, 45, 20, .12), 0 18px 34px rgba(60, 45, 20, .2); } }
.item.sticker.tearing .note { transition: box-shadow .16s ease; box-shadow: 0 4px 8px rgba(60, 45, 20, .14), 0 30px 50px rgba(60, 45, 20, .26); }
.item.sticker .note.slap { animation: slap .38s cubic-bezier(.34,1.6,.64,1); }
@keyframes slap { 0% { transform: rotate(var(--rot)) scale(.4); opacity: 0; } 100% { transform: rotate(var(--rot)) scale(1); opacity: 1; } }
.item.sticker.sel { outline: none; }
.item.sticker.sel .note { outline: calc(2px / var(--s)) solid var(--accent); outline-offset: calc(4px / var(--s)); }
.item.sticker .rs { display: none !important; }
.item.sticker .sbody { position: relative; flex: 1; min-height: 0; display: flex; align-items: flex-start; overflow: hidden; }
.item.sticker .tx { width: 100%; padding: 0; min-height: 0; border-radius: 0; background: none; color: inherit; font-family: Onest, var(--font); font-weight: 500; line-height: 1.32; white-space: pre-wrap; word-break: break-word; text-wrap: pretty; }
.item.sticker .tx[contenteditable="true"] { caret-color: var(--ink-st); }
.item.sticker .tx:empty::before { color: inherit; opacity: .45; }
.item.sticker .smeta { position: relative; margin-top: 10px; font: 10px "JetBrains Mono", ui-monospace, monospace; opacity: .6; white-space: nowrap; overflow: hidden; }
.item.sticker .smeta:empty { display: none; }
/* Панель стикера: цвета и S/M/L */
html:not(.mobile) .tools button.sw2 { width: 36px; min-width: 36px; height: 36px; }
.tools button.sw2 i { width: 20px; height: 20px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.tools button.sw2.on i { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #1f1d1a; }
html:not(.mobile) .tools button.sz { width: auto; min-width: 32px; height: 36px; padding: 0 6px; border-radius: 9px; font: 11px "JetBrains Mono", ui-monospace, monospace; color: #4a4741; }
html:not(.mobile) .tools button.sz.on { background: #f1efeb; color: #1f1d1a; font-weight: 500; }

/* ============ Рабочие стикеры: карточки на доске ============ */
.item.doc, .item.table, .item.tasks { --paper: oklch(0.995 0.003 85); --rule: oklch(0.92 0.005 80); --wtext: oklch(0.33 0.005 70); --wmuted: oklch(0.5 0.006 70); --wfaint: oklch(0.72 0.006 70); }
.item.wopen { opacity: 0; }
.wcard {
  position: relative; display: flex; flex-direction: column; height: 100%; background: var(--paper); border-radius: 10px; color: #1f1d1a; font-family: Onest, var(--font);
  box-shadow: 0 1px 2px rgba(40, 32, 20, .08), 0 14px 32px rgba(40, 32, 20, .13);
  transition: transform .22s cubic-bezier(.34,1.4,.64,1), box-shadow .22s ease;
}
@media (hover: hover) { .item.doc:hover .wcard, .item.table:hover .wcard, .item.tasks:hover .wcard { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(40, 32, 20, .08), 0 22px 44px rgba(40, 32, 20, .18); } }
.item.doc .wcard { padding: 22px 20px 16px; overflow: hidden; }
.item.table .wcard { padding: 20px 0 14px; }
.item.tasks .wcard { padding: 20px 20px 14px; }
.w-hint { position: absolute; top: 10px; right: 10px; height: 22px; padding: 0 8px; border-radius: 6px; background: #1f1d1a; color: #faf9f7; font-size: 10px; display: flex; align-items: center; opacity: 0; transform: translateY(-2px); transition: opacity .15s, transform .15s; pointer-events: none; z-index: 2; }
@media (hover: hover) { .item:hover .w-hint { opacity: 1; transform: none; } }
.w-title { font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 10px; overflow-wrap: anywhere; }
.w-title:empty::before { content: "Без названия"; color: var(--wfaint); }
.item.table .w-title { padding: 0 20px; margin-bottom: 12px; }
.w-body { position: relative; flex: 1; min-height: 0; overflow: hidden; font-size: 9.5px; line-height: 1.5; color: var(--wtext); }
.w-body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(oklch(0.995 0.003 85 / 0), var(--paper)); }
.w-body h1 { font-size: 13px; margin: 0 0 4px; font-weight: 700; color: #1f1d1a; }
.w-body h2, .w-body h3 { font-size: 11px; margin: 8px 0 2px; font-weight: 600; color: #1f1d1a; }
.w-body p { margin: 0 0 4px; }
.w-body ul, .w-body ol { margin: 0 0 4px; padding-left: 1.2em; }
.w-body blockquote { margin: 4px 0; font-family: "PT Serif", serif; font-style: italic; }
.w-body .chk { display: flex; gap: 5px; align-items: center; }
.w-body .chk .cb { width: 8px; height: 8px; border-radius: 2px; border: 1px solid #a8a29a; flex: none; }
.w-body .chk.done .cb { background: var(--accent); border-color: var(--accent); }
.w-body .chk.done > span:last-child { text-decoration: line-through; color: var(--wfaint); }
.w-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font: 10px "JetBrains Mono", ui-monospace, monospace; color: var(--wmuted); white-space: nowrap; overflow: hidden; }
.item.table .w-foot { padding: 0 20px; }
.w-ico { flex: none; width: 20px; height: 20px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.w-ico.doc { background: oklch(0.72 0.16 38 / .14); color: oklch(0.5 0.15 38); }
.w-ico.table { background: oklch(0.7 0.12 160 / .16); color: oklch(0.45 0.1 160); }
.w-ico.tasks { background: oklch(0.62 0.14 290 / .14); color: oklch(0.45 0.14 290); }
.w-foot > .w-av, .w-avs { margin-left: auto; }
.w-avs { display: flex; } .w-avs .w-av + .w-av { margin-left: -5px; }
.w-av { flex: none; width: 20px; height: 20px; border-radius: 50%; font: 600 8px Onest, sans-serif; color: #2a1d12; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--paper, #fff); }
.w-mini { width: 100%; border-collapse: collapse; font-size: 11px; }
.w-mini th { text-align: left; font-weight: 500; color: var(--wmuted); font-size: 10px; padding: 6px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.w-mini td { padding: 6px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; color: var(--wtext); }
.w-mini th:first-child, .w-mini td:first-child { padding-left: 20px; } .w-mini th:last-child, .w-mini td:last-child { padding-right: 20px; }
.w-mini .r { text-align: right; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 10px; }
.w-mini tfoot td { font-weight: 600; color: #1f1d1a; border-bottom: 0; }
.w-more { padding: 6px 0 0; font-size: 11px; color: var(--wfaint); }
.item.table .w-more { padding: 6px 20px 0; }
.w-empty { color: var(--wfaint, #b5b0a8); }
.w-prog { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.w-bar { flex: 1; height: 5px; border-radius: 3px; background: oklch(0.92 0.005 80); overflow: hidden; }
.w-bar b { display: block; height: 100%; border-radius: 3px; background: oklch(0.62 0.14 290); transition: width .4s cubic-bezier(.2,.8,.2,1), background .3s; }
.w-prog.all .w-bar b { background: oklch(0.62 0.13 155); }
.w-prog span { font: 11px "JetBrains Mono", ui-monospace, monospace; color: oklch(0.5 0.006 70); white-space: nowrap; }
.w-prog.all span { color: oklch(0.62 0.13 155); }
.w-citem { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13px; color: var(--wtext); }
.w-citem .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-citem.done .t { text-decoration: line-through; color: var(--wfaint); }
.w-citem .due { font: 10px "JetBrains Mono", ui-monospace, monospace; color: var(--wmuted); }
.w-citem .due.late { color: oklch(0.58 0.19 28); }
/* чекбокс чек-листа (карточка и лист) */
.w-cb { flex: none; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid oklch(0.62 0.01 70); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: oklch(0.995 0.003 85);
  transition: background .16s, border-color .16s, transform .2s cubic-bezier(.34,1.6,.64,1); }
@media (hover: hover) { .w-cb:hover { transform: scale(1.15); border-color: oklch(0.62 0.14 290); } }
.done > .w-cb, .w-cb.on { background: oklch(0.62 0.14 290); border-color: oklch(0.62 0.14 290); }
.done > .w-cb::after, .w-cb.on::after { content: ""; width: 9px; height: 5px; border-left: 1.8px solid #fff; border-bottom: 1.8px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.w-cb.pop { animation: wcbpop .32s cubic-bezier(.34,1.8,.64,1); }
@keyframes wcbpop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.wcard .w-cb { width: 16px; height: 16px; border-radius: 5px; }

/* ============ Рабочие стикеры: лист ============ */
.w-scrim { position: fixed; inset: 0; z-index: 100; background: oklch(0.25 0.01 70 / .28); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); opacity: 0; transition: opacity .3s ease; }
.w-scrim.show { opacity: 1; }
.w-sheet { position: fixed; z-index: 101; background: oklch(0.995 0.003 85); border-radius: 10px; box-shadow: 0 30px 80px oklch(0.2 0.02 70 / .28); overflow: hidden; color: #1f1d1a; font-family: Onest, var(--font);
  transition: left .36s cubic-bezier(.2,.8,.2,1), top .36s cubic-bezier(.2,.8,.2,1), width .36s cubic-bezier(.2,.8,.2,1), height .36s cubic-bezier(.2,.8,.2,1); }
html.mobile .w-sheet { border-radius: 0; }
.w-page { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; transition: opacity .18s ease; }
.w-sheet.ready .w-page { opacity: 1; }
.w-top { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 12px 0 14px; flex: none; }
html.mobile .w-top { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
.w-back { height: 34px; padding: 0 12px 0 8px; border-radius: 9px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4f4a43; transition: background .15s, transform .18s cubic-bezier(.34,1.5,.64,1); }
.w-back:hover { background: #f3f2ef; color: #1f1d1a; }
.w-back kbd { font: 10px "JetBrains Mono", ui-monospace, monospace; color: #b5b0a8; margin-left: 4px; }
html.mobile .w-back kbd { display: none; }
.w-meta { margin-left: auto; display: flex; align-items: center; gap: 10px; font: 10px "JetBrains Mono", ui-monospace, monospace; color: #86827a; }
.w-ib { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #4f4a43; transition: background .15s, color .15s, transform .18s cubic-bezier(.34,1.5,.64,1); }
.w-ib:hover { background: #f3f2ef; color: oklch(0.45 0.19 28); transform: scale(1.12); }
.w-scroll { flex: 1; min-height: 0; overflow: auto; padding: 8px 0 120px; -webkit-overflow-scrolling: touch; }
.w-inner { max-width: 620px; margin: 0 auto; padding: 0 40px; }
.w-sheet[data-kind="table"] .w-inner { max-width: 900px; }
.w-sheet[data-kind="tasks"] .w-inner { max-width: 680px; }
html.mobile .w-inner { padding: 0 18px; }
.w-ptitle { font-size: 36px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; outline: none; margin: 8px 0 18px; user-select: text; -webkit-user-select: text; cursor: text; }
.w-sheet:not([data-kind="doc"]) .w-ptitle { font-size: 32px; }
.w-ptitle:empty::before { content: attr(data-ph); color: #b5b0a8; }
.w-sheet [contenteditable="true"] { user-select: text; -webkit-user-select: text; }
/* документ */
.w-ed { position: relative; outline: none; font-size: 16px; line-height: 1.65; color: oklch(0.33 0.005 70); caret-color: var(--accent); min-height: 200px; cursor: text; }
.w-ed > * { margin: 0 0 8px; }
.w-ed h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; color: #1f1d1a; margin: 24px 0 8px; }
.w-ed h2, .w-ed h3 { font-size: 19px; font-weight: 600; line-height: 1.3; color: #1f1d1a; margin: 20px 0 6px; }
.w-ed ul, .w-ed ol { padding-left: 1.4em; }
.w-ed li { margin: 2px 0; }
.w-ed b, .w-ed strong { color: #1f1d1a; }
.w-ed a { color: oklch(0.55 0.15 38); }
.w-ed blockquote { font-family: "PT Serif", serif; font-style: italic; font-size: 19px; line-height: 1.5; color: #1f1d1a; padding-left: 30px; position: relative; margin: 16px 0; }
.w-ed blockquote::before { content: "«"; position: absolute; left: 0; top: -8px; font-size: 40px; font-style: normal; color: var(--accent); }
.w-ed .chk { display: flex; gap: 10px; align-items: flex-start; }
.w-ed .cb { flex: none; display: inline-block; width: 16px; height: 16px; margin-top: .3em; border: 1.5px solid oklch(0.62 0.01 70); border-radius: 5px; cursor: pointer; transition: transform .18s cubic-bezier(.34,1.5,.64,1); }
.w-ed .cb:hover { transform: scale(1.15); }
.w-ed .chk.done .cb { background: var(--accent); border-color: var(--accent); }
.w-ed .chk.done > span:last-child { text-decoration: line-through; color: #b5b0a8; }
.w-ed:has(> p:only-child > br:only-child)::before { content: attr(data-ph); position: absolute; color: #b5b0a8; pointer-events: none; }
.w-ed ::selection { background: oklch(0.72 0.16 38 / .22); }
.w-fmt { z-index: 110; }
.w-blocks, .w-menu { z-index: 111; }
.w-blocks { width: 260px; }
.w-menu { width: 240px; }
.w-dot { width: 16px; height: 16px; border-radius: 50%; display: block; }
.w-mi { height: 36px; }
.w-mi.danger { color: #d23c32; }
.w-ck { margin-left: auto; color: var(--accent); }
.w-newname { flex: none; height: 34px; margin: 4px 2px; padding: 0 10px; border: 1.5px solid #e6e4e0; border-radius: 9px; font: 13px var(--font); outline: none; user-select: text; -webkit-user-select: text; }
.w-newname:focus { border-color: var(--accent); }
/* таблица */
.w-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.w-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.w-grid th { position: relative; text-align: left; font-weight: 500; font-size: 12px; color: #86827a; height: 38px; padding: 0 12px; border-bottom: 1px solid oklch(0.92 0.005 80); white-space: nowrap; cursor: pointer; }
.w-grid th:hover { background: #f3f2ef; color: #1f1d1a; }
.w-grid th .tico { display: inline-flex; width: 16px; margin-right: 6px; vertical-align: -2px; color: #b5b0a8; }
.w-grid th.r { text-align: right; }
.w-grid th.add { width: 44px; text-align: center; color: #b5b0a8; }
.w-grid th.idx, .w-grid td.idx { width: 40px; padding: 0; text-align: center; font: 11px "JetBrains Mono", ui-monospace, monospace; color: #b5b0a8; cursor: default; }
.w-grid th.idx:hover { background: none; }
.w-grid td { position: relative; height: 42px; padding: 0 12px; border-bottom: 1px solid oklch(0.92 0.005 80); color: oklch(0.33 0.005 70); white-space: nowrap; cursor: cell; }
.w-grid td.r { text-align: right; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; }
.w-grid td.sel { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 4px; background: #fff; }
.w-grid td.editing { box-shadow: inset 0 0 0 2px var(--accent), 0 6px 16px oklch(0.3 0.02 70 / .12); background: #fff; cursor: text; }
.w-grid td .cv { outline: none; display: block; min-height: 20px; line-height: 20px; }
.w-grid tr:hover td:not(.sel):not(.editing) { background: oklch(0.98 0.004 80); }
.w-grid td.idx .x { display: none; width: 22px; height: 22px; border-radius: 6px; align-items: center; justify-content: center; color: #b5b0a8; margin: 0 auto; }
.w-grid tr:hover td.idx .n { display: none; }
.w-grid tr:hover td.idx .x { display: flex; }
.w-grid td.idx .x:hover { color: oklch(0.58 0.19 28); background: #f3f2ef; }
.w-grid tfoot td { font-weight: 600; color: #1f1d1a; border-bottom: 0; cursor: default; font-size: 13px; }
.w-grid tfoot td.r { font-weight: 500; }
.w-lbl { font: 500 10px "JetBrains Mono", ui-monospace, monospace; color: #86827a; margin-right: 6px; }
.w-addrow { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 52px; color: #b5b0a8; font-size: 13px; border-radius: 8px; width: 100%; text-align: left; transition: background .15s, color .15s; }
.w-addrow:hover { color: #1f1d1a; background: #f3f2ef; }
.w-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.w-pill i { width: 6px; height: 6px; border-radius: 50%; }
.w-person { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.w-person .w-av { width: 22px; height: 22px; font-size: 9px; box-shadow: none; }
/* чек-лист */
.w-prog.big { margin-bottom: 18px; } .w-prog.big .w-bar { height: 6px; } .w-prog.big span { font-size: 12px; }
.w-list { display: flex; flex-direction: column; }
.w-task { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 6px 0 4px; border-radius: 9px; transition: background .15s, opacity .2s; }
.w-task:hover { background: oklch(0.975 0.004 80); }
.w-task .fold { flex: none; width: 16px; height: 24px; display: flex; align-items: center; justify-content: center; color: #86827a; border-radius: 5px; }
.w-task button.fold:hover { background: #f3f2ef; color: #1f1d1a; }
.w-task .fold svg { transition: transform .2s; }
.w-task .fold.open svg { transform: rotate(90deg); }
.w-task.sub { margin-left: 58px; }
.w-task.sub .tt { font-size: 14px; }
.w-task.sub .w-cb { width: 16px; height: 16px; border-radius: 5px; }
.w-task .grip { position: absolute; left: -24px; width: 18px; height: 28px; display: flex; align-items: center; justify-content: center; color: #b5b0a8; cursor: grab; opacity: 0; transition: opacity .15s; }
.w-task:hover .grip { opacity: 1; }
.w-task .tt { flex: 1; min-width: 0; font-size: 15px; line-height: 1.45; padding: 10px 0; outline: none; color: #1f1d1a; word-break: break-word; cursor: text; }
.w-task .tt:empty::before { content: "Новая задача"; color: #b5b0a8; }
.w-task.done .tt { text-decoration: line-through; color: #b5b0a8; }
.w-task .chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 7px; font: 11px "JetBrains Mono", ui-monospace, monospace; color: #86827a; background: #f3f2ef; }
.w-task .chip.late { background: oklch(0.95 0.03 28); color: oklch(0.58 0.19 28); }
.w-task .chip.today { background: oklch(0.95 0.04 75); color: oklch(0.45 0.1 70); }
.w-task .chip.ghost { background: none; color: #b5b0a8; opacity: 0; transition: opacity .15s; }
.w-task .chip.subc { background: oklch(0.62 0.14 290 / .12); color: oklch(0.45 0.14 290); }
.w-task .chip.subc.full { background: oklch(0.93 0.05 155); color: oklch(0.4 0.1 155); }
.w-task:hover .chip.ghost, .w-task.focus .chip.ghost { opacity: 1; }
.w-task .addsub { flex: none; height: 26px; padding: 0 8px; border-radius: 7px; font-size: 12px; color: #b5b0a8; opacity: 0; transition: opacity .15s; }
.w-task:hover .addsub, .w-task.focus .addsub { opacity: 1; }
.w-task .addsub:hover { color: #1f1d1a; background: #f3f2ef; }
.w-task .whob { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform .18s cubic-bezier(.34,1.5,.64,1); }
.w-task .whob:hover { transform: scale(1.12); }
.w-task .whob.none { border: 1.5px dashed #b5b0a8; color: #b5b0a8; opacity: 0; transition: opacity .15s; }
.w-task:hover .whob.none, .w-task.focus .whob.none { opacity: 1; }
.w-task .whob .w-av { width: 26px; height: 26px; font-size: 9px; box-shadow: none; }
.w-task .tx { flex: none; width: 24px; height: 24px; border-radius: 6px; color: #b5b0a8; display: flex; align-items: center; justify-content: center; opacity: 0; }
.w-task:hover .tx { opacity: 1; }
.w-task .tx:hover { color: oklch(0.58 0.19 28); background: #f3f2ef; }
html.mobile .w-task .chip.ghost, html.mobile .w-task .addsub, html.mobile .w-task .whob.none, html.mobile .w-task .tx { opacity: 1; }
html.mobile .w-task .grip { display: none; }
.w-task.dragging { opacity: .4; }
.w-task.over-top { box-shadow: inset 0 2px 0 var(--accent); }
.w-task.over-bottom { box-shadow: inset 0 -2px 0 var(--accent); }
.w-add { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 4px; color: #b5b0a8; font-size: 15px; border-radius: 9px; width: 100%; text-align: left; transition: background .15s, color .15s; }
.w-add:hover { color: #1f1d1a; background: oklch(0.975 0.004 80); }
.w-add .plus { width: 18px; text-align: center; font-size: 16px; }
.w-donehead { display: flex; align-items: center; gap: 8px; margin-top: 20px; height: 36px; padding: 0 4px; font-size: 13px; font-weight: 500; color: #86827a; border-radius: 8px; width: 100%; text-align: left; }
.w-donehead:hover { color: #1f1d1a; background: oklch(0.975 0.004 80); }
.w-donehead svg { transition: transform .2s; }
.w-donehead.open svg { transform: rotate(90deg); }
.w-alldone { display: none; align-items: center; gap: 10px; margin: 4px 0 12px; padding: 14px 16px; border-radius: 12px; background: oklch(0.95 0.04 155); color: oklch(0.38 0.1 155); font-size: 14px; font-weight: 500; }
.w-alldone.show { display: flex; animation: tfRise .3s cubic-bezier(.34,1.5,.64,1); }

/* ============ Меню «Стикер» и стикер «в руке» ============ */
.spicker { position: fixed; z-index: 70; width: 360px; padding: 14px; background: #fff; border: 1px solid #e6e4e0; border-radius: 18px; box-shadow: 0 20px 50px rgba(40, 32, 20, .18);
  display: flex; flex-direction: column; gap: 12px; transform-origin: 0 24px; overflow: hidden; --x: 0px; --y: 0px; animation: spGrow .26s cubic-bezier(.34,1.4,.64,1); }
.spicker[hidden] { display: none; }
.spicker.hide { animation: spShrink .14s ease forwards; pointer-events: none; }
.spicker.is-lit::before { opacity: 1; }
.spicker > * { position: relative; z-index: 1; }
@keyframes spGrow { from { opacity: 0; transform: scale(.6) translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes spShrink { to { opacity: 0; transform: scale(.9) translateX(-6px); } }
.sp-work { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-items: start; }
.sp-wk { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px 10px; border-radius: 12px; font-size: 12px; color: #4a4741; transition: background .15s, color .15s; }
.sp-wk:hover { background: #f3f2ef; color: #1f1d1a; }
.sp-ic { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; transition: transform .26s cubic-bezier(.34,1.6,.64,1); }
.sp-wk:hover .sp-ic { transform: translateY(-3px) rotate(-4deg) scale(1.08); }
.sp-st { animation: spItem .32s cubic-bezier(.34,1.5,.64,1) both; animation-delay: calc(var(--i) * 28ms + 60ms); }
.spicker.hide .sp-st { animation: none; }
@keyframes spItem { from { opacity: 0; transform: translateY(8px) scale(.8); } to { opacity: 1; transform: none; } }
.sp-note { width: 40px; height: 40px; border-radius: 4px 4px 4px 10px; background: oklch(0.88 0.11 92); box-shadow: 0 4px 10px oklch(0.4 0.05 92 / .22); }
.sp-doc { width: 34px; height: 40px; border-radius: 4px; background: oklch(0.95 0.015 85); display: flex; flex-direction: column; gap: 4px; padding: 8px 6px; box-shadow: 0 3px 8px rgba(40, 32, 20, .1); }
.sp-doc i { display: block; height: 2px; border-radius: 2px; background: oklch(0.7 0.01 70); }
.sp-doc i:first-child { height: 3px; width: 70%; background: oklch(0.35 0.01 70); } .sp-doc i:last-child { width: 60%; }
.sp-table { width: 40px; height: 40px; border-radius: 4px; background: oklch(0.95 0.015 85); display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 1fr); gap: 1px; padding: 1px; box-shadow: 0 3px 8px rgba(40, 32, 20, .1); }
.sp-table i { background: oklch(0.97 0.01 85); } .sp-table i.h { background: oklch(0.86 0.08 160); }
.sp-tasks { width: 40px; height: 40px; border-radius: 4px; background: oklch(0.95 0.015 85); display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 7px; box-shadow: 0 3px 8px rgba(40, 32, 20, .1); }
.sp-tasks b { display: flex; align-items: center; gap: 4px; }
.sp-tasks i { width: 6px; height: 6px; border-radius: 2px; border: 1px solid oklch(0.5 0.01 70); } .sp-tasks i.on { background: oklch(0.65 0.14 290); border-color: oklch(0.65 0.14 290); }
.sp-tasks u { flex: 1; height: 2px; background: oklch(0.7 0.01 70); }
/* «в руке» */
#viewport.holding, #viewport.holding .item { cursor: none; }
.held { position: fixed; z-index: 95; pointer-events: none; transform: translate(-50%, -50%) rotate(-6deg) scale(.9); opacity: .92; filter: drop-shadow(0 12px 18px rgba(40, 32, 20, .25)); animation: heldPick .22s cubic-bezier(.34,1.6,.64,1); }
.held[hidden] { display: none; }
@keyframes heldPick { from { transform: translate(-50%, -50%) scale(.3); opacity: 0; } }
.held-tip { position: fixed; z-index: 96; pointer-events: none; height: 24px; padding: 0 8px; border-radius: 7px; background: #1f1d1a; color: #faf9f7; font-size: 11px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.held-tip[hidden] { display: none; }
.held-tip kbd { font: 9px "JetBrains Mono", ui-monospace, monospace; opacity: .6; }
.h-note { width: 200px; min-height: 200px; padding: 16px 16px 14px; border-radius: 4px 4px 4px 16px; background: oklch(0.9 0.11 92); color: oklch(0.27 0.04 92); font: 500 17px/1.35 Onest, var(--font); display: flex; flex-direction: column; }
.h-note .m { margin-top: auto; font: 10px "JetBrains Mono", ui-monospace, monospace; opacity: .6; }
.h-card { width: 240px; border-radius: 9px; background: oklch(0.99 0.006 85); overflow: hidden; font-family: Onest, var(--font); }
.h-card .sp { height: 6px; background: var(--c); }
.h-card .bd { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.h-card .k { font: 10px "JetBrains Mono", ui-monospace, monospace; color: #86827a; }
.h-card .tl { font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: #1f1d1a; }
.h-card .ln { height: 6px; border-radius: 3px; background: oklch(0.92 0.006 80); }
/* поставленный рабочий стикер вырастает из точки клика */
.wcard.grow { animation: wGrow .42s cubic-bezier(.34,1.5,.64,1) both; }
@keyframes wGrow { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
html.mobile .spicker, html.mobile .held, html.mobile .held-tip { display: none !important; }

/* ============ Комментарии ============ */
#cpins { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 2000000000; }
.cpin {
  position: absolute; width: 34px; height: 34px; margin-top: -34px; border-radius: 50% 50% 50% 4px; display: flex; align-items: center; justify-content: center;
  font: 600 11px Onest, var(--font); color: oklch(0.17 0.02 70); cursor: pointer; background: oklch(0.85 0.05 70);
  box-shadow: 0 0 0 2.5px #fff, 0 8px 18px rgba(40, 32, 20, .28); transform-origin: 0 100%; transform: scale(calc(1 / var(--s, 1)));
  transition: transform .2s cubic-bezier(.34,1.6,.64,1), opacity .3s;
}
.cpin:hover, .cpin.open { transform: scale(calc(1.14 / var(--s, 1))); }
.cpin.open { box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px var(--accent), 0 8px 18px rgba(40, 32, 20, .28); }
.cpin.unread::after { content: ""; position: absolute; inset: -6px; border-radius: 50% 50% 50% 6px; border: 2px solid var(--accent); animation: cPulse 1.6s ease-out 4; /* четыре волны, потом спокойное кольцо */ pointer-events: none; }
@keyframes cPulse { 0% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.25); } }
.cpin .n { position: absolute; top: -6px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #1f1d1a; color: #fff; font: 500 9px "JetBrains Mono", ui-monospace, monospace; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.cpin.drop { animation: cDrop .42s cubic-bezier(.34,1.7,.5,1); }
@keyframes cDrop { 0% { opacity: 0; translate: 0 -24px; scale: .4; } 100% { opacity: 1; translate: 0 0; scale: 1; } }
.cpin.melt { opacity: 0; scale: .2; translate: 0 10px; pointer-events: none; transition: opacity .3s, scale .3s, translate .3s; }
.cpin.draft { background: #f08a5d; color: #2a1a10; font-size: 16px; }
#viewport.commenting, #viewport.commenting * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M14 2a12 12 0 0112 12 12 12 0 01-12 12H3a1 1 0 01-1-1V14A12 12 0 0114 2z' fill='%23f08a5d' stroke='white' stroke-width='2'/%3E%3Cpath d='M9 14h10M14 9v10' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 3 25, crosshair !important; }
.item.c-target { outline: calc(2px / var(--s)) dashed var(--accent); outline-offset: calc(4px / var(--s)); border-radius: calc(14px / var(--s)); }
.c-tip { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px; background: #1f1d1a; color: #faf9f7; font-size: 12px; pointer-events: none; }
.c-tip[hidden], .c-peek[hidden], .c-thread[hidden], .c-toast[hidden] { display: none; }
.c-tip kbd { font: 10px "JetBrains Mono", ui-monospace, monospace; opacity: .6; }
.c-peek { position: fixed; z-index: 85; max-width: 260px; padding: 10px 12px; background: #fff; border: 1px solid #e6e4e0; border-radius: 12px; box-shadow: 0 12px 28px rgba(40, 32, 20, .16); font-size: 12px; pointer-events: none; animation: tfRise .14s ease; }
.c-peek b { font-weight: 600; } .c-peek span { color: #86827a; }
.c-peek p { margin: 3px 0 0; color: #4a4741; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-thread { position: fixed; z-index: 86; display: flex; flex-direction: column; width: 320px; max-height: min(480px, calc(100vh - 32px)); background: #fff; border: 1px solid #e6e4e0; border-radius: 16px; box-shadow: 0 20px 50px rgba(40, 32, 20, .18); font-family: Onest, var(--font); color: #1f1d1a; animation: cPop .22s cubic-bezier(.34,1.4,.64,1); }
@keyframes cPop { from { opacity: 0; transform: scale(.92) translateX(-8px); } to { opacity: 1; transform: none; } }
/* Телефон, комментарии (дизайн «Мобильная версия», экран «Комментарии»): облачко внизу включает режим, подсказка сверху */
.c-tip-m { display: none; }
html.mobile .c-tip-d { display: none; } html.mobile .c-tip-m { display: inline; }
html.mobile .c-tip { top: calc(62px + env(safe-area-inset-top)); height: 38px; padding: 0 6px 0 14px; font-size: 14px; }
html.mobile #c-list { margin-left: 4px; height: 28px; padding: 0 10px; border-radius: 8px; background: rgb(255 255 255 / .16); color: inherit; font: inherit; font-size: 13px; font-weight: 600; }
.mf-btn i { position: absolute; margin: -22px 0 0 22px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font: normal 600 10px/16px var(--font); text-align: center; }
.mf-btn i:empty { display: none; }
#mf-com { position: relative; }
#board.ro-view ~ .mfull #mf-com, .mfull.ro #mf-com { visibility: hidden; }
html.mobile .c-thread { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom) + var(--kb, 0px)); width: auto; max-height: 60vh; }
.c-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 14px; border-bottom: 1px solid #ebe9e5; flex: none; }
.c-head .on { font: 10px "JetBrains Mono", ui-monospace, monospace; color: #86827a; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-hb { height: 30px; padding: 0 10px; border-radius: 8px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: #4a4741; transition: background .15s, color .15s, transform .18s cubic-bezier(.34,1.5,.64,1); }
.c-hb[hidden] { display: none; }
.c-hb:hover { background: #f3f2ef; color: #1f1d1a; }
.c-hb.resolve:hover { color: oklch(0.55 0.13 155); }
.c-hb.icon { width: 30px; padding: 0; justify-content: center; }
.c-hb.icon:hover { transform: scale(1.12); }
.c-msgs { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px 4px; display: flex; flex-direction: column; gap: 14px; }
.c-msgs[hidden] { display: none; }
.c-msg { display: flex; gap: 10px; }
.c-msg.new { animation: tfRise .22s ease; }
.c-av { flex: none; width: 26px; height: 26px; border-radius: 50%; font: 600 9px Onest, sans-serif; color: oklch(0.17 0.02 70); display: flex; align-items: center; justify-content: center; }
.c-mb { min-width: 0; flex: 1; }
.c-mh { font-size: 12px; } .c-mh b { font-weight: 600; } .c-mh span { color: #86827a; margin-left: 4px; }
.c-mt { margin-top: 3px; font-size: 13px; line-height: 1.45; color: #4a4741; white-space: pre-wrap; word-break: break-word; user-select: text; -webkit-user-select: text; }
.c-mention { color: oklch(0.5 0.15 38); font-weight: 500; background: oklch(0.72 0.16 38 / .12); padding: 0 3px; border-radius: 4px; }
.c-compose { flex: none; margin: 8px 10px 10px; display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 12px; border: 1px solid #e6e4e0; border-radius: 12px; background: oklch(0.985 0.003 80); transition: border-color .15s, box-shadow .15s; }
.c-compose:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px oklch(0.72 0.16 38 / .15); background: #fff; }
.c-compose textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; font: 13px/1.45 Onest, var(--font); color: #1f1d1a; padding: 5px 0; max-height: 120px; user-select: text; -webkit-user-select: text; }
.c-compose textarea::placeholder { color: #b5b0a8; }
.c-send { flex: none; width: 30px; height: 30px; border-radius: 9px; background: #f3f2ef; color: #b5b0a8; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s, transform .18s cubic-bezier(.34,1.5,.64,1); }
.c-send.ready { background: #1f1d1a; color: #fff; }
.c-send.ready:hover { transform: scale(1.1); }
.c-hint { flex: none; padding: 0 14px 10px; font: 10px "JetBrains Mono", ui-monospace, monospace; color: #b5b0a8; }
html.mobile .c-hint { display: none; }
.c-mentions { z-index: 90; width: 230px; }
.c-moremenu { z-index: 90; width: 200px; }
.c-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 300; height: 36px; padding: 0 6px 0 14px; border-radius: 10px; background: #1f1d1a; color: #faf9f7; font-size: 12px; display: flex; align-items: center; gap: 10px; animation: tfRise .2s ease; }
.c-toast button { height: 26px; padding: 0 10px; border-radius: 7px; background: rgba(255,255,255,.12); color: #fff; font-size: 12px; }
.c-toast button:hover { background: rgba(255,255,255,.2); }
/* панель «Комментарии» */
.clist { display: flex; flex-direction: column; max-height: min(460px, 60vh); overflow: auto; padding: 6px; }
.clist:empty { display: none; }
.cempty[hidden] { display: none; }
.c-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; text-align: left; transition: background .15s; position: relative; }
.c-row:hover { background: #f4f2ee; }
.c-row.unread::after { content: ""; position: absolute; right: 12px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.c-rb { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.c-rh { font-size: 12px; display: flex; gap: 6px; padding-right: 14px; } .c-rh b { font-weight: 600; flex: none; } .c-rh span { color: #86827a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-rt { font-size: 13px; line-height: 1.4; color: #4a4741; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-rn { font: 10px "JetBrains Mono", ui-monospace, monospace; color: #86827a; }
#comments-btn { position: relative; }
#comments-btn.has-unread::after { content: ""; position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #fff; }
.cpin.dragging { cursor: grabbing; transition: none; transform: scale(calc(1.14 / var(--s, 1))); box-shadow: 0 0 0 2.5px #fff, 0 14px 28px rgba(40, 32, 20, .34); }
#viewport.c-dragging, #viewport.c-dragging * { cursor: grabbing !important; }

/* ============ Рисование ============ */
/* Штрихи — два холста размером с экран (+запас) внутри мира: статичный и «живой» поверх; стрелки (SVG) — выше */
.inkc { position: absolute; pointer-events: none; z-index: 1499999998; }
.inkc.live { z-index: 1499999999; }
#ink { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; z-index: 1500000000; }
#ink .ink-hit { pointer-events: stroke; cursor: pointer; }
#viewport[class*="t-"] #ink .ink-hit { pointer-events: none; }
#ink .ink-marker { mix-blend-mode: multiply; }
#ink .ink-sel { filter: drop-shadow(0 0 .5px var(--accent)) drop-shadow(0 0 3px oklch(0.72 0.16 38 / .6)); }
#ink .ink-fade { transition: opacity .16s; opacity: 0; }
#viewport.t-arrow, #viewport.t-arrow * { cursor: crosshair !important; }
#viewport.t-pen, #viewport.t-pen *, #viewport.t-marker, #viewport.t-marker * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M4 20l2-6 10-10 4 4-10 10z' fill='white' stroke='%23333' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 3 21, crosshair !important; }
#viewport.t-eraser, #viewport.t-eraser * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='white' fill-opacity='.7' stroke='%23333' stroke-width='1.5'/%3E%3C/svg%3E") 12 12, crosshair !important; }
.item.ink-snap { outline: calc(2px / var(--s)) solid var(--accent); outline-offset: calc(4px / var(--s)); border-radius: calc(14px / var(--s)); }
.elbar .draw-tool { position: relative; }
.elbar .draw-tool #draw-ico { display: flex; }
.elbar .draw-tool #draw-ico svg { width: 18px; height: 18px; }
.elbar .draw-tool .cdot { position: absolute; right: 5px; bottom: 5px; width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 1.5px #fff; }
.elbar .draw-tool .cdot[hidden] { display: none; }
/* полка снизу по центру */
.dshelf, .lbar { position: fixed; z-index: 65; display: flex; align-items: center; gap: 2px; padding: 6px; background: #fff; border: 1px solid #e6e4e0; border-radius: 14px; box-shadow: 0 14px 34px rgba(40, 32, 20, .16); }
.dshelf { left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 20px; animation: dUp .26s cubic-bezier(.34,1.4,.64,1); }
.lbar { padding: 4px; border-radius: 12px; animation: tfRise .16s ease; }
.dshelf[hidden], .lbar[hidden] { display: none; }
@keyframes dUp { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.dshelf .grp { display: flex; gap: 2px; align-items: center; }
.dshelf .grp.off { opacity: .3; pointer-events: none; }
.dshelf .ssep, .lbar .ssep { width: 1px; height: 24px; background: #e6e4e0; margin: 0 6px; flex: none; }
.dshelf .ssep.sm, .lbar .ssep.sm { margin: 0 3px; }
.dshelf .sb, .lbar .sb { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #4a4741; position: relative; transition: transform .18s cubic-bezier(.34,1.5,.64,1), background .15s, color .15s; }
.lbar .sb { width: 36px; height: 36px; border-radius: 9px; }
.dshelf .sb:hover, .lbar .sb:hover, .dshelf .sw:hover, .lbar .sw:hover, .dshelf .sz:hover { transform: scale(1.12); }
.dshelf .sb:active, .lbar .sb:active { transform: scale(.94); }
.dshelf .sb.on, .lbar .sb.on { background: #f3f2ef; color: #1f1d1a; }
.dshelf .grp:first-child .sb.on::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 14px; height: 2px; margin-left: -7px; border-radius: 1px; background: var(--accent); }
.lbar .sb.del:hover { color: #b3261e; }
.lbar .sb svg { width: 18px; height: 18px; }
.dshelf .sw, .lbar .sw { width: 30px; height: 40px; display: flex; align-items: center; justify-content: center; transition: transform .18s cubic-bezier(.34,1.5,.64,1); }
.lbar .sw { height: 36px; }
.dshelf .sw i, .lbar .sw i { width: 18px; height: 18px; border-radius: 50%; transition: box-shadow .15s; }
.dshelf .sw.on i, .lbar .sw.on i { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #1f1d1a; }
.dshelf .sz { width: 32px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 9px; transition: transform .18s cubic-bezier(.34,1.5,.64,1), background .15s; }
.dshelf .sz i { border-radius: 50%; background: #1f1d1a; }
.dshelf .sz.on { background: #f3f2ef; }
.tray.under-shelf { opacity: 0; pointer-events: none; }
html.mobile .dshelf, html.mobile .lbar { display: none !important; }
#ink .ink-handle { fill: #fff; stroke: var(--accent); pointer-events: all; cursor: move; }
#ink g:has(.ink-hit) .ink-hit { cursor: move; }
.lbar .lsz { min-width: 26px; text-align: center; font: 11px "JetBrains Mono", ui-monospace, monospace; color: #4a4741; }
.elbar .elsep { position: relative; z-index: 1; height: 1px; margin: 4px 6px; background: #e6e4e0; flex: none; }

/* ============ Фреймы ============ */
.item.frame { animation: none; }
.item.frame .fb { position: absolute; inset: 0; border-radius: 20px; background: var(--ft); border: 1px solid var(--ftb); transition: background-color .18s, box-shadow .18s; }
.item.frame.sel { outline: none; }
.item.frame.sel .fb { box-shadow: 0 0 0 calc(2px / var(--s)) var(--accent); }
.fover { position: absolute; border-radius: 14px; background: oklch(0.72 0.16 38 / .07); box-shadow: inset 0 0 0 calc(2px / var(--s)) var(--accent); pointer-events: none; }
.item.frame .rs { display: none !important; }
.item.frame .fh { position: absolute; left: 2px; bottom: 100%; margin-bottom: calc(6px / var(--s)); display: flex; align-items: baseline; gap: calc(8px / var(--s)); white-space: nowrap; font-size: calc(12px / var(--s)); color: #86827a; cursor: grab; font-family: Onest, var(--font); }
.item.frame .fname { font-weight: 600; color: #3a3632; outline: none; border-radius: 4px; padding: 1px 3px; margin: -1px -3px; }
.item.frame .fname[contenteditable="true"] { background: #fff; box-shadow: 0 0 0 1.5px var(--accent); cursor: text; user-select: text; -webkit-user-select: text; }
.item.frame .fcount { font: calc(10px / var(--s)) "JetBrains Mono", ui-monospace, monospace; }
.item.frame .fcount b { display: none; font-weight: 500; color: oklch(0.55 0.16 38); }

.item.frame .fempty { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: calc(13px / var(--s)); color: #a29d95; pointer-events: none; font-family: Onest, var(--font); }
.item.frame.empty .fempty { display: flex; }
.item.frame .fhdl { position: absolute; display: none; width: calc(10px / var(--s)); height: calc(10px / var(--s)); margin: calc(-5px / var(--s)); background: #fff; border: calc(1.5px / var(--s)) solid var(--accent); border-radius: calc(3px / var(--s)); z-index: 2; }
#world:not(.multi) .item.frame.sel .fhdl { display: block; }
html.mobile .item.frame .fhdl { display: none !important; }
.item.frame .fhdl[data-c="nw"] { left: 0; top: 0; cursor: nwse-resize; } .item.frame .fhdl[data-c="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.item.frame .fhdl[data-c="ne"] { left: 100%; top: 0; cursor: nesw-resize; } .item.frame .fhdl[data-c="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
#fghosts { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: -999999; }
.fghost { position: absolute; border-radius: 12px; border: calc(1.5px / var(--s)) dashed var(--accent); background: oklch(0.72 0.16 38 / .08); pointer-events: none; }
.fdraft { position: absolute; border-radius: 20px; border: calc(1.5px / var(--s)) dashed var(--accent); background: oklch(0.72 0.16 38 / .06); pointer-events: none; z-index: 1999999999; }
.fdraft[hidden] { display: none; }
.fdraft span { position: absolute; left: 50%; top: 100%; margin-top: calc(8px / var(--s)); transform: translateX(-50%); padding: calc(2px / var(--s)) calc(7px / var(--s)); border-radius: calc(6px / var(--s)); background: #1f1d1a; color: #faf9f7; font: calc(10px / var(--s)) "JetBrains Mono", ui-monospace, monospace; white-space: nowrap; }
#viewport.t-frame, #viewport.t-frame .item.frame, #viewport.t-frame .item.frame * { cursor: crosshair !important; }
.item.fpop { animation: fPop .24s cubic-bezier(.34,1.5,.64,1); }
@keyframes fPop { from { scale: 1.04; } to { scale: 1; } }

/* ---------- Совместная работа: курсоры участников, их выделения, «правит …», режим просмотра ---------- */
#peers { position: absolute; inset: 0; pointer-events: none; z-index: 42; overflow: hidden; }
.peer { position: absolute; left: 0; top: 0; display: flex; align-items: flex-start; gap: 2px; transition: transform .07s linear; will-change: transform; }
.peer svg { width: 16px; height: 16px; fill: var(--pc); stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.25)); }
.peer span { margin-top: 12px; padding: 2px 7px; border-radius: 7px; background: var(--pc); color: #1c1a17; font-size: 11px; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
#psel { position: absolute; left: 0; top: 0; pointer-events: none; }
.psel { position: absolute; border-radius: calc(6px / var(--s)); box-shadow: 0 0 0 calc(2px / var(--s)) var(--pc); }
.psel.lock { box-shadow: 0 0 0 calc(2px / var(--s)) var(--pc), 0 0 0 calc(6px / var(--s)) color-mix(in oklch, var(--pc) 30%, transparent); }
.psel span { position: absolute; right: 0; bottom: 100%; margin-bottom: calc(6px / var(--s)); transform-origin: 100% 100%; transform: scale(calc(1 / var(--s))); padding: 2px 7px; border-radius: 7px; background: var(--pc); color: #1c1a17; font-size: 11px; font-weight: 600; white-space: nowrap; }
#board.ro .elbar, #board.ro #tools, #board.ro .fab, #board.ro .tray, #board.ro .mbar-b:not(.mbar-com), #board.ro .mbar-plus { display: none !important; }
#board.ro-view .mbar { display: none !important; } /* зритель: ни правок, ни комментариев — панели нет */
#board.ro-view #comments-btn { display: none; }
#board.ro #viewport { cursor: grab; }


/* ---------- Отрисовка видеокартой (gpu/bridge.js): DOM-объекты невидимы, их рисует #gpu; видим только интерфейс ---------- */
#gpu { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: block; }
html.gpu #viewport { background: transparent; }
html.gpu #grid, html.gpu .inkc { display: none; }
html.gpu .item:not(.gpu-live) { background: none !important; box-shadow: none !important; outline: none !important; animation: none !important; transition: none !important; }
html.gpu .item:not(.gpu-live) > :not(.rs):not(.fhdl):not(.nav):not(.sdel):not(.sadd) { visibility: hidden; }
html.gpu .item.gpu-live { visibility: visible; }
html.gpu .item:not(.gpu-live) .car > .nav, html.gpu .item:not(.gpu-live) .car > .cnt { visibility: visible; }
html.gpu .item.loading:not(.gpu-live) > .play, html.gpu .item:not(.gpu-live) .slide.loading > .play { visibility: visible !important; } /* видео грузится: кольцо поверх отрисовки видеокартой */ /* стрелки и счётчик карусели — DOM-кнопки внутри .car, видеокарта их не рисует */
html.gpu .item.off { content-visibility: visible !important; } /* раскладка нужна всем объектам: из неё снимаются буквы */
html.gpu .item .note, html.gpu .item .wcard { transition: none !important; }
html.gpu .item.sticker:hover .note { transform: rotate(var(--rot)) !important; box-shadow: 0 1px 2px rgba(60, 45, 20, .12), 0 10px 22px rgba(60, 45, 20, .14) !important; }
html.gpu .item.doc:hover .wcard, html.gpu .item.table:hover .wcard, html.gpu .item.tasks:hover .wcard { transform: none !important; }
html.gpu .item.sticker.sel:not(.gpu-live) .note { outline: none !important; }
html.gpu #ink path:not(.ink-hit) { stroke-opacity: 0; } /* стрелки рисует видеокарта, SVG — только для нажатий и ручек */
html.gpu #world { will-change: transform, opacity; }
html.gpu #world.gpu-moving, html.gpu #inklive.gpu-moving { opacity: 0; } /* во время жеста DOM-холст стоит; прозрачность — у композитора, без пересчёта стилей */
/* Подбор ощущения камеры (?feel=1) */
.feel { position: fixed; right: 16px; bottom: 16px; z-index: 50; width: 280px; padding: 14px; border-radius: 14px; background: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.12); font-size: 12.5px; color: #2b2925; display: flex; flex-direction: column; gap: 10px; }
.feel-h { font-weight: 600; font-size: 13.5px; }
.feel label { display: flex; flex-direction: column; gap: 3px; }
.feel label span { display: flex; justify-content: space-between; }
.feel label b { font-weight: 600; font-variant-numeric: tabular-nums; }
.feel label i { font-style: normal; color: #8a867e; font-size: 11.5px; }
.feel input { width: 100%; }
.feel-b { display: flex; gap: 6px; }
.feel-b button { flex: 1; height: 30px; border-radius: 8px; background: #f4f2ee; font-size: 12px; color: #2b2925; }

/* ============ Онбординг (onboarding.js): три подсказки у реальных элементов главной, без затемнения и блокировки ============ */
/* ============ Знакомство с Доской — макет «Онбординг» (public/onboarding.js): затемнение с окном вокруг элемента, рамка, подсказка ============ */
.ob2 { --o-acc: oklch(0.72 0.16 38); font-family: Onest, var(--h-font); color: oklch(0.2 0.004 70); }
.ob2-block { position: fixed; inset: 0; z-index: 150; } .ob2.free .ob2-block { pointer-events: none; } /* на шагах-действиях клики проходят к доске */
.ob2-hole, .ob2-ring { position: fixed; z-index: 151; border-radius: 28px; pointer-events: none; transition: left .45s cubic-bezier(.2,.8,.2,1), top .45s cubic-bezier(.2,.8,.2,1), width .45s cubic-bezier(.2,.8,.2,1), height .45s cubic-bezier(.2,.8,.2,1), opacity .25s; }
.ob2-hole { box-shadow: 0 0 0 9999px oklch(0.24 0.012 60 / 0.34); }
.ob2-ring { z-index: 152; border: 1.5px solid var(--o-acc); }
.ob2-ring i { position: absolute; width: 9px; height: 9px; border-radius: 2px; background: #fff; border: 1.5px solid var(--o-acc); box-sizing: border-box; }
.ob2-ring i:nth-child(1) { left: -5px; top: -5px; } .ob2-ring i:nth-child(2) { right: -5px; top: -5px; } .ob2-ring i:nth-child(3) { left: -5px; bottom: -5px; } .ob2-ring i:nth-child(4) { right: -5px; bottom: -5px; }
.ob2.wait .ob2-ring, .ob2.wait .ob2-coach { opacity: 0; }
.ob2-coach { position: fixed; z-index: 160; width: 320px; box-sizing: border-box; padding: 18px 18px 14px; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px oklch(0.2 0.02 70 / 0.28);
  display: flex; flex-direction: column; gap: 10px; transition: left .45s cubic-bezier(.2,.8,.2,1), top .45s cubic-bezier(.2,.8,.2,1), opacity .25s; }
.ob2-top { display: flex; align-items: center; justify-content: space-between; }
.ob2-dots { display: flex; gap: 4px; } .ob2-dots i { width: 6px; height: 6px; border-radius: 3px; background: oklch(0.9 0.004 70); transition: all .3s; }
.ob2-dots i.on { background: var(--o-acc); } .ob2-dots i.cur { width: 18px; }
.ob2-skip { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 12px; color: oklch(0.5 0.006 70); cursor: pointer; } .ob2-skip:hover { color: oklch(0.3 0.005 70); }
.ob2-t { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.ob2-s { font-size: 14px; line-height: 1.45; color: oklch(0.42 0.006 70); text-wrap: pretty; }
.ob2-ways { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 4px; } .ob2-kinds { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 2px 0 4px; }
.ob2-ways[hidden], .ob2-kinds[hidden], .ob2-hint[hidden], .ob2-foot[hidden] { display: none; }
.ob2-ways div, .ob2-kinds div { display: flex; align-items: center; gap: 12px; font-size: 14px; color: oklch(0.25 0.005 70); } .ob2-kinds div { gap: 10px; }
.ob2-ways b, .ob2-kinds b { flex: none; width: 34px; height: 34px; border-radius: 10px; background: oklch(0.965 0.004 80); border: 1px solid oklch(0.92 0.004 70); display: flex; align-items: center; justify-content: center; color: oklch(0.3 0.005 70); }
.ob2-kinds b.y { background: oklch(0.88 0.11 92); border-color: transparent; color: oklch(0.3 0.04 92); }
.ob2-hint { padding-top: 2px; font-size: 13px; font-weight: 500; color: oklch(0.55 0.16 38); }
.ob2-foot { display: flex; justify-content: flex-end; padding-top: 4px; }
.ob2-next { height: 36px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--o-acc); color: oklch(0.18 0.02 38); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.ob2-next:hover { background: oklch(0.68 0.16 38); }
/* панель слева над затемнением: «Ссылка» пульсирует (шаг 1), «Стикер» в рамке (шаг 5) */
.elbar.ob2-lift { z-index: 155; }
.ob2-lift.ob2-pulse { background: oklch(0.95 0.03 38) !important; animation: ob2pulse 1.4s cubic-bezier(.2,.8,.2,1) infinite; }
.ob2-lift.ob2-ringed { box-shadow: inset 0 0 0 1.5px oklch(0.72 0.16 38); }
@keyframes ob2pulse { 0% { box-shadow: inset 0 0 0 2px oklch(0.72 0.16 38 / .9); } 100% { box-shadow: inset 0 0 0 2px oklch(0.72 0.16 38 / 0); } }
.ob2-fin { position: fixed; inset: 0; z-index: 400; background: oklch(0.975 0.004 80); opacity: 0; transition: opacity .7s ease; display: flex; align-items: center; justify-content: center; font-family: Onest, var(--h-font); pointer-events: none; }
.ob2-fin.on { opacity: 1; pointer-events: auto; }
.ob2-fin > div { display: flex; flex-direction: column; align-items: center; gap: 16px; transform: scale(.9); transition: transform .7s cubic-bezier(.2,1.3,.4,1); }
.ob2-fin.on > div { transform: none; }
.ob2-fin i { width: 64px; height: 64px; border-radius: 20px; background: oklch(0.72 0.16 38); color: oklch(0.18 0.02 38); display: flex; align-items: center; justify-content: center; transform: rotate(-6deg); box-shadow: 0 14px 34px oklch(0.5 0.12 38 / 0.3); }
.ob2-fin b { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; color: oklch(0.2 0.004 70); } .ob2-fin span { font-size: 15px; color: oklch(0.45 0.006 70); }
.ob2-replay { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; height: 36px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid oklch(0.9 0.004 70);
  box-shadow: 0 8px 24px oklch(0.3 0.01 70 / 0.1); display: flex; align-items: center; gap: 8px; font: inherit; font-family: Onest, var(--h-font); font-size: 13px; color: oklch(0.35 0.005 70); cursor: pointer; }
.ob2-replay:hover { color: oklch(0.2 0.004 70); }
/* Телефон — макет «Онбординг моб»: прожектор вокруг элемента, карточка во всю ширину сверху или снизу */
.obm { font-family: Onest, var(--h-font); color: oklch(0.2 0.004 70); }
.obm-block { position: fixed; inset: 0; z-index: 150; } .obm.free .obm-block { pointer-events: none; }
.obm-spot, .obm-pulse { position: fixed; z-index: 151; pointer-events: none; transition: left .45s cubic-bezier(.2,.8,.2,1), top .45s cubic-bezier(.2,.8,.2,1), width .45s cubic-bezier(.2,.8,.2,1), height .45s cubic-bezier(.2,.8,.2,1), border-radius .45s, opacity .25s; }
.obm-spot { box-shadow: 0 0 0 2px oklch(0.72 0.16 38), 0 0 0 2000px oklch(0.2 0.012 60 / 0.42); }
.obm-pulse { border: 2px solid oklch(0.72 0.16 38); box-sizing: border-box; opacity: 0; }
.obm.free .obm-pulse { animation: obmring 1.6s ease-out infinite; }
@keyframes obmring { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.25); opacity: 0; } }
.obm.hide .obm-spot, .obm.hide .obm-pulse, .obm.hide .obm-coach, .obm.wait .obm-coach { opacity: 0 !important; }
.obm-coach { position: fixed; left: 14px; right: 14px; z-index: 160; background: #fff; border-radius: 20px; padding: 16px 18px 14px; box-shadow: 0 20px 50px oklch(0.2 0.02 70 / 0.28);
  display: flex; flex-direction: column; gap: 10px; transition: opacity .25s, transform .35s cubic-bezier(.2,.8,.2,1); }
.obm.moving .obm-coach { opacity: 0; transform: translateY(6px); }
.obm-top { display: flex; align-items: center; justify-content: space-between; }
.obm-n { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; color: oklch(0.55 0.16 38); }
.obm-skip { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 13px; color: oklch(0.5 0.006 70); }
.obm-t { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.obm-s { font-size: 14px; line-height: 1.45; color: oklch(0.42 0.006 70); text-wrap: pretty; }
.obm-ways { display: flex; flex-direction: column; gap: 8px; padding: 2px 0; } .obm-ways[hidden], .obm-act[hidden], .obm-foot[hidden] { display: none; }
.obm-ways div { display: flex; align-items: center; gap: 12px; font-size: 14px; color: oklch(0.25 0.005 70); }
.obm-ways b { flex: none; width: 34px; height: 34px; border-radius: 10px; background: oklch(0.965 0.004 80); border: 1px solid oklch(0.92 0.004 70); display: flex; align-items: center; justify-content: center; color: oklch(0.3 0.005 70); }
.obm-ways svg { width: 18px; height: 18px; }
.obm-act { padding-top: 2px; font-size: 13px; font-weight: 500; color: oklch(0.55 0.16 38); }
.obm-foot { display: flex; justify-content: flex-end; }
.obm-next { height: 40px; padding: 0 18px; border: 0; border-radius: 12px; background: oklch(0.2 0.004 70); color: oklch(0.99 0.002 80); font: inherit; font-size: 14px; font-weight: 600; }
.obm-toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); z-index: 400; transform: translate(-50%, -80px); opacity: 0; transition: transform .5s cubic-bezier(.2,1.3,.4,1), opacity .4s;
  height: 36px; padding: 0 14px 0 10px; border-radius: 999px; background: oklch(0.2 0.004 70); color: oklch(0.99 0.002 80); display: flex; align-items: center; gap: 8px; font: 500 13px Onest, var(--h-font); white-space: nowrap; pointer-events: none; }
.obm-toast.on { transform: translate(-50%, 0); opacity: 1; }
.obm-toast i { width: 18px; height: 18px; border-radius: 50%; background: oklch(0.72 0.16 38); color: oklch(0.18 0.02 38); display: flex; align-items: center; justify-content: center; } .obm-toast i svg { width: 10px; height: 10px; }
/* пустые «Входящие» на время знакомства: карточка о том, как отправлять посты боту */
#inbox.obm-demo #inbox-fan, #inbox.obm-demo #inbox-empty, #inbox.obm-demo #inbox-go { display: none !important; }
.obm-inbox { background: #fff; border: 1px solid oklch(0.9 0.004 70); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 6px; font-family: Onest, var(--h-font); }
.obm-ib-t { font-size: 15px; font-weight: 600; line-height: 1.3; } .obm-ib-s { font-size: 13px; line-height: 1.45; color: oklch(0.45 0.006 70); } .obm-ib-n { font-size: 10px; line-height: 1.4; color: oklch(0.55 0.006 70); }
.obm-ib-steps { margin-top: 6px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.obm-ib-steps > div { display: flex; flex-direction: column; gap: 6px; } .obm-ib-steps span { font-size: 11px; line-height: 1.3; color: oklch(0.4 0.006 70); }
.obm-ib-steps u { text-decoration: none; font-family: "JetBrains Mono", ui-monospace, monospace; color: oklch(0.58 0.16 38); }
.obm-ib-p, .obm-ib-c, .obm-ib-d { height: 96px; border-radius: 10px; background: oklch(0.965 0.004 80); border: 1px solid oklch(0.92 0.004 70); overflow: hidden; box-sizing: border-box; }
.obm-ib-p { display: flex; flex-direction: column; } .obm-ib-p i { flex: 1; background: center/cover no-repeat; }
.obm-ib-p b { height: 24px; display: flex; align-items: center; gap: 6px; padding: 0 7px; background: #fff; color: oklch(0.35 0.005 70); }
.obm-ib-p svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.obm-ib-p em { width: 20px; height: 20px; margin-left: -3px; border-radius: 50%; background: oklch(0.72 0.16 38); color: oklch(0.18 0.02 38); display: flex; align-items: center; justify-content: center; }
.obm-ib-c { padding: 8px 7px; display: flex; flex-direction: column; justify-content: center; gap: 7px; }
.obm-ib-c p { margin: 0; height: 18px; border-radius: 9px; background: linear-gradient(90deg, oklch(0.85 0.01 250) 18px, transparent 18px, transparent 23px, oklch(0.85 0.004 70) 23px) left center/100% 5px no-repeat, radial-gradient(circle at 9px 9px, oklch(0.85 0.01 250) 9px, transparent 9.5px); opacity: .45; }
.obm-ib-c p.on { opacity: 1; height: auto; display: flex; align-items: center; gap: 5px; padding: 4px; margin: 0 -4px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1.5px oklch(0.72 0.16 38); font-size: 9px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.obm-ib-c p.on i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: oklch(0.2 0.004 70); }
.obm-ib-d { position: relative; display: flex; align-items: center; justify-content: center; }
.obm-ib-d i { width: 46px; height: 58px; border-radius: 7px; background: center/cover no-repeat; transform: rotate(-4deg); box-shadow: 0 6px 14px oklch(0.3 0.02 70 / 0.16); }
.obm-ib-d b { position: absolute; left: 6px; top: 6px; height: 16px; padding: 0 6px; border-radius: 999px; background: oklch(0.2 0.004 70); color: oklch(0.99 0.002 80); font-size: 8px; font-weight: 600; display: flex; align-items: center; }

/* ============ Узкое окно (телефон отмечается html.mobile по сенсору; здесь — просто ширина окна) ============ */
@media (max-width: 520px) {
  .share { left: 8px; right: 8px; width: auto; }
  .share-foot { flex-direction: column; align-items: stretch; }
}
@media (max-width: 440px) {
  .h-search { width: 132px; } .h-search kbd { display: none; }
}
/* список уведомлений на узком экране — во всю ширину, иначе выезжает за левый край */
@media (max-width: 440px) { .h-notes { position: fixed; left: 12px; right: 12px; top: calc(68px + env(safe-area-inset-top)); width: auto; } }
html.mobile .h-notes { position: fixed; left: 12px; right: 12px; top: calc(68px + env(safe-area-inset-top)); width: auto; }

@keyframes bump { 50% { transform: scale(1.14); } }

/* ============ Разбор входящих (телефон): дизайн «Мобильная версия», экран «Входящие» ============ */
.inbox-go { display: none; margin-left: auto; font-size: 15px; font-weight: 500; color: var(--h-acc-text); text-decoration: none; }
html.mobile .inbox-go { display: block; }
html.mobile .inbox-hint:not(:empty) + .inbox-go { display: none; } /* пока карточку несут — вместо «Разобрать» подсказка */
.tri { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; font-family: var(--h-font); color: var(--h-ink); animation: fade .2s var(--ease);
  background-color: var(--h-bg); background-image: radial-gradient(oklch(0.88 0.004 70) 1px, transparent 1.2px); background-size: 24px 24px; }
.tri[hidden] { display: none; }
html.tri-on, html.tri-on body { overflow: hidden; }
.tri-top { display: flex; align-items: baseline; gap: 8px; padding: calc(14px + env(safe-area-inset-top)) 16px 8px; }
.tri-top b { font-size: 17px; font-weight: 600; }
.tri-top .mono { font-size: 11px; color: var(--h-mut); }
.tri-back { align-self: center; width: 36px; height: 36px; margin-left: -8px; border-radius: 11px; display: grid; place-items: center; color: var(--h-ink); }
.tri-back:active { background: var(--h-hov); }
.tri-stack { position: relative; flex: 1; min-height: 0; margin: 10px 24px 18px; }
.tri-card { position: absolute; inset: 14px 0 0; margin: auto; width: min(100%, 320px); height: fit-content; max-height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 8px 8px 12px;
  background: #fff; border: 1px solid var(--h-line); border-radius: 20px; box-shadow: 0 18px 40px oklch(0.3 0.01 70 / 0.14); touch-action: none; -webkit-user-select: none; user-select: none;
  transform: translateY(calc(var(--d, 0) * -14px)) scale(calc(1 - var(--d, 0) * .05)); transition: transform .45s cubic-bezier(.3,1.2,.4,1), opacity .25s; }
.tri-card:not(.top) { pointer-events: none; }
.tri-card:not(.top) > * { visibility: hidden; } /* следующие — только краем стопки */
.tri-card.enter { transform: translateY(-14px) scale(.95); }
.tri-img { flex: 1 1 auto; min-height: 120px; max-height: calc(100vh - 380px); max-height: calc(100dvh - 380px); border-radius: 14px; background: oklch(0.94 0.005 70) center / cover no-repeat; }
.tri-txt { padding: 0 6px; display: flex; flex-direction: column; gap: 4px; }
.tri-cap { font-size: 15px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tri-src { font: 11px "JetBrains Mono", ui-monospace, monospace; color: var(--h-mut); }
.tri-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; color: var(--h-mut); font-size: 15px; }
.tri-empty b { font-size: 22px; color: var(--h-ink); letter-spacing: -.01em; }
.tri-sheet { flex: none; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--h-line); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px oklch(0.3 0.01 70 / 0.06); transition: transform .3s var(--ease), opacity .3s; }
.tri-sheet.off { transform: translateY(100%); opacity: 0; pointer-events: none; }
.tri-sh-h { display: flex; align-items: center; gap: 8px; padding: 0 16px 12px; }
.tri-sh-h b { flex: 1; font-size: 15px; font-weight: 600; }
.tri-later, .tri-del { height: 34px; border-radius: 10px; border: 1px solid var(--h-line); background: #fff; font: inherit; font-size: 14px; font-weight: 500; color: var(--h-ink); }
.tri-later { padding: 0 14px; } .tri-del { width: 34px; display: grid; place-items: center; }
.tri-later:active, .tri-del:active { background: var(--h-hov); }
.tri-shelf { display: flex; gap: 10px; overflow-x: auto; padding: 4px 16px 4px; scrollbar-width: none; }
.tri-shelf::-webkit-scrollbar { display: none; }
.tri-tile { flex: none; width: 76px; display: flex; flex-direction: column; gap: 6px; align-items: center; font: inherit; color: var(--h-ink); }
.tri-tile .h-thumb { width: 76px; aspect-ratio: 1; border-radius: 14px; transition: transform .2s var(--spring), box-shadow .2s; }
.tri-tile .h-big, .tri-tile .h-st { display: none; }
.tri-name { max-width: 100%; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tri-tile.hot .h-thumb { transform: scale(1.1); box-shadow: 0 0 0 2.5px var(--h-acc), 0 10px 22px oklch(0.3 0.01 70 / 0.16); }
.tri-tile.bump .h-thumb { animation: bump .3s var(--spring); }
.tri-new { display: grid; place-items: center; background: transparent; border: 1.5px dashed oklch(0.82 0.005 70); color: var(--h-mut); }

/* ============ Полный экран (телефон): дизайн «Мобильная версия», экран «Полный экран» ============ */
.mfull { position: fixed; inset: 0; z-index: 80; background: rgb(0 0 0 / var(--mf-a, 1)); color: #fff; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; animation: fade .2s var(--ease); }
.mfull[hidden] { display: none; }
.mf-top { position: absolute; z-index: 2; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; transition: opacity .2s; opacity: var(--mf-a, 1); }
.mf-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .14); color: #fff; }
.mf-btn svg { width: 16px; height: 16px; }
.mf-spacer { visibility: hidden; }
.mf-n { font: 12px "JetBrains Mono", ui-monospace, monospace; color: rgb(255 255 255 / .75); letter-spacing: .04em; }
.mf-track { position: absolute; inset: 0; will-change: transform; }
.mf-track.anim { transition: transform .32s cubic-bezier(.25,.8,.25,1); }
.mf-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(64px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }
.mf-slide img, .mf-slide video { max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain; pointer-events: none; }
.mf-slide video { pointer-events: auto; }
.mf-link { width: min(100%, 340px); background: #fff; color: #1f1e1c; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.mf-link .mf-li { aspect-ratio: 1.2; background: #eee center / cover no-repeat; }
.mf-link .mf-lt { padding: 14px 16px 4px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.mf-link .mf-ld { padding: 0 16px; font: 11px "JetBrains Mono", ui-monospace, monospace; color: #8a8782; }
.mf-link button { margin: 14px 16px 16px; height: 42px; border-radius: 12px; background: #1f1e1c; color: #fff; font-size: 14px; font-weight: 600; }
.mf-sticker { width: min(100%, 320px); aspect-ratio: 1; padding: 26px 24px; border-radius: 6px 6px 6px 22px; background: oklch(0.9 0.11 92); color: oklch(0.25 0.04 70); font-size: 24px; font-weight: 500; line-height: 1.3; overflow: hidden; box-shadow: 0 20px 50px rgb(0 0 0 / .4); white-space: pre-wrap; overflow-wrap: anywhere; }
.mf-dots { position: absolute; bottom: calc(10px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font: 11px "JetBrains Mono", ui-monospace, monospace; color: rgb(255 255 255 / .6); }
