/* ── Error banner ─────────────────────────────────────────── */
.chat-error {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 12px;
    margin: 12px 16px 0;
    padding: 10px 14px;
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: var(--r-lg);
    font-size: 13px; line-height: 1.4;
    color: var(--red); flex-shrink: 0;
}
.chat-error__dismiss {
    border: none; background: transparent;
    font-size: 13px; font-weight: 600;
    color: var(--red); cursor: pointer; flex-shrink: 0; padding: 0;
}

/* ── Chat body ────────────────────────────────────────────── */
.chat-body {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column;
    padding: 20px 20px 28px;
    background: transparent; position: relative;
    scrollbar-width: none;
}
.chat-body::-webkit-scrollbar { display: none; }

/* ── Floating prompt items ────────────────────────────────── */
.prompt-float__item {
    position: absolute;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px; font-weight: 400;
    color: var(--green);
    text-transform: capitalize;
    white-space: nowrap; pointer-events: none; user-select: none;
    overflow: hidden; clip-path: inset(0 100% 0 0);
    animation: float-type-in 1.5s steps(38, end) forwards;
    z-index: 0; opacity: 0;
}
.prompt-float__item::after {
    content: '▋'; font-size: 12px; vertical-align: baseline;
    opacity: 0; animation: float-cursor 0.75s step-end infinite; animation-delay: 1.5s;
}
.prompt-float__item--exit { animation: float-fade-out 0.4s ease-out forwards !important; }
.prompt-float__item--exit::after { animation: none !important; opacity: 0 !important; }

@keyframes float-type-in {
    0%   { clip-path: inset(0 100% 0 0); opacity: 0; }
    4%   { opacity: 0.22; }
    100% { clip-path: inset(0 0% 0 0); opacity: 0.22; }
}
@keyframes float-fade-out {
    from { opacity: 0.22; } to { opacity: 0; }
}
@keyframes float-cursor {
    0%, 100% { opacity: 0.45; } 50% { opacity: 0; }
}

/* ── Context trim notice ──────────────────────────────────── */
.context-trim-notice {
    text-align: center; font-size: 12px;
    color: var(--grey-light); padding: 5px 14px;
    border: 1px dashed var(--border); border-radius: var(--r-pill);
    margin-bottom: 12px; align-self: center;
}

/* ── Message actions & indicators ────────────────────────── */
.msg-bubble {
    font-size: 14px; line-height: 1.55;
    white-space: pre-wrap; word-break: break-word;
}

.output-card .msg-bubble { max-width: 100%; }

