/* Shared geometry comes last, after the existing theme layers. */
.ts-app-focus { outline:2px solid var(--sp-star); outline-offset:2px; scroll-margin-top:120px; }
.sp-catalog-head { display:grid; gap:5px; margin:0 0 18px; }
.sp-catalog-head .sp-h1, .sp-catalog-head .sp-lead { margin:0; }
.sp-catalog-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.sp-catalog-card { display:grid; align-content:start; justify-items:start; gap:10px; min-height:168px; padding:18px; text-align:left; color:var(--sp-star); cursor:pointer; }
.sp-catalog-card b { font-size:17px; }
.sp-catalog-card small { color:var(--sp-dust); line-height:1.45; }
.sp-catalog-card i { align-self:end; margin-top:4px; color:var(--sp-ion); font-size:13px; font-style:normal; font-weight:700; }
.sp-catalog-glyph { display:grid; place-items:center; width:42px; height:42px; color:var(--sp-ion); border-radius:14px; background:var(--sp-panel2); }
.sp-side-brand { display:none; }
.sp-app, .sp-main, .sp-page, .sp-card, .sp-sheet, .sp-sheet-body, .nw-step { min-width:0; }
.wl-circ { border-radius:50%; }
.wl-acts { grid-template-columns:repeat(4,minmax(0,1fr)); }
.wl-act { min-width:0; }
.wl-act > span { overflow-wrap:anywhere; }
.nw-copy, .tp-addr, .sp-kv-v, .sp-code { min-width:0; max-width:100%; }
.nw-copy code, .tp-addr code, .sp-code code { overflow-wrap:anywhere; word-break:break-word; white-space:normal; }
.nw-copy svg, .tp-addr svg { flex:none; }
.tp-card { grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); }
.tp-side, .tp-net > span, .wl-main-l { min-width:0; }
.sp-sheet-body > .sp-seg { position:sticky; top:0; z-index:4; background:var(--sp-hull); }
.sp-divider { height:1px; margin:18px 0; background:var(--sp-line); }
.hm-profile { display:flex; align-items:center; text-align:left; gap:10px; margin-bottom:16px; max-width:100%; }
.hm-profile > span:nth-child(2) { flex:1; min-width:0; }
.hm-profile small { display:block; font-size:12px; color:var(--sp-dust); margin-top:4px; }
.sp-nav { max-width:calc(100vw - 20px); }
:is(button,a,input,textarea):focus-visible { outline:2px solid var(--sp-ion); outline-offset:3px; }
@media (max-width:380px) {
 .sp-sheet-body { padding-left:14px; padding-right:14px; }
 .sp-main { padding-left:12px; padding-right:12px; }
 .sp-nav-item { min-width:38px; padding-left:9px; padding-right:9px; }
 .sp-nav-item.on { padding-left:10px; padding-right:10px; gap:4px; }
 .sp-nav-lbl { font-size:12px; }
 .tp-card { grid-template-columns:minmax(0,1fr); gap:18px; }
 .tp-side { align-items:center; text-align:center; }
 .wl-hero { padding:18px; }
 .wl-bal { font-size:clamp(26px,9vw,42px); flex-wrap:wrap; }
 .wl-circ { width:52px; height:52px; }
 .wl-acts { gap:6px; }
 .wl-act { font-size:12px; }
 .nw-row { gap:8px; padding:12px 10px; }
 .nw-row-meta { max-width:90px; }
 .sp-period { flex-wrap:wrap; }
}
@media (min-width:960px) {
 .sp-app:not(.bare) { padding-left:216px; }
 .sp-app:not(.bare) .sp-nav { position:fixed; inset:0 auto 0 0; bottom:0; width:216px; max-width:none; height:100dvh; transform:none; border-radius:0; padding:28px 16px; display:flex; flex-direction:column; align-items:stretch; gap:8px; background:var(--sp-hull); border-right:1px solid var(--sp-line); box-shadow:none; }
 .sp-side-brand { display:flex; padding:8px 12px 32px; }
 .sp-app .sp-nav-item, .sp-app .sp-nav-item.on { width:100%; height:48px; flex:none; justify-content:flex-start; gap:12px; padding:0 16px; border-radius:16px; }
 .sp-app .sp-nav-lbl { max-width:none; opacity:1; font-size:14px; }
 .sp-app .sp-nav-badge { top:14px; right:8px; }
 .sp-top { left:216px; padding:20px 32px; height:80px; border-bottom:1px solid var(--sp-line); }
 .sp-top > .sp-wordmark { display:none; }
 .sp-main, .sp-main.wide, .sp-main.chat { width:100%; max-width:1440px; padding:104px 32px 32px; margin:0 auto; }
 .sp-app.bare .sp-main { max-width:none; padding:0; }
 .sp-app[data-section=home] .hm { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(280px,1fr); gap:24px; align-items:start; }
 .hm > .pf-hero, .hm > .hm-wal, .hm > .hm-lead { grid-column:1 / -1; }
 .hm > .sp-quick { grid-column:2; grid-row:3; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-self:stretch; align-content:center; gap:24px; padding:20px; border-radius:28px; background:var(--sp-panel2); }
 .hm .hm-bal { min-height:230px; }
 .hm .sp-dirs.list { grid-template-columns:minmax(0,1fr); }
 .wl { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(260px,1fr); gap:24px; align-items:start; }
 .wl > .wl-hero { grid-column:1; }
 .wl > .wl-acts { grid-column:2; grid-row:1; align-self:center; }
 .wl > :not(.wl-hero):not(.wl-acts):not(.sp-sheet-root) { grid-column:1 / -1; }
 .sp-sheet-root { padding:24px; }
 .sp-sheet, .sp-sheet.full { height:auto; max-height:calc(100dvh - 48px); max-width:520px; border-radius:28px; }
 .sp-sheet-body { flex:0 1 auto; }
 .sp-pad-sheet { min-height:0; gap:16px; }
 .sp-pad-k { min-height:50px; }
 .sp-main.chat { max-width:1440px; }
 .sp-ai { height:calc(100dvh - 136px); min-height:0; }
 .sp-ai-chat { min-height:0; height:100%; }
 .sp-ai-feed { min-height:0; flex:1; overflow-y:auto; }
 .sp-ai-side { position:static; max-height:100%; overflow-y:auto; }
 html.kb .sp-nav { transform:none; opacity:1; pointer-events:auto; }

 /* Рабочие экраны — отдельная desktop-композиция, а не увеличенная мобильная колонка. */
 .pn-frame { gap:24px; }
 .pn-frame > .pn-tabs { position:sticky; top:92px; z-index:14; width:max-content; max-width:100%; padding:6px; }
 .pn-frame > .sp-page.pn { max-width:none; }
 .pn-frame .pn-svcs { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .pn-frame .sp-queue { max-width:none; }
 .ts-frame { gap:22px; }
 .ts-frame > .ts-nav { position:sticky; top:92px; z-index:14; width:max-content; max-width:100%; padding:6px; border-radius:999px; background:var(--sp-panel); box-shadow:var(--sp-shadow); }
 .ts-frame > .ts-over { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; align-items:start; }
 .ts-frame > .ts-over > :first-child { grid-column:span 2; }
 .ts-frame > .ts-pct { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-items:start; }
 .ts-frame > .ts-pct > :last-child { grid-column:1 / -1; }
 .ts-frame > .sp-page:not(.ts-over):not(.ts-pct) { max-width:980px; }
 .pn-frame .sp-split { grid-template-columns:420px minmax(0,1fr); gap:24px; }
 .pn-frame .sp-pane-list { top:148px; max-height:calc(100dvh - 174px); padding:14px; border-radius:20px; background:var(--sp-panel2); }
 .pn-frame .sp-pane-detail { min-height:calc(100dvh - 170px); padding:4px 0; }
}
@media (prefers-reduced-motion:reduce) {
 *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}
@media (max-width:639px) {
 .sp-catalog-grid { grid-template-columns:minmax(0,1fr); }
 .sp-catalog-card { min-height:142px; }
}

/* Ленты вкладок в панели тянутся ровно до краёв экрана: поле страницы здесь 12px, а не 16px, — без вылезания за экран. */
@media (max-width: 719px) {
  .pn-frame > .pn-tabs { margin-left: -12px; margin-right: -12px; }
  .ts-frame > .sp-chips.scroll.ts-nav { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
}

/* Верхняя панель на узких экранах: все действия, включая полный экран, остаются доступны. */
.sp-top .sp-grow { min-width: 0; }
.sp-top .sp-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 379px) { .sp-top { gap: 3px; padding-inline: 10px; } .sp-top .sp-iconbtn { width: 36px; height: 36px; border-radius: 12px; } .sp-top .sp-title { font-size: 17px; } }
/* Быстрые суммы QR — ровной сеткой, без «висящей» последней кнопки */
.qr-screen .sp-pad-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
.qr-screen .sp-pad-quick .sp-chip { padding-inline: 4px; justify-content: center; min-width: 0; }

/* Панель ТС на компьютере: окна ТС — боковая колонка слева, контент справа; шторки панели выезжают справа (480px), а не лист по центру. */
@media (min-width:1024px) {
 .ts-frame { display:grid; grid-template-columns:200px minmax(0,1fr); gap:22px 28px; align-items:start; }
 .ts-frame > * { grid-column:2; min-width:0; }
 .ts-frame > .ts-nav { grid-column:1; grid-row:1 / span 40; position:sticky; top:104px; flex-direction:column; flex-wrap:nowrap; align-items:stretch; gap:2px; width:auto; max-height:calc(100dvh - 128px); overflow-y:auto; margin:0; padding:8px; border-radius:20px; }
 .ts-frame > .ts-nav .sp-chip { justify-content:flex-start; width:100%; border-radius:12px; text-align:left; }
 .ts-frame > .sp-page:not(.ts-over):not(.ts-pct) { max-width:none; }
 .sp-app[data-section=work] .sp-sheet-root { align-items:stretch; justify-content:flex-end; padding:0; }
 .sp-app[data-section=work] .sp-sheet, .sp-app[data-section=work] .sp-sheet.full { width:480px; max-width:100vw; height:100%; max-height:none; border-radius:24px 0 0 24px; animation:sp-drawer-in 260ms var(--sp-ease); }
 .sp-app[data-section=work] .sp-sheet::before { display:none; }
}
@keyframes sp-drawer-in { from { transform:translateX(100%); } to { transform:none; } }
@media (prefers-reduced-motion:reduce) { .sp-app[data-section=work] .sp-sheet { animation:none; } }
