.liftoff-page { min-height: 100vh; overflow: hidden; background: transparent; }
.liftoff-header { position: relative; z-index: 60; }
.liftoff-header .nav a[aria-current="page"] { color: var(--brand); }
.liftoff-shell { height: calc(100vh - 69px); display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.liftoff-sidebar { min-height: 0; padding: 18px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); }
.new-chat-button { min-height: 44px; padding: 10px 13px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font-weight: 800; cursor: pointer; }
.new-chat-button:hover { border-color: var(--brand); color: var(--brand); }
.new-chat-button span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 18px; font-weight: 500; }
.demo-credits { padding: 16px 0; display: grid; gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.demo-credits > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.demo-credits span { color: var(--muted); font-size: 13px; }
.demo-credits strong { color: var(--ink); font-size: 13px; }
.demo-credits small { color: var(--muted); line-height: 1.45; }
.credit-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.credit-meter span { height: 5px; border-radius: 3px; background: var(--line); }
.credit-meter span.is-available { background: var(--brand); }
.business-context { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.business-context summary { padding: 4px 0 12px; color: var(--ink); font-size: 13px; font-weight: 850; cursor: pointer; }
.context-fields { display: grid; gap: 10px; }
.context-fields label { color: var(--muted); font-size: 11px; }
.context-fields input { min-height: 39px; padding: 9px 10px; font-size: 13px; }
.demo-sidebar-links { margin-top: auto; display: grid; gap: 8px; }
.demo-sidebar-links a { color: var(--muted); font-size: 13px; }
.demo-sidebar-links a:hover { color: var(--brand); }

.liftoff-chat { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: transparent; }
.chat-header { min-height: 64px; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); }
.chat-header > div { display: flex; align-items: center; gap: 10px; }
.chat-header h1 { margin: 0; font-size: 16px; }
.chat-header p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.ai-status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.research-status { color: var(--muted); font-size: 12px; }
.chat-header-actions { display: flex; align-items: center; gap: 10px; }
.button.compact { min-height: 32px; padding: 6px 9px; font-size: 11px; }
.chat-scroll { min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.chat-messages { width: min(860px, calc(100% - 40px)); min-height: 100%; margin: 0 auto; padding: 42px 0 24px; }
.chat-welcome { min-height: calc(100% - 30px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.welcome-mark { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; font-weight: 900; }
.chat-welcome h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); }
.chat-welcome > p { max-width: 580px; margin: 10px auto 26px; color: var(--muted); }
.prompt-grid { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; text-align: left; }
.prompt-grid button { min-height: 90px; padding: 17px; display: grid; align-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
.prompt-grid button:hover { border-color: var(--brand); background: var(--brand-soft); }
.prompt-grid span { color: var(--muted); font-size: 12px; }

.chat-message { margin-bottom: 24px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
.message-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 900; }
.chat-message.assistant .message-avatar { background: var(--brand); color: #fff; }
.message-body { min-width: 0; padding-top: 4px; }
.message-body > strong { display: block; margin-bottom: 8px; font-size: 13px; }
.message-copy { color: var(--ink); line-height: 1.7; }
.message-copy p { margin: 0 0 12px; }
.message-copy p:last-child { margin-bottom: 0; }
.message-copy ul { margin: 0 0 12px; padding-left: 20px; }
.message-sources { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.message-sources summary { width: max-content; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; }
.source-links { display: flex; flex-wrap: wrap; gap: 7px; }
.source-links a { max-width: 230px; padding: 7px 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.source-links a:hover { border-color: var(--brand); color: var(--brand); }
.message-actions { margin-top: 10px; display: flex; gap: 6px; }
.message-actions button { min-height: 28px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; cursor: pointer; }
.message-actions button:hover { border-color: var(--brand); color: var(--brand); }
.chat-message.is-streaming .message-copy { white-space: pre-wrap; }
.typing-indicator { min-height: 24px; display: flex; align-items: center; gap: 5px; }
.typing-indicator span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: liftoff-pulse 1s ease-in-out infinite; }
.typing-indicator span:nth-child(2) { animation-delay: .12s; }
.typing-indicator span:nth-child(3) { animation-delay: .24s; }
@keyframes liftoff-pulse { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.credit-exhausted { width: min(860px, calc(100% - 40px)); margin: 0 auto 10px; padding: 13px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 7px; background: var(--surface); }
.credit-exhausted[hidden] { display: none; }
.credit-exhausted > div { margin-right: auto; display: grid; }
.credit-exhausted span { color: var(--muted); font-size: 12px; }
.credit-exhausted .button { padding: 8px 10px; font-size: 12px; }
.chat-composer { position: relative; width: min(860px, calc(100% - 40px)); margin: 0 auto 18px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 14px 42px color-mix(in srgb, var(--ink) 9%, transparent); backdrop-filter: blur(12px); }
.chat-composer:focus-within { border-color: var(--brand); }
.chat-composer textarea { min-height: 44px; max-height: 160px; padding: 8px 6px; border: 0; border-radius: 0; background: transparent; box-shadow: none; resize: none; line-height: 1.55; }
.chat-composer textarea:focus { box-shadow: none; }
.image-preview { min-height: 54px; margin-bottom: 6px; padding: 8px; display: grid; grid-template-columns: 44px minmax(0, 1fr) 32px; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.image-preview[hidden] { display: none; }
.image-preview img { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; }
.image-preview > div { min-width: 0; display: grid; }
.image-preview strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.image-preview span { color: var(--muted); font-size: 10px; }
.image-preview .icon-button { width: 30px; height: 30px; min-height: 30px; font-size: 18px; }
.composer-tools { min-height: 38px; padding: 6px 0 8px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.tool-button { min-height: 30px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink); font-size: 11px; font-weight: 800; cursor: pointer; }
.tool-button:hover { border-color: var(--brand); color: var(--brand); }
.research-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.research-control select { width: auto; min-height: 30px; padding: 4px 28px 4px 8px; font-size: 11px; }
.credit-estimate { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 800; }
.credit-estimate.is-over-limit { color: var(--danger); }
.composer-actions { min-height: 36px; display: flex; align-items: center; gap: 10px; }
.model-picker { position: relative; }
.model-picker-button { min-height: 34px; padding: 7px 10px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; }
.model-picker-button span { font-size: 12px; }
.model-picker-button i { width: 7px; height: 7px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.model-menu { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 80; width: 280px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.model-menu[hidden] { display: none; }
.model-option { width: 100%; min-height: 58px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.model-option:last-child { border-bottom: 0; }
.model-option:hover, .model-option.is-selected { background: var(--brand-soft); }
.model-option span { display: grid; }
.model-option small { color: var(--muted); }
.model-option > b { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.model-option.is-selected > b { color: var(--brand); }
.composer-note { margin-left: auto; color: var(--muted); font-size: 10px; }
.send-button { min-width: 64px; min-height: 34px; padding: 7px 12px; border: 1px solid var(--brand); border-radius: 6px; background: var(--brand); color: #fff; font-weight: 850; cursor: pointer; }
.send-button:disabled { border-color: var(--line); background: var(--line); color: var(--muted); cursor: not-allowed; }
.chat-notice { min-height: 0; margin: 6px 4px -3px; color: var(--danger); font-size: 11px; }
.chat-notice:empty { display: none; }
.upload-warning { margin: 9px 4px -2px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.liftoff-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 18px; background: rgba(3, 12, 14, .68); }
.liftoff-modal[hidden] { display: none; }
.liftoff-modal-card { position: relative; width: min(520px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.liftoff-modal-card h2 { margin: 5px 0 10px; font-size: 27px; }
.liftoff-modal-card > p:not(.eyebrow) { color: var(--muted); }
.modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
.model-benefits { margin: 20px 0; display: grid; gap: 8px; }
.model-benefits span { padding: 9px 0; border-bottom: 1px solid var(--line); }
.modal-actions { display: flex; gap: 8px; }

@media (max-width: 900px) {
  .liftoff-page { overflow: auto; }
  .liftoff-shell { height: auto; min-height: calc(100vh - 69px); grid-template-columns: 220px minmax(0, 1fr); }
  .liftoff-sidebar { padding: 14px; }
  .composer-note { display: none; }
}

@media (max-width: 700px) {
  .liftoff-page { overflow-x: hidden; }
  .liftoff-shell { display: flex; min-height: calc(100vh - 64px); flex-direction: column; }
  .liftoff-sidebar { min-height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .new-chat-button, .demo-sidebar-links { display: none; }
  .demo-credits { padding: 4px 0 12px; border-top: 0; }
  .demo-credits small { display: none; }
  .business-context { padding-bottom: 0; border-bottom: 0; }
  .context-fields { grid-template-columns: 1fr 1fr; padding-bottom: 12px; }
  .liftoff-chat { min-height: 720px; flex: 1; }
  .chat-header { padding-inline: 16px; }
  .research-status { display: none; }
  .chat-header-actions { margin-left: auto; }
  .chat-messages, .chat-composer, .credit-exhausted { width: calc(100% - 28px); }
  .chat-messages { padding-top: 24px; }
  .chat-welcome { justify-content: flex-start; padding-top: 30px; }
  .prompt-grid { grid-template-columns: 1fr; }
  .prompt-grid button { min-height: 72px; }
  .credit-exhausted { align-items: flex-start; flex-wrap: wrap; }
  .credit-exhausted > div { width: 100%; }
}

@media (max-width: 460px) {
  .context-fields { grid-template-columns: 1fr; }
  .chat-message { grid-template-columns: 28px minmax(0, 1fr); gap: 9px; }
  .message-avatar { width: 27px; height: 27px; }
  .model-menu { width: min(280px, calc(100vw - 48px)); }
  .model-picker-button b { display: none; }
  .composer-tools { flex-wrap: wrap; }
  .credit-estimate { margin-left: 0; }
  .upload-warning { font-size: 8px; }
  .modal-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .typing-indicator span { animation: none; }
}
