/* Five-pass editorial UX review. Keep refinements separate and reviewable. */
.article-header h1{max-width:22ch;letter-spacing:-.035em}
.article-summary{font-size:20px;line-height:28px;color:var(--muted);max-width:60ch}
.article-body{padding:40px;overflow:hidden}
.article-body>p,.article-body>ul,.article-body>ol{max-width:68ch;font-size:18px;line-height:28px}
.article-body>p{margin-bottom:24px}
.article-body>h2{margin-top:48px;margin-bottom:24px;scroll-margin-top:112px}
.article-body>h2:first-child{margin-top:0}
.toc{margin-bottom:32px}
.toc summary{cursor:pointer;font-weight:600;min-height:32px}
.toc ol{margin-top:16px;margin-bottom:0}
.toc li{margin-bottom:8px}
.feed-intro{margin-bottom:24px}
.feed-intro .eyebrow{margin-bottom:12px}
.feed-intro h1{margin-bottom:12px}
.shell-focused .editor{max-width:none;width:100%;margin:0}
.feed-cover{margin:24px 0 8px;overflow:hidden;border-radius:8px;aspect-ratio:16/9}
.feed-cover img{width:100%;height:100%;object-fit:cover;display:block}
.header-actions .btn{white-space:nowrap}
.story-number{min-width:24px;flex-shrink:0;white-space:nowrap}
.rail-story{gap:12px}
.rail .badge{white-space:nowrap}
.rich-figure img{width:100%;height:auto;aspect-ratio:3/2;object-fit:cover}
.article-body .rich-figure img,.article-header .rich-figure img{height:auto;aspect-ratio:auto;object-fit:contain}
.rich-table-scroll{overscroll-behavior-x:contain}
.article-header .rich-figure{margin:24px 0}
.article-header .rich-figure img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:8px}
.article-header .rich-figure figcaption{font-size:12px;line-height:16px;color:var(--muted);margin-top:8px}
:root[data-theme=dark] .search img,:root[data-theme=dark] [data-menu] img,:root[data-theme=dark] [data-theme] img{filter:invert(1)}
@media(max-width:680px){html{scroll-padding-top:24px}.article-header .rich-figure{margin-left:-16px;margin-right:-16px}.article-header .rich-figure img{border-radius:0}.article-header .rich-figure figcaption{padding:0 16px}.rich-table-scroll{max-width:100%}}
.sidebar{max-height:calc(100dvh - 120px);overflow-y:auto;scrollbar-width:thin}
@media(max-width:680px){
 .topbar{position:relative;top:0}
 html:has(body.menu-open){overflow:hidden}
 .sidebar.is-open{top:var(--menu-top,120px);bottom:0;height:auto;max-height:none;padding-top:16px;overscroll-behavior:contain}
 .article-body{padding:24px 16px}
 .article-body>p,.article-body>li,.article-body>ul,.article-body>ol{font-size:16px;line-height:24px}
 .article-body>h2{font-size:24px;line-height:32px;margin-top:32px;scroll-margin-top:24px}
 .article-header h1{font-size:30px;line-height:36px;max-width:none}
 .article-summary{font-size:18px;line-height:28px}
 .article-header .author-row{flex-wrap:wrap}
 .article-header .author-row .btn{margin-left:40px}
 .feed-intro h1{font-size:30px;line-height:36px}
 .tabs{overflow-x:auto;flex-wrap:nowrap}
}

