/* Echoes CRM — дизайн в стиле iOS (Human Interface Guidelines): системные цвета, inset grouped списки,
   полупрозрачные панели, крупные заголовки. Тема — светлая/тёмная по Telegram или системе. */
:root {
  --bg: #F2F2F7; --bg2: #FFFFFF; --bg3: #F2F2F7; --elev: #FFFFFF;
  --label: #000000; --label2: rgba(60,60,67,.6); --label3: rgba(60,60,67,.3); --label4: rgba(60,60,67,.18);
  --sep: rgba(60,60,67,.29); --fill: rgba(118,118,128,.12); --fill2: rgba(120,120,128,.16); --fill3: rgba(118,118,128,.24);
  --chev: #C4C4C7; --thumb: #FFFFFF;
  --blue: #007AFF; --green: #34C759; --orange: #FF9500; --red: #FF3B30; --yellow: #FFCC00; --purple: #AF52DE;
  --pink: #FF2D55; --indigo: #5856D6; --teal: #30B0C7; --gray: #8E8E93; --brown: #A2845E; --mint: #00C7BE;
  --bar: rgba(249,249,249,.86); --sheet: rgba(255,255,255,.92); --hud: rgba(30,30,30,.86);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --font-serif: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000; --bg2: #1C1C1E; --bg3: #2C2C2E; --elev: #2C2C2E;
  --label: #FFFFFF; --label2: rgba(235,235,245,.6); --label3: rgba(235,235,245,.3); --label4: rgba(235,235,245,.16);
  --sep: rgba(84,84,88,.65); --fill: rgba(118,118,128,.24); --fill2: rgba(118,118,128,.28); --fill3: rgba(118,118,128,.36);
  --chev: #5A5A5E; --thumb: #636366;
  --blue: #0A84FF; --green: #30D158; --orange: #FF9F0A; --red: #FF453A; --yellow: #FFD60A; --purple: #BF5AF2;
  --pink: #FF375F; --indigo: #5E5CE6; --teal: #40C8E0; --gray: #8E8E93; --brown: #AC8E68; --mint: #63E6E2;
  --bar: rgba(22,22,23,.82); --sheet: rgba(44,44,46,.92); --hud: rgba(60,60,64,.92);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--label); }
body { font: 17px/1.29 var(--font); letter-spacing: -.41px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
a { color: var(--blue); text-decoration: none; }
img { display: block; }
.hidden { display: none !important; }

#app { max-width: 720px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(49px + 32px + var(--safe-b)); }
#app.no-tabbar { padding-bottom: calc(40px + var(--safe-b)); }
#app.with-composer { padding-bottom: calc(96px + var(--safe-b)); }

#progress { position: fixed; top: 0; left: 0; height: 2.5px; width: 0; background: var(--blue); z-index: 100; transition: width .4s ease, opacity .3s; opacity: 0; }
#progress.on { width: 75%; opacity: 1; }

/* ---------------------------------------------------------- навигация */
.nav { position: sticky; top: 0; z-index: 20; height: calc(44px + var(--safe-t)); padding: var(--safe-t) 8px 0;
  display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; transition: background .2s, box-shadow .2s; }
.nav.scrolled, .nav.solid { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 .5px 0 var(--sep); }
.nav-title { font-weight: 600; font-size: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; opacity: 0; transition: opacity .15s; }
.nav.scrolled .nav-title, .nav.solid .nav-title { opacity: 1; }
.nav-left, .nav-right { display: flex; align-items: center; min-width: 0; }
.nav-right { justify-content: flex-end; gap: 2px; }
.nav-btn { color: var(--blue); font-size: 17px; height: 44px; padding: 0 8px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.nav-btn:active { opacity: .35; }
.nav-btn.bold { font-weight: 600; }
.nav-btn:disabled { color: var(--label3); }
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.back svg { width: 13px; height: 21px; margin-right: 2px; }
.nav-status { font-size: 13px; color: var(--label2); padding: 0 8px; white-space: nowrap; }

.large-title { font: 700 34px/41px var(--font-display); letter-spacing: .37px; padding: 0 16px; margin: 0 0 8px; overflow-wrap: anywhere; }
.eyebrow { font: 700 13px/18px var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--label2); padding: 0 16px; margin-top: 2px; }
.page-sub { color: var(--label2); font-size: 15px; padding: 0 16px; margin: -4px 0 8px; letter-spacing: -.24px; }

/* ---------------------------------------------------------- inset grouped списки */
.group-header { font-size: 13px; line-height: 18px; letter-spacing: -.08px; text-transform: uppercase; color: var(--label2); padding: 0 32px 7px; margin-top: 24px; display: flex; align-items: center; gap: 8px; }
.group-header .act { margin-left: auto; text-transform: none; color: var(--blue); font-size: 15px; letter-spacing: -.24px; }
.group-header.first { margin-top: 12px; }
.group-footer { font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label2); padding: 7px 32px 0; }
.group { margin: 0 16px; background: var(--bg2); border-radius: 10px; overflow: hidden; }
.group + .group { margin-top: 24px; }
.cell { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 11px 16px; width: 100%; text-align: left; --inset: 16px; }
.cell + .cell::before { content: ""; position: absolute; top: 0; right: 0; left: var(--inset); border-top: .5px solid var(--sep); }
.cell.has-icon { --inset: 57px; }
.cell.has-avatar { --inset: 68px; }
.cell.has-thumb { --inset: 76px; }
button.cell:active, a.cell:active, .cell.tap:active { background: var(--fill3); }
.cell-body { flex: 1; min-width: 0; }
.cell-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-title.wrap { white-space: normal; overflow-wrap: anywhere; }
.cell-sub { font-size: 15px; letter-spacing: -.24px; color: var(--label2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.cell-sub.wrap { white-space: normal; }
.cell-value { color: var(--label2); flex: none; max-width: 55%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-value.blue { color: var(--blue); }
.cell .chev { width: 8px; height: 14px; flex: none; color: var(--chev); }
.cell .check { color: var(--blue); width: 17px; height: 17px; flex: none; }
.cell.action { color: var(--blue); }
.cell.destructive { color: var(--red); }
.cell.center { justify-content: center; }
.cell .count { color: var(--label2); flex: none; }
.cell input.cell-input, .cell textarea.cell-input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 0; font-size: 17px; }
.cell input.cell-input.right { text-align: right; color: var(--label2); }
.cell input::placeholder, .cell textarea::placeholder { color: var(--label3); }
.cell textarea.cell-input { resize: none; line-height: 1.38; min-height: 88px; display: block; }
.cell input[type="datetime-local"], .cell input[type="date"], .cell input[type="time"] { border: 0; background: var(--fill); border-radius: 6px; padding: 6px 10px; font-size: 17px; color: var(--label); outline: none; min-width: 0; max-width: 62%; }
.cell-label { flex: none; min-width: 96px; }

.icon-sq { width: 29px; height: 29px; border-radius: 7px; display: grid; place-items: center; flex: none; color: #fff; }
.icon-sq svg { width: 18px; height: 18px; }
.icon-sq.lg { width: 44px; height: 44px; border-radius: 10px; }
.icon-sq.lg svg { width: 24px; height: 24px; }
.bg-blue { background: var(--blue); } .bg-green { background: var(--green); } .bg-orange { background: var(--orange); }
.bg-red { background: var(--red); } .bg-yellow { background: var(--yellow); } .bg-purple { background: var(--purple); }
.bg-pink { background: var(--pink); } .bg-indigo { background: var(--indigo); } .bg-teal { background: var(--teal); }
.bg-gray { background: var(--gray); } .bg-brown { background: var(--brown); } .bg-mint { background: var(--mint); }
.c-blue { color: var(--blue); } .c-green { color: var(--green); } .c-orange { color: var(--orange); } .c-red { color: var(--red); }
.c-purple { color: var(--purple); } .c-gray { color: var(--label2); } .c-indigo { color: var(--indigo); } .c-teal { color: var(--teal); }

.badge-num { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--red); color: #fff; font-size: 15px; display: inline-grid; place-items: center; flex: none; letter-spacing: 0; }

/* пилюли-статусы */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap; flex: none; }
.pill.blue { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.pill.green { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.pill.orange { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.pill.red { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.pill.purple { background: color-mix(in srgb, var(--purple) 15%, transparent); color: var(--purple); }
.pill.indigo { background: color-mix(in srgb, var(--indigo) 15%, transparent); color: var(--indigo); }
.pill.gray { background: var(--fill); color: var(--label2); }
.pill.pink { background: color-mix(in srgb, var(--pink) 15%, transparent); color: var(--pink); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

/* ---------------------------------------------------------- сегменты, поиск, кнопки */
.seg-wrap { padding: 0 16px; margin: 6px 0 4px; }
.seg { display: flex; background: var(--fill2); border-radius: 9px; padding: 2px; }
.seg button { flex: 1; height: 28px; border-radius: 7px; font-size: 13px; font-weight: 500; letter-spacing: -.08px; color: var(--label); position: relative; white-space: nowrap; padding: 0 6px; text-align: center; }
.seg button + button::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; border-left: .5px solid var(--label4); }
.seg button.on { background: var(--thumb); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04), 0 0 0 .5px rgba(0,0,0,.04); font-weight: 600; }
.seg button.on::before, .seg button.on + button::before { display: none; }

.search { margin: 2px 16px 8px; position: relative; }
.search input { width: 100%; height: 36px; border: 0; outline: none; border-radius: 10px; background: var(--fill); padding: 0 10px 0 32px; font-size: 17px; }
.search input::placeholder { color: var(--label2); }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--label2); }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border-radius: 12px; font-size: 17px; font-weight: 600; background: var(--blue); color: #fff; text-align: center; }
.btn:active { opacity: .7; }
.btn:disabled { opacity: .4; }
.btn.tinted { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.btn.tinted.red { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.btn.green { background: var(--green); }
.btn.gray { background: var(--fill); color: var(--label); }
.btn.plain { background: none; color: var(--blue); font-weight: 400; height: 44px; }
.btn.plain.red { color: var(--red); }
.btn svg { width: 20px; height: 20px; }
.btns { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.btns.row { flex-direction: row; }
.btns.row .btn { flex: 1; }

/* переключатель iOS */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill2); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 3px 1px rgba(0,0,0,.06); transition: transform .25s cubic-bezier(.3,.7,.4,1); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------------------------------------------------------- аватары и миниатюры */
.av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 16px; overflow: hidden; background-size: cover; background-position: center; letter-spacing: 0; }
.av.xs { width: 20px; height: 20px; font-size: 9px; }
.av.sm { width: 28px; height: 28px; font-size: 12px; }
.av.md { width: 56px; height: 56px; font-size: 22px; }
.av.lg { width: 84px; height: 84px; font-size: 34px; }
.thumb { width: 48px; height: 48px; border-radius: 8px; flex: none; background: var(--fill) center/cover no-repeat; position: relative; }
.thumb .n { position: absolute; right: 3px; bottom: 3px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 0 4px; letter-spacing: 0; }
.thumb.ph { display: grid; place-items: center; color: var(--label3); }
.thumb.ph svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------- таббар */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 -.5px 0 var(--sep); padding-bottom: var(--safe-b); }
.tabbar .in { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: 49px; }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--gray); font-size: 10px; font-weight: 500; letter-spacing: .1px; position: relative; text-align: center; }
.tabbar button svg { width: 28px; height: 26px; }
.tabbar button.on { color: var(--blue); }
.tabbar .tb-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 12px; font-weight: 500; display: grid; place-items: center; padding: 0 5px; letter-spacing: 0; }

/* ---------------------------------------------------------- контент-план */
.week-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 16px; margin-top: 4px; }
.week-head .month { font-size: 20px; font-weight: 600; letter-spacing: .38px; text-transform: capitalize; }
.week-head .arrows { display: flex; align-items: center; }
.week-head .arrows button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--blue); }
.week-head .arrows .today-btn { width: auto; padding: 0 8px; font-size: 17px; }
.week-head .arrows svg { width: 11px; height: 18px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 10px; margin: 2px 0 6px; }
.week-strip button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; text-align: center; }
.week-strip .wd { font-size: 11px; font-weight: 500; color: var(--label2); text-transform: uppercase; letter-spacing: .07px; }
.week-strip .dn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; letter-spacing: .3px; }
.week-strip .today .dn { color: var(--red); font-weight: 600; }
.week-strip .sel .dn { background: var(--label); color: var(--bg2); font-weight: 600; }
.week-strip .today.sel .dn { background: var(--red); color: #fff; }
.week-strip .dots { display: flex; gap: 3px; height: 6px; }
.week-strip .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--label3); }
.week-strip .weekend .wd { color: var(--label3); }

