* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

*:focus,
*:active {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
textarea,
select,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
[role="button"],
.btn,
.sidebar-item,
.action-btn,
.icon-btn,
.auth-btn,
.menu-btn {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body.preload *,
body.preload *::before,
body.preload *::after {
  transition: none !important;
}

:root {
  --border: #e8e8e8;
  --text: #222;
  --muted: #666;
  --ai-bg: #f2f2f2;
  --user-bg: #0a84ff;
  --user-text: #fff;
  --chat-font-size-scale: 1;
}

::selection {
  background: #050505;
  color: #ffffff;
  text-shadow: none;
}

::-moz-selection {
  background: #050505;
  color: #ffffff;
  text-shadow: none;
}

body.dark-mode ::selection {
  background: #383838;
  color: #ffffff;
  text-shadow: none;
}

body.dark-mode ::-moz-selection {
  background: #383838;
  color: #ffffff;
  text-shadow: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #ffffff;
  color: var(--text);
  overflow-x: hidden;
}

.container {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.header {
  background: transparent;
  padding: 6px 0 34px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  width: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
}

.logo-container {
  position: relative;
}

.sidebar-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #000;
}

.sidebar-btn .sidebar-icon {
  display: block;
  width: 20.48px;
  height: 20.48px;
  pointer-events: none;
}

.sidebar-btn .sidebar-arrow {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (hover: hover) {
  .sidebar-btn:hover .sidebar-arrow {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-btn:focus-visible .sidebar-arrow {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-btn .sidebar-arrow {
    transform: none;
    transition: opacity 0.12s linear;
  }
}

.header-upgrade {
  align-items: center;
  height: 40px;
  padding: 0 4px;
  color: #1e3a8a;
  font-size: 14.5px;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.15s;
}

.header-upgrade:hover {
  color: #1d4ed8;
}

.input-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.input-stack > .input-wrapper {
  max-width: 100%;
}

.input-under {
  position: relative;
  display: flex;
  justify-content: flex-end;
  padding: 6px 0 0;
}

.model-picker {
  position: relative;
}

.input-note {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  margin: 0;
  font-size: 12px;
  line-height: 26px;
  color: #999;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.has-messages .input-note,
:where(html.in-chat) .container .input-note {
  display: block;
}

@media (max-width: 768px) {
  .input-note {
    position: static;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 10px 0 4px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .input-under {
    padding-top: 6px;
  }
}

.model-selector {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #888;
}

.model-selector .model-label {
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.model-selector:hover .model-label,
.model-selector.active .model-label {
  background: #f0f0f0;
  color: #333;
}

.model-selector .model-effort {
  padding: 4px 8px 4px 4px;
  color: #999;
  white-space: nowrap;
  transition: color 0.15s;
}

.model-selector .model-effort[hidden] {
  display: none;
}

.model-selector .model-effort:hover {
  color: #666;
}

.model-selector.has-mesh {
  position: relative;
}

.model-selector.has-mesh #inlineLevelText {
  color: transparent;
}

.model-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  z-index: 3000;
  padding: 6px;
  min-width: 240px;
  width: max-content;
  max-width: min(360px, calc(100vw - 20px));
}

.model-dropdown.open-upwards {
  top: auto;
  bottom: calc(100% + 6px);
}

.model-dropdown .dropdown-group {
  padding: 0;
}

.model-dropdown .dropdown-item {
  border-radius: 8px;
  gap: 16px;
}

.model-menu-sep {
  height: 1px;
  background: #eee;
  margin: 4px 8px;
}

.model-dropdown .effort-row {
  padding: 10px 14px;
}

.model-dropdown .effort-row .dropdown-item-label,
.model-dropdown .effort-row .dropdown-item-value {
  font-size: 14px;
}

.effort-row .effort-chevron {
  opacity: 0.7;
}

.model-dropdown .effort-row.open {
  background: #f5f5f5;
}

.effort-panel {
  position: absolute;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 6px;
  min-width: 200px;
  width: max-content;
  max-width: calc(100vw - 16px);
  z-index: 3001;
}

.effort-panel[hidden] {
  display: none;
}

.model-dropdown .level-option-item {
  padding: 8px 14px;
}

.model-dropdown .level-option-item .level-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-group {
  padding: 8px 0;
}

.dropdown-label {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

.dropdown-item.selected {
  background: transparent;
  font-weight: 600;
}

.dropdown-item .model-verified {
  display: none;
  width: 15px;
  height: 15px;
  margin-left: 14px;
  flex-shrink: 0;
}

.dropdown-item .model-verified svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dropdown-item .model-verified .mv-tick {
  stroke: #111;
}

.dropdown-item.selected .model-verified {
  display: block;
}

body.dark-mode .dropdown-item .model-verified .mv-tick {
  stroke: #fff;
}

.dropdown-item.disabled {
  color: #a0a0a0;
  cursor: not-allowed;
  background: #fff;
  
}

.dropdown-item.disabled:hover {
  background: #fff;
}

.chat-outer {
  flex: 1;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
  width: 100%;
  max-width: 760px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  --scrollbar-opacity: 0.01;
  --scrollbar-thumb-rgb: 0, 0, 0;

  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--scrollbar-thumb-rgb), var(--scrollbar-opacity, 0.01)) transparent;
}

body.dark-mode .chat-container {
  --scrollbar-thumb-rgb: 255, 255, 255;
}

.chat-container::-webkit-scrollbar {
  width: 6px;
  height: 0px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
  border: none;
}

.chat-container::-webkit-scrollbar-thumb {
  background-color: rgba(var(--scrollbar-thumb-rgb), var(--scrollbar-opacity, 0.01));
  border-radius: 999px;
  border: none;
  transition: background-color 0.15s linear;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(var(--scrollbar-thumb-rgb), 0.32) !important;
}

body.dark-mode .chat-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(var(--scrollbar-thumb-rgb), 0.36) !important;
}

* {
  scrollbar-width: thin;
}

::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  background: transparent !important;
  border: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

*::-webkit-scrollbar-button,
*::-webkit-scrollbar-button:single-button,
*::-webkit-scrollbar-button:start,
*::-webkit-scrollbar-button:end,
*::-webkit-scrollbar-button:vertical,
*::-webkit-scrollbar-button:horizontal,
*::-webkit-scrollbar-button:vertical:increment,
*::-webkit-scrollbar-button:vertical:decrement,
*::-webkit-scrollbar-button:horizontal:increment,
*::-webkit-scrollbar-button:horizontal:decrement {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  background: transparent !important;
  border: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

*::-webkit-scrollbar-corner {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

*::-webkit-scrollbar:horizontal {
  display: none !important;
  height: 0 !important;
}

.message {
  display: flex;
  flex-direction: column;
  animation: slideIn 0.18s ease-out;
}

.message-meta {
  max-width: 70%;
  font-size: calc(11.5px * var(--chat-font-size-scale, 1));
  color: #8a8a8a;
  line-height: 1;
  margin: 0 0 6px 0;
}

.message.user .message-meta {
  display: none;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

.message.user {
  align-items: flex-end;
}

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

.message-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: calc(13.5px * var(--chat-font-size-scale, 1));
}

.message.user .message-bubble {
  background: #d3d3d3;
  color: #000;
  border-top-right-radius: 6px;
  white-space: pre-wrap;
}

.message.ai .message-bubble {
  background: transparent;
  color: #000000;
  border-top-left-radius: 6px;
  overflow-wrap: break-word;
  width: 100%;
  max-width: 100%;
}

.message.ai .message-bubble p {
  margin-top: 0;
  margin-bottom: 10px;
}

.message.ai .message-bubble .answer-block > p:first-child {
  margin-top: 0;
}
.message.ai .message-bubble .answer-block > p:last-child {
  margin-bottom: 0;
}
.message.ai .message-bubble .answer-block > p:only-child {
  margin-top: 0;
  margin-bottom: 0;
}

.message.ai .message-bubble h1,
.message.ai .message-bubble h2,
.message.ai .message-bubble h3,
.message.ai .message-bubble h4,
.message.ai .message-bubble h5,
.message.ai .message-bubble h6 {
  margin-top: 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.message.ai .message-bubble ul,
.message.ai .message-bubble ol {
  margin-left: 20px;
  margin-bottom: 10px;
}

.message.ai .message-bubble hr {
  height: 0;
  border: 0;
  border-top: 1px solid #e0e0e0;
  margin: 14px 0;
}

body.dark-mode .message.ai .message-bubble hr {
  border-top-color: #383838;
}

.message.ai .message-bubble table {
  width: 100%;
  max-width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  font-size: calc(12px * var(--chat-font-size-scale, 1));
  line-height: 1.45;
  background: transparent !important;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  table-layout: auto;
}

.message.ai .message-bubble th,
.message.ai .message-bubble td {
  padding: 6px 10px;
  text-align: left;
  background: transparent !important;
  border: 1px solid #e2e8f0;
  font-size: calc(12px * var(--chat-font-size-scale, 1));
  word-break: normal;
}

.message.ai .message-bubble th {
  background: transparent !important;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 2px solid #cbd5e1;
}

.message.ai .message-bubble tr,
.message.ai .message-bubble tr:nth-child(even) td,
.message.ai .message-bubble tr:hover td {
  background: transparent !important;
}

body.dark-mode .message.ai .message-bubble table {
  border-color: #383838;
  background: transparent !important;
}

body.dark-mode .message.ai .message-bubble th,
body.dark-mode .message.ai .message-bubble td {
  border-color: #333333;
  color: #e0e0e0;
  background: transparent !important;
}

body.dark-mode .message.ai .message-bubble th {
  background: transparent !important;
  color: #ffffff;
  border-bottom-color: #444444;
}

body.dark-mode .message.ai .message-bubble tr,
body.dark-mode .message.ai .message-bubble tr:nth-child(even) td,
body.dark-mode .message.ai .message-bubble tr:hover td {
  background: transparent !important;
}

.code-block-wrap {
  position: relative;
  margin: 12px 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  min-width: 0;
}

.code-block-wrap>pre {
  grid-area: 1 / 1;
  min-width: 0;
}

.message.ai .message-bubble pre {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 14px 44px 14px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: calc(13px * var(--chat-font-size-scale, 1));
  line-height: 1.45;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.message.ai .message-bubble pre::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.message.ai .message-bubble pre::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.message.ai .message-bubble pre::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.message.ai .message-bubble pre:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.45);
}

.message.ai .message-bubble pre::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.75);
}

.message.ai .message-bubble code {
  background: rgba(0, 0, 0, 0.055);
  color: #111;
  padding: 0.12em 0.34em;
  border-radius: 4px;
  font-size: 0.86em;
}

.message.ai .message-bubble pre code,
.message.ai .message-bubble pre code.hljs {
  font-size: 0.88em;   
  display: block;
  min-width: max-content;
  overflow: visible !important;
  padding: 0 !important;
  background: transparent !important;
  border: none;
  color: #24292e;
  white-space: pre;
}

.code-copy-btn {
  grid-area: 1 / 1;
  position: sticky;
  top: -14px;
  justify-self: end;
  align-self: start;
  background: transparent;
  border: none;
  box-shadow: none;
  width: 26px;
  height: 26px;
  margin: 4px 8px 10px auto;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, color 0.25s ease, transform 0.15s ease;
  z-index: 10;
  pointer-events: auto;
  opacity: 0.2;
  color: #666666;
}

.code-copy-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.code-copy-btn:hover {
  opacity: 1;
  color: #111111;
  transform: translateY(-1px);
}

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

.code-copy-btn:disabled,
.code-copy-btn.copy-blocked,
.code-copy-btn:disabled:hover,
.code-copy-btn.copy-blocked:hover {
  cursor: not-allowed !important;
  opacity: 0.5 !important;
  color: #888888 !important;
  transform: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.code-copy-btn.copy-blocked:disabled:hover svg,
.code-copy-btn:disabled:hover svg {
  opacity: 0.4;
}

.code-copy-btn.copy-blocked:disabled:hover::after {
  content: "■";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 4px;
  font-size: 10px;
  line-height: 1;
}

.code-copy-btn.copied {
  opacity: 1 !important;
  color: #059669 !important;
}

.code-copy-btn.copied svg {
  stroke: #059669 !important;
}

.message.ai .message-bubble:hover .code-copy-btn {
  opacity: 1;
}

body.dark-mode .message.ai .message-bubble pre {
  background: #141414;
  border-color: #2a2a2a;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

body.dark-mode .message.ai .message-bubble pre::-webkit-scrollbar-track {
  background: transparent;
}

body.dark-mode .message.ai .message-bubble pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

body.dark-mode .message.ai .message-bubble pre:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.45);
}

body.dark-mode .message.ai .message-bubble pre::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.75);
}

body.dark-mode .message.ai .message-bubble code {
  background: rgba(255, 255, 255, 0.085);
  color: #f2f2f2;
}

body.dark-mode .message.ai .message-bubble pre code,
body.dark-mode .message.ai .message-bubble pre code.hljs {
  color: #e0e0e0;
  background: transparent !important;
}

body.dark-mode .code-copy-btn {
  color: #888888;
  opacity: 0.25;
}

body.dark-mode .code-copy-btn:hover {
  opacity: 1;
  color: #ffffff;
}

body.dark-mode .code-copy-btn:disabled,
body.dark-mode .code-copy-btn.copy-blocked,
body.dark-mode .code-copy-btn:disabled:hover,
body.dark-mode .code-copy-btn.copy-blocked:hover {
  cursor: not-allowed !important;
  opacity: 0.5 !important;
  color: #666666 !important;
  background: transparent !important;
}

body.dark-mode .code-copy-btn.copy-blocked:disabled:hover svg,
body.dark-mode .code-copy-btn:disabled:hover svg {
  opacity: 0.3;
}

body.dark-mode .code-copy-btn.copy-blocked:disabled:hover::after {
  color: #ff4d4d;
  background: rgba(20, 20, 20, 0.85);
}

body.dark-mode .code-copy-btn.copied {
  opacity: 1 !important;
  color: #10b981 !important;
}

body.dark-mode .code-copy-btn.copied svg {
  stroke: #10b981 !important;
}

.input-area {
  background: var(--input-area-bg, #fff);
  padding: 12px 0 16px;
  flex-shrink: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}

.welcome-text {
  font-size: 26px;
  font-weight: 600;
  color: #333;
  margin-bottom: 24px;
  min-height: 1.2em;
  opacity: 0;
  display: none;
  transition: opacity 0.3s;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 16px;
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .welcome-text {
    font-size: 22px;
    line-height: 1.3;
  }
}

:where(html:not(.in-chat)) .container:not(.has-messages) .input-area,
:where(html:not(.in-chat)) .chat-outer:has(.chat-container:empty)~.input-area,
:where(html:not(.in-chat)) .chat-outer:has(.chat-container:empty)+.input-area,
:where(html:not(.in-chat)) .chat-container:empty~.input-area,
:where(html:not(.in-chat)) .chat-container:empty+.input-area {
  position: absolute;
  left: 0;
  right: 0;
  top: 35vh;
  transform: none;
  background: transparent;
  padding: 12px 0;
  z-index: 1001;
  animation: emptyStateEntrance 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes emptyStateEntrance {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.has-messages .input-area,
:where(html.in-chat) .container .input-area {
  position: relative;
  top: auto;
  transform: translateY(0);
  background: var(--input-area-bg, #fff);
  
  padding: 12px 0 6px;
}

.has-messages.animate-drop .input-area {
  animation: inputDropIn 0.55s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes inputDropIn {
  from {
    transform: translateY(-35vh);
    background: transparent;
  }

  to {
    transform: translateY(0);
    background: var(--input-area-bg, #fff);
  }
}

:where(html:not(.in-chat)) .container:not(.has-messages) .input-area .welcome-text,
:where(html:not(.in-chat)) .chat-outer:has(.chat-container:empty)+.input-area .welcome-text,
:where(html:not(.in-chat)) .chat-container:empty+.input-area .welcome-text {
  display: block;
  opacity: 1;
}

.input-inner {
  width: 100%;
  max-width: 760px;
  
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  justify-content: center;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  background: #fdfdfd;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  width: 600px;
  min-height: 84px;
  padding: 10px 6px 4px 6px;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.15s, box-shadow 0.15s, transform 0.3s ease;
}

.input-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: auto;
}

:where(html:not(.in-chat)) .container:not(.has-messages) .input-area .input-wrapper,
:where(html:not(.in-chat)) .chat-outer:has(.chat-container:empty)+.input-area .input-wrapper,
:where(html:not(.in-chat)) .chat-container:empty+.input-area .input-wrapper {
  width: 740px;
}

:where(html:not(.in-chat)) .container:not(.has-messages) .input-area .settings-btn,
:where(html:not(.in-chat)) .chat-outer:has(.chat-container:empty)+.input-area .settings-btn,
:where(html:not(.in-chat)) .chat-container:empty+.input-area .settings-btn {
  width: 34px;
  height: 34px;
}

.input-wrapper:focus-within {
  border-color: #d0d0d0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.input-box-wrapper {
  width: 100%;
  max-height: 160px;
  overflow-y: auto;
  cursor: default;
  
}

:where(html:not(.in-chat)) .container:not(.has-messages) .input-area .input-box-wrapper,
:where(html:not(.in-chat)) .chat-outer:has(.chat-container:empty)+.input-area .input-box-wrapper,
:where(html:not(.in-chat)) .chat-container:empty+.input-area .input-box-wrapper {
  max-height: 200px;
}

.input-box {
  width: 100%;
  padding: 0 11px 0 8px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  resize: none;
  line-height: 1.45;
  outline: none;
  overflow: hidden;
  height: 24px;
  
}

.input-box:focus {
  border-color: transparent;
}

.input-box-wrapper {
  scrollbar-width: auto;
  scrollbar-color: auto;
}

.input-box-wrapper::-webkit-scrollbar {
  width: 5px;
}

.input-box-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.input-box-wrapper::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 10px;
}

body.dark-mode .input-box-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
}

.input-box-wrapper::-webkit-scrollbar-button {
  display: none;
}

.button-group {
  display: flex;
  gap: 4px;
  align-items: center;
  position: relative;
  margin-right: 0;
}

.settings-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: -2px;
  padding: 0;
  transition: all 0.15s;
  position: relative;
}

.settings-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  position: relative;
  z-index: 2;
}

.inline-level-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: -44px;
  width: 290px;
  min-height: auto;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  z-index: 3000;
  padding: 6px;
  cursor: default;
}

.has-messages .inline-level-dropdown,
:where(html.in-chat) .container .inline-level-dropdown {
  right: -46px;
}

.inline-level-dropdown.open-upwards {
  top: auto;
  bottom: calc(100% + 8px);
}

.dropdown-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  gap: 12px;
}

.dropdown-menu-item:hover {
  background: #f5f5f5;
}

.dropdown-item-label {
  font-size: 14.5px;
  color: #333;
  font-weight: 500;
}

.dropdown-item-value {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #888;
  font-size: 14.5px;
  min-width: 0;
  
  justify-content: flex-end;
}

.dropdown-item-value span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-item-value svg {
  opacity: 0.7;
}

.theme-option-item {
  padding: 8px 10px;
  font-size: 14px;
  color: #333;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 1px;
}

.theme-option-item:hover {
  background: #f5f5f5;
}

.theme-option-item.selected {
  background: #f0f0f0;
  font-weight: 500;
}

.send-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #000;
  color: #fff;
  cursor: pointer;
  padding: 0;

  display: grid;
  place-items: center;

  flex-shrink: 0;
  transition: transform 0.08s, opacity 0.15s, background 0.15s;
}

