:root {
    --color-header: #263746;
    --color-header-hover: #354d60;
    --color-accent: #e87524;
    --color-accent-hover: #c95e16;
    --color-page: #f4f6f8;
    --color-card: #ffffff;
    --color-text: #202a35;
    --color-muted: #65717d;
    --color-border: #e0e5e9;
    --color-link: #1769aa;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--color-page);
    color: var(--color-text);
    font-family: Arial, sans-serif;
    line-height: 1.55;
}
.site-header {
    background: var(--color-header);
    color: #fff;
    padding: 24px 20px 0;
    border-bottom: 3px solid var(--color-accent);
}

.header-inner, main, .footer-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.brand {
    display: inline-block;
    color: #fff;
    font-size: 27px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: .2px;
}

.tagline {
    margin: 6px 0 20px;
    color: #dce5ec;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 0 0 18px;
}

.site-nav a {
    color: #fff;
    text-decoration: none;
    padding: 5px 0;
}

.site-nav a:hover, .site-nav a:focus-visible {
    color: #ffbd8b;
    text-decoration: underline;
}

main {
    padding: 24px 20px 42px;
}

.card {
    background: var(--color-card);
    padding: 22px;
    margin: 16px 0;
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

h1, h2, h3 {
    margin-top: 0;
    line-height: 1.3;
}

p {
    line-height: 1.6;
}

a {
    color: var(--color-link);
}

.site-footer {
    background: #e8edf1;
    color: #53616d;
    padding: 20px;
    font-size: 14px;
}

.site-footer p {
    margin: 0 0 6px;
}
label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 700;
}

input, select, button {
    width: 100%;
    min-height: 44px;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #cbd3da;
    border-radius: 6px;
}

input:focus, select:focus, button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

button {
    margin-top: 20px;
    background: var(--color-accent);
    color: #fff;
    cursor: pointer;
    border: 0;
    font-weight: 700;
}

button:hover {
    background: var(--color-accent-hover);
}

.result {
    margin-top: 20px;
    padding: 16px;
    background: #eaf4ec;
    border: 1px solid #c9e2ce;
    border-radius: 8px;
}

.error {
    background: #fff0ed;
    border-color: #f0c5bc;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

th {
    background: var(--color-page);
}

.muted {
    color: var(--color-muted);
    font-size: 14px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grid > * {
    min-width: 0;
}
@media (max-width: 600px) {
    .site-header {
        padding: 20px 16px 0;
    }
    .brand {
        font-size: 24px;
    }
    main {
        padding: 16px 12px 30px;
    }
    .card {
        padding: 16px;
    }
    .site-nav {
        gap: 8px 14px;
    }
    .grid {
        grid-template-columns: minmax(0, 1fr);
    }
    table {
        display: block;
        overflow-x: auto;
    }
    th, td {
        padding: 8px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    button {
        transition: background-color .15s ease;
    }
}

/* === Металловед: обновлённое оформление === */

:root {
    --color-page: #f2f5f8;
    --color-card: #ffffff;
    --color-text: #202b36;
    --color-muted: #687786;
    --color-border: #dce3e9;
    --color-link: #1769aa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.site-header {
    padding-top: 28px;
    background: linear-gradient(135deg, #1e2c39 0%, #30495c 100%);
    border-bottom: 4px solid var(--color-accent);
}

.header-inner,
main,
.footer-inner {
    max-width: 1160px;
}

.brand {
    font-size: 30px;
    letter-spacing: -0.5px;
}

.tagline {
    max-width: 680px;
    font-size: 15px;
    color: #d5e0e8;
}

.site-nav {
    gap: 8px 24px;
}

.site-nav a {
    transition: color .18s ease;
}

main {
    padding-top: 32px;
    padding-bottom: 52px;
}

h1 {
    font-size: clamp(28px, 4vw, 38px);
    letter-spacing: -0.7px;
}

h2 {
    font-size: clamp(22px, 3vw, 28px);
    letter-spacing: -0.3px;
}

h3 {
    font-size: 19px;
}

.card {
    padding: 26px;
    margin: 20px 0;
    border-radius: 14px;
    border-color: var(--color-border);
    box-shadow: 0 3px 12px rgba(27, 45, 60, 0.035);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.card:hover {
    border-color: #c8d3dd;
    box-shadow: 0 7px 22px rgba(27, 45, 60, 0.065);
}

a {
    text-underline-offset: 3px;
}

input,
select {
    background: #fff;
    color: var(--color-text);
    border-color: #cbd5df;
    border-radius: 8px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(232, 117, 36, 0.13);
    outline: none;
}

button {
    min-height: 46px;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(150, 75, 20, 0.12);
    transition: background-color .15s ease, transform .15s ease;
}

button:hover {
    transform: translateY(-1px);
}

.result {
    border-radius: 10px;
    padding: 18px;
}

table {
    font-size: 15px;
}

th {
    color: #334454;
    font-weight: 700;
}

th,
td {
    padding: 12px 14px;
}

tbody tr:nth-child(even) {
    background: #f8fafc;
}

.site-footer {
    border-top: 1px solid var(--color-border);
}

@media (max-width: 600px) {
    .site-header {
        padding-top: 22px;
    }

    .brand {
        font-size: 26px;
    }

    main {
        padding-top: 20px;
        padding-bottom: 32px;
    }

    .card {
        padding: 18px;
        margin: 14px 0;
        border-radius: 11px;
    }

    th,
    td {
        padding: 9px 10px;
    }
}

/* Главная страница Металловеда */

.hero-card {
    padding: 30px;
    border-top: 3px solid var(--color-accent);
}

.hero-copy {
    max-width: 800px;
    margin-bottom: 28px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--color-accent-hover);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.hero-description {
    max-width: 760px;
    color: var(--color-muted);
    font-size: 17px;
}

.calculator-panel {
    padding: 24px;
    background: #f7f9fb;
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.calculator-panel h2 {
    margin-bottom: 6px;
}

.calculator-panel form {
    margin-top: 20px;
}

.calculator-note {
    margin-bottom: 0;
}

.section-heading {
    margin-bottom: 24px;
}

.section-heading h2 {
    margin-bottom: 8px;
}

.section-heading p {
    margin-top: 0;
    color: var(--color-muted);
}

.calculator-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 210px;
    padding: 20px;
    color: var(--color-text);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.tool-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 8px 22px rgba(27, 45, 60, .08);
    transform: translateY(-2px);
}

.tool-number {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--color-accent-hover);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
}

.tool-card h3 {
    margin-bottom: 8px;
}

.tool-card p {
    margin: 0 0 18px;
    color: var(--color-muted);
    font-size: 14px;
}

.tool-link {
    margin-top: auto;
    color: var(--color-link);
    font-size: 14px;
    font-weight: 700;
}

.reference-card {
    background: #f8fafc;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

@media (max-width: 850px) {
    .calculator-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .hero-card {
        padding: 18px;
    }

    .hero-description {
        font-size: 16px;
    }

    .calculator-panel {
        padding: 16px;
    }

    .calculator-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tool-card {
        min-height: 175px;
    }
}
