/* Feedback widget: quiet launcher fixed bottom-right + small native <dialog> panel. Uses the page's theme variables. */
.fb-launch {
    position: fixed; z-index: 25;
    right: max(20px, calc(env(safe-area-inset-right) + 12px));
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 16px 0 14px; border-radius: 999px;
    background: var(--card); color: var(--text);
    border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    font: 600 0.92rem/1 Outfit, system-ui, sans-serif; cursor: pointer;
    transition: opacity 0.15s ease, visibility 0.15s;
}
html.light .fb-launch { box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14); }
.fb-launch svg { width: 18px; height: 18px; flex: none; }
.fb-launch:hover { border-color: color-mix(in srgb, var(--text) 35%, transparent); }
.fb-launch:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
/* Out of the way while it would sit over the timelines, the hot buttons or "+ Add a city", and while dragging. */
.fb-launch.fb-tucked, body:has(.stack.dragging) .fb-launch, .fb-launch[aria-expanded="true"] { opacity: 0; visibility: hidden; pointer-events: none; }
/* The fallback toast (no trigger button) sits above the launcher instead of under it. */
body.has-fb .toast:not(.anchored) { bottom: max(76px, calc(env(safe-area-inset-bottom) + 68px)); }

.fb-dialog {
    position: fixed; inset: auto max(20px, calc(env(safe-area-inset-right) + 12px)) max(20px, calc(env(safe-area-inset-bottom) + 12px)) auto;
    margin: 0; width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); overflow: auto;
    padding: 18px 18px 16px; border-radius: 16px;
    background: var(--card); color: var(--text); border: 1px solid var(--line);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
    font-family: Outfit, system-ui, sans-serif;
}
html.light .fb-dialog { box-shadow: 0 18px 44px rgba(15, 23, 42, 0.2); }
.fb-dialog::backdrop { background: rgba(6, 9, 19, 0.35); }
html.light .fb-dialog::backdrop { background: rgba(15, 23, 42, 0.18); }
@media (prefers-reduced-motion: no-preference) {
    .fb-dialog[open] { animation: fb-in 0.16s ease-out; }
    @keyframes fb-in { from { opacity: 0; transform: translateY(8px); } }
}
.fb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fb-head h2 { font-size: 1.05rem; line-height: 1.3; font-weight: 700; margin: 0; }
.fb-x {
    flex: none; width: 36px; height: 36px; margin: -6px -6px 0 0; border-radius: 10px;
    display: grid; place-items: center; background: transparent; color: var(--muted); border: 1px solid transparent; cursor: pointer;
}
.fb-x:hover { color: var(--text); border-color: var(--line); }
.fb-x:focus-visible { outline: 3px solid var(--text); outline-offset: 1px; }
.fb-x svg { width: 18px; height: 18px; }
.fb-form { display: grid; gap: 12px; }
.fb-field { display: grid; gap: 6px; }
.fb-field label { font-size: 0.88rem; font-weight: 600; }
.fb-field .fb-opt { color: var(--muted); font-weight: 400; }
.fb-form textarea, .fb-form input[type="email"] {
    width: 100%; font: inherit; font-size: 0.95rem; color: var(--text); background: var(--bg);
    border: 1px solid color-mix(in srgb, var(--text) 22%, transparent); border-radius: 10px; padding: 10px 12px;
}
.fb-form textarea { resize: vertical; min-height: 110px; line-height: 1.45; }
.fb-form textarea:focus-visible, .fb-form input[type="email"]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.fb-form :is(textarea, input):user-invalid { border-color: #ef4444; }
html.light .fb-form :is(textarea, input):user-invalid { border-color: #b91c1c; }
.fb-err { display: none; color: #fca5a5; font-size: 0.82rem; }
html.light .fb-err { color: #b91c1c; }
.fb-form :is(textarea, input):user-invalid ~ .fb-err { display: block; }
.fb-form [aria-invalid="true"] { border-color: #ef4444; }
html.light .fb-form [aria-invalid="true"] { border-color: #b91c1c; }
.fb-form [aria-invalid="true"] ~ .fb-err { display: block; }
.fb-count { color: var(--muted); font-size: 0.78rem; justify-self: end; font-variant-numeric: tabular-nums; }
.fb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fb-note { color: var(--muted); font-size: 0.8rem; line-height: 1.4; margin: 0; }
.fb-note a, .fb-status a { color: inherit; text-underline-offset: 3px; }
.fb-send {
    justify-self: stretch; min-height: 44px; border-radius: 12px; border: 1px solid transparent;
    background: var(--text); color: var(--card); font: 700 0.95rem/1 Outfit, system-ui, sans-serif; cursor: pointer;
}
.fb-send:hover { opacity: 0.92; }
.fb-send:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.fb-send[disabled] { opacity: 0.6; cursor: progress; }
.fb-status { font-size: 0.88rem; line-height: 1.45; margin: 0; }
.fb-status:empty { display: none; }
.fb-status.fb-bad { color: #fca5a5; }
html.light .fb-status.fb-bad { color: #b91c1c; }
.fb-done { display: grid; gap: 14px; }
.fb-done p { margin: 0; line-height: 1.5; }
.fb-done[hidden], .fb-form[hidden] { display: none; }

@media (max-width: 600px) {
    .fb-launch {
        width: 48px; height: 48px; min-height: 48px; padding: 0; justify-content: center;
        right: max(12px, calc(env(safe-area-inset-right) + 8px)); bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px));
    }
    .fb-launch svg { width: 22px; height: 22px; }
    .fb-launch .fb-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    body.has-fb .toast:not(.anchored) { bottom: max(72px, calc(env(safe-area-inset-bottom) + 68px)); }
    .fb-dialog {
        inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px; width: auto; max-width: none;
        max-height: calc(100dvh - 16px); border-radius: 18px;
    }
}