.send-btn svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.send-btn:hover {
  background: #000;
}

.send-btn:active {
  opacity: 0.85;
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #999;
}

.send-btn.generating {
  background: #c0c0c0;
  border-color: #a0a0a0;
  cursor: default;
}

.send-btn.generating:hover {
  background: #c0c0c0;
}

.send-btn .stop-square {
  width: 12px;
  height: 12px;
  background: #000;
  border-radius: 2px;
  cursor: pointer;
}

.send-icon {
  fill: currentColor;
}

.button-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.cancel-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #ff4444;
  background: #ff4444;
  color: #fff;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
  transition: transform 0.08s, opacity 0.15s, background 0.15s;
}

.cancel-btn:hover {
  background: #ff2222;
}

.cancel-btn:active {
  transform: scale(0.98);
}

.cancel-icon {
  fill: currentColor;
}

.loading-indicator {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #111;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.send-icon {
  fill: currentColor;
}

.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.4);
}

body.dark-mode .chat-container::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .chat-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.message.ai .message-bubble pre::-webkit-scrollbar {
  height: 8px;
}

.message.ai .message-bubble pre::-webkit-scrollbar-track {
  background: #f8fafc;
}

.message.ai .message-bubble pre::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.message.ai .message-bubble pre::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.message.ai .message-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: calc(14px * var(--chat-font-size-scale, 1));
  border: none;
}

