* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; height: 100vh; }

/* Auth Panel */
#auth-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
#auth-panel h1 { color: white; margin-bottom: 30px; font-size: 2rem; }
#auth-panel .auth-box {
  background: white; padding: 30px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 400px; max-width: 90%;
}
#auth-panel input {
  width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd;
  border-radius: 6px; font-size: 14px;
}
#auth-panel textarea {
  width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd;
  border-radius: 6px; font-size: 12px; height: 80px; resize: vertical;
}
#auth-panel button {
  width: 100%; padding: 12px; background: #667eea; color: white; border: none;
  border-radius: 6px; font-size: 16px; cursor: pointer; margin-bottom: 10px;
}
#auth-panel button:hover { background: #5a6fd6; }
#auth-panel .divider { text-align: center; margin: 20px 0; color: #999; }
#auth-panel .login-section { border-top: 1px solid #eee; padding-top: 20px; margin-top: 20px; }

/* App Header */
#app-header {
  display: none;
  align-items: center;
  padding: 0 20px;
  height: 52px;
  background: white;
  border-bottom: 1px solid #e0e0e0;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
}
.header-nav {
  display: flex;
  gap: 4px;
}
.header-nav-tab {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: #666;
  transition: all 0.2s;
}
.header-nav-tab:hover { background: #f0f0f0; color: #333; }
.header-nav-tab.active {
  background: #667eea;
  color: white;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-status .status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #dc3545;
}
.header-status .status-dot.connected { background: #28a745; }
.header-status .status-text {
  font-size: 12px; color: #888; font-weight: 500;
}
.header-user-id {
  font-size: 12px;
  color: #555;
  font-family: monospace;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-logout-btn {
  padding: 5px 14px;
  font-size: 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
.header-logout-btn:hover { background: #c82333; }

/* Chat Container */
#chat-container {
  display: none; height: calc(100vh - 52px); max-height: calc(100vh - 52px); overflow: hidden;
  grid-template-columns: 280px 1fr 350px;
  transition: grid-template-columns 0.2s;
}
/* Custom elements must behave as block-level grid children */
#chat-container > odi-chat-sidebar,
#chat-container > odi-chat-area {
  display: block; overflow: hidden; min-width: 0; min-height: 0;
}
#chat-container > odi-right-panel {
  display: block; overflow: visible; min-width: 0; min-height: 0;
}
#chat-container.panel-hidden {
  grid-template-columns: 280px 1fr 20px;
}
#chat-container.panel-hidden #panel-content {
  display: none;
}
#chat-container.panel-hidden .panel-toggle-tab svg {
  transform: rotate(180deg);
}

