/* ==========================================================================
   GMAIL MODERN MATERIAL DESIGN 3 / GOOGLE WORKSPACE THEME CSS
   ========================================================================== */

:root {
  /* Colors - Gmail Material You / M3 Palette */
  --gm-bg-page: #f6f8fc;
  --gm-surface: #ffffff;
  --gm-surface-hover: #f1f3f4;
  --gm-surface-active: #e8f0fe;
  --gm-surface-unread: #ffffff;
  --gm-surface-read: #f2f6fc;
  --gm-surface-read-hover: #eaf1fb;
  
  --gm-text-main: #1f1f1f;
  --gm-text-muted: #444746;
  --gm-text-subtle: #5e5e5e;
  --gm-text-light: #747775;
  
  --gm-primary: #0b57d0;
  --gm-primary-container: #c2e7ff;
  --gm-on-primary-container: #001d35;
  --gm-primary-hover: #0842a0;

  --gm-border: #e0e2e0;
  --gm-border-subtle: #f0f1f1;
  --gm-divider: #e8eaed;
  
  --gm-star-gold: #f4b400;
  --gm-star-empty: #c4c7c5;
  
  /* Badges & Chips */
  --gm-badge-blue-bg: #e8f0fe;
  --gm-badge-blue-text: #1a73e8;
  --gm-badge-green-bg: #e6f4ea;
  --gm-badge-green-text: #137333;
  --gm-badge-yellow-bg: #fef7e0;
  --gm-badge-yellow-text: #b06000;
  --gm-badge-red-bg: #fce8e6;
  --gm-badge-red-text: #c5221f;

  /* Shadows */
  --gm-shadow-1: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --gm-shadow-2: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
  --gm-shadow-3: 0 4px 12px 0 rgba(0,0,0,0.15), 0 0 4px 0 rgba(0,0,0,0.1);
  --gm-shadow-compose: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
  --gm-shadow-dropdown: 0 4px 16px rgba(0,0,0,0.18);

  /* Dimensions & Spacing */
  --header-height: 64px;
  --sidebar-width: 256px;
  --workspace-bar-width: 56px;
  --content-border-radius: 16px;

  /* Fonts */
  --font-family: 'Google Sans', 'Google Sans Text', Roboto, 'Segoe UI', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: var(--gm-bg-page);
  color: var(--gm-text-main);
  font-size: 14px;
  line-height: 1.4;
  user-select: none;
}

/* Material Symbols Adjustments */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  vertical-align: middle;
}

.material-symbols-outlined.fill-1 {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

/* Utility hidden */
.hidden {
  display: none !important;
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */
.gmail-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: var(--gm-bg-page);
  position: relative;
}

/* ==========================================================================
   1. HEADER / SEARCH BAR
   ========================================================================== */
.gmail-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background-color: var(--gm-bg-page);
  z-index: 100;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.logo-wrapper:hover {
  background: rgba(0, 0, 0, 0.04);
}

.gmail-logo-text {
  font-size: 22px;
  font-weight: 400;
  color: var(--gm-text-muted);
  letter-spacing: -0.5px;
  position: relative;
  top: -1px;
}

/* Header Center Search */
.header-center {
  flex: 1;
  max-width: 720px;
  position: relative;
}

.search-box-container {
  display: flex;
  align-items: center;
  background-color: #eaf1fb;
  border-radius: 28px;
  height: 48px;
  padding: 0 8px 0 12px;
  transition: background-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.search-box-container:focus-within {
  background-color: #ffffff;
  box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

.search-icon-btn {
  color: var(--gm-text-subtle);
  background: transparent;
  border: none;
  cursor: pointer;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: var(--gm-text-main);
  padding: 0 12px;
}

.search-input::placeholder {
  color: var(--gm-text-subtle);
  font-size: 15px;
}

.search-clear-btn, .search-filters-btn {
  color: var(--gm-text-subtle);
}

/* Search suggestions dropdown */
.search-dropdown {
  position: absolute;
  top: 54px;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--gm-shadow-dropdown);
  padding: 8px 0;
  z-index: 200;
  border: 1px solid var(--gm-divider);
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  cursor: pointer;
  color: var(--gm-text-muted);
  font-size: 14px;
}

.search-dropdown-item:hover {
  background-color: var(--gm-surface-hover);
  color: var(--gm-text-main);
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--gm-border);
  padding: 4px 10px 4px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--gm-text-muted);
  transition: background 0.15s;
}

