/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@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-font-weight: 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;
      --tw-outline-style: solid;
      --tw-blur: initial;
      --tw-brightness: initial;
      --tw-contrast: initial;
      --tw-grayscale: initial;
      --tw-hue-rotate: initial;
      --tw-invert: initial;
      --tw-opacity: initial;
      --tw-saturate: initial;
      --tw-sepia: initial;
      --tw-drop-shadow: initial;
      --tw-drop-shadow-color: initial;
      --tw-drop-shadow-alpha: 100%;
      --tw-drop-shadow-size: initial;
      --tw-duration: initial;
      --tw-content: "";
    }
  }
}

@font-face {
  font-family: Vazirmatn;
  src: url("../assets/Vazirmatn-FD-Thin.woff2") format("woff2");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("../assets/Vazirmatn-FD-ExtraLight.woff2") format("woff2");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("../assets/Vazirmatn-FD-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("../assets/Vazirmatn-FD-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("../assets/Vazirmatn-FD-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("../assets/Vazirmatn-FD-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("../assets/Vazirmatn-FD-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("../assets/Vazirmatn-FD-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("../assets/Vazirmatn-FD-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@layer theme {
  :root, :host {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
      "Noto Sans", Arial, 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;
    --text-sm: .875rem;
    --text-sm--line-height: calc(1.25 / .875);
    --font-weight-semibold: 600;
    --radius-sm: .25rem;
    --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, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, 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;
    -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:where(:not(iframe)) {
    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 {
  .collapse {
    visibility: collapse;
  }

  .visible {
    visibility: visible;
  }

  .sr-only {
    clip-path: inset(50%);
    white-space: nowrap;
    border-width: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    position: absolute;
    overflow: hidden;
  }

  .absolute {
    position: absolute;
  }

  .fixed {
    position: fixed;
  }

  .relative {
    position: relative;
  }

  .static {
    position: static;
  }

  .sticky {
    position: sticky;
  }

  .top-2 {
    top: calc(var(--spacing) * 2);
  }

  .left-2 {
    left: calc(var(--spacing) * 2);
  }

  .container {
    width: 100%;
  }

  @media (min-width: 40rem) {
    .container {
      max-width: 40rem;
    }
  }

  @media (min-width: 48rem) {
    .container {
      max-width: 48rem;
    }
  }

  @media (min-width: 64rem) {
    .container {
      max-width: 64rem;
    }
  }

  @media (min-width: 80rem) {
    .container {
      max-width: 80rem;
    }
  }

  @media (min-width: 96rem) {
    .container {
      max-width: 96rem;
    }
  }

  .block {
    display: block;
  }

  .contents {
    display: contents;
  }

  .flex {
    display: flex;
  }

  .grid {
    display: grid;
  }

  .hidden {
    display: none;
  }

  .inline {
    display: inline;
  }

  .table {
    display: table;
  }

  .size-4 {
    width: calc(var(--spacing) * 4);
    height: calc(var(--spacing) * 4);
  }

  .min-w-0 {
    min-width: 0;
  }

  .flex-1 {
    flex: 1;
  }

  .flex-shrink, .shrink {
    flex-shrink: 1;
  }

  .border-collapse {
    border-collapse: collapse;
  }

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

  .scrollbar-none {
    scrollbar-width: none;
  }

  .flex-col {
    flex-direction: column;
  }

  .flex-row {
    flex-direction: row;
  }

  .flex-wrap {
    flex-wrap: wrap;
  }

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

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

  .gap-0 {
    gap: 0;
  }

  .gap-1 {
    gap: var(--spacing);
  }

  .gap-6 {
    gap: calc(var(--spacing) * 6);
  }

  .overflow-x-auto {
    overflow-x: auto;
  }

  .rounded-full {
    border-radius: 3.40282e38px;
  }

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

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

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

  .border-\[hsl\(0_0\%_100\%\/0\.1\)\] {
    border-color: #ffffff1a;
  }

  .px-1 {
    padding-inline: var(--spacing);
  }

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

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

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

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

  .text-left {
    text-align: left;
  }

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

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

  .whitespace-nowrap {
    white-space: nowrap;
  }

  .text-\[hsl\(0_0\%_64\%\)\] {
    color: #a3a3a3;
  }

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

  .ring {
    --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(1px + 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);
  }

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

  .blur {
    --tw-blur: blur(8px);
    filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
  }

  .filter {
    filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
  }

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

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

  .duration-150 {
    --tw-duration: .15s;
    transition-duration: .15s;
  }

  .outline-none {
    --tw-outline-style: none;
    outline-style: none;
  }

  .select-none {
    -webkit-user-select: none;
    user-select: none;
  }

  .after\:absolute:after {
    content: var(--tw-content);
    position: absolute;
  }

  .after\:inset-x-0:after {
    content: var(--tw-content);
    inset-inline: 0;
  }

  .after\:inset-y-1:after {
    content: var(--tw-content);
    inset-block: var(--spacing);
  }

  .after\:-bottom-px:after {
    content: var(--tw-content);
    bottom: -1px;
  }

  .after\:-left-px:after {
    content: var(--tw-content);
    left: -1px;
  }

  .after\:h-0\.5:after {
    content: var(--tw-content);
    height: calc(var(--spacing) * .5);
  }

  .after\:w-0\.5:after {
    content: var(--tw-content);
    width: calc(var(--spacing) * .5);
  }

  .after\:rounded-full:after {
    content: var(--tw-content);
    border-radius: 3.40282e38px;
  }

  .after\:bg-\[hsl\(0_0\%_100\%\)\]:after {
    content: var(--tw-content);
    background-color: #fff;
  }

  .after\:opacity-0:after {
    content: var(--tw-content);
    opacity: 0;
  }

  .after\:transition-opacity:after {
    content: var(--tw-content);
    transition-property: opacity;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  .after\:duration-150:after {
    content: var(--tw-content);
    --tw-duration: .15s;
    transition-duration: .15s;
  }

  @media (hover: hover) {
    .hover\:bg-\[hsl\(0_0\%_100\%\/0\.06\)\]:hover {
      background-color: #ffffff0f;
    }

    .hover\:text-\[hsl\(0_0\%_92\%\)\]:hover {
      color: #ebebeb;
    }
  }

  .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-\[hsl\(0_0\%_100\%\/0\.35\)\]:focus-visible {
    --tw-ring-color: #ffffff59;
  }

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

  .focus-visible\:ring-offset-\[hsl\(0_0\%_7\%\)\]:focus-visible {
    --tw-ring-offset-color: #121212;
  }

  .disabled\:cursor-not-allowed:disabled {
    cursor: not-allowed;
  }

  .disabled\:opacity-40:disabled {
    opacity: .4;
  }

  .aria-selected\:bg-\[hsl\(0_0\%_25\%\)\][aria-selected="true"] {
    background-color: #404040;
  }

  .aria-selected\:text-\[hsl\(0_0\%_100\%\)\][aria-selected="true"] {
    color: #fff;
  }

  .aria-selected\:after\:opacity-100[aria-selected="true"]:after {
    content: var(--tw-content);
    opacity: 1;
  }

  @media (min-width: 48rem) {
    .md\:hidden {
      display: none;
    }
  }
}

:root {
  --background: #fff;
  --foreground: #353638;
  --sidebar-background: #f7f7f8;
  --sidebar-hover: #ededed;
  --sidebar-active: #e6e6e6;
  --border: #e6e6e6;
  --muted: #6b6b6b;
  --sidebar-color: #fff;
  --muted-foreground: #8c8c8c;
  --input-background: #fff;
  --input-border: #d9d9d9;
  --button-hover: #f2f2f2;
  --accent: #171717;
  --accent-foreground: #fff;
  --tooltip-background: #212121;
  --tooltip-foreground: #fafafa;
  --tooltip-border: #404040;
  --composer-background: #f5f5f5;
  --composer-hover: #e3e3e3;
  --composer-ring: #00000014;
  --composer-ring-focus: #0000002e;
  --message-bubble: #e8f3fe;
  --message-bubble-text: #0c274a;
  --code-background: #f3f3f3;
  --code-header: #f3f3f3;
  --code-border: #d8dee4;
  --code-foreground: #24292f;
  --profile-name: #353638;
  --sidebar-border: #e0e0e0;
  --group-divider: #e3e3e3;
  --dropdown-background: #fff;
  --dropdown-hover: #f0f0f0;
  --toolbar-background: #fff;
  --toolbar-border: #dbdbdb;
  --toolbar-hover: #f0f0f0;
  --new-chat-background: #fff;
  --new-chat-foreground: #353638;
  --new-chat-border: #d9d9d9;
  --attachment-border: #d6d6d6;
  --attachment-hover: #f5f5f5;
  --attachment-remove-background: #353638;
  --attachment-remove-foreground: #fff;
  --attachment-remove-border: #353638;
  --file-icon-background: #eceff3;
  --file-icon-foreground: #475466;
  --file-icon-border: #cfd5de;
  --think-active-background: #e8f1ff;
  --think-active-foreground: #245fab;
  --think-active-border: #a9c5ed;
  --radius: 12px;
  --font-sans: "Nunito";
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;
  --scrollbar-track-bg: transparent;
  --scrollbar-thumb-bg: #0000002e;
  --scrollbar-thumb-hover: #00000052;
  --scrollbar-size: 8px;
}

[data-theme="dark"] {
  --background: #151517;
  --foreground: #ededed;
  --sidebar-background: #1b1b1c;
  --sidebar-hover: #ffffff1a;
  --sidebar-active: #ffffff1a;
  --border: #3b3b3b;
  --muted: #a1a1a1;
  --muted-foreground: #8c8c8c;
  --input-background: #2c2c2e;
  --input-border: #545454;
  --button-hover: #303030;
  --accent: #fff;
  --accent-foreground: #171717;
  --tooltip-background: #43454a;
  --tooltip-foreground: #fff;
  --tooltip-border: #d1d1d1;
  --composer-background: #2c2c2e;
  --composer-hover: #ffffff14;
  --composer-ring: #ffffff0f;
  --composer-ring-focus: #ffffff24;
  --message-bubble: #2c2c2e;
  --message-bubble-text: #f9fafb;
  --code-background: #1b1b1c;
  --code-header: #2c2c2e;
  --code-border: #343943;
  --code-foreground: #e6edf3;
  --sidebar-border: #ffffff1a;
  --group-divider: #ffffff0f;
  --dropdown-background: #353638;
  --dropdown-hover: #454648;
  --toolbar-background: #353638;
  --toolbar-border: #ffffff1f;
  --toolbar-hover: #ffffff14;
  --new-chat-background: #43454a;
  --new-chat-foreground: #f3f4f6;
  --new-chat-border: transparent;
  --attachment-border: #ffffff1f;
  --attachment-hover: #ffffff14;
  --attachment-remove-background: #fff;
  --attachment-remove-foreground: #151517;
  --attachment-remove-border: #545454;
  --file-icon-background: #212121;
  --file-icon-foreground: #e6e6e6;
  --file-icon-border: #414141;
  --think-active-background: #283142;
  --think-active-foreground: #679efe;
  --think-active-border: #4868b2;
  --scrollbar-track-bg: transparent;
  --scrollbar-thumb-bg: #ffffff1a;
  --scrollbar-thumb-hover: #fff3;
  --scrollbar-size: 8px;
  --profile-name: #cfd3d6;
}

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
}

html {
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizelegibility;
}

[dir="rtl"] {
  font-family: Vazirmatn, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
}

body {
  overflow: hidden;
}

body.modal-open .app {
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

body.sidebar-drawer-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
}

.app {
  background: var(--background);
  width: 100%;
  height: 100dvh;
  display: flex;
  overflow: hidden;
}

.main {
  overscroll-behavior: contain;
  background: var(--background);
  flex-direction: column;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  position: relative;
  overflow: hidden auto;
}

.backdrop {
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  -webkit-backdrop-filter: blur();
  backdrop-filter: blur();
  background: #0006;
  transition: opacity .24s, visibility .24s, -webkit-backdrop-filter .24s, backdrop-filter .24s;
  position: fixed;
  inset: 0;
}

.backdrop.open {
  opacity: 1;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-bg) var(--scrollbar-track-bg);
}

::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
  background: var(--scrollbar-track-bg);
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb-bg);
  border-radius: 9999px;
  transition: background-color .2s ease-in-out;
}

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

::-webkit-scrollbar-corner {
  background: var(--scrollbar-track-bg);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@property --tw-content {
  syntax: "*";
  inherits: false;
  initial-value: "";
}
/* ===== Shared controls ================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

.btn:hover {
  background: var(--button-hover);
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-foreground);
}
.btn-primary:hover {
  opacity: 0.86;
  background: var(--accent);
}
.btn-outline {
  border-color: var(--input-border);
  background: var(--input-background);
}
.btn-outline:hover {
  border-color: var(--muted);
}
.btn-icon {
  width: 36px;
  padding: 0;
}
.btn-block {
  width: 100%;
}

/* Asset-backed icons inherit currentColor through an SVG mask. */
.icon-asset {
  display: inline-block;
  flex: 0 0 auto;
  width: var(--icon-size, 18px);
  height: var(--icon-size, 18px);
  background-color: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

/* ===== Sidebar ========================================================= */
/* Sidebar side is set by `data-sidebar-side` on `.app`:
   - auto (default): left in LTR, right in RTL, following `dir` on <html>.
   - left / right: pinned to that physical side in every direction.
   Text inside always follows `dir`. */
[dir="rtl"] .app[data-sidebar-side="left"],
[dir="ltr"] .app[data-sidebar-side="right"] {
  flex-direction: row-reverse;
}

:is(.app[data-sidebar-side="left"], [dir="ltr"] .app[data-sidebar-side="auto"]) .sidebar {
  border-right: 1px solid var(--sidebar-border);
}

:is(.app[data-sidebar-side="right"], [dir="rtl"] .app[data-sidebar-side="auto"]) .sidebar {
  border-left: 1px solid var(--sidebar-border);
}

/* The header sidebar icon points at the docked side. */
:is(.app[data-sidebar-side="right"], [dir="rtl"] .app[data-sidebar-side="auto"]) .sidebar-collapse-button .icon-asset,
:is(.app[data-sidebar-side="right"], [dir="rtl"] .app[data-sidebar-side="auto"]) [data-sidebar-expand] .icon-asset {
  transform: scaleX(-1);
}

.sidebar {
  position: relative;
  z-index: 50;
  display: flex;
  flex: 0 0 260px;
  flex-direction: column;
  width: 260px;
  height: 100%;
  overflow: hidden;
  background: var(--sidebar-background);
  color: var(--foreground);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    width 180ms ease,
    flex-basis 180ms ease;

  /* Built-in conversation icon for the collapsed rail. */
  --conversation-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

.sidebar-header {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 3px;
  padding: 6px 9px 0;
}
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 8px;
  color: var(--foreground);
  font-size: 15px;
  font-weight: 650;
  text-align: start;
}
.sidebar-brand:hover {
  background: var(--sidebar-hover);
}
.sidebar-brand > .icon-asset {
  color: var(--foreground);
}
.sidebar-brand-text {
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-extra-actions {
  margin-bottom: 12px;
}
.sidebar-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 33px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--foreground);
  font-size: 14px;
  text-align: start;
  transition: background 120ms ease;
}
.sidebar-button:hover {
  background: var(--sidebar-hover);
}
.sidebar-icon {
  display: inline-flex;
  color: currentColor;
}
.conversation-container {
  --fade: 28px;
  --fade-top: 0px; /* driven by the animation / data-scroll */
  --fade-bottom: 0px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-top: 0;
  padding-inline: 6px;
  /* --- the actual fade --- */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0px, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0px, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.conversation-group:not(:last-child) {
  margin-bottom: 18px;
  border-bottom: 1px solid var(--group-divider);
  padding-bottom: 20px;
}

.conversation-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 10px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.conversation-entry {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 8px;
}
.conversation-entry:hover,
.conversation-entry:focus-within,
.conversation-entry:has(.conversation.active) {
  background: var(--sidebar-hover);
}
.conversation {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 9px 10px;
  overflow: hidden;
  border-radius: 8px;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 700;
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    background 120ms ease,
    color 120ms ease;
}
.conversation:hover {
  color: var(--foreground);
}
.conversation.active {
  color: var(--foreground);
}
.conversation-entry:has(.conversation.active) {
  background: var(--sidebar-active);
}
.conversation-more {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-inline-end: 4px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 140ms ease,
    background 140ms ease,
    color 140ms ease;
}
.conversation-entry:hover .conversation-more,
.conversation-entry:focus-within .conversation-more,
.conversation-entry.menu-open .conversation-more {
  opacity: 1;
  pointer-events: auto;
}
.conversation-more:hover,
.conversation-entry.menu-open .conversation-more {
  background: var(--button-hover);
  color: var(--foreground);
}
.conversation-more:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
.conversation-entry.menu-open {
  background: var(--sidebar-hover);
}

/* Inline rename field replaces the row's button while editing. */
.conversation-entry.renaming .conversation,
.conversation-entry.renaming .conversation-more {
  display: none;
}
.conversation-rename {
  flex: 1;
  min-width: 0;
  height: 38px;
  margin: 0 4px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--input-border));
  border-radius: 8px;
  outline: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 700;
}

/* Multi-select mode. */
.conversation-container.is-selecting .conversation-more {
  display: none;
}
.conversation-container {
  --check-accent: #4d6bfe;
  --check-border: color-mix(in srgb, var(--foreground) 24%, transparent);
}
/* Round selection checkbox: light ring when empty, solid blue with a white tick when chosen. */
.conversation-check {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-inline: 8px 2px;
  border: 1.5px solid var(--check-border);
  border-radius: 50%;
  background: transparent center / 14px no-repeat;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.conversation-check:hover {
  border-color: color-mix(in srgb, var(--foreground) 45%, transparent);
}
.conversation-check:checked {
  border-color: var(--check-accent);
  background-color: var(--check-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.6l2.7 2.7L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  box-shadow: 0 1px 3px color-mix(in srgb, var(--check-accent) 45%, transparent);
}
.conversation-check:focus-visible {
  outline: 2px solid var(--check-accent);
  outline-offset: 2px;
}

/* Toggle beside the group title that turns multi-select on and off. */
.group-action {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-foreground);
  transition: background 120ms ease, color 120ms ease;
}
.group-action:hover {
  background: var(--sidebar-hover);
  color: var(--foreground);
}
.group-action[aria-pressed="true"] {
  background: color-mix(in srgb, var(--check-accent) 14%, transparent);
  color: var(--check-accent);
}
.conversation-entry.selected {
  background: var(--sidebar-active);
}
.selection-bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--sidebar-border);
}
.selection-bar[hidden] {
  display: none;
}
.selection-bar__count {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.selection-bar__button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: transparent;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
}
.selection-bar__button:hover:not(:disabled) {
  background: var(--sidebar-hover);
}
.selection-bar__button--danger {
  border-color: transparent;
  background: #e5322d;
  color: #fff;
}
.selection-bar__button--danger:hover:not(:disabled) {
  background: #cf2a26;
}
.selection-bar__button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* Conversation options menu. It lives in <body> (see scripts/sidebar.ts), above the
   sidebar (z-index 50) and backdrop (40) but below modals (120). */
.conversation-menu {
  position: fixed;
  z-index: 90;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--dropdown-background);
  box-shadow: 0 12px 35px hsl(0 0% 0% / 0.14), 0 2px 8px hsl(0 0% 0% / 0.06);
  animation: conversation-menu-in 120ms ease;
}
.conversation-menu[hidden] {
  display: none;
}
.conversation-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--foreground);
  font-size: 15px;
  font-weight: 500;
  text-align: start;
  white-space: nowrap;
}
.conversation-menu__item:hover,
.conversation-menu__item:focus-visible {
  outline: 0;
  background: var(--dropdown-hover);
}
.conversation-menu__item--danger {
  color: #e5322d;
}
@keyframes conversation-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

