:root {
  --bg: #0b0d10; --panel: #171b21; --panel2: #222933; --line: #3a4553; --text: #f2f4f7; --muted: #b3bdc9;
  --accent: #e0a34a; --accent-ink: #1a1206; --good: #5fc487; --bad: #f07a7a; --warn: #e8c15a; --blue: #6aa9f0;
  --t-good: #14261c; --t-bad: #331a1a; --t-warn: #2a2310; --t-blue: #15263b; --t-skip: #14171b; --hover: #1c222a;
  --b-good: #2f6d49; --b-bad: #8a3a3a; --b-warn: #6f5c22;
}
:root[data-theme=light] {
  --bg: #e6e9ee; --panel: #ffffff; --panel2: #e9edf2; --line: #aab2be; --text: #0d1014; --muted: #3d4651;
  --accent: #9a5a08; --accent-ink: #ffffff; --good: #136534; --bad: #b3261a; --warn: #6e5000; --blue: #0f4fb0;
  --t-good: #cfeed9; --t-bad: #f9d2ce; --t-warn: #f8e9b0; --t-blue: #cfe1fa; --t-skip: #dde0e5; --hover: #eef1f5;
  --b-good: #4fa672; --b-bad: #d0685f; --b-warn: #c2a030;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
html[data-theme=light] { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 6px 0 14px; }
h2 { font-size: 14.5px; margin: 0 0 10px; color: var(--text); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
main { max-width: 1320px; margin: 0 auto; padding: 18px 20px 60px; }
code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
pre { white-space: pre-wrap; word-break: break-word; font: inherit; margin: 8px 0 0; }

.top { display: flex; align-items: center; gap: 6px 22px; padding: 6px 20px; min-height: 54px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 16px; color: var(--accent); white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 6px; }
.top nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.top nav a { color: var(--muted); padding: 8px 12px; border-radius: 7px; white-space: nowrap; }
.top nav a:hover { color: var(--text); background: var(--panel2); text-decoration: none; }
.top nav a.on { color: var(--text); background: var(--panel2); }
.who { display: flex; align-items: center; gap: 12px; white-space: nowrap; }

.card { background: var(--panel); box-shadow: 0 1px 2px rgba(0,0,0,.12); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.narrow { max-width: 440px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2.wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 900px) { .grid2, .grid2.wide-left { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 100%; }
.count { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 20px; padding: 1px 9px; font-size: 13px; font-weight: 500; }
.crumb { margin: 0 0 4px; }

label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
label.row, label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font: inherit; min-width: 0; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 8px 14px; font: inherit; cursor: pointer; white-space: nowrap; display: inline-block; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; font: inherit; padding: 0; }
.link.bad { color: var(--bad); }
.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form2 .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form2 { grid-template-columns: 1fr; } }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid var(--line); background: var(--panel2); }
.flash.good { border-color: var(--b-good); background: var(--t-good); }
.flash.bad { border-color: var(--b-bad); background: var(--t-bad); }
.flash.warn { border-color: var(--b-warn); background: var(--t-warn); }

.login { max-width: 360px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 12px; }
.login h1 { margin: 0; color: var(--accent); }
.login p { margin: -8px 0 4px; }

.stat { color: var(--text); display: block; }
.stat:hover { border-color: var(--accent); text-decoration: none; }
.big { font-size: 34px; font-weight: 700; line-height: 1.1; margin-bottom: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip, .tag { display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); white-space: nowrap; background: var(--panel2); color: var(--muted); }
.tag { margin-left: 6px; font-weight: 500; vertical-align: middle; }
.s-new { color: var(--muted); }
.s-contacted { color: var(--blue); background: var(--t-blue); }
.s-replied { color: var(--good); background: var(--t-good); }
.s-talking { color: var(--warn); background: var(--t-warn); }
.s-accepted { color: var(--panel); background: var(--good); }
.s-rejected { color: var(--bad); background: var(--t-bad); }
.s-skip { color: var(--muted); background: var(--t-skip); }
.line { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); color: var(--text); }
.line:first-of-type { border-top: 0; }
.line:hover { text-decoration: none; background: var(--panel2); }
.line b { white-space: nowrap; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.list { width: 100%; border-collapse: collapse; background: var(--panel); }
table.list th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; }
table.list td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
table.list tbody tr:hover td { background: var(--hover); }
td.name { max-width: 340px; }
td.name a { color: var(--text); }
td.reach { white-space: nowrap; }
td.due { color: var(--warn); font-weight: 600; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 12.5px; margin-right: 4px; }
.pill:hover { border-color: var(--accent); text-decoration: none; }
.pill.mail { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
select.status { padding: 4px 8px; border-radius: 20px; font-size: 12.5px; border-color: transparent; }

.noteform { margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 8px; padding: 10px 12px; margin-top: 10px; background: var(--panel2); }
.msg.in { border-left-color: var(--good); }
.msg.failed { border-left-color: var(--bad); }
.msg header { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.msg summary { cursor: pointer; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.ev { padding: 7px 2px; border-top: 1px dashed var(--line); margin-top: 10px; }
.evtext { white-space: pre-wrap; }
dl.info { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 0; }
dl.info dt { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
dl.info dd { margin: 0; min-width: 0; word-break: break-word; }
pre.desc { color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
details.card summary { cursor: pointer; }
details.card[open] summary { margin-bottom: 12px; }
.compose textarea { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13.5px; }

/* rows take the colour of their status */
table.list tbody tr td:first-child { border-left: 4px solid transparent; }
tr.r-contacted td { background: var(--t-blue); } tr.r-contacted td:first-child { border-left-color: var(--blue); }
tr.r-replied td { background: var(--t-good); } tr.r-replied td:first-child { border-left-color: var(--good); }
tr.r-talking td { background: var(--t-warn); } tr.r-talking td:first-child { border-left-color: var(--warn); }
tr.r-accepted td { background: var(--t-good); } tr.r-accepted td:first-child { border-left-color: var(--good); border-left-width: 8px; }
tr.r-rejected td { background: var(--t-bad); } tr.r-rejected td:first-child { border-left-color: var(--bad); }
tr.r-rejected td.name b { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
tr.r-skip td { background: var(--t-skip); color: var(--muted); } tr.r-skip td.name b { color: var(--muted); }
table.list tbody tr[class^="r-"]:not(.r-new):hover td { filter: brightness(1.06); }
table.list td { font-size: 14.5px; }
td.name b { font-size: 15.5px; }
select.status { font-weight: 600; border-color: var(--line); }
select.status.s-new { background: var(--panel); }
select.status option { background: var(--panel); color: var(--text); }

/* notes in the list */
td.note { min-width: 200px; max-width: 320px; }
.lastnote { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.addnote { font-size: 12.5px; }
.noteedit { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.noteedit textarea { width: 100%; font-size: 13.5px; }
.theme { font-size: 16px; line-height: 1; padding: 6px 9px; }

/* phones */
@media (max-width: 820px) {
  main { padding: 12px 10px 50px; }
  .top { flex-wrap: wrap; height: auto; padding: 8px 10px; gap: 6px 12px; position: static; }
  .top nav { order: 3; flex-basis: 100%; }
  .who { margin-left: auto; }
  h1 { font-size: 19px; }
  .filters > * { flex: 1 1 46%; }
  .filters .grow { flex-basis: 100%; }
  .tablewrap { border: 0; overflow: visible; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list { background: none; }
  table.list thead { display: none; }
  table.list tbody tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; background: var(--panel); }
  table.list td { border: 0; padding: 5px 12px; max-width: none; }
  table.list td:first-child { padding-top: 10px; }
  table.list td:last-child { padding-bottom: 10px; }
  table.list td:empty { display: none; }
  table.list td[data-label]:not(:empty)::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12.5px; }
  td.reach { white-space: normal; }
  .pill { padding: 7px 12px; margin-bottom: 4px; font-size: 14px; }
  select.status { padding: 7px 10px; font-size: 14px; }
  td.note { max-width: none; }
  table.list td.opt { display: inline-block; width: auto; padding-right: 0; }
  .btn { padding: 9px 14px; }
  .msg header { flex-direction: column; gap: 2px; }
  input, select, textarea { font-size: 16px; }
}

@media (min-width: 821px) and (max-width: 1280px) { table.list .opt { display: none; } td.note { min-width: 150px; } td.name { max-width: 250px; } }

@media (max-width: 820px) {
  table.list tbody tr.r-contacted { background: var(--t-blue); } table.list tbody tr.r-replied, table.list tbody tr.r-accepted { background: var(--t-good); }
  table.list tbody tr.r-talking { background: var(--t-warn); } table.list tbody tr.r-rejected { background: var(--t-bad); } table.list tbody tr.r-skip { background: var(--t-skip); }
  table.list tbody tr[class^="r-"] td { background: none; }
}

.btn { font-weight: 600; }
.pill { font-weight: 600; font-size: 13px; }
.top nav a { font-weight: 600; }
.top nav a.on { box-shadow: inset 0 -2px 0 var(--accent); }
.big { color: var(--text); }
.line b, td.name b { font-weight: 700; }
.s-new { color: var(--text); }

.noteacts { display: inline-flex; gap: 10px; font-size: 12.5px; }
.noteacts .link { font-size: 12.5px; }
td.note .noteitem { margin-bottom: 4px; }
.ev.note { border-top-style: solid; }
.ev .evtext { margin-top: 2px; }
[hidden] { display: none !important; }

.tag.sitebad { background: var(--t-bad); color: var(--bad); border-color: var(--b-bad); }
.tag.sitewarn { background: var(--t-warn); color: var(--warn); border-color: var(--b-warn); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.maillist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.mailrow { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 8px; }
.mailrow.in { border-left-color: var(--good); }
.mailrow.unmatched { border-left-color: var(--muted); }
.mailrow.failed { border-left-color: var(--bad); }
.mailrow summary { display: grid; grid-template-columns: 22px minmax(160px, 260px) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; list-style: none; }
.mailrow summary::-webkit-details-marker { display: none; }
.mailrow .dir { font-weight: 700; color: var(--muted); }
.mailrow .who { display: flex; flex-direction: column; min-width: 0; }
.mailrow .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mailrow .subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mailrow .meta { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.mailrow[open] summary { border-bottom: 1px solid var(--line); }
.mailbody { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.mailbody pre { margin: 0; max-height: 420px; overflow: auto; }
.testlog .step { padding: 6px 0; border-top: 1px solid var(--line); font-weight: 600; }
.testlog .step:first-of-type { border-top: 0; }
.sigpreview { background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; }
@media (max-width: 820px) {
  .mailrow summary { grid-template-columns: 18px minmax(0, 1fr); }
  .mailrow .subj, .mailrow .meta { grid-column: 2; }
  .mailrow .subj { white-space: normal; }
}
.endself { align-self: end; }
.filters input.grow { flex: 1 1 260px; }

.gamepick { font-weight: 700; padding: 5px 12px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.gamepick:hover { text-decoration: none; filter: brightness(1.1); }
.gamepick span { opacity: .8; font-size: 12px; }
.gamegrid { margin-top: 18px; }
.gamecard { width: 100%; text-align: left; cursor: pointer; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 14px; padding: 26px 24px; }
.gamecard:hover, .gamecard.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.gname { font-size: 28px; font-weight: 800; }
.keycode { font: 600 14px Consolas, "Cascadia Mono", monospace; letter-spacing: .03em; padding: 3px 7px; }
.keyline { padding: 4px 0; }
table.keys td { vertical-align: middle; }
.rowedit summary { cursor: pointer; list-style: none; }
.rowedit[open] { min-width: 230px; }
.rowedit form { margin-top: 6px; }
.shownkeys textarea { width: 100%; font: 600 14px Consolas, monospace; }
.shownkeys { border-color: var(--good); display: flex; flex-direction: column; gap: 10px; }
.w90 { width: 90px; } .w130 { width: 150px; }
.composebar { align-items: flex-start; gap: 14px; }
.composebar label { flex: 1 1 200px; }
.composebar label.w130 { flex: 0 0 150px; }
.bigsub { font-size: 16px; font-weight: 600; color: var(--muted); }
a.linkflash { display: block; color: var(--text); font-weight: 600; }

.gamecard { padding: 0; overflow: hidden; gap: 0; }
.gamecard .gcover { display: block; width: 100%; aspect-ratio: 12 / 5; object-fit: cover; background: #10141a; }
.gamecard .gcover.none { display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; color: #8b95a3; }
.gamecard .gname { padding: 16px 22px 0; font-size: 24px; }
.gamecard .chips { padding: 10px 22px 20px; }
.gamecard:hover .gcover { filter: brightness(1.12); }
.gamecard { transition: transform .12s ease; } .gamecard:hover { transform: translateY(-2px); }
.coverform { margin-top: -8px; }

.badge { background: var(--bad); color: #fff; border-radius: 20px; padding: 0 7px; font-size: 12px; font-weight: 700; }
td.pick, th.pick { width: 34px; padding-right: 0 !important; }
.bulkbar { position: sticky; top: 60px; z-index: 4; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 9px; margin-bottom: 10px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bulkbar .btn { background: var(--panel); color: var(--text); border-color: var(--panel); }
.bulkbar .muted { color: inherit; opacity: .85; }
.mailrow.unread { border-left-color: var(--accent); border-left-width: 6px; background: var(--panel2); }
.mailrow.unread .who b, .mailrow.unread .stext { font-weight: 800; }
.mailrow.unread .dir::after { content: " ●"; color: var(--accent); }
.mailrow:not(.unread) .stext { font-weight: 500; }
.mailrow:not(.unread) .who b { font-weight: 600; }
.mailrow .snip { color: var(--muted); font-weight: 400; }
.mailrow summary:hover { background: var(--hover); }
.markall { margin: -4px 0 10px; }
h2.sect { margin: 22px 0 10px; }
.filerow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 8px; }
.filerow code { max-width: 520px; display: inline-block; vertical-align: bottom; }
.reciplist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 180px; overflow: auto; }
.medialist { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; margin-bottom: 16px; }
.media { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; padding: 12px; margin: 0; align-items: start; }
.mthumb { display: flex; flex-direction: column; gap: 8px; }
.mthumb img { width: 100%; border-radius: 7px; display: block; background: #000; max-height: 300px; object-fit: cover; }
.nothumb { display: flex; align-items: center; justify-content: center; height: 110px; border-radius: 7px; background: var(--panel2); font-weight: 800; color: var(--muted); }
.mthumb .dl { text-align: center; padding: 7px 8px; font-size: 13px; }
.mbody { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mtitle { font-size: 15.5px; }
.posted { display: flex; flex-wrap: wrap; gap: 5px; }
.posted .chip { font-size: 12px; font-weight: 600; }
.cap { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }
.cap pre { margin: 2px 0 0; font-size: 13.5px; }
.postform, .numform { margin-top: 8px; gap: 6px; }
.numform input { width: 84px; padding: 5px 7px; }
.numform input.grow { width: auto; min-width: 120px; }
.bar { height: 5px; background: var(--panel2); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
button[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 820px) { .medialist { grid-template-columns: 1fr; } .media { grid-template-columns: 120px minmax(0, 1fr); } .bulkbar { top: 0; } }
.mailrow .who { align-items: flex-start; gap: 0; white-space: normal; text-align: left; }
.mailrow .dir { text-align: center; }
.top nav a { padding: 7px 9px; font-size: 14px; }
.top { gap: 6px 14px; }

a.preview { position: relative; display: block; cursor: zoom-in; }
a.preview .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; padding-left: 3px; }
a.preview:hover .play { background: var(--accent); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.86); display: flex; align-items: center; justify-content: center; padding: 14px; }
.lbinner { display: flex; flex-direction: column; gap: 10px; max-width: 100%; max-height: 100%; align-items: center; }
.lbbar { display: flex; gap: 10px; align-items: center; width: 100%; color: #fff; }
.lbbar b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.lightbox video, .lightbox img { max-width: min(100%, 1200px); max-height: calc(100vh - 100px); border-radius: 8px; background: #000; }
body.noscroll { overflow: hidden; }

label.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; padding: 18px; text-align: center; border: 2px dashed var(--line); border-radius: 10px; background: var(--bg); color: var(--text); cursor: pointer; font-weight: 400; font-size: 14.5px; transition: border-color .12s, background .12s; }
label.dropzone:hover, label.dropzone.over { border-color: var(--accent); background: var(--panel2); }
label.dropzone.over { border-style: solid; }
label.dropzone.has { border-color: var(--good); }
label.dropzone.has .dzlist { color: var(--text); font-weight: 600; }
label.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dzlist { max-width: 100%; word-break: break-word; }
.upbar { width: 100%; height: 8px; border-radius: 4px; background: var(--panel2); overflow: hidden; margin-top: 6px; }
.upbar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }

/* ---------------- mailbox (desktop mail program layout) */
main:has(.mailbox) { max-width: none; }
.mailtop { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.mailsearch { flex: 1; min-width: 200px; }
.mailsearch input { width: 100%; border-radius: 20px; padding: 8px 16px; }
.btn.sm, select.sm { padding: 5px 10px; font-size: 13px; }
.btn.danger { color: var(--bad); border-color: var(--b-bad); }
.mailbox { display: grid; grid-template-columns: 230px minmax(320px, 430px) minmax(0, 1fr); height: calc(100vh - 150px); min-height: 520px;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.folders { border-right: 1px solid var(--line); padding: 10px 8px; overflow-y: auto; background: var(--panel2); display: flex; flex-direction: column; gap: 2px; }
.ftitle { font-weight: 700; font-size: 13px; padding: 4px 8px 10px; word-break: break-all; }
.fsep { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 8px 4px; font-weight: 700; }
.folder { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 6px; color: var(--text); font-size: 14px; }
.folder:hover { background: var(--hover); text-decoration: none; }
.folder.on { background: var(--t-blue); font-weight: 700; box-shadow: inset 3px 0 0 var(--blue); }
.folder.over { background: var(--t-warn); outline: 2px dashed var(--accent); }
.folder .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .fcount { font-size: 12.5px; color: var(--blue); }
.ficon { width: 20px; text-align: center; }
.newfolder { display: flex; gap: 4px; margin-top: 6px; padding: 0 4px; }
.newfolder input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 13px; }
.newfolder .btn { padding: 4px 8px; font-size: 12.5px; }
.folderedit { padding: 8px 6px; }
.mlist { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.mlist form { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.mtools { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--panel); }
.mtitle { font-weight: 700; flex: 1; }
.mbtns { display: flex; gap: 4px; flex-wrap: wrap; width: 100%; }
.mbtns.dim .btn, .mbtns.dim select { opacity: .45; pointer-events: none; }
.mrows { overflow-y: auto; flex: 1; }
.mrow { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px 9px 8px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; cursor: pointer; }
.mrow:hover { background: var(--hover); }
.mrow.on { background: var(--t-blue); border-left-color: var(--blue); }
.mrow.picked { background: var(--t-warn); }
.mrow.unread { border-left-color: var(--accent); }
.mrow.unread .mfrom, .mrow.unread .msubj { font-weight: 800; }
.mrow.unread .msubj { color: var(--blue); }
.mrow.failed .msubj { color: var(--bad); }
.mpick { margin-top: 3px; }
.mlink { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; color: var(--text); }
.mlink:hover { text-decoration: none; }
.mfrom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mdate { font-size: 12px; color: var(--muted); white-space: nowrap; }
.msubj { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 500; }
.msnip { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.mempty { padding: 30px; text-align: center; }
.mpager { padding: 8px; }
.mread { overflow-y: auto; padding: 18px 24px; min-width: 0; }
.mback { display: none; margin-bottom: 8px; }
.rsubj { font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0 0 12px; }
.rhead { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; flex-shrink: 0; }
.ractions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.assignbar { background: var(--t-warn); border: 1px solid var(--b-warn); border-radius: 8px; padding: 8px 10px; margin-bottom: 14px; gap: 6px; }
.rbody { font-size: 14.5px; line-height: 1.6; margin: 0; }
.rempty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bigicon { font-size: 54px; opacity: .25; }
@media (max-width: 1100px) { .mailbox { grid-template-columns: 200px minmax(0, 1fr); } .mailbox .mread { display: none; }
  .mailbox.reading { grid-template-columns: 1fr; } .mailbox.reading .folders, .mailbox.reading .mlist { display: none; } .mailbox.reading .mread { display: block; } .mback { display: inline-block; } }
@media (max-width: 700px) { .mailbox { grid-template-columns: 1fr; height: auto; } .folders { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .ftitle, .fsep, .folderedit { display: none; } .folder { padding: 5px 8px; font-size: 13px; } .newfolder { width: 100%; } .mrows { max-height: none; } }

td.note { min-width: 240px; max-width: 380px; }
.lastnote { -webkit-line-clamp: 4; cursor: pointer; line-height: 1.45; }
.lastnote.open { display: block; -webkit-line-clamp: unset; overflow: visible; background: var(--panel2); border-radius: 6px; padding: 6px 8px; margin: -2px -4px 2px; }
.notemore { font-size: 12.5px; font-weight: 600; display: block; margin: 2px 0; }

.viewbar { gap: 6px; margin-bottom: 10px; }
.viewbar .btn.on { background: var(--t-blue); border-color: var(--blue); font-weight: 700; }
.rframe { width: 100%; min-height: 300px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: block; }

.media { position: relative; }
.mselect { position: absolute; top: 8px; left: 8px; z-index: 2; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 3px 5px; display: flex; }
.mselect input { width: 17px; height: 17px; }
.media.picked { outline: 3px solid var(--accent); }
.tabs .archtab { margin-left: auto; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brandlogo { height: 34px; width: auto; display: block; }
.brandtext { display: flex; flex-direction: column; line-height: 1.1; margin: 0; }
.brandtext b { font-size: 15px; letter-spacing: .02em; color: var(--text); }
.brandtext small { font-size: 11.5px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.loginlogo { height: 84px; width: auto; align-self: center; margin-bottom: 4px; }
.login h1 { text-align: center; color: var(--text); }
.login p.muted { text-align: center; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
@media (max-width: 820px) { .brandlogo { height: 28px; } .brandtext small { display: none; } }

/* contact list: fits without sideways scrolling */
main:has(table.list) { max-width: 1680px; }
table.list { table-layout: auto; }
td.name { min-width: 220px; max-width: 360px; }
td.name .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; color: var(--text); }
td.reach { white-space: normal; min-width: 150px; max-width: 230px; }
td.reach .pill { margin: 0 4px 4px 0; }
td.note { min-width: 200px; max-width: 340px; width: 28%; }
td.track { white-space: nowrap; }
td.track .due { color: var(--warn); font-weight: 700; }
@media (min-width: 821px) and (max-width: 1280px) { td.note { min-width: 160px; } td.reach { max-width: 170px; } }
@media (max-width: 820px) {
  .top { gap: 6px 10px; padding: 8px 10px 0; }
  .top nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px 6px; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { flex-shrink: 0; }
  .who { gap: 8px; }
  .gamepick { padding: 4px 10px; font-size: 13px; }
}