/* Writer controls remain readable at narrow widths and high zoom. */
.editor-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:24px 0 16px;max-width:100%;min-width:0}
.editor-toolbar-label{flex-basis:100%;font-size:14px;line-height:20px;font-weight:600;margin-bottom:4px}
.editor-toolbar .btn{min-height:44px;padding:8px 12px;max-width:100%;white-space:normal;flex:0 1 auto}
.editor-block-dialog{width:min(560px,90vw);max-width:90vw;max-height:90dvh;overflow-y:auto;overscroll-behavior:contain;padding:24px;scrollbar-width:thin}
.editor-block-dialog h2{font-size:24px;line-height:32px;margin-bottom:24px}
.editor-block-form{min-width:0}
.editor-block-form .field{margin-bottom:16px}
.editor-block-form textarea{min-height:144px;max-width:100%}
.editor-block-form input[type=file]{font-size:14px;line-height:20px;padding:12px;white-space:normal;max-width:100%}
.editor-block-form .row{flex-wrap:wrap;gap:8px;justify-content:flex-end}
.editor-block-form .row .btn{min-height:44px;max-width:100%;white-space:normal}
.editor-block-error{font-size:14px;line-height:20px;margin:8px 0 16px}
.editor-sources{margin:32px 0}
.editor-sources>h2{font-size:20px;line-height:28px;margin-bottom:8px}
.editor-sources>p{font-size:14px;line-height:20px;margin-bottom:16px}
.editor-source-list{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}
.editor-source-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) auto;gap:12px;align-items:end;min-width:0}
.editor-source-row .field{margin:0;min-width:0;font-size:14px;line-height:20px}
.editor-source-row .btn,.editor-sources>.row .btn{min-height:44px;white-space:normal}
.editor-source-error{grid-column:1/-1;font-size:12px;line-height:16px;margin:0}
.editor-source-count{font-size:12px;line-height:16px}
@media(max-width:680px){
 .editor-toolbar{gap:8px;margin-top:24px}
 .editor-toolbar .btn{padding:8px 12px;font-size:12px;line-height:16px;flex:1 1 96px}
 .editor-block-dialog{padding:24px 16px;width:90vw;max-width:90vw;max-height:90dvh}
 .editor-block-form .row .btn{flex:1 1 96px}
 .editor-source-row{grid-template-columns:minmax(0,1fr);gap:12px}
 .editor-source-row>.btn{justify-self:start}
 .editor-source-row .field input{width:100%}
 .editor-source-error{grid-column:1}
}
@media(max-width:680px){.rich-table table{min-width:600px}.rich-table::after{content:"Таблицу можно прокрутить в сторону →";display:block;font-size:12px;line-height:16px;color:var(--muted);margin-top:8px}.rich-table th,.rich-table td{overflow-wrap:normal;word-break:normal}}

