/* OpenAI / ChatGPT Clean Design Language with Light & Dark Mode */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/InterVariable.woff2') format('woff2');
}

:root {
  /* Dark Mode Default */
  --bg-main: #212121;
  --bg-sidebar: #171717;
  --bg-surface: #2f2f2f;
  --bg-surface-hover: #383838;
  --bg-surface-subtle: #262626;
  --border-subtle: #303030;
  --border-medium: #424242;
  --border-focus: #737373;
  --text-primary: #ececec;
  --text-secondary: #b4b4b4;
  --text-muted: #737373;
  --accent-green: #10a37f;
  --accent-green-hover: #0e8c6d;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --btn-primary-bg: #ffffff;
  --btn-primary-text: #0d0d0d;
  --btn-primary-hover: #e5e5e5;
  --modal-bg: #171717;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --radius-input: 26px;
}

/* Light Mode Overrides (ChatGPT Style) */
[data-theme="light"] {
  --bg-main: #ffffff;
  --bg-sidebar: #f9f9f9;
  --bg-surface: #f4f4f4;
  --bg-surface-hover: #eaeaea;
  --bg-surface-subtle: #f7f7f8;
  --border-subtle: #e5e5e5;
  --border-medium: #d1d5db;
  --border-focus: #9ca3af;
  --text-primary: #0d0d0d;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --accent-green: #10a37f;
  --accent-green-hover: #0e8c6d;
  --btn-primary-bg: #0d0d0d;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #262626;
  --modal-bg: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100vh;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Logos */
.app-logo {
  height: 30px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.welcome-logo {
  height: 48px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: inline-block;
}

/* Automatic Theme-Aware Logo Switching */
[data-theme="dark"] .theme-logo-light {
  display: none !important;
}
[data-theme="dark"] .theme-logo-dark {
  display: inline-block !important;
}

[data-theme="light"] .theme-logo-dark {
  display: none !important;
}
[data-theme="light"] .theme-logo-light {
  display: inline-block !important;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.2s ease, width 0.2s ease, background-color 0.2s ease;
  z-index: 20;
}

.sidebar.collapsed {
  transform: translateX(-100%);
  width: 0;
  overflow: hidden;
  border-right: none;
}

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

.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.new-chat-btn:hover {
  background-color: var(--bg-surface);
  border-color: var(--border-medium);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 8px 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.12s, color 0.12s;
}

.history-item:hover, .history-item.active {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.logged-out-sidebar-card {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.logged-out-sidebar-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.logged-out-sidebar-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.auth-button-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Primary and Secondary Buttons */
.btn-primary-white {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn-primary-white:hover {
  background-color: var(--btn-primary-hover);
}

.btn-secondary-dark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn-secondary-dark:hover {
  background-color: var(--bg-surface);
}

/* Google Sign In Button */
.btn-google-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-google-auth:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-focus);
}

.google-icon-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Usage Meter Card */
.usage-meter-card {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}

.usage-title {
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.usage-pill {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-subtle);
}

.progress-bar-bg {
  width: 100%;
  height: 4px;
  background-color: var(--bg-surface);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--text-primary);
  transition: width 0.3s ease;
}

.progress-bar-fill.warning {
  background-color: #f59e0b;
}

.progress-bar-fill.danger {
  background-color: var(--danger);
}

.btn-upgrade-minimal {
  width: 100%;
  padding: 7px 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-upgrade-minimal:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-focus);
}

/* User Profile Row */
.user-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background-color: transparent;
  transition: background-color 0.15s;
}

.user-profile-row:hover {
  background-color: var(--bg-surface);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--border-medium);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.user-info {
  flex: 1;
  margin-left: 10px;
  overflow: hidden;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.user-plan-badge.pro {
  color: var(--text-primary);
  font-weight: 600;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-main);
  transition: background-color 0.2s ease;
}

