.review-page {
    max-width: 1180px;
    margin: 0 auto;
}

.review-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.review-hero-small {
    align-items: flex-start;
}

.review-kicker {
    display: block;
    margin-bottom: .35rem;
    color: #2563eb;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.review-hero h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
}

.review-hero p {
    max-width: 720px;
    margin: .35rem 0 0;
    color: #64748b;
}

.review-metrics,
.review-card-stats,
.review-analytics-grid,
.review-embed-grid,
.review-editor-grid {
    display: grid;
    gap: 1rem;
}

.review-metrics {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 1rem;
}

.review-metric,
.review-card,
.review-panel,
.review-public-card,
.review-display-widget,
.review-empty,
.review-moderation-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.review-metric {
    padding: 1rem;
}

.review-metric span {
    display: block;
    color: #64748b;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.review-metric strong {
    display: block;
    margin-top: .35rem;
    font-size: 1.65rem;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.review-card {
    padding: 1rem;
}

.review-card-top,
.review-moderation-head,
.review-public-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.review-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #fff;
    background: #2563eb;
    border-radius: 8px;
    font-size: 1.25rem;
}

.review-menu-btn {
    color: #475569;
    text-decoration: none;
}

.review-card h2 {
    margin: 1rem 0 .35rem;
    font-size: 1.15rem;
    font-weight: 800;
}

.review-card p,
.review-panel p {
    color: #64748b;
}

.review-card-badges,
.review-card-actions,
.review-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}

.review-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.review-card-stats span {
    color: #64748b;
    font-size: .9rem;
}

.review-card-stats strong {
    color: #0f172a;
}

.review-empty {
    padding: 3rem 1rem;
    text-align: center;
}

.review-empty i {
    display: block;
    margin-bottom: .75rem;
    color: #94a3b8;
    font-size: 3rem;
}

.review-form-shell,
.review-public-form {
    display: grid;
    gap: 1rem;
}

.review-editor-grid,
.review-analytics-grid,
.review-embed-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.review-panel {
    padding: 1rem;
}

.review-panel h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 800;
}

.review-switches {
    display: grid;
    gap: .75rem;
    margin-top: 1rem;
}

.review-switch,
.review-consent {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    color: #334155;
}

.review-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

.review-public-body {
    margin: 0;
    background: #f8fafc;
}

.review-public {
    min-height: 100vh;
    padding: 2rem 1rem;
    background: #f8fafc;
}

.review-public-card {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.25rem;
}

.review-public-header h1 {
    margin: 0;
    color: #0f172a;
    font-size: 1.5rem;
    font-weight: 800;
}

.review-public-header p {
    margin: .3rem 0 0;
    color: #64748b;
}

.review-public-header {
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.review-public-header .review-card-icon {
    background: var(--review-primary);
}

.review-rating-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: .5rem;
}

.review-rating-picker input {
    position: absolute;
    opacity: 0;
}

.review-rating-picker span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

.review-rating-picker input:checked + span {
    color: #fff;
    background: var(--review-accent);
    border-color: var(--review-accent);
}

.review-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
}

.review-submit-btn {
    justify-self: start;
    background: var(--review-primary);
    border-color: var(--review-primary);
}

.review-thanks {
    padding: 2rem 1rem;
    text-align: center;
}

.review-thanks span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: .75rem;
    color: #fff;
    background: #16a34a;
    border-radius: 999px;
    font-size: 1.6rem;
    font-weight: 800;
}

.review-moderation-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.review-moderation-card {
    padding: 1rem;
}

.review-stars {
    color: #cbd5e1;
    letter-spacing: 0;
}

