:root {
  --bg: #f9fbfd;
  --text: #1f1f1f;
  --muted: #5e5e5e;
  --icon: #444746;
  --line: #e1e3e1;
  --active: #d3e3fd;
  --blue: #0b57d0;
  --blue-deep: #0842a0;
  --compose: #c2e7ff;
  --selected: #c2e7ff;
  --danger: #b3261e;
  --star: #f4b400;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px 2px rgba(0,0,0,.15);
  font-family: Roboto, Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  user-select: none;
}
.material-symbols-outlined.fill { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

.icon-btn, .rail-btn, .avatar-btn {
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--icon);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover, .rail-btn:hover, .avatar-btn:hover { background: rgba(68,71,70,.08); }
.tip {
  position: fixed; z-index: 80; pointer-events: none; white-space: nowrap;
  background: #3c4043; color: #fff; font-size: 12px; font-weight: 500; line-height: 16px;
  padding: 4px 8px; border-radius: 4px;
}

.topbar {
  height: 64px; display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #5f6368; min-width: 180px; padding-left: 4px; }
.logo span { font-size: 22px; letter-spacing: .2px; }
.search {
  flex: 1; max-width: 720px; height: 46px; margin: 0 0 0 14px; background: #e9eef6;
  border-radius: 24px; display: flex; align-items: center; padding: 0 6px 0 12px; gap: 8px;
}
.search:focus-within, .search.search-open {
  background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.24); position: relative; z-index: 61;
}
.search.search-open { border-radius: 8px 8px 0 0; box-shadow: 0 1px 2px rgba(60,64,67,.3); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; height: 100%; min-width: 0; }
.search input::-webkit-search-cancel-button,
.search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.search-clear {
  width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent;
  color: var(--icon); display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0;
}
.search-clear:hover { background: rgba(68,71,70,.08); }
.search-chip {
  display: inline-flex; align-items: center; gap: 2px; max-width: 280px; height: 28px;
  padding: 0 2px 0 10px; border-radius: 14px; background: #d3e3fd; color: #041e49;
  font-size: 14px; flex: none;
}
.search-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-chip button {
  width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent;
  color: #041e49; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none;
}
.search-chip button:hover { background: rgba(11, 87, 208, .12); }
.search-chip .material-symbols-outlined { font-size: 16px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.avatar-btn { width: 32px; height: 32px; color: #fff; font-weight: 500; margin-left: 4px; overflow: hidden; padding: 0; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

.workspace { height: calc(100vh - 64px); display: flex; min-height: 0; }
.sidebar { width: 256px; flex: none; padding-top: 8px; overflow: auto; }
.stage {
  flex: 1; min-width: 0; background: #fff; border-radius: 16px;
  margin: 0 8px 12px 0; display: flex; flex-direction: column; overflow: hidden;
}
.rail { width: 56px; display: flex; flex-direction: column; align-items: center; padding-top: 4px; gap: 4px; }

.compose-btn {
  margin: 0 16px 16px 8px; height: 50px; border: 0; border-radius: 15px;
  background: var(--compose); color: #001d35; padding: 0 22px 0 16px;
  display: inline-flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.compose-btn:hover { box-shadow: var(--shadow); background: #b6daf8; }
.nav-item, .more-btn {
  width: calc(100% - 16px); height: 32px; border: 0; background: transparent;
  border-radius: 0 16px 16px 0; display: flex; align-items: center; gap: 12px;
  padding: 0 12px 0 26px; color: var(--text); text-align: left;
}
.nav-item:hover, .more-btn:hover,
.nav-row:hover .nav-item, .nav-row.menu-open .nav-item { background: rgba(32,33,36,.06); }
.nav-item.active, .nav-row:hover .nav-item.active, .nav-row.menu-open .nav-item.active { background: var(--active); font-weight: 700; }
.nav-item.has-unread { font-weight: 700; }
.nav-item .badge { margin-left: auto; font-size: 13px; font-weight: 700; }
.nav-row:hover:has(.nav-manage) .badge,
.nav-row:focus-within:has(.nav-manage) .badge,
.nav-row.menu-open .badge { visibility: hidden; }
.nav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-row { position: relative; }
.nav-manage {
  display: none; position: absolute; right: 18px; top: 2px; width: 28px; height: 28px;
  padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--icon);
  align-items: center; justify-content: center; z-index: 1;
}
.nav-row:hover .nav-manage, .nav-row:focus-within .nav-manage, .nav-row.menu-open .nav-manage { display: inline-flex; }
.nav-manage:hover { background: #e8eaed; }
.nav-row:hover:has(.nav-item.active) .nav-manage,
.nav-row:focus-within:has(.nav-item.active) .nav-manage,
.nav-row.menu-open:has(.nav-item.active) .nav-manage { background: #e8f0fe; }
.nav-row:hover:has(.nav-item.active) .nav-manage:hover,
.nav-row:focus-within:has(.nav-item.active) .nav-manage:hover,
.nav-row.menu-open:has(.nav-item.active) .nav-manage:hover { background: #d3e3fd; }
.nav-row:hover:has(.nav-manage) .nav-item,
.nav-row:focus-within:has(.nav-manage) .nav-item,
.nav-row.menu-open .nav-item { padding-right: 36px; }
.nav-section { color: #444746; font-weight: 500; padding: 14px 26px 6px; }
.trash-note {
  padding: 14px 24px; text-align: center; color: #444746; background: #f8fafd;
  border-bottom: 1px solid rgba(100, 121, 143, 0.12);
}
.cr-folder { margin-top: 8px;}
.trash-note button { border: 0; background: none; color: var(--blue); font: inherit; cursor: pointer; padding: 0; }
.trash-note button:hover { text-decoration: underline; }
.more-btn { color: var(--text); font-weight: 500; margin-top: 8px;}
.nav-more { display: none; }
.nav-more.open { display: block; }
.label-mark { width: 20px; height: 20px; flex: none; display: block; }
.label-mark path { fill: currentColor; }
.nav-add {
  display: none; width: 56px; height: 40px; margin: 0; padding: 0; border: 0;
  border-radius: 20px; background: transparent; color: #202124;
  align-items: center; justify-content: center;
}
.nav-add:hover { background: rgba(32,33,36,.06); }

.progress { height: 3px; overflow: hidden; background: #e8f0fe; }
.progress span { display: block; height: 100%; width: 40%; background: var(--blue); animation: slide 1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }

.toolbar { height: 48px; display: flex; align-items: center; padding: 0 8px; gap: 2px; flex: none; }
.select-box { display: inline-flex; align-items: center; height: 40px; margin-left: 4px;}
.select-caret {
  width: 20px; height: 32px; padding: 0; border: 0; background: transparent; color: var(--icon);
  border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
}
.select-caret .material-symbols-outlined { font-size: 20px; }
.select-caret:hover { background: rgba(68,71,70,.08); }
.menu-check { width: 20px; height: 20px; flex: none; }
.toolbar .spacer { flex: 1; }
.page-label { color: var(--muted); font-size: 12px; margin-right: 8px; }
.check { width: 14px; height: 14px; accent-color: var(--blue); }
.mail-tabs { display: flex; flex: none; align-items: stretch; height: 56px; gap: 8px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.mail-tab {
  flex: 0 0 auto; min-width: 180px; height: 100%; border: 0; border-bottom: 3px solid transparent;
  background: transparent; color: #444746; display: inline-flex; align-items: center;
  gap: 12px; padding: 0 20px; font-size: 14px; font-weight: 500;
}
.mail-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-tab:hover { background: rgba(32,33,36,.04); }
.mail-tab.on { color: var(--blue); border-bottom-color: var(--blue); }
.mail-tab .material-symbols-outlined { font-size: 20px; }

.list { overflow: auto; flex: 1; }
.row {
  display: grid; grid-template-columns: 28px 28px minmax(120px, 200px) minmax(0, 1fr) auto;
  align-items: center; height: 40px; padding: 0 8px 0 12px; position: relative; background: #f2f6fc;
  border-bottom: 1px solid rgba(100, 121, 143, 0.12);
}
.row:hover { box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); z-index: 1; }
.nav-item.drop-target, .mail-tab.drop-target { background: #d3e3fd; outline: 2px solid var(--blue); outline-offset: -2px; }
body.dragging-mail, body.dragging-mail .row { cursor: grabbing; user-select: none; }
.drag-ghost {
  position: fixed; z-index: 90; pointer-events: none; max-width: 280px;
  padding: 8px 12px; background: #fff; color: #1f1f1f; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(60,64,67,.28); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row.unread { background: #fff; }
.row.unread .sender, .row.unread .subject, .row.unread .date-label { font-weight: 700; color: #1f1f1f; }
.row.checked { background: var(--selected); }
.row.cursor { outline: 1px solid #d3e3fd; }
.sender, .subject-wrap { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.sender { padding-right: 30px; }
.snippet { color: var(--muted); font-weight: 400; }
.draft-tag { color: #d93025; font-weight: 700; margin-right: 6px; }
.date-cell { display: flex; align-items: center; justify-content: flex-end; min-width: 88px; gap: 2px; }
.date-label { color: var(--muted); font-size: 12px; }
.row.snoozed .date-cell { min-width: 148px; padding-left: 36px; }
.row.snoozed .date-label,
.row.unread.snoozed .date-label { color: #d93025; font-weight: 500; }
.row-actions { display: none; }
.row:hover .row-actions { display: flex; }
.row:hover .date-label { display: none; }
.star { border: 0; background: transparent; color: #c4c7c5; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.star.on { color: var(--star); }
.clip { color: #5f6368; font-size: 18px; vertical-align: middle; }

.reader { overflow: auto; flex: 1; }
.reader-subject { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 400; padding: 12px 16px 4px 56px; }
.msg { padding: 8px 16px 12px; }
.msg.collapsed { display: flex; align-items: center; gap: 12px; height: 56px; cursor: pointer; border-top: 1px solid #f1f3f4; }
.msg.collapsed .snippet { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.collapsed:hover { background: #f6f8fc; }
.msg-head { display: flex; gap: 12px; align-items: flex-start; }
.msg-line { display: flex; align-items: center; gap: 12px; min-height: 28px; }
.who { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msg-tools { display: flex; align-items: center; flex: none; }
.msg-tools .date-label { margin-right: 4px; line-height: 28px; }
.msg-tools .icon-btn, .msg-tools .star { width: 32px; height: 32px; }
.avatar, .avatar-lg {
  width: 40px; height: 40px; border-radius: 50%; color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 500; flex: none; text-transform: uppercase;
}
.avatar-lg { width: 72px; height: 72px; font-size: 28px; }
.msg-meta { flex: 1; min-width: 0; }
.msg-meta .name { font-weight: 700; }
.msg-meta .addr { color: var(--muted); font-weight: 400; }
.to-line { color: var(--muted); font-size: 12px; background: none; border: 0; padding: 0; }
.details {
  margin-top: 8px; background: #f6f8fc; border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #3c4043;
}
.details div { display: grid; grid-template-columns: 70px 1fr; gap: 8px; margin: 2px 0; }
.msg-body { margin: 12px 0 0 52px; }
.msg-body iframe { width: 100%; height: 0; border: 0; display: block; }
.attach-block { margin: 16px 0 4px 52px; padding-top: 10px; border-top: 1px dotted #dadce0; }
.attach-block.pending { display: none; }
.attach-head { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.attach-label { font-size: 14px; color: #202124; }
.attach-all { width: 32px; height: 32px; color: #5f6368; }
.attach-all:disabled { opacity: 0.45; }
.attach-all .material-symbols-outlined { font-size: 20px; }
.attach-label strong { font-weight: 700; }
.attach-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.attach-wrap { position: relative; width: 176px; height: 124px; flex: none; }
.attach {
  --att-fold: #4986e7;
  --att-fold-shade: #c9c9c9;
  --att-fold-size: 20px;
  position: relative; width: 100%; height: 100%; border: 1px solid #dadce0;
  background: #fff; color: inherit; font: inherit; text-align: left; padding: 0;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--att-fold-size)),
    calc(100% - var(--att-fold-size)) 100%,
    0 100%
  );
}
.attach:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.attach-sheet { position: absolute; inset: 0; pointer-events: none; }
.attach img, .attach .pdf-thumb {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block;
  object-fit: cover; background: #f8f9fa; pointer-events: none;
}
.attach-page {
  position: absolute; z-index: 1; left: 0; right: 0; top: 4px; bottom: 36px;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.attach-page svg { width: 36px; height: 44px; display: block; }
.attach-foot {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 36px;
  display: flex; align-items: center; gap: 8px; padding: 0 40px 0 10px;
  background: #f1f3f4; border-top: 1px solid #dadce0;
}
.attach-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; color: #202124; }
.type-badge {
  flex: none; height: 16px; min-width: 16px; padding: 0 3px; border-radius: 2px;
  font-size: 8px; font-weight: 700; letter-spacing: 0; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.type-ico { flex: none; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; color: #5f6368; }
.type-ico .material-symbols-outlined { font-size: 18px; }
.attach-fold {
  position: absolute; z-index: 8; right: -1px; bottom: -1px; display: block;
  width: calc(var(--att-fold-size) * 2); height: var(--att-fold-size); pointer-events: none;
}
.att-fold-shade { fill: var(--att-fold-shade); }
.att-fold-front { fill: var(--att-fold); }
.attach-hover {
  position: absolute; z-index: 3; inset: 0; display: flex; flex-direction: column; opacity: 0; pointer-events: none;
  padding: 8px 10px 44px;
}
.attach-image .attach-hover { background: rgba(32, 33, 36, .84); color: #fff; justify-content: flex-end; }
.attach-file .attach-hover { background: rgba(248, 249, 250, .97); color: #202124; justify-content: flex-start; }
.attach-hover-top, .attach-hover-copy { width: 100%; }
.attach-wrap:hover .attach-hover, .attach-wrap:focus-within .attach-hover { opacity: 1; }
.attach-wrap:hover .attach-foot, .attach-wrap:hover .attach-page { opacity: 0; }
.attach-hover-top { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.attach-hover-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.attach-hover-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 13px; font-weight: 500; line-height: 1.25; word-break: break-word;
}
.attach-hover-size { font-size: 12px; color: #5f6368; }
.attach-image .attach-hover-size { color: rgba(255,255,255,.82); }
.attach-hover .type-badge { height: 22px; min-width: 22px; font-size: 9px; }
.attach-hover .type-ico, .attach-hover .type-ico .material-symbols-outlined { width: 22px; height: 22px; font-size: 22px; }
.attach-dl {
  position: absolute; z-index: 5; left: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%;
  background: #5f6368; color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; text-decoration: none;
}
.attach-dl .material-symbols-outlined { font-size: 18px; color: #fff; }
.attach-wrap:hover .attach-dl, .attach-wrap:focus-within .attach-dl { opacity: 1; }
.attach-dl:hover { background: #3c4043; }
.dialog.eml-window { width: min(920px, 94vw); max-height: min(860px, 90vh); overflow: auto; padding: 16px 20px 20px; border-radius: 12px; }
.eml-head { display: flex; align-items: flex-start; gap: 8px; }
.eml-head h2 { flex: 1; margin: 0; font-size: 20px; font-weight: 400; }
.eml-meta { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.eml-window .attach-block { margin-left: 0; }
.eml-body {
  font: 13px/1.45 Arial, Helvetica, sans-serif; color: #202124;
  max-height: 60vh; overflow: auto; white-space: normal;
}
.eml-body p { margin: 0 0 .2em; }
.eml-body div, .eml-body h1, .eml-body h2, .eml-body h3 { margin: 0; }
.eml-body table { border-collapse: collapse; border-spacing: 0; }
.eml-body td, .eml-body th {
  vertical-align: top; line-height: 1.35;
  padding-top: 6px !important; padding-bottom: 6px !important;
}
.eml-body td p, .eml-body td div, .eml-body th p, .eml-body th div { margin: 0 !important; line-height: 1.35; }
.eml-body img { max-width: 100%; height: auto; }
.eml-loading { color: var(--muted); }
.scrim.scrim-preview { background: rgba(32, 33, 36, 0.72); padding: 20px; }
.dialog.preview-window {
  width: calc(100vw - 48px); height: calc(100vh - 40px); max-height: none;
  padding: 12px 16px 16px; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden;
}
.preview-stage { flex: 1; min-height: 0; margin-top: 12px; background: #3c4043; border-radius: 8px; overflow: hidden; }
.preview-stage iframe, .preview-stage img { width: 100%; height: 100%; border: 0; object-fit: contain; background: #3c4043; }
.reply-actions { display: flex; gap: 8px; padding: 8px 16px 28px 68px; }
.reply-btn {
  height: 36px; border-radius: 18px; border: 1px solid #747775; background: #fff; color: #444746;
  padding: 0 16px; display: inline-flex; align-items: center; gap: 8px;
}
.reply-btn:hover { background: #f2f2f2; }

.compose {
  position: fixed; right: 72px; bottom: 0; width: 650px; height: 600px; max-height: calc(100vh - 40px);
  background: #fff; border-radius: 16px 16px 0 0; z-index: 40;
  box-shadow: 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12), 0 5px 5px -3px rgba(0,0,0,.2);
  display: flex; flex-direction: column;
}
.compose.full { left: 64px; right: 64px; top: 32px; width: auto; height: auto; border-radius: 16px; }
.compose.min { height: 48px; width: 328px; overflow: hidden; }
.compose-head {
  height: 40px; background: #f2f6fc; border-radius: 16px 16px 0 0; display: flex; align-items: center;
  justify-content: space-between; padding: 0 8px 0 16px; color: #041e49; flex: none;
}
.compose.min .compose-head { cursor: pointer; }
.compose-head-actions { display: flex; }
.compose-head .icon-btn, .compose-head button { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 50%; color: #444746; }
.compose-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.field-row { display: flex; align-items: center; min-height: 36px; border-bottom: 1px solid #f1f3f4; padding: 0 12px; gap: 8px; }
.field-label { color: var(--muted); width: 28px; flex: none; }
.field-row input[type="text"] { border: 0; outline: 0; flex: 1; height: 36px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex: 1; min-width: 0; padding: 4px 0; }
.chips input { border: 0; outline: 0; min-width: 80px; flex: 1; height: 28px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #e8eaed; border-radius: 16px; padding: 2px 8px; font-size: 13px; }
.chip button { border: 0; background: transparent; cursor: pointer; color: #444746; }
.text-btn { border: 0; background: transparent; color: var(--muted); }
.editor { flex: 1; min-height: 160px; overflow: auto; padding: 12px 16px; outline: none; }
.editor img { max-width: 100%; }
.suggest {
  position: absolute; left: 48px; right: 16px; background: #fff; z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,.24); border-radius: 4px; overflow: hidden;
}
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 8px 12px; }
.suggest button:hover, .suggest button.active { background: #f1f3f4; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #dadce0; border-radius: 8px; padding: 4px 8px; font-size: 12px; }
.file-chip button { border: 0; background: transparent; }
.compose-foot { display: flex; align-items: center; gap: 2px; padding: 8px 8px 12px 12px; flex: none; z-index: 99; background-color: #fff;}
.send-btn { background: var(--blue); color: #fff; border: 0; border-radius: 18px; height: 36px; padding: 0 24px; font-weight: 500; margin-right: 6px; }
.send-btn:hover { background: var(--blue-deep); }
.send-btn:disabled { opacity: .7; }
.draft-status { margin-left: auto; color: var(--muted); font-size: 12px; padding-right: 8px; }
.discard { margin-left: 0; }

.toast {
  position: fixed; left: 24px; bottom: 24px; z-index: 70; background: #323232; color: #fff;
  border-radius: 4px; min-width: 280px; max-width: 480px; padding: 14px 16px 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  box-shadow: 0 3px 5px rgba(0,0,0,.2);
}
.toast button { border: 0; background: transparent; color: #a8c7fa; font-weight: 500; }

.scrim { position: fixed; inset: 0; background: rgba(32,33,36,.45); z-index: 80; display: flex; align-items: center; justify-content: center; }
.dialog { background: #fff; border-radius: 28px; width: min(520px, 92vw); padding: 24px 24px 16px; box-shadow: 0 24px 38px rgba(0,0,0,.18); }
.dialog.confirm { width: min(400px, 92vw); padding: 24px 24px 20px; border-radius: 16px; }
.dialog.confirm h2 { margin-bottom: 16px; }
.dialog.confirm p { margin: 0; font-size: 14px; line-height: 20px; color: #202124; }
.dialog.confirm .dialog-actions { margin-top: 28px; }
.dialog h2 { margin: 0 0 8px; font-size: 22px; font-weight: 400; }
.dialog label { display: block; margin: 12px 0 9px; font-size: 12px; color: #444746; }
.dialog input, .dialog textarea, .dialog select {
  width: 100%; border: 1px solid #747775; border-radius: 4px; padding: 10px 12px;
}
.dialog input:focus, .dialog textarea:focus, .dialog select:focus { outline: 2px solid var(--blue); border-color: transparent; }
.dialog textarea { min-height: 80px; resize: vertical; }
.popover.search-panel {
  min-width: 0; max-width: none; max-height: min(78vh, 560px); overflow: auto;
  padding: 4px 16px 12px; border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 10px rgba(60,64,67,.28); z-index: 60;
}
.adv-row { display: grid; grid-template-columns: 148px 1fr; align-items: center; min-height: 44px; gap: 12px; }
.adv-row > span { color: #444746; font-size: 14px; }
.adv-row input, .adv-row select {
  width: 100%; height: 32px; border: 0; border-bottom: 1px solid #c4c7c5; border-radius: 0;
  background: transparent; padding: 0 2px; font: inherit; color: inherit;
}
.adv-row input:focus, .adv-row select:focus { outline: none; border-bottom: 2px solid var(--blue); }
.search-line { display: flex; align-items: center; gap: 16px; }
.search-line > * { flex: 1; min-width: 0; }
.adv-checks { display: flex; align-items: center; gap: 20px; min-height: 36px; }
.adv-checks label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #202124; }
.adv-checks input { width: 18px; height: 18px; margin: 0; padding: 0; border: 0; flex: none; accent-color: var(--blue); }
.adv-actions { display: flex; justify-content: flex-end; padding-top: 10px; }
.popover.search-panel .btn.primary {
  display: inline-flex; width: auto; min-height: 36px; padding: 0 24px;
  background: var(--blue); color: #fff;
}
.popover.search-panel .btn.primary:hover { background: var(--blue-deep); }
.dialog.snooze-picker { width: min(560px, 94vw); }
.picker-body { display: flex; gap: 28px; align-items: flex-start; margin-top: 8px; }
.picker-cal { width: 288px; flex: none; border: 1px solid var(--blue); border-radius: 8px; padding: 4px 8px 10px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 8px; font-size: 16px; }
.picker-head span { display: flex; }
.picker-head button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #444746; display: inline-flex; align-items: center; justify-content: center; }
.picker-head button:hover { background: #f1f3f4; }
.picker-week, .picker-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.picker-week span { text-align: center; color: #444746; font-size: 12px; line-height: 32px; }
.picker-days button {
  width: 36px; height: 36px; margin: 1px auto; border: 0; border-radius: 50%; background: transparent; color: inherit; padding: 0;
}
.picker-days button:hover:not(:disabled) { background: #f1f3f4; }
.picker-days button.out { color: #9aa0a6; }
.picker-days button.today { box-shadow: inset 0 0 0 1px var(--blue); color: var(--blue); }
.picker-days button.on, .picker-days button.on.today { background: var(--blue); color: #fff; box-shadow: none; }
.picker-days button:disabled { color: #c4c7c5; cursor: default; }
.picker-fields { flex: 1; display: flex; flex-direction: column; gap: 18px; min-width: 0; padding-top: 48px; }
.dialog.snooze-picker .picker-fields input { height: 56px; border-radius: 8px; font-size: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn { border: 0; background: transparent; color: var(--blue); font-weight: 500; height: 36px; padding: 0 16px; border-radius: 18px; }
.btn:hover { background: #e8f0fe; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.busy { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.busy::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn.primary:hover { background: var(--blue-deep); }
.btn.danger { color: var(--danger); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.colors button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #dadce0; }
.colors button.on { box-shadow: 0 0 0 2px var(--blue); }

.popover {
  position: fixed; z-index: 60; background: #fff; min-width: 220px; max-width: 320px;
  border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.24); padding: 8px 0; max-height: 360px; overflow: auto;
}
.popover button, .menu-row {
  display: flex; width: 100%; align-items: center; gap: 12px; text-align: left;
  border: 0; background: #fff; padding: 8px 16px; cursor: pointer; min-height: 36px;
}
.popover button:hover, .menu-row:hover { background: #f1f3f4; }
.popover.snooze-menu { min-width: 288px; padding: 6px 0 8px; }
.snooze-title { padding: 10px 24px 8px; color: #444746; font-size: 14px; }
.popover.snooze-menu .snooze-choice { justify-content: space-between; min-height: 34px; padding: 0 24px; gap: 32px; }
.snooze-when { color: #5f6368; font-size: 14px; margin-left: auto; white-space: nowrap; }
.popover.snooze-menu #pick-snooze { min-height: 44px; padding: 0 24px; }
.popover .material-symbols-outlined { font-size: 20px; color: #444746; width: 20px; }
.menu-sep { height: 1px; background: #e8eaed; margin: 6px 0; }
.source-dialog { width: min(860px, 94vw); }
.source-view {
  max-height: 60vh; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f6f8fc; padding: 12px; border-radius: 8px; margin: 0;
}
.account-card { padding: 12px 16px 8px; border-bottom: 1px solid #eee; }
.account-card strong, .account-card span { display: block; }
.account-card span { color: var(--muted); font-size: 13px; }
.popover.account-menu {
  width: 360px; min-width: 0; max-width: calc(100vw - 16px); max-height: none;
  border-radius: 28px; padding: 12px 0 16px;
  box-shadow: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);
}
.popover.account-menu .account-card {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px 16px; border-bottom: 0;
}
.popover.account-menu .account-avatar {
  width: 56px; height: 56px; border-radius: 50%; color: #fff; font-size: 22px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden;
}
.avatar-btn .letter { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.popover.account-menu .account-avatar .letter { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.popover.account-menu .account-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.popover.account-menu .account-id { min-width: 0; }
.popover.account-menu .account-id strong { font-size: 16px; font-weight: 500; line-height: 24px; }
.popover.account-menu .account-id span {
  font-size: 14px; line-height: 20px; color: #444746;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.popover.account-menu .menu-sep { margin: 8px 0; }
.popover.account-menu button {
  min-height: 48px; padding: 0 24px; gap: 16px; font-size: 14px;
}
.popover.account-menu .material-symbols-outlined { font-size: 22px; width: 22px; }

.settings { flex: 1; min-height: 0; overflow: auto; background: #fff; }
.settings-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px;
  height: 64px; padding: 0 12px; background: #fff;
}
.settings-bar h1 { margin: 0; font-size: 22px; font-weight: 400; }
.settings-body { max-width: 720px; margin: 0 auto; padding: 8px 32px 48px; }
.settings-hero { display: flex; align-items: center; gap: 20px; padding: 8px 0 28px; }
.settings-photo { position: relative; width: 96px; height: 96px; flex: none; }
.settings-face, .settings-photo img.settings-face {
  width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 36px; font-weight: 500; object-fit: cover;
}
.settings-photo .photo-btn {
  position: absolute; right: -2px; bottom: -2px; width: 36px; height: 36px; border: 2px solid #fff;
  border-radius: 50%; background: #e8f0fe; color: #0b57d0; display: flex; align-items: center; justify-content: center; padding: 0;
}
.settings-photo .photo-btn:hover { background: #d3e3fd; }
.settings-who { min-width: 0; }
.settings-who strong, .settings-who span { display: block; }
.settings-who strong { font-size: 22px; font-weight: 400; line-height: 28px; }
.settings-who span { color: #444746; font-size: 14px; line-height: 20px; margin-top: 2px; }
.text-btn { border: 0; background: transparent; color: var(--blue); font-weight: 500; padding: 8px 0 0; }
.text-btn:hover { text-decoration: underline; }
.settings section { border-top: 1px solid var(--line); padding: 28px 0 8px; }
.settings h2 { margin: 0 0 18px; font-size: 16px; font-weight: 500; }
.settings label { display: block; margin: 16px 0 6px; font-size: 12px; color: #444746; }
.settings input, .settings select, .settings textarea {
  width: min(480px, 100%); border: 1px solid #747775; border-radius: 4px; background: #fff;
  font: inherit; color: inherit;
}
.settings input, .settings select { height: 44px; padding: 0 12px; }
.settings textarea { min-height: 140px; padding: 12px; resize: vertical; }
.settings input:focus, .settings select:focus, .settings textarea:focus { outline: 2px solid var(--blue); border-color: transparent; }
.settings .hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 16px; }
.settings-actions { display: flex; justify-content: flex-end; padding-top: 28px; }
.settings-actions .btn.primary { min-width: 132px; }

.empty { margin: auto; text-align: center; color: var(--muted); padding: 48px 16px; }
.empty h2 { font-weight: 400; color: var(--text); }
.check-line { display: flex; align-items: center; }

.contacts { display: grid; grid-template-columns: 360px 1fr; min-height: 0; flex: 1; }
.contact-list { border-right: 1px solid var(--line); overflow: auto; }
.contact-tools { display: flex; gap: 8px; padding: 16px; align-items: center; }
.contact-tools input { flex: 1; border: 0; background: #f1f3f4; border-radius: 8px; height: 40px; padding: 0 12px; }
.contact-item { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: #fff; text-align: left; padding: 10px 16px; }
.contact-item.active, .contact-item:hover { background: #e8f0fe; }
.contact-detail { padding: 32px 40px; overflow: auto; }
.contact-detail h2 { font-size: 28px; font-weight: 400; margin: 12px 0; }
.meta-row { display: flex; gap: 12px; align-items: center; margin: 10px 0; color: #3c4043; }

.cal { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.cal-head h2 { font-size: 22px; font-weight: 400; margin: 0 8px; }
.today-btn { border: 1px solid #dadce0; background: #fff; border-radius: 4px; height: 36px; padding: 0 16px; }
.dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dow { color: var(--muted); font-size: 11px; text-transform: uppercase; padding: 0 8px 8px; }
.dow span, .cal-cell { padding: 4px; }
.cal-grid { flex: 1; border-top: 1px solid #e0e0e0; overflow: auto; }
.cal-cell { min-height: 108px; border-right: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; }
.cal-cell.out { background: #fafafa; color: #9aa0a6; }
.num { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 12px; }
.cal-cell.today .num { background: var(--blue); color: #fff; }
.event-chip {
  display: block; width: 100%; text-align: left; border: 0; color: #fff; border-radius: 4px;
  font-size: 12px; padding: 1px 6px; margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

.login-body { min-height: 100%; display: flex; align-items: center; justify-content: center; background: #fff; }
.login-card { width: min(450px, 94vw); border: 1px solid #dadce0; border-radius: 8px; padding: 48px 40px 36px; }
.login-card h1 { font-size: 24px; font-weight: 400; margin: 12px 0 4px; }
.login-brand { margin: 12px 0 0; font-size: 22px; letter-spacing: .2px; color: #5f6368; }
.logo img { width: 46px; height: 24px; object-fit: contain; }
.login-sub { color: #202124; margin: 0 0 24px; }
.login-card label { display: block; font-size: 12px; color: #444746; margin-bottom: 4px; }
.login-card input { width: 100%; border: 1px solid #747775; border-radius: 4px; height: 52px; padding: 0 14px; margin-bottom: 16px; }
.login-card input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.login-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.login-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-error { color: var(--danger); background: #fce8e6; border-radius: 8px; padding: 8px 12px; }

@media (min-width: 901px) {
  body.nav-collapsed .workspace { position: relative; }
  body.nav-collapsed .sidebar {
    position: absolute; top: 0; left: 0; bottom: 0; width: 72px; z-index: 25;
    background: var(--bg); overflow: hidden;
    transition: width .2s ease, box-shadow .2s ease;
  }
  body.nav-collapsed .stage { margin-left: 72px; }
  body.nav-collapsed .sidebar:hover,
  body.nav-collapsed .sidebar:focus-within,
  body.nav-collapsed.nav-peek .sidebar {
    width: 256px; overflow: auto;
    box-shadow: 0 8px 10px rgba(60,64,67,.15), 0 4px 16px rgba(60,64,67,.2);
  }
  body.nav-collapsed:not(.nav-peek) .sidebar:not(:hover):not(:focus-within) .compose-btn {
    width: 56px; height: 56px; margin: 0 8px 16px; padding: 0; justify-content: center;
  }
  body.nav-collapsed:not(.nav-peek) .sidebar:not(:hover):not(:focus-within) .compose-label,
  body.nav-collapsed:not(.nav-peek) .sidebar:not(:hover):not(:focus-within) .nav-name,
  body.nav-collapsed:not(.nav-peek) .sidebar:not(:hover):not(:focus-within) .more-btn,
  body.nav-collapsed:not(.nav-peek) .sidebar:not(:hover):not(:focus-within) #new-folder,
  body.nav-collapsed:not(.nav-peek) .sidebar:not(:hover):not(:focus-within) .nav-manage { display: none; }
  body.nav-collapsed:not(.nav-peek) .sidebar:not(:hover):not(:focus-within) .nav-more {
    display: flex; flex-direction: column; align-items: center;
  }
  body.nav-collapsed:not(.nav-peek) .sidebar:not(:hover):not(:focus-within) .nav-add { display: flex; }
  body.nav-collapsed:not(.nav-peek) .sidebar:not(:hover):not(:focus-within) .nav-item {
    position: relative; width: 40px; height: 40px; margin: 0 auto; padding: 0; justify-content: center; border-radius: 50%;
  }
  body.nav-collapsed:not(.nav-peek) .sidebar:not(:hover):not(:focus-within) .badge {
    position: absolute; top: 6px; right: 3px; width: 8px; height: 8px; margin: 0; padding: 0;
    border-radius: 50%; background: #d93025; font-size: 0; color: transparent; overflow: hidden;
  }
  body.nav-collapsed:not(.nav-peek) .sidebar:not(:hover):not(:focus-within) .nav-row {
    display: flex; justify-content: center;
  }
}

@media (max-width: 900px) {
  .logo span, .rail { display: none; }
  .logo { min-width: 0; }
  .sidebar { position: fixed; z-index: 30; top: 64px; bottom: 0; left: 0; background: var(--bg); transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
  .stage { margin-right: 8px; }
  .row { grid-template-columns: 24px 24px 92px minmax(0,1fr) auto; }
  .mail-tab { min-width: 0; gap: 6px; padding: 0 12px; font-size: 13px; }
  .compose { left: 0; right: 0; width: auto; }
  .contacts { grid-template-columns: 1fr; }
  .contact-detail { display: none; }
  .contacts.show-detail .contact-list { display: none; }
  .contacts.show-detail .contact-detail { display: block; }
}
