/* EQ Mail Web — marca Midit (tokens alinhados a accounts/busca) */

:root {
  --midit-blue: #1f6fc4;
  --midit-accent: #3d9cf0;
  --midit-blue-deep: #165a9e;
  --bg: #f4f7fb;
  --bg-accent: #e8eef6;
  --surface: #ffffff;
  --ink: #1a2330;
  --muted: #5a6b82;
  --line: rgba(31, 111, 196, 0.18);
  --blue: var(--midit-blue);
  --blue-soft: rgba(61, 156, 240, 0.16);
  --blue-nav: rgba(61, 156, 240, 0.22);
  --hover: rgba(31, 111, 196, 0.08);
  --unread: #1a2330;
  --radius: 14px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --font-display: "Sora", "Outfit", "Segoe UI", sans-serif;
  --side-w: 256px;
  --row-h: 44px;
  --row-pad-y: 0.35rem;
  --focus: 0 0 0 3px rgba(61, 156, 240, 0.35);
}

body.theme-dark {
  --bg: #070b14;
  --bg-accent: #0d1524;
  --surface: #121b2e;
  --ink: #eaf2ff;
  --muted: #9bb0cc;
  --line: rgba(125, 168, 220, 0.22);
  --blue: #3d9cf0;
  --blue-soft: rgba(61, 156, 240, 0.18);
  --blue-nav: rgba(61, 156, 240, 0.28);
  --hover: rgba(61, 156, 240, 0.12);
  --unread: #eaf2ff;
  color-scheme: dark;
}

body.density-compact {
  --row-h: 34px;
  --row-pad-y: 0.15rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); }
a { color: var(--blue); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.spacer { flex: 1; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.skip-link {
  position: absolute; left: 0.75rem; top: -3rem; z-index: 2000;
  background: var(--blue); color: #fff; padding: 0.55rem 0.9rem;
  border-radius: 8px; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 0.75rem; outline: none; box-shadow: var(--focus); }
:focus-visible { outline: none; box-shadow: var(--focus); }
.err {
  color: #8c1d18;
  background: #fce8e6;
  border: 1px solid #f5c6c2;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
body.theme-dark .err {
  color: #ffc9c9;
  background: rgba(240, 113, 120, 0.15);
  border-color: rgba(240, 113, 120, 0.4);
}
.pad { padding: 1.5rem; }

.icon-btn {
  width: 40px; height: 40px;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--muted);
  cursor: pointer; font-size: 1.15rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

.btn-primary {
  border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--midit-accent) 0%, var(--midit-blue) 100%);
  color: #fff;
  font-weight: 600; padding: 0.75rem 1.4rem;
  cursor: pointer; font-size: 0.95rem;
  font-family: var(--font-display);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  border: 0; background: transparent; color: var(--muted);
  border-radius: 12px; padding: 0.55rem 1rem; cursor: pointer;
}
.btn-ghost:hover { background: var(--hover); color: var(--ink); }

/* —— Login (padrão accounts Midit · light, 2 colunas) —— */
.login-shell.midit-login {
  min-height: 100vh;
  display: block;
  padding: 0;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(31, 111, 196, 0.14), transparent 58%),
    radial-gradient(700px 420px at 92% 8%, rgba(61, 156, 240, 0.1), transparent 52%),
    radial-gradient(600px 400px at 70% 100%, rgba(31, 111, 196, 0.08), transparent 55%),
    linear-gradient(165deg, #f7fafc 0%, #eef3f9 48%, #e8eef6 100%);
}
.login-shell.midit-login::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(31, 111, 196, 0.14) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 25%, transparent 75%);
}
.midit-login__shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: stretch;
}
.midit-login__brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 5vw, 4.5rem);
}
.midit-login__logo-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  width: fit-content;
}
.midit-login__mark {
  width: clamp(96px, 14vw, 132px);
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.16));
}
.midit-login__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.35rem);
  letter-spacing: 0.08em;
  line-height: 1;
  background: linear-gradient(120deg, #0f172a 8%, #1f6fc4 55%, #3d9cf0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.midit-login__tagline {
  margin: 1.35rem 0 0;
  max-width: 22rem;
  font-size: 1.08rem;
  line-height: 1.45;
  color: var(--muted);
}
.midit-login__services {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.midit-login__services li {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #334155;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(31, 111, 196, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}
.midit-login__panel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 3rem);
}
.login-shell .login-card.midit-login__panel {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid rgba(31, 111, 196, 0.16);
  border-radius: 22px;
  padding: 2rem 1.75rem 1.65rem;
  box-shadow:
    0 20px 48px rgba(15, 23, 42, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}
.midit-login__panel h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: #0f172a;
}
.midit-login__panel .hint,
.midit-login__panel .hint-top {
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.4;
}
.midit-login__panel .hint code {
  font-size: 0.88em;
  color: #1f6fc4;
  background: rgba(31, 111, 196, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
.midit-login__panel label {
  display: block;
  margin: 0.95rem 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #475569;
}
.midit-login__panel input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  color: #0f172a;
  font-family: var(--font);
}
.midit-login__panel input:focus {
  outline: none;
  border-color: var(--midit-blue);
  box-shadow: 0 0 0 3px rgba(31, 111, 196, 0.18);
}
.midit-login__panel input::placeholder {
  color: #94a3b8;
}
.midit-login__panel .btn-primary,
.midit-login__panel .btn-midit {
  width: 100%;
  margin-top: 1.15rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(31, 111, 196, 0.28);
}
.midit-login__panel .btn-midit {
  margin-top: 0.15rem;
}
.midit-login__panel form .btn-primary {
  margin-top: 1.25rem;
}
.login-or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(31, 111, 196, 0.16);
}
.login-or span { white-space: nowrap; }
.login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  margin: 1.15rem 0 0;
  font-size: 0.88rem;
}
.login-links a {
  text-decoration: none;
  font-weight: 500;
}
.login-links a:hover { text-decoration: underline; }
.login-legacy {
  margin: 1.1rem 0 0;
  font-size: 0.78rem;
}