.app-download-card {
  position: fixed;
  z-index: 95;
  width: 148px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--dropdown-background);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  animation: conversation-menu-in 120ms ease;
}
.app-download-card[hidden] { display: none; }
.app-download-card__qr {
  display: grid;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
}
.app-download-card__qr img { width: 100%; height: auto; aspect-ratio: 1; display: block; }
.app-download-card__caption {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

/* ===== Search dialog (Ctrl/Cmd+K) ======================================= */
.search-dialog {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.search-dialog[hidden] { display: none; }
.search-dialog__backdrop { position: absolute; inset: 0; background: hsl(0 0% 0% / 0.45); animation: search-fade 120ms ease; }
.search-dialog__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(560px, 76vh);
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--dropdown-background, var(--background));
  color: var(--foreground);
  box-shadow: 0 24px 80px hsl(0 0% 0% / 0.35);
  animation: search-pop 140ms ease;
}
@keyframes search-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes search-pop { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .search-dialog__backdrop, .search-dialog__panel { animation: none; } }

.search-dialog__field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 8px 0 14px;
  border-radius: 14px;
  background: var(--composer-background);
  color: var(--muted);
}
.search-dialog__field:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.search-dialog__field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 15px;
}
.search-dialog__field input::-webkit-search-cancel-button { display: none; }
.search-dialog__close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.search-dialog__close:hover { background: var(--button-hover); color: var(--foreground); }
.search-dialog__label { margin: 12px 10px 4px; color: var(--muted-foreground); font-size: 12px; font-weight: 600; }
.search-dialog__results { margin: 0; padding: 0; list-style: none; overflow-y: auto; }
.search-dialog__result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.search-dialog__result[aria-selected='true'], .search-dialog__result:hover { background: var(--button-hover); }
.search-dialog__result .icon-asset { flex: none; color: var(--muted); }
.search-dialog__text { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 1px; }
.search-dialog__title { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.search-dialog__snippet { overflow: hidden; color: var(--muted-foreground); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.search-dialog mark { padding: 0; border-radius: 3px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; }
.search-dialog__empty { margin: 0; padding: 26px 10px; color: var(--muted-foreground); font-size: 14px; text-align: center; }
.search-dialog__empty[hidden] { display: none; }
.search-dialog__hint { margin: 8px 10px 0; color: var(--muted-foreground); font-size: 11px; text-align: end; }
@media (max-width: 480px) { .search-dialog { padding-top: 8vh; } .search-dialog__hint { display: none; } }

.sidebar-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 130;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--tooltip-background);
  color: var(--tooltip-foreground);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.sidebar-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.conversation-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-title-writing .conversation-title-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(4px);
  animation: conversation-word-in 260ms ease forwards;
}