.review-stars .filled,
.review-display-item .filled {
    color: var(--review-accent, #f59e0b);
}

.review-comment {
    margin: 1rem 0;
    color: #0f172a;
    font-size: 1.02rem;
}

.review-consent-line {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.review-consent-line.ok {
    color: #15803d;
}

.review-consent-line.warn {
    color: #b45309;
}

.review-moderation-actions {
    display: grid;
    gap: .75rem;
}

.review-bar-row,
.review-sentiment-row,
.review-link-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.review-bar-row span {
    width: 2rem;
    font-weight: 800;
}

.review-bar-row div {
    flex: 1;
    height: 10px;
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 999px;
}

.review-bar-row i {
    display: block;
    height: 100%;
    background: #2563eb;
}

.review-code {
    padding: .75rem;
    min-height: 120px;
    overflow: auto;
    color: #e2e8f0;
    background: #0f172a;
    border-radius: 8px;
}

.review-display-body {
    margin: 0;
    background: transparent;
}

.review-display-widget {
    padding: 1rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.review-display-widget header span {
    color: var(--review-primary);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.review-display-widget h1 {
    margin: .2rem 0 1rem;
    font-size: 1.35rem;
}

.review-display-item p {
    margin: .75rem 0;
    color: #334155;
    font-size: 1rem;
}

.review-display-empty {
    color: #64748b;
}

body.theme-dark .review-hero,
body.theme-dark .review-metric,
body.theme-dark .review-card,
body.theme-dark .review-panel,
body.theme-dark .review-empty,
body.theme-dark .review-moderation-card,
body.theme-dark .review-public-card,
body.theme-dark .review-display-widget {
    color: #e2e8f0;
    background: #111827;
    border-color: #334155;
}

body.theme-dark .review-hero p,
body.theme-dark .review-card p,
body.theme-dark .review-panel p,
body.theme-dark .review-metric span,
body.theme-dark .review-card-stats span,
body.theme-dark .review-public-header p,
body.theme-dark .review-display-item p,
body.theme-dark .review-display-empty {
    color: #94a3b8;
}

body.theme-dark .review-comment,
body.theme-dark .review-card-stats strong,
body.theme-dark .review-public-header h1,
body.theme-dark .review-display-widget h1 {
    color: #e2e8f0;
}


body.theme-dark .review-public,
body.theme-dark.review-public-body {
    background: #0f172a;
}

body.theme-dark .review-public-card .form-control {
    color: #e2e8f0;
    background: #0f172a;
    border-color: #475569;
}

@media (max-width: 720px) {
    .review-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .review-editor-actions {
        flex-direction: column-reverse;
    }
}

@media (prefers-color-scheme: dark) {
    .review-public-body,
    .review-public {
        background: #0f172a;
    }

    .review-public-card,
    .review-display-widget {
        color: #e2e8f0;
        background: #111827;
        border-color: #334155;
    }

    .review-public-header h1,
    .review-display-widget h1 {
        color: #e2e8f0;
    }

    .review-public-header p,
    .review-display-item p,
    .review-display-empty {
        color: #94a3b8;
    }

    .review-public-card .form-control {
        color: #e2e8f0;
        background: #0f172a;
        border-color: #475569;
    }

    .review-public-card .form-control:focus {
        border-color: var(--review-primary, #2563eb);
        box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .2);
    }

    .review-rating-picker span {
        color: #e2e8f0;
        border-color: #475569;
    }
}

.review-embed-preview-frame,
.webformafy-review-frame {
    border: 0;
    border-radius: 8px;
    width: 100%;
}

.review-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.review-filter-row--toolbar {
    margin-bottom: 1rem;
}

.review-preview-panel {
    min-height: 0;
    position: sticky;
    top: calc(73px + 1rem);
    align-self: start;
    max-height: calc(100vh - 105px);
    max-height: calc(100dvh - 105px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.review-editor-preview {
    --review-primary: #2563eb;
    --review-accent: #f59e0b;
    display: grid;
    gap: .9rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.review-editor-preview .review-card-icon {
    background: var(--review-primary);
}

.review-editor-preview h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
}

.review-preview-stars {
    display: flex;
    flex-wrap: wrap;
    gap: .15rem;
    color: #cbd5e1;
    font-size: 1.3rem;
    line-height: 1;
}

.review-preview-stars .filled {
    color: var(--review-accent);
}

.review-preview-field {
    padding: .65rem .75rem;
    color: #64748b;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.review-preview-text {
    min-height: 74px;
}

.review-preview-consent,
.review-preview-status {
    display: flex;
    gap: .5rem;
    color: #475569;
    font-size: .9rem;
}

.review-preview-status {
    display: block;
    padding-top: .25rem;
    border-top: 1px solid #e2e8f0;
}

.review-preview-submit {
    justify-self: start;
    color: #fff;
    background: var(--review-primary);
    border-color: var(--review-primary);
}

.review-preview-submit:disabled {
    opacity: .55;
}

.review-display-item[hidden] {
    display: none;
}

.review-display-widget--grid .review-display-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}

.review-display-widget--grid .review-display-item,
.review-display-widget--compact .review-display-item {
    padding: .75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.review-display-widget--compact .review-display-track {
    display: grid;
    gap: .5rem;
}

.review-display-widget--compact .review-display-item p {
    margin: .35rem 0;
    font-size: .92rem;
}

.review-display-widget--compact .review-stars {
    font-size: .9rem;
}

body.theme-dark .review-editor-preview,
body.theme-dark .review-preview-field,
body.theme-dark .review-display-widget--grid .review-display-item,
body.theme-dark .review-display-widget--compact .review-display-item {
    background: #0f172a;
    border-color: #334155;
}

body.theme-dark .review-editor-preview h3 {
    color: #e2e8f0;
}

body.theme-dark .review-preview-field,
body.theme-dark .review-preview-consent,
body.theme-dark .review-preview-status {
    color: #94a3b8;
}

@media (max-width: 720px) {
    .review-hero-actions,
    .review-editor-actions {
        justify-content: stretch;
    }

    .review-hero-actions .btn,
    .review-editor-actions .btn {
        width: 100%;
    }
}

.review-wall {
    min-height: 100vh;
    padding: 2rem 1rem 3rem;
    background: #f8fafc;
}

.review-wall-hero,
.review-wall-grid {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.review-wall-hero {
    padding: 1rem 0 1.25rem;
}

.review-wall-hero h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 850;
}

.review-wall-hero p {
    max-width: 700px;
    margin: .45rem 0 0;
    color: #475569;
    font-size: 1.05rem;
}

.review-wall-grid {
    display: grid;
    grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.review-wall-form-card {
    position: sticky;
    top: 1rem;
}

.review-wall-form-card .review-public-header {
    align-items: flex-start;
}

.review-wall-form-card .review-public-header h2,
.review-wall-feed-head h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 800;
}

.review-thanks--compact {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

.review-thanks--compact span {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
}

.review-wall-feed {
    display: grid;
    gap: .75rem;
}

.review-wall-feed-head {
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.review-wall-list {
    display: grid;
    gap: .75rem;
}

.review-wall-item,
.review-wall-empty {
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.review-wall-item p {
    margin: .75rem 0;
    color: #334155;
    font-size: 1rem;
}

.review-wall-item strong {
    margin-right: .5rem;
}

body.theme-dark .review-wall,
body.theme-dark.review-public-body .review-wall {
    background: #0f172a;
}

body.theme-dark .review-wall-hero h1,
body.theme-dark .review-wall-form-card .review-public-header h2,
body.theme-dark .review-wall-feed-head h2 {
    color: #e2e8f0;
}

body.theme-dark .review-wall-hero p,
body.theme-dark .review-wall-item p {
    color: #94a3b8;
}

body.theme-dark .review-wall-feed-head,
body.theme-dark .review-wall-item,
body.theme-dark .review-wall-empty,
body.theme-dark .review-thanks--compact {
    background: #111827;
    border-color: #334155;
}

@media (max-width: 860px) {
    .review-wall-grid {
        grid-template-columns: 1fr;
    }

    .review-wall-form-card {
        position: static;
    }
}

.review-copy-buffer {
    position: fixed;
    top: -1000px;
    left: -1000px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.review-share-panel {
    display: grid;
    gap: .75rem;
    margin-bottom: 1rem;
}

/* Use a dedicated preview rail so the sticky customer-facing result never
   scrolls over configuration panels. All setup groups stay in one left-hand
   flow, while the preview remains visible on the right. */
.review-editor .review-editor-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
    grid-template-areas:
        "business preview"
        "behavior preview"
        "handoff preview";
    align-items: start;
}

.review-editor .review-editor-grid > :nth-child(1) {
    grid-area: business;
}

.review-editor .review-editor-grid > :nth-child(2) {
    grid-area: behavior;
}

.review-editor .review-editor-grid > :nth-child(3) {
    grid-area: handoff;
}

.review-editor .review-editor-grid > :nth-child(4) {
    grid-area: preview;
}

.review-editor-guide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.review-editor-guide div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .35rem .6rem;
    align-items: start;
    padding: .85rem;
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
}

.review-editor-guide i {
    grid-row: span 2;
    color: #2563eb;
    font-size: 1.15rem;
}

.review-editor-guide strong {
    color: #0f172a;
    line-height: 1.1;
}

.review-editor-guide span,
.review-field-help,
.review-panel-hint,
.review-switch small {
    color: #64748b;
    font-size: .86rem;
    line-height: 1.35;
}

.review-panel-hint {
    margin: -.4rem 0 1rem;
}

.review-field-help {
    margin-top: .3rem;
}

.review-switch span {
    display: grid;
    gap: .1rem;
}

.review-switch strong {
    color: #334155;
    font-weight: 700;
}

.review-switch small {
    display: block;
}

body.theme-dark .review-editor-guide div {
    background: #172033;
    border-color: #334155;
}

body.theme-dark .review-editor-guide strong,
body.theme-dark .review-switch strong {
    color: #e2e8f0;
}

body.theme-dark .review-editor-guide span,
body.theme-dark .review-field-help,
body.theme-dark .review-panel-hint,
body.theme-dark .review-switch small {
    color: #94a3b8;
}

@media (max-width: 860px) {
    .review-editor-guide {
        grid-template-columns: 1fr;
    }

    .review-editor .review-editor-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "preview"
            "business"
            "behavior"
            "handoff";
    }

    .review-preview-panel {
        position: static;
        max-height: none;
        overflow: visible;
        overscroll-behavior: auto;
        scrollbar-gutter: auto;
    }
}

.review-thanks-note {
    margin-top: .5rem;
    color: #475569;
    font-size: .9rem;
}

body.theme-dark .review-thanks-note {
    color: #94a3b8;
}

.review-mode-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
    margin-bottom: .35rem;
}

.review-mode-card {
    position: relative;
    display: block;
    margin: 0;
}

.review-mode-card input,
.review-reaction-picker input {
    position: absolute;
    opacity: 0;
}

.review-mode-card span,
.review-reaction-picker span,
.review-experience-pill,
.review-preview-experience {
    border-radius: 8px;
}

.review-mode-card span {
    display: grid;
    gap: .2rem;
    min-height: 96px;
    padding: .75rem;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    cursor: pointer;
}

.review-mode-card strong {
    color: #0f172a;
    font-weight: 800;
}

.review-mode-card small {
    color: #64748b;
    font-size: .82rem;
    line-height: 1.35;
}

.review-mode-card input:checked + span {
    background: #eff6ff;
    border-color: var(--review-primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .16);
}

.review-experience-pill,
.review-preview-experience {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: var(--review-primary, #2563eb);
    background: rgba(37, 99, 235, .1);
    border: 1px solid rgba(37, 99, 235, .22);
    font-size: .76rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.review-experience-pill {
    margin-bottom: .35rem;
    padding: .35rem .5rem;
}

.review-preview-experience {
    padding: .4rem .55rem;
}

.review-reaction-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: .5rem;
}

.review-reaction-picker label {
    position: relative;
    margin: 0;
}

.review-reaction-picker span {
    display: grid;
    gap: .15rem;
    min-height: 64px;
    padding: .65rem .75rem;
    color: #334155;
    background: #fff;
    border: 1px solid #cbd5e1;
    cursor: pointer;
}

.review-reaction-picker strong {
    color: #0f172a;
    font-weight: 800;
}

.review-reaction-picker small {
    color: #64748b;
    font-size: .78rem;
}

.review-reaction-picker input:checked + span,
.review-reaction-picker span.selected {
    color: #fff;
    background: var(--review-accent, #f59e0b);
    border-color: var(--review-accent, #f59e0b);
}

.review-reaction-picker input:checked + span strong,
.review-reaction-picker input:checked + span small,
.review-reaction-picker span.selected,
.review-reaction-picker span.selected strong,
.review-reaction-picker span.selected small {
    color: #fff;
}

.review-reaction-picker--preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-reaction-picker--preview span {
    min-height: auto;
    padding: .5rem .6rem;
    font-size: .86rem;
    font-weight: 800;
}

body.theme-dark .review-mode-card span,
body.theme-dark .review-reaction-picker span {
    color: #cbd5e1;
    background: #0f172a;
    border-color: #334155;
}

body.theme-dark .review-mode-card strong,
body.theme-dark .review-reaction-picker strong {
    color: #e2e8f0;
}

body.theme-dark .review-mode-card small,
body.theme-dark .review-reaction-picker small {
    color: #94a3b8;
}

body.theme-dark .review-mode-card input:checked + span {
    background: #172033;
}

@media (max-width: 720px) {
    .review-mode-picker,
    .review-reaction-picker--preview {
        grid-template-columns: 1fr;
    }
}

.review-display-reaction {
    display: inline-flex;
    width: fit-content;
    margin-top: .35rem;
    padding: .28rem .45rem;
    color: var(--review-primary, #2563eb);
    background: rgba(37, 99, 235, .1);
    border: 1px solid rgba(37, 99, 235, .22);
    border-radius: 8px;
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}