/* UI system v1: canonical aliases and semantic primitives, after legacy rules. */
:root,:root[data-theme=dark]{--bg:var(--color-canvas);--surface:var(--color-surface);--ink:var(--color-text);--muted:var(--color-text-muted);--line:var(--color-border-subtle);--soft:var(--color-surface-subtle);--accent:var(--color-action-primary);--accent-ink:var(--color-on-primary);--danger:var(--color-danger);--focus:var(--color-focus);--curve:var(--motion-curve)}
body{font-family:var(--font-ui);font-size:var(--type-body-size);line-height:var(--type-body-leading);font-weight:var(--weight-regular)}
h1{font-size:var(--type-heading-size);line-height:var(--type-heading-leading)}
h2{font-size:var(--type-section-size);line-height:var(--type-section-leading)}
h3{font-size:var(--type-subheading-size);line-height:var(--type-subheading-leading)}
p{font-size:var(--type-body-size);line-height:var(--type-body-leading)}
h1,h2,h3{font-weight:var(--weight-semibold)}
.btn,button{font-family:var(--font-ui);font-size:var(--type-button-size);line-height:var(--type-button-leading);font-weight:var(--weight-semibold);border-radius:var(--radius-control);transition:transform var(--motion-feedback) var(--motion-curve),opacity var(--motion-feedback) var(--motion-curve)}
.btn.primary,.primary{background:var(--color-action-primary);border-color:var(--color-action-primary);color:var(--color-on-primary)}
.btn.primary:hover,.primary:hover{background:var(--color-action-primary-hover);border-color:var(--color-action-primary-hover);color:var(--color-on-primary)}
.meta,.caption-5{font-size:var(--type-meta-size);line-height:var(--type-meta-leading)}
.field input:not([type=checkbox]):not([type=radio]),.field textarea,.field select,.editor-source-row input{border-color:var(--color-border-control);border-radius:var(--radius-control);font-family:var(--font-ui)}
:focus-visible{outline:var(--focus-width) solid var(--color-focus);outline-offset:var(--focus-offset)}
.article-body code,.editor-preview code{font-family:var(--font-code)}
.card{border-radius:var(--radius-card);border-color:var(--color-border-subtle)}
.rich-callout-note{background:var(--color-info-surface);color:var(--color-info)}
.rich-callout-warning{background:var(--color-warning-surface);color:var(--color-warning)}
.notice{background:var(--color-success-surface);border-color:var(--color-success-border);color:var(--color-success)}
.notice.error{background:var(--color-danger-surface);border-color:var(--color-danger-border);color:var(--color-danger)}
.notice.warning{background:var(--color-warning-surface);border-color:var(--color-warning-border);color:var(--color-warning)}
.rich-figure img{border-radius:var(--radius-media)}
.editor-toolbar{gap:var(--space-75);margin-top:var(--space-300);margin-bottom:var(--space-200)}
.editor-block-dialog{padding:var(--space-300);border-radius:var(--radius-xl)}
.editor-block-form .field{margin-bottom:var(--space-200)}
.editor-source-list{gap:var(--space-200)}
.editor-source-row{gap:var(--space-100)}
.editor-toolbar .btn,.editor-block-form .btn,.editor-sources .btn{min-height:var(--control-hit-size)}
.sidebar nav .nav-icon,.ui-icon{width:var(--icon-size);height:var(--icon-size)}
.topbar{z-index:var(--layer-header)}
.sidebar.is-open{z-index:var(--layer-navigation)}
body.menu-open .topbar{z-index:var(--layer-menu-control)}
.toast{z-index:var(--layer-toast)}
.skip-link{z-index:var(--layer-skip)}
@media(max-width:680px){
 :root{--type-heading-size:var(--text-3xl-size);--type-heading-leading:var(--text-3xl-leading);--radius-card:var(--radius-lg)}
 .editor-block-dialog{padding:var(--space-300) var(--space-200)}
}
html{scroll-behavior:auto}

.model-directory{min-width:0}
.model-filters{display:flex;flex-wrap:wrap;gap:var(--space-100);margin:var(--space-200) 0}
.model-filters .btn{white-space:normal;text-align:center}
.model-directory .model-card{min-width:0;overflow-wrap:anywhere}
.model-directory .catalog-grid{grid-template-columns:minmax(0,1fr)}
.model-directory .model-card{padding:20px;margin:0}
.model-versions{display:grid;gap:8px;padding:0;margin:16px 0;list-style:none}
.model-version>a{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) auto;gap:12px;align-items:center;padding:12px;background:var(--soft);border-radius:8px}
.model-version>a:hover{box-shadow:inset 0 0 0 1px var(--focus)}
.model-version h3{margin:0 0 4px;font-size:16px;line-height:24px}
.model-version p{margin:0;font-size:14px;line-height:20px}
@media(max-width:680px){.model-version>a{grid-template-columns:minmax(0,1fr) auto;row-gap:4px}.model-version>a>p{grid-column:1/-1;grid-row:2}.model-version>a>span{grid-column:2;grid-row:1}}
.model-benchmarks{margin-top:var(--space-300)}
.model-benchmark-table{overflow:auto;margin:var(--space-200) 0}
.model-benchmark-table table{width:100%;border-collapse:collapse;text-align:left;font-variant-numeric:tabular-nums}
.model-benchmark-table th,.model-benchmark-table td{padding:var(--space-100);border-bottom:1px solid var(--line)}
.model-benchmark-table thead th,.model-benchmark-table td{white-space:nowrap}
