/*
  Кабинет BRO AI в браузере — повторяет приложение BROII для Mac (channel/clients/BroAI/Sources/V3).
  Токены — из V3/Design/V3Tokens.swift и макета channel/clients/design/mac-native/src.html.
  Один радиус карточки (12), один отступ (16), строка 30, текст 13, подпись 11–12, заголовок 15.
  На ширине телефона — раскладка iPhone-версии: вкладки внизу, экраны стопкой.
*/
@font-face { font-family: 'Medeo Sans'; src: url(fonts/MedeoSansVariable.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Medeo Mono'; src: url(fonts/MedeoMonoVariable.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --font: 'Medeo Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Medeo Mono', ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  --r-win: 16px; --r-card: 12px; --r-row: 7px;
  --side-w: 258px; --tb-h: 52px; --page-h: 28px; --page-top: 20px; --col-h: 28px; --bubble-inset: 72px;
  --lime: #C9F24D; --lime-deep: #5F7C0C; --ink: #0B0C0E;
  color-scheme: dark;
}
[data-theme="dark"] {
  --win: #1d1d1f; --side: #262628; --side-line: rgba(255,255,255,.07);
  --bar: rgba(38,38,40,.86);
  --card: #2a2a2c; --card-2: #323235; --well: #19191b; --field: #2c2c2f; --code: #161618;
  --line: rgba(255,255,255,.085); --sep: rgba(255,255,255,.07);
  --t1: rgba(255,255,255,.93); --t2: rgba(235,235,245,.6); --t3: rgba(235,235,245,.34);
  --hover: rgba(255,255,255,.055); --press: rgba(255,255,255,.09); --mute-sel: rgba(255,255,255,.11);
  --track: rgba(255,255,255,.1); --seg: rgba(255,255,255,.06); --seg-on: rgba(255,255,255,.14);
  --green: #30d158; --red: #ff453a; --yellow: #ffd60a; --blue: #0a84ff; --purple: #bf5af2; --teal: #40c8e0;
  --yellow-text: #ffd60a;
  --warn-bg: rgba(255,214,10,.10); --warn-line: rgba(255,214,10,.28);
  --sheet-shadow: 0 24px 70px rgba(0,0,0,.6), 0 0 0 .5px rgba(255,255,255,.14);
  --brand-ii: #C9F24D;
  color-scheme: dark;
}
[data-theme="light"] {
  --win: #ffffff; --side: #f0f0f2; --side-line: rgba(0,0,0,.07);
  --bar: rgba(246,246,248,.9);
  --card: #f6f6f8; --card-2: #ececef; --well: #f3f3f5; --field: #ffffff; --code: #f3f3f5;
  --line: rgba(0,0,0,.08); --sep: rgba(0,0,0,.07);
  --t1: rgba(0,0,0,.86); --t2: rgba(60,60,67,.62); --t3: rgba(60,60,67,.36);
  --hover: rgba(0,0,0,.045); --press: rgba(0,0,0,.08); --mute-sel: rgba(0,0,0,.08);
  --track: rgba(0,0,0,.09); --seg: rgba(0,0,0,.05); --seg-on: #ffffff;
  --green: #28a745; --red: #e5372c; --yellow: #ffc300; --blue: #0a6cff; --purple: #bf5af2; --teal: #40c8e0;
  --yellow-text: rgba(0,0,0,.86);
  --warn-bg: rgba(255,204,0,.16); --warn-line: rgba(255,195,0,.6);
  --sheet-shadow: 0 24px 70px rgba(0,0,0,.28), 0 0 0 .5px rgba(0,0,0,.16);
  --brand-ii: #5F7C0C;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 13px/1.38 var(--font); color: var(--t1); background: var(--win);
  -webkit-font-smoothing: antialiased; overflow: hidden; letter-spacing: -.003em;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--acc-text); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s12 { width: 12px; height: 12px; } svg.i.s14 { width: 14px; height: 14px; } svg.i.s18 { width: 18px; height: 18px; }
svg.i.s20 { width: 20px; height: 20px; } svg.i.s24 { width: 24px; height: 24px; } svg.i.s40 { width: 40px; height: 40px; stroke-width: 1.1; }
.sel { user-select: text; -webkit-user-select: text; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--t2); } .faint { color: var(--t3); }
.num { font-variant-numeric: tabular-nums; }

/* ── Надпись BROII и знак ─────────────────────────────────────────────── */
.lockup { height: 15px; width: auto; display: block; }
.lockup .bx-mark { color: var(--t1); }
.lockup .bx-bro { fill: var(--t1); }
.lockup .bx-ai { fill: var(--brand-ii); }
[data-theme="dark"] .lockup .bx-mark { color: var(--lime); }

