:root {
  color-scheme: light dark;
  --bg: light-dark(#f8f7fc, #10101a);
  --panel: light-dark(#ffffff, #171722);
  --panel-2: light-dark(#f1eff8, #1d1d2b);
  --text: light-dark(#222033, #f2f0fb);
  --muted: light-dark(#77738b, #a4a0b8);
  --line: light-dark(#e6e2f0, #2b293c);
  --accent: #9b83ff;
  --accent-strong: #8163f2;
  --shadow: 0 18px 55px rgba(23, 14, 56, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100dvh; display: flex; background: var(--bg); }
.sidebar { width: 258px; flex: 0 0 258px; padding: 27px 17px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 11px 28px; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.5px; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: .4px; }
.brand-mark { position: relative; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, #c4b3ff, #7454e8); box-shadow: 0 5px 18px #8b71ed55; }
.brand-mark span { position: absolute; width: 4px; height: 18px; border-radius: 9px; background: white; transform: rotate(38deg); }
.brand-mark span:nth-child(2) { height: 13px; transform: translateX(-6px) rotate(-38deg); opacity: .85; }
.brand-mark span:nth-child(3) { height: 10px; transform: translateX(6px) rotate(-38deg); opacity: .65; }
.new-chat { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 12px; text-align: left; padding: 12px 13px; font-weight: 650; font-size: 13px; display: flex; gap: 9px; align-items: center; transition: .2s; }
.new-chat:hover, .side-link:hover { background: var(--panel-2); }
.new-chat span { color: var(--accent-strong); font-size: 19px; line-height: 14px; }
.side-label { margin: 30px 11px 10px; color: var(--muted); font-size: 9px; letter-spacing: 1.6px; font-weight: 800; }
.side-link { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; border-radius: 10px; background: transparent; padding: 11px 12px; color: var(--muted); text-align: left; font-size: 12px; margin-bottom: 4px; }
.side-link > span { font-size: 17px; width: 17px; text-align: center; }
.side-link.active { color: var(--text); background: var(--panel-2); font-weight: 700; }
.sidebar-bottom { margin-top: auto; }
.privacy-note { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px 10px; display: flex; align-items: flex-start; gap: 9px; margin: 12px 0 14px; }
.privacy-dot, .status-dot { display: inline-block; width: 7px; height: 7px; background: #56c9a4; border-radius: 50%; box-shadow: 0 0 0 3px #56c9a41c; margin-top: 4px; flex: 0 0 auto; }
.privacy-note b { display: block; font-size: 10px; font-weight: 700; }
.privacy-note small { display: block; color: var(--muted); font-size: 9px; margin-top: 4px; line-height: 1.4; }
.main { min-width: 0; flex: 1; display: flex; flex-direction: column; min-height: 100dvh; position: relative; }
.topbar { height: 70px; padding: 0 34px; display: flex; align-items: center; border-bottom: 1px solid var(--line); gap: 14px; }
.topbar-spacer { flex: 1; }
.status-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 99px; padding: 7px 11px; color: var(--muted); font-size: 10px; }
.status-dot { width: 6px; height: 6px; margin: 0; }
.icon-btn { border: 1px solid var(--line); background: var(--panel); color: var(--muted); width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
.mobile-menu, .mobile-brand { display: none; }
.chat-area { width: 100%; max-width: 840px; flex: 1; margin: 0 auto; padding: 40px 34px 22px; }
.welcome { display: flex; align-items: center; flex-direction: column; text-align: center; padding-top: 6px; }
.hero-orb { width: 82px; height: 82px; position: relative; display: grid; place-items: center; margin-bottom: 21px; }
.orb-core { width: 51px; height: 51px; border-radius: 19px; display: grid; place-items: center; color: white; font-size: 24px; background: radial-gradient(circle at 30% 20%, #d9d0ff, #9578f6 52%, #6346c5); box-shadow: 0 0 40px #9479f65e, inset 0 1px 8px #ffffff6e; z-index: 2; }
.orb-ring { position: absolute; border: 1px solid #9b83ff7a; border-radius: 50%; inset: 0; transform: rotate(-26deg) scaleY(.55); }
.ring-two { inset: 8px -9px; transform: rotate(43deg) scaleY(.65); border-color: #a6a0ff75; }
.orb-spark { position: absolute; color: #b5a4ff; font-style: normal; font-size: 13px; }
.spark-one { top: 3px; right: -7px; }
.spark-two { bottom: 4px; left: -6px; font-size: 9px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; letter-spacing: 1.8px; font-weight: 800; }
.eyebrow-line { height: 1px; width: 19px; background: var(--line); }
h1 { margin: 16px 0 12px; font-size: clamp(29px, 4vw, 42px); line-height: 1.16; letter-spacing: -1.9px; font-weight: 760; }
h1 span { color: #a08af6; }
.welcome-copy { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.suggestions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 29px; text-align: left; }
.suggestion { display: flex; align-items: center; gap: 11px; padding: 14px 13px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 13px; min-width: 0; text-align: left; transition: transform .18s, border-color .18s, box-shadow .18s; }
.suggestion:hover { transform: translateY(-2px); border-color: #aa98f2; box-shadow: var(--shadow); }
.suggestion-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; font-size: 19px; flex: 0 0 auto; background: #a48cf31b; }
.violet { color: #a18aff; } .amber { color: #e8ad62; background: #e8ad6218; } .blue { color: #73aaf8; background: #73aaf818; } .mint { color: #5bc7a5; background: #5bc7a518; }
.suggestion b { display: block; font-size: 11px; }
.suggestion small { display: block; color: var(--muted); font-size: 9px; margin-top: 4px; line-height: 1.3; }
.suggestion-arrow { color: var(--muted); margin-left: auto; font-size: 15px; align-self: flex-start; }
.composer-wrap { width: 100%; max-width: 840px; padding: 0 34px 20px; margin: 0 auto; }
.composer { background: var(--panel); border: 1px solid light-dark(#dcd5ef, #38334d); border-radius: 17px; padding: 15px 15px 11px; box-shadow: 0 10px 38px rgba(29, 19, 67, .07); }
.composer:focus-within { border-color: #a08af6; box-shadow: 0 0 0 3px #a08af619, 0 10px 38px rgba(29, 19, 67, .07); }
textarea { width: 100%; resize: none; min-height: 31px; max-height: 170px; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 13px; line-height: 1.6; padding: 1px 2px 8px; }
textarea::placeholder { color: var(--muted); }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-hint { color: var(--muted); font-size: 9px; display: flex; align-items: center; gap: 6px; }
.sparkle-small { color: #a08af6; font-size: 12px; }
.hint-sep { opacity: .5; }
.send-btn { border: 0; background: linear-gradient(130deg, #a18aff, #7c5fe5); color: white; border-radius: 10px; padding: 8px 10px 8px 13px; display: flex; gap: 11px; align-items: center; font-size: 10px; font-weight: 750; box-shadow: 0 4px 14px #8062e633; }
.send-btn b { font-size: 15px; line-height: 10px; }
.send-btn:disabled { opacity: .55; cursor: wait; }
.disclaimer { text-align: center; color: var(--muted); font-size: 9px; margin: 10px 0 0; }
.messages { display: flex; flex-direction: column; gap: 23px; padding-bottom: 18px; }
.message { display: flex; gap: 11px; align-items: flex-start; animation: appear .2s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.message.user { justify-content: flex-end; }
.avatar { width: 29px; height: 29px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: linear-gradient(145deg, #b7a6ff, #7554df); font-size: 14px; }
.message-body { min-width: 0; max-width: calc(100% - 42px); font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.message.user .message-body { background: var(--panel-2); border: 1px solid var(--line); border-radius: 15px 5px 15px 15px; padding: 11px 14px; max-width: 82%; }
.message.assistant .message-body { padding: 2px 0; }
.message-label { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .7px; margin-bottom: 5px; }
.message-body p { margin: 0 0 10px; }
.message-body p:last-child { margin-bottom: 0; }
.message-body pre { overflow-x: auto; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.message-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.message-body :not(pre) > code { background: var(--panel-2); padding: 2px 4px; border-radius: 4px; }
.typing { color: var(--muted); font-size: 12px; }
.typing span { display: inline-block; animation: pulse 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); font-size: 12px; z-index: 10; transition: .2s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.history-panel { width: 100%; }
.history-item { width: 100%; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); margin-bottom: 9px; }
.history-item b { display: block; font-size: 12px; margin-bottom: 5px; }
.history-item small { color: var(--muted); font-size: 10px; }
.empty-history { color: var(--muted); font-size: 13px; text-align: center; padding: 36px 10px; }
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: 270px; transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .topbar { height: 58px; padding: 0 15px; }
  .mobile-menu { display: inline-grid; place-items: center; }
  .mobile-brand { display: flex; align-items: center; gap: 7px; font-size: 13px; }
  .mini-orb { color: #a08af6; font-size: 18px; }
  .status-pill { margin-left: auto; padding: 6px 8px; font-size: 9px; }
  .chat-area { padding: 28px 16px 18px; }
  .hero-orb { transform: scale(.86); margin-bottom: 15px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.2px; gap: 6px; }
  .eyebrow-line { width: 11px; }
  h1 { font-size: 31px; letter-spacing: -1.4px; margin-top: 13px; }
  .welcome-copy { font-size: 11px; }
  .suggestions { grid-template-columns: 1fr; margin-top: 23px; gap: 8px; }
  .suggestion { padding: 11px 12px; }
  .suggestion-icon { width: 32px; height: 32px; }
  .composer-wrap { padding: 0 12px 12px; }
  .composer { border-radius: 15px; padding: 12px 12px 10px; }
  .composer-hint { font-size: 8px; }
  .disclaimer { font-size: 8px; }
  .message-body { font-size: 12px; }
}
@media (min-width: 761px) and (max-height: 850px) {
  .chat-area { padding-top: 25px; }
  .hero-orb { transform: scale(.78); margin-bottom: 10px; }
  .suggestions { margin-top: 20px; }
}
