:root {
  --paper: #f7f6f2;
  --paper-deep: #eeece6;
  --ink: #292b2f;
  --muted: #8c8d90;
  --muted-dark: #686a6c;
  --line: #e4e1da;
  --accent: #d97b55;
  --accent-soft: #f5e3db;
  --lilac: #e8e2ef;
  --mint: #dfece6;
  --shadow: 0 20px 55px rgba(43, 39, 30, .08);
  --sidebar-width: 278px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible { outline: 3px solid rgba(217, 123, 85, .26); outline-offset: 3px; }

.app-shell { display: flex; min-height: 100vh; background: linear-gradient(110deg, #f6f5f1 0%, #fbfaf7 100%); }

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(244, 242, 236, .76);
}

.sidebar-top { display: flex; flex-direction: column; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 11px; padding: 0 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: var(--ink); transform: rotate(-4deg); }
.brand-mark svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.brand-copy { display: flex; align-items: baseline; gap: 4px; font-family: "Space Grotesk", sans-serif; font-size: 19px; letter-spacing: -.06em; }
.brand-copy strong { font-weight: 700; }
.brand-copy em { color: var(--accent); font-style: normal; font-weight: 600; }

.new-chat-button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 13px 12px; border: 1px solid #dad7cf; border-radius: 12px; background: rgba(255,255,255,.52); font-size: 12px; font-weight: 600; cursor: pointer; transition: .2s ease; }
.new-chat-button:hover { border-color: #c3bfb5; background: #fff; transform: translateY(-1px); }
.new-chat-button kbd { margin-left: auto; color: #aaa9a6; font-size: 10px; font-weight: 500; }
.plus-icon { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; color: #fff; background: var(--accent); font-size: 17px; font-weight: 400; line-height: 1; }

.main-nav { display: grid; gap: 6px; margin-top: -9px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted-dark); font-size: 12px; text-align: left; cursor: pointer; }
.nav-item:hover, .nav-item.active { color: var(--ink); background: rgba(255,255,255,.7); }
.nav-item.active { font-weight: 600; box-shadow: 0 3px 13px rgba(60, 53, 41, .04); }
.nav-icon { width: 17px; color: var(--accent); font-size: 20px; line-height: 12px; }
.nav-new { margin-left: auto; color: #70a98e; font-size: 9px; font-weight: 600; }

.sidebar-label { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; color: #aaa7a1; font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.sidebar-label button { border: 0; background: none; color: #afaca7; cursor: pointer; letter-spacing: 2px; }
.conversation-list { display: grid; gap: 5px; margin-top: -17px; }
.conversation-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted-dark); font-size: 11px; text-align: left; cursor: pointer; }
.conversation-item:hover, .conversation-item.selected { background: rgba(255,255,255,.58); color: var(--ink); }
.conversation-dot { width: 5px; height: 5px; border-radius: 50%; background: #ccc9c3; }
.selected .conversation-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(217, 123, 85, .11); }

.sidebar-bottom { display: grid; gap: 19px; }
.usage-note, .profile-row { display: flex; align-items: center; gap: 10px; }
.usage-note { padding: 12px; border: 1px solid #e2dfd8; border-radius: 12px; background: rgba(255,255,255,.44); }
.status-orb { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #6da88d; box-shadow: 0 0 0 4px rgba(109, 168, 141, .13); }
.usage-note div, .profile-row div { display: grid; gap: 3px; min-width: 0; }
.usage-note strong, .profile-row strong { overflow: hidden; color: var(--muted-dark); font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.usage-note span:last-child, .profile-row span:not(.profile-avatar) { color: #aaa9a6; font-size: 10px; }
.profile-row { padding: 0 5px; }
.profile-avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: #bab2aa; font-size: 12px; font-weight: 700; }
.profile-row button { margin-left: auto; border: 0; background: transparent; color: #aaa7a1; cursor: pointer; font-size: 14px; }

.chat-pane { position: relative; display: flex; flex: 1; min-width: 0; flex-direction: column; min-height: 100vh; overflow: hidden; }
.chat-pane::before { position: absolute; inset: 0; pointer-events: none; content: ""; opacity: .34; background-image: linear-gradient(rgba(204, 199, 186, .14) 1px, transparent 1px), linear-gradient(90deg, rgba(204, 199, 186, .11) 1px, transparent 1px); background-size: 60px 60px; mask-image: linear-gradient(to bottom, #000, transparent 78%); }
.chat-header { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; min-height: 86px; padding: 20px 5.2vw 17px; border-bottom: 1px solid rgba(228,225,218,.72); }
.header-title { display: flex; align-items: center; gap: 11px; }
.mini-mouse { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; background: var(--accent-soft); font-size: 16px; }
.header-title h1 { margin: 0; font-family: "Space Grotesk", sans-serif; font-size: 15px; letter-spacing: -.035em; }
.online-label { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: #a3a19c; font-size: 10px; }
.online-label i { width: 5px; height: 5px; border-radius: 50%; background: #70a98e; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.model-picker { display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid #e3e0d9; border-radius: 7px; color: #96948f; background: rgba(255,255,255,.37); font-size: 10px; }
.model-picker select { max-width: 176px; padding: 3px 18px 3px 0; border: 0; outline: 0; color: var(--muted-dark); background: transparent; font-size: 10px; font-weight: 600; cursor: pointer; }
.model-picker select:focus-visible { outline: 2px solid rgba(217, 123, 85, .26); outline-offset: 2px; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #aaa7a1; cursor: pointer; font-size: 17px; }
.icon-button:hover { color: var(--ink); background: rgba(255,255,255,.66); }

.conversation { position: relative; z-index: 1; display: flex; flex: 1; flex-direction: column; width: min(850px, calc(100% - 44px)); margin: 0 auto; overflow: auto; scrollbar-width: thin; scrollbar-color: #d9d5cd transparent; }
.welcome { display: flex; flex-direction: column; align-items: center; padding: clamp(62px, 9vh, 105px) 0 24px; text-align: center; }
.welcome-avatar { width: 81px; height: 81px; display: grid; place-items: center; margin-bottom: 21px; border: 1px solid #eed5c9; border-radius: 27px; background: linear-gradient(145deg, #faeae3, #f1d9cf); box-shadow: 0 13px 28px rgba(196, 120, 87, .13); transform: rotate(-5deg); }
.welcome-avatar svg { width: 68px; fill: none; stroke: #b96645; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; transform: rotate(5deg); }
.eyebrow { margin: 0 0 10px; color: #b3aaa2; font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.welcome h2 { margin: 0; color: var(--ink); font-family: "Space Grotesk", sans-serif; font-size: clamp(29px, 3.2vw, 40px); font-weight: 600; letter-spacing: -.065em; line-height: 1.08; }
.welcome h2 span { color: var(--accent); }
.welcome-copy { margin: 16px 0 29px; color: #9a9995; font-size: 13px; line-height: 1.65; }
.prompt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; width: 100%; max-width: 730px; }
.prompt-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 13px 13px; border: 1px solid rgba(226,223,216,.9); border-radius: 13px; background: rgba(255,255,255,.5); text-align: left; cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.prompt-card:hover { border-color: #d8c7bd; box-shadow: 0 9px 22px rgba(78, 63, 42, .06); transform: translateY(-2px); }
.prompt-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; font-size: 14px; }
.prompt-icon.peach { color: #bc6c4a; background: var(--accent-soft); }
.prompt-icon.lavender { color: #8c78a0; background: var(--lilac); }
.prompt-icon.mint { color: #65947e; background: var(--mint); }
.prompt-card > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.prompt-card strong { color: var(--muted-dark); font-size: 11px; font-weight: 600; }
.prompt-card small { overflow: hidden; color: #aaa7a1; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.prompt-arrow { color: #b5b2ac; font-size: 14px; }

.message-list { display: grid; gap: 25px; width: 100%; padding: 25px 0 48px; }
.message { display: flex; gap: 11px; max-width: 88%; animation: message-in .25s ease both; }
.message.user { justify-self: end; flex-direction: row-reverse; }
.message-avatar { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border-radius: 10px; font-size: 14px; }
.message.assistant .message-avatar { color: #b96645; background: var(--accent-soft); }
.message.user .message-avatar { color: #fff; background: var(--ink); font-size: 11px; font-weight: 700; }
.message-content { display: grid; gap: 6px; }
.message-meta { color: #aaa7a1; font-size: 10px; }
.message.user .message-meta { text-align: right; }
.message-bubble { padding: 11px 14px; border: 1px solid #e6e2db; border-radius: 4px 15px 15px 15px; color: var(--muted-dark); background: rgba(255,255,255,.72); font-size: 13px; line-height: 1.65; box-shadow: 0 5px 16px rgba(59, 49, 35, .035); }
.message.user .message-bubble { border-color: var(--ink); border-radius: 15px 4px 15px 15px; color: #fff; background: var(--ink); }
.message-bubble p { margin: 0 0 9px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble ul, .message-bubble ol { margin: 7px 0 0; padding-left: 19px; }
.message-bubble code { padding: 2px 5px; border-radius: 4px; background: rgba(0,0,0,.06); font-size: .92em; }
.message.user .message-bubble code { background: rgba(255,255,255,.16); }
.typing-bubble { display: inline-flex; align-items: center; gap: 4px; min-width: 60px; }
.typing-bubble i { width: 5px; height: 5px; border-radius: 50%; background: #c8a393; animation: typing 1s infinite ease-in-out; }
.typing-bubble i:nth-child(2) { animation-delay: .13s; }.typing-bubble i:nth-child(3) { animation-delay: .26s; }
.message-error .message-bubble { border-color: #ecc7ba; color: #a35f4a; background: #fff3ed; }

.composer-area { position: relative; z-index: 2; width: min(850px, calc(100% - 44px)); margin: 0 auto; padding: 9px 0 21px; }
.composer { padding: 12px 12px 10px 16px; border: 1px solid #dedbd4; border-radius: 18px; background: rgba(255,255,255,.79); box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: #cfaa99; box-shadow: 0 20px 55px rgba(174, 112, 77, .12); }
.composer textarea { display: block; width: 100%; min-height: 25px; max-height: 130px; padding: 1px 0; border: 0; outline: 0; resize: none; color: var(--ink); background: transparent; font-size: 13px; line-height: 1.65; }
.composer textarea::placeholder { color: #b1afab; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.composer-tools { display: flex; align-items: center; gap: 8px; min-width: 0; color: #b0aea9; font-size: 9px; }
.tool-button { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; border: 1px solid #e1ded8; border-radius: 8px; color: #a7a39d; background: transparent; font-size: 17px; cursor: pointer; }
.tool-button:hover { color: var(--accent); border-color: #d8b8aa; background: var(--accent-soft); }
.send-button { display: flex; align-items: center; gap: 8px; padding: 8px 11px 8px 13px; border: 0; border-radius: 9px; color: #fff; background: var(--accent); font-size: 11px; font-weight: 600; cursor: pointer; transition: .2s ease; }
.send-button:hover { background: #c56c49; transform: translateY(-1px); }
.send-button:disabled { opacity: .5; cursor: wait; transform: none; }
.send-button span:last-child { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 5px; background: rgba(255,255,255,.2); font-size: 13px; }
.footer-caption { margin: 10px 0 0; color: #b7b4af; font-size: 9px; text-align: center; }
.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; }
.hidden { display: none !important; }

@keyframes typing { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes message-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 800px) {
  :root { --sidebar-width: 74px; }
  .sidebar { padding: 22px 11px 15px; }
  .brand { justify-content: center; padding: 0; }.brand-copy, .new-chat-button span:not(.plus-icon), .new-chat-button kbd, .nav-item span:not(.nav-icon), .nav-new, .sidebar-label span, .sidebar-label button, .conversation-list, .usage-note div, .profile-row div, .profile-row button { display: none; }
  .new-chat-button { justify-content: center; padding: 10px; }.new-chat-button .plus-icon { width: 25px; height: 25px; }
  .main-nav { gap: 8px; }.nav-item { justify-content: center; padding: 12px 8px; }.nav-icon { font-size: 23px; }
  .sidebar-label { justify-content: center; padding: 0; }.sidebar-bottom { gap: 12px; }.usage-note { justify-content: center; padding: 10px 0; border: 0; background: transparent; }.profile-row { justify-content: center; padding: 0; }
  .chat-header { padding: 17px 24px; }.model-chip { display: none; }
}

@media (max-width: 570px) {
  :root { --sidebar-width: 0px; }
  .sidebar { display: none; }
  .chat-pane { min-height: 100svh; }
  .chat-header { min-height: 72px; padding: 14px 19px; }
  .header-actions { gap: 3px; }.model-picker { display: none; }.icon-button { width: 28px; }
  .conversation, .composer-area { width: calc(100% - 30px); }
  .welcome { padding-top: 50px; }.welcome h2 { font-size: 31px; }.welcome-copy { margin-bottom: 25px; }
  .prompt-grid { grid-template-columns: 1fr; max-width: 330px; gap: 8px; }.prompt-card { padding: 11px 12px; }
  .message { max-width: 94%; }.message-bubble { font-size: 12px; }
  .composer-area { padding-bottom: 13px; }.composer { padding-left: 13px; }.composer-tools span { display: none; }.footer-caption { font-size: 8px; }
}