.conversation-title-word + .conversation-title-word {
  animation-delay: 260ms;
}

@keyframes conversation-word-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .conversation-title-writing .conversation-title-word {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
.sidebar-footer {
  flex: 0 0 auto;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  text-align: start;
  transition: background 120ms ease;
}
.profile:hover {
  background: var(--sidebar-hover);
}
.profile-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 0px;
}
.profile-name,
.profile-plan {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--profile-name);
}
.profile-plan {
  color: var(--muted-foreground);
  font-size: 11px;
}
.profile-dropdown {
  width: 100%;
}
.profile-trigger {
  justify-content: flex-start;
}
.profile-chevron {
  display: inline-flex;
  margin-inline-start: auto;
  color: var(--muted-foreground);
  transition: transform 140ms ease;
}
.profile-dropdown .dropdown-menu {
  top: auto;
  bottom: calc(100% + 8px);
  width: min(260px, calc(100vw - 24px));
}
.account-menu-item {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
}
.account-menu-item > svg,
.account-menu-item > .icon-asset {
  flex: 0 0 auto;
  color: var(--muted);
}
.account-menu-item > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu-offer {
  color: var(--foreground);
  font-weight: 600;
}
.account-menu-offer > svg,
.account-menu-offer > .icon-asset {
  color: var(--accent);
}
.account-menu-danger {
  color: #c53d3d;
}
.account-menu-danger > svg,
.account-menu-danger > .icon-asset {
  color: currentColor;
}
.dropdown-separator {
  height: 1px;
  margin: 5px 4px;
  background: var(--border);
}

