/* [project]/src/app/globals.css [app-client] (css) */
@layer properties {
  @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
    *, :before, :after, ::backdrop {
      --tw-rotate-x: initial;
      --tw-rotate-y: initial;
      --tw-rotate-z: initial;
      --tw-skew-x: initial;
      --tw-skew-y: initial;
      --tw-border-style: solid;
      --tw-outline-style: solid;
      --tw-ease: initial;
    }
  }
}

@layer theme {
  :root, :host {
    --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
      "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
      "Courier New", monospace;
    --spacing: .25rem;
    --radius-sm: .25rem;
    --radius-md: .375rem;
    --radius-lg: .5rem;
    --radius-xl: .75rem;
    --ease-out: cubic-bezier(0, 0, .2, 1);
    --ease-in-out: cubic-bezier(.4, 0, .2, 1);
    --default-transition-duration: .15s;
    --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    --default-font-family: var(--font-sans);
    --default-mono-font-family: var(--font-mono);
  }
}

@layer base {
  *, :after, :before, ::backdrop {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  ::file-selector-button {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  html, :host {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    line-height: 1.5;
    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    font-feature-settings: var(--default-font-feature-settings, normal);
    font-variation-settings: var(--default-font-variation-settings, normal);
    -webkit-tap-highlight-color: transparent;
  }

  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }

  abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }

  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }

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

  b, strong {
    font-weight: bolder;
  }

  code, kbd, samp, pre {
    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    font-feature-settings: var(--default-mono-font-feature-settings, normal);
    font-variation-settings: var(--default-mono-font-variation-settings, normal);
    font-size: 1em;
  }

  small {
    font-size: 80%;
  }

  sub, sup {
    vertical-align: baseline;
    font-size: 75%;
    line-height: 0;
    position: relative;
  }

  sub {
    bottom: -.25em;
  }

  sup {
    top: -.5em;
  }

  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }

  :-moz-focusring {
    outline: auto;
  }

  progress {
    vertical-align: baseline;
  }

  summary {
    display: list-item;
  }

  ol, ul, menu {
    list-style: none;
  }

  img, svg, video, canvas, audio, iframe, embed, object {
    vertical-align: middle;
    display: block;
  }

  img, video {
    max-width: 100%;
    height: auto;
  }

  button, input, select, optgroup, textarea {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  :where(select:is([multiple], [size])) optgroup {
    font-weight: bolder;
  }

  :where(select:is([multiple], [size])) optgroup option {
    padding-inline-start: 20px;
  }

  ::file-selector-button {
    margin-inline-end: 4px;
  }

  ::placeholder {
    opacity: 1;
  }

  @supports (not ((-webkit-appearance: -apple-pay-button))) or (contain-intrinsic-size: 1px) {
    ::placeholder {
      color: currentColor;
    }

    @supports (color: color-mix(in lab, red, red)) {
      ::placeholder {
        color: color-mix(in oklab, currentcolor 50%, transparent);
      }
    }
  }

  textarea {
    resize: vertical;
  }

  ::-webkit-search-decoration {
    -webkit-appearance: none;
  }

  ::-webkit-date-and-time-value {
    min-height: 1lh;
    text-align: inherit;
  }

  ::-webkit-datetime-edit {
    display: inline-flex;
  }

  ::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
  }

  ::-webkit-datetime-edit {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-year-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-month-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-day-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-hour-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-minute-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-second-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-millisecond-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-meridiem-field {
    padding-block: 0;
  }

  ::-webkit-calendar-picker-indicator {
    line-height: 1;
  }

  :-moz-ui-invalid {
    box-shadow: none;
  }

  button, input:where([type="button"], [type="reset"], [type="submit"]) {
    appearance: button;
  }

  ::file-selector-button {
    appearance: button;
  }

  ::-webkit-inner-spin-button {
    height: auto;
  }

  ::-webkit-outer-spin-button {
    height: auto;
  }

  [hidden]:where(:not([hidden="until-found"])) {
    display: none !important;
  }
}

@layer components;

