/* Caixa de entrada tipo Gmail */
main.full { max-width: none; padding: 0; height: 100vh; display: flex; flex-direction: column; }
main.full > .banner { margin: 12px 16px 0; }
main.full > #page { flex: 1; min-height: 0; }

.wm { display: grid; grid-template-columns: 210px minmax(320px, 420px) minmax(0, 1fr); height: 100%; }
.wm-side { padding: 14px 10px; border-right: 1px solid var(--line); overflow: auto; background: var(--bg); }
.wm-new { width: 100%; padding: 12px 16px; border-radius: 14px; font-weight: 600; display: flex; gap: 10px; align-items: center; justify-content: center; margin-bottom: 14px; }
.wm-side select { margin-bottom: 10px; font-size: 13px; }
.wm-folder { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; border-radius: 0 16px 16px 0; color: var(--text-2); }
.wm-folder:hover { background: var(--surface-2); }
.wm-folder.on { background: var(--info-bg); color: var(--text); font-weight: 650; }
.wm-folder .n { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.wm-folder.unread { color: var(--text); font-weight: 650; }
.wm-folder svg { flex: none; opacity: .8; }
.wm-side .wm-link { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--text-2); margin-top: 14px; padding: 6px 12px; border: 0; background: none; }
.wm-side .wm-link:hover { color: var(--text); background: none; }

