@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

:root {
    /* Zeeglas: the original sage/slate palette, with tonal layers */
    --zg-page: #cbd3cf;
    --zg-page-deep: #c2cbc7;
    --zg-card: #dbe1dd;
    --zg-card-hi: #e3e8e5;
    --zg-ink: #2e3944;
    --zg-ink-soft: #4f5e66;
    --zg-slate: #849da2;
    --zg-teal: #3c6a6e;
    --zg-teal-deep: #2b5559;
    --zg-teal-wash: #c9dad7;
    --zg-teal-rgb: 60, 106, 110;
    --zg-clay: #8a6560;
    --zg-clay-wash: #e1d6d2;
    /* icons8 icons are black; tint them to the text ink with a hint of sea glass (#30404a), a bit more on hover (#2f5156) */
    --zg-icon-filter: brightness(0) saturate(100%) invert(22%) sepia(8%) saturate(1673%) hue-rotate(158deg) brightness(91%) contrast(87%);
    --zg-icon-filter-hover: brightness(0) saturate(100%) invert(22%) sepia(5%) saturate(4269%) hue-rotate(140deg) brightness(100%) contrast(75%);
    --zg-shadow-rgb: 34, 52, 58;
    --zg-highlight: inset 0 1px 0 rgba(255, 255, 255, .65);
    --zg-shadow:
        0 1px 1px rgba(var(--zg-shadow-rgb), .06),
        0 2px 4px rgba(var(--zg-shadow-rgb), .06),
        0 8px 16px -6px rgba(var(--zg-shadow-rgb), .14),
        0 20px 36px -18px rgba(var(--zg-shadow-rgb), .22);
    --zg-shadow-lift:
        0 1px 1px rgba(var(--zg-shadow-rgb), .05),
        0 4px 8px rgba(var(--zg-shadow-rgb), .07),
        0 14px 24px -8px rgba(var(--zg-shadow-rgb), .18),
        0 28px 48px -20px rgba(var(--zg-shadow-rgb), .28);
    --zg-shadow-press:
        0 1px 1px rgba(var(--zg-shadow-rgb), .08),
        0 2px 6px -2px rgba(var(--zg-shadow-rgb), .14);
    --zg-ease: cubic-bezier(.22, .8, .26, 1);
    --zg-focus-ring: 3px solid rgba(var(--zg-teal-rgb), .45);
    --zg-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.4l2.9 2.8 6-6.4' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    --background-color: var(--zg-page);
    --explainbox-color: var(--zg-ink);
    --explainbox-background-color: var(--zg-card);   /* also the waveform canvas fill */
    --audiowaveform-color: var(--zg-teal);
    --button-color: var(--zg-ink);
    --button-background-color: var(--zg-card);
    --button-background-color-selected: var(--zg-teal-wash);
    --button-color-disabled: var(--zg-slate);
    --button-background-color-disabled: #d3d9d5;
    --button-border-color: var(--zg-slate);
    --button-border-color-selected: var(--zg-teal-deep);
    --button-border-color-selected-hover: var(--zg-teal-deep);
    --button-border-color-hover: var(--zg-teal);
    --textarea-color: var(--zg-ink);
    --textarea-background-color: var(--zg-card-hi);
    --textarea-border-color-focus: rgba(var(--zg-teal-rgb), .55);
}

* {
    margin: 0;
    padding: 0;
    font-family: "Poppins", serif;
}
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    background-color: var(--background-color);
    /* two faint pools of sea-glass light so the frosted headers have something to frost */
    background-image:
        radial-gradient(1100px 620px at 18% -8%, rgba(232, 240, 236, .42), transparent 62%),
        radial-gradient(900px 600px at 92% 108%, rgba(150, 184, 182, .28), transparent 60%),
        linear-gradient(180deg, var(--zg-page) 0%, var(--zg-page-deep) 100%);
    background-attachment: fixed;
    scroll-snap-type: y proximity;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    padding-top: 40px; //room for navbar
    width: 100%;
}

body::-webkit-scrollbar {
    display: none;
}

ul {
    list-style-position: inside;
}
.fullheight { 
    height: 100vh;
}
h1 { font-size: 20px; font-weight: 600; letter-spacing: -.005em; color: var(--zg-ink); }