@layer utilities {
  .invisible {
    visibility: hidden;
  }

  .visible {
    visibility: visible;
  }

  .absolute {
    position: absolute;
  }

  .fixed {
    position: fixed;
  }

  .relative {
    position: relative;
  }

  .static {
    position: static;
  }

  .start {
    inset-inline-start: var(--spacing);
  }

  .end {
    inset-inline-end: var(--spacing);
  }

  .block {
    display: block;
  }

  .contents {
    display: contents;
  }

  .flex {
    display: flex;
  }

  .grid {
    display: grid;
  }

  .hidden {
    display: none;
  }

  .inline-block {
    display: inline-block;
  }

  .inline-flex {
    display: inline-flex;
  }

  .transform {
    transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
  }

  .resize {
    resize: both;
  }

  .border {
    border-style: var(--tw-border-style);
    border-width: 1px;
  }

  .break-all {
    word-break: break-all;
  }

  .italic {
    font-style: italic;
  }

  .underline {
    text-decoration-line: underline;
  }

  .outline {
    outline-style: var(--tw-outline-style);
    outline-width: 1px;
  }

  .transition {
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  .ease-in-out {
    --tw-ease: var(--ease-in-out);
    transition-timing-function: var(--ease-in-out);
  }

  .ease-out {
    --tw-ease: var(--ease-out);
    transition-timing-function: var(--ease-out);
  }
}

:root {
  --qbit-primary: #6366f1;
  --qbit-primary-hover: #4f46e5;
  --qbit-primary-light: #818cf8;
  --qbit-accent: #8b5cf6;
  --qbit-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --qbit-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #8b5cf6 100%);
  --bg-primary: #0f0f17;
  --bg-secondary: #16161f;
  --bg-tertiary: #1e1e2e;
  --bg-hover: #252538;
  --bg-active: #2a2a42;
  --bg-card: #1a1a2e;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #2e2e44;
  --border-active: #4338ca;
  --bubble-self: #4338ca;
  --bubble-self-text: #fff;
  --bubble-other: #1e1e2e;
  --bubble-other-text: #e2e8f0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --transition-fast: .15s cubic-bezier(.4, 0, .2, 1);
  --transition-normal: .25s cubic-bezier(.4, 0, .2, 1);
}

[data-theme="light"] {
  --bg-primary: #f5f5fa;
  --bg-secondary: #fff;
  --bg-tertiary: #eeeef4;
  --bg-hover: #e8e8f0;
  --bg-active: #dddde8;
  --bg-card: #fff;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e2ee;
  --border-active: #6366f1;
  --bubble-self: #6366f1;
  --bubble-self-text: #fff;
  --bubble-other: #eeeef4;
  --bubble-other-text: #1e293b;
  --qbit-primary-light: #4f46e5;
  --lightningcss-light: initial;
  --lightningcss-dark: ;
  color-scheme: light;
}

[data-theme="light"] .sidebar-nav {
  background: #eaeaf2;
}

[data-theme="light"] .login-page {
  background: linear-gradient(135deg, #e8e8f8 0%, #f0f0fa 50%, #eaeaf5 100%);
}

[data-theme="light"] .toast {
  color: #1e293b;
  background: #fff;
  border: 1px solid #e2e2ee;
  box-shadow: 0 4px 20px #0000001a;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #c8c8d8;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #a8a8b8;
}

[data-theme="light"] .msg-bubble pre {
  background: #0000000d !important;
  border-color: #00000014 !important;
}

[data-theme="light"] .msg-bubble code {
  background: #0000000f !important;
  border-color: #00000014 !important;
}

@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --bg-primary: #f5f5fa;
    --bg-secondary: #fff;
    --bg-tertiary: #eeeef4;
    --bg-hover: #e8e8f0;
    --bg-active: #dddde8;
    --bg-card: #fff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e2ee;
    --border-active: #6366f1;
    --bubble-self: #6366f1;
    --bubble-self-text: #fff;
    --bubble-other: #eeeef4;
    --bubble-other-text: #1e293b;
    --qbit-primary-light: #4f46e5;
    --lightningcss-light: initial;
    --lightningcss-dark: ;
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg-primary);
  height: 100%;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  font-family: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
  overflow: hidden;
}

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: none;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.login-page {
  background: var(--bg-primary);
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  display: flex;
  position: relative;
  overflow: hidden;
}

