:root {
  color-scheme: dark;
  --bg: #111214;
  --sidebar: #151618;
  --surface: #1b1c1f;
  --surface-raised: #222326;
  --surface-hover: #292a2e;
  --line: #303136;
  --line-soft: #25262a;
  --text: #f1f1ef;
  --muted: #a3a3a5;
  --muted-soft: #79797d;
  --accent: #d44a4d;
  --accent-hover: #e45a5d;
  --accent-tint: rgba(212, 74, 77, .12);
  --focus: #ff8586;
  --sidebar-width: 264px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { height: 100%; }
body { min-width: 320px; height: 100%; margin: 0; background: var(--bg); color: var(--text); }
button, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { display: flex; height: 100vh; height: 100dvh; min-height: 400px; overflow: hidden; }
.sidebar { width: var(--sidebar-width); flex: 0 0 var(--sidebar-width); background: var(--sidebar); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; padding: 25px 14px 18px; z-index: 20; }
.sidebar-top { display: grid; gap: 34px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 0 10px; color: inherit; text-decoration: none; }
.brand-mark { position: relative; width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 11px; overflow: hidden; background: #352023; }
.brand-mark img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.bird-fallback { display: none; font-size: 12px; font-weight: 800; letter-spacing: -.05em; color: #fff; }
.image-unavailable .bird-fallback { display: block; }
.image-unavailable img { display: none; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-copy strong { font-size: 15px; letter-spacing: -.035em; line-height: 1.1; white-space: nowrap; }
.brand-copy strong span { color: #ee8586; }
.brand-copy small { color: var(--muted-soft); font-size: 10px; letter-spacing: .015em; white-space: nowrap; }
.new-chat-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 43px; padding: 0 13px; border: 1px solid #3c3d42; border-radius: 10px; background: #242528; font-size: 14px; font-weight: 550; text-align: left; transition: background .18s, border-color .18s, transform .18s; }
.new-chat-button:hover { background: #2d2e32; border-color: #53545a; }
.new-chat-button:active { transform: scale(.985); }
.new-chat-button svg { width: 18px; height: 18px; }
.new-chat-shortcut { margin-left: auto; color: var(--muted-soft); font-size: 20px; font-weight: 300; line-height: 1; }
.sidebar-history { min-height: 0; overflow-y: auto; margin-top: 29px; }
.sidebar-label { margin: 0 10px 9px; color: var(--muted-soft); font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.history-item { display: block; width: 100%; overflow: hidden; padding: 10px 11px; border: 0; border-radius: 8px; background: transparent; color: #bfc0c1; font-size: 13px; text-align: left; text-overflow: ellipsis; white-space: nowrap; transition: background .18s, color .18s; }
.history-item:hover, .history-item:focus-visible { background: #26272a; color: #fff; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.sidebar-control { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #bfc0c1; font-size: 13px; text-align: left; transition: background .18s, color .18s; }
.sidebar-control:hover { background: #26272a; color: #fff; }
.sidebar-control svg { width: 18px; height: 18px; }
.control-value { margin-left: auto; color: var(--muted-soft); }
.sidebar-footer { padding: 19px 10px 0; color: #69696d; font-size: 11px; }

.main-panel { display: flex; flex: 1; flex-direction: column; min-width: 0; background: var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; flex: 0 0 68px; padding: 0 33px; border-bottom: 1px solid rgba(255,255,255,.045); }
.topbar-leading { display: flex; align-items: center; min-width: 0; }
.model-title { color: #eeeeed; font-size: 15px; font-weight: 610; letter-spacing: -.025em; white-space: nowrap; }
.model-title > span:last-child { color: var(--muted); font-weight: 500; }
.model-chevron { padding: 0 7px; color: #606065; font-weight: 400; }
.availability { display: flex; align-items: center; gap: 8px; color: #a7a8a9; font-size: 12px; white-space: nowrap; }
.availability-dot { width: 6px; height: 6px; border-radius: 50%; background: #80a68a; box-shadow: 0 0 0 3px rgba(128,166,138,.09); }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); transition: background .18s, color .18s; }
.icon-button:hover { background: var(--surface-hover); color: var(--text); }
.mobile-menu-button { display: none; margin-right: 12px; }

.conversation-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.conversation-inner { display: flex; flex-direction: column; max-width: 852px; min-height: 100%; margin: 0 auto; padding: 30px 36px 12px; }
.welcome { width: 100%; max-width: 690px; margin: auto; padding: 38px 0 53px; text-align: center; }
.welcome-image { position: relative; display: grid; place-items: center; width: 82px; height: 82px; margin: 0 auto 30px; border: 1px solid #423034; border-radius: 23px; background: #281c1e; box-shadow: 0 12px 42px rgba(0,0,0,.22); overflow: hidden; }
.welcome-image img { position: relative; z-index: 1; width: 100%; height: 100%; padding: 7px; object-fit: contain; }
.welcome-image .bird-fallback { font-size: 22px; }
.eyebrow { margin-bottom: 12px; color: #c77274; font-size: 11px; font-weight: 750; letter-spacing: .17em; }
.welcome h1 { margin: 0; color: #f3f3f2; font-size: clamp(32px, 4vw, 44px); font-weight: 640; letter-spacing: -.055em; line-height: 1.12; }
.welcome p { margin: 15px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.prompt-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 46px; text-align: left; }
.prompt-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 62px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 12px; background: #1b1c1e; color: #d7d7d8; font-size: 14px; font-weight: 480; text-align: left; transition: transform .18s, border-color .18s, background .18s, box-shadow .18s; }
.prompt-card svg { width: 17px; height: 17px; flex: 0 0 17px; color: #77787b; transition: transform .18s, color .18s; }
.prompt-card:hover { transform: translateY(-2px); border-color: #515257; background: #242529; box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.prompt-card:hover svg { transform: translateX(3px); color: #d4d4d5; }
.prompt-card:active { transform: translateY(0); }

.messages { display: flex; flex-direction: column; gap: 30px; width: 100%; max-width: 740px; margin: 0 auto; padding: 12px 0 26px; }
.message { display: flex; gap: 14px; min-width: 0; animation: message-in .28s ease-out both; }
.message.user { justify-content: flex-end; }
.user-content { max-width: min(82%, 590px); padding: 12px 16px; border: 1px solid #37383c; border-radius: 17px 17px 5px 17px; background: #292a2d; color: #f0f0ef; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.message.assistant { align-items: flex-start; }
.message-avatar { position: relative; display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid #493135; border-radius: 10px; background: #301e21; overflow: hidden; }
.message-avatar img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.message-avatar .bird-fallback { font-size: 10px; }
.assistant-content { min-width: 0; flex: 1; padding-top: 2px; }
.assistant-name { margin-bottom: 7px; color: #dadadb; font-size: 13px; font-weight: 650; }
.assistant-text { margin: 0; color: #e5e5e4; font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.assistant-actions { margin-top: 8px; }
.copy-button { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 2px 5px; border: 0; border-radius: 5px; background: transparent; color: var(--muted-soft); font-size: 12px; transition: color .18s, background .18s; }
.copy-button svg { width: 14px; height: 14px; }
.copy-button:hover { color: var(--text); background: var(--surface-hover); }
.typing-dots { display: flex; align-items: center; gap: 5px; min-height: 26px; }
.typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: #a3a3a5; animation: dot-pulse 1.2s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: .14s; }
.typing-dots span:nth-child(3) { animation-delay: .28s; }
.message.thinking .message-avatar { animation: bird-think .48s ease-in-out infinite alternate; }
.message.reacting .message-avatar { animation: bird-react .35s ease-out; }

.composer-area { flex: 0 0 auto; width: 100%; padding: 10px 30px calc(17px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(17,18,20,0), var(--bg) 20px); }
.composer { max-width: 780px; margin: 0 auto; padding: 13px 14px 10px 18px; border: 1px solid #44454a; border-radius: 17px; background: #222326; box-shadow: 0 13px 32px rgba(0,0,0,.16); transition: border-color .2s, box-shadow .2s, background .2s; }
.composer:focus-within { border-color: #966164; background: #252629; box-shadow: 0 0 0 3px rgba(212,74,77,.1), 0 13px 32px rgba(0,0,0,.16); }
.composer textarea { display: block; width: 100%; min-height: 26px; max-height: 160px; padding: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font-size: 15px; line-height: 1.55; overflow-y: auto; }
.composer textarea::placeholder { color: #929397; }
.composer-bottom { display: flex; align-items: flex-end; justify-content: space-between; min-height: 32px; padding-top: 7px; }
.composer-hint { align-self: center; color: #77787d; font-size: 11px; }
.send-button { display: grid; place-items: center; width: 31px; height: 31px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; transition: background .18s, transform .18s, opacity .18s; }
.send-button:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.send-button:active:not(:disabled) { transform: scale(.94); }
.send-button:disabled { background: #3b3c40; color: #818287; }
.send-button svg { width: 18px; height: 18px; }
.disclaimer { max-width: 780px; margin: 10px auto 0; color: #717277; font-size: 11px; text-align: center; line-height: 1.35; }

.about-dialog { width: min(calc(100% - 32px), 440px); padding: 24px; border: 1px solid #46474c; border-radius: 17px; background: #202124; color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.about-dialog::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; }
.dialog-brand { display: flex; align-items: center; gap: 9px; color: #d5d5d5; font-size: 11px; font-weight: 700; letter-spacing: .11em; }
.dialog-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: #a93237; color: white; font-size: 10px; letter-spacing: -.04em; }
.about-dialog h2 { margin: 31px 0 10px; font-size: 28px; font-weight: 630; letter-spacing: -.045em; line-height: 1.16; }
.about-dialog p { margin: 0; color: #b7b7ba; font-size: 15px; line-height: 1.65; }
.dialog-meta { display: grid; grid-template-columns: auto 1fr; gap: 12px 20px; margin-top: 30px; padding-top: 19px; border-top: 1px solid var(--line); }
.dialog-meta span { color: var(--muted-soft); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.dialog-meta strong { color: #dededf; font-size: 13px; font-weight: 550; }

@keyframes message-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dot-pulse { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes bird-think { from { transform: rotate(-3deg) translateY(0); } to { transform: rotate(3deg) translateY(-2px); } }
@keyframes bird-react { 0%,100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-3px) rotate(-8deg); } 60% { transform: translateX(3px) rotate(7deg); } }

@media (max-width: 760px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; height: 100vh; height: 100dvh; transform: translateX(-100%); transition: transform .26s ease; box-shadow: 20px 0 55px rgba(0,0,0,.24); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim:not([hidden]) { position: fixed; inset: 0; display: block; z-index: 15; background: rgba(0,0,0,.56); }
  .mobile-menu-button { display: grid; }
  .topbar { flex-basis: 60px; padding: 0 17px; }
  .conversation-inner { padding: 24px 20px 8px; }
  .welcome { padding: 28px 0 40px; }
  .welcome-image { width: 70px; height: 70px; margin-bottom: 24px; }
  .prompt-grid { margin-top: 34px; }
  .composer-area { padding: 8px 15px calc(14px + env(safe-area-inset-bottom)); }
}
@media (max-width: 520px) {
  .availability { font-size: 0; }
  .availability-dot { width: 7px; height: 7px; }
  .welcome h1 { font-size: 34px; }
  .prompt-grid { grid-template-columns: 1fr; gap: 8px; }
  .prompt-card { min-height: 51px; }
  .messages { gap: 23px; }
  .user-content { max-width: 88%; }
  .composer-hint { display: none; }
  .composer-bottom { justify-content: flex-end; }
  .disclaimer { font-size: 10px; }
}
@media (max-height: 700px) and (min-width: 761px) {
  .welcome { padding: 15px 0 24px; }
  .welcome-image { width: 64px; height: 64px; margin-bottom: 17px; }
  .prompt-grid { margin-top: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

