.zuruf-launcher {
    position: fixed;
    z-index: 45;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    min-width: 44px;
    min-height: 52px;
    padding: .7rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border: 1px solid #173426;
    border-radius: 7px;
    background: var(--green-deep);
    color: #fff;
    box-shadow: 0 12px 30px rgba(18, 36, 27, .24);
    font-weight: 700;
    text-decoration: none;
    touch-action: manipulation;
}

.zuruf-launcher:hover,
.zuruf-launcher:active { background: #173426; color: #fff; }
.zuruf-launcher svg { width: 1.35rem; height: 1.35rem; flex: none; fill: currentColor; }
.zuruf-launcher:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }

.zuruf-dialog { width: min(34rem, calc(100vw - 2rem)); height: min(46rem, calc(100dvh - 3rem)); }
.zuruf-dialog[open] { grid-template-rows: auto minmax(0, 1fr); }
.zuruf-dialog__body { padding-bottom: 1rem; display: flex; flex-direction: column; overscroll-behavior: contain; }
.zuruf-intro { padding: .9rem 1rem; border-left: 3px solid var(--green); background: var(--green-soft); }
.zuruf-intro p { margin: 0; }
.zuruf-intro p + p { margin-top: .35rem; color: var(--ink); font-size: .88rem; line-height: 1.45; }
.zuruf-thread,
.zuruf-page__result { min-width: 0; display: grid; gap: .8rem; }
.zuruf-thread { margin-top: 1rem; }
.zuruf-page__result:empty { display: none; }

.zuruf-user-message {
    max-width: 88%;
    margin-left: auto;
    padding: .75rem .9rem;
    border: 1px solid #b8c7bd;
    border-radius: 7px 7px 2px 7px;
    background: #edf3ef;
    overflow-wrap: anywhere;
}
.zuruf-user-message p { margin: 0; }
.zuruf-user-message .eyebrow { margin-bottom: .25rem; }

.zuruf-reply {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: var(--radius-surface);
    background: var(--surface);
    overflow-wrap: anywhere;
}
.zuruf-reply--proposal { border-left-color: var(--signal); background: #fffaf0; }
.zuruf-reply--error,
.zuruf-reply--unavailable { border-left-color: var(--red); background: var(--red-soft); }
.zuruf-reply--success { border-left-color: var(--green); background: var(--green-soft); }
.zuruf-reply > header { display: flex; align-items: flex-start; gap: .7rem; }
.zuruf-reply__mark { width: .7rem; height: .7rem; flex: none; margin-top: .28rem; border: 2px solid currentColor; border-radius: 50%; color: var(--green); }
.zuruf-reply--proposal .zuruf-reply__mark { color: #8a5a00; }
.zuruf-reply--error .zuruf-reply__mark,
.zuruf-reply--unavailable .zuruf-reply__mark { color: var(--red); }
.zuruf-reply h2,
.zuruf-reply h3,
.zuruf-reply p { margin: 0; }
.zuruf-reply h2,
.zuruf-reply h3 { font-size: 1.12rem; }
.zuruf-reply > p { margin-top: .65rem; line-height: 1.5; }
.zuruf-reply > .button { margin-top: .85rem; }
.zuruf-details { margin: .9rem 0 0; border-top: 1px solid var(--line); }
.zuruf-details div { min-width: 0; padding: .55rem 0; display: grid; grid-template-columns: minmax(6rem, .7fr) minmax(0, 1.3fr); gap: .7rem; border-bottom: 1px solid var(--line); }
.zuruf-details dt { color: var(--muted); font-size: .8rem; }
.zuruf-details dd { min-width: 0; margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.zuruf-reply__actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .65rem; }
.zuruf-reply__actions form { margin: 0; }
.zuruf-reply__actions .button { min-height: 44px; }

.zuruf-composer { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.zuruf-dialog .zuruf-composer { position: sticky; bottom: -1rem; margin-top: auto; padding-bottom: max(0rem, env(safe-area-inset-bottom)); background: var(--surface); }
.zuruf-composer label { display: block; margin-bottom: .45rem; font-weight: 700; }
.zuruf-composer textarea { min-height: 5.75rem; resize: vertical; }
.zuruf-composer__footer { margin-top: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.zuruf-composer__footer p { max-width: 25rem; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.zuruf-composer__footer .button { flex: none; min-height: 44px; }
.zuruf-busy { margin: .8rem 0 0; color: var(--green); font-weight: 700; }
.zuruf-busy[hidden] { display: none; }
.zuruf-full-page { margin: .7rem 0 0; text-align: center; }
.zuruf-full-page a { min-height: 44px; display: inline-flex; align-items: center; color: var(--green); font-weight: 700; }

.zuruf-page { width: min(100%, 62rem); margin-inline: auto; }
.zuruf-page__workspace { padding: clamp(1rem, 3vw, 1.75rem); }
.zuruf-page__result { margin-bottom: 1rem; }
.zuruf-boundary h2 { margin: 0; font-size: 1.1rem; }
.zuruf-boundary p { margin: .35rem 0 0; }

[data-zuruf-root][aria-busy] .zuruf-composer { opacity: .72; }

@media (max-width: 42.5rem) {
    .zuruf-launcher { right: max(.75rem, env(safe-area-inset-right)); bottom: max(.75rem, env(safe-area-inset-bottom)); }
    .zuruf-dialog { width: 100%; height: 100dvh; max-height: 100dvh; }
    .zuruf-dialog__body { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
    .zuruf-dialog .zuruf-composer { position: static; margin-top: 1rem; }
    .zuruf-composer__footer { align-items: stretch; flex-direction: column; }
    .zuruf-composer__footer .button,
    .zuruf-reply__actions form,
    .zuruf-reply__actions .button { width: 100%; }
    .zuruf-details div { grid-template-columns: 1fr; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .zuruf-launcher { scroll-behavior: auto; }
}

@media print {
    .zuruf-launcher,
    .zuruf-dialog { display: none !important; }
}
