/* Contests + Mail tabs. Colours only through theme.css tokens so both themes work. */
.ct-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.ct-bar input[type=search] { flex: 1 1 220px; min-width: 0; padding: 8px 10px; border: 1px solid rgb(var(--line)); border-radius: 10px; background: rgb(var(--surface)); color: rgb(var(--ink)); }
.ct-dim { color: rgb(var(--faint)); }
.ct-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ct-card { background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.ct-top { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.ct-title { font-weight: 600; color: rgb(var(--ink)); text-decoration: none; line-height: 1.3; overflow-wrap: anywhere; }
.ct-title:hover { color: rgb(var(--brand-500)); }
.ct-meta { font-size: 13px; color: rgb(var(--muted)); margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ct-meta b { color: rgb(var(--ink)); }
.ct-entries { margin-left: 4px; }
.ct-pill { flex: none; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.ct-good { background: rgb(var(--successx) / .14); color: rgb(var(--successx)); }
.ct-won { background: rgb(var(--amberx) / .18); color: rgb(var(--amberx)); }
.ct-ok { background: rgb(var(--brand-500) / .12); color: rgb(var(--brand-500)); }
.ct-bad { background: rgb(var(--dangerx) / .12); color: rgb(var(--dangerx)); }
.ct-dim-pill { background: rgb(var(--faint) / .15); color: rgb(var(--muted)); }
.ct-edit { margin-top: 8px; font-size: 13px; }
.ct-edit summary { cursor: pointer; color: rgb(var(--muted)); }
.ct-edit label { display: block; margin: 6px 0; color: rgb(var(--muted)); }
.ct-edit input, .ct-edit select { display: block; width: 100%; box-sizing: border-box; margin-top: 2px; padding: 6px 8px; border: 1px solid rgb(var(--line)); border-radius: 8px; background: rgb(var(--raised)); color: rgb(var(--ink)); }
.ct-log { margin-top: 6px; white-space: pre-wrap; }
.ct-events { display: flex; flex-direction: column; gap: 6px; }
.ct-event { background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); border-radius: 10px; padding: 8px 12px; font-size: 14px; color: rgb(var(--ink)); overflow-wrap: anywhere; }
.ct-when { color: rgb(var(--faint)); font-variant-numeric: tabular-nums; margin-right: 6px; }

#mail-cats { flex-wrap: wrap; }
.ml-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: rgb(var(--dangerx)); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.ml-toggle { display: flex; gap: 6px; align-items: center; font-size: 14px; color: rgb(var(--muted)); }
.ml-accts { font-size: 12px; overflow-wrap: anywhere; }
.ml-list { display: flex; flex-direction: column; border: 1px solid rgb(var(--line)); border-radius: 14px; overflow: hidden; background: rgb(var(--surface)); }
.ml-row { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 14px; border-top: 1px solid rgb(var(--line)); color: rgb(var(--muted)); text-decoration: none; font-size: 14px; }
.ml-row:first-child { border-top: 0; }
.ml-row:hover { background: rgb(var(--raised)); }
.ml-row.unread .ml-from, .ml-row.unread .ml-subj { color: rgb(var(--ink)); font-weight: 600; }
.ml-row.unread .ml-subj .ct-dim { font-weight: 400; }
.ml-row.imp { box-shadow: inset 3px 0 0 rgb(var(--dangerx)); }
.ml-from, .ml-subj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-meta { font-size: 12px; color: rgb(var(--faint)); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ml-senders { margin-top: 14px; }
.ml-senders input, .ml-senders select { display: inline-block; width: auto; max-width: 100%; }
@media (max-width: 640px) {
  .ct-list { grid-template-columns: 1fr; }
  .ml-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ml-subj { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
}
