:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fafd;
  --surface-hover: #f2f6fc;
  --surface-active: #d3e3fd;
  --border: #e0e3ea;
  --border-soft: #edf0f5;
  --text: #202124;
  --muted: #5f6368;
  --muted-soft: #9aa0a6;
  --blue: #0b57d0;
  --blue-hover: #0842a0;
  --blue-soft: #d3e3fd;
  --red: #c5221f;
  --yellow: #fbbc04;
  --green: #188038;
  --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.18), 0 1px 3px rgba(60, 64, 67, 0.08);
  --shadow-md: 0 2px 8px rgba(60, 64, 67, 0.18), 0 6px 20px rgba(60, 64, 67, 0.12);
  --shadow-lg: 0 10px 28px rgba(60, 64, 67, 0.24);
  --sidebar-width: 256px;
  --topbar-height: 64px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}


html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

button,
input,
textarea,
select { font: inherit; }

button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(11, 87, 208, 0.35);
  outline-offset: 2px;
}

.mail-app {
  height: 100vh;
  width: 100vw;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  background: var(--bg);
  transition: grid-template-columns 0.18s ease;
}

.topbar {
  grid-column: 1 / -1;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 16px;
  background: var(--bg);
  z-index: 30;
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar__left { width: 220px; }
.topbar__right { margin-left: auto; }

.icon-btn,
.toolbar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 18px;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.toolbar-btn { width: 36px; height: 36px; font-size: 17px; }

.icon-btn:hover,
.toolbar-btn:hover,
.compose-window__actions button:hover,
.compose-tool:hover,
.compose-trash:hover {
  background: rgba(60, 64, 67, 0.08);
}

.topbar__menu { flex-direction: column; gap: 4px; }
.topbar__menu span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--muted);
  border-radius: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4285f4, #ea4335 46%, #fbbc04 70%, #34a853);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.22);
}

.brand__name {
  color: var(--muted);
  font-size: 22px;
  letter-spacing: -0.2px;
}

.searchbar {
  height: 48px;
  max-width: 720px;
  flex: 1;
  border-radius: 24px;
  background: #eaf1fb;
  display: flex;
  align-items: center;
  padding: 0 8px 0 14px;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.searchbar:focus-within {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.searchbar input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  color: var(--text);
  height: 100%;
  min-width: 0;
}

.searchbar__icon,
.searchbar__filter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 20px;
}

.searchbar__icon:hover,
.searchbar__filter:hover { background: rgba(60, 64, 67, 0.08); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #7e57c2;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar--large {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.sidebar {
  grid-row: 2;
  grid-column: 1;
  padding: 8px 12px 16px 8px;
  overflow-y: auto;
  background: var(--bg);
  transition: transform 0.2s ease;
}

.compose-btn {
  height: 56px;
  min-width: 142px;
  border-radius: 16px;
  background: #c2e7ff;
  color: #001d35;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px 0 16px;
  margin: 8px 0 16px 0;
  box-shadow: var(--shadow-sm);
  font-weight: 500;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.compose-btn:hover { box-shadow: var(--shadow-md); }
.compose-btn:active { transform: translateY(1px); }
.compose-btn__plus { font-size: 28px; line-height: 1; }

.sidebar-nav,
.sidebar-section { display: flex; flex-direction: column; gap: 1px; }

.sidebar-nav__item {
  min-height: 32px;
  border-radius: 0 18px 18px 0;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 0 12px 0 16px;
  color: var(--text);
  text-align: left;
  font-size: 14px;
  transition: background 0.14s ease;
}

.sidebar-nav__item:hover { background: rgba(60, 64, 67, 0.08); }
.sidebar-nav__item.is-active { background: var(--blue-soft); font-weight: 700; }
.sidebar-nav__icon { color: var(--muted); font-size: 15px; }
.sidebar-nav__count { font-size: 12px; }

.sidebar-section { margin-top: 24px; padding-left: 8px; }
.sidebar-section__head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 0 8px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-section__head button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--muted);
}

.sidebar-section__head button:hover { background: rgba(60, 64, 67, 0.08); }

.account-pill,
.label-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  border-radius: 16px;
  padding: 0 10px;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  overflow: hidden;
}

.account-pill span:last-child,
.label-pill { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-pill:hover,
.account-pill.is-active,
.label-pill:hover { background: rgba(60, 64, 67, 0.08); color: var(--text); }

.account-dot,
.label-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ea4335;
  flex-shrink: 0;
}

