.tool-page {
    display: flex;
    flex-direction: column;
    background: var(--pay-ground);
}

.tool-layout {
    --tool-accent: #007267;
    --tool-line: #d5e4de;
    --tool-muted: #3d5c61;
    --tool-support: #536b6a;
    --tool-selected: #e4f2eb;
    --tool-result: #f5faf7;
    --tool-error: #9a3527;
    --tool-section-gap: 24px;
    width: 100%;
    max-width: var(--pay-shell-width);
    margin-inline: auto;
    padding: 28px var(--pay-shell-inset) 64px;
    flex: 1 0 auto;
    color: var(--pay-ink);
    font-size: 16px;
    line-height: 1.6;
}

.tool-layout > main, .tool-reference {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--tool-section-gap);
}

:where(.tool-layout) a { color: var(--tool-accent); text-underline-offset: .22em; }
.tool-layout :focus-visible { outline: 1px solid var(--tool-accent); outline-offset: 2px; }
.tool-layout :is(input, select, button, .tool-primary):focus-visible,
.tool-layout .tool-nav a:focus-visible {
    outline: 0;
    border-color: var(--pay-ink);
    background-color: #edf5f1;
}
.tool-layout input[aria-invalid="true"]:focus-visible {
    border-color: var(--tool-error);
    background-color: #fff4f1;
}

.tool-skip {
    position: absolute;
    z-index: 1001;
    inset: 8px auto auto 8px;
    transform: translateY(-150%);
    background: var(--pay-surface);
    padding: 8px 12px;
}
.tool-skip:focus { transform: none; }

.tool-heading, .tool-workbench {
    padding: var(--pay-panel-padding);
    border: 1px solid var(--pay-line);
    border-radius: 16px;
}
.tool-heading {
    position: relative;
    isolation: isolate;
    overflow: clip;
    background: #ecf4ef;
    color: var(--pay-ink);
}
.tool-heading::before {
    --grid-line: rgb(0 106 91 / 12%);
    position: absolute;
    z-index: -1;
    inset-block: -34%;
    inset-inline-end: -5%;
    width: 62%;
    background-image: linear-gradient(90deg, var(--grid-line) 1px, transparent 1px), /* taste-skill-ignore: grid lines */
        linear-gradient(var(--grid-line) 1px, transparent 1px); /* taste-skill-ignore: grid lines */
    background-size: 38px 32px;
    mask-image: radial-gradient(ellipse at 77% 43%, #000 12%, transparent 68%); /* taste-skill-ignore: fade the grid */
    transform: skewX(-27deg);
    pointer-events: none;
    content: "";
}
.tool-heading .tool-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    margin-bottom: 8px;
    padding-inline: 10px;
    border: 1px solid var(--tool-line);
    border-radius: 8px;
    background: var(--pay-surface);
    color: var(--pay-jade);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.tool-heading .tool-back:hover,
.tool-heading .tool-back:focus-visible {
    border-color: var(--pay-jade);
    background: var(--tool-selected);
}
.tool-heading .tool-back:focus-visible { outline: 0; }
.tool-heading h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.3;
    font-weight: 750;
}
.tool-intro { margin-top: 8px; color: var(--tool-muted); font-size: 15px; line-height: 1.7; }