/* =====================================================================
   Sidebar header, quick links
   ===================================================================== */
.sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-block: 8px;
}
.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-new-tip {
  display: flex;
  width: 100%;
}
.sidebar-new-tip > #newChat {
  flex: 1 1 auto;
}
.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 4px 3px 10px;
}
.sidebar-link {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 600;
}
.sidebar-link:hover {
  background: var(--sidebar-hover);
}
.sidebar-link > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Collapsed desktop sidebar: fully hidden. The chat header exposes the
   controls needed to restore it (see .mobile-chat-brand). */
.app[data-sidebar-side] .sidebar.collapsed {
  border-width: 0;
}
.sidebar.collapsed {
  flex-basis: 0;
  width: 0;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* ===== Avatar, badges and tooltips ==================================== */
.avatar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #27ae60;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
.avatar-md {
  width: 34px;
  height: 34px;
}
.avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 17px;
}
.avatar-circle {
  border-radius: 50%;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}
.badge-neutral {
  background: var(--sidebar-hover);
  color: var(--muted);
}
.badge-accent {
  background: var(--accent);
  color: var(--accent-foreground);
}
.badge-outline {
  border: 1px solid var(--input-border);
  color: var(--muted);
}
/* ===== Dropdown ======================================================= */
.dropdown {
  position: relative;
  display: inline-flex;
}
.dropdown-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  inset-inline-start: 0;
  display: flex;
  width: max-content;
  flex-direction: column;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--dropdown-background);
  box-shadow: 0 12px 35px hsl(0 0% 0% / 0.14);
  opacity: 0;
  max-width: fit-content;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 120ms ease,
    visibility 120ms ease,
    transform 120ms ease;
}
.dropdown-menu[data-placement-y="top"] {
  transform: translateY(4px);
}
.dropdown-menu.end {
  inset-inline-end: 0;
  inset-inline-start: auto;
}
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  max-width: fit-content;
}
.dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--foreground);
  font-size: 14px;
  text-align: start;
  font-weight: 700;
}
.dropdown-item > span:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dropdown-item:hover,
.dropdown-item[aria-selected="true"] {
  background: var(--dropdown-hover);
}
.dropdown-item-desc {
  color: var(--muted-foreground);
  font-size: 11px;
}

.dropdown-item.account-menu-item {
  flex-direction: row;
}

.profile-dropdown .account-menu-item {
  font-weight: 600;
}

.profile-dropdown .account-menu-item svg,
.profile-dropdown .account-menu-item .icon-asset {
  width: 19px;
  height: 19px;
  color: var(--foreground);
}

/* ===== Modal and settings ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: hsl(0 0% 0% / 0.46);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    visibility 160ms ease;
}
.modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal-panel {
  width: min(100%, 570px);
  max-height: min(680px, calc(100dvh - 40px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--background);
  box-shadow: 0 24px 80px hsl(0 0% 0% / 0.25);
  transform: translateY(8px) scale(0.98);
  transition: transform 160ms ease;
}
.modal.open .modal-panel {
  transform: translateY(0) scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.modal-body {
  padding: 0 20px 20px;
}
.settings-tabs {
  display: flex;
  gap: 4px;
  margin: 16px 0;
  padding: 4px;
  border-radius: 9px;
  background: var(--sidebar-background);
}
.settings-tab {
  flex: 1;
  min-height: 34px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
}
.settings-tab:hover {
  color: var(--foreground);
}
.settings-tab[aria-selected="true"] {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 3px hsl(0 0% 0% / 0.08);
}
.settings-panel[hidden] {
  display: none;
}
.settings-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-child {
  border-bottom: 0;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.settings-label {
  font-size: 13px;
  font-weight: 600;
}
.settings-hint {
  margin-top: 4px;
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.4;
}
.settings-control {
  width: min(220px, 45%);
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-background);
  color: var(--foreground);
  font-size: 13px;
}
.settings-control:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: 1px;
}

/* Settings dialog layout inspired by the account settings reference. */
.settings-modal {
  --settings-surface: #f7f7f8;
  --settings-raised: #ececef;
  --settings-hover: #e5e5e8;
  --settings-active: #dedee2;
  --settings-line: #dddddf;
  background: hsl(0 0% 0% / 0.62);
  backdrop-filter: blur(5px);
}

[data-theme="dark"] .settings-modal {
  --settings-surface: #2c2c2f;
  --settings-raised: #46474c;
  --settings-hover: #3a3a3d;
  --settings-active: #56565a;
  --settings-line: #3a3a3d;
}

