/* МедСтенд 2027 — «Клиническая карта». Слой 1: шрифты, шапка, тёмная тема.
   Подключается после medstand-2026.css; старые файлы не правим. */
:root {
    --ms-ink: #10343c;
    --ms-muted: #5b7378;
    --ms-line: #d6e3e4;
    --ms-page: #f4f8f8;
    --ms-card: #fff;
    --ms-accent: #087f76;
    --ms-accent-ink: #fff;
    --ms-strip: #0e3a43;
    --ms-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --ms-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color-scheme: light;
}

body {
    font-family: var(--ms-sans);
    color: var(--ms-ink);
    background: var(--ms-page);
}

/* Верхняя полоса — как строка медицинского бланка */
.site-header__notice {
    background: var(--ms-strip);
    font-family: var(--ms-mono);
    font-size: .74rem;
    letter-spacing: .02em;
}
.site-header__notice .site-shell { min-height: 30px; }
.site-header__notice a { text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,.45); }

.site-header { box-shadow: none; background: var(--ms-card); border-bottom: 1px solid var(--ms-line); }
.site-header__main { min-height: 84px; }

/* Кнопки шапки: «Личный кабинет» — белый текст на бирюзе (старый style.css перекрашивал ссылку) */
.site-header .account-link,
.site-header .account-link:link,
.site-header .account-link:visited {
    color: var(--ms-accent-ink) !important;
    background: var(--ms-accent);
}
.site-header .account-link:hover { background: #075f5a; }
.site-header .quiet-link { border: 1px solid var(--ms-line); background: transparent; }
.site-header .quiet-link:hover { border-color: var(--ms-accent); color: var(--ms-accent); }

/* Навигация: тонкая линейка-«маркер анализа» под активным пунктом */
.site-header__navigation { border-top: 1px solid var(--ms-line); }
.primary-navigation a { font-weight: 600; letter-spacing: .01em; }
.primary-navigation a::after { height: 2px; background: var(--ms-accent); }

/* Поиск */
.header-search input[type="text"],
.header-search input[type="search"] {
    border: 1px solid var(--ms-line);
    background: var(--ms-page);
}

/* Метки дат и рубрик — моноширинный, как в выписке */
.news-meta, .card-meta, .item-meta, time { font-family: var(--ms-mono); letter-spacing: 0; }

/* Крупные карточки: заголовок целиком (раньше обрезался фиксированной высотой 167px) */
.box_video .text_tip, .b_photo:hover .text_tip { height: auto; max-height: 100%; padding-right: 56px; }
.box_video .video-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.box_video .s_text { display: none; }
.category { font-family: var(--ms-mono); letter-spacing: .04em; }

/* ===== Слой 2: главная — «клиническая карта» ===== */
/* Колонки — плоские панели без теней */
.content > .left > .coll,
.content > .center > .coll,
.content > .right > .coll,
.box_video {
    box-shadow: none;
    border-color: var(--ms-line);
    border-radius: 14px;
    background: var(--ms-card);
}
.box_video { box-shadow: 0 1px 0 var(--ms-line); }

/* Заголовок колонки: короткая бирюзовая метка над названием */
.content .sub_head { position: relative; padding-top: 10px; letter-spacing: .02em; }
.content .sub_head::before {
    content: ""; position: absolute; top: 0; left: 0;
    width: 28px; height: 3px; border-radius: 2px; background: var(--ms-accent);
}

/* Ленты: строки вместо коробок, слева — цветной «маркер рубрики» */
.main_list > li {
    margin: 0;
    padding: 16px 0 16px 14px;
    background: transparent;
    border: 0;
    border-left: 3px solid var(--ms-line);
    border-bottom: 1px solid var(--ms-line);
    border-radius: 0;
    box-shadow: none;
}
.main_list > li:last-child { border-bottom: 0; }
.main_list > li:hover { border-left-color: var(--ms-accent); }
.main_list > li:has(.date a[href*="/medicine/"]) { border-left-color: #2a9d8f; }
.main_list > li:has(.date a[href*="/health/"])   { border-left-color: #5aa469; }
.main_list > li:has(.date a[href*="/science/"])  { border-left-color: #5b6fd6; }
.main_list > li:has(.date a[href*="/business/"]) { border-left-color: #c58b2a; }
.main_list > li:has(.date a[href*="/incidents/"]),
.main_list > li:has(.date a[href*="/accidents/"]) { border-left-color: #c2475a; }
.main_list .lil_line, .main_list hr { display: none; }
.news_pic, .top_side_article img, .top_side_news img {
    width: 96px; max-height: 72px; border-radius: 8px; margin-right: 12px;
}
.main_list .date, .main_list .date strong { font-family: var(--ms-mono); font-size: .72rem; }
.main_list .date strong { color: var(--ms-accent); }

/* Каталог: строки с моноширинным счётчиком, числа не вылезают за край */
.content .bg_light_green.cat_menu_pic {
    margin: 0; background: transparent; border: 0; border-bottom: 1px solid var(--ms-line);
    border-radius: 0; box-shadow: none; table-layout: fixed;
}
.cat_menu_pic td { padding: 10px 0; }
.cat_menu_pic td:last-child { width: 3.6em; text-align: right; }
.cat_menu_pic td:last-child .top_side_cat h2 {
    display: inline-block; min-width: 2.4em; padding: 2px 8px; margin: 0;
    font-family: var(--ms-mono); font-size: .8rem; text-align: center;
    color: var(--ms-accent); background: var(--med-teal-50); border-radius: 99px;
}
.top_side_cat h2 { margin: 0; font-size: 1rem; }

/* «Перейти в каталог», «Все статьи» — текстовые ссылки со стрелкой */
.content .more { background: none; border: 0; }
.content .more a {
    font-family: var(--ms-mono); font-size: .76rem; text-transform: uppercase;
    letter-spacing: .04em; color: var(--ms-accent); text-decoration: none; border: 0; background: none;
}
.content .more a::after { content: " →"; }

.box_video .text_tip_author_date, .box_video .date, .box_video .views { color: rgba(255,255,255,.88); }
.content .more, .content .left_more, .content .right_more { border: 0 !important; box-shadow: none !important; background: none !important; }
.content .table1 { box-shadow: none; border-radius: 12px; }
.content .table1 h4 a { color: var(--ms-ink); text-decoration: none; }
.content .table1 h4 a:hover { color: var(--ms-accent); }

/* Тёмная тема — «ночной режим монитора» */
@media (prefers-color-scheme: dark) {
    :root {
        --ms-ink: #d7e8e8;
        --ms-muted: #8fa9ad;
        --ms-line: #24434a;
        --ms-page: #0b1d22;
        --ms-card: #10272d;
        --ms-accent: #2bb3a6;
        --ms-accent-ink: #062226;
        --ms-strip: #061418;
        --med-blue-900: #d7e8e8;
        --med-blue-700: #b4cdd0;
        --med-slate-700: #a9c0c3;
        --med-slate-500: #8fa9ad;
        --med-slate-300: #2f525a;
        --med-slate-200: #24434a;
        --med-slate-100: #0b1d22;
        --med-teal-800: #2bb3a6;
        --med-teal-700: #3cc4b6;
        --med-teal-900: #5ad0c3;
        --med-teal-100: #123a3d;
        --med-teal-50: #0f2c31;
        --med-white: #10272d;
        --med-shadow: 0 10px 30px rgba(0, 0, 0, .35);
        color-scheme: dark;
    }
    body { background: var(--ms-page); color: var(--ms-ink); }
    .site-header__notice, .site-header__notice a { color: #bfe3df; }
    .site-brand img { background: #f4f8f8; border-radius: 12px; padding: 4px 8px; }
    .site-header .account-link:hover { background: #5ad0c3; }
    img { filter: brightness(.92); }
    /* Старый style.css задаёт тёмный текст и белые фоны жёстко */
    h1, h2, h3, h4, h5, h6, p, li, td, th, dt, dd, label, span, div { border-color: var(--ms-line); }
    h1, h2, h3, h4, h5, h6 { color: var(--ms-ink); }
    a { color: #5ad0c3; }
    .box_video .text_tip, .box_video .video-title, .box_video .date, .box_video .views,
    .site-footer h2, .auth-intro, .auth-submit, a.board--primary, input[type="button"] { color: #fff; }
    .category { color: #063a3a; background: #bff0ea; }
    .site-header .quiet-link { color: var(--ms-ink); }
    .date a, .main_list .date a { color: var(--ms-muted); }
    .more, .more a, .left_more, .right_more { background: transparent !important; color: #5ad0c3; }
    /* Страница материала: старый style.css задаёт тёмный текст и белые подложки */
    .site-main p, .site-main li, .site-main td, .site-main dd, .site-main dt,
    .site-main blockquote, article, .coll_n { color: var(--ms-ink); }
    .site-main li a, .content-meta a, .pop_news a, .img_source, .img_source a { color: #7fd8cd; }
    .sub_menu, .sub_menu ul, .sub_menu li, .pop_news, .pop_news ul, .pop_news li,
    article ul, article ol, .coll_n ul, .bg_light_green, .bg_green { background: var(--ms-card) !important; }
    .sub_menu a { color: var(--ms-muted); }
    .sub_menu li.selected a { color: #062226; background: var(--ms-accent); }
    .pop_news .number { color: var(--ms-accent); }
    .img_box2, .border_news, .textsize_label { color: var(--ms-muted); }
    ins.adsbygoogle { background: transparent !important; }
    input, select, textarea { background: #0f2429; color: var(--ms-ink); border-color: var(--ms-line); }
}