/* ── Окно ─────────────────────────────────────────────────────────────── */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--win); }
.tb { height: var(--tb-h); flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 12px; gap: 12px; border-bottom: .5px solid var(--sep); position: relative; z-index: 5; }
.tb .l, .tb .r { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb .r { justify-content: flex-end; }
.tb .c { display: flex; justify-content: center; min-width: 0; }
.tb .ttl { min-width: 0; padding-left: 6px; }
.tb .ttl b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glass { height: 30px; min-width: 30px; padding: 0 10px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--t1);
  background: var(--seg); box-shadow: inset 0 0 0 .5px var(--line); white-space: nowrap; }
.glass:hover { background: var(--seg-on); }
.glass.ico { padding: 0; width: 30px; color: var(--t2); }
.glass.ico:hover { color: var(--t1); }
.glass.group { padding: 0 3px; gap: 0; }
.glass.group > button { width: 28px; height: 26px; border-radius: 13px; display: grid; place-items: center; color: var(--t2); }
.glass.group > button:hover { background: var(--hover); color: var(--t1); }
.glass.group > button.on { color: var(--acc-text); }
.statuscap { font-size: 12px; color: var(--t2); }
.statuscap .lockup { height: 14px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; display: inline-block; }
.dot.off { background: var(--t3); } .dot.bad { background: var(--red); } .dot.warn { background: var(--yellow); } .dot.acc { background: var(--acc); }
.dot.blue { background: var(--blue); }