.day-header { display: flex; align-items: baseline; gap: 8px; padding: 0 32px 7px; margin-top: 22px; font-size: 13px; letter-spacing: -.08px; text-transform: uppercase; color: var(--label2); scroll-margin-top: 60px; }
.day-header.today { color: var(--red); font-weight: 600; }
.day-header .gap { white-space: nowrap; margin-left: auto; text-transform: none; color: var(--orange); font-weight: 500; }
.time-col { width: 46px; flex: none; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--label2); letter-spacing: -.24px; }
.cell.slot { color: var(--label3); }
.cell.slot .plus { margin-left: auto; color: var(--blue); width: 22px; height: 22px; flex: none; }
.cell.past { opacity: .6; }

.month-grid { margin: 0 16px; background: var(--bg2); border-radius: 12px; padding: 8px 6px 10px; }
.month-grid .wds, .month-grid .days { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-grid .wds span { text-align: center; font-size: 11px; font-weight: 600; color: var(--label2); padding: 4px 0 6px; text-transform: uppercase; }
.month-grid .days button { min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 3px; gap: 3px; border-radius: 8px; }
.month-grid .days button:active { background: var(--fill); }
.month-grid .days .n { font-size: 17px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.month-grid .days .other .n { color: var(--label3); }
.month-grid .days .today .n { background: var(--red); color: #fff; font-weight: 600; }
.month-grid .days .marks { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; max-width: 34px; }
.month-grid .days .marks i { width: 5px; height: 5px; border-radius: 50%; }
.month-grid .days .gapday .n { color: var(--orange); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 32px 0; font-size: 13px; color: var(--label2); letter-spacing: -.08px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

.load-bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin-top: 6px; }
.load-bar i { display: block; height: 100%; border-radius: 3px; background: var(--blue); }
.load-bar i.hot { background: var(--orange); } .load-bar i.over { background: var(--red); }

/* ---------------------------------------------------------- пост */
.post-head { padding: 0 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.post-title-input { display: block; width: calc(100% - 32px); margin: 0 16px 4px; border: 0; outline: none; background: none; font: 700 28px/34px var(--font-display); letter-spacing: .36px; resize: none; padding: 0; overflow: hidden; }
.callout { margin: 12px 16px 0; border-radius: 12px; padding: 12px 14px; font-size: 15px; letter-spacing: -.24px; line-height: 1.38; display: flex; gap: 10px; }
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.callout b { display: block; font-weight: 600; margin-bottom: 2px; }
.callout.yellow { background: color-mix(in srgb, var(--yellow) 18%, var(--bg2)); }
.callout.yellow svg { color: var(--orange); }
.callout.red { background: color-mix(in srgb, var(--red) 12%, var(--bg2)); }
.callout.red svg { color: var(--red); }
.callout.blue { background: color-mix(in srgb, var(--blue) 10%, var(--bg2)); }
.callout.blue svg { color: var(--blue); }
.callout.green { background: color-mix(in srgb, var(--green) 12%, var(--bg2)); }
.callout.green svg { color: var(--green); }
.callout.gray { background: var(--bg2); }
.callout.gray svg { color: var(--label2); }
.callout .txt { overflow-wrap: anywhere; flex: 1; min-width: 0; }
.pre { white-space: pre-wrap; }

.media-strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px; scrollbar-width: none; }
.media-strip::-webkit-scrollbar { display: none; }
.media-strip .ms { position: relative; width: 92px; height: 92px; border-radius: 10px; flex: none; background: var(--fill) center/cover no-repeat; }
.media-strip .ms .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.media-strip .ms .x svg { width: 10px; height: 10px; }
.media-strip .ms .mv { position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; }
.media-strip .ms .mv svg { width: 12px; height: 12px; }
.media-strip .ms .i { position: absolute; left: 7px; bottom: 5px; color: #fff; font-size: 12px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.media-strip .add { width: 92px; height: 92px; border-radius: 10px; flex: none; background: var(--fill); color: var(--blue); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 500; text-align: center; letter-spacing: -.08px; }
.media-strip .add svg { width: 24px; height: 24px; }

.editor { width: 100%; border: 0; outline: none; resize: none; background: none; padding: 12px 16px; font-size: 17px; line-height: 1.42; min-height: 180px; display: block; }
.editor::placeholder { color: var(--label3); }
.editor-tools { display: flex; align-items: center; gap: 2px; padding: 4px 8px 6px; border-top: .5px solid var(--sep); }
.editor-tools button { height: 32px; min-width: 36px; padding: 0 8px; border-radius: 7px; color: var(--blue); font-size: 15px; display: grid; place-items: center; }
.editor-tools button:active { background: var(--fill); }
.editor-tools .cnt { margin-left: auto; font-size: 13px; color: var(--label2); padding-right: 8px; font-variant-numeric: tabular-nums; letter-spacing: -.08px; }
.editor-tools .cnt.over { color: var(--orange); }

/* предпросмотр как в Telegram */
.tg-preview { margin: 0 16px; background: color-mix(in srgb, var(--blue) 7%, var(--bg)); border-radius: 12px; padding: 14px 10px; }
.tg-bubble { background: var(--bg2); border-radius: 14px 14px 14px 4px; overflow: hidden; max-width: 420px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.tg-bubble .media { display: grid; gap: 2px; }
.tg-bubble .media.n2, .tg-bubble .media.n3, .tg-bubble .media.n4 { grid-template-columns: 1fr 1fr; }
.tg-bubble .media div { background: var(--fill) center/cover; aspect-ratio: 4/3; }
.tg-bubble .media.n1 div { aspect-ratio: auto; height: 240px; }
.tg-bubble .media.n3 div:first-child { grid-column: span 2; }
.tg-bubble .body { padding: 8px 12px 6px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; letter-spacing: -.2px; }
.tg-bubble .body blockquote { margin: 4px 0; padding: 2px 8px; border-left: 3px solid var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); border-radius: 4px; }
.tg-bubble .meta { text-align: right; font-size: 12px; color: var(--label2); padding: 0 10px 6px; }
.tg-bubble .chan { font-size: 14px; font-weight: 600; color: var(--blue); padding: 8px 12px 0; }

/* ИИ-проверка */
.ai-card { margin: 0 16px; background: var(--bg2); border-radius: 12px; overflow: hidden; }
.ai-top { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.ring { width: 54px; height: 54px; flex: none; position: relative; }
.ring svg { width: 54px; height: 54px; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 19px; font-weight: 700; letter-spacing: 0; }
.ai-sum { font-size: 15px; line-height: 1.38; letter-spacing: -.24px; }
.ai-issue { padding: 11px 16px; position: relative; font-size: 15px; letter-spacing: -.24px; line-height: 1.36; }
.ai-issue::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.ai-issue .t { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 2px; }
.ai-issue .fix { color: var(--label2); margin-top: 3px; }
.shimmer { background: linear-gradient(90deg, var(--fill) 25%, var(--fill3) 50%, var(--fill) 75%); background-size: 300% 100%; animation: shimmer 1.4s infinite linear; border-radius: 6px; height: 12px; margin: 8px 0; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* ---------------------------------------------------------- медиатека */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 6px; }
@media (min-width: 560px) { .grid3 { grid-template-columns: repeat(5, 1fr); } }
.grid3 .ph { aspect-ratio: 1; background: var(--fill) center/cover no-repeat; position: relative; overflow: hidden; }
.grid3 .ph:active { opacity: .7; }
.grid3 .ph .tag { position: absolute; left: 5px; bottom: 5px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #fff; display: inline-flex; align-items: center; gap: 3px; letter-spacing: 0; }
.grid3 .ph .tag.used { background: rgba(52,199,89,.9); }
.grid3 .ph .tag.plan { background: rgba(0,122,255,.85); }
.grid3 .ph .sel { position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #fff; background: rgba(0,0,0,.15); box-shadow: 0 0 2px rgba(0,0,0,.3); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; letter-spacing: 0; }
.grid3 .ph.picked .sel { background: var(--blue); }
.grid3 .ph.picked::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.2); }
.grid3 .ph .spin { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-photo { background: #000; display: grid; place-items: center; max-height: 62vh; overflow: hidden; }
.hero-photo img { max-width: 100%; max-height: 62vh; object-fit: contain; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; }
.tags span { background: var(--fill); border-radius: 14px; padding: 4px 11px; font-size: 15px; letter-spacing: -.24px; }

/* ---------------------------------------------------------- идеи */
.vote { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: var(--fill); flex: none; color: var(--label2); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.vote svg { width: 14px; height: 14px; }
.vote.on { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.anniv { width: 44px; flex: none; text-align: center; border-radius: 9px; overflow: hidden; background: var(--bg3); }
.anniv .m { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 1px 0; letter-spacing: .04em; }
.anniv .d { font-size: 19px; font-weight: 600; padding: 2px 0 3px; letter-spacing: 0; }

/* ---------------------------------------------------------- метрики и графики */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px; margin-top: 8px; }
.tile { background: var(--bg2); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.tile .k { font-size: 13px; font-weight: 600; color: var(--label2); display: flex; align-items: center; gap: 6px; letter-spacing: -.08px; }
.tile .k svg { width: 15px; height: 15px; }
.tile .v { font: 700 26px/32px var(--font-display); letter-spacing: .36px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v small { font-size: 17px; font-weight: 600; color: var(--label2); letter-spacing: 0; }
.tile .s { font-size: 13px; color: var(--label2); margin-top: 1px; letter-spacing: -.08px; }
.chart { margin: 0 16px; background: var(--bg2); border-radius: 12px; padding: 14px 14px 10px; }
.chart .ch-title { font-size: 13px; font-weight: 600; color: var(--label2); letter-spacing: -.08px; }
.chart .ch-value { font: 700 22px/28px var(--font-display); margin-bottom: 8px; }
.chart svg { width: 100%; height: 140px; display: block; overflow: visible; }
.chart .axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--label2); margin-top: 4px; letter-spacing: 0; }
.hbar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; margin-top: 6px; }
.hbar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.month-switch { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; margin: 2px 0 6px; }
.month-switch .t { font-size: 20px; font-weight: 600; letter-spacing: .38px; text-transform: capitalize; }
.month-switch button { width: 44px; height: 40px; display: grid; place-items: center; color: var(--blue); }
.month-switch button svg { width: 11px; height: 18px; }

/* ---------------------------------------------------------- профиль */
.profile { text-align: center; padding: 8px 16px 6px; }
.profile .av { margin: 0 auto 10px; }
.profile h2 { margin: 0; font: 700 26px/32px var(--font-display); letter-spacing: .36px; }
.profile .pos { color: var(--label2); margin-top: 2px; font-size: 15px; letter-spacing: -.24px; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px; margin-top: 16px; }
.stats3 div { background: var(--bg2); border-radius: 12px; padding: 10px 6px; text-align: center; }
.stats3 b { display: block; font: 700 22px/28px var(--font-display); }
.stats3 span { font-size: 12px; color: var(--label2); letter-spacing: 0; }

/* ---------------------------------------------------------- задачи */
.status-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 16px; margin: 4px 0 0; }
.status-seg button { height: 34px; border-radius: 9px; background: var(--bg2); font-size: 13px; font-weight: 600; color: var(--label2); letter-spacing: -.08px; text-align: center; }
.status-seg button.on { color: #fff; }
.status-seg button:disabled { cursor: default; }
.comment { display: flex; gap: 8px; padding: 5px 16px; align-items: flex-end; }
.comment .bubble { background: var(--bg2); border-radius: 18px; padding: 7px 12px 8px; min-width: 0; max-width: 85%; }
.comment .who { font-size: 13px; font-weight: 600; letter-spacing: -.08px; }
.comment .when { font-size: 12px; color: var(--label2); margin-left: 6px; font-weight: 400; }
.comment .txt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.35; letter-spacing: -.32px; }
.comment .del { color: var(--label3); font-size: 12px; margin-top: 2px; }
.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 -.5px 0 var(--sep); padding: 7px 12px calc(7px + var(--safe-b)); }
.composer form { max-width: 720px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: .5px solid var(--sep); background: var(--bg2); border-radius: 18px; padding: 7px 14px; max-height: 120px; outline: none; min-height: 36px; font-size: 17px; line-height: 1.25; }
.send-btn { width: 32px; height: 32px; margin-bottom: 2px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; }
.send-btn svg { width: 16px; height: 16px; }

/* заметки */
.note-body { padding: 14px 16px; font-size: 17px; line-height: 1.47; overflow-wrap: anywhere; }
.note-body h2 { font: 700 22px/28px var(--font-display); margin: 18px 0 6px; } .note-body h3 { font-size: 19px; margin: 14px 0 4px; }
.note-body > :first-child { margin-top: 0; } .note-body > :last-child { margin-bottom: 0; }
.note-body p { margin: 0 0 12px; } .note-body ul, .note-body ol { margin: 0 0 12px; padding-left: 22px; }
.note-body code { background: var(--fill); border-radius: 5px; padding: 1px 5px; font-size: 15px; }
.note-body blockquote { margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--brown); color: var(--label2); }

/* ---------------------------------------------------------- пустые состояния */
.empty { text-align: center; color: var(--label2); padding: 48px 32px; font-size: 15px; letter-spacing: -.24px; }
.empty .ic { width: 56px; height: 56px; margin: 0 auto 12px; color: var(--label3); }
.empty .ic svg { width: 56px; height: 56px; }
.empty b { display: block; color: var(--label); font: 600 20px/25px var(--font-display); margin-bottom: 6px; letter-spacing: .38px; }
.empty .btn { width: auto; display: inline-flex; padding: 0 20px; height: 40px; font-size: 15px; margin-top: 16px; border-radius: 20px; }
.center-screen { min-height: 86vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.center-screen .eyebrow { margin-bottom: 18px; }
.center-screen .ic svg { width: 64px; height: 64px; color: var(--label3); }
.center-screen h2 { margin: 14px 0 6px; font: 700 24px/30px var(--font-display); }
.center-screen p { color: var(--label2); max-width: 300px; margin: 0; font-size: 15px; letter-spacing: -.24px; }
.center-screen .btn { max-width: 240px; margin-top: 22px; }
.skel-group { margin: 12px 16px; background: var(--bg2); border-radius: 10px; padding: 4px 16px; }
.skel-group .shimmer { height: 14px; margin: 14px 0; }
.skel-group .shimmer:nth-child(2n) { width: 70%; }

/* ---------------------------------------------------------- листы, алерты, HUD */
#overlay { position: fixed; inset: 0; z-index: 60; display: none; }
#overlay.on { display: block; }
#overlay .shade { position: absolute; inset: 0; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .25s; }
#overlay.show .shade { opacity: 1; }
.asheet { position: absolute; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); max-width: 420px; margin: 0 auto; transform: translateY(calc(100% + 40px)); transition: transform .35s cubic-bezier(.2,.9,.25,1); }
#overlay.show .asheet { transform: none; }
.asheet .grp { background: var(--sheet); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-radius: 14px; overflow: hidden; max-height: 66vh; overflow-y: auto; }
.asheet .grp + .grp { margin-top: 8px; }
.asheet .ttl { text-align: center; padding: 14px 16px 12px; font-size: 13px; color: var(--label2); line-height: 1.35; letter-spacing: -.08px; }
.asheet .ttl b { display: block; font-weight: 600; margin-bottom: 2px; }
.asheet .opt { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 57px; padding: 8px 16px; font-size: 20px; letter-spacing: .38px; color: var(--blue); position: relative; text-align: center; }
.asheet .opt::before { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: .5px solid var(--sep); }
.asheet .grp > .opt:first-child::before { display: none; }
.asheet .opt:active { background: var(--fill2); }
.asheet .opt.red { color: var(--red); }
.asheet .opt.cancel { font-weight: 600; }
.asheet .opt .sub { display: block; font-size: 13px; color: var(--label2); letter-spacing: -.08px; margin-top: 2px; }
.asheet .opt.list { flex-direction: row; justify-content: flex-start; gap: 12px; text-align: left; font-size: 17px; letter-spacing: -.41px; color: var(--label); min-height: 50px; }
.asheet .opt.list .ck { margin-left: auto; color: var(--blue); width: 18px; height: 18px; flex: none; }
.asheet .opt.list .lb { flex: 1; min-width: 0; }

.alert { position: absolute; left: 50%; top: 42%; width: 270px; transform: translate(-50%, -50%) scale(1.12); opacity: 0; transition: transform .25s cubic-bezier(.2,.9,.25,1), opacity .2s; background: var(--sheet); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-radius: 14px; overflow: hidden; text-align: center; }
#overlay.show .alert { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.alert .a-body { padding: 19px 16px 15px; }
.alert h4 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.41px; }
.alert p { margin: 2px 0 0; font-size: 13px; line-height: 1.35; letter-spacing: -.08px; }
.alert input, .alert textarea { width: 100%; margin-top: 14px; border: .5px solid var(--sep); background: var(--bg2); border-radius: 7px; height: 30px; padding: 0 7px; font-size: 15px; outline: none; letter-spacing: -.24px; }
.alert textarea { height: 76px; padding: 6px 7px; resize: none; }
.alert .a-btns { display: flex; border-top: .5px solid var(--sep); }
.alert .a-btns button { flex: 1; height: 44px; font-size: 17px; color: var(--blue); text-align: center; }
.alert .a-btns button + button { border-left: .5px solid var(--sep); }
.alert .a-btns button.bold { font-weight: 600; }
.alert .a-btns button.red { color: var(--red); }
.alert .a-btns button:active { background: var(--fill2); }

.lightbox { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: #000; opacity: 0; transition: opacity .2s; }
#overlay.show .lightbox { opacity: 1; }
.lightbox img { max-width: 100%; max-height: 86vh; }
.lightbox .close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; display: grid; place-items: center; }
.lightbox .close svg { width: 12px; height: 12px; }

#hud { position: fixed; left: 50%; top: calc(10px + var(--safe-t)); transform: translate(-50%, -90px); z-index: 90; background: var(--hud); color: #fff; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); padding: 10px 18px; border-radius: 22px; font-size: 15px; font-weight: 500; letter-spacing: -.24px; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: transform .4s cubic-bezier(.2,.9,.25,1.1); max-width: calc(100vw - 32px); text-align: center; pointer-events: none; display: flex; align-items: center; gap: 8px; }
#hud.on { transform: translate(-50%, 0); }
#hud svg { width: 18px; height: 18px; flex: none; }

.dev-bar { margin: 28px 16px 0; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--sep); color: var(--label2); font-size: 13px; }
.dev-bar select { display: block; width: 100%; margin-top: 8px; height: 36px; border-radius: 8px; border: 0; background: var(--fill); padding: 0 8px; color: var(--label); }


/* ==========================================================================
   Liquid Glass (iOS 26): стеклянные плавающие панели, капсулы, крупные скругления.
   Слой поверх базовых стилей — переопределяет форму и материал компонентов.
   ========================================================================== */
:root {
  --glass: rgba(255,255,255,.58);
  --glass-strong: rgba(255,255,255,.74);
  --glass-tint: rgba(0,122,255,.88);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1px 1px rgba(255,255,255,.35), inset 0 0 0 .5px rgba(255,255,255,.7);
  --glass-shadow: 0 8px 28px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.08);
  --glass-blur: blur(22px) saturate(190%) brightness(1.04);
  --r-group: 26px;
}
:root[data-theme="dark"] {
  --glass: rgba(44,44,48,.52);
  --glass-strong: rgba(52,52,56,.72);
  --glass-tint: rgba(10,132,255,.85);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 1px rgba(255,255,255,.06), inset 0 0 0 .5px rgba(255,255,255,.14);
  --glass-shadow: 0 8px 28px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.3);
  --glass-blur: blur(22px) saturate(170%) brightness(1.1);
}

