/* Unseenet graphical client. Colours are the logo's and unseenet.org's
   (ink #10302a, green #16a974 / #34d399). No web fonts: nothing is loaded
   from outside this computer. */

:root, :root[data-theme="dark"] {
  --ink: #10302a;
  --ink-deep: #0b241f;
  --ink-2: #173d35;
  --ink-sel: #1d4a40;
  --paper: #e8f3ef;
  --paper-2: #c9e2d9;
  --muted: #9cc3b6;
  --green: #34d399;
  --green-deep: #16a974;
  --on-green: #06201a;
  --amber: #f5c26b;
  --red: #f19a8f;
  --line: rgba(232, 243, 239, 0.08);
  --line-2: rgba(232, 243, 239, 0.16);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  --own: #16a974;
  --scrim: rgba(5, 18, 15, 0.62);
  color-scheme: dark;
}
/* Light: the same greens on paper. Used when the system prefers it, unless
   the palette chose dark; or when the palette chose light. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ink: #f4f8f6; --ink-deep: #e7f0ec; --ink-2: #dbe8e2; --ink-sel: #cbe3d9;
    --paper: #10302a; --paper-2: #24493f; --muted: #4c6b62;
    --green: #0f8a5f; --green-deep: #b9ebd4; --on-green: #06201a; --own: #b9ebd4;
    --amber: #8a5a00; --red: #b3261e; --line: rgba(16, 48, 42, 0.1); --line-2: rgba(16, 48, 42, 0.2);
    --scrim: rgba(16, 48, 42, 0.35); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --ink: #f4f8f6; --ink-deep: #e7f0ec; --ink-2: #dbe8e2; --ink-sel: #cbe3d9;
  --paper: #10302a; --paper-2: #24493f; --muted: #4c6b62;
  --green: #0f8a5f; --green-deep: #b9ebd4; --on-green: #06201a; --own: #b9ebd4;
  --amber: #8a5a00; --red: #b3261e; --line: rgba(16, 48, 42, 0.1); --line-2: rgba(16, 48, 42, 0.2);
  --scrim: rgba(16, 48, 42, 0.35); color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 14px; line-height: 1.45; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px;
  background: var(--ink-2); color: var(--paper-2); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#root { height: 100%; }

/* ---- buttons ------------------------------------------------------------ */
.btn { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2);
  background: transparent; color: var(--paper-2); display: inline-flex; align-items: center;
  gap: 8px; }
.btn:hover { border-color: var(--muted); color: var(--paper); }
.btn.primary { background: var(--green); border-color: var(--green); color: var(--ink); font-weight: 700; }
.btn.primary:hover { background: var(--paper); border-color: var(--paper); }
.btn.primary kbd { background: rgba(16, 48, 42, 0.18); color: var(--ink); }
.btn.icon { width: 40px; padding: 0; justify-content: center; font-weight: 700; }
.btn:disabled { opacity: 0.5; cursor: default; }
.link { border: none; background: none; color: var(--muted); padding: 4px 8px; border-radius: 6px;
  min-height: 32px; font-size: 13px; }
.link:hover { color: var(--paper); background: var(--ink-2); }

/* ---- unlock ------------------------------------------------------------- */
.unlock { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.unlock-box { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 26px; }
.unlock-head { display: flex; flex-direction: column; gap: 14px; }
.headers { font-family: var(--mono); font-size: 12px; color: var(--muted); line-height: 1.6;
  word-break: break-all; }
.headers b { color: var(--paper); font-weight: 400; }
.subject { margin: 0; font-family: var(--mono); font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; }
.subject small { display: block; font-size: 12px; font-weight: 400; letter-spacing: 0;
  color: var(--muted); margin-bottom: 6px; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { font-weight: 600; }
.field { height: 48px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line-2);
  background: var(--ink-deep); font-size: 16px; }
.field:focus { border-color: var(--green); outline: none; }
.form .btn.primary { height: 48px; justify-content: center; }
.error { color: var(--red); font-size: 13px; min-height: 1.4em; }
.note { margin: 0; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); padding-top: 14px; }
.note strong { color: var(--amber); }
.statuscard { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px;
  background: var(--ink-deep); border: 1px solid var(--line); font-size: 13px; }