.account-dot--all { background: #7e57c2; }
.account-dot--red { background: #ea4335; }
.account-dot--blue { background: #4285f4; }
.account-dot--green { background: #34a853; }
.label-dot--blue { background: #4285f4; }
.label-dot--red { background: #d93025; }
.label-dot--green { background: #188038; }

.main-shell {
  grid-row: 2;
  grid-column: 2;
  min-width: 0;
  min-height: 0;
  padding: 0 16px 16px 0;
  display: flex;
}

.mail-surface,
.email-detail {
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 0 1px rgba(237, 240, 245, 0.85);
}

.mail-toolbar,
.email-detail__toolbar,
.bulk-toolbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
  color: var(--muted);
  background: var(--surface);
}

.bulk-toolbar {
  background: #e8f0fe;
  color: var(--blue);
  justify-content: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.mail-toolbar__left,
.mail-toolbar__right,
.email-detail__left,
.email-detail__right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mail-range,
.email-detail__right span {
  font-size: 12px;
  margin-right: 8px;
  color: var(--muted);
}

.toolbar-action {
  height: 32px;
  border-radius: 16px;
  padding: 0 12px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}
.toolbar-action:hover { background: rgba(11, 87, 208, 0.08); }
.toolbar-action--danger { color: var(--red); }

.checkbox-wrap {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}

.checkbox-wrap:hover { background: rgba(60, 64, 67, 0.08); }
.checkbox-wrap input { display: none; }
.checkbox-wrap span {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border: 2px solid #5f6368;
  display: block;
  position: relative;
}
.checkbox-wrap input:checked + span { background: var(--blue); border-color: var(--blue); }
.checkbox-wrap input:checked + span::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 56px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.category-tab {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 18px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 500;
}
.category-tab:hover { background: rgba(60, 64, 67, 0.04); }
.category-tab.is-active { color: var(--blue); border-bottom-color: var(--blue); }

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

.email-row {
  min-height: 44px;
  border-bottom: 1px solid var(--border-soft);
  display: grid;
  grid-template-columns: 40px 32px minmax(132px, 200px) minmax(0, 1fr) auto;
  align-items: center;
  padding: 0 12px 0 4px;
  gap: 2px;
  background: #f2f6fc;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 rgba(100, 121, 143, 0.12);
  transition: box-shadow 0.14s ease, background 0.14s ease;
  font-size: 14px;
}

.email-row:hover {
  box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  position: relative;
  z-index: 1;
}

.email-row.is-read { background: #fff; color: var(--muted); }
.email-row.is-active { background: #d3e3fd; }

.email-row__star {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--muted-soft);
  font-size: 18px;
}
.email-row__star:hover { background: rgba(60, 64, 67, 0.08); }
.email-row__star.is-starred { color: var(--yellow); }

.email-row__sender {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 700;
  color: var(--text);
}
.email-row.is-read .email-row__sender,
.email-row.is-read .email-row__subject { font-weight: 400; color: var(--muted); }

.email-row__main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.email-row__subject {
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex-shrink: 0;
  max-width: 48%;
}
.email-row__dash,
.email-row__preview {
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.email-row__preview { min-width: 0; }
.email-row__date {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  font-weight: 700;
  padding-left: 10px;
}
.email-row.is-read .email-row__date { color: var(--muted); font-weight: 400; }
.email-row__account,
.email-row__chip {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  background: #edf2fa;
  color: var(--muted);
  font-size: 11px;
  padding: 2px 5px;
  margin-right: 5px;
  flex-shrink: 0;
}
.email-row__chip--urgent { background: #fce8e6; color: #a50e0e; }
.email-row__chip--client { background: #e8f0fe; color: #174ea6; }
.email-row__attachment { margin-left: 4px; color: var(--muted); flex-shrink: 0; }

.empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  padding: 30px;
}
.empty-state__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #edf2fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 18px;
}
.empty-state h2 { font-size: 20px; font-weight: 500; margin: 0 0 8px; color: var(--text); }
.empty-state p { margin: 0; font-size: 14px; }

.email-detail__toolbar {
  border-bottom: 1px solid var(--border-soft);
}

.email-card {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 44px 42px;
  background: #fff;
}
.email-card__header { margin-bottom: 22px; }
.email-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.email-title-line h1 {
  font-size: 24px;
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.2px;
  color: var(--text);
}
.email-label {
  display: inline-flex;
  align-items: center;
  height: 20px;
  border-radius: 4px;
  padding: 0 8px;
  background: #edf2fa;
  color: var(--muted);
  font-size: 12px;
}
.email-label--folder { background: #f1f3f4; }

.email-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 28px;
}
.sender-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #5f6368;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.email-meta__main { min-width: 0; flex: 1; }
.email-meta__sender { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.email-meta__sender strong { font-size: 14px; }
.email-meta__sender span,
.email-meta__to { color: var(--muted); font-size: 12px; }
.email-meta__to { padding: 0; }
.email-meta__side { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }

.email-body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  max-width: 820px;
}
.email-body p { margin: 0 0 16px; }
.email-body blockquote {
  margin: 18px 0 0;
  padding-left: 14px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
.attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.attachment-card {
  height: 42px;
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.attachment-card:hover { background: #f8fafd; }
.reply-actions { display: flex; gap: 10px; margin-top: 36px; }
.reply-btn {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 18px;
  color: var(--muted);
  font-weight: 500;
}
.reply-btn:hover { background: #f8fafd; }

.account-popover {
  position: fixed;
  top: 58px;
  right: 16px;
  width: 330px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 80;
}
.account-popover__profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 0 14px;
}
.account-popover__profile span,
.account-popover__note { color: var(--muted); font-size: 13px; }
.account-popover__note {
  border-radius: 14px;
  background: #f8fafd;
  padding: 12px;
  line-height: 1.45;
  margin-bottom: 12px;
}
.account-popover button {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 19px;
  color: var(--blue);
  font-weight: 700;
}
.account-popover button:hover { background: #f8fafd; }

.compose-window {
  position: fixed;
  right: 26px;
  bottom: 0;
  width: 560px;
  height: 560px;
  max-height: calc(100vh - 90px);
  border-radius: 10px 10px 0 0;
  background: #fff;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 70;
}
.compose-window[data-state="maximized"] {
  width: min(960px, calc(100vw - 48px));
  height: calc(100vh - 80px);
  right: 24px;
  bottom: 24px;
  border-radius: 10px;
}
.compose-window[data-state="minimized"] { width: 300px; height: 42px; }
.compose-window[data-state="minimized"] .compose-window__body,
.compose-window[data-state="minimized"] .compose-window__footer { display: none; }
.compose-window__header {
  height: 42px;
  background: #f2f6fc;
  color: #041e49;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}
.compose-window__actions { display: flex; align-items: center; gap: 2px; }
.compose-window__actions button { width: 28px; height: 28px; border-radius: 50%; color: #444746; }
.compose-window__body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 16px; }
.compose-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 14px;
}
.compose-field label { flex-shrink: 0; font-size: 13px; }
.compose-field input,
.compose-field select { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); height: 100%; }
.compose-field select { color: var(--muted); }
.compose-field--from { min-height: 38px; }
.compose-window textarea {
  flex: 1;
  min-height: 160px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 16px 0;
  color: var(--text);
  line-height: 1.5;
}
.compose-window__footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-soft);
}
.send-btn {
  height: 36px;
  border-radius: 18px;
  background: var(--blue);
  color: #fff;
  padding: 0 22px;
  font-weight: 700;
  margin-right: 8px;
}
.send-btn:hover { background: var(--blue-hover); }
.compose-tool,
.compose-trash {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.compose-trash { margin-left: auto; }

.mobile-compose {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #c2e7ff;
  color: #001d35;
  box-shadow: var(--shadow-md);
  font-size: 30px;
  z-index: 65;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #202124;
  color: #fff;
  border-radius: 4px;
  padding: 12px 18px;
  box-shadow: var(--shadow-md);
  font-size: 14px;
  z-index: 100;
}

.mobile-scrim { display: none; }

.mail-app[data-sidebar-collapsed="true"] { --sidebar-width: 76px; }
.mail-app[data-sidebar-collapsed="true"] .topbar__left { width: 56px; }
.mail-app[data-sidebar-collapsed="true"] .brand__name,
.mail-app[data-sidebar-collapsed="true"] .compose-btn__text,
.mail-app[data-sidebar-collapsed="true"] .sidebar-nav__label,
.mail-app[data-sidebar-collapsed="true"] .sidebar-nav__count,
.mail-app[data-sidebar-collapsed="true"] .sidebar-section { display: none; }
.mail-app[data-sidebar-collapsed="true"] .brand__mark { display: none; }
.mail-app[data-sidebar-collapsed="true"] .compose-btn {
  min-width: 56px;
  width: 56px;
  height: 56px;
  padding: 0;
  justify-content: center;
  border-radius: 16px;
}
.mail-app[data-sidebar-collapsed="true"] .sidebar-nav__item {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  margin: 0 auto 2px;
}

.mail-app[data-view="email"] .mail-surface { display: none; }
.mail-app[data-view="email"] .email-detail { display: flex; }
.mail-app[data-view="list"] .email-detail { display: none; }
.mail-app[data-view="list"] .mail-surface { display: flex; }

@media (max-width: 980px) {
  .email-row {
    grid-template-columns: 38px 30px minmax(105px, 145px) minmax(0, 1fr) auto;
  }
  .email-row__account { display: none; }
  .email-row__subject { max-width: 56%; }
}

@media (max-width: 760px) {
  :root { --topbar-height: 58px; --sidebar-width: 0px; }
  .mail-app { grid-template-columns: 1fr; }
  .topbar { gap: 8px; padding: 6px 8px; }
  .topbar__left { width: auto; }
  .brand__name,
  .topbar__right .icon-btn:not(:last-child) { display: none; }
  .brand__mark { width: 30px; height: 30px; font-size: 16px; }
  .searchbar { height: 44px; }
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--topbar-height);
    bottom: 0;
    width: 280px;
    z-index: 55;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-md);
  }
  .mail-app[data-mobile-sidebar="true"] .sidebar { transform: translateX(0); }
  .mail-app[data-mobile-sidebar="true"] .mobile-scrim {
    display: block;
    position: fixed;
    inset: var(--topbar-height) 0 0 0;
    background: rgba(32, 33, 36, 0.28);
    z-index: 50;
  }
  .main-shell { grid-column: 1; padding: 0 8px 8px; }
  .mail-surface,
  .email-detail { border-radius: 14px; }
  .mail-toolbar__right { display: none; }
  .category-tabs { grid-template-columns: 1fr; height: 48px; }
  .category-tab:not(.is-active) { display: none; }
  .email-row {
    grid-template-columns: 34px 28px minmax(0, 1fr) auto;
    grid-template-areas:
      "check star sender date"
      "check star main main";
    min-height: 64px;
    font-size: 13px;
    row-gap: 0;
    padding-right: 10px;
  }
  .email-row .checkbox-wrap { grid-area: check; }
  .email-row__star { grid-area: star; }
  .email-row__sender { grid-area: sender; }
  .email-row__main { grid-area: main; }
  .email-row__date { grid-area: date; padding-left: 6px; }
  .email-row__subject { max-width: 62%; }
  .email-row__dash { display: none; }
  .email-card { padding: 20px 18px 32px; }
  .email-title-line h1 { font-size: 20px; }
  .email-meta__side .toolbar-btn { display: none; }
  .email-meta__side { align-items: flex-start; }
  .reply-actions { flex-direction: column; align-items: flex-start; }
  .compose-window,
  .compose-window[data-state="maximized"] {
    width: 100vw;
    height: calc(100vh - 58px);
    max-height: none;
    right: 0;
    bottom: 0;
    border-radius: 10px 10px 0 0;
  }
  .compose-window[data-state="minimized"] { width: calc(100vw - 16px); right: 8px; height: 42px; }
  .mobile-compose { display: inline-flex; align-items: center; justify-content: center; }
  .compose-btn { display: none; }
  .account-popover { width: calc(100vw - 24px); right: 12px; }
}

/* Login / app shell additions for PHP version */
.login-page {
  min-height: 100vh;
  margin: 0;
  background: #f6f8fc;
  font-family: Arial, Helvetica, sans-serif;
  display: grid;
  place-items: center;
  color: #202124;
}

.login-card {
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 28px;
  padding: 36px;
  box-shadow: 0 12px 30px rgba(60, 64, 67, 0.12);
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-card__mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ea4335, #fbbc04, #34a853, #4285f4);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 500;
}

.login-card p {
  margin: 0 0 24px;
  color: #5f6368;
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  font-size: 13px;
  color: #5f6368;
}

.login-form input {
  width: 100%;
  border: 1px solid #dadce0;
  border-radius: 10px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 15px;
  outline: none;
}

.login-form input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.login-button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: #0b57d0;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.login-button:hover {
  background: #0842a0;
}

.login-error {
  background: #fce8e6;
  color: #b3261e;
  border: 1px solid #f4c7c3;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.login-demo {
  margin-top: 20px;
  padding: 14px;
  border-radius: 14px;
  background: #f1f3f4;
  font-size: 13px;
  color: #5f6368;
  line-height: 1.5;
}

.app-user-link {
  color: inherit;
  text-decoration: none;
}

.settings-page {
  min-height: 100vh;
  background: #f6f8fc;
  font-family: Arial, Helvetica, sans-serif;
  color: #202124;
  padding: 24px;
}

.settings-shell {
  max-width: 1080px;
  margin: 0 auto;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.settings-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
}

.settings-back {
  color: #0b57d0;
  text-decoration: none;
  font-weight: 600;
}

.settings-grid {
  display: grid;
  gap: 14px;
}

.account-card-real {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}

.account-card-real h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

.account-card-real p {
  margin: 0;
  color: #5f6368;
  font-size: 14px;
}

.account-card-real__status {
  align-self: start;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e6f4ea;
  color: #137333;
  font-size: 12px;
  font-weight: 700;
}

.account-card-real__status.is-disabled {
  background: #f1f3f4;
  color: #5f6368;
}

@media (max-width: 640px) {
  .login-card {
    border-radius: 22px;
    padding: 28px 22px;
  }

  .settings-page {
    padding: 16px;
  }

  .settings-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-card-real {
    grid-template-columns: 1fr;
  }
}

/* Settings v3.2 */
.settings-shell--wide {
  max-width: 1180px;
}

.settings-header--panel p {
  margin: 8px 0 0;
  color: #5f6368;
  line-height: 1.45;
}

.settings-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dadce0;
  color: #444746;
  font-size: 13px;
}

.settings-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.settings-tab {
  min-height: 38px;
  border-radius: 999px;
  padding: 0 16px;
  color: #444746;
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
}

.settings-tab:hover {
  background: #eef2f7;
}

.settings-tab.is-active {
  background: #d3e3fd;
  color: #0b57d0;
  font-weight: 700;
}

.settings-panel {
  display: none;
}

.settings-panel.is-active {
  display: block;
}

.settings-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.settings-panel__head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 500;
}

.settings-panel__head p {
  margin: 0;
  color: #5f6368;
  line-height: 1.45;
}

.settings-button,
.settings-mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #0b57d0;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 700;
  white-space: nowrap;
}

.settings-button:hover,
.settings-mini-button:hover {
  background: #f8fafd;
  border-color: #c7d2e8;
}

.settings-button--primary {
  background: #0b57d0;
  border-color: #0b57d0;
  color: #fff;
}

.settings-button--primary:hover {
  background: #0842a0;
  border-color: #0842a0;
}

.settings-mini-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.settings-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-card-real--rich {
  align-items: start;
}

.account-card-real__main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.account-card-real__avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  flex: 0 0 auto;
}

.account-card-real h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.account-card-real__side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.settings-table-wrap {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 18px;
  overflow: auto;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.settings-table th,
.settings-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.settings-table th {
  color: #5f6368;
  font-weight: 700;
  background: #f8fafd;
}

.settings-table tr:last-child td {
  border-bottom: 0;
}

.settings-table td strong,
.settings-table td span {
  display: block;
}

.settings-table td span {
  margin-top: 4px;
  color: #5f6368;
  font-size: 13px;
}

.settings-user-card {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}

.settings-user-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.settings-user-card h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.settings-user-card p {
  margin: 0;
  color: #5f6368;
  font-size: 14px;
}

.settings-assignment-list {
  display: grid;
  gap: 8px;
}

.settings-check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  border-radius: 10px;
  background: #f8fafd;
  padding: 0 10px;
  color: #444746;
  font-size: 14px;
}

.settings-check-row input {
  width: 16px;
  height: 16px;
}

.mail-account-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}

.mail-account-form label {
  display: grid;
  gap: 7px;
  color: #5f6368;
  font-size: 13px;
  font-weight: 700;
}

.mail-account-form input,
.mail-account-form select,
.mail-account-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dadce0;
  border-radius: 10px;
  padding: 0 11px;
  color: #202124;
  outline: none;
  background: #fff;
  font-weight: 400;
}

.mail-account-form textarea {
  min-height: 96px;
  resize: vertical;
  padding-top: 11px;
}

.mail-account-form input:focus,
.mail-account-form select:focus,
.mail-account-form textarea:focus {
  border-color: #0b57d0;
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.12);
}

