.primary-nav a[aria-current="location"] { box-shadow: inset 0 -3px #f3cc85; }
.tools-main {
    --tool-mono: ui-monospace, Consolas, "Liberation Mono", monospace;
    --tool-line: #bcc7c0;
    --tool-muted: #405763;
    color: var(--ink);
    overflow-wrap: anywhere;
}
.tools-main [hidden] { display: none !important; }
.tool-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: clamp(0.625rem, 1.5vw, 1.25rem);
    padding: clamp(1rem, 2.25vw, 1.75rem);
    border-top: 3px solid var(--navy);
    background: #fbfaf6;
}
.tool-heading > .fa-fw {
    display: grid;
    place-items: center;
    width: 2.875rem;
    aspect-ratio: 1;
    margin-top: 0.15rem;
    background: #e5ece7;
    font-size: 1.25rem;
}
.tool-heading h1 {
    color: var(--navy);
    font-size: clamp(1.65rem, 3.3vw, 2.65rem);
    font-weight: 500;
    line-height: 1.35;
    line-break: strict;
}
.tool-heading h1 .title-phrase { display: inline-block; max-width: 100%; }
.tool-heading p, .tool-notes p, .tool-entry p { line-height: 1.8; line-break: strict; }
.tool-heading p { grid-column: 2; max-width: 52em; margin: 0; color: var(--tool-muted); }
.tool-heading { row-gap: 0.45rem; }
.tools-main :is(p, td) a, .directory-section h3 a, .tool-back a {
    color: var(--navy);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}
.tools-main :is(p, td, h3) a:hover, .tool-back a:hover { color: var(--red); }
.tools-main :not(pre) > code { font: 0.95em var(--tool-mono); }
.tool-workspace, .tool-directory {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1rem, 2.2vw, 1.6rem);
    margin-top: clamp(1.1rem, 2.5vw, 2rem);
}
.tool-panel {
    min-width: 0;
    padding: clamp(1rem, 2.15vw, 1.55rem);
    border: 1px solid var(--tool-line);
    border-top: 2px solid var(--navy);
    background: #fffcf7;
}
.tool-output { background: #edf1ed; }
.panel-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1rem;
    color: var(--navy);
    font-size: clamp(1.125rem, 1.9vw, 1.4rem);
    font-weight: 600;
    line-height: 1.45;
}
.panel-title .fas { font-size: 0.83em; }
.tool-input fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.tool-input .tool-field + .tool-field { margin-top: 1.15rem; }
.field-label {
    display: block;
    margin-bottom: 0.4rem;
    padding: 0;
    color: var(--navy);
    font-weight: 600;
}
.tool-input :is(textarea, select, input[type="text"], input[type="password"], input[type="number"]) {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid #849692;
    border-radius: 2px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}
