/**
 * GIRI MAIL v3.0 — Premium 3-Column Layout
 * Fichier CSS dédié (hors bundle.min.css)
 */

/* ===== VIEW CONTAINER OVERRIDE ===== */
#view-mail.active:has(.gm-layout) {
  display: flex !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
  height: calc(100vh - 60px) !important;
  overflow: hidden !important;
  gap: 0 !important;
}

#view-mail.active .gm-layout {
  height: 100% !important;
}

/* ===== LAYOUT GRID ===== */
.gm-layout {
  --gm-sidebar-w: 240px;
  --gm-list-w: 340px;
  display: grid;
  grid-template-columns: var(--gm-sidebar-w) var(--gm-list-w) 1fr;
  column-gap: 1px;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary, #080810);
  color: var(--text, #e2e8f0);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 14px;
  position: relative;
}

.gm-layout::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(212,175,55,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== SIDEBAR ===== */
.gm-sidebar {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-secondary, #0a0a14) 0%, var(--bg-primary, #080810) 100%);
  border-right: 1px solid rgba(255,255,255,0.05);
  padding: 20px 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

.gm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 10px;
}

.gm-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #d4af37, #f4d03f);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #000;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(212,175,55,0.3);
}

.gm-brand-name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== COMPOSE BUTTON ===== */
.gm-compose-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 14px 14px;
  padding: 11px 16px;
  background: linear-gradient(135deg, #d4af37, #f0c84a);
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(212,175,55,0.3), 0 1px 0 rgba(255,255,255,0.15) inset;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}

.gm-compose-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}

.gm-compose-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 28px rgba(212,175,55,0.45);
}

.gm-compose-btn:active {
  transform: translateY(0) scale(0.99);
}

.gm-compose-btn svg { flex-shrink: 0; }

/* ===== NAV ===== */
.gm-nav {
  flex: 1;
  padding: 0 10px;
}

.gm-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 10px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.14s ease;
  user-select: none;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
  position: relative;
  border: 1px solid transparent;
}

.gm-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  transform: translateX(2px);
}

.gm-nav-item.active {
  background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(212,175,55,0.08));
  color: #d4af37;
  font-weight: 600;
  border: 1px solid rgba(212,175,55,0.15);
}

.gm-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: #d4af37;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(212,175,55,0.6);
}

.gm-nav-item.active svg { stroke: #d4af37; }

.gm-nav-item span:first-of-type { flex: 1; }

.gm-nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 8px 12px;
}

/* ===== BADGES ===== */
.gm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  background: var(--accent, #6366f1);
  color: #fff;
  animation: gm-badge-pulse 2s ease-in-out infinite;
  letter-spacing: 0;
}

.gm-badge:empty { display: none; }

.gm-badge-gold { background: linear-gradient(135deg, #d4af37, #f0c84a); color: #000; animation: none; }
.gm-badge-amber { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #000; animation: none; }

@keyframes gm-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0); }
}

/* ===== SIDEBAR FOOTER ===== */
.gm-sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: auto;
}

.gm-kbd-hints {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gm-kbd-hints div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.22);
}

.gm-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  font-size: 10px;
  font-family: inherit;
  color: rgba(255,255,255,0.38);
  background: rgba(255,255,255,0.05);
  line-height: 1.5;
  letter-spacing: 0.5px;
}

/* ===== RESIZE DIVIDERS ===== */
.gm-divider {
  width: 4px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 5;
  transition: background 0.15s;
}

.gm-divider:hover,
.gm-divider.gm-dragging {
  background: rgba(212,175,55,0.2);
}

.gm-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 28px;
  border-radius: 1px;
  background: rgba(255,255,255,0.08);
  transition: background 0.15s;
}

.gm-divider:hover::after { background: rgba(212,175,55,0.5); }

.gm-resizing { user-select: none !important; cursor: col-resize !important; }

/* ===== EMAIL LIST PANEL ===== */
.gm-list-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
  background: var(--bg-secondary, #0c0c18);
  position: relative;
  z-index: 1;
}

.gm-list-header {
  padding: 16px 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  background: rgba(255,255,255,0.01);
}

.gm-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.gm-search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  stroke: rgba(255,255,255,0.25);
  pointer-events: none;
}

