.dqr-entry {
    align-items: center;
    display: flex;
    justify-content: flex-start;
    padding-top: .8rem;
}

.dqr-entry-compact { padding-top: .25rem; }

.dqr-trigger {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--det-muted, #66756e);
    cursor: pointer;
    display: inline-flex;
    font: 600 .75rem/1.2 "Poppins", system-ui, sans-serif;
    gap: .42rem;
    padding: .42rem .62rem;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.dqr-trigger svg { height: 16px; width: 16px; }
.dqr-trigger:hover {
    background: rgba(92, 111, 92, .08);
    border-color: rgba(92, 111, 92, .16);
    color: var(--det-primary-dark, #2d5f4d);
}

.dqr-trigger:focus,
.dqr-trigger:focus-visible,
.dqr-close:focus,
.dqr-close:focus-visible,
.dqr-submit:focus,
.dqr-submit:focus-visible,
.dqr-option input:focus,
.dqr-option input:focus-visible,
.dqr-field textarea:focus,
.dqr-field textarea:focus-visible {
    outline: 2px solid var(--det-primary, #5c8a72);
    outline-offset: 2px;
}

.dqr-trigger.is-sent { color: #157347; cursor: default; }
.dqr-dialog-open { overflow: hidden; }
.dqr-backdrop, .dqr-backdrop * { box-sizing: border-box; }

.dqr-backdrop {
    align-items: center;
    background: rgba(19, 29, 24, .58);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 10050;
}

.dqr-dialog {
    background: #fff;
    border: 1px solid #dfe8e3;
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(15, 35, 25, .24);
    color: #17251f;
    font-family: "Poppins", system-ui, sans-serif;
    max-height: min(760px, calc(100vh - 2rem));
    max-width: 560px;
    overflow: auto;
    width: 100%;
}

.dqr-head {
    align-items: flex-start;
    border-bottom: 1px solid #e5ece8;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.25rem 1.3rem 1.05rem;
}

.dqr-kicker {
    color: #2f7d5f;
    display: block;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: .28rem;
    text-transform: uppercase;
}

.dqr-head h2 { color: inherit; font-size: 1.2rem; font-weight: 750; line-height: 1.25; margin: 0; }
.dqr-head p { color: #66756e; font-size: .78rem; line-height: 1.55; margin: .35rem 0 0; }

.dqr-close {
    align-items: center;
    background: #f3f7f5;
    border: 0;
    border-radius: 999px;
    color: #4d5e56;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 34px;
    height: 34px;
    justify-content: center;
    padding: 0;
    width: 34px;
}

.dqr-close svg { height: 17px; width: 17px; }
.dqr-form { display: grid; gap: 1rem; padding: 1.2rem 1.3rem 1.3rem; }
.dqr-field { border: 0; margin: 0; min-width: 0; padding: 0; }

.dqr-field legend,
.dqr-field > label {
    color: #32453b;
    display: block;
    font-size: .75rem;
    font-weight: 750;
    margin-bottom: .5rem;
}

.dqr-field > label span { color: #839088; font-weight: 500; }
.dqr-options { display: grid; gap: .42rem; }

.dqr-option {
    align-items: center;
    background: #f8faf9;
    border: 1px solid #e3eae6;
    border-radius: 10px;
    color: #32453b;
    cursor: pointer;
    display: flex;
    font-size: .78rem;
    gap: .6rem;
    padding: .65rem .72rem;
}

.dqr-option:has(input:checked) { background: #edf7f2; border-color: #76a890; }
.dqr-option input { accent-color: #2f7d5f; height: 16px; margin: 0; width: 16px; }

.dqr-field textarea {
    background: #fff;
    border: 1px solid #d8e2dc;
    border-radius: 10px;
    color: #17251f;
    font: 500 .78rem/1.5 "Poppins", system-ui, sans-serif;
    min-height: 96px;
    padding: .72rem;
    resize: vertical;
    width: 100%;
}

.dqr-field textarea::placeholder { color: #91a098; }
.dqr-actions { align-items: center; display: flex; gap: .8rem; justify-content: space-between; }
.dqr-message { color: #a04444; font-size: .72rem; line-height: 1.35; }

.dqr-submit {
    background: #2f7d5f;
    border: 0;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    flex: 0 0 auto;
    font: 700 .78rem "Poppins", system-ui, sans-serif;
    min-height: 40px;
    padding: .68rem 1rem;
}

.dqr-submit:hover { background: #225e47; }
.dqr-submit:disabled { cursor: wait; opacity: .65; }

body.dark-mode .dqr-trigger,
html[data-det-theme="dark"] .dqr-trigger { color: #aab8b0; }
body.dark-mode .dqr-trigger:hover,
html[data-det-theme="dark"] .dqr-trigger:hover {
    background: rgba(127, 168, 127, .13);
    border-color: rgba(127, 168, 127, .25);
    color: #cce0d1;
}

body.dark-mode .dqr-dialog,
html[data-det-theme="dark"] .dqr-dialog { background: #19211c; border-color: #34443b; color: #e8eee9; }
body.dark-mode .dqr-head,
html[data-det-theme="dark"] .dqr-head { border-color: #34443b; }
body.dark-mode .dqr-head p,
html[data-det-theme="dark"] .dqr-head p,
body.dark-mode .dqr-field > label span,
html[data-det-theme="dark"] .dqr-field > label span { color: #aab8b0; }

body.dark-mode .dqr-close,
html[data-det-theme="dark"] .dqr-close,
body.dark-mode .dqr-option,
html[data-det-theme="dark"] .dqr-option { background: #202a24; border-color: #34443b; color: #dbe8de; }
body.dark-mode .dqr-option:has(input:checked),
html[data-det-theme="dark"] .dqr-option:has(input:checked) {
    background: rgba(127, 168, 127, .14);
    border-color: #73977d;
}

body.dark-mode .dqr-field legend,
body.dark-mode .dqr-field > label,
html[data-det-theme="dark"] .dqr-field legend,
html[data-det-theme="dark"] .dqr-field > label { color: #dbe8de; }
body.dark-mode .dqr-field textarea,
html[data-det-theme="dark"] .dqr-field textarea {
    background: #131a16;
    border-color: #405248;
    color: #e8eee9;
}

@media (max-width: 560px) {
    .dqr-backdrop { align-items: flex-end; padding: 0; }
    .dqr-dialog {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        max-height: 92vh;
        max-height: 92dvh;
    }
    .dqr-head, .dqr-form { padding-left: 1rem; padding-right: 1rem; }
    .dqr-actions { align-items: stretch; flex-direction: column; }
    .dqr-submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .dqr-trigger { transition: none; }
}
