/* Phone & tablet layout (≤900px). Everything outside the media queries only hides the mobile-only controls,
   so the desktop layout is unchanged. Loaded after styles.css and reader.css. */
.m-burger,.m-stoggle,.m-only,.drawer-bg,.m-badge{display:none}
i.m-ico{display:none}
.login-err{color:var(--red);font-size:13px;font-weight:500}

/* ======================= tablet + phone ======================= */
@media (max-width:900px){
  html,body{overscroll-behavior-y:none}
  body{font-size:15px;-webkit-text-size-adjust:100%;text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,87,183,.12)}
  input,select,textarea,.inp,.inp.sm,.inp.xs,.select,.select.sm{font-size:16px}   /* ≥16px: no iOS zoom on focus */
  .app{grid-template-columns:minmax(0,1fr);height:100vh;height:100dvh}
  .main{min-width:0}

  /* ---- off-canvas sidebar drawer ---- */
  .sidebar{position:fixed;top:0;left:0;bottom:0;width:min(86vw,340px);z-index:46;transform:translateX(-105%);visibility:hidden;
    transition:transform .22s ease,visibility 0s linear .22s;padding:calc(14px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  body.drawer-open .sidebar{transform:none;visibility:visible;transition:transform .22s ease,visibility 0s;box-shadow:10px 0 36px rgba(0,0,0,.38)}
  .drawer-bg{display:block;position:fixed;inset:0;background:rgba(8,17,31,.5);z-index:45;opacity:0;pointer-events:none;transition:opacity .2s}
  body.drawer-open .drawer-bg{opacity:1;pointer-events:auto}
  .brand{padding:2px 6px 14px}.brand-sub{font-size:12px}
  .nav-item{min-height:46px;font-size:15px}
  .nav-item.active::before{left:-12px}
  .nav-count{font-size:13px;color:#C7D2E3}
  .nav-pill{font-size:12px;padding:2px 8px}
  .tree{flex:none;overflow:visible;min-height:0}
  .t-sec{font-size:12px;padding:14px 10px 4px}
  .t-add{width:44px;height:44px;margin:-12px -8px -12px 0}.t-add i{width:17px;height:17px}
  .t-item,.t-item.src{min-height:44px;font-size:15px;padding:6px 10px;gap:10px}
  .t-item.src{font-size:14.5px}
  .t-item i{width:17px;height:17px}
  .t-item b{font-size:13px;padding:1px 8px}
  .t-item.active::before{left:-8px}
  .t-caret{width:44px;height:44px;margin:-6px -8px -6px -14px}.t-caret i{width:16px;height:16px}
  .t-edit{width:44px;height:44px;margin:-6px -6px}.t-edit i{width:15px;height:15px}
  .t-item.active .t-edit{display:grid}
  .t-empty{font-size:13px;padding:6px 12px}
  .side-links a{min-height:44px;font-size:14.5px;gap:11px}
  .side-links a i{width:17px;height:17px}
  .pipeline{padding:10px 12px}.pipeline-row,.pipeline-run{font-size:13px}.pipeline-h{font-size:12.5px}

  /* ---- top bar ---- */
  .topbar{height:auto;min-height:56px;gap:6px;padding:calc(6px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) 6px max(8px,env(safe-area-inset-left))}
  .m-burger,.m-stoggle{display:grid;width:44px;height:44px;flex:none;border-radius:10px;border-color:transparent}
  .m-burger i,.m-stoggle i{width:23px;height:23px}
  .m-badge{display:block;position:absolute;top:-4px;right:-8px;font-style:normal;font-size:11px;font-weight:700;line-height:16px;min-width:18px;padding:0 4px;
    border-radius:99px;background:var(--blue);color:#fff;text-align:center;border:2px solid #fff;font-variant-numeric:tabular-nums;pointer-events:none}
  .m-badge:empty{display:none}
  .crumbs{flex:1;min-width:0;font-size:16px;padding-left:6px}
  .crumbs>span,.crumbs>i{display:none}
  .crumbs b{font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .global-search{display:none;flex:1;min-width:0;max-width:none;height:44px;border-radius:10px}
  .global-search input{min-width:0;font-size:16px}
  .global-search kbd{display:none}
  body.msearch .global-search{display:flex}
  body.msearch .crumbs,body.msearch #btnCollect{display:none}
  body.msearch .m-stoggle{background:var(--blue-50);color:var(--blue)}
  .topbar-right{gap:4px;margin-left:0}
  .last-col,#btnHelp{display:none}
  #btnCollect{width:44px;height:44px;padding:0;justify-content:center;border-color:transparent;box-shadow:none}
  #btnCollect span{display:none}#btnCollect i{width:21px;height:21px}

  /* ---- generic controls: ≥44px tap targets ---- */
  .btn,.btn.sm,.btn.xs{height:44px;min-height:44px;font-size:15px;padding:0 14px;border-radius:10px}
  .btn.xs{font-size:14px;padding:0 12px}
  .btn i{width:18px;height:18px}
  .select,.select.sm,.inp,.inp.sm{height:44px;border-radius:10px}
  .inp.xs{height:40px;width:76px}
  .seg{padding:3px;border-radius:11px}
  .seg button{min-height:38px;padding:0 14px;font-size:14.5px;border-radius:8px;white-space:nowrap}
  .toggle{min-height:44px;font-size:15px}
  .toggle span{width:42px;height:26px;flex:none}.toggle span::after{width:22px;height:22px}.toggle input:checked+span::after{left:18px}
  button.chip{min-height:44px;font-size:14px;padding:6px 13px}
  .chip.xs{font-size:13px}
  .icon-x{width:44px;height:44px}.icon-x i{width:19px;height:19px}
  .muted-p{font-size:14px}
  .muted{font-size:13px}
  code{font-size:13px;overflow-wrap:anywhere}
  .fl{font-size:14px}
  .hb{font-size:12.5px}
  .toast{max-width:calc(100vw - 24px);bottom:calc(16px + env(safe-area-inset-bottom));font-size:14.5px;padding:12px 16px}

  /* dropdown menus → bottom sheets (one-handed) */
  .split .menu{position:fixed;left:0;right:0;bottom:0;top:auto;width:auto;max-height:80vh;overflow:auto;border-radius:18px 18px 0 0;
    padding:6px 10px calc(12px + env(safe-area-inset-bottom));z-index:71;box-shadow:0 -10px 30px rgba(8,17,31,.25);overscroll-behavior:contain}
  .split .menu::before{content:"";display:block;width:40px;height:4px;border-radius:2px;background:#D0D5DD;margin:4px auto 8px}
  .split.open::before{content:"";position:fixed;inset:0;background:rgba(8,17,31,.45);z-index:70}
  .menu-h{font-size:12.5px;padding:8px 12px}
  .menu-i{min-height:54px;padding:12px;align-items:center;border-radius:10px}
  .menu-i>i{width:20px;height:20px;margin-top:0}
  .menu-i b{font-size:16px}.menu-i small{font-size:13.5px}

  /* ---- modals ---- */
  .modal-bg{padding:16px}
  .modal.wide{width:100%}
  .m-h{min-height:56px;padding:6px 8px 6px 16px}
  .m-h b{font-size:17px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .m-b{padding:16px}
  .m-f{flex-wrap:wrap;padding:10px 16px calc(10px + env(safe-area-inset-bottom))}
  .dc-row{grid-template-columns:minmax(0,1fr);gap:4px}
  .disc{flex-wrap:wrap}.disc .inp{flex:1 1 100%}.disc .btn{flex:1 1 auto;justify-content:center}
  .fchecks label{min-height:40px;font-size:14.5px}
  .fchecks input,.fl input[type=checkbox]{width:20px;height:20px}
  .me-row{flex-wrap:wrap}.me-row .fl{flex:1 1 160px;min-width:0}
  .me-prev{min-height:0}
  .me-it{font-size:14px}
  .cond,.act{flex-wrap:wrap;padding-bottom:8px;border-bottom:1px dashed var(--line)}
  .cond .c-f,.cond .c-o{width:auto;flex:1 1 calc(50% - 30px);min-width:0}
  .cond .c-v{flex:1 1 calc(100% - 50px);min-width:0}
  .act .a-t{width:auto;flex:1 1 100%}
  .act .a-v,.act .a-fold{flex:1 1 calc(100% - 50px);min-width:0}
  .keys{font-size:14px}

  /* ---- reader: stacked list → article ---- */
  .reader,.reader.pane-open,.reader.view-expanded.pane-open{display:block;position:relative;height:100%}
  .rl-col{height:100%;border-right:0}
  .rp-col{position:absolute;inset:0;z-index:5;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  .reader.pane-open .rp-col{display:block;animation:isp-slide .18s ease-out}
  .reader.view-expanded .rp-col{display:none}
  @keyframes isp-slide{from{transform:translateX(36px);opacity:.3}to{transform:none;opacity:1}}
  .rl-head{padding:10px 12px 8px}
  .rl-title-row{flex-wrap:wrap;gap:6px 8px}
  .rl-t{flex:1 1 auto;min-width:0}
  .rl-t h1{font-size:19px;min-width:0}
  .rl-counts{font-size:13px}.rl-counts span+span{display:none}
  .rl-actions{flex-wrap:wrap;gap:6px}
  #btnOut{width:44px;padding:0;justify-content:center}#btnOut .bl{display:none}
  .rl-sub{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:1px 0 8px}
  .rl-toolbar{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;margin:0 -12px;padding:0 12px 2px;gap:8px;scrollbar-width:none}
  .rl-toolbar::-webkit-scrollbar{display:none}
  .rl-toolbar>*{flex:none}
  .rl-toolbar .sp{display:none}
  #segUnread{order:0}#mrSplit{order:1}#btnReload{order:2}#segView{order:3}#selSort{order:4}#btnDups{order:5}
  .rl-toolbar .seg button{padding:0 13px;font-size:14.5px}
  .seg.icons button{width:44px;padding:0}.seg.icons i{width:18px;height:18px}
  #btnMarkAll{padding:0 12px}#btnMarkAll .bl{display:none}#btnMarkAll i{width:20px;height:20px}
  .split-caret2{width:44px;padding:0;justify-content:center}
  #btnReload{width:44px;padding:0;justify-content:center}#btnReload i{width:20px;height:20px}
  .rl-list{padding-bottom:env(safe-area-inset-bottom);-webkit-overflow-scrolling:touch}
  .arow{grid-template-columns:34px minmax(0,1fr);gap:0 6px;padding:12px 14px 12px 4px}
  .arow.unread::after{left:4px;top:21px}
  .st-btn{width:44px;height:44px;margin:-10px -4px -10px -6px}.st-btn i{width:19px;height:19px}
  .ar-line1{font-size:13px;gap:8px}
  .a-src{font-size:13px;max-width:60vw}.a-src.big{font-size:14.5px}
  .a-time{font-size:13px}
  .ar-title{font-size:16px;line-height:1.4;margin-top:3px}
  .ar-snip{font-size:14px;line-height:1.45;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;margin-top:3px}
  .ar-line3{gap:6px;margin-top:7px}
  .rchip{font-size:12px;padding:1px 7px}
  .also{font-size:12.5px}.atag{font-size:12.5px}
  .views{font-size:12.5px}
  .rl-end,.rl-more{font-size:13.5px}
  .aexp{padding:14px 14px 16px;max-width:none}
  .ax-head{flex-wrap:wrap;gap:6px}
  .ax-title{font-size:18px}
  .ax-text{font-size:16px}
  .view-cards .rl-list{grid-template-columns:minmax(0,1fr);padding:12px;gap:10px}
  .ac-title{font-size:15.5px}.ac-snip{font-size:14px}
  .view-cards .rl-list{grid-auto-rows:auto}.acard{height:auto;min-height:0}.acard>.ac-snip{max-height:none;-webkit-line-clamp:3}
  /* article screen */
  .rp-bar{padding:6px 10px;gap:4px}
  .rp-bar .m-hide{display:none}
  .rp-bar .btn.m-only{display:inline-flex}
  .rp-back{padding:0 14px 0 8px;font-size:15.5px;gap:6px}.rp-back i{width:21px;height:21px}
  .rp-nav{width:44px;padding:0;justify-content:center}.rp-nav i{width:23px;height:23px}
  .rp-bar .btn .bl{display:none}
  .rp-bar i.m-ico{display:inline-flex}
  .rp-bar [data-pane="star"],.rp-bar [data-pane="read"],.rp-bar a.btn{width:44px;padding:0;justify-content:center}
  .rp-bar [data-pane] i,.rp-bar a.btn i{width:20px;height:20px}
  .rp-body{padding:16px 16px calc(40px + env(safe-area-inset-bottom));max-width:none}
  .rp-meta{gap:8px}
  .rp-title{font-size:22px;line-height:1.3}
  .rp-url{font-size:12.5px}
  .rp-text{font-size:17px;line-height:1.65;overflow-wrap:break-word}
  .rp-text img,.rp-text video,.rp-text iframe{max-width:100%;height:auto}
  .rp-also,.rp-orig{font-size:14px}
  .rp-also a{padding:4px 0}
  .atag.big{font-size:13.5px;padding:4px 10px}
  .atag button{font-size:20px;padding:0 2px 0 6px;min-width:24px}
  .tag-form input,.tag-form input:focus{height:44px;font-size:16px;width:180px;max-width:100%}
  .rp-extra{font-size:13.5px}.rp-links{font-size:13.5px}
  .rp-empty small{display:none}
  /* search page */
  .rs-search{gap:8px;padding:6px 6px 6px 12px;border-radius:12px}
  .rs-search input#rsQ{min-width:0;flex:1 1 calc(100% - 40px);height:44px}
  .rs-search select,.rs-search .dfl,.rs-search .toggle{display:none}
  .rs-search.f-open select{display:block;flex:1 1 100%;height:44px;min-width:0}
  .rs-search.f-open .dfl{display:flex;flex:1 1 calc(50% - 4px);min-width:0;font-size:14px}
  .rs-search.f-open .dfl input{flex:1;min-width:0;height:44px}
  .rs-search.f-open .toggle{display:inline-flex;flex:1 1 100%}
  .rs-search .rs-more{display:inline-flex;flex:1 1 40%;justify-content:center}
  .rs-search.f-open .rs-more{background:var(--blue-50);border-color:var(--blue-100);color:var(--blue)}
  .rl-head:has(.rs-search) .rl-sub{display:none}
  .rl-head:has(.rs-search) .rs-stats{margin-top:10px}
  .rs-spark svg{width:128px;height:auto}
  .rs-search>.btn.primary{flex:1 1 40%;justify-content:center}
  .rs-nf{font-size:12px;background:var(--blue);color:#fff;border-radius:99px;padding:0 7px;line-height:18px}
  .rs-kpis{gap:10px 16px}.rs-kpis b{font-size:18px}.rs-kpis span{font-size:12.5px}
  .rs-facets .rchip{font-size:12.5px;padding:4px 8px}
  .rs-src{flex-wrap:nowrap;overflow-x:auto;margin:8px -12px 0;padding:0 12px 2px;scrollbar-width:none}
  .rs-src::-webkit-scrollbar{display:none}.rs-src>*{flex:none}
  .rs-help{font-size:13.5px;line-height:1.7}

  /* ---- management pages ---- */
  .page{padding-bottom:calc(28px + env(safe-area-inset-bottom));-webkit-overflow-scrolling:touch}
  .page-head{flex-direction:column;align-items:stretch;padding:14px 14px 12px;gap:10px}
  .page-title{font-size:21px}
  .eyebrow{font-size:12px;line-height:1.45}
  .page-head .rh-actions{flex-wrap:wrap}
  .page-head .rh-actions>.btn{flex:1 1 auto;justify-content:center}
  .kpis,.page .kpis{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:0 14px 12px}
  .kpi{padding:10px 12px;min-width:0}.kpi-l{font-size:12.5px}.kpi-v{font-size:22px}.kpi-s{font-size:12.5px}
  .filters{padding:0 14px 12px;gap:8px}
  .filters .search{min-width:0;flex:1 1 100%;height:44px}
  .search input,.global-search input{font-size:16px;min-width:0;align-self:stretch;height:auto}
  .filters .seg{max-width:100%;overflow-x:auto;scrollbar-width:none}.filters .seg button{flex:none}
  .table-wrap{margin:0 14px 16px}
  .pad,.muted-p.pad{padding:0 14px}
  .page-tabs{padding:0 14px 12px}
  .page-tabs .tabs{overflow-x:auto;scrollbar-width:none}
  .tab{min-height:40px;font-size:14.5px;flex:none}
  .card.pad-card{margin:0 14px 12px}.pad-card{padding:14px}
  .card-t{font-size:15px}.card-s{font-size:13.5px}
  .dup-kpis{grid-template-columns:minmax(0,1fr)}
  .dup-ex{font-size:14px}
  /* subscriptions table → cards */
  #subTable,#subTable tbody{display:block;width:100%}
  #subTable thead{display:none}
  #subTable tr{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px 10px;padding:12px 14px;border-top:1px solid var(--line-2);
    grid-template-areas:"name name name act act act" "fold fold fold fold fold fold" "rgn rgn rgn hl hl hl" "n24 n24 pd pd tot tot" "new new new run run run" "sp sp sp sp sp sp" "err err err err err err"}
  #subTable tbody tr:first-child{border-top:0}
  #subTable td{display:block;padding:0;border:0;font-size:14px;min-width:0}
  #subTable td:empty{display:none}
  #subTable td:nth-child(1){grid-area:name}#subTable td:nth-child(2){grid-area:fold}#subTable td:nth-child(3){grid-area:rgn}#subTable td:nth-child(4){grid-area:hl}
  #subTable td:nth-child(5){grid-area:n24}#subTable td:nth-child(6){grid-area:pd}#subTable td:nth-child(7){grid-area:sp}#subTable td:nth-child(8){grid-area:tot}
  #subTable td:nth-child(9){grid-area:new}#subTable td:nth-child(10){grid-area:run}#subTable td:nth-child(11){grid-area:err;white-space:normal;overflow-wrap:anywhere}#subTable td:nth-child(12){grid-area:act}
  #subTable td[colspan]{grid-area:auto;grid-column:1/-1}
  #subTable td:nth-child(n+5):nth-child(-n+10)::before{display:block;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted-2);margin-bottom:1px}
  #subTable td:nth-child(5)::before{content:"За добу"}#subTable td:nth-child(6)::before{content:"Сер./день"}#subTable td:nth-child(7)::before{content:"14 днів"}
  #subTable td:nth-child(8)::before{content:"Усього"}#subTable td:nth-child(9)::before{content:"Остання стаття"}#subTable td:nth-child(10)::before{content:"Останній збір"}
  #subTable td[colspan]::before{content:none}
  #subTable .num-r{text-align:left}
  #subTable .src-name{display:block;font-size:15.5px}
  #subTable .src-dom{font-size:12px}
  #subTable .folder{font-size:13px;margin-right:8px}
  #subTable .row-act{text-align:right;margin:-8px -8px 0 0}
  .row-act button{width:44px;height:44px}.row-act i{width:18px;height:18px}
  #subTable td:nth-child(7) .spark-svg{width:100%;max-width:170px;height:auto}
  /* rules / filters table → cards */
  .auto-t,.auto-t tbody{display:block;width:100%}
  .auto-t thead{display:none}
  .auto-t tr{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"en name act" "sum sum sum" "num num num";gap:6px 10px;padding:12px 14px;border-top:1px solid var(--line-2);align-items:center}
  .auto-t tbody tr:first-child{border-top:0}
  .auto-t td{display:block;padding:0;border:0;font-size:14.5px;min-width:0}
  .auto-t td:nth-child(1){grid-area:en}.auto-t td:nth-child(2){grid-area:name}.auto-t td:nth-child(3){grid-area:sum}.auto-t td:nth-child(4){grid-area:num}.auto-t td:nth-child(5){grid-area:act}
  .auto-t td[colspan]{grid-area:auto;grid-column:1/-1;white-space:normal}
  .auto-t .num-r{text-align:left;font-size:14px}
  .auto-t .num-r::before{content:attr(data-label) ": ";font-weight:500;color:var(--muted)}
  .auto-sum{font-size:14.5px;line-height:1.65;overflow-wrap:anywhere}
  .auto-sum .cz{font-size:12.5px}
  .auto-t .toggle{min-height:44px;min-width:44px}
  /* monitoring */
  .mon-edit{grid-template-columns:minmax(0,1fr)}.me-form,.me-prev{min-width:0}.fl .select,.fl .inp{width:100%;min-width:0;max-width:100%}
  .mon-grid{grid-template-columns:minmax(0,1fr);padding:0 14px;gap:12px}
  .mon-card{padding:14px}
  .mc-name{font-size:16px}.mc-q{font-size:12.5px}
  .mc-act{margin:-8px -8px 0 0}.mc-act button{width:44px;height:44px}.mc-act i{width:18px;height:18px}
  .mc-kpis{gap:6px}.mc-kpis div{padding:7px 8px;min-width:0}.mc-kpis b{font-size:18px}.mc-kpis span{font-size:12px}
  .mc-days{font-size:12px}
  .mc-f .btn{margin-left:auto}
  /* outputs & API */
  .out-grid{grid-template-columns:minmax(0,1fr);padding:0 14px;gap:12px}
  .out-new{padding:0 14px 12px}
  .out-new .select{flex:1 1 100%;height:44px;min-width:0}
  .out-new .btn{flex:1 1 auto;justify-content:center}
  .out-row{padding:12px 14px}
  .or-h b{font-size:15px;flex:1;min-width:0}
  .or-h .muted{white-space:normal;flex:1 1 100%;order:3}
  .or-h .sp{display:none}
  .or-h .btn.xs{width:44px;padding:0;justify-content:center}
  .copyrow code{font-size:12.5px;padding:10px 8px}
  .copyrow .btn{width:44px;padding:0;justify-content:center;flex:none}
  .fmt{width:42px;font-size:12px}
  .card-h{padding:14px 14px 10px}
  .ep td{font-size:13.5px}.ep td:first-child{width:56px}.ep code{overflow-wrap:anywhere}
  pre.code{font-size:12.5px;overflow-wrap:anywhere}
  .set-card{max-width:none}.set-card .toggle{flex-wrap:wrap}

  /* ---- Інфоспейс (ШІ) ---- */
  #screen-report.active{display:block;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}
  .report-head{padding:12px 14px}
  .rh-top{flex-direction:column;align-items:stretch;gap:10px}
  .rh-top>.eyebrow{white-space:normal;font-size:12px;line-height:1.45}
  .rh-actions{flex-wrap:wrap;gap:8px}
  .rh-actions>.btn{flex:1 1 auto;justify-content:center;padding:0 12px;font-size:14.5px}
  .report-title{font-size:18px;margin:6px 0 10px}
  .rh-meta{gap:8px}
  .stamp{font-size:13px;padding:6px 10px}
  .datepick{height:44px;padding:0 12px}.dp-text{font-size:15px}
  .status-badge{font-size:13.5px;padding:6px 12px}
  .period{flex:1 1 100%;flex-wrap:wrap;white-space:normal;border-left:0;padding-left:0;margin-left:0;gap:6px 12px;font-size:13.5px}
  .period-t{white-space:normal}
  .period-bar{order:3;flex:1 1 100%;width:auto}
  .newer-bar{flex-wrap:wrap;font-size:13.5px}
  .ai-strip{flex-direction:column;align-items:stretch;padding:12px 14px;gap:10px}
  .ais-l,.ais-r{gap:10px}
  .ais-prog{min-width:0;flex:1 1 100%;order:-1}
  .ais-t{font-size:14px}.ais-t .muted{white-space:normal}
  .ais-lh{font-size:13.5px;flex:1 1 100%}
  .lim{font-size:13.5px;flex-wrap:wrap}.lim-bar{width:64px;height:8px}.lim small{font-size:12px}
  #btnLog{margin-left:auto}
  .ai-log{padding:10px 14px;max-height:none;overflow:visible}
  .ai-jobs{width:100%}.ai-jobs td{font-size:12.5px;padding:5px 8px 5px 0;overflow-wrap:anywhere}
  .ai-log pre.code{max-height:320px}
  .report-body{display:block}
  .report-main{display:block}
  .section-bar{flex-direction:column;align-items:stretch;gap:8px;padding:14px 14px 0}
  .section-title{font-size:13px}
  .tab .n{font-size:12.5px}.st-n{font-size:12px}.ai-badge{font-size:12px}.flag-n{font-size:12px}
  #regionTabs{overflow-x:auto;scrollbar-width:none}#regionTabs::-webkit-scrollbar{display:none}
  .toolbar{flex-wrap:wrap;padding:10px 14px;gap:8px}
  .search.small{min-width:0;flex:1 1 100%;height:44px}
  .toolbar-spacer{display:none}
  .hint{white-space:normal;font-size:13px;flex:1 1 100%;order:5}.hint:empty{display:none}
  #btnAdd{margin-left:auto}
  .msg-list{overflow:visible;padding:4px 10px 24px}
  .group-h .gname{font-size:14px}.group-h .gcount{font-size:13px;white-space:nowrap}
  .msg{grid-template-columns:24px minmax(0,1fr);gap:0 8px;padding:12px 12px 10px 6px}
  .msg .handle{display:none}
  .msg .num{font-size:13px;padding-top:3px}
  .mtext{font-size:16px;line-height:1.5}
  .pchip{font-size:12px}.schip{font-size:12.5px}.schip.tg{font-size:12px}.mtime{font-size:12.5px}.thr{font-size:12px}
  .mside{grid-column:1/-1;flex-direction:row;align-items:center;justify-content:space-between;min-width:0;margin-top:6px;padding-left:32px;gap:8px}
  .mactions{opacity:1;order:2;gap:4px}
  .mactions button{width:44px;height:44px}.mactions i{width:18px;height:18px}
  .counter{min-height:44px;font-size:13px;padding:4px 10px;white-space:normal;text-align:left}
  .flag-note{font-size:13.5px}.flag-note .btn{height:44px;min-height:44px;font-size:13.5px}
  .report-side{border-left:0;border-top:1px solid var(--line);padding:14px 14px 24px;overflow:visible}
  .pcard-h{flex-wrap:wrap}.pcard-t{font-size:13px}.pcard-s{font-size:12.5px;white-space:normal}
  .checks li{font-size:14.5px;padding:9px 0;align-items:center}.cb{width:20px;height:20px}.checks .cnt{font-size:12.5px}
  .olist li{font-size:14.5px;padding:8px 0}
  .t3 .tt{font-size:14.5px}.t3 .ts{font-size:12.5px}
  .events{font-size:14px}.events td:first-child{width:84px}
  .ai-empty{padding:0 16px}

  /* ---- login ---- */
  .login-body{height:100vh;height:100dvh;padding:16px}
  .login-card{width:100%;max-width:380px;padding:24px 20px;gap:14px}
  .login-card .inp{height:50px;font-size:16px}
  .login-card .btn{height:50px;justify-content:center;font-size:16px}
}

/* ======================= phone ======================= */
@media (max-width:600px){
  .kpis,.page .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .kpis>.kpi:last-child:nth-child(odd){grid-column:1/-1}
  .rh-actions>.btn{flex:1 1 0;min-width:0;padding:0 10px}
  /* modals → full-screen sheets */
  .modal-bg{padding:0;align-items:stretch}
  .modal,.modal.wide{width:100%;max-width:none;height:100%;max-height:none;border-radius:0}
  .m-h{padding-top:calc(6px + env(safe-area-inset-top))}
  .m-b{flex:1}
  /* Інфоспейс: primary actions in a fixed bottom bar, reachable with the thumb */
  body.ai-mode #screen-report.active{padding-bottom:calc(80px + env(safe-area-inset-bottom))}
  body.ai-mode #aiStrip::before{content:"";position:fixed;left:0;right:0;bottom:0;height:calc(72px + env(safe-area-inset-bottom));background:rgba(255,255,255,.97);
    border-top:1px solid var(--line);box-shadow:0 -6px 18px rgba(16,24,40,.08);z-index:30}
  body.ai-mode #btnProcess{position:fixed;left:12px;bottom:calc(12px + env(safe-area-inset-bottom));width:calc(50% - 18px);height:48px;z-index:31;
    justify-content:center;font-size:15.5px;overflow:hidden;white-space:nowrap;border-radius:12px}
  body.ai-mode #btnProcess[disabled]{opacity:1;background:#6D9BD6;border-color:#6D9BD6}
  body.ai-mode #dlSplit{position:fixed;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));width:calc(50% - 18px);z-index:32;display:flex}
  body.ai-mode #dlSplit .split-main{flex:1;min-width:0;height:48px;justify-content:center;padding:0 8px;font-size:15.5px;border-radius:12px 0 0 12px}
  body.ai-mode #dlSplit .split-caret{height:48px;width:46px;flex:none;padding:0;justify-content:center;border-radius:0 12px 12px 0}
  body.ai-mode #dlSplit .split-main{font-size:0}body.ai-mode #dlSplit .split-sub{display:none}
  body.ai-mode #dlSplit .split-main::after{content:"Скачати";font-size:15.5px}
  body.ai-mode .toast{bottom:calc(86px + env(safe-area-inset-bottom))}
}
