/* Страница стандарта /standards/<alias> */

.nsd-std {
    --nsd-accent: #0345BF;
    --nsd-border: #dbe2ea;
    --nsd-muted: #5b6673;
}

.nsd-std__crumbs {
    font-size: .875rem;
    color: var(--nsd-muted);
    margin-bottom: 1rem;
}
.nsd-std__crumbs a { color: var(--nsd-accent); text-decoration: none; }
.nsd-std__crumbs a:hover { text-decoration: underline; }
.nsd-std__sep { margin: 0 .4rem; opacity: .5; }

.nsd-std__h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 .5rem; }
.nsd-std__subtitle {
    font-size: 1.1rem;
    color: var(--nsd-muted);
    margin: 0 0 1.5rem;
}

/* Интерактивный поиск по типоразмеру */
.nsd-std__finder {
    border: 1px solid var(--nsd-border);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.75rem;
    background: #f7f9fc;
}
.nsd-std__finder-title { font-size: 1.15rem; margin: 0 0 .85rem; }
.nsd-std__finder-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.nsd-std__finder-form label {
    display: flex;
    flex-direction: column;
    font-size: .8rem;
    color: var(--nsd-muted);
    gap: .25rem;
}
.nsd-std__finder-form select {
    min-width: 180px;
    padding: .5rem .6rem;
    border: 1px solid var(--nsd-border);
    border-radius: 8px;
    background: #fff;
    font-size: .95rem;
}
.nsd-std__finder-result { margin-top: 1rem; }
.nsd-std__finder-table {
    border-collapse: collapse;
    width: auto;
    min-width: 320px;
    margin: .5rem 0 1rem;
    font-size: .95rem;
}
.nsd-std__finder-table td {
    border: 1px solid var(--nsd-border);
    padding: .4rem .7rem;
}
.nsd-std__finder-table td:first-child { color: var(--nsd-muted); }
.nsd-std__finder-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.nsd-std__finder-btn {
    display: inline-block;
    padding: .55rem 1.1rem;
    border-radius: 8px;
    background: var(--nsd-accent);
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
}
.nsd-std__finder-btn:hover { filter: brightness(1.08); }
.nsd-std__finder-btn--ghost {
    background: #fff;
    color: var(--nsd-accent) !important;
    border: 1px solid var(--nsd-accent);
}
.nsd-std__finder-empty { color: var(--nsd-muted); }

/* Оглавление */
.nsd-std__toc {
    border: 1px solid var(--nsd-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}
.nsd-std__toc-title { font-size: 1.1rem; margin: 0 0 .6rem; }
.nsd-std__toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 2;
    column-gap: 2rem;
}
.nsd-std__toc-item { break-inside: avoid; margin: 0 0 .3rem; }
.nsd-std__toc-item--h3 { padding-left: 1rem; font-size: .92rem; }
.nsd-std__toc-item a { color: var(--nsd-accent); text-decoration: none; }
.nsd-std__toc-item a:hover { text-decoration: underline; }

/* Текст стандарта */
.nsd-std__body { font-size: 1.0625rem; line-height: 1.7; color: #1f2733; }
.nsd-std__body h2 {
    font-size: 1.55rem;
    line-height: 1.3;
    margin: 2.2rem 0 1rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--nsd-accent);
    scroll-margin-top: 90px;
}
.nsd-std__body h3 {
    font-size: 1.25rem;
    margin: 1.6rem 0 .75rem;
    scroll-margin-top: 90px;
}
.nsd-std__body h4 { font-size: 1.08rem; margin: 1.2rem 0 .5rem; }
.nsd-std__body p { margin: 0 0 .9rem; }
.nsd-std__body ul { margin: 0 0 1rem 1.1rem; padding: 0; }
.nsd-std__body li { margin: 0 0 .3rem; }
.nsd-std__body a { color: var(--nsd-accent); }
.nsd-std__caption,
.nsd-std__figcaption {
    font-size: .95rem;
    color: var(--nsd-muted);
    text-align: center;
    margin: .75rem 0;
}
.nsd-std__figure { margin: 1rem 0; text-align: center; }
.nsd-std__figure img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--nsd-border);
    border-radius: 8px;
    background: #fff;
}