.status-indicator-pill:hover {
  background: var(--gm-surface-hover);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online {
  background-color: #1e8e3e;
}

.status-indicator-pill .dropdown-arrow {
  font-size: 16px;
  color: var(--gm-text-light);
}

/* User Avatar circle */
.user-profile-btn {
  margin-left: 6px;
  cursor: pointer;
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a73e8;
  color: #fff;
  font-weight: 500;
  font-size: 15px;
  border: 2px solid transparent;
  transition: transform 0.15s;
}

.avatar-circle:hover {
  transform: scale(1.05);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Common icon buttons */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--gm-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  outline: none;
}

.icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--gm-text-main);
}

.icon-btn:active {
  background-color: rgba(0, 0, 0, 0.12);
}

.icon-btn.disabled {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}

.icon-btn-tiny {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--gm-text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn-tiny:hover {
  background: rgba(0,0,0,0.08);
}

.icon-btn-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--gm-text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn-small:hover {
  background: rgba(0,0,0,0.06);
  color: var(--gm-text-main);
}

/* ==========================================================================
   2. MAIN BODY (SIDEBAR + CONTENT + WORKSPACE)
   ========================================================================== */
.gmail-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}
/* App Rail Navigation (Far Left) */
.app-rail-nav {
  width: 68px;
  min-width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 8px;
  background-color: var(--gm-bg-page);
}

.app-rail-btn {
  width: 56px;
  height: 52px;
  border-radius: 16px;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gm-text-muted);
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  gap: 2px;
}

.app-rail-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--gm-text-main);
}

.app-rail-btn.active {
  color: #001d35;
}

.app-rail-btn.active .app-rail-icon-wrapper {
  background-color: #d3e3fd;
  color: #001d35;
}

.app-rail-icon-wrapper {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-rail-badge {
  position: absolute;
  top: -2px;
  right: 2px;
  background-color: #b3261e;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 8px;
  line-height: 1.1;
}

.tab-content-text {
  display: flex;
  align-items: center;
  gap: 8px;
}
.keyboard-layout-picker {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gm-text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.keyboard-layout-picker:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--gm-text-main);
}

/* ==========================================================================
   3. LEFT SIDEBAR
   ========================================================================== */
.gmail-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 0 12px 12px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--gm-bg-page);
  transition: width 0.2s, min-width 0.2s, padding 0.2s;
}

.gmail-sidebar.collapsed {
  width: 72px;
  min-width: 72px;
  padding: 0 8px;
}

.gmail-sidebar.collapsed .compose-text,
.gmail-sidebar.collapsed .nav-label,
.gmail-sidebar.collapsed .nav-badge,
.gmail-sidebar.collapsed .sidebar-section-title,
.gmail-sidebar.collapsed .storage-widget,
.gmail-sidebar.collapsed .meet-widget {
  display: none;
}

.gmail-sidebar.collapsed .compose-btn {
  padding: 0;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  justify-content: center;
}

.gmail-sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0;
  height: 44px;
}

/* Compose Button */
.compose-wrapper {
  padding: 8px 0 16px 4px;
}

.compose-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: var(--gm-primary-container);
  color: var(--gm-on-primary-container);
  border: none;
  border-radius: 16px;
  padding: 0 24px 0 16px;
  height: 56px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--gm-shadow-1);
  transition: box-shadow 0.2s, background-color 0.2s, transform 0.1s;
}

.compose-btn:hover {
  box-shadow: var(--gm-shadow-2);
  background-color: #b5deff;
}

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