/* общий материал стекла + блик сверху */
.tabbar, .nav-btn, .asheet .grp, .alert, #hud, .composer textarea, .seg button.on, .tabbar button.on::before {
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.tabbar, .nav-btn, .asheet .grp, .alert, #hud, .composer textarea {
  background: var(--glass); box-shadow: var(--glass-edge), var(--glass-shadow);
}

/* --- шапка: прозрачная, при прокрутке — мягкое размытие вместо полосы */
.nav { padding: var(--safe-t) 12px 0; height: calc(56px + var(--safe-t)); }
.nav.scrolled, .nav.solid { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.nav::before { content: ""; position: absolute; inset: 0 0 -18px; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 94%, transparent) 0%, color-mix(in srgb, var(--bg) 86%, transparent) 62%, transparent 100%);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent); mask-image: linear-gradient(to bottom, #000 68%, transparent); }
.nav.scrolled::before, .nav.solid::before { opacity: 1; }
.nav-right { gap: 8px; }
.nav-btn { height: 44px; min-width: 44px; padding: 0 16px; border-radius: 22px; justify-content: center; color: var(--label); font-weight: 500; position: relative; overflow: hidden; transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.nav-btn::after, .tabbar::after, .asheet .grp::after, .alert::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,0) 38%, rgba(255,255,255,0) 70%, rgba(255,255,255,.12) 100%); }
:root[data-theme="dark"] .nav-btn::after, :root[data-theme="dark"] .tabbar::after, :root[data-theme="dark"] .asheet .grp::after, :root[data-theme="dark"] .alert::after {
  background: linear-gradient(160deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,0) 72%, rgba(255,255,255,.05) 100%); }
.nav-btn:active { opacity: 1; transform: scale(1.08); }
.nav-btn.icon { width: 44px; padding: 0; }
.nav-btn.icon svg { width: 21px; height: 21px; }
.nav-btn.back svg { width: 12px; height: 20px; margin: 0 2px 0 0; }
.nav-btn.bold { background: var(--glass-tint); color: #fff; font-weight: 600; }
.nav-btn:disabled { color: var(--label3); }
.nav-status { padding: 0 4px; }

.large-title { margin-top: 2px; }

/* --- таббар: плавающая стеклянная капсула */
.tabbar { left: 50%; right: auto; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); width: min(calc(100% - 28px), 440px);
  border-radius: 34px; padding: 4px; overflow: hidden; }
.tabbar .in { height: 60px; }
.tabbar button { border-radius: 28px; gap: 2px; position: relative; z-index: 0; font-size: 10.5px; }
.tabbar button.on::before { content: ""; position: absolute; inset: 0 2px; z-index: -1; border-radius: 28px;
  background: color-mix(in srgb, var(--label) 9%, transparent); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 0 0 .5px rgba(255,255,255,.25); }
.tabbar button svg { width: 26px; height: 24px; }
.tabbar .tb-badge { top: 4px; }
#app { padding-bottom: calc(100px + var(--safe-b)); }

/* --- списки: крупные скругления */
.group, .skel-group, .tile, .chart, .ai-card, .month-grid, .tg-preview, .callout, .stats3 div { border-radius: var(--r-group); }
.tile, .chart { border-radius: 22px; }
.callout { border-radius: 20px; }
.cell { min-height: 52px; padding: 13px 18px; --inset: 18px; }
.cell.has-icon { --inset: 59px; }
.group-header { padding: 0 34px 8px; }
.group-footer { padding: 8px 34px 0; }
.icon-sq { border-radius: 8px; }
.thumb { border-radius: 12px; }
.media-strip .ms, .media-strip .add { border-radius: 16px; }