.gm-search {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  color: var(--text, #e2e8f0);
  font-size: 13px;
  outline: none;
  transition: all 0.18s ease;
  box-sizing: border-box;
}

.gm-search::placeholder { color: rgba(255,255,255,0.25); }

.gm-search:focus {
  border-color: rgba(212,175,55,0.35);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.08);
}

.gm-list-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.28);
  padding-bottom: 12px;
}

.gm-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.gm-list::-webkit-scrollbar { width: 3px; }
.gm-list::-webkit-scrollbar-track { background: transparent; }
.gm-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.gm-email-list { flex: 1; overflow-y: auto; min-height: 0; }

/* ===== EMAIL ITEMS ===== */
.gm-email-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.12s ease;
  position: relative;
}

.gm-email-item:hover {
  background: rgba(255,255,255,0.035);
}

.gm-email-item.gm-selected {
  background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(212,175,55,0.05));
  border-left: 2px solid #d4af37;
}

.gm-email-item.gm-unread .gm-item-from {
  font-weight: 700;
  color: #fff;
}

.gm-email-item.gm-unread .gm-item-subject {
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

/* ===== AVATAR ===== */
.gm-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.gm-avatar-lg {
  width: 46px;
  height: 46px;
  font-size: 19px;
  border-radius: 13px;
}

.gm-item-avatar { flex-shrink: 0; padding-top: 1px; }
.gm-item-content { flex: 1; min-width: 0; }

.gm-item-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.gm-item-from {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.gm-item-date {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}

.gm-item-subject {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.gm-item-preview {
  font-size: 12px;
  color: rgba(255,255,255,0.27);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.gm-item-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 2px;
  opacity: 0;
  transition: opacity 0.12s;
  flex-shrink: 0;
}

.gm-email-item:hover .gm-item-actions { opacity: 1; }

.gm-item-star {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px;
  color: rgba(255,255,255,0.25);
  transition: color 0.12s, transform 0.15s;
  display: flex;
  align-items: center;
}

.gm-item-star:hover { color: #d4af37; transform: scale(1.2); }
.gm-item-star.gm-starred { color: #d4af37; opacity: 1 !important; }

.gm-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #6366f1);
  margin-top: 2px;
  box-shadow: 0 0 6px var(--accent, #6366f1);
}

/* ===== READER ===== */
.gm-reader {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary, #080810);
  height: 100%;
  min-height: 0;
  flex: 1;
  position: relative;
  z-index: 1;
}

.gm-reader::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.15), transparent);
  pointer-events: none;
}

.gm-reader-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex: 1;
  gap: 12px;
  color: rgba(255,255,255,0.2);
  text-align: center;
  padding-bottom: 60px;
}

.gm-reader-empty-icon {
  font-size: 64px;
  opacity: 0.12;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 30px rgba(212,175,55,0.2));
  animation: gm-float 4s ease-in-out infinite;
}

@keyframes gm-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.gm-reader-empty p {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.22);
  margin: 0;
  letter-spacing: 0.2px;
}

.gm-reader-empty span {
  font-size: 12px;
  color: rgba(255,255,255,0.13);
  display: flex;
  align-items: center;
  gap: 6px;
}

.gm-reader-empty kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 11px;
  font-family: inherit;
  color: rgba(255,255,255,0.3);
  line-height: 1.6;
}

.gm-reader-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ===== READER TOOLBAR ===== */
.gm-reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  gap: 8px;
  background: rgba(255,255,255,0.01);
  backdrop-filter: blur(10px);
}

.gm-reader-toolbar-left {
  display: flex;
  gap: 6px;
}

.gm-tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.14s ease;
  font-weight: 500;
}

.gm-tool-btn:hover {
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.88);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

.gm-tool-danger:hover {
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border-color: rgba(239,68,68,0.2);
}

.gm-reply-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(212,175,55,0.08));
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 9px;
  color: #d4af37;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.2px;
}

.gm-reply-btn:hover {
  background: linear-gradient(135deg, rgba(212,175,55,0.25), rgba(212,175,55,0.15));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,175,55,0.2);
}

