/* WoseApp — a deliberately calm interface.
   Light is the default; dark follows the system. */

:root {
  --paper:      #f7f6f3;
  --surface:    #ffffff;
  --surface-2:  #f1efea;
  --ink:        #1b1d21;
  --ink-2:      #5c6069;
  --ink-3:      #8b8f98;
  --line:       #e3e0d9;
  --line-2:     #d5d1c8;
  --accent:     #2f8f5b;
  --accent-ink: #ffffff;
  --accent-soft:#e7f2ec;
  --danger:     #b3402f;
  --danger-soft:#f6e7e4;
  --bubble-me:  #e7f2ec;
  --bubble-you: #f1efea;
  --focus:      #2f6f8f;
  --radius:     14px;
  --radius-sm:  10px;
  --shadow:     0 1px 2px rgba(20, 22, 26, .05), 0 8px 24px rgba(20, 22, 26, .04);
  --rail:       248px;
  --col:        620px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14161a;
    --surface:    #1b1e23;
    --surface-2:  #23272e;
    --ink:        #e9e9ea;
    --ink-2:      #a7acb5;
    --ink-3:      #767c86;
    --line:       #2a2e35;
    --line-2:     #363b44;
    --accent:     #4bb87c;
    --accent-ink: #0d1712;
    --accent-soft:#1c2f25;
    --danger:     #e0705c;
    --danger-soft:#31201d;
    --bubble-me:  #1e3a2b;
    --bubble-you: #23272e;
    --focus:      #6fb3d6;
    --shadow:     0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .28);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 .7em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface); padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

.icon { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------- structure */

.shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.main {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 0 max(84px, env(safe-area-inset-bottom));
}
.main-wide { max-width: 100%; padding-bottom: 0; }

/* Top bar: mobile and tablet only. */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .55rem .9rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; letter-spacing: -.02em; font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.rail { display: none; }

/* Bottom tab bar: mobile and tablet. */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: .5rem .2rem .45rem; color: var(--ink-3);
  min-height: 54px;
}
.tab:hover { text-decoration: none; color: var(--ink-2); }
.tab.is-active { color: var(--accent); }
.tab em { font-style: normal; font-size: .62rem; letter-spacing: .01em; }
.tab .dot {
  position: absolute; top: 4px; left: 50%; margin-left: 3px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-size: .62rem; font-weight: 700; border-radius: 9px;
}

@media (min-width: 1000px) {
  .shell {
    grid-template-columns: var(--rail) minmax(0, 1fr);
    max-width: calc(var(--rail) + var(--col) + 3rem);
    margin: 0 auto;
    gap: 2rem;
  }
  .topbar, .tabbar { display: none; }
  .main { padding-bottom: 4rem; grid-column: 2; }
  .main-wide { grid-column: 1 / -1; }

  .rail {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: sticky; top: 0; align-self: start;
    height: 100vh; padding: 1.4rem .5rem 1rem;
    grid-column: 1;
  }
  .rail-brand { padding: .2rem .75rem 1.2rem; font-size: 1.2rem; }
  .rail-link {
    position: relative;
    display: flex; align-items: center; gap: .8rem;
    padding: .65rem .8rem; border-radius: var(--radius);
    color: var(--ink-2); font-weight: 550;
  }
  .rail-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
  .rail-link.is-active { color: var(--ink); font-weight: 650; }
  .rail-link.is-active .icon { color: var(--accent); }
  .rail-link .badge {
    margin-left: auto; min-width: 20px; padding: 0 6px; height: 20px;
    display: grid; place-items: center; border-radius: 10px;
    background: var(--accent); color: var(--accent-ink);
    font-size: .7rem; font-weight: 700;
  }
  .rail-me { margin-top: auto; gap: .6rem; }
  .rail-me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-compose { margin: .6rem .3rem 0; justify-content: center; }
}

/* ---------------------------------------------------------------- pieces */

.page-head {
  padding: 1.4rem 1rem .6rem;
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: 1.45rem; }
.page-head-back { display: grid; gap: .25rem; }
.page-note { margin: .35rem 0 0; color: var(--ink-3); font-size: .84rem; }