/* Top Nav Bar */
.top-nav {
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-main);
  z-index: 10;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-icon:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.model-selector-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.model-selector-pill:hover {
  background-color: var(--bg-surface);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Screen Sharing Buttons */
.btn-screen-share {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-screen-share:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

.btn-screen-share.active {
  border-color: var(--accent-green);
  color: var(--text-primary);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.btn-screen-share.active .live-dot {
  background-color: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

/* Clean Regular Companion / Pop out button */
.btn-companion {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-companion:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

/* Interactive Screen Sharing Dock */
.screen-dock {
  background-color: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
}

.screen-dock.visible {
  display: flex;
}

.dock-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dock-thumb-container {
  width: 68px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-subtle);
}

.dock-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dock-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dock-title {
  font-size: 0.8rem;
  font-weight: 600;
}

.dock-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.dock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Chat Messages Feed */
.chat-scroll-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 120px;
}

.chat-center-content {
  max-width: 768px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Welcome Screen */
.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px 24px;
  gap: 20px;
}

.welcome-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  min-height: 48px;
}

.welcome-heading {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.prompt-suggestions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 640px;
}

.suggestion-card {
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suggestion-card:hover {
  background-color: var(--bg-surface);
  border-color: var(--border-medium);
}

.suggestion-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.suggestion-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.suggestion-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Message Styles */
.message-row {
  display: flex;
  gap: 14px;
  width: 100%;
}

.message-row.user {
  justify-content: flex-end;
}

.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message-avatar.assistant {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.message-bubble-content {
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 85%;
  word-break: break-word;
}

.message-row.user .message-bubble-content {
  background-color: var(--bg-surface);
  padding: 9px 15px;
  border-radius: var(--radius-input);
  color: var(--text-primary);
}

.message-row.assistant .message-bubble-content {
  color: var(--text-primary);
  padding: 4px 0;
  width: 100%;
}

.message-bubble-content pre {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 10px 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.message-bubble-content code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background-color: var(--bg-surface);
  padding: 2px 5px;
  border-radius: 4px;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-action-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
}

.btn-action-copy:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.cursor-blink {
  display: inline-block;
  width: 6px;
  height: 15px;
  background-color: var(--text-primary);
  margin-left: 4px;
  animation: blink 0.8s infinite;
  vertical-align: middle;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Floating Input Dock */
.input-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 16px 20px;
  background: linear-gradient(180deg, transparent 0%, var(--bg-main) 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input-container-pill {
  max-width: 768px;
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-input);
  padding: 8px 12px 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s;
}

.input-container-pill:focus-within {
  border-color: var(--border-focus);
}

.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  resize: none;
  max-height: 160px;
  height: 24px;
  line-height: 1.5;
  padding: 0;
}

.btn-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--border-medium);
  border: none;
  color: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-send.active {
  background-color: var(--text-primary);
  color: var(--bg-main);
}

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

.input-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

/* Modals */
.modal-overlay {
  visibility: hidden;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--modal-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.auth-tabs {
  display: flex;
  background-color: var(--bg-surface);
  padding: 3px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.auth-tab {
  flex: 1;
  padding: 7px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.auth-tab.active {
  background-color: var(--modal-bg);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-input {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
}

.auth-input:focus {
  border-color: var(--border-focus);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border-subtle);
}

/* Pricing Modal */
.pro-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.pricing-price {
  font-size: 1.85rem;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.pricing-period {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.perks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.perk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.perk-item svg {
  color: var(--text-primary);
  flex-shrink: 0;
}

/* Settings Modal Styles */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-toggle-group {
  display: flex;
  background-color: var(--bg-surface);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.theme-toggle-btn.active {
  background-color: var(--modal-bg);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Clean Companion Popup View */
body.companion-view {
  background-color: var(--bg-main);
}

.companion-header {
  background-color: var(--bg-main);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.companion-snap-bar {
  background-color: var(--bg-surface-subtle);
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    height: 100%;
  }
  .prompt-suggestions-grid {
    grid-template-columns: 1fr;
  }
}

/* Companion workspace */
.auth-note, .auth-status { font-size: .82rem; line-height: 1.6; color: var(--text-muted); }
.auth-status { color: var(--text-primary); min-height: 1.3em; }
.usage-reset-note { font-size: .65rem; color: var(--text-muted); line-height: 1.5; }
.app-notice { margin: 12px 24px 0; padding: 12px 16px; border: 1px solid var(--border-medium); border-radius: 12px; font-size: .8rem; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-green); outline-offset: 3px; }
body.companion-view { display: flex; flex-direction: column; height: 100dvh; min-width: 280px; overflow: hidden; }
.companion-header { padding: 14px 16px; flex-shrink: 0; }
.companion-brand { display: flex; align-items: center; gap: 9px; }
.companion-brand .app-logo { height: 28px; max-width: 60px; }
.companion-brand strong { display: block; font-size: .85rem; }
.companion-brand span { display: block; margin-top: 3px; font-size: .65rem; color: var(--text-muted); }
.companion-header-actions { display: flex; gap: 3px; }
.companion-header-actions svg, .companion-screen-card button svg { width: 15px; height: 15px; }
.companion-screen-card { display: flex; align-items: center; gap: 10px; margin: 12px 12px 8px; padding: 11px; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-surface-subtle); flex-shrink: 0; }
.companion-screen-preview { width: 50px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 7px; overflow: hidden; background: var(--bg-main); color: var(--text-muted); flex-shrink: 0; }
.companion-screen-preview img { width: 100%; height: 100%; object-fit: cover; }
.companion-screen-preview > svg { width: 22px; }
.companion-screen-details { flex: 1; min-width: 0; }
.companion-connection { display: flex; align-items: center; gap: 6px; font-size: .73rem; }
.companion-screen-details > span { display: block; font-size: .64rem; margin-top: 5px; color: var(--text-muted); line-height: 1.5; }
.companion-screen-card .btn-icon { padding: 5px; }
.companion-notice { margin: 3px 12px 8px; padding: 10px 12px; border: 1px solid var(--border-medium); border-radius: 9px; font-size: .73rem; color: var(--text-secondary); line-height: 1.5; }
.companion-quick-actions { display: flex; gap: 6px; padding: 3px 12px 10px; flex-shrink: 0; }
.companion-quick-actions button { background: transparent; border: 1px solid var(--border-medium); border-radius: 20px; padding: 6px 10px; font: inherit; font-size: .68rem; color: var(--text-secondary); cursor: pointer; }
.companion-quick-actions button:hover:enabled { background: var(--bg-surface); color: var(--text-primary); }
.companion-chat { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.companion-chat .message-row { gap: 9px; width: 100%; }
.companion-chat .message-avatar { width: 23px; height: 23px; min-width: 23px; }
.companion-chat .message-avatar svg { width: 13px; height: 13px; }
.companion-chat .message-bubble-content { min-width: 0; max-width: 100%; font-size: .83rem; overflow-wrap: anywhere; }
.companion-chat pre { max-width: 100%; overflow-x: auto; margin: 8px 0; }
.companion-chat .btn-action-copy { display: block; margin-top: 8px; font-size: .66rem; }
.companion-empty { margin: auto; max-width: 270px; padding: 20px 4px; text-align: center; }
.companion-empty > svg { width: 26px; height: 26px; color: var(--text-secondary); margin-bottom: 14px; }
.companion-empty h1 { font-size: 1.08rem; font-weight: 500; letter-spacing: -.035em; margin-bottom: 9px; }
.companion-empty p { font-size: .78rem; line-height: 1.7; color: var(--text-muted); }
.companion-empty a { display: inline-block; margin-top: 15px; font-size: .75rem; color: var(--text-primary); }
.companion-composer { padding: 6px 12px 12px; border-top: 1px solid var(--border-subtle); flex-shrink: 0; }
.companion-composer .input-container-pill { padding: 8px 10px 8px 14px; border-radius: 18px; }
.companion-composer .chat-textarea { font-size: .82rem; max-height: 120px; }
.companion-composer .btn-send { width: 30px; height: 30px; flex-shrink: 0; }
.companion-composer .btn-send svg { width: 15px; height: 15px; }
.companion-activity { min-height: 22px; padding: 1px 4px 6px; font-size: .65rem; color: var(--text-muted); }
.companion-footnote { margin-top: 8px; font-size: .58rem; line-height: 1.5; color: var(--text-muted); text-align: center; }
@media (max-width: 768px) {
  .sidebar { z-index: 30; }
  .nav-left .logo-container, .nav-right #topNavAuthButtons, .nav-right #topShareText { display: none !important; }
  .model-selector-pill { max-width: 150px; overflow: hidden; }
  .model-selector-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-nav { padding: 10px; gap: 8px; }
  .nav-left, .nav-right { gap: 5px; }
}
@media (max-width: 350px) {
  .companion-brand span { display: none; }
  .companion-screen-preview { display: none; }
  .companion-footnote { font-size: .55rem; }
}

/* Saved account conversations */
.history-empty { padding: 8px; font-size: .75rem; line-height: 1.6; color: var(--text-muted); }
.saved-chat-row { display: flex; align-items: center; border-radius: var(--radius-sm); }
.saved-chat-row.active, .saved-chat-row:hover { background: var(--bg-surface); }
.chat-open { flex: 1; min-width: 0; background: transparent; border: 0; text-align: left; font-family: inherit; }
.chat-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-open svg { width: 15px; height: 15px; flex-shrink: 0; }
.chat-delete { flex-shrink: 0; opacity: 0; margin-right: 4px; }
.chat-delete svg { width: 13px; height: 13px; }
.saved-chat-row:hover .chat-delete, .saved-chat-row:focus-within .chat-delete { opacity: 1; }
.chat-delete:hover { color: var(--danger); }
.delete-chat-actions { display: flex; gap: 8px; justify-content: flex-end; }
.delete-chat-actions button { width: auto; padding: 8px 18px; }
#confirmDeleteChatBtn { background: var(--danger); color: white; }
.companion-screen-card[hidden] { display: none; }
.companion-quick-actions { flex-wrap: wrap; }
.companion-header { min-height: 54px; }
@media (hover: none) { .chat-delete { opacity: 1; } }
.billing-button { margin-top: 12px; width: 100%; }
.billing-button[hidden], .billing-test-note[hidden] { display: none; }
.pro-price { font-size: 2rem; font-weight: 650; margin: 4px 0 16px; }
.pro-price span { font-size: .85rem; font-weight: 400; color: var(--text-muted); }
.pro-card > p { line-height: 1.6; }
.billing-test-note { color: var(--text-secondary); font-size: .8rem; padding: 8px 12px; border: 1px solid var(--border-subtle); border-radius: 8px; }
.pro-card #checkoutBtn { width: 100%; margin-top: 12px; }
.model-selector-pill { font: inherit; color: var(--text-primary); background: transparent; border: 0; cursor: pointer; }
.model-icon { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.model-modal-card { width: min(560px, calc(100vw - 32px)); }
.model-options { display: grid; gap: 5px; max-height: 65vh; overflow: auto; }
.model-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: left; color: var(--text-primary); background: transparent; border: 1px solid transparent; border-radius: 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.model-option:hover, .model-option:focus-visible { background: var(--bg-surface-hover); }
.model-option[aria-pressed="true"] { background: var(--bg-surface); border-color: var(--accent-green); }
.model-details { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.model-name { font-weight: 500; overflow-wrap: anywhere; }
.model-option.locked { background: var(--bg-surface-subtle); border-color: var(--border-subtle); }
.model-option.locked .model-name { color: var(--text-secondary); }
.model-option small { font-size: .7rem; color: var(--text-secondary); }
.model-lock-badge { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; padding: 4px 7px; border: 1px solid var(--border-medium); border-radius: 6px; color: var(--text-secondary); font-size: .65rem; font-weight: 600; white-space: nowrap; }
.model-lock-badge svg { width: 13px; height: 13px; }
.model-option.locked:hover, .model-option.locked:focus-visible { background: var(--bg-surface-hover); border-color: var(--border-focus); }
.model-settings-trigger { cursor: pointer; text-align: left; }
.input-share-btn { padding: 4px; color: var(--text-secondary); flex-shrink: 0; }
.input-share-btn svg { width: 18px; height: 18px; }
.input-share-btn[aria-pressed="true"] { color: var(--accent-green); background: var(--bg-surface-hover); }
kbd { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-medium); border-radius: 5px; font: 600 .75rem var(--font-sans); min-width: 22px; height: 22px; }
.screen-answer { flex-shrink: 0; max-height: 45vh; overflow: auto; margin: 14px 22px 0; padding: 16px; border: 1px solid var(--accent-green); border-radius: 14px; background: var(--bg-surface-subtle); }
.screen-answer[hidden] { display: none; }
.screen-answer-header { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--accent-green); }
.screen-answer-question { font-size: .82rem; color: var(--text-secondary); margin: 6px 0 12px; line-height: 1.5; }
.screen-answer-result { display: block; width: fit-content; padding: 7px 11px; color: var(--text-primary); background: rgba(16,163,127,.19); border-radius: 7px; font-size: 1.05rem; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.screen-answer-explanation { font-size: .85rem; line-height: 1.6; margin: 12px 0; }
.answer-preview { position: relative; max-width: 560px; line-height: 0; border-radius: 8px; overflow: hidden; }
.answer-preview img { display: block; width: 100%; height: auto; }
.answer-region { position: absolute; border: 3px solid #10b981; background: rgba(16,185,129,.18); border-radius: 5px; box-sizing: border-box; box-shadow: 0 0 0 999px rgba(0,0,0,.12); pointer-events: none; }
.companion-view .screen-answer { margin: 8px 12px 0; padding: 12px; max-height: 42vh; }
.model-icon[src*="zai"], .model-icon[src*="kimi-color"] { background: #fff; border-radius: 4px; padding: 2px; }
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
@media (max-width: 900px) { .answer-screen-btn > span { display: none; } #currentModelDisplay { max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
