.kc {
    --kc-ink: #16242b;
    --kc-muted: #5a6b73;
    --kc-line: #dfe5e8;
    --kc-plot: #f7f9fa;
    --kc-starved: #3d6b5e;
    --kc-mid: #5a7380;
    --kc-plenty: #d06a1c;
}

.kc-hint {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--kc-muted);
}

.kc-plot {
    background: var(--kc-plot);
    border: 1px solid var(--kc-line);
    border-radius: 8px;
    overflow: hidden;
}

.kc-svg {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
}

.kc-bg {
    fill: var(--kc-plot);
}

.kc-grid {
    stroke: #e4eaed;
    stroke-width: 1;
}

.kc-axis-label,
.kc-axis-title {
    fill: #7a8a92;
    font-size: 11px;
    font-family: inherit;
}

.kc-axis-title {
    font-size: 12px;
}

.kc-line {
    stroke: #1d4251;
    stroke-width: 2.25;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.kc-cross {
    stroke: rgba(29, 66, 81, 0.35);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    pointer-events: none;
}

.kc-dot circle {
    fill: #5a7380;
    stroke: #fff;
    stroke-width: 2;
}

.kc-dot--starved circle { fill: var(--kc-starved); }
.kc-dot--mid circle { fill: var(--kc-mid); }
.kc-dot--plenty circle { fill: var(--kc-plenty); }

.kc-dot.is-selected circle {
    stroke: #1d4251;
    stroke-width: 2.5;
}

.kc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 10px 0 0;
    font-size: 0.8rem;
    color: var(--kc-muted);
}

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

.kc-legend i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.kc-legend i.starved { background: var(--kc-starved); }
.kc-legend i.mid { background: var(--kc-mid); }
.kc-legend i.plenty { background: var(--kc-plenty); }

.kc-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.kc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kc-field label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--kc-muted);
}

.kc-field input[type='number'],
.kc-field input[type='text'] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--kc-line);
    border-radius: 6px;
    font: inherit;
}

.kc-o2-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kc-o2-row input[type='range'] {
    flex: 1;
    min-width: 0;
}

.kc-o2-row input[type='number'] {
    width: 4.6rem;
    padding: 6px 8px;
}

.kc-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.kc-preset,
.kc-link {
    border: 1px solid var(--kc-line);
    background: #fff;
    border-radius: 999px;
    padding: 5px 11px;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--kc-ink);
}

.kc-preset.is-active {
    border-color: currentColor;
    font-weight: 600;
}

.kc-preset[data-kc-preset='starved'] { color: var(--kc-starved); }
.kc-preset[data-kc-preset='mid'] { color: var(--kc-mid); }
.kc-preset[data-kc-preset='plenty'] { color: var(--kc-plenty); }

.kc-tools__foot {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.kc-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.kc-tag--starved { background: #e7f1ed; color: var(--kc-starved); }
.kc-tag--mid { background: #e8eef1; color: var(--kc-mid); }
.kc-tag--plenty { background: #fbeee0; color: var(--kc-plenty); }

.kc-log {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 0.88rem;
}

.kc-log th,
.kc-log td {
    text-align: left;
    padding: 8px 6px;
    border-bottom: 1px solid var(--kc-line);
}

.kc-log th {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--kc-muted);
}

.kc-log tr.is-selected td {
    background: #eef4f7;
}

.kc-log__empty {
    color: var(--kc-muted);
    font-style: italic;
}

.kc-link {
    padding: 3px 9px;
}

@media (max-width: 720px) {
    .kc-tools {
        grid-template-columns: 1fr;
    }
}
