:root {
    --bg-main: #2c2c2c;
    --win-bg: #f0f0f0;
    --win-border: #7a7a7a;
    --tab-inactive: #e1e1e1;
    --antag: blue;
    --stim: green;
    --input-height: 20px;
    --font-size: 11px;
    --border: 1px solid var(--win-border);
}
.hidden { display: none; }
.custom-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 10000; }
.custom-modal { background: #f0f0f0; padding: 20px; border: var(--border); border-radius: 4px; min-width: 300px; max-width: 500px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
.custom-modal h3 { margin: 0 0 15px 0; font-size: 14px; }
.custom-modal .modal-message { white-space: pre-wrap; margin-bottom: 20px; font-size: 12px; }
.custom-modal .modal-close { padding: 8px 24px; background: #e1e1e1; border: 1px solid #7a7a7a; cursor: pointer; font-size: 12px; }
* { box-sizing: border-box; }
body { background-color: var(--bg-main); font-family: Arial, sans-serif; font-size: var(--font-size); margin: 0; display: flex; justify-content: center; padding-top: 10px; }
.antag { color: blue; width: 100%; text-align: left; }
.stim { color: green; width: 100%; text-align: right; }
.blue-text { color: blue; }
.green-text { color: green; }
.moneygreen-bg { background-color: #C0DCC0; }
.matrix-legend { font-size: 9.5px; }
.app-window { width: 920px; background-color: var(--win-bg); border: 1px solid var(--win-border); box-shadow: 0 0 15px rgba(0,0,0,0.5); }
.tabs-bar { display: flex; background-color: var(--tab-inactive); border-bottom: 1px solid var(--win-border); }
.tab { padding: 5px 15px; border: 1px solid transparent; border-bottom: none; background: none; cursor: pointer; font-size: 12px; }
.tab.active { background-color: var(--win-bg); border: 1px solid var(--win-border); border-bottom: 2px solid var(--win-bg); margin-bottom: -1px; font-weight: bold; }
.workspace { padding: 10px; min-height: 520px; }
.tab-content[hidden] { display: none !important; }
.header-line { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.label-bold { font-weight: bold; }
.main-title { font-weight: bold; font-size: 12px; }
.macro-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 10px; }
.macro-grid .col { display: flex; flex-direction: column; align-items: center; }
.macro-grid .col label { font-weight: bold; margin-bottom: 2px; }
.macro-grid .col input { width: 100%; max-width: 80px; box-sizing: border-box; }
.nitrogen-row { display: flex; gap: 20px; align-items: center; background: #e8e8e8; padding: 5px; border-radius: 2px; }
.inline-input { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; }
.inline-input label { font-weight: bold; width: 30px; }
.salts-panel, .conc-panel { margin-top: 15px; }
.salts-header, .salt-row, .conc-header, .conc-row { display: grid; grid-template-columns: 320px repeat(3, 1fr) 1fr; align-items: center; }
.salts-header, .conc-header { font-weight: bold; border-bottom: 1px solid #333; padding: 4px 0; background: #e8e8e8; }
.salts-header > :nth-child(2),
.salts-header > :nth-child(3),
.salts-header > :nth-child(4) { text-align: center; padding: 4px 0; font-weight: bold; }
.salt-row, .conc-row { border-bottom: 1px solid #ddd; padding: 3px 0; }
.salt-row .name, .conc-header .name, .conc-row .name { padding-left: 8px; }
.salt-row .val, .conc-header .val, .conc-row .val { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 4px; min-height: 30px; }
.s-label { font-size: 10px; font-weight: bold; color: #333; text-align: right; width: 30px; flex-shrink: 0; }
.salt-row .val input, .conc-header .val input, .conc-row .val input { width: 100%; max-width: 100px; box-sizing: border-box; text-align: center; }
.salt-row .result, .conc-header .result, .conc-row .result { display: flex; justify-content: flex-end; padding-right: 10px; font-weight: bold; }
input[type="number"], input[type="text"][inputmode="decimal"] { width: 80px; height: var(--input-height); text-align: right; border: var(--border); font-size: var(--font-size); }
.matrix-table input[type="text"] { width: 60px; height: var(--input-height); text-align: right; border: var(--border); font-size: var(--font-size); padding: 0 2px; }
input[readonly] { background-color: #e9e9e9; color: #555; }
button { cursor: pointer; background: #f0f0f0; border: 1px solid var(--win-border); padding: 3px 10px; }
button:hover { background: #e0e0e0; }
.app-footer { padding: 10px; background: #e1e1e1; border-top: 1px solid var(--win-border); }
.profile-string-container { display: flex; align-items: center; margin-bottom: 8px; }
.footer-layout { display: grid; grid-template-columns: 220px 1fr 180px; align-items: center; }
.wega { font-size: 26px; font-weight: bold; color: #2e7d32; line-height: 0.9; }
.sub-tabs { display: flex; background-color: #d8d8d8; border: 1px solid var(--win-border); border-bottom: none; margin-bottom: 0; }
.sub-tab { padding: 4px 20px; border: 1px solid transparent; border-bottom: none; background: none; cursor: pointer; font-size: var(--font-size); font-family: Arial, sans-serif; color: maroon; }
.sub-tab.active { background-color: var(--win-bg); border: 1px solid var(--win-border); border-bottom: 2px solid var(--win-bg); margin-bottom: -1px; font-weight: bold; }
.conc-sub-content { padding: 10px; }
.conc-sub-content[hidden], .conc-sub-content:not(.active) { display: none !important; }
.solution-section { margin-top: 10px; }
.section-header { font-size: 18px; font-weight: bold; color: maroon; padding: 5px 0; border-bottom: 1px solid #ccc; margin-bottom: 5px; }
.solution-total { text-align: right; padding: 5px; font-weight: bold; color: maroon; }
.conc-footer { margin-top: 15px; padding: 10px; background: #e8e8e8; border: 1px solid #ccc; display: flex; gap: 20px; align-items: center; }
.conc-footer label[for] { font-weight: bold; margin-right: 5px; }
.mixing-panel { margin-top: 10px; }
.mixing-header { display: grid; grid-template-columns: 60px 60px 1fr; align-items: center; font-weight: bold; border-bottom: 1px solid #333; padding: 4px 0; background: #e8e8e8; }
.mixing-header .m-pump, .mixing-header .m-grams { text-align: center; }
.mixing-list { max-height: 400px; overflow-y: auto; }
.mixing-row { display: grid; grid-template-columns: 60px 60px 1fr; align-items: center; border-bottom: 1px solid #ddd; padding: 3px 0; }
.pump-input, .grams-input { width: 55px; height: 22px; text-align: center; border: var(--border); font-size: var(--font-size); }
.m-name-label { padding-left: 8px; font-size: var(--font-size); }
.mixing-footer { margin-top: 15px; padding: 10px; background: #e8e8e8; border: 1px solid #ccc; display: flex; gap: 10px; align-items: center; }
.mixer-address { width: 200px; height: 24px; border: var(--border); font-size: var(--font-size); padding: 0 5px; }
.mixer-spin { width: 60px; height: 24px; border: var(--border); font-size: var(--font-size); text-align: center; }
.btn-base, .btn-make, .btn-profile, .btn-journal { padding: 5px 15px; font-size: var(--font-size); cursor: pointer; background: #f0f0f0; border: var(--border); }
.corrector-footer { display: flex; gap: 10px; margin-top: 15px; padding: 10px; background: #f5f5f5; border-top: 1px solid #ddd; }
.corrector-footer button, .corrector-table .corr-col-btn button { padding: 5px 15px; font-size: var(--font-size); cursor: pointer; background: #f0f0f0; border: var(--border); }
.corrector-footer button { min-width: 120px; }
.corrector-table .corr-col-btn button { padding: 3px 8px; min-width: 70px; }
.price-panel { margin-top: 10px; }
.price-list { max-height: 500px; overflow-y: auto; }
.price-row { display: grid; grid-template-columns: 80px 1fr; align-items: center; border-bottom: 1px solid #ddd; padding: 4px 0; }
.price-input { width: 70px; height: 22px; text-align: right; border: var(--border); font-size: var(--font-size); }
.p-name { padding-left: 8px; font-size: var(--font-size); }
[data-hidden="cmplx"] { display: none; }
.micro-composition { margin-top: 8px; padding: 6px 10px; font-size: var(--font-size); color: #333; background-color: #f5f5f5; border: 1px solid #ccc; border-radius: 3px; min-height: 20px; }
input.error { background-color: #ffe6e6; border-color: #d00; color: #d00; }
.corrector-wrapper { display: flex; gap: 10px; align-items: flex-start; }
.corrector-main { flex: 1; }
.corrector-table { width: 100%; border-collapse: collapse; background: transparent; }
.corrector-table th, .corrector-table td { border-bottom: 1px solid #999; padding: 4px 6px; }
.corrector-table th { font-weight: bold; font-size: var(--font-size); text-align: center; white-space: nowrap; }
.corrector-table .corr-label-col { width: 40px; text-align: center; }
.corrector-table .corr-col-name { width: 140px; font-weight: bold; font-size: var(--font-size); text-align: center; padding: 6px 0; }
.corrector-table .corr-col-btn { width: 140px; text-align: center; padding: 4px 0; }
.corrector-table .corr-label { font-weight: bold; text-align: center; width: 40px; font-size: var(--font-size); }
.corrector-table .corr-row input { width: 100%; height: var(--input-height); text-align: right; border: none; font-size: var(--font-size); padding: 0 4px; box-sizing: border-box; max-width: 80px; }
.corrector-protocol { width: 280px; flex-shrink: 0; }
.protocol-header { font-weight: bold; margin-bottom: 5px; font-size: 12px; }
.protocol-text { width: 100%; height: 470px; padding: 8px; border: 1px solid #ccc; border-radius: 3px; font-size: var(--font-size); font-family: Arial, sans-serif; resize: vertical; background: #f5f5f5; }
.journal-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); z-index: 10000; display: flex; justify-content: center; align-items: center; }
.journal-content { background: #fff; padding: 20px; border-radius: 8px; max-width: 90%; max-height: 90%; overflow: auto; min-width: 600px; min-height: 400px; }
.journal-content h2 { margin-top: 0; color: #333; border-bottom: 2px solid #2e7d32; padding-bottom: 10px; }
.journal-entry { border-bottom: 1px solid #eee; padding: 10px; margin-bottom: 10px; }
.journal-entry code { font-size: 12px; display: block; word-break: break-all; background: #f5f5f5; padding: 5px; border-radius: 3px; margin: 5px 0; }
.journal-entry pre { font-size: var(--font-size); white-space: pre-wrap; background: #fafafa; padding: 5px; border-radius: 3px; margin: 5px 0; max-height: 200px; overflow: auto; }
.journal-entry button { font-size: 10px; margin-top: 5px; }
.journal-content button { padding: 5px 10px; margin-right: 10px; margin-bottom: 10px; cursor: pointer; background: #f0f0f0; border: 1px solid #ccc; border-radius: 3px; }
.journal-content button:hover { background: #e0e0e0; }
#journal-clear { color: red; }
#journal-export { color: #2e7d32; }

/* Utility-классы (пункт 12) */
.flex-center { display: flex; align-items: center; gap: 4px; }
.small-input { height: var(--input-height); font-size: var(--font-size); border: var(--border); }
