﻿/* Линкей — версия для телефона: html[data-device="mobile"] (js/device.js) */
html:not([data-device="mobile"]) .m-ui{display:none!important}
.m-sheet[hidden]{display:none!important}
.dv-top{position:fixed;right:24px;bottom:24px;z-index:85;width:48px;height:48px;border-radius:50%;display:grid;place-items:center;padding:0;background:var(--panel-2);color:var(--ink);border:1px solid var(--line-2);box-shadow:0 6px 18px rgba(0,0,0,.45);cursor:pointer;opacity:0;pointer-events:none;transform:translateY(10px);transition:opacity .2s,transform .2s}
.dv-top.is-on{opacity:1;pointer-events:auto;transform:none}
.dv-top:hover{border-color:var(--teal);color:var(--teal)}
html:not([data-device="mobile"]):not([data-device="tablet"]) .dv-top,html:not([data-device="mobile"]):not([data-device="tablet"]) .lb-count{display:none}
.lb-count{position:absolute;top:22px;left:20px;margin:0;font:700 13px var(--f-ui);letter-spacing:.06em;color:var(--ink-2)}
.lb-hint{margin:10px 0 0;font:500 12px var(--f-ui);color:var(--muted)}
html.dv-lock,html.dv-lock body{overflow:hidden}

html[data-device="mobile"]{--head-h:52px;--tabbar-h:62px;--gutter:16px;scroll-padding-top:calc(var(--head-h) + 64px)}
html[data-device="mobile"] body{padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom))}
html[data-device="mobile"] .site-head{height:calc(var(--head-h) + env(safe-area-inset-top));padding-top:env(safe-area-inset-top)}
html[data-device="mobile"] .site-head__in{gap:10px;padding-left:max(var(--gutter),env(safe-area-inset-left));padding-right:max(var(--gutter),env(safe-area-inset-right))}
html[data-device="mobile"] .nav,html[data-device="mobile"] .nav-toggle{display:none!important}
html[data-device="mobile"] .brand{font-size:17px;gap:8px}
html[data-device="mobile"] .brand__logo{width:28px;height:28px;border-radius:8px}
html[data-device="mobile"] .brand__ver{font-size:10.5px;padding:2px 6px;border:1px solid rgba(233,166,63,.45);border-radius:10px;line-height:1.2}
html[data-device="mobile"] .org{padding-left:10px;gap:6px}
html[data-device="mobile"] .org__cross{width:24px;height:24px}
html[data-device="mobile"] .org__txt{display:none}

