@import url("https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700;900&display=swap");

:root {
    --blue: #1A263C;
    --blue-2: #78AAD4;
    --aqua: #007AE5;
    --orange: #D3985C;
    --orange-2: #FFD8AD;
    --hover-blue: #2a3d60;
    --hover-orange: #af7e4c;
    --white: #ffffff;
    --black: #222222;
    --text: #334155;
    --muted: #666666;
    --line: #e5e5e5;
    --page: #f1f1f1;
    --soft: #fafafa;
    --danger: #a33b3b;
    --success: #237546;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    background: var(--page);
    color: var(--black);
    font-family: "Merriweather", Georgia, "Times New Roman", serif;
    line-height: 1.55;
}

a {
    color: var(--aqua);
    text-decoration: none;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

a:hover { color: var(--orange); }

:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

.container {
    width: min(1296px, calc(100% - 48px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--blue);
    box-shadow: 0 6px 18px rgba(26, 38, 60, .22);
}

.header-shell {
    display: flex;
    min-height: 108px;
    align-items: stretch;
}

.header-logo {
    display: flex;
    width: 270px;
    flex: 0 0 270px;
    align-items: center;
    gap: 14px;
    padding-right: 28px;
    color: var(--orange);
}

.header-logo:hover { color: var(--orange-2); }

.header-logo img {
    width: 70px;
    height: 78px;
    object-fit: contain;
}

.header-logo span {
    color: var(--orange);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.15;
}

.header-block {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.header-up,
.header-down {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-up {
    min-height: 46px;
    border-bottom: 1px solid rgba(120, 170, 212, .24);
}

.header-down { min-height: 62px; }

.header-up-menu,
.header-down-menu,
.header-lang {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.header-up-menu { gap: 24px; }

.header-up-menu a,
.header-lang button {
    color: var(--blue-2);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.header-lang {
    gap: 14px;
    margin-left: 20px;
}

.header-lang form {
    margin: 0;
}

.header-lang button {
    border: 0;
    background: none;
    cursor: pointer;
    padding: 0;
    color: #bdbdbd;
    font-family: inherit;
}

.header-lang button.is-active,
.header-up-menu a:hover,
.header-lang button:hover {
    color: var(--blue-2);
}

.header-down-menu {
    gap: 26px;
    justify-content: flex-end;
    width: 100%;
}

.header-down-menu a,
.link-button {
    color: var(--white);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
}

.header-down-menu a:hover,
.link-button:hover {
    color: var(--orange);
}

.logout-form { margin: 0; }

.link-button {
    border: 0;
    background: none;
    cursor: pointer;
    padding: 0;
}

.page-content {
    min-height: calc(100vh - 168px);
    padding: 46px 0 68px;
}

.site-footer {
    padding: 26px 0;
    background: var(--blue);
    color: var(--blue-2);
    font-size: 14px;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--blue);
    line-height: 1.25;
}

h1 {
    margin-bottom: 18px;
    font-size: 42px;
    font-weight: 700;
}

h2 {
    margin-bottom: 14px;
    font-size: 26px;
    font-weight: 700;
}

h3 {
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 700;
}

p { margin-top: 0; }

.lead,
.section-heading p,
.card p {
    color: var(--muted);
    font-size: 18px;
}

.page-heading {
    max-width: 940px;
    margin-bottom: 28px;
}

.eyebrow,
.card-kicker {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--orange);
    font-size: 15px;
    font-weight: 700;
}

.hero {
    position: relative;
    overflow: hidden;
    margin: -46px calc(50% - 50vw) 28px;
    padding: 42px max(24px, calc((100vw - 1296px) / 2)) 48px;
    background:
        linear-gradient(90deg, rgba(26, 38, 60, .98), rgba(26, 38, 60, .86)),
        radial-gradient(circle at 82% 16%, rgba(211, 152, 92, .26), transparent 34%),
        var(--blue);
    color: var(--white);
}

.workspace-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 36px;
    align-items: end;
}

.workspace-hero h1 {
    max-width: 900px;
    margin-bottom: 14px;
    color: var(--white);
    font-size: 38px;
    line-height: 1.2;
}

.workspace-hero p {
    max-width: 820px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, .92);
    font-size: 18px;
}

.workspace-hero p.hero-news {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    max-width: 860px;
    margin-top: 8px;
    padding: 10px 18px 10px 10px;
    border: 1px solid rgba(255, 216, 173, .4);
    border-left: 4px solid var(--orange);
    background: rgba(255, 255, 255, .07);
    color: var(--white);
    font-size: 17px;
    line-height: 1.45;
}

.hero-news-tag {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: var(--orange);
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hero-news-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue);
    animation: hero-news-pulse 1.8s ease-out infinite;
}

@keyframes hero-news-pulse {
    0% { box-shadow: 0 0 0 0 rgba(26, 38, 60, .6); }
    70% { box-shadow: 0 0 0 7px rgba(26, 38, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 38, 60, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-news-dot { animation: none; }
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
}

.section-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
    background: var(--white);
}

.section-tab {
    min-height: 60px;
    padding: 17px 18px;
    border: 1px solid var(--line);
    border-right: 0;
    color: var(--blue);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.section-tab:last-child { border-right: 1px solid var(--line); }

.section-tab:hover,
.section-tab.is-active {
    background: var(--blue);
    color: var(--orange-2);
}

/* Вкладки «Согласования»: число колонок задает шаблон через --tab-count.
   Один класс, чтобы на узком экране сработало общее правило .section-tabs. */
.review-tabs { grid-template-columns: repeat(var(--tab-count, 4), minmax(0, 1fr)); }

.decision-comment {
    min-width: 220px;
    max-width: 420px;
}

.decision-meta {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.page-section { margin-top: 20px; }

.grid {
    display: grid;
    gap: 28px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.grid-4 .card {
    min-width: 0;
    padding: 22px;
}

.grid-4 .card h2 {
    font-size: 20px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.grid-4 .card p {
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.55;
}

.grid-4 .text-link {
    font-size: 13px;
    white-space: nowrap;
}

.card,
.calculator-card,
.auth-card,
.empty-state,
.table-wrap,
.notification-card {
    border: 1px solid var(--line);
    background: var(--white);
}

.card {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    padding: 32px;
}

.card h2 { max-width: 760px; }

.card p { margin-bottom: 24px; }

.accent-blue { border-top: 5px solid var(--blue); }
.accent-green { border-top: 5px solid var(--blue-2); }
.accent-aqua { border-top: 5px solid var(--aqua); }
.accent-amber { border-top: 5px solid var(--orange); }

.card .button,
.selectable-card .button {
    align-self: flex-start;
    margin-top: auto;
}

.text-link {
    margin-top: auto;
    color: var(--orange);
    font-weight: 700;
}

.text-link::after { content: " ->"; }

.button {
    display: inline-flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: var(--orange);
    color: var(--white);
    cursor: pointer;
    padding: 14px 28px;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.button:hover {
    background: var(--hover-orange);
    color: var(--white);
}

.button.secondary {
    border: 1px solid rgba(255, 255, 255, .55);
    background: transparent;
    color: var(--white);
}

.button.secondary:hover {
    border-color: var(--orange);
    background: var(--orange);
}

.card .button.secondary,
.calculator-card .button.secondary,
.auth-card .button.secondary,
.document-header .button.secondary,
.section-heading .button.secondary,
.form-actions .button.secondary,
.review-form .button.secondary,
.publication-decision-form .button.secondary {
    border: 1px solid var(--blue);
    color: var(--blue);
}

.card .button.secondary:hover,
.calculator-card .button.secondary:hover,
.auth-card .button.secondary:hover,
.document-header .button.secondary:hover,
.section-heading .button.secondary:hover,
.form-actions .button.secondary:hover,
.review-form .button.secondary:hover,
.publication-decision-form .button.secondary:hover {
    background: var(--blue);
    color: var(--white);
}

.button.success { background: var(--success); }
.button.danger { background: var(--danger); }
.button:disabled { opacity: .55; cursor: not-allowed; }

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.section-heading .button { flex: 0 0 auto; }

.form-section {
    margin: 30px 0;
    padding: 30px;
    border: 1px solid var(--line);
    background: var(--white);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
}

/* Три языка сайта в одну строку: в двух колонках третий оставался один. */
.form-grid.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.field label,
.field-label,
.review-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--blue);
    font-size: 15px;
    font-weight: 700;
}

.form-control,
input,
select,
textarea {
    width: 100%;
    border: 1px solid #d8d8d8;
    background: var(--white);
    color: var(--blue);
    padding: 13px 14px;
    font: inherit;
    font-size: 16px;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--orange);
    outline: 0;
}

select { min-height: 52px; }

textarea {
    min-height: 122px;
    resize: vertical;
}

.required { color: var(--orange); }

ul.errorlist {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--danger);
    font-size: 14px;
}

.publication-card {
    margin: 22px 0;
    padding: 26px;
    border: 1px solid var(--line);
    border-left: 6px solid var(--orange);
    background: var(--soft);
}

.publication-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.publication-card-heading h3 { margin-bottom: 0; }

/* После решения по статье страница открывается на ней (#publication-N):
   отступ, чтобы заголовок карточки не прятался под закрепленной шапкой. */
.publication-card { scroll-margin-top: 250px; }

/* Статья, отклоненная проверяющим: остается в заявке, но выделена. */
.publication-card.is-rejected {
    border-left-color: var(--danger);
    background: #fdf6f5;
}

.publication-decision {
    margin-bottom: 18px;
    padding: 12px 16px;
    border-left: 3px solid var(--danger);
    background: var(--white);
}

.publication-decision-form {
    max-width: 720px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.publication-decision-form summary {
    color: var(--danger);
    cursor: pointer;
    font-weight: 700;
}

.publication-decision-form label {
    display: block;
    margin: 14px 0 8px;
    color: var(--blue);
    font-size: 15px;
    font-weight: 700;
}

.publication-decision-form .button { margin-top: 12px; }

/* Решение по статье на этапе: согласовать сразу, доработка и отклонение
   раскрываются с полем для комментария. */
.publication-decision-form .inline-action-form { margin: 0 0 8px; }
.publication-decision-form details { margin-top: 10px; }
.publication-decision-form details + details { margin-top: 6px; }
.publication-decision-form details.decision-revision > summary { color: #725018; }
.publication-decision-form details.decision-reject > summary { color: var(--danger); }

.status-decision-approve {
    border-color: #acd8ba;
    color: var(--success);
}

.status-decision-revision {
    border-color: var(--orange);
    color: #725018;
}

.status-decision-reject {
    border-color: #efb9b0;
    color: var(--danger);
}

.publication-decision.decision-revision { border-left-color: var(--orange); }
.publication-decision.decision-approve { border-left-color: var(--success); }

details.review-form > summary {
    color: var(--blue);
    cursor: pointer;
    font-weight: 700;
}

.finish-outcome {
    padding: 12px 16px;
    border-left: 3px solid var(--success);
    background: var(--soft);
    color: var(--blue);
    font-weight: 700;
}

.finish-outcome.is-blocked { border-left-color: var(--orange); }

.rejected-publications ul { margin: 8px 0 0; padding-left: 20px; }
.rejected-publications li { margin-bottom: 6px; }

.publication-number { color: var(--orange); }

.delete-control {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--danger);
    font-size: 14px;
    font-weight: 700;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.messages { margin-bottom: 24px; }

.message {
    margin-bottom: 10px;
    padding: 14px 18px;
    border-left: 5px solid var(--blue-2);
    background: var(--white);
}

.message.success { border-color: var(--success); color: #195a32; }
.message.error { border-color: var(--danger); color: #7d1f19; }
.message.warning { border-color: var(--orange); color: #725018; }

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 15px;
}

th {
    background: var(--blue);
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

tbody tr:hover { background: #f7f7f7; }
tr:last-child td { border-bottom: 0; }

.status {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    border: 1px solid var(--line);
    background: var(--soft);
    color: var(--blue);
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.status-at_specialist,
.status-at_head,
.status-at_director {
    border-color: var(--blue-2);
    color: var(--blue);
}

.status-approved {
    border-color: #acd8ba;
    color: var(--success);
}

.status-revision {
    border-color: var(--orange);
    color: #725018;
}

.status-rejected {
    border-color: #efb9b0;
    color: var(--danger);
}

.status-withdrawn {
    border-color: #c9c9c9;
    color: #555555;
}

/* Статья, отозванная автором: в рассмотрении не участвует. */
.publication-card.is-withdrawn {
    border-left-color: #9a9a9a;
    background: #f4f4f4;
}

.publication-decision-form.decision-withdraw > summary { color: var(--danger); }

.details-grid {
    display: grid;
    grid-template-columns: minmax(190px, 280px) 1fr;
    gap: 12px 22px;
}

.details-grid dt {
    color: var(--muted);
    font-weight: 700;
}

.details-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.inline-action-form {
    display: inline-flex;
    margin: 0 12px 12px 0;
}

.review-form {
    max-width: 720px;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.review-form .button { margin-top: 12px; }

.timeline {
    margin-left: 8px;
    padding-left: 24px;
    border-left: 2px solid var(--orange);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
    padding-left: 10px;
}

.timeline-item::before {
    position: absolute;
    left: -31px;
    top: 6px;
    width: 12px;
    height: 12px;
    border: 3px solid var(--white);
    background: var(--orange);
    content: "";
}

.timeline-item span {
    margin-left: 8px;
    color: var(--muted);
    font-size: 13px;
}

blockquote {
    margin: 10px 0;
    padding: 12px 16px;
    border-left: 4px solid var(--orange);
    background: #fff8ef;
}

.calculator-card {
    max-width: 1080px;
    padding: 34px;
}

.indexing-directory {
    max-width: 1080px;
    padding: 34px;
    border: 1px solid var(--line);
    background: var(--white);
}

.help-note {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 22px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--orange);
    background: var(--white);
}

.help-note-icon {
    display: grid;
    flex: none;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue);
    color: var(--orange-2);
}

.help-note p {
    margin: 0;
    color: var(--text);
    font-size: 16px;
}

.help-note strong { color: var(--blue); }

.help-note-room {
    display: inline-block;
    padding: 0 10px;
    border-radius: 4px;
    background: var(--orange-2);
    color: var(--blue);
    font-weight: 700;
    white-space: nowrap;
}

.contact-card {
    max-width: 820px;
    padding: 34px;
    border: 1px solid var(--line);
    border-top: 5px solid var(--blue-2);
    background: var(--white);
}

.contact-extension {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 18px;
}

.contact-extension strong {
    color: var(--blue);
    font-size: 20px;
}

.contact-units {
    display: grid;
    gap: 16px;
}

.contact-unit {
    margin: 0;
    padding: 18px 20px;
    border-left: 4px solid var(--orange);
    background: var(--soft);
    color: var(--text);
    font-size: 18px;
}

.indexing-resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.indexing-resource {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 96px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--blue-2);
    background: var(--soft);
    color: var(--text);
}

.indexing-resource:hover {
    border-color: var(--orange);
    background: #fff8ef;
    color: var(--text);
}

.indexing-resource strong {
    display: block;
    margin-bottom: 3px;
    color: var(--blue);
    font-size: 18px;
}

.indexing-resource small {
    display: block;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.indexing-resource-action {
    color: var(--orange);
    font-weight: 700;
    white-space: nowrap;
}

.auth-card {
    max-width: 500px;
    margin: 34px auto;
    padding: 34px;
}

.register-card {
    max-width: 860px;
}

.auth-card .field { margin-bottom: 18px; }

.auth-note {
    margin: 22px 0 0;
    color: var(--muted);
}

.help-text {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
}

.calculator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 28px;
    align-items: stretch;
}

.calculator-form {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 22px;
}

.calculator-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.calculator-form .button { align-self: flex-start; }

.calculator-result {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    background: var(--blue);
    color: var(--white);
}

.result-label {
    display: block;
    margin-bottom: 12px;
    color: var(--orange-2);
    font-size: 14px;
    font-weight: 700;
}

.calculator-result strong {
    display: block;
    color: var(--white);
    font-size: 34px;
    font-weight: 700;
}

.calculator-result .muted-result { color: rgba(255, 255, 255, .72); }

.calculator-result small {
    display: block;
    margin-top: 10px;
    color: rgba(255, 255, 255, .78);
}

.notifications {
    display: grid;
    gap: 18px;
}

.notification-card {
    padding: 26px;
}

.notification-card h2 {
    margin-bottom: 10px;
    font-size: 22px;
}

.notification-card small { color: var(--muted); }
.notification-card.unread { border-left: 6px solid var(--orange); }

.empty-state {
    padding: 42px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 1100px) {
    .header-shell {
        min-height: 0;
        flex-direction: column;
        padding: 14px 0;
    }

    .header-logo {
        width: auto;
        flex-basis: auto;
        padding-right: 0;
    }

    .header-up,
    .header-down {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        min-height: 0;
        padding: 14px 0 0;
    }

    .header-down-menu {
        justify-content: flex-start;
        gap: 18px;
    }

    .workspace-hero,
    .calculator-grid,
    .indexing-resource-grid,
    .grid-2,
    .grid-3,
    .form-grid,
    .form-grid.form-grid-3,
    .section-tabs {
        grid-template-columns: 1fr;
    }

    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .hero-actions { justify-content: flex-start; }
    .calculator-form .button { align-self: stretch; }
}

@media (max-width: 680px) {
    .container {
        width: min(100% - 28px, 1296px);
    }

    .page-content { padding-top: 34px; }

    .grid-4 { grid-template-columns: 1fr; }

    .help-note {
        align-items: flex-start;
        padding: 18px;
    }

    h1 { font-size: 30px; }
    h2 { font-size: 22px; }

    .hero {
        margin-top: -34px;
        padding-top: 44px;
        padding-bottom: 50px;
    }

    .workspace-hero h1 { font-size: 34px; }
    .workspace-hero p { font-size: 18px; }

    .workspace-hero p.hero-news {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
        font-size: 16px;
    }

    .header-logo img {
        width: 56px;
        height: 64px;
    }

    .header-logo span { font-size: 15px; }

    .header-up-menu,
    .header-down-menu {
        gap: 12px 16px;
    }

    .card,
    .form-section,
    .calculator-card,
    .indexing-directory,
    .contact-card,
    .auth-card,
    .notification-card {
        padding: 22px;
    }

    .section-heading,
    .publication-card-heading,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button,
    .section-heading .button {
        width: 100%;
    }

    .indexing-resource {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .details-grid dd { margin-bottom: 12px; }

    th,
    td {
        padding: 13px 14px;
    }
}


/* ---------- Онлайн-калькуляторы (4 вида расчета) ---------- */

.mrp-note {
    max-width: 1080px;
    margin: 0 0 20px;
    padding: 14px 18px;
    border-left: 4px solid var(--blue-2);
    background: var(--white);
    color: var(--blue);
    font-weight: 700;
}

.back-link { color: var(--orange); }
.back-link::before { content: "<- "; }

.calculator-title {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 22px;
}

.calculator-inputs-1 { grid-template-columns: minmax(0, 1fr); }

/* Переключатель «страницы / печатные листы» занимает всю ширину строки. */
.field-wide { grid-column: 1 / -1; }

div.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-top: 4px;
}

div.radio-row label {
    display: flex;
    align-items: center;
    margin: 0;
    color: var(--text);
    font-weight: 400;
    cursor: pointer;
}

div.radio-row input[type="radio"] {
    width: auto;
    min-height: 0;
    margin: 0 8px 0 0;
    border: 0;
    padding: 0;
    accent-color: var(--blue);
}

.calculator-sheets {
    margin: -8px 0 0;
    color: var(--blue);
    font-size: 14px;
    font-weight: 700;
}

.result-mrp {
    display: block;
    margin-top: 6px;
    color: var(--orange-2);
    font-size: 18px;
    font-weight: 700;
}

.result-lines {
    margin: 16px 0 0;
    padding-left: 18px;
    color: rgba(255, 255, 255, .82);
    font-size: 14px;
}

.result-lines li { margin-bottom: 4px; }

.calculator-note {
    margin: 24px 0 0;
    padding: 12px 16px;
    border-left: 4px solid var(--orange);
    background: #fff8ef;
    color: var(--text);
    font-size: 14px;
}


/* Блок-схема раздела «Краткая информация» и загруженные материалы. */
.scheme-figure {
    margin: 24px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #ffffff;
    /* Широкую схему не сжимаем, а даем прокрутить: мелкий текст нечитаем. */
    overflow-x: auto;
}

.scheme-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.scheme-caption {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted);
}

.current-file {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--muted);
    word-break: break-all;
}

/* Встроенный просмотр PDF. Шапка компактная: иначе документ уезжает за экран. */
.document-header {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    justify-content: space-between;
    margin: 18px 0 12px;
}

.document-title {
    margin: 2px 0 0;
    font-size: 30px;
    line-height: 1.15;
}

.document-meta {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Кнопки в шапке компактнее основных: это вспомогательное действие. */
.document-actions .button {
    min-height: 40px;
    padding: 0 18px;
    font-size: 14px;
}

/* Ширина под лист A4 при 100%: иначе Chrome заливает бока темным фоном. */
.pdf-viewer {
    max-width: 860px;
    margin: 0 auto 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #f0f0f0;
    overflow: hidden;
}

.pdf-frame {
    display: block;
    width: 100%;
    height: min(82vh, 1100px);
    min-height: 460px;
    border: 0;
}

.pdf-hint {
    max-width: 860px;
    margin: 0 auto 24px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 700px) {
    .document-header { align-items: flex-start; }
    .document-title { font-size: 24px; }
    .pdf-frame { height: 70vh; min-height: 360px; }
}

/* Глобальное правило input{width:100%} растягивает и чекбоксы: внутри
   .delete-control возвращаем им собственный размер, иначе подпись уезжает вниз. */
.delete-control input[type="checkbox"] {
    width: auto;
    flex: none;
}