/* --- сегменты, поиск, кнопки: капсулы */
.seg { border-radius: 100px; padding: 3px; background: var(--fill2); }
.seg button { height: 32px; border-radius: 100px; font-size: 14px; }
.seg button + button::before { display: none; }
.seg button.on { background: var(--glass-strong); box-shadow: var(--glass-edge), 0 3px 10px rgba(0,0,0,.12); }
.search input { height: 44px; border-radius: 100px; padding-left: 40px; background: var(--fill2); }
.search svg { left: 15px; width: 17px; height: 17px; }
.btn { height: 52px; border-radius: 100px; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 18px color-mix(in srgb, var(--blue) 25%, transparent); }
.btn.green { box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 18px color-mix(in srgb, var(--green) 25%, transparent); }
.btn.tinted, .btn.gray, .btn.plain { box-shadow: none; }
.btn.tinted { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 0 0 .5px color-mix(in srgb, var(--blue) 18%, transparent); }
.btn:active { opacity: 1; transform: scale(.97); }
.status-seg button { border-radius: 100px; height: 36px; }
.empty .btn { border-radius: 100px; display: flex; width: fit-content; margin: 16px auto 0; }
.vote { border-radius: 16px; }

/* --- action sheet: стеклянные карточки */
.asheet { left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); }
.asheet .grp { border-radius: 32px; position: relative; }
.asheet .grp + .grp { margin-top: 10px; }
.asheet .opt::before { left: 22px; right: 22px; border-top-color: color-mix(in srgb, var(--sep) 70%, transparent); }
.asheet .opt.list { padding: 8px 22px; }
.asheet .opt.cancel { color: var(--label); }

/* --- alert: стекло и кнопки-капсулы */
.alert { width: 300px; border-radius: 34px; }
.alert .a-body { padding: 24px 22px 16px; }
.alert input, .alert textarea { height: 40px; border-radius: 100px; padding: 0 14px; border: 0; background: var(--fill2); }
.alert textarea { height: 84px; border-radius: 18px; padding: 10px 14px; }
.alert .a-btns { border-top: 0; gap: 8px; padding: 4px 16px 16px; }
.alert .a-btns button { height: 46px; border-radius: 100px; background: var(--fill2); color: var(--label); font-weight: 500; }
.alert .a-btns button + button { border-left: 0; }
.alert .a-btns button.bold { background: var(--glass-tint); color: #fff; }
.alert .a-btns button.red { background: color-mix(in srgb, var(--red) 88%, transparent); color: #fff; }
#overlay .shade { background: rgba(0,0,0,.22); }

/* --- HUD и поле комментария */
#hud { color: var(--label); border-radius: 100px; padding: 12px 20px; }
.composer { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 8px 14px calc(12px + var(--safe-b)); }
.composer form { border-radius: 100px; }
.composer textarea { border: 0; border-radius: 22px; padding: 10px 16px; min-height: 44px; }
.send-btn { width: 44px; height: 44px; margin-bottom: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 14px color-mix(in srgb, var(--blue) 35%, transparent); }
#app.with-composer { padding-bottom: calc(110px + var(--safe-b)); }

/* лайтбокс: круглая стеклянная кнопка закрытия */
.lightbox .close { width: 44px; height: 44px; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); background: rgba(255,255,255,.2); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }

/* план/факт под заголовком дня и статус сохранения */
.fact-line { padding: 0 34px 8px; margin-top: -4px; font-size: 13px; font-weight: 500; letter-spacing: -.08px; }
.nav-status.warn { color: var(--orange); font-weight: 600; }
.nav-status u { text-decoration: none; color: var(--blue); }

/* степпер нормы в настройках */
.stepper { display: flex; align-items: center; gap: 10px; flex: none; }
.stepper button { width: 34px; height: 30px; border-radius: 100px; background: var(--fill2); font-size: 19px; font-weight: 500; color: var(--label); text-align: center; }
.stepper b { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }

/* оценка 1–5 в идеях */
.rate { display: flex; gap: 8px; flex: none; }
.rate button { width: 32px; height: 32px; border-radius: 100px; background: var(--fill2); font-size: 15px; font-weight: 600; color: var(--label2); text-align: center; }
.rate button.on { background: var(--blue); color: #fff; }

/* этапы закупки рекламы */
.steps { display: flex; justify-content: space-between; padding: 6px 20px 2px; margin-top: 10px; position: relative; }
.steps::before { content: ""; position: absolute; left: 36px; right: 36px; top: 19px; border-top: 2px solid var(--fill3); }
.step { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; color: var(--label2); position: relative; z-index: 1; width: 62px; text-align: center; letter-spacing: 0; }
.step i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); border: 2px solid var(--fill3); font-style: normal; font-weight: 700; font-size: 13px; }
.step i svg { width: 14px; height: 14px; }
.step.done i { background: var(--green); border-color: var(--green); color: #fff; }
.step.cur i { border-color: var(--blue); color: var(--blue); }
.step.cur span { color: var(--label); font-weight: 600; }

/* статус сохранения — вторая строка под заголовком в шапке */
.nav-title .nav-status { display: block; margin: 0 auto; padding: 0; font-size: 11px; font-weight: 500; line-height: 13px; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; }
.nav-title .nav-status:empty { display: none; }

.clamp2 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }

.rate-cell { flex-direction: column; align-items: stretch; gap: 10px; }
.rate-head { display: flex; justify-content: space-between; gap: 8px; font-size: 17px; }
.rate-head .c-gray { font-size: 15px; }
.rate-cell .rate button { flex: 1; width: auto; height: 36px; }

/* подложка под плавающим полем комментария — контент не просвечивает пятнами */
.composer::before { content: ""; position: absolute; inset: -22px 0 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 55%, transparent 100%); }
.composer textarea { background: var(--glass-strong); }

/* поле с подписью сверху (форма в духе «Контактов») */
.cell.field { flex-direction: column; align-items: stretch; gap: 2px; padding-top: 9px; padding-bottom: 10px; cursor: text; }
.field-label { font-size: 13px; color: var(--label2); letter-spacing: -.08px; }
.cell.field textarea.cell-input { min-height: 44px; }

/* текстовые кнопки в шапке не должны наезжать на заголовок */
.nav:has(.nav-btn:not(.icon)) .nav-title { max-width: 34vw; }
@media (min-width: 560px) { .nav:has(.nav-btn:not(.icon)) .nav-title { max-width: 240px; } }
.nav-btn:not(.icon) { padding: 0 14px; }

/* ---------------------------------------------------------- KPI: чат */
#app.tabbar-composer { padding-bottom: calc(180px + var(--safe-b)); }
.composer.above-tabbar { bottom: calc(80px + var(--safe-b)); padding-bottom: 8px; }
.composer.above-tabbar::before { inset: -22px 0 -90px; }
.composer form { align-items: flex-end; }
.composer-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.composer-field textarea { width: 100%; }
.attach-btn { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--blue);
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), var(--glass-shadow); }
.attach-btn svg { width: 22px; height: 22px; }
.attach-chip { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border-radius: 16px; background: var(--glass-strong); box-shadow: var(--glass-edge); font-size: 14px; color: var(--label2); }
.attach-chip img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.attach-chip span { flex: 1; }
.attach-chip button { width: 26px; height: 26px; border-radius: 50%; background: var(--fill2); display: grid; place-items: center; color: var(--label2); }
.attach-chip button svg { width: 10px; height: 10px; }

.kpi-card { margin: 4px 16px 0; background: var(--bg2); border-radius: 22px; padding: 14px 16px 12px; display: grid; gap: 10px; }
.kpi-bar-head { display: flex; justify-content: space-between; font-size: 15px; letter-spacing: -.24px; }
.kpi-bar-head b { font-weight: 600; }
.kpi-bar .hbar { margin-top: 5px; }
.kpi-foot { font-size: 13px; color: var(--label2); letter-spacing: -.08px; }

