:root {
    --accent: #1a7f5e;
    --accent-dark: #146147;
    --text-black: #0a0a0a;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --border: rgba(0, 0, 0, 0.06);
    --error: #ff4757;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

body {
    margin: 0; font-family: 'Roboto', sans-serif; color: var(--text-black); min-height: 100vh;
    background: linear-gradient(125deg, #ffffff 0%, #f0f4f2 25%, #d1e8df 50%, #ffffff 100%);
    background-size: 400% 400%; animation: meshGradient 20s ease infinite; background-attachment: fixed;
}

@keyframes meshGradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* ШАПКА */
.top-bar {
    position: fixed; top: 0; width: 100%; height: 60px;
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center;
    padding: 0 25px; z-index: 1000;
}

.page-name { font-family: 'Ubuntu', sans-serif; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }
.burger-btn { background: none; border: none; width: 22px; height: 12px; display: flex; flex-direction: column; justify-content: space-between; padding: 0; }
.burger-btn span { width: 100%; height: 2px; background: var(--text-black); border-radius: 4px; }

/* МЕНЮ */
.sidebar {
    position: fixed; top: 0; right: -100%; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(30px);
    z-index: 1002; transition: 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.sidebar.active { right: 0; }
.menu-label { font-family: 'Ubuntu', sans-serif; font-size: 10px; text-transform: uppercase; letter-spacing: 4px; color: #999; margin-bottom: 20px; }
.sidebar a { font-family: 'Ubuntu', sans-serif; padding: 12px; font-size: 24px; font-weight: 700; text-decoration: none; color: var(--text-black); transition: 0.3s; }
.sidebar a.active { color: var(--accent); }
.menu-divider { width: 40px; height: 3px; background: var(--accent); margin: 15px 0; border-radius: 2px; opacity: 0.6; }

/* КОНТЕНТ */
.content { padding: 90px 20px 40px; }
.page { display: none; animation: pageFade 0.5s ease; }
.page.active { display: block; }
@keyframes pageFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.hero-title { font-family: 'Ubuntu', sans-serif; font-size: 38px; font-weight: 700; margin-bottom: 25px; letter-spacing: -1.5px; }

/* КАРТОЧКИ */
.card.glass {
    background: var(--glass-bg); backdrop-filter: blur(15px); border-radius: 28px; padding: 25px;
    margin-bottom: 25px; border: 1px solid rgba(255, 255, 255, 0.6); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.03);
}
.card-header { font-family: 'Ubuntu', sans-serif; font-size: 18px; font-weight: 700; color: var(--accent); margin-bottom: 20px; }

/* ФЕРМЕНТЫ (СПЕЦИФИКА) */
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.small-label { font-size: 10px; font-weight: 700; color: #777; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; display: block; }
.res-display { margin-top: 15px; padding: 18px; background: rgba(26, 127, 94, 0.1); border-radius: 20px; font-family: 'Ubuntu', sans-serif; font-weight: 700; color: var(--accent); font-size: 20px; }

/* ТАБЛИЦА РАСХОДА */
.table-header { display: flex; font-size: 9px; color: #888; text-transform: uppercase; font-weight: 700; margin-bottom: 12px; }
.flow-inline-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(0,0,0,0.03); }
.input-unit { flex: 1; }
.pct-unit { flex: 0.5; }
.separator { color: #ccc; font-size: 18px; }

/* КАЛЬКУЛЯТОР КИСЛОТЫ */
.acid-display-card { padding: 25px !important; margin-bottom: 20px !important; background: linear-gradient(135deg, rgba(26, 127, 94, 0.15), rgba(255,255,255,0.4)) !important; }
.results-row { display: flex; justify-content: space-between; gap: 20px; }
.res-item { text-align: center; flex: 1; }
.main-res-val { font-family: 'Ubuntu', sans-serif; font-size: 24px; font-weight: 700; color: var(--accent); margin-top: 5px; }

.calc-grid-new { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 75px); gap: 12px; }
.calc-btn { border-radius: 20px; border: 1px solid rgba(255,255,255,0.8); background: rgba(255,255,255,0.7); backdrop-filter: blur(10px); font-size: 22px; font-family: 'Ubuntu', sans-serif; font-weight: 700; transition: 0.1s; display: flex; align-items: center; justify-content: center; }
.calc-btn:active { transform: scale(0.92); opacity: 0.8; }
.calc-btn.triple { grid-row: span 3; height: 100%; background: var(--accent) !important; color: white !important; font-size: 32px; }
.calc-btn.clr { color: var(--error); }
.calc-btn.zero { grid-column: span 2; }

input { width: 100%; border: none; border-bottom: 2px solid rgba(0,0,0,0.06); padding: 8px 0; font-size: 18px; background: transparent; font-family: 'Roboto', sans-serif; color: var(--text-black); transition: 0.3s; }
input:focus { border-bottom-color: var(--accent); }
input[type="time"] { font-size: 16px; accent-color: var(--accent); }

/* TOASTS & OVERLAY */
#toast-container { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); width: 90%; z-index: 2000; pointer-events: none; }
.toast { background: rgba(10, 10, 10, 0.85); color: white; padding: 12px 18px; border-radius: 15px; font-size: 12px; text-align: center; margin-bottom: 8px; backdrop-filter: blur(10px); animation: toastIn 0.4s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.1); visibility: hidden; opacity: 0; transition: 0.4s; z-index: 1001; }
.overlay.active { visibility: visible; opacity: 1; }
.input-error { color: var(--error) !important; font-weight: 700; }
.row-error { border-bottom-color: var(--error) !important; background: rgba(255, 71, 87, 0.04); }