.compose-icon {
  font-size: 24px;
}

/* Sidebar Nav Items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 16px 0 20px;
  border-radius: 16px;
  cursor: pointer;
  color: var(--gm-text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
  position: relative;
}

.nav-item:hover {
  background-color: #eaebef;
  color: var(--gm-text-main);
}

.nav-item.active {
  background-color: #d3e3fd;
  color: #001d35;
  font-weight: 700;
}

.nav-item.active .nav-icon {
  font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 20;
}

.nav-icon {
  margin-right: 18px;
  font-size: 20px;
  color: inherit;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  font-size: 12px;
  font-weight: 700;
  color: inherit;
}

.nav-divider {
  height: 1px;
  background-color: var(--gm-border);
  margin: 12px 12px;
}

/* Labels */
.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 4px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gm-text-muted);
}

.icon-btn-micro {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--gm-text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn-micro:hover {
  background: rgba(0,0,0,0.08);
}

.label-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 22px;
  margin-left: 5px;
}

/* Storage space widget */
.storage-widget {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--gm-text-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.storage-bar-track {
  width: 100%;
  height: 4px;
  background: #e0e2e0;
  border-radius: 2px;
  overflow: hidden;
}

.storage-bar-fill {
  height: 100%;
  background: #1a73e8;
  border-radius: 2px;
}

.storage-upgrade-link {
  color: #1a73e8;
  text-decoration: none;
  font-weight: 500;
  margin-top: 4px;
}

.storage-upgrade-link:hover {
  text-decoration: underline;
}

/* Meet widget */
.meet-widget {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meet-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gm-text-muted);
}

.meet-btn:hover {
  background-color: #eaebef;
  color: var(--gm-text-main);
}

/* ==========================================================================
   4. MAIN CONTENT CONTAINER
   ========================================================================== */
.gmail-content {
  flex: 1;
  background-color: var(--gm-surface);
  border-radius: var(--content-border-radius);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.03);
  position: relative;
}

/* 4.1 TOOLBAR */
.content-toolbar {
  height: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--gm-divider);
  background-color: var(--gm-surface);
  z-index: 10;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-selection-actions, .toolbar-default-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-v-divider {
  width: 1px;
  height: 20px;
  background-color: var(--gm-divider);
  margin: 0 4px;
}

.checkbox-dropdown-wrapper {
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.pagination-info {
  font-size: 12px;
  color: var(--gm-text-subtle);
  margin-right: 4px;
}

/* Custom Checkbox */
.custom-checkbox {
  position: relative;
  width: 18px;
  height: 18px;
  cursor: pointer;
  display: inline-block;
}

.custom-checkbox input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.custom-checkbox .checkmark {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  background-color: transparent;
  border: 2px solid var(--gm-text-subtle);
  border-radius: 2px;
  transition: all 0.15s;
}

.custom-checkbox:hover .checkmark {
  border-color: var(--gm-text-main);
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--gm-primary);
  border-color: var(--gm-primary);
}

.custom-checkbox .checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

/* 4.2 INBOX CATEGORY TABS */
.inbox-tabs {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--gm-divider);
  background-color: var(--gm-surface);
  height: 48px;
  min-height: 48px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  color: var(--gm-text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
  width: 250px;
  flex-shrink: 0;
}

.tab-icon {
  font-size: 20px;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-title {
  white-space: nowrap;
}

.tab-btn:hover {
  background-color: var(--gm-surface-hover);
  color: var(--gm-text-main);
}

.tab-btn.active {
  color: var(--gm-primary);
  font-weight: 700;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 3px;
  background-color: var(--gm-primary);
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}

.tab-new-badge {
  font-size: 11px;
  color: #1a73e8;
  font-weight: 500;
  margin-left: 8px;
  white-space: nowrap;
}

.tab-badge-pill {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
  margin-left: 8px;
  white-space: nowrap;
}

.tab-badge-pill.green {
  background: var(--gm-badge-green-bg);
  color: var(--gm-badge-green-text);
}

.tab-badge-pill.blue {
  background: var(--gm-badge-blue-bg);
  color: var(--gm-badge-blue-text);
}

.tab-badge-pill.yellow {
  background: var(--gm-badge-yellow-bg);
  color: var(--gm-badge-yellow-text);
}

/* ==========================================================================
   5. EMAIL LIST VIEW & ROWS
   ========================================================================== */
.email-list-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--gm-surface);
  position: relative;
}

