/* MAIN-12: the pages under Tools in the nav. Colours come from theme.css, so the light and the dark theme both work */

.toolPage {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 640px;
    margin: 0 auto;
}

.toolCard {
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.toolNote {
    margin: 0;
    color: var(--ink-muted);
    font-size: 13px;
    text-align: center;
}

.toolActions {
    display: flex;
    gap: 8px;
}

    .toolActions.end {
        justify-content: flex-end;
    }

.toolBtn {
    min-height: 44px;
    padding: 0 16px;
    background: var(--surface);
    border: 1px solid var(--line-control);
    border-radius: 6px;
    color: var(--ink);
    font-weight: 600;
}

    .toolBtn.primary {
        flex: 1;
        background: var(--accent);
        border-color: var(--accent);
        color: var(--on-accent);
    }

    .toolBtn:disabled {
        opacity: 0.5;
        cursor: default;
    }

    .toolBtn:focus-visible {
        outline: 2px solid var(--accent-line);
        outline-offset: 2px;
    }

/* 16px, as a phone zooms the page in on any smaller field */
#text,
#message,
#lengthNumber {
    font-size: 16px;
}

/* ---------- letter count ---------- */

.toolCounts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.toolCount {
    padding: 10px 4px;
    text-align: center;
}

.toolCountValue {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.toolCount.lead .toolCountValue {
    color: var(--accent-ink);
}

.toolCountLabel {
    color: var(--ink-muted);
    font-size: 13px;
}

#text {
    min-height: 40vh;
}

/* ---------- request a tool ---------- */

.toolForm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toolNotice,
.toolWait {
    margin: 0;
    text-align: center;
}

    .toolNotice.problem {
        color: var(--danger);
    }

.toolCountdown {
    color: var(--accent-ink);
    font-variant-numeric: tabular-nums;
}

/* ---------- password generator ---------- */

/* Room for the longest password from the start: the slider sits below, and a box that grew with the length would move
   it away from the finger. 128 characters take 5 lines on the narrowest phones and 3 on a wide screen */
.toolPassword {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 7.5em;
    margin-bottom: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 1.1rem;
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
    user-select: all;
}

@media (min-width: 768px) {
    .toolPassword {
        min-height: 4.5em;
    }
}

.toolHint {
    margin: 0 0 12px;
    color: var(--ink-body);
    font-size: 13px;
    text-align: center;
}

.toolPresets {
    display: flex;
    border: 1px solid var(--line-control);
    border-radius: 6px;
    overflow: hidden;
}

    .toolPresets button {
        flex: 1 1 auto;
        min-height: 44px;
        padding: 4px 8px;
        background: var(--surface);
        border: 0;
        color: var(--ink);
        font-weight: 600;
        line-height: 1.2;
    }

        .toolPresets button + button {
            border-left: 1px solid var(--line-control);
        }

        .toolPresets button[aria-pressed="true"] {
            background: var(--accent);
            color: var(--on-accent);
        }

        /* Inside the button, as the row clips anything outside it */
        .toolPresets button:focus-visible {
            outline: 2px solid var(--accent-line);
            outline-offset: -2px;
        }

.toolLabel {
    display: block;
    margin-top: 12px;
    color: var(--ink-body);
    font-size: 13px;
}

.toolLength {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .toolLength input[type="range"] {
        flex: 1;
        min-width: 0;
        height: 44px;
        accent-color: var(--accent);
    }

#lengthNumber {
    flex: none;
    width: 5em;
}

.toolChecks {
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
    margin-top: 4px;
}

.toolCheck {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

    .toolCheck input {
        width: 18px;
        height: 18px;
        margin: 0;
        accent-color: var(--accent);
    }
