/* Mail: the webmail screen (assets/webmail.js) — platform staff (/platform/ → Mail) and every user who switched it on (#mail). */
.wmail { display: grid; grid-template-columns: 220px minmax(260px, 360px) minmax(0, 1fr); height: calc(100vh - 118px); min-height: 520px;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface); }
.wmail.wide { grid-template-columns: 220px minmax(0, 1fr); } .wmail.wide .wm-list { display: none; }
.wm-side { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-right: 1px solid var(--color-border); background: var(--color-surface-sunken); overflow-y: auto; }
.wm-boxname { padding: 4px 8px 10px; font-weight: var(--weight-semibold); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; }
.wm-boxname small { display: block; color: var(--color-text-muted); font-weight: 400; font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; }
.wm-boxsel { margin: 0 0 10px; }
.wm-folders { display: grid; gap: 2px; }
.wm-f { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border: 0; border-radius: var(--radius-md); background: none; color: var(--color-text-secondary); font: inherit; font-size: var(--text-sm); cursor: pointer; text-align: left; }
.wm-f .i { width: 16px; height: 16px; flex: none; } .wm-f span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-f:hover { background: var(--color-hover); color: var(--color-text); } .wm-f.on { background: var(--color-brand-subtle); color: var(--color-text); font-weight: var(--weight-semibold); }
.wm-f em { font-style: normal; font-size: 11px; color: var(--color-text-muted); font-weight: var(--weight-semibold); }
.wm-f em.on { background: var(--color-brand); color: #fff; border-radius: var(--radius-full); padding: 0 7px; line-height: 18px; }
.wm-f em.warn { background: var(--color-warning); color: #111; border-radius: var(--radius-full); padding: 0 7px; line-height: 18px; }
.wm-sep { height: 1px; background: var(--color-border); margin: 10px 4px; }
.wm-status { margin-top: auto; padding-top: 10px; display: grid; gap: 6px; font-size: var(--text-xs); color: var(--color-text-muted); }
.wm-sync { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px; }
.wm-err { display: flex; gap: 6px; align-items: flex-start; color: var(--color-danger); font-size: var(--text-xs); line-height: 1.4; }
.wm-err span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; } .wm-err .i { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.wm-err.big { background: var(--color-danger-subtle); padding: 10px 12px; border-radius: var(--radius-md); font-size: var(--text-sm); } .wm-err.big span { -webkit-line-clamp: unset; }
.wm-list { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--color-border); }
.wm-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--color-border); color: var(--color-text-muted); }
.wm-search input { border: 0; background: none; padding: 4px 0; height: auto; box-shadow: none; } .wm-search input:focus { outline: none; box-shadow: none; }
.wm-rows { overflow-y: auto; flex: 1; }
.wm-row { display: block; width: 100%; text-align: left; padding: 10px 14px 10px 16px; border: 0; border-bottom: 1px solid var(--color-border-subtle); background: none; color: var(--color-text); font: inherit; cursor: pointer; position: relative; }
.wm-row:hover { background: var(--color-hover); } .wm-row.on { background: var(--color-brand-subtle); }
.wm-row.unread::before { content: ''; position: absolute; left: 6px; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: var(--color-brand); }
.wm-r1 { display: flex; justify-content: space-between; gap: 8px; font-size: var(--text-sm); }
.wm-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text-secondary); } .wm-row.unread .wm-who, .wm-row.unread .wm-subj { color: var(--color-text); font-weight: var(--weight-semibold); }
.wm-when { flex: none; color: var(--color-text-muted); font-size: var(--text-xs); }
.wm-subj { display: flex; align-items: center; gap: 5px; font-size: var(--text-sm); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-snip { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-more { margin: 10px auto; display: flex; }
.wm-empty { padding: 28px 16px; text-align: center; color: var(--color-text-muted); font-size: var(--text-sm); }
.wm-read { min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.wm-blank { margin: auto; text-align: center; color: var(--color-text-muted); padding: 30px; } .wm-blank .i { width: 40px; height: 40px; opacity: .45; }
.wm-msg { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 14px 18px 18px; gap: 10px; }
.wm-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wm-h { font-size: 19px; font-weight: var(--weight-semibold); margin: 4px 0 0; line-height: 1.3; word-break: break-word; }
.wm-meta { font-size: var(--text-sm); display: grid; gap: 2px; } .wm-meta .muted { font-size: var(--text-xs); }
.wm-pics { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--color-surface-sunken); border-radius: var(--radius-md); padding: 7px 10px; font-size: var(--text-xs); color: var(--color-text-secondary); }
.wm-pics span { flex: 1; min-width: 180px; }
.wm-files { display: flex; flex-wrap: wrap; gap: 6px; }
.wm-file { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; padding: 5px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-md); font-size: var(--text-xs); color: var(--color-text); text-decoration: none; }
.wm-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wm-file small { color: var(--color-text-muted); flex: none; } .wm-file:hover { border-color: var(--color-brand); }
.wm-frame { flex: 1; width: 100%; min-height: 360px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
.wm-compose { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; flex: 1; min-height: 0; }
.wm-compose label { display: block; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.wm-compose label > :is(input, select, textarea) { display: block; width: 100%; margin-top: 5px; }
.wm-compose label .muted { font-weight: 400; }
.wm-compose .grow { flex: 1; display: flex; flex-direction: column; } .wm-compose .grow > textarea { flex: 1; min-height: 200px; resize: vertical; line-height: 1.55; }
.wm-compose fieldset { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 10px 12px 12px; display: grid; gap: 10px; margin: 0; }
.wm-compose legend { font-size: var(--text-sm); font-weight: var(--weight-semibold); padding: 0 6px; }
.wm-ctitle { font-weight: var(--weight-semibold); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .wm-row3 { display: grid; grid-template-columns: 2fr 90px 1fr; gap: 10px; }
.wm-link { font-size: var(--text-xs); align-self: flex-start; margin-top: -4px; }
.wm-compose .wm-chk { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.wm-compose .wm-chk > input { width: auto; flex: none; margin: 3px 0 0; } .wm-compose .wm-chk.big { font-size: var(--text-md); }
.wm-quote { font-size: var(--text-xs); color: var(--color-text-muted); } .wm-quote div { white-space: pre-wrap; max-height: 160px; overflow: auto; margin-top: 6px; padding: 8px 10px; background: var(--color-surface-sunken); border-radius: var(--radius-md); }
.wm-cfoot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--color-border); }
.wm-chips, .wm-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--text-xs); }
.wm-chip { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-secondary); border-radius: var(--radius-full); padding: 4px 10px; font: inherit; font-size: var(--text-xs); cursor: pointer; }
.wm-chip:hover, .wm-chip.on { border-color: var(--color-brand); color: var(--color-text); }
.wm-wide { display: flex; flex-direction: column; min-height: 0; flex: 1; } .wm-wide-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 0; }
.wm-wide-h h3 { margin: 0; font-size: 18px; } .wm-wide-h p { margin: 4px 0 0; max-width: 720px; font-size: var(--text-sm); }
.wm-set { max-width: 860px; }
.wm-cn { display: grid; grid-template-columns: 260px minmax(0, 1fr); flex: 1; min-height: 0; margin-top: 12px; border-top: 1px solid var(--color-border); }
.wm-cnlist { border-right: 1px solid var(--color-border); overflow-y: auto; }
.wm-cnrow { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--color-border-subtle); background: none; color: var(--color-text); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.wm-cnrow span { font-size: var(--text-xs); color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wm-cnrow:hover { background: var(--color-hover); } .wm-cnrow.on { background: var(--color-brand-subtle); }
.wm-test { display: grid; gap: 6px; } .wm-t { display: flex; gap: 8px; align-items: flex-start; font-size: var(--text-sm); padding: 8px 10px; border-radius: var(--radius-md); }
.wm-t.ok { background: var(--color-success-subtle); } .wm-t.bad { background: var(--color-danger-subtle); } .wm-t .i { flex: none; margin-top: 2px; }
.wm-prev { display: grid; gap: 6px; margin-top: 8px; } .wm-prev .wm-frame { min-height: 320px; }
.wm-setup { display: grid; gap: 14px; max-width: 900px; } .wm-setup h3 { display: flex; gap: 8px; align-items: center; } .wm-setup .wm-wide-h { padding-top: 0; } .wm-setup .wm-compose { padding-left: 0; padding-right: 0; }
@media (max-width: 1200px) { .wmail { grid-template-columns: 190px minmax(220px, 300px) minmax(0, 1fr); } }
.wm-newbtn { padding: 0 2px 10px; } .wm-newbtn .btn { width: 100%; justify-content: center; }
.wm-back { display: none; align-self: flex-start; }
/* phone: one pane at a time — folders + list, or the email / what you are writing (with Back) */
@media (max-width: 900px) {
  .wmail, .wmail.wide { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; } .wm-side { border-right: 0; border-bottom: 1px solid var(--color-border); }
  .wm-folders { grid-template-columns: repeat(3, minmax(0, 1fr)); } .wm-status { margin-top: 6px; }
  .wm-list { border-right: 0; } .wm-rows { max-height: none; }
  .wmail:not(.reading) .wm-read { display: none; }
  .wmail.reading:not(.wide) .wm-side, .wmail.reading .wm-list { display: none; }
  .wm-read { min-height: 70vh; } .wm-back { display: inline-flex; }
  .wm-msg, .wm-compose { padding: 12px; }
  .wm-row2, .wm-row3, .wm-cn { grid-template-columns: minmax(0, 1fr); }
}
.wmail .tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: var(--weight-medium);
  background: var(--color-surface-sunken); color: var(--color-text-secondary); white-space: nowrap; }
.wmail .tag.on { background: var(--color-success-subtle); color: var(--color-success); }
.wmail .tag.off { background: var(--color-danger-subtle); color: var(--color-danger); }
.wmail .tag.warn { background: var(--color-warning-subtle); color: var(--color-warning); }
