:root {
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#1f2937;
  background:#f5f6f8;
  font-synthesis:none;
  font-size:14px;
  --blue:#2563eb;
  --muted:#6b7280;
  --line:#e5e7eb
}

* {
  box-sizing:border-box
}

body {
  margin:0
}

button,input,textarea,select {
  font:inherit
}

button,a,input,textarea,select {
  -webkit-tap-highlight-color:transparent
}

button {
  cursor:pointer
}

button:disabled {
  cursor:default;
  opacity:.5
}

button,input,textarea,select {
  outline-offset:4px
}

button:focus-visible,a:focus-visible {
  outline:3px solid #93b4fd
}

input:focus,textarea:focus,select:focus {
  outline:2px solid #93b4fd
}

button {
  transition:background .15s,border-color .15s
}

button:enabled:hover {
  filter:brightness(.96)
}

a {
  color:inherit;
  text-decoration:none
}

[hidden] {
  display:none!important
}

h1,h2,p {
  margin:0
}

.muted {
  color:var(--muted);
  line-height:1.7
}

.primary {
  border:1px solid var(--blue);
  border-radius:8px;
  background:var(--blue);
  color:#fff;
  font-weight:600;
  padding:11px 16px
}

.eyebrow {
  font-size:10px;
  font-weight:700;
  letter-spacing:1.7px;
  color:var(--blue)
}

.brand {
  display:flex;
  align-items:center;
  gap:11px;
  font-size:17px;
  font-weight:650;
  letter-spacing:-.4px
}

.brand-mark {
  display:flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  border-radius:10px;
  background:var(--blue);
  color:#fff;
  font-size:32px;
  font-weight:700;
  letter-spacing:-2px;
  padding-right:3px;
  padding-bottom:4px
}

.brand-subtitle {
  display:block;
  font-size:8px;
  letter-spacing:1.7px;
  font-weight:500;
  margin-top:5px
}

.error {
  color:#a92b2b;
  background:#fff1f1;
  border:1px solid #fecaca;
  border-radius:7px;
  padding:10px 12px;
  line-height:1.5;
  font-size:13px;
  overflow-wrap:anywhere
}

.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
}

.loading-view {
  height:100dvh;
  display:grid;
  place-items:center;
  color:var(--muted)
}

.login-view {
  min-height:100dvh;
  display:grid;
  place-items:center;
  padding:38px 20px;
  background:radial-gradient(ellipse at 25% 0%,#e8eefc 0%,transparent 55%),#f5f6f8
}

.login-wrap {
  width:100%;
  max-width:440px
}

.login-brand {
  justify-content:center;
  margin-bottom:34px
}

.login-brand .brand-subtitle {
  color:var(--muted)
}

.login-card {
  padding:36px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:0 8px 36px #1f293707
}

.login-card h1 {
  font-size:29px;
  line-height:1.25;
  letter-spacing:-1px;
  margin:12px 0 14px;
  font-weight:650
}

.login-card>.muted {
  font-size:13px;
  margin-bottom:26px
}

.login-card label {
  display:block;
  font-weight:600;
  font-size:12px;
  margin:18px 0 8px
}

.login-card input {
  width:100%;
  height:43px;
  border:1px solid #d6dbe3;
  border-radius:7px;
  padding:10px 12px;
  background:#fff
}

.login-card input::placeholder {
  color:#9ca3af
}

.login-card .error {
  margin-top:18px
}

.login-submit {
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-top:24px
}

.login-note {
  text-align:center;
  color:#858c99;
  font-size:11px;
  margin-top:25px
}

.app-view {
  height:100dvh;
  min-height:420px;
  display:flex;
  flex-direction:column
}

.topbar {
  height:72px;
  flex-shrink:0;
  background:#1f2937;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 28px
}

.topbar .brand-subtitle {
  color:#a8b3c5
}

.account {
  display:flex;
  align-items:center;
  gap:18px;
  font-size:12px
}

.account>span {
  max-width:160px;
  overflow:hidden;
  text-overflow:ellipsis
}

.topbar-button {
  background:#ffffff09;
  border:1px solid #ffffff30;
  color:#e5e7eb;
  border-radius:6px;
  padding:8px 12px;
  font-size:12px
}

.workspace {
  display:flex;
  flex:1;
  min-height:0
}

.sidebar {
  width:260px;
  flex-shrink:0;
  background:#f9fafb;
  border-right:1px solid var(--line);
  padding:25px 18px 20px;
  display:flex;
  flex-direction:column;
  min-height:0
}

.new-chat {
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:12px
}

.new-chat>span {
  font-size:19px;
  line-height:16px
}

.sidebar-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:27px 8px 12px
}