/* ===== READER CONTENT ===== */
.gm-reader-subject {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  padding: 28px 32px 18px;
  line-height: 1.3;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.gm-reader-meta {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 0 32px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.gm-reader-meta-info { flex: 1; }

.gm-reader-from {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.gm-reader-addr {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  font-weight: 400;
}

.gm-reader-to {
  font-size: 12px;
  color: rgba(255,255,255,0.38);
  margin-bottom: 3px;
}

.gm-reader-date {
  font-size: 12px;
  color: rgba(255,255,255,0.28);
}

.gm-reader-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  color: rgba(255,255,255,0.75);
  line-height: 1.8;
  font-size: 15px;
}

.gm-reader-body::-webkit-scrollbar { width: 4px; }
.gm-reader-body::-webkit-scrollbar-track { background: transparent; }
.gm-reader-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.gm-reader-body a { color: #d4af37; text-decoration: none; border-bottom: 1px solid rgba(212,175,55,0.3); }
.gm-reader-body a:hover { border-bottom-color: #d4af37; }
.gm-reader-body img { max-width: 100%; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.gm-reader-body pre {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 18px;
  overflow-x: auto;
  font-size: 13px;
  color: rgba(255,255,255,0.68);
  line-height: 1.6;
}

/* ===== REPLY BOX ===== */
.gm-reader-reply-box {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 18px 32px 22px;
  flex-shrink: 0;
}

.gm-reply-inner {
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.gm-reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 15px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.02);
}

.gm-reply-editor {
  min-height: 110px;
  max-height: 220px;
  overflow-y: auto;
  padding: 15px;
  font-size: 14px;
  color: rgba(255,255,255,0.82);
  outline: none;
  line-height: 1.7;
}

.gm-reply-editor:empty:before {
  content: attr(placeholder);
  color: rgba(255,255,255,0.18);
  pointer-events: none;
}

.gm-reply-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ===== COMPOSER MODAL ===== */
.gm-composer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
  backdrop-filter: blur(8px);
}

.gm-composer-backdrop.open {
  display: flex;
}

.gm-composer {
  background: linear-gradient(160deg, var(--bg-secondary, #14142a), var(--bg-primary, #0f0f1e));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  width: 580px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 32px 100px rgba(0,0,0,0.7),
    0 0 0 1px rgba(212,175,55,0.12),
    0 1px 0 rgba(255,255,255,0.05) inset;
  animation: gm-composer-slide 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes gm-composer-slide {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Resize handle */
.gm-resize-handle {
  height: 6px;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gm-resize-handle::after {
  content: '';
  width: 32px;
  height: 3px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
}

.gm-resize-handle:hover::after {
  background: rgba(212,175,55,0.4);
}

.gm-composer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
  flex-shrink: 0;
}

.gm-composer-title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
}

.gm-composer-actions { display: flex; gap: 6px; }

.gm-icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  color: rgba(255,255,255,0.45);
  transition: all 0.12s;
  font-size: 12px;
}

.gm-icon-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.gm-btn-active {
  background: rgba(212,175,55,0.15) !important;
  color: #d4af37 !important;
  border-color: rgba(212,175,55,0.3) !important;
}

.gm-composer-fields {
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.gm-composer-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.gm-composer-field:last-child { border-bottom: none; }

.gm-composer-field label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  width: 38px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.gm-field-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  color: rgba(255,255,255,0.88);
  font-family: inherit;
}

.gm-field-input::placeholder { color: rgba(255,255,255,0.22); }

.gm-to-wrap { flex: 1; position: relative; }
.gm-to-wrap .gm-field-input { width: 100%; }

/* ===== TO AUTOCOMPLETE ===== */
.gm-to-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary, #14142a);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}

.gm-to-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
}

.gm-to-item:hover,
.gm-to-item.gm-to-hover {
  background: rgba(212,175,55,0.1);
}

.gm-to-item-name {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}

.gm-to-item-email {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

.gm-to-item mark {
  background: rgba(212,175,55,0.25);
  color: #d4af37;
  padding: 0 1px;
  border-radius: 2px;
}

/* ===== COMPOSER BODY ===== */
.gm-composer-body {
  flex: 1;
  overflow: hidden;
  min-height: 170px;
}

.gm-body-editor {
  width: 100%;
  height: 100%;
  min-height: 170px;
  padding: 16px 20px;
  box-sizing: border-box;
  background: none;
  outline: none;
  font-size: 14px;
  color: rgba(255,255,255,0.82);
  line-height: 1.7;
  font-family: inherit;
  overflow-y: auto;
}

.gm-body-editor:empty:before {
  content: attr(placeholder);
  color: rgba(255,255,255,0.18);
  pointer-events: none;
}

/* ===== HTML MODE ===== */
.gm-html-mode {
  display: flex;
  flex: 1;
  min-height: 200px;
  gap: 0;
}

.gm-html-source-wrap,
.gm-html-preview-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gm-html-source-wrap { border-right: 1px solid rgba(255,255,255,0.07); }

.gm-html-label {
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.gm-html-source {
  flex: 1;
  resize: none;
  background: rgba(0,0,0,0.2);
  border: none;
  outline: none;
  padding: 14px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
}

.gm-html-preview {
  flex: 1;
  border: none;
  background: #fff;
}

/* ===== AI PANEL ===== */
.gm-ai-panel {
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(212,175,55,0.03);
}

.gm-ai-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.gm-ai-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #d4af37;
}

.gm-ai-panel-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gm-ai-prompt {
  width: 100%;
  min-height: 60px;
  max-height: 120px;
  resize: vertical;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
}

.gm-ai-prompt:focus {
  border-color: rgba(212,175,55,0.3);
}

.gm-ai-options {
  display: flex;
  gap: 8px;
  align-items: center;
}

.gm-ai-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 7px 12px;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.gm-ai-generate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #d4af37, #f0c84a);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.gm-ai-generate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212,175,55,0.3);
}

.gm-ai-generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== COMPOSER TOOLBAR ===== */
.gm-composer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  gap: 8px;
}

.gm-composer-format { display: flex; gap: 4px; }

.gm-fmt-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 7px;
  cursor: pointer;
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  transition: all 0.12s;
}

.gm-fmt-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.92);
}