.settings-modal .modal-panel {
  display: flex;
  flex-direction: column;
  width: min(700px, 100%);
  height: min(460px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: var(--settings-surface);
  box-shadow: 0 30px 100px hsl(0 0% 0% / 0.45);
}

.settings-modal .modal-header {
  flex: 0 0 auto;
  padding: 16px 20px 10px;
  border-bottom: 0;
}

.settings-modal .modal-title {
  font-size: 16px;
  font-weight: 700;
}

.settings-modal .modal-header .btn-icon {
  width: 28px;
  min-height: 28px;
  border-radius: 999px;
}

.settings-modal .modal-body {
  flex: 1;
  min-height: 0;
  padding: 0 20px 20px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 28px;
  height: 100%;
}

.settings-modal .settings-tabs {
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 5px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.settings-modal .settings-tab {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 11px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
  text-align: start;
  transition: background 140ms ease;
}

.settings-modal .settings-tab .icon-asset {
  width: 16px;
  height: 16px;
}

.settings-modal .settings-tab:hover {
  background: var(--settings-hover);
  color: var(--foreground);
}

.settings-modal .settings-tab[aria-selected="true"] {
  background: var(--settings-active);
  color: var(--foreground);
  box-shadow: none;
}

.settings-content {
  min-width: 0;
  overflow: auto;
  padding-inline-end: 1px;
}

.settings-section-title {
  margin: 3px 0 10px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 700;
}

.settings-theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.settings-theme-option {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  height: 76px;
  border: 1px solid var(--settings-line);
  border-radius: 11px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease;
}

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

.settings-theme-option[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--foreground) 14%, var(--settings-line));
  background: var(--settings-raised);
}

.settings-theme-option > svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.settings-preference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 16px;
  border-bottom: 1px solid var(--settings-line);
  font-size: 13px;
  font-weight: 600;
}

.settings-preference-row:last-child {
  border-bottom: 0;
}

.settings-select-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 90px;
  min-height: 36px;
  border-radius: 999px;
  background: var(--settings-raised);
}

.settings-select-pill select {
  width: 100%;
  min-height: 36px;
  appearance: none;
  padding: 0 31px 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  cursor: pointer;
}

[dir="rtl"] .settings-select-pill select {
  padding: 0 14px 0 31px;
}

.settings-select-pill > .icon-asset {
  position: absolute;
  inset-inline-end: 11px;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.settings-modal .settings-section {
  padding: 14px 0;
  border-color: var(--settings-line);
}

.settings-modal .settings-label {
  font-size: 13px;
}

.settings-modal .settings-hint {
  max-width: 300px;
  font-size: 11px;
}

.settings-modal .settings-control {
  min-height: 34px;
  border-radius: 9px;
  background: var(--settings-raised);
}

.settings-account-list {
  width: 100%;
}

.settings-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  border-bottom: 1px solid var(--settings-line);
}

.settings-account-row:last-child {
  border-bottom: 0;
}

.settings-account-row-described {
  min-height: 86px;
}

.settings-account-label,
.settings-account-value {
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
}

.settings-account-value {
  text-align: end;
}

.settings-account-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.google-mark {
  background: conic-gradient(from -35deg, #4285f4 0 25%, #34a853 0 44%, #fbbc05 0 67%, #ea4335 0 83%, #4285f4 0);
  background-clip: text;
  color: transparent;
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.settings-account-description {
  max-width: 390px;
  margin-top: 4px;
  color: color-mix(in srgb, var(--foreground) 70%, transparent);
  font-size: 12px;
  line-height: 1.45;
}

.settings-action-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--foreground) 20%, transparent);
  border-radius: 999px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease;
}

.settings-action-button:hover {
  background: var(--settings-hover);
  border-color: color-mix(in srgb, var(--foreground) 32%, transparent);
}

.settings-action-danger {
  border-color: #ff4d55;
  color: #ff4d55;
}

.settings-action-danger:hover {
  border-color: #ff6269;
  background: color-mix(in srgb, #ff4d55 10%, transparent);
}

.settings-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 40px;
  height: 24px;
  cursor: pointer;
}

.settings-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-switch > span:not(.sr-only) {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #65666a;
  transition: background 160ms ease;
}

.settings-switch > span:not(.sr-only)::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px hsl(0 0% 0% / 0.25);
  transition: transform 160ms ease;
}

.settings-switch input:checked + span {
  background: #5b8def;
}

.settings-switch input:checked + span::after {
  transform: translateX(16px);
}

[dir="rtl"] .settings-switch input:checked + span::after {
  transform: translateX(16px);
}

.settings-switch input:focus-visible + span {
  outline: 2px solid color-mix(in srgb, #5b8def 70%, white);
  outline-offset: 2px;
}

.settings-about-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--settings-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--settings-raised) 45%, transparent);
}

.settings-about-title {
  font-size: 14px;
  font-weight: 700;
}

.settings-about-card p {
  margin: 5px 0;
  color: var(--muted-foreground);
  font-size: 11px;
}

.settings-about-card span {
  color: var(--muted-foreground);
  font-size: 10px;
}
.spinner {
  display: inline-block;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.spinner-sm {
  width: 18px;
  height: 18px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.settings-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.mobile-menu {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(86vw, 300px);
    box-shadow: none;
    visibility: hidden;
    transition:
      transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 280ms ease,
      visibility 280ms ease;
    will-change: transform;
  }
  /* Collapsing is a desktop rail behavior; keep the mobile drawer readable. */
  .sidebar.collapsed {
    flex-basis: 272px;
    width: min(86vw, 300px);
    opacity: 1;
    pointer-events: auto;
  }
  :is(.app[data-sidebar-side="left"], [dir="ltr"] .app[data-sidebar-side="auto"]) .sidebar.collapsed {
    border-right-width: 1px;
  }
  :is(.app[data-sidebar-side="right"], [dir="rtl"] .app[data-sidebar-side="auto"]) .sidebar.collapsed {
    border-left-width: 1px;
  }
  .sidebar.collapsed .sidebar-header > div:first-child {
    justify-content: space-between;
    gap: 3px;
    padding-inline: 0;
  }
  .sidebar.collapsed .sidebar-brand {
    justify-content: flex-start;
    width: auto;
    margin-inline: 0;
    gap: 8px;
    padding: 5px 7px;
  }
  .sidebar.collapsed .sidebar-brand > *:not(.icon-asset):not(svg) {
    display: revert !important;
  }
  .sidebar.collapsed .sidebar-brand-text,
  .sidebar.collapsed .profile-info,
  .sidebar.collapsed .profile-chevron,
  .sidebar.collapsed .conversation-title {
    display: revert;
  }
  .sidebar.collapsed .conversation-group-title {
    display: flex;
  }
  /* Restore the search button on mobile. */
  .sidebar.collapsed [data-search-chats] {
    display: revert;
  }
  /* Restore the collapse toggle on mobile. */
  .sidebar.collapsed .sidebar-collapse-button {
    display: revert;
  }
  .sidebar.collapsed .sidebar-button {
    justify-content: flex-start;
    gap: 11px;
    padding: 0 11px;
    font-size: 14px;
  }
  .sidebar.collapsed .sidebar-extra-actions {
    display: revert;
    margin-bottom: 12px;
  }
  .sidebar.collapsed .conversation-container {
    padding: 8px 9px;
    padding-top: 0;
    padding-inline: 9px;
  }
  .sidebar.collapsed .conversation-group {
    margin-bottom: 18px;
  }
  .sidebar.collapsed .conversation {
    display: block;
    width: 100%;
    height: auto;
    min-height: 38px;
    margin: 0;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
    text-align: start;
  }
  .sidebar.collapsed .conversation-more {
    display: grid;
  }
  .conversation-more {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar.collapsed .conversation::before {
    display: none;
  }
  .sidebar.collapsed .sidebar-footer {
    padding-inline: 12px;
  }
  .sidebar.collapsed .profile {
    justify-content: flex-start;
    padding: 8px;
  }
  /* The drawer slides in from whichever side the sidebar is docked to. */
  :is(.app[data-sidebar-side="left"], [dir="ltr"] .app[data-sidebar-side="auto"]) .sidebar {
    right: auto;
    left: 0;
    transform: translate3d(-105%, 0, 0);
  }
  :is(.app[data-sidebar-side="right"], [dir="rtl"] .app[data-sidebar-side="auto"]) .sidebar {
    right: 0;
    left: auto;
    transform: translate3d(105%, 0, 0);
  }
  .app[data-sidebar-side] .sidebar.open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
  }
  :is(.app[data-sidebar-side="left"], [dir="ltr"] .app[data-sidebar-side="auto"]) .sidebar.open {
    box-shadow: 10px 0 35px hsl(0 0% 0% / 0.18);
  }
  :is(.app[data-sidebar-side="right"], [dir="rtl"] .app[data-sidebar-side="auto"]) .sidebar.open {
    box-shadow: -10px 0 35px hsl(0 0% 0% / 0.18);
  }
  .modal {
    padding: 10px;
    align-items: flex-end;
  }
  .modal-panel {
    max-height: calc(100dvh - 20px);
    border-radius: 16px 16px 10px 10px;
  }
  .settings-row {
    align-items: flex-start;
  }
  .settings-control {
    width: 42%;
  }
}

#newChat {
  border: 1px solid var(--new-chat-border);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 2px 4px rgba(106, 111, 117, 0.08);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--new-chat-background);
  color: var(--new-chat-foreground);
  border-radius: 100px;
  width: 100%;
  font-weight: 700;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}