.tool-nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}
.tool-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 86px;
    padding: 9px 8px;
    border: 1px solid var(--tool-line);
    border-radius: 10px;
    background: var(--pay-surface);
    color: var(--pay-ink);
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
}
.tool-nav a:hover { border-color: #90b8a9; background: #f6faf7; }
.tool-nav a[aria-current] {
    border-color: #338b79;
    background: var(--tool-selected);
    color: #005b50;
}
.tool-icon {
    display: block;
    flex-shrink: 0;
    color: #27665c;
}
.tool-nav .tool-icon {
    width: 26px;
    height: 26px;
    color: #58736d;
}
.tool-form-heading .tool-icon { color: #005b50; }

.tool-workbench { background: var(--pay-surface); }
.tool-form, .tool-output { min-width: 0; }
.tool-form-heading { margin-bottom: 16px; }
.tool-form-heading h2, .tool-output h2 { color: var(--pay-ink); font-size: 20px; line-height: 1.5; font-weight: 700; }
.tool-form-heading h2 { display: flex; align-items: center; gap: 8px; }
.tool-form-heading h2 .tool-icon { width: 22px; height: 22px; }
.tool-output {
    margin-top: 18px;
    padding: 19px;
    border: 1px solid var(--tool-line);
    border-radius: 10px;
    background: var(--tool-result);
}
.tool-output:has(> section[hidden]) { display: none; }
.tool-output h2 { margin-bottom: 10px; }
.tool-output .resource-result-title {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tool-line);
    line-height: 1.6;
}
.tool-workbench noscript p { margin-top: 10px; }

.tool-workbench-estimate {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.tool-workbench-estimate .tool-output { margin: 0; }
.tool-workbench-estimate noscript { grid-column: 1 / -1; }

:where(.tool-layout) label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.tool-form label { color: #264f53; font-weight: 700; }
:where(.tool-layout) :is(input, select), .tool-primary {
    min-height: 46px;
    border-radius: 7px;
    padding: 8px 12px;
    font: inherit;
}
:where(.tool-layout) :is(input, select) {
    width: 100%;
    min-width: 0;
    border: 1px solid #738d82;
    background: var(--pay-surface);
    color: var(--pay-ink);
}
:where(.tool-layout) :is(input, select):focus {
    border-color: var(--tool-accent);
    background: #f8fcfa;
}
:where(.tool-layout) input[aria-invalid="true"] { border-color: var(--tool-error); }
.tool-layout input.tool-identifier {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 14px;
}
.tool-layout input.tool-identifier::placeholder { font-family: system-ui, sans-serif; }
.tool-input-row { display: flex; gap: 9px; }
.tool-form :is(input, select, button.tool-primary) { min-height: 50px; }
.tool-form button.tool-primary { min-width: 104px; }
.tool-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    border: 1px solid var(--tool-accent);
    background: var(--tool-accent);
    color: #fff;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.tool-primary:hover { background: #005e55; border-color: #005e55; }
.tool-primary:active { background: #004f48; }
.tool-layout .tool-primary:focus-visible { background: #004f48; border-color: #003c37; }
.tool-primary:disabled { opacity: .7; cursor: wait; }
@media (forced-colors: active) {
    .tool-layout :is(input, select, button, .tool-primary, input[aria-invalid="true"]):focus-visible,
    .tool-heading .tool-back:focus-visible,
    .tool-layout .tool-nav a:focus-visible { border-color: Highlight; }
}
.tool-status { margin: 8px 0 0; font-size: 14px; }
.tool-status:empty { margin: 0; }
.tool-status[data-error="true"] { color: var(--tool-error); }

.tool-data { margin: 0; }
.tool-data > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--tool-line);
}
.tool-estimate .tool-data > div { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.tool-data dt { color: var(--tool-support); font-size: 14px; }
.tool-data dd {
    margin: 0;
    text-align: end;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.tool-data .tool-address { font-family: ui-monospace, Consolas, monospace; font-size: 14px; } /* Address identifier. */
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; margin-top: 10px; }
.tool-actions a { display: inline-flex; min-height: 44px; align-items: center; }
.tool-share-field { margin-top: 10px; }
.tool-group + .tool-group { margin-top: 16px; }
.tool-group h3 { margin: 0 0 5px; font-size: 16px; }
.tool-group meter { width: 100%; max-width: 168px; display: block; margin: 4px 0 0 auto; accent-color: var(--tool-accent); }
.tool-layout [data-tone="positive"] { color: #006357; }
.tool-layout [data-tone="warning"] { color: var(--tool-error); }
.tool-quote { display: block; color: var(--tool-muted); font-size: 13px; font-weight: 400; }
.tool-convert-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.tool-convert-fields > div { min-width: 0; }
.tool-convert-fields .estimate-secondary { white-space: nowrap; }
.tool-qr-result { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.tool-qr-result img { display: block; max-width: 100%; height: auto; }
.tool-qr-result p { overflow-wrap: anywhere; }
.tool-source { margin-top: 9px; color: var(--tool-support); font-size: 14px; }
.tool-hint { display: block; margin: 6px 0 13px; color: var(--tool-support); font-size: 14px; }
a.tool-hint { display: inline-flex; min-height: 44px; align-items: center; margin: 0; }

@media (max-width: 940px) {
    .tool-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .tool-layout { --tool-section-gap: 20px; max-width: var(--pay-tablet-width); padding-top: 20px; }
}
@media (max-width: 620px) {
    .tool-heading::before {
        width: 50%;
        background-size: 24px 22px;
        opacity: .7;
    }
    .tool-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .tool-nav a {
        flex-direction: row;
        justify-content: flex-start;
        min-height: 56px;
        gap: 8px;
        padding: 8px 12px;
        font-size: 16px;
        text-align: start;
    }
    .tool-nav .tool-icon { width: 24px; height: 24px; }
    .tool-workbench-estimate { grid-template-columns: minmax(0, 1fr); gap: 13px; }
    .tool-form .tool-input-row { flex-direction: column; }
    .tool-layout .tool-form input.tool-identifier { font-size: 16px; }
    .tool-form .estimate-presets { gap: 4px; }
    .tool-form .estimate-presets button { padding-inline: 7px; }
    .tool-data .tool-address { font-size: 13px; }
}
@media (max-width: 600px) {
    .tool-layout { padding-block: 16px 40px; }
    .tool-output { padding: 15px; }
    .tool-form-heading h2, .tool-output h2 { font-size: 18px; }
}

/* The calculator compares fees in the tool before sending a quantity to checkout. */
.estimate-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.estimate-presets button, .estimate-secondary {
    min-height: 44px;
    padding: 6px 13px;
    border: 1px solid #a6b9af;
    border-radius: 7px;
    background: var(--pay-surface);
    color: var(--pay-ink);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.estimate-presets button { min-width: 44px; }
.estimate-secondary:disabled { opacity: .6; cursor: default; }
.estimate-presets button:hover, .estimate-secondary:hover {
    background: #f2f8f4;
}
.estimate-presets button[aria-pressed="true"] {
    border-color: var(--tool-accent);
    background: var(--tool-selected);
    color: #005b50;
    font-weight: 700;
}
.estimate-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
    margin-top: 18px;
}
.estimate-settings > div { min-width: 0; }
.estimate-costs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 12px;
}
.estimate-costs > div {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--tool-line);
    border-radius: 7px;
    background: var(--pay-surface);
}
.estimate-costs dt { color: var(--tool-muted); font-size: 14px; }
.estimate-costs dd {
    margin: 2px 0 0;
    color: var(--pay-ink);
    font-size: clamp(19px, 2.3vw, 28px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.estimate-costs #estimatePrice { color: var(--tool-accent); }
.estimate-difference {
    margin-bottom: 10px;
    color: #005b50;
    font-size: 15px;
    font-weight: 700;
}
.estimate-breakdown > div { padding-block: 6px; }
.estimate-rate, .estimate-fee-note { margin: 9px 0 0; }
.estimate-rate + .estimate-secondary { margin-top: 6px; }

.tool-reference > * { min-width: 0; }
.tool-reference h2 { scroll-margin-block-start: 10px; }
.tool-reference-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}
.tool-reference dt, .tool-reference dd, .tool-reference h3 { overflow-wrap: anywhere; }
.tool-reference-guide > p {
    color: var(--pay-muted);
    font-size: 14px;
    line-height: 1.9;
    margin-bottom: 14px;
}
.tool-reference-guide .tool-reference-example { margin: 14px 0 0; }
.tool-reference-packages dd { margin: 0; }
.tool-reference-packages dd strong {
    color: var(--pay-jade);
    font-size: 24px;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}
.tool-reference-packages dd span { display: block; }
.tool-reference-faq .tool-faq-item { padding: 14px 16px; }
.tool-faq-item h3 {
    margin-bottom: 6px;
    color: #35574f;
    font-size: 15px;
    font-weight: 700;
}
.tool-faq-item p {
    color: var(--pay-muted);
    font-size: 14px;
    line-height: 1.9;
}
@media (min-width: 761px) {
    .tool-reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .tool-reference-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .estimate-settings, .tool-convert-fields { grid-template-columns: minmax(0, 1fr); }
    .estimate-settings { gap: 8px; }
}
