/*!
 * header-chat.css — СГЕНЕРИРОВАНО src/gen.py, руками не править.
 * Адаптивные правила svitex-erp-ui.css / disk.css / chat.css (@media max-width) переписаны в @container svxchat,
 * чтобы чат внутри выезжающей панели хедера (ширина ≤ 420px) выглядел как мобильный Svitex Chat при любой ширине окна.
 * Подключать ПОСЛЕ chat.css и ДО header.css. Исходные файлы не меняются.
 */

/* ── из ../svitex-erp-ui/svitex-erp-ui.css ── */
@container svxchat (max-width:900px){.ch-app{--svx-edge:18px}}
@container svxchat (max-width:900px){
  .svx-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
  .svx-field,.svx-field.is-half,html .svx-field.is-check{grid-column:span 1}
  .svx-split{grid-template-columns:minmax(0,1fr)}
  .svx-find{flex-wrap:wrap}
  .svx-cost{grid-template-columns:minmax(0,1fr) auto}
}
@container svxchat (max-width:1100px){
  .workspace{grid-template-columns:200px minmax(0,1fr)}
  html .cat-form-panel{width:300px}
}
@container svxchat (max-width:900px){
  html body,html .arm{height:auto;max-height:none;min-height:100%;overflow:auto}
  .workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
  .types{border-right:0;border-bottom:1px solid var(--line);max-height:38vh;padding:6px 8px}
  html .types h3{margin:10px 10px 4px}
  .titlebar{flex-wrap:wrap;gap:10px}
  h1{white-space:normal;font-size:15px}
  .lamps{order:3}
  html .cat-split{flex-direction:column}
  html .cat-form-panel{width:auto;border-left:0;border-top:2px solid var(--line);max-height:none}
  .grid-wrap{min-height:55vh}
  .actions{flex-direction:column;align-items:stretch}
  .defaults{flex-wrap:wrap}
}
@container svxchat (max-width:480px){
  html .brand{flex-wrap:wrap;row-gap:8px}
  html .mark{flex-basis:100%;border-right:0;padding-right:0}  /* знак отдельной строкой над заголовком */
  .toolbar,.filters,.actions{padding:8px 10px}
  html .seg{max-width:100%;overflow-x:auto}
  html :is(input[type="text"],input[type="search"],input[type="date"],input:not([type]),select){font-size:16px}  /* без зума на iOS */
  dialog{border-radius:16px}
}