.email-list {
  display: flex;
  flex-direction: column;
}

.email-row {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--gm-border-subtle);
  background-color: var(--gm-surface-read);
  cursor: pointer;
  transition: box-shadow 0.1s, background-color 0.1s;
  position: relative;
  font-size: 14px;
}

.email-row:hover {
  box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  background-color: var(--gm-surface-read-hover);
  z-index: 2;
}

.email-row.unread {
  background-color: var(--gm-surface-unread);
  font-weight: 700;
  color: var(--gm-text-main);
}

.email-row.unread .email-sender,
.email-row.unread .email-subject {
  font-weight: 700;
  color: var(--gm-text-main);
}

.email-row.selected {
  background-color: var(--gm-surface-active) !important;
}

/* Row elements */
.row-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 14px;
  flex-shrink: 0;
}

.btn-star, .btn-important {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gm-star-empty);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.btn-star:hover {
  color: var(--gm-text-subtle);
}

.btn-star.starred {
  color: var(--gm-star-gold);
}

.btn-star.starred .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.btn-important.important {
  color: #f29900;
}

.btn-important.important .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.email-sender-col {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gm-text-main);
  padding-right: 16px;
  flex-shrink: 0;
}

.email-content-col {
  flex: 1;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 16px;
  gap: 6px;
}

.email-subject {
  color: var(--gm-text-main);
  flex-shrink: 0;
}

.email-snippet-separator {
  color: var(--gm-text-light);
  font-weight: 400;
}

.email-snippet {
  color: var(--gm-text-light);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tags in row */
.email-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-right: 4px;
}

.tag-work { background: #e8f0fe; color: #1a73e8; }
.tag-personal { background: #e6f4ea; color: #188038; }
.tag-finance { background: #fef7e0; color: #b06000; }
.tag-dev { background: #f3e8fd; color: #8430ce; }
.tag-inbox { background: #f1f3f4; color: #5f6368; }

.attachment-icon-pill {
  color: var(--gm-text-subtle);
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* Date col */
.email-date-col {
  width: 80px;
  text-align: right;
  font-size: 12px;
  color: var(--gm-text-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.email-row.unread .email-date-col {
  color: var(--gm-text-main);
  font-weight: 700;
}

/* Hover Quick Actions on Row */
.row-hover-actions {
  display: none;
  position: absolute;
  right: 16px;
  top: 0;
  bottom: 0;
  align-items: center;
  gap: 2px;
  background: inherit;
  padding-left: 12px;
}

.email-row:hover .row-hover-actions {
  display: flex;
  background: var(--gm-surface-read-hover);
}

.email-row.unread:hover .row-hover-actions {
  display: flex;
  background: var(--gm-surface-hover);
}
.email-row:hover .email-date-col {
  visibility: hidden;
}

/* Empty State */
.empty-state-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60%;
  color: var(--gm-text-subtle);
  text-align: center;
  padding: 40px;
}

.empty-state-icon span {
  font-size: 64px;
  color: #dadce0;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--gm-text-main);
  margin-bottom: 8px;
}

.empty-state-subtitle {
  font-size: 14px;
  color: var(--gm-text-light);
}

/* ==========================================================================
   6. EMAIL DETAIL VIEW
   ========================================================================== */
.email-detail-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--gm-surface);
  overflow-y: auto;
  position: relative;
  z-index: 20;
}

.detail-top-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--gm-divider);
  background: var(--gm-surface);
  position: sticky;
  top: 0;
  z-index: 5;
}

.detail-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.email-detail-sheet {
  padding: 24px 32px 60px 32px;
  max-width: 960px;
}

.detail-subject-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.detail-subject {
  font-size: 22px;
  font-weight: 400;
  color: var(--gm-text-main);
  line-height: 1.3;
}

.detail-sender-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.sender-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #ea4335;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  flex-shrink: 0;
}

.sender-meta {
  flex: 1;
}

.sender-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.sender-name {
  font-weight: 700;
  color: var(--gm-text-main);
}

.sender-email {
  color: var(--gm-text-light);
  font-size: 12px;
}

.sender-to-line {
  font-size: 12px;
  color: var(--gm-text-light);
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
}

.details-dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gm-text-subtle);
  display: inline-flex;
  align-items: center;
}

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