/* ============================================================
     1. Modern path — pure CSS, zero JS
     ============================================================ */
@supports (animation-timeline: scroll()) {
  .conversation-container {
    animation: scroll-edge-fade linear both;
    animation-timeline: scroll(self);
  }
}

@keyframes scroll-edge-fade {
  0% {
    --fade-top: 0px;
    --fade-bottom: var(--fade);
  }
  5%,
  95% {
    --fade-top: var(--fade);
    --fade-bottom: var(--fade);
  }
  100% {
    --fade-top: var(--fade);
    --fade-bottom: 0px;
  }
}

/* ============================================================
     2. Fallback path — needs the tiny JS at the bottom
     ============================================================ */
@supports not (animation-timeline: scroll()) {
  .conversation-container {
    transition:
      --fade-top 180ms ease,
      --fade-bottom 180ms ease;
  }
  .conversation-container[data-scroll="none"] {
    --fade-top: 0px;
    --fade-bottom: 0px;
  }
  .conversation-container[data-scroll="top"] {
    --fade-top: 0px;
    --fade-bottom: var(--fade);
  }
  .conversation-container[data-scroll="middle"] {
    --fade-top: var(--fade);
    --fade-bottom: var(--fade);
  }
  .conversation-container[data-scroll="bottom"] {
    --fade-top: var(--fade);
    --fade-bottom: 0px;
  }
}

/* ============================================================
     3. Optional — each conversation item fades in as it enters
        Delete this whole block if you don't want it.
     ============================================================ */
@supports (animation-timeline: view()) {
  .conversation-group > :not(.conversation-group-title) {
    animation: conversation-reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 70%;
  }
}

@keyframes conversation-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
     Reduced motion
     ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .conversation-container,
  .conversation-group > :not(.conversation-group-title) {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .conversation-container {
    --fade-top: 0px;
    --fade-bottom: 0px;
  }
}

.mobile-chat-brand {
  display: flex;
  align-items: center;
}

.sidebar-collapse-mode {
  align-items: center;
  gap: 2px;
  height: 43px;
  margin-inline-start: 16px;
  padding-inline: 3px;
  display: flex;
  border-radius: 100px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  background: var(--toolbar-background);
  border: 1px solid var(--toolbar-border);
}

.mobile-chat-brand {
  display: none;
}

@media (max-width: 768px) {
  .mobile-chat-brand {
    display: none;
  }
}

.sidebar-collapse-mode .btn-icon {
  border-radius: 9999px;
}

.sidebar-collapse-mode .btn-icon:hover {
  background: var(--toolbar-hover);
}

@media (min-width: 768px) {
  body.sidebar-fully-collapsed .mobile-chat-brand {
    display: flex;
  }
}

@media (max-width: 768px) {
  .sidebar-collapse-mode {
    display: flex;
  }

  .settings-modal .modal-panel {
    width: 100%;
    height: min(560px, calc(100dvh - 20px));
    max-height: calc(100dvh - 20px);
    border-radius: 18px 18px 8px 8px;
  }

  .settings-modal .modal-header {
    padding: 14px 16px 10px;
  }

  .settings-modal .modal-body {
    padding: 0 14px 14px;
  }

  .settings-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .settings-modal .settings-tabs {
    flex-direction: row;
    flex: 0 0 auto;
    overflow-x: auto;
    padding-bottom: 2px;
    width: 100%;
  }

  .settings-modal .settings-tab {
    width: auto;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    white-space: nowrap;
  }

  .settings-content {
    flex: 1;
  }

  .settings-theme-options {
    gap: 8px;
  }

  .settings-theme-option {
    height: 70px;
    border-radius: 10px;
    font-size: 12px;
  }

  .settings-preference-row {
    min-height: 52px;
  }

  .settings-account-row {
    min-height: 54px;
    gap: 12px;
  }

  .settings-account-row-described {
    min-height: 82px;
  }

  .settings-account-label,
  .settings-account-value {
    font-size: 12px;
  }

  .settings-account-value {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .settings-account-description {
    font-size: 11px;
    line-height: 1.45;
  }

  .settings-action-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }
}


  .attachment-preview-list {
    display: flex;
    gap: 8px;
    padding: 4px 2px 10px;
    overflow-x: auto;
  }
  .attachment-preview-list[hidden] {
    display: none;
  }
  .attachment-preview-list::-webkit-scrollbar {
    display: none;
  }

  /* ── Card — base (shared) ────────────────────────────────── */
  .attachment-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-height: 64px;
    padding: 9px 10px;
    border-radius: 16px;
    border: 1px solid var(--attachment-border);
    background: var(--input-background);
    transition:
      border-color 120ms ease,
      background 120ms ease;
    overflow: hidden;
  }

  .attachment-card:hover {
    background: var(--attachment-hover);
  }

  /* ── File variant (default) — 240px wide, icon + meta ─────── */
  .attachment-card--file {
    width: 240px;
  }

  /* ── Image variant — square thumb only, no meta ───────────── */
  .attachment-card--image {
    width: 64px;
    height: 64px;
    padding: 0;
    gap: 0;
    border-radius: 14px;
  }

  /* ── Icon shell (file variant) ───────────────────────────── */
  .attachment-card__visual {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  /* ── Image variant visual — fills the whole square card ──── */
  .attachment-card__visual--image {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
  }

  .attachment-card__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
  }

  /* ── File icon ───────────────────────────────────────────── */

  /* ── Text meta (file variant only) ───────────────────────── */
  .attachment-card__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }

  .attachment-card__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .attachment-card__size {
    font-size: 11px;
    color: var(--muted-foreground);
    white-space: nowrap;
  }

  /* ── Close button — appears on hover ─────────────────────── */
  .attachment-card__remove {
    position: absolute;
    top: 3px;
    right: 3px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--attachment-remove-border);
    background: var(--attachment-remove-background);
    color: var(--attachment-remove-foreground);
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition:
      opacity 120ms ease,
      transform 120ms ease,
      color 120ms ease;
    z-index: 2;
  }

  .attachment-card__remove svg {
    width: 10px;
    height: 10px;
    display: block;
  }

  /* Show on card hover / focus */
  .attachment-card:hover .attachment-card__remove,
  .attachment-card:focus-within .attachment-card__remove {
    opacity: 1;
    transform: scale(1);
  }
