:root {
    --ok: #3fb67a;
    --warn: #f2b705;
    --bad: #e5483b;
}

.tool-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 150px clamp(20px, 5vw, 48px) var(--gap-lg);
}

.tool-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}

.tool-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 12px;
}

.tool-lead {
    color: var(--text-muted);
    max-width: 640px;
    margin: 0;
}

.lang-switch {
    display: flex;
    border: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 12px;
}

.lang-switch button {
    background: none;
    border: 0;
    color: var(--text-muted);
    padding: 8px 14px;
    cursor: pointer;
    letter-spacing: 0.1em;
    font-family: inherit;
    font-size: inherit;
}

.lang-switch button.active {
    color: var(--text);
    background: var(--panel);
}

.panel {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: clamp(18px, 3vw, 28px);
    margin-bottom: 24px;
}

.panel-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
}

.source-grid {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.field label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 10px 12px;
    font: inherit;
    font-size: 15px;
}

.field textarea {
    font-family: var(--font-mono);
    font-size: 13px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.field .row {
    display: flex;
    gap: 8px;
}

.field .row select {
    width: auto;
    flex: 0 0 auto;
    max-width: 55%;
}

.row-between {
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 8px;
}

.field-wide {
    grid-column: 1 / -1;
}

.hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

.hint.conv {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-alt);
    min-height: 1.4em;
}

.row-between .hint {
    margin-top: 0;
}

.btn {
    background: none;
    border: 1px solid var(--line);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
}

.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Verdict */

.lvl-0 { --lvl: var(--ok); }
.lvl-1 { --lvl: var(--warn); }
.lvl-2 { --lvl: var(--bad); }

.verdict {
    border: 1px solid var(--line);
    border-left: 4px solid var(--lvl);
    background: var(--panel);
    padding: clamp(18px, 3vw, 28px);
    margin-bottom: 24px;
}

.verdict-title {
    margin: 0 0 6px;
    font-size: clamp(20px, 2.6vw, 28px);
    color: var(--lvl);
}

.verdict-sub {
    margin: 0 0 20px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-bottom: 24px;
}

.metric {
    background: var(--bg);
    padding: 14px 16px;
}

.metric .k {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric .v {
    font-size: 22px;
    font-weight: 700;
    margin-top: 4px;
}

.metric .u {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
}

.metric.lvl-0 .v,
.metric.lvl-1 .v,
.metric.lvl-2 .v {
    color: var(--lvl);
}

.advice {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.advice li {
    padding-left: 18px;
    position: relative;
    color: #d8d6d0;
    font-size: 15px;
}

.advice li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    background: var(--lvl);
}

.advice li.lvl-0::before { background: var(--ok); }
.advice li.lvl-1::before { background: var(--warn); }
.advice li.lvl-2::before { background: var(--bad); }
.advice li.info::before { background: var(--text-muted); }

/* Charts */

.chart-note {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 16px;
    max-width: 760px;
}

.chart {
    width: 100%;
    height: auto;
    display: block;
    background: var(--bg);
    border: 1px solid var(--line);
}

.chart .grid {
    stroke: rgba(255, 255, 255, 0.07);
    stroke-width: 1;
}

.chart .axis {
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 1;
}

.chart .tick-text {
    fill: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

.chart .axis-title {
    fill: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

.chart .curve-label {
    font-family: var(--font-mono);
    font-size: 11px;
    paint-order: stroke;
    stroke: var(--bg);
    stroke-width: 3px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend i {
    display: inline-block;
    width: 18px;
    height: 3px;
    background: var(--c);
}

.legend i.dashed {
    height: 0;
    border-top: 2px dashed var(--c);
    background: none;
}

/* Table */

.tbl-wrap {
    overflow-x: auto;
}

.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 640px;
}

.tbl th,
.tbl td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.tbl th {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.tbl tr.mine td {
    background: rgba(255, 255, 255, 0.04);
    font-weight: 700;
}

.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 8px;
    background: var(--lvl);
}

.msg-error {
    border: 1px solid var(--bad);
    color: var(--bad);
    padding: 16px 20px;
    margin-bottom: 24px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.method,
.disclaimer {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--text-muted);
    max-width: 820px;
}

.disclaimer {
    color: #d8d6d0;
    border-left: 2px solid var(--accent-alt);
    padding-left: 14px;
}

.site-nav a.active {
    color: var(--text);
}