/* нижняя панель вкладок */
html[data-device="mobile"] .m-tabs{position:fixed;left:0;right:0;bottom:0;z-index:90;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));height:calc(var(--tabbar-h) + env(safe-area-inset-bottom));padding:0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);background:rgba(13,20,29,.97);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-top:1px solid var(--line-2)}
.m-tabs__i{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:48px;padding:6px 2px 4px;margin:0;color:var(--muted);font:600 11px/1.1 var(--f-ui);background:none;border:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
.m-tabs__i:hover{text-decoration:none;color:var(--ink)}
.m-tabs__i .ico{width:24px;height:24px}
.m-tabs__i.is-current{color:var(--teal)}
.m-tabs__i.is-current::before{content:"";position:absolute;top:0;left:30%;right:30%;height:3px;border-radius:0 0 3px 3px;background:var(--teal)}
.m-tabs__i:focus-visible{outline-offset:-4px}
/* нижний лист «Все разделы» */
html[data-device="mobile"] .m-sheet{position:fixed;inset:0;z-index:120}
.m-sheet__back{position:absolute;inset:0;background:rgba(3,6,10,.62);opacity:0;transition:opacity .25s}
.m-sheet__panel{position:absolute;left:0;right:0;bottom:0;max-height:84vh;display:flex;flex-direction:column;background:var(--bg-2);border-top:1px solid var(--line-2);border-radius:20px 20px 0 0;padding:0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);transform:translateY(100%);transition:transform .26s cubic-bezier(.2,.8,.2,1);box-shadow:0 -12px 40px rgba(0,0,0,.5)}
.m-sheet.is-open .m-sheet__back{opacity:1}
.m-sheet.is-open .m-sheet__panel{transform:translateY(0)}
.m-sheet__grip{flex:none;width:42px;height:5px;margin:9px auto 2px;border-radius:3px;background:var(--line-2)}
.m-sheet__head{flex:none;display:flex;align-items:center;justify-content:space-between;padding:2px 8px 2px 20px}
.m-sheet__head h2{font-size:17px;margin:0}
.m-sheet__close{width:44px;height:44px;display:grid;place-items:center;padding:0;background:none;border:0;border-radius:50%;color:var(--ink-2);cursor:pointer}
.m-sheet__body{overflow-y:auto;overscroll-behavior:contain;padding:0 16px 20px}
.m-sheet__cap{margin:14px 4px 8px;font:700 11px var(--f-ui);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.m-sheet__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.m-sheet__a{display:flex;align-items:center;gap:10px;min-height:52px;padding:10px 12px;background:var(--panel);border:1px solid var(--line);border-radius:12px;color:var(--ink);font:600 14.5px/1.2 var(--f-ui)}
.m-sheet__a:hover{text-decoration:none;border-color:var(--line-2)}
.m-sheet__a .ico{flex:none;color:var(--steel)}
.m-sheet__a.is-current{border-color:var(--teal);color:var(--teal);background:rgba(53,191,174,.08)}
.m-sheet__a.is-current .ico{color:var(--teal)}

/* полоса «В этом разделе» */
html[data-device="mobile"] .m-chips{position:sticky;top:calc(var(--head-h) + env(safe-area-inset-top));z-index:40;background:rgba(10,15,22,.95);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.m-chips__row{display:flex;gap:8px;overflow-x:auto;padding:6px 16px;scrollbar-width:none;overscroll-behavior-x:contain}
.m-chips__row::-webkit-scrollbar{display:none}
.m-chip{flex:none;display:inline-flex;align-items:center;max-width:76vw;min-height:40px;padding:0 15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:var(--panel);border:1px solid var(--line-2);border-radius:20px;color:var(--ink-2);font:600 13.5px var(--f-ui)}
.m-chip:hover{text-decoration:none;color:var(--ink)}
.m-chip.is-current{background:var(--teal);border-color:var(--teal);color:#06110f}

/* статья */
html[data-device="mobile"] .article{padding:18px var(--gutter) 36px;gap:0}
html[data-device="mobile"] .article__body{font-size:17px;line-height:1.62}
html[data-device="mobile"] .article__body section{margin-top:36px;padding-top:22px}
html[data-device="mobile"] .article__body figure.fig{margin:24px calc(-1 * var(--gutter))}
html[data-device="mobile"] .article__body figure.fig>img,html[data-device="mobile"] .article__body figure.fig>svg,html[data-device="mobile"] .article__body figure.fig>.diagram{border-left:0;border-right:0;border-radius:0}
html[data-device="mobile"] .article__body figure.fig>figcaption{margin-left:var(--gutter);margin-right:var(--gutter);font-size:13px}
html[data-device="mobile"] .article__body figure.fig--narrow,html[data-device="mobile"] .article__body figure.fig--page,html[data-device="mobile"] .pages figure.fig{margin-left:auto;margin-right:auto}
html[data-device="mobile"] .article__body figure.fig--narrow>img,html[data-device="mobile"] .article__body figure.fig--page>img,html[data-device="mobile"] .pages figure.fig>img{border:1px solid var(--line);border-radius:var(--r)}
html[data-device="mobile"] .article__body figure.fig--narrow>figcaption,html[data-device="mobile"] .article__body figure.fig--page>figcaption,html[data-device="mobile"] .pages figure.fig>figcaption{margin-left:0;margin-right:0}
html[data-device="mobile"] .pages figure.fig{margin:0}
/* карусели карточек */
html[data-device="mobile"] .m-car{display:flex!important;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;margin-left:calc(-1 * var(--gutter));margin-right:calc(-1 * var(--gutter));padding:4px var(--gutter) 6px;scroll-padding:0 var(--gutter);scrollbar-width:none;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
html[data-device="mobile"] .m-car::-webkit-scrollbar{display:none}
html[data-device="mobile"] .m-car>*{flex:0 0 84%;min-width:0;scroll-snap-align:start}
html[data-device="mobile"] .pages.m-car>*{flex-basis:64%}
html[data-device="mobile"] .m-dots{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;margin:4px 0 0;min-height:32px}
.m-dot{width:26px;height:32px;display:grid;place-items:center;padding:0;background:none;border:0;cursor:pointer}
.m-dot::before{content:"";width:7px;height:7px;border-radius:4px;background:var(--line-2);transition:width .2s,background .2s}
.m-dot.is-on::before{width:20px;background:var(--teal)}
.m-dots__n{font:600 13px var(--f-ui);color:var(--muted);font-variant-numeric:tabular-nums}

/* таблицы → карточки */
html[data-device="mobile"] table.m-stack{display:block;overflow:visible;font-size:14.5px}
html[data-device="mobile"] table.m-stack caption{display:block;position:static}
html[data-device="mobile"] table.m-stack.is-scroll caption::after{content:none}
html[data-device="mobile"] table.m-stack thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
html[data-device="mobile"] table.m-stack tbody{display:block}
html[data-device="mobile"] table.m-stack tr{display:block;margin:0 0 10px;padding:2px 14px;background:var(--panel);border:1px solid var(--line);border-left:3px solid var(--steel);border-radius:10px}
html[data-device="mobile"] table.m-stack tbody tr:hover{background:var(--panel)}
html[data-device="mobile"] table.m-stack td,html[data-device="mobile"] table.m-stack tbody th{display:grid;grid-template-columns:minmax(0,40%) minmax(0,1fr);gap:4px 12px;width:auto!important;padding:9px 0;border-bottom:1px solid var(--line);white-space:normal;text-align:left}
html[data-device="mobile"] table.m-stack td:last-child{border-bottom:0}
html[data-device="mobile"] table.m-stack td::before,html[data-device="mobile"] table.m-stack tbody th::before{content:attr(data-label);padding-top:2px;font:700 11px/1.35 var(--f-ui);letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
html[data-device="mobile"] table.m-stack td:first-child,html[data-device="mobile"] table.m-stack td:not([data-label]){display:block;padding:11px 0 9px;font-size:15.5px}
html[data-device="mobile"] table.m-stack td:first-child::before,html[data-device="mobile"] table.m-stack td:not([data-label])::before{content:none}
html[data-device="mobile"] table.m-stack tr.m-stack__grp{padding:12px 2px 2px;background:none;border:0}
html[data-device="mobile"] table.m-stack tr.m-stack__grp td{color:var(--amber);font-size:13px;letter-spacing:.06em;text-transform:uppercase;border:0}

/* сворачиваемые врезки */
html[data-device="mobile"] aside.m-fold{margin-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}
html[data-device="mobile"] aside.m-fold.is-folded{position:relative;max-height:11.5em;overflow:hidden}
html[data-device="mobile"] aside.m-fold.is-folded::after{content:"";position:absolute;left:0;right:0;bottom:0;height:4.5em;background:linear-gradient(rgba(18,27,39,0),var(--panel));pointer-events:none}
html[data-device="mobile"] .m-fold__btn{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:46px;margin:0 0 28px;padding:0 12px;background:var(--panel);border:1px solid var(--line);border-top:1px dashed var(--line-2);border-radius:0 0 var(--r) var(--r);color:var(--teal);font:700 14px var(--f-ui);cursor:pointer}
.m-fold__btn .ico{width:18px;height:18px;transform:rotate(90deg);transition:transform .2s}
.m-fold__btn[aria-expanded="true"] .ico{transform:rotate(-90deg)}
/* кнопка «наверх» над панелью вкладок */
html[data-device="mobile"] .dv-top{right:calc(14px + env(safe-area-inset-right));bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px)}

/* лайтбокс: полноэкранный, свайпы вместо стрелок */
html[data-device="mobile"] .lightbox{padding:calc(64px + env(safe-area-inset-top)) 0 calc(18px + env(safe-area-inset-bottom));touch-action:pinch-zoom}
html[data-device="mobile"] .lightbox img{max-width:100vw;max-height:calc(100vh - 220px);border-left:0;border-right:0}
html[data-device="mobile"] .lightbox__prev,html[data-device="mobile"] .lightbox__next{display:none}
html[data-device="mobile"] .lightbox__close{top:calc(10px + env(safe-area-inset-top));right:10px;width:48px;height:48px;border-radius:50%}
html[data-device="mobile"] .lightbox__cap{max-height:22vh;overflow:auto;padding:0 16px;font-size:13px}
html[data-device="mobile"] .lb-count{top:calc(24px + env(safe-area-inset-top))}

/* галерея: лента во всю ширину */
html[data-device="mobile"] .gallery{display:flex;flex-direction:column;gap:18px;margin:0 calc(-1 * var(--gutter))}
html[data-device="mobile"] .gallery .tile{border-left:0;border-right:0;border-radius:0}
html[data-device="mobile"] .gallery .tile figcaption{padding:12px var(--gutter) 14px}

/* главная */
html[data-device="mobile"] .section{padding:40px 0}
html[data-device="mobile"] .cards .card h3{font-size:18px}
html[data-device="mobile"] .card__go{display:inline-flex;align-items:center;min-height:44px}
html[data-device="mobile"] .hero__meta .btn{min-height:48px;display:flex;align-items:center;justify-content:center}

/* просмотр документа: одна страница, свайп, крупные кнопки снизу */
html[data-device="mobile"] .sample__view{padding-left:0;padding-right:0}
html[data-device="mobile"] .pv{height:calc(100svh - var(--head-h) - var(--tabbar-h) - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:430px;margin:0;border-left:0;border-right:0;border-radius:0}
html[data-device="mobile"] .pv__bar{justify-content:center;padding:6px 8px}
html[data-device="mobile"] .pv__bar>.pv__grp:not(:last-of-type),html[data-device="mobile"] .pv__zoom,html[data-device="mobile"] .pv__sp{display:none}
html[data-device="mobile"] .pv__bar>.pv__grp:last-of-type{flex-wrap:wrap;justify-content:center}
html[data-device="mobile"] .pv__bar button,html[data-device="mobile"] .pv__bar a{height:40px;padding:0 12px}
html[data-device="mobile"] .pv__thumbs{display:none!important}
html[data-device="mobile"] .pv__scroll{padding:0;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x pinch-zoom}
html[data-device="mobile"] .pv__scroll::-webkit-scrollbar{display:none}
html[data-device="mobile"] .pv__pages{display:flex;width:auto!important;height:100%;margin:0}
html[data-device="mobile"] .pv__page{flex:0 0 100%;width:100%;height:100%;margin:0;padding:8px;object-fit:contain;background:none;box-shadow:none;scroll-snap-align:center;scroll-snap-stop:always}
html[data-device="mobile"] .pvm{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;background:var(--panel);border-top:1px solid var(--line)}
.pvm__b{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:112px;height:48px;padding:0 14px;background:var(--bg-2);border:1px solid var(--line-2);border-radius:12px;color:var(--ink);font:700 15px var(--f-ui);cursor:pointer}
.pvm__b:disabled{opacity:.35;cursor:default}
.pvm__b .ico{width:20px;height:20px}
.pvm__n{font:600 14px var(--f-ui);color:var(--ink-2);font-variant-numeric:tabular-nums}
.pvm__n b{color:var(--teal);font-size:17px}
html[data-device="mobile"] .pvm__hint{margin:8px var(--gutter) 0;font:500 12.5px/1.4 var(--f-ui);color:var(--muted)}
html[data-device="mobile"] .pv--max{height:auto;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}

/* подвал: крупные цели касания */
html[data-device="mobile"] .site-foot{padding-bottom:28px}
html[data-device="mobile"] .site-foot ul{columns:2}
html[data-device="mobile"] .site-foot li{margin:0}
html[data-device="mobile"] .site-foot li a{display:inline-flex;align-items:center;min-height:44px}/* цели касания и минимальный кегль */
html[data-device="mobile"] .brand{min-height:44px}
html[data-device="mobile"] .cards .card__n{font-size:12px}
html[data-device="mobile"] .m-dots{min-height:40px}
html[data-device="mobile"] .m-dot{width:30px;height:40px}
html[data-device="mobile"] .shots .shot figcaption a{display:flex;align-items:center;min-height:40px}

html[data-device="mobile"] .pv:not(.pv--max){height:calc(100svh - var(--head-h) - var(--tabbar-h) - 28px - 54px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
html[data-device="mobile"] table.m-stack td:not(:first-child)>a:only-child{display:inline-flex;align-items:center;min-height:40px;min-width:40px;justify-content:center;justify-self:start}
html[data-device="mobile"] .article__body .m-car>figure.fig{margin:0}
html[data-device="mobile"] .article__body .m-car>figure.fig>img{border:1px solid var(--line);border-radius:var(--r)}
html[data-device="mobile"] .article__body .m-car>figure.fig>figcaption{margin-left:0;margin-right:0}
html[data-device="mobile"][data-orient="landscape"] .m-chips{position:relative;top:auto}
html[data-device="mobile"][data-orient="landscape"] .pv:not(.pv--max){height:calc(100svh - var(--head-h) - var(--tabbar-h) - 8px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:260px}