.screen {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#intro-screen,
#upload-screen {
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.screen:not(.active) {
    display: none !important;
}

.decisiontree {
    position: relative;
}

.decisiontree .node {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 250px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    transition: transform .62s var(--zg-ease), opacity .45s ease;
}

.decisiontree .node img {
    margin-top: 30px;
    margin-bottom: 30px;
}


.off-screen-left {
    transform: translateX(-200%);
    opacity: 0;
    pointer-events: none;
}

.on-screen {
    transform: translateX(0);
}

.off-screen-right {
    transform: translateX(200%);
    opacity: 0;
    pointer-events: none;
}

.decisiontree { width: 100%; }  

.fakenode { display: none; }

.vflexbox {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.gosection,
.documentwriterinputpage {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 90%;
    max-width: 900px;
    justify-content: center;
}

.documentwriterinput {
    display: flex;
    flex-direction: column;
    
    
    align-items: stretch;
}

.documentwriterinput textarea,
.explainbox,
#rapport-tinymce,
.button {
    border-radius: 20px;
    font-size: 14px;
    box-shadow: var(--zg-highlight), var(--zg-shadow);
    padding: 2vh 2vw;
    margin: 1vh 1vw;
}

.decisiontree .node .back {
    align-self: center;
    position: absolute;
    left: -86px;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    border-width: 2px;
}
.decisiontree .node .back img { margin: 0; width: 22px; height: 22px; }
.decisiontree .node .back:not(:disabled):hover { transform: translateX(-2px); }
.decisiontree .node .back:not(:disabled):hover img { transform: none; }

/* slow breathing glow */
.button.primary {
    border-color: var(--zg-teal);
    color: var(--zg-teal-deep);
    font-weight: 500;
    animation: zg-breathe 3.8s ease-in-out infinite;
}
.button.primary:not(:disabled):hover { animation: none; }
@keyframes zg-breathe {
    0%, 100% {
        box-shadow: var(--zg-highlight), var(--zg-shadow), 0 0 0 0 rgba(var(--zg-teal-rgb), 0);
    }
    50% {
        box-shadow: var(--zg-highlight), var(--zg-shadow),
            0 0 0 5px rgba(var(--zg-teal-rgb), .10),
            0 0 26px 2px rgba(var(--zg-teal-rgb), .22);
    }
}

textarea {
    color: var(--textarea-color);
    background-color: var(--textarea-background-color);
}

.multiplechoice {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5%;
}


.explainbox,
.button {
    color: var(--button-color);
    display:flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.explainbox .content { margin-top: 1.4vh; color: var(--zg-ink-soft); line-height: 1.55; }

.explainbox { 
    color: var(--explainbox-color);
    background-color: var(--explainbox-background-color);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 40%);
    border: 1px solid rgba(255, 255, 255, .35);
}
.button {
    border: 3px solid var(--button-border-color);
    flex: 1;
    position: relative;
    background-color: var(--button-background-color);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 45%);
    line-height: 1.5;
    transition:
        transform .28s var(--zg-ease),
        box-shadow .28s var(--zg-ease),
        border-color .2s ease,
        background-color .25s ease,
        color .2s ease;
}
.button * {
    pointer-events: none;
}
/*make sure links still work*/
.button a, .button a * {
    pointer-events: auto;
}
.button:disabled {
    border: 3px solid transparent;
    color:var(--button-color-disabled);
    background-color: var(--button-background-color-disabled);
    background-image: none;
    box-shadow: inset 0 0 0 1px rgba(var(--zg-teal-rgb), .12), 0 1px 2px rgba(var(--zg-shadow-rgb), .06);
    cursor: default;
}


.button:not(:disabled):hover {
    border: 3px solid var(--button-border-color-hover);
    cursor: pointer;
    transform: translateY(-2px);
    box-shadow: var(--zg-highlight), var(--zg-shadow-lift);
}

.button:not(:disabled):active {
    border: 3px solid var(--button-border-color-selected);
    cursor: pointer;
    transform: translateY(0);
    box-shadow: var(--zg-highlight), var(--zg-shadow-press);
    transition-duration: .08s;
}

.button.selected {
    border: 3px solid var(--button-border-color-selected);
    background-color: var(--button-background-color-selected);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 50%);
    color: var(--zg-teal-deep);
    font-weight: 500;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), var(--zg-shadow);
}

