/* flowcalc.chromoshub.ru — GC column pressure/flow calculator */
:root {
    --bg: #0d1117;
    --bg-2: #161b22;
    --bg-3: #1c2430;
    --card: #10151d;
    --line: #26303c;
    --line-2: #313d4d;
    --txt: #e6edf3;
    --txt-2: #9aa7b4;
    --txt-3: #6b7684;
    --accent: #4bd0b0;
    --accent-2: #16a085;
    --err: #f85149;
    --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", "DejaVu Sans Mono", "Consolas", monospace;
    --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="light"] {
    --bg: #f2f6f5;
    --bg-2: #ffffff;
    --bg-3: #eef2f4;
    --card: #ffffff;
    --line: #dde4e6;
    --line-2: #c9d3d4;
    --txt: #14201d;
    --txt-2: #52616a;
    --txt-3: #808d92;
    --accent: #0f9b81;
    --accent-2: #0c7d68;
    --err: #cf222e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
    font-family: var(--ui);
    background:
        radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
        var(--bg);
    color: var(--txt);
    min-height: 100vh;
}

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.brand__mark { font-size: 18px; }
.actions { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.lang__btn {
    font-family: var(--mono); font-size: 11px; font-weight: 600;
    padding: 0 9px; border: 0; background: var(--bg-3); color: var(--txt-2); cursor: pointer;
    transition: background .12s, color .12s;
}
.lang__btn + .lang__btn { border-left: 1px solid var(--line-2); }
.lang__btn:hover { color: var(--accent); }
.lang__btn.is-active { background: var(--accent-2); color: #fff; }
.icon-btn {
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-3); color: var(--txt-2); cursor: pointer;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.is-ok { color: #fff; background: var(--accent-2); border-color: var(--accent-2); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .i-moon { display: none; }
:root[data-theme="light"] .icon-btn .i-sun { display: none; }
:root[data-theme="light"] .icon-btn .i-moon { display: block; }

.wrap {
    max-width: 880px; margin: 0 auto; padding: 22px 18px 40px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    align-items: start;
}
.panel {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    padding: 18px 18px; box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
.panel--accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.panel__title { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-2); margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--txt-3); margin: -6px 0 12px; }

.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--txt-2); margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field--row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.field--row > span { flex: 1; }

input, select {
    font-family: var(--mono); font-size: 14px;
    padding: 8px 10px; background: var(--bg-3); color: var(--txt);
    border: 1px solid var(--line-2); border-radius: 8px; outline: none;
}
.field--row input, .field--row select { width: 130px; text-align: right; }
.field--row select { text-align: left; }
input:focus, select:focus { border-color: var(--accent); }
select { cursor: pointer; }
.in-unit { display: inline-flex; align-items: center; gap: 6px; }
.in-unit input { width: 96px; }
.in-unit em { font-style: normal; font-size: 12px; color: var(--txt-3); font-family: var(--mono); min-width: 26px; }
.mt8 { margin-top: 8px; width: 100%; }
.mb8 { margin-bottom: 10px; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; width: 100%; }
.seg__btn {
    flex: 1; font-family: var(--ui); font-size: 12.5px;
    padding: 8px 6px; border: 0; background: var(--bg-3); color: var(--txt-2); cursor: pointer;
    transition: background .12s, color .12s;
}
.seg__btn + .seg__btn { border-left: 1px solid var(--line-2); }
.seg__btn:hover { color: var(--accent); }
.seg__btn.is-active { background: var(--accent-2); color: #fff; }

.res-row b { color: var(--txt); }
.mono { font-family: var(--mono); }
.err { margin-top: 10px; color: var(--err); font-size: 13px; }

/* chart */
.panel--wide { grid-column: 1 / -1; }
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .tick { fill: var(--txt-3); font-family: var(--mono); font-size: 11px; }
.chart .axis-title { fill: var(--txt-2); font-family: var(--ui); font-size: 12px; }
.chart .curve { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .op-dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart .op-label { fill: var(--txt); font-family: var(--mono); font-size: 11px; }
.chart .opt-line { stroke: #d29922; stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .opt-label { fill: #d29922; font-family: var(--mono); font-size: 10px; }
.chart .cross { stroke: var(--txt-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .cross-dot { fill: var(--card); stroke: var(--accent); stroke-width: 2; }
.chart .tip-bg { fill: var(--bg-2); stroke: var(--line-2); stroke-width: 1; }
.chart .tip-tx { fill: var(--txt); font-family: var(--mono); font-size: 11px; }

/* holdup hero */
.hero {
    grid-column: 1 / -1;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, var(--card)), var(--card));
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.hero__label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-2); }
.hero__val b { font-family: var(--mono); font-size: 2.6rem; color: var(--accent); line-height: 1.1; }
.hero__val em { font-style: normal; font-size: 1rem; color: var(--txt-2); }
.hero__sub { font-family: var(--mono); font-size: 12px; color: var(--txt-3); }
.hero__stats { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; margin-top: 4px; font-family: var(--mono); font-size: 12px; color: var(--txt-3); }
.hero__stats b { color: var(--txt-2); }

.note { grid-column: 1 / -1; font-size: 12px; color: var(--txt-3); text-align: center; line-height: 1.5; }

@media (max-width: 680px) {
    .wrap { grid-template-columns: 1fr; }
    .hero, .note { grid-column: 1 / -1; }
}
