.tool-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.tool-hero {
    margin-bottom: 2rem;
}

.tool-hero h1 {
    margin: 0 0 0.6rem;
    color: #00d1b2;
    font-size: 2.4rem;
    line-height: 1.2;
}

.tool-hero p {
    max-width: 760px;
    margin: 0;
    color: #f0e0bd;
    font-size: 1.05rem;
    line-height: 1.55;
}

.tool-card {
    padding: 1.75rem;
    margin-bottom: 3rem;
    border: 1px solid #343b46;
    border-radius: 14px;
    background: #161b22;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.converter-settings {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.setting-group {
    min-width: 150px;
}

.setting-group > label {
    display: block;
    margin-bottom: 0.35rem;
    color: #f0c674;
    font-weight: 600;
}

.converter-settings select,
.converter-settings input {
    min-height: 2.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #f0f6fc;
    background: #0d1117;
    font: inherit;
}

.converter-settings select {
    cursor: pointer;
}

.converter-settings select:focus,
.converter-settings input:focus {
    border-color: #00d1b2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 209, 178, 0.18);
}

.custom-impedance-container {
    min-width: 180px;
}

.input-with-unit {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-with-unit input {
    width: 120px;
}

.input-with-unit span {
    color: #f0c674;
}

.converter-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #343b46;
}

.converter-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    table-layout: fixed;
}

.converter-table th,
.converter-table td {
    padding: 0.7rem 0.45rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #30363d;
}

.converter-table th {
    color: #f0c674;
    background: #232831;
    font-weight: 700;
}

.converter-table tbody tr {
    background: #161b22;
}

.converter-input {
    width: 100%;
    min-width: 105px;
    padding: 0.75rem 0.65rem;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #f0f6fc;
    background: #0d1117;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.98rem;
}

.converter-input:focus {
    border-color: #00d1b2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 209, 178, 0.18);
}

.converter-input.is-source {
    border-color: #d8a93f;
    background: #11151c;
    box-shadow: 0 0 0 1px rgba(216, 169, 63, 0.18);
}

.converter-input.is-invalid {
    border-color: #ff8585;
    background: rgba(255, 133, 133, 0.06);
}

.converter-status {
    min-height: 1.5em;
    margin: 1.2rem 0 0;
    color: #f0c674;
    font-size: 0.95rem;
}

.converter-status.error {
    color: #ff8585;
}

.tool-note {
    margin: 0.6rem 0 0;
    color: #d2d7df;
    font-size: 0.92rem;
    line-height: 1.5;
}

.tool-content {
    max-width: 850px;
    color: #dce2ea;
}

.tool-content h2,
.tool-terminal h2 {
    margin-top: 2rem;
    color: #00d1b2;
    line-height: 1.25;
}

.tool-content p,
.tool-terminal p {
    line-height: 1.6;
}

.formula-block {
    padding: 1.2rem 1.35rem;
    margin: 1.5rem 0;
    border: 1px solid #343b46;
    border-left: 4px solid #00d1b2;
    border-radius: 10px;
    color: #dce2ea;
    background: #1b2028;
}

.formula-block p {
    margin: 0.55rem 0;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Consolas,
        "Liberation Mono",
        monospace;
}

/*
.tool-terminal {
    padding-top: 1rem;
    margin-top: 3rem;
    border-top: 1px solid #343b46;
}

.related-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.related-tool {
    display: block;
    position: relative;
    padding: 1rem 2.5rem 1rem 1.1rem;
    border: 1px solid #30363d;
    border-radius: 10px;
    color: inherit;
    background: #1b2028;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.related-tool::after {
    content: "›";
    position: absolute;
    top: 50%;
    right: 1rem;
    color: #dce2ea;
    font-size: 1.7rem;
    transform: translateY(-50%);
}

.related-tool:hover,
.related-tool:focus {
    border-color: #00d1b2;
    background: #252b36;
    transform: translateY(-1px);
}

.related-tool strong,
.related-tool span {
    display: block;
}

.related-tool strong {
    color: #f0f6fc;
}

.related-tool span {
    margin-top: 0.35rem;
    color: #c5ccd5;
    font-size: 0.94rem;
    line-height: 1.45;
}

.tool-feedback {
    padding-top: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid #343b46;
    color: #d2d7df;
}

.tool-feedback a {
    color: #00d1b2;
}

.tool-feedback a:hover,
.tool-feedback a:focus {
    color: #5eead4;
}

*/

@media (max-width: 720px) {
    .tool-page {
        padding: 2rem 1rem;
    }

    .tool-hero h1 {
        font-size: 2rem;
    }

    .tool-card {
        padding: 1rem;
    }

    .converter-settings {
        align-items: stretch;
    }

    .converter-settings > * {
        width: 100%;
    }

    .setting-group {
        min-width: 0;
    }

    .converter-settings select,
    .converter-settings input {
        width: 100%;
    }

    .input-with-unit input {
        flex: 1;
        width: auto;
    }

    .related-tools {
        grid-template-columns: 1fr;
    }
}