/* Таблицы стандарта */
.nsd-std__table-wrap {
    overflow-x: auto;
    margin: 1rem 0 1.5rem;
    -webkit-overflow-scrolling: touch;
}
.nsd-std__body table {
    border-collapse: collapse;
    font-size: .85rem;
    min-width: 100%;
}
.nsd-std__body caption {
    caption-side: top;
    text-align: left;
    font-size: .95rem;
    color: var(--nsd-muted);
    padding: .3rem 0 .5rem;
}
.nsd-std__body th,
.nsd-std__body td {
    border: 1px solid var(--nsd-border);
    padding: .3rem .45rem;
    text-align: center;
    vertical-align: middle;
}
.nsd-std__body th { background: #eef3fb; font-weight: 600; }

.nsd-std__filterbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    margin: 1.5rem 0 .5rem;
}
.nsd-std__filterbar input {
    flex: 1 1 260px;
    padding: .5rem .7rem;
    border: 1px solid var(--nsd-border);
    border-radius: 8px;
    font-size: .95rem;
}

@media (max-width: 700px) {
    .nsd-std__h1 { font-size: 1.45rem; }
    .nsd-std__toc-list { columns: 1; }
}

/* Таблицы данных с двухуровневой шапкой (Ряд 1 / Ряд 2) */
.nsd-std__body table.nsd-std__dt {
    border-collapse: collapse;
    font-size: .8rem;
    width: 100%;
}
.nsd-std__body table.nsd-std__dt caption {
    caption-side: top;
    text-align: left;
    font-weight: 600;
    color: #1f2733;
    padding: .2rem 0 .5rem;
}
.nsd-std__body table.nsd-std__dt thead th {
    background: #eef3fb;
    font-weight: 600;
    padding: .3rem .4rem;
    white-space: nowrap;
}
.nsd-std__body table.nsd-std__dt thead tr:nth-child(2) th {
    font-weight: 400;
    font-size: .72rem;
    color: #5b6673;
}
.nsd-std__body table.nsd-std__dt th[scope="row"] {
    background: #f7f9fc;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 1;
}
.nsd-std__body table.nsd-std__dt .nsd-std__pn { left: 3.5rem; }
.nsd-std__body table.nsd-std__dt td {
    padding: .25rem .4rem;
    text-align: center;
    border: 1px solid #dbe2ea;
    white-space: nowrap;
}
.nsd-std__mass-title { font-size: 1.05rem; margin: 1.4rem 0 .5rem; }

@media print {
    .nsd-std__finder,
    .nsd-std__toc,
    .nsd-std__filterbar { display: none !important; }
    .nsd-std__body { font-size: 10pt; }
    .nsd-std__table-wrap { overflow: visible; }
}


/* --- Главы стандарта (разбивка на отдельные страницы) --- */
.nsd-std__layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    margin-top: 1rem;
}
.nsd-std__side {
    position: sticky;
    top: 1rem;
    padding: 14px 16px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    background: #fbfcfe;
    font-size: .95rem;
}
.nsd-std__side-title { font-size: 1rem; margin: .2rem 0 .6rem; }
.nsd-std__side .nsd-std__toc-list { list-style: none; padding-left: 0; margin: 0 0 1rem; columns: 1; column-count: 1; }
.nsd-std__side .nsd-std__toc-item { padding: .15rem 0; }
.nsd-std__main { min-width: 0; }
.nsd-std__pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e3e8ef;
}
.nsd-std__pager a { max-width: 48%; }
.nsd-std__pager-next { margin-left: auto; text-align: right; }

@media (max-width: 900px) {
    .nsd-std__layout { grid-template-columns: 1fr; }
    .nsd-std__side { position: static; }
}

@media print {
    .nsd-std__side,
    .nsd-std__pager { display: none !important; }
}
.nsd-std__side .nsd-std__toc-item--current { font-weight: 600; }
.nsd-std__side .nsd-std__toc-item--current a { color: #0b3d91; }
/* --- Текст по ширине + списки/сноска (1.2.6) --- */
.nsd-std__body p,
.nsd-std__body li { text-align: justify; }
.nsd-std__body ul.nsd-std__list,
.nsd-std__body ol.nsd-std__olist { padding-left: 1.4rem; margin: .6rem 0; }
.nsd-std__body ul.nsd-std__list > li,
.nsd-std__body ol.nsd-std__olist > li { margin-bottom: .35rem; }
.nsd-std__body p.nsd-std__footnote {
    margin-top: 1.2rem;
    padding-top: .6rem;
    border-top: 1px solid #e3e8ef;
    font-size: .95rem;
    color: #444;
}