.backlink {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--ink-3); font-size: .85rem;
}
.backlink .icon { width: 16px; height: 16px; }

.tabs { display: flex; gap: .4rem; margin-top: .8rem; }
.tabs-wrap { flex-wrap: wrap; }
.tabl {
  padding: .35rem .75rem; border-radius: 999px;
  font-size: .87rem; font-weight: 550; color: var(--ink-2);
  border: 1px solid var(--line);
}
.tabl:hover { text-decoration: none; background: var(--surface-2); }
.tabl.is-active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.05rem; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, black); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: .35rem .8rem; font-size: .85rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

.iconbtn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }

.flashes { padding: .8rem 1rem 0; display: grid; gap: .5rem; }
.flashes-float {
  position: fixed; top: .8rem; left: 50%; transform: translateX(-50%);
  z-index: 60; width: min(520px, calc(100% - 2rem)); padding: 0;
}
.flash {
  margin: 0; padding: .65rem .9rem; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  font-size: .9rem; box-shadow: var(--shadow);
}
.flash-err { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }

.avatar {
  --s: 44px;
  width: var(--s); height: var(--s); flex: none;
  border-radius: 50%; object-fit: cover; display: block;
  background: var(--surface-2);
}
.avatar-initial {
  display: grid; place-items: center;
  background: hsl(var(--hue, 150) 34% 82%);
  color: hsl(var(--hue, 150) 45% 24%);
  font-weight: 700; font-size: calc(var(--s) * .42);
  user-select: none;
}
@media (prefers-color-scheme: dark) {
  .avatar-initial { background: hsl(var(--hue, 150) 22% 28%); color: hsl(var(--hue, 150) 45% 82%); }
}

/* ----------------------------------------------------------- composer */

.composer {
  display: flex; gap: .8rem; padding: 1rem;
  border-bottom: 8px solid var(--surface-2);
  background: var(--surface);
}
.composer-main { flex: 1; min-width: 0; }
.composer textarea, .reply-form textarea, .msg-form textarea, .field textarea {
  width: 100%; resize: none; border: 0; background: transparent; color: inherit;
  font: inherit; padding: .35rem 0; max-height: 45vh;
}
.composer textarea::placeholder { color: var(--ink-3); }
.composer textarea:focus { outline: none; }
.composer-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: .8rem;
  margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line);
}
.counter { color: var(--ink-3); font-size: .8rem; font-variant-numeric: tabular-nums; }
.counter.is-low { color: var(--danger); }

.signin-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1rem; background: var(--surface); border-bottom: 8px solid var(--surface-2);
}
.signin-strip p { margin: 0; color: var(--ink-2); font-size: .9rem; }

/* --------------------------------------------------------------- posts */

.feed { display: flex; flex-direction: column; }