/* Sidebar */
#sidebar {
  background: white; border-right: 1px solid #e0e0e0;
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
}
#sidebar-header {
  padding: 15px; border-bottom: 1px solid #e0e0e0;
  display: flex; justify-content: space-between; align-items: center;
}
#sidebar-header h2 { font-size: 18px; color: #333; }
#sidebar-header button {
  padding: 6px 12px; background: #667eea; color: white; border: none;
  border-radius: 4px; cursor: pointer; font-size: 12px;
}
#conversation-list { flex: 1; overflow-y: auto; }
.conversation-item {
  padding: 15px; border-bottom: 1px solid #f0f0f0; cursor: pointer;
  transition: background 0.2s;
}
.conversation-item:hover { background: #f8f9fa; }
.conversation-item.active { background: #e8f0fe; border-left: 3px solid #667eea; }
.conversation-item .conv-name { font-weight: 600; color: #333; margin-bottom: 4px; }
.conversation-item .conv-preview { font-size: 13px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-item .conv-time { font-size: 11px; color: #999; float: right; }
.conversation-item .unread-badge {
  background: #667eea; color: white; padding: 2px 8px; border-radius: 12px;
  font-size: 11px; float: right;
}

/* Chat Area */
#chat-area {
  display: flex; flex-direction: column; background: #fafafa;
  height: 100%; overflow: hidden;
}
#chat-header {
  padding: 15px 20px; background: white; border-bottom: 1px solid #e0e0e0;
  display: flex; justify-content: space-between; align-items: center;
}
#chat-header .chat-title { font-weight: 600; font-size: 16px; }
#chat-header .chat-status { font-size: 12px; color: #28a745; }
#messages-container {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; min-height: 0;
}
.message {
  max-width: 70%; margin-bottom: 15px; padding: 12px 16px;
  border-radius: 18px; word-wrap: break-word;
}
.message.sent {
  background: #667eea; color: white; align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.message.received {
  background: white; color: #333; align-self: flex-start;
  border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.message .msg-sender { font-size: 11px; opacity: 0.8; margin-bottom: 4px; }
.message .msg-time { font-size: 10px; opacity: 0.7; margin-top: 4px; text-align: right; }
.message .msg-status { font-size: 10px; margin-left: 5px; }
#typing-indicator {
  padding: 10px 20px; font-size: 13px; color: #666; font-style: italic;
  min-height: 30px;
}
#message-input-area {
  padding: 15px 20px; background: white; border-top: 1px solid #e0e0e0;
  display: flex; gap: 10px;
}
#message-input {
  flex: 1; padding: 12px; border: 1px solid #ddd; border-radius: 24px;
  resize: none; font-size: 14px; max-height: 100px;
}
#send-btn {
  padding: 12px 24px; background: #667eea; color: white; border: none;
  border-radius: 24px; cursor: pointer; font-weight: 600;
}
#send-btn:hover { background: #5a6fd6; }
#send-btn:disabled { background: #ccc; cursor: not-allowed; }