.button.selected:hover {
    border: 3px solid var(--button-border-color-selected-hover);
}

.stoprecordingbutton,
.gobutton,
.nextbutton {
    flex: none;
    width: 30%;
    min-width: 200px;
    align-self: center;
}

.nextbutton:disabled {
    visibility: hidden;
}

.introbutton {
    width: 20vw;
    min-width: 200px;
}

.icon {
    max-width: 12vw;
    margin: 1vh 1vw;
}

.qrcode {
    width: 10vw;
    margin: 1vh 1vw;
    background: #fff;
    padding: 10px;
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgba(var(--zg-teal-rgb), .14), 0 6px 18px -8px rgba(var(--zg-shadow-rgb), .35);
    animation: zg-rise .5s var(--zg-ease) both;
}

.audiopanels {
    flex: 0 0 40vh;
    display: flex;
    flex-direction: column;
}

.audiopanel {
    flex:1;
    display: flex;
    align-self: stretch;
}

.audiopanel:not(.active) {
    display: none;
}

.audiopanel.select-source {
    flex-direction: row;
    justify-content: space-between;
}

.audiopanel.qrpanel { position: relative; }
.audiopanel.transcribe { position: relative; }
.audiopanel.transcribe:not(.finished) .icon {
    display: none;
}

.audiopanel.transcribe .spinner {
    margin-bottom: 30px;
}
.audiopanel .progressmessage {
    text-align: center;
}

.recordbutton.permission_denied { background-color: #fcc; }
/*.recordbutton p::before { content: "Begin nieuwe opname"; }*/
/*.recordbutton.permission_denied p::before { content: "Microfoon toegang is uitgeschakeld. Ga naar instellingen om toestemming te geven."; }*/

.button .img { pointer-events: none; }

.audiopanel.transcribe.finished .spinner { display: none; }
.audiopanel .uploadfilebutton { position: relative; }
.audiopanel .uploadfilebutton #sleepmsg { position: absolute; bottom: 30px;}
@media (max-width: 1024px) { .audiopanel .uploadfilebutton #sleepmsg { display: none; } }
.audiopanel .dragging .img { display: none; }
.audiopanel .dragging { background-color: var(--zg-teal-wash); border-color: var(--zg-teal); border-style: dashed; }
.audiopanel.textinput { position:relative;}
.audiopanel textarea { flex: 1 1 30vh; }

.documentwriterinput input[type="file"] {
    display: none;
}

a:hover {
    text-decoration: underline;
    cursor: pointer;
}

/*settings shared between textarea in audiopanel, and textarea in textareapromptelement*/
.documentwriterinput textarea {
    background-color: var(--textarea-background-color);
    resize: none;
    font-size: 14px;
    /*font-weight: lighter;*/
    outline: 3px solid transparent;
    border: 1px solid rgba(var(--zg-teal-rgb), .14);
    color: var(--zg-ink);
    line-height: 1.6;
    box-shadow: inset 0 1px 3px rgba(var(--zg-shadow-rgb), .07), var(--zg-shadow);
    transition: outline-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.textareadocumentwriterinput textarea { flex: 0 0 30vh; }

.documentwriterinput textarea:focus {
    outline: 3px solid var(--textarea-border-color-focus);
    background-color: #eef2ef;
}

.closebutton {
    position: absolute;
    top: 0;
    right: 0;
    margin: 2vh 2vw;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(var(--zg-teal-rgb), .18);
    background: var(--zg-card-hi);
    color: var(--zg-ink-soft);
    font-size: 12px;
    font-weight: 500;
    box-shadow: var(--zg-highlight), 0 1px 2px rgba(var(--zg-shadow-rgb), .1), 0 3px 8px -2px rgba(var(--zg-shadow-rgb), .14);
    transition: border-color .2s ease, color .2s ease, transform .25s var(--zg-ease), background-color .2s ease;
}

.closebutton:hover {
    border: 1px solid var(--zg-teal);
    color: var(--zg-teal-deep);
    background: #fff;
    transform: rotate(90deg);
    cursor: pointer;
}
.closebutton:active {
    border: 1px solid var(--zg-teal-deep);
    transform: rotate(90deg) scale(.94);
}

.cards {
    display: flex;
    justify-content: center;
    width: 90%;
    gap: 40px;
    margin: 50px auto;
}

.card {
    box-sizing: border-box;
    width: max-content;
    min-width: 300px;
    padding: 25px;
}
.card h1 {
    padding:10px;
    font-size: 30px;
}

.spinner {
    box-sizing: border-box;
    /* sea-glass ring with a teal arc */
    border: 4px solid rgba(var(--zg-teal-rgb), .16);
    border-top-color: var(--zg-teal);
    border-right-color: rgba(var(--zg-teal-rgb), .55);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    animation: spin 1.1s cubic-bezier(.55, .15, .45, .85) infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#rapport-tinymce-container {
    min-width: 65%;
    margin: 0 4vh;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    /* the editor gives up room when the feedback field grows, so the bar never drops off screen */
    height: calc(100vh - 40px - 1vh);
}

/* Kept outside the iframe document so the indicator is never copied with the report. */
#rapport-progress {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    /* Set the complete border: TinyMCE's reset otherwise removes its solid style. */
    border: 2px solid var(--explainbox-color);
    border-top-color: transparent;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 0 4px white;
    pointer-events: none;
    animation-duration: 0.8s;
}

#rapport-progress[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    #rapport-progress {
        animation-duration: 2s;
    }
}