.sidebar-heading h2 {
  font-size:9px;
  letter-spacing:1.1px;
  font-weight:600;
  color:#8992a1
}

.icon-button {
  border:0;
  background:transparent;
  color:#6b7280;
  font-size:19px;
  padding:3px 5px;
  line-height:1
}

.sidebar-note {
  font-size:12px;
  color:#8992a1;
  padding:8px;
  line-height:1.7
}

.sessions {
  overflow:auto;
  flex:1;
  min-height:0
}

.session {
  display:block;
  width:100%;
  text-align:left;
  padding:12px;
  margin:3px 0;
  border:1px solid transparent;
  border-radius:8px;
  background:transparent;
  color:#4b5563
}

.session:hover {
  background:#f0f2f6
}

.session.active {
  background:#eaf0fe;
  border-color:#dbe6fe;
  color:#1d4ed8
}

.session-title {
  font-size:12px;
  font-weight:550;
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}

.session-date {
  display:block;
  color:#9299a6;
  font-size:10px;
  margin-top:7px
}

.sidebar-footer {
  display:flex;
  gap:10px;
  align-items:center;
  padding:18px 8px 0;
  margin-top:auto;
  border-top:1px solid var(--line);
  font-size:10px;
  color:#8a93a1
}

.sidebar-footer strong {
  font-weight:550;
  color:#657083
}

.sidebar-footer p {
  margin-top:5px
}

.small-mark {
  font-size:26px;
  font-weight:650;
  color:#aab7cd;
  letter-spacing:-2px
}

.chat-panel {
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
  background:#fff
}

.chat-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid #eff0f3;
  padding:23px 34px;
  flex-shrink:0
}

.chat-header h1 {
  font-size:14px;
  font-weight:600;
  max-width:420px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.chat-header p {
  font-size:11px;
  color:#98a0ac;
  margin-top:6px
}

.status {
  display:flex;
  align-items:center;
  gap:7px;
  background:#fafbfc;
  border:1px solid #e9edf2;
  border-radius:20px;
  padding:7px 10px;
  font-size:10px;
  color:#7b8595;
  white-space:nowrap
}

.status-dot {
  width:6px;
  height:6px;
  border-radius:50%;
  background:#a1a8b5
}

.status[data-state="ready"] .status-dot {
  background:#36a578
}

.status[data-state="offline"] .status-dot {
  background:#d7a148
}

.conversation-scroll {
  flex:1;
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  scroll-behavior:smooth
}

.welcome {
  max-width:780px;
  width:100%;
  margin:0 auto;
  padding:clamp(30px,7vh,85px) 35px 30px;
  text-align:center
}

.welcome-mark {
  display:flex;
  width:62px;
  height:62px;
  align-items:center;
  justify-content:center;
  margin:0 auto 25px;
  background:#edf3ff;
  color:var(--blue);
  border:1px solid #e0eaff;
  border-radius:18px;
  font-size:48px;
  font-weight:650;
  letter-spacing:-4px;
  padding-right:4px;
  padding-bottom:6px
}

.welcome>.eyebrow {
  font-size:9px;
  letter-spacing:1.6px
}

.welcome h2 {
  font-size:30px;
  letter-spacing:-1px;
  font-weight:600;
  margin:12px 0
}

.welcome>p {
  font-size:13px;
  line-height:1.8;
  color:#8992a1
}

.suggestions {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:34px;
  text-align:left
}

.suggestion {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:9px;
  min-height:157px;
  padding:17px 16px;
  border:1px solid #e5e9f0;
  border-radius:10px;
  background:#fff;
  color:#293449;
  text-align:left
}

.suggestion:enabled:hover {
  border-color:#b1c8fa;
  background:#fafcff
}

.suggestion-icon {
  color:#6284ba;
  font-size:21px;
  line-height:22px;
  margin-bottom:2px
}

.suggestion strong {
  font-size:11px;
  font-weight:600
}

.suggestion>span:not([class]) {
  font-size:11px;
  color:#929aa7;
  line-height:1.6;
  padding-right:4px
}

.suggestion-arrow {
  align-self:flex-end;
  color:#8d9cb2;
  font-size:16px;
  margin-top:auto
}

.composer-area {
  width:100%;
  max-width:880px;
  margin:0 auto;
  padding:14px 34px 21px;
  flex-shrink:0
}

.composer {
  border:1px solid #dce2ec;
  border-radius:12px;
  padding:12px 13px 10px;
  box-shadow:0 3px 12px #1f293704;
  transition:border-color .15s
}

.composer:focus-within {
  border-color:#97b6f8;
  box-shadow:0 0 0 3px #2563eb08
}

.composer textarea {
  width:100%;
  resize:none;
  min-height:57px;
  max-height:160px;
  border:0;
  background:transparent;
  padding:6px 4px;
  line-height:1.6;
  outline:none;
  font-size:13px;
  color:#1f2937
}

.composer textarea::placeholder {
  color:#a0a7b4
}

.composer-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-top:8px
}

