.feedback-page {
    background: #080808;
}

.feedback-main {
    box-sizing: border-box;
    width: min(100% - 2rem, 760px);
    min-height: 55vh;
    margin: 2rem auto 4rem;
}

.feedback-panel {
    padding: clamp(1.25rem, 4vw, 2.5rem);
    color: #f7f7f7;
    background: #131313;
    border: 1px solid #333;
    border-radius: 10px;
}

.feedback-modal[hidden] {
    display: none;
}

.feedback-modal {
    position: fixed;
    z-index: var(--site-modal-z, 100000030);
    inset: 0;
    display: flex;
    justify-content: flex-end;
    box-sizing: border-box;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

.feedback-modal__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(0, 0, 0, .7);
    border: 0;
    cursor: default;
}

.feedback-modal__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: min(100%, 450px);
    height: 100vh;
    height: 100dvh;
    color: #f7f7f7;
    background: #131313;
    border-left: 1px solid #444;
    box-shadow: -1rem 0 3rem rgba(0, 0, 0, .55);
}

.feedback-modal__header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: .75rem 1rem;
    padding-top: max(.75rem, env(safe-area-inset-top));
    background: #131313;
    border-bottom: 1px solid #3d3d3d;
}

.feedback-modal__header h2 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.feedback-modal__close {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 0;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.feedback-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.feedback-modal .feedback-form {
    margin-top: 0;
}

.feedback-modal-success {
    display: grid;
    gap: 1rem;
}

.feedback-modal-success[hidden] {
    display: none;
}

.feedback-form {
    display: grid;
    gap: 1.4rem;
    margin-top: 1.5rem;
}

.feedback-form[hidden],
.feedback-form-shell.is-feedback-success .feedback-form,
.feedback-form-shell.is-feedback-success .feedback-message--error,
.feedback-form-shell.is-feedback-success .feedback-message--warning {
    display: none !important;
}

.feedback-field {
    display: grid;
    min-width: 0;
    gap: .55rem;
    padding: 0;
    border: 0;
}

.feedback-field label,
.feedback-field legend {
    font-weight: 700;
}

.feedback-field textarea,
.feedback-image-input {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    color: #fff;
    background: #050505;
    border: 1px solid #666;
    border-radius: 6px;
    font-size: 16px;
}

.feedback-field textarea {
    min-height: 12rem;
    padding: .85rem;
    resize: vertical;
}

.feedback-character-count {
    margin: 0;
    color: #bbb;
    font-size: .9rem;
    line-height: 1.4;
    text-align: right;
}

.feedback-image-input {
    min-height: 48px;
    padding: .65rem;
}

.feedback-field textarea::placeholder {
    color: #999;
    opacity: 1;
}

.feedback-field textarea:focus,
.feedback-image-input:focus {
    border-color: #ff65b7;
    outline: 2px solid rgba(255, 101, 183, .25);
    outline-offset: 1px;
}

.feedback-help {
    margin: 0;
    color: #bbb;
    font-size: .9rem;
    line-height: 1.6;
}

.feedback-primary-button,
.feedback-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 48px;
    padding: .8rem 1.2rem;
    color: #fff;
    border-radius: 6px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
}

.feedback-primary-button {
    width: 100%;
    background: #d72d87;
    border: 1px solid #ef57a6;
}

.feedback-secondary-button {
    width: fit-content;
    max-width: 100%;
    background: #2d2d2d;
    border: 1px solid #666;
}

.feedback-primary-button:hover,
.feedback-secondary-button:hover {
    filter: brightness(1.12);
}

.feedback-primary-button:focus-visible,
.feedback-secondary-button:focus-visible,
.feedback-link-button:focus-visible,
.feedback-thumbnail-button:focus-visible,
.feedback-selected-image__remove:focus-visible,
.feedback-upload-control:focus-visible,
.feedback-image-modal__close:focus-visible {
    outline: 2px solid #ff8fc9;
    outline-offset: 2px;
}

.feedback-modal__close:focus-visible {
    outline: 2px solid #ff8fc9;
    outline-offset: -3px;
}

.feedback-primary-button:disabled,
.feedback-secondary-button:disabled,
.feedback-upload-control:disabled {
    color: #b8b8b8;
    background: #383838;
    border-color: #606060;
    cursor: not-allowed;
    filter: none;
    opacity: 1;
}

.feedback-primary-button:disabled:hover,
.feedback-secondary-button:disabled:hover,
.feedback-upload-control:disabled:hover {
    filter: none;
}