.detail-date {
  font-size: 12px;
  color: var(--gm-text-light);
}

/* Email Body Content */
.detail-body {
  font-size: 14px;
  line-height: 1.6;
  color: #2c2c2c;
  padding: 10px 0 30px 0;
  user-select: text;
}

.detail-body p {
  margin-bottom: 14px;
}

.detail-body a {
  color: var(--gm-primary);
  text-decoration: underline;
}

.detail-body .security-alert-box {
  background: #fef7e0;
  border-left: 4px solid #f9ab00;
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
}

.detail-body .btn-cta-blue {
  display: inline-block;
  background-color: #1a73e8;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 6px;
  margin: 12px 0;
}

/* Authentic Borderless Gmail Thread Layout (Pixel-matched to official screenshot) */
.gmail-thread-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 12px;
}

.thread-message-item {
  display: flex;
  flex-direction: column;
  position: relative;
}

.thread-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.thread-item-header-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.thread-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.thread-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thread-sender-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-sender-line {
  font-size: 14px;
}

.thread-sender-name {
  font-weight: 700;
  color: #1f1f1f;
}

.thread-sender-email {
  font-size: 12px;
  color: #5e5e5e;
  margin-left: 4px;
}

.thread-to-line {
  font-size: 12px;
  color: #5e5e5e;
  display: flex;
  align-items: center;
  gap: 2px;
}

.thread-item-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #5e5e5e;
}

.thread-date {
  font-size: 12px;
  color: #5e5e5e;
  margin-right: 8px;
  white-space: nowrap;
}

.thread-item-body {
  padding-left: 56px;
  font-size: 14px;
  line-height: 1.7;
  color: #1f1f1f;
  font-family: Arial, Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.thread-item-body p {
  margin: 0 0 14px 0;
}

.thread-quote-attribution {
  color: #5e5e5e;
  font-size: 13px;
  margin-top: 20px;
  margin-bottom: 6px;
}

.thread-quote-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e0e2e0;
  color: #444746;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  height: 16px;
  margin-top: 4px;
}

.thread-quote-dots:hover {
  background: #d3d5d3;
}

/* Modern Action Buttons at the bottom of thread */
.bottom-reply-bar {
  padding-left: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

.pill-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #747775;
  border-radius: 20px;
  padding: 8px 24px;
  background: #ffffff;
  color: #1f1f1f;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pill-action-btn:hover {
  background: #f1f3f4;
  border-color: #444746;
}

.pill-action-btn .material-symbols-outlined {
  font-size: 18px;
  color: #444746;
}
.detail-attachments {
  margin-top: 24px;
  border-top: 1px solid var(--gm-divider);
  padding-top: 16px;
}

.attachments-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gm-text-muted);
  margin-bottom: 12px;
}

.attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--gm-border);
  border-radius: 8px;
  padding: 10px 14px;
  background: #f8fafd;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  min-width: 220px;
}

.attachment-card:hover {
  background: #ffffff;
  border-color: #1a73e8;
  box-shadow: var(--gm-shadow-1);
}

.attachment-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #e8f0fe;
  color: #1a73e8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attachment-meta {
  flex: 1;
}

.attachment-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--gm-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.attachment-size {
  font-size: 11px;
  color: var(--gm-text-light);
}

