:root {
  color-scheme: light;
  --text: #20252b;
  --secondary: #444d57;
  --muted: #606b77;
  --page: #f5f6f7;
  --surface: #ffffff;
  --soft: #edf0f2;
  --border: #dce1e6;
  --border-strong: #848c96;
  --accent: #175b9b;
  --on-accent: #ffffff;
  --danger: #a92e26;
  --warning: #fff6df;
  --warning-border: #a88628;
  --shadow: #00000020;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
  color-scheme: dark;
  --text: #e8edf2;
  --secondary: #c0c9d3;
  --muted: #a0acba;
  --page: #11161c;
  --surface: #171e26;
  --soft: #212b36;
  --border: #313d4b;
  --border-strong: #6b7682;
  --accent: #83bcf0;
  --on-accent: #11161c;
  --danger: #f49891;
  --warning: #332c19;
  --warning-border: #a78b43;
  --shadow: #00000060;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #e8edf2;
  --secondary: #c0c9d3;
  --muted: #a0acba;
  --page: #11161c;
  --surface: #171e26;
  --soft: #212b36;
  --border: #313d4b;
  --border-strong: #6b7682;
  --accent: #83bcf0;
  --on-accent: #11161c;
  --danger: #f49891;
  --warning: #332c19;
  --warning-border: #a78b43;
  --shadow: #00000060;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  background: var(--page);
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  font-size: 0.9rem;
}

header nav .identity {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.identity .did {
  color: var(--muted);
  font-size: 0.82em;
  overflow-wrap: anywhere;
}

img.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 0.35rem;
  background: var(--soft);
}

.byline {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 1rem;
}

header nav form {
  display: inline;
  margin: 0;
}

header nav button {
  margin-top: 0;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  padding: 0.5rem 1rem;
  z-index: 10;
}

.skip:focus-visible {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.layer {
  display: inline-block;
  padding: 0.05em 0.45em;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--soft);
  color: var(--secondary);
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.15rem 0;
}

.item-heading {
  margin: 0.1rem 0;
}

details.about,
details.why {
  font-size: 0.9rem;
  margin: 0.35rem 0;
}

details.why summary {
  color: var(--accent);
  cursor: pointer;
  display: inline-block;
}

details.about summary {
  cursor: pointer;
  font-weight: 600;
}

.legend {
  color: var(--muted);
}

a.external::after {
  content: " ↗";
}

.tombstone-banner {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-left-width: 4px;
  border-radius: 4px;
  background: var(--soft);
}

.projection-note {
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 1.5rem;
}

h1 {
  font-size: 1.35rem;
  margin: 0.5rem 0 1rem;
}

h2 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

a {
  color: var(--accent);
}

.purpose {
  color: var(--secondary);
}

form {
  margin: 1rem 0;
}

label {
  display: block;
  margin: 0.6rem 0 0.3rem;
  font-weight: 600;
}

