:root {
    --ink: #25322f;
    --muted: #687571;
    --paper: #fbfaf6;
    --surface: #ffffff;
    --line: #dde4df;
    --moss: #386b5a;
    --moss-dark: #285044;
    --moss-pale: #eaf3ee;
    --amber: #d79943;
    --danger: #9b3b33;
    --danger-dark: #7e2e28;
    --danger-pale: #fbefed;
    --user: #f0eee7;
    --shadow: 0 18px 55px rgba(40, 64, 56, 0.10);
}

* { box-sizing: border-box; }

html, body {
    min-height: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: "Nunito", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.6;
}

a { color: var(--moss); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(56, 107, 90, 0.18); outline-offset: 3px; }
img, svg, video { max-width: 100%; height: auto; }
p, li, h1, h2, h3, strong, small, label, a { overflow-wrap: anywhere; }

.site-header {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(251, 250, 246, 0.92);
    backdrop-filter: blur(14px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark, .large-mark {
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(145deg, var(--moss), #62a083);
    border-radius: 50%;
    font-family: "Nunito", ui-rounded, sans-serif;
    font-weight: 800;
}

.brand-mark { width: 34px; height: 34px; font-size: 19px; }
.large-mark { width: 66px; height: 66px; margin: 0 auto 20px; font-size: 38px; }
.brand strong, .brand small { display: block; line-height: 1.25; }
.brand small { color: var(--muted); font-size: 11px; }

.account-nav { display: flex; align-items: center; justify-content: flex-end; gap: 18px; min-width: 0; color: var(--muted); font-size: 14px; }
.account-nav form { margin: 0; }
.text-button { border: 0; padding: 0; color: var(--moss); background: none; }

.primary-button, .secondary-button {
    min-height: 48px;
    padding: 11px 19px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    text-decoration: none;
}

.primary-button { color: white; background: var(--moss); }
.primary-button:hover { background: var(--moss-dark); }
.primary-button:disabled { cursor: wait; opacity: 0.55; }
.secondary-button { color: var(--moss); background: var(--surface); border-color: var(--line); }
.inline-button { display: inline-flex; align-items: center; }
.full-width { width: 100%; }

.eyebrow {
    margin: 0 0 8px;
    color: var(--moss);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lede { max-width: 58ch; color: var(--muted); font-size: 19px; line-height: 1.55; }
.auth-shell, .welcome-shell { min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); display: grid; place-items: center; padding: clamp(22px, 5vw, 54px) clamp(18px, 4vw, 36px); }
.auth-card, .welcome-card { width: min(100%, 700px); min-width: 0; padding: clamp(28px, 6vw, 48px); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.auth-card h1, .welcome-card h1 { max-width: 19ch; margin: 0; font-size: clamp(32px, 6vw, 48px); font-weight: 800; line-height: 1.12; letter-spacing: -0.025em; }
.centered-card { text-align: center; }
.stacked-form { display: grid; gap: 9px; margin-top: 28px; }
.stacked-form input { width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px; border: 1px solid #cbd6d0; border-radius: 10px; background: #fff; font-size: 17px; }
.stacked-form input:focus, textarea:focus { outline: 3px solid rgba(56, 107, 90, 0.14); border-color: var(--moss); }
.stacked-form .primary-button { margin-top: 12px; }
.help-text, .auth-foot, .usage-note { color: var(--muted); font-size: 14px; }
.errorlist, .form-error { color: #9b3b33; }

.credit-summary { display: inline-flex; align-items: center; gap: 7px; margin: 5px 0 20px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: #fcfdfb; font-size: 14px; }
.credit-summary strong { color: var(--ink); font-size: 17px; }
.credit-summary.low { border-color: #e5c997; color: #7a5725; background: #fff9ee; }
.credit-summary.low strong { color: #714c18; }
.credit-summary.negative { border-color: #e1b8b3; color: var(--danger); background: var(--danger-pale); }
.credit-summary.negative strong { color: var(--danger); }

.conversation-grid { display: grid; gap: 10px; margin-top: 32px; }
.conversation-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 16px; min-width: 0; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.conversation-card:hover { border-color: #a9bcb2; background: var(--moss-pale); }
.conversation-card small { color: var(--muted); white-space: nowrap; }
.about-gus { margin-top: 34px; padding: clamp(22px, 5vw, 30px); border: 1px solid #cadbd2; border-radius: 18px; background: linear-gradient(145deg, #f2f8f4, #fbfaf6); }
.about-gus-layout { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 18px; align-items: start; }
.about-gus-photo { display: block; width: 76px; height: 76px; object-fit: cover; border: 3px solid rgba(255, 255, 255, 0.88); border-radius: 50%; box-shadow: 0 4px 16px rgba(42, 61, 54, 0.14); }
.about-gus-copy { min-width: 0; }
.about-gus h2 { max-width: 24ch; margin: 0 0 14px; color: var(--moss); font-size: clamp(24px, 4vw, 30px); line-height: 1.2; }
.about-gus p:not(.eyebrow) { max-width: 62ch; margin: 0 0 0.8em; }
.about-gus .about-gus-tagline { margin: -7px 0 16px; color: var(--ink); font-size: 17px; font-weight: 800; }
.about-gus p:last-child { margin-bottom: 0; }
.friendly-aside { color: var(--muted); }

.chat-shell { display: grid; grid-template-columns: clamp(240px, 20vw, 280px) minmax(0, 1fr); min-width: 0; height: calc(100vh - 56px); height: calc(100dvh - 56px); min-height: 0; overflow: hidden; }
.conversation-sidebar { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; padding: 14px 12px 12px; border-right: 1px solid var(--line); background: #f5f4ef; }
.conversation-sidebar > form { flex: 0 0 auto; }
.conversation-sidebar > form .secondary-button { min-height: 42px; padding: 8px 14px; font-size: 14px; }
.conversation-list { display: grid; min-height: 0; gap: 3px; margin: 10px -2px 0; padding: 2px 2px 12px; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
.conversation-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 13px; line-height: 1.3; }
.conversation-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-link small { color: var(--muted); font-size: 11px; line-height: 1; white-space: nowrap; }
.conversation-link:hover, .conversation-link.active { background: var(--surface); box-shadow: 0 3px 14px rgba(45, 70, 61, 0.08); }
.sidebar-usage { display: flex; align-items: center; flex: 0 0 auto; gap: 5px; margin: 8px 0 0; padding: 9px 10px; color: var(--muted); font-size: 12px; }
.sidebar-usage strong { margin-left: 1px; color: var(--ink); }
.sidebar-usage.low { border: 1px solid #e5c997; border-radius: 9px; color: #7a5725; background: #fff9ee; }
.sidebar-usage.low strong { color: #714c18; }
.sidebar-usage.negative { border-color: #e1b8b3; color: var(--danger); background: var(--danger-pale); }
.sidebar-usage.negative strong { color: var(--danger); }

.conversation-pane { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); min-width: 0; min-height: 0; height: 100%; overflow: hidden; background: var(--surface); }
.conversation-pane > * { width: 100%; min-width: 0; }
.conversation-header { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 14px; padding: 6px clamp(18px, 3vw, 36px); border-bottom: 1px solid var(--line); }
.conversation-heading { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.conversation-header .eyebrow { flex: 0 0 auto; margin: 0; font-size: 9px; white-space: nowrap; }
.conversation-header h1 { max-width: none; min-width: 0; overflow: hidden; margin: 0; font-size: 16px; font-weight: 800; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.conversation-header.admin-review-header { min-height: 64px; }
.conversation-header.admin-review-header .conversation-heading { display: block; }
.conversation-header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; min-width: 0; }
.conversation-menu { position: relative; }
.conversation-menu summary { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font-size: 17px; font-weight: 800; letter-spacing: 0.08em; list-style: none; cursor: pointer; }
.conversation-menu-dots { color: #73817c; font-size: 13px; font-weight: 600; letter-spacing: 0.03em; line-height: 1; transform: translateY(-1px); }
.conversation-menu summary:hover .conversation-menu-dots, .conversation-menu summary:focus-visible .conversation-menu-dots, .conversation-menu[open] .conversation-menu-dots { color: var(--ink); }
.conversation-menu summary::-webkit-details-marker { display: none; }
.conversation-menu[open] summary { border-color: #afc3b8; background: var(--moss-pale); }
.admin-review-note { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.admin-review-note a { color: var(--moss-dark); font-weight: 800; }
.admin-review-footer { padding: 13px clamp(28px, 5vw, 72px) max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); background: var(--moss-pale); font-size: 12px; font-weight: 750; line-height: 1.4; }
.conversation-menu-popover { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; display: grid; width: min(260px, calc(100vw - 32px)); padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.menu-action { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 11px 12px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; text-decoration: none; font-size: 14px; line-height: 1.35; }
.menu-icon { display: inline-grid; width: 18px; flex: 0 0 18px; place-items: center; color: var(--muted); font-size: 17px; }
.menu-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.menu-action:hover { background: var(--moss-pale); }
.danger-action { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; color: var(--danger); }
.danger-action .menu-icon { color: var(--danger); }
.danger-action:hover { background: var(--danger-pale); }

.message-list { min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: clamp(18px, 2.5vh, 28px) clamp(24px, 4vw, 56px) 28px; scroll-behavior: smooth; }
.message-list.is-empty { display: grid; place-items: center; overflow-y: hidden; padding-top: 28px; padding-bottom: 28px; }
.empty-conversation { width: min(100%, 560px); margin: 0 auto; transform: translateY(-1vh); text-align: center; color: var(--muted); }
.empty-conversation .large-mark { width: 60px; height: 60px; margin-bottom: 14px; font-size: 34px; }
.empty-conversation h2 { margin: 0; color: var(--ink); font-size: 30px; font-weight: 800; line-height: 1.2; }
.empty-conversation p { max-width: 44ch; margin: 12px auto 0; font-size: 18px; line-height: 1.5; }
.empty-invitation-next { display: block; margin-top: 0.16em; }
.message { width: min(100%, 900px); min-width: 0; margin: 0 auto 22px; }
.message-label { margin: 0 0 5px 3px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.message-bubble { padding: 16px 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 4px 16px rgba(42, 61, 54, 0.045); }
.message.user .message-bubble { background: var(--user); border-color: transparent; }
.message-content { max-width: 74ch; min-width: 0; font-size: 17px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.message-content p { margin: 0 0 0.8em; }
.message-content p:last-child { margin-bottom: 0; }
.message-content .tapping-point { margin-bottom: 0.12em; line-height: 1.48; }
.message-content h2, .message-content h3 { margin: 1.2em 0 0.45em; font-family: "Nunito", ui-rounded, sans-serif; font-weight: 800; line-height: 1.3; }
.message-content code { white-space: break-spaces; overflow-wrap: anywhere; }
.message-content .blank-line { height: 0.55em; }
.citations { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.citations summary { cursor: pointer; color: var(--moss); font-weight: 700; }
.citations ol { margin-bottom: 0; padding-left: 24px; }
.message-usage { position: relative; display: flex; align-items: center; gap: 6px; margin-top: 12px; color: #87928e; font-size: 11px; }
.usage-info { position: relative; }
.message-usage > .usage-info { transform: translateY(-1px); }
.usage-info summary { display: grid; width: 13px; height: 13px; place-items: center; border: 1px solid #aebbb6; border-radius: 50%; color: #75827d; font-size: 8px; font-weight: 800; line-height: 1; list-style: none; cursor: pointer; }
.usage-info summary::-webkit-details-marker { display: none; }
.usage-info[open] summary { color: var(--moss-dark); border-color: var(--moss); background: var(--moss-pale); }
.usage-info-popover { position: absolute; z-index: 20; bottom: calc(100% + 7px); left: 0; width: min(330px, calc(100vw - 48px)); padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-size: 12px; line-height: 1.4; }
.usage-info-popover dl { display: grid; gap: 8px; margin: 0; }
.usage-info-popover dl div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
.usage-info-popover dt { font-weight: 800; }
.usage-info-popover dd { margin: 0; color: var(--muted); }
.usage-info-popover p { margin: 11px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); }
.credit-summary-info summary { width: 16px; height: 16px; font-size: 9px; }
.credit-summary-info .usage-info-popover { top: calc(100% + 7px); bottom: auto; left: -80px; }
.sidebar-usage-info .usage-info-popover { left: -76px; width: min(270px, calc(100vw - 48px)); }
.message-credit-balance { margin-top: 7px; color: #7a5725; font-size: 12px; font-weight: 800; }
.message-credit-balance.negative { color: var(--danger); }
.message-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.message-attachment { display: inline-flex; min-width: 0; max-width: 100%; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid rgba(56, 107, 90, 0.2); border-radius: 999px; color: var(--moss-dark); background: rgba(242, 250, 245, 0.76); font-size: 12px; font-weight: 750; line-height: 1.2; overflow-wrap: anywhere; }
.message-actions { display: flex; gap: 8px; padding: 7px 4px 0; }
.message-action { position: relative; display: inline-grid; width: 34px; min-height: 34px; padding: 6px; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.message-action svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.message-action::after { position: absolute; z-index: 5; bottom: calc(100% + 5px); left: 50%; padding: 5px 8px; transform: translate(-50%, 3px); border-radius: 7px; color: #fff; background: #273832; content: attr(data-tooltip); font-size: 11px; font-weight: 700; line-height: 1.2; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 100ms ease, transform 100ms ease; transition-delay: 0ms; }
.message-action:hover::after, .message-action:focus-visible::after { transform: translate(-50%, 0); opacity: 1; transition-delay: 250ms; }
.message-action:hover { color: var(--moss); background: var(--moss-pale); }
.message-action:disabled { cursor: default; opacity: 0.7; }
.feedback-action.active { color: var(--moss-dark); background: var(--moss-pale); }
.feedback-panel { max-width: 620px; margin: 8px 4px 0; padding: 14px 15px; border: 1px solid #cadbd2; border-radius: 13px; background: #f7faf8; }
.feedback-panel[hidden] { display: none; }
.feedback-panel form { display: grid; gap: 9px; }
.feedback-panel label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 14px; font-weight: 800; line-height: 1.35; }
.feedback-panel label small { color: var(--muted); font-size: 11px; font-weight: 700; }
.feedback-panel textarea { width: 100%; min-width: 0; max-width: 100%; min-height: 76px; resize: vertical; padding: 10px 12px; border: 1px solid #cbd6d0; border-radius: 10px; color: var(--ink); background: var(--surface); font-size: 15px; line-height: 1.45; }
.feedback-panel-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.small-primary-button { min-height: 38px; padding: 7px 13px; border: 1px solid transparent; border-radius: 9px; color: white; background: var(--moss); font-size: 14px; font-weight: 800; }
.small-primary-button:hover { background: var(--moss-dark); }
.small-primary-button:disabled { cursor: wait; opacity: 0.6; }
.feedback-panel .text-button { min-height: 38px; padding: 7px 2px; font-size: 14px; font-weight: 700; }
.feedback-status { flex: 1 1 180px; color: var(--muted); font-size: 12px; line-height: 1.35; text-align: right; }

.composer { position: relative; min-width: 0; padding: 10px clamp(24px, 4vw, 56px) max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(252, 253, 251, 0.98); }
.composer > * { width: min(100%, 900px); margin-left: auto; margin-right: auto; }
.composer textarea { display: block; min-width: 0; min-height: 48px; max-height: min(32dvh, 180px); resize: none; padding: 10px 14px; border: 1px solid #cbd6d0; border-radius: 14px; background: var(--surface); font-size: 16px; line-height: 1.45; }
.attachment-shelf { position: relative; z-index: 18; flex: 0 0 auto; margin: 0; }
.attachment-shelf summary { position: relative; display: grid; width: 44px; min-height: 42px; place-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); list-style: none; cursor: pointer; }
.attachment-shelf summary::-webkit-details-marker { display: none; }
.attachment-shelf summary:hover, .attachment-shelf summary:focus-visible { border-color: #b8c1bd; background: var(--surface); }
.attachment-shelf.has-attachments summary, .attachment-shelf[open] summary { border-color: #9fbcac; background: #eef8f1; }
.attachment-shelf-icon { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.attachment-shelf-icon { width: 19px; height: 19px; color: var(--muted); }
.attachment-shelf.has-attachments .attachment-shelf-icon, .attachment-shelf[open] .attachment-shelf-icon { color: var(--moss); }
.attachment-shelf-count { position: absolute; top: -6px; right: -6px; display: grid; min-width: 19px; height: 19px; padding: 0 5px; place-items: center; border: 2px solid var(--surface); border-radius: 999px; color: white; background: var(--moss); font-size: 10px; font-weight: 800; line-height: 1; }
.attachment-shelf-count[hidden], .attachment-panel-add[hidden], .attachment-empty-state[hidden] { display: none; }
.attachment-shelf-panel { position: absolute; z-index: 35; bottom: calc(100% + 8px); left: 0; width: min(360px, calc(100vw - 32px)); padding: 8px; border: 1px solid #c5d7cd; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.attachment-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 9px; }
.attachment-panel-header > span { min-width: 0; }
.attachment-panel-header strong, .attachment-panel-header small { display: block; }
.attachment-panel-header strong { font-size: 13px; line-height: 1.25; }
.attachment-panel-header small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.3; }
.attachment-panel-add { display: inline-flex; min-height: 34px; flex: 0 0 auto; align-items: center; padding: 6px 10px; border: 1px solid #bfd2c7; border-radius: 9px; color: var(--moss-dark); background: #f4faf6; font-size: 12px; font-weight: 800; cursor: pointer; }
.attachment-panel-add:hover, .attachment-panel-add:focus-visible { border-color: #9fbcac; background: #eef8f1; }
.attachment-panel-add.disabled { cursor: not-allowed; opacity: 0.52; }
.attachment-tray { display: grid; max-height: 190px; gap: 6px; overflow-y: auto; }
.attachment-empty-state { margin: 0; padding: 13px 10px; border: 1px dashed #cedbd4; border-radius: 10px; color: var(--muted); background: #fafcfb; font-size: 12px; text-align: center; }
.attachment-chip { display: grid; grid-template-columns: 20px minmax(0, 1fr) 28px; width: 100%; align-items: center; gap: 7px; padding: 7px 7px 7px 10px; border: 1px solid #d4e2da; border-radius: 10px; color: var(--ink); background: #f7fbf8; }
.attachment-kind { color: var(--moss); font-size: 18px; font-weight: 900; text-align: center; }
.attachment-chip-copy { min-width: 0; }
.attachment-chip-copy strong, .attachment-chip-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip-copy strong { font-size: 12px; line-height: 1.25; }
.attachment-chip-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
.attachment-chip button { display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 20px; line-height: 1; }
.attachment-chip button:hover, .attachment-chip button:focus-visible { color: var(--danger); background: var(--danger-pale); }
.attachment-chip.removing { opacity: 0.56; }
.composer > .attachment-drop-overlay { position: absolute; z-index: 50; display: grid; width: auto; margin: 0; place-content: center; justify-items: center; inset: 7px clamp(16px, 4vw, 48px); border: 2px dashed #7aa18e; border-radius: 18px; color: var(--moss-dark); background: rgba(242, 250, 245, 0.97); text-align: center; pointer-events: none; }
.attachment-drop-overlay[hidden] { display: none; }
.attachment-drop-overlay svg { width: 30px; height: 30px; margin-bottom: 5px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.attachment-drop-overlay strong { font-size: 15px; }
.attachment-drop-overlay small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 700; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; }
.composer-input-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.composer-status { min-width: 0; flex: 1 1 auto; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.composer .primary-button { min-height: 42px; padding: 8px 16px; border-radius: 11px; }
.attachment-button { display: flex; width: 44px; min-height: 42px; flex: 0 0 44px; align-items: center; justify-content: center; padding: 8px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); font-size: 14px; font-weight: 800; line-height: 1.2; cursor: pointer; }
.attachment-button:hover { border-color: #afc3b8; background: var(--moss-pale); }
.attachment-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.attachment-button.disabled { cursor: not-allowed; opacity: 0.52; }
.speech-button .speech-icon-stop { display: none; }
.speech-button.recording .speech-icon-microphone { display: none; }
.speech-button.recording .speech-icon-stop { display: block; }
.speech-button.recording { color: #9f3131; border-color: #d5a4a4; background: #fff3f1; }
.speech-button.transcribing { cursor: wait; opacity: 0.62; }
.pace-menu { position: relative; z-index: 12; flex: 0 0 auto; }
.pace-menu summary { display: flex; min-height: 42px; align-items: center; gap: 6px; padding: 7px 10px 7px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); font-size: 13px; font-weight: 800; line-height: 1.2; list-style: none; cursor: pointer; }
.pace-menu summary::-webkit-details-marker { display: none; }
.pace-menu summary svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; transition: transform 120ms ease; }
.pace-menu[open] summary { border-color: #afc3b8; background: var(--moss-pale); }
.pace-menu[open] summary svg { transform: rotate(180deg); }
.pace-menu.disabled summary { cursor: wait; opacity: 0.58; }
.pace-menu-popover { position: absolute; z-index: 30; bottom: calc(100% + 8px); left: 0; display: grid; width: min(350px, calc(100vw - 32px)); padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.pace-option { display: grid; grid-template-columns: minmax(0, 1fr) 20px; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 11px 12px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; }
.pace-option:hover, .pace-option:focus-visible { background: var(--moss-pale); }
.pace-option strong, .pace-option small { display: block; }
.pace-option strong { font-size: 14px; line-height: 1.25; }
.pace-option small { margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.35; }
.pace-check { width: 19px; height: 19px; fill: none; stroke: var(--moss); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; opacity: 0; }
.pace-option.active .pace-check { opacity: 1; }
.streaming-cursor::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 3px; background: var(--amber); animation: blink 0.9s infinite; vertical-align: -2px; }
@keyframes blink { 50% { opacity: 0.15; } }

.flash-stack { position: fixed; z-index: 10; top: 84px; right: 20px; left: 20px; display: grid; justify-items: end; pointer-events: none; }
.flash { padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.confirm-dialog { width: min(92vw, 520px); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: transparent; box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: rgba(26, 38, 34, 0.48); backdrop-filter: blur(2px); }
.dialog-card { padding: clamp(24px, 5vw, 34px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.dialog-card h2 { margin: 0 0 10px; font-size: 27px; line-height: 1.2; }
.dialog-card p:not(.eyebrow) { color: var(--muted); }
.dialog-card strong { color: var(--ink); }
.dialog-field { display: grid; gap: 7px; margin-top: 20px; color: var(--ink); font-size: 14px; font-weight: 800; }
.dialog-field input { width: 100%; min-width: 0; min-height: 48px; padding: 11px 13px; border: 1px solid #cbd6d0; border-radius: 10px; color: var(--ink); background: var(--surface); font-size: 17px; font-weight: 600; }
.dialog-field input:focus { outline: 3px solid rgba(56, 107, 90, 0.14); border-color: var(--moss); }
.dialog-error { margin: 9px 0 0; font-size: 13px; font-weight: 700; }
.dialog-error[hidden] { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.danger-button { min-height: 48px; padding: 11px 18px; border: 1px solid transparent; border-radius: 12px; color: white; background: var(--danger); font-weight: 800; }
.danger-button:hover { background: var(--danger-dark); }
.danger-button:disabled { cursor: wait; opacity: 0.65; }
.copy-notice { position: fixed; z-index: 30; right: 20px; bottom: 20px; max-width: min(360px, calc(100vw - 32px)); padding: 10px 14px; transform: translateY(14px); border: 1px solid #b9d0c3; border-radius: 11px; color: var(--moss-dark); background: #f2faf5; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 140ms ease, transform 140ms ease; }
.copy-notice.visible { transform: translateY(0); opacity: 1; }
.copy-notice.error { border-color: #e1b8b3; color: var(--danger); background: var(--danger-pale); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
    .brand small, .account-nav > span { display: none; }
    .chat-shell { display: block; }
    .conversation-sidebar { display: none; }
    .conversation-pane { width: 100%; height: calc(100vh - 56px); }
    .conversation-pane { height: calc(100dvh - 56px); }
}

@media (max-width: 600px) {
    .site-header { min-height: 52px; padding: 7px 12px; }
    .brand { gap: 9px; }
    .brand-mark { width: 34px; height: 34px; }
    .account-nav { gap: 12px; }
    .auth-shell, .welcome-shell { min-height: calc(100dvh - 52px); padding: 18px 14px 28px; place-items: start center; }
    .auth-card, .welcome-card { padding: 28px 22px; border-radius: 20px; }
    .chat-shell { min-height: calc(100dvh - 52px); }
    .conversation-pane { height: calc(100dvh - 52px); }
    .conversation-header { min-height: 42px; padding: 4px 12px; }
    .conversation-header .eyebrow { display: none; }
    .conversation-header h1 { font-size: 14px; }
    .conversation-header-actions { gap: 6px; }
    .conversation-menu summary { width: 34px; height: 34px; }
    .message-list { padding: 14px 12px 20px; }
    .message { margin-bottom: 18px; }
    .message-bubble { padding: 14px; border-radius: 15px; }
    .message-content { font-size: 16px; line-height: 1.6; }
    .feedback-panel { margin-right: 0; margin-left: 0; padding: 13px; }
    .usage-info-popover { left: -150px; width: min(320px, calc(100vw - 48px)); }
    .feedback-status { flex-basis: 100%; text-align: left; }
    .composer { padding: 8px 12px max(8px, env(safe-area-inset-bottom)); }
    .composer textarea { min-height: 46px; max-height: min(34dvh, 160px); padding: 9px 12px; }
    .composer-actions { gap: 8px; margin-top: 6px; }
    .composer-input-actions { gap: 7px; }
    .composer-status { position: absolute; right: 12px; bottom: calc(100% + 5px); left: 12px; display: none; width: auto; max-width: none; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(252, 253, 251, 0.96); box-shadow: 0 4px 14px rgba(42, 61, 54, 0.08); font-size: 11px; }
    .composer-status.active { display: block; }
    .composer .primary-button { min-height: 40px; padding: 7px 13px; }
    .pace-menu summary, .attachment-button, .attachment-shelf summary { min-height: 40px; }
    .attachment-button, .attachment-shelf summary { width: 42px; }
    .attachment-shelf-panel { position: fixed; right: 12px; bottom: calc(58px + env(safe-area-inset-bottom)); left: 12px; width: auto; max-height: min(230px, 42vh); }
    .pace-menu-popover { position: fixed; right: 12px; bottom: calc(58px + env(safe-area-inset-bottom)); left: 12px; width: auto; }
    .conversation-card { grid-template-columns: 1fr; }
    .conversation-card small { white-space: normal; }
    .about-gus-layout { grid-template-columns: 1fr; gap: 14px; }
    .about-gus-photo { width: 64px; height: 64px; }
    .dialog-actions { align-items: stretch; flex-direction: column-reverse; }
    .dialog-actions button { width: 100%; }
    .copy-notice { right: 16px; bottom: 16px; left: 16px; max-width: none; }
}

@media (max-width: 380px) {
    .brand strong { font-size: 16px; }
    .account-nav { font-size: 13px; }
    .auth-card, .welcome-card { padding: 24px 18px; }
    .pace-menu summary { min-height: 38px; padding: 6px 7px 6px 8px; font-size: 12px; }
    .attachment-button, .attachment-shelf summary { width: 38px; min-height: 38px; }
    .attachment-button { flex-basis: 38px; }
    .composer .primary-button { min-height: 38px; padding: 6px 11px; font-size: 14px; }
    .composer-input-actions { gap: 4px; }
    .composer-actions { gap: 4px; }
}