.wm-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.wm-search { padding: 10px 12px 6px; }
.wm-search input { border-radius: 20px; padding: 8px 14px; background: var(--surface-2); border-color: transparent; }
.wm-search input:focus { background: var(--surface); border-color: var(--line); outline: none; }
.wm-tools { display: flex; align-items: center; gap: 2px; padding: 2px 8px 6px; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; }
.wm-tools input[type=checkbox] { width: auto; margin: 0 8px; }
.ib { border: 0; background: none; padding: 6px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-2); }
.ib:hover { background: var(--surface-2); color: var(--text); }
.ib:disabled { opacity: .35; cursor: default; background: none; }
.ib.star-on { color: #e8a900; }
.wm-rows { overflow: auto; flex: 1; }
.wm-row { display: grid; grid-template-columns: auto auto 1fr auto; gap: 2px 6px; align-items: center; padding: 8px 12px 8px 6px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.wm-row:hover { background: var(--surface-2); }
.wm-row.sel { background: var(--info-bg); }
.wm-row.open { box-shadow: inset 3px 0 0 var(--accent); }
.wm-row input { width: auto; margin: 0 6px; }
.wm-row .who, .wm-row .subj { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wm-row .who { grid-column: 3; color: var(--text-2); }
.wm-row .when { grid-column: 4; font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.wm-row .subj { grid-column: 3 / 5; color: var(--text-2); font-size: 13px; }
.wm-row.unread .who, .wm-row.unread .subj { color: var(--text); font-weight: 650; }
.wm-row.unread .when { color: var(--text); font-weight: 600; }
.wm-row .star { grid-row: 1 / 3; grid-column: 2; padding: 4px; }
.wm-row .chk { grid-row: 1 / 3; grid-column: 1; }
.wm-empty { color: var(--muted); padding: 40px 20px; text-align: center; }

.wm-read { overflow: auto; min-width: 0; background: var(--surface); }
.wm-read .wm-empty { margin-top: 18vh; }
.wm-msg { padding: 18px 26px 40px; max-width: 980px; }
.wm-msg h1 { font-size: 21px; font-weight: 500; margin: 4px 0 16px; word-break: break-word; }
.wm-bar { display: flex; gap: 2px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.wm-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.wm-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 650; flex: none; }
.wm-head .meta { flex: 1; min-width: 0; }
.wm-head .meta .to { color: var(--muted); font-size: 12.5px; word-break: break-word; }
.wm-head .date { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.wm-body { width: 100%; border: 0; display: block; min-height: 120px; background: #fff; border-radius: 8px; }
.wm-imgs { font-size: 13px; margin-bottom: 12px; padding: 8px 12px; }
.wm-atts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.wm-att { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; text-decoration: none; color: var(--text); max-width: 260px; background: var(--surface); }
.wm-att:hover { background: var(--surface-2); }
.wm-att .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.wm-att .sz { color: var(--muted); font-size: 12px; }
.wm-replybar { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.wm-replybar button { border-radius: 18px; display: flex; gap: 8px; align-items: center; }
.wm-back { display: none; }

/* Janela de escrever */
.wm-win { position: fixed; right: 24px; bottom: 0; width: 560px; max-width: calc(100vw - 16px); height: min(620px, calc(100vh - 40px)); background: var(--surface);
  border-radius: 12px 12px 0 0; box-shadow: 0 8px 40px rgba(0,0,0,.28); display: flex; flex-direction: column; z-index: 15; border: 1px solid var(--line); }
.wm-win.max { right: 50%; bottom: 50%; transform: translate(50%, 50%); width: min(1000px, calc(100vw - 48px)); height: calc(100vh - 80px); border-radius: 12px; }
.wm-win.min { height: auto; }
.wm-win.min > :not(.wm-win-top) { display: none; }
.wm-win-top { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 16px; background: var(--surface-2); border-radius: 12px 12px 0 0; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.wm-win-top span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-win-top .ib { padding: 4px; }
.wm-fld { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 0 14px; }
.wm-fld label { margin: 0; color: var(--muted); font-size: 13px; min-width: 34px; }
.wm-fld input, .wm-fld select { border: 0; padding: 9px 0; background: none; border-radius: 0; }
.wm-fld input:focus, .wm-fld select:focus { outline: none; }
.wm-fld[hidden] { display: none; }
.wm-fld .lnk { white-space: nowrap; border: 0; background: none; color: var(--text-2); padding: 4px; font-size: 13px; }
.wm-tb { display: flex; gap: 1px; padding: 4px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wm-tb .ib { border-radius: 6px; padding: 5px 7px; font-size: 13px; }
.wm-ed { flex: 1; overflow: auto; padding: 12px 16px; outline: none; font: 14px/1.55 Arial, Helvetica, sans-serif; color: var(--text); }
.wm-ed blockquote { margin: 0 0 0 .8ex; border-left: 2px solid var(--line); padding-left: 1ex; color: var(--text-2); }
.wm-ed img { max-width: 100%; }
.wm-ed.drag { outline: 2px dashed var(--accent); outline-offset: -8px; }
.wm-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 6px; }
.wm-chip { display: flex; gap: 6px; align-items: center; background: var(--surface-2); border-radius: 6px; padding: 4px 4px 4px 10px; font-size: 12.5px; max-width: 240px; }
.wm-chip b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-chip i { color: var(--muted); font-style: normal; white-space: nowrap; }
.wm-chip .ib { padding: 2px; }
.wm-foot { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); }
.wm-foot .primary { border-radius: 18px; padding: 8px 22px; font-weight: 600; }
.wm-foot .check { font-size: 12.5px; color: var(--text-2); margin: 0 0 0 6px; }

.sig-ed { border: 1px solid var(--line); border-radius: 8px; min-height: 120px; padding: 10px 12px; outline: none; font: 14px/1.5 Arial, Helvetica, sans-serif; background: var(--surface); margin-top: 4px; }
.sig-ed img { max-width: 100%; }

@media (max-width: 1100px) {
  .wm { grid-template-columns: 190px minmax(0, 1fr); }
  .wm-read { display: none; }
  .wm.reading .wm-list { display: none; }
  .wm.reading .wm-read { display: block; }
  .wm-back { display: inline-grid; }
}
@media (max-width: 800px) {
  main.full { height: auto; min-height: 100vh; }
  .wm { grid-template-columns: 1fr; height: auto; }
  .wm-side { border-right: 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .wm-side .wm-new { width: auto; margin: 0; padding: 8px 14px; }
  .wm-side nav, .wm-side .wm-link { display: none; }
  .wm-side .wm-fsel { display: block; flex: 1; margin: 0; }
  .wm-msg { padding: 14px 16px 30px; }
  .wm-win, .wm-win.max { right: 0; left: 0; width: 100%; max-width: none; height: 100vh; transform: none; border-radius: 0; }
}
.wm-fsel { display: none; }
