/* PMail — original webmail design */

.pmail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.pmail-brand--lg {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.pmail-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pmail-brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}

.pmail-icon {
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

.pmail-brand--lg .pmail-icon { height: 36px; filter: none; }

.pmail-byline {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #80868b;
}

.pmail-brand--lg .pmail-byline { font-size: 12px; }

.pmail-wordmark {
  font-family: var(--font-brand);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  color: #3c4043;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.pmail-brand--lg .pmail-wordmark {
  font-size: 26px;
  letter-spacing: -0.015em;
}

:root {
  --bg: #f3f1ff;
  --bg-accent: #ebe8ff;
  --surface: #ffffff;
  --surface-2: #faf9ff;
  --border: #e4e0f5;
  --border-light: #ede9fe;
  --text: #1a1625;
  --text-2: #5c5670;
  --text-3: #8b849e;
  --brand: #6366F1;
  --brand-2: #7C3AED;
  --brand-3: #EC4899;
  --brand-cyan: #06B6D4;
  --brand-hover: #4f46e5;
  --brand-soft: #ede9fe;
  --brand-soft-2: #e0e7ff;
  --red: #e11d48;
  --star: #f59e0b;
  --sidebar-collapsed: 68px;
  --sidebar-w: 252px;
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-ui: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-brand: Roboto, 'Google Sans', 'Product Sans', 'Helvetica Neue', Arial, sans-serif;
  --radius-lg: 20px;
  --skeleton-base: #ebe8f8;
  --skeleton-shine: #f8f7ff;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 2px 12px rgba(26, 22, 37, 0.04);
  --shadow-card: 0 1px 2px rgba(26, 22, 37, 0.04);
  --shadow-compose: 0 8px 32px rgba(26, 22, 37, 0.1);
  --shadow-popup: 0 12px 40px rgba(26, 22, 37, 0.12);
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }
.hidden { display: none !important; }

/* Session restore: show app shell before JS finishes validating token */
html.session-restore #login-view {
  display: none !important;
}
html.session-restore #app-view {
  display: flex !important;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #323232;
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: .25s;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 90%, rgba(236, 72, 153, 0.12), transparent 50%),
    var(--bg);
}

.login-card {
  position: relative;
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 36px 36px;
  box-shadow: var(--shadow-card);
}

.login-card h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}

.login-sub {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 28px;
}

.mail-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 15px;
  margin-bottom: 14px;
  color: var(--text);
  background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s;
}

.mail-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: var(--surface);
}

.btn-primary {
  width: 100%;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: transform .15s, box-shadow .15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.login-download-app {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.login-download-app svg { width: 18px; height: 18px; color: var(--brand); }
.login-download-app:hover {
  background: var(--brand-soft);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--brand);
}

.login-error {
  margin-top: 16px;
  font-size: 13px;
  color: var(--red);
  text-align: center;
}

.app-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
  position: relative;
}

.mail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px 8px 4px;
  flex-shrink: 0;
  min-height: 64px;
  background: var(--bg);
}

.mail-header-start {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-left: 4px;
  margin-right: 8px;
}

.header-brand {
  gap: 8px;
  flex-shrink: 0;
}

.header-brand .pmail-icon {
  height: 26px;
  filter: none;
}

.header-brand .pmail-wordmark {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
}

.header-brand .pmail-byline {
  font-size: 9px;
  letter-spacing: 0.05em;
}

@media (max-width: 720px) {
  .header-brand .pmail-byline { display: none; }
}

.mail-search {
  flex: 1;
  max-width: 720px;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 44px;
  box-shadow: var(--shadow-soft);
  transition: border-color .15s, box-shadow .15s;
}

.mail-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.mail-search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}

.mail-search input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  min-width: 0;
  color: var(--text);
}

.mail-search input:focus { outline: none; }
.mail-search input::placeholder { color: var(--text-3); }

.mail-header-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 4px;
}

.mail-download-app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: transform .15s, box-shadow .15s;
}
.mail-download-app svg { width: 18px; height: 18px; }
.mail-download-app:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
  color: #fff;
}
@media (max-width: 900px) {
  .mail-download-app-label { display: none; }
  .mail-download-app { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }
}

.mail-icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s, color .15s;
}

.mail-icon-btn svg { width: 20px; height: 20px; }
.mail-icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.mail-icon-btn--danger:hover { background: #fff1f2; color: var(--red); }
#btn-star.starred { color: var(--star); }
#btn-star.starred svg { fill: var(--star); stroke: var(--star); }
.mail-icon-btn.light { color: #fff; }
.mail-icon-btn.light:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }

.mail-avatar {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

.login-cancel-add {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.login-cancel-add:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.login-view--overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 90%, rgba(236, 72, 153, 0.12), transparent 50%),
    rgba(243, 241, 255, 0.94);
  backdrop-filter: blur(6px);
}

.login-view--overlay .login-card {
  position: relative;
}

/* Account switcher (Gmail-style) */
.account-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 60px 12px 16px;
  pointer-events: none;
}