/* ── из ../svitex-disk/disk.css ── */
@container svxchat (max-width:1100px){
  .ch-app{--dk-side:208px;--dk-pad:20px}
  .dk-list .c-who{display:none}
}
@container svxchat (max-width:900px){
  .ch-app{--dk-top:56px;--dk-pad:16px;--dk-tile:150px}
  .dk-app{grid-template-columns:minmax(0,1fr);padding-bottom:var(--dk-tabbar)}
  .dk-top{padding:0 10px 0 6px;gap:6px}
  .dk-burger{display:inline-grid}
  .dk-brand{width:auto;margin-right:auto}
  .dk-top .dk-search{position:fixed;left:0;right:0;top:var(--dk-top);z-index:9;max-width:none;padding:8px 16px;background:var(--svx-bg);border-bottom:1px solid var(--line)}
  .dk-top .dk-search>.dk-i{left:29px}
  .dk-search kbd,.dk-top .theme,.dk-user .nm{display:none}
  .dk-main{padding-top:56px}
  /* сайдбар → выезжающая панель */
  .dk-side{position:fixed;left:0;top:0;bottom:0;z-index:70;width:min(300px,86vw);border-right:2px solid var(--ink);transform:translateX(-102%);
    transition:transform .25s cubic-bezier(.2,.8,.3,1)}
  .dk-app.drawer .dk-side{transform:none}
  .dk-app.drawer .dk-scrim{display:block;position:fixed;inset:0;z-index:65;background:var(--svx-backdrop)}
  .dk-foot.main{display:block;padding:24px var(--dk-pad) 16px;margin-top:auto;text-align:center}
  .dk-head{flex-wrap:wrap;padding:12px var(--dk-pad) 10px;min-height:0}
  .dk-crumbs{flex:1 1 100%;order:-1}
  .dk-crumbs li:not(:last-child):not(.dk-up1){display:none}
  .dk-crumbs [aria-current]{font-size:18px}
  .dk-crumbs li.dk-up1::before{transform:rotate(180deg);margin-left:0}  /* «‹ Родитель › Текущая» — шаг назад */
  .dk-tile .more{opacity:1}
  .dk-list .c-date,.dk-list .c-ck,.dk-list thead{display:none}
  .dk-list .c-name small{display:block}
  /* нижняя панель */
  .dk-tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:30;height:var(--dk-tabbar);align-items:center;justify-content:space-around;
    padding:0 8px env(safe-area-inset-bottom);background:var(--svx-bg);border-top:2px solid var(--line)}
  .dk-tabbar a{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:84px;padding:6px 4px;font-size:11.5px;color:var(--muted);text-decoration:none;border-radius:10px}
  .dk-tabbar a .dk-i{width:22px;height:22px}
  .dk-tabbar a[aria-current]{color:var(--ink);font-weight:700}
  html .dk-tabbar .ghost{min-height:44px;padding:0 20px;font-size:14px}
  .dk-up{left:8px;right:8px;bottom:calc(var(--dk-tabbar) + 8px);width:auto;max-width:none;border-radius:16px}
  .dk-toast{bottom:calc(var(--dk-tabbar) + 16px)}
  /* модалки — снизу листом */
  dialog.dk-modal,dialog.dk-sheet{width:100vw;max-width:100vw;margin:auto 0 0;border-radius:16px 16px 0 0;border-bottom:0;max-height:88vh}
  dialog.dk-viewer{width:100vw;height:100dvh;max-height:none;margin:0;border:0;border-radius:0}
  .dk-viewer>header{padding:8px 8px 8px 14px}
  .dk-viewer>header .acts .ghost .lbl{display:none}
  .dk-stage{padding:12px}
  .dk-stage>.nav{display:none}
  .dk-viewer>footer{padding:10px 14px;flex-wrap:wrap}
  .dk-page{padding:28px 24px;font-size:10px}
  .dk-audio{padding:20px}
  .dk-menu.sheet{left:0!important;right:0;top:auto!important;bottom:0;border-radius:16px 16px 0 0;border-bottom:0;padding:8px 8px calc(12px + env(safe-area-inset-bottom))}
  .dk-menu.sheet button{padding:12px 12px;font-size:15px}
  .dk-menu.sheet kbd{display:none}
  .dk-auth{display:block;padding:0 16px}
  .dk-auth>.top{padding:16px 0 4px}
  .dk-auth .art{padding:0;gap:0}
  .dk-auth .art .hero,.dk-auth .tag{display:none}
  .dk-auth .art .strip{display:block;width:100%;max-width:520px}
  .dk-auth .card{margin:8px 0 20px;padding:22px 18px 18px;border-radius:16px}
  .dk-auth h1{font-size:24px}
  .dk-prose h1{font-size:24px}
  .dk-filters{flex-wrap:wrap}
  .dk-shared .c-link,.dk-shared .c-num,.dk-shared .c-pw,.dk-shared .c-date{display:none}
  /* имя переносится (до 2 строк), статус и действия — по содержимому, без обрезки */
  html .dk-shared td:nth-child(3),html .dk-shared .c-more{width:1%;white-space:nowrap}
  html .dk-shared th.c-more{width:1%!important}
  .dk-shared .c-name b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;overflow-wrap:anywhere;line-height:1.3}
  .dk-shared .c-more [data-copy]{display:none}   /* копирование — в листе «Настроить» */
}
@container svxchat (max-width:480px){
  .ch-app{--dk-tile:140px;--dk-gap:12px}
  .dk-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dk-tiles.folders{grid-template-columns:minmax(0,1fr)}
  .dk-head .dk-count{display:none}
  html .seg.dk-view>button .lbl{display:none}
  .dk-list .c-size{width:76px}
  .dk-empty h2{font-size:19px}
  .dk-empty p{font-size:14px}
  html .dk-search input{font-size:16px}  /* без зума на iOS */
  .dk-auth .card{border:0;padding:12px 2px}
}