.message.ai .message-bubble th,
.message.ai .message-bubble td {
  padding: 14px 16px;
  text-align: left;
  border: none;
  border-bottom: 1px solid #eaeaea;
  vertical-align: top;
}

.message.ai .message-bubble th {
  background-color: transparent;
  font-weight: 600;
  color: #111;
}

.message.ai .message-bubble tr:last-child td {
  border-bottom: none;
}

@media (max-width: 768px) {
  .header {
    padding: 3px 0 21px;
  }

  .header-inner {
    padding: 0 12px;
    justify-content: flex-start;
  }

  .logo {
    font-size: 18px;
  }

  .model-selector .model-label,
  .model-selector .model-effort {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .settings-btn {
    width: 32px;
    height: 32px;
  }

  .settings-menu {
    right: 0;
    left: auto;
    max-width: calc(100vw - 24px);
    overflow-x: hidden;
  }

  .settings-icon {
    width: 18px;
    height: 18px;
  }

  .chat-container {
    padding: 14px 12px;
  }

  .message-bubble {
    max-width: 88%;
  }

  .input-inner {
    max-width: 100%;
    padding: 0 10px;
  }

  .input-stack {
    width: 100%;
  }

  .input-wrapper {
    width: 100% !important;
  }

  :where(html:not(.in-chat)) .container:not(.has-messages) .input-area .input-wrapper,
  :where(html:not(.in-chat)) .chat-outer:has(.chat-container:empty)+.input-area .input-wrapper,
  :where(html:not(.in-chat)) .chat-container:empty+.input-area .input-wrapper {
    width: 100% !important;
  }

  .inline-level-dropdown {
    right: 0 !important;
    left: auto !important;
    width: 260px !important;
    max-width: 88vw !important;
    top: calc(100% + 8px) !important;
    bottom: auto !important;
  }

  .has-messages .inline-level-dropdown,
  :where(html.in-chat) .container .inline-level-dropdown {
    right: 0 !important;
    left: auto !important;
  }

  .inline-level-dropdown.open-upwards {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
  }

  .settings-panel-container {
    width: 94vw !important;
    height: auto !important;
    min-height: 380px !important;
    max-height: 85vh !important;
    border-radius: 16px !important;
  }

  .settings-sidebar {
    width: 125px !important;
    padding: 14px 4px 14px 6px !important;
  }

  .settings-sidebar-item,
  .settings-logout-btn {
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 8px 8px !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  .settings-content {
    padding: 18px 14px !important;
  }

  .settings-content-title {
    font-size: 18px !important;
    margin-bottom: 16px !important;
  }

  .settings-label {
    font-size: 13.5px !important;
  }

  .theme-dropdown-btn {
    font-size: 13.5px !important;
  }

  .settings-close-icon {
    top: 12px !important;
    right: 12px !important;
  }

  .delete-modal,
  .logout-confirm-box,
  .folder-modal-content {
    width: 92vw !important;
    padding: 20px 16px !important;
  }
}

.sidebar-content::-webkit-scrollbar {
  width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
}

.sidebar-content::-webkit-scrollbar-button,
.sidebar-content::-webkit-scrollbar-button:single-button,
.sidebar-content::-webkit-scrollbar-button:vertical:increment,
.sidebar-content::-webkit-scrollbar-button:vertical:decrement {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
}

body.dark-mode .sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

body.dark-mode .sidebar-content {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.message.ai .message-bubble .MathJax,
.message.ai .message-bubble mjx-container,
.message.ai .message-bubble mjx-container[jax="CHTML"] {
  font-size: 105% !important;
}

.windowed-message {

  content-visibility: auto;
}

.auth-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #000000;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #111111;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-nav-btn:hover {
  background: #222222;
}

body.dark-mode .auth-nav-btn {
  background: #000000;
  color: #ffffff;
  border-color: #333333;
}

body.dark-mode .auth-nav-btn:hover {
  background: #222222;
}

.auth-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #666666;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  transition: color 0.2s ease;
  z-index: 20;
  box-shadow: none;
  backdrop-filter: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.auth-close-btn:hover,
.auth-close-btn:active,
.auth-close-btn:focus-visible {
  background: transparent;
  color: #111111;
  transform: none;
}

body.dark-mode .auth-close-btn {
  background: transparent;
  color: #aaaaaa;
}

body.dark-mode .auth-close-btn:hover,
body.dark-mode .auth-close-btn:active,
body.dark-mode .auth-close-btn:focus-visible {
  background: transparent;
  color: #ffffff;
}

.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

body.dark-mode .auth-overlay {
  background: rgba(0, 0, 0, 0.72);
}

.auth-container-card {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 820px;
  min-height: 520px;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  animation: authCardScale 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.dark-mode .auth-container-card {
  background: #18181c;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

@keyframes authCardScale {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-left-banner {
  position: relative;
  width: 360px;
  flex-shrink: 0;
  background: #030306;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.auth-liquid-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  pointer-events: none;
  z-index: 1;
  object-fit: cover;
}

.glass-reflection-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
  z-index: 4;
}

.auth-banner-logo {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 34px;
  height: 34px;
  z-index: 5;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.28));
}

@media (max-width: 768px) {
  .auth-banner-logo {
    top: 18px;
    left: 18px;
    width: 28px;
    height: 28px;
  }
}

.auth-right-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 36px;
  box-sizing: border-box;
}

.auth-panel {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  width: 100%;
  max-width: 360px;
  padding: 0;
  box-shadow: none;
  text-align: center;
  color: #111111;
  box-sizing: border-box;
  animation: none;
}

body.dark-mode .auth-panel {
  background: transparent;
  color: #ececec;
  border: none;
  box-shadow: none;
}

@media (max-width: 768px) {
  .auth-container-card {
    flex-direction: column;
    max-width: 420px;
    min-height: auto;
    border-radius: 20px;
  }

  .auth-left-banner {
    width: 100%;
    height: 180px;
    padding: 24px 20px;
  }

  .glowing-sphere {
    width: 75px;
    height: 75px;
    top: 40%;
  }

  .banner-title {
    font-size: 18px;
  }

  .banner-subtitle {
    display: none;
  }

  .auth-right-content {
    padding: 28px 24px;
  }
}

.auth-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

.auth-head {
  margin-bottom: 28px;
}

.auth-head .auth-title {
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  line-height: 1.5;
  color: #71717a;
  margin: 0;
}

body.dark-mode .auth-subtitle {
  color: #a1a1aa;
}

.auth-title .auth-title-char {
  display: inline-block;
}

.auth-title.auth-title-anim .auth-title-char {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(6px);
  animation: authTitleIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(0.14s + var(--i, 0) * 0.05s);
  will-change: opacity, filter, transform;
}

@keyframes authTitleIn {
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-title.auth-title-anim .auth-title-char {
    filter: none;
    transform: none;
    animation-name: authTitleFade;
  }
}

@keyframes authTitleFade {
  to {
    opacity: 1;
  }
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input {
  height: 48px;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid #e4e4e7;

  padding: 0 16px 2px;
  border-radius: 12px;
  color: #18181b;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.auth-input::placeholder {
  color: #a1a1aa;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  -webkit-text-fill-color: #18181b;
  caret-color: #18181b;
  transition: background-color 9999s 0s;
}

.auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset, 0 0 0 3px rgba(24, 24, 27, 0.08);
}

body.dark-mode .auth-input:-webkit-autofill,
body.dark-mode .auth-input:-webkit-autofill:hover,
body.dark-mode .auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #1f1f23 inset;
  -webkit-text-fill-color: #f4f4f5;
  caret-color: #f4f4f5;
}