.feedback-link-button {
    width: fit-content;
    padding: .35rem 0;
    color: #ff9dce;
    background: transparent;
    border: 0;
    text-decoration: underline;
    cursor: pointer;
}

.feedback-home-button {
    width: 100%;
    margin-top: 1rem;
    text-decoration: none;
}

.feedback-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.feedback-thumbnail-button {
    display: block;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    background: #050505;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: zoom-in;
}

.feedback-thumbnail-button img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
}

.feedback-images-field {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.feedback-images-description {
    margin: 0;
    color: #ccc;
    font-size: .8rem;
    line-height: 1.6;
}

.feedback-image-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.feedback-upload-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    gap: .65rem;
    padding: .75rem 1rem;
    color: #f2f2f2;
    background: transparent;
    border: 1px solid #777;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
}

.feedback-upload-control[hidden] {
    display: none;
}

.feedback-modal .js-feedback-upload-control {
    display: none;
}

.feedback-selected-images {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
    min-width: 0;
}

.feedback-selected-images[hidden] {
    display: none;
}

.feedback-selected-image {
    display: grid;
    min-width: 0;
    gap: .35rem;
}

.feedback-selected-image__preview {
    position: relative;
    min-width: 0;
}

.feedback-selected-image .feedback-thumbnail-button {
    width: 100%;
    aspect-ratio: 4 / 3;
}

.feedback-selected-image img {
    height: 100%;
}

.feedback-selected-image__remove {
    position: absolute;
    z-index: 1;
    top: .35rem;
    right: .35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #fff;
    background: rgba(0, 0, 0, .78);
    border: 1px solid #777;
    border-radius: 50%;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.feedback-image-modal {
    position: fixed;
    z-index: calc(var(--site-modal-z, 100000030) + 1);
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: clamp(1rem, 4vw, 2rem);
    background: rgba(0, 0, 0, .86);
}

.feedback-image-modal[hidden] {
    display: none;
}

.feedback-image-modal__panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 1100px);
    height: min(100%, 820px);
}

.feedback-image-modal__image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.feedback-image-modal__close {
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #fff;
    background: rgba(0, 0, 0, .75);
    border: 1px solid #777;
    border-radius: 50%;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.feedback-modal-open {
    overflow: hidden;
}

.feedback-message {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 6px;
    line-height: 1.7;
}

.feedback-message ul {
    margin: 0;
    padding-left: 1.25rem;
}

.feedback-message--error {
    color: #ffd7d7;
    background: #3b1515;
    border: 1px solid #8b3636;
}

.feedback-message--warning {
    color: #fff0c7;
    background: #3d3013;
    border: 1px solid #7e6226;
}

.feedback-message--success {
    color: #d9ffe2;
    background: #12351c;
    border: 1px solid #347949;
}

.feedback-notice {
    padding: 0;
    color: #aaa;
    background: transparent;
    border: 0;
    font-size: .8rem;
    line-height: 1.4;
}

.feedback-notice p {
    margin: 0;
}

.feedback-notice p + p {
    margin-top: .3rem;
}

.feedback-contact-note a {
    color: #ff9dce;
    text-decoration: underline;
}

@media screen and (max-width: 768px) {
    .feedback-modal__panel {
        width: 100%;
        border-left: 0;
        box-shadow: none;
    }

    .feedback-modal__body {
        padding: .85rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .feedback-modal .feedback-capture-control {
        display: none;
    }

    .feedback-modal .js-feedback-upload-control:not([hidden]) {
        display: inline-flex;
    }

    .feedback-selected-images {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .feedback-selected-image .feedback-thumbnail-button {
        width: 100%;
        aspect-ratio: auto;
    }

    .feedback-selected-image img {
        width: 100%;
        height: auto;
        max-height: 320px;
        object-fit: contain;
    }

    .feedback-selected-image__remove {
        top: .5rem;
        right: .5rem;
        width: 44px;
        height: 44px;
        font-size: 1.55rem;
    }

    .feedback-notice {
        font-size: .75rem;
        line-height: 1.4;
    }
}

@media screen and (max-width: 600px) {
    .feedback-main {
        width: min(100% - 1rem, 760px);
        margin-top: 1rem;
        margin-bottom: 2rem;
    }

    .feedback-panel {
        padding: 1.1rem;
    }

    .feedback-secondary-button {
        width: 100%;
    }

    .feedback-image-modal {
        padding: .75rem;
    }
}
