/* ============================================================
   PAC — SUBSTANCES REGISTRY
   Основные стили страницы. Мобильные переопределения находятся
   в substances-mobile.css и подключаются после этого файла.
   ============================================================ */

:root {
    --bg: #edf0f3;
    --paper: #fff;
    --ink: #202a35;
    --muted: #65717e;
    --navy: #182532;
    --line: #dce2e7;
    --accent: #5eb1ce;
    --category-color: #5b9db8;
    --category-soft: #edf5f8;
    --category-deep: #315b70;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 Arial, Helvetica, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }

.site-header { min-height: 76px; padding: 0 34px; background: #17232e; color: #f6f8fa; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: .12em; }
.brand-name small { display: block; font-size: 8px; letter-spacing: .16em; color: #9eb0bd; }
.header-user { display: flex; align-items: center; gap: 20px; }
.user-details { display: flex; flex-direction: column; text-align: right; }
.user-greeting { font-size: 13px; font-weight: 700; }
.user-access { font-size: 11px; color: #aab8c3; }
.logout-link { border: 1px solid #60717e; border-radius: 5px; padding: 7px 12px; color: #eaf0f4; text-decoration: none; font-size: 12px; }

.page-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar { background: #202f3b; color: #dce5eb; padding: 30px 18px; position: sticky; top: 0; height: 100vh; align-self: start; }
.sidebar-heading { padding: 0 11px 14px; color: #91a2af; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.sidebar-nav a { display: flex; justify-content: space-between; padding: 12px; color: #d3dde4; text-decoration: none; border-radius: 5px; font-size: 15px; border-left: 3px solid transparent; }
.sidebar-nav a:hover { background: #2d414f; }
.sidebar-nav a.active { background: #314858; border-left-color: var(--accent); color: #fff; }
.sidebar-nav a span { font-size: 11px; color: #9eb4c1; border: 1px solid #607887; border-radius: 3px; padding: 0 5px; }
.sidebar-note { position: absolute; bottom: 23px; left: 26px; color: #8ea1ae; font-size: 10px; letter-spacing: .1em; }
.status-dot { display: inline-block; width: 6px; height: 6px; background: #70b58a; border-radius: 50%; margin-right: 6px; }

.main-content { min-width: 0; padding: 32px clamp(18px, 4vw, 62px) 40px; }
.page-topline { display: flex; justify-content: space-between; gap: 12px; color: #7d8993; font-size: 11px; font-weight: 800; letter-spacing: .14em; padding-bottom: 12px; border-bottom: 1px solid #d7dde2; }
.page-hero { position: relative; overflow: hidden; margin: 25px 0 24px; padding: 42px; background: linear-gradient(116deg, #1a2a37, #304858); color: #f6f8fa; border-radius: 8px; box-shadow: 0 12px 34px #13223014; }
.page-hero:after { content: "PAC"; position: absolute; right: 16px; top: -45px; color: #ffffff09; font-size: 190px; font-weight: 900; pointer-events: none; }
.hero-kicker, .eyebrow { font-size: 11px; letter-spacing: .18em; font-weight: 800; color: #9dc4d6; }
.page-hero h1 { margin: 9px 0 7px; font-size: clamp(34px, 3.2vw, 50px); line-height: 1.1; }
.page-hero > p { position: relative; max-width: 720px; color: #c1ced6; margin: 0; }
.hero-stats { display: flex; gap: 34px; margin-top: 27px; }
.hero-stats div { display: flex; align-items: baseline; gap: 8px; border-left: 1px solid #506574; padding-left: 13px; }
.hero-stats strong { font-size: 27px; }
.hero-stats span { font-size: 11px; color: #b9c7d0; text-transform: uppercase; letter-spacing: .08em; }

.section-marker { font-size: 11px; color: #788692; font-weight: 800; letter-spacing: .15em; margin-bottom: 8px; }
.intro-panel, .content-panel, .closing-note { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 5px 17px #13223009; }
.intro-panel { padding: 27px 30px; margin-bottom: 30px; }
.intro-panel h2, .section-title { margin: 0 0 12px; font-size: 27px; line-height: 1.25; }
.intro-panel p { font-size: 15px; color: #4d5a65; margin: 8px 0; line-height: 1.7; }
.note { margin: 16px 0; padding: 13px 16px; background: #eef4f7; border-left: 3px solid #6c91a5; border-radius: 3px; color: #50636f; font-size: 13px; line-height: 1.65; }
.content-section { margin: 30px 0; }
.section-heading { margin-bottom: 15px; }
.section-heading > p { margin: 0; color: #6a7782; font-size: 14px; }

.category-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 16px 0 13px; }
.search-wrap { display: flex; align-items: center; gap: 9px; width: min(460px, 100%); min-height: 43px; padding: 0 13px; background: #fff; border: 1px solid #d5dde3; border-radius: 5px; }
.search-icon { color: #718491; font-size: 23px; line-height: 1; }
.search-wrap input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.result-count { color: #87939c; font-size: 11px; }
.category-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; }
.category-tab { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 9px 12px; text-align: left; border: 1px solid #d9e0e5; border-radius: 5px; background: #f9fbfc; color: #50616d; transition: background .18s, border-color .18s, transform .18s; }
.category-tab:hover { background: #fff; border-color: #aebfc9; transform: translateY(-1px); }
.category-tab.active { background: #eaf3f7; border-color: #8eb7c8; box-shadow: inset 3px 0 var(--category-color); color: #29485a; }
.tab-code { display: grid; place-items: center; min-width: 48px; min-height: 29px; padding: 3px 6px; border-radius: 4px; background: #e8eef2; color: #496777; font: 700 11px Consolas, monospace; }
.tab-name { font-size: 12px; font-weight: 700; line-height: 1.3; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.category-panel { --category-color: #5b9db8; --category-soft: #edf5f8; --category-deep: #315b70; background: #fff; border: 1px solid #dce3e8; border-radius: 7px; overflow: hidden; }
.category-panel[hidden] { display: none !important; }
.category-panel.category-amn { --category-color: #8b7ca9; --category-soft: #f2eff7; --category-deep: #594d72; }
.category-panel.category-mp { --category-color: #6c9c83; --category-soft: #edf5f0; --category-deep: #416b55; }
.category-panel.category-st { --category-color: #bd9b5e; --category-soft: #f8f3e9; --category-deep: #79633b; }
.category-panel.category-an { --category-color: #7298b4; --category-soft: #eef3f7; --category-deep: #48677f; }
.category-panel.category-ad { --category-color: #68a69b; --category-soft: #edf6f4; --category-deep: #3f7169; }
.category-panel.category-nb { --category-color: #8a83b1; --category-soft: #f1f0f8; --category-deep: #59527d; }
.category-panel.category-pr { --category-color: #9b9b68; --category-soft: #f4f4ec; --category-deep: #6c6d45; }
.category-panel.category-dg { --category-color: #649da5; --category-soft: #edf5f6; --category-deep: #3d6b72; }
.category-panel.category-tx { --category-color: #b77d79; --category-soft: #f8efee; --category-deep: #7b4e4b; }
.category-panel.category-rc { --category-color: #a58c64; --category-soft: #f6f2eb; --category-deep: #705b3c; }
.category-heading { position: relative; display: flex; justify-content: space-between; gap: 20px; padding: 25px 28px 22px; background: linear-gradient(110deg, var(--category-soft), #fff); border-bottom: 1px solid #e3e8eb; }
.category-kicker { margin-bottom: 7px; color: var(--category-deep); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.category-heading h2 { margin: 0 0 7px; color: #263b49; font-size: 25px; line-height: 1.25; }
.category-heading p { max-width: 760px; margin: 0; color: #63717b; font-size: 13px; line-height: 1.65; }
.category-code { display: inline-block; margin-right: 5px; color: var(--category-deep); font-family: Consolas, monospace; }
.category-mark { flex: 0 0 auto; display: grid; place-items: center; width: 65px; height: 65px; border: 1px solid color-mix(in srgb, var(--category-color), white 55%); border-radius: 8px; color: var(--category-deep); background: #ffffffa8; font: 800 20px Consolas, monospace; }
.category-notice { margin: 18px 22px 8px; padding: 12px 15px; border-left: 3px solid var(--category-color); border-radius: 3px; background: var(--category-soft); color: #596873; font-size: 12px; line-height: 1.6; }
.order-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px 4px; }
.order-label { color: #87939c; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.order-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.order-filter { padding: 6px 11px; border: 1px solid #d8e0e5; border-radius: 4px; background: #fff; color: #64727d; font-size: 11px; }
.order-filter.active { border-color: var(--category-color); background: var(--category-soft); color: var(--category-deep); font-weight: 700; }
.order-section { margin: 17px 22px 24px; }
.order-section[hidden] { display: none !important; }
.order-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid #e5e9ec; }
.order-heading > div { display: flex; align-items: center; gap: 10px; }
.order-index { color: var(--category-color); font: 700 12px Consolas, monospace; }
.order-heading h3 { margin: 0; color: #344957; font-size: 18px; }
.order-heading p { max-width: 570px; margin: 0; color: #84909a; font-size: 11px; line-height: 1.5; text-align: right; }
.empty-order, .empty-category { margin: 13px 0; padding: 20px; border: 1px dashed #d4dde3; border-radius: 5px; background: #fafcfd; color: #7a8790; font-size: 12px; text-align: center; }
.empty-category { margin: 22px; padding: 30px 20px; }
.empty-category strong { display: block; margin-bottom: 5px; color: #4f626f; font-size: 14px; }
.empty-category p { margin: 0; }

.substance-card { margin: 14px 0; border: 1px solid #dce3e8; border-radius: 6px; background: #fff; overflow: hidden; }
.substance-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #f5f8fa; border-bottom: 1px solid #e4e9ed; }
.substance-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.substance-code { color: #2e4d60; font: 800 17px Consolas, monospace; }
.order-tag, .substance-status { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 3px; font-size: 9px; font-weight: 800; letter-spacing: .07em; }
.order-tag-one { color: #466a7e; background: #e7f0f4; }
.order-tag-two { color: #80633c; background: #f5efdf; }
.order-tag-three { color: #86534e; background: #f6eae8; }
.order-tag-four { color: #060055; background: #cbcfe3; }
.order-tag-five { color: #341b44; background: #bcaae3; }
.order-tag-six { color: #0c4a5f; background: #d6efdc; }
.order-tag-seven { color: #0f4c5c; background: #d3ebee; }
.order-tag-eight { color: #5c3b0a; background: #f3e2c2; }
.order-tag-nine { color: #6a2b3c; background: #f4dde3; }
.order-tag-ten { color: #2f3a45; background: #dde3e8; }
.status-draft { color: #7a6b52; background: #f3efe7; }
.card-toggle { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border: 1px solid #d1dbe1; border-radius: 4px; background: #fff; color: #5e7180; font-size: 19px; line-height: 1; }
.substance-card-body { display: grid; grid-template-columns: minmax(190px, 260px) minmax(0, 1fr); gap: 22px; padding: 18px; }
.substance-media { min-width: 0; }
.image-open { position: relative; display: grid; place-items: center; width: 100%; min-height: 205px; padding: 0; overflow: hidden; border: 1px solid #dce3e8; border-radius: 5px; background: repeating-linear-gradient(135deg, #f5f7f8, #f5f7f8 10px, #eef2f4 10px, #eef2f4 20px); }
.image-open img { display: block; width: 100%; height: 205px; object-fit: contain; color: #7c8992; font-size: 12px; }
.image-zoom-hint { position: absolute; right: 7px; bottom: 7px; padding: 4px 7px; border-radius: 3px; background: #17232ed9; color: #fff; font-size: 9px; opacity: 0; transition: opacity .2s; }
.image-open:hover .image-zoom-hint { opacity: 1; }
.image-caption { margin-top: 7px; color: #929da5; font-size: 9px; font-weight: 700; letter-spacing: .09em; text-align: center; }
.summary-label { margin-bottom: 7px; color: #82909a; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.substance-summary > p { margin: 0 0 14px; color: #566570; font-size: 13px; line-height: 1.65; }
.placeholder-text { color: #87939b !important; font-style: italic; }
.substance-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.substance-meta > div { padding: 9px 10px; border: 1px solid #e7ecef; border-radius: 4px; background: #fafcfd; }
.substance-meta span, .substance-meta strong { display: block; }
.substance-meta span { margin-bottom: 3px; color: #89959d; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.substance-meta strong { color: #465966; font-size: 11px; font-weight: 700; }
.substance-details { padding: 0 18px 17px; }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-field { padding: 11px 12px; border: 1px solid #e7ecef; border-radius: 4px; background: #fbfcfd; }
.detail-field > span { display: block; margin-bottom: 5px; color: #657b89; font-size: 10px; font-weight: 800; }
.detail-field p { margin: 0; color: #77838c; font-size: 11px; line-height: 1.55; }
.detail-note { margin-top: 9px; padding: 11px 13px; border-left: 3px solid var(--category-color); background: var(--category-soft); color: #65727b; font-size: 11px; line-height: 1.6; }
.substance-card.collapsed .substance-card-body, .substance-card.collapsed .substance-details { display: none; }
.substance-card.collapsed .substance-card-top { border-bottom: 0; }

.no-search-results { margin: 18px 0; padding: 22px; border: 1px dashed #cbd5dc; border-radius: 5px; color: #77858f; text-align: center; font-size: 13px; }
.closing-note { padding: 18px 21px; margin: 32px 0 20px; background: #f7f9fa; }
.closing-note p { font-size: 13px; color: #687680; margin: 0; line-height: 1.65; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #d5dce1; padding-top: 13px; color: #8a969f; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.page-navigation { display: flex; justify-content: space-between; gap: 15px; margin-top: 22px; }
.page-nav-link { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border: 1px solid #cbd4db; border-radius: 5px; color: #304656; text-decoration: none; background: #f8fafb; min-width: 190px; }
.page-nav-link:hover { background: #e8eff3; }
.page-nav-link small { display: block; font-size: 10px; color: #82909a; font-weight: 800; letter-spacing: .1em; }
.page-nav-link strong { display: block; font-size: 13px; }
.page-nav-link.next { margin-left: auto; text-align: right; }

.image-modal { position: fixed; inset: 0; z-index: 1200; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px; padding: 50px 24px 25px; background: #07111beF; }
.image-modal.open { display: flex; }
.image-modal img { max-width: min(1100px, 92vw); max-height: 82vh; object-fit: contain; box-shadow: 0 15px 60px #0008; }
.modal-close { position: absolute; top: 15px; right: 22px; width: 42px; height: 42px; border: 1px solid #ffffff55; border-radius: 50%; background: #ffffff12; color: #fff; font-size: 28px; line-height: 1; }
.modal-caption { color: #d5e0e7; font-size: 12px; text-align: center; }
.access-screen { position: fixed; inset: 0; z-index: 1000; background: #091118e0; display: grid; place-items: center; padding: 20px; }
.access-screen[hidden] { display: none; }
.access-panel { width: min(430px, 100%); padding: 34px; background: #fff; border-radius: 8px; text-align: center; }
.lock-symbol { font-size: 42px; color: #6b8190; }
.access-panel .eyebrow { color: #8a9aa5; }
.access-panel h2 { font-size: 21px; margin: 6px 0; }
.access-panel p { font-size: 13px; color: #66737c; }
.access-panel a { display: inline-block; background: #263d4e; color: #fff; text-decoration: none; border-radius: 4px; padding: 10px 17px; margin-top: 12px; font-size: 12px; }


/* ============================================================
   PAC SUBSTANCES — STRUCTURE / ACCESSIBILITY / CARD CONTROLS
   Дополнительный слой к исходному оформлению страницы.
   ============================================================ */
:where(.main-content) button:focus-visible,
:where(.main-content) a:focus-visible,
:where(.main-content) input:focus-visible {
    outline: 3px solid #7aaec3;
    outline-offset: 2px;
}

.category-toolbar { align-items: center; }
.search-wrap { position: relative; }
.search-wrap input { min-width: 0; }
.search-clear {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 27px;
    height: 27px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: #edf2f5;
    color: #637580;
    font-size: 20px;
    line-height: 1;
}
.search-clear:hover { background: #e1e9ed; color: #2d4656; }
.search-clear[hidden] { display: none !important; }

.order-heading { align-items: center; }
.order-heading-copy { min-width: 0; flex: 1 1 auto; }
.order-heading-title { display: flex; align-items: center; gap: 10px; }
.order-heading-copy > p { max-width: 760px; margin: 6px 0 0; color: #73818a; font-size: 11px; line-height: 1.55; }
.order-bulk-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 6px; }
.order-bulk-actions button {
    min-height: 30px;
    padding: 6px 9px;
    border: 1px solid #d6dfe5;
    border-radius: 4px;
    background: #f9fbfc;
    color: #5b6d79;
    font-size: 10px;
    font-weight: 700;
    transition: background .16s, border-color .16s, color .16s;
}
.order-bulk-actions button:hover:not(:disabled) { border-color: #9eb4c0; background: #edf4f7; color: #304e60; }
.order-bulk-actions button:disabled { opacity: .42; cursor: not-allowed; }

.substance-card { transition: border-color .16s, box-shadow .16s; }
.substance-card:focus-within { border-color: #a9c0cc; }
.substance-card-top { align-items: center; }
.substance-card-headline { min-width: 0; flex: 1 1 auto; }
.substance-card-headline .substance-identity { min-width: 0; }
.card-collapsed-summary { margin: 6px 0 0; color: #77858e; font-size: 11px; line-height: 1.45; }
.substance-access-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border: 1px solid #d8e1e6;
    border-radius: 3px;
    background: #f8fafb;
    color: #647783;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
}
.status-restricted { color: #825e4c; background: #f5ede8; }
.locked-code { color: #6b747b; letter-spacing: .02em; }
.card-toggle { cursor: pointer; transition: background .16s, border-color .16s, color .16s; }
.card-toggle:hover { border-color: #9cb2be; background: #edf4f7; color: #2f5265; }
.card-toggle span { display: block; transform: translateY(-1px); }
.substance-card-content { border-top: 1px solid #e4e9ed; }
.substance-card.collapsed .substance-card-content { display: none; }
.substance-card.collapsed .substance-card-top { border-bottom: 0; }
.substance-card:not(.collapsed) .substance-card-top { border-bottom: 0; }
.locked-card-body {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 23px 20px;
    background: linear-gradient(110deg, #f7f9fa, #fff);
}
.locked-card-symbol {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid #d8e0e5;
    border-radius: 5px;
    background: #edf2f5;
    color: #758894;
    font-size: 19px;
}
.locked-card-body strong { display: block; margin: 0 0 4px; color: #485d6a; font-size: 13px; }
.locked-card-body p { margin: 0 0 5px; color: #697984; font-size: 12px; line-height: 1.55; }
.locked-card-body span { color: #98a2a9; font-size: 10px; }
.empty-order[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
    .substance-card:not(.collapsed) { box-shadow: 0 5px 16px rgba(30, 53, 68, .055); }
}
/* Описание отдельного порядка препаратов */
.order-description {
    position: relative;
    margin: 15px 0 19px;
    padding: 17px 19px;

    border: 1px solid #e1e8ec;
    border-left: 4px solid var(--category-color);

    border-radius: 5px;
    background: linear-gradient(
        110deg,
        var(--category-soft),
        #ffffff 85%
    );

    box-shadow: 0 3px 10px rgba(30, 53, 68, .04);
}

.order-description-label {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 9px;

    color: var(--category-deep);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
}

.order-description-label::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;

    border-radius: 50%;
    background: var(--category-color);
}

.order-description p {
    margin: 0 0 9px;

    color: #53636e;
    font-size: 13px;
    line-height: 1.7;
}

.order-description p:last-child {
    margin-bottom: 0;
}

/* ============================================================
   СВОРАЧИВАЕМЫЕ ПОРЯДКИ
   Кнопку и обёртку .order-body создаёт substances.js.
   ============================================================ */
.order-filter-row { flex-wrap: wrap; }
.orders-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.orders-bar-standalone { justify-content: flex-end; margin: 16px 22px 0; }
.orders-bar button {
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid #d6dfe5;
    border-radius: 4px;
    background: #f9fbfc;
    color: #5b6d79;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: background .16s, border-color .16s, color .16s;
}
.orders-bar button:hover { border-color: #9eb4c0; background: #edf4f7; color: #304e60; }

.order-heading.is-toggleable { cursor: pointer; }
.order-heading.is-toggleable:hover h3 { color: var(--category-deep); }
.order-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid #d6dfe5;
    border-radius: 4px;
    background: #f9fbfc;
    color: #5b6d79;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background .16s, border-color .16s, color .16s;
}
.order-toggle:hover { border-color: #9eb4c0; background: #edf4f7; color: #304e60; }
.order-chevron {
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .18s;
}
.order-section.is-collapsed > .order-heading .order-chevron { transform: translateX(-1px) rotate(-45deg); }
.order-section.is-collapsed > .order-body { display: none; }

/* Свёрнутый порядок превращается в компактную плашку */
.order-section.is-collapsed { margin-bottom: 12px; }
.order-section.is-collapsed > .order-heading {
    padding: 11px 14px;
    border: 1px solid #e1e8ec;
    border-left: 3px solid var(--category-color);
    border-radius: 5px;
    background: linear-gradient(110deg, var(--category-soft), #fff 80%);
}
.order-section.is-collapsed > .order-heading:hover { border-color: color-mix(in srgb, var(--category-color), white 40%); }

@media (max-width: 720px) {
    .order-heading { flex-wrap: wrap; }
    .order-heading > p { order: 3; flex-basis: 100%; max-width: none; text-align: left; }
}

/* ============================================================
   УНИФИЦИРОВАННАЯ КАРТОЧКА: 10 ПАРАМЕТРОВ
   Неприменимый параметр: <div class="detail-field is-na">…</div>
   Широкое поле (связанные составы): class="detail-field is-wide"
   ============================================================ */
.detail-field.is-wide { grid-column: 1 / -1; }
.detail-field.is-na { border-style: dashed; background: #f6f8f9; }
.detail-field.is-na > span {
    color: #a3aeb5;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}
.detail-field.is-na p { color: #a9b3ba; font-style: italic; }

/* Связанные составы */
.related-groups { display: grid; gap: 7px; }
.related-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.related-label { min-width: 74px; color: #8a97a0; font-size: 10px; font-weight: 700; }
.substance-link {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid color-mix(in srgb, var(--category-color), white 50%);
    border-radius: 3px;
    background: var(--category-soft);
    color: var(--category-deep);
    font: 700 11px Consolas, monospace;
    text-decoration: none;
    transition: background .16s, border-color .16s;
}
.substance-link:hover { background: #fff; border-color: var(--category-color); }
.related-dash { margin: 0 -1px; color: #9aa6ae; font-size: 11px; }

/* Подсветка карточки после перехода по ссылке */
.substance-card.card-flash { border-color: var(--category-color); }
@media (prefers-reduced-motion: no-preference) {
    .substance-card.card-flash { animation: card-flash 1.8s ease-out; }
}
@keyframes card-flash {
    0%   { box-shadow: 0 0 0 4px color-mix(in srgb, var(--category-color), transparent 45%); }
    100% { box-shadow: 0 0 0 0 transparent; }
}