.account-panel:not(.hidden) {
  pointer-events: auto;
}

.account-panel-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.account-panel-card {
  position: relative;
  width: min(400px, calc(100vw - 24px));
  max-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  background: #f1f3f4;
  border-radius: 28px;
  box-shadow: 0 4px 24px rgba(26, 22, 37, 0.14), 0 12px 48px rgba(26, 22, 37, 0.1);
  overflow: hidden;
  pointer-events: auto;
}

.account-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  min-height: 48px;
}

.account-panel-head-email {
  font-size: 13px;
  color: #3c4043;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-panel-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.account-panel-close:hover {
  background: rgba(60, 64, 67, 0.08);
}

.account-panel-close svg { width: 20px; height: 20px; }

.account-panel-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 24px 20px;
  text-align: center;
}

.account-panel-hero-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25);
}

.account-panel-greeting {
  font-family: var(--font-brand);
  font-size: 22px;
  font-weight: 400;
  color: #202124;
  line-height: 1.3;
}

.account-panel-section {
  margin: 0 12px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.account-panel-section.is-collapsed .account-panel-list-wrap {
  display: none;
}

.account-panel-section.is-collapsed .account-panel-toggle i {
  transform: rotate(180deg);
}

.account-panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border: none;
  background: #fff;
  color: #3c4043;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 1px solid #e8eaed;
}

.account-panel-toggle:hover {
  background: #f8f9fa;
}

.account-panel-toggle svg {
  width: 18px;
  height: 18px;
  color: #5f6368;
  transition: transform .15s;
}

.account-panel-list-wrap {
  overflow-y: auto;
  max-height: 240px;
}

.account-panel-list {
  display: flex;
  flex-direction: column;
}

.account-panel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background .12s;
}

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

.account-panel-item.is-active {
  background: #e8f0fe;
}

.account-panel-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.account-panel-item-body {
  flex: 1;
  min-width: 0;
}

.account-panel-item-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #202124;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-panel-item-email {
  display: block;
  font-size: 12px;
  color: #5f6368;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.account-panel-item-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: #5f6368;
  background: #f1f3f4;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.account-panel-actions {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-panel-action {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: #fff;
  color: #3c4043;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}

.account-panel-action:hover {
  background: #e8eaed;
}

.account-panel-action svg {
  width: 20px;
  height: 20px;
  color: #1a73e8;
  flex-shrink: 0;
}

.account-panel-action:last-child svg {
  color: #5f6368;
}

@media (max-width: 480px) {
  .account-panel {
    padding: 56px 8px 8px;
    justify-content: center;
  }

  .account-panel-card {
    width: 100%;
    border-radius: 24px;
  }
}

.mail-body {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: 0 16px 12px 0;
  position: relative;
}

.mail-rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-collapsed);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 40;
  transition: width 0.22s ease, box-shadow 0.22s ease;
}

.mail-rail:hover,
.mail-rail.is-expanded {
  width: var(--sidebar-w);
  align-items: stretch;
  box-shadow: none;
  border-right: 1px solid var(--border);
}

.mail-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  width: 100%;
  padding: 8px 0 10px;
  overflow: hidden;
  background: var(--bg);
  transition: background 0.22s ease;
}

.mail-rail:hover .mail-sidebar,
.mail-rail.is-expanded .mail-sidebar {
  align-items: stretch;
  padding: 8px 8px 10px;
  background: var(--bg);
}

.btn-compose {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 auto 12px;
  padding: 0;
  width: 52px;
  height: 52px;
  min-width: 52px;
  border: none;
  border-radius: 16px;
  background: #c2e7ff;
  color: #001d35;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition: width 0.22s ease, min-width 0.22s ease, padding 0.22s ease, margin 0.22s ease, background 0.15s ease;
}

.mail-rail:hover .btn-compose,
.mail-rail.is-expanded .btn-compose {
  width: calc(100% - 8px);
  min-width: 0;
  height: 56px;
  margin: 0 4px 14px;
  padding: 0 20px;
  justify-content: flex-start;
  border-radius: 16px;
}

.btn-compose svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke-width: 2px;
}

.btn-compose span {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.18s ease, max-width 0.22s ease;
}

.mail-rail:hover .btn-compose span,
.mail-rail.is-expanded .btn-compose span {
  opacity: 1;
  max-width: 140px;
}

.mail-rail:not(:hover):not(.is-expanded) .btn-compose span {
  display: none;
}

.btn-compose:hover {
  box-shadow: none;
  background: #a8daff;
}

.mail-sidebar nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  display: flex;
  justify-content: center;
}