.form-section-title {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #edf0f5;
  color: #202124;
  font-weight: 700;
}

.form-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.mail-account-form__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.settings-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  min-height: 42px;
  max-width: min(520px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 18px;
  background: #202124;
  color: #fff;
  box-shadow: 0 10px 28px rgba(60, 64, 67, 0.24);
  z-index: 100;
  font-size: 14px;
}

@media (max-width: 760px) {
  .settings-header__actions,
  .settings-panel__head {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-grid--two,
  .mail-account-form {
    grid-template-columns: 1fr;
  }

  .account-card-real__main {
    flex-direction: column;
  }

  .account-card-real__side {
    justify-items: start;
  }

  .mail-account-form__actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* v3.3 - Google-like popovers, quick actions and richer UI */
.google-popover {
  border: 1px solid rgba(218, 220, 224, 0.85);
  background: #fff;
  box-shadow: 0 4px 12px rgba(60, 64, 67, 0.18), 0 16px 36px rgba(60, 64, 67, 0.16);
  overflow: hidden;
}

.google-popover__head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid #edf0f5;
  color: #202124;
  font-size: 14px;
}

.google-popover__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  font-size: 20px;
}

.google-popover__close:hover { background: rgba(60, 64, 67, 0.08); }

.google-popover__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid #edf0f5;
}