.post {
  display: flex; gap: .8rem;
  padding: 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.post-standalone { border-bottom: 8px solid var(--surface-2); }
.post-body { flex: 1; min-width: 0; }
.post-head {
  display: flex; align-items: baseline; gap: .35rem;
  font-size: .92rem; flex-wrap: wrap;
}
.post-name { font-weight: 650; }
.post-handle, .post-time, .post-dot { color: var(--ink-3); font-size: .87rem; }
.post-text { margin-top: .15rem; white-space: pre-wrap; }
.post-standalone .post-text { font-size: 1.12rem; }
.post-text a { color: var(--focus); text-decoration: underline; text-underline-offset: 2px; }

.post-actions {
  display: flex; align-items: center; gap: .35rem;
  margin-top: .7rem; flex-wrap: wrap;
}
.act-form { margin: 0; }
.act-right { margin-left: auto; }
.act {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .6rem; border-radius: 999px;
  border: 1px solid transparent; background: transparent;
  color: var(--ink-3); font: inherit; font-size: .84rem; cursor: pointer;
}
.act:hover { text-decoration: none; background: var(--surface-2); color: var(--ink-2); }
.act .icon { width: 17px; height: 17px; }
.act-reply:hover { color: var(--focus); }
.act-count { cursor: default; font-variant-numeric: tabular-nums; }
.act-count:hover { background: transparent; color: var(--ink-3); }
.act-count em { font-style: normal; }
.act-approve.is-on { color: var(--accent); background: var(--accent-soft); }
.act-approve.is-on .icon { stroke-width: 2.4; }
.act-danger:hover { color: var(--danger); background: var(--danger-soft); }

.quiet-note {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: 1rem; margin: 0;
  background: var(--surface); border-bottom: 1px solid var(--line);
  color: var(--ink-2); font-size: .9rem;
}
.quiet-note .icon { color: var(--accent); margin-top: 2px; }

.cta-row { padding: 1.2rem 1rem; display: grid; gap: .5rem; justify-items: start; }
.cta-note { color: var(--ink-3); font-size: .85rem; margin: 0; }

.pager { padding: 1.2rem 1rem; display: flex; justify-content: center; }

.empty {
  padding: 2.5rem 1.5rem; text-align: center; color: var(--ink-2);
  display: grid; gap: .5rem; justify-items: center;
}
.empty-page { padding-top: 5rem; }
.empty-title { font-weight: 650; color: var(--ink); font-size: 1.05rem; margin: 0; }
.empty-inline { padding: 2rem 1rem; text-align: center; color: var(--ink-3); }

.panel {
  background: var(--surface); border-top: 8px solid var(--surface-2);
  padding: .4rem 0;
}
.panel-title { padding: .8rem 1rem .4rem; font-size: 1rem; }
.panel-more { display: block; padding: .8rem 1rem; color: var(--accent); font-size: .9rem; }

.person {
  display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem;
}
.person + .person { border-top: 1px solid var(--line); }
.person-main { flex: 1; min-width: 0; }
.person-name { font-weight: 650; display: block; }
.person-handle { color: var(--ink-3); font-size: .87rem; }
.person-bio {
  margin: .2rem 0 0; color: var(--ink-2); font-size: .87rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ------------------------------------------------------------ profile */

.profile { padding: 1.2rem 1rem; background: var(--surface); border-bottom: 8px solid var(--surface-2); }
.profile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.profile-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.profile-actions form { margin: 0; }
.profile-name { font-size: 1.3rem; margin-top: .8rem; }
.profile-handle { color: var(--ink-3); margin: 0; }
.profile-bio { margin: .7rem 0 0; }
.profile-stats {
  display: flex; flex-wrap: wrap; gap: .2rem 1.1rem;
  margin: .9rem 0 0; color: var(--ink-3); font-size: .89rem;
}
.profile-stats b { color: var(--ink); font-weight: 650; }
.profile-joined { color: var(--ink-3); }

/* ------------------------------------------------------------ inboxes */

.threads { list-style: none; margin: 0; padding: 0; background: var(--surface); }
.thread-row {
  display: flex; align-items: flex-start; gap: .8rem; padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.thread-row:hover { text-decoration: none; background: var(--surface-2); }
.thread-row.is-unread { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.thread-main { flex: 1; min-width: 0; }
.thread-top { display: flex; align-items: baseline; gap: .35rem; }
.thread-name { font-weight: 650; }
.thread-handle { color: var(--ink-3); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-time { margin-left: auto; color: var(--ink-3); font-size: .8rem; flex: none; }
.thread-about {
  display: flex; align-items: center; gap: .35rem; margin: .15rem 0 0;
  color: var(--ink-3); font-size: .82rem;
}
.thread-about .icon { width: 14px; height: 14px; flex: none; }
.thread-snip {
  margin: .15rem 0 0; color: var(--ink-2); font-size: .9rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-snip .you { color: var(--ink-3); }
.pill {
  min-width: 21px; height: 21px; padding: 0 6px; align-self: center;
  display: grid; place-items: center; border-radius: 11px;
  background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700;
}

/* ----------------------------------------------------------- messages */

.thread-head {
  display: flex; align-items: center; gap: .8rem;
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
}
.thread-head h1 { display: none; }
.thread-head .backlink { flex: none; }
.thread-who { display: flex; align-items: center; gap: .55rem; min-width: 0; flex: 1; }
.thread-who span { display: grid; min-width: 0; }
.thread-who b { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-who em { font-style: normal; color: var(--ink-3); font-size: .8rem; }
.thread-archive { margin: 0; flex: none; }

.thread-privacy {
  display: flex; align-items: center; gap: .4rem;
  margin: 0; padding: .55rem 1rem; font-size: .8rem; color: var(--ink-3);
  background: var(--surface-2);
}
.thread-privacy .icon { width: 15px; height: 15px; }

.quoted {
  padding: .9rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.quoted-compact { font-size: .9rem; color: var(--ink-2); }
.quoted-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.quoted-name { font-weight: 650; }
.quoted-handle { color: var(--ink-3); font-size: .87rem; }
.quoted-label { color: var(--ink-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.quoted-link { margin-left: auto; color: var(--accent); font-size: .85rem; }
.quoted-text { white-space: pre-wrap; }

.messages { padding: 1rem; display: flex; flex-direction: column; gap: .35rem; }
.day-sep { text-align: center; margin: .8rem 0 .4rem; }
.day-sep span {
  background: var(--surface-2); color: var(--ink-3);
  padding: .2rem .7rem; border-radius: 999px; font-size: .75rem;
}
.msg { display: flex; }
.msg-mine { justify-content: flex-end; }
.bubble {
  max-width: min(78%, 34rem);
  padding: .5rem .8rem .35rem;
  border-radius: 16px 16px 16px 5px;
  background: var(--bubble-you);
}
.msg-mine .bubble { background: var(--bubble-me); border-radius: 16px 16px 5px 16px; }
.bubble-text { white-space: pre-wrap; }
.bubble-text a { color: var(--focus); text-decoration: underline; }
.bubble-time { display: block; text-align: right; color: var(--ink-3); font-size: .68rem; margin-top: .1rem; }

.msg-form {
  position: sticky; bottom: 0;
  display: flex; align-items: flex-end; gap: .6rem;
  padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.msg-form textarea {
  flex: 1; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 20px; padding: .6rem .9rem; max-height: 30vh;
}
.msg-form textarea:focus { outline: none; border-color: var(--accent); }

.blocked-note {
  margin: 0; padding: 1rem; text-align: center;
  color: var(--ink-3); font-size: .88rem; border-top: 1px solid var(--line);
}

@media (min-width: 1000px) {
  .msg-form { bottom: 0; }
}

/* ------------------------------------------------------ notifications */

.notes { list-style: none; margin: 0; padding: 0; background: var(--surface); }
.note {
  display: flex; align-items: flex-start; gap: .8rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--line);
}
.note.is-new { background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); }
.note-main { flex: 1; min-width: 0; }
.note-main p { margin: 0; font-size: .92rem; color: var(--ink-2); }
.note-name { font-weight: 650; color: var(--ink); }
.note-time { color: var(--ink-3); font-size: .8rem; margin-left: .2rem; }
.note-post {
  display: block; margin-top: .25rem; padding: .4rem .6rem;
  background: var(--surface-2); border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: .85rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.clear-form { padding: 1rem; display: flex; justify-content: center; }

/* ------------------------------------------------------ forms & prose */

.card-form {
  display: grid; gap: 1rem; padding: 1.2rem 1rem;
  background: var(--surface); border-bottom: 8px solid var(--surface-2);
}
.field { display: grid; gap: .3rem; }
.field > span { font-weight: 600; font-size: .9rem; }
.field > span i { font-style: normal; font-weight: 400; color: var(--ink-3); }
.field small { color: var(--ink-3); font-size: .8rem; }
.field input, .field textarea, .searchbar input {
  font: inherit; color: inherit;
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: .6rem .75rem;
  width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field input:disabled { color: var(--ink-3); background: var(--surface-2); }
.field textarea { resize: vertical; }
.field-label { display: block; font-weight: 600; font-size: .9rem; padding: 1rem 1rem 0; }

.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .93rem; }
.check input { margin-top: .3rem; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.check small { display: block; color: var(--ink-3); font-size: .82rem; }
.form-h { font-size: 1rem; margin-top: .3rem; }
.form-note { color: var(--ink-2); font-size: .88rem; margin: 0; }
.rule { border: 0; border-top: 1px solid var(--line); margin: .2rem 0; }
.avatar-row { display: flex; gap: 1rem; align-items: flex-start; }
.avatar-row > div { flex: 1; display: grid; gap: .6rem; }
.danger-form { border-left: 3px solid var(--danger); }

.reply-form { display: grid; gap: 0; padding: 0 1rem 1rem; background: var(--surface); }
.reply-form textarea {
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: .7rem .8rem; margin-top: .35rem;
}
.reply-form textarea:focus { outline: none; border-color: var(--accent); }

.fineprint {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: 1rem; color: var(--ink-3); font-size: .84rem;
}
.fineprint .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }

.searchbar {
  display: flex; align-items: center; gap: .6rem; padding: 1rem;
  background: var(--surface); border-bottom: 8px solid var(--surface-2);
}
.searchbar .icon { color: var(--ink-3); flex: none; }
.searchbar input { flex: 1; }

.prose { padding: 1.4rem 1rem 3rem; background: var(--surface); }
.prose h2 { font-size: 1.08rem; margin: 1.6rem 0 .5rem; }
.prose .lede { font-size: 1.1rem; color: var(--ink); }
.prose ul { margin: 0 0 1em; padding-left: 1.2rem; color: var(--ink-2); }
.prose li { margin-bottom: .45rem; }
.prose strong { color: var(--ink); }

/* ---------------------------------------------------- signed-out pages */

body.plain { background: var(--paper); }

.auth {
  width: min(430px, calc(100% - 2rem));
  margin: 3rem auto 4rem;
  display: grid; gap: .8rem;
}
.auth-brand { justify-self: center; font-size: 1.3rem; margin-bottom: .5rem; }
.auth h1 { font-size: 1.5rem; text-align: center; }
.auth-note { text-align: center; color: var(--ink-3); font-size: .9rem; margin: 0; }
.auth .card-form {
  border: 1px solid var(--line); border-radius: var(--radius);
  border-bottom-width: 1px; box-shadow: var(--shadow); margin-top: .5rem;
}
.auth-alt { text-align: center; color: var(--ink-2); font-size: .9rem; margin: 0; }
.auth-alt a { color: var(--accent); font-weight: 600; }

.landing { max-width: 1060px; margin: 0 auto; padding: 0 1.2rem 4rem; }
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.2rem 0; flex-wrap: wrap;
}
.landing-nav nav { display: flex; gap: .5rem; }

.hero { padding: 3.5rem 0 2.5rem; max-width: 40rem; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); letter-spacing: -.03em; line-height: 1.1; }
.hero-sub { margin-top: 1.1rem; font-size: clamp(1rem, 2.4vw, 1.16rem); color: var(--ink-2); }
.hero-cta { display: flex; gap: .7rem; margin-top: 1.8rem; flex-wrap: wrap; }

.pitch {
  display: grid; gap: 1rem; margin: 1.5rem 0 3rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.pitch-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem;
}
.pitch-card h2 { font-size: 1rem; margin-bottom: .4rem; }
.pitch-card p { color: var(--ink-2); font-size: .92rem; margin: 0; }

.demo { max-width: 34rem; }
.post-demo {
  border: 1px solid var(--line); border-radius: var(--radius); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.demo-note { margin-top: .8rem; color: var(--ink-3); font-size: .87rem; text-align: center; }

.landing-foot {
  margin-top: 3.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: .87rem;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Delete sits with the timestamp, so the action row never wraps on narrow screens. */
.post-del { margin: -6px 0 -6px auto; }
.iconbtn-sm { width: 30px; height: 30px; }
.iconbtn-sm .icon { width: 16px; height: 16px; }
.post-del .iconbtn:hover { color: var(--danger); background: var(--danger-soft); }
.post-head { width: 100%; }

/* --------------------------------------------- composer reply switch */

.composer-opt {
  display: flex; gap: .55rem; align-items: flex-start;
  margin-top: .6rem; font-size: .85rem; color: var(--ink-2);
}
.composer-opt input { margin-top: .25rem; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.composer-opt .icon { width: 15px; height: 15px; vertical-align: -2px; }
.composer-opt small { display: block; color: var(--ink-3); font-size: .78rem; }

.act-off { cursor: default; color: var(--ink-3); opacity: .75; }
.act-off:hover { background: transparent; color: var(--ink-3); }

/* ------------------------------------------------------- moderation */

.statgrid {
  display: grid; gap: 1px; background: var(--line);
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  border-bottom: 8px solid var(--surface-2);
}
.stat {
  display: grid; gap: 2px; padding: .9rem 1rem;
  background: var(--surface); color: var(--ink-2);
}
.stat:hover { text-decoration: none; background: var(--surface-2); }
.stat b { font-size: 1.4rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--ink-3); }
.stat-bad b { color: var(--danger); }

.tagl {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: .72rem; font-weight: 600; vertical-align: 1px;
}
.tagl-bad  { background: var(--danger-soft); color: var(--danger); }
.tagl-warn { background: #f4ecd8; color: #8a6a1f; }
.tagl-role { background: var(--accent-soft); color: var(--accent); text-transform: capitalize; }
@media (prefers-color-scheme: dark) {
  .tagl-warn { background: #3a3222; color: #d8b768; }
}
.person-meta { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; -webkit-line-clamp: unset; }

.logs { list-style: none; margin: 0; padding: 0; }
.logrow {
  display: flex; gap: .6rem; align-items: baseline;
  padding: .55rem 1rem; border-top: 1px solid var(--line); font-size: .85rem;
}
.logrow:first-child { border-top: 0; }
.logaction {
  flex: none; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: .72rem; font-weight: 600; text-transform: capitalize;
}
.logaction-ban, .logaction-delete_user, .logaction-delete_post { background: var(--danger-soft); color: var(--danger); }
.logaction-unban, .logaction-restore_post { background: var(--accent-soft); color: var(--accent); }
.logtext { flex: 1; min-width: 0; color: var(--ink-2); }
.logtext i { color: var(--ink-3); font-style: normal; }
.logtime { flex: none; color: var(--ink-3); font-size: .75rem; }

.modpost { padding: .8rem 1rem; border-top: 1px solid var(--line); }
.modpost:first-child { border-top: 0; }
.modpost.is-removed { opacity: .6; }
.modpost-head {
  display: flex; gap: .4rem; align-items: center; flex-wrap: wrap;
  font-size: .85rem; color: var(--ink-3);
}
.modpost-head .avatar { --s: 28px; }
.modpost-counts { margin-left: auto; font-variant-numeric: tabular-nums; }
.modpost-body { margin: .4rem 0 .5rem; color: var(--ink); font-size: .92rem; }
.modpost-acts { display: flex; gap: .5rem; }

.verified-note {
  display: flex; align-items: center; gap: .4rem;
  margin: 0; padding: .7rem 1rem; font-size: .85rem;
  color: var(--accent); background: var(--accent-soft);
}
.verified-note .icon { width: 16px; height: 16px; }

.field select {
  font: inherit; color: inherit;
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: .6rem .75rem; width: 100%;
}

/* Password field with its own escape hatch. */
.field-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.field-row label { font-weight: 600; font-size: .9rem; }
.field-aside { color: var(--accent); font-size: .82rem; font-weight: 600; }

/* ------------------------------------------------------- post media */

.media {
  display: grid; gap: 3px; margin-top: .6rem;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
}
.media-1 { grid-template-columns: 1fr; }
.media-2 { grid-template-columns: 1fr 1fr; }
.media-3 { grid-template-columns: 1fr 1fr; }
.media-3 .media-item:first-child { grid-row: span 2; }
.media-4 { grid-template-columns: 1fr 1fr; }
.media-item {
  position: relative; display: block; background: var(--surface-2);
  min-height: 0;
}
.media-item:hover { text-decoration: none; }
.media-1 .media-item img { max-height: 520px; width: 100%; object-fit: contain; background: var(--surface-2); }
.media-2 .media-item img, .media-3 .media-item img, .media-4 .media-item img {
  width: 100%; height: 100%; max-height: 260px; object-fit: cover;
}
.media-item img { display: block; }
.media-tag {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(0,0,0,.72); color: #fff;
  font-size: .66rem; font-weight: 700; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 4px;
}

.composer-media { display: block; margin-top: .7rem; cursor: pointer; }
.composer-media input[type="file"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
}
.composer-media-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .75rem; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-2);
  font-size: .85rem; font-weight: 600;
}
.composer-media:hover .composer-media-btn { background: var(--surface-2); color: var(--ink); }
.composer-media input:focus-visible + .composer-media-btn { outline: 2px solid var(--focus); outline-offset: 2px; }
.composer-media small { display: block; margin-top: .3rem; color: var(--ink-3); font-size: .76rem; }
.composer-media small.is-bad { color: var(--danger); }

/* ---------------------------------------------------- video card */

.ytcard {
  position: relative; margin-top: .6rem;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: #0d0f12;
  aspect-ratio: 16 / 9;
}
.ytcard-play {
  position: relative; display: block;
  width: 100%; height: 100%; padding: 0;
  border: 0; background: transparent; cursor: pointer; font: inherit;
  color: #fff;
}
.ytcard-poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ytcard-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.10) 0%, rgba(0,0,0,0) 38%, rgba(0,0,0,.72) 100%);
}
.ytcard-icon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.5));
  transition: transform .15s ease;
}
.ytcard-play:hover .ytcard-icon { transform: translate(-50%, -50%) scale(1.08); }
.ytcard-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: .7rem .9rem;
  font-size: .88rem; font-weight: 600; line-height: 1.3; text-align: left;
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ytcard:not(.has-poster) .ytcard-shade { background: none; }
.ytcard.is-playing { background: #000; }
.ytcard iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ------------------------------------------------------ group rooms */

.act-group:hover { color: var(--accent); }
.tagl-bot { background: var(--surface-2); color: var(--ink-3); display: inline-flex; align-items: center; gap: 3px; }
.tagl-bot .icon { width: 12px; height: 12px; }

.groupdot {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
}
.thread-head .groupdot { width: 36px; height: 36px; }

.group-warning {
  display: flex; gap: .7rem; align-items: flex-start;
  margin: 0; padding: .9rem 1rem;
  background: #f4ecd8; color: #6b5316; font-size: .88rem;
  border-bottom: 1px solid var(--line);
}
.group-warning .icon { flex: none; margin-top: 2px; }
@media (prefers-color-scheme: dark) {
  .group-warning { background: #33291a; color: #e0c88a; }
}
.thread-privacy-open { background: #f4ecd8; color: #6b5316; }
@media (prefers-color-scheme: dark) {
  .thread-privacy-open { background: #33291a; color: #e0c88a; }
}

.members { border-bottom: 1px solid var(--line); background: var(--surface); }
.members summary {
  padding: .7rem 1rem; cursor: pointer; font-size: .85rem; color: var(--ink-2);
}
.members-list { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .8rem; }
.member {
  display: flex; align-items: center; gap: .4rem;
  padding: .25rem .6rem .25rem .25rem; border-radius: 999px;
  background: var(--surface-2); font-size: .82rem;
}
.member:hover { text-decoration: none; background: var(--line); }
.member span { display: grid; line-height: 1.15; }
.member em { font-style: normal; color: var(--ink-3); font-size: .72rem; }

.messages-group .msg { align-items: flex-end; gap: .45rem; }
.msg-av { flex: none; align-self: flex-end; }
.msg-av-blank { width: 28px; }
.bubble-who {
  display: block; font-size: .76rem; font-weight: 700;
  color: var(--accent); margin-bottom: 2px;
}
.messages-group .msg:not(.msg-head) .bubble { border-top-left-radius: 6px; }
.leave-form { display: flex; justify-content: center; padding: 0 1rem 1.5rem; }

.bot-note {
  display: flex; gap: .6rem; align-items: flex-start;
  margin: .8rem 0 0; padding: .7rem .85rem;
  background: var(--surface-2); border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: .85rem;
}
.bot-note .icon { flex: none; margin-top: 2px; color: var(--ink-3); }

/* Single images size to their own aspect ratio instead of stretching a grid row. */
.media { align-items: start; }
.media-1 .media-item img { height: auto; max-height: 560px; object-fit: contain; }