body.dark-mode .auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #1f1f23 inset, 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.auth-input:focus {
  border-color: #18181b;
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}

body.dark-mode .auth-input {
  background: #1f1f23;
  border-color: #2e2e33;
  color: #f4f4f5;
}

body.dark-mode .auth-input::placeholder {
  color: #71717a;
}

body.dark-mode .auth-input:focus {
  border-color: #a1a1aa;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.auth-field {
  position: relative;
}

.auth-field .auth-input {
  padding-left: 46px;
}

.auth-field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #a1a1aa;
  pointer-events: none;
}

.auth-btn {
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.15s, color 0.15s;
  font-family: inherit;
}

.email-btn {
  background: #18181b;
  color: #ffffff;
}

.email-btn:hover {
  background: #3f3f46;
}

.email-btn:disabled,
.email-btn:disabled:hover {
  background: #e4e4e7;
  color: #a1a1aa;
  cursor: default;
}

body.dark-mode .email-btn {
  background: #f4f4f5;
  color: #18181b;
}

body.dark-mode .email-btn:hover {
  background: #ffffff;
}

body.dark-mode .email-btn:disabled,
body.dark-mode .email-btn:disabled:hover {
  background: #2a2a2f;
  color: #6b6b72;
}

.google-btn {
  background: #f4f4f5;
  color: #18181b;
  border: none;
}

.google-btn:hover {
  background: #e9e9ec;
}

body.dark-mode .google-btn {
  background: #26262b;
  color: #f4f4f5;
}

body.dark-mode .google-btn:hover {
  background: #2f2f35;
}

.auth-switch {
  margin: 4px 0 0;
  font-size: 13px;
  color: #71717a;
}

.auth-switch-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #18181b;
  cursor: pointer;
}

.auth-switch-btn:hover {
  text-decoration: underline;
}

body.dark-mode .auth-switch {
  color: #a1a1aa;
}

body.dark-mode .auth-switch-btn {
  color: #f4f4f5;
}

.code-info-box {
  margin-bottom: 12px;
}

.code-info-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px 0;
  color: inherit;
}

.code-info-sub {
  font-size: 14px;
  line-height: 1.5;
  color: #71717a;
  margin: 0;
}

body.dark-mode .code-info-sub {
  color: #a1a1aa;
}

.sent-email-badge {
  display: inline-block;          
  font-weight: 600;
  color: #18181b;
  overflow-wrap: anywhere;
}

body.dark-mode .sent-email-badge {
  color: #f4f4f5;
}

.code-input-wrapper {
  margin: 0;
}

.code-input {
  height: 56px;
  font-family: monospace, Courier, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 10px;
  text-align: center;
  padding: 0 16px;
}

.code-error-msg {
  background: transparent;
  border: none;
  color: #ff3b30;
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 0;
  border-radius: 0;
  text-align: center;
}

.dob-picker-container {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}

.dob-select {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-color: #f7f7f8;
  border: 1px solid #e2e2e7;
  border-radius: 9px;
  padding: 10px 24px 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #1c1c1e;
  outline: none;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.dob-select-month {
  flex: 1.35;
}

.dob-select:hover {
  border-color: #c7c7cc;
  background-color: #f2f2f7;
}

.dob-select:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
  background-color: #ffffff;
}

body.dark-mode .dob-select {
  background-color: #242426;
  border-color: #38383a;
  color: #f2f2f7;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

body.dark-mode .dob-select option {
  background-color: #1c1c1e;
  color: #ffffff;
}

body.dark-mode .dob-select:hover {
  border-color: #48484a;
  background-color: #2c2c2e;
}

body.dark-mode .dob-select:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25);
  background-color: #1c1c1e;
}

.code-timer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-top: 4px;
}

.code-timer {
  color: #888;
  font-variant-numeric: tabular-nums;
}

.resend-code-btn {
  background: none;
  border: none;
  color: #0a84ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
}

.resend-code-btn:disabled {
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.resend-code-btn:not(:disabled):hover {
  text-decoration: underline;
}

.back-email-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
  padding: 4px;
  transition: color 0.2s;
}

.back-email-btn:hover {
  color: #111;
}

body.dark-mode .back-email-btn:hover {
  color: #fff;
}