.mail-rail:hover .mail-sidebar nav,
.mail-rail.is-expanded .mail-sidebar nav {
  justify-content: stretch;
}

.folder-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mail-rail:not(:hover):not(.is-expanded) .folder-list {
  width: var(--sidebar-collapsed);
}

.mail-rail:hover .folder-list,
.mail-rail.is-expanded .folder-list {
  width: 100%;
  align-items: stretch;
}

.folder-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  margin: 0 auto 2px;
  flex-shrink: 0;
  transition: width 0.22s ease, height 0.22s ease, padding 0.22s ease, border-radius 0.22s ease, background 0.15s, margin 0.22s ease;
}

.mail-rail:not(:hover):not(.is-expanded) .folder-label,
.mail-rail:not(:hover):not(.is-expanded) .folder-count {
  display: none;
}

.mail-rail:not(:hover):not(.is-expanded) .folder-item {
  gap: 0;
}

.mail-rail:hover .folder-item,
.mail-rail.is-expanded .folder-item {
  width: auto;
  height: 32px;
  justify-content: flex-start;
  padding: 0 20px;
  margin: 0 4px 4px;
  border-radius: 0 16px 16px 0;
}

.folder-item svg {
  width: 20px;
  height: 20px;
  color: var(--text-2);
  flex-shrink: 0;
}

.folder-item:hover { background: #e8eaed; color: var(--text); }

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

.mail-rail:hover .folder-item.active,
.mail-rail.is-expanded .folder-item.active {
  background: #d3e3fd;
  box-shadow: inset 3px 0 0 transparent;
}

.folder-item.active svg { color: #001d35; }

.folder-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  transition: opacity 0.18s ease, max-width 0.22s ease;
}

.mail-rail:hover .folder-label,
.mail-rail.is-expanded .folder-label {
  opacity: 1;
  max-width: 160px;
}

.folder-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.18s ease, max-width 0.22s ease;
}

.mail-rail:hover .folder-count,
.mail-rail.is-expanded .folder-count {
  opacity: 1;
  max-width: 48px;
}

.mail-rail:not(:hover):not(.is-expanded) .folder-item.has-count::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d93025;
}

.sidebar-email {
  font-size: 11px;
  color: var(--text-3);
  padding: 12px 8px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  text-align: center;
  opacity: 0;
  max-height: 0;
  transition: opacity 0.18s ease, max-height 0.22s ease;
}

.mail-rail:hover .sidebar-email,
.mail-rail.is-expanded .sidebar-email {
  opacity: 1;
  max-height: 40px;
  padding: 12px 16px 4px;
  text-align: left;
}

.mail-content {
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  margin-left: var(--sidebar-collapsed);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: none;
  transition: margin-left 0.22s ease;
}

/* Burger pin: push mail list so it is not under the menu.
   Hover-only expand stays overlay (no margin change). */
.mail-body:has(.mail-rail.is-expanded) .mail-content {
  margin-left: var(--sidebar-w);
}

.mail-content.reading-open .list-pane { display: none; }
.mail-content.reading-open .read-pane { display: flex; }

/* ── MESSAGE LIST ── */
.list-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.list-chrome {
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 2px 16px 2px 4px;
}

.list-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.list-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}

.list-folder-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.list-head-meta {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 400;
  white-space: nowrap;
}

/* Inbox filter tabs — clean, flat, premium */
.list-tabs {
  display: flex;
  align-items: stretch;
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
}

.list-tabs.hidden { display: none; }

.list-tab {
  position: relative;
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}

.list-tab svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke-width: 1.75;
}

.list-tab:hover {
  background: transparent;
  color: var(--text);
}

.list-tab.active {
  color: var(--brand);
  font-weight: 600;
  background: transparent;
  border-bottom-color: var(--brand);
}

.list-tab.active svg {
  color: var(--brand);
}

.list-filter { /* styled via .list-tab */ }

.mail-icon-btn--sm { width: 34px; height: 34px; }

.msg-check-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 50%;
  transition: background .15s;
}

.msg-check-wrap:hover {
  background: rgba(26, 22, 37, 0.05);
}

.msg-check-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.msg-check-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-3);
  border-radius: 2px;
  background: var(--surface);
  transition: border-color .15s, background .15s;
}

.msg-check-input:checked + .msg-check-box {
  border-color: var(--brand);
  background: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12l5 5L19 7'/%3E%3C/svg%3E");
  background-size: 14px;
  background-position: center;
  background-repeat: no-repeat;
}

.msg-list { flex: 1; overflow-y: auto; }

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 0 16px 0 4px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  min-height: 52px;
  background: var(--surface);
  position: relative;
  transition: background .12s;
}

.msg-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  border-radius: 0 2px 2px 0;
}

.msg-row.unread::before {
  background: linear-gradient(180deg, var(--brand), var(--brand-3));
}

