/**
 * App layout: ChatGPT-style shell
 * - #app-shell: flex h-screen
 * - #app-sidebar: left nav (sessions, New chat, token)
 * - #app-main: main area (header + content)
 * - .app-main-content: flex row = #chat-column + #right-panel
 */

/* ---------------------------------------------------------------------------
   App shell
   --------------------------------------------------------------------------- */
.app-shell {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 100vh;
  min-height: 0;
  background: var(--md-sys-color-surface-container-low);
}

/* ---------------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------------- */
.app-sidebar {
  flex: 0 0 260px;
  width: 260px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-surface);
  border-right: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-1);
  transition: width 0.2s ease, flex 0.2s ease;
}

.app-sidebar.collapsed {
  flex: 0 0 72px;
  width: 72px;
}

.app-sidebar.collapsed .app-sidebar-title,
.app-sidebar.collapsed .app-sidebar-new-chat-text,
.app-sidebar.collapsed .app-sidebar-session-list .session-item-title,
.app-sidebar.collapsed .token-panel-header span,
.app-sidebar.collapsed .token-input-group,
.app-sidebar.collapsed .app-sidebar-slide3-toolbar,
.app-sidebar.collapsed .app-sidebar-view-all-text,
.app-sidebar.collapsed .app-sidebar-search-input {
  display: none;
}

.app-sidebar.collapsed .app-sidebar-brand {
  justify-content: center;
  padding-left: 0;
}

.app-sidebar.collapsed .app-sidebar-new-chat {
  justify-content: center;
  padding: 12px;
}

.app-sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  flex-shrink: 0;
}

