/* Final sidebar skin. Loaded last so the sidebar behaves as one visual system. */
:root {
  --xs-sidebar-width: 260px;
  --xs-sidebar-rail: 68px;
  --xs-sidebar-inset: 8px;
  --xs-sidebar-row: 36px;
  --xs-sidebar-radius: 8px;
}

.left-sidebar {
  width: var(--xs-sidebar-width);
  background: var(--bg-secondary, #171717);
  border-right: 0;
  box-shadow: none;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sidebar-header {
  min-height: 52px;
  padding: 8px 10px 4px 14px;
  gap: 8px;
}

.sidebar-logo-link {
  min-width: 0;
  padding: 6px 4px;
  border-radius: var(--xs-sidebar-radius);
  margin-right: auto;
}

.sidebar-brand-text {
  overflow: hidden;
  color: var(--text-primary);
  font: 600 15px/20px Inter, ui-sans-serif, sans-serif;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-header-ghost {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 6px;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  -webkit-appearance: none;
  appearance: none;
  filter: none !important;
  color: var(--text-secondary);
}

.sidebar-header-ghost:hover,
.sidebar-header-ghost:focus,
.sidebar-header-ghost:focus-visible,
.sidebar-header-ghost:active {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text-primary);
  outline: none;
}
.sidebar-header-ghost::before,
.sidebar-header-ghost::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
.sidebar-header-ghost svg { width: 24px !important; height: 24px !important; }
.sidebar-header-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.sidebar-header-collapse:hover,
.sidebar-header-collapse:focus-visible { background: var(--bg-hover); color: var(--text-primary); outline: none; }
.sidebar-header-collapse::after {
  content: attr(data-tooltip);
  position: fixed;
  top: 48px;
  left: 148px;
  z-index: 2000;
  padding: 6px 9px;
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.sidebar-header-collapse:hover::after,
.sidebar-header-collapse:focus-visible::after { opacity: 1; }
.content-wrapper > .toggle-button { display: none !important; }

.sidebar-quick-actions {
  padding: 2px var(--xs-sidebar-inset) 6px;
  margin: 0;
}

.sidebar-quick-actions-inner,
.sidebar-secondary-nav { gap: 0; }

.sidebar-action-btn,
.sidebar-all-chats-btn {
  min-height: var(--xs-sidebar-row);
  padding: 7px 10px;
  gap: 10px;
  border-radius: var(--xs-sidebar-radius);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: -0.01em;
}

.sidebar-action-btn::before { border-radius: var(--xs-sidebar-radius); }
.sidebar-action-btn:hover::before,
.sidebar-action-btn.active::before,
.sidebar-action-btn.is-active::before { background: var(--bg-hover); }
.sidebar-action-icon { width: 18px; height: 18px; margin: 0; color: currentColor; }
.sidebar-action-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.shortcut-hint { margin-left: auto; color: var(--text-tertiary); font-size: 11px; opacity: 0; }
.sidebar-action-btn:hover .shortcut-hint { opacity: .75; }

.sidebar-content {
  padding: 0 var(--xs-sidebar-inset) 8px;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.sidebar-content::-webkit-scrollbar { width: 0; }
.sidebar-content:hover { scrollbar-width: thin; }
.sidebar-content:hover::-webkit-scrollbar { width: 5px; }

/* ChatGPT keeps unfinished product areas out of the main navigation. */
.sidebar-secondary-nav > .is-placeholder,
.sidebar-secondary-nav > #action-customize { display: none !important; }

.sidebar-projects {
  margin: 10px 0 0;
  padding: 0;
  border: 0;
}

.sidebar-projects-header,
.sidebar-projects-header.sidebar-projects-header {
  min-height: 32px !important;
  margin: 0 !important;
  padding: 6px 10px !important;
  border-radius: var(--xs-sidebar-radius);
  color: var(--text-primary);
}
.sidebar-projects-header:hover { background: transparent; }
.sidebar-projects-title { font-size: 12px; font-weight: 600; line-height: 18px; }
.sidebar-projects-chevron { margin-left: auto; opacity: 0; }
.sidebar-projects-header:hover .sidebar-projects-chevron,
.sidebar-projects--collapsed .sidebar-projects-chevron { opacity: .7; }

.sidebar-project-newbtn,
.sidebar-project-row,
.sidebar-project-newbtn.sidebar-project-newbtn,
.sidebar-project-row.sidebar-project-row,
.sidebar-project-morebtn {
  min-height: var(--xs-sidebar-row) !important;
  padding: 7px 10px !important;
  gap: 10px;
  border-radius: var(--xs-sidebar-radius);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.sidebar-project-newbtn:hover,
.sidebar-project-row:hover,
.sidebar-project-row.is-active,
.sidebar-project-morebtn:hover { background: var(--bg-hover); }
.sidebar-project-row.is-active { font-weight: 400; }
.sidebar-project-newbtn .folder-icon,
.sidebar-project-row .folder-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  color: var(--text-secondary);
  stroke-width: 1.8;
}
.sidebar-project-row.is-active .folder-icon { color: var(--project-accent, var(--text-primary)); }
.sidebar-project-newbtn .name,
.sidebar-project-row .name { font-size: inherit; line-height: inherit; }
.sidebar-project-row .sidebar-project-menu-btn { right: 5px; width: 28px; height: 28px; }

.sidebar-project-chats { padding: 1px 0 5px 28px; }
.sidebar-project-chat {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--xs-sidebar-radius);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 20px;
}
.sidebar-project-chat:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-projects-more-hint { margin: 3px 10px 5px; font-size: 11px; }

.sidebar-section-recents { padding: 0; }
.sidebar-section-header,
.sidebar-section-recents .sidebar-section-header {
  position: static;
  min-height: 32px;
  padding: 12px 10px 4px;
  background: transparent;
  box-shadow: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0;
}

#tab-list { margin: 0; padding: 0; }
.chat-tab {
  min-height: var(--xs-sidebar-row);
  margin: 0;
  padding: 7px 36px 7px 10px;
  border-radius: var(--xs-sidebar-radius);
}
.chat-tab::before { border-radius: var(--xs-sidebar-radius); }
.chat-tab:hover::before,
.chat-tab.active-tab::before { background: var(--bg-hover); }
.chat-tab .tab-content { min-height: 20px; padding: 0; }
.chat-tab .tab-name {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: -0.01em;
}
.chat-tab.active-tab .tab-name { font-weight: 400; }
.tab-actions { right: 6px; }
.tab-actions-toggle { width: 26px; height: 26px; border-radius: 6px; }
.tab-actions-toggle:hover { background: color-mix(in srgb, var(--text-primary) 8%, transparent); }

.sidebar-all-chats-link { margin: 2px 0 8px; }
.sidebar-all-chats-icon { width: 18px; height: 18px; margin: 0; }
.sidebar-all-chats-count { border: 0; background: transparent; }
.sidebar-empty-state { padding: 8px 10px 18px; font-size: 13px; }

.sidebar-footer {
  min-height: 64px;
  padding: 8px;
  border-top: 0;
  background: var(--bg-secondary, #171717);
}
.sidebar-footer .profile-header {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 7px 8px;
  gap: 10px;
  border-radius: 10px;
  background: transparent;
}
.sidebar-footer .profile-header:hover { background: var(--bg-hover); }
.sidebar-footer .profile-image { width: 32px; height: 32px; border-radius: 50%; }
.sidebar-footer .profile-header-text { min-width: 0; flex: 1; }
.sidebar-footer .profile-name {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-footer .profile-header-plan { color: var(--text-secondary); font-size: 11px; line-height: 15px; }
.sidebar-footer .profile-upgrade-btn {
  padding: 5px 8px;
  border: 1px solid var(--border-primary);
  border-radius: 7px;
  color: var(--text-primary);
  background: transparent;
  font-size: 11px;
  font-weight: 500;
}
.sidebar-footer .profile-upgrade-btn:hover { background: var(--bg-hover); }
.sidebar-footer .profile-header .dropdown-container {
  left: 0;
  width: 252px;
  transform: translateY(6px);
  border: 1px solid var(--border-primary);
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: 0 14px 38px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.14);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.sidebar-footer .profile-header .dropdown-container.active { transform: translateY(0); }
.footer-dropdown .footer-profile-block { padding: 12px; }
.footer-dropdown .footer-row,
.dropdown-menu.footer-dropdown a.footer-row {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.footer-dropdown .footer-divider { margin: 5px 8px; }

body.sidebar-collapsed .left-sidebar { width: var(--xs-sidebar-rail); }
body.sidebar-collapsed .left-sidebar .sidebar-header { padding: 8px 0 4px; gap: 4px; }
body.sidebar-collapsed .sidebar-header-collapse::after { top: 86px; left: 58px; }
body.sidebar-collapsed .left-sidebar .sidebar-content { padding: 0 8px 8px; }
body.sidebar-collapsed .left-sidebar .sidebar-action-btn,
body.sidebar-collapsed .sidebar-all-chats-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 9px;
  justify-content: center;
  border-radius: var(--xs-sidebar-radius);
}
body.sidebar-collapsed .left-sidebar .sidebar-action-btn::before { border-radius: inherit; }
body.sidebar-collapsed .left-sidebar .sidebar-footer { min-height: 56px; padding: 8px; }
body.sidebar-collapsed .left-sidebar .sidebar-footer .profile-header { width: 40px; height: 40px; padding: 4px; }
body.sidebar-collapsed .sidebar-footer .profile-header .dropdown-container {
  bottom: 0;
  left: calc(100% + 12px);
  transform: translateX(6px);
}
body.sidebar-collapsed .sidebar-footer .profile-header .dropdown-container.active { transform: translateX(0); }

@media (max-width: 768px) {
  :root { --xs-sidebar-width: min(88vw, 320px); }
  body.device-phone .left-sidebar,
  body.viewport-mobile .left-sidebar { width: var(--xs-sidebar-width) !important; }
  body.device-phone .sidebar-header,
  body.viewport-mobile .sidebar-header { min-height: 56px; padding: 10px 12px 6px; }
  body.device-phone .sidebar-content,
  body.viewport-mobile .sidebar-content { padding: 0 8px 10px !important; }
  body.device-phone .sidebar-quick-actions,
  body.viewport-mobile .sidebar-quick-actions { padding: 2px 8px 6px !important; }
  body.device-phone .sidebar-action-btn,
  body.device-phone .sidebar-project-row,
  body.device-phone .chat-tab { min-height: 40px !important; }
  body.device-phone .sidebar-footer { padding: 8px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .left-sidebar, .left-sidebar * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Project workspace is the sole home for project conversations. */
.project-page {
  width: min(960px, calc(100% - 48px));
  padding: 52px 0 88px;
}
.project-page-header { align-items: center; margin-bottom: 28px; }
.project-page-title { font-size: 28px; line-height: 34px; font-weight: 650; }
.project-new-chat-btn {
  min-height: 48px;
  margin-bottom: 22px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
}
.project-page-settings-grid { gap: 14px; }
.project-card { padding: 20px; border-radius: 16px; }
.project-section.project-conversations {
  margin-top: 18px;
  padding: 8px;
  border-radius: 16px;
}
.project-conversations-header { padding: 12px 12px 10px; }
.project-conversations-title { margin: 0; color: var(--text-primary); font-size: 14px; font-weight: 600; }
.project-conversations-subtitle { margin: 3px 0 0; color: var(--text-tertiary); font-size: 12px; line-height: 17px; }
.project-chat-row {
  min-height: 52px;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
}
.project-chat-row + .project-chat-row { margin-top: 2px; }
.project-chat-row:hover { background: var(--bg-hover); }
.project-chat-row .title { font-size: 14px; font-weight: 450; }
.project-chat-row .updated { font-size: 11px; }
.project-chats-empty { margin: 0; padding: 26px 12px 30px; text-align: center; }

@media (max-width: 700px) {
  .project-page { width: auto; padding: 24px 16px 64px; }
  .project-page-title { font-size: 23px; line-height: 29px; }
}
