:root {
  --bg-page: #fefefe;
  --bg-sidebar: #fefefe;
  --bg-surface: #ffffff;
  --bg-input: #ffffff;
  --bg-glass: #fefefe;
  --brand-primary: #000000;
  --brand-primary-soft: rgba(0, 0, 0, 0.08);
  --brand-primary-hover: #1a1a1a;
  --text-high: #1f1f1f;
  --text-med: #444746;
  --text-low: #70757a;
  --text-on-brand: #ffffff;
  --border-subtle: #eeeeee;
  --border-strong: #e0e0e0;
  --sidebar-w: 245px;
  --sidebar-mini: 63px;
  --header-h: 58px;
  --input-max-w: 760px;
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-elevated: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-modal: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-pill: 100px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.3s var(--ease);
  --bg-code: #1e1e1e;
  --text-code: #d4d4d4;
  --mocha-code-header: #111111;
  --stop-color: #8a6b3f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: default;
  font-family: "Google Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body {
  zoom: 0.95;
  height: 105.263vh;
  width: 105.263vw;
  background: var(--bg-page);
  background-color: #fefefe;
  color: var(--text-high);
  display: flex;
  overflow: hidden;
  transition: background 0.5s var(--ease);
  -webkit-user-select: none;
  user-select: none;
}

html,
.viewport,
.header-bar,
#chat-scroller {
  background-color: #fefefe;
}

.chat-content,
.chat-content *,
#userInput {
  -webkit-user-select: text !important;
  user-select: text !important;
  cursor: auto;
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded" !important;
  font-size: 24px;
  line-height: 1;
}

#sidebar {
  width: var(--sidebar-w);
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: width 0.2s var(--ease);
  position: relative;
  z-index: 100;
  min-height: 0;
  overflow: visible;
  font-weight: 450;
}

#sidebar.collapsed {
  width: var(--sidebar-mini);
}

.sidebar-header {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 10px 0 15px;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-high);
  font-size: 25px;
  transform: scaleX(1.05);
  transform-origin: center;
  font-variation-settings:
    "FILL" 0,
    "wght" 200,
    "GRAD" 0,
    "opsz" 28;
}

.menu-toggle:hover {
  background: var(--brand-primary-soft);
}

.search-toggle-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-high);
}

.search-toggle-btn:hover {
  background: var(--brand-primary-soft);
}

.search-toggle-btn.active {
  background: var(--brand-primary-soft);
}

.search-toggle-btn .material-symbols-rounded {
  font-size: 22px;
}

.nav-content {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
}

.sidebar-top-nav {
  flex: 0 0 auto !important;
  overflow: visible !important;
}

.sidebar-top-nav-tight {
  padding-bottom: 0 !important;
}

.sidebar-main-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.sidebar-bottom-no-border {
  border-top: none !important;
}

.history-label {
  width: calc(100% - 28px);
  margin: 14px 14px 8px 14px;
  padding: 0 8px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  font-size: 0.74rem;
  font-weight: 550;
  color: #8a8f94;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
}

.history-label:hover {
  color: #5f6368;
}

.history-label span {
  cursor: pointer;
}

.history-label .material-symbols-rounded {
  font-size: 16px;
  line-height: 1;
  margin-left: 1px;
  transform: translateY(0);
}

#sidebar-main-content.history-collapsed #sidebar-history {
  display: none !important;
}

#sidebar-history {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  margin-top: 0 !important;
  padding: 0 12px 0 4px !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: none !important;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

#sidebar-history .history-chat-btn {
  flex: 0 0 auto;
}

.sidebar-status {
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text-low);
}

.sidebar-status.error {
  color: #b00020;
}

.sidebar-search-link {
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
}

.sidebar-search-link:hover,
.sidebar-search-link.active {
  background: rgba(0, 0, 0, 0.04);
  color: var(--brand-primary);
}

#sidebar.collapsed .sidebar-search-link .nav-text {
  opacity: 0;
  pointer-events: none;
  width: 0;
  margin-left: 0;
  overflow: hidden;
}

.nav-link {
  height: 45px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
  color: var(--text-med);
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  position: relative;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--brand-primary);
}

.nav-link.active {
  background: rgba(0, 0, 0, 0.04);
  color: var(--brand-primary);
  font-weight: 450;
}

.search-toggle-btn:hover,
.search-toggle-btn.active,
.menu-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}

#sidebar-history .history-chat-btn:hover {
  background: rgba(0, 0, 0, 0.04) !important;
}

#sidebar-history .history-chat-btn.active {
  background: rgba(0, 0, 0, 0.04) !important;
  font-weight: 450;
}

#sidebar-history .history-chat-btn,
#chatSearchModalResults .history-chat-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100%;
  height: 38px;
  padding: 0 8px 0 12px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 10px !important;
  cursor: pointer;
  gap: 4px;
}

#sidebar-history .history-chat-btn .nav-text,
#chatSearchModalResults .history-chat-btn .nav-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-more-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-low);
  flex: 0 0 auto;
  margin-left: auto;
  margin-right: 0;
}

.chat-more-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-high);
}

.chat-more-btn .material-symbols-rounded {
  font-size: 17px;
}

.nav-text {
  margin-left: 16px;
  font-size: 0.95rem;
  font-weight: 450;
  transition: opacity 0.18s var(--ease);
  white-space: nowrap;
}

#sidebar .nav-link .material-symbols-rounded {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin: 0;
  transform: translateX(4px);
  transition: none;
}

#newChatBtn {
  padding-left: 12px;
  margin-top: 2px;
  height: 38px;
  width: calc(100% - 12px);
  overflow: visible;
}

#sidebar.collapsed .nav-link {
  padding: 0 16px;
  justify-content: flex-start;
}

#sidebar.collapsed #newChatBtn {
  padding-left: 12px;
}

#newChatBtn::before {
  content: "";
  position: absolute;
  left: -3px;
  right: -8px;
  top: 0;
  bottom: 0;
  border-radius: 10px;
  background: transparent;
  z-index: -1;
}

#newChatBtn:hover,
#newChatBtn.active {
  background: transparent !important;
}

#newChatBtn:hover::before,
#newChatBtn.active::before {
  background: rgba(0, 0, 0, 0.04);
}

#newChatBtn .material-symbols-rounded {
  transform: translateX(-1px) !important;
}

#sidebar.collapsed .nav-text {
  opacity: 0;
  pointer-events: none;
  width: 0;
  margin-left: 0;
  overflow: hidden;
}