/* ===== Header ========================================================= */
.header {
  /* Sticks to the top of the scrolling main column. */
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  height: 60px;
  padding: 0 18px;
  background: var(--background);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.desktop-model-selector { display: block; }

/* .mobile-chat-brand,
.mobile-header-actions { display: none; } */

.header-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background 120ms ease;
}

.header-button:hover {
  background: var(--button-hover);
}

.offer-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  color: #63A8F8;
  font-size: 12px;
  font-weight: 700;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.offer-button:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--background));
}

.offer-button:active { transform: scale(.98); }

[data-temporary-chat][aria-pressed='true'] {
  background: var(--sidebar-active);
  color: var(--foreground);
}

.model-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  transition: background 120ms ease;
}

.model-button:hover {
  background: var(--button-hover);
}

.model-chevron {
  display: flex;
  color: var(--muted);
}

.theme-trigger {
  width: auto;
  gap: 3px;
  padding: 0 8px;
}

.theme-mode-icon {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
  box-shadow: inset -5px -3px 0 0 var(--background);
  transform: rotate(-20deg);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.theme-mode-icon[data-active-theme='light'] {
  border-width: 2px;
  box-shadow: inset 0 0 0 4px var(--background);
  transform: rotate(0);
}

.theme-chevron {
  display: inline-flex;
  color: var(--muted-foreground);
  transition: transform 140ms ease;
}

.theme-dropdown.open .theme-chevron { transform: rotate(180deg); }
.theme-dropdown .dropdown-menu { width: 150px; }

.theme-option {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.theme-option > span:first-child { justify-content: flex-start; }
.theme-check { color: var(--foreground); opacity: 0; }
.theme-option[aria-selected='true'] .theme-check { opacity: 1; }

/* ===== Chat area ====================================================== */
/* `.main` owns the scrolling; this column just grows with its content. */
.chat {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  width: 100%;
  height: auto;
  min-height: 0;
}

.messages {
  flex: 1 0 auto;
}

.messages-inner {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  /* Extra room at the bottom so the last message clears the sticky composer. */
  padding: 40px 24px 150px;
}

/* ===== Welcome ======================================================== */
.welcome {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding-top: 23vh;
  text-align: center;
  justify-content: center;
  gap: 10px;
}

.welcome[hidden] {
  display: none;
}

.welcome-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--input-background);
}

.welcome-logo .icon-asset {
  width: 22px;
  height: 22px;
}

.welcome-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.welcome-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* ===== Messages ======================================================= */
.message {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


.message-user .message-attachment-list {
  width: max-content;
  max-width: 78%;
}

.message-user .message-bubble {
  max-width: 78%;
  padding: 11px 15px;
  border-radius: 22px;
  background: var(--message-bubble);
  color: var(--message-bubble-text);
  font-weight: 400;
}

.message-assistant {
  align-items: flex-start;
}

.message-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.message-bubble {
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-assistant .message-bubble {
  width: min(100%, 760px);
}

.message-bubble p {
  margin: 0;
}

.message-bubble code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--sidebar-hover);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ===== Code blocks ==================================================== */
.code-block {
  width: 100%;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--code-background);
  color: var(--code-foreground);
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
  direction: ltr;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 12px 0 16px;
  background: var(--code-header);
}

.code-language {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.code-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
}

.code-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  transition: background 120ms ease, color 120ms ease;
}

.code-action:hover:not(:disabled) {
  background: color-mix(in srgb, var(--foreground) 9%, transparent);
  color: var(--foreground);
}

.code-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.code-actions__divider {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--code-border);
}

.code-copy {
  padding: 5px 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  transition: background 120ms ease, color 120ms ease;
}

.code-copy:hover {
  background: var(--button-hover);
  color: var(--foreground);
}

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

.code-scroll {
  max-height: 320px;
  overflow: auto;
}

.code-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.code-scroll pre {
  min-width: max-content;
  margin: 0;
  padding: 16px 18px;
}

.code-scroll code,
.message-bubble .code-scroll code {
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--code-foreground);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