.login-page:before {
  content: "";
  background: radial-gradient(circle, #6366f126 0%, #0000 70%);
  border-radius: 50%;
  width: 600px;
  height: 600px;
  position: absolute;
  top: -200px;
  right: -200px;
}

.login-page:after {
  content: "";
  background: radial-gradient(circle, #8b5cf61f 0%, #0000 70%);
  border-radius: 50%;
  width: 500px;
  height: 500px;
  position: absolute;
  bottom: -150px;
  left: -150px;
}

.login-card {
  z-index: 10;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  width: 420px;
  padding: 48px 40px;
  position: relative;
  box-shadow: 0 25px 50px -12px #00000080;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  background: var(--qbit-gradient);
  -webkit-text-fill-color: transparent;
  letter-spacing: -.5px;
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 28px;
  font-weight: 700;
}

.login-logo p {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 14px;
}

.login-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
  outline: none;
  margin-bottom: 16px;
  padding: 12px 16px;
  font-size: 14px;
}

.login-input:focus {
  border-color: var(--qbit-primary);
  box-shadow: 0 0 0 3px #6366f126;
}

.login-input::placeholder {
  color: var(--text-muted);
}

.login-btn {
  background: var(--qbit-gradient);
  border-radius: var(--radius-md);
  color: #fff;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition-fast);
  border: none;
  margin-top: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
}

.login-btn:hover {
  background: var(--qbit-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px #6366f14d;
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.login-switch {
  text-align: center;
  color: var(--text-muted);
  margin-top: 20px;
  font-size: 13px;
}

.login-switch a {
  color: var(--qbit-primary-light);
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
}

.login-switch a:hover {
  text-decoration: underline;
}

.login-error {
  color: #f87171;
  border-radius: var(--radius-sm);
  background: #ef44441a;
  border: 1px solid #ef444433;
  margin-bottom: 16px;
  padding: 10px 14px;
  font-size: 13px;
}

.chat-layout {
  background: radial-gradient(circle at 0% 0%, #6366f126 0%, transparent 40%),
              radial-gradient(circle at 100% 100%, #8b5cf626 0%, transparent 40%),
              var(--bg-primary);
  height: 100vh;
  display: flex;
  position: relative;
  overflow: hidden;
}

.sidebar-nav {
  -webkit-backdrop-filter: blur(16px);
  z-index: 95;
  background: #16161fa6;
  border-right: 1px solid #ffffff08;
  flex-direction: column;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  width: 68px;
  padding: 16px 0;
  display: flex;
  position: relative;
}

.nav-avatar {
  border-radius: var(--radius-full);
  background: var(--qbit-gradient);
  color: #fff;
  cursor: pointer;
  width: 40px;
  height: 40px;
  transition: transform var(--transition-fast);
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  box-shadow: 0 4px 12px #6366f14d;
}

.nav-avatar:hover {
  transform: scale(1.05);
}

.nav-icon {
  border-radius: var(--radius-md);
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: none;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  display: flex;
  position: relative;
}

.nav-icon:hover {
  color: var(--text-primary);
  background: #ffffff0d;
}

.nav-icon.active {
  color: var(--qbit-primary-light);
  background: #6366f126;
  box-shadow: inset 0 0 0 1px #6366f133;
}

.nav-icon .badge {
  color: #fff;
  border-radius: var(--radius-full);
  background: #ef4444;
  justify-content: center;
  align-items: center;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  position: absolute;
  top: 4px;
  right: 4px;
  box-shadow: 0 2px 4px #ef444466;
}

.nav-spacer {
  flex: 1;
}

.conversation-panel {
  -webkit-backdrop-filter: blur(16px);
  background: #16161fa6;
  border-right: 1px solid #ffffff08;
  flex-direction: column;
  flex-shrink: 0;
  width: 300px;
  display: flex;
}

.panel-header {
  justify-content: space-between;
  align-items: center;
  padding: 20px 16px 12px;
  display: flex;
}

.panel-header h2 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
}

.panel-search {
  padding: 0 12px 12px;
}

.panel-search input {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  width: 100%;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  border: 1px solid #0000;
  outline: none;
  padding: 8px 12px;
  font-size: 13px;
}

.panel-search input:focus {
  border-color: var(--border-color);
  background: var(--bg-primary);
}

.panel-search input::placeholder {
  color: var(--text-muted);
}

.conv-list {
  flex: 1;
  padding: 0 6px;
  overflow-y: auto;
}

.conv-item {
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 10px;
  display: flex;
}

.conv-item:hover {
  background: var(--bg-hover);
}

.conv-item.active {
  background: var(--bg-active);
}

.conv-item-avatar {
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  width: 42px;
  height: 42px;
  color: var(--text-secondary);
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  position: relative;
}

.conv-item-avatar .online-dot {
  border: 2px solid var(--bg-secondary);
  background: #22c55e;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  position: absolute;
  bottom: 0;
  right: 0;
}

.conv-item-info {
  flex: 1;
  min-width: 0;
}

.conv-item-name {
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
}

.conv-item-preview {
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 2px;
  font-size: 12px;
  overflow: hidden;
}

.conv-item-meta {
  flex-direction: column;
  flex-shrink: 0;
  align-items: flex-end;
  gap: 4px;
  display: flex;
}

.conv-item-time {
  color: var(--text-muted);
  font-size: 11px;
}

.conv-item-unread {
  background: var(--qbit-primary);
  color: #fff;
  border-radius: var(--radius-full);
  justify-content: center;
  align-items: center;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 600;
  animation: .3s ease-out badgeBounce;
  display: flex;
}

@keyframes badgeBounce {
  0% {
    transform: scale(0);
  }

  60% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.presence-dot {
  border: 2px solid var(--bg-secondary);
  border-radius: 50%;
  width: 10px;
  height: 10px;
  position: absolute;
  bottom: 0;
  right: 0;
}

.chat-area {
  background: none;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  display: flex;
}

.chat-header {
  -webkit-backdrop-filter: blur(16px);
  z-index: 10;
  background: #0f0f17a6;
  border-bottom: 1px solid #ffffff0d;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding: 0 24px;
  display: flex;
}

[data-theme="light"] .chat-header {
  background: #f5f5fabf;
  border-bottom: 1px solid #0000000d;
}

.chat-header-info h3 {
  font-size: 16px;
  font-weight: 600;
}

.chat-header-info span {
  color: var(--text-muted);
  font-size: 12px;
}

.chat-header-actions {
  gap: 8px;
  display: flex;
}

.chat-header-actions button {
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: #ffffff08;
  border: 1px solid #0000;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  display: flex;
}

.chat-header-actions button:hover {
  color: var(--text-primary);
  background: #ffffff14;
  border-color: #ffffff1a;
}

.message-list {
  flex-direction: column;
  flex: 1;
  gap: 4px;
  padding: 20px 24px;
  display: flex;
  overflow-y: auto;
}

.msg-row {
  align-items: flex-end;
  gap: 8px;
  max-width: 70%;
  animation: .2s ease-out msgFadeIn;
  display: flex;
}

@keyframes msgFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg-row.msg-highlight {
  animation: 2s ease-out msgHighlightPulse;
}

@keyframes msgHighlightPulse {
  0%, 100% {
    background: none;
  }

  15%, 45% {
    background: #facc1526;
    border-radius: 12px;
    box-shadow: inset 0 0 0 2px #facc1566;
  }

  75% {
    background: #facc150d;
  }
}

.msg-row.self {
  flex-direction: row-reverse;
  margin-left: auto;
}

.msg-avatar {
  border-radius: var(--radius-full);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .5px;
  -webkit-user-select: none;
  user-select: none;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  box-shadow: 0 2px 8px #00000026;
}

.msg-bubble {
  border-radius: var(--radius-lg);
  word-break: break-word;
  max-width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
}

.msg-row:not(.self) .msg-bubble {
  background: var(--bubble-other);
  color: var(--bubble-other-text);
  border-bottom-left-radius: 4px;
}

.msg-row.self .msg-bubble {
  background: var(--bubble-self);
  color: var(--bubble-self-text);
  border-bottom-right-radius: 4px;
}

[data-bubble="gradient"] .msg-row.self .msg-bubble {
  background: linear-gradient(135deg, #7c3aed, #6366f1, #3b82f6);
  box-shadow: 0 2px 12px #6366f14d;
}

[data-bubble="gradient"] .msg-row:not(.self) .msg-bubble {
  background: linear-gradient(135deg, #1e293b, #334155);
  box-shadow: 0 2px 8px #0003;
}

[data-bubble="flat"] .msg-bubble {
  box-shadow: none;
  border-radius: 4px;
}

[data-bubble="flat"] .msg-row.self .msg-bubble {
  background: #4338ca;
}

[data-bubble="flat"] .msg-row:not(.self) .msg-bubble {
  background: #1e293b;
}

.msg-time {
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
  font-size: 10px;
}

.msg-row.self .msg-time {
  text-align: right;
}

.msg-system {
  text-align: center;
  color: var(--text-muted);
  padding: 8px 0;
  font-size: 12px;
}

.chat-input-area {
  -webkit-backdrop-filter: blur(16px);
  z-index: 10;
  background: #0f0f17a6;
  border-top: 1px solid #ffffff0d;
  flex-shrink: 0;
  padding: 12px 24px 20px;
}

[data-theme="light"] .chat-input-area {
  background: #f5f5fabf;
  border-top: 1px solid #0000000d;
}

.chat-input-toolbar {
  gap: 4px;
  margin-bottom: 8px;
  display: flex;
}

.chat-input-toolbar button {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  background: none;
  border: none;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  display: flex;
}

.chat-input-toolbar button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chat-input-box {
  align-items: flex-end;
  gap: 12px;
  display: flex;
}

.chat-input-box textarea {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  resize: none;
  min-height: 42px;
  max-height: 120px;
  transition: border-color var(--transition-fast);
  outline: none;
  flex: 1;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.chat-input-box textarea:focus {
  border-color: var(--qbit-primary);
}

.chat-input-box textarea::placeholder {
  color: var(--text-muted);
}

.send-btn {
  background: var(--qbit-gradient);
  border-radius: var(--radius-md);
  color: #fff;
  cursor: pointer;
  width: 42px;
  height: 42px;
  transition: all var(--transition-fast);
  border: none;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  display: flex;
}

.send-btn:hover {
  background: var(--qbit-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px #6366f14d;
}

.send-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.empty-state {
  color: var(--text-muted);
  flex-direction: column;
  flex: 1;
  justify-content: center;
  align-items: center;
  display: flex;
}

.empty-state-icon {
  opacity: .3;
  margin-bottom: 16px;
  font-size: 64px;
}

.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 600;
}

.empty-state p {
  font-size: 14px;
}

.loading-screen {
  background: var(--bg-primary);
  justify-content: center;
  align-items: center;
  height: 100vh;
  display: flex;
}

.loading-spinner {
  border: 3px solid var(--border-color);
  border-top-color: var(--qbit-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: .8s linear infinite spin;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.emoji-picker {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  z-index: 200;
  flex-direction: column;
  width: 340px;
  max-height: 380px;
  animation: .2s ease-out slideUp;
  display: flex;
  position: absolute;
  bottom: 100%;
  left: 0;
  box-shadow: 0 12px 40px #00000080;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.emoji-search {
  padding: 10px 12px 6px;
}

.emoji-search input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 100%;
  color: var(--text-primary);
  outline: none;
  padding: 8px 12px;
  font-size: 13px;
}

.emoji-search input:focus {
  border-color: var(--qbit-primary);
}

.emoji-search input::placeholder {
  color: var(--text-muted);
}

.emoji-tabs {
  border-bottom: 1px solid var(--border-color);
  gap: 2px;
  padding: 0 8px;
  display: flex;
}

.emoji-tab {
  cursor: pointer;
  opacity: .5;
  transition: all var(--transition-fast);
  background: none;
  border: none;
  border-bottom: 2px solid #0000;
  padding: 6px 8px;
  font-size: 16px;
}

.emoji-tab:hover {
  opacity: .8;
}

.emoji-tab.active {
  opacity: 1;
  border-bottom-color: var(--qbit-primary);
}

.emoji-grid-container {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.emoji-section-title {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 4px 6px;
  font-size: 11px;
  font-weight: 600;
}

.emoji-grid {
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  display: grid;
}

.emoji-btn {
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 36px;
  height: 36px;
  transition: all var(--transition-fast);
  background: none;
  border: none;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  display: flex;
}

.emoji-btn:hover {
  background: var(--bg-hover);
  transform: scale(1.2);
}

.modal-overlay {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 1000;
  background: #0009;
  justify-content: center;
  align-items: center;
  animation: .2s ease-out fadeIn;
  display: flex;
  position: fixed;
  inset: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.settings-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 680px;
  max-height: 520px;
  animation: .25s ease-out scaleIn;
  display: flex;
  overflow: hidden;
  box-shadow: 0 25px 60px #00000080;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.settings-nav {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  flex-direction: column;
  gap: 4px;
  width: 180px;
  padding: 20px 12px;
  display: flex;
}

.settings-nav h3 {
  color: var(--text-primary);
  padding: 0 8px 12px;
  font-size: 14px;
  font-weight: 700;
}

.settings-nav-item {
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 13px;
}

.settings-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.settings-nav-item.active {
  background: var(--bg-active);
  color: var(--qbit-primary-light);
}

.settings-content {
  flex: 1;
  padding: 24px 28px;
  position: relative;
  overflow-y: auto;
}

.settings-close {
  background: var(--bg-tertiary);
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  display: flex;
  position: absolute;
  top: 12px;
  right: 12px;
}

.settings-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.settings-section h2 {
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 700;
}

.settings-field {
  margin-bottom: 18px;
}

.settings-field label {
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  display: block;
}

.settings-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 100%;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
  outline: none;
  padding: 10px 14px;
  font-size: 14px;
}

.settings-input:focus {
  border-color: var(--qbit-primary);
}

.settings-input.disabled {
  opacity: .5;
  cursor: not-allowed;
}

.settings-id-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: SF Mono, Fira Code, monospace;
  font-size: 12px;
  display: flex;
}

.settings-id-box span {
  text-overflow: ellipsis;
  flex: 1;
  overflow: hidden;
}

.settings-id-box button {
  cursor: pointer;
  opacity: .6;
  transition: opacity var(--transition-fast);
  background: none;
  border: none;
  padding: 2px;
  font-size: 14px;
}

.settings-id-box button:hover {
  opacity: 1;
}

.settings-save-btn {
  background: var(--qbit-gradient);
  border-radius: var(--radius-md);
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  margin-top: 8px;
  padding: 10px 24px;
  font-weight: 600;
}

.settings-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px #6366f14d;
}

.profile-avatar-section {
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  display: flex;
}

.profile-avatar-large {
  border-radius: var(--radius-full);
  background: var(--qbit-gradient);
  color: #fff;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 64px;
  font-size: 24px;
  font-weight: 700;
  display: flex;
}

.profile-avatar-edit {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 6px 14px;
  font-size: 13px;
}

.profile-avatar-edit:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.theme-options {
  gap: 12px;
  padding-top: 4px;
  display: flex;
}

.theme-option {
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border: 2px solid #0000;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  display: flex;
}

.theme-option.active {
  border-color: var(--qbit-primary);
}

.theme-option:hover {
  background: var(--bg-hover);
}

.theme-preview {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  width: 56px;
  height: 40px;
}

.theme-preview.dark {
  background: #1a1a2e;
}

.theme-preview.light {
  background: #f0f0f5;
}

.theme-preview.auto {
  background: linear-gradient(135deg, #1a1a2e 50%, #f0f0f5 50%);
}

.theme-option span {
  color: var(--text-muted);
  font-size: 11px;
}

.font-size-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 6px 16px;
  font-size: 13px;
}

.font-size-btn.active {
  background: var(--bg-active);
  border-color: var(--qbit-primary);
  color: var(--qbit-primary-light);
}

.font-size-btn:hover {
  background: var(--bg-hover);
}

.about-content {
  text-align: center;
  padding: 20px 0;
}

.about-logo {
  margin-bottom: 12px;
  font-size: 48px;
  animation: 3s ease-in-out infinite float;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.about-content h3 {
  background: var(--qbit-gradient);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  margin-bottom: 4px;
  font-size: 22px;
  font-weight: 700;
}

.about-version {
  color: var(--text-muted);
  margin-bottom: 12px;
  font-size: 12px;
}

.about-desc {
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto 16px;
  font-size: 14px;
  line-height: 1.6;
}

.about-links {
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  display: flex;
}

.about-links a {
  color: var(--qbit-primary-light);
  font-size: 13px;
  text-decoration: none;
}

.about-links a:hover {
  text-decoration: underline;
}

.about-links span {
  color: var(--text-muted);
}

.about-tech {
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  display: flex;
}

.about-tech span {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 11px;
}

.message-search-panel {
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  z-index: 50;
  flex-direction: column;
  width: 320px;
  height: 100%;
  animation: .2s ease-out slideLeft;
  display: flex;
  position: absolute;
  top: 0;
  right: 0;
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.search-header {
  border-bottom: 1px solid var(--border-color);
  padding: 16px;
}

.search-input-row {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  display: flex;
}

.search-icon {
  opacity: .5;
  font-size: 16px;
}

.search-input {
  color: var(--text-primary);
  background: none;
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-close {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  display: flex;
}

.search-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.search-count {
  color: var(--text-muted);
  padding-top: 8px;
  font-size: 12px;
}

.search-results {
  flex: 1;
  overflow-y: auto;
}

.search-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 13px;
}

.search-result-item {
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 16px;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-content {
  color: var(--text-primary);
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  overflow: hidden;
}

.search-result-meta {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 11px;
}

.search-highlight {
  color: var(--qbit-primary-light);
  background: #6366f14d;
  border-radius: 2px;
  padding: 0 2px;
}

.msg-context-item {
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all var(--transition-fast);
  background: none;
  border: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  display: flex;
}

.msg-context-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.msg-status {
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  font-size: 10px;
  display: inline-flex;
}

.msg-status.sending, .msg-status.sent {
  color: var(--text-muted);
}

.msg-status.delivered {
  color: var(--qbit-primary-light);
}

.msg-status.read {
  color: #22c55e;
}

.typing-indicator {
  color: var(--text-muted);
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  display: flex;
}

.typing-dots {
  gap: 3px;
  display: flex;
}

.typing-dots span {
  background: var(--text-muted);
  border-radius: 50%;
  width: 6px;
  height: 6px;
  animation: 1.4s ease-in-out infinite typingBounce;
}

.typing-dots span:nth-child(2) {
  animation-delay: .2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes typingBounce {
  0%, 80%, 100% {
    opacity: .4;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-6px);
  }
}

.msg-actions {
  opacity: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: opacity var(--transition-fast);
  gap: 2px;
  padding: 2px;
  display: flex;
  position: absolute;
  top: -8px;
  box-shadow: 0 2px 8px #0000004d;
}

.msg-row:not(.self) .msg-actions {
  right: 0;
}

.msg-row.self .msg-actions {
  left: 0;
}

.msg-action-btn {
  cursor: pointer;
  width: 26px;
  height: 26px;
  transition: background var(--transition-fast);
  background: none;
  border: none;
  border-radius: 4px;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  display: flex;
}

.msg-action-btn:hover {
  background: var(--bg-hover);
}

.msg-reply {
  border-left: 3px solid var(--qbit-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  cursor: pointer;
  background: #6366f11a;
  margin-bottom: 4px;
  padding: 6px 10px;
  font-size: 12px;
}

.msg-reply:hover {
  background: #6366f126;
}

.reply-preview {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--qbit-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 12px;
  font-size: 12px;
  display: flex;
}

.reply-preview-close {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  margin-left: auto;
  font-size: 14px;
}

.ws-status-bar {
  justify-content: center;
  align-items: center;
  gap: 6px;
  height: 24px;
  font-size: 11px;
  font-weight: 500;
  animation: .3s ease-out slideDown;
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ws-status-bar.connected {
  color: #22c55e;
  background: #22c55e1a;
}

.ws-status-bar.disconnected {
  color: #ef4444;
  background: #ef44441a;
}

.ws-status-bar.reconnecting {
  color: #f59e0b;
  background: #f59e0b1a;
}

.ws-dot {
  border-radius: 50%;
  width: 6px;
  height: 6px;
}

.ws-status-bar.connected .ws-dot {
  background: #22c55e;
}

.ws-status-bar.disconnected .ws-dot {
  background: #ef4444;
}

.ws-status-bar.reconnecting .ws-dot {
  background: #f59e0b;
  animation: 1s ease-in-out infinite pulse;
}

@keyframes pulse {
  50% {
    opacity: .5;
  }
}

.toast-container {
  z-index: 2000;
  flex-direction: column;
  gap: 8px;
  display: flex;
  position: fixed;
  top: 20px;
  right: 20px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  align-items: center;
  gap: 8px;
  min-width: 260px;
  padding: 12px 16px;
  font-size: 13px;
  animation: .3s ease-out slideInRight;
  display: flex;
  box-shadow: 0 8px 24px #0006;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  border-left: 3px solid #22c55e;
}

.toast.error {
  border-left: 3px solid #ef4444;
}

.toast.info {
  border-left: 3px solid var(--qbit-primary);
}

.msg-context-menu {
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-width: 160px;
  padding: 4px;
  animation: .15s ease-out scaleIn;
  position: fixed;
  box-shadow: 0 10px 40px #00000080;
}

.msg-context-item {
  width: 100%;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-align: left;
  background: none;
  border: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  transition: background .1s;
  display: flex;
}

.msg-context-item:hover {
  background: var(--bg-active);
}

.msg-context-item.danger {
  color: #f87171;
}

.msg-context-item.danger:hover {
  background: #f871711a;
}

.badge {
  color: #fff;
  border: 2px solid var(--bg-secondary);
  background: #ef4444;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  position: absolute;
  top: -5px;
  right: -5px;
}

.msg-reply {
  color: var(--qbit-primary-light);
  border-left: 2px solid var(--qbit-primary);
  opacity: .8;
  margin-bottom: 3px;
  padding-left: 8px;
  font-size: 11px;
}

.modal-overlay {
  z-index: 900;
  background: #00000080;
  justify-content: center;
  align-items: center;
  animation: .2s ease-out fadeIn;
  display: flex;
  position: fixed;
  inset: 0;
}

.conv-item:has(.conv-item-name span:first-child) {
  border-left: 2px solid var(--qbit-primary);
}

.msg-actions {
  opacity: 0;
  align-items: center;
  gap: 2px;
  transition: opacity .15s;
  display: flex;
}

.msg-row:hover .msg-actions {
  opacity: 1;
}

.msg-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 12px;
  line-height: 1;
  transition: all .1s;
}

.msg-action-btn:hover {
  background: var(--bg-active);
  border-color: var(--qbit-primary);
  transform: scale(1.1);
}

.presence-dot {
  border: 2px solid var(--bg-secondary);
  z-index: 1;
  background: #6b7280;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  transition: background .3s;
  position: absolute;
  bottom: -1px;
  right: -1px;
}

.presence-dot.online {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e80;
}

.presence-dot.away {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b4d;
}

.presence-dot.busy {
  background: #ef4444;
  box-shadow: 0 0 6px #ef44444d;
}

.presence-dot.offline {
  background: #6b7280;
}

.reaction-bar {
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding: 2px 0;
  display: flex;
}

.reaction-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  color: var(--text-primary);
  border-radius: 12px;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  font-size: 14px;
  line-height: 1.4;
  transition: all .15s;
  display: inline-flex;
}

.reaction-chip:hover {
  background: var(--bg-active);
  border-color: var(--qbit-primary-light);
  transform: scale(1.08);
}

.reaction-chip.mine {
  border-color: var(--qbit-primary);
  background: #6366f126;
}

.reaction-chip.mine:hover {
  background: #6366f140;
}

.reaction-chip.add {
  color: var(--text-muted);
  justify-content: center;
  min-width: 24px;
  padding: 2px 6px;
  font-size: 12px;
}

.reaction-count {
  color: var(--text-muted);
  font-size: 11px;
}

.reaction-picker {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  z-index: 50;
  gap: 2px;
  padding: 6px 8px;
  animation: .15s ease-out scaleIn;
  display: flex;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 8px 32px #00000080;
}

.reaction-picker-btn {
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  border: none;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  font-size: 18px;
  transition: all .12s;
  display: flex;
}

.reaction-picker-btn:hover {
  background: var(--bg-active);
  transform: scale(1.3);
}

.msg-row {
  position: relative;
}

.file-upload-panel {
  padding: 16px;
}

.file-upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  background: #ffffff05;
  padding: 32px;
  transition: all .2s;
}

.file-upload-dropzone:hover, .file-upload-dropzone.drag-over {
  border-color: var(--brand-primary);
  background: #6366f10d;
}

.file-upload-icon {
  margin-bottom: 12px;
  font-size: 40px;
}

.file-upload-hint {
  color: var(--text-primary);
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 500;
}

.file-upload-sub {
  color: var(--text-muted);
  margin: 0 0 4px;
  font-size: 13px;
}

.file-upload-limit {
  color: var(--text-muted);
  opacity: .6;
  margin: 0;
  font-size: 12px;
}

.file-upload-list {
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  margin-top: 12px;
  display: flex;
  overflow-y: auto;
}

.file-upload-item {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  display: flex;
  position: relative;
}

.file-upload-item.success {
  border-color: #10b9814d;
}

.file-upload-item.failed {
  border-color: #ef44444d;
}

.file-thumb {
  border-radius: var(--radius-sm);
  background: #ffffff0d;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  display: flex;
  overflow: hidden;
}

.file-thumb img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.file-type-icon {
  font-size: 22px;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
}

.file-meta {
  color: var(--text-muted);
  gap: 8px;
  margin-top: 2px;
  font-size: 12px;
  display: flex;
}

.file-progress-text {
  color: var(--brand-primary);
  font-weight: 500;
}

.file-status-ok {
  color: #10b981;
}

.file-status-err {
  color: #ef4444;
}

.file-progress-bar {
  background: #ffffff1a;
  border-radius: 2px;
  height: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.file-progress-fill {
  background: var(--gradient-primary);
  border-radius: 2px;
  height: 100%;
  transition: width .3s;
}

.file-remove-btn {
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 14px;
  transition: all .15s;
}

.file-remove-btn:hover {
  color: #ef4444;
  background: #ef44441a;
}

.file-upload-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  display: flex;
}

.file-btn-cancel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 20px;
  font-size: 13px;
  transition: all .15s;
}

.file-btn-cancel:hover {
  background: var(--bg-active);
}

.file-btn-send {
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  color: #fff;
  cursor: pointer;
  border: none;
  padding: 8px 24px;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
}

.file-btn-send:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.group-settings-overlay {
  z-index: 1000;
  background: #00000080;
  justify-content: center;
  align-items: center;
  animation: .15s fadeIn;
  display: flex;
  position: fixed;
  inset: 0;
}

.group-settings-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  flex-direction: column;
  width: 480px;
  max-height: 80vh;
  animation: .2s scaleIn;
  display: flex;
  overflow: hidden;
  box-shadow: 0 20px 60px #00000080;
}

.group-settings-header {
  border-bottom: 1px solid var(--border-color);
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  display: flex;
}

.group-settings-header h3 {
  color: var(--text-primary);
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.group-settings-close {
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 16px;
  transition: all .15s;
}

.group-settings-close:hover {
  color: var(--text-primary);
  background: var(--bg-active);
}

.group-settings-tabs {
  border-bottom: 1px solid var(--border-color);
  display: flex;
}

.group-tab {
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid #0000;
  flex: 1;
  padding: 10px;
  font-size: 13px;
  transition: all .15s;
}

.group-tab:hover {
  color: var(--text-secondary);
}

.group-tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.group-settings-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.group-avatar-section {
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
  display: flex;
}

.group-avatar-large {
  background: var(--gradient-primary);
  color: #fff;
  border-radius: 18px;
  justify-content: center;
  align-items: center;
  width: 72px;
  height: 72px;
  font-size: 28px;
  display: flex;
  overflow: hidden;
}

.group-avatar-large img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.group-muted-badge {
  color: #f59e0b;
  background: #f59e0b1a;
  border-radius: 20px;
  margin-top: 8px;
  padding: 2px 10px;
  font-size: 12px;
}

.group-form-item {
  margin-bottom: 16px;
}

.group-form-item label {
  color: var(--text-muted);
  margin-bottom: 6px;
  font-size: 13px;
  display: block;
}

.group-input, .group-textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  color: var(--text-primary);
  outline: none;
  padding: 8px 12px;
  font-size: 14px;
  transition: border-color .15s;
}

.group-input:focus, .group-textarea:focus {
  border-color: var(--brand-primary);
}

.group-input:disabled, .group-textarea:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.group-textarea {
  resize: vertical;
  min-height: 60px;
}

.group-meta-list {
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
  padding-top: 16px;
}

.group-meta-item {
  color: var(--text-secondary);
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  display: flex;
}

.group-meta-item .meta-label {
  color: var(--text-muted);
}

.group-save-btn {
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  color: #fff;
  cursor: pointer;
  border: none;
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity .15s;
}

.group-save-btn:hover {
  opacity: .9;
}

.group-save-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.group-danger-zone {
  border-top: 1px solid var(--border-color);
  margin-top: 24px;
  padding-top: 16px;
}

.group-danger-btn {
  border-radius: var(--radius-md);
  color: #ef4444;
  cursor: pointer;
  background: #ef44441a;
  border: 1px solid #ef44444d;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  font-size: 13px;
  transition: all .15s;
}

.group-danger-btn:hover {
  background: #ef444433;
}

.group-danger-btn.disband {
  border-color: #ef444480;
}

.group-member-item {
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  display: flex;
}

.group-member-item:last-child {
  border-bottom: none;
}

.group-member-avatar {
  background: var(--gradient-primary);
  color: #fff;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  font-size: 14px;
  display: flex;
  overflow: hidden;
}

.group-member-avatar img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.group-member-info {
  flex: 1;
  min-width: 0;
}

.group-member-name {
  color: var(--text-primary);
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
}

.group-member-username {
  color: var(--text-muted);
  font-size: 12px;
}

.group-role-badge {
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 500;
}

.group-role-badge.owner {
  color: #f59e0b;
  background: #f59e0b26;
}

.group-role-badge.admin {
  color: #3b82f6;
  background: #3b82f626;
}

.group-member-remove {
  color: #ef4444;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #ef44441a;
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  transition: all .15s;
}

.group-member-remove:hover {
  background: #ef444433;
}

.group-confirm-overlay {
  z-index: 10;
  background: #00000080;
  justify-content: center;
  align-items: center;
  display: flex;
  position: absolute;
  inset: 0;
}

.group-confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 320px;
  padding: 24px;
}

.group-confirm-box p {
  color: var(--text-primary);
  margin: 0 0 20px;
  font-size: 14px;
}

.group-confirm-actions {
  justify-content: center;
  gap: 8px;
  display: flex;
}

.group-confirm-actions button {
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 8px 20px;
  font-size: 13px;
  transition: all .15s;
}

.group-confirm-actions button.danger {
  color: #fff;
  background: #ef4444;
  border-color: #ef4444;
}

.group-confirm-actions button.danger:hover {
  background: #dc2626;
}

.global-search-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  flex-direction: column;
  width: 560px;
  max-height: 70vh;
  animation: .2s scaleIn;
  display: flex;
  position: absolute;
  top: 10%;
  left: 50%;
  overflow: hidden;
  transform: translateX(-50%);
  box-shadow: 0 20px 60px #00000080;
}

.global-search-header {
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  display: flex;
}

.global-search-icon {
  flex-shrink: 0;
  font-size: 18px;
}

.global-search-input {
  color: var(--text-primary);
  background: none;
  border: none;
  outline: none;
  flex: 1;
  font-size: 15px;
}

.global-search-input::placeholder {
  color: var(--text-muted);
}

.global-search-kbd {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 11px;
}

.global-search-tabs {
  border-bottom: 1px solid var(--border-color);
  gap: 2px;
  padding: 6px 12px;
  display: flex;
}

.global-search-tab {
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  transition: all .15s;
}

.global-search-tab:hover {
  background: var(--bg-active);
  color: var(--text-secondary);
}

.global-search-tab.active {
  color: var(--brand-primary);
  background: #6366f126;
  font-weight: 500;
}

.global-search-results {
  flex: 1;
  max-height: 50vh;
  padding: 8px 0;
  overflow-y: auto;
}

.global-search-result-item {
  cursor: pointer;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  transition: background .12s;
  display: flex;
}

.global-search-result-item:hover {
  background: var(--bg-active);
}

.search-result-avatar {
  background: var(--gradient-primary);
  color: #fff;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  font-size: 14px;
  display: flex;
  overflow: hidden;
}

.search-result-avatar.group {
  border-radius: var(--radius-sm);
}

.search-result-avatar.message {
  color: var(--brand-primary);
  background: #6366f126;
}

.search-result-avatar img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  color: var(--text-primary);
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
}

.search-result-type {
  font-size: 12px;
}

.search-result-sub {
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  font-size: 12px;
  overflow: hidden;
}

.global-search-loading {
  color: var(--text-muted);
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px;
  font-size: 13px;
  display: flex;
}

.search-spinner {
  border: 2px solid var(--border-color);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: .6s linear infinite spin;
}

.global-search-empty, .global-search-hint {
  color: var(--text-muted);
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px;
  font-size: 14px;
  display: flex;
}

.global-search-hint kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 11px;
}

.voice-recorder {
  align-items: center;
  display: inline-flex;
}

.voice-rec-btn {
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: none;
  border: none;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  display: flex;
}

.voice-rec-btn:hover {
  color: var(--text-primary);
  background: #ffffff0d;
  transform: none;
}

.voice-recording-panel, .voice-recorded-panel {
  border-radius: var(--radius-md);
  background: #ef444414;
  border: 1px solid #ef444433;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  animation: .15s scaleIn;
  display: flex;
}

.voice-wave {
  align-items: center;
  gap: 3px;
  height: 24px;
  display: flex;
}

.voice-wave-bar {
  background: #ef4444;
  border-radius: 2px;
  width: 3px;
  animation: .6s ease-in-out infinite alternate voiceWave;
}

@keyframes voiceWave {
  0% {
    opacity: .4;
    height: 6px;
  }

  100% {
    opacity: 1;
    height: 20px;
  }
}

@keyframes voicePulse {
  0% {
    transform: scaleY(.6);
  }

  100% {
    transform: scaleY(1.2);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.voice-timer {
  color: #ef4444;
  min-width: 40px;
  font-family: SF Mono, monospace;
  font-size: 14px;
  font-weight: 600;
}

.voice-duration {
  color: var(--text-muted);
  font-size: 12px;
}

.voice-rec-actions {
  gap: 6px;
  display: flex;
}

.voice-cancel-btn {
  border-radius: var(--radius-sm);
  background: var(--bg-active);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 12px;
}

.voice-stop-btn {
  color: #fff;
  cursor: pointer;
  background: #ef4444;
  border: none;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  font-size: 12px;
  display: flex;
}

.voice-send-btn {
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  color: #fff;
  cursor: pointer;
  border: none;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
}

.voice-audio-player {
  max-width: 160px;
  height: 28px;
}

.voice-audio-player::-webkit-media-controls-panel {
  background: none;
}

.msg-highlight {
  animation: 2s ease-out msgHighlight;
}

@keyframes msgHighlight {
  0%, 30% {
    background: #6366f126;
  }

  100% {
    background: none;
  }
}

.msg-row input[type="checkbox"] {
  flex-shrink: 0;
  transition: transform .15s;
}

.msg-row input[type="checkbox"]:hover {
  transform: scale(1.2);
}

.pinned-banner {
  animation: .2s ease-out slideDown;
}

.settings-group h3 {
  color: var(--text-primary);
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .sidebar-nav {
    width: 52px;
    padding: 12px 0;
  }

  .sidebar-nav .nav-label {
    display: none;
  }

  .conversation-panel {
    width: 260px;
  }

  .chat-header {
    height: 56px;
    padding: 0 12px;
  }

  .chat-header-info h3 {
    font-size: 14px;
  }

  .msg-bubble {
    max-width: 85%;
  }

  .settings-overlay .settings-dialog {
    width: 90vw;
    height: 85vh;
  }

  .settings-nav {
    width: 140px;
  }

  .login-card {
    width: 90vw;
    max-width: 380px;
  }
}

@media (max-width: 480px) {
  .chat-layout {
    position: relative;
  }

  .mobile-back-btn {
    display: block !important;
  }

  .sidebar-nav {
    gap: 4px;
    width: 48px;
  }

  .sidebar-nav button {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .conversation-panel {
    z-index: 2;
    width: calc(100vw - 48px);
    position: relative;
  }

  .chat-layout.has-active-conv .conversation-panel {
    display: none;
  }

  .chat-layout.has-active-conv .chat-area {
    width: 100%;
    display: flex;
  }

  .chat-layout:not(.has-active-conv) .chat-area {
    display: none;
  }

  .chat-header {
    height: 52px;
    padding: 0 8px;
  }

  .chat-header-info h3 {
    font-size: 13px;
  }

  .panel-header {
    padding: 12px 10px 8px;
  }

  .panel-header h2 {
    font-size: 16px;
  }

  .panel-search {
    padding: 0 10px 8px;
  }

  .conv-item {
    gap: 8px;
    padding: 8px;
  }

  .conv-item-avatar {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .msg-row {
    padding: 3px 8px;
  }

  .msg-avatar {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }

  .msg-bubble {
    max-width: 90%;
    padding: 8px 10px;
    font-size: 13px;
  }

  .msg-actions {
    opacity: 1;
    margin-top: 4px;
    position: static;
  }

  .message-list {
    padding: 8px 0;
  }

  .input-bar {
    padding: 6px 8px;
  }

  .input-bar textarea {
    font-size: 14px;
  }

  .empty-state {
    padding: 20px;
  }

  .empty-state-icon {
    font-size: 40px !important;
  }

  .settings-overlay .settings-dialog {
    border-radius: 0;
    width: 100vw;
    height: 100vh;
  }

  .settings-nav {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    flex-direction: row;
    gap: 0;
    width: 100%;
    padding: 8px;
    overflow-x: auto;
  }

  .settings-nav-item {
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 12px;
  }

  .settings-main {
    flex: 1;
    overflow-y: auto;
  }
}

@media (max-width: 360px) {
  .sidebar-nav {
    width: 42px;
  }

  .sidebar-nav button {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .conversation-panel {
    width: calc(100vw - 42px);
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .chat-layout {
    height: 100dvh;
  }

  .chat-header {
    height: 44px;
  }

  .settings-overlay .settings-dialog {
    height: 100vh;
  }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .input-bar {
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
  }

  .sidebar-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

.modal-overlay img[alt="Preview"] {
  transition: opacity .15s;
}

@media (max-width: 480px) {
  .modal-overlay img[alt="Preview"] {
    border-radius: 4px !important;
    max-width: 98vw !important;
    max-height: 70vh !important;
  }
}

@property --tw-rotate-x {
  syntax: "*";
  inherits: false
}

@property --tw-rotate-y {
  syntax: "*";
  inherits: false
}

@property --tw-rotate-z {
  syntax: "*";
  inherits: false
}

@property --tw-skew-x {
  syntax: "*";
  inherits: false
}

@property --tw-skew-y {
  syntax: "*";
  inherits: false
}

@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-outline-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-ease {
  syntax: "*";
  inherits: false
}

/*# sourceMappingURL=src_app_globals_0p2ml0n.css.map*/