.tool-input :is(textarea, input[type="text"], input[type="password"]) { display: block; width: 100%; }
.tool-input textarea[name] { min-height: 8rem; resize: vertical; font: 1rem/1.6 var(--tool-mono); }
.tool-input select { min-width: min(13rem, 100%); }
.tool-input input[type="number"] { width: 6rem; }
.tool-input input:disabled { background: #eeefea; }
.tool-input :is(input[type="radio"], input[type="checkbox"]) {
    flex: none;
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--navy);
}
.tool-options { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; }
.tool-choice {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.625rem;
    cursor: pointer;
}
.tool-hint { margin: 0.3rem 0 0; color: var(--tool-muted); font-size: 0.875rem; line-height: 1.65; }
.tool-primary, .tool-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid;
    border-radius: 2px;
    font: 500 1rem/1.5 var(--sans);
    text-decoration: none;
    cursor: pointer;
}
.tool-primary { min-width: 8rem; margin-top: 1rem; background: var(--navy); color: #fff; border-color: var(--navy); }
.tool-primary:hover { background: #21445a; }
.tool-primary:disabled { cursor: default; opacity: 0.72; }
.tool-secondary { background: #fafbf7; color: var(--navy); border-color: #85968f; }
.tool-secondary:hover { background: #e2e9e3; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.tool-actions .fas { font-size: 0.875em; }
.tools-main :is(input, select, button, a, textarea, pre, [tabindex]):focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}
.result-empty {
    display: grid;
    align-content: center;
    min-height: clamp(8.25rem, 12vw, 11rem);
    padding: 1rem;
    border: 1px dashed #a4b2aa;
    background: #f6f8f2;
    color: var(--tool-muted);
    text-align: center;
    font-size: 0.9375rem;
}
.tool-feedback { color: var(--tool-muted); font-size: 0.9375rem; }
.tool-feedback:not(:empty) { margin-top: 0.65rem; }
.tool-error { padding: 0.75rem; border-inline-start: 3px solid #9d514d; background: #fbefeb; color: #77322d; }
.tool-error pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.tool-output .tool-code, .tool-output pre.tool-code[class*="language-"] {
    max-width: 100%;
    max-height: 28rem;
    margin: 0;
    padding: 0.75rem;
    overflow: auto;
    border: 1px solid var(--tool-line);
    border-radius: 0;
    background: #fafbf7;
    color: var(--navy);
    font: 0.9375rem/1.65 var(--tool-mono);
    text-shadow: none;
}
.tool-output pre.tool-code.line-numbers { padding-inline-start: 3.5em; }
.tool-output .tool-code code { color: inherit; font: inherit; text-shadow: none; }
.tool-code .line-numbers-rows { left: -3.5em; width: 2.7em; border-color: var(--tool-line); }
.tool-code .line-numbers-rows > span::before { color: #586a70; }
.tool-output .tool-code .token { color: inherit; }
.tool-code :is(.token.comment, .token.prolog) { color: #52665b; }
.tool-code :is(.token.tag, .token.keyword, .token.builtin, .token.function, .token.entity) { color: #185579; }
.tool-code :is(.token.string, .token.char, .token.attr-value) { color: #833a45; }
.tool-code :is(.token.boolean, .token.number, .token.constant) { color: #634779; }
.tool-notes { max-width: 58rem; margin-top: 1.5rem; }
.tool-notes p + p { margin-top: 0.6rem; }
.tool-back { margin-top: 1.5rem; padding-top: 0.4rem; border-top: 1px solid var(--rule); }
.directory-section { min-width: 0; border-top: 2px solid var(--navy); }
.directory-section > h2 { margin: 0; padding-block: 0.7rem; }
.tool-entry {
    padding: 0.8rem 1rem 1rem;
    border-block-start: 1px solid var(--tool-line);
    background: #fbfaf6;
}
.tool-entry:last-child { border-bottom: 1px solid var(--tool-line); }
.tool-entry h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.5; }
.tool-entry h3 a { display: flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; }
.tool-entry h3 a::after {
    content: "";
    flex: none;
    width: 0.45rem;
    height: 0.45rem;
    margin-inline-start: auto;
    border: solid var(--navy);
    border-width: 1.5px 1.5px 0 0;
    transform: rotate(45deg);
}
.tool-entry p { margin-top: 0.25rem; color: var(--tool-muted); font-size: 0.9375rem; }
.custom-choice { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.password-options .tool-field + .tool-field { padding-top: 0.85rem; border-top: 1px solid var(--rule); }
.password-options .field-label { margin: 0 0 0.35rem; }
.password-switches { display: grid; justify-items: start; }
.passwords { display: flex; flex-wrap: wrap; align-content: start; gap: 0.4rem; max-height: 27rem; overflow: auto; padding: 0.2rem; }
.passwords button { max-width: 100%; padding: 0.35rem 0.6rem; overflow-wrap: anywhere; font: 1rem/1.5 var(--tool-mono); }
.passwords + .tool-actions, .tool-output .tool-hint + .passwords { margin-top: 0.7rem; }
.lookup-panel { margin-top: clamp(1.1rem, 2.5vw, 2rem); }
.connection-data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; margin: 0; }
.connection-data > div { min-width: 0; padding-block: 0.7rem; border-top: 1px solid var(--tool-line); }
.connection-data dt { color: var(--tool-muted); font-size: 0.9375rem; font-weight: 500; }
.connection-data dd { margin: 0.2rem 0 0; color: var(--navy); font-size: 1.25rem; }
.registry-sources { margin-top: 1.5rem; }
.registry-sources table { width: 100%; margin-top: 0.75rem; border-collapse: collapse; background: #fbfaf6; }
.registry-sources :is(th, td) { padding: 0.5rem clamp(0.4rem, 1.5vw, 0.875rem); border: 1px solid var(--tool-line); vertical-align: top; text-align: start; }
.registry-sources th { color: var(--navy); background: #e5ece7; }
@media (max-width: 52rem) {
    .tool-workspace, .tool-directory { grid-template-columns: minmax(0, 1fr); }
    .result-empty { min-height: 5.25rem; }
    .tool-output .tool-code:has(> :is(.language-html, .language-dummy)),
    .tool-output .tool-code > :is(.language-html, .language-dummy) {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }
}
@media (max-width: 37rem) {
    .tool-heading { column-gap: 0.6rem; }
    .tool-heading > .fa-fw { width: 2rem; font-size: 1rem; }
    .tool-heading p { grid-column: 1 / -1; }
    .tool-heading { row-gap: 0.4rem; }
    .tool-heading p { margin: 0; }
    .tool-workspace .tool-primary { width: 100%; }
    .tool-panel { padding: 0.875rem; }
    .connection-data { grid-template-columns: minmax(0, 1fr); }
    .registry-sources table { font-size: 0.875rem; }
}