.composer-options {
  display:flex;
  align-items:center;
  gap:13px
}

.attach-button {
  display:flex;
  gap:6px;
  align-items:center;
  background:transparent;
  border:0;
  color:#8a94a4;
  padding:5px 3px;
  font-size:11px
}

.toolbar-divider {
  height:14px;
  width:1px;
  background:#e9ecf1
}

.composer select {
  color:#7e899a;
  background:transparent;
  border:0;
  font-size:11px;
  max-width:95px;
  padding:4px 0
}

.send {
  display:flex;
  align-items:center;
  gap:14px;
  padding:8px 13px;
  font-size:11px
}

.send>span:last-child {
  font-size:17px
}

.send:disabled {
  background:#eef1f6;
  color:#9ba6b7;
  border-color:#eef1f6;
  opacity:1
}

.composer-note {
  display:flex;
  justify-content:space-between;
  gap:14px;
  font-size:9px;
  color:#a0a8b5;
  margin:12px 2px 0
}

.chat-error {
  margin-bottom:10px
}

.messages {
  max-width:830px;
  margin:0 auto;
  padding:30px 34px 10px
}

.message {
  display:flex;
  gap:14px;
  margin-bottom:28px;
  overflow-wrap:anywhere
}

.avatar {
  flex-shrink:0;
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  background:#eef3ff;
  color:var(--blue);
  font-size:21px;
  font-weight:650;
  letter-spacing:-1px
}

.message.user .avatar {
  font-size:11px;
  background:#f0f2f5;
  color:#7c8594;
  letter-spacing:0
}

.message-content {
  min-width:0;
  flex:1
}

.message-label {
  font-size:11px;
  font-weight:650;
  margin:7px 0 10px
}

.message-notice {
  color:#6b7280;
  font-size:12px;
  line-height:1.6;
  margin:12px 0 0;
  overflow-wrap:anywhere
}

.message-text {
  white-space:pre-wrap;
  font-size:13px;
  line-height:1.85;
  color:#4b5563
}

.message.user .message-text {
  color:#273448
}

.thinking {
  max-width:830px;
  margin:0 auto;
  padding:0 34px 28px;
  color:#929bad;
  font-size:12px
}

.thinking-dots {
  display:inline-block;
  color:#608ae0;
  letter-spacing:3px;
  margin-right:10px;
  animation:pulse 1.5s ease-in-out infinite
}

.attachments {
  display:flex;
  gap:9px;
  flex-wrap:wrap;
  margin-bottom:8px
}

.attachment {
  display:flex;
  align-items:center;
  gap:8px;
  background:#f5f7fa;
  border:1px solid #e4e8ef;
  border-radius:7px;
  padding:5px;
  max-width:200px
}

.attachment img {
  width:32px;
  height:32px;
  object-fit:cover;
  border-radius:4px
}