/* Quick reply section */
.quick-reply-box {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quick-reply-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reply-chip {
  background: #ffffff;
  border: 1px solid var(--gm-border);
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--gm-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.reply-chip:hover {
  background: #f1f3f4;
  color: var(--gm-text-main);
  border-color: #dadce0;
}

.quick-reply-actions {
  display: flex;
  gap: 12px;
}

.reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--gm-border);
  border-radius: 20px;
  padding: 8px 20px;
  background: #fff;
  color: var(--gm-text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.reply-btn:hover {
  background: #f1f3f4;
  color: var(--gm-text-main);
}

.reply-btn.primary {
  border-color: #dadce0;
}

/* ==========================================================================
   7. RIGHT WORKSPACE SIDEBAR
   ========================================================================== */
.workspace-sidebar {
  width: var(--workspace-bar-width);
  min-width: var(--workspace-bar-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 16px;
  background-color: var(--gm-bg-page);
}

.workspace-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--gm-text-muted);
}

.workspace-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

.workspace-divider {
  width: 20px;
  height: 1px;
  background-color: var(--gm-divider);
}

/* ==========================================================================
   8. COMPOSE MODAL WINDOW
   ========================================================================== */
.compose-modal {
  position: fixed;
  bottom: 0;
  right: 80px;
  width: 540px;
  height: 500px;
  background-color: #ffffff;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  box-shadow: var(--gm-shadow-compose);
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
  animation: slideUpCompose 0.2s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes slideUpCompose {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.compose-modal.minimized {
  height: 44px;
  width: 260px;
}

.compose-modal.minimized .compose-body {
  display: none;
}

.compose-modal.fullscreen {
  top: 40px;
  bottom: 40px;
  left: calc(50% - 450px);
  width: 900px;
  height: calc(100vh - 80px);
  border-radius: 12px;
}

.compose-header {
  height: 44px;
  background-color: #f2f6fc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  cursor: pointer;
}

.compose-header-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--gm-text-main);
}

.compose-header-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.compose-header-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--gm-text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.compose-header-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--gm-text-main);
}

.compose-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 16px 12px 16px;
}

.compose-field {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--gm-border-subtle);
  padding: 6px 0;
  gap: 8px;
  font-size: 14px;
}

.compose-field-label {
  color: var(--gm-text-light);
  font-size: 14px;
  width: 44px;
}

.compose-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--gm-text-main);
  background: transparent;
}

.compose-subject-input {
  font-weight: 500;
}

.compose-field-actions {
  display: flex;
  gap: 8px;
}

.compose-field-action-btn {
  color: var(--gm-text-light);
  font-size: 13px;
  cursor: pointer;
}

.compose-field-action-btn:hover {
  color: var(--gm-text-main);
  text-decoration: underline;
}

.compose-editor-area {
  flex: 1;
  padding: 8px 0;
  display: flex;
}

.compose-textarea {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gm-text-main);
}

.compose-attached-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--gm-border-subtle);
}

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

.send-btn-group {
  display: flex;
  align-items: center;
  background-color: var(--gm-primary);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--gm-shadow-1);
}

.btn-send-main {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px 8px 20px;
  cursor: pointer;
}

.btn-send-main:hover {
  background-color: var(--gm-primary-hover);
}

.btn-send-options {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 8px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-send-options:hover {
  background-color: var(--gm-primary-hover);
}

.compose-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ==========================================================================
   9. POPUPS & TOASTS
   ========================================================================== */
.gmail-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background-color: #323232;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--gm-shadow-2);
  z-index: 500;
  font-size: 14px;
  animation: fadeInToast 0.2s ease;
}

