.vti-product-fit {
    margin: .8rem 0;
    color: #202a23;
}
.vti-product-fit [hidden] { display: none !important; }
.vti-product-fit .vti-fit-trigger {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem .45rem;
    max-width: 100%;
    min-height: 36px;
    margin: 0;
    padding: .42rem .85rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #f5d649;
    color: #24261d;
    font: inherit;
    font-size: .925em;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}
.vti-product-fit .vti-fit-trigger:hover { filter: brightness(.95); }
.vti-product-fit .vti-fit-trigger:not([data-state]) {
    padding: .3rem .25rem .3rem 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #285f22;
    font-weight: 600;
}
.vti-product-fit .vti-fit-trigger:not([data-state]) [data-trigger-label] {
    text-decoration: underline;
    text-underline-offset: .17em;
}
.vti-fit-trigger[data-state="pass"] [data-current-tractor]::before {
    content: "·";
    margin-right: .45em;
}
.vti-product-fit .vti-fit-trigger:focus-visible {
    outline: 2px solid #347722;
    outline-offset: 2px;
}
.vti-product-fit .vti-fit-trigger[data-state="pass"] { background: #e9f3e4; color: #26591c; }
.vti-product-fit .vti-fit-trigger[data-state="verify"] { background: #fff2c8; color: #654504; }
.vti-product-fit .vti-fit-trigger[data-state="fail"] { background: #f8e9e4; color: #822519; }
.vti-fit-trigger [data-current-tractor] { font-weight: 500; }
.vti-fit-trigger-arrow { font-size: 1.2em; line-height: 1; }
.vti-fit-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem .85rem;
}
.vti-fit-link {
    color: #25563e;
    text-decoration: underline;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: .45rem .2rem;
}
.vti-fit-details { margin-top: .65rem; }
.vti-fit-editor label { display: block; font-weight: 600; }
.vti-fit-editor input, .vti-fit-editor select {
    display: block;
    width: 100%;
    min-height: 42px;
    margin: .2rem 0 0;
}
.vti-fit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    margin: .55rem 0 1rem;
}
.vti-fit-details summary { cursor: pointer; }
.vti-fit-details ul, .vti-fit-details p { margin: .6rem 0 0; }
.vti-fit-details li[data-state="fail"] { color: #822519; font-weight: 600; }
.vti-fit-matches {
    list-style: none;
    max-height: 220px;
    overflow: auto;
    padding: 0;
    margin: .25rem 0;
    border: 1px solid #d7ded8;
}
.vti-fit-matches button {
    border: 0;
    background: #fff;
    color: #202a23;
    width: 100%;
    text-align: left;
    cursor: pointer;
    padding: .5rem .75rem;
}
.vti-fit-matches button:hover, .vti-fit-matches button:focus-visible { background: #eef6f0; }
.vti-product-fit .vti-tractor-spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
    gap: .5rem;
}
.vti-product-fit .vti-tractor-spec { padding: .45rem; background: #f4f7f4; }
.vti-product-fit .vti-tractor-spec dd { margin: 0; }



/* Keep fields and focus visible when the product template resets form controls. */
.vti-product-fit .vti-fit-editor input,
.vti-product-fit .vti-fit-editor select {
    box-sizing: border-box;
    border: 1px solid #838d85;
    border-radius: 4px;
    background-color: #fff;
    color: #202a23;
    caret-color: #202a23;
    padding: .45rem .6rem;
}
.vti-product-fit .vti-fit-editor input:focus,
.vti-product-fit .vti-fit-editor select:focus {
    border-color: #25563e;
    outline: 2px solid #25563e;
    outline-offset: 2px;
}
.vti-product-fit .vti-fit-editor [data-tractor-form] { margin-top: .8rem; }
.vti-product-fit .vti-fit-editor [data-tractor-form] .vti-fit-actions { margin-top: .8rem; }

.vti-product-fit .vti-fit-editor input:focus {
    caret-color: #202a23 !important;
}

.vti-product-fit .vti-fit-editor {
    box-sizing: border-box;
    width: min(800px, calc(100% - 2rem));
    max-width: none;
    height: min(44rem, calc(100vh - 2rem));
    height: min(44rem, calc(100dvh - 2rem));
    max-height: none;
    scrollbar-gutter: stable;
    margin: auto;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid #d7ded8;
    border-radius: 12px;
    background: #fff;
    color: #202a23;
    overflow: auto;
    overscroll-behavior: contain;
}
.vti-fit-editor::backdrop { background: rgba(19, 30, 24, .58); }
.vti-fit-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid #d7ded8;
    font-size: 1.15em;
}
.vti-fit-dialog-header .vti-fit-link { min-height: 44px; }
html:has(.vti-fit-editor:modal) { overflow: hidden; }
@media (max-width: 600px) {
    .vti-product-fit .vti-fit-editor {
        position: fixed;
        inset: max(.5rem, env(safe-area-inset-top)) 0 auto;
        margin: 0 auto;
        width: calc(100% - 1rem);
        height: calc(100vh - max(.5rem, env(safe-area-inset-top)) - max(.5rem, env(safe-area-inset-bottom)));
        height: calc(100dvh - max(.5rem, env(safe-area-inset-top)) - max(.5rem, env(safe-area-inset-bottom)));
        max-height: none;
        padding: 1rem;
    }
    .vti-product-fit .vti-fit-editor input,
    .vti-product-fit .vti-fit-editor select { font-size: max(1em, 16px); }
}

.vti-fit-grid > label {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
}
.vti-product-fit .vti-fit-grid input,
.vti-product-fit .vti-fit-grid select {
    height: 44px;
    min-width: 0;
}
.vti-fit-saved:has(details:not([hidden])) { margin-bottom: 1rem; }
@media (max-width: 480px) {
    .vti-fit-grid { grid-template-columns: minmax(0, 1fr); }
}

.vti-product-fit .vti-fit-details {
    border: 1px solid #cbd8cd;
    border-radius: 7px;
    background: #fff;
}
.vti-product-fit .vti-fit-details > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    min-height: 44px;
    padding: .45rem .75rem;
    border-radius: 6px;
    background: #f6f7f6;
    color: #202a23;
    font-weight: 700;
    list-style: none;
}
.vti-fit-details > summary::-webkit-details-marker { display: none; }
.vti-fit-details > summary::after {
    content: "";
    flex: none;
    width: .5em;
    height: .5em;
    margin-right: .15em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}
.vti-fit-details[open] > summary::after { transform: rotate(225deg); }
.vti-product-fit .vti-fit-details > summary:hover { background: #e5efe5; color: #24542e; }
.vti-product-fit .vti-fit-details > summary:focus-visible { outline: 2px solid #347722; outline-offset: 2px; }
.vti-product-fit .vti-fit-details[open] > summary { border-bottom: 1px solid #cbd8cd; }
.vti-fit-details > [data-other-fields] { padding: .25rem .75rem 0; }
.vti-fit-details > [data-weight-reference] { margin: .25rem .75rem .75rem; }
.vti-product-fit ul[data-confirmed-specs],
.vti-product-fit ul[data-checks] {
    display: grid;
    gap: .55rem;
    margin: 0;
    padding: .75rem;
    list-style: none;
}
.vti-product-fit ul[data-confirmed-specs] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vti-product-fit [data-confirmed-specs] li {
    display: grid;
    gap: .15rem;
    padding: .55rem .65rem;
    background: #f5f8f5;
    border-radius: 5px;
}
.vti-fit-spec-label { font-size: .88em; }
.vti-fit-spec-confirmed { color: #255b33; font-size: .83em; font-weight: 600; }
.vti-product-fit [data-checks] li {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    padding: .5rem .65rem;
    border-radius: 5px;
    font-weight: 400;
}
.vti-product-fit [data-checks] li[data-state="pass"] { color: #255b33; background: #f6f8f6; }
.vti-product-fit [data-checks] li[data-state="fail"] { color: #822519; background: #fbefeb; }
.vti-product-fit [data-checks] li[data-state="verify"] { color: #654504; background: #fff6db; }
.vti-fit-check-marker { flex: 0 0 1em; font-weight: 800; text-align: center; }
.vti-fit-check-status, .vti-fit-check-message { display: block; }
.vti-fit-check-message { color: #202a23; }
.vti-fit-issues, .vti-fit-hitch-warning {
    padding: .65rem .85rem;
    border: 1px solid #dec584;
    border-left: 4px solid #a67a17;
    border-radius: 6px;
    background: #fff8e6;
    color: #624711;
}
.vti-fit-issues { margin-bottom: .85rem; }
.vti-fit-issues[data-state="fail"] {
    border-color: #e5b8ac;
    border-left-color: #9a3626;
    background: #fbefeb;
    color: #822519;
}
.vti-product-fit .vti-fit-issues ul { margin: .2rem 0 0; padding-left: 1.1em; }
.vti-fit-hitch-warning { margin: 0 .75rem .75rem; }
.vti-fit-hitch-warning p { margin: .2rem 0 0; }
.vti-fit-forget { margin-top: .75rem; }
@media (max-width: 480px) {
    .vti-product-fit ul[data-confirmed-specs] { grid-template-columns: minmax(0, 1fr); }
}

.vti-fit-issues[data-state="pass"] {
    border-color: #cadcca;
    border-left-color: #347722;
    background: #f1f7f1;
    color: #255b33;
}
.vti-fit-issues ul:empty { display: none; }
.vti-product-fit .vti-fit-check-message { font-weight: 400; }


.vti-fit-footer {
    display: grid;
    justify-items: start;
    gap: .5rem;
    margin-top: 1rem;
    padding-top: .7rem;
    border-top: 1px solid #d7ded8;
    font-size: .9em;
}
.vti-fit-footer a,
.vti-fit-footer summary { color: #285f22; text-decoration: underline; }
.vti-fit-footer summary { cursor: pointer; }
.vti-fit-footer p { margin: .5rem 0 0; }

.vti-fit-footer summary {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    list-style: none;
}
.vti-fit-footer summary::-webkit-details-marker { display: none; }
.vti-fit-footer summary::after {
    content: "";
    flex: none;
    width: .42em;
    height: .42em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-.12em) rotate(45deg);
}
.vti-fit-footer details[open] > summary::after {
    transform: translateY(.1em) rotate(225deg);
}

.vti-product-fit .vti-fit-spec-toggle {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: .45rem .75rem;
    border: 1px solid #cbd8cd;
    border-radius: 6px;
    background: #f6f7f6;
    color: #202a23;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.vti-product-fit .vti-fit-spec-toggle:hover { background: #e5efe5; }
.vti-fit-spec-toggle::after {
    content: "⌄";
    line-height: 1;
    margin-left: .65em;
}
.vti-fit-spec-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

.vti-fit-comparison-title {
    display: block;
    margin: .65rem .75rem 0;
}
.vti-fit-recommendation {
    margin: .7rem 0;
    padding: .65rem .85rem;
    border: 1px solid #cbd8cd;
    border-radius: 6px;
    background: #f6f8f6;
}
.vti-fit-recommendation a {
    display: block;
    color: #285f22;
    text-decoration: underline;
}

.vti-fit-mower-heading { display: block; margin-bottom: .45rem; }
.vti-fit-mower-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    padding: .7rem;
    border: 1px solid #dce4dc;
    border-radius: 6px;
    background: #fff;
}
.vti-product-fit .vti-fit-mower-card img {
    flex: 0 0 auto;
    width: clamp(90px, 22vw, 150px);
    aspect-ratio: 1;
    object-fit: contain;
}
.vti-fit-mower-content { flex: 1 1 220px; min-width: 0; }
.vti-product-fit .vti-fit-mower-meta { margin: .1rem 0; color: #526457; font-size: .88em; line-height: 1.3; }
.vti-product-fit .vti-fit-mower-content dl {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem 1rem;
    margin: .45rem 0 .65rem;
}
.vti-fit-mower-content dt { font-size: .82em; color: #526457; }
.vti-product-fit .vti-fit-mower-content dd { margin: 0; font-weight: 700; }
.vti-product-fit .vti-fit-mower-link {
    display: inline-block;
    padding: .34rem .65rem;
    color: #fff;
    background: #285f22;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
}
.vti-product-fit .vti-fit-mower-link:hover { background: #1c4817; color: #fff; }

.vti-fit-mower-type { display: inline-block; max-width: 100%; font-weight: 700; }
@media (max-width: 600px) {
    .vti-fit-mower-type { display: block; }
}
