/* Mail density and typography follow Gmail compact reference */
.mail-app {
  font-family: 'Google Sans', Roboto, RobotoDraft, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: #202124;
}
.mail-nav nav button {
  height: 32px;
  color: #202124;
  gap: 16px;
  font-weight: 400;
  font-size: 13px;
  padding: 0 16px 0 20px;
  border-radius: 0 16px 16px 0;
}
.mail-nav nav button.active {
  font-weight: 600;
  background: #d3e3fd;
  color: #041e49;
}
.compose-button {
  width: auto;
  min-width: 120px;
  height: 42px;
  margin: 8px 0 14px 8px;
  padding: 0 20px 0 14px;
  font-weight: 500;
  font-size: 13px;
  border-radius: 16px;
  gap: 10px;
  background: #c2e7ff;
  color: #001d35;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.15s, background 0.15s;
}
.compose-button:hover {
  background: #b5e0fc;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.1);
}
.compose-button .mi { width: 20px; height: 20px; }
.mail-nav nav button .mi { width: 18px; height: 18px; }
.mail-search { background: #e9eef6; max-width: 720px; height: 40px; border-radius: 20px; }
.mail-search input { font-size: 13.5px; }
.mail-surface { border-radius: 16px; box-shadow: none; }
.mail-toolbar { height: 42px; padding: 0 14px; }
.toolbar-left { gap: 6px; }
.toolbar-divider { height: 18px; border-left: 1px solid #e7e9ec; margin: 0 8px; }
.inbox-label {
  width: auto;
  border: 0;
  margin: 0;
  padding: 10px 16px;
  font-size: 13px;
  color: #202124;
  font-weight: 500;
  gap: 10px;
}
.inbox-label > .mi { width: 16px; height: 16px; color: #5f6368; }
.message-row {
  min-height: 38px;
  padding: 0 14px;
  gap: 8px;
  background: #f2f6fc;
  box-shadow: inset 0 -1px 0 #e8eaed;
}
.message-open {
  grid-template-columns: 190px minmax(0,1fr) auto;
  padding: 8px 0;
  gap: 14px;
  color: #202124;
  font-weight: 400;
  line-height: 18px;
  font-size: 12.5px;
}
.message-row .star-button { margin-right: 6px; color: #b5b8bc; width: 24px; height: 24px; min-width: 24px; padding: 4px; }
.message-row .star-button.starred { color: #e4a11b; }
.message-sender { font-weight: 400; font-size: 12.5px; }
.message-subject { font-weight: 400; font-size: 12.5px; }
.message-snippet { color: #5f6368; font-weight: 400; font-size: 12.5px; }
.message-date { font-size: 11.5px; font-weight: 400; color: #5f6368; }
.unread .message-sender, .unread .message-subject, .unread .message-date { font-weight: 700; color: #000; }
.thread-count { font-size: 11.5px; font-weight: 500; margin-left: 4px; color: #5f6368; }
.mail-label-chip { font-weight: 400; font-size: 10.5px; padding: 1px 5px; border-radius: 3px; }

/* Conversation Reader */
.conversation-reader { padding: 14px 24px 32px 14px; max-width: none; margin: 0; }
.conversation-reader h1 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  margin: 0 0 0 44px;
  overflow-wrap: anywhere;
}
.conversation-reader h1 small { font-size: 11.5px; font-weight: 400; color: #5f6368; margin-left: 10px; white-space: nowrap; }
.conversation-reader .subject-tag { background: #e5e7e7; border-radius: 3px; font-size: 10.5px; padding: 2px 5px; font-weight: 400; margin-left: 10px; }
.conversation-message { border-bottom: 1px solid #e8eaed; padding: 0; }
.conversation-message:last-child { border-bottom: 0; }
.conversation-heading { display: flex; align-items: center; gap: 4px; min-height: 56px; }
.conversation-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent!important;
  padding: 10px 0;
  color: #202124;
}
.conversation-toggle .sender-avatar { width: 32px; height: 32px; background: #326e1e; color: white; font-size: 14px; font-weight: 500; }
.conversation-sender { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.conversation-sender > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conversation-sender strong { font-size: 13px; font-weight: 600; }
.conversation-address { font-size: 11.5px; font-weight: 400; color: #5f6368; margin-left: 4px; display: none; }
.conversation-preview { font-size: 12.5px; color: #5f6368; font-weight: 400; }
.conversation-toggle time { margin-left: auto; align-self: flex-start; padding-top: 3px; font-size: 11.5px; font-weight: 400; color: #5f6368; white-space: nowrap; }
.conversation-heading .star-button { width: 28px; min-width: 28px; height: 28px; padding: 5px; }
.conversation-heading .thread-reply { display: none; }
.conversation-message.expanded .conversation-address { display: inline; }
.conversation-message.expanded .thread-reply { display: inline-flex; }
.conversation-message.expanded .conversation-heading { min-height: 52px; }
.conversation-body { font-size: 13px; line-height: 1.6; margin: 0 0 20px 44px; overflow-wrap: anywhere; }
.conversation-body[hidden] { display: none; }
.conversation-body iframe { display: block; width: 100%; height: auto; min-height: 0; border: 0; background: white; }
.conversation-body .attachment-heading, .conversation-body .attachment-grid { margin-left: 0; }
.conversation-reader .reply-footer { margin: 20px 0 0 44px; display: flex; gap: 8px; flex-wrap: wrap; }
.conversation-reader .soft-button { border-color: #dadce0; color: #444746; padding: 6px 16px; font-size: 12.5px; gap: 8px; border-radius: 16px; }
.conversation-reader .soft-button:hover { background: #f0f4f9; }
.conversation-reader .plain-body { white-space: pre-wrap; }

@media (min-width: 1600px) { .message-open { grid-template-columns: 200px minmax(0,1fr) auto; } }
@media (max-width: 1100px) { .message-open { grid-template-columns: 145px minmax(0,1fr) auto; gap: 8px; } .conversation-reader { padding-right: 16px; } }
@media (max-width: 760px) {
  .message-row { padding: 0 10px; min-height: 56px; gap: 6px; }
  .message-open { grid-template-columns: minmax(0,1fr) auto; padding: 8px 0; gap: 4px; font-size: 12.5px; }
  .message-summary { font-size: 12px; }
  .message-date { font-size: 10.5px; }
  .message-row .star-button { margin-right: 0; }
  .conversation-reader { padding: 14px 10px; }
  .conversation-reader h1 { margin-left: 0; font-size: 17px; }
  .conversation-heading { gap: 0; }
  .conversation-toggle { gap: 8px; flex-wrap: wrap; }
  .conversation-toggle .sender-avatar { width: 28px; height: 28px; font-size: 13px; }
  .conversation-sender { min-width: 100px; }
  .conversation-toggle time { width: 100%; padding: 0 0 0 36px; font-size: 10.5px; }
  .conversation-body { margin: 0 0 18px; }
  .conversation-reader .reply-footer { margin-left: 0; }
  .conversation-address { display: none!important; }
  .toolbar-divider { margin: 0 4px; }
}

#bulk-mark { width: auto; max-width: 140px; padding: 4px 20px 4px 8px; background: #f2f6fc; border: 1px solid #dadce0; border-radius: 4px; font-size: 12px; color: #444746; height: 30px; }
.empty-trash-button { border: 0; color: #1a73e8; background: transparent; padding: 6px 10px; font-size: 12px; font-weight: 500; border-radius: 4px; }
.empty-trash-button:hover { background: #f1f3f4; }
.label-nav-title { display: flex; justify-content: space-between; align-items: center; color: #202124; font-size: 12.5px; font-weight: 600; padding-top: 12px; }
.label-nav-title #nav-add-label { width: 24px; height: 24px; padding: 0; border: 0; display: grid; place-items: center; margin: 0; background: transparent; color: #5f6368; font-size: 18px; border-radius: 50%; }
.label-nav-title #nav-add-label:hover { background: #e8edf5; }

.conversation-heading .thread-forward { display: none; }
.conversation-message.expanded .thread-forward { display: inline-flex; }
.compose-editor blockquote { margin: 10px 0 6px; padding-left: 10px; border-left: 2px solid #dadce0; color: #444746; font-size: 12.5px; }
.message-recipient-details{font-size:12px;line-height:1.6;color:#5f6368;margin-bottom:16px;overflow-wrap:anywhere}
.message-recipient-details span{display:inline-block;min-width:30px;font-weight:500}
.composer .compose-send-limit { color: #747b83; font-size: 11px; line-height: 1.4; margin: 8px 0 0; flex-shrink: 0; }