@keyframes fadeInToast {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-action {
  background: transparent;
  border: none;
  color: #a8c7fa;
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
}

.toast-action:hover {
  text-decoration: underline;
}

.toast-close {
  background: transparent;
  border: none;
  color: #c4c7c5;
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* Account Popup Menu */
.account-popup-menu {
  position: absolute;
  top: 60px;
  right: 16px;
  width: 360px;
  background: #e9eef6;
  border-radius: 28px;
  padding: 16px;
  box-shadow: var(--gm-shadow-dropdown);
  z-index: 400;
  display: flex;
  flex-direction: column;
}

.account-popup-header {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.account-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: #1a73e8;
  color: #fff;
  font-size: 28px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.account-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-fullname {
  font-size: 16px;
  font-weight: 500;
  color: var(--gm-text-main);
}

.account-email {
  font-size: 13px;
  color: var(--gm-text-light);
  margin-bottom: 16px;
}

.manage-account-btn {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--gm-border);
  border-radius: 20px;
  color: var(--gm-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: background 0.15s;
}

.manage-account-btn:hover {
  background: #f1f3f4;
}

.account-popup-divider {
  height: 8px;
}

.account-item-other {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 8px;
}

.account-item-other:hover {
  background: #f1f3f4;
}

.account-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #8430ce;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.account-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--gm-text-main);
}

.account-item-email {
  font-size: 12px;
  color: var(--gm-text-light);
}

.account-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--gm-text-muted);
  cursor: pointer;
  transition: background 0.15s;
}

.account-action-row:hover {
  background: #f8f9fa;
  color: var(--gm-text-main);
}

.account-popup-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--gm-text-light);
}

.account-popup-footer a {
  color: var(--gm-text-light);
  text-decoration: none;
}

.account-popup-footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   10. SCROLLBARS & RESPONSIVE TWEAKS
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   11. MOBILE & TABLET RESPONSIVE SYSTEM
   ========================================================================== */