.msg-row:hover { background: var(--surface-2); }
.msg-row.active { background: var(--brand-soft-2); }
.msg-row.checked { background: #f5f3ff; }

.msg-row-star {
  width: 34px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
}

.msg-row-star svg { width: 16px; height: 16px; }
.msg-row-star:hover { color: var(--star); }
.msg-row-star.starred { color: var(--star); }
.msg-row-star.starred svg { fill: var(--star); stroke: var(--star); }

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin: 8px 10px 0 0;
  letter-spacing: 0.02em;
}

.msg-row-body {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
}

.msg-row-top {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 22px;
}

.msg-from {
  flex-shrink: 0;
  width: min(168px, 26%);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  padding-right: 10px;
}

.msg-row.unread .msg-from,
.msg-row.unread .msg-subject { font-weight: 600; color: var(--text); }

.msg-line {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.msg-subject { color: var(--text); font-weight: 500; }
.msg-preview { color: var(--text-3); font-weight: 400; margin-left: 6px; }

.msg-date {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-3);
  padding-left: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.msg-row.unread .msg-date { color: var(--brand); font-weight: 600; }

.msg-row-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.msg-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
}

.msg-attach-chip svg { width: 12px; height: 12px; color: var(--brand); }

.list-empty {
  padding: 72px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}

/* ── Shimmer / skeleton loading (Instagram-style) ── */
@keyframes pmail-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.shimmer-block {
  display: block;
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 0%,
    var(--skeleton-shine) 45%,
    var(--skeleton-base) 90%
  );
  background-size: 200% 100%;
  animation: pmail-shimmer 1.35s ease-in-out infinite;
  border-radius: 8px;
}

.msg-list.is-loading { pointer-events: none; }

.skeleton-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 10px 16px 10px 4px;
  border-bottom: 1px solid var(--border-light);
  min-height: 52px;
}

.skeleton-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  margin: 12px 8px 0 6px;
  flex-shrink: 0;
}

.skeleton-star {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin: 13px 6px 0 0;
  flex-shrink: 0;
}

.skeleton-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  margin: 8px 10px 0 0;
  flex-shrink: 0;
}

.skeleton-body {
  flex: 1;
  min-width: 0;
  padding: 4px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line { height: 12px; border-radius: 6px; }
.skeleton-line--from { width: 38%; height: 13px; }
.skeleton-line--subject { width: 72%; }
.skeleton-line--preview { width: 55%; opacity: 0.85; }

.skeleton-date {
  width: 42px;
  height: 11px;
  border-radius: 5px;
  margin-top: 12px;
  flex-shrink: 0;
}

.read-pane.is-loading .read-toolbar,
.read-pane.is-loading .read-scroll > *:not(.read-body) {
  pointer-events: none;
}

.read-avatar.shimmer-block {
  color: transparent;
  border-radius: 12px;
}

.skeleton-read-title {
  display: block;
  height: 28px;
  width: min(420px, 85%);
  border-radius: 10px;
  margin-bottom: 4px;
}

.skeleton-read-line {
  display: block;
  height: 14px;
  width: 160px;
  margin-top: 6px;
  border-radius: 6px;
}

.skeleton-read-line.short { width: 200px; }

.skeleton-read-date {
  display: block;
  height: 12px;
  width: 120px;
  margin-left: auto;
  border-radius: 6px;
}

.read-body.is-loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.skeleton-read-para {
  display: block;
  height: 14px;
  border-radius: 6px;
}

.skeleton-read-para:nth-child(3n) { width: 92% !important; }
.skeleton-read-para:nth-child(3n + 1) { width: 78% !important; }
.skeleton-read-para:nth-child(3n + 2) { width: 65% !important; }

.list-pane.is-loading .list-head-meta {
  color: transparent;
  position: relative;
  min-width: 72px;
  min-height: 14px;
  display: inline-block;
}

.list-pane.is-loading .list-head-meta::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 0%,
    var(--skeleton-shine) 45%,
    var(--skeleton-base) 90%
  );
  background-size: 200% 100%;
  animation: pmail-shimmer 1.35s ease-in-out infinite;
}

/* ── READ (tam səhifə) ── */
.read-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

.gm-content.reading-open .read-pane {
  display: flex;
}

.read-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 10px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-2);
}

.read-toolbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.read-folder-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  margin-left: 4px;
}

.read-actions { display: flex; gap: 2px; }

.read-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px 40px 56px;
  max-width: 900px;
}

.read-subject {
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 24px;
  line-height: 1.35;
  color: var(--text);
}