.thinking-content-text {
  color: #555;
  font-size: 14px;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: #fff;
  color: #333;
  z-index: 2001;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, color 0.3s ease;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.sidebar.active {
  transform: translateX(0);
}

@media (min-width: 769px) {
  .container {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.sidebar-open .container {
    margin-left: 280px;
  }

  html.no-slide .sidebar,
  html.no-slide .container,
  html.no-slide .header-inner,
  html.no-slide .sidebar-btn {
    transition: none !important;
  }

  .sidebar-btn {
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
      margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  }

  body.sidebar-open #sidebarBtn {
    width: 0;
    margin-right: -8px;
    opacity: 0;
    pointer-events: none;
  }

  .header-inner {
    transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.sidebar-open .header-inner {
    padding-left: 22px;
  }

  .sidebar-overlay {
    display: none;
  }

  .sidebar {
    box-shadow: none;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
  }

  body.dark-mode .sidebar {
    border-right-color: rgba(255, 255, 255, 0.08);
  }
}

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

.sidebar-logo {
  height: 13px;
  max-height: 13px;
  width: auto;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

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

.sidebar-logo-mark {
  display: block;
  width: 23.24px;
  height: 18px;
  color: #000;
}

.sidebar-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.sidebar-close-btn .sidebar-icon {
  display: block;
  width: 20.48px;
  height: 20.48px;
  pointer-events: none;
}

.sidebar-close-btn .sidebar-arrow-back {
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (hover: hover) {
  .sidebar-close-btn:hover .sidebar-arrow-back {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-close-btn:focus-visible .sidebar-arrow-back {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-close-btn .sidebar-arrow-back {
    transform: none;
    transition: opacity 0.12s linear;
  }
}

.sidebar-content {
  padding: 20px 16px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-chats-header {
  color: #000;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 12px;
  margin-top: 10px;
  margin-right: 3px;
}

.dark-mode .sidebar-chats-header {
  color: #fff;
}

.sidebar-chat-item {
  color: #666;
  font-size: 13.5px;
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.2s, color 0.2s;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 32px;
}

.dark-mode .sidebar-chat-item {
  color: #aaa;
}

.sidebar-chat-item:hover {
  background: #f0f0f0;
  color: #222;
}

.dark-mode .sidebar-chat-item:hover {
  background: #333;
  color: #eee;
}

.sidebar-chat-item.active {
  background: #eaeaea;
  color: #000;
  font-weight: 500;
}

.dark-mode .sidebar-chat-item.active {
  background: #444;
  color: #fff;
}

.sidebar-chat-options-btn {
  display: none;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  color: #999;
  font-size: 11px;
  line-height: 1;
  font-weight: bold;
  letter-spacing: 1px;
  transition: all 0.2s;
}

.dark-mode .sidebar-chat-options-btn {
  color: #888;
}

.sidebar-chat-item:hover .sidebar-chat-options-btn {
  display: block;
}

.sidebar-chat-options-btn:hover {
  background: transparent;
  color: #000;
}

.dark-mode .sidebar-chat-options-btn:hover {
  background: transparent;
  color: #fff;
}

.sidebar-chat-menu {
  position: fixed;
  background: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  padding: 2px 0;
  min-width: 90px;
}

.dark-mode .sidebar-chat-menu {
  background: #282828;
  border-color: #3e3e3e;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.sidebar-chat-menu-item {
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  width: 100%;
  font-family: inherit;
  transition: background 0.15s;
}

.sidebar-chat-menu-item.rename {
  color: #000000;
}

.dark-mode .sidebar-chat-menu-item.rename {
  color: #ffffff;
}

.sidebar-chat-menu-item.delete {
  color: #ff4d4d;
}

.sidebar-chat-menu-item:hover {
  background: #f5f5f5;
}

.dark-mode .sidebar-chat-menu-item:hover {
  background: #333333;
}

.sidebar-chat-rename-input {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  outline: none;
  padding: 0;
  margin: 0;
}

.delete-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: deleteModalFadeIn 0.25s ease-out forwards;
}

@keyframes deleteModalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.delete-modal {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  animation: deleteModalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes deleteModalPopIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

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

.dark-mode .delete-modal {
  background: #212121;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.delete-modal-title {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 20px;
  color: #000;
}

.dark-mode .delete-modal-title {
  color: #fff;
}

.delete-modal-body {
  font-size: 15px;
  color: #333;
  margin-bottom: 8px;
}

.dark-mode .delete-modal-body {
  color: #ddd;
}

.delete-modal-subtext {
  font-size: 13px;
  color: #888;
  margin-bottom: 24px;
}

.dark-mode .delete-modal-subtext {
  color: #888;
}

.delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.delete-modal-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 24px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.delete-modal-btn.cancel {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  color: #000000;
}

.dark-mode .delete-modal-btn.cancel {
  background: #212121;
  border-color: #444;
  color: #ffffff;
}

.delete-modal-btn.cancel:hover {
  background: #f5f5f5;
}

.dark-mode .delete-modal-btn.cancel:hover {
  background: #2a2a2a;
}

.delete-modal-btn.confirm {
  background: #ff0033;
  
  color: #ffffff;
}

.delete-modal-btn.confirm:hover {
  background: #e6002e;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  user-select: none;
  background: #71717a;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  flex-shrink: 0;
}

.profile-avatar-small .avatar-mesh {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.profile-avatar-small .avatar-initial {
  position: relative;
  z-index: 1;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);

  text-box: trim-both cap alphabetic;
}

@supports not (text-box: trim-both cap alphabetic) {
  .profile-avatar-small .avatar-initial {
    transform: translateY(-0.5px);
  }
}

.profile-avatar-small.tier-starter {
  background: linear-gradient(135deg, #6b3a17, #c98a4b);
}

.profile-avatar-small.tier-plus {
  background: linear-gradient(135deg, #3a4250, #a9b4c2);
}

.profile-avatar-small.tier-plus-plus {
  background: linear-gradient(135deg, #0d5a41, #3fd39a);
}

.profile-avatar-small.tier-pro {
  background: linear-gradient(135deg, #6e4f0c, #e0b43a);
}

.profile-avatar-small.tier-pro-plus {
  background: linear-gradient(135deg, #4a1c7a, #b27ef0);
}

.profile-avatar-small.tier-ultimate {
  background: linear-gradient(135deg, #0a1f6b, #2f6fe0);
}

.profile-avatar-small.tier-dev {
  background: linear-gradient(135deg, #0a4aa8, #3ea8ff);
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-weight: 600;
  font-size: 14px;
  color: #222;
}

.profile-sub {
  font-size: 12px;
  color: #777;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #a1a1aa;
  font-size: 12px;
  margin: 6px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ececee;
}

body.dark-mode .auth-divider::before,
body.dark-mode .auth-divider::after {
  background: #2e2e33;
}

.auth-label {
  text-align: left;
  font-size: 11px;
  color: #666;
  margin-bottom: -10px;
}

.settings-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10005;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.settings-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.settings-modal {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  width: 90%;
  max-width: 800px;
  height: 80vh;
  max-height: 800px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-modal-overlay.active .settings-modal {
  transform: translateY(0) scale(1);
}

.settings-modal-header {
  padding: 24px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: #111;
}

.settings-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.settings-close-btn:hover {
  background: #f5f5f5;
  color: #222;
}

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

.settings-panel-container {
  width: 800px;
  max-width: 95vw;
  height: 500px;
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: row;
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.settings-sidebar {
  width: 220px;
  background: #f9f9f9;
  border-right: 1px solid #eaeaea;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.settings-sidebar-item {
  font-size: 15px;
  font-weight: 600;
  padding: 10px 12px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #111;
  border-radius: 8px;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.settings-sidebar-item:hover {
  background: #eaeaea;
}

.settings-content {
  flex: 1;
  padding: 24px 32px;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s ease;
}

.settings-content-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #111;
  transition: color 0.4s ease;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eaeaea;
  padding: 16px 0;
  transition: border-color 0.4s ease;
}

.settings-label {
  font-size: 15px;
  font-weight: 400;
  color: #333;
  transition: color 0.4s ease;
}

.theme-dropdown-btn {
  background: none;
  border: none;
  font-size: 15px;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.4s ease;
}

.settings-close-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: #555;
  padding: 4px;
  transition: color 0.4s ease;
}

.settings-close-icon:hover {
  color: #111;
}

.theme-ripple {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #111;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 10000;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-ripple.active {
  transform: translate(-50%, -50%) scale(400);
}

body {
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.dark-mode {
  background: #212121;
  color: #ececec;
  --text: #ececec;
  --border: #333;
}

body.dark-mode .header {
  background: transparent;
}

body.dark-mode .header-upgrade {
  color: #60a5fa;
}

body.dark-mode .header-upgrade:hover {
  color: #93c5fd;
}

body.dark-mode .sidebar-btn {
  color: #ececec;
}

body.dark-mode .welcome-text {
  color: #ececec;
}

body.dark-mode .model-selector {
  color: #d1d5db;
}

body.dark-mode .model-selector:hover .model-label,
body.dark-mode .model-selector.active .model-label {
  background: #3a3a3a;
  color: #ececec;
}

body.dark-mode .model-selector .model-effort {
  color: #9ca3af;
}

body.dark-mode .model-selector .model-effort:hover {
  color: #d1d5db;
}

body.dark-mode .ft-invert-dark {
  filter: invert(1) hue-rotate(180deg);
}

body.dark-mode .model-menu-sep {
  background: #333;
}

body.dark-mode .input-note {
  color: #8e8e8e;
}

body.dark-mode .model-dropdown .effort-row.open {
  background: #222;
}

body.dark-mode .settings-panel-container {
  background: #212121;
  border-color: #333;
}

body.dark-mode .settings-sidebar {
  background: #171717;
  border-right-color: #333;
}

body.dark-mode .settings-sidebar-item {
  color: #ececec;
}

body.dark-mode .settings-sidebar-item:hover {
  background: #2f2f2f;
}

body.dark-mode .settings-sidebar-item.active {
  background: #2f2f2f;
}

body.dark-mode .settings-content {
  background: #212121;
}

body.dark-mode .settings-content-title {
  color: #ececec;
}

body.dark-mode .settings-row {
  border-bottom-color: #333;
}

body.dark-mode .settings-label {
  color: #d1d5db;
}

body.dark-mode .theme-dropdown-btn {
  color: #ececec;
}

body.dark-mode .settings-close-icon {
  color: #9ca3af;
}

body.dark-mode .settings-close-icon:hover {
  color: #ececec;
}

#settingsOverlay.auth-overlay {
  z-index: 10005;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

body.dark-mode #settingsOverlay.auth-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.settings-panel-container {
  border-radius: 16px !important;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
  overflow: hidden;
}

body.dark-mode .settings-panel-container {
  border: 1px solid rgba(120, 120, 120, 0.35) !important;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(100, 100, 100, 0.15) !important;
}

.settings-logout-row {
  margin-top: 0;
  padding-top: 8px;
  border-top: 1px solid #eaeaea;
  transition: border-color 0.4s ease;
}

body.dark-mode .settings-logout-row {
  border-top-color: #333;
}

.settings-logout-btn {
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #ff3b30;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: background-color 0.2s ease, opacity 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.settings-logout-btn:hover {
  background: rgba(255, 59, 48, 0.08);
  opacity: 1;
}

body.dark-mode .settings-logout-btn:hover {
  background: rgba(255, 59, 48, 0.16);
}

.logout-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: deleteModalFadeIn 0.25s ease-out forwards;
}

.logout-confirm-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  animation: deleteModalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

body.dark-mode .logout-confirm-box,
.dark-mode .logout-confirm-box {
  background: #212121;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.logout-confirm-title {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 20px;
  color: #000000;
}

body.dark-mode .logout-confirm-title,
.dark-mode .logout-confirm-title {
  color: #ffffff;
}

.logout-confirm-body {
  font-size: 15px;
  color: #333333;
  margin-bottom: 8px;
}

body.dark-mode .logout-confirm-body,
.dark-mode .logout-confirm-body {
  color: #dddddd;
}

.logout-confirm-subtext {
  font-size: 13px;
  color: #888888;
  margin-bottom: 24px;
}

body.dark-mode .logout-confirm-subtext,
.dark-mode .logout-confirm-subtext {
  color: #888888;
}

.logout-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.logout-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 24px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.logout-btn.cancel,
.logout-btn-no {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  color: #000000;
}

body.dark-mode .logout-btn.cancel,
.dark-mode .logout-btn.cancel,
body.dark-mode .logout-btn-no,
.dark-mode .logout-btn-no {
  background: #212121;
  border-color: #444444;
  color: #ffffff;
}

.logout-btn.cancel:hover,
.logout-btn-no:hover {
  background: #f5f5f5;
  opacity: 1;
}

body.dark-mode .logout-btn.cancel:hover,
.dark-mode .logout-btn.cancel:hover,
body.dark-mode .logout-btn-no:hover,
.dark-mode .logout-btn-no:hover {
  background: #2a2a2a;
}

.logout-btn.confirm,
.logout-btn-yes {
  background: #ff0033;
  color: #ffffff;
  border: none;
}

.logout-btn.confirm:hover,
.logout-btn-yes:hover {
  background: #e6002e;
  opacity: 1;
}

body.dark-mode .auth-panel:not(.settings-panel-container) {
  background: transparent;
  color: #ececec;
  border: none;
}

body.dark-mode .model-dropdown,
body.dark-mode .effort-panel,
body.dark-mode .inline-level-dropdown {
  background: #111;
  border-color: #333;
  color: #fff;
}

body.dark-mode .dropdown-label {
  color: #999;
}

body.dark-mode .dropdown-item {
  color: #fff;
}

body.dark-mode .dropdown-item.selected {
  background: transparent;
  color: #fff;
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-menu-item:hover {
  background: #222;
}

body.dark-mode .dropdown-item.disabled,
body.dark-mode .dropdown-item.disabled:hover {
  background: transparent;
  color: #666;
}

body.dark-mode .dropdown-item-label {
  color: #fff;
}

body.dark-mode .dropdown-item-value {
  color: #ccc;
}

body.dark-mode .theme-option-item {
  color: #fff;
}

body.dark-mode .theme-option-item:hover {
  background: #3a3a3a;
}

body.dark-mode .theme-option-item.selected {
  background: #4a4a4a;
  color: #fff;
}

body.dark-mode .input-wrapper {
  background: #2f2f2f;
  border-color: #333;
  transition: background-color 0.4s ease, border-color 0.4s ease, width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.3s ease;
}

body.dark-mode .input-wrapper:focus-within {
  border-color: #555;
}

body.dark-mode {
  --input-area-bg: #212121;
}

body.dark-mode .has-messages .input-area,
:where(html.in-chat) body.dark-mode .container .input-area {
  background: #212121;
}

body.dark-mode .input-box {
  background: transparent;
  color: #ececec;
  border-color: transparent;
  transition: color 0.4s ease;
}

body.dark-mode .settings-btn {
  color: #d1d5db;
}

body.dark-mode .settings-btn:hover {
  background: #3a3a3a;
  color: #ececec;
}

.dark-mode .send-btn {
  background: #ececec;
  color: #000;
}

.dark-mode .send-btn:hover {
  background: #fff;
}

.dark-mode .send-btn:disabled {
  background: #8a8a8a;
  color: #2f2f2f;
  opacity: 0.5;
}

.dark-mode .send-btn .stop-square {
  background: #000;
}

body.dark-mode .message.ai .message-bubble {
  background: transparent;
  color: #ececec;
  border-color: transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

body.dark-mode .sidebar {
  background: #171717;
  color: #ececec;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease, color 0.4s ease;
}

body.dark-mode .sidebar-footer {
  border-color: #333;
  transition: border-color 0.4s ease;
}

body.dark-mode .sidebar-close-btn {
  color: #ececec;
}

body.dark-mode .sidebar-logo {
  filter: brightness(0) invert(1);
}

body.dark-mode .sidebar-logo-mark {
  color: #fff;
}

body.dark-mode .profile-name {
  color: #ececec;
}

.sidebar-settings-btn {
  color: #555;
}

body.dark-mode .sidebar-settings-btn {
  color: #ececec;
}

.attachment-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: -7px;
  width: 140px;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  z-index: 3000;
  padding: 4px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95) translateY(-5px);
  transform-origin: top left;
  transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.attachment-dropdown.open-upwards {
  top: auto;
  bottom: calc(100% + 43px);
  left: -7px;
  right: auto;
  transform-origin: bottom left;
  transform: scale(0.95) translateY(5px);
}

.attachment-dropdown.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

body.dark-mode .attachment-dropdown {
  background: #111;
  border-color: #333;
  color: #fff;
}

.attachment-dropdown .dropdown-menu-item {
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
}

.attachment-dropdown .dropdown-item-label {
  font-size: 13.5px;
}

.attachment-dropdown .dropdown-menu-item svg {
  width: 16px;
  height: 16px;
}

.file-preview-container {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease, padding 0.3s ease;
  overflow: hidden;
  padding: 0;
  opacity: 0;
}

.file-preview-container.active {
  grid-template-rows: 1fr;
  opacity: 1;
  padding: 0 0 6px 0;
}

.file-preview-inner {
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-left: 6px;
}

.file-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: transparent;
  border-radius: 16px;
  padding: 2px 0px 2px 2px;
  font-size: 13.5px;
  color: #333;
  border: 1px solid transparent;
  max-width: 160px;
}

body.dark-mode .file-preview-pill {
  background-color: transparent;
  color: #eee;
  border-color: transparent;
}

.file-preview-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-preview-icon svg {
  width: 100%;
  height: 100%;
}

body.dark-mode .file-preview-icon img[src*="folder.svg"] {
  filter: invert(1) brightness(2);
}

.file-preview-icon.folder-clickable {
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.file-preview-icon.folder-clickable:hover {
  opacity: 0.7;
  transform: scale(1.1);
}

.folder-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  animation: folderModalFadeIn 0.25s ease-out forwards;
}

@keyframes folderModalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.folder-modal-content {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  animation: folderModalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes folderModalPopIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

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

.dark-mode .folder-modal-content {
  background: #212121;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.folder-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid #eaeaea;
  padding-bottom: 12px;
}

.dark-mode .folder-modal-header {
  border-bottom-color: #333;
}

.folder-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: inherit;
}

.folder-modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
}

.folder-modal-close-btn:hover {
  color: #555;
}

.dark-mode .folder-modal-close-btn:hover {
  color: #ccc;
}

.folder-modal-body {
  overflow-y: auto;
  flex-grow: 1;
  margin-right: -8px;
  padding-right: 8px;
}

.folder-modal-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.folder-modal-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background-color: #f7f7f7;
  transition: background-color 0.2s;
}

.dark-mode .folder-modal-file-row {
  background-color: #2f2f2f;
}

.folder-modal-file-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.dark-mode .folder-modal-file-icon img[src*="folder.svg"] {
  filter: invert(1) brightness(2);
}

.folder-modal-file-name {
  flex-grow: 1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #333;
}

.dark-mode .folder-modal-file-name {
  color: #eee;
}

.folder-modal-file-remove {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  width: auto;
  height: auto;
}

.folder-modal-file-remove svg {
  width: 14px;
  height: 14px;
}

.folder-modal-file-remove:hover {
  background-color: #e5e5e5;
  color: #f44336;
}

.dark-mode .folder-modal-file-remove:hover {
  background-color: #3e3e3e;
  color: #ff5722;
}

.folder-modal-empty {
  padding: 24px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.file-preview-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  line-height: 1.4;
}

.file-remove-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  width: 18px;
  height: 18px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  top: 1px;
  left: -4px;
  transition: all 0.15s ease;
}

.file-remove-btn svg {
  width: 12px;
  height: 12px;
}

.file-remove-btn:hover {
  color: #ff4d4d;
  background-color: transparent;
}

body.dark-mode .file-remove-btn:hover {
  color: #ff6b6b;
  background-color: transparent;
}

.drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

body.dark-mode .drag-overlay {
  background: rgba(0, 0, 0, 0.65);
}

body.drag-active .drag-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.drag-active .input-area {
  z-index: 2010 !important;
  background: transparent !important;
  box-shadow: none !important;
}

:where(html:not(.in-chat)) body.drag-active .container:not(.has-messages) .input-area,
:where(html:not(.in-chat)) body.drag-active .chat-outer:has(.chat-container:empty)~.input-area,
:where(html:not(.in-chat)) body.drag-active .chat-outer:has(.chat-container:empty)+.input-area,
:where(html:not(.in-chat)) body.drag-active .chat-container:empty~.input-area,
:where(html:not(.in-chat)) body.drag-active .chat-container:empty+.input-area {
  background: transparent !important;
}

body.drag-active .input-wrapper {
  position: relative;
  z-index: 2020 !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.1);
  border-color: #666 !important;
  transform: scale(1.02);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode.drag-active .input-wrapper {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 0 2px rgba(255, 255, 255, 0.1);
  border-color: #888 !important;
}

.file-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none !important;
  border: none !important;
  border-radius: 16px;
  padding: 2px 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  height: 28px;
  transition: color 0.2s ease;
  user-select: none;
  margin-top: 0px;
  vertical-align: middle;
  position: relative;
  top: 1.92px;
  left: -10px;
}

.file-more-btn:hover {
  color: #555;
  background: none !important;
}

.has-messages .file-more-btn,
:where(html.in-chat) .container .file-more-btn {
  left: -4.7px;
}

body.dark-mode .file-more-btn {
  background: none !important;
  border: none !important;
  color: #aaa;
}

body.dark-mode .file-more-btn:hover {
  color: #fff;
  background: none !important;
}

.file-preview-pill.temp-pill-blink .file-preview-name {
  color: #ff4d4d !important;
  animation: textBlinkRed 0.4s ease-in-out infinite alternate;
}

body.dark-mode .file-preview-pill.temp-pill-blink .file-preview-name {
  color: #ff6b6b !important;
}

@keyframes textBlinkRed {
  0% {
    opacity: 0.35;
  }

  100% {
    opacity: 1;
  }
}

.top-error-banner {
  position: fixed;
  top: -65px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ff4d4d;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10010;
  transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
}

.top-error-banner.show {
  top: 24px;
  opacity: 1;
  pointer-events: auto;
}

.input-wrapper.error-pulse {
  animation: borderFlashRed 0.5s ease-in-out infinite alternate;
}

@keyframes borderFlashRed {
  0% {
    border-color: #e5e5e5;
    box-shadow: 0 0 0 0 rgba(255, 77, 77, 0), 0 4px 12px rgba(0, 0, 0, 0.05);
  }

  100% {
    border-color: #ff4d4d !important;
    box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.25), 0 4px 16px rgba(255, 77, 77, 0.15) !important;
  }
}

body.dark-mode .input-wrapper.error-pulse {
  animation: borderFlashRedDark 0.5s ease-in-out infinite alternate;
}

@keyframes borderFlashRedDark {
  0% {
    border-color: #333;
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0), 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  100% {
    border-color: #ff6b6b !important;
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.3), 0 4px 16px rgba(255, 107, 107, 0.25) !important;
  }
}

.message-content-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 70%;
}

.message.user .message-content-wrapper {
  flex-direction: row;
  justify-content: flex-end;
  align-self: flex-end;
}

.message.ai .message-content-wrapper {
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-self: flex-start;
}

.message-content-wrapper .message-bubble {
  max-width: 100%;
  flex-shrink: 1;
}

.message-attachments-indicator {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  padding: 2px 4px;
  font-size: 11.5px;
  color: #8a8a8a;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s, transform 0.2s;
}

.message-attachments-indicator:hover {
  color: #555;
  transform: scale(1.03);
}

.dark-mode .message-attachments-indicator {
  background: none;
  color: #8a8a8a;
}

.dark-mode .message-attachments-indicator:hover {
  color: #ccc;
}

.message-attachments-indicator svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
}

.message-attachments-list {
  display: grid;
  grid-template-rows: 0fr;
  max-width: 70%;
  align-self: flex-end;

  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  transform: translateY(-4px);
  transition: grid-template-rows 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.25s ease-out,
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    margin 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.message-attachments-list.open {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
  margin-top: 6px;
  margin-bottom: 2px;
}

.message-attachments-list-inner {
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.message-attachments-list .file-preview-pill {
  font-size: 12px;
  padding: 2px 8px;
  background-color: #f7f7f7;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  max-width: 140px;
}

.dark-mode .message-attachments-list .file-preview-pill {
  background-color: #2f2f2f;
  border-color: #3e3e3e;
  color: #eee;
}

.message-attachments-list .file-preview-icon {
  width: 14px;
  height: 14px;
}

mjx-container,
mjx-container svg {
  color: inherit !important;
  fill: currentColor !important;
}

body.dark-mode mjx-container,
body.dark-mode mjx-container svg {
  color: #ececec !important;
  fill: currentColor !important;
}

mjx-container[jax="SVG"] {
  display: inline-block;
  margin: 0.15em 0;
  vertical-align: middle;
  max-width: 100%;
}

mjx-container[jax="SVG"][display="true"] {
  display: block;
  text-align: center;
  margin: 0.8em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.token-limit-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 14px 4px 14px;
  margin: 0;
  border-radius: 0;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transition: color 0.2s ease-in-out;
  animation: fadeInLimit 0.15s ease-out;
}

@keyframes fadeInLimit {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.token-limit-badge.warning {
  background: transparent !important;
  border: none !important;
  color: #999;
}

body.dark-mode .token-limit-badge.warning {
  background: transparent !important;
  border: none !important;
  color: #8a8a8a;
}

.token-limit-badge.danger {
  background: transparent !important;
  border: none !important;
  color: #6f6f6f;
}

body.dark-mode .token-limit-badge.danger {
  background: transparent !important;
  border: none !important;
  color: #b0b0b0;
}

.sidebar-footer {
  position: relative;
}

.sidebar-settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-settings-btn:hover,
.sidebar-settings-btn[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.06);
}

.sidebar-settings-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.sidebar-settings-btn svg {
  transition: transform 0.2s ease;
}

.account-menu {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% + 6px);
  z-index: 10010;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  transform-origin: bottom center;
  animation: accountMenuIn 0.14s ease-out;
}

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

@keyframes accountMenuIn {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.account-menu-email {
  font-size: 12.5px;
  font-weight: 500;
  color: #71717a;
  padding: 6px 10px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-email:empty {
  display: none;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #222;
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;             
  letter-spacing: 0.005em;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.account-menu-item:hover,
.account-menu-item:focus-visible {
  background: #f2f2f2;
  outline: none;
}

.account-menu-item svg {
  flex-shrink: 0;
  color: #444;
  stroke-width: 2.3;            
}

.account-menu-ext {
  margin-left: auto;
  opacity: 0.6;
  stroke-width: 2.1 !important;
}

.account-menu-sep {
  height: 1px;
  background: #eee;
  margin: 5px 4px;
}

.account-menu-upgrade svg {
  color: #1d4ed8;
}

.upgrade-label {
  position: relative;
  display: inline-block;
}

.upgrade-label #accountMenuUpgradeText {
  background: linear-gradient(90deg, #0a1f6b, #1d4ed8 55%, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.upgrade-label.has-mesh #accountMenuUpgradeText {
  background: none;
}

.text-mesh-gl {
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  visibility: hidden;
  pointer-events: none;
}

.text-mesh-out {
  position: absolute;
  pointer-events: none;
}

body.dark-mode .sidebar-settings-btn:hover,
body.dark-mode .sidebar-settings-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .account-menu {
  background: #262626;
  border-color: #383838;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

body.dark-mode .account-menu-email {
  color: #a1a1aa;
}

body.dark-mode .account-menu-item {
  color: #ececec;
}

body.dark-mode .account-menu-item svg {
  color: #bdbdbd;
}

body.dark-mode .account-menu-item:hover,
body.dark-mode .account-menu-item:focus-visible {
  background: #333;
}

body.dark-mode .account-menu-sep {
  background: #383838;
}

body.dark-mode .account-menu-upgrade svg {
  color: #60a5fa;
}

body.dark-mode .upgrade-label #accountMenuUpgradeText {
  background-image: linear-gradient(90deg, #3b82f6, #60a5fa 55%, #bfdbfe);
}

body.dark-mode .upgrade-label.has-mesh #accountMenuUpgradeText {
  background: none;
}

.settings-sidebar-item.active {
  background: #eaeaea;
}

.settings-pane[hidden] {
  display: none;
}

.settings-pane {

  overflow: visible;
}

.usage-plan-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  margin-bottom: 8px;
}

.usage-plan-badge {
  font-size: 13px;
  font-weight: 500;
  color: #71717a;
}

.usage-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 2fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #eaeaea;
}

.usage-row-title {
  font-size: 14.5px;
  color: #111;
}

.usage-row-sub {
  font-size: 12.5px;
  color: #71717a;
  margin-top: 3px;
}

.usage-bar {
  height: 6px;
  border-radius: 999px;
  background: #e8e8e8;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #3b82f6;              
  transition: width 0.4s ease, background-color 0.4s ease;
}

.usage-row-pct {
  font-size: 13px;
  color: #555;
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
  text-box: trim-both cap alphabetic;
}

@supports not (text-box: trim-both cap alphabetic) {
  .usage-row-pct {
    transform: translateY(-1px);
  }
}

.usage-note {
  font-size: 12.5px;
  color: #71717a;
  margin-top: 14px;
  line-height: 1.5;
}

.usage-status {
  font-size: 12.5px;
  color: #8a8a8f;
  padding: 10px 0;
  line-height: 1.5;
}

body.dark-mode .usage-status {
  color: #8e8e93;
}

.account-list {
  display: flex;
  flex-direction: column;
}

.account-row {
  border-bottom: 1px solid #ececec;
}

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

.account-row-main {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 84px;
  align-items: center;
  column-gap: 16px;
  min-height: 56px;
  padding: 6px 0;
}

.account-label {
  font-size: 14px;
  color: #3f3f46;
}

.account-value {
  font-size: 14px;
  color: #71717a;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.account-actions .account-btn {
  width: 100%;
}

.account-row-main.no-actions .account-value {
  grid-column: 2 / -1;
}

.account-row-main.no-actions .account-actions {
  display: none;
}

.account-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: transparent;
  color: #27272a;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.account-btn:hover:not(:disabled) {
  background: #f4f4f5;
}

.account-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.account-btn.primary {
  background: #18181b;
  border-color: #18181b;
  color: #fff;
}

.account-btn.primary:hover:not(:disabled) {
  background: #3f3f46;
}

.account-btn.danger {
  color: #dc2626;
  border-color: #fecaca;
}

.account-btn.danger:hover:not(:disabled) {
  background: #fef2f2;
}

.account-btn.danger.solid {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.account-btn.danger.solid:hover:not(:disabled) {
  background: #b91c1c;
}

.account-icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #71717a;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.account-icon-btn:hover {
  background: #f4f4f5;
  color: #18181b;
}

.account-icon-btn.copied {
  color: #16a34a;
}

.account-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #52525b;
  background: none;
  border: none;
  padding: 0;
  letter-spacing: 0.02em;
}

.settings-title-plan {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #a1a1aa;
  letter-spacing: 0.01em;
  vertical-align: 2px;
}

.account-subform {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 0 16px;
}

.account-subform[hidden] {
  display: none;
}

.account-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #18181b;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-input:focus {
  border-color: #a1a1aa;
  box-shadow: 0 0 0 3px rgba(161, 161, 170, 0.18);
}

.account-pw {
  position: relative;
}

.account-pw .account-input {
  padding-right: 40px;
}

.account-pw-eye {
  position: absolute;
  top: 4px;
  right: 4px;
}

.account-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.account-form-msg {
  font-size: 12.5px;
  color: #dc2626;
  min-height: 0;
}

.account-form-msg:empty {
  display: none;
}

.account-value.has-inline-edit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: visible;
}

.account-value-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-btn.inline-edit {
  flex: none;
  max-width: 0;
  margin-left: 0;
  padding: 0;
  border-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.22s ease, margin-left 0.22s ease, padding 0.22s ease,
              opacity 0.16s ease, background-color 0.15s ease;
}

.account-row:hover .account-btn.inline-edit,
.account-btn.inline-edit:focus-visible {
  max-width: 88px;
  margin-left: 10px;
  padding: 0 10px;
  border-width: 1px;
  opacity: 1;
}

@media (hover: none) {
  
  .account-btn.inline-edit {
    max-width: 88px;
    margin-left: 10px;
    padding: 0 10px;
    border-width: 1px;
    opacity: 1;
  }
}

.delete-modal-overlay.above-settings {
  z-index: 10010;
}

.account-delete-modal .delete-modal-title {
  margin-bottom: 12px;
}

.account-delete-modal .delete-modal-body {
  margin: 0 0 20px;
  line-height: 1.5;
  color: #52525b;
}

.account-delete-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: #71717a;
  word-break: break-all;
}

.account-delete-label strong {
  font-weight: 600;
  color: #18181b;
}

.account-delete-input {
  display: block;
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
  color: #18181b;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-delete-input:focus {
  border-color: #a1a1aa;
  box-shadow: 0 0 0 3px rgba(161, 161, 170, 0.2);
}

.account-delete-error {
  min-height: 0;
  margin-top: 8px;
  font-size: 12.5px;
  color: #dc2626;
}

.account-delete-error:empty {
  display: none;
}

.account-delete-modal .delete-modal-actions {
  margin-top: 24px;
}

.account-delete-modal .delete-modal-btn {
  min-width: 120px;
  height: 40px;
  padding: 0 20px;
}

.delete-modal-btn.confirm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.account-delete-modal .delete-modal-btn.confirm {
  background: #18181b;
  color: #fff;
}

.account-delete-modal .delete-modal-btn.confirm:hover:not(:disabled) {
  background: #3f3f46;
}

.dark-mode .account-delete-modal .delete-modal-btn.confirm {
  background: #f4f4f5;
  color: #18181b;
}

.dark-mode .account-delete-modal .delete-modal-btn.confirm:hover:not(:disabled) {
  background: #d4d4d8;
}

.dark-mode .account-delete-modal .delete-modal-body { color: #a1a1aa; }
.dark-mode .account-delete-label { color: #a1a1aa; }
.dark-mode .account-delete-label strong { color: #f4f4f5; }
.dark-mode .account-delete-input { background: #1a1a1a; border-color: #3f3f46; color: #f4f4f5; }
.dark-mode .account-delete-input:focus { border-color: #71717a; box-shadow: 0 0 0 3px rgba(113, 113, 122, 0.25); }

body.dark-mode .account-row { border-bottom-color: #2e2e2e; }
body.dark-mode .account-label { color: #d4d4d8; }
body.dark-mode .account-value,
body.dark-mode .account-key { color: #a1a1aa; }
body.dark-mode .account-btn { border-color: #3f3f46; color: #e4e4e7; }
body.dark-mode .account-btn:hover:not(:disabled) { background: #27272a; }
body.dark-mode .account-btn.primary { background: #f4f4f5; border-color: #f4f4f5; color: #18181b; }
body.dark-mode .account-btn.primary:hover:not(:disabled) { background: #d4d4d8; }
body.dark-mode .account-btn.danger { color: #f87171; border-color: #7f1d1d; }
body.dark-mode .account-btn.danger:hover:not(:disabled) { background: #2a1414; }
body.dark-mode .account-btn.danger.solid { background: #dc2626; border-color: #dc2626; color: #fff; }
body.dark-mode .account-icon-btn { color: #a1a1aa; }
body.dark-mode .account-icon-btn:hover { background: #27272a; color: #f4f4f5; }
body.dark-mode .settings-title-plan { color: #71717a; }
body.dark-mode .account-input { background: #1c1c1c; border-color: #3f3f46; color: #f4f4f5; }

@media (max-width: 640px) {
  .account-row-main {
    grid-template-columns: minmax(0, 1fr) 84px;
  }
  .account-value,
  .account-row-main.no-actions .account-value {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: left;
  }
  .account-value.has-inline-edit {
    justify-content: space-between;
  }
}

.settings-nav-group {
  display: flex;
  flex-direction: column;
}

.settings-subnav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.22s ease, opacity 0.18s ease, margin 0.22s ease;
}

.settings-nav-group:hover .settings-subnav,
.settings-nav-group:focus-within .settings-subnav,
.settings-nav-group.open .settings-subnav {
  max-height: 80px;
  opacity: 1;
  margin: 2px 0 4px;
}

.settings-subnav-item {
  padding: 6px 12px 6px 24px;
  font-size: 13px;
  font-weight: 500;
  color: #8a8a8f;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.settings-subnav-item:hover {
  color: #27272a;
  background: #ededed;
}

.settings-subnav-item.active {
  color: #18181b;
  background: #e7e7e7;
}

body.dark-mode .settings-subnav-item { color: #8e8e93; }
body.dark-mode .settings-subnav-item:hover { color: #e4e4e7; background: #2a2a2a; }
body.dark-mode .settings-subnav-item.active { color: #f4f4f5; background: #2f2f2f; }

.settings-sidebar:has(.settings-sidebar-item:hover, .settings-subnav-item:hover) .settings-sidebar-item.active:not(:hover),
.settings-sidebar:has(.settings-sidebar-item:hover, .settings-subnav-item:hover) .settings-subnav-item.active:not(:hover) {
  background: transparent;
}

.forgot-link {
  align-self: flex-end;
  background: none;
  border: none;
  padding: 2px 0;
  margin-top: -2px;
  font-size: 12px;
  color: #71717a;
  cursor: pointer;
}

.forgot-link:hover {
  color: #18181b;
  text-decoration: underline;
}

.forgot-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pw-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: -2px;
}

.pw-links .forgot-link {
  align-self: auto;
  margin-top: 0;
}

#passwordLoginStep.forgot-mode .password-field,
#passwordLoginStep.forgot-mode #pwLoginBtn,
#passwordLoginStep.forgot-mode #pwLinks,
#passwordLoginStep.forgot-mode #forgotPasswordBtn,
#passwordLoginStep.forgot-mode #pwLoginErrorMsg {
  display: none !important;
}

body.dark-mode .forgot-link { color: #a1a1aa; }
body.dark-mode .forgot-link:hover { color: #f4f4f5; }

body.dark-mode .settings-sidebar-item.active {
  background: #2f2f2f;
}

body.dark-mode .usage-plan-line,
body.dark-mode .usage-row-title {
  color: #ececec;
}

body.dark-mode .usage-row {
  border-bottom-color: #333;
}

body.dark-mode .usage-bar {
  background: #333;
}

body.dark-mode .usage-row-pct {
  color: #bdbdbd;
}

@media (max-width: 768px) {
  .usage-row {
    grid-template-columns: 1fr auto;
  }

  .usage-row .usage-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.code-lang-label {
  grid-area: 1 / 1;
  justify-self: start;
  align-self: start;
  margin: 13px 0 0 15px;
  font-family: inherit;          
  font-size: 12px;
  line-height: 1;
  color: #6b7280;
  pointer-events: none;
  user-select: none;
  z-index: 5;
}

.message.ai .message-bubble .code-block-wrap.has-lang > pre {
  padding-top: 40px;
}

body.dark-mode .code-lang-label {
  color: #9ca3af;
}

.password-intro {
  font-size: 14px;
  color: #555;
  margin: 0 0 14px;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field .auth-input {
  width: 100%;
  padding-right: 44px;           
  box-sizing: border-box;
}

.password-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: #777;
  cursor: pointer;
}

.password-eye:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

.password-eye .eye-closed { display: none; }
.password-eye[aria-pressed="true"] .eye-open { display: none; }
.password-eye[aria-pressed="true"] .eye-closed { display: block; }

.password-hint {
  font-size: 12.5px;
  color: #888;
  margin-top: 6px;
}

body.dark-mode .password-intro { color: #bdbdbd; }
body.dark-mode .password-eye { color: #aaa; }
body.dark-mode .password-eye:hover { background: rgba(255, 255, 255, 0.08); color: #eee; }
body.dark-mode .password-hint { color: #9ca3af; }

.message.user .message-bubble.collapsible {
  position: relative;
  padding-right: 34px;              
}

.message.user .message-bubble.collapsible.collapsed .user-msg-text {
  max-height: calc(1.5em * 8);      
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.user-msg-toggle {
  position: absolute;
  top: 6px;                         
  right: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: none;                 
  color: #444;
  opacity: 0.75;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.user-msg-toggle:hover {
  opacity: 1;
}

.user-msg-toggle svg {
  transition: transform 0.2s ease;
}

.message.user .message-bubble.collapsible:not(.collapsed) .user-msg-toggle svg {
  transform: rotate(180deg);
}

body.dark-mode .user-msg-toggle {
  color: #ececec;
}

.message.ai .message-content-wrapper {
  width: 100%;
}

.message.ai .message-bubble .code-block-wrap > pre {
  min-height: 56px;
  box-sizing: border-box;
}

.message.ai .message-bubble .code-block-wrap > pre.has-hscroll {
  padding-bottom: calc(14px - var(--code-hscroll, 0px));
}
