.aba-advice {
    --advice-left: calc(12px + env(safe-area-inset-left, 0px));
    --advice-green: #263b2d;
    --advice-tab-height: 44px;
    position: fixed;
    z-index: 1030;
    bottom: 0;
    left: var(--advice-left);
    width: min(336px, calc(100% - var(--advice-left) - 12px - env(safe-area-inset-right, 0px)));
    color: var(--advice-green);
    font: inherit;
    pointer-events: none;
}

.aba-advice-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    width: max-content;
    max-width: 100%;
    min-height: var(--advice-tab-height);
    padding: 8px 13px;
    color: #fff;
    background: var(--advice-green);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 3px 14px #0002;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.3;
    list-style: none;
    cursor: pointer;
    pointer-events: auto;
}

.aba-advice-trigger::-webkit-details-marker { display: none; }

.aba-advice-trigger svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.aba-advice-chevron { margin-left: auto; }

.aba-advice[open] .aba-advice-trigger { width: 100%; }
.aba-advice[open] .aba-advice-chevron { transform: rotate(180deg); }

.aba-advice-trigger:hover,
.aba-advice .aba-advice-submit:hover {
    color: #fff;
    background: #385141;
}

.aba-advice :is(summary, button, a):focus-visible {
    outline: 2px solid #648553;
    outline-offset: 2px;
}

.aba-advice-panel {
    max-height: calc(100vh - var(--advice-tab-height) - 12px);
    max-height: calc(100dvh - var(--advice-tab-height) - 12px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 13px;
    border: 1px solid #dbe4d9;
    border-top: 0;
    border-radius: 0 0 7px 7px;
    background: #fff;
    box-shadow: 0 8px 22px #0002;
    font-size: .8125rem;
    line-height: 1.4;
    pointer-events: auto;
}

.aba-advice[open] .aba-advice-panel { animation: aba-advice-expand .18s ease-out; }

@keyframes aba-advice-expand {
    from { clip-path: inset(100% 0 0); opacity: .6; }
    to { clip-path: inset(0); opacity: 1; }
}

.aba-advice #aba-advice-title {
    margin: 0 0 5px;
    color: var(--advice-green);
    font-size: .975rem;
    font-weight: 750;
    line-height: 1.25;
}

.aba-advice #aba-advice-intro {
    margin: 0 0 10px;
    color: #4a564d;
}

.aba-advice .aba-advice-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.aba-advice .form-control {
    width: 100%;
    min-height: 38px;
    padding: 6px 9px;
    border-color: #cdd8cf;
    border-radius: 4px;
    font-size: .875rem;
}

.aba-advice .form-control::placeholder { color: #57645b; opacity: 1; }

.aba-advice textarea.form-control {
    min-height: 55px;
    resize: vertical;
}

.aba-advice .form-control:focus {
    border-color: #5e7e69;
    box-shadow: 0 0 0 2px #5e7e692e;
}

.aba-advice .form-control.is-invalid { border-color: var(--bs-form-invalid-border-color, #b02a37); }

.aba-advice .aba-advice-status {
    margin-bottom: 8px;
    padding: 6px 8px;
}

.aba-advice .aba-advice-privacy {
    margin: 8px 0;
    font-size: .75rem;
}

.aba-advice .aba-advice-privacy a {
    color: #34543e;
    text-decoration: underline;
}

.aba-advice-captcha { margin-top: 8px; }
.aba-advice-captcha-feedback { margin: 4px 0; color: var(--bs-form-invalid-color, #b02a37); }

.aba-advice .aba-advice-submit {
    width: 100%;
    min-height: 40px;
    border: 0;
    border-radius: 4px;
    color: #fff;
    background: var(--advice-green);
    font-size: .875rem;
    font-weight: 700;
}

.aba-advice .aba-advice-confirmation {
    margin-top: 9px;
    padding: 10px;
    background: #edf3ec;
}

.aba-advice .aba-advice-confirmation h3 {
    margin: 0 0 6px;
    font-size: .9375rem;
}

.aba-advice .aba-advice-confirmation p { margin: 0 0 8px; }
.aba-advice .aba-advice-confirmation p:last-child { margin-bottom: 0; }
.aba-advice [hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .aba-advice[open] .aba-advice-panel { animation: none; }
}