.read-meta {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.read-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.read-sender { flex: 1; min-width: 0; }
.read-sender strong { display: block; font-size: 14px; font-weight: 500; }
.read-sender span { font-size: 12px; color: var(--text-2); }
.read-date { font-size: 12px; color: var(--text-2); flex-shrink: 0; }

.read-to {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.read-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}
.read-body p { margin-bottom: 1em; }

.compose-dock {
  position: fixed;
  bottom: 0;
  right: 56px;
  z-index: 200;
  width: min(600px, calc(100vw - 32px));
}

.compose-dock.is-minimized { width: min(320px, calc(100vw - 32px)); }

.compose-dock.is-expanded {
  right: 24px;
  width: min(760px, calc(100vw - 48px));
}

.compose-win {
  position: relative;
  background: #fff;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 10px 1px rgba(60, 64, 67, 0.14), 0 3px 14px 2px rgba(60, 64, 67, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 10px 16px;
  background: #f2f6fc;
  color: #3c4043;
  font-weight: 500;
  font-size: 14px;
  flex-shrink: 0;
  border-radius: 8px 8px 0 0;
}

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

.compose-head-btn {
  width: 32px;
  height: 32px;
  color: #5f6368;
}

.compose-head-btn svg { width: 18px; height: 18px; }
.compose-head-btn:hover { background: rgba(60, 64, 67, 0.08); color: #202124; }

.compose-body-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}

.compose-dock.is-minimized .compose-body-wrap { display: none; }

.compose-fields {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.compose-fields input,
.compose-extra-field {
  width: 100%;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  padding: 12px 16px;
  font: inherit;
  font-size: 14px;
  color: #202124;
  background: #fff;
}

.compose-fields input:focus,
.compose-extra-field:focus { outline: none; }

.compose-recipient-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px solid #f0f0f0;
  padding: 6px 0 6px 16px;
  min-height: 44px;
}

.compose-field-label {
  flex-shrink: 0;
  width: 52px;
  padding-top: 8px;
  font-size: 14px;
  color: #5f6368;
}

.recipient-field {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 0;
}

.recipient-chips {
  display: contents;
}

.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px 4px 4px;
  border: 1px solid #dadce0;
  border-radius: 16px;
  background: #fff;
  font-size: 13px;
  color: #202124;
  line-height: 1.2;
}