@media (max-width: 860px) {
  .midit-login__shell {
    grid-template-columns: 1fr;
  }
  .midit-login__brand {
    padding: 2rem 1.35rem 0.5rem;
    align-items: center;
    text-align: center;
  }
  .midit-login__logo-link {
    align-items: center;
  }
  .midit-login__tagline {
    margin-left: auto;
    margin-right: auto;
  }
  .midit-login__services {
    justify-content: center;
  }
  .midit-login__mark {
    width: 88px;
  }
  .midit-login__wordmark {
    font-size: 2rem;
  }
  .midit-login__panel-wrap {
    padding: 1rem 1.1rem 2rem;
  }
}

/* legado (se ainda referenciado) */
.login-shell:not(.midit-login) {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(700px 320px at 12% 0%, rgba(61, 156, 240, 0.28) 0%, transparent 55%),
    radial-gradient(500px 280px at 90% 100%, rgba(31, 111, 196, 0.14) 0%, transparent 50%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-accent) 100%);
}
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  box-shadow: 0 12px 40px rgba(16, 32, 56, 0.1);
}
.login-brand {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.15rem;
}
.login-logo-img {
  display: block;
  width: min(220px, 100%);
  height: auto;
}
.login-mark-img { display: block; width: 56px; height: 56px; }
.login-mark {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.1;
}
.login-submark {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}
.login-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
  font-family: var(--font-display);
}
.login-card label { display: block; margin: 1rem 0 0.35rem; font-size: 0.85rem; color: var(--muted); }
.login-card input {
  width: 100%; padding: 0.85rem 1rem;
  border: 1px solid #747775; border-radius: 8px;
  font-size: 1rem; background: #fff;
}
.login-card input:focus {
  outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue);
}
.login-card .btn-primary,
.login-card .btn-ghost[type="submit"],
.login-card .btn-midit { width: 100%; margin-top: 1.25rem; }
.login-card .btn-midit { margin-top: 0.5rem; }

/* —— Shell Gmail —— */
.gmail-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "top top"
    "side main";
  background: var(--bg);
}
.gmail-shell.nav-collapsed {
  grid-template-columns: 0 1fr;
  grid-template-areas:
    "top top"
    "main main";
}
.gmail-shell.nav-collapsed .g-side {
  display: none;
}

/* Main + right apps rail (estilo Drive / Google) */
.mail-main-row {
  grid-area: main;
  display: flex;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.mail-main-row > .g-main {
  grid-area: unset;
  flex: 1;
  min-width: 0;
}
.mail-rail {
  flex: 0 0 56px;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0 16px;
  border-left: 1px solid var(--line);
  background: var(--bg);
  z-index: 5;
}
.mail-rail-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink);
}
.mail-rail-btn:hover { background: var(--hover); }
.mail-rail-btn.is-on { background: var(--blue-soft); }
.mail-rail-spacer { flex: 1; }
.rail-ico { display: block; width: 24px; height: 24px; }
.rail-ico-cal {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #1a73e8;
  color: #fff;
  font: 700 13px/28px var(--font-display), sans-serif;
  text-align: center;
}
.rail-ico-contacts {
  border-radius: 50%;
  background: #1a73e8;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/></svg>") center / 16px no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/></svg>") center / 16px no-repeat;
}
.rail-ico-meet {
  border-radius: 6px;
  background: #00897b;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M17 10.5V7a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h12a1 1 0 001-1v-3.5l4 4v-11l-4 4z'/></svg>") center / 18px no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M17 10.5V7a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h12a1 1 0 001-1v-3.5l4 4v-11l-4 4z'/></svg>") center / 18px no-repeat;
}