.bar { height: 4px; border-radius: 99px; background: var(--ink-2); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 35%; background: var(--green);
  animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .bar > span { animation: none; width: 100%; opacity: .5; } }
.bar.determinate > span { animation: none; transition: width .2s linear; }   /* postage progress (#29) */
.choices { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: transparent; text-align: left; }
.choice[aria-pressed="true"] { border-color: var(--green); background: var(--ink-2); }
.choice small { display: block; color: var(--muted); }

/* ---- app shell ------------------------------------------------------------ */
.app { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.body { flex: 1 1 auto; min-height: 0; display: flex; }
.side { flex: 0 0 272px; min-height: 0; overflow-y: auto; background: var(--ink-deep);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 4px; font-family: var(--mono);
  font-weight: 700; font-size: 17px; }
.brand img { width: 30px; height: 30px; }
.logo.on-light { display: none; }
:root[data-theme="light"] .logo.on-dark { display: none; }
:root[data-theme="light"] .logo.on-light { display: inline; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .logo.on-dark { display: none; }
  :root:not([data-theme="dark"]) .logo.on-light { display: inline; }
}
.search { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 10px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--ink); color: var(--muted);
  font-size: 13px; text-align: left; }
.search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav h3 { margin: 0; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.06em;
  color: var(--muted); padding: 0 10px 4px; }
.item { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 8px;
  border: none; background: transparent; color: var(--paper-2); text-align: left; width: 100%; }
.item:hover { background: var(--ink-2); }
.item.on { background: var(--ink-sel); color: var(--paper); }
.item .ic { width: 22px; flex: none; font-family: var(--mono); color: var(--muted); }
.item.on .ic { color: var(--green); }
.item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.group .nm { font-family: var(--mono); font-size: 13px; }
.item.unread .nm { font-weight: 700; color: var(--paper); }
.count { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
  background: var(--green); color: var(--ink); }
.foryou { font-family: var(--mono); font-size: 12px; color: var(--amber); }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px;
  background: var(--ink); border: 1px solid var(--line); }
.me .who { flex: 1; min-width: 0; }
.me .who div:first-child { font-family: var(--mono); font-size: 13px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--muted); }
.dot.ok { background: var(--green); }
.main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ghead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 24px;
  border-bottom: 1px solid var(--line); }
.ghead .t { flex: 1 1 300px; min-width: 0; }
.ghead h1 { margin: 0; font-family: var(--mono); font-size: 20px; letter-spacing: -0.01em; }
.ghead .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ghead p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--ink-2); color: var(--paper-2);
  display: inline-flex; align-items: center; gap: 5px; }
.chip.warn { color: var(--amber); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.content { flex: 1 1 auto; min-height: 0; display: flex; }
.empty { margin: auto; max-width: 30em; text-align: center; color: var(--muted); padding: 32px; }
.empty h2 { color: var(--paper); font-size: 18px; margin: 0 0 6px; }
.statusbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding: 6px 16px;
  background: var(--ink-deep); border-top: 1px solid var(--line); font-family: var(--mono);
  font-size: 12px; color: var(--muted); }
