:root {
    --bg: #f4f4f1;
    --surface: #ffffff;
    --border: #d8d6cf;
    --border-strong: #b8b5ac;
    --text: #1a1a1a;
    --text-muted: #6b6b66;
    --accent: #1e4e8c;
    --accent-soft: #e8eef6;
    --error-bg: #fdecec;
    --error-text: #8b1f1f;
    --mono: "IBM Plex Mono", "Courier New", monospace;
    --sans: "IBM Plex Sans", -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

header { margin-bottom: 1.5rem; }

h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 0.25rem;
    letter-spacing: -0.01em;
}

.subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
}
.row:last-child { margin-bottom: 0; }

.field { display: flex; flex-direction: column; }
.field--qty { max-width: 160px; }

label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

input[type="number"], select {
    font-family: var(--mono);
    font-size: 15px;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    background: var(--surface);
    color: var(--text);
    width: 100%;
}

select { font-family: var(--sans); }

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.btn {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    background: var(--text);
    color: var(--surface);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    height: 40px;
    letter-spacing: 0.02em;
}
.btn:hover { background: var(--accent); }

.btn--secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn--secondary:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.prices-card__title {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

/* Результат */
.result__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.result__title { font-size: 16px; font-weight: 500; }
.result__params { font-size: 13px; color: var(--text-muted); margin-top: 0.25rem; font-family: var(--mono); }

.result__mass {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}
.result__mass-value {
    font-family: var(--mono);
    font-size: 36px;
    font-weight: 500;
    color: var(--text);
    line-height: 1;
}
.result__mass-unit {
    font-size: 14px;
    color: var(--text-muted);
}

.result__total {
    background: var(--accent-soft);
    padding: 0.6rem 0.9rem;
    border-radius: 3px;
    margin-bottom: 1rem;
    font-size: 14px;
}
.result__total .num {
    font-family: var(--mono);
    font-weight: 500;
    color: var(--accent);
}

.details {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.details td {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}
.details tr:last-child td { border-bottom: none; }
.details td:first-child { color: var(--text-muted); }
.details td:last-child { text-align: right; }
.details .num, .details .formula { font-family: var(--mono); }

.error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: #f0caca;
    font-size: 14px;
}

footer {
    margin-top: 2rem;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}
