@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 {
      --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-font-weight: initial;
      --tw-tracking: initial;
      --tw-shadow: 0 0 #0000;
      --tw-shadow-color: initial;
      --tw-shadow-alpha: 100%;
      --tw-inset-shadow: 0 0 #0000;
      --tw-inset-shadow-color: initial;
      --tw-inset-shadow-alpha: 100%;
      --tw-ring-color: initial;
      --tw-ring-shadow: 0 0 #0000;
      --tw-inset-ring-color: initial;
      --tw-inset-ring-shadow: 0 0 #0000;
      --tw-ring-inset: initial;
      --tw-ring-offset-width: 0px;
      --tw-ring-offset-color: #fff;
      --tw-ring-offset-shadow: 0 0 #0000;
    }

    ::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-font-weight: initial;
      --tw-tracking: initial;
      --tw-shadow: 0 0 #0000;
      --tw-shadow-color: initial;
      --tw-shadow-alpha: 100%;
      --tw-inset-shadow: 0 0 #0000;
      --tw-inset-shadow-color: initial;
      --tw-inset-shadow-alpha: 100%;
      --tw-ring-color: initial;
      --tw-ring-shadow: 0 0 #0000;
      --tw-inset-ring-color: initial;
      --tw-inset-ring-shadow: 0 0 #0000;
      --tw-ring-inset: initial;
      --tw-ring-offset-width: 0px;
      --tw-ring-offset-color: #fff;
      --tw-ring-offset-shadow: 0 0 #0000;
    }
  }
}

