.ih-feedback-trigger[hidden],
.ih-feedback-dialog:not([open]),
.ih-feedback-dialog [hidden] {
    display: none;
}

.ih-feedback-trigger--footer {
    padding: 0;
    color: #11644d;
    font: inherit;
    text-align: left;
}

.ih-feedback-trigger--footer:hover {
    color: #07533e;
    text-decoration: underline;
}

.ih-feedback-trigger--floating {
    position: fixed;
    z-index: 700;
    top: 50%;
    left: 0;
    display: none;
    width: 36px;
    max-height: calc(100vh - 32px);
    padding: 14px 8px;
    border-radius: 0 8px 8px 0;
    background: #11644d;
    color: #fff;
    font: 600 14px/20px Inter, sans-serif;
    overflow-wrap: anywhere;
    writing-mode: vertical-rl;
    transform: translateY(-50%);
    transition: none;
}

.ih-feedback-trigger--floating:hover {
    background: #07533e;
}

.ih-feedback-trigger--floating > span {
    display: block;
    transform: rotate(180deg);
}

@media (min-width: 1041px) {
    .ih-feedback-trigger--floating {
        display: inline-block;
    }

    .ih-feedback-footer-entry--responsive {
        display: none;
    }
}

@media (hover: hover) and (pointer: fine) {
    .ih-feedback-trigger--floating {
        transform: translate(-6px, -50%);
    }

    .ih-feedback-trigger--floating:hover,
    .ih-feedback-trigger--floating:focus-visible {
        transform: translateY(-50%);
    }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .ih-feedback-trigger--floating {
        transition: transform 160ms ease-out;
    }
}

@media (scripting: none) {
    .ih-feedback-trigger--floating {
        display: none;
    }
}

html.ih-feedback-open {
    overflow: hidden;
}

.ih-feedback-dialog {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: min(560px, calc(100% - 32px));
    height: fit-content;
    max-height: calc(100% - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: none;
    border-radius: 16px;
    background: #fff;
    color: #1f1f1f;
    font: 400 16px/1.5 Inter, sans-serif;
    overflow: auto;
    overscroll-behavior: contain;
}

.ih-feedback-dialog::backdrop {
    background: rgba(0, 0, 0, .45);
}

.ih-feedback-panel {
    position: relative;
    padding: 28px;
}

.ih-feedback-heading {
    margin: 0 52px 20px 0;
    font: 700 24px/1.25 Inter, sans-serif;
}

.ih-feedback-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    color: #4c4c4c;
    font: 400 28px/1 Inter, sans-serif;
}

.ih-feedback-close:hover {
    background: #f5f5f5;
}

.ih-feedback-rating {
    min-width: 0;
    margin: 0 0 14px;
    padding: 0;
    border: none;
}

.ih-feedback-rating legend,
.ih-feedback-comment {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.ih-feedback-stars {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
}

.ih-feedback-choice {
    position: relative;
    min-width: 0;
}

.ih-feedback-choice input[type="radio"] {
    position: absolute;
    display: block;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
}

.ih-feedback-choice label {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 6px;
    color: #4c4c4c;
    font-size: 12px;
    line-height: 14px;
    cursor: pointer;
}

.ih-feedback-star {
    display: block;
    width: 26px;
    height: 26px;
    fill: none;
    stroke: #45534f;
    stroke-width: 1.65;
    stroke-linejoin: round;
}

.ih-feedback-choice.is-filled .ih-feedback-star {
    fill: #11644d;
    stroke: #11644d;
}

.ih-feedback-choice :checked + label {
    color: #11644d;
    font-weight: 700;
}

.ih-feedback-trigger:focus-visible,
.ih-feedback-dialog button:focus-visible,
.ih-feedback-dialog textarea:focus-visible,
.ih-feedback-choice input:focus-visible + label {
    outline: 2px solid #11644d;
    outline-offset: 2px;
}

.ih-feedback-dialog textarea {
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 96px;
    padding: 10px 12px;
    border: 1px solid #bfc8c4;
    border-radius: 8px;
    font: inherit;
    resize: vertical;
}

.ih-feedback-error {
    margin: 12px 0 0;
    color: #b42323;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.ih-feedback-error:empty {
    margin: 0;
}

.ih-feedback-submit {
    min-height: 44px;
    margin-top: 16px;
}

.ih-feedback-submit:disabled {
    opacity: .7;
    cursor: wait;
}

.ih-feedback-success {
    margin: 0;
}

@media (max-width: 1040px) {
    .ih-feedback-dialog {
        width: 100%;
        max-width: none;
        margin: auto 0 0;
        border-radius: 16px 16px 0 0;
    }

    .ih-feedback-panel {
        max-width: 560px;
        margin: 0 auto;
        padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    }

    .ih-feedback-heading {
        font-size: 20px;
    }

    .ih-feedback-stars {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .ih-feedback-submit {
        width: 100%;
    }
}

@media (max-width: 1040px) and (prefers-reduced-motion: no-preference) {
    .ih-feedback-dialog[open] {
        animation: ih-feedback-slide-in 180ms ease-out;
    }
}

.ih-feedback-dialog.ih-feedback--fullscreen[open] {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: calc(64px + env(safe-area-inset-top, 0px))
        max(16px, env(safe-area-inset-right, 0px))
        calc(24px + env(safe-area-inset-bottom, 0px))
        max(16px, env(safe-area-inset-left, 0px));
    border-radius: 0;
    animation: none;
}

.ih-feedback--fullscreen .ih-feedback-panel {
    flex: none;
    width: min(504px, 100%);
    margin: auto;
    padding: 0;
}

.ih-feedback--fullscreen .ih-feedback-close {
    position: fixed;
    z-index: 1;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
}

.ih-feedback--fullscreen .ih-feedback-close:not(:hover) {
    background: #fff;
}

@keyframes ih-feedback-slide-in {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