.recipient-chip-avatar {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.recipient-chip-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.recipient-chip-remove {
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 2px;
  margin-left: 2px;
  cursor: pointer;
  color: #5f6368;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipient-chip-remove:hover {
  background: rgba(60, 64, 67, 0.08);
  color: #202124;
}

.recipient-chip-remove svg {
  width: 14px;
  height: 14px;
}

.recipient-input {
  flex: 1 1 120px;
  min-width: 80px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: #202124;
  padding: 6px 8px 6px 0;
  outline: none;
}

.compose-recipient-row .compose-cc-bcc {
  padding-top: 8px;
  padding-right: 12px;
}

.compose-cc-bcc {
  display: flex;
  gap: 12px;
  padding-right: 12px;
  flex-shrink: 0;
}

.compose-link-btn {
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: #5f6368;
  cursor: pointer;
  padding: 4px;
}

.compose-link-btn:hover { color: #202124; }

.compose-editor-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.compose-editor {
  flex: 1;
  min-height: 200px;
  max-height: 340px;
  overflow-y: auto;
  padding: 12px 16px 8px;
  font-size: 14px;
  line-height: 1.6;
  color: #202124;
  outline: none;
  border: none;
  resize: none;
  width: 100%;
  font-family: inherit;
  background: #fff;
}

.compose-dock.is-expanded .compose-editor {
  min-height: 280px;
  max-height: 52vh;
}

.compose-editor--plain { display: block; }

.compose-editor ul,
.compose-editor ol { margin: 0.5em 0; padding-left: 1.5em; }

.compose-editor blockquote {
  margin: 0.5em 0;
  padding-left: 12px;
  border-left: 3px solid #dadce0;
  color: #5f6368;
}

.compose-chrome {
  flex-shrink: 0;
  background: #fff;
  position: relative;
}

.compose-format-bar {
  padding: 8px 12px 4px;
  background: #fff;
}

.compose-format-bar.hidden { display: none; }

.format-bar-inner {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 4px 8px;
  background: #f1f3f4;
  border-radius: 24px;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.format-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font: inherit;
  font-size: 13px;
  flex-shrink: 0;
  padding: 0;
}

.format-btn svg { width: 16px; height: 16px; }
.format-btn .format-caret { width: 12px; height: 12px; opacity: 0.7; }
.format-btn:hover,
.format-btn.active { background: rgba(60, 64, 67, 0.12); color: #202124; }

.format-size-btn,
.format-align-btn,
.format-more-btn { width: auto; padding: 0 4px; }

.format-sep {
  width: 1px;
  height: 20px;
  background: #dadce0;
  margin: 0 3px;
  flex-shrink: 0;
}

.format-select {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: #3c4043;
  cursor: pointer;
  padding: 4px 2px;
  max-width: 96px;
}

.format-color {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 4px;
}

.format-color:hover { background: rgba(60, 64, 67, 0.12); }

.format-color input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.format-color-a {
  font-weight: 700;
  font-size: 15px;
  color: #202124;
  border-bottom: 3px solid #222;
  line-height: 1;
}

.compose-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px 12px;
  flex-shrink: 0;
}

.compose-foot-main {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.compose-foot-spacer { flex: 1; }

.compose-send-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  margin-right: 6px;
}

.btn-send-compose {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 20px;
  border: none;
  border-radius: 18px 0 0 18px;
  background: #0b57d0;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-send-compose:hover { background: #0842a0; }

.compose-send-caret {
  width: 32px;
  height: 36px;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0 18px 18px 0;
  background: #0b57d0;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.compose-send-caret svg { width: 16px; height: 16px; }
.compose-send-caret:hover { background: #0842a0; }

.compose-toolbar {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.compose-tool-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.compose-tool-btn svg { width: 20px; height: 20px; }
.compose-tool-btn:hover { background: rgba(60, 64, 67, 0.08); color: #202124; }

.compose-tool-btn.active {
  background: #c2e7ff;
  color: #001d35;
}

.format-aa {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  font-weight: 500;
}

.compose-trash-btn { margin-left: 2px; }

.compose-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 4px;
}

.compose-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 16px;
  background: #f1f3f4;
  color: #202124;
  font-size: 12px;
  max-width: 100%;
}

.compose-attachment button {
  border: none;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.compose-popover {
  position: absolute;
  z-index: 50;
  min-width: 240px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 2px 6px 2px rgba(60, 64, 67, 0.15);
}

.compose-popover.hidden { display: none; }

.compose-popover--format { min-width: 140px; padding: 4px 0; }

.compose-popover--more { min-width: 260px; }

.compose-popover-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: #3c4043;
  text-align: left;
  cursor: pointer;
}

.compose-popover-item svg { width: 18px; height: 18px; color: #5f6368; flex-shrink: 0; }
.compose-popover-item:hover { background: #f1f3f4; }

.compose-popover-sep {
  height: 1px;
  margin: 4px 0;
  background: #e8eaed;
}

.compose-format-extra {
  position: absolute;
  z-index: 35;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.2);
}

.compose-format-extra.hidden { display: none; }

.format-extra-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.format-extra-btn svg { width: 18px; height: 18px; }
.format-extra-btn:hover { background: #f1f3f4; color: #202124; }

.compose-emoji-panel {
  position: absolute;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(60, 64, 67, 0.2);
}

.compose-emoji-panel.hidden { display: none; }

.compose-emoji-panel button {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  border-radius: 4px;
}

.compose-emoji-panel button:hover { background: #f1f3f4; }

.compose-dock.is-plain .compose-format-bar,
.compose-dock.is-plain #compose-format-toggle { pointer-events: none; opacity: 0.45; }

.compose-schedule-backdrop {
  position: absolute;
  inset: 0;
  z-index: 45;
  background: rgba(32, 33, 36, 0.35);
  border-radius: 8px 8px 0 0;
}

.compose-schedule-backdrop.hidden { display: none; }

.compose-schedule-panel {
  position: absolute;
  z-index: 50;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(380px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow-y: auto;
  padding: 0;
  background: #fff;
  border: none;
  border-radius: 28px;
  box-shadow: 0 8px 28px rgba(60, 64, 67, 0.28);
}

.compose-schedule-panel--picker {
  width: min(560px, calc(100% - 24px));
  padding: 0;
}

.compose-schedule-panel.hidden { display: none; }

.schedule-view { padding: 20px 20px 16px; }

.schedule-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.schedule-panel-title {
  font-size: 22px;
  font-weight: 400;
  color: #3c4043;
  line-height: 1.3;
}

.schedule-close-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin: -4px -8px 0 0;
}

.schedule-close-btn svg { width: 20px; height: 20px; }
.schedule-close-btn:hover { background: #f1f3f4; }

.schedule-timezone {
  font-size: 13px;
  color: #5f6368;
  margin-bottom: 16px;
}

.schedule-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.schedule-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 24px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: #3c4043;
}

.schedule-option:hover,
.schedule-option.selected { background: #f1f3f4; }

.schedule-option-label { font-size: 14px; font-weight: 400; }

.schedule-option-time {
  font-size: 13px;
  color: #5f6368;
  white-space: nowrap;
}

.schedule-pick-custom {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 14px;
  margin-top: 4px;
  border: none;
  border-top: 1px solid #e8eaed;
  border-radius: 0 0 28px 28px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: #3c4043;
  cursor: pointer;
  text-align: left;
}

.schedule-pick-custom svg { width: 20px; height: 20px; color: #5f6368; }
.schedule-pick-custom:hover { background: #f8f9fa; }

.schedule-picker-title {
  font-size: 22px;
  font-weight: 400;
  color: #3c4043;
  padding: 20px 24px 12px;
}

.schedule-picker-body {
  display: flex;
  gap: 20px;
  padding: 0 24px 8px;
  align-items: flex-start;
}

.schedule-calendar-wrap { flex: 1; min-width: 0; }

.schedule-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.schedule-cal-month {
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
}

.schedule-cal-nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.schedule-cal-nav-btn svg { width: 18px; height: 18px; }
.schedule-cal-nav-btn:hover { background: #f1f3f4; }

.schedule-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 4px;
}

.schedule-cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: #70757a;
  padding: 4px 0;
}

.schedule-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.schedule-cal-day {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: none;
  border-radius: 50%;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: #3c4043;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.schedule-cal-day:hover { background: #f1f3f4; }

.schedule-cal-day.is-other {
  color: #dadce0;
  cursor: default;
}

.schedule-cal-day.is-other:hover { background: transparent; }

.schedule-cal-day.is-today {
  color: #0b57d0;
  font-weight: 500;
}

.schedule-cal-day.is-selected {
  background: #0b57d0;
  color: #fff;
  font-weight: 500;
}

.schedule-cal-day.is-selected:hover { background: #0b57d0; }

.schedule-datetime-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 148px;
  flex-shrink: 0;
  padding-top: 44px;
}

.schedule-date-input,
.schedule-time-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: #3c4043;
  background: #fff;
  letter-spacing: 0.02em;
}

.schedule-time-input::placeholder { color: #9aa0a6; }

.schedule-time-input:focus,
.schedule-date-input:focus {
  outline: none;
  border-color: #0b57d0;
  border-width: 2px;
  padding: 9px 11px;
}

.schedule-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 20px;
}

.schedule-cancel {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #0b57d0;
  padding: 8px 16px;
  border-radius: 18px;
  cursor: pointer;
}

.schedule-cancel:hover { background: #e8f0fe; }

.schedule-confirm {
  border: none;
  background: #0b57d0;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 24px;
  cursor: pointer;
}

.schedule-confirm:hover { background: #0842a0; }

@media (max-width: 520px) {
  .schedule-picker-body { flex-direction: column; }
  .schedule-datetime-inputs {
    width: 100%;
    padding-top: 0;
    flex-direction: row;
  }
  .schedule-date-input,
  .schedule-time-input { flex: 1; }
}

.compose-popover-item i[data-lucide="clock"] {
  color: #0b57d0;
}

.read-body p { margin-bottom: 1em; }

.read-attachments {
  margin: 8px 0 28px;
}

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

.read-attachments-head svg {
  width: 16px;
  height: 16px;
}

.attachment-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid #e3e8ee;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.06);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}

.attachment-card:hover {
  border-color: #c4b5fd;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.14);
  transform: translateY(-1px);
}

.attachment-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

.attachment-card-icon--pdf { background: linear-gradient(145deg, #ef4444, #dc2626); }
.attachment-card-icon--doc { background: linear-gradient(145deg, #3b82f6, #2563eb); }
.attachment-card-icon--sheet { background: linear-gradient(145deg, #22c55e, #16a34a); }
.attachment-card-icon--slide { background: linear-gradient(145deg, #f97316, #ea580c); }
.attachment-card-icon--image { background: linear-gradient(145deg, #a855f7, #9333ea); }
.attachment-card-icon--archive { background: linear-gradient(145deg, #64748b, #475569); }
.attachment-card-icon--text { background: linear-gradient(145deg, #6b7280, #4b5563); }
.attachment-card-icon--default { background: linear-gradient(145deg, #6366f1, #4f46e5); }

.attachment-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachment-card-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-card-meta {
  font-size: 12px;
  color: var(--text-3);
}

.attachment-card-download {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text-2);
  background: #f1f3f4;
  transition: background .18s, color .18s;
}

.attachment-card:hover .attachment-card-download {
  background: var(--brand-soft);
  color: var(--brand);
}

.attachment-card-download svg {
  width: 16px;
  height: 16px;
}


.btn-text {
  border: none;
  background: none;
  font: inherit;
  color: var(--text-2);
  cursor: pointer;
  padding: 8px;
}

@media (max-width: 1024px) {
  .mail-rail.is-expanded { width: min(var(--sidebar-w), 80vw); }
  .mail-body:has(.mail-rail.is-expanded) .mail-content {
    margin-left: min(var(--sidebar-w), 80vw);
  }
}

@media (max-width: 768px) {
  .msg-from { width: min(100px, 30%); }
  .list-tab span { display: none; }
  .list-tab { min-height: 44px; padding: 8px; }
  .list-folder-label { max-width: 96px; }
  .read-scroll { padding: 20px 20px 40px; }
  .msg-avatar { display: none; }
}

@media (max-width: 600px) {
  .mail-search { display: none; }
}

/* Settings */
.settings-view {
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
}

.settings-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #e8eaed);
}

.settings-title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: var(--text, #202124);
}

.settings-body {
  flex: 1;
  overflow: auto;
  padding: 24px;
  max-width: 720px;
}

.settings-section-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2, #5f6368);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-hint {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-2, #5f6368);
  line-height: 1.5;
}

.settings-section + .settings-section {
  margin-top: 32px;
}

.settings-notify-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.settings-notify-btn {
  width: auto;
  min-width: 200px;
  margin-top: 0;
  padding: 10px 18px;
}

.settings-notify-status {
  margin: 0;
  font-size: 13px;
  color: var(--text-3);
}

.settings-notify-status.is-on {
  color: #0d9488;
}

.settings-notify-status.is-warn {
  color: #b45309;
}

.settings-lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.settings-lang-option:hover {
  background: #f1f3f4;
}

.settings-lang-option.is-selected {
  background: #e8f0fe;
  border-color: #c2d7fc;
}

.settings-lang-option input {
  accent-color: #1a73e8;
}

/* Account settings (Google Account-style) */
.app-view.account-settings-open .mail-header,
.app-view.account-settings-open .mail-body {
  visibility: hidden;
}

.account-panel-manage {
  margin-top: 16px;
  padding: 9px 24px;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #fff;
  color: #1a73e8;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.account-panel-manage:hover {
  background: #f6fafe;
  border-color: #d2e3fc;
}

.account-settings-view {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  background: #f0f4f9;
  color: #202124;
  font-family: var(--font-brand), var(--font);
}

.account-settings-view.hidden {
  display: none;
}

.account-settings-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 8px 16px 8px 8px;
  background: #f0f4f9;
  flex-shrink: 0;
}

.account-settings-topbar-start {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.account-settings-back {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.account-settings-back:hover {
  background: rgba(60, 64, 67, 0.08);
}

.account-settings-back svg { width: 20px; height: 20px; }

.account-settings-brand {
  font-size: 22px;
  font-weight: 400;
  color: #5f6368;
  letter-spacing: 0;
  white-space: nowrap;
}

.account-settings-topbar-end {
  display: flex;
  align-items: center;
  gap: 4px;
}

.account-settings-icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  display: grid;
  place-items: center;
  opacity: 0.45;
}

.account-settings-icon-btn svg { width: 20px; height: 20px; }

.account-settings-avatar-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: default;
  display: grid;
  place-items: center;
  margin-left: 4px;
}

.account-settings-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 0;
  overflow: hidden;
}

.account-settings-nav {
  width: 256px;
  flex-shrink: 0;
  padding: 8px 12px;
  overflow-y: auto;
}

.account-settings-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #202124;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.account-settings-nav-item svg {
  width: 20px;
  height: 20px;
  color: #5f6368;
  flex-shrink: 0;
}

.account-settings-nav-item.is-active {
  background: #d3e3fd;
  color: #041e49;
}

.account-settings-nav-item.is-active svg {
  color: #0b57d0;
}

.account-settings-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 8px 24px 48px;
}

.account-personal-page {
  max-width: 960px;
  margin: 0 auto;
}

.account-personal-title {
  margin: 8px 0 20px;
  font-size: 24px;
  font-weight: 400;
  color: #202124;
}

.account-info-card {
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 16px;
  overflow: hidden;
}

.account-info-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px 20px;
  border-bottom: 1px solid #e8eaed;
}

.account-info-row--last {
  border-bottom: none;
}

.account-info-row--photo {
  min-height: 80px;
}

.account-info-icon {
  width: 24px;
  height: 24px;
  color: #5f6368;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.account-info-icon svg { width: 20px; height: 20px; }

.account-info-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-info-label {
  font-size: 14px;
  font-weight: 500;
  color: #202124;
}

.account-info-value {
  font-size: 14px;
  color: #3c4043;
  line-height: 1.4;
  word-break: break-word;
}

.account-info-value--muted {
  color: #5f6368;
}

.account-info-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.account-settings-footer {
  flex-shrink: 0;
  padding: 16px 24px 20px;
  border-top: 1px solid #e3e8ef;
  background: #f0f4f9;
}

.account-settings-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 12px;
  color: #5f6368;
}

@media (max-width: 900px) {
  .account-settings-nav {
    width: 72px;
    padding: 8px;
  }

  .account-settings-nav-item {
    justify-content: center;
    padding: 12px;
    border-radius: 16px;
  }

  .account-settings-nav-item span {
    display: none;
  }
}

@media (max-width: 600px) {
  .account-settings-nav {
    display: none;
  }

  .account-personal-title {
    font-size: 20px;
  }

  .account-info-row {
    padding: 12px 16px;
    gap: 12px;
  }
}