/* ── из ../svitex-chat/chat.css ── */
@container svxchat (max-width:1100px){
  .ch-app{--ch-list:300px}
  .ch-app.info{grid-template-columns:var(--ch-list) minmax(0,1fr)}
  .ch-app.info .ch-info{position:fixed;right:0;top:var(--dk-top);bottom:0;z-index:20;width:var(--ch-info);background:var(--svx-bg);border-left:2px solid var(--ink)}
  .ch-filter .n{display:none}
  .ch-stage.grid{grid-template-columns:minmax(0,1fr) 240px}
  .ch-sbody{padding:8px 24px 32px}
}
@container svxchat (max-width:900px){
  .ch-app{grid-template-columns:minmax(0,1fr)!important;padding-bottom:var(--dk-tabbar)}
  .ch-app .dk-top{padding:0 10px 0 var(--svx-edge)}
  .ch-app .dk-brand{width:auto;margin-right:auto}
  .ch-nav,.ch-app .dk-top .theme,.ch-app .dk-user .nm{display:none}
  .ch-dlg{display:none}
  .ch-lhead{padding:12px 12px 8px var(--svx-edge)}
  .ch-search kbd{display:none}
  html .ch-search input{font-size:16px}
  .ch-search,.ch-filter{margin-right:12px}
  .ch-items{padding:0 4px}
  .ch-item{padding-left:calc(var(--svx-edge) - 4px)}
  .ch-sec{margin-left:var(--svx-edge)}
  .ch-acts{display:none}
  /* экран переписки */
  .ch-app.open{grid-template-rows:minmax(0,1fr);padding-bottom:0}
  .ch-app.open>.dk-top,.ch-app.open>.ch-list,.ch-app.open>.dk-tabbar{display:none}
  .ch-app.open .ch-dlg{display:flex;height:100dvh}
  .ch-back{display:inline-grid}
  .ch-dhead{gap:8px;min-height:56px;padding:6px 6px 6px 6px}
  .ch-dhead .hide-s,.ch-compose .hide-s,.ch-cb.hide-s{display:none}
  .ch-pinbar{padding-left:14px}
  .ch-feed{padding:8px 12px 6px}
  .ch-row{max-width:88%}
  .ch-img .dk-scene{width:240px}
  .ch-filecard{min-width:0}
  .ch-quote span{max-width:220px}
  .ch-compose{padding:8px 10px calc(10px + env(safe-area-inset-bottom));gap:4px}
  .ch-replying{margin:0 10px}
  .ch-attach{left:10px!important;right:10px;bottom:64px!important;top:auto!important}
  .ch-app.info .ch-info{position:fixed;inset:0;z-index:40;width:auto;border:0;background:var(--svx-bg)}
  .ch-info>header{min-height:56px;padding:6px 12px 6px 6px}
  .ch-info .hide-m{display:none}
  /* звонки */
  .ch-chead{min-height:56px;gap:10px;padding-right:8px}
  .ch-chead .t{text-align:left}
  .ch-chead h2,.ch-chead p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .ch-stage.grid{display:flex;flex-direction:column;gap:10px;padding:10px 12px;overflow:auto}
  .ch-tile.share{flex:none;aspect-ratio:16/9}
  .ch-side{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .ch-side .ch-tile{aspect-ratio:4/3}
  .ch-side .ch-tile:first-child{grid-column:1/-1;aspect-ratio:16/9}
  .ch-tile .ch-ava.xl{width:56px;height:56px;font-size:18px}
  .ch-self{width:120px;right:14px;bottom:14px}
  .ch-ctls{gap:8px;padding:12px 8px calc(16px + env(safe-area-inset-bottom))}
  .ch-cb{min-width:60px}
  .ch-cb .c{width:52px;height:52px}
  .ch-cb.end .c{width:72px}
  dialog.ch-ring{width:100vw;max-width:100vw;height:100dvh;max-height:none;margin:0;border:0;border-radius:0;display:none;flex-direction:column;justify-content:center}
  dialog.ch-ring[open]{display:flex}
  .ch-mini{padding-left:12px;gap:6px}
  .ch-mini .tx span{display:none}
  html .ghost.ch-endsm span{display:none}
  html .ghost.ch-endsm{padding:0 10px}
  /* настройки: меню → раздел */
  .ch-set .ch-snav{border-right:0;padding:0 4px 16px}
  .ch-set .ch-snav .chev{display:inline-block}
  .ch-set .ch-snav a[aria-current]{background:none;box-shadow:none}
  .ch-set .ch-snav a{padding-left:calc(var(--svx-edge) - 4px)}
  .ch-set .ch-snav h1{padding-left:calc(var(--svx-edge) - 4px)}
  .ch-set .ch-sbody{display:none;padding:0 16px 28px}
  .ch-set.sec .ch-snav{display:none}
  .ch-set.sec .ch-sbody{display:block}
  .ch-set.sec{grid-template-rows:minmax(0,1fr)}
  .ch-set.sec>.dk-top{display:none}
  .ch-shead{position:sticky;top:0;z-index:2;margin:0 -16px;padding:6px 12px 6px 6px;background:var(--svx-bg);border-bottom:2px solid var(--line)}
  .ch-shead h1{font-size:18px}
  .ch-group{padding:2px 14px}
  .ch-group.form{padding:14px}
  .ch-group .g2{grid-template-columns:minmax(0,1fr)}
  .ch-opt{flex-wrap:wrap;gap:10px}
  .ch-opt .seg{width:100%;display:flex}
  html .ch-opt .seg>button{flex:1;padding:0 6px}
  .ch-opt .l{flex:1 1 200px}
  .ch-themes{gap:8px}
  .ch-theme{padding:8px}
  .ch-pv{height:64px}
  .ch-theme .nm{font-size:13px}
  .ch-prof{gap:14px}
  .ch-prof .ch-ava.xxl{width:72px;height:72px;font-size:22px}
  .ch-devs li{flex-wrap:wrap}
  .ch-devs li .ghost{margin-left:38px}
  .dk-tabbar{display:flex}
}
@container svxchat (max-width:900px){.ch-set:not(.sec) .ch-sbody{display:none}}
@container svxchat (max-width:480px){
  .ch-pick h2,.ch-lempty h2{font-size:17px}
  .ch-themes .nm{font-size:12.5px}
}
@container svxchat (max-width:900px){.ch-shead .ch-back{display:inline-grid}}
