/* Free electronics calculators - community job C4 (2026-11-17).
 *
 * One stylesheet for the index page (/tools-calculators) and for every tool
 * page (/tools-calculators/<slug>). Phone first: the layout is built for a
 * 390px screen and widens from there. No rule here changes the page body
 * background, the site font or any shared theme style.
 */

.ptt-tool,
.ptt-tools-index {
    box-sizing: border-box;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 18px 16px 40px;
    color: #1a1a1a;
    font-size: 16px;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.ptt-tool *,
.ptt-tools-index * {
    box-sizing: border-box;
}

/* ---------- index page ---------- */

.ptt-tools-index-hero {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 16px;
    margin-bottom: 18px;
}

.ptt-tools-index-hero h1 {
    font-size: 26px;
    line-height: 1.25;
    margin: 0 0 8px;
}

.ptt-tools-index-hero p {
    margin: 0;
    color: #475569;
}

.ptt-tools-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.ptt-tools-card {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    background: #ffffff;
    color: #1a1a1a;
    text-decoration: none;
}

.ptt-tools-card:hover,
.ptt-tools-card:focus {
    border-color: #3b82f6;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.ptt-tools-card h2 {
    font-size: 18px;
    line-height: 1.3;
    margin: 0 0 6px;
}

.ptt-tools-card p {
    margin: 0;
    font-size: 14px;
    color: #475569;
}

.ptt-tools-note {
    margin-top: 20px;
    color: #475569;
    font-size: 14px;
}

/* ---------- tool page ---------- */

.ptt-tool-crumbs {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
}

.ptt-tool-crumbs a {
    color: #2563eb;
}

.ptt-tool-title {
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 10px;
}

.ptt-tool-intro {
    font-size: 17px;
    color: #334155;
    margin: 0 0 18px;
}

.ptt-tool-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
}

.ptt-tool-h2 {
    font-size: 20px;
    line-height: 1.3;
    margin: 0 0 12px;
}

.ptt-tool-h3 {
    font-size: 17px;
    line-height: 1.3;
    margin: 18px 0 6px;
}

.ptt-tool-p {
    margin: 0 0 10px;
}

.ptt-tool-share-hint {
    margin: 12px 0 0;
    font-size: 13px;
    color: #64748b;
}

/* ---------- calculator ---------- */

.ptt-calc-inputs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.ptt-calc-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ptt-calc-field[hidden] {
    display: none;
}

.ptt-calc-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.ptt-calc-unit {
    font-size: 13px;
    color: #64748b;
}

.ptt-calc-control {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    font-size: 16px;
    line-height: 1.4;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    -webkit-appearance: none;
    appearance: none;
}

select.ptt-calc-control {
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

.ptt-calc-control:focus {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 1px;
    border-color: #3b82f6;
}

.ptt-calc-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.ptt-calc-result {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f1f5f9;
    border-left: 4px solid #3b82f6;
}

.ptt-calc-result-label {
    font-size: 13px;
    color: #475569;
}

.ptt-calc-result-value {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
}

.ptt-calc-note {
    margin: 4px 0 0;
    font-size: 13px;
    color: #475569;
}

.ptt-calc-empty {
    margin: 0;
    color: #64748b;
}

.ptt-calc-formula {
    margin: 14px 0 0;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    color: #334155;
}

.ptt-calc-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 14px;
}

.ptt-calc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.ptt-calc-button,
.ptt-tool-button {
    display: inline-block;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.ptt-calc-button-secondary,
.ptt-tool-button-alt {
    background: #ffffff;
    color: #1d4ed8;
}

.ptt-calc-share-field {
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

/* ---------- parts and next steps ---------- */

.ptt-tool-parts {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.ptt-tool-part {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.ptt-tool-part a {
    color: #1d4ed8;
    font-weight: 600;
    font-size: 15px;
}

.ptt-tool-part-price {
    font-size: 14px;
    color: #475569;
}

.ptt-tool-next {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.ptt-tool-other {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.ptt-tool-other a {
    color: #1d4ed8;
}

/* ---------- wider screens ---------- */

@media (min-width: 560px) {
    .ptt-calc-inputs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ptt-calc-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ptt-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ptt-tool-parts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ptt-tool-next {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .ptt-tool,
    .ptt-tools-index {
        padding: 24px 24px 56px;
    }

    .ptt-tools-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ptt-tool-title {
        font-size: 32px;
    }
}