#uploadbox {
    display: flex;
    width: 300px;
    height: 200px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 22px;
    color: var(--zg-ink-soft);
    font-weight: 500;
    animation: zg-rise .5s var(--zg-ease) both;
}
#uploadbox .spinner { width: 44px; height: 44px; }

#result-screen #buttons {
    display:flex;
    flex: none;
    flex-direction: row;
    justify-content: stretch;
    align-items: stretch;
    margin-top: 4px;
    font-size: 14px;
}

.collapsible {
}
.collapsible h1:hover {
    cursor: pointer;
    text-decoration: underline;
}

.collapsible .content:not(.expanded) {
    display: none;
}

.question h1 { font-size: 16px; }
.question .content { font-size: 14px; margin-top: 3vh; margin-left: 5vw; }
.question { margin: 20px 10vw; }

nav {
    display:flex;
    flex-direction: row;
    justify-content: end;
    background-color: rgba(132, 157, 162, .82);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    backdrop-filter: blur(10px) saturate(130%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 4px 14px -8px rgba(var(--zg-shadow-rgb), .4);
    position: fixed; /* Fixes navbar to the top of the viewport */
    top: 0; /* Align top edge of navbar with top edge of the viewport */
    width: 100%; /* Ensures the navbar stretches across the full width of the viewport */
    z-index: 1000; /* Ensures the navbar stays on top of other content */
}

nav a {
    display: block;
    color: #e3e9e4;
    text-align: center;
    margin: 10px 1vw;
    text-decoration: none;
    text-underline-offset: 4px;
}

nav a:hover {
    text-decoration: underline;
}

nav a.active {
    text-decoration: underline;
}
#rapport-error {
    border: 2px solid #9c2424;
    background: #fff0f0;
    color: #7a1616;
    font-size: 14px;
    font-weight: bold;
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 6px;
}

/* ==========================================================================
   Zeeglas: depth, crisp shadows, teal interaction states and gentle motion
   ========================================================================== */
.scrolltarget { scroll-snap-align: center; }

body { color: var(--zg-ink); }

::selection { background: rgba(var(--zg-teal-rgb), .22); }

/* frosted-glass header cards */
aside.explainbox,
.gosection > .explainbox {
    background-color: rgba(222, 229, 225, .58);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .08) 55%, rgba(255, 255, 255, 0) 100%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, .55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .8),
        inset 0 -1px 0 rgba(var(--zg-teal-rgb), .06),
        var(--zg-shadow);
}
aside.explainbox h1,
.gosection > .explainbox h1 { position: relative; }
.gosection > .explainbox h1 { margin-bottom: 1.2vh; }
aside.explainbox h1::after,
.gosection > .explainbox h1::after {
    /* small sea-glass rule under the title */
    content: "";
    display: block;
    width: 28px;
    height: 2px;
    margin: 8px auto 0;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(var(--zg-teal-rgb), .2), rgba(var(--zg-teal-rgb), .7), rgba(var(--zg-teal-rgb), .2));
}
.explainbox a { color: var(--zg-teal-deep); text-decoration-color: rgba(var(--zg-teal-rgb), .4); text-underline-offset: 2px; }
.explainbox a:hover { text-decoration-color: currentColor; }