@media (max-width: 900px) {
  :root {
    --header-height: 56px;
    --sidebar-width: 280px;
  }

  /* Hide Desktop App Rail & Workspace Add-ons on Mobile */
  .app-rail-nav,
  .workspace-sidebar,
  .status-indicator-pill,
  #btn-support,
  #btn-settings,
  #btn-apps,
  .toolbar-v-divider,
  .keyboard-layout-picker {
    display: none !important;
  }

  /* Mobile Header with Full-width Search */
  .gmail-header {
    padding: 0 8px;
    gap: 8px;
  }

  .header-left {
    min-width: auto;
    gap: 4px;
  }

  .gmail-logo-text {
    display: none;
  }

  .header-center {
    flex: 1;
    max-width: 100%;
  }

  .search-box-container {
    height: 40px;
    padding: 0 8px;
  }

  .search-input {
    font-size: 14px;
    padding: 0 6px;
  }

  .header-right {
    gap: 4px;
  }

  /* Mobile Drawer Sidebar (Hidden by default, slides out on menu click) */
  .gmail-sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 500;
    background: #ffffff;
    box-shadow: var(--gm-shadow-3);
    padding: 16px 12px;
    transition: left 0.25s cubic-bezier(0, 0, 0.2, 1);
  }

  .gmail-sidebar.open {
    left: 0;
  }

  /* Mobile Backdrop */
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 450;
    display: none;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  /* Main Content View on Mobile */
  .gmail-content {
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: none;
  }

  /* Mobile Tabs (Horizontal Scrollable) */
  .inbox-tabs {
    overflow-x: auto;
    height: 44px;
    min-height: 44px;
    scrollbar-width: none;
  }

  .inbox-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    min-width: 130px;
    padding: 0 12px;
    font-size: 13px;
  }

  /* Mobile Email Row (Authentic Gmail Mobile / App Layout) */
  .email-row {
    display: flex !important;
    flex-direction: row !important;
    height: auto !important;
    min-height: 72px;
    padding: 10px 12px !important;
    border-bottom: 1px solid #f0f1f1 !important;
    align-items: flex-start !important;
    position: relative;
    box-sizing: border-box;
  }

  .row-controls {
    margin-right: 8px !important;
    gap: 4px !important;
    align-items: center;
    padding-top: 2px;
  }

  .btn-important {
    display: none !important;
  }

  .email-sender-col {
    display: none !important;
  }

  .email-date-col {
    position: absolute;
    right: 12px;
    top: 10px;
    font-size: 11px;
    color: #5f6368;
    font-weight: 400;
  }

  .email-row.unread .email-date-col {
    font-weight: 700;
    color: #1a73e8;
  }
  .email-content-col {
    flex: 1;
    min-width: 0;
    padding-right: 60px !important; /* Space for date */
    padding-left: 0 !important;
    white-space: normal !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px;
  }

  .email-mobile-sender {
    font-size: 14px;
    font-weight: 700;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .email-row:not(.unread) .email-mobile-sender {
    font-weight: 500;
    color: #444746;
  }

  .email-subject {
    font-size: 13px;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .email-snippet-separator {
    display: none !important;
  }

  .email-snippet {
    font-size: 12px;
    color: #5f6368;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .row-hover-actions {
    display: none !important;
  }

  .email-row:hover {
    box-shadow: none !important;
  }
  /* Mobile Email Detail View */
  .email-detail-sheet {
    padding: 14px 12px 40px 12px;
  }

  .detail-subject-row {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }

  .detail-subject {
    font-size: 17px;
    line-height: 1.35;
  }

  .thread-item-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    margin-bottom: 8px;
  }

  .thread-item-header-left {
    flex: 1;
    min-width: 0;
    gap: 10px;
    align-items: flex-start;
  }

  .thread-avatar-circle {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .thread-sender-meta {
    flex: 1;
    min-width: 0;
    padding-right: 4px;
  }

  .thread-sender-line {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .thread-sender-name {
    font-size: 13.5px;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
  }

  .thread-sender-email {
    margin-left: 0;
    font-size: 11px;
    color: #5e5e5e;
    word-break: break-all;
  }

  .thread-to-line {
    font-size: 11px;
    color: #5e5e5e;
    margin-top: 2px;
    word-break: break-all;
  }

  .thread-item-header-right {
    position: static;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    padding-top: 2px;
  }

  .thread-date {
    font-size: 11px;
    margin-right: 2px;
    color: #5e5e5e;
  }

  .thread-item-header-right .icon-btn-micro {
    width: 22px;
    height: 22px;
  }
  .thread-item-body {
    padding-left: 0;
    margin-top: 10px;
    font-size: 13.5px;
    line-height: 1.65;
  }
  .bottom-reply-bar {
    padding-left: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .pill-action-btn {
    justify-content: center;
  }

  /* Mobile Compose Modal (Full Screen) */
  .compose-modal {
    inset: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}

/* ==========================================================================
   12. GOOGLE AUTH PASSWORD GATE
   ========================================================================== */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  background: #f0f4f9;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(8px);
}

.auth-gate-overlay.hidden {
  display: none !important;
}

.auth-gate-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 40px 36px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
}

.auth-logo {
  margin-bottom: 16px;
}

.auth-title {
  font-size: 24px;
  font-weight: 500;
  color: #1f1f1f;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: #444746;
  margin-bottom: 28px;
  line-height: 1.5;
}

#auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-password-input {
  width: 100%;
  height: 52px;
  border: 1px solid #747775;
  border-radius: 12px;
  padding: 0 48px 0 16px;
  font-size: 16px;
  font-family: inherit;
  color: #1f1f1f;
  background: #ffffff;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-password-input:focus {
  border-color: #0b57d0;
  box-shadow: 0 0 0 2px rgba(11, 87, 208, 0.2);
}

.auth-toggle-pwd {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #747775;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.auth-error-msg {
  color: #b3261e;
  font-size: 13px;
  text-align: left;
  margin-top: -8px;
}

.auth-submit-btn {
  height: 48px;
  background: #0b57d0;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 8px;
}

.auth-submit-btn:hover {
  background: #0842a0;
}

.auth-submit-btn:active {
  transform: scale(0.98);
}

.auth-card-footer {
  margin-top: 24px;
  font-size: 12px;
  color: #747775;
}