/* Right Panel */
#right-panel {
  background: white; border-left: 1px solid #e0e0e0;
  height: 100%; overflow: visible;
  position: relative;
}
#panel-content {
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
}
/* Panel Toggle Tab (left border) */
.panel-toggle-tab {
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 48px;
  background: white;
  border: 1px solid #e0e0e0;
  border-right: none;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  padding: 0;
  z-index: 10;
  transition: color 0.2s;
}
.panel-toggle-tab:hover { color: #667eea; }
.panel-toggle-tab svg { transition: transform 0.2s; }
/* Tabs */
.panel-tabs {
  display: flex; border-bottom: 1px solid #e0e0e0;
}
.panel-tab {
  flex: 1; padding: 12px; text-align: center; cursor: pointer;
  border: none; background: none; font-size: 13px; font-weight: 500;
}
.panel-tab.active { border-bottom: 2px solid #667eea; color: #667eea; }

/* Device Panel */
#device-panel { display: none; flex: 1; overflow-y: auto; padding: 15px; min-height: 0; }
#device-panel.active { display: block; }
#device-panel h3 { font-size: 14px; margin-bottom: 15px; color: #333; }
.device-item {
  padding: 12px; background: #f8f9fa; border-radius: 8px; margin-bottom: 10px;
}
.device-item .device-name { font-weight: 600; margin-bottom: 4px; }
.device-item .device-info { font-size: 12px; color: #666; }
.device-item .device-current { color: #28a745; font-size: 11px; }
.device-item button {
  margin-top: 8px; padding: 6px 12px; background: #dc3545; color: white;
  border: none; border-radius: 4px; cursor: pointer; font-size: 12px;
}

/* Debug Panel */
#debug-panel { display: none; flex: 1; overflow-y: auto; padding: 10px; font-family: monospace; font-size: 11px; min-height: 0; }
#debug-panel.active { display: block; }
.debug-entry { padding: 2px 6px; border-bottom: 1px solid #f0f0f0; word-break: break-all; white-space: pre-wrap; max-height: 60px; overflow: hidden; font-size: 10px; }
.debug-entry:hover { max-height: none; background: #fffde7; }
.debug-entry.sent { background: #e8f5e9; }
.debug-entry.received { background: #e3f2fd; }
.debug-entry.error { background: #ffebee; color: #c62828; }
.debug-entry .debug-time { color: #999; margin-right: 6px; font-size: 9px; }
.debug-entry .debug-dir { font-weight: bold; margin-right: 6px; }
.debug-clear-btn { position: absolute; top: 5px; right: 10px; padding: 2px 8px; font-size: 10px; background: #f5f5f5; border: 1px solid #ddd; cursor: pointer; border-radius: 3px; }
.debug-clear-btn:hover { background: #e0e0e0; }

/* Encryption Panel */
#encryption-panel { display: none; flex: 1; overflow-y: auto; padding: 15px; min-height: 0; }
#encryption-panel.active { display: block; }
#encryption-panel h3 { font-size: 14px; margin-bottom: 15px; color: #333; }
#encryption-panel .key-status { padding: 12px; background: #f8f9fa; border-radius: 8px; margin-bottom: 10px; }
#encryption-panel .key-status.has-keys { background: #e8f5e9; }
#encryption-panel button {
  padding: 8px 16px; background: #667eea; color: white; border: none;
  border-radius: 4px; cursor: pointer; font-size: 13px; margin-top: 10px;
}
#encryption-panel textarea {
  width: 100%; height: 60px; font-size: 10px; margin-top: 10px;
  font-family: monospace; resize: vertical;
}

/* User Info */
#user-info {
  padding: 10px 15px; border-bottom: 1px solid #e0e0e0; font-size: 12px; color: #666;
}
#user-info .user-id { font-family: monospace; word-break: break-all; }

/* No Selection */
#no-conversation {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: #999;
}
#no-conversation svg { width: 80px; height: 80px; margin-bottom: 20px; opacity: 0.5; }

/* Modal Styles */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); display: flex; align-items: center;
  justify-content: center; z-index: 1000;
}
.modal-content {
  background: white; padding: 30px; border-radius: 12px;
  max-width: 400px; width: 90%; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-content h3 { margin-bottom: 15px; color: #333; }
.modal-content p { color: #666; margin-bottom: 20px; font-size: 14px; line-height: 1.5; }
.modal-content input {
  width: 100%; padding: 12px; margin-bottom: 15px;
  border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
  box-sizing: border-box;
}
.modal-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }
.modal-buttons button {
  padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 14px;
  border: 1px solid #ddd; background: #f5f5f5;
}
.modal-buttons button:hover { background: #e0e0e0; }
.modal-buttons button.primary { background: #667eea; color: white; border: none; }
.modal-buttons button.primary:hover { background: #5a6fd6; }
.modal-error { color: #dc3545; font-size: 13px; margin-bottom: 10px; }

/* Phase 5: Encryption Status Badge */
.encryption-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px;
  border-radius: 4px; font-size: 12px; background: #e8f5e9; color: #2e7d32;
}
.encryption-badge.disabled {
  background: #f5f5f5; color: #757575;
}
.encryption-badge.error {
  background: #ffebee; color: #c62828;
}
#key-version-indicator {
  font-weight: bold; margin-left: 5px;
}

/* Phase 5: Rotation Toast Notification */
.toast {
  position: fixed; bottom: 20px; right: 20px; background: #323232;
  color: white; padding: 12px 16px; border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); display: flex; align-items: center;
  gap: 10px; z-index: 1000; animation: slideIn 0.3s ease-out;
}
.toast button {
  background: none; border: none; color: white; font-size: 20px;
  cursor: pointer; padding: 0; margin-left: 10px;
}
@keyframes slideIn {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Phase 5: Message Debug Badge */
.message-debug-badge {
  display: inline-block; font-size: 10px; padding: 2px 4px;
  border-radius: 3px; margin-left: 5px; background: #4caf50; color: white;
}
.message-debug-badge.failed {
  background: #f44336;
}
.message-debug-badge.disabled {
  background: #9e9e9e;
}

/* Phase 5: Debug Controls */
.debug-controls {
  padding: 10px 20px; border-top: 1px solid #e0e0e0;
  font-size: 12px; background: white;
}
.debug-controls label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.debug-controls input[type="checkbox"] {
  cursor: pointer;
}

/* ============================================================
   ATTACHMENT MESSAGE BUBBLES
   ============================================================ */

/* Attachment card (clickable) */
.attachment-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  transition: opacity 0.2s; min-width: 180px;
}
.attachment-card:hover { opacity: 0.85; }

/* Icon */
.attachment-icon { font-size: 28px; flex-shrink: 0; }

/* File info */
.attachment-info { flex: 1; min-width: 0; }
.attachment-name {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attachment-size { font-size: 11px; opacity: 0.7; margin-top: 2px; }

/* Download arrow */
.attachment-download-icon { font-size: 16px; opacity: 0.6; flex-shrink: 0; }

/* Image card */
.attachment-image-card { flex-direction: column; padding: 4px; gap: 4px; }
.attachment-image-placeholder {
  width: 200px; height: 140px; background: rgba(0,0,0,0.05);
  border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; opacity: 0.7;
}
.attachment-image-loaded { width: auto; height: auto; }
.attachment-thumbnail {
  max-width: 200px; max-height: 200px; border-radius: 10px;
  object-fit: cover; display: block;
}
.attachment-label {
  font-size: 11px; opacity: 0.7; padding: 2px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px;
}

/* Sent attachment colors */
.message.sent .attachment-card { background: rgba(255,255,255,0.15); }
.message.sent .attachment-name { color: white; }
.message.sent .attachment-size { color: rgba(255,255,255,0.7); }
.message.sent .attachment-image-placeholder { background: rgba(255,255,255,0.15); color: white; }
.message.sent .attachment-label { color: rgba(255,255,255,0.7); }

/* Received attachment colors */
.message.received .attachment-card { background: rgba(0,0,0,0.04); }
.message.received .attachment-name { color: #333; }
.message.received .attachment-size { color: #888; }
.message.received .attachment-image-placeholder { background: rgba(0,0,0,0.06); color: #666; }
.message.received .attachment-label { color: #666; }

/* Uploading/Sending state */
.message.uploading { opacity: 0.8; }
.message.send-failed { opacity: 0.6; }
.uploading-card { pointer-events: none; }

/* Upload spinner */
.upload-spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: uploadSpin 0.8s linear infinite;
  flex-shrink: 0;
}
.message.received .upload-spinner {
  border-color: rgba(0,0,0,0.1);
  border-top-color: #667eea;
}
.upload-spinner.failed {
  border-color: rgba(255,0,0,0.2);
  border-top-color: #ff5252;
  animation: none;
}
@keyframes uploadSpin {
  to { transform: rotate(360deg); }
}

/* Older messages loader (scroll-to-load-more) */
.older-messages-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  color: #888;
  font-size: 0.85em;
}
.older-messages-loader .upload-spinner {
  width: 20px; height: 20px;
  border-width: 2px;
  border-color: rgba(0,0,0,0.1);
  border-top-color: #667eea;
}

/* Progress text in uploading placeholder */
.upload-progress-text {
  font-size: 12px; opacity: 0.9;
}
.upload-progress-text.failed { color: #ff5252; }

/* Uploading image placeholder */
.uploading-placeholder {
  background: rgba(255,255,255,0.1) !important;
}

/* Message status indicators */
.msg-status.failed { color: #ff5252; }
.msg-status.read { color: #4fc3f7; }

/* ============================================================
   EMOJI & MEDIA BUTTONS (Plan B)
   ============================================================ */

/* Media Button */
#media-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid #ccc;
  background: transparent;
  color: #888;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.2s;
}
#media-btn:hover { border-color: #667eea; color: #667eea; }
#media-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Input Wrapper (textarea + emoji btn) */
#input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-end;
}
#input-wrapper #message-input {
  width: 100%;
  padding-right: 40px;
}

/* Emoji Button */
#emoji-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px; height: 28px;
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  border-radius: 50%;
  transition: color 0.2s;
}
#emoji-btn:hover { color: #667eea; }

/* Send Button (icon circle) */
#send-btn {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Emoji Picker Popup */
#emoji-picker {
  position: absolute;
  bottom: 100%;
  right: 0;
  width: 320px;
  max-height: 320px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  overflow: hidden;
  margin-bottom: 8px;
}
.emoji-picker-header {
  border-bottom: 1px solid #eee;
}
.emoji-categories {
  display: flex;
  gap: 2px;
  padding: 8px;
  overflow-x: auto;
}
.emoji-cat-btn {
  width: 32px; height: 32px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.emoji-cat-btn:hover { background: #f0f0f0; }
.emoji-cat-btn.active { background: #e8f0fe; }
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  padding: 8px;
  max-height: 240px;
  overflow-y: auto;
  gap: 2px;
}
.emoji-cell {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.emoji-cell:hover { background: #f0f0f0; }

/* Upload Preview */
#upload-preview {
  padding: 8px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
}
.upload-preview-content {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
#upload-preview-image {
  height: 60px;
  max-width: 120px;
  border-radius: 8px;
  object-fit: cover;
}
#upload-preview-file {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#upload-preview-name {
  font-weight: 500;
  font-size: 13px;
  color: #333;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#upload-preview-size {
  font-size: 12px;
  color: #888;
}
#upload-cancel-btn {
  margin-left: auto;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: none;
  background: #e0e0e0;
  cursor: pointer;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
#upload-cancel-btn:hover { background: #ff5252; color: white; }

/* ============================================================
   QUOTES TAB (Plan A)
   ============================================================ */

/* Quotes Panel */
#quotes-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-height: 0;
}
#quotes-panel.active {
  display: block;
}

/* Quote List Header */
.quote-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
}
.quote-list-header h3 {
  font-size: 16px;
  color: #333;
  margin: 0;
}
.quote-count {
  font-size: 13px;
  color: #888;
}
.quote-count strong {
  color: #333;
}

/* Quote Card */
.quote-card {
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s;
}
.quote-card:hover { background: #f8f9fa; }
.quote-card.expired { opacity: 0.7; }

.quote-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.quote-timer {
  font-size: 13px;
  font-weight: 600;
}
.quote-timer.active { color: #e53935; }
.quote-timer.expired { color: #999; }
.quote-response-count {
  font-size: 13px;
  color: #667eea;
  font-weight: 500;
}
.quote-response-count.expired { color: #999; }
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #667eea;
  color: white;
  font-size: 11px;
  font-weight: 600;
}
.quote-card.expired .count-badge {
  background: #ccc;
}
.quote-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 0 0 10px 0;
}
.quote-card-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.quote-product-info {
  flex: 1;
  min-width: 0;
}
.product-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-price {
  font-size: 12px;
  color: #888;
}
.quote-product-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Partner Response Header */
.partner-response-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
}
.back-button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #333;
  padding: 4px;
}
.back-button:hover { color: #667eea; }
.partner-response-header h3 {
  font-size: 16px;
  color: #333;
  margin: 0;
}

/* Quote Summary */
.quote-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}
.quote-summary-image {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}
.quote-summary-name {
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

/* Partner Card */
.partner-card {
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
}
.partner-store-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.partner-store-image {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.partner-store-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}
.verified-badge {
  color: #667eea;
  font-size: 14px;
}
.partner-staff-info {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}
.partner-pricing {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 13px;
}
.partner-pricing .label { color: #888; }
.partner-pricing .value { font-weight: 600; color: #333; }
.partner-note {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.partner-time {
  font-size: 11px;
  color: #999;
  margin-bottom: 10px;
}
.btn-start-chat {
  width: 100%;
  padding: 10px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-start-chat:hover { background: #5a6fd6; }

/* Loading / Empty / Error states */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}
.error-state {
  padding: 20px;
  color: #c62828;
  font-size: 13px;
  text-align: center;
}

/* Quotes Page Layout (quotes.html) */
#quotes-main {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}
#quotes-auth-required {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
  color: #666;
  font-size: 16px;
}
#quotes-auth-required a { color: #667eea; }