input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]),
textarea {
  width: 100%;
  padding: 0.45rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

button {
  margin-top: 0.5rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  cursor: pointer;
}

ul,
ol {
  padding-left: 1.5rem;
}

li {
  margin: 0.45rem 0;
  overflow-wrap: anywhere;
}

article {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tombstone {
  color: var(--muted);
  font-style: italic;
  border-left: 3px solid var(--border-strong);
  padding-left: 0.6rem;
}

.badge {
  display: inline-block;
  padding: 0.05em 0.45em;
  border-radius: 3px;
  background: var(--danger);
  color: var(--on-accent);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.notice {
  padding: 0.75rem 1rem;
  border: 1px solid var(--warning-border);
  border-radius: 4px;
  background: var(--warning);
}

.pages {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin: 1rem 0;
}

.pages-summary {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.error-message {
  font-weight: 600;
}

/* The public collection leads; participation follows the posts. */
.p0 main {
  max-width: 48rem;
}

.p0 h1 {
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  margin-bottom: 0;
}

.collection-intro .exhibition {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.collection-tagline {
  font-size: 1.15rem;
  font-weight: 600;
}

.collection-intro p {
  margin: 0.65rem 0;
}

.collection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin: 0.85rem 0;
  font-weight: 600;
}

.p0 .collection-posts {
  padding: 0;
  list-style: none;
}

.p0 .collection-posts > li {
  margin: 0.8rem 0;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.p0 .collection-posts .item-heading {
  font-size: 1.05rem;
  font-weight: 600;
}

.seed-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.participation {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-top: 0.5rem;
}

.permissions {
  margin-top: 1rem;
}

.permissions code {
  overflow-wrap: anywhere;
}

#collection, #submit {
  scroll-margin-top: 1rem;
}

.participant-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr)); gap:1rem; margin-top:1.5rem; }
.participant-card, .label-card { background:var(--surface); border:1px solid var(--border); border-radius:.6rem; padding:1.2rem; overflow-wrap:anywhere; }
.participant-card h2, .label-card h2 { margin-top:0; }
.label-card { margin:1rem 0; }
.label-card code, main code { overflow-wrap:anywhere; }

/* A continuous reader column, with generous targets rather than spacious cards. */
.p0.reader-page main { max-width:600px; padding:0; }
.reader-page h1 { font-size:17px; margin:0; padding:0 12px; }
.reader-page .page-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; padding:0 12px; }
.reader-page .page-heading h1 { padding:0; }
.feed-refresh { display:inline-flex; align-items:center; min-height:44px; font-size:13px; }
.following-feed { border-top:1px solid var(--border); }
.feed-post { margin:0; background:var(--surface); border-bottom:1px solid var(--border); padding:10px 12px 0; white-space:normal; }
.feed-row { display:grid; grid-template-columns:40px minmax(0,1fr); gap:10px; }
.feed-body { min-width:0; }
.feed-author { display:flex; align-items:baseline; gap:6px; min-width:0; margin-bottom:3px; white-space:nowrap; }
.feed-author strong, .feed-handle { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.feed-author strong { flex:0 1 auto; max-width:60%; }
.feed-author strong:only-of-type { max-width:60%; }
.feed-handle { flex:1 1 0; color:var(--muted); font-size:13px; }
.feed-date { flex:none; margin-left:auto; color:var(--muted); font-size:13px; font-variant-numeric:tabular-nums; }
.feed-avatar { width:40px; height:40px; border-radius:50%; object-fit:cover; background:var(--soft); }
.feed-avatar-placeholder { display:block; }
.feed-text { font-size:15px; line-height:1.4; white-space:pre-wrap; overflow-wrap:anywhere; }
.feed-images { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr)); gap:4px; margin-top:8px; }
.feed-images img { width:100%; max-height:28rem; object-fit:contain; background:var(--soft); border-radius:6px; }
.feed-actions { display:flex; flex-wrap:wrap; align-items:center; gap:0 16px; margin-top:2px; font-size:13px; }
.feed-actions a { display:inline-flex; align-items:center; min-height:44px; color:var(--muted); }
.feed-external { display:block; padding:10px; margin-top:8px; border:1px solid var(--border); border-radius:6px; text-decoration:none; }
.feed-external span, .feed-external small { display:block; margin-top:4px; }
.feed-context { margin:0; padding:6px 12px 3px 62px; background:var(--surface); color:var(--muted); font-size:13px; }
.feed-next { padding:12px; text-align:center; font-weight:600; }
.feed-next a { display:inline-flex; align-items:center; min-height:44px; }
.reader-details, .quiet-control { margin:12px; padding:12px; background:var(--soft); border-radius:6px; }
.content-warning { border:1px solid var(--border-strong); border-radius:6px; padding:0; }
.content-warning[open] > .feed-row { padding:0 8px; }
.content-warning > summary { display:list-item; min-height:44px; padding:10px; cursor:pointer; }
.thread-reply { margin-left:0; }
.thread-reply .thread-reply { margin-left:16px; border-left:1px solid var(--border); }
.thread-focus { box-shadow:inset 3px 0 0 var(--accent); }
.thread-focus .feed-post { background:transparent; }
.thread-focus .feed-author { flex-wrap:wrap; white-space:normal; }
.thread-focus .feed-author strong, .thread-focus .feed-handle { max-width:none; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
.thread-focus .feed-handle { flex:1 1 auto; }
.thread-focus .feed-date { flex:1 0 100%; margin:2px 0 4px; }
.thread-focus .feed-text { font-size:17px; line-height:1.45; }
.account-menu { position:relative; }
.account-menu > summary { min-height:44px; display:flex; align-items:center; cursor:pointer; }
.account-menu-items { position:absolute; right:0; top:100%; z-index:5; min-width:180px; padding:6px; border:1px solid var(--border); border-radius:6px; background:var(--surface); box-shadow:0 6px 18px var(--shadow); }
.account-menu-items a { display:flex; align-items:center; min-height:44px; padding:0 10px; }
.muted { color:var(--muted); font-size:13px; }
header nav > a { display:inline-flex; align-items:center; min-height:44px; }
header nav [aria-current="page"] { color:var(--text); text-decoration-thickness:2px; text-underline-offset:5px; }
.display-form fieldset { margin:12px 0; border:1px solid var(--border); border-radius:6px; padding:12px; }
.display-options { display:flex; flex-wrap:wrap; gap:6px 20px; }
.display-options label { display:flex; align-items:center; gap:8px; min-height:44px; margin:0; font-weight:400; }
.display-options input { accent-color:var(--accent); }
@media (min-width:601px) { .reader-page main { border-left:1px solid var(--border); border-right:1px solid var(--border); } }
@media (max-width:480px) { header { padding:4px 12px; gap:0 12px; } header nav { gap:12px; } .feed-actions { gap:0 12px; } }

.feed-notice { margin:0; min-height:44px; padding:10px 12px 10px 62px; background:var(--surface); color:var(--muted); font-size:13px; }
.feed-notice p { margin:0; }
.feed-body .feed-notice { padding:8px 0; }
.header-inner { display:flex; flex-wrap:wrap; align-items:center; gap:0 12px; width:100%; max-width:600px; margin:0 auto; }
@media (hover:hover) and (pointer:fine) { .feed-actions a, .feed-refresh, .account-menu-items a { min-height:32px; } }
@media (max-width:359px) {
  .feed-row { grid-template-columns:32px minmax(0,1fr); gap:8px; }
  .feed-avatar { width:32px; height:32px; }
  .feed-context, .feed-notice { padding-left:52px; }
}

.reader-page header { padding:0 12px; }

/* One primary reader and one deliberate companion, never an automatic dashboard. */
.workspace-active header .header-inner { max-width:1440px; }
.p0.workspace-active main.workspace { max-width:1440px; padding:0; border:0; display:grid; grid-template-columns:190px minmax(0,600px); justify-content:center; height:calc(100dvh - var(--workspace-header,45px)); overflow:hidden; }
.p0.workspace-active main.workspace.has-companion { grid-template-columns:190px minmax(0,600px) minmax(300px,600px); }
.workspace-nav { padding:16px 12px; overflow:auto; border-right:1px solid var(--border); }
.workspace-nav h2 { font-size:17px; margin:0 0 16px; }
.workspace-nav label { display:block; font-size:13px; margin:0 0 14px; }
.workspace-nav select { width:100%; min-height:36px; margin-top:4px; color:var(--text); background:var(--surface); border:1px solid var(--border-strong); border-radius:6px; }
.workspace-nav form { padding:0; border:0; }
.workspace-hint { font-size:13px; }
.workspace-primary,.companion-content { min-width:0; overflow:auto; overscroll-behavior:contain; }
.workspace-primary { border-right:1px solid var(--border); }
.workspace-secondary { min-width:0; display:flex; flex-direction:column; background:var(--surface); }
.workspace-secondary[hidden] { display:none; }
.companion-heading { display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:6px 10px; border-bottom:1px solid var(--border); }
.companion-heading strong { margin-right:auto; font-size:14px; }
.companion-heading button { font-size:13px; min-height:32px; padding:4px 8px; }
.companion-content { flex:1; }
.workspace-view > p,.workspace-view > h2,.workspace-view > ul,.workspace-view > details:not(.reader-details),.workspace-view > form { margin:12px; }
.workspace-view > .page-heading { min-height:44px; padding:0 12px; display:flex; justify-content:space-between; align-items:center; }
.workspace-view > .page-heading h1 { font-size:17px; margin:0; padding:0; }
.workspace-view .feed-next,.workspace-view .reader-details,.local-quiet-review { margin:12px; }
.workspace-view article[hidden] { display:none; }
.feed-actions button { background:transparent; border:0; color:var(--muted); text-decoration:underline; padding:0 4px; font:inherit; cursor:pointer; min-height:32px; }
.workspace-status { position:fixed; bottom:16px; left:50%; transform:translateX(-50%); z-index:20; max-width:min(600px,90vw); padding:12px; background:var(--surface); color:var(--text); box-shadow:0 2px 16px #0005; border:1px solid var(--border-strong); border-radius:8px; }
.workspace-status:empty { display:none; }
.workspace-status button { margin-left:12px; }
.workspace-view [aria-disabled="true"] { pointer-events:none; opacity:.6; }
@media (max-width:1050px) {
 .p0.workspace-active main.workspace { grid-template-columns:150px minmax(0,600px); }
 .p0.workspace-active main.workspace.has-companion { grid-template-columns:130px minmax(0,1fr) minmax(280px,1fr); }
}
@media (max-width:760px) {
 .p0.workspace-active main.workspace,.p0.workspace-active main.workspace.has-companion { display:flex; flex-direction:column; height:calc(100dvh - var(--workspace-header,45px)); }
 .workspace-nav { flex:none; display:flex; gap:8px; flex-wrap:wrap; padding:8px 12px; border-right:0; border-bottom:1px solid var(--border); overflow:visible; }
 .workspace-nav h2,.workspace-hint { display:none; }
 .workspace-nav label { flex:1 1 90px; min-width:0; margin:0; }
 .workspace-nav form { margin:0; width:100%; }
 .workspace-nav form button { min-height:36px; }
 .workspace-primary { flex:1; }
 .workspace-secondary { position:fixed; inset:var(--workspace-header,45px) 0 0; z-index:10; }
 .companion-heading button,.feed-actions button { min-height:44px; }
}
@media (pointer:coarse) { .feed-actions button { min-height:44px; } }
.workspace-view .collection-intro { padding:12px; }
.workspace-view .collection-tagline { font-size:20px; }
.workspace-view .collection-posts { margin:0; padding:0; }
.workspace-view .collection-posts > .community-post { list-style:none; margin:0; padding:0 0 10px; border-radius:0; }
.community-post > details,.community-post > a { margin:8px 12px; }
.workspace-view #submit { padding:12px; }
.post-context { font-size:13px; margin:6px 0; }
.context-badge { display:inline-flex; align-items:center; min-height:32px; gap:4px; }
.post-context ul { padding-left:18px; }
.feed-quote { border:1px solid var(--border); border-radius:8px; margin:8px 0; overflow:hidden; }
.feed-quote .feed-post { border-bottom:0; }
.feed-quote .feed-avatar { width:28px; height:28px; }
.feed-quote .feed-row { grid-template-columns:28px minmax(0,1fr); gap:8px; }
.feed-video { margin-top:8px; }
.feed-video video { width:100%; max-height:420px; background:#000; border-radius:8px; }
.feed-external img { width:100%; max-height:220px; object-fit:cover; }
.following-feed > .feed-context:has(+ article[hidden]) { display:none; }

.reader-welcome { margin:12px; padding:14px; border:1px solid var(--border); border-radius:8px; background:var(--surface); font-size:14px; }
.reader-welcome h2 { font-size:18px; margin:0 0 8px; }
.reader-welcome p { margin:8px 0; }
.reader-welcome button { min-height:36px; margin:4px 0; }
.workspace-create { font-size:13px; margin:0 0 14px; }
.personal-feed-form label { display:block; margin:10px 0; }
.personal-feed-form input:not([type=checkbox]):not([type=hidden]) { display:block; width:100%; max-width:34rem; }
.personal-feed-form fieldset { border:1px solid var(--border); border-radius:6px; }
.personal-feed-list { padding:0; list-style:none; }
.personal-feed-list > li { padding:12px 0; border-bottom:1px solid var(--border); }
.personal-feed-list h3 { margin:0; }
.personal-feed-summary { padding:0 12px; font-size:13px; }
@media(max-width:760px){ .workspace-create{width:100%;margin:0;} .reader-welcome{padding:10px;font-size:13px;} .reader-welcome h2{font-size:16px;} }

/* Signed-out product entry; authenticated workspace layout is unchanged. */
.product-intro { margin-bottom: 1.25rem; }
.product-tagline { font-size: clamp(1.4rem, 4vw, 1.85rem); line-height: 1.2; font-weight: 650; }
.frontdoor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.signin-link { display: inline-block; padding: .7rem 1rem; border: 1px solid currentColor; border-radius: .5rem; font-weight: 650; }
.header-signin { font-weight: 700; }
.account-availability { font-size: .875rem; line-height: 1.5; }
.cabinet-heading { margin-top: 2rem; }
.attention-summary { margin:0; padding:8px 12px; color:var(--muted); font-size:13px; }
.attention-summary p, .attention-marker p { margin:0; }
.attention-summary ul, .attention-marker ul { margin:6px 0; padding-left:18px; }
.feed-empty { margin:0; padding:12px; color:var(--muted); }
.community-conversation { margin-top:24px; }
.community-conversation .conversation-note, .community-context { color:var(--muted); font-size:13px; }
.community-context { margin:8px 12px; }
.moderator-actions { margin-top:24px; padding:12px; background:var(--soft); border-radius:6px; }

/* Public About, Privacy and Terms pages, and the footer linking them */
.prose { max-width: 42rem; line-height: 1.55; }
.prose h2 { margin-top: 1.75rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95em; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.45rem 0.55rem; text-align: left; vertical-align: top; }
.prose th { background: var(--soft); }
.prose code { overflow-wrap: anywhere; }
@media (max-width: 40rem) { .prose table, .prose tbody, .prose tr, .prose td { display: block; } .prose thead { display: none; } .prose td:first-child { font-weight: 600; background: var(--soft); } }
.site-footer { border-top: 1px solid var(--border); margin-top: 2.5rem; padding: 1rem; color: var(--muted); font-size: 0.9em; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; justify-content: center; }
.site-footer a { color: var(--secondary); }

.labs-settings label { display:flex; align-items:center; gap:8px; min-height:44px; }
.labs-comparison { margin:0; padding:10px 12px; border-top:1px solid var(--border); background:var(--soft); }
.labs-comparison p,.labs-group-note { margin:4px 0; color:var(--muted); font-size:13px; }
.labs-comparison button { min-height:36px; margin:4px 6px 0 0; }
.labs-comparison button[aria-pressed="true"] { color:var(--surface); background:var(--accent); }
.labs-group { border-bottom:2px solid var(--border-strong); }
.labs-group-note { padding:8px 12px 4px; background:var(--soft); }
.labs-group .feed-post { border-bottom:0; }
.labs-group-members { background:var(--surface); border-top:1px solid var(--border); }
.labs-group-members > summary { min-height:44px; padding:10px 12px; cursor:pointer; font-weight:600; }
.labs-group-members .feed-post { border-top:1px solid var(--border); }