[data-theme='light'] .hljs-keyword,
[data-theme='light'] .hljs-selector-tag,
[data-theme='light'] .hljs-literal { color: #cf222e; }
[data-theme='light'] .hljs-title.function_,
[data-theme='light'] .hljs-title,
[data-theme='light'] .hljs-type,
[data-theme='light'] .hljs-built_in { color: #8250df; }
[data-theme='light'] .hljs-string,
[data-theme='light'] .hljs-attr { color: #0a3069; }
[data-theme='light'] .hljs-number,
[data-theme='light'] .hljs-symbol { color: #0550ae; }
[data-theme='light'] .hljs-comment { color: #6e7781; font-style: italic; }
[data-theme='light'] .hljs-variable,
[data-theme='light'] .hljs-params { color: #953800; }
[data-theme='light'] .hljs-property,
[data-theme='light'] .hljs-selector-class { color: #116329; }

[data-theme='dark'] .hljs-keyword,
[data-theme='dark'] .hljs-selector-tag,
[data-theme='dark'] .hljs-literal,
[data-theme='dark'] .hljs-title.function_ { color: #c792ea; }
[data-theme='dark'] .hljs-string,
[data-theme='dark'] .hljs-attr { color: #c3e88d; }
[data-theme='dark'] .hljs-number,
[data-theme='dark'] .hljs-symbol { color: #f78c6c; }
[data-theme='dark'] .hljs-comment { color: #697098; font-style: italic; }
[data-theme='dark'] .hljs-title,
[data-theme='dark'] .hljs-type,
[data-theme='dark'] .hljs-built_in { color: #82aaff; }
[data-theme='dark'] .hljs-variable,
[data-theme='dark'] .hljs-params { color: #f07178; }
[data-theme='dark'] .hljs-property,
[data-theme='dark'] .hljs-selector-class { color: #ffcb6b; }

/* ===== Message actions ================================================ */
.message-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 1;
  transition: opacity 120ms ease;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
}

.message-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
  transition: background 120ms ease, color 120ms ease;
}

.message-action:hover {
  background: var(--button-hover);
  color: var(--foreground);
}

.message-action[aria-pressed="true"] {
  color: var(--accent);
}

.message-action:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.version-pager {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.version-pager[hidden] {
  display: none;
}

.version-pager .message-action {
  width: 24px;
}

.version-pager__count {
  min-width: 28px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  user-select: none;
}

/* Chevrons point in the reading direction. */
.version-pager__button svg {
  display: block;
}

.version-pager:dir(rtl) .version-pager__button svg {
  transform: scaleX(-1);
}

/* ===== Inline message editor ========================================== */
.message-editing > .message-row,
.message-editing > .message-actions,
.message-editing > .message-attachment-list {
  display: none;
}

.message-editor {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--input-border);
  border-radius: 20px;
  background: var(--composer-background);
  transition: border-color 120ms ease;
}

.message-editor__input:focus,
.message-editor__input:focus-visible {
  outline: 0;
  box-shadow: none;
}

.message-editor__input {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 200px;
  padding: 8px 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.6;
  resize: none;
}

.message-editor__attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 4px 8px;
}

.message-editor__attachments[hidden] {
  display: none;
}

.edit-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--attachment-border);
  border-radius: 999px;
  color: var(--foreground);
  font-size: 13px;
}

.edit-attachment__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-attachment__remove {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.edit-attachment__remove:hover {
  background: var(--button-hover);
  color: var(--foreground);
}

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

.message-editor__attach {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.message-editor__attach:hover {
  background: var(--composer-hover);
  color: var(--foreground);
}

.message-editor__attach:has(:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.message-editor__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-editor__button {
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: background 120ms ease, opacity 120ms ease;
}

.message-editor__button--cancel {
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--foreground);
}

.message-editor__button--cancel:hover {
  background: var(--button-hover);
}

.message-editor__button--send {
  background: #2c67c5;
  color: var(--accent-foreground);
}

.message-editor__button--send:hover:not(:disabled) {
  opacity: 0.85;
}

.message-editor__button--send:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* ===== Composer ======================================================= */
.chat-composer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
  width: 100%;
  padding: 16px 0 10px;
  padding-top: 0;
  background: var(--background);
}

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

.chat-empty .messages {
  flex: 0 0 auto;
  width: 100%;
  overflow: visible;
  margin-top: -20dvh;
}

.chat-empty .messages-inner {
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

.chat-empty .welcome {
  padding-top: 0;
}

.chat-empty .chat-composer {
  position: static;
  padding: 18px 0 0;
  background: transparent;
}

.chat-empty .composer-wrapper {
  position: relative;
  inset: auto;
  padding-top: 0;
}

.chat-composer > section {
  gap: 0;
}

.chat-composer #chat-form {
  max-width: 776px;
}

.chat-hint {
  margin: 8px 16px 0;
  color: var(--muted-foreground);
  font-size: 11px;
  text-align: center;
}

#chat-form [data-role='primary']:disabled {
  cursor: default;
  opacity: .45;
}

.chat-input-shell {
  position: relative;
  background: var(--composer-background);
  color: var(--foreground);
  border-radius: 24px;
  min-height: 124px;
  display: flex;
  width: 100%;
  flex-direction: column;
}

.chat-textarea { color: var(--foreground); }
.chat-textarea::placeholder { color: var(--muted-foreground); }
[dir="rtl"] .chat-textarea::placeholder{
  text-align: right;
}
.chat-input-action { color: var(--muted); }

.chat-input-action:hover {
  background: var(--composer-hover);
  color: var(--foreground);
}

.chat-input-action.is-open {
  background: var(--composer-hover);
  color: var(--foreground);
}

.chat-input-action.is-open .icon-asset {
  transform: rotate(45deg);
}

.chat-input-action .icon-asset {
  transition: transform 140ms ease;
}

.attachment-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 30;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--input-background);
  box-shadow: 0 18px 55px hsl(0 0% 0% / .18);
}

.attachment-menu[hidden] {
  display: none;
}

.attachment-menu-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 66px;
  padding: 10px 12px;
  border-radius: 14px;
  background: transparent;
  color: var(--foreground);
  text-align: left;
  transition: background 120ms ease;
}

button.attachment-menu-item:hover {
  background: var(--button-hover);
}

.attachment-menu-item-static {
  cursor: default;
}

.attachment-menu-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--composer-background);
  color: var(--foreground);
}

.attachment-menu-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: start;
  gap: 3px;
}

.attachment-menu-copy strong {
  font-size: 14px;
  font-weight: 600;
}

.attachment-menu-copy > span {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.35;
}

.attachment-preview-list {
  display: flex;
  gap: 8px;
  padding: 8px 4px 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.attachment-preview-list[hidden] {
  display: none;
}

.attachment-preview-card {
  position: relative;
  display: flex;
  flex: 0 0 218px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 34px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--input-background);
}

.attachment-preview-visual {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  overflow: hidden;
  place-items: center;
  border-radius: 10px;
  background: var(--composer-background);
}

.attachment-preview-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-file-extension {
  max-width: 42px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-overflow: ellipsis;
}

.attachment-preview-details {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.attachment-preview-details strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-details > span {
  color: var(--muted-foreground);
  font-size: 10px;
}

.attachment-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  background: var(--composer-background);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: background 120ms ease, color 120ms ease;
}

.attachment-remove:hover {
  background: var(--button-hover);
  color: var(--foreground);
}

.think-action[aria-pressed='true'] {
  background: var(--think-active-background);
  color: var(--think-active-foreground);
  border-color: var(--think-active-border);
}

.chat-send-button { background: #2c67c5; }

.composer-wrapper {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  padding: 20px 24px 24px;
  background: linear-gradient(
    to bottom,
    transparent,
    color-mix(in srgb, var(--background) 85%, transparent) 20%,
    var(--background) 55%
  );
}

.composer-shell {
  width: 100%;
  max-width: 820px;
}

.composer {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--input-border);
  border-radius: 16px;
  background: var(--input-background);
  box-shadow: 0 2px 8px hsl(0 0% 0% / 0.04), 0 8px 30px hsl(0 0% 0% / 0.04);
  transition: border-color 120ms ease;
}


.composer textarea {
  width: 100%;
  min-height: 54px;
  max-height: 180px;
  padding: 8px 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
}

.composer textarea::placeholder {
  color: var(--muted-foreground);
}

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

.composer-left,
.composer-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.composer-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--muted);
  transition: background 120ms ease, color 120ms ease;
}

.composer-button:hover {
  background: var(--button-hover);
  color: var(--foreground);
}

.send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-foreground);
  transition: opacity 120ms ease, transform 120ms ease;
}

.send-button:hover {
  opacity: 0.85;
}

.send-button:active {
  transform: scale(0.95);
}

.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.disclaimer {
  margin: 10px 0 0;
  color: var(--muted-foreground);
  font-size: 11px;
  text-align: center;
}

/* ===== Error / 404 ==================================================== */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  text-align: center;
}

.error-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* ===== Responsive ===================================================== */
@media (max-width: 768px) {
  .header {
    z-index: 20;
    height: 58px;
    padding: 0 12px;
    background: color-mix(in srgb, var(--background) 90%, transparent);
    /* backdrop-filter: blur(14px); */
  }

  .desktop-model-selector { display: none; }

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

  .theme-trigger { padding: 0 6px; }

  .header-right > .tooltip:has(.offer-button),
  .header-right > .tooltip:has([data-temporary-chat]) { display: none; }

  .offer-button span { display: none; }

  .messages-inner {
    padding-right: 16px;
    padding-left: 16px;
  }

  .chat-composer {
    padding-top: 10px;
  }

  .chat-empty .messages-inner {
    padding-right: 16px;
    padding-left: 16px;
  }

  .chat-empty .chat-composer {
    padding-top: 14px;
  }

  .chat-empty .composer-wrapper {
    padding-top: 0;
  }

  .chat-composer > section {
    padding-right: 10px;
    padding-left: 10px;
  }

  .attachment-menu {
    border-radius: 18px;
  }

  .attachment-preview-card {
    flex-basis: 190px;
  }

  .welcome {
    padding-top: 14vh;
  }

  .welcome-title {
    font-size: 24px;
  }

  .composer-wrapper {
    padding: 16px 10px 10px;
  }

  .composer {
    border-radius: 14px;
  }
}