.google-primary-btn,
.google-outline-btn,
.google-text-btn {
  min-height: 36px;
  border-radius: 18px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.google-primary-btn { background: #0b57d0; color: #fff; }
.google-primary-btn:hover { background: #0842a0; }
.google-outline-btn { border: 1px solid #dadce0; color: #0b57d0; background: #fff; }
.google-outline-btn:hover,
.google-text-btn:hover { background: #f8fafd; }
.google-text-btn { color: #0b57d0; background: transparent; }

.search-popover {
  position: fixed;
  top: 58px;
  left: min(360px, 22vw);
  width: min(720px, calc(100vw - 32px));
  border-radius: 14px;
  z-index: 90;
}

.search-popover__grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px 16px;
  padding: 16px;
}

.search-popover__grid label {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  color: #5f6368;
  font-size: 13px;
}

.search-popover__grid input,
.search-popover__grid select {
  min-height: 38px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 0 11px;
  background: #fff;
  color: #202124;
  outline: none;
}

.search-popover__grid input:focus,
.search-popover__grid select:focus {
  border-color: #0b57d0;
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.1);
}

.account-popover {
  padding: 0;
  border-radius: 28px;
  background: #f8fafd;
}

.account-popover__profile--google {
  margin: 12px 12px 0;
  padding: 18px 16px 20px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid #edf0f5;
}

.account-popover__profile--google .google-outline-btn { margin-top: 10px; }

.account-popover__accounts {
  margin: 8px 12px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #edf0f5;
  overflow: hidden;
}

.account-popover__account-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf0f5;
}

.account-popover__account-row:last-child { border-bottom: 0; }
.account-popover__account-row strong,
.account-popover__account-row span { display: block; }
.account-popover__account-row strong { font-size: 13px; color: #202124; }
.account-popover__account-row span { margin-top: 2px; font-size: 12px; color: #5f6368; }

.account-popover__bottom-actions {
  display: grid;
  gap: 0;
  margin: 8px 12px 12px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #edf0f5;
  overflow: hidden;
}

.account-popover__bottom-actions a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: #0b57d0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid #edf0f5;
}

.account-popover__bottom-actions a:last-child { border-bottom: 0; color: #5f6368; }
.account-popover__bottom-actions a:hover { background: #f8fafd; }

.email-row {
  grid-template-columns: 40px 32px minmax(132px, 200px) minmax(0, 1fr) 72px;
}

.email-row__quick-actions {
  display: none;
  justify-content: flex-end;
  gap: 2px;
}

.email-row:hover .email-row__date { display: none; }
.email-row:hover .email-row__quick-actions { display: flex; }
.email-row__quick-actions button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #5f6368;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.email-row__quick-actions button:hover { background: rgba(60, 64, 67, 0.08); color: #202124; }

.compose-window {
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(218, 220, 224, 0.78);
  box-shadow: 0 8px 28px rgba(60, 64, 67, 0.24), 0 2px 8px rgba(60, 64, 67, 0.16);
}

.compose-window__header {
  background: #f2f6fc;
  border-bottom: 1px solid #edf0f5;
}

.compose-window[data-state="maximized"] { border-radius: 18px; }
.compose-save-status {
  margin-left: auto;
  margin-right: 8px;
  color: #5f6368;
  font-size: 12px;
}
.compose-trash { margin-left: 0; }

.google-side-rail {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: 56px;
  display: grid;
  grid-auto-rows: 48px;
  justify-items: center;
  align-content: start;
  gap: 4px;
  padding-top: 10px;
  background: var(--bg);
  z-index: 20;
}

.google-side-rail button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  font-size: 17px;
}

.google-side-rail button:hover { background: rgba(60, 64, 67, 0.08); }
.google-side-rail span {
  width: 20px;
  height: 1px;
  background: #dadce0;
  margin: 8px 0;
}

.main-shell { padding-right: 72px; }

.settings-toast,
.toast {
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(32, 33, 36, 0.28);
}

@media (max-width: 900px) {
  .google-side-rail { display: none; }
  .main-shell { padding-right: 8px; }
  .search-popover { left: 12px; right: 12px; width: auto; }
}

@media (max-width: 640px) {
  .search-popover__grid,
  .search-popover__grid label { grid-template-columns: 1fr; }
  .search-popover__grid { gap: 10px; }
  .search-popover__grid label { gap: 6px; }
  .email-row__quick-actions { display: none !important; }
  .email-row:hover .email-row__date { display: block; }
}

/* v3.4 - polish Google-style popups, settings editor and rich compose editor */
[hidden] { display: none !important; }

.google-account-menu {
  position: fixed;
  top: 58px;
  right: 18px;
  width: 436px;
  max-width: calc(100vw - 24px);
  border-radius: 28px;
  border: 0;
  background: #e9eef6;
  box-shadow: 0 12px 34px rgba(60, 64, 67, 0.28), 0 2px 8px rgba(60, 64, 67, 0.16);
  z-index: 95;
  overflow: hidden;
  color: #202124;
}

.google-account-menu__top {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 22px;
  color: #3c4043;
  font-size: 14px;
}

.google-account-menu__profile {
  margin: 0 12px;
  padding: 18px 18px 20px;
  border-radius: 24px 24px 8px 8px;
  background: #fff;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.google-account-menu__avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #7e57c2;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 600;
}

.google-account-menu__profile h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 400;
}

.google-account-menu__manage {
  min-height: 38px;
  border: 1px solid #dadce0;
  border-radius: 999px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0b57d0;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.google-account-menu__manage:hover { background: #f8fafd; }

.google-account-menu__accounts,
.google-account-menu__actions {
  margin: 2px 12px 0;
  background: #fff;
  overflow: hidden;
}

.google-account-menu__accounts { border-radius: 8px; }
.google-account-menu__actions { border-radius: 8px 8px 24px 24px; }

.google-account-menu__row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  color: #202124;
}

.google-account-menu__row:hover,
.google-account-menu__actions a:hover { background: #f8fafd; }
.google-account-menu__row:last-child { border-bottom: 0; }
.google-account-menu__row strong,
.google-account-menu__row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.google-account-menu__row strong { font-size: 14px; font-weight: 600; }
.google-account-menu__row small { margin-top: 3px; font-size: 13px; color: #5f6368; }
.google-account-menu__row em {
  font-style: normal;
  color: #137333;
  background: #e6f4ea;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.google-account-menu__actions a {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  color: #0b57d0;
  text-decoration: none;
  border-bottom: 1px solid #edf0f5;
  font-weight: 600;
}
.google-account-menu__actions a:last-child { border-bottom: 0; color: #3c4043; }
.google-account-menu__legal {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  font-size: 12px;
}

.compose-window {
  width: 620px;
  height: 620px;
  border-radius: 16px 16px 0 0;
}

.compose-window__body { padding: 0 16px; }
.compose-formatbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border-soft);
}
.compose-format-btn {
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #444746;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.compose-format-btn:hover,
.compose-tool:hover,
.compose-trash:hover { background: rgba(60, 64, 67, 0.08); }
.compose-format-separator {
  width: 1px;
  height: 20px;
  background: #dadce0;
  margin: 0 4px;
}
.compose-editor,
.rich-editor {
  flex: 1;
  min-height: 220px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 16px 0;
  color: var(--text);
  line-height: 1.55;
  overflow: auto;
  word-break: break-word;
}
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #5f6368;
  pointer-events: none;
}
.quoted-message {
  margin-top: 12px;
  padding-left: 12px;
  border-left: 3px solid #dadce0;
  color: #5f6368;
  font-size: 13px;
}

.inline-reply {
  margin-top: 18px;
  border: 1px solid #dadce0;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}
.inline-reply__head,
.inline-reply__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 12px 0 16px;
  background: #f8fafd;
  border-bottom: 1px solid #edf0f5;
}
.inline-reply__editor {
  min-height: 128px;
  padding: 16px;
}
.inline-reply__footer {
  justify-content: flex-start;
  gap: 8px;
  border-top: 1px solid #edf0f5;
  border-bottom: 0;
  padding: 8px 12px;
}

.settings-page--google {
  background: #f6f8fc;
  padding: 28px;
}
.settings-shell--google {
  max-width: 1160px;
}
.settings-header--panel {
  background: #fff;
  border: 1px solid #e5e8ef;
  border-radius: 28px;
  padding: 22px 24px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}
.settings-header--panel h1 { font-size: 30px; }
.settings-tabs {
  background: #fff;
  border: 1px solid #e5e8ef;
  border-radius: 999px;
  padding: 5px;
  width: max-content;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}
.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}
.settings-summary-card {
  background: #fff;
  border: 1px solid #e5e8ef;
  border-radius: 22px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}
.settings-summary-card span,
.settings-summary-card small { display: block; color: #5f6368; font-size: 13px; }
.settings-summary-card strong { display: block; margin: 6px 0 4px; font-size: 30px; font-weight: 500; color: #202124; }

.account-card-real {
  border-color: #e5e8ef;
  border-radius: 24px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}
.account-card-real:hover { box-shadow: 0 6px 18px rgba(60, 64, 67, 0.12); }
.account-card-real__avatar {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  color: #fff !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}
.account-card-real__main { align-items: center; }
.account-card-real__main h3 { font-size: 18px; margin-bottom: 8px; }
.account-card-real__main p { margin-top: 2px; }
.settings-table-wrap,
.settings-user-card,
.mail-account-form {
  border-color: #e5e8ef;
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}
.settings-button,
.settings-mini-button { box-shadow: none; }

.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.32);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 120;
}
.settings-modal {
  width: min(820px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(32, 33, 36, 0.32);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.settings-modal__header,
.settings-modal__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #edf0f5;
}
.settings-modal__header h2 { margin: 0 0 4px; font-size: 24px; font-weight: 500; }
.settings-modal__header p { margin: 0; color: #5f6368; }
.settings-modal__body { padding: 18px 22px; overflow: auto; }
.settings-modal__footer { justify-content: flex-end; align-items: center; border-top: 1px solid #edf0f5; border-bottom: 0; }
.settings-modal__tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: #f1f4f9;
  border-radius: 999px;
  margin-bottom: 16px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}
.settings-modal__tabs button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 14px;
  color: #444746;
}
.settings-modal__tabs button.is-active { background: #fff; color: #0b57d0; font-weight: 700; box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12); }
.mail-account-form--modal { box-shadow: none; border: 0; padding: 0; border-radius: 0; }
.mail-account-form__wide { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .settings-page--google { padding: 14px; }
  .settings-tabs { width: 100%; border-radius: 22px; }
  .settings-summary-grid { grid-template-columns: 1fr; }
  .settings-header--panel { border-radius: 22px; padding: 18px; }
  .settings-modal-backdrop { padding: 10px; align-items: end; }
  .settings-modal { max-height: calc(100vh - 20px); border-radius: 24px 24px 0 0; }
  .google-account-menu { right: 12px; width: calc(100vw - 24px); }
  .compose-window { width: 100vw; height: calc(100vh - 58px); }
}

/* --------------------------------------------------------------------------
   Lemon Mail v3.5 — modern Google/Material inspired account UI
   -------------------------------------------------------------------------- */
:root {
  --lm-purple: #6f42d8;
  --lm-purple-dark: #4f2cb7;
  --lm-purple-soft: #f1eafd;
  --lm-purple-soft-2: #f7f3ff;
  --lm-blue-soft: #eaf1ff;
  --lm-green-soft: #eaf7ef;
  --lm-orange-soft: #fff3df;
  --lm-ink: #111827;
  --lm-muted: #667085;
  --lm-line: #e6e8ef;
  --lm-card-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 14px 34px rgba(16, 24, 40, .08);
  --lm-pop-shadow: 0 18px 55px rgba(16, 24, 40, .18), 0 2px 8px rgba(16, 24, 40, .08);
}

.account-popover.google-account-menu--modern {
  position: fixed;
  top: 74px;
  right: 22px;
  width: min(520px, calc(100vw - 28px));
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(210, 214, 224, .95);
  border-radius: 22px;
  box-shadow: var(--lm-pop-shadow);
  padding: 0;
  overflow: hidden;
  z-index: 70;
  color: var(--lm-ink);
  backdrop-filter: blur(18px);
}

.google-account-menu--modern .google-account-menu__identity {
  display: grid;
  grid-template-columns: 78px 1fr 40px;
  align-items: center;
  gap: 18px;
  padding: 28px 30px 22px;
}

.google-account-menu__avatar-wrap { position: relative; width: 72px; height: 72px; }
.google-account-menu--modern .google-account-menu__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 26px;
  background: linear-gradient(145deg, #8b5cf6, #6545c7);
  box-shadow: inset 0 -10px 18px rgba(0,0,0,.08), 0 10px 24px rgba(111, 66, 216, .28);
}

.google-account-menu__status {
  position: absolute;
  right: 3px;
  bottom: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2eb84a;
  border: 3px solid #fff;
}

.google-account-menu__identity-main strong {
  display: block;
  font-size: 24px;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.google-account-menu__identity-main span {
  display: block;
  color: var(--lm-muted);
  font-size: 17px;
  margin-top: 5px;
}
.google-account-menu__chevron {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 22px;
  color: #4b5563;
}
.google-account-menu__chevron:hover { background: #f3f4f8; }

.google-account-menu--modern .google-account-menu__manage {
  margin: 0 30px 24px;
  width: max-content;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid #d9ddeb;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--lm-purple-dark);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.google-account-menu--modern .google-account-menu__manage:hover { background: #fbfaff; border-color: #c7b8f6; }
.google-account-menu__manage-icon { font-size: 20px; }
.google-account-menu__divider { height: 1px; background: var(--lm-line); margin: 0 30px; }

.google-account-menu--modern .google-account-menu__accounts { padding: 18px 30px; }
.google-account-menu--modern .google-account-menu__row {
  width: 100%;
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 82px;
  padding: 9px 0;
  border-radius: 16px;
  text-align: left;
}
.google-account-menu--modern .google-account-menu__row:hover { background: #faf9ff; padding-left: 10px; padding-right: 10px; }
.google-account-menu__account-avatar,
.premium-account-card__avatar,
.premium-account-mini,
.premium-assigned-dots em {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 800;
}
.google-account-menu__account-avatar {
  width: 56px;
  height: 56px;
  font-size: 22px;
  color: #fff;
  position: relative;
}
.google-account-menu__account-avatar.account-dot--red,
.premium-account-card__avatar.account-dot--red,
.premium-account-mini.account-dot--red,
.premium-assigned-dots em.account-dot--red { background: linear-gradient(145deg, #ffe1dd, #f04438); color: #b42318; }
.google-account-menu__account-avatar.account-dot--blue,
.premium-account-card__avatar.account-dot--blue,
.premium-account-mini.account-dot--blue,
.premium-assigned-dots em.account-dot--blue { background: linear-gradient(145deg, #dce8ff, #4d8bff); color: #155eef; }
.google-account-menu__account-avatar.account-dot--green,
.premium-account-card__avatar.account-dot--green,
.premium-account-mini.account-dot--green,
.premium-assigned-dots em.account-dot--green { background: linear-gradient(145deg, #d9f7df, #35b65f); color: #087443; }
.google-account-menu__account-avatar.account-dot--all,
.premium-account-card__avatar.account-dot--all,
.premium-account-mini.account-dot--all,
.premium-assigned-dots em.account-dot--all { background: linear-gradient(145deg, #f0e8ff, #8b5cf6); color: #5b35b1; }
.google-account-menu__account-copy strong {
  display: block;
  color: var(--lm-ink);
  font-size: 18px;
  line-height: 1.2;
}
.google-account-menu__account-copy small {
  display: block;
  color: var(--lm-muted);
  font-size: 16px;
  margin-top: 4px;
}
.google-account-menu--modern .google-account-menu__row em {
  font-style: normal;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--lm-purple-soft);
  color: var(--lm-purple-dark);
  font-weight: 800;
  font-size: 14px;
}

.google-account-menu--modern .google-account-menu__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 18px 30px;
}
.google-account-menu--modern .google-account-menu__actions a {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--lm-purple-dark);
  font-weight: 700;
  text-decoration: none;
  border-radius: 12px;
}
.google-account-menu--modern .google-account-menu__actions a:hover { background: #faf8ff; }
.google-account-menu--modern .google-account-menu__actions a:first-child { border-right: 1px solid var(--lm-line); border-radius: 12px 0 0 12px; }
.google-account-menu--modern .google-account-menu__actions span { font-size: 18px; }
.google-account-menu--modern .google-account-menu__legal {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  min-height: 72px;
  border-top: 1px solid var(--lm-line);
  background: #fbfcff;
  color: var(--lm-muted);
  font-size: 15px;
}
.google-account-menu--modern .google-account-menu__legal a {
  color: var(--lm-muted);
  text-decoration: none;
  text-align: center;
  font-weight: 600;
}
.google-account-menu--modern .google-account-menu__legal span { height: 24px; background: var(--lm-line); }

/* Settings premium screen */
body.settings-page--premium {
  min-height: 100vh;
  height: auto;
  overflow: auto;
  background:
    radial-gradient(circle at 85% 0%, rgba(111, 66, 216, .10), transparent 30%),
    radial-gradient(circle at 8% 18%, rgba(66, 133, 244, .08), transparent 28%),
    #f8faff;
  color: var(--lm-ink);
}

.settings-topbar {
  min-height: 76px;
  padding: 12px 28px;
  display: grid;
  grid-template-columns: 170px minmax(280px, 620px) 1fr;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid rgba(226, 230, 240, .86);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.settings-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--lm-ink);
  font-weight: 800;
  font-size: 20px;
}
.settings-topbar__search {
  height: 52px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  background: #f1f4fa;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 8px;
  color: #697386;
}
.settings-topbar__search:focus-within { background: #fff; border-color: #d7ddec; box-shadow: 0 8px 24px rgba(16,24,40,.08); }
.settings-topbar__search input { border: 0; background: transparent; height: 100%; outline: 0; min-width: 0; }
.settings-topbar__search button { width: 36px; height: 36px; border-radius: 50%; color: #667085; }
.settings-topbar__icons { margin-left: auto; display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; }
.settings-topbar__icons a:not(.settings-topbar__avatar),
.settings-topbar__icons button {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; text-decoration: none; color: #475467; font-weight: 700;
}
.settings-topbar__icons a:hover, .settings-topbar__icons button:hover { background: #f1f3f8; }
.settings-topbar__avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(145deg, #8b5cf6, #6545c7); color: #fff; text-decoration: none; font-weight: 800; }

.settings-layout--premium {
  max-width: 1420px;
  margin: 0 auto;
  padding: 34px 32px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
}
.settings-content { min-width: 0; }
.settings-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.settings-hero h1 {
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: -.04em;
  margin: 6px 0 10px;
}
.settings-hero p { margin: 0; color: var(--lm-muted); font-size: 16px; }
.settings-back { color: var(--lm-purple-dark); text-decoration: none; font-weight: 800; font-size: 14px; }

.settings-tabs--premium {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--lm-line);
  margin-bottom: 28px;
  overflow-x: auto;
}
.settings-tabs--premium .settings-tab {
  padding: 16px 18px 14px;
  color: #475467;
  border-bottom: 3px solid transparent;
  border-radius: 12px 12px 0 0;
  font-weight: 700;
  white-space: nowrap;
}
.settings-tabs--premium .settings-tab:hover { background: rgba(111, 66, 216, .06); }
.settings-tabs--premium .settings-tab.is-active { color: var(--lm-purple-dark); border-bottom-color: var(--lm-purple); background: linear-gradient(180deg, rgba(111,66,216,.06), transparent); }

.settings-page--premium .settings-panel { display: none; }
.settings-page--premium .settings-panel.is-active { display: block; }
.settings-panel__head--premium { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.settings-panel__head--premium h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.settings-panel__head--premium p { margin: 0; color: var(--lm-muted); }

.settings-page--premium .settings-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #d8ddeb;
  border-radius: 12px;
  color: var(--lm-purple-dark);
  background: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.settings-page--premium .settings-button:hover { background: #faf8ff; border-color: #c6b6f4; }
.settings-page--premium .settings-button--primary { color: #fff; background: linear-gradient(145deg, #7c3aed, #5b35b1); border-color: transparent; box-shadow: 0 12px 28px rgba(111,66,216,.22); }
.settings-page--premium .settings-button--primary:hover { background: linear-gradient(145deg, #6d28d9, #4c1d95); }

.premium-account-list { display: grid; gap: 14px; }
.premium-account-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 24px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(219, 223, 234, .94);
  border-radius: 20px;
  box-shadow: var(--lm-card-shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.premium-account-card:hover { transform: translateY(-1px); border-color: #d7caf8; box-shadow: 0 4px 14px rgba(16,24,40,.07), 0 18px 42px rgba(16,24,40,.09); }
.premium-account-card__avatar { width: 68px; height: 68px; font-size: 28px; }
.premium-account-card__titleline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.premium-account-card h3 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.premium-account-card__email { margin: 4px 0 0; color: #344054; font-size: 15px; }
.premium-account-card__meta { margin: 10px 0 0; color: var(--lm-muted); font-size: 14px; }
.premium-account-card__chips { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.premium-account-card__chips span {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: #f6f7fb; color: #536079; font-weight: 700; font-size: 13px;
}
.premium-status {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; padding: 0 12px; border-radius: 999px; background: #e8f6ee; color: #0b7a38; font-weight: 800; font-size: 13px;
}
.premium-status.is-disabled { background: #f3f4f6; color: #667085; }
.premium-account-card__actions { display: grid; grid-template-columns: auto auto 44px; align-items: start; gap: 10px; }
.premium-account-card__actions button,
.premium-user-row__actions button,
.settings-side-card button {
  min-height: 40px; padding: 0 14px; border: 1px solid #dce1ee; border-radius: 11px; background: #fff; color: var(--lm-purple-dark); font-weight: 800;
}
.premium-account-card__actions button:hover,
.premium-user-row__actions button:hover,
.settings-side-card button:hover { background: #faf8ff; border-color: #c7b9f4; }
.premium-account-card__actions .premium-icon-button { width: 44px; padding: 0; font-size: 18px; }
.premium-account-card__actions small { grid-column: 1 / -1; justify-self: end; text-align: right; color: var(--lm-muted); line-height: 1.45; margin-top: 4px; }
.premium-account-card__actions small strong { color: #344054; }
.premium-account-card__actions small span { color: #17a34a; font-weight: 900; }

.premium-users-section { margin-top: 32px; }
.premium-users-table {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--lm-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 14px 34px rgba(16,24,40,.05);
}
.premium-users-table__head,
.premium-user-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.3fr) 145px minmax(170px, 1fr) 145px 130px;
  align-items: center;
  gap: 16px;
}
.premium-users-table__head { padding: 14px 22px; color: #667085; font-weight: 800; font-size: 13px; border-bottom: 1px solid var(--lm-line); background: #fbfcff; }
.premium-user-row { min-height: 72px; padding: 14px 22px; border-bottom: 1px solid #eef1f6; }
.premium-user-row:last-child { border-bottom: 0; }
.premium-user-row__person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.premium-user-row__person strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.premium-user-row__person small { display: block; color: var(--lm-muted); font-size: 13px; margin-top: 3px; }
.premium-role { justify-self: start; padding: 7px 12px; border-radius: 999px; background: #eaf1ff; color: #175cd3; font-size: 13px; font-weight: 800; }
.premium-role--admin { background: var(--lm-purple-soft); color: var(--lm-purple-dark); }
.premium-assigned-dots { display: flex; gap: 6px; align-items: center; }
.premium-assigned-dots em { width: 28px; height: 28px; font-size: 12px; font-style: normal; }
.premium-user-row__actions { display: flex; gap: 8px; justify-content: flex-end; }
.premium-account-mini { width: 42px; height: 42px; flex: 0 0 42px; }

.premium-user-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.premium-person-card {
  background: #fff; border: 1px solid var(--lm-line); border-radius: 18px; padding: 20px; box-shadow: var(--lm-card-shadow);
}
.premium-person-card__head { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; }
.premium-person-card h3 { margin: 0; }
.premium-person-card p { margin: 4px 0 0; color: var(--lm-muted); }
.premium-assignment-list { margin-top: 18px; display: grid; gap: 10px; }
.premium-assignment-list label { display: flex; align-items: center; gap: 10px; color: #344054; }

.settings-aside { display: grid; align-content: start; gap: 14px; position: sticky; top: 104px; }
.settings-side-card {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--lm-line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--lm-card-shadow);
}
.settings-side-card h3 { margin: 0 0 16px; font-size: 17px; }
.settings-side-card dl { margin: 0; display: grid; gap: 14px; }
.settings-side-card dl div { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.settings-side-card dt { color: #475467; font-weight: 700; font-size: 14px; }
.settings-side-card dd { margin: 0; font-weight: 900; color: var(--lm-ink); }
.settings-side-card button { width: 100%; margin-top: 18px; }
.settings-side-card--tips p { display: grid; grid-template-columns: 34px 1fr; gap: 10px; color: #536079; margin: 14px 0; line-height: 1.35; }
.settings-side-card--tips p span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--lm-purple-soft); }

.premium-form {
  background: #fff;
  border: 1px solid var(--lm-line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--lm-card-shadow);
}
.premium-form__section { grid-column: 1 / -1; margin: 12px 0 0; color: var(--lm-purple-dark); }
.settings-page--premium .mail-account-form label { color: #344054; font-weight: 800; }
.settings-page--premium .mail-account-form input,
.settings-page--premium .mail-account-form select,
.settings-page--premium .mail-account-form textarea {
  border-radius: 12px; border-color: #dce1ee; min-height: 44px; background: #fff;
}
.settings-page--premium .mail-account-form input:focus,
.settings-page--premium .mail-account-form select:focus,
.settings-page--premium .mail-account-form textarea:focus { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(111,66,216,.10); }

.settings-modal--premium {
  border-radius: 22px;
  border: 1px solid var(--lm-line);
  box-shadow: var(--lm-pop-shadow);
  max-width: 760px;
}
.settings-modal--premium .settings-modal__header { background: linear-gradient(180deg, #fff, #fbfcff); }
.settings-modal--premium .settings-modal__tabs button.is-active { background: var(--lm-purple-soft); color: var(--lm-purple-dark); }
.settings-toast { background: #202124; color: #fff; }

@media (max-width: 1120px) {
  .settings-layout--premium { grid-template-columns: 1fr; }
  .settings-aside { position: static; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .premium-account-card { grid-template-columns: 70px 1fr; }
  .premium-account-card__actions { grid-column: 1 / -1; grid-template-columns: auto auto 44px 1fr; }
  .premium-account-card__actions small { grid-column: 4; margin-top: 0; align-self: center; }
}
@media (max-width: 820px) {
  .settings-topbar { grid-template-columns: 1fr auto; }
  .settings-topbar__brand { display: none; }
  .settings-topbar__search { min-width: 0; }
  .settings-layout--premium { padding: 24px 16px 36px; }
  .settings-hero { align-items: flex-start; flex-direction: column; }
  .premium-account-card { grid-template-columns: 58px 1fr; padding: 18px; }
  .premium-account-card__avatar { width: 54px; height: 54px; font-size: 22px; }
  .premium-account-card__actions { display: flex; flex-wrap: wrap; }
  .premium-account-card__actions small { width: 100%; text-align: left; }
  .premium-users-table__head { display: none; }
  .premium-user-row { grid-template-columns: 1fr; gap: 10px; }
  .premium-user-grid, .settings-aside { grid-template-columns: 1fr; }
  .google-account-menu--modern .google-account-menu__identity { grid-template-columns: 64px 1fr 34px; padding: 24px 20px 18px; }
  .google-account-menu__avatar-wrap, .google-account-menu--modern .google-account-menu__avatar { width: 60px; height: 60px; }
  .google-account-menu__identity-main strong { font-size: 20px; }
  .google-account-menu__identity-main span { font-size: 15px; }
  .google-account-menu--modern .google-account-menu__manage, .google-account-menu__divider, .google-account-menu--modern .google-account-menu__accounts, .google-account-menu--modern .google-account-menu__actions { margin-left: 20px; margin-right: 20px; padding-left: 0; padding-right: 0; }
}