.statusbar kbd { background: none; padding: 0; color: var(--paper); font-size: 12px; }
.statusbar .grow { flex: 1; }
.statusbar .link.update { color: var(--amber); font-weight: 600; }
.statusbar .keys { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.statusbar .st { display: flex; align-items: center; gap: 6px; max-width: 50%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- avatars ------------------------------------------------------------- */
.av { flex: none; width: 34px; height: 34px; border-radius: 99px; display: flex; align-items: center;
  justify-content: center; font-family: var(--mono); font-weight: 700; font-size: 13px; color: #10302a; }
.av.s { width: 28px; height: 28px; font-size: 11px; }
.av.xs { width: 22px; height: 22px; font-size: 10px; }
.c0 { background: #7cc4f0; } .c1 { background: #f5c26b; } .c2 { background: #c7b3f5; }
.c3 { background: #f0a3c4; } .c4 { background: #34d399; } .c5 { background: #9cc3b6; }

/* ---- threads ---------------------------------------------------------- */
.threads { flex: 1 1 340px; max-width: 420px; min-width: 260px; min-height: 0; overflow-y: auto;
  border-right: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.thread { display: flex; gap: 10px; width: 100%; padding: 11px 12px; border-radius: 10px; border: none;
  background: transparent; color: var(--paper-2); text-align: left; }
.thread:hover { background: var(--ink-2); }
.thread.on { background: var(--ink-sel); color: var(--paper); }
.thread .mk { flex: none; width: 8px; margin-top: 6px; }
.thread .mk.new { height: 8px; border-radius: 99px; background: var(--green); }
.thread .mk.you { margin-top: 1px; color: var(--amber); font-size: 12px; }
.thread .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.thread .sj { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; }
.thread.unread .sj { font-weight: 700; color: var(--paper); }
.thread .meta { font-size: 12px; color: var(--muted); }
.reader { flex: 999 1 480px; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px 32px;
  display: flex; flex-direction: column; gap: 20px; }
.reader h2 { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; max-width: 34em; }
.post { display: flex; gap: 12px; max-width: 46em; }
.post .pb { flex: 1; min-width: 0; }
.post .ph { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.post .name { font-family: var(--mono); font-weight: 700; }
.post .sm { font-size: 12px; color: var(--muted); }
.post .sm.you { color: var(--amber); }
.post .sm.ok { color: var(--green); }
.post .sm.lock { color: var(--paper-2); }
.text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.text.bad { color: var(--red); font-style: italic; }
.sig { margin: 8px 0 0; padding-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted);
  white-space: pre-wrap; overflow-wrap: anywhere; }
.post .pa { display: flex; gap: 2px; margin-top: 6px; margin-left: -8px; }
.post.target { position: relative; }
.post.target .pb { background: var(--ink-2); border-radius: 10px; padding: 8px 12px; margin: -8px -12px; }
.compose { flex: none; padding: 14px 32px 18px; border-top: 1px solid var(--line); display: flex;
  flex-direction: column; gap: 8px; }
.compose .row { display: flex; gap: 10px; align-items: flex-end; }
.compose textarea { flex: 1; min-width: 0; resize: vertical; min-height: 64px; max-height: 40vh; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--ink-deep); }
.compose textarea:focus { border-color: var(--green); outline: none; }
.hint { font-size: 12px; color: var(--muted); }
.sending { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.sending .bar { width: 80px; }

/* ---- chat --------------------------------------------------------------- */
.chat { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 28px; display: flex;
  flex-direction: column; gap: 14px; }
.msgs > .spacer { margin-top: auto; }
.day { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: rgba(232, 243, 239, 0.1); }
.mg { display: flex; gap: 10px; max-width: 680px; }
.mg .col { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.mg .hd { display: flex; align-items: baseline; gap: 8px; }
.mg .hd .name { font-family: var(--mono); font-weight: 700; font-size: 13px; }
.bubble { padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: var(--ink-2);
  white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.bubble .time { display: none; }
.mg.mine { align-self: flex-end; flex-direction: row-reverse; }
.mg.mine .col { align-items: flex-end; }
.mg.mine .bubble { background: var(--own); color: var(--on-green); border-radius: 14px 4px 14px 14px; }
.mg.mine .bubble.pending { opacity: 0.72; }
.mg.mine .bubble.failed { background: var(--red); color: #fff; }
.quote { display: block; font-size: 12px; color: var(--muted); padding: 4px 8px; margin-bottom: 6px;
  border-radius: 6px; background: var(--ink); }
.mg.mine .quote { background: rgba(6, 32, 26, 0.18); color: var(--on-green); }
.state { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.state.ok { color: var(--green); }
.state.bad { color: var(--red); }
.chatbar { flex: none; padding: 12px 28px 16px; border-top: 1px solid var(--line); display: flex;
  flex-direction: column; gap: 6px; }
.chatbar .row { display: flex; gap: 10px; align-items: center; }
.chatbar input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 22px;
  border: 1px solid var(--line-2); background: var(--ink-deep); }
.chatbar input:focus { border-color: var(--green); outline: none; }
.send { flex: none; width: 44px; height: 44px; border-radius: 99px; border: none; background: var(--green);
  color: var(--ink); display: flex; align-items: center; justify-content: center; }
.chatbar .hint { padding-left: 16px; }
.replying { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding-left: 16px; }

/* ---- dialogs and palette ---------------------------------------------------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); display: flex;
  align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; z-index: 10; }
.dialog { width: 100%; max-width: 600px; max-height: 80vh; display: flex; flex-direction: column;
  border-radius: 14px; background: var(--ink); border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); overflow: hidden; }
.dialog.wide { max-width: 720px; }
.dialog .dh { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 56px;
  border-bottom: 1px solid var(--line); }
.dialog .dh h2 { margin: 0; font-size: 16px; flex: 1; }
.dialog .dh input { flex: 1; min-width: 0; height: 44px; border: none; background: transparent; font-size: 16px; }
.dialog .dh input:focus { outline: none; }
.dialog .db { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog .db.list { padding: 8px; gap: 2px; }
.dialog .df { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--muted); }
.dialog .df.btns { justify-content: flex-end; gap: 8px; font-family: var(--sans); }
.dialog label { font-weight: 600; font-size: 13px; }
.dialog .in { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--ink-deep); }
.dialog .in:focus { border-color: var(--green); outline: none; }
.dialog textarea.in { min-height: 220px; resize: vertical; }
.cmd { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px;
  border: none; background: transparent; text-align: left; width: 100%; }
.cmd.on { background: var(--ink-sel); }
.cmd .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd .nm.mono { font-size: 13px; }
.cmd small { color: var(--muted); font-size: 12px; }
.sect { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted);
  padding: 8px 12px 4px; text-transform: uppercase; }
.keybox { font-family: var(--mono); font-size: 13px; padding: 12px; border-radius: 10px; background: var(--ink-deep);
  word-break: break-all; user-select: all; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* About Unseenet: long plain-language text, easy to read */
.dialog .db.about { gap: 10px; line-height: 1.55; font-size: 14px; }
.about-tag { margin: 0; font-family: var(--mono); color: var(--green); }
.about-h { margin: 10px 0 0; font-size: 15px; }
.about-cmp { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; }
.about-cmp dt { font-weight: 600; }
.about-cmp dd { margin: 0; }
.about-status { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding: 12px 14px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--ink-deep); }
.about-status .about-h { margin: 0; color: var(--amber); }
.dialog .dh .logo { flex: none; }
@media (max-width: 560px) { .about-cmp { grid-template-columns: 1fr; gap: 2px; } .about-cmp dd { margin-bottom: 8px; } }
.toast { position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%); padding: 10px 16px;
  border-radius: 10px; background: var(--paper); color: var(--ink); font-weight: 600; z-index: 20;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); max-width: calc(100% - 32px); }

.ghead .back { display: none; }

/* ---- small screens -------------------------------------------------------- */
@media (max-width: 860px) {
  .side { flex-basis: 220px; }
  .threads { max-width: none; flex-basis: 100%; border-right: none; }
  .content.reading .threads { display: none; }
  .content:not(.reading) .reader { display: none; }
  .scroll, .compose { padding-left: 16px; padding-right: 16px; }
  .statusbar .keys { display: none; }
  .ghead .back { display: inline-flex; }
}
@media (max-width: 620px) {
  .body { flex-direction: column; }
  .side { flex: none; max-height: 38vh; border-right: none; border-bottom: 1px solid var(--line); }
  .me { display: none; }
}

/* ---- people, forms ---------------------------------------------------------- */
.nav h3.row-h { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.mini { width: 26px; height: 26px; border-radius: 6px; border: none; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; }
.mini:hover { background: var(--ink-2); color: var(--paper); }
.item.person { gap: 8px; }
/* the group tree: .egypt in .history in alt.* */
.dot-pre { color: var(--muted); }
.sub { display: flex; flex-direction: column; gap: 2px; margin-left: 12px; padding-left: 4px;
  border-left: 1px solid var(--ink-2); }
.item.folder .nm { color: var(--paper-2); }
.nav h3.fold-h { padding-right: 10px; }
.fold-t { display: inline-flex; align-items: center; gap: 4px; border: none; background: transparent; padding: 0;
  font: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; }
.fold-t:hover { color: var(--paper); }
.fold-t .car { width: 10px; }
.choices.row { flex-direction: row; flex-wrap: wrap; max-height: none; }
.choices.row .choice { flex: 1 1 130px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400 !important; }
.member { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dialog form .error:empty { display: none; }


/* ---- discussion: the newsreader ------------------------------------------------ */
.content.news { flex-direction: column; }
.ptable { flex: 0 0 38%; min-height: 120px; overflow-y: auto; border-bottom: 1px solid var(--line); }
.prow { display: grid; grid-template-columns: 18px minmax(0, 1fr) 190px 116px; gap: 12px; align-items: center;
  width: 100%; min-height: 32px; padding: 0 20px; border: none; background: transparent; color: var(--paper-2);
  text-align: left; font-size: 13.5px; }
.prow:hover { background: var(--ink-2); }
.prow.on { background: var(--ink-sel); color: var(--paper); }
.prow.head { position: sticky; top: 0; z-index: 1; min-height: 28px; background: var(--ink); cursor: default;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); }
.prow.head:hover { background: var(--ink); }
.prow .flag { color: var(--green); font-size: 10px; }
.prow .sj { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow.root .sj { color: var(--paper); }
.prow.unread .sj { font-weight: 700; color: var(--paper); }
.prow .tree { font-family: var(--mono); color: var(--muted); }
.prow .same { color: var(--muted); }
.prow.unread .same, .prow.on .same { color: inherit; }
.prow .you { color: var(--amber); }
.prow .from, .prow .date { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: var(--muted); }
.prow.pending { opacity: 0.8; cursor: default; }
.news .reader { flex: 1 1 auto; min-height: 0; }
.news.full .ptable { display: none; }
.reader .pbody { max-width: 46em; margin-left: 46px; }
.reader .post { max-width: 46em; }
.inreply { border: none; background: none; padding: 2px 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.inreply:hover { color: var(--paper); }
.attrib { margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.quote-block { margin: 2px 0 10px; padding: 6px 12px; border-left: 3px solid var(--green-deep);
  border-radius: 0 8px 8px 0; background: var(--ink-deep); color: var(--paper-2); font-size: 13.5px;
  white-space: pre-wrap; overflow-wrap: anywhere; }
.ql.q2 { padding-left: 12px; color: var(--muted); }
.ql.q3 { padding-left: 24px; color: var(--muted); opacity: 0.8; }
details.quote-block summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.pbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 24px;
  border-top: 1px solid var(--line); }
.pbar .grow { flex: 1; }
.compose-body { min-height: 360px; font-size: 13.5px; line-height: 1.5; tab-size: 4; }
@media (max-width: 860px) {
  .ptable { flex-basis: auto; flex-grow: 1; border-bottom: none; }
  .content.news.reading .ptable { display: none; }
  .content.news:not(.reading) .reader { display: none; }
  .prow { grid-template-columns: 14px minmax(0, 1fr) 90px; padding: 0 12px; }
  .prow .from { display: none; }
  .reader .pbody { margin-left: 0; }
}

/* ---- the bootable image ---------------------------------------------------------- */
.sysbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
  position: fixed; top: 16px; right: 16px; left: 16px; z-index: 5; }
.sysbar select.btn { appearance: none; background: transparent; padding-right: 14px; }
.sysbar select option { background: var(--ink); color: var(--paper); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cmd form.inline { display: flex; gap: 6px; align-items: center; }
.cmd form.inline .in { width: 180px; padding: 6px 10px; }

/* full-screen reading: the post gets the whole window, as in the terminal client (F) */
.app.reading-full .side, .app.reading-full .ghead { display: none; }
.app.reading-full .reader .scroll { padding-top: 28px; }
.app.reading-full .reader h2, .app.reading-full .reader .post { max-width: calc(70ch + 46px); margin-left: auto; margin-right: auto; }
.app.reading-full .reader .pbody { max-width: 70ch; margin-left: auto; margin-right: auto; font-size: 16px; line-height: 1.6; }
.fullbar { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 24px;
  border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.fullbar .grow { flex: 1; }
@media (max-width: 620px) { .fullbar .hint { display: none; } }

/* a post among chat lines stands out with its subject (UN-RFC 0028) */
.bubble.is-post { border-left: 3px solid var(--green); border-radius: 4px 14px 14px 4px; }
.mg.mine .bubble.is-post { border-radius: 14px 4px 4px 14px; }
.bubble .lsub { font-weight: 600; margin-bottom: 4px; }
.bubble .lact { margin-top: 6px; font-size: 13px; }

/* a chat with someone who is not a contact (UN-RFC 0028, 6.2) */
.item.person.stranger .nm { font-style: italic; opacity: 0.85; }

.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }

/* the owner tools under About this group may need two rows */
.df.btns.wrap { flex-wrap: wrap; gap: 8px; }
.df .grow { flex: 1; }

/* Markdown (UN-RFC 0031): the core's safe tree, styled to sit in the reader */
.md .text, .md .attrib { white-space: normal; }
.md .mdh { margin: 14px 0 6px; line-height: 1.25; }
.md h3.mdh { font-size: 19px; } .md h4.mdh { font-size: 16px; } .md h5.mdh { font-size: 14px; }
.md ul, .md ol { margin: 6px 0; padding-left: 24px; }
.md li > .text { margin: 2px 0; }
.md code, .bubble code { font-family: var(--mono); font-size: 0.92em; padding: 1px 5px; border-radius: 4px;
  background: var(--ink-sel); }
.mdcode { font-family: var(--mono); font-size: 13px; line-height: 1.45; padding: 10px 12px; margin: 8px 0;
  border-radius: 6px; background: var(--ink-deep); overflow-x: auto; white-space: pre; }
.mdcode code { background: none; padding: 0; }
.mdhr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
blockquote.quote-block.md { margin: 8px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--line); color: var(--muted); }
.mdlink { color: var(--green); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.mdlink .addr { font-family: var(--mono); font-size: 0.85em; color: var(--muted); text-decoration: none; }
.mdimg { font-style: italic; color: var(--muted); }
.emoji { font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }

/* ---- phones: one pane at a time (unseenet-gui #22) ----------------------------------
   Groups → posts → the post, each full screen, back arrows at the top; only what you
   need now, the rest behind ⋯; writing full screen with Post/Send at the top, so the
   on-screen keyboard never hides it. Same width as PHONE in app.js.

   Rules for every view, also the ones to come (feeds, pages, ...):
   - it fills the group pane (.content); a second column becomes its own pane with a
     back arrow, never a squeezed column;
   - one primary action stays visible (New post, Reply, Send); others go behind ⋯
     (the palette, or a .sec-tools group that ⋯ opens);
   - an input that people type in sits at the bottom of the screen (chat) or its send
     button sits at the top (a full-screen dialog), so the keyboard never hides it;
   - no hover-only controls, no keyboard hints; targets at least 44 px. */
.ghead .back-groups, .dh-send, .more-btn, .pal-btn, .pal-close { display: none; }
.sec-tools { display: contents; }
@media (max-width: 760px) {
  .app { height: 100dvh; }
  .body { flex-direction: column; }
  .side { flex: 1 1 auto; max-height: none; width: 100%; border: none; }
  .me { display: flex; }
  .app.pane-group .side { display: none; }
  .app.pane-groups .main { display: none; }

  /* touch: no keyboard hints, bigger targets */
  kbd { display: none !important; }
  .item { min-height: 44px; }
  .btn { min-height: 40px; }
  .search { min-height: 44px; }

  /* the group's header: one line of title, the actions that matter */
  .ghead { padding: 8px 12px; gap: 6px 8px; flex-wrap: nowrap; }
  .ghead .back-groups { display: inline-flex; flex: none; }
  .ghead .t { flex: 1 1 auto; min-width: 0; }
  .ghead .row { flex-wrap: nowrap; }
  .ghead h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ghead .chip { display: none; }
  .ghead p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
  .ghead .actions { flex: none; display: flex; gap: 6px; }
  .ghead .actions .btn { padding: 0 10px; }
  .ghead .actions .btn:not(.primary):not(.icon) { display: none; }   /* Show as chat etc.: behind ⋯ */
  .ghead .actions .pal-btn { display: inline-flex; }
  .ghead .actions .btn.icon[aria-label="About this group"] { display: none; }   /* behind ⋯ too */
  .ghead .actions .btn.primary svg { margin: 0; }

  /* the list of posts: two lines each, subject first */
  .ptable { flex: 1 1 auto; border-bottom: none; }
  .prow.head { display: none; }
  .prow { grid-template-columns: 12px minmax(0, 1fr) auto; grid-template-areas: "flag sj date" ". from from";
    gap: 2px 8px; min-height: 56px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .prow .flag { grid-area: flag; }
  .prow .sj { grid-area: sj; font-size: 15px; }
  .prow .from { display: block; grid-area: from; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .prow .date { grid-area: date; font-size: 12px; color: var(--muted); }

  /* reading a post: the text, and Reply / ↑ ↓ / Next unread / ⋯ at the bottom */
  .scroll { padding: 16px 14px; }
  .reader h2 { font-size: 19px; }
  .reader .pbody { margin-left: 0; font-size: 15px; }
  .pbar { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); gap: 6px; }
  .pbar .hint, .pbar .full-btn { display: none; }
  .more-btn { display: inline-flex; }
  .sec-tools { display: none; }
  .sec-tools.open { display: flex; flex-wrap: wrap; gap: 6px; order: 10; width: 100%; }

  /* chat */
  .chatbar { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .chatbar > .hint { display: none; }
  .chatbar input { font-size: 16px; }      /* 16px: iOS does not zoom into the field */

  /* dialogs, and writing: the whole screen */
  .scrim { padding: 0; align-items: stretch; }
  .dialog, .dialog.wide { max-width: none; max-height: none; height: 100dvh; border-radius: 0; border: none; }
  .dialog .dh { position: sticky; top: 0; z-index: 1; background: var(--ink); }
  .dialog .db { flex: 1 1 auto; min-height: 0; }
  .dialog .df { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .dialog .in, .dialog textarea.in { font-size: 16px; }
  .dh-send, .pal-close { display: inline-flex; }
  .dialog .df.keys-only { display: none; }
  .compose-body, .dialog textarea.in { min-height: 0; flex: 1 1 auto; height: 40dvh; }

  /* the status bar: one quiet line */
  .statusbar { padding: 4px 12px; font-size: 12px; }
  .statusbar .st { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