.app-sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--md-sys-shape-corner-medium, 12px);
  background: var(--md-sys-color-primary, #213448);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-sidebar-title {
  font-size: var(--md-sys-typescale-title-medium, 16px);
  font-weight: 600;
  color: var(--md-sys-color-on-surface, #213448);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-new-chat {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 16px;
  padding: 10px 16px;
  border: 1px solid var(--md-sys-color-outline-variant, #e0d5c3);
  border-radius: var(--md-sys-shape-corner-medium, 12px);
  background: var(--md-sys-color-surface-container-lowest, #fff);
  color: var(--md-sys-color-on-surface, #213448);
  font-size: var(--md-sys-typescale-body-medium, 14px);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.app-sidebar-new-chat:hover {
  background: var(--md-sys-color-surface-container-low, #f5f1e8);
  border-color: var(--md-sys-color-outline, #94b4c1);
}

.app-sidebar-new-chat i {
  font-size: 1rem;
  flex-shrink: 0;
}

/* Slide 3: session list + search + view all */
.app-sidebar-slide3 {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-sidebar-slide3-toolbar {
  flex-shrink: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-sidebar-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.app-sidebar-search-icon {
  position: absolute;
  left: 12px;
  font-size: 12px;
  opacity: 0.6;
  color: var(--md-sys-color-on-surface-variant, #547792);
  pointer-events: none;
}

.app-sidebar-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--md-sys-color-outline-variant, #e0d5c3);
  border-radius: var(--md-sys-shape-corner-small, 8px);
  background: var(--md-sys-color-surface-container-lowest, #fff);
  color: var(--md-sys-color-on-surface, #213448);
  font-size: 13px;
  transition: border-color 0.2s;
}

.app-sidebar-search-input::placeholder {
  color: var(--md-sys-color-on-surface-variant, #547792);
  opacity: 0.8;
}

.app-sidebar-search-input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary, #213448);
}

.app-sidebar-view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--md-sys-color-outline-variant, #e0d5c3);
  border-radius: var(--md-sys-shape-corner-small, 8px);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant, #547792);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.app-sidebar-view-all:hover {
  background: var(--md-sys-color-surface-container-low, #f5f1e8);
  border-color: var(--md-sys-color-outline, #94b4c1);
  color: var(--md-sys-color-on-surface, #213448);
}

.app-sidebar-view-all.active {
  background: var(--md-sys-color-surface-container-high, #e0d5c3);
  border-color: var(--md-sys-color-primary, #213448);
  color: var(--md-sys-color-primary, #213448);
}

.app-sidebar-slide3 .app-sidebar-session-list {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.app-sidebar-session-list {
  flex: 1;
  min-height: 0;
  max-height: 50vh;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-sidebar-session-list .session-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--md-sys-shape-corner-small, 8px);
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface, #213448);
  font-size: var(--md-sys-typescale-body-medium, 14px);
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.app-sidebar-session-list .session-item:hover {
  background: var(--md-sys-color-surface-container-low, #f5f1e8);
}

.app-sidebar-session-list .session-item.active {
  background: var(--md-sys-color-surface-container-high, #e0d5c3);
  color: var(--md-sys-color-primary, #213448);
}

.app-sidebar-session-list .session-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.app-sidebar-session-list .session-item-icon {
  flex-shrink: 0;
  opacity: 0.8;
}

.app-sidebar-session-list .session-item-date {
  flex-shrink: 0;
  font-size: 11px;
  opacity: 0.7;
  white-space: nowrap;
}

.app-sidebar-session-list .session-item-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-sidebar-session-list .session-item-wrap .session-item {
  flex: 1;
  min-width: 0;
}

.app-sidebar-session-list .session-item-delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant, #5c5c5c);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.app-sidebar-session-list .session-item-wrap:hover .session-item-delete,
.app-sidebar-session-list .session-item-delete:hover {
  opacity: 1;
  background: var(--md-sys-color-surface-container-high, #e8e0d0);
  color: var(--md-sys-color-error, #b3261e);
}

.app-sidebar.collapsed .app-sidebar-session-list .session-item-delete {
  display: none;
}

.session-list-loading,
.session-list-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant, #547792);
}

.session-list-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--md-sys-color-outline-variant, #e0d5c3);
  border-top-color: var(--md-sys-color-primary, #213448);
  border-radius: 50%;
  animation: session-list-spin 0.8s linear infinite;
}

.session-list-scroll-hint {
  opacity: 0.7;
}

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

.app-sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--md-sys-color-outline-variant, #e0d5c3);
  padding: 8px;
}

/* Token panel when inside sidebar: no fixed position, stronger contrast */
.token-panel-in-sidebar {
  position: static;
  top: auto;
  right: auto;
  min-width: 0;
  width: 100%;
  background: var(--md-sys-color-surface-container-high, #e0d5c3);
  border-radius: var(--md-sys-shape-corner-small, 8px);
  border: 1px solid var(--md-sys-color-outline, #94b4c1);
  padding: 12px;
}

.token-panel-in-sidebar .token-panel-header {
  color: var(--md-sys-color-on-surface, #213448);
  font-weight: 600;
}

.token-panel-in-sidebar .token-panel-toggle {
  color: var(--md-sys-color-on-surface, #213448);
}

.token-panel-in-sidebar .token-panel-toggle:hover {
  background-color: rgba(33, 52, 72, 0.08);
  color: var(--md-sys-color-primary, #213448);
}

.token-panel-in-sidebar .token-input {
  background: var(--md-sys-color-surface-container-lowest, #fff);
  color: var(--md-sys-color-on-surface, #213448);
  border: 1px solid var(--md-sys-color-outline, #94b4c1);
}

.token-panel-in-sidebar .token-input::placeholder {
  color: var(--md-sys-color-on-surface-variant, #547792);
}

.token-panel-in-sidebar .token-input:focus {
  border-color: var(--md-sys-color-primary, #213448);
  box-shadow: 0 0 0 2px rgba(33, 52, 72, 0.15);
}

/* Save: primary, Clear: outline – rõ ràng, không mờ */
.token-panel-in-sidebar .token-btn-primary {
  background: var(--md-sys-color-primary, #213448);
  color: var(--md-sys-color-on-primary, #fff);
  border: none;
  font-weight: 600;
}

.token-panel-in-sidebar .token-btn-primary:hover {
  background: #2563eb;
  color: #fff;
}

.token-panel-in-sidebar .token-btn-secondary {
  background: transparent;
  color: var(--md-sys-color-primary, #213448);
  border: 1px solid var(--md-sys-color-outline, #94b4c1);
  font-weight: 500;
}

.token-panel-in-sidebar .token-btn-secondary:hover {
  background: rgba(33, 52, 72, 0.06);
  border-color: var(--md-sys-color-primary, #213448);
}

/* Status text đậm, dễ đọc */
.token-panel-in-sidebar .token-status {
  background: var(--md-sys-color-surface-container-lowest, #fff);
  color: var(--md-sys-color-on-surface-variant, #547792);
  border: 1px solid var(--md-sys-color-outline, #94b4c1);
  font-weight: 500;
  font-size: 12px;
}

.token-panel-in-sidebar .token-status.success {
  background: rgba(148, 180, 193, 0.15);
  color: var(--md-sys-color-secondary, #547792);
  border-color: var(--md-sys-color-tertiary, #94b4c1);
}

.token-panel-in-sidebar .token-status.info {
  background: rgba(84, 119, 146, 0.12);
  color: var(--md-sys-color-secondary, #547792);
  border-color: var(--md-sys-color-outline, #94b4c1);
}

.token-panel-in-sidebar .token-status.error {
  background: rgba(33, 52, 72, 0.08);
  color: var(--md-sys-color-on-surface, #213448);
  border-color: var(--md-sys-color-outline, #94b4c1);
}

.token-panel-in-sidebar.collapsed .token-input-group {
  display: none;
}

/* Auth hidden: when token exists, hide footer and expand session list */
.app-sidebar-footer.auth-hidden {
  display: none;
}

.token-panel-in-sidebar.auth-hidden {
  display: none;
}

/* Version selector (bottle versions in session) */
.version-selector-panel {
  background: var(--md-sys-color-surface-container, #f5f1e8);
  border: 1px solid var(--md-sys-color-outline-variant, #e0d5c3);
  border-radius: var(--md-sys-shape-corner-medium, 12px);
  padding: 12px;
}

.version-selector-panel.hidden {
  display: none !important;
}

.version-selector-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface, #213448);
  margin-bottom: 8px;
}

.version-selector-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.version-chip {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--md-sys-color-outline-variant, #e0d5c3);
  background: var(--md-sys-color-surface-container-lowest, #fff);
  color: var(--md-sys-color-on-surface, #213448);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.version-chip:hover {
  background: var(--md-sys-color-surface-container-low, #f5f1e8);
  border-color: var(--md-sys-color-outline, #94b4c1);
}

.version-chip.active {
  background: var(--md-sys-color-primary-container, #e8eef2);
  border-color: var(--md-sys-color-primary, #213448);
  color: var(--md-sys-color-primary, #213448);
  font-weight: 500;
}

/* ---------------------------------------------------------------------------
   Main
   --------------------------------------------------------------------------- */
.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-surface-container-low);
}

.app-main-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--md-sys-color-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  font-size: var(--md-sys-typescale-body-medium, 14px);
  color: var(--md-sys-color-on-surface-variant);
}

.app-main-header-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-main-header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-sys-color-primary, #213448);
}

.app-main-header-session,
.app-main-header-edit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-main-header-session.hidden,
.app-main-header-edit.hidden {
  display: none;
}

/* CAD engine badge (FreeCAD / NX) next to session id */
.session-engine-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--md-sys-color-secondary-container, #c4e2f5);
  color: var(--md-sys-color-on-secondary-container, #1a3a4a);
}
.session-engine-badge.hidden {
  display: none;
}

/* Nhóm nút sáng/tối + 3D sát nhau bên phải header */
.app-main-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-main-header-panel-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small, 8px);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  font-size: var(--md-sys-typescale-body-medium, 14px);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.app-main-header-panel-toggle:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
}

.theme-toggle-btn {
  min-width: 40px;
  padding: 8px;
}

.theme-toggle-btn .theme-icon-dark,
.theme-toggle-btn .theme-icon-light {
  display: inline-block;
}

.theme-toggle-btn .theme-icon-light.hidden,
.theme-toggle-btn .theme-icon-dark.hidden {
  display: none !important;
}

.app-main-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
  /* Biến cho resize: độ rộng panel 3D (px) */
  --right-panel-width: 420px;
}

/* ---------------------------------------------------------------------------
   Chat column
   --------------------------------------------------------------------------- */
.chat-column {
  flex: 1;
  min-width: 320px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
}

.chat-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Gemini style: không khung bó, chat hòa vào nền */
.chat-column-gemini .chat-card {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* Ẩn thanh header chat (Assistant, Ready to help, Edit) */
.chat-header-bar {
  display: none !important;
}

.chat-column-gemini .chat-messages-area {
  background: transparent;
  flex: 1;
}

.chat-column-gemini .chat-input-wrapper {
  padding: 16px 0 12px;
  background: transparent;
  border: none;
}

.chat-column-gemini .chat-input-hints {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

.chat-column .pdf-viewer-container {
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Right panel (3D, Progress, JSON Viewer, OBJ Viewer, Download)
   --------------------------------------------------------------------------- */
.right-panel {
  flex: 0 0 0;
  width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-surface-container-low);
  border-left: 1px solid var(--md-sys-color-outline-variant);
  transition: flex 0.25s ease, width 0.25s ease, min-width 0.25s ease;
}

.right-panel.is-open {
  flex: 0 0 420px;
  width: 420px;
  min-width: 420px;
  overflow-y: auto;
}

/* Inner cao theo nội dung để panel bên ngoài scroll được */
.right-panel-inner {
  padding: 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
}

/* OBJ Viewer panel: chiếm chỗ còn lại, tối thiểu 320px để viewer vuông không bị cắt */
.obj-viewer-panel-flex {
  flex: 1 1 auto;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

/* Khi panel phải mở: chat flex 1, panel dùng --right-panel-width (có thể kéo resize) */
.app-main-content.right-panel-open .chat-column {
  flex: 1;
  min-width: 320px;
}

.app-main-content.right-panel-open .right-panel {
  flex: 0 0 var(--right-panel-width);
  width: var(--right-panel-width);
  min-width: 320px;
  max-width: 85%;
}

/* Thanh chia có thể kéo giữa chat và panel 3D */
.main-resize-handle {
  display: none;
  flex: 0 0 6px;
  width: 6px;
  min-width: 6px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
}

.app-main-content.right-panel-open .main-resize-handle {
  display: block;
}

.main-resize-handle:hover,
.main-resize-handle.is-dragging {
  background: var(--md-sys-color-primary);
  opacity: 0.5;
}

/* ---------------------------------------------------------------------------
   Responsive: sidebar as drawer on small screens
   --------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .chat-column {
    min-width: 0;
  }

  .main-resize-handle {
    display: none !important;
  }

  .right-panel.is-open {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
    flex: none;
    width: 100%;
    max-width: 420px;
    min-width: 0;
    box-shadow: -4px 0 16px rgba(0,0,0,0.1);
  }
}

@media (max-width: 768px) {
  .right-panel.is-open {
    max-width: 100%;
  }

  .app-main-header-panel-toggle-text {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   New Chat modal: đặt tên phiên + chọn nền tảng (FreeCAD / NX)
   --------------------------------------------------------------------------- */
.new-chat-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity 0.2s ease;
}

.new-chat-modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.new-chat-modal {
  width: 100%;
  max-width: 400px;
  margin: 16px;
  padding: 0;
  background: var(--md-sys-color-surface, #fff);
  border-radius: var(--md-sys-shape-corner-large, 16px);
  box-shadow: var(--md-sys-elevation-3, 0 4px 24px rgba(0, 0, 0, 0.12));
  border: 1px solid var(--md-sys-color-outline-variant, #e0d5c3);
  overflow: hidden;
  transform: scale(1);
  transition: transform 0.2s ease;
}

.new-chat-modal-overlay.hidden .new-chat-modal {
  transform: scale(0.98);
}

.new-chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant, #e8e0d5);
}

.new-chat-modal-title {
  margin: 0;
  font-size: var(--md-sys-typescale-title-large, 18px);
  font-weight: 600;
  color: var(--md-sys-color-on-surface, #213448);
  display: flex;
  align-items: center;
}

.new-chat-modal-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant, #5c6b7a);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.new-chat-modal-close:hover {
  background: var(--md-sys-color-surface-container-high, #e8e4dc);
  color: var(--md-sys-color-on-surface, #213448);
}

.new-chat-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.new-chat-label {
  font-size: var(--md-sys-typescale-body-medium, 14px);
  font-weight: 500;
  color: var(--md-sys-color-on-surface, #213448);
  display: block;
  margin-bottom: 4px;
}

.new-chat-input,
.new-chat-select {
  width: 100%;
  padding: 12px 14px;
  font-size: var(--md-sys-typescale-body-medium, 14px);
  color: var(--md-sys-color-on-surface, #213448);
  background: var(--md-sys-color-surface-container-lowest, #faf8f5);
  border: 1px solid var(--md-sys-color-outline-variant, #e0d5c3);
  border-radius: var(--md-sys-shape-corner-medium, 12px);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.new-chat-input::placeholder {
  color: var(--md-sys-color-on-surface-variant, #5c6b7a);
  opacity: 0.8;
}

.new-chat-input:focus,
.new-chat-select:focus {
  outline: none;
  border-color: var(--md-sys-color-primary, #547792);
  box-shadow: 0 0 0 2px rgba(84, 119, 146, 0.2);
}

.new-chat-select {
  cursor: pointer;
  appearance: auto;
}

.new-chat-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--md-sys-color-outline-variant, #e8e0d5);
  background: var(--md-sys-color-surface-container-lowest, #faf8f5);
}

.new-chat-btn {
  padding: 10px 20px;
  font-size: var(--md-sys-typescale-label-large, 14px);
  font-weight: 500;
  border-radius: var(--md-sys-shape-corner-medium, 12px);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}

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

.new-chat-btn-secondary {
  background: var(--md-sys-color-surface-container-high, #e8e4dc);
  color: var(--md-sys-color-on-surface, #213448);
}

.new-chat-btn-secondary:hover {
  background: var(--md-sys-color-surface-container-highest, #ddd8d0);
}

.new-chat-btn-primary {
  background: var(--md-sys-color-primary, #547792);
  color: var(--md-sys-color-on-primary, #fff);
}

.new-chat-btn-primary:hover {
  background: var(--md-sys-color-primary-container, #3d5a6e);
  color: var(--md-sys-color-on-primary-container, #e2e8f0);
}
