.jaro-pq-converter,
.jaro-pq-converter * {
    box-sizing: border-box;
}

.jaro-pq-converter {
    --jaro-pq-primary: #164468;
    --jaro-pq-accent: #217da6;
    --jaro-pq-border: #c8d3dc;
    --jaro-pq-soft: #eef5f8;
    --jaro-pq-text: #173b5b;
    --jaro-pq-muted: #5d7488;
    --jaro-pq-green: #00815f;
    width: 100%;
    max-width: 1540px;
    margin: 20px auto;
    color: var(--jaro-pq-text);
    background: #f4f7f9;
    border: 1px solid #dbe4ea;
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.45;
}

.jaro-pq-header {
    padding: 16px 24px;
    color: #fff;
    background: var(--jaro-pq-primary);
}

.jaro-pq-title {
    font-size: 15px;
    letter-spacing: .02em;
}

.jaro-pq-subtitle {
    margin-top: 4px;
    font-size: 14px;
    opacity: .95;
}

.jaro-pq-layout {
    display: grid;
    grid-template-columns: minmax(290px, 30%) minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
}

.jaro-pq-input-card,
.jaro-pq-results-card {
    min-width: 0;
    background: #fff;
    border: 1px solid #dfe7ec;
}

.jaro-pq-input-card {
    display: flex;
    flex-direction: column;
    padding: 20px 18px 16px;
}

.jaro-pq-input-card h3,
.jaro-pq-summary-panel h3 {
    margin: 0 0 13px;
    color: var(--jaro-pq-primary);
    font-size: 14px;
    font-weight: 500;
}

.jaro-pq-field-label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 500;
}

.jaro-pq-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(130px, 42%);
    gap: 7px;
    margin-bottom: 14px;
}

.jaro-pq-field-row-simple {
    grid-template-columns: minmax(0, 1fr) 42%;
    align-items: center;
}

.jaro-pq-field-row-simple span {
    color: var(--jaro-pq-muted);
    font-size: 13px;
    font-weight: 600;
}

.jaro-pq-converter input,
.jaro-pq-converter select,
.jaro-pq-converter button {
    font: inherit;
}

.jaro-pq-converter input,
.jaro-pq-converter select {
    width: 100%;
    height: 34px;
    padding: 5px 8px;
    color: #243746;
    background: #fff;
    border: 1px solid #b8c3cb;
    border-radius: 0;
}

.jaro-pq-converter input:focus,
.jaro-pq-converter select:focus,
.jaro-pq-button:focus-visible,
.jaro-pq-tab:focus-visible {
    outline: 2px solid var(--jaro-pq-accent);
    outline-offset: 2px;
}

.jaro-pq-note {
    margin: 7px 0 15px;
    color: var(--jaro-pq-muted);
    font-size: 12px;
}

.jaro-pq-button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #9aaab5;
    border-radius: 0;
    cursor: pointer;
    transition: filter .15s ease, transform .05s ease;
}

.jaro-pq-button:hover {
    filter: brightness(.97);
}

.jaro-pq-button:active {
    transform: translateY(1px);
}

.jaro-pq-button-primary {
    width: 100%;
    color: #fff;
    background: var(--jaro-pq-accent);
    border-color: var(--jaro-pq-accent);
    font-weight: 600;
}

.jaro-pq-button-secondary {
    color: #163c58;
    background: #eef2f4;
}

.jaro-pq-button-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 7px;
}

.jaro-pq-message {
    min-height: 21px;
    margin: 10px 0 0;
    color: var(--jaro-pq-muted);
    font-size: 12px;
}

.jaro-pq-message.is-error {
    color: #b42318;
}

.jaro-pq-message.is-success {
    color: #146c54;
}

.jaro-pq-credit {
    margin-top: auto;
    padding: 11px 12px;
    color: var(--jaro-pq-primary);
    background: var(--jaro-pq-soft);
    border: 1px solid #d5e3ea;
    font-size: 11px;
    font-weight: 600;
}

.jaro-pq-results-card {
    display: flex;
    min-height: 610px;
    flex-direction: column;
}

.jaro-pq-tabs {
    display: flex;
    align-items: flex-end;
    min-height: 43px;
    overflow-x: auto;
    border-bottom: 1px solid #aeb8bf;
}

.jaro-pq-tab {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 18px;
    color: #102d43;
    background: #e5e2dc;
    border: 1px solid #aea99f;
    border-bottom: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.jaro-pq-tab + .jaro-pq-tab {
    margin-left: -1px;
}

.jaro-pq-tab.is-active {
    position: relative;
    z-index: 2;
    color: var(--jaro-pq-primary);
    background: #fff;
    transform: translateY(1px);
}

.jaro-pq-panel {
    display: none;
    min-height: 0;
    flex: 1 1 auto;
    padding: 14px;
}

.jaro-pq-panel.is-active {
    display: block;
}

.jaro-pq-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #9fb0bc;
}

.jaro-pq-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    font-size: 14px;
}

.jaro-pq-table th,
.jaro-pq-table td {
    padding: 8px 10px;
    border: 0;
    text-align: right;
    white-space: nowrap;
}

.jaro-pq-table th:first-child,
.jaro-pq-table td:first-child {
    text-align: left;
}

.jaro-pq-table thead {
    color: var(--jaro-pq-primary);
    background: #eaf3f7;
}

.jaro-pq-table tbody tr:nth-child(even) {
    background: #f6f8fa;
}

.jaro-pq-table tbody tr.is-selected {
    background: #cfe6f3;
}

.jaro-pq-selected-mark {
    color: #253b4a;
    font-size: 12px;
}

.jaro-pq-summary-panel {
    padding: 18px;
}

.jaro-pq-noise-result {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding: 18px;
    background: #eaf4f8;
    border: 1px solid #cadde7;
    font-size: 18px;
}

.jaro-pq-noise-maximum {
    color: var(--jaro-pq-green);
}

.jaro-pq-summary {
    min-height: 330px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    color: #0e3658;
    background: #fff;
    border: 1px solid #222;
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre;
}

@media (max-width: 900px) {
    .jaro-pq-layout {
        grid-template-columns: 1fr;
    }

    .jaro-pq-results-card {
        min-height: 520px;
    }

    .jaro-pq-credit {
        margin-top: 16px;
    }
}

@media (max-width: 560px) {
    .jaro-pq-converter {
        margin: 10px auto;
    }

    .jaro-pq-header {
        padding: 14px 16px;
    }

    .jaro-pq-layout {
        padding: 8px;
    }

    .jaro-pq-input-card,
    .jaro-pq-summary-panel,
    .jaro-pq-panel {
        padding: 13px;
    }

    .jaro-pq-field-row {
        grid-template-columns: 1fr;
    }

    .jaro-pq-field-row-simple {
        grid-template-columns: minmax(0, 1fr) 60px;
    }

    .jaro-pq-tab {
        padding: 9px 12px;
        font-size: 12px;
    }

    .jaro-pq-noise-result {
        flex-direction: column;
        font-size: 16px;
    }

    .jaro-pq-summary {
        min-height: 290px;
        font-size: 12px;
    }
}