.chat { padding: 8px 12px 0; display: flex; flex-direction: column; gap: 6px; }
.day-sep { align-self: center; font-size: 12px; font-weight: 600; color: var(--label2); background: var(--fill); padding: 3px 10px; border-radius: 100px; margin: 12px 0 4px; letter-spacing: 0; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 84%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .bubble { background: var(--bg2); border-radius: 20px 20px 20px 6px; padding: 8px 12px; position: relative; min-width: 0; max-width: 100%; }
.msg.me .bubble { background: var(--blue); color: #fff; border-radius: 20px 20px 6px 20px; }
.msg.me .bubble a { color: #fff; text-decoration: underline; }
.msg .bubble.photo { padding: 0; overflow: hidden; width: min(300px, 76vw); background: var(--bg2); color: var(--label); }
.msg.me .bubble.photo { background: var(--bg2); color: var(--label); border: 2px solid color-mix(in srgb, var(--blue) 35%, transparent); }
.bubble.photo img { width: 100%; max-height: 340px; object-fit: cover; display: block; cursor: zoom-in; background: var(--fill); }
.b-body { padding: 10px 12px 10px; }
.b-text { font-size: 16px; line-height: 1.38; letter-spacing: -.3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.b-author { font-size: 13px; font-weight: 600; color: var(--blue); margin-bottom: 2px; }
.b-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.b-time { font-size: 11px; opacity: .6; margin-left: auto; letter-spacing: 0; }
.msg .bubble:not(.photo) .b-time { display: block; text-align: right; margin-top: 2px; }
.b-review { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--orange) 14%, transparent); font-size: 14px; line-height: 1.35; }
.b-review b { display: block; font-size: 12px; font-weight: 600; color: var(--orange); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 2px; }
.kb-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg.me .kb-row { justify-content: flex-end; }
.kb { height: 34px; padding: 0 12px; border-radius: 100px; display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600;
  background: var(--glass-strong); box-shadow: var(--glass-edge), 0 2px 8px rgba(0,0,0,.08); color: var(--label); letter-spacing: -.1px; }
.kb svg { width: 15px; height: 15px; }
.kb.green { background: var(--green); color: #fff; }
.kb.blue { background: var(--blue); color: #fff; }
.kb.red { color: var(--red); }
.kb.plain { background: none; box-shadow: none; color: var(--blue); font-weight: 500; padding: 0 6px; }
.kb.plain.red { color: var(--red); }

.b-lowres { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--orange); font-weight: 500; }
.b-lowres svg { width: 15px; height: 15px; flex: none; }

/* шкала публикаций дня */
.day-meter { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; text-transform: none; letter-spacing: 0; }
.dm-label { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dm-track { display: inline-flex; gap: 3px; }
.dm-track i { width: 14px; height: 6px; border-radius: 3px; background: var(--fill3); }
.day-meter.zero .dm-label { color: var(--red); }
.day-meter.zero .dm-track i { background: color-mix(in srgb, var(--red) 28%, var(--fill)); }
.day-meter.mid .dm-label { color: var(--orange); }
.day-meter.mid .dm-track i.on { background: var(--orange); }
.day-meter.ok .dm-label { color: var(--green); }
.day-meter.ok .dm-track i.on { background: var(--green); }
.day-header { align-items: center; }

.asheet .opt-head { padding: 14px 22px 6px; font-size: 13px; font-weight: 600; color: var(--label2); text-transform: uppercase; letter-spacing: .02em; text-align: left; position: relative; }
.asheet .opt-head + .opt::before { display: none; }

.msg-ctl { display: flex; gap: 12px; margin-top: 4px; align-items: center; }
.msg-ctl button { font-size: 12px; color: var(--blue); }
.msg-ctl button + button { color: var(--red); }
.edited { font-size: 11px; color: var(--label3); }

/* отметки @сотрудника */
.mention { color: var(--blue); font-weight: 600; font: inherit; font-weight: 600; padding: 0; background: none; display: inline; cursor: pointer; }
.me .bubble .mention { color: inherit; text-decoration: underline; }
#mention-pop { position: fixed; z-index: 60; max-height: 260px; overflow-y: auto; border-radius: 16px; padding: 4px;
  background: var(--glass-strong, var(--bg2)); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--glass-edge, 0 0 0 .5px var(--sep)), 0 10px 30px rgba(0,0,0,.18); }
#mention-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 12px; text-align: left; }
#mention-pop button:active { background: var(--fill); }
#mention-pop span { display: flex; flex-direction: column; min-width: 0; }
#mention-pop b { font-size: 15px; font-weight: 600; color: var(--label); }
#mention-pop small { font-size: 13px; color: var(--label2); }

/* разделы «Ответственный / Аудитор» во вкладке задач */
.section-title { display: flex; align-items: baseline; gap: 8px; margin: 26px 20px 2px; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.26px; color: var(--label); }
.section-title span { font-size: 17px; font-weight: 600; color: var(--label2); }
.seg-wrap + .section-title { margin-top: 16px; }
.done-toggle { width: 100%; text-align: left; background: none; font: inherit; font-size: 13px; text-transform: uppercase; }
.done-toggle svg { width: 7px; height: 12px; color: var(--label3, var(--label2)); transition: transform .2s; }
.done-toggle.open svg { transform: rotate(90deg); }

/* компактный свободный слот */
.cell.slot { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
.cell.slot .time-col { color: var(--label3); }
.slot-add { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--label3); }
.slot-add svg { width: 13px; height: 13px; color: var(--blue); }
.cell.slot:active .slot-add { color: var(--blue); }
/* прошедшие дни — тише, но ошибки видны */
.past-day .cell:not(:has(.st-failed)) { opacity: .6; }

/* KPI: «Принято с правкой» и «Отклонено» различаются не только текстом */
.pill.teal { background: color-mix(in srgb, var(--teal, #30b0c7) 16%, transparent); color: var(--teal, #30b0c7); }
.b-review.red { background: color-mix(in srgb, var(--red) 12%, transparent); }
.b-review.red b { color: var(--red); }
.b-review.yellow { background: color-mix(in srgb, var(--yellow, #ffcc00) 18%, transparent); }
.b-review.yellow b { color: color-mix(in srgb, var(--orange) 80%, var(--label)); }
.b-review b svg { width: 11px; height: 11px; margin-right: 4px; vertical-align: -1px; }
.bubble.photo.is-rejected img { filter: grayscale(1); opacity: .55; }
.tiles.three { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tiles.three .tile { padding: 12px; min-width: 0; }
.tiles.three .tile .v { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles.three .tile .k { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles.three .tile .k svg { width: 13px; height: 13px; }
.grid3 .ph .tag.icon { width: 20px; padding: 0; justify-content: center; }

/* просмотр фото с зумом */
.lightbox.zoomable { display: block; padding: 0; }
.lb-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.lb-stage:active { cursor: grabbing; }
.lightbox.zoomable img { position: absolute; left: 0; top: 0; max-width: none; max-height: none; user-select: none; -webkit-user-select: none; will-change: transform; }
.lightbox.zoomable img.pixels { image-rendering: pixelated; }
.lb-bar { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; border-radius: 100px;
  background: rgba(255,255,255,.16); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.lb-bar button { min-width: 44px; height: 40px; border-radius: 100px; color: #fff; font-size: 22px; font-weight: 500; }
.lb-bar .lb-pct { min-width: 72px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lb-bar button:active { background: rgba(255,255,255,.18); }
.editor-tools.mini { padding: 4px 6px 0; border-top: none; gap: 2px; }
.editor-tools.mini button { height: 28px; min-width: 32px; }

/* PDF-регламент */
.pdf-pages { margin: 14px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.pdf-page { width: 100%; height: auto; border-radius: 10px; background: #fff; box-shadow: 0 0 0 .5px var(--sep), 0 4px 14px rgba(0,0,0,.08); cursor: zoom-in; }
.pdf-loading { padding: 40px 16px; text-align: center; color: var(--label2); font-size: 15px; }

/* оценка идеи: средний балл цветом */
.rate-badge { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 52px; height: 46px; padding: 0 6px; border-radius: 14px;
  font: 700 18px/1 var(--font-display); letter-spacing: 0; }
.rate-badge small { font: 500 10px/1.2 var(--font); margin-top: 3px; opacity: .85; white-space: nowrap; }
.rate-badge.red { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.rate-badge.yellow { background: color-mix(in srgb, var(--yellow, #ffcc00) 22%, transparent); color: color-mix(in srgb, var(--orange) 85%, var(--label)); }
.rate-badge.green { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.rate-badge.gray { background: var(--fill); color: var(--label3); }
.rate-head .rate-badge { flex-direction: row; gap: 8px; height: 34px; padding: 0 12px; }
.rate-head .rate-badge small { margin: 0; }
.rate.stars button.on.red { background: var(--red); }
.rate.stars button.on.yellow { background: #f5b800; }
.rate.stars button.on.green { background: var(--green); }

/* видео и архив на превью */
.vbadge { position: absolute; right: 5px; bottom: 5px; height: 18px; padding: 0 6px; border-radius: 9px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.vbadge svg { width: 8px; height: 8px; }
.abadge { position: absolute; right: 5px; top: 5px; width: 20px; height: 20px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.abadge svg { width: 12px; height: 12px; }
.thumb { position: relative; }
.thumb .vbadge { right: 3px; bottom: 3px; height: 15px; padding: 0 4px; font-size: 10px; }
.media-strip .add svg { width: 26px; height: 26px; }
.hero-photo.video video { width: 100%; max-height: 70vh; display: block; background: #000; border-radius: inherit; }
.media-strip .ms .abadge { top: auto; bottom: 4px; }

/* визуальный редактор: жирный/курсив видны сразу */
.rte { outline: none; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; cursor: text; }
.rte.cell-input { min-height: 66px; }
.rte:empty::before { content: attr(data-placeholder); color: var(--label3); pointer-events: none; }
.rte b, .rte strong { font-weight: 700; }
.rte a { color: var(--blue); text-decoration: underline; }
.rte blockquote { margin: 4px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--blue); color: var(--label2); }

/* у формы ввода нет своей подложки — стекло только у поля и кнопки */
.composer form { background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
textarea[data-rich][hidden] { display: none !important; }

/* галочка «Отправить в исходном качестве» под мультимедиа */
.orig-toggle { cursor: pointer; border-top: .5px solid var(--sep); }
.tick { -webkit-appearance: none; appearance: none; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--label3); margin: 0; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.tick:checked { background: var(--blue); border-color: var(--blue); }
.tick:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: translateY(-1px) rotate(45deg); }
.tick:disabled { opacity: .5; }

/* превью «как в Telegram»: оригиналы файлом */
.tg-docs { padding: 10px 12px 2px; display: flex; flex-direction: column; gap: 10px; }
.tg-doc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tg-doc .th { width: 54px; height: 54px; border-radius: 8px; flex: none; background: var(--fill) center/cover; }
.tg-doc .nm { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tg-doc .nm b { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-doc .nm span { font-size: 13px; color: var(--label2); }

/* вложения в сообщениях и описаниях */
.att { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.att-grid { display: grid; gap: 3px; border-radius: 12px; overflow: hidden; max-width: 280px; }
.att-grid.n2, .att-grid.n3, .att-grid.n4 { grid-template-columns: 1fr 1fr; }
.att-grid.n3 .att-ph:first-child { grid-column: span 2; }
.att-ph { position: relative; aspect-ratio: 4/3; background: var(--fill) center/cover; cursor: zoom-in; }
.att-grid.n1 .att-ph { aspect-ratio: auto; height: 200px; }
.att-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--fill); text-align: left; max-width: 280px; }
.att-file span { display: flex; flex-direction: column; min-width: 0; }
.att-file b { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--label); }
.att-file small { font-size: 12px; color: var(--label2); }
.file-ic { flex: none; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; letter-spacing: .02em; background: var(--gray); }
.file-ic.red { background: var(--red); } .file-ic.blue { background: var(--blue); } .file-ic.green { background: var(--green); } .file-ic.brown { background: var(--brown); }
.att-pending { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 0; }
.att-pending.in-form { padding: 10px 16px 4px; }
.ap-ph { position: relative; width: 52px; height: 52px; border-radius: 10px; background: var(--fill) center/cover; }
.ap-file { position: relative; display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 26px 0 8px; border-radius: 10px; background: var(--glass-strong, var(--fill)); max-width: 200px; font-size: 13px; }
.ap-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-file .file-ic { width: 30px; height: 30px; font-size: 9px; }
.ap-ph button, .ap-file button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.ap-ph button svg, .ap-file button svg { width: 8px; height: 8px; }
.desc-block .media-strip { padding-top: 6px; }
.desc-block .icon-btn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--label3); flex: none; }
.desc-block .icon-btn svg { width: 11px; height: 11px; }
.desc-block > .cell.tap { gap: 12px; }
.comment .bubble .att-grid { max-width: 240px; }
.lb-bar { display: grid; grid-template-columns: 48px 80px 48px; gap: 0; padding: 4px; }
.lb-bar button { display: grid; place-items: center; padding: 0; min-width: 0; width: 100%; height: 40px; line-height: 1; }
.b-when { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 13px; color: var(--label2); }
.b-when svg { width: 13px; height: 13px; }
.when-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px;
  background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); font-size: 14px; font-weight: 500; }
.when-chip svg { width: 14px; height: 14px; }

/* служебные строки в KPI-чате */
.sys-msg { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 86%; margin: 6px auto; padding: 6px 12px; border-radius: 14px;
  background: var(--fill); text-align: center; font-size: 13px; line-height: 1.35; color: var(--label2); }
.sys-msg small { font-size: 11px; color: var(--label3); }

/* превью Telegram: название канала сверху, ровные скругления */
.tg-bubble { border-radius: 16px; }
.tg-bubble .chan.top { padding: 8px 12px 6px; }
.tg-bubble .chan.top + .tg-docs { padding-top: 2px; }

/* панель зума: без размытия под ней — оно перерисовывалось на каждом кадре и давало рывки */
.lb-bar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: rgba(40,40,42,.92) !important; }
.lb-bar .lb-pct { font-variant-numeric: tabular-nums; }
.ap-add { width: 52px; height: 52px; border-radius: 10px; background: var(--fill); color: var(--blue); display: grid; place-items: center; }
.ap-add svg { width: 20px; height: 20px; }
.sys-msg.reply { cursor: pointer; align-items: stretch; text-align: left; min-width: 60%; }
.sys-msg.reply > span, .sys-msg.reply > small { text-align: center; }
.sys-quote { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 6px; margin-bottom: 4px; border-left: 3px solid var(--blue); border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 8%, transparent); color: var(--label); font-size: 12px; }
.sys-quote i { width: 30px; height: 30px; border-radius: 6px; flex: none; background: var(--fill) center/cover; }
.sys-quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes kpiFlash { 0%, 60% { box-shadow: 0 0 0 3px var(--blue); } 100% { box-shadow: 0 0 0 0 transparent; } }
.msg.flash .bubble { animation: kpiFlash 1.4s ease-out; }

/* главная: спокойное состояние — одной строкой; критичное — заметнее */
.calm { display: flex; align-items: center; gap: 8px; margin: 18px 32px 0; font-size: 15px; color: var(--green); font-weight: 500; }
.calm svg { width: 16px; height: 16px; }
.group-header.hot { color: var(--red); font-weight: 600; }
.group.alert-group { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--red) 35%, transparent), var(--glass-shadow, none); }
.cell.show-all { justify-content: center; }
.cell.show-all span { margin: 0 auto; }

/* план: плотнее шапка — переключатели, месяц и лента идут без лишних зазоров */
.seg-wrap.plan-modes { margin-top: 0; }
.plan-modes + .week-head { margin-top: 0; }
.week-head .arrows button { height: 36px; }
.day-meter .dm-label em { font-style: normal; font-weight: 500; color: var(--label2); }
.b-next { margin-top: 4px; font-size: 13px; color: var(--blue); font-weight: 500; }

/* медиатека: все значки на одной полупрозрачной подложке — читаются на светлом и пёстром */
.grid3 .ph .tag.icon, .vbadge, .abadge { background: rgba(0,0,0,.55) !important; color: #fff; box-shadow: 0 0 0 .5px rgba(255,255,255,.18); }
.grid3 .ph .tag.used.icon { color: #5ee37f; }
.grid3 .ph .tag.plan.icon { color: #7cc2ff; }
.abadge { border-radius: 10px; }
.cell .rate-badge { min-width: 46px; height: 36px; font-size: 17px; border-radius: 12px; }
.week-head .month { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 360px) { .week-head .month { font-size: 18px; } .week-head .arrows .today-btn { font-size: 15px; padding: 0 4px; } }
.day-header { gap: 8px; }
.day-header .day-meter { flex: none; }
.day-meter .dm-label em { color: var(--green); }

/* зарплата: платёжка */
.slip .slip-total { border-top: .5px solid var(--sep); font-size: 17px; }
.slip .slip-total b { font-weight: 700; }
.slip.paid .slip-total b:last-child { color: var(--green); }
.cell.action.red-text, .cell.action.red-text span { color: var(--red); }
.slip .cell.action svg { width: 18px; height: 18px; }
#bn-amount { color: var(--label); }

/* ---------- нижняя часть экрана: одни переменные для таббара, поля ввода и клавиатуры ---------- */
:root { --tabbar-h: 68px; --tabbar-gap: 10px; --composer-h: 64px; --kb: 0px; }
#app { padding-bottom: calc(var(--tabbar-h) + var(--tabbar-gap) + 24px + var(--safe-b)); }
#app.no-tabbar { padding-bottom: calc(40px + var(--safe-b)); }
#app.with-composer { padding-bottom: calc(var(--composer-h) + 32px + var(--safe-b) + var(--kb)); }
.tabbar { bottom: calc(var(--tabbar-gap) + var(--safe-b)); }
.composer.above-tabbar { bottom: calc(var(--tabbar-h) + var(--tabbar-gap) + var(--safe-b)); }
/* клавиатура открыта: таббар прячем, поле ввода — сразу над клавиатурой */
body.kb-open .tabbar { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); }
body.kb-open .composer, body.kb-open .composer.above-tabbar { bottom: var(--kb); padding-bottom: 8px; }

/* ---------- заголовок навбара: предсказуемое многоточие, не наезжает на кнопки ---------- */
.nav-title { max-width: calc(100vw - 200px); min-width: 0; }
@media (max-width: 360px) { .nav-title { max-width: calc(100vw - 170px); font-size: 16px; } }

/* ---------- зоны нажатия: видимый размер прежний, сенсорная цель ~44×44 ---------- */
/* у абсолютно позиционированных кнопок (крестик и стрелка на превью) position не трогаем — ::after и так отсчитывается от них */
.desc-block .icon-btn, .msg-ctl button, .kb.plain, .stepper button, .lb-bar button { position: relative; }
.media-strip .ms .x::after, .media-strip .ms .mv::after, .desc-block .icon-btn::after, .ap-ph button::after, .ap-file button::after,
.attach-chip button::after { content: ""; position: absolute; inset: -10px; }
.msg-ctl button::after, .kb.plain::after { content: ""; position: absolute; inset: -8px -4px; }

/* ---------- вторичные подписи: важное — в две строки, короткие превью — одной ---------- */
.cell-sub.two { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#app.tabbar-composer { padding-bottom: calc(var(--tabbar-h) + var(--tabbar-gap) + var(--composer-h) + 48px + var(--safe-b) + var(--kb)); }
.dup-th { width: 40px; height: 40px; border-radius: 8px; flex: none; background: var(--fill) center/cover; }
.over-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: 700; color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); vertical-align: 1px; }

/* KPI: решение — два равных больших ряда; уточнение — светлая таблетка */
.kb-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 320px; }
.kb-row.two .kb { height: 40px; justify-content: center; font-size: 15px; }
.msg.me .kb-row { justify-content: flex-end; }
.msg.me .kb-row.two { margin-left: auto; }
.kb.plain-pill { background: color-mix(in srgb, var(--orange) 14%, transparent); color: color-mix(in srgb, var(--orange) 85%, var(--label)); box-shadow: none; }
.pill.yellow { background: color-mix(in srgb, #ffcc00 22%, transparent); color: color-mix(in srgb, var(--orange) 85%, var(--label)); }

/* «хвостик» сообщения, как в Telegram: острый угол со стороны отправителя — везде, где переписка */
.tg-bubble { border-radius: 16px; }
.comment .bubble { border-radius: 18px 18px 18px 6px; }
.comment.me .bubble { border-radius: 18px 18px 6px 18px; }
.msg .bubble { border-radius: 20px 20px 20px 6px; }
.msg.me .bubble { border-radius: 20px 20px 6px 20px; }
.assign-btn { flex: none; height: 32px; }
.nodate-call { width: calc(100% - 32px); text-align: left; margin: 8px 16px 0; }
/* строка с датой — переход к посту в плане */
.b-open { display: block; width: 100%; text-align: left; margin: 2px -6px 0; padding: 2px 6px 4px; border-radius: 10px; }
.b-open:active { background: var(--fill); }
.b-open .b-when { margin-top: 4px; }
.b-chev { margin-left: auto; display: inline-flex; color: var(--label3); }
.b-chev svg { width: 7px; height: 12px; }
.b-when { width: 100%; }

/* ===================== ПК и большие экраны ===================== */
/* наведение мышью — только там, где есть мышь (на телефоне подсветка «залипает») */
@media (hover: hover) and (pointer: fine) {
  .cell.tap:hover, button.cell:hover, .asheet .opt:hover, .ms:hover, .att-file:hover, .b-open:hover { background-color: var(--fill2); }
  .nav-btn:hover, .kb:hover, .btn:hover, .pill[data-act]:hover, .seg button:not(.on):hover { filter: brightness(.96); }
  .tabbar button:hover .lbl, .tabbar button:hover svg { color: var(--blue); }
  .grid3 .ph:hover { filter: brightness(1.06); }
  button, [data-act] { cursor: pointer; }
  /* тонкие полосы прокрутки вместо системных толстых */
  * { scrollbar-width: thin; scrollbar-color: var(--fill) transparent; }
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-thumb { background: var(--fill); border-radius: 8px; }
}
/* широкое окно (Telegram Desktop развёрнут, браузер): меню и диалоги — по центру, а не снизу */
@media (min-width: 760px) {
  .asheet { top: 50%; bottom: auto; transform: translateY(-46%) scale(.97); opacity: 0; transition: transform .25s, opacity .2s; }
  #overlay.show .asheet { transform: translateY(-50%); opacity: 1; }
  .grid3 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; padding: 0 16px; }
  .grid3 .ph { border-radius: 8px; }
  .tiles.three { gap: 12px; }
  .msg .bubble.photo { width: 340px; }
  .att-grid { max-width: 340px; }
  .large-title { font-size: 38px; line-height: 46px; }
}
@media (min-width: 1100px) {
  #app { max-width: 820px; }
  .composer form { max-width: 820px; }
}
/* KPI-чат: после кнопок под карточкой — отступ, чтобы следующее сообщение не прилипало */
.msg .kb-row:last-child { margin-bottom: 12px; }
.chat .sys-msg { margin: 12px auto; }
/* «Обсуждение · N ›» внутри карточки публикации */
.b-discuss { display: flex; align-items: center; gap: 6px; width: calc(100% + 12px); margin: 8px -6px 0; padding: 8px 6px; border-top: .5px solid var(--sep);
  color: var(--blue); font-size: 14px; font-weight: 500; text-align: left; }
.b-discuss svg { width: 15px; height: 15px; }
.b-discuss .b-chev { margin-left: auto; }
.b-discuss:active { background: var(--fill); }

/* KPI-чат: больше воздуха; карточки публикаций и превью поста — скруглены со всех сторон, «хвостик» только у текстовых сообщений */
.chat { gap: 12px; }
.msg .bubble.photo, .msg.me .bubble.photo { border-radius: 20px; }
.tg-bubble { border-radius: 16px; }
.chat .sys-msg { margin: 6px auto; }
.msg .kb-row:last-child { margin-bottom: 6px; }

/* KPI-чат: единый ритм — 12 между любыми элементами ленты, 8 от карточки до кнопок и между кнопками */
.chat { gap: 12px; }
.chat > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.chat .sys-msg { margin-left: auto !important; margin-right: auto !important; }
.msg .kb-row { margin-top: 8px; margin-bottom: 0; gap: 8px; }
.msg .kb-row + .kb-row { margin-top: 8px; }
.msg .kb-row:last-child { margin-bottom: 0; }
.kb-row.two { gap: 8px; }

/* ===================== аудит интерфейса: контраст, зоны нажатия, единые размеры ===================== */
/* светлая тема: системные оранжевый и зелёный на белом читаются плохо (контраст ~2:1) — для текста берём «чернильные» оттенки */
:root { --orange-ink: #C25700; --green-ink: #1F8A3B; }
:root[data-theme="dark"] { --orange-ink: var(--orange); --green-ink: var(--green); }
.c-orange, .pill.orange, .st-review, .day-meter.mid .dm-label, .kb.plain-pill, .b-review.yellow b, .rate-badge.yellow, .pill.yellow { color: var(--orange-ink) !important; }
.c-green, .pill.green, .day-meter.ok .dm-label, .rate-badge.green, .over-tag, .calm, .slip.paid .slip-total b:last-child { color: var(--green-ink) !important; }
/* таббар: подписи неактивных вкладок — контрастнее */
.tabbar button:not(.on) { color: #6E6E73; }
:root[data-theme="dark"] .tabbar button:not(.on) { color: #A1A1A6; }
/* поля ввода внутри строк — высота цели не меньше 32 px */
.cell input.cell-input, .cell textarea.cell-input { min-height: 32px; }
/* «По оценке ⇅», «Показать» и прочие действия в заголовках групп */
.group-header .act { padding: 8px 0 8px 12px; margin: -8px 0; }
/* кружок «выполнено» у задачи: 24 px видно, нажимать можно шире */
[data-act="toggleTaskDone"] { position: relative; }
[data-act="toggleTaskDone"]::after { content: ""; position: absolute; inset: -10px; }
.gapday .n { color: var(--orange-ink) !important; }
/* кнопки навбара не сжимаются — текст «Список», «Готово» не обрезается; ширина уходит у заголовка */
.nav-btn { flex: none; }
/* боковые колонки навбара не уже своих кнопок, заголовок сжимается с многоточием */
.nav { grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr); }
.nav-title { min-width: 0; }
/* ссылка на другой пост в плашке: название, ниже — дата, без висящей точки */
.callout-link { display: block; text-align: left; font-size: 15px; line-height: 1.35; }
.callout-when { display: block; color: var(--label2); font-size: 13px; margin-top: 2px; }
.attach-chip button { position: relative; }
/* заголовок карточки (задача, пост, идея): длинный — мельче, чтобы не занимать пол-экрана */
.large-title.detail-title { font-size: 26px; line-height: 32px; margin: 12px 0; }
.large-title.detail-title.long, .post-title-input.long { font-size: 20px; line-height: 26px; }
/* ряд «Принять / Отклонить» — ровно по ширине карточки над ним */
.msg:has(.bubble.photo) .kb-row.two { width: min(300px, 76vw); max-width: none; }
@media (min-width: 760px) { .msg:has(.bubble.photo) .kb-row.two { width: 340px; } }
/* пары «подпись число» в плитке: переносятся целиком, без висящих точек-разделителей */
.tile .facts { display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 0; }
.tile .facts span { white-space: nowrap; }
/* плитки-кнопки: содержимое прижато к верху, заголовки соседних плиток на одной линии */
button.tile { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; text-align: left; }
/* «Скачать» в просмотре фото/видео — слева сверху, напротив «Закрыть» */
.lightbox .close.dl { right: auto; left: 12px; }
.lightbox .close.dl svg { width: 18px; height: 18px; }

/* экран фото/видео: шапка сплошная, без дымки поверх снимка */
/* действия под фото — как в «Поделиться» iOS: иконка и подпись */
.media-actions { display: flex; justify-content: center; gap: 8px; padding: 12px 16px 4px; }
.media-actions button { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px;
  background: var(--bg2); color: var(--blue); font-size: 12px; font-weight: 500; box-shadow: var(--glass-edge, none); }
.media-actions button svg { width: 22px; height: 22px; }
.media-actions button.red { color: var(--red); }
.media-actions button:active { background: var(--fill); }

/* разделители в карточках: отступ и справа, как в iOS 26 — линия не упирается в край карточки */
.cell + .cell::before, .ai-issue::before { right: 18px; border-top-color: color-mix(in srgb, var(--sep) 70%, transparent); }
/* в группе, где строки разные (пост с миниатюрой + пустой слот), линии с одним отступом — иначе они «скачут» */
.group:has(> .cell.slot):has(> .cell.has-thumb) > .cell { --inset: 18px !important; }
/* «Показать все / Свернуть» под строками с иконками — линия с тем же отступом, что и у строк */
.group:has(> .cell.has-icon) > .cell.show-all, .group:has(> .cell.has-icon) > .cell.action { --inset: 59px; }

/* фото на экране просмотра — во всю ширину, уходит под шапку; по бокам размытая копия снимка вместо чёрных полос.
   Шапка над фото — только стеклянные кнопки, без полосы; стекло-полоса появляется, когда фото уехало под неё */
.hero-photo { position: relative; background: #111; margin: calc(-64px - var(--safe-t)) 0 0; overflow: hidden; display: grid; place-items: center;
  min-height: calc(220px + var(--safe-t)); max-height: 66vh; padding-top: calc(64px + var(--safe-t)); cursor: zoom-in; }
.hero-photo .hero-bg { position: absolute; inset: -40px; background: center/cover; filter: blur(28px) saturate(140%) brightness(.8); transform: scale(1.1); }
.hero-photo img { position: relative; max-width: 100%; max-height: calc(66vh - 64px - var(--safe-t)); object-fit: contain; border-radius: 0; box-shadow: none; }
.hero-photo.video { background: #000; border-radius: 0; padding-top: calc(64px + var(--safe-t)); }
.nav.over-photo:not(.scrolled)::before { opacity: 0; }
.nav.over-photo:not(.scrolled) .nav-title { opacity: 0; }
.nav.over-photo { transition: none; }

/* имя файла при отправке оригиналом */
.file-name-row { --inset: 18px; }
.file-name-row .th { width: 40px; height: 40px; border-radius: 8px; flex: none; background: var(--fill) center/cover; }
.file-name-row .cell-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name-row .fn-edit { flex: none; color: var(--blue); display: grid; place-items: center; }
.file-name-row .fn-edit svg { width: 18px; height: 18px; }

/* метка важности у заголовка — в размер заголовка, а не мелкой плашкой */
.imp-pill { height: 26px; padding: 0 10px; font-size: 15px; font-weight: 600; margin-right: 8px; vertical-align: 5px; }
.task-row .imp-pill, .cell .imp-pill { height: 20px; padding: 0 7px; font-size: 12px; margin-right: 4px; vertical-align: 1px; }

/* площадка и режим плана — два отдельных переключателя, между ними нормальный зазор */
.seg-wrap.plan-modes { margin-top: 10px; }

/* месяц: пустой кружок — свободное место под пост в этот день */
.month-grid .days .marks i.free { background: none !important; box-shadow: inset 0 0 0 .75px var(--label3); }
.legend .dot.free { background: none !important; box-shadow: inset 0 0 0 1.2px var(--label3); }


/* медиатека: значки «в плане» / «вышло» снова цветные и крупнее */
.grid3 .ph .tag.icon { width: 26px; height: 26px; border-radius: 13px; left: 6px; bottom: 6px; color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.grid3 .ph .tag.plan.icon { background: rgba(0,122,255,.92) !important; color: #fff; }
.grid3 .ph .tag.used.icon { background: rgba(52,199,89,.92) !important; color: #fff; }
.grid3 .ph .tag.icon svg { width: 14px; height: 14px; }
.hero-photo { padding-top: 0; }
.hero-photo img { max-height: 66vh; width: 100%; }

/* шире колонки приложения фото во всю ширину упирается в края колонки и даёт «стык» —
   там фото становится скруглённой карточкой под обычной шапкой */
@media (min-width: 721px) {
  .hero-photo { margin: 8px 16px 0; border-radius: var(--r-group); min-height: 0; }
  .hero-photo img { width: auto; max-width: 100%; max-height: 60vh; }
  .hero-photo.video { padding-top: 0; }
  .nav.over-photo:not(.scrolled)::before { opacity: 1; }
  .nav.over-photo:not(.scrolled) .nav-title { opacity: 1; }
}

/* стекло шапки: плавно по прокрутке и на всю ширину окна — без жёсткого края у колонки на ПК */
.nav::before, .nav.scrolled::before, .nav.solid::before, .nav.over-photo:not(.scrolled)::before {
  opacity: var(--nav-p, 0); transition: none; left: 50%; right: auto; width: 100vw; transform: translateX(-50%); }
@media (min-width: 721px) { .nav.over-photo:not(.scrolled)::before { opacity: var(--nav-p, 0); } }
.bn-cur { font-size: 20px; font-weight: 600; color: var(--label2); margin-left: 4px; flex: none; }
.bn-cur { margin-left: 2px; }
.slip .slip-total { border-top: none; }   /* линию даёт общий разделитель строк — иначе получалась двойная */

/* KPI: Принять / Отклонить / Уточнить / Изменить текст — одна сетка, кнопки одного размера */
.kb-row.two .kb { height: 40px; padding: 0 10px; justify-content: center; font-size: 15px; font-weight: 600; min-width: 0; }
.kb-row.two .kb.plain { background: var(--fill); color: var(--blue); box-shadow: none; }
.kb-row.two .kb.plain.red { color: var(--red); }
.kb-row.two .kb:only-child { grid-column: 1 / -1; }
.kb-row.two + .kb-row.two { margin-top: 8px; }
.kb-row .kb { white-space: nowrap; }

/* шапка: одинаковая плотность на всех экранах — и над светлыми списками, и над тёмными фото медиатеки.
   Плотнее подложка и короче растушёвка снизу, сильнее размытие: контрастные снимки под ней не просвечивают */
.nav::before {
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 97%, transparent) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 70%, transparent 100%);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  -webkit-mask-image: linear-gradient(to bottom, #000 76%, transparent); mask-image: linear-gradient(to bottom, #000 76%, transparent); }

/* решение по посту из KPI — одна строка во всю ширину */
.kb-row.decide { max-width: none; margin: 0; }
.kb-row.decide.three { grid-template-columns: repeat(3, 1fr); }
.kb-row.decide.three .kb { padding: 0 6px; gap: 4px; font-size: 14px; }
@media (max-width: 340px) { .kb-row.decide.three .kb svg { display: none; } }

/* залитые кнопки (Принять, Назначить) — без светлой стеклянной обводки: на цвете она читалась как съехавший край */
.kb.green, .kb.blue { box-shadow: 0 2px 8px rgba(0,0,0,.10); }

/* ответы в чате KPI: цитата в пузыре и полоска над полем ввода */
.b-quote { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; text-align: left; margin: 0 0 6px; padding: 5px 8px 5px 10px;
  border-radius: 10px; background: color-mix(in srgb, var(--blue) 10%, transparent); box-shadow: inset 3px 0 0 var(--blue); cursor: pointer; }
.msg.me .bubble:not(.photo) .b-quote { background: rgba(255,255,255,.2); box-shadow: inset 3px 0 0 rgba(255,255,255,.85); }
.b-quote i, .reply-bar i { width: 32px; height: 32px; border-radius: 6px; flex: none; background: var(--fill) center/cover; }
.b-quote span, .reply-bar span { min-width: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.25; }
.b-quote span, .reply-bar span { overflow: hidden; }
.b-quote b, .reply-bar b { font-weight: 600; color: var(--blue); }
.msg.me .bubble:not(.photo) .b-quote b { color: #fff; }
.b-quote span { white-space: nowrap; text-overflow: ellipsis; }
.b-quote span > *, .reply-bar span > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; margin: 0 0 6px; border-radius: 12px; background: color-mix(in srgb, var(--blue) 8%, transparent); }
.reply-bar > svg { width: 18px; height: 18px; color: var(--blue); flex: none; }
.reply-bar span { flex: 1; white-space: nowrap; }
.reply-bar button { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--label2); flex: none; }
.reply-bar button svg { width: 14px; height: 14px; }
.chat [data-reply] { -webkit-touch-callout: none; }
.tg-preview { padding: 10px; }   /* рамка вокруг «как в Telegram» — одинаковая со всех сторон */
.reply-bar { background: var(--bg2); box-shadow: inset 3px 0 0 var(--blue), 0 1px 6px rgba(0,0,0,.08); }

/* карточка KPI: текст отдельно, служебное (дата, «дальше», статус) — под тонкой линией */
.b-info { margin-top: 10px; padding-top: 8px; border-top: .5px solid var(--sep); }
.b-info .b-when { margin-top: 0; }
.kb-row.decide + .kb-row.decide { margin-top: 8px; }

/* «Проверка» одного цвета везде: точка в календаре, легенда и подпись статуса */
:root { --orange-ink: #E07800; }

/* переключатели: ячейки строго равной ширины — выделение (жирный шрифт) не сдвигает соседей */
.seg button { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* шапка при прокрутке: простой сплошной прямоугольник цвета фона и серая линия снизу во всю ширину окна —
   без размытия и растушёвки */
.nav::before, .nav.scrolled::before, .nav.solid::before, .nav.over-photo:not(.scrolled)::before {
  top: 0; bottom: 0; background: var(--bg); box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--sep) 55%, transparent);
  -webkit-backdrop-filter: none; backdrop-filter: none; -webkit-mask-image: none; mask-image: none; }

/* разделители строк: ровно 1px и светлее — полупиксельная линия на дробных координатах выглядела то чёткой,
   то размытой, отсюда «кривизна» */
.cell + .cell::before, .ai-issue::before, .asheet .opt::before { border-top-width: 1px; border-top-color: color-mix(in srgb, var(--sep) 42%, transparent); }
.b-info, .orig-toggle, .slip .slip-total, .b-discuss, .editor-tools { border-top-width: 1px !important; border-top-color: color-mix(in srgb, var(--sep) 42%, transparent) !important; }

/* шапка выше и заголовок крупнее; тень у кнопок шапки ровная со всех сторон — кнопка не «проваливается» вниз */
.nav { height: calc(64px + var(--safe-t)); }
.nav-title { font-size: 19px; font-weight: 600; letter-spacing: -.3px; }
.nav .nav-btn { box-shadow: var(--glass-edge), 0 1px 8px rgba(0,0,0,.09); }
:root[data-theme="dark"] .nav .nav-btn { box-shadow: var(--glass-edge), 0 1px 8px rgba(0,0,0,.35); }

/* разделители строк: от левого края содержимого (иконки, миниатюры) до правого (значения, стрелки) — одинаково везде */
.group > .cell + .cell::before, .group .cell + .cell::before { left: 18px !important; right: 18px !important; }


/* факты в плитках плана — ровной сеткой 2×2, одинаково в обеих плитках */
.tile .s.facts { display: grid; grid-template-columns: 1fr; }   /* по строке на факт — в узкой плитке пары не помещались */
.tile .s.facts span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* «Обсуждение»: дата создания справа в той же строке, пустое состояние — одной строкой сразу под ним */
.group-header .meta { margin-left: auto; text-transform: none; color: var(--label3); font-size: 13px; letter-spacing: -.08px; white-space: nowrap; padding-left: 12px; }
.discuss-empty { padding: 0 16px; font-size: 15px; color: var(--label3); letter-spacing: -.24px; }

/* подзаголовки разделов и подписи — на линии содержимого внутри карточек (как в iOS) */
.group-header, .group-footer, .day-header, .legend, .fact-line { padding-left: 34px; padding-right: 34px; }
.discuss-empty { padding: 0 34px; }

/* от крупного заголовка до первого раздела — столько же, сколько между разделами */
.group-header.first { margin-top: 16px; }   /* + 8px под заголовком = 24px, как между разделами */
.large-title + .group-header, .large-title + .group-header.first { margin-top: 24px; }   /* отступы сливаются: 24px — как между разделами */


.sys-quote svg { width: 18px; height: 18px; flex: none; color: var(--blue); }   /* иконка поста в строке «поручили пост» */

/* ЕДИНЫЙ размер кнопок действий во всей системе: большие кнопки (.btn) и кнопки решений (Принять / Отклонить /
   Уточнить / Править / Сохранить и выйти / Изменить решение) — одна высота 46px, одно скругление, один шрифт.
   Второстепенные — серая подложка с синим текстом */
.btn, .btn.plain, .kb-row.two .kb, .kb-row.decide .kb { height: 46px; border-radius: 23px; font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.kb-row.decide.three .kb { font-size: 14px; gap: 3px; padding: 0 4px; }
.kb-row.decide.three .kb svg { width: 14px; height: 14px; }
.btn.tinted, .kb-row.two .kb.plain { background: var(--fill); color: var(--blue); box-shadow: none; }
.btn.tinted.red, .kb-row.two .kb.plain.red { color: var(--red); }
.btn { box-shadow: 0 2px 8px rgba(0,0,0,.10); }
.btn.green { box-shadow: 0 2px 8px rgba(0,0,0,.10); }
.btn.plain { box-shadow: none; }
.btns { gap: 8px; }
.btns .kb-row.decide { margin: 0; }
.btns .kb-row.decide + .kb-row.decide { margin-top: 0; }
.kb-row.two, .kb-row.decide { gap: 8px; }
.kb-row.two .kb:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* нечётная последняя кнопка — во всю ширину */

/* площадка в карточке KPI и выбор её при отправке */
.b-plat { font-weight: 600; }
.b-plat.tg { color: var(--blue); }
.b-plat.tt { color: var(--pink); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* никаких «голых» текстовых кнопок среди действий — все таблетками одного вида */
.btn.plain { background: var(--fill); color: var(--blue); font-weight: 600; height: 46px; }
.btn.plain.red, .btn.plain.red-text { color: var(--red); }
/* «Изменить решение» в чате KPI — всегда отдельной строкой во всю ширину: в половину не помещается */
.kb-row.two .kb[data-act="kpiChange"] { grid-column: 1 / -1; }
.kb-row.two .kb { min-width: 0; }
.kb-row.two .kb[data-act="assignDate"] { grid-column: 1 / -1; }   /* «Назначить дату» — главное действие, во всю ширину */
.kb-row.two .kb[data-act="kpiEditItem"] { grid-column: 1 / -1; }   /* «Править» — во всю ширину, как «Изменить решение» */
.kb-row.two .kb[data-act="kpiReview"][data-s="clarify"] { grid-column: 1 / -1; }   /* и «Уточнить» над ним — тоже целиком, без пустой половины */
.kb-row.decide.three .kb { grid-column: auto !important; }   /* в ряду из трёх — все три в одну строку */
/* цитата в ответе: длинный текст обрезается многоточием */
.b-quote .q-t, .reply-bar .q-t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.b-quote > span, .reply-bar > span { min-width: 0; flex: 1; }
.chat .sys-msg.reply { width: 86%; max-width: 86%; min-width: 0; box-sizing: border-box; }   /* служебные строки-ответы — одной ширины, не по длине текста */

/* нагрузка на неделе: слово-оценка справа и полоска того же цвета по общей шкале (12 дел = под завязку) */
.load-head { display: flex; align-items: center; gap: 8px; }
.load-head .cell-title { flex: 1; min-width: 0; }
.load-word { font-size: 13px; font-weight: 600; flex: none; }
.load-word.free { color: var(--label3); } .load-word.ok { color: var(--green-ink); } .load-word.hot { color: var(--orange-ink); } .load-word.over { color: var(--red); }
.load-bar i.free { background: var(--label3); } .load-bar i.ok { background: var(--green); } .load-bar i.hot { background: var(--orange); } .load-bar i.over { background: var(--red); }

/* заглушка без фото — плотный серый, а не полупрозрачный (иначе линии значка темнеют там, где пересекаются) */
.thumb.ph { color: #AEAEB2; }
:root[data-theme="dark"] .thumb.ph { color: #636366; }

/* плитка «Выполнение плана»: крупная цифра на сегодня, полоска, ниже — ровная табличка мелким */
.plan-tile .pt-big { font: 700 30px/1.1 var(--font-display); letter-spacing: -.5px; margin-top: 6px; }
.plan-tile .pt-big span { font-size: 18px; font-weight: 600; color: var(--label2); letter-spacing: 0; }
.plan-tile .pt-cap { font-size: 12px; color: var(--label2); margin-top: 1px; }
.plan-tile .pt-track { display: flex; gap: 3px; margin: 8px 0 2px; }
.plan-tile .pt-track i { flex: 1; height: 5px; border-radius: 3px; background: var(--fill2); max-width: 28px; }
.plan-tile .pt-track i.on { background: var(--blue); }
.plan-tile .pt-track i.out { background: var(--green); }
.plan-tile.zero .pt-big { color: var(--red); }
.plan-tile .pt-rows { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.plan-tile .pt-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.plan-tile .pt-rows span { color: var(--label2); }
.plan-tile .pt-rows b { font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; }
.plan-tile .pt-rows b span { font-weight: 400; color: var(--label3); }
.plan-tile .pt-rows .sep { margin-top: 4px; padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--sep) 42%, transparent); }

/* неделя: сегодня — всегда красный кружок; выбранный (отфильтрованный) день — чёрная обводка */
.week-strip .today .dn { background: none; color: var(--red); font-weight: 600; box-shadow: none; }        /* сегодня — просто красное число */
.week-strip .sel .dn { background: var(--label); color: var(--bg2); font-weight: 600; box-shadow: none; }      /* выбранный день — чёрный кружок, белое число */
.week-strip .today.sel .dn { background: var(--red); color: #fff; box-shadow: none; }                          /* выбрали сегодня — красный кружок, белое число */

/* легенда месяца: «свободное место» — ровное кольцо того же размера, что точки, по центру строки */
.legend .dot.free { box-sizing: border-box; width: 8px; height: 8px; background: none !important; box-shadow: none; border: 1.25px solid var(--label3); }
.month-grid .days .marks i.free { box-sizing: border-box; background: none !important; box-shadow: none; border: 1px solid var(--label3); }


/* iOS: дата/время в окне ввода — без системного вида, значение по центру */
.alert input[type="datetime-local"], .alert input[type="date"], .alert input[type="time"] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%;
  line-height: 40px; text-align: center; color: var(--label); font-size: 16px;
}
.alert input[type="datetime-local"]::-webkit-date-and-time-value,
.alert input[type="date"]::-webkit-date-and-time-value,
.alert input[type="time"]::-webkit-date-and-time-value { text-align: center; margin: 0; min-height: 40px; line-height: 40px; }
.cell input[type="datetime-local"], .cell input[type="date"], .cell input[type="time"] { -webkit-appearance: none; appearance: none; min-width: 0; flex: 0 0 auto; }
.cell input[type="date"]::-webkit-date-and-time-value, .cell input[type="time"]::-webkit-date-and-time-value, .cell input[type="datetime-local"]::-webkit-date-and-time-value { text-align: right; margin: 0; }

/* заголовок шапки проявляется вместе с фоном (--nav-t из onScroll) и чуть всплывает снизу; на телефоне крупнее */
.nav .nav-title, .nav.scrolled .nav-title, .nav.solid .nav-title, .nav.over-photo:not(.scrolled) .nav-title {
  opacity: var(--nav-t, 0); transform: translateY(calc((1 - var(--nav-t, 0)) * 6px)); transition: none; }
.nav-title { font-size: 20px; letter-spacing: -.35px; }
@media (max-width: 720px) { .nav-title { font-size: 21px; } }
@media (max-width: 360px) { .nav-title { font-size: 19px; } }

/* текст поста и комментарий: стартуют с одной строки, дальше растут по мере набора */
.editor, .rte.editor { min-height: 48px; }
#np-notes { min-height: 0; overflow: hidden; }

/* идеи: метка типа (Контент / Улучшение) и статус в работе — в одну строку */
.pill.teal { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }
.idea-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* вход на сайте: код, который надо сверить с ботом */
.login-code { font-size: 40px; font-weight: 700; letter-spacing: 10px; margin: 14px 0 12px; font-variant-numeric: tabular-nums; color: var(--label); }

/* слот, время которого прошло без публикации */
.cell.slot.missed .time-col { color: var(--label3); }
.slot-missed { color: var(--red); font-size: 15px; font-weight: 500; }

/* карандаш у дня плана: свои норма и слоты этого числа */
.day-header .dh-t { display: inline-flex; align-items: center; gap: 6px; }
.day-edit { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 6px; margin-left: 2px; border-radius: 11px; color: var(--label3); }
.day-edit svg { width: 14px; height: 14px; }
.day-edit:active { background: var(--fill); }
.day-edit.own { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.day-edit span { font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; }

/* у имени сотрудника: выходной / отпуск сегодня */
.u-mark { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 6px; border-radius: 50%; vertical-align: -3px; flex: none; }
.u-mark svg { width: 13px; height: 13px; }
.u-mark.off { color: var(--indigo); background: color-mix(in srgb, var(--indigo) 13%, transparent); }
.u-mark.vac { color: var(--teal); background: color-mix(in srgb, var(--teal) 15%, transparent); }
h2 .u-mark { width: 26px; height: 26px; vertical-align: 2px; }
h2 .u-mark svg { width: 16px; height: 16px; }
/* «Не вышло» сегодня — так же приглушённо, как в прошедших днях */
.cell.slot.missed { opacity: .6; }
.past-day .cell.slot.missed { opacity: .6; }
/* «Изменить» у дня — читаемой кнопкой, а не одной иконкой */
.day-edit { color: var(--blue); background: color-mix(in srgb, var(--blue) 9%, transparent); padding: 0 8px 0 7px; }
.day-edit span { font-size: 12px; }
.day-edit.own { background: color-mix(in srgb, var(--blue) 16%, transparent); }
.day-header .dh-t { white-space: nowrap; min-width: 0; }
/* «Изменить только этот день» — строкой внизу дня */
.day-edit-row svg { width: 20px; height: 20px; }
.day-edit-row span { font-size: 15px; }
.own-tag { margin-left: 6px; padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0;
  color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }

/* серые иконки — сплошным цветом: полупрозрачный --label3 темнел там, где линии иконки пересекаются */
:root { --icon3: #C4C4C9; --icon2: #8A8A8E; }
:root[data-theme="dark"] { --icon3: #545458; --icon2: #98989F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --icon3: #545458; --icon2: #98989F; } }
.empty .ic, .center-screen .ic svg, .thumb.ph, .desc-block .icon-btn, .b-chev, .slot-add svg, .nav-btn:disabled svg,
.cell.slot .time-col svg, .week-strip svg, .chev, svg.chev { color: var(--icon3); }

/* в плане: кто в этот день отдыхает */
.cell.away-row { flex-wrap: wrap; gap: 6px; padding-top: 9px; padding-bottom: 9px; }
.away-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px 0 7px; border-radius: 12px; font-size: 13px; font-weight: 500; }
.away-chip svg { width: 14px; height: 14px; }
.away-chip.off { color: var(--indigo); background: color-mix(in srgb, var(--indigo) 12%, transparent); }
.away-chip.vac { color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, transparent); }
/* отпуск — зелёная пальма */
.u-mark.vac, .away-chip.vac { color: var(--green-ink, var(--green)); background: color-mix(in srgb, var(--green) 15%, transparent); }

/* гость: только просмотр — всё, что меняет данные, спрятано (сервер всё равно не даст) */
.guest-banner { position: relative; text-align: center; font-size: 12px; font-weight: 600; padding: calc(4px + var(--safe-t)) 12px 4px;
  color: var(--indigo); background: color-mix(in srgb, var(--indigo) 12%, var(--bg)); }
body.guest .composer, body.guest .nav-right .nav-btn:not([data-act="openSearch"]):not([data-act="back"]),
body.guest .cell.action, body.guest .btns:not(:has([data-act="deviceLogout"])), body.guest .stepper button, body.guest .slot-add, body.guest [data-act="newPostAt"],
body.guest [data-act="newPostNoTime"], body.guest .kb-row, body.guest [data-act="taskToggle"], body.guest .day-edit-row { display: none !important; }
body.guest .cell.slot { pointer-events: none; }

/* идеи: метка типа — серая с иконкой */
.pill.type-pill { background: var(--fill); color: var(--label2); gap: 4px; }
.pill.type-pill svg { width: 12px; height: 12px; }
.idea-pills .pill { margin-right: 0; }
.idea-pills .pill { height: 20px; padding: 0 7px; font-size: 12px; vertical-align: 1px; }

/* вышел раньше плана: плановое время зачёркнуто, под ним фактическое */
.time-col .tc-was { display: block; text-decoration: line-through; color: var(--label3); font-size: 15px; line-height: 18px; }
.time-col .tc-now { display: block; line-height: 18px; }


/* вышедший пост в плане — приглушён, как всё прошедшее */
.cell.post-out { opacity: .6; }

/* время в плане: прошедшее (вышло, не вышло, прошлые дни) — светлое; то, что только планируется, — обычным серым */
.cell.slot:not(.missed) .time-col { color: var(--label2); }
.cell.post-out .time-col, .cell.slot.missed .time-col, .past-day .time-col { color: var(--label3); }