/* ---------- buttons ---------- */
.button img {
    transition: transform .35s var(--zg-ease), filter .25s ease;
}
/* tint the black icons8 line icons (the app logo stays as-is) */
.button img[src*="icons8"],
.audiopanel .icon[src*="icons8"],
.closebutton img[src*="icons8"] {
    filter: var(--zg-icon-filter);
}

.button:not(:disabled):hover img[src*="icons8"] { filter: var(--zg-icon-filter-hover); }
.button:not(:disabled):hover img { transform: translateY(-1px) scale(1.035); }

.button:focus-visible,
.closebutton:focus-visible,
#feedback_send:focus-visible,
#stars .star:focus-visible {
    outline: var(--zg-focus-ring);
    outline-offset: 3px;
}

/* selected: small check */
.button.selected::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    border-radius: 50%;
    background: var(--zg-check) center / 20px no-repeat, var(--zg-teal-deep);
    box-shadow: 0 1px 2px rgba(var(--zg-shadow-rgb), .25);
    animation: zg-pop .32s var(--zg-ease) both;
}

/* Toekennen / Afwijzen: distinct but calm */
.multiplechoice .button[choice="Afwijzen"].selected {
    background-color: var(--zg-clay-wash);
    border-color: var(--zg-clay);
    color: #6e4c48;
}
.multiplechoice .button[choice="Afwijzen"].selected::after {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7 7l6 6M13 7l-6 6' fill='none' stroke='white' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E") center / 20px no-repeat,
        var(--zg-clay);
}
.multiplechoice .button[choice="Afwijzen"]:not(:disabled):hover { border-color: var(--zg-clay); }
.multiplechoice .button[choice="Afwijzen"].selected:hover { border-color: #74504b; }
.multiplechoice > span { color: var(--zg-ink-soft); font-weight: 500; }
.multiplechoice .button { padding-top: 1.6vh; padding-bottom: 1.6vh; }

@keyframes zg-pop {
    0% { transform: scale(.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ---------- panels ---------- */
.qrpanel .instructions { color: var(--zg-ink-soft); line-height: 1.75; margin-top: 6px; }
.qrpanel .instructions li::marker { color: var(--zg-teal); }

.audiopanel .progressmessage { color: var(--zg-ink-soft); line-height: 1.7; font-variant-numeric: tabular-nums; }
.audiopanel.transcribe.finished .icon { animation: zg-rise .45s var(--zg-ease) both; }
.audiopanel.recording canvas { border-radius: 12px; }
textarea::placeholder { color: #7f9195; }

@keyframes zg-rise {
    from { opacity: 0; transform: translateY(6px) scale(.98); }
    to { opacity: 1; transform: none; }
}

/* ---------- result screen ---------- */
#rapport-tinymce-container .tox-tinymce {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important; /* TinyMCE sets an inline height; let the flex layout decide */
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 20px;
    box-shadow: 0 0 0 1px rgba(var(--zg-teal-rgb), .10), var(--zg-shadow);
}
#rapport-tinymce-container .tox .tox-editor-header {
    background: linear-gradient(180deg, #f5f8f6, #eef2f0);
    border-bottom: 1px solid rgba(var(--zg-teal-rgb), .12);
    box-shadow: none !important;
    padding: 2px 0 !important;
}
#rapport-tinymce-container .tox .tox-toolbar,
#rapport-tinymce-container .tox .tox-toolbar__primary,
#rapport-tinymce-container .tox .tox-toolbar__overflow { background: transparent; }
#rapport-tinymce-container .tox .tox-tbtn { color: var(--zg-ink-soft); border-radius: 8px; }
#rapport-tinymce-container .tox .tox-tbtn svg { fill: var(--zg-ink-soft); }
#rapport-tinymce-container .tox .tox-tbtn:hover { background: var(--zg-teal-wash); color: var(--zg-teal-deep); }
#rapport-tinymce-container .tox .tox-tbtn:hover svg { fill: var(--zg-teal-deep); }
#rapport-tinymce-container .tox .tox-tbtn--enabled,
#rapport-tinymce-container .tox .tox-tbtn--enabled:hover { background: #d5e3e0; }

/* ---------- feedback bar ---------- */
#back-button,
#restart-button { flex-shrink: 0; }

#feedback_area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

#feedback_div {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 1.4vh 1.6vw;
}

#rating {
    flex: none;
    min-width: 116px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
#tevreden_text {
    color: var(--zg-ink-soft);
    font-size: 13px;
    font-weight: 500;
    min-height: 1.5em;
}
#stars { display: flex; }
#stars .star {
    appearance: none;
    background: none;
    border: 0;
    padding: 1px 2px;
    border-radius: 6px;
    font-size: 22px;
    line-height: 1;
    color: #a9b6b6;
    cursor: pointer;
    transition: color .15s ease, transform .2s var(--zg-ease), text-shadow .2s ease;
}
#stars .star.on {
    color: #dca12e;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .5), 0 0 10px rgba(220, 161, 46, .3);
}
#stars .star:hover { transform: translateY(-1px) scale(1.18); }
#stars .star.pop { animation: zg-star-pop .4s var(--zg-ease); }
#stars.nudge { animation: zg-nudge .7s ease .2s; }