.attachment span {
  font-size:10px;
  max-width:110px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.attachment button {
  border:0;
  background:transparent;
  font-size:17px;
  color:#8e99ac;
  padding:0 4px
}

.message-images {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:14px
}

.message-images figure {
  margin:0;
  max-width:300px;
  min-width:100px
}

.message-images img {
  display:block;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:240px;
  border:1px solid #e6e9ef;
  border-radius:8px;
  object-fit:contain
}

.message-images figcaption {
  font-size:11px;
  line-height:1.6;
  color:#7b8698;
  margin-top:6px
}

.image-unavailable {
  font-size:11px;
  color:#7b8698;
  background:#f4f6f9;
  padding:10px;
  border-radius:6px
}

.sidebar-note,.sidebar-heading h2,.session-date,.chat-header p,.status,.welcome>p,.suggestion>span:not([class]),.attach-button,.composer select,.composer-note,.thinking,.login-note,.sidebar-footer {
  color:var(--muted)
}

.composer textarea::placeholder,.login-card input::placeholder {
  color:var(--muted)
}

@keyframes pulse {
  50% {
    opacity:.3
  }
}

@media(min-width:1500px) {
  .sidebar {
    width:285px
  }
  .welcome {
    padding-top:12vh
  }
  .composer-area {
    padding-bottom:30px
  }
}

@media(max-width:1000px) {
  .sidebar {
    width:220px;
    padding:22px 12px 15px
  }
  .topbar {
    padding:0 22px
  }
  .chat-header {
    padding:20px 24px
  }
  .welcome {
    padding-left:24px;
    padding-right:24px
  }
  .suggestions {
    gap:9px
  }
  .suggestion {
    padding:13px 12px
  }
  .composer-area {
    padding:14px 24px 20px
  }
  .composer-note {
    font-size:8px
  }
  .chat-header h1 {
    max-width:250px
  }
}

@media(max-width:760px) {
  .topbar {
    height:65px;
    padding:0 17px
  }
  .brand {
    font-size:15px;
    gap:9px
  }
  .brand-mark {
    height:34px;
    width:34px;
    font-size:29px
  }
  .brand-subtitle {
    font-size:7px;
    letter-spacing:1.3px
  }
  .account {
    gap:9px
  }
  .account>span {
    display:none
  }
  .topbar-button {
    font-size:11px;
    padding:7px 9px
  }
  .workspace {
    flex-direction:column
  }
  .sidebar {
    width:100%;
    flex-direction:row;
    align-items:center;
    gap:10px;
    padding:10px 14px;
    border-right:0;
    border-bottom:1px solid var(--line);
    flex-shrink:0;
    min-height:59px
  }
  .new-chat {
    width:auto;
    white-space:nowrap;
    padding:9px 11px;
    font-size:10px
  }
  .new-chat>span {
    font-size:14px
  }
  .sidebar-heading {
    margin:0
  }
  .sidebar-heading h2,.sidebar-footer {
    display:none
  }
  .sidebar-note {
    font-size:10px;
    padding:0;
    max-width:160px;
    line-height:1.4
  }
  .sessions {
    display:flex;
    gap:6px;
    overflow-x:auto;
    max-height:54px
  }
  .session {
    width:auto;
    min-width:140px;
    margin:0;
    padding:7px 9px
  }
  .session-title {
    max-width:160px;
    font-size:10px
  }
  .session-date {
    font-size:8px;
    margin-top:3px
  }
  .chat-panel {
    min-height:0
  }
  .chat-header {
    padding:14px 19px
  }
  .chat-header h1 {
    font-size:12px;
    max-width:175px
  }
  .chat-header p {
    font-size:9px
  }
  .status {
    font-size:9px;
    padding:6px 8px
  }
  .welcome {
    padding:30px 20px 20px
  }
  .welcome-mark {
    height:48px;
    width:48px;
    font-size:36px;
    border-radius:14px;
    margin-bottom:20px
  }
  .welcome h2 {
    font-size:25px
  }
  .welcome>p {
    font-size:12px
  }
  .suggestions {
    margin-top:24px
  }
  .suggestion {
    min-height:140px;
    padding:11px
  }
  .suggestion strong {
    font-size:10px
  }
  .suggestion>span:not([class]) {
    font-size:10px
  }
  .suggestion-icon {
    font-size:18px
  }
  .composer-area {
    padding:10px 14px 14px
  }
  .composer-note {
    font-size:8px;
    justify-content:center
  }
  .composer-note>span {
    display:none
  }
  .messages {
    padding:22px 19px 6px
  }
  .message {
    gap:10px
  }
  .message-text {
    font-size:13px
  }
  .thinking {
    padding:0 20px 20px
  }
}

@media(max-width:400px) {
  .login-card {
    padding:27px
  }
  .login-card h1 {
    font-size:27px
  }
  .welcome>p {
    font-size:11px
  }
  .suggestions {
    grid-template-columns:1fr;
    margin-top:20px
  }
  .suggestion {
    min-height:0;
    padding:13px 15px;
    display:grid;
    grid-template-columns:22px 1fr 16px;
    gap:5px 9px;
    align-items:center
  }
  .suggestion-icon {
    grid-row:1/3
  }
  .suggestion>span:not([class]) {
    grid-column:2
  }
  .suggestion-arrow {
    grid-column:3;
    grid-row:1/3
  }
  .chat-header h1 {
    max-width:150px
  }
  .status {
    max-width:115px;
    white-space:normal;
    text-align:left
  }
  .desktop-break {
    display:none
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important;
    animation:none!important;
    transition:none!important
  }
}

.message-text p { margin: 0 0 .65em; white-space: pre-wrap; }
.message-text h3 { font-size: 1.05rem; margin: 1em 0 .5em; }
.message-text ul { padding-left: 1.4em; }
.message-text code { background: #f0eee8; padding: .1em .3em; border-radius: 4px; }
.message-text .table-line { font-family: monospace; overflow-x: auto; margin: 0; }
.message-files { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.file-download { display: block; padding: .8rem 1rem; border: 1px solid #c9cfc0; border-radius: .7rem; background: #f1f5ec; color: #263d23; text-decoration: none; font-weight: 600; }
.pro-option { font-size: .75rem; display: flex; gap: .35rem; align-items: center; }
.pro-option input { width: auto; }
@media(max-width:600px) { .composer-options { flex-wrap: wrap; } }