.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--seg); box-shadow: inset 0 0 0 .5px var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { height: 24px; padding: 0 12px; border-radius: 6px; font-size: 12.5px; color: var(--t1); white-space: nowrap; }
.seg button:hover:not(.on) { background: var(--hover); }
.seg button.on { background: var(--seg-on); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg.small button { height: 22px; padding: 0 10px; font-size: 12px; }

.body { flex: 1; min-height: 0; display: flex; }
.side { width: var(--side-w); flex: none; margin: 8px 0 8px 8px; border-radius: 12px; background: var(--side); box-shadow: inset 0 0 0 .5px var(--side-line);
  display: flex; flex-direction: column; overflow: hidden; transition: width .22s ease, margin .22s ease, opacity .18s; }
#app.noside .side { width: 0; margin-left: 0; opacity: 0; }
.search { margin: 10px 12px 6px; height: 28px; border-radius: 7px; background: var(--field); display: flex; align-items: center; gap: 6px; padding: 0 8px; color: var(--t3); box-shadow: inset 0 0 0 .5px var(--line); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--t1); font-size: 13px; }
.search input::placeholder { color: var(--t3); }
.nav { flex: 1; overflow-y: auto; padding: 0 10px 10px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.sec { font-size: 11px; font-weight: 600; color: var(--t3); padding: 14px 8px 5px; display: flex; align-items: center; gap: 4px; user-select: none; }
.sec .grow { flex: 1; }
.sec .sb { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; color: var(--t3); }
.sec .sb:hover { background: var(--hover); color: var(--t1); }
.sec .sb.plus { color: var(--acc-text); }
.sec .chev { transition: transform .2s; }
.sec.closed .chev { transform: rotate(-90deg); }
.row { min-height: 30px; border-radius: var(--r-row); display: flex; align-items: center; gap: 8px; padding: 0 8px; color: var(--t1); position: relative; cursor: pointer; width: 100%; text-align: left; }
.row > svg.i { color: var(--acc-text); }
.row:hover { background: var(--hover); }
.row.on { background: var(--acc-sel-strong); }
.row .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .badge { font-size: 11px; font-weight: 600; color: var(--t3); font-variant-numeric: tabular-nums; }
.row .folder { width: 18px; height: 15px; flex: none; }
.row.orow { min-height: 40px; }
.row.orow .lbl { display: flex; flex-direction: column; line-height: 1.25; }
.row.orow .lbl small { font-size: 11px; color: var(--t2); overflow: hidden; text-overflow: ellipsis; }
.row.orow.unread .ot { font-weight: 600; }
.row .ox { width: 18px; height: 18px; border-radius: 5px; display: none; place-items: center; color: var(--t2); flex: none; }
.row:hover .ox { display: grid; } .row .ox:hover { background: var(--press); }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 1.6px solid var(--track); border-top-color: var(--acc-text); animation: rot 1s linear infinite; flex: none; display: inline-block; }
.spin.lg { width: 20px; height: 20px; border-width: 2px; }
@keyframes rot { to { transform: rotate(360deg); } }
.side-foot { border-top: .5px solid var(--side-line); padding: 8px 10px 10px; }
.limits { padding: 4px 8px 2px; cursor: pointer; border-radius: 7px; }
.limits:hover { background: var(--hover); }
.limits .hd { font-size: 11px; font-weight: 600; color: var(--t3); display: flex; justify-content: space-between; margin-bottom: 5px; }
.lim { display: grid; grid-template-columns: 64px 1fr 34px; align-items: center; gap: 8px; font-size: 11px; color: var(--t2); height: 19px; font-variant-numeric: tabular-nums; }
.lim span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lim span:last-child { text-align: right; }
/* Подписка в полоске «Лимиты»: имя и тариф слева, окна строками справа (V3LimitsStrip). */
.limsub { display: grid; grid-template-columns: 58px 1fr; gap: 6px; align-items: start; margin-bottom: 5px; }
.limsub .nm { display: flex; flex-direction: column; min-width: 0; font-size: 11px; color: var(--t2); line-height: 1.25; padding-top: 2px; }
.limsub .nm span, .limsub .nm small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.limsub .nm small { font-size: 10px; color: var(--t3); }
.limsub .ws { min-width: 0; font-size: 11px; }
.limsub .ws .faint { display: block; padding-top: 2px; }
.limsub .lim { grid-template-columns: 44px 1fr 30px; gap: 6px; height: 17px; }
.meter { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--green); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.meter.acc i { background: var(--acc); } .meter.blue i { background: var(--blue); } .meter.y i { background: var(--yellow); } .meter.r i { background: var(--red); }
.meter.thin { height: 4px; } .meter.lg { height: 8px; border-radius: 4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.content { flex: 1; min-height: 0; overflow: hidden; display: flex; }
.scroll { flex: 1; overflow-y: auto; min-width: 0; }
.scroll::-webkit-scrollbar { width: 11px; } .scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
.scroll:hover::-webkit-scrollbar-thumb { background-color: var(--track); }
.pad { padding: var(--page-top) var(--page-h) 40px; }
.pad.read { max-width: 1100px; }
.fade-in { animation: fin .2s ease both; }
@keyframes fin { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* Колонки: список + подробности */
.split { display: flex; flex: 1; min-width: 0; min-height: 0; }
.list-col { width: 300px; flex: none; border-right: .5px solid var(--sep); display: flex; flex-direction: column; min-height: 0; }
.list-col.w340 { width: 340px; } .list-col.w380 { width: 380px; }
.list-col .scroll { padding: 0 8px 20px; }
.list-hd { display: flex; align-items: center; gap: 6px; padding: 12px 12px 10px 16px; min-height: 50px; border-bottom: .5px solid var(--sep); }
.list-hd b { font-size: 13px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-hd .ib { width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; color: var(--t2); background: var(--seg); box-shadow: inset 0 0 0 .5px var(--line); }
.list-hd .ib:hover { color: var(--t1); background: var(--seg-on); }
.detail { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.li { display: flex; gap: 10px; padding: 8px 10px; border-radius: 9px; position: relative; cursor: pointer; }
.li + .li::before { content: ''; position: absolute; left: 10px; right: 10px; top: 0; border-top: .5px solid var(--sep); }
.li.on + .li::before, .li.on::before, .li:hover::before, .li:hover + .li::before { display: none; }
.li:hover:not(.on) { background: var(--hover); }
.li.on { background: var(--acc-sel); box-shadow: inset 0 0 0 .5px var(--acc-line); }
.li .lead { width: 14px; padding-top: 4px; display: flex; justify-content: center; flex: none; }
.li .bd { flex: 1; min-width: 0; }
.li .t { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li.unread .t { font-weight: 700; }
.li .sub { font-size: 11.5px; color: var(--t2); display: flex; align-items: center; gap: 5px; margin-top: 1px; white-space: nowrap; overflow: hidden; }
.li .sub .clip { overflow: hidden; text-overflow: ellipsis; }
.li .prev { font-size: 12px; color: var(--t2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.li .when { font-size: 11px; color: var(--t3); flex: none; padding-top: 2px; }
.grp { font-size: 11px; font-weight: 600; color: var(--t3); padding: 14px 10px 4px; display: flex; gap: 6px; align-items: center; }
.grp:first-child { padding-top: 8px; }

/* ── Карточки, сетки, строки ──────────────────────────────────────────── */
h1.big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; }
.lede { color: var(--t2); font-size: 13px; margin: 0 0 18px; }
h2.h { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 28px 0 10px; display: flex; align-items: center; gap: 8px; }
h2.h:first-child { margin-top: 4px; }
h2.h .n { color: var(--t3); font-weight: 600; }
h2.h .more { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--acc-text); }
h3.h { font-size: 13px; font-weight: 700; margin: 20px 4px 8px; } h3.h:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--card); border-radius: var(--r-card); box-shadow: inset 0 0 0 .5px var(--line); padding: 16px 16px; position: relative; min-width: 0; }
.card.click { cursor: pointer; } .card.click:hover { background: var(--card-2); }
.card .ch { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.card .ch .r { margin-left: auto; font-weight: 400; }
.card .cs { color: var(--t2); margin-top: 6px; font-size: 12.5px; line-height: 1.4; }
.card .cf { display: flex; align-items: center; gap: 6px; color: var(--t2); font-size: 12px; margin-top: 12px; }
.card .cf .r { margin-left: auto; color: var(--t3); }
.card.tight { padding: 12px 14px; }
.tag { font-size: 11.5px; font-weight: 500; height: 20px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tag.acc { background: var(--acc-soft); color: var(--acc-text); }
.tag.blue { background: rgba(10,132,255,.16); color: var(--blue); }
.tag.green { background: rgba(48,209,88,.15); color: var(--green); }
.tag.yellow { background: rgba(255,214,10,.16); color: var(--yellow-text); }
.tag.red { background: rgba(255,69,58,.15); color: var(--red); }
.tag.gray { background: var(--hover); color: var(--t2); }
.tag.purple { background: rgba(191,90,242,.16); color: var(--purple); }
.stat .n { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .n.acc { color: var(--acc-text); }
.stat .l { color: var(--t2); margin-top: 6px; font-size: 12px; }
.form { background: var(--card); border-radius: var(--r-card); box-shadow: inset 0 0 0 .5px var(--line); overflow: hidden; }
.fr { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 14px; position: relative; }
.fr + .fr::before { content: ''; position: absolute; top: 0; left: 14px; right: 14px; border-top: .5px solid var(--sep); }
.fr .k { flex: 1; min-width: 0; }
.fr .k b { font-weight: 500; }
.fr .k small { display: block; color: var(--t2); font-size: 12px; margin-top: 1px; }
.fr .v { color: var(--t2); text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fr.click { cursor: pointer; } .fr.click:hover { background: var(--hover); }
.fr .ico { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: #fff; flex: none; }
.fnote { color: var(--t2); font-size: 12px; margin: 8px 14px 0; line-height: 1.45; }
.toggle { width: 38px; height: 22px; border-radius: 11px; background: var(--track); position: relative; flex: none; transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .2s; }
.toggle.on { background: var(--acc); } .toggle.on::after { left: 18px; }
.btn { height: 26px; padding: 0 11px; border-radius: 7px; background: var(--seg); box-shadow: inset 0 0 0 .5px var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; font-size: 13px; }
.btn:hover:not(:disabled) { background: var(--seg-on); }
.btn.prim { background: var(--acc); color: var(--acc-ink); box-shadow: none; font-weight: 600; }
.btn.prim:hover:not(:disabled) { filter: brightness(1.06); background: var(--acc); }
.btn.danger { color: var(--red); }
.btn.lg { height: 34px; padding: 0 16px; font-size: 13.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link { color: var(--acc-text); cursor: pointer; } .link:hover { text-decoration: underline; }
select.popsel, .popsel { height: 26px; padding: 0 26px 0 10px; border-radius: 7px; background: var(--seg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 6.5 8 4l3 2.5M5 9.5 8 12l3-2.5'/%3E%3C/svg%3E") no-repeat right 6px center / 14px; border: 0; box-shadow: inset 0 0 0 .5px var(--line); appearance: none; -webkit-appearance: none; color: var(--t1); font-size: 13px; max-width: 100%; }
.input, .ta { width: 100%; border: 0; outline: 0; background: var(--field); border-radius: 8px; padding: 7px 10px; font-size: 13px; box-shadow: inset 0 0 0 .5px var(--line); }
.input:focus, .ta:focus { box-shadow: inset 0 0 0 .5px var(--line), 0 0 0 3px var(--acc-soft); }
.ta { resize: vertical; min-height: 90px; line-height: 1.45; }
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 12px; font-weight: 600; color: var(--t2); margin: 0 2px 6px; }
.fld > small { display: block; color: var(--t3); font-size: 11.5px; margin: 5px 2px 0; }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--t2); text-align: center; padding: 40px 24px; gap: 6px; min-height: 240px; }
.empty svg.i { color: var(--t3); margin-bottom: 6px; }
.empty b { font-size: 15px; color: var(--t2); font-weight: 700; }
.empty .btn { margin-top: 10px; }
.warnbox { background: var(--warn-bg); box-shadow: inset 0 0 0 .5px var(--warn-line); border-radius: 10px; padding: 10px 14px; display: flex; gap: 10px; align-items: flex-start; }
.warnbox svg.i { color: var(--yellow); margin-top: 1px; }
.errbox { color: var(--red); font-size: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.check .box { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.3px var(--t3); flex: none; margin-top: 1px; display: grid; place-items: center; }
.check.done .box { background: var(--green); box-shadow: none; color: #fff; }
.check.run .box { box-shadow: inset 0 0 0 1.3px var(--acc-text); }
.check.run .box::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--acc-text); }
.check.done .t { color: var(--t2); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: var(--r-card); box-shadow: inset 0 0 0 .5px var(--line); overflow: hidden; }
.table th { text-align: left; font-weight: 600; color: var(--t2); font-size: 12px; padding: 9px 14px; border-bottom: .5px solid var(--sep); }
.table td { padding: 9px 14px; border-bottom: .5px solid var(--sep); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; } .table tr.click:hover td { background: var(--hover); }
.table .num { text-align: right; }
.skel { background: linear-gradient(90deg, var(--hover) 0%, var(--press) 50%, var(--hover) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pfolder { width: 18px; height: 15px; }

/* ── Разговор ─────────────────────────────────────────────────────────── */
.chat-hd { display: flex; align-items: center; gap: 10px; padding: 8px var(--col-h); border-bottom: .5px solid var(--sep); min-height: 50px; }
.chat-hd .ct { font-size: 15px; font-weight: 700; letter-spacing: -.01em; padding: 3px 6px; margin-left: -6px; border-radius: 6px; display: inline-flex; gap: 6px; align-items: center; min-width: 0; flex: 0 1 auto; cursor: pointer; }
.chat-hd .ct span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-hd .ct .pen { width: 22px; height: 22px; border-radius: 11px; background: var(--seg); display: grid; place-items: center; color: var(--t2); flex: none; }
.chat-hd .ct:hover { background: var(--hover); }
.chat-hd input.rename { font-size: 15px; font-weight: 700; border: 0; outline: 0; background: var(--field); border-radius: 6px; padding: 3px 6px; margin-left: -6px; box-shadow: 0 0 0 3px var(--acc-soft); min-width: 0; flex: 1; max-width: 520px; }
.chat-hd .sp { flex: 1; }
.feed { flex: 1; overflow-y: auto; padding: 16px 0 10px; overflow-anchor: none; }
.feed-in { padding: 0 var(--col-h); margin: 0 auto; max-width: 1100px; }
.feed .more-btn { display: flex; justify-content: center; margin: 0 0 14px; }
.msg { margin: 0 0 16px; font-size: 13px; line-height: 1.5; }
.msg.me { display: flex; flex-direction: column; align-items: flex-end; padding-left: var(--bubble-inset); }
.msg.me .bub { background: var(--acc-sel); border-radius: 12px; padding: 8px 12px; max-width: 100%; box-shadow: inset 0 0 0 .5px var(--acc-line); white-space: pre-wrap; word-wrap: break-word; user-select: text; }
.msg.me .bub.pending { opacity: .65; }
.msg .meta { font-family: var(--mono); font-size: 11px; color: var(--t3); margin-top: 4px; }
.msg.me .atts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 6px; }
.msg.ag { user-select: text; }
.msg .worked { font-family: var(--mono); font-size: 11px; color: var(--t3); margin-top: 8px; }
.msg .worked span[title] { cursor: help; }
.md { word-wrap: break-word; overflow-wrap: anywhere; }
.md p { margin: 0 0 9px; } .md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 14px 0 6px; line-height: 1.3; }
.md h1 { font-size: 19px; } .md h2 { font-size: 16px; } .md h3 { font-size: 14px; } .md h4 { font-size: 13px; }
.md ul, .md ol { margin: 4px 0 9px; padding-left: 22px; } .md li { margin: 2px 0; }
.md li.task { list-style: none; margin-left: -22px; display: flex; gap: 8px; align-items: flex-start; }
.md li.task .box { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.3px var(--t3); flex: none; margin-top: 3px; display: grid; place-items: center; }
.md li.task.done .box { background: var(--green); box-shadow: none; color: #fff; } .md li.task.done { color: var(--t2); }
.md code { font-family: var(--mono); font-size: 12px; background: var(--hover); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--code); border-radius: 10px; box-shadow: inset 0 0 0 .5px var(--line); padding: 10px 14px; font: 12px/1.55 var(--mono); overflow-x: auto; margin: 6px 0 10px; position: relative; }
.md pre code { background: none; padding: 0; font-size: inherit; }
.md pre .copy { position: absolute; right: 6px; top: 6px; opacity: 0; }
.md pre:hover .copy { opacity: 1; }
.md blockquote { margin: 0 0 9px; padding: 2px 0 2px 12px; border-left: 3px solid var(--acc); color: var(--t2); }
.md table { border-collapse: separate; border-spacing: 0; margin: 4px 0 12px; background: var(--card); border-radius: 10px; box-shadow: inset 0 0 0 .5px var(--line); overflow: hidden; font-size: 12.5px; display: block; overflow-x: auto; max-width: 100%; }
.md th { text-align: left; color: var(--t2); font-weight: 600; font-size: 12px; padding: 7px 12px; border-bottom: .5px solid var(--sep); }
.md td { padding: 7px 12px; border-bottom: .5px solid var(--sep); vertical-align: top; } .md tr:last-child td { border-bottom: 0; }
.md hr { border: 0; border-top: .5px solid var(--sep); margin: 14px 0; }
.md img { max-width: 100%; border-radius: 8px; }
.md a.fpath { font-family: var(--mono); font-size: 12px; }
.md .fm { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 12px; color: var(--t2); background: var(--card); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; box-shadow: inset 0 0 0 .5px var(--line); }
.md .fm b { font-weight: 500; color: var(--t3); }
.mdv { font-size: 14px; line-height: 1.6; max-width: 900px; }
.mdv h1 { font-size: 26px; letter-spacing: -.02em; margin-top: 0; } .mdv h2 { font-size: 19px; margin-top: 24px; } .mdv h3 { font-size: 15px; }
.mdraw { font: 12px/1.6 var(--mono); white-space: pre-wrap; color: var(--t1); user-select: text; max-width: 1000px; margin: 0; }
.fold { display: inline-flex; align-items: center; gap: 6px; color: var(--t2); font-size: 12px; padding: 3px 8px 3px 2px; border-radius: 6px; margin: 2px 0 6px; cursor: pointer; }
.fold:hover { background: var(--hover); }
.fold .chev { transition: transform .15s; } .fold.open .chev { transform: rotate(90deg); }
.tools { margin: -2px 0 8px 6px; padding-left: 12px; border-left: .5px solid var(--sep); }
.tool { display: flex; align-items: baseline; gap: 8px; color: var(--t2); font-size: 12px; padding: 2px 0; min-width: 0; }
.tool b { font-weight: 600; color: var(--t2); flex: none; }
.tool .arg { font-family: var(--mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t3); }
.tool.err b { color: var(--red); }
.tool-out { font: 11.5px/1.5 var(--mono); color: var(--t2); background: var(--code); border-radius: 8px; padding: 8px 10px; margin: 2px 0 6px; white-space: pre-wrap; max-height: 260px; overflow: auto; }
.think { color: var(--t2); font-size: 12.5px; font-style: italic; white-space: pre-wrap; margin: 0 0 8px; padding-left: 12px; border-left: .5px solid var(--sep); }
.sysline { display: flex; align-items: center; gap: 10px; color: var(--t3); font-size: 11.5px; margin: 6px 0 16px; text-align: center; }
.sysline::before, .sysline::after { content: ''; flex: 1; border-top: .5px solid var(--sep); }
.typing { display: inline-flex; align-items: center; gap: 8px; color: var(--t2); font-size: 12px; margin: 2px 0 14px; }
.caret::after { content: ''; display: inline-block; width: 7px; height: 13px; background: var(--acc-text); margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(2) infinite; border-radius: 1px; }
@keyframes blink { 50% { opacity: 0; } }
.qcard { background: var(--card); border-radius: 12px; box-shadow: inset 0 0 0 .5px var(--acc-line); padding: 12px 14px; margin: 4px 0 16px; }
.qcard .q { font-weight: 600; margin-bottom: 8px; }
.qcard .opts { display: flex; flex-direction: column; gap: 6px; }
.qcard .opt { text-align: left; padding: 8px 10px; border-radius: 8px; background: var(--seg); box-shadow: inset 0 0 0 .5px var(--line); }
.qcard .opt:hover { background: var(--seg-on); }
.qcard .opt small { display: block; color: var(--t2); font-size: 11.5px; }
.att { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 7px; background: var(--seg); box-shadow: inset 0 0 0 .5px var(--line); font-size: 12px; max-width: 240px; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att img { width: 20px; height: 20px; object-fit: cover; border-radius: 4px; }
.att .x { color: var(--t3); } .att .x:hover { color: var(--t1); }
.thumb { max-width: 220px; max-height: 160px; border-radius: 8px; display: block; box-shadow: inset 0 0 0 .5px var(--line); }
.composer-wrap { padding: 6px var(--col-h) 16px; flex: none; }
.composer { max-width: 1100px; margin: 0 auto; background: var(--field); border-radius: 14px; box-shadow: inset 0 0 0 .5px var(--line), 0 2px 12px rgba(0,0,0,.08); padding: 10px 10px 8px 14px; transition: box-shadow .2s; }
.composer:focus-within { box-shadow: inset 0 0 0 1px var(--acc-line), 0 0 0 3px var(--acc-soft); }
.composer.drag { box-shadow: inset 0 0 0 1.5px var(--acc); }
.composer textarea { width: 100%; border: 0; outline: 0; background: transparent; resize: none; font-size: 13px; line-height: 1.45; min-height: 20px; max-height: 240px; display: block; }
.composer textarea::placeholder { color: var(--t3); }
.composer .atts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.composer .bar { display: flex; align-items: center; gap: 2px; margin-top: 8px; }
.composer .bar .sp { flex: 1; }
.cbtn { height: 28px; min-width: 28px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--t2); padding: 0 7px; font-size: 12.5px; white-space: nowrap; }
.cbtn:hover:not(:disabled) { background: var(--hover); color: var(--t1); }
.cbtn b { font-weight: 600; color: var(--t1); }
.cbtn.send { background: var(--acc); color: var(--acc-ink); width: 30px; padding: 0; }
.cbtn.send:disabled { background: var(--track); color: var(--t3); opacity: 1; }
.cbtn.stop { background: var(--t1); color: var(--win); width: 30px; padding: 0; }
.cbtn.mic.on { background: var(--red); color: #fff; }
.cbtn .ring { width: 14px; height: 14px; }
.ctxn { font-family: var(--mono); font-size: 11px; color: var(--t3); }
.queue { max-width: 1100px; margin: 0 auto 6px; display: flex; flex-direction: column; gap: 4px; }
.queue .qi { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--t2); background: var(--card); border-radius: 8px; padding: 5px 10px; box-shadow: inset 0 0 0 .5px var(--line); }
.queue .qi span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banners { position: fixed; left: 50%; top: 62px; transform: translateX(-50%); z-index: 80; width: 380px; max-width: calc(100vw - 20px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.banners .banner { pointer-events: auto; }
.banner { position: relative; width: 100%; background: var(--bar); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); border-radius: 14px; box-shadow: var(--sheet-shadow); padding: 12px 14px; animation: drop .3s cubic-bezier(.2,.8,.2,1); display: flex; gap: 10px; align-items: flex-start; }
@keyframes slin { from { transform: translateX(120%); } to { transform: none; } }
.banner .appi { width: 30px; height: 30px; border-radius: 7px; background: var(--lime); display: grid; place-items: center; flex: none; }
.banner .bd { flex: 1; min-width: 0; }
.banner b { font-size: 13px; display: block; } .banner p { margin: 1px 0 0; font-size: 12.5px; color: var(--t2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.banner .btns { margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; background: var(--bar); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 12px; box-shadow: var(--sheet-shadow); padding: 9px 14px; font-size: 13px; animation: fin .2s ease; max-width: calc(100vw - 32px); }
.toast.err { color: var(--red); }

/* ── Листы, всплывашки, меню, окно настроек ───────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.25); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; animation: fadein .15s ease; }
@keyframes fadein { from { opacity: 0; } }
.sheet { width: 600px; max-width: 100%; max-height: 84vh; background: var(--win); border-radius: 14px; box-shadow: var(--sheet-shadow); display: flex; flex-direction: column; overflow: hidden; animation: drop .2s cubic-bezier(.2,.8,.2,1); }
.sheet.wide { width: 760px; } .sheet.narrow { width: 440px; }
@keyframes drop { from { opacity: 0; transform: translateY(-12px); } }
.sheet .sh-hd { display: flex; align-items: center; gap: 10px; padding: 16px 20px 6px; }
.sheet .sh-hd b { font-size: 15px; flex: 1; }
.sheet .sh-body { padding: 8px 20px 16px; overflow-y: auto; }
.sheet .sh-ft { display: flex; align-items: center; gap: 8px; padding: 12px 20px 16px; border-top: .5px solid var(--sep); }
.sheet .sh-ft .sp { flex: 1; }
.settings { width: 680px; height: min(680px, 88vh); }
.set-tabs { display: flex; justify-content: center; gap: 2px; padding: 10px 8px 10px; border-bottom: .5px solid var(--sep); overflow-x: auto; scrollbar-width: none; flex: none; }
.set-tabs::-webkit-scrollbar { display: none; }
.set-tabs button { min-width: 74px; height: 54px; padding: 0 6px; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--t2); font-size: 11.5px; flex: none; }
.set-tabs button svg.i { width: 22px; height: 22px; stroke-width: 1.4; }
.set-tabs button:hover { background: var(--hover); }
.set-tabs button.on { background: var(--hover); color: var(--acc-text); box-shadow: inset 0 0 0 .5px var(--line); }
.set-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 22px; height: 22px; border-radius: 50%; position: relative; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.25); }
.swatches button.on::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.swatches button.on.dk::after { background: #0b0c0e; }
.pairbox { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.paircode { font: 600 26px/1 var(--mono); letter-spacing: .18em; padding: 12px 16px; border-radius: 10px; background: var(--well); box-shadow: inset 0 0 0 .5px var(--line); user-select: all; }
.menu { position: fixed; z-index: 75; min-width: 200px; max-width: 320px; max-height: 70vh; overflow-y: auto; background: var(--bar); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); border-radius: 10px; box-shadow: var(--sheet-shadow); padding: 5px; animation: fin .12s ease; }
.menu .mi { min-height: 26px; border-radius: 5px; display: flex; align-items: center; gap: 8px; padding: 3px 9px; font-size: 13px; width: 100%; text-align: left; }
.menu .mi:hover:not(:disabled) { background: var(--acc); color: var(--acc-ink); }
.menu .mi:hover:not(:disabled) svg.i, .menu .mi:hover:not(:disabled) small { color: var(--acc-ink); }
.menu .mi svg.i { color: var(--t2); }
.menu .mi .ck { width: 14px; flex: none; display: grid; place-items: center; }
.menu .mi small { margin-left: auto; color: var(--t3); font-size: 11.5px; padding-left: 12px; }
.menu .mi.danger { color: var(--red); }
.menu .msep { border-top: .5px solid var(--sep); margin: 5px 8px; }
.menu .mh { font-size: 11px; font-weight: 600; color: var(--t3); padding: 6px 9px 3px; }
.pop { position: fixed; z-index: 75; width: 320px; background: var(--bar); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); border-radius: 14px; box-shadow: var(--sheet-shadow); padding: 14px; animation: fin .15s ease; }
.palette { width: 620px; }
.palette input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 15px 18px 13px 46px; }
.palette .pi { position: absolute; left: 18px; top: 17px; color: var(--t2); }
.palette .res { border-top: .5px solid var(--sep); max-height: 380px; overflow-y: auto; padding: 6px; }
.palette .res .mi { height: 32px; border-radius: 7px; display: flex; align-items: center; gap: 10px; padding: 0 10px; width: 100%; text-align: left; }
.palette .res .mi.on { background: var(--acc); color: var(--acc-ink); } .palette .res .mi.on small, .palette .res .mi.on svg.i { color: var(--acc-ink); }
.palette .res .mi small { margin-left: auto; color: var(--t3); font-size: 12px; }
.palette .res .mi svg.i { color: var(--t2); }
.palette .res .rh { font-size: 11px; font-weight: 600; color: var(--t3); padding: 8px 10px 4px; }

/* ── Вход ─────────────────────────────────────────────────────────────── */
#entry { position: fixed; inset: 0; overflow-y: auto; background: var(--win); display: flex; justify-content: center; }
#entry .box { width: min(840px, 100%); padding: 48px 30px 40px; }
#entry .logo { display: flex; justify-content: center; margin-bottom: 40px; }
#entry .logo .lockup { height: 34px; }
#entry .owner { text-align: center; color: var(--t2); margin: -26px 0 26px; font-size: 12.5px; }
.efield { background: var(--card); border-radius: 12px; box-shadow: inset 0 0 0 .5px var(--line); padding: 8px 14px 9px; display: block; }
.efield span { display: block; font-size: 11px; color: var(--t2); margin-bottom: 2px; }
.efield input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 15px; padding: 0; }
.efield input.code { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.efield:focus-within { box-shadow: inset 0 0 0 .5px var(--line), 0 0 0 3px var(--acc-soft); }
.erow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ebtn { width: 100%; height: 40px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 .5px var(--line); font-weight: 600; font-size: 14px; margin-top: 12px; }
.ebtn.ready { background: var(--acc); color: var(--acc-ink); box-shadow: none; }
.enote { color: var(--t2); font-size: 12.5px; margin: 12px 0 0; line-height: 1.5; }
.elinks { display: flex; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
.elinks button { color: var(--acc-text); font-weight: 600; font-size: 12.5px; }
.trust { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--t2); }

/* ── Телефон: раскладка iPhone-версии ─────────────────────────────────── */
.tabbar { display: none; }
.back { display: none; }
@media (max-width: 760px) {
  :root { --page-h: 20px; --col-h: 16px; --bubble-inset: 40px; }
  body { font-size: 15px; }
  .tb { grid-template-columns: auto 1fr auto; padding: 0 10px; height: 50px; }
  .tb .c { justify-content: flex-start; overflow: hidden; }
  .tb .hide-phone, .hide-phone { display: none !important; }
  .back { display: inline-flex; }
  .side { position: fixed; z-index: 40; top: 50px; bottom: 64px; left: 0; margin: 0; border-radius: 0; width: 100%; display: none; }
  #app.phone-side .side { display: flex; }
  #app.noside .side { width: 100%; }
  .body { padding-bottom: 64px; }
  .tabbar { display: flex; position: fixed; z-index: 45; left: 10px; right: 10px; bottom: 8px; height: 56px; border-radius: 28px; background: var(--bar); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); box-shadow: var(--sheet-shadow); padding: 4px; }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; color: var(--t2); border-radius: 24px; position: relative; }
  .tabbar button svg.i { width: 22px; height: 22px; }
  .tabbar button.on { color: var(--acc-text); background: var(--hover); }
  .tabbar .nb { position: absolute; top: 2px; left: 55%; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }
  .split { position: relative; }
  .split .list-col { width: 100% !important; border-right: 0; }
  .split .detail { display: none; }
  .split.show-detail .list-col { display: none; }
  .split.show-detail .detail { display: flex; }
  .grid.g3, .grid.g4, .grid.g2 { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .li .t { font-size: 15px; } .li .sub { font-size: 13px; } .li .prev { font-size: 13.5px; }
  .msg { font-size: 15px; } .composer textarea { font-size: 16px; }
  .md pre, .tool-out { font-size: 12px; }
  .row { min-height: 40px; font-size: 15px; }
  .sheet, .settings { width: 100%; max-height: 92vh; }
  .scrim { padding: 4vh 8px 8px; align-items: flex-end; }
  .settings { height: 92vh; }
  .erow { grid-template-columns: 1fr; gap: 10px; }
  .banners { top: 56px; width: calc(100vw - 20px); }
  .fr { min-height: 48px; }
  .input, .ta, .popsel { font-size: 16px; }
  .composer-wrap { padding-bottom: 10px; }
  .pad { padding-bottom: 30px; }
  .chat-hd { min-height: 46px; }
}