.msg-actions {
    display: flex; gap: 8px; margin-top: 4px;
}
.msg-action-btn {
    display: inline-flex; align-items: center;
    justify-content: center; gap: 5px;
    padding: 7px 12px; min-height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: transparent; color: var(--grey);
    font-size: 12px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.msg-action-btn:hover:not(:disabled) {
    background: var(--tint); border-color: var(--green); color: var(--green);
}
.msg-action-btn:disabled { opacity: 0.35; cursor: default; }
.msg-action-btn--done { background: var(--tint); color: var(--green); border-color: var(--green); }

.typing-indicator { color: var(--grey-light); font-style: italic; font-size: 14px; }

.cursor-blink { animation: blink 1s step-end infinite; margin-left: 1px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Stop / Mic / Send buttons ────────────────────────────── */
.btn-stop {
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 6px 14px; font-size: 13px; font-weight: 600;
    background: #fff; color: var(--ink); cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn-stop:hover { background: var(--tint); border-color: var(--green); color: var(--green); }

.btn-mic {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--border); background: transparent;
    color: var(--grey); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.btn-mic:hover:not(:disabled) { background: var(--tint); border-color: var(--green); color: var(--green); }
.btn-mic--active { background: var(--green); border-color: var(--green); color: #fff; }
.btn-mic:disabled { opacity: 0.38; cursor: default; }

.btn-send {
    width: 44px; height: 44px; border-radius: 50%;
    border: none; background: var(--disabled); color: var(--grey-light);
    display: flex; align-items: center; justify-content: center;
    cursor: default; flex-shrink: 0; transition: background 0.12s;
}
.btn-send--active { background: var(--green); color: #fff; cursor: pointer; }
.btn-send--active:hover { opacity: 0.88; }

/* ── Composer center wrap & hero ──────────────────────────── */
.prompt-center-wrap {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    gap: 16px; width: 100%; position: relative;
}

.composer-hero {
    position: absolute; left: 0; right: 0;
    top: 50%; transform: translateY(calc(-100% - 200px));
    text-align: center; z-index: 1;
    pointer-events: none; user-select: none;
}
.composer-hero__title {
    font-size: clamp(48px, 6.5vw, 76px);
    font-weight: 700; color: var(--green);
    letter-spacing: -0.03em; line-height: 1;
    margin: 0 0 12px; outline: none;
}
.composer-hero__sub {
    font-size: 15px; font-weight:600;
    color: rgba(0,85,0,0.72);
    line-height: 1.6; margin: 0;
}

/* ── Brand side tab ───────────────────────────────────────── */
.brand-fab {
    position: fixed; top: 50%; right: 0;
    transform: translateY(-50%);
    background: rgba(0,82,0,0.85); color: rgba(255,255,255,1);
    border: none; border-radius: 8px 0 0 8px;
    padding: 18px 8px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.2em; text-transform: uppercase;
    writing-mode: vertical-lr; pointer-events: none;
    cursor: default; z-index: 10;
    user-select: none; white-space: nowrap;
}
.brand-fab span { display: block; transform: rotate(180deg); }

/* ── Prompt input area ────────────────────────────────────── */
.prompt-input-area {
    max-width: 860px; width: 100%; margin: 0 auto;
    padding: 18px 20px 14px;
    display: flex; flex-direction: column; gap: 10px;
    background: var(--white);
    border: 2px solid var(--green);
    border-radius: var(--r-lg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.45);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.prompt-input-area:focus-within {
    box-shadow: 0 0 18px 5px rgba(6,82,16,0.15), 0 1px 2px rgba(0,0,0,0.45);
}

.prompt-textarea {
    width: 100%; height: 160px; resize: none;
    overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none;
    border: none; padding: 0;
    font-family: inherit; font-size: 14px; font-weight: 500;
    line-height: 1.35; color: var(--ink);
    background: transparent; outline: none;
}
.prompt-textarea::-webkit-scrollbar { display: none; }
.prompt-textarea::placeholder { color: var(--grey-light); }

.composer-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center; gap: 8px;
    padding-top: 8px; border-top: 1px solid var(--border);
}

.composer-left {
    flex: 1; display: flex; align-items: center;
    gap: 8px; min-width: 0;
}
.composer-model {
    font-size: 11px; font-weight: 600;
    color: var(--grey-light); text-transform: capitalize;
    white-space: nowrap; user-select: none; flex-shrink: 0;
}
.composer-fw-trigger {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px 3px 7px;
    border: 1px solid var(--border); border-radius: var(--r-pill);
    background: transparent; font: inherit;
    font-size: 11px; font-weight: 600; color: var(--grey);
    cursor: pointer; transition: border-color 0.12s, color 0.12s;
    white-space: nowrap;
}
.composer-fw-trigger:hover:not(:disabled) { border-color: var(--green); color: var(--green); background-color: var(--tint); }
.composer-fw-picker--open .composer-fw-trigger { border-color: var(--green); color: var(--green); }
.composer-fw-trigger:disabled { cursor: default; pointer-events: none; }
.composer-fw-dot {
    width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.composer-fw-label {
    font-size: 11px; font-weight: 600; color: inherit; white-space: nowrap;
}
.composer-fw-chevron {
    color: currentColor; flex-shrink: 0;
    transition: transform 0.18s ease;
}
.composer-fw-picker--open .composer-fw-chevron { transform: rotate(180deg); }
.composer-fw-picker { position: relative; }
.composer-fw-backdrop {
    position: fixed; inset: 0; z-index: 9;
}
.composer-fw-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    z-index: 10;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    padding: 4px;
    min-width: 150px;
    margin: 0;
}
.composer-fw-option {
    display: flex; align-items: center; gap: 7px;
    width: 100%; padding: 7px 10px;
    border: none; background: transparent;
    font: inherit; font-size: 11px; font-weight: 600;
    color: var(--ink); text-align: left; cursor: pointer;
    border-radius: var(--r-sm);
    transition: background 0.1s, color 0.1s;
}
.composer-fw-option:hover:not(.composer-fw-option--active) {
    background: var(--tint);
    color: var(--green);
}
.composer-fw-option--active { background: var(--green); color: #fff; }
.composer-fw-option--active .composer-fw-option__dot { outline: 2px solid rgba(255,255,255,0.45); }
.composer-fw-option__dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}

.composer-hint {
    font-size: 11px; color: var(--grey-light);
    text-align: center; white-space: nowrap;
}
.composer-btns {
    display: flex; align-items: center; justify-content: flex-end; gap: 6px;
}

/* ── Deliver selector ─────────────────────────────────────── */
.deliver-selector {
    display: flex; width: fit-content; margin: 0 auto;
    background: #F5F5F5; border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 3px; gap: 2px;
}
.deliver-pill {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 4px; font-size: 11px; font-weight: 600; font-family: inherit;
    border-radius: var(--r-md); border: none; background: transparent;
    color: var(--grey); padding: 8px 14px; min-height: 36px;
    cursor: pointer; transition: background 0.12s, color 0.12s;
    white-space: nowrap; user-select: none;
}
.deliver-pill--active { background: var(--green); color: #fff; }
.deliver-pill:hover:not(:disabled):not(.deliver-pill--active) { background: var(--tint); color: var(--green); }
.deliver-pill--soon { opacity: 0.35; cursor: default; }
.deliver-pill__badge { font-size: 9px; font-weight: 700; opacity: 0.7; margin-left: 2px; }

/* ── Output area ──────────────────────────────────────────── */
.output-center-wrap {
    flex: 1; display: flex; flex-direction: column; justify-content: flex-start;
}
.output-area-row {
    display: flex; flex-direction: row;
    align-items: flex-start; justify-content: center;
    gap: 12px; width: 100%;
}
.output-cards-wrap {
    flex: 0 1 860px; display: flex; flex-direction: column;
    gap: 16px; min-width: 0;
}
.output-area-row:has(.perfect-panel) .output-cards-wrap { flex: 0 1 740px; }

/* ── Output card ──────────────────────────────────────────── */
.output-card {
    max-width: 860px; width: 100%; margin: 0 auto;
    padding: 18px 20px;
    display: flex; flex-direction: column; gap: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.output-card--prev { border-color: #EEEEEE; box-shadow: none; opacity: 0.6; }

.output-card__actions {
    border-top: 1px solid var(--border);
    padding-top: 10px; margin-top: 2px;
    display: flex; gap: 8px;
}

.output-meta {
    display: flex; align-items: center;
    gap: 8px; flex-wrap: wrap;
}
.meta-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; border-radius: var(--r-sm);
    background: var(--tint);
    color: var(--ink); padding: 2px 9px 2px 7px;
    user-select: none; white-space: nowrap;
}
.meta-pill__label { font-weight: 400; opacity: 0.8; }
.meta-pill__value { font-weight: 600; color: var(--green); text-transform: capitalize; }

.output-stop-area { display: flex; justify-content: flex-start; }

/* ── Card & panel grow-from-center animation ──────────────── */
@keyframes grow-from-center {
    from { transform: scaleY(0.04); opacity: 0; }
    to   { transform: scaleY(1);    opacity: 1; }
}

.output-card--streaming {
    transform-origin: center;
    animation: grow-from-center 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.perfect-panel {
    transform-origin: center;
    animation: grow-from-center 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.perfect-panel__body {
    transform-origin: top;
    animation: grow-from-center 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Markdown output ──────────────────────────────────────── */
.md-output { font-size: 14px; white-space: normal; line-height: 1.35; }
.md-output p { margin-bottom: 0.5em; }
.md-output p:last-child { margin-bottom: 0; }
.md-output h1, .md-output h2, .md-output h3, .md-output h4 {
    font-weight: 500; margin: 0.9em 0 0.35em; line-height: 1.3;
}
.md-output h1 { font-size: 1.2em; }
.md-output h2 { font-size: 1.07em; }
.md-output h3 { font-size: 1em; }
.md-output ul, .md-output ol { padding-left: 1.4em; margin-bottom: 0.65em; }
.md-output li { margin-bottom: 0.2em; }
.md-output li:last-child { margin-bottom: 0; }
.md-output code {
    font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
    font-size: 0.87em; background: rgba(0,82,0,0.07);
    color: var(--green); padding: 0.1em 0.35em; border-radius: 4px;
}
.md-output pre {
    background: #1A1A1A; color: #fff;
    border-radius: var(--r-md); padding: 12px 14px;
    overflow-x: auto; margin: 0.65em 0;
    font-family: ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
    font-size: 0.87em; line-height: 1.55;
}
.md-output pre code { background: none; color: inherit; padding: 0; border-radius: 0; }
.md-output blockquote {
    border-left: 3px solid var(--border);
    margin: 0.65em 0; padding: 0.1em 0 0.1em 1em; color: var(--grey);
}
.md-output table { border-collapse: collapse; width: 100%; margin: 0.65em 0; font-size: 0.92em; display: block; overflow-x: auto; }
.md-output th, .md-output td { border: 1px solid var(--border); padding: 5px 10px; text-align: left; }
.md-output th { background: #F5F5F5; font-weight: 700; }
.md-output a { color: var(--green); text-decoration: underline; }
.md-output hr { border: none; border-top: 1px solid var(--border); margin: 0.9em 0; }
.md-output input[type="checkbox"] { margin-right: 0.35em; }
.md-streaming { white-space: pre-wrap; }
.md-output--before { color: var(--grey); opacity: 0.72; }

/* ── Before / Refined toggle ──────────────────────────────── */
.before-after-toggle { display: flex; gap: 4px; margin-left: auto; flex-shrink: 0; }
.baf-tab {
    padding: 3px 10px; border-radius: var(--r-sm);
    border: 1px solid var(--border); background: transparent;
    font: inherit; font-size: 11px; font-weight: 600;
    color: var(--grey); opacity: 0.5; cursor: pointer;
    transition: background 0.1s, border-color 0.1s, opacity 0.4s, color 0.1s;
}
.baf-tab:hover { opacity: 0.8; }
.baf-tab--active { background: var(--tint); border-color: var(--green); color: var(--green); opacity: 1; }
.baf-tab--original-active {
    background: #fff7eb;
    border-color: #ffe7c0;
    color: #dd8b05;
    opacity: 1;
}

/* ── Perfect your prompt panel ────────────────────────────── */
.perfect-panel {
    width: 340px; flex-shrink: 0;
    display: flex; flex-direction: column;
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}
.perfect-panel__header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; background: var(--pale);
    border: none; cursor: pointer; font: inherit;
    text-align: left; width: 100%;
    transition: background 0.12s;
}
.perfect-panel__header:hover { background: var(--tint); }
.perfect-panel--open .perfect-panel__header { border-bottom: 1px solid var(--border); }

.perfect-panel__header-icon { color: var(--green); flex-shrink: 0; line-height: 0; }
.perfect-panel__header-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perfect-panel__title { font-size: 13px; font-weight: 700; color: var(--green); line-height: 1.2; }
.perfect-panel__desc { font-size: 11px; font-weight: 400; color: var(--grey); line-height: 1.4; }

.perfect-panel__chevron {
    flex-shrink: 0; color: var(--grey-light); opacity: 0.7;
    transition: transform 0.18s ease;
}
.perfect-panel__chevron--open { transform: rotate(180deg); opacity: 1; }

.perfect-panel__spinner {
    width: 14px; height: 14px;
    border: 1.5px solid var(--border); border-top-color: var(--green);
    border-radius: 50%; flex-shrink: 0;
    animation: perfect-spin 0.6s linear infinite;
}
@keyframes perfect-spin { to { transform: rotate(360deg); } }

.perfect-panel__body {
    padding: 4px 16px 16px;
    display: flex; flex-direction: column;
}
.perfect-question { padding: 12px 0; border-bottom: 1px solid var(--border); }
.perfect-question:last-of-type { border-bottom: none; padding-bottom: 4px; }

.perfect-question__label { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.perfect-question__num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%;
    background: #F5F5F5; border: 1px solid var(--border);
    color: var(--grey); font-size: 10px; font-weight: 700;
    flex-shrink: 0; margin-top: 1px;
}
.perfect-question--answered .perfect-question__num {
    background: var(--green); border-color: var(--green); color: #fff;
}
.perfect-question__text { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }

.perfect-question__body { display: flex; flex-direction: column; gap: 4px; padding-left: 26px; }

.perfect-option {
    width: 100%; padding: 9px 10px; min-height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--r-md); background: transparent;
    color: var(--ink); font: inherit; font-size: 12px; font-weight: 400;
    text-align: left; cursor: pointer;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
    display: flex; align-items: center; gap: 8px;
}
.perfect-option:hover:not(.perfect-option--selected) {
    background: var(--tint); border-color: var(--green); color: var(--green);
}
.perfect-option--selected { background: var(--green); border-color: var(--green); color: #fff; }

.perfect-option__radio {
    width: 14px; height: 14px; border-radius: 50%;
    border: 1.5px solid var(--border); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.1s;
}
.perfect-option--selected .perfect-option__radio { border-color: rgba(255,255,255,0.6); }
.perfect-option--selected .perfect-option__radio::after {
    content: ''; width: 6px; height: 6px;
    border-radius: 50%; background: #fff; display: block;
}
.perfect-option__label { flex: 1; line-height: 1.3; }

.perfect-option-input {
    width: 100%; border: none; border-bottom: 1px solid var(--border);
    padding: 6px 0; font: inherit; font-size: 12px; font-weight: 400;
    color: var(--ink); background: transparent; outline: none;
    transition: border-color 0.15s; margin-top: 2px;
}
.perfect-option-input:focus { border-bottom-color: var(--green); }
.perfect-option-input::placeholder { color: var(--grey-light); font-style: italic; }

.perfect-panel__readonly-note { margin: 0 0 10px; font-size: 11px; color: var(--grey); font-style: italic; }
.perfect-panel__refine {
    margin-top: 14px; width: 100%; padding: 10px 14px;
    background: var(--green); color: #fff; border: none;
    border-radius: var(--r-md); font: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; gap: 5px; transition: opacity 0.12s;
}
.perfect-panel__refine:hover:not(:disabled) { opacity: 0.88; }
.perfect-panel__refine:disabled { opacity: 0.38; cursor: default; }

/* ── Coming soon popup ────────────────────────────────────── */
.coming-soon-popup {
    position: fixed; bottom: 72px; left: 50%;
    transform: translateX(-50%);
    background: var(--red); color: #fff;
    font-size: 12px; font-weight: 600;
    padding: 6px 14px; border-radius: var(--r-sm);
    white-space: nowrap; pointer-events: none;
    z-index: 2000;
    animation: coming-soon-in 0.15s ease;
}
@keyframes coming-soon-in {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Motion preferences ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .prompt-float__item,
    .prompt-float__item::after,
    .cursor-blink,
    .perfect-panel__spinner,
    .coming-soon-popup { animation: none !important; }
    .prompt-float__item { opacity: 0.22; clip-path: none; }
}

/* ── Responsive ───────────────────────────────────────────── */

/* Desktop-wide (≤ 1100px): output panel stacks vertically */
@media (max-width: 1100px) {
    .output-area-row { flex-direction: column; align-items: center; }
    .perfect-panel { width: 100%; max-width: 860px; }
    .output-area-row:has(.perfect-panel) .output-cards-wrap { flex: 0 1 860px; }
}

/* Tablet (≤ 1024px): trim lower float rows, slightly compact hero */
@media (max-width: 1024px) {
    .chat-body > .prompt-float__item:nth-child(n+8) { display: none; }
    .composer-hero__sub { font-size: 13px; line-height: 1.5; }
    .brand-fab { display: none; }
}

/* Mobile (≤ 767px): sidebar overlay, hide floats, compact layout */
@media (max-width: 767px) {
    /* Floating background items — too cramped on narrow screens */
    .prompt-float__item { display: none !important; }

    /* Composer hero */
    .composer-hero__sub { display: none; }
    .composer-hero__title { font-size: clamp(32px, 8vw, 52px); }

    /* Chat body — push content below the absolute-positioned hamburger (58px) and topbar (40px) */
    .chat-body { padding: 72px 12px 20px; }

    /* Input area */
    .prompt-input-area { padding: 14px 14px 12px; border-radius: var(--r-lg); width: calc(100% - 32px); }
    .prompt-textarea { height: 120px; }
    .composer-hint { display: none; }
    /* Composer actions: stack deliver selector above send row on very small widths */
    .composer-actions { grid-template-columns: auto 1fr auto; gap: 6px; }

    /* Output area — more breathing room between perfect panel and output cards when stacked */
    .output-area-row { gap: 20px; }
    .output-cards-wrap { gap: 12px; }

    /* Output cards */
    .output-card { padding: 14px; border-radius: var(--r-lg); }
    .output-card__actions { flex-wrap: wrap; gap: 6px; }

    /* Message actions */
    .msg-actions { gap: 6px; flex-wrap: wrap; }

    /* Before/after toggle: allow wrapping beside meta pills */
    .output-meta { row-gap: 6px; }

    /* Deliver selector: smaller gap on mobile */
    .deliver-selector { padding: 2px; gap: 1px; }
    .deliver-pill { padding: 7px 10px; font-size: 11px; }
}

/* Pocket (≤ 480px): tightest sizing */
@media (max-width: 480px) {
    .composer-hero__title { font-size: clamp(26px, 8vw, 38px); }
    .prompt-input-area { padding: 10px 12px 10px; width: calc(100% - 24px); }
    .prompt-textarea { height: 100px; }
    .output-card { padding: 12px; gap: 8px; }
    /* Push below hamburger (8+40=48px) + buffer */
    .chat-body { padding: 60px 10px 16px; }
    .perfect-panel__refine { padding: 11px 14px; font-size: 13px; }
}