@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;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-400: #90a1b9;
    --color-slate-500: #62748e;
    --color-slate-700: #314158;
    --color-slate-800: #1d293d;
    --color-slate-900: #0f172b;
    --color-white: #fff;
    --spacing: .25rem;
    --text-sm: .875rem;
    --text-sm--line-height: calc(1.25 / .875);
    --text-base: 1rem;
    --text-base--line-height: calc(1.5 / 1);
    --text-lg: 1.125rem;
    --text-lg--line-height: calc(1.75 / 1.125);
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --tracking-tight: -.025em;
    --radius-xs: .125rem;
    --radius-sm: .25rem;
    --radius-md: .375rem;
    --radius-xl: .75rem;
    --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);
  }

  @supports (color: color(display-p3 0 0 0)) {
    :root, :host {
      --color-slate-100: color(display-p3 .947345 .959969 .97483);
      --color-slate-200: color(display-p3 .890322 .909405 .939294);
      --color-slate-400: color(display-p3 .577446 .629622 .716602);
      --color-slate-500: color(display-p3 .397645 .452653 .547642);
      --color-slate-700: color(display-p3 .205992 .253487 .336039);
      --color-slate-800: color(display-p3 .121994 .158688 .232363);
      --color-slate-900: color(display-p3 .0639692 .0891152 .163036);
    }
  }

  @supports (color: lab(0% 0 0)) {
    :root, :host {
      --color-slate-100: lab(96.286% -.852436 -2.46847);
      --color-slate-200: lab(91.7353% -.998765 -4.76968);
      --color-slate-400: lab(65.5349% -2.25151 -14.5072);
      --color-slate-500: lab(48.0876% -2.03595 -16.5814);
      --color-slate-700: lab(26.9569% -1.47016 -15.6993);
      --color-slate-800: lab(16.132% -.318035 -14.6672);
      --color-slate-900: lab(7.78673% 1.82345 -15.0537);
    }
  }
}

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

  ::backdrop {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  ::-webkit-file-upload-button {
    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%;
    -moz-tab-size: 4;
    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;
  }

  ::-webkit-file-upload-button {
    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:-webkit-any([multiple], [size])) optgroup {
    font-weight: bolder;
  }

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

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

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

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

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

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

  ::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-start: 0;
    padding-block-end: 0;
  }

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

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

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

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

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

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

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

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

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

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

  button {
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button;
  }

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

  ::-webkit-file-upload-button {
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button;
  }

  ::file-selector-button {
    -webkit-appearance: button;
    -moz-appearance: 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 {
  .absolute {
    position: absolute;
  }

  .fixed {
    position: fixed;
  }

  .relative {
    position: relative;
  }

  .static {
    position: static;
  }

  .end:not(:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
    right: var(--spacing);
  }

  .end:not(:-moz-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
    right: var(--spacing);
  }

  .end:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
    right: var(--spacing);
  }

  .end:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
    left: var(--spacing);
  }

  .end:-moz-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
    left: var(--spacing);
  }

  .end:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
    left: var(--spacing);
  }

  .flex {
    display: flex;
  }

  .hidden {
    display: none;
  }

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

  .h-8 {
    height: calc(var(--spacing) * 8);
  }

  .h-10 {
    height: calc(var(--spacing) * 10);
  }

  .h-12 {
    height: calc(var(--spacing) * 12);
  }

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

  .items-center {
    align-items: center;
  }

  .justify-center {
    justify-content: center;
  }

  .rounded-md {
    border-radius: var(--radius-md);
  }

  .rounded-xl {
    border-radius: var(--radius-xl);
  }

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

  .border-slate-200 {
    border-color: var(--color-slate-200);
  }

  .bg-slate-100 {
    background-color: var(--color-slate-100);
  }

  .bg-slate-900 {
    background-color: var(--color-slate-900);
  }

  .bg-transparent {
    background-color: #0000;
  }

  .bg-white {
    background-color: var(--color-white);
  }

  .px-3 {
    padding-inline: calc(var(--spacing) * 3);
  }

  .px-4 {
    padding-inline: calc(var(--spacing) * 4);
  }

  .px-6 {
    padding-inline: calc(var(--spacing) * 6);
  }

  .py-4 {
    padding-block: calc(var(--spacing) * 4);
  }

  .pt-6 {
    padding-top: calc(var(--spacing) * 6);
  }

  .pb-2 {
    padding-bottom: calc(var(--spacing) * 2);
  }

  .text-base {
    font-size: var(--text-base);
    line-height: var(--tw-leading, var(--text-base--line-height));
  }

  .text-lg {
    font-size: var(--text-lg);
    line-height: var(--tw-leading, var(--text-lg--line-height));
  }

  .text-sm {
    font-size: var(--text-sm);
    line-height: var(--tw-leading, var(--text-sm--line-height));
  }

  .font-medium {
    --tw-font-weight: var(--font-weight-medium);
    font-weight: var(--font-weight-medium);
  }

  .font-semibold {
    --tw-font-weight: var(--font-weight-semibold);
    font-weight: var(--font-weight-semibold);
  }

  .tracking-tight {
    --tw-tracking: var(--tracking-tight);
    letter-spacing: var(--tracking-tight);
  }

  .text-slate-500 {
    color: var(--color-slate-500);
  }

  .text-slate-700 {
    color: var(--color-slate-700);
  }

  .text-slate-900 {
    color: var(--color-slate-900);
  }

  .text-white {
    color: var(--color-white);
  }

  .italic {
    font-style: italic;
  }

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

  .shadow-sm {
    --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .transition-colors {
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  @media (hover: hover) {
    .hover\:bg-slate-100:hover {
      background-color: var(--color-slate-100);
    }
  }

  @media (hover: hover) {
    .hover\:bg-slate-200:hover {
      background-color: var(--color-slate-200);
    }
  }

  @media (hover: hover) {
    .hover\:bg-slate-800:hover {
      background-color: var(--color-slate-800);
    }
  }

  .focus-visible\:ring-2:focus-visible {
    --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .focus-visible\:ring-slate-400:focus-visible {
    --tw-ring-color: var(--color-slate-400);
  }

  .focus-visible\:outline-none:focus-visible {
    --tw-outline-style: none;
    outline-style: none;
  }

  .disabled\:pointer-events-none:disabled {
    pointer-events: none;
  }

  .disabled\:opacity-50:disabled {
    opacity: .5;
  }
}

:root {
  --brand: #7c6af7;
  --brand-dark: #6355d4;
  --brand-light: #9b8cf9;
  --brand-glow: #7c6af740;
  --brand-gradient: linear-gradient(135deg, #7c6af7 0%, #4f93e8 100%);
  --bg-body: #0b0b17;
  --bg-sidebar: #112;
  --bg-surface: #171728;
  --bg-elevated: #1e1e35;
  --bg-input: #1a1a2e;
  --bg-hover: #7c6af714;
  --bg-active: #7c6af726;
  --bg-msg-sent: linear-gradient(135deg, #3730a3 0%, #2563eb 100%);
  --bg-msg-recv: #1e1e35;
  --bg-overlay: #000000b3;
  --text-primary: #e8e8f4;
  --text-secondary: #88a;
  --text-muted: #55557a;
  --text-brand: #9b8cf9;
  --border: #ffffff12;
  --border-focus: #7c6af780;
  --online: #34d399;
  --danger: #f75c7c;
  --warn: #f7a35c;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

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

html, body, #root {
  width: 100%;
  height: 100%;
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  overflow: hidden;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

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

::-webkit-scrollbar-thumb {
  background: #7c6af74d;
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7c6af780;
}

::selection {
  background: #7c6af766;
}

a {
  color: var(--brand-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

input, textarea {
  font-family: var(--font);
  color: var(--text-primary);
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
}

button {
  font-family: var(--font);
  cursor: pointer;
  color: inherit;
  background: none;
  border: none;
}

.auth-page {
  background: radial-gradient(ellipse at 30% 20%, #7c6af726 0%, transparent 60%), radial-gradient(ellipse at 70% 80%, #4f93e81f 0%, transparent 60%), var(--bg-body);
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
  display: flex;
  overflow: auto;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  padding: 40px;
  box-shadow: 0 24px 80px #00000080, 0 0 0 1px #7c6af71a;
}

.auth-logo {
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  display: flex;
}

.auth-logo-icon {
  background: var(--brand-gradient);
  color: #fff;
  letter-spacing: -1px;
  width: 64px;
  height: 64px;
  box-shadow: 0 8px 24px var(--brand-glow);
  border-radius: 18px;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  font-weight: 800;
  display: flex;
}

.auth-title {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
}

.auth-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-top: 4px;
  font-size: 14px;
}

.form-field {
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  display: flex;
}

.form-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  color: var(--text-primary);
  padding: 12px 14px;
  font-size: 15px;
  transition: border-color .15s;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

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

.form-error {
  color: var(--danger);
  margin-top: 4px;
  font-size: 13px;
}

.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  color: var(--text-primary);
  cursor: pointer;
  padding: 10px 14px;
  font-size: 14px;
}

.form-select:focus {
  border-color: var(--border-focus);
  outline: none;
}

.btn {
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  transition: all .15s;
  display: inline-flex;
}

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

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 4px 16px var(--brand-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px #7c6af766;
}

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

.btn-ghost {
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  color: var(--danger);
  background: #f75c7c1f;
  border: 1px solid #f75c7c40;
}

.btn-danger:hover {
  background: #f75c7c33;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-icon {
  border-radius: var(--radius-xs);
  padding: 8px;
}

.messenger {
  background: var(--bg-body);
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  flex-direction: column;
  flex-shrink: 0;
  width: 320px;
  min-width: 280px;
  max-width: 360px;
  display: flex;
}

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

.sidebar-avatar {
  background: var(--brand-gradient);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 38px;
  height: 38px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  overflow: hidden;
}

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

.sidebar-title {
  color: var(--text-primary);
  flex: 1;
  font-size: 17px;
  font-weight: 700;
}

.sidebar-actions {
  align-items: center;
  gap: 2px;
  display: flex;
}

.icon-btn {
  width: 34px;
  height: 34px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  transition: all .15s;
  display: flex;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.search-wrap {
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
}

.search-input-wrap {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 24px;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  transition: border-color .15s;
  display: flex;
}

.search-input-wrap:focus-within {
  border-color: var(--border-focus);
}

.search-input-wrap input {
  flex: 1;
  font-size: 14px;
}

.search-input-wrap svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.folder-tabs {
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
  gap: 2px;
  padding: 6px 12px;
  display: flex;
  overflow-x: auto;
}

.folder-tabs::-webkit-scrollbar {
  display: none;
}

.folder-tab {
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  border-radius: 20px;
  flex-shrink: 0;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  display: flex;
}

.folder-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.folder-tab.active {
  background: var(--brand-gradient);
  color: #fff;
}

.chat-list {
  flex: 1;
  padding: 4px 0;
  overflow-y: auto;
}

.chat-item {
  cursor: pointer;
  border-radius: var(--radius-xs);
  align-items: center;
  gap: 12px;
  margin: 1px 6px;
  padding: 10px 14px;
  transition: background .12s;
  display: flex;
  position: relative;
}

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

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

.chat-item-avatar {
  color: #fff;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  position: relative;
  overflow: hidden;
}

.chat-item-avatar img {
  object-fit: cover;
  border-radius: 50%;
  width: 100%;
  height: 100%;
}

.online-dot {
  background: var(--online);
  border: 2px solid var(--bg-sidebar);
  border-radius: 50%;
  width: 12px;
  height: 12px;
  position: absolute;
  bottom: 1px;
  right: 1px;
}

.chat-item-body {
  flex: 1;
  min-width: 0;
}

.chat-item-top {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  display: flex;
}

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

.chat-item-time {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 12px;
}

.chat-item-preview {
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  display: flex;
}

.chat-item-last-msg {
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
  font-size: 13px;
  overflow: hidden;
}

.unread-badge {
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
}

.unread-badge.muted {
  background: var(--text-muted);
}

.chat-area {
  background: var(--bg-body);
  flex-direction: column;
  flex: 1;
  min-width: 0;
  display: flex;
  position: relative;
}

.chat-bg {
  pointer-events: none;
  background: radial-gradient(at 10% 90%, #7c6af70a 0%, #0000 50%), radial-gradient(at 90% 10%, #4f93e808 0%, #0000 50%);
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.chat-header {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  display: flex;
  position: relative;
}

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

.chat-header-name {
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
}

.chat-header-status {
  color: var(--text-secondary);
  font-size: 13px;
}

.chat-header-status.online {
  color: var(--online);
}

.chat-header-actions {
  align-items: center;
  gap: 2px;
  display: flex;
}

.message-list {
  flex-direction: column;
  flex: 1;
  gap: 2px;
  padding: 12px 16px;
  display: flex;
  position: relative;
  overflow-y: auto;
}

.date-divider {
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  display: flex;
}

.date-divider:before, .date-divider:after {
  content: "";
  background: var(--border);
  flex: 1;
  height: 1px;
}

.date-divider-label {
  color: var(--text-muted);
  background: var(--bg-elevated);
  white-space: nowrap;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 12px;
}

.message-row {
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
  display: flex;
}

.message-row.sent {
  flex-direction: row-reverse;
}

.message-row.sent .msg-avatar {
  display: none;
}

.msg-avatar {
  color: #fff;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-self: flex-end;
  align-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  overflow: hidden;
}

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

.msg-bubble-wrap {
  flex-direction: column;
  max-width: min(68%, 600px);
  display: flex;
}

.message-row.sent .msg-bubble-wrap {
  align-items: flex-end;
}

.msg-sender-name {
  color: var(--brand-light);
  margin-bottom: 3px;
  margin-left: 12px;
  font-size: 12px;
  font-weight: 600;
}

.msg-bubble {
  word-break: break-word;
  background: var(--bg-msg-recv);
  color: var(--text-primary);
  border-radius: 18px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

.message-row.sent .msg-bubble {
  background: var(--bg-msg-sent);
  border-radius: 18px 18px 4px;
}

.message-row.recv .msg-bubble {
  border-radius: 4px 18px 18px;
}

.msg-bubble.deleted {
  opacity: .5;
  color: var(--text-muted);
  font-style: italic;
}

.msg-reply {
  border-left: 3px solid var(--brand);
  background: #7c6af71a;
  border-radius: 0 6px 6px 0;
  margin-bottom: 6px;
  padding: 4px 8px;
  font-size: 12px;
}

.msg-reply-name {
  color: var(--brand-light);
  margin-bottom: 2px;
  font-weight: 600;
}

.msg-reply-content {
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.msg-forwarded {
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-size: 12px;
  font-style: italic;
}

.msg-media {
  border-radius: 10px;
  max-width: 100%;
  margin-bottom: 4px;
  overflow: hidden;
}

.msg-media img, .msg-media video {
  object-fit: cover;
  border-radius: 10px;
  max-width: 280px;
  max-height: 300px;
  display: block;
}

.msg-file {
  cursor: pointer;
  color: inherit;
  background: #ffffff0d;
  border-radius: 10px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  text-decoration: none;
  display: flex;
}

.msg-file:hover {
  background: #ffffff1a;
}

.msg-file-info {
  min-width: 0;
}

.msg-file-name {
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
}

.msg-file-size {
  color: var(--text-secondary);
  font-size: 11px;
}

.msg-meta {
  color: #fff6;
  -webkit-user-select: none;
  user-select: none;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 11px;
  display: flex;
}

.message-row.recv .msg-meta {
  color: var(--text-muted);
}

.msg-edited {
  font-style: italic;
}

.msg-reactions {
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  display: flex;
}

.msg-reaction {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  border-radius: 12px;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 13px;
  transition: all .15s;
  display: flex;
}

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

.msg-reaction.reacted {
  border-color: var(--brand);
  background: #7c6af726;
}

.msg-reaction-count {
  color: var(--text-secondary);
  font-size: 12px;
}

.msg-code {
  font-family: var(--font-mono);
  background: #ffffff1a;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 13px;
}

.msg-link {
  color: var(--brand-light);
  text-decoration: underline;
}

.msg-spoiler {
  color: #0000;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  background: #ffffff26;
  border-radius: 4px;
  padding: 0 4px;
  transition: all .2s;
}

.msg-spoiler:focus, .msg-spoiler.revealed {
  color: var(--text-primary);
  background: #ffffff14;
}

.msg-input-area {
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
  z-index: 10;
  padding: 12px 16px;
  position: relative;
}

.reply-preview {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 12px;
  display: flex;
}

.reply-preview-bar {
  background: var(--brand);
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
  width: 3px;
}

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

.reply-preview-name {
  color: var(--brand-light);
  font-size: 12px;
  font-weight: 600;
}

.reply-preview-text {
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  overflow: hidden;
}

.input-row {
  align-items: flex-end;
  gap: 10px;
  display: flex;
}

.input-wrap {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 24px;
  flex: 1;
  align-items: flex-end;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  transition: border-color .15s;
  display: flex;
}

.input-wrap:focus-within {
  border-color: var(--border-focus);
}

.input-wrap textarea {
  resize: none;
  flex: 1;
  align-self: center;
  max-height: 140px;
  font-size: 15px;
  line-height: 1.5;
  overflow-y: auto;
}

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

.attach-btn {
  color: var(--text-secondary);
  transition: color .15s;
}

.attach-btn:hover {
  color: var(--brand-light);
}

.send-btn {
  background: var(--brand-gradient);
  color: #fff;
  width: 46px;
  height: 46px;
  box-shadow: 0 4px 12px var(--brand-glow);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  transition: all .15s;
  display: flex;
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px #7c6af780;
}

.send-btn:active {
  transform: scale(.97);
}

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

.ctx-menu {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 1000;
  min-width: 170px;
  padding: 4px;
  animation: .1s fadeIn;
  position: fixed;
  box-shadow: 0 8px 32px #0006;
}

.ctx-item {
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 14px;
  transition: background .1s;
  display: flex;
}

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

.ctx-item.danger {
  color: var(--danger);
}

.ctx-sep {
  background: var(--border);
  height: 1px;
  margin: 4px 0;
}

.empty-chat {
  color: var(--text-muted);
  flex-direction: column;
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 40px;
  display: flex;
}

.empty-chat-icon {
  background: var(--bg-elevated);
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  display: flex;
}

.empty-chat-title {
  color: var(--text-secondary);
  font-size: 20px;
  font-weight: 600;
}

.empty-chat-desc {
  text-align: center;
  max-width: 280px;
  font-size: 14px;
}

.modal-overlay {
  background: var(--bg-overlay);
  z-index: 500;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  padding: 16px;
  animation: .15s fadeIn;
  display: flex;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  animation: .2s slideUp;
  display: flex;
  overflow: hidden;
  box-shadow: 0 24px 80px #00000080;
}

.modal-header {
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  display: flex;
}

.modal-title {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
}

.modal-body {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
}

.modal-footer {
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  gap: 10px;
  padding: 16px 24px;
  display: flex;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section-title {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
}

.settings-row {
  border-radius: var(--radius-sm);
  cursor: pointer;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  transition: background .12s;
  display: flex;
}

.settings-row:hover {
  background: var(--bg-hover);
}

.settings-row-label {
  color: var(--text-primary);
  font-size: 14px;
}

.settings-row-value {
  color: var(--text-secondary);
  font-size: 13px;
}

.toggle {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  cursor: pointer;
  border-radius: 12px;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  transition: all .2s;
  position: relative;
}

.toggle.on {
  background: var(--brand);
  border-color: var(--brand);
}

.toggle:after {
  content: "";
  background: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  transition: transform .2s;
  position: absolute;
  top: 2px;
  left: 2px;
}

.toggle.on:after {
  transform: translateX(18px);
}

.user-list-item {
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  transition: background .12s;
  display: flex;
}

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

.user-list-item.selected {
  background: var(--bg-active);
}

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

.user-item-name {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

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

.profile-avatar-wrap {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  display: flex;
}

.profile-avatar {
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  width: 80px;
  height: 80px;
  font-size: 30px;
  font-weight: 700;
  display: flex;
  position: relative;
  overflow: hidden;
}

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

.profile-avatar-overlay {
  opacity: 0;
  background: #00000080;
  justify-content: center;
  align-items: center;
  transition: opacity .15s;
  display: flex;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.profile-avatar:hover .profile-avatar-overlay {
  opacity: 1;
}

.checkbox-wrap {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  align-items: flex-start;
  gap: 10px;
  display: flex;
}

.checkbox-box {
  border: 2px solid var(--border);
  background: var(--bg-input);
  border-radius: 4px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 18px;
  transition: all .15s;
  display: flex;
}

.checkbox-box.checked {
  background: var(--brand);
  border-color: var(--brand);
}

.checkbox-text {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.typing-indicator {
  align-items: center;
  gap: 3px;
  padding: 2px 0;
  display: flex;
}

.typing-dot {
  background: var(--brand-light);
  border-radius: 50%;
  width: 6px;
  height: 6px;
  animation: 1.2s infinite typingBounce;
}

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

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

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

.emoji-btn {
  border-radius: var(--radius-xs);
  cursor: pointer;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  font-size: 20px;
  transition: background .12s;
  display: flex;
}

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

.spinner {
  border: 2px solid #fff3;
  border-top-color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: .7s linear infinite spin;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

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

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

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

  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@media (max-width: 700px) {
  .sidebar {
    width: 100%;
    max-width: 100%;
  }

  .chat-area.hidden, .sidebar.hidden {
    display: none;
  }
}

@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-font-weight {
  syntax: "*";
  inherits: false
}

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

@property --tw-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

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

@property --tw-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-inset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

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

@property --tw-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-ring-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

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

@property --tw-ring-offset-width {
  syntax: "<length>";
  inherits: false;
  initial-value: 0;
}

@property --tw-ring-offset-color {
  syntax: "*";
  inherits: false;
  initial-value: #fff;
}

@property --tw-ring-offset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

