.page-tool--line-height-calculator .tool-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-tool--line-height-calculator .tool-inputs__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-tool--line-height-calculator .tool-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 16px;
}

.page-tool--line-height-calculator .tool-field {
    gap: 6px;
}

.page-tool--line-height-calculator .tool-field__top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.page-tool--line-height-calculator .tool-field__top .label {
    flex: 1 1 auto;
    padding-bottom: 6px;
}

.page-tool--line-height-calculator .tool-inline {
    display: flex;
    gap: 8px;
}

.page-tool--line-height-calculator .tool-inline--compact {
    flex: 0 0 auto;
}

.page-tool--line-height-calculator .tool-inline--compact .input {
    width: 6.5rem;
    min-height: 38px;
    padding: 0.3rem 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.page-tool--line-height-calculator .tool-inline--compact .select {
    width: auto;
    min-width: 4.5rem;
}

.page-tool--line-height-calculator .tool-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 26px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

.page-tool--line-height-calculator .tool-range::-webkit-slider-runnable-track {
    height: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-3);
}

.page-tool--line-height-calculator .tool-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    margin-top: -8px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.page-tool--line-height-calculator .tool-range:focus {
    outline: none;
}

.page-tool--line-height-calculator .tool-range:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.page-tool--line-height-calculator .tool-range::-moz-range-track {
    height: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-3);
}

.page-tool--line-height-calculator .tool-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--accent);
}

.page-tool--line-height-calculator .tool-range:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.page-tool--line-height-calculator .tool-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    color: var(--faint);
    font-family: var(--font-mono);
    font-size: 0.66rem;
}

.page-tool--line-height-calculator .tool-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.page-tool--line-height-calculator .tool-hint code {
    padding: 0.05rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--surface-3);
    color: var(--ink-2);
    font-family: var(--font-mono);
}

.page-tool--line-height-calculator .tool-presets,
.page-tool--line-height-calculator .tool-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.page-tool--line-height-calculator .tool-presets {
    padding-top: 2px;
}

.page-tool--line-height-calculator .tool-presets__label {
    color: var(--faint);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-tool--line-height-calculator .tool-workspace {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.page-tool--line-height-calculator .tool-preview {
    grid-column: 1 / -1;
}

.page-tool--line-height-calculator .tool-preview__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.page-tool--line-height-calculator .tool-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-2);
    font-size: 0.8rem;
    cursor: pointer;
}

.page-tool--line-height-calculator .tool-toggle input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--accent);
}

.page-tool--line-height-calculator #preview-readout {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--faint);
}

.page-tool--line-height-calculator .tool-preview__stage {
    display: flex;
    align-items: flex-start;
    min-height: 20rem;
    padding: 32px;
    background: var(--surface);
    overflow-wrap: anywhere;
}

.page-tool--line-height-calculator .tool-preview__sample {
    margin: 0;
    max-width: 62ch;
    color: var(--ink);
}

.page-tool--line-height-calculator .tool-preview__stage--guides .tool-preview__sample {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent calc(var(--lh-guide, 1.5rem) - 1px),
        var(--line) calc(var(--lh-guide, 1.5rem) - 1px),
        var(--line) var(--lh-guide, 1.5rem)
    );
}

.page-tool--line-height-calculator .tool-hint--note {
    padding: 11px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}

.page-tool--line-height-calculator .tool-status {
    min-height: 0;
    margin: 0;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.page-tool--line-height-calculator .tool-status.status {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}

.page-tool--line-height-calculator .tool-status.status--error {
    background: var(--danger-soft);
    color: var(--danger);
}

.page-tool--line-height-calculator .tool-units {
    background: var(--surface);
}

.page-tool--line-height-calculator .tool-units__empty {
    margin: 0;
    padding: 2rem 16px;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

.page-tool--line-height-calculator .tool-unit {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 8rem) minmax(0, 1fr);
    align-items: baseline;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 0.82rem;
}

.page-tool--line-height-calculator .tool-unit:nth-child(even) {
    background: var(--surface-2);
}

.page-tool--line-height-calculator .tool-unit:last-of-type {
    border-bottom: 0;
}

.page-tool--line-height-calculator .tool-unit__label {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-tool--line-height-calculator .tool-unit__value {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.page-tool--line-height-calculator .tool-unit__note {
    min-width: 0;
    color: var(--faint);
    font-size: 0.76rem;
}

.page-tool--line-height-calculator .tool-recommendation {
    margin: 0;
    padding: 11px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.8rem;
}

.page-tool--line-height-calculator .tool-recommendation--ok {
    color: var(--success);
}

.page-tool--line-height-calculator .tool-recommendation--warn {
    color: var(--danger);
}

.page-tool--line-height-calculator .tool-reverse__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-tool--line-height-calculator .tool-reverse__result {
    margin: 0;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.page-tool--line-height-calculator .tool-reverse__result.status {
    margin: 0;
}

.page-tool--line-height-calculator .tool-reverse__result--ok {
    border-color: var(--success);
    color: var(--success);
}

.page-tool--line-height-calculator .tool-reverse__result--warn {
    border-color: var(--danger);
    color: var(--danger);
}

.page-tool--line-height-calculator .tool-about__text {
    max-width: 80ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.page-tool--line-height-calculator .tool-about__text code {
    padding: 0.05rem 0.3rem;
    border-radius: var(--radius-xs);
    background: var(--surface-3);
    color: var(--ink-2);
    font-family: var(--font-mono);
}

@media (max-width: 860px) {
    .page-tool--line-height-calculator .tool-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-tool--line-height-calculator .tool-workspace {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .page-tool--line-height-calculator .tool-unit {
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
    }

    .page-tool--line-height-calculator .tool-preview__stage {
        min-height: 14rem;
        padding: 24px;
    }
}