.mail-rail-panel {
  position: absolute;
  top: 0;
  right: 56px;
  bottom: 0;
  width: min(340px, calc(100% - 56px));
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -2px 0 12px rgba(16, 24, 40, 0.1);
  z-index: 20;
  display: flex;
  flex-direction: column;
}
.mail-rail-panel[hidden] { display: none !important; }
.mail-rail-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 12px 8px 8px 16px;
}
.mail-rail-panel-head h2 {
  margin: 0;
  font: 600 1.05rem/1.3 var(--font-display), sans-serif;
}
.mail-rail-panel-actions { display: flex; gap: 2px; align-items: center; }
.mail-rail-date {
  border: 0;
  background: transparent;
  font: 500 15px/1.3 var(--font-display), sans-serif;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.mail-rail-panel-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 10px;
}
.mail-rail-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  margin-right: 4px;
}
.mail-rail-chip:hover { background: var(--hover); }
.mail-rail-search {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 20px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
}
.mail-rail-cal-timeline {
  flex: 1;
  overflow: auto;
  position: relative;
  padding: 0 8px 24px 0;
}
.mail-rail-cal-hour {
  display: grid;
  grid-template-columns: 48px 1fr;
  height: 48px;
  align-items: start;
}
.mail-rail-cal-hour-label {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  padding-right: 8px;
  transform: translateY(-6px);
}
.mail-rail-cal-hour-line {
  border-top: 1px solid var(--line);
  height: 100%;
}
.mail-rail-cal-now {
  position: absolute;
  left: 48px;
  right: 8px;
  height: 2px;
  background: #ea4335;
  pointer-events: none;
}
.mail-rail-cal-now::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ea4335;
}
.mail-rail-cal-ev {
  position: absolute;
  left: 52px;
  right: 12px;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  color: #fff;
  background: #1a73e8;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  z-index: 1;
  text-decoration: none;
  box-sizing: border-box;
  min-height: 18px;
}
.mail-rail-cal-ev:hover { filter: brightness(1.06); }
.mail-rail-cal-ev.meeting { background: #9334e6; }
.mail-rail-cal-ev.all-day { background: #188038; }
.mail-rail-meet-sub {
  margin: 1rem 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mail-rail-meet-upcoming {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mail-rail-meet-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
.mail-rail-meet-item:hover { background: var(--hover); }
.mail-rail-meet-when {
  font-size: 0.75rem;
  color: var(--muted);
}
.mail-rail-meet-title {
  font-size: 0.9rem;
  font-weight: 600;
}
.mail-rail-meet-empty {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.25rem 0;
}
.mail-rail-panel-foot {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.mail-rail-panel-foot a {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.mail-rail-panel-foot a:hover { text-decoration: underline; }

.mail-rail-contact-list {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
  flex: 1;
  overflow: auto;
}
.mail-rail-contact-list li { margin: 0; padding: 0; }
.mail-rail-contact-list li > button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
}
.mail-rail-contact-list li > button:hover { background: var(--hover); }
.mail-rail-contact-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.mail-rail-contact-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.mail-rail-contact-meta strong {
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-rail-contact-meta span {
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-rail-contact-empty {
  padding: 1.25rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.mail-rail-meet-body {
  padding: 0.5rem 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.mail-rail-meet-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.mail-rail-meet-cta:hover { background: var(--blue-nav); }
.mail-rail-meet-link {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.mail-rail-meet-link:hover { text-decoration: underline; }

.g-top {
  grid-area: top;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0 0.85rem 0 0.35rem;
  background: var(--bg);
}
.g-top-left {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}
.g-logo {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: var(--ink);
  min-width: 0; padding: 0 0.25rem;
}
.g-logo-img { display: block; width: 32px; height: 32px; flex-shrink: 0; }
.g-logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 600; color: var(--ink);
  white-space: nowrap;
}
.g-search {
  width: 100%;
  max-width: 720px;
  justify-self: center;
  display: flex; align-items: center; gap: 0.35rem;
  background: var(--blue-soft);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0.15rem 0.5rem 0.15rem 1rem;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.g-search:focus-within {
  background: var(--surface);
  border-color: var(--blue);
  box-shadow: var(--focus);
}
.g-search-ico { color: var(--muted); font-size: 1.2rem; }
.g-search input {
  flex: 1; border: 0; background: transparent;
  padding: 0.7rem 0.4rem; font-size: 1rem; outline: none;
  min-width: 0;
}
.g-top-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  justify-self: end;
}
.g-action-group,
.g-tb-group {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}
.g-action-sep {
  width: 1px;
  height: 22px;
  margin: 0 0.35rem;
  background: var(--line);
  flex-shrink: 0;
}

/* Launcher de serviços (paridade midit.pt) */
.eq-apps {
  position: relative;
  margin-left: 0.15rem;
  z-index: 91;
}
.eq-apps-btn {
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 50%;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  padding: 0;
  color: inherit;
}
.eq-apps-btn:hover,
.eq-apps-btn.is-open {
  background: color-mix(in srgb, var(--muted, #5a655e) 14%, transparent);
}
.eq-apps-grid {
  grid-template-columns: repeat(3, 5px);
  gap: 3px;
  display: grid;
}
.eq-apps-grid i {
  background: #5f6368;
  border-radius: 50%;
  width: 5px;
  height: 5px;
}
.eq-apps-panel {
  z-index: 12050;
  scrollbar-width: thin;
  background: #e9eef6;
  border: 1px solid rgba(60, 64, 67, 0.12);
  border-radius: 28px;
  width: min(320px, 94vw);
  max-height: min(440px, 70vh);
  padding: 1rem 0.65rem 0.85rem;
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  overflow: hidden auto;
  box-shadow: 0 4px 16px rgba(60, 64, 67, 0.22), 0 0 0 1px rgba(60, 64, 67, 0.04);
}
.eq-apps-panel[hidden] { display: none !important; }
.eq-apps-title {
  color: #3c4043;
  margin: 0 0.75rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 500;
}
.eq-apps-grid-list {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.15rem 0.2rem;
  margin: 0;
  padding: 0 0.35rem 0.35rem;
  list-style: none;
  display: grid;
}
.eq-apps-grid-list a {
  color: #202124;
  border-radius: 16px;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.65rem 0.35rem 0.55rem;
  text-decoration: none;
  display: flex;
}
.eq-apps-grid-list a:hover,
.eq-apps-grid-list a:focus-visible {
  background: rgba(32, 33, 36, 0.08);
  outline: none;
}
.eq-apps-ico {
  flex-shrink: 0;
  place-items: center;
  width: 48px;
  height: 48px;
  display: grid;
}
.eq-apps-ico svg,
.eq-apps-ico img {
  object-fit: contain;
  border-radius: 10px;
  width: 48px;
  height: 48px;
  display: block;
}
.eq-apps-label {
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #3c4043;
  max-width: 100%;
  font-size: 0.78rem;
  line-height: 1.2;
  overflow: hidden;
}
body.theme-dark .eq-apps-panel {
  color: #e8ebe6;
  background: #1e2420;
  border-color: rgba(255, 255, 255, 0.1);
}
body.theme-dark .eq-apps-title,
body.theme-dark .eq-apps-label { color: #e8ebe6; }
body.theme-dark .eq-apps-grid-list a:hover,
body.theme-dark .eq-apps-grid-list a:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}
body.theme-dark .eq-apps-grid i { background: #c4cbc4; }

/* Avatar + menu de conta (paridade Drive) */
.eq-account-wrap {
  position: relative;
  margin-left: 0.15rem;
  z-index: 90;
}
.gdrive-avatar {
  width: 36px;
  height: 36px;
  border: 2px solid transparent;
  border-radius: 50%;
  background:
    linear-gradient(#1e8e3e, #1e8e3e) padding-box,
    conic-gradient(from 180deg, #ea4335, #fbbc04, #34a853, #4285f4, #ea4335) border-box;
  color: #fff;
  font: 600 14px/1 "Outfit", "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
}
.gdrive-avatar--photo {
  background:
    linear-gradient(#fff, #fff) padding-box,
    conic-gradient(from 180deg, #ea4335, #fbbc04, #34a853, #4285f4, #ea4335) border-box;
}
.gdrive-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.gdrive-avatar:hover { filter: brightness(1.05); }
.eq-account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 376px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 4px 24px rgba(60, 64, 67, 0.28), 0 0 0 1px rgba(60, 64, 67, 0.08);
  z-index: 12000;
  overflow: hidden;
  padding: 8px 0 4px;
  color: #202124;
}
.eq-account-menu[hidden] { display: none !important; }
.eq-account-identity {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px 56px 12px 22px;
}
.eq-account-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f1f3f4;
  color: #444746;
  font: 400 22px/1 "Segoe UI", sans-serif;
  cursor: pointer;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.eq-account-close span {
  display: block;
  transform: translateY(-1px);
}
.eq-account-close:hover { background: #e8eaed; }
.eq-account-avatar-lg {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid transparent;
  background:
    linear-gradient(#1e8e3e, #1e8e3e) padding-box,
    conic-gradient(from 180deg, #ea4335, #fbbc04, #34a853, #4285f4, #ea4335) border-box;
  color: #fff;
  font: 600 32px/72px "Outfit", "Segoe UI", sans-serif;
  text-align: center;
  flex-shrink: 0;
  overflow: hidden;
}
.eq-account-avatar-lg--photo {
  background:
    linear-gradient(#fff, #fff) padding-box,
    conic-gradient(from 180deg, #ea4335, #fbbc04, #34a853, #4285f4, #ea4335) border-box;
  line-height: 0;
}
.eq-account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.eq-account-cam {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #dadce0;
  color: #202124;
  font-size: 12px;
  line-height: 24px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(60,64,67,.2);
}
.eq-account-id-text { min-width: 0; }
.eq-account-name {
  margin: 0;
  font: 600 16px/1.25 "Outfit", "Segoe UI", sans-serif;
  color: #202124;
  word-break: break-word;
}
.eq-account-email {
  margin: 2px 0 0;
  font-size: 13px;
  color: #5f6368;
  word-break: break-all;
}
.eq-account-list {
  display: flex;
  flex-direction: column;
  padding: 4px 12px 8px;
  gap: 2px;
}
.eq-account-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: #202124;
  font: 500 14px/1.2 "Outfit", "Segoe UI", sans-serif;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  text-align: left;
}
.eq-account-row:hover { background: #f1f3f4; }
.eq-account-row-ico {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  font: 600 16px/1 sans-serif;
  color: #0b57d0;
}
.eq-account-row-plus { background: #e8f0fe; }
.eq-account-row-out {
  background: #e8f0fe;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M10 17l1.4-1.4L8.8 13H19v-2H8.8l2.6-2.6L10 7l-5 5 5 5zM4 19h8v2H4c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h8v2H4v14z'/></svg>") center / 16px no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M10 17l1.4-1.4L8.8 13H19v-2H8.8l2.6-2.6L10 7l-5 5 5 5zM4 19h8v2H4c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h8v2H4v14z'/></svg>") center / 16px no-repeat;
}
.eq-account-pills {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 16px 12px;
}
.eq-account-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 24px;
  border: 1px solid #dadce0;
  background: #f8f9fa;
  color: #202124;
  font: 500 13px/1.25 "Outfit", "Segoe UI", sans-serif;
  text-decoration: none;
  box-sizing: border-box;
}
.eq-account-pill:hover { background: #f1f3f4; }
.eq-account-pill-ico {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font: 700 10px/1 "Outfit", sans-serif;
}
.eq-account-pill-eq {
  background: #0f9d58;
  color: #fff;
}
.eq-account-pill-star {
  background: #202124;
  color: #fff;
  font-size: 14px;
}
.eq-account-pill-cloud {
  border-radius: 6px;
  background: conic-gradient(from 200deg, #4285f4, #ea4335, #fbbc04, #34a853, #4285f4);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 006 20h13a5 5 0 00.35-9.96z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 006 20h13a5 5 0 00.35-9.96z'/></svg>") center / contain no-repeat;
}
.eq-account-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px 14px;
  font-size: 12px;
  color: #5f6368;
}
.eq-account-foot a {
  color: #5f6368;
  text-decoration: none;
}
.eq-account-foot a:hover { text-decoration: underline; }

body.theme-dark .eq-account-menu {
  background: #292a2d;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #e8eaed;
}
body.theme-dark .eq-account-name,
body.theme-dark .eq-account-row,
body.theme-dark .eq-account-pill { color: #e8eaed; }
body.theme-dark .eq-account-email,
body.theme-dark .eq-account-foot,
body.theme-dark .eq-account-foot a { color: #9aa0a6; }
body.theme-dark .eq-account-close,
body.theme-dark .eq-account-row:hover,
body.theme-dark .eq-account-pill:hover { background: #3c4043; }
body.theme-dark .eq-account-pill {
  background: #35363a;
  border-color: #5f6368;
}
body.theme-dark .eq-account-cam {
  background: #292a2d;
  border-color: #5f6368;
  color: #e8eaed;
}


.g-side {
  grid-area: side;
  padding: 0.5rem 0.75rem 1rem 0.75rem;
  overflow: auto;
}
.g-compose {
  display: inline-flex; align-items: center; gap: 0.75rem;
  border: 0; border-radius: 14px;
  background: linear-gradient(135deg, var(--midit-accent) 0%, var(--midit-blue) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600; font-size: 0.95rem;
  padding: 0.95rem 1.4rem 0.95rem 1.1rem;
  margin: 0.35rem 0 1rem 0.35rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(31, 111, 196, 0.28);
  transition: filter 0.15s, transform 0.15s;
}
.g-compose:hover { filter: brightness(1.05); transform: translateY(-1px); }
.g-compose-ico {
  width: 24px; height: 24px; display: grid; place-items: center; font-size: 1.1rem;
}
.g-nav { display: flex; flex-direction: column; gap: 2px; }
.g-nav button {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: 0; background: transparent;
  text-align: left;
  padding: 0.55rem 0.85rem 0.55rem 1.1rem;
  border-radius: 12px;
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 44px;
}
.g-nav button:hover { background: var(--hover); }
.g-nav button.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}
.g-nav .ico { opacity: 0.85; font-size: 1.05rem; }
.g-nav .cnt { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.g-nav button.active .cnt { color: var(--blue); }

.g-main {
  grid-area: main;
  padding: 0 0.75rem 1rem 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mail-main-row > .g-main {
  padding-right: 0.75rem;
}
.g-main.split,
.g-main.stack {
  gap: 0.75rem;
  align-items: stretch;
}
.g-main.split {
  display: grid;
  grid-template-columns: minmax(300px, 42%) 1fr;
}
.g-main.stack {
  display: grid;
  grid-template-rows: minmax(180px, 38%) 1fr;
  grid-template-columns: 1fr;
}
.g-main.split #pane-list,
.g-main.split #pane-reader,
.g-main.stack #pane-list,
.g-main.stack #pane-reader {
  display: flex !important;
  min-width: 0;
  min-height: 0;
  height: 100%;
}
.g-main.split #btn-back-list,
.g-main.stack #btn-back-list {
  display: none;
}
#btn-layout[data-layout="stack"] {
  color: var(--blue);
}
.g-card {
  flex: 1;
  min-height: 0;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.g-list-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid var(--line);
  padding: 0 0.35rem 0 0.5rem;
  min-height: 48px;
}
.g-tabs {
  display: flex;
  gap: 0;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.g-tabs::-webkit-scrollbar { display: none; }
.g-tab {
  border: 0; background: transparent;
  padding: 0.85rem 0.95rem;
  font-size: 0.9rem; font-weight: 500;
  color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.g-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.g-tab:hover { background: var(--hover); }
.g-list-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  padding-right: 0.15rem;
}
.g-list-meta .g-count {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0 0.35rem;
  white-space: nowrap;
}

.g-toolbar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.3rem 0.65rem;
  border-bottom: 1px solid var(--line);
  min-height: 48px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}
.g-check {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
}
.g-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
}
.g-count { font-size: 0.8rem; color: var(--muted); }
.g-who { font-size: 0.8rem; }

.g-list {
  list-style: none; margin: 0; padding: 0;
  overflow: auto; flex: 1;
}
.list-status {
  margin: 0;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--line);
  background: #eaf1fb;
  color: #174ea6;
}
.list-status[data-kind="error"] {
  background: #fce8e6;
  color: #8c1d18;
}

.g-list li {
  display: grid;
  grid-template-columns: 40px 28px minmax(120px, 180px) 1fr 22px auto;
  align-items: center;
  gap: 0.35rem;
  padding: var(--row-pad-y) 1rem var(--row-pad-y) 0.5rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 0.9rem;
  min-height: var(--row-h);
}
.g-list li:hover { box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px rgba(0,0,0,.08); z-index: 1; position: relative; }
.g-list li.unread { background: #fff; }
.g-list li.unread .from,
.g-list li.unread .subj-text { font-weight: 700; color: var(--unread); }
.g-list li.read .from { font-weight: 400; color: #202124; }
.g-list li.active { background: #c2e7ff33; }
.g-list li.focus { outline: 2px solid var(--blue); outline-offset: -2px; }
.g-list li.checked { background: #e8f0fe; }
.g-list .star { border: 0; background: transparent; color: #b0b0b0; cursor: pointer; font-size: 1.05rem; }
.g-list .from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-list .snippet {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted);
}
.g-list .snippet .subj-text { color: inherit; }
.g-list li.unread .snippet .subj-text { color: var(--unread); }
.g-list .attach {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  opacity: 0.85;
}
.g-list .attach.empty-attach { visibility: hidden; }
.g-list .date {
  font-size: 0.8rem; color: var(--muted);
  white-space: nowrap; padding-left: 0.35rem;
  font-weight: 500;
}
.g-list li.unread .date { color: var(--ink); font-weight: 700; }
.g-list .empty {
  display: block; padding: 3rem 1.5rem; text-align: center;
  color: var(--muted); grid-column: 1 / -1;
}
.g-list .empty.loading { color: var(--blue); }
.g-list .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 3.5rem 1.5rem;
  text-align: center;
  grid-column: 1 / -1;
}
.g-list .empty-state .empty-ico {
  width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center;
  font-size: 1.7rem;
  background: var(--blue-soft);
  color: var(--blue);
}
.g-list .empty-state h2 {
  margin: 0.4rem 0 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}
.g-list .empty-state p {
  margin: 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.skel-row {
  pointer-events: none;
  cursor: default !important;
}
.skel-row:hover { box-shadow: none !important; }
.skel-bar {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--hover) 0%, var(--blue-soft) 50%, var(--hover) 100%);
  background-size: 200% 100%;
  animation: skel-shine 1.2s ease-in-out infinite;
}
.skel-row .from .skel-bar { width: 72%; }
.skel-row .snippet .skel-bar { width: 88%; }
.skel-row .date .skel-bar { width: 48px; height: 10px; margin-left: auto; }
.skel-row .chk, .skel-row .star, .skel-row .attach { visibility: hidden; }
@keyframes skel-shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.reader-skel {
  padding: 1.5rem;
}
.reader-skel .skel-bar { margin-bottom: 0.85rem; }
.reader-skel .skel-bar.lg { height: 22px; width: 55%; }
.reader-skel .skel-bar.md { height: 12px; width: 35%; }
.reader-skel .skel-bar.block { height: 120px; width: 100%; margin-top: 1.25rem; }
.g-list .star.on { color: #f4b400; }
.g-toolbar .batch-btn:disabled { opacity: 0.3; }
.list-more {
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
}
.side-folder-add {
  margin: 0.75rem;
  width: calc(100% - 1.5rem);
  font-size: 0.85rem;
}
.g-simple-dlg {
  border: 0;
  border-radius: 12px;
  padding: 0;
  width: min(360px, 92vw);
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
.g-simple-dlg[open] { display: flex; flex-direction: column; }
.g-simple-dlg::backdrop { background: rgba(32,33,36,.4); }
.g-simple-dlg header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}
.g-simple-dlg header h3 { margin: 0; font-size: 1rem; font-weight: 500; }
.g-simple-dlg input {
  margin: 0.75rem 1rem;
  width: calc(100% - 2rem);
  padding: 0.7rem 0.85rem;
  border: 1px solid #747775;
  border-radius: 8px;
  font: inherit;
}
.g-simple-dlg footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
}
.g-simple-dlg .pad-x { padding: 0 1rem; margin: 0; }
.move-folder-list {
  max-height: 50vh;
  overflow: auto;
  padding: 0.35rem;
}
.move-folder-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
.move-folder-list button:hover { background: var(--hover); }

/* Reader */
.g-reader-bar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--line);
  min-height: 52px;
  flex-wrap: wrap;
}
.g-reader-bar .g-tb-reply {
  flex-wrap: wrap;
  gap: 0.2rem;
}
.g-reader-body { overflow: auto; flex: 1; padding: 0.5rem 1.5rem 2rem; }
.g-reader-body h1 {
  font-size: 1.4rem; font-weight: 400; margin: 0.75rem 0 1rem;
}
.g-reader-meta {
  display: flex; gap: 0.75rem; align-items: flex-start;
  margin-bottom: 1.25rem;
}
.g-reader-meta .av {
  width: 40px; height: 40px; border-radius: 50%;
  background: #aecbfa; color: #062e6f;
  display: grid; place-items: center; font-weight: 600; flex-shrink: 0;
}
.g-reader-meta .info { min-width: 0; }
.g-reader-meta .from-line { font-weight: 500; }
.g-reader-meta .to-line { font-size: 0.85rem; color: var(--muted); }
.g-reader-body .attach-note {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: #3c4043;
  background: #f1f3f4;
  border-radius: 8px;
}
.attach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  border: 1px solid var(--line);
  background: #f8f9fa;
  border-radius: 20px;
  padding: 0.4rem 0.85rem 0.4rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
}
.attach-chip:hover { background: var(--blue-soft); border-color: #a8c7fa; }
.attach-chip:disabled { opacity: 0.55; cursor: wait; }
.attach-chip .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.attach-chip .size { color: var(--muted); font-size: 0.78rem; }
.reader-empty { margin-top: 2.5rem; text-align: center; }
.g-reader-body .empty-state { padding-top: 3rem; }
.g-reader-body .empty-state h2 {
  margin: 0.4rem 0 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}
.g-reader-body .empty-state p {
  margin: 0.35rem auto 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.g-reader-body .empty-ico {
  width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center; margin: 0 auto;
  font-size: 1.7rem; background: var(--blue-soft); color: var(--blue);
}
.g-reader-body iframe {
  width: 100%; min-height: 55vh; border: 0;
  background: #fff;
}
.g-main.split .g-reader-body iframe { min-height: 45vh; }
.g-main.stack .g-reader-body iframe { min-height: 28vh; }
.g-main.stack .g-list { max-height: none; }

/* Compose dialog */
.btn-tool {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 18px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
}
.btn-tool:hover { background: var(--hover); color: var(--ink); }
.btn-tool:disabled { opacity: 0.35; cursor: default; }
.g-reader-bar .btn-tool {
  color: var(--ink);
  background: color-mix(in srgb, var(--blue-soft) 55%, transparent);
}
.g-reader-bar .btn-tool:hover:not(:disabled) {
  background: var(--blue-soft);
  color: var(--blue);
}
.g-msg-dlg-tools .btn-tool {
  color: #fff;
  background: rgba(255,255,255,.12);
}
.g-msg-dlg-tools .btn-tool:hover { background: rgba(255,255,255,.22); }
.tool-sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.28);
  margin: 0 0.25rem;
}

.g-compose-dlg {
  border: 0; border-radius: 16px 16px 0 0;
  padding: 0; width: min(640px, 96vw);
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  margin: auto 1rem 0 auto;
  position: fixed;
  bottom: 0; right: 1rem; top: auto; left: auto;
  max-height: 80vh;
  z-index: 1100;
}
.g-compose-dlg[open] {
  display: flex;
  flex-direction: column;
}
.g-compose-dlg::backdrop { background: rgba(32, 33, 36, 0.25); }
.g-compose-dlg form { display: flex; flex-direction: column; max-height: 80vh; }
.g-compose-dlg header {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--midit-blue-deep), var(--midit-blue));
  color: #fff;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  border-radius: 16px 16px 0 0;
}
.g-compose-dlg header h3 { margin: 0; font-size: 0.95rem; font-weight: 500; }
.g-compose-dlg header .icon-btn { color: #fff; }
.g-compose-dlg input, .g-compose-dlg textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--line);
  padding: 0.75rem 1rem; font: inherit; outline: none;
}
.g-compose-dlg textarea { border-bottom: 0; resize: vertical; flex: 1; min-height: 200px; }
.g-compose-dlg footer,
.compose-foot {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.75rem 1rem 1rem;
}
.compose-foot-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
.g-compose-dlg .send { border-radius: 24px; padding: 0.65rem 1.5rem; }
.g-compose-dlg .err { margin: 0.5rem 1rem; }
.g-compose-dlg .ok {
  margin: 0.5rem 1rem;
  color: #137333;
  background: #e6f4ea;
  border: 1px solid #ceead6;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.compose-atts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--line);
}
.c-att-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
}
.c-att-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f1f3f4;
  border-radius: 16px;
  padding: 0.25rem 0.55rem 0.25rem 0.7rem;
  font-size: 0.8rem;
}
.c-att-list button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}
.c-att-list button:hover { color: #8c1d18; }

/* Message popup (double-click) — display só com [open], senão o dialog nunca abre */
.g-msg-dlg {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(880px, 94vw);
  height: min(820px, 90vh);
  max-width: 94vw;
  max-height: 90vh;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  overflow: hidden;
}
.g-msg-dlg[open] {
  display: flex;
  flex-direction: column;
}
.g-msg-dlg::backdrop {
  background: rgba(32, 33, 36, 0.45);
}
.g-msg-dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem 0.65rem 1.1rem;
  background: linear-gradient(135deg, var(--midit-blue-deep), var(--midit-blue));
  color: #fff;
}
.g-msg-dlg-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-msg-dlg-tools { display: flex; align-items: center; gap: 0.1rem; }
.g-msg-dlg-tools .icon-btn { color: #fff; }
.g-msg-dlg-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
}
.g-msg-dlg-body iframe { min-height: 50vh; }

/* Context menu (right-click) */
.ctx-menu {
  position: fixed;
  z-index: 1000;
  min-width: 220px;
  margin: 0;
  padding: 0.35rem 0;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18), 0 1px 2px rgba(0,0,0,.08);
  font-size: 0.9rem;
}
.ctx-menu.hidden { display: none !important; }
.ctx-menu .hidden,
.ctx-menu [hidden] { display: none !important; }
.ctx-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.55rem 1rem;
  font: inherit;
  color: #202124;
  cursor: pointer;
}
.ctx-menu button:hover,
.ctx-menu button:focus {
  background: #e8f0fe;
  color: #174ea6;
  outline: none;
}
.ctx-menu button.danger:hover {
  background: #fce8e6;
  color: #8c1d18;
}
.ctx-menu hr {
  border: 0;
  border-top: 1px solid #e8eaed;
  margin: 0.3rem 0;
}
.ctx-menu .ctx-label {
  padding: 0.35rem 1rem 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.side-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 28, 0.45);
  z-index: 25;
}
.side-backdrop.hidden { display: none !important; }

@media (max-width: 900px) {
  .gmail-shell,
  .gmail-shell.nav-collapsed {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "main";
  }
  .gmail-shell.nav-collapsed .g-side { display: none; }
  .gmail-shell.nav-collapsed .g-side.open,
  .g-side.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--side-w), 86vw);
    background: var(--surface);
    z-index: 30;
    box-shadow: 8px 0 28px rgba(0,0,0,.2);
    padding-top: 0.75rem;
  }
  .mail-rail { display: none; }
  .mail-rail-panel {
    right: 0;
    width: min(360px, 100%);
  }
  .g-list li {
    grid-template-columns: 40px 28px 1fr 18px auto;
    min-height: 48px;
  }
  .g-list .from { display: none; }
  .g-search { max-width: none; }
  .g-logo-text { display: none; }
  .g-top {
    gap: 0.4rem;
    padding: 0 0.45rem;
  }
  .g-action-group #btn-density,
  .g-top-actions #btn-layout { display: none; }
  .g-list-head { padding-right: 0.2rem; }
  .g-tab { padding: 0.8rem 0.7rem; font-size: 0.85rem; }
  .g-toolbar { padding: 0.25rem 0.4rem; }
  .g-reader-bar .g-action-sep { display: none; }
  .g-reader-bar .btn-tool { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
  .icon-btn, .g-nav button, .g-compose { min-height: 44px; }
  .g-compose-dlg {
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
    right: 0; left: 0; bottom: 0; top: 0;
  }
  .g-compose-dlg form { max-height: 100%; height: 100%; }
  .g-compose-dlg header { border-radius: 0; }
  .g-compose-dlg textarea { min-height: 40vh; flex: 1; }
  .compose-foot-secondary { width: 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .skel-bar { animation: none; }
  .g-compose { transition: none; }
}

/* —— Definições —— */
.g-settings-dlg {
  border: none;
  border-radius: 14px;
  padding: 0;
  width: min(720px, 96vw);
  max-height: min(88vh, 720px);
  box-shadow: 0 16px 48px rgba(16, 24, 40, 0.28);
  background: var(--surface);
  color: var(--ink);
}
.g-settings-dlg[open] {
  display: flex;
  flex-direction: column;
}
.g-settings-dlg::backdrop { background: rgba(16, 24, 40, 0.45); }
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.settings-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}
.settings-body {
  display: grid;
  grid-template-columns: 148px 1fr;
  min-height: 320px;
  overflow: hidden;
  flex: 1;
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.5rem;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.settings-tab {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.settings-tab:hover { background: var(--hover); }
.settings-tab.on {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 600;
}
.settings-panels {
  overflow: auto;
  padding: 1rem 1.1rem 1.25rem;
}
.settings-panel { display: none; }
.settings-panel.on { display: block; }
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  font-size: 0.92rem;
}
.settings-field span { color: var(--muted); font-size: 0.85rem; }
.settings-field input,
.settings-field textarea,
.settings-inline select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0.55rem 0.7rem;
  font: inherit;
}
.settings-field textarea { resize: vertical; min-height: 140px; line-height: 1.45; }
.settings-fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem 0.35rem;
  margin: 0 0 1rem;
}
.settings-fieldset legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.settings-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  font-size: 0.92rem;
}
.settings-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  font-size: 0.92rem;
}
.settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
}
.settings-contact-form {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.settings-contact-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0.5rem 0.65rem;
  font: inherit;
}
.settings-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.settings-contact-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.settings-contact-list li:last-child { border-bottom: 0; }
.settings-contact-list .meta { min-width: 0; }
.settings-contact-list .meta strong { display: block; }
.settings-contact-list .meta span { color: var(--muted); font-size: 0.82rem; }
.settings-contact-list .badge {
  font-size: 0.72rem;
  color: var(--blue);
  margin-left: 0.35rem;
}
.settings-contact-list .del {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
}
.settings-contact-list .del:hover {
  background: var(--hover);
  color: #b3261e;
}
@media (max-width: 700px) {
  .settings-body { grid-template-columns: 1fr; }
  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .settings-contact-form { grid-template-columns: 1fr; }
}

/* —— Rich text editor —— */
.rte-wrap {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
  min-height: 220px;
  flex: 1;
  background: var(--surface);
}
.rte-wrap-sig {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 160px;
  overflow: hidden;
}
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.rte-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  min-width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}
.rte-btn:hover, .rte-btn:focus-visible { background: var(--hover); }
.rte-font, .rte-size {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  height: 30px;
  max-width: 110px;
}
.rte-color {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink);
}
.rte-color:hover { background: var(--hover); }
.rte-color input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
}
.rte-editor {
  flex: 1;
  min-height: 180px;
  padding: 0.85rem 1rem;
  outline: none;
  overflow: auto;
  line-height: 1.5;
  font-size: 0.95rem;
  word-break: break-word;
}
.rte-editor a {
  color: var(--blue);
  text-decoration: underline;
  word-break: break-word;
}
.rte-editor-sig { min-height: 120px; }
.rte-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.rte-editor blockquote {
  margin: 0.5rem 0 0;
  padding-left: 0.75rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.g-compose-dlg .rte-wrap { border-bottom: 1px solid var(--line); }
.g-compose-dlg textarea { display: none; }

@media (max-width: 900px) {
  .rte-editor { min-height: 36vh; }
}