@keyframes zg-star-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.38); }
    100% { transform: scale(1); }
}
@keyframes zg-nudge {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

#feedback_field {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* grows with what you type (see autoGrowFeedbackTextarea), from two lines up to about six */
#feedback_text {
    width: 100%;
    min-height: calc(3em + 24px);
    max-height: 10.5em;
    overflow-y: auto;
    resize: none;
    padding: 11px 14px;
    border: 1px solid rgba(var(--zg-teal-rgb), .18);
    border-radius: 12px;
    background-color: #f3f6f4;
    color: var(--zg-ink);
    font-size: 14px;
    line-height: 1.5;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
#feedback_text:hover { border-color: rgba(var(--zg-teal-rgb), .35); }
#feedback_text:focus {
    outline: none;
    background-color: #fff;
    border-color: var(--zg-teal);
    box-shadow: 0 0 0 4px rgba(var(--zg-teal-rgb), .14);
}
#feedback_hint {
    margin: 5px 0 0 14px;
    font-size: 12px;
    color: var(--zg-teal-deep);
    animation: zg-rise .3s var(--zg-ease) both;
}
#feedback_hint:empty { display: none; }
#feedback_hint.error { color: #8a4a44; }

#feedback_send {
    flex: none;
    padding: 10px 20px;
    border-radius: 999px;
    border: 2px solid var(--zg-teal);
    background: var(--zg-card-hi);
    color: var(--zg-teal-deep);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--zg-highlight), 0 1px 2px rgba(var(--zg-shadow-rgb), .1);
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .25s var(--zg-ease), box-shadow .25s var(--zg-ease);
}
#feedback_send:not(:disabled):hover {
    background: var(--zg-teal);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -6px rgba(var(--zg-teal-rgb), .6);
}
#feedback_send:not(:disabled):active { transform: none; box-shadow: var(--zg-shadow-press); }
#feedback_send:disabled {
    border-color: rgba(var(--zg-teal-rgb), .2);
    color: #8fa2a6;
    box-shadow: none;
    cursor: default;
}

#want_new_iteration_div {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
#feedback_thanks {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--zg-teal-deep);
    font-size: 13px;
    font-weight: 500;
    animation: zg-rise .4s var(--zg-ease) both;
}
#feedback_thanks::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--zg-check) center / 16px no-repeat, var(--zg-teal);
}
#want_new_iteration_div .button {
    flex: none;
    padding: 1.4vh 2.4vw;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    /* spinners keep turning: they are the only sign that work is still in progress */
    *:not(.spinner), *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .button.primary { box-shadow: var(--zg-highlight), var(--zg-shadow), 0 0 0 4px rgba(var(--zg-teal-rgb), .14); }
    .button:not(:disabled):hover,
    .button:not(:disabled):hover img { transform: none; }
}
