.feedback-app {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-strong: #fffaf0;
    --text: #111827;
    --muted: #4b5563;
    --line: rgba(15, 23, 42, 0.10);
    --line-strong: rgba(15, 23, 42, 0.14);
    --accent: #ffb000;
    --accent-strong: #e69e00;
    --accent-text: #111827;
    --warn: #8a5a00;
    --error: #b3261e;
    --gold: #f59e0b;
    --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    --radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.feedback-app,
.feedback-app * {
    box-sizing: border-box;
}

.feedback-app button,
.feedback-app input,
.feedback-app select,
.feedback-app textarea {
    font: inherit;
}

.feedback-app button {
    cursor: pointer;
}

body.feedback-form-standalone {
    min-width: 0;
    margin: 0;
    color: var(--text, #111827);
    background: var(--bg, #ffffff);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.feedback-app {
    width: min(1200px, calc(100% - 48px));
    margin: 28px auto 48px;
}

.app-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.app-head h1 {
    margin: 0;
    color: var(--text);
    font-size: 40px;
    line-height: 1.1;
    letter-spacing: 0;
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--warn);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.mode-pill {
    padding: 9px 13px;
    border: 1px solid rgba(255, 176, 0, 0.55);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface-strong);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.step-nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.step-nav button {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    background: var(--surface);
    font-size: 14px;
    font-weight: 800;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.step-nav button span {
    display: inline-grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: var(--muted);
    background: #f8fafc;
    font-size: 12px;
    transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.step-nav button:not(.is-active):hover {
    border-color: rgba(255, 176, 0, 0.65);
    background: #fffaf0;
    transform: translateY(-1px);
}

.step-nav button.is-active {
    border-color: var(--accent);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.step-nav button.is-active span {
    color: var(--accent-text);
    background: var(--accent);
}

.step-nav button.is-hidden,
.is-hidden {
    display: none !important;
}

.feedback-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: clip;
}

.form-step {
    display: none;
    padding: 24px;
}

.form-step.is-active {
    display: block;
}

.step-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.step-title h2 {
    margin: 0;
    color: var(--text);
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: 0;
    font-weight: 800;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field,
.check-field,
.upload-zone {
    min-width: 0;
}

.field.full,
.check-field.full,
.upload-zone.full {
    grid-column: 1 / -1;
}

.field {
    display: grid;
    gap: 7px;
}

.field > span,
.field > label,
.field legend {
    color: #374151;
    font-weight: 800;
}

.field legend {
    margin: 0 0 8px;
    padding: 0;
}

fieldset.field {
    margin: 0;
    padding: 0;
    border: 0;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.field input,
.field select {
    min-height: 52px;
    padding: 0 14px;
}

.field textarea {
    min-height: 132px;
    padding: 14px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 176, 0, 0.20);
}

.field select:disabled,
.field input:disabled {
    color: #9ca3af;
    background: #f8fafc;
    cursor: not-allowed;
}

.combo-field {
    grid-template-rows: auto auto auto;
    position: relative;
}

.combo-control {
    position: relative;
    min-width: 0;
}

.combo-field input[type="text"] {
    min-height: 52px;
    padding-right: 52px;
}

.combo-toggle {
    position: absolute;
    top: 5px;
    right: 5px;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    touch-action: manipulation;
    transition: background-color 160ms ease, transform 160ms ease;
}

.combo-toggle::before {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.combo-toggle:not(:disabled):hover,
.combo-toggle:not(:disabled):focus-visible {
    background: #fff4d6;
}

.combo-field.is-open .combo-toggle::before {
    transform: translateY(2px) rotate(225deg);
}

.combo-toggle:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.combo-options {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    max-height: min(330px, 48vh);
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.combo-options[hidden] {
    display: none;
}

.combo-option {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--text);
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    user-select: none;
    scroll-margin: 8px;
    touch-action: manipulation;
}

.combo-option:hover,
.combo-option.is-active {
    background: #fff4d6;
}

.combo-option.is-selected {
    color: #5f3d00;
    background: #ffedbd;
}

.combo-option mark {
    padding: 0;
    color: inherit;
    background: rgba(255, 176, 0, 0.32);
    border-radius: 3px;
}

.combo-empty {
    min-height: 46px;
    padding: 12px;
    color: var(--muted);
    font-weight: 700;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.segmented label {
    min-width: 0;
}

.segmented input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: grid;
    place-items: center;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
    background: #fff;
    font-weight: 700;
    transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.segmented label:hover span {
    border-color: rgba(255, 176, 0, 0.70);
    background: #fffaf0;
    transform: translateY(-1px);
}

.segmented input:checked + span {
    border-color: var(--accent);
    color: var(--accent-text);
    background: var(--accent);
}

.segmented input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(255, 176, 0, 0.22);
}

.check-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-strong);
    font-weight: 700;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.check-field:hover {
    border-color: rgba(255, 176, 0, 0.70);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.check-field input {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.check-field .field-error {
    flex-basis: 100%;
}

.star-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 52px;
}

.star-rating button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #9ca3af;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    text-shadow: none;
    transform-origin: center;
    transition: color 140ms ease, transform 140ms ease, filter 140ms ease;
}

.star-rating button.is-active {
    color: var(--gold);
    background: transparent;
}

.star-rating button:hover,
.star-rating button.is-preview {
    color: var(--gold);
    transform: translateY(-1px) scale(1.12);
}

.star-rating button.is-popping {
    animation: star-pop 420ms ease-out;
}

.star-rating button:focus-visible {
    outline: 3px solid rgba(215, 154, 33, 0.25);
    outline-offset: 2px;
}

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    font-size: 24px;
    line-height: 1;
    animation: rating-fade 260ms ease-out;
}

.rating-stars .star-on {
    color: var(--gold);
}

.rating-stars .star-off {
    color: #9ca3af;
}

.upload-zone {
    padding: 16px;
    border: 1px dashed rgba(255, 176, 0, 0.65);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
}

.upload-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.upload-head h3 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0;
}

.upload-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.upload-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    color: var(--accent-text);
    background: var(--accent);
    font-weight: 900;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.upload-button:hover {
    background: var(--accent-strong);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.upload-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.upload-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 34px;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.upload-item:hover {
    border-color: rgba(255, 176, 0, 0.65);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.upload-thumb {
    display: grid;
    place-items: center;
    width: 72px;
    aspect-ratio: 1;
    border-radius: 6px;
    background: var(--surface-strong);
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.upload-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-meta {
    min-width: 0;
}

.upload-name {
    margin: 0 0 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.upload-size {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 13px;
}

.progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #fef3c7;
}

.progress-track span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.18s ease;
}

.remove-upload {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    background: #fff;
    font-size: 20px;
    line-height: 1;
    transition: transform 140ms ease, color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.remove-upload:hover {
    color: var(--error);
    border-color: var(--error);
    background: #fff5f5;
    transform: scale(1.05);
}

.review {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.review-group {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.review-group.full {
    grid-column: 1 / -1;
}

.review-group h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.review-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid #eef1ea;
}

.review-row:first-of-type {
    border-top: 0;
}

.review-row dt {
    color: var(--muted);
    font-weight: 700;
}

.review-row dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.submit-progress {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-strong);
}

.submit-progress p {
    margin: 8px 0 0;
    color: var(--muted);
}

.form-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    background: #ffffff;
}

.form-actions button {
    min-height: 44px;
    min-width: 112px;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-weight: 700;
}

.primary {
    border: 1px solid var(--accent);
    color: var(--accent-text);
    background: var(--accent);
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.primary:hover {
    background: var(--accent-strong);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.secondary {
    border: 1px solid var(--line-strong);
    color: var(--text);
    background: #fff;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.secondary:hover {
    border-color: var(--accent);
    background: var(--surface-strong);
    transform: translateY(-1px);
}

.status-line {
    min-width: 0;
    color: var(--muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.field-error {
    min-height: 18px;
    margin: 0;
    color: var(--error);
    font-size: 13px;
    font-weight: 700;
}

.has-error input,
.has-error select,
.has-error textarea {
    border-color: var(--error);
}

.has-error .segmented span {
    border-color: var(--error);
}

@keyframes star-pop {
    0% {
        transform: scale(0.86);
        filter: brightness(1);
    }
    42% {
        transform: translateY(-2px) scale(1.26);
        filter: brightness(1.18);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes rating-fade {
    0% {
        opacity: 0;
        transform: translateY(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

@media (max-width: 860px) {
    .feedback-app {
        width: min(100% - 20px, 720px);
        margin: 12px auto;
    }

    .app-head {
        align-items: start;
    }

    .app-head h1 {
        font-size: 28px;
    }

    .step-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .form-step {
        padding: 18px;
    }

    .form-grid,
    .review,
    .upload-list {
        grid-template-columns: 1fr;
    }

    .review-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .form-actions {
        grid-template-columns: 1fr 1fr;
        padding: 14px 18px;
    }

    .status-line {
        grid-column: 1 / -1;
        order: -1;
    }
}

@media (max-width: 520px) {
    .feedback-app {
        width: calc(100% - 12px);
        margin: 6px auto;
    }

    .app-head {
        display: grid;
        gap: 8px;
    }

    .app-head h1 {
        font-size: 25px;
    }

    .mode-pill {
        justify-self: start;
    }

    .step-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .step-nav button {
        min-height: 38px;
        padding: 7px 8px;
        font-size: 13px;
    }

    .form-step {
        padding: 14px;
    }

    .step-title h2 {
        font-size: 21px;
    }

    .segmented {
        grid-template-columns: 1fr;
    }

    .upload-head {
        align-items: stretch;
        flex-direction: column;
    }

    .upload-button {
        width: 100%;
    }

    .upload-item {
        grid-template-columns: 62px minmax(0, 1fr) 34px;
    }

    .upload-thumb {
        width: 62px;
    }

    .form-actions {
        grid-template-columns: 1fr;
    }

    .form-actions button {
        width: 100%;
    }
}