.gm-attach-btn svg { stroke: currentColor; }

.gm-composer-send-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gm-send-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.18);
}

.gm-send-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #d4af37, #f0c84a);
  color: #000;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(212,175,55,0.35);
  letter-spacing: 0.3px;
}

.gm-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(212,175,55,0.5);
}

.gm-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===== ATTACHMENTS ===== */
.gm-attachments-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 18px;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.01);
  flex-shrink: 0;
}

.gm-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.gm-pj-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  max-width: 200px;
}

.gm-pj-item.gm-pj-loading { opacity: 0.6; }
.gm-pj-item.gm-pj-error { border-color: rgba(239,68,68,0.3); }

.gm-pj-icon { flex-shrink: 0; display: flex; align-items: center; }

.gm-pj-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-pj-size {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.gm-pj-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.3);
  padding: 2px;
  display: flex;
  transition: color 0.12s;
}

.gm-pj-remove:hover { color: #f87171; }

.gm-pj-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: gm-spin 0.6s linear infinite;
}

/* ===== STATES ===== */
.gm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px;
}

.gm-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,0.06);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: gm-spin 0.65s linear infinite;
  box-shadow: 0 0 12px rgba(212,175,55,0.2);
}

.gm-spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: gm-spin 0.65s linear infinite;
  vertical-align: middle;
}

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

.gm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 28px;
  gap: 14px;
  color: rgba(255,255,255,0.2);
  font-size: 13px;
}

/* ===== TOAST ===== */
.gm-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.gm-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.gm-toast-success {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.3);
  color: #34d399;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(52,211,153,0.1);
}

.gm-toast-error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(248,113,113,0.1);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 900px) {
  .gm-layout {
    grid-template-columns: 62px 1fr;
  }

  .gm-sidebar {
    align-items: center;
    padding: 12px 0;
  }

  .gm-brand-name,
  .gm-nav-item span,
  .gm-compose-btn span:not(.gm-badge),
  .gm-compose-btn kbd,
  .gm-sidebar-footer { display: none; }

  .gm-compose-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    margin: 4px 7px 12px;
    border-radius: 12px;
  }

  .gm-nav-item {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 12px;
    margin: 0 7px 3px;
  }

  .gm-nav-item.active::before { display: none; }

  .gm-reader { display: none; }

  .gm-divider { display: none; }
}

@media (max-width: 600px) {
  .gm-layout { grid-template-columns: 1fr; }
  .gm-sidebar { display: none; }
  .gm-divider { display: none; }
  .gm-list-panel { border-right: none; }

  .gm-composer {
    width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 85vh;
  }

  .gm-composer-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .gm-reader-subject { font-size: 18px; padding: 18px 18px 14px; }
  .gm-reader-meta { padding: 0 18px 14px; }
  .gm-reader-body { padding: 18px; }
}
