/* The site's look: a dark ground, one color per wing, Secular One for
   display type, Heebo for text, Frank Ruhl Libre for long reading. */

:root {
  --ground: #13110e;
  --raised: #1e1b16;
  --raised-2: #2a2620;
  --line: #2e2a24;
  --line-strong: #4a443b;
  --ink: #f3eee6;
  --soft: #cfc6b8;
  --muted: #9a9183;
  --paper: #f6f1e7;
  --paper-ink: #231e16;
  --accent: #e9a23b;
  --on-accent: #1a1206;
  --display: 'Secular One', 'Heebo', sans-serif;
  --text: 'Heebo', system-ui, sans-serif;
  --read: 'Frank Ruhl Libre', 'Heebo', serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 22px;
  --gutter: 24px;
}

/* One color per wing. The page sets data-wing on <body> or a block. */
[data-wing='music'] { --accent: #e9a23b; --on-accent: #1a1206; --tint: #2a2418; }
[data-wing='books'] { --accent: #5db7a4; --on-accent: #06201b; --tint: #12302a; }
[data-wing='sketches'] { --accent: #e584b4; --on-accent: #2a0b1b; --tint: #33172a; }
[data-wing='humor'] { --accent: #ee7a54; --on-accent: #2a0e05; --tint: #33190f; }
[data-wing='torah'] { --accent: #e3c978; --on-accent: #221a03; --tint: #2c2711; }
[data-wing='articles'] { --accent: #d9d1c3; --on-accent: #1c1912; --tint: #2a2721; }
[data-wing='software'] { --accent: #79bfe6; --on-accent: #04192a; --tint: #11283a; }
[data-wing='videos'] { --accent: #b6a2ee; --on-accent: #170c33; --tint: #221a3b; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header and footer ---------- */
.bar { position: sticky; top: 0; z-index: 10; background: rgb(19 17 14 / 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding-block: 16px; }
.mark { font-family: var(--display); font-size: 24px; text-decoration: none; }
.bar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; flex: 1 1 auto; font-size: 15px; }
.bar nav a { color: var(--soft); text-decoration: none; padding-block: 4px; }
.bar nav a:hover, .bar nav a[aria-current='page'] { color: var(--ink); }
.bar nav a[aria-current='page'] { box-shadow: inset 0 -2px var(--accent); }
.bar .who { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.site-foot { border-top: 1px solid var(--line); margin-top: 64px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 32px 48px; color: var(--muted); font-size: 14px; }
.site-foot a { color: var(--soft); text-decoration: none; }
.socials { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* ---------- buttons, chips, badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--ground); border-color: var(--ink); font-weight: 700; }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.btn.small { min-height: 34px; padding: 4px 14px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li, .chip { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--raised-2); color: var(--soft); }
.chip.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.badge.vis-private { color: var(--muted); }
.badge.vis-community, .badge.vis-members { color: var(--accent); }
.badge.vis-public { color: var(--soft); }
.badge.draft { color: var(--ink); border-style: dashed; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; color: var(--muted); }
.lock { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 14px; }
.empty { color: var(--muted); padding-block: 24px; }

/* ---------- home ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-end; padding-block: 72px 56px; }
.hero .copy { flex: 999 1 560px; min-width: 0; }
.kicker { font-size: 15px; letter-spacing: 2px; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(52px, 9vw, 112px); line-height: 0.95; }
.hero .lede { margin-top: 28px; max-width: 560px; font-size: 20px; color: var(--soft); font-weight: 300; }
.hero .actions { margin-top: 32px; }
.hero aside { flex: 1 1 220px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.hero aside .label { font-size: 13px; letter-spacing: 2px; color: var(--muted); }
.hero aside a { text-decoration: none; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 24px; }
.section-head h2 { font-family: var(--display); font-weight: 400; font-size: 36px; }
.section-head span { color: var(--muted); font-size: 15px; }
.block { padding-block: 24px 56px; }

.wings { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.wing-tile {
  display: flex; flex-direction: column; gap: 10px; min-height: 220px; padding: 26px;
  border-radius: var(--radius); background: var(--accent); color: var(--on-accent); text-decoration: none;
  transition: transform 0.15s ease;
}
.wing-tile:hover { transform: translateY(-3px); }
.wing-tile .name { font-family: var(--display); font-size: 34px; line-height: 1; }
.wing-tile .what { font-size: 15px; line-height: 1.5; }
.wing-tile .who { margin-top: auto; font-size: 13px; font-weight: 700; }
.wing-tile svg { width: 34px; height: 34px; stroke: currentColor; }
@media (prefers-reduced-motion: reduce) { .wing-tile { transition: none; } .wing-tile:hover { transform: none; } }

.feed { display: flex; flex-direction: column; }
.feed a { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); text-decoration: none; }
.feed a:last-child { border-bottom: 1px solid var(--line); }
.feed .w { font-size: 13px; font-weight: 700; color: var(--accent); width: 110px; }
.feed .t { flex: 1 1 280px; font-size: 20px; }
.feed .d { font-size: 14px; color: var(--muted); }
.split { display: flex; flex-wrap: wrap; gap: 40px; }
.split > .main { flex: 999 1 560px; min-width: 0; }
.split > .side { flex: 1 1 300px; align-self: flex-start; }
.panel { padding: 28px; border-radius: var(--radius); background: var(--raised); display: flex; flex-direction: column; gap: 14px; }
.panel h2, .panel h3 { font-family: var(--display); font-weight: 400; font-size: 26px; }
.panel p { color: var(--soft); }
.panel.tinted { background: var(--tint, var(--raised)); }

/* ---------- wing and space pages ---------- */
.band { background: var(--accent); color: var(--on-accent); }
.band .wrap { padding-block: 56px 0; }
.band h1 { font-family: var(--display); font-weight: 400; font-size: clamp(52px, 8vw, 96px); line-height: 1; }
.band .lede { margin-top: 12px; max-width: 640px; font-size: 19px; }
.band .crumbs { font-size: 15px; margin-bottom: 10px; }
.band .crumbs a { color: inherit; }
.band nav { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 36px; }
.band nav a { padding: 12px 20px; color: inherit; text-decoration: none; border-radius: 14px 14px 0 0; }
.band nav a[aria-current='page'] { background: var(--ground); color: var(--ink); font-weight: 700; }
.band .spacer { height: 40px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 18px; background: var(--raised); text-decoration: none; min-height: 120px; }
.card:hover { background: var(--raised-2); }
.card .title { font-family: var(--display); font-size: 24px; line-height: 1.15; }
.card p { color: var(--soft); font-size: 15px; }
.card .meta { margin-top: auto; }
.card .card-cover { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; margin-bottom: 6px; }
.card img { border-radius: 12px; aspect-ratio: 16 / 9; object-fit: cover; }
.card.book { background: var(--accent); color: var(--on-accent); min-height: 260px; border-radius: 10px 22px 22px 10px; }
.card.book p, .card.book .meta { color: inherit; opacity: 0.85; }

.cover { flex: 0 1 280px; aspect-ratio: 2 / 3; border-radius: 10px 22px 22px 10px; background: var(--accent); color: var(--on-accent); padding: 30px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.cover .t { font-family: var(--display); font-size: 38px; line-height: 1.05; }
.cover img { width: 100%; height: 100%; object-fit: cover; margin: -30px; width: calc(100% + 60px); height: calc(100% + 60px); max-width: none; }
.book-head { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; padding-block: 40px; }
.book-head .copy { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.book-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 7vw, 80px); line-height: 1; }
.book-head .lede { font-size: 19px; color: var(--soft); max-width: 600px; }
.steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 4px; color: var(--soft); }

.toc { list-style: none; padding: 0; margin: 0; }
.toc li { border-top: 1px solid var(--line); }
.toc li:last-child { border-bottom: 1px solid var(--line); }
.toc a, .toc .locked { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; text-decoration: none; }
.toc .locked { color: var(--muted); }
.toc .n { color: var(--muted); font-size: 14px; }

.community-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 22px 26px; border-radius: 18px; background: var(--tint, var(--raised)); }
.community-box p { flex: 1 1 260px; color: var(--soft); }
.community-box strong { color: var(--ink); }
.community-list { list-style: none; margin: 0; padding: 0; flex: 1 1 100%; display: grid; gap: 8px; }
.community-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.community-list a:not(.btn) { color: var(--ink); font-weight: 500; }
.community-box .state, .community-card .state { color: var(--soft); font-size: 0.9em; }
.community-card .title { color: var(--ink); text-decoration: none; }

/* ---------- reading ---------- */
.article { max-width: 780px; padding-block: 48px; }
.article > header { display: grid; gap: 14px; margin-bottom: 36px; }
.article .kind { font-size: 14px; font-weight: 700; color: var(--accent); }
.article h1 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 6vw, 64px); line-height: 1.05; }
.article .lede { color: var(--soft); font-size: 20px; }
.paper { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius); padding: clamp(24px, 5vw, 56px); }
.prose { font-size: 1.1rem; line-height: 1.85; overflow-wrap: anywhere; }
.paper.prose, .prose.read { font-family: var(--read); font-size: 1.25rem; }
.prose > * + * { margin-top: 1em; }
/* A chapter imported from Word (public/docx.js): its own spacing, sizes and pictures. */
.prose.rich { line-height: var(--dx-line, 1.85); }
.prose.rich > * + * { margin-top: var(--dx-gap, 1em); }
.prose.rich > .dx-gap { min-height: 1lh; }
.prose.rich img { max-width: 100%; height: auto; vertical-align: middle; }
.prose.rich .dx-figure { text-align: center; }
/* A group drawn in Word: pieces placed by percent, text scaled with the box. */
.prose.rich .dx-group { position: relative; display: block; max-width: 100%; margin-inline: auto; container-type: inline-size; text-align: start; line-height: 1.3; }
.prose.rich .dx-group .dx-at { position: absolute; margin: 0; overflow: visible; font-size: calc(100cqw / var(--dx-w) * var(--dx-fs)); }
.prose.rich .dx-group .dx-at > * { margin: 0; }
.prose.rich .dx-group .dx-at > .dx-gap { min-height: 0; }
.prose.rich img.dx-fill { display: block; width: 100%; height: 100%; max-width: none; border-radius: 0; }
.prose.rich .dx-crop { position: relative; display: inline-block; max-width: 100%; overflow: hidden; vertical-align: middle; }
.prose.rich .dx-group .dx-at:has(> .dx-cropped) { overflow: hidden; }
.prose.rich img.dx-cropped { position: absolute; max-width: none; border-radius: 0; }
.prose.rich .dx-float-left { float: left; margin: 0.3em 0 0.6em 1em; max-width: 50%; }
.prose.rich .dx-float-right { float: right; margin: 0.3em 1em 0.6em 0; max-width: 50%; }
.prose.rich .dx-tab { display: inline-block; min-width: 2em; }
.prose.rich .dx-num { display: inline-block; min-width: 1.6em; }
.prose.rich .dx-box { border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: 6px; padding: 0.6em 1em; }
.prose.rich .dx-table { border-collapse: collapse; margin-inline: auto; }
.prose.rich .dx-table td { border: 1px solid color-mix(in srgb, currentColor 25%, transparent); padding: 0.3em 0.6em; vertical-align: top; }
.prose.rich sup.dx-note a { text-decoration: none; padding-inline: 0.1em; }
.prose.rich .dx-notes-rule { border: 0; border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent); margin-top: 2.5em; width: 30%; }
.prose.rich .dx-notes-title { font-size: 1.1em; margin-top: 0.8em; }
.prose.rich .dx-note-text, .prose.rich .dx-notes-title ~ p { font-size: 0.85em; }
.prose.rich::after { content: ''; display: block; clear: both; }
@media (max-width: 520px) {
  .prose.rich .dx-float-left, .prose.rich .dx-float-right { float: none; display: block; margin: 0.4em auto; max-width: 70%; }
}
.prose h2, .prose h3, .prose h4 { font-family: var(--display); font-weight: 400; line-height: 1.25; margin-top: 1.6em; }
.prose h2 { font-size: 30px; }
.prose h3 { font-size: 24px; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose blockquote { margin-inline: 0; padding-inline-start: 1.1em; border-inline-start: 3px solid var(--accent); opacity: 0.85; }
.prose code { font-family: var(--mono); font-size: 0.85em; background: rgb(127 127 127 / 0.15); border-radius: 4px; padding: 0.05em 0.35em; }
.prose pre { background: #0e0d0b; color: var(--ink); border-radius: 14px; padding: 1rem; overflow-x: auto; direction: ltr; text-align: left; }
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: 14px; margin-inline: auto; }
.prose a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.prose hr { border: 0; border-top: 1px solid rgb(127 127 127 / 0.3); margin-block: 2em; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid rgb(127 127 127 / 0.3); padding: 0.4rem 0.7rem; text-align: start; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; }
.pager a { text-decoration: none; color: var(--soft); }
.back { margin-top: 40px; font-size: 15px; }
.back a { color: var(--soft); }
.hero-img { border-radius: var(--radius); margin-bottom: 32px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.links a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); text-decoration: none; font-size: 15px; }

/* ---------- songs ---------- */
.versions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.versions button { font: inherit; font-size: 15px; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; }
.versions button[aria-selected='true'] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.version[hidden] { display: none; }
.sheet { background: var(--paper); color: var(--paper-ink); border-radius: 18px; padding: clamp(20px, 4vw, 36px); }
.sheet .tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; color: #6b5a3a; margin-bottom: 20px; }
.sheet .tools button { font: inherit; min-width: 44px; min-height: 36px; border-radius: 999px; border: 1px solid #cdbf9f; background: transparent; color: var(--paper-ink); cursor: pointer; }
.chords { font-size: 19px; line-height: 1.35; }
.chords .line { white-space: pre-wrap; min-height: 1.35em; }
.chords .line.chordline { font-family: var(--mono); font-size: 15px; color: #a85a06; white-space: pre; overflow-x: auto; }
.chords .ch { unicode-bidi: isolate; direction: ltr; }
.chords .seg { display: inline-flex; flex-direction: column; vertical-align: bottom; }
.chords .seg .ch { font-family: var(--mono); font-size: 15px; color: #a85a06; min-height: 1.3em; padding-inline-end: 6px; }
.chords[dir="rtl"] .seg .ch { text-align: right; padding-inline: 6px 0; }
.chords .gap { height: 0.9em; }
/* Section names ({c: פזמון}) are a quiet label with a hairline; the chorus sits on a faint warm wash. */
.chords .part { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: #8a6a3a; margin: 18px 0 6px; }
.chords .part::after { content: ''; flex: 1; height: 1px; background: #e3d7bf; }
.chords > .part:first-child { margin-top: 0; }
.chords .chorus { background: #efe5d2; border-radius: 12px; padding: 10px 14px; margin-block: 6px 10px; }
.chords .chorus .part { margin-top: 4px; }
.chords.plain .ch, .chords.plain .chordline { display: none; }
.media { border-radius: 18px; overflow: hidden; background: #000; }
.media iframe, .media video { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.media.audio { background: var(--raised); padding: 12px; border: 1px solid var(--line); }
.media.audio audio { display: block; width: 100%; height: 48px; color-scheme: dark; }
.media video { max-height: 80vh; background: #000; }
.media.audio.framed { padding: 0; }
.media.audio iframe { aspect-ratio: auto; height: 84px; }
.media.doc iframe { aspect-ratio: 4 / 3; }
.media-note { font-size: 14px; color: var(--muted); margin-top: 8px; }
.media-open { margin-top: 8px; font-size: 14px; }
.media-open a { color: var(--muted); text-decoration: none; }
.media-open a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- comments ---------- */
.comments { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); display: grid; gap: 20px; }
.comments h2 { font-family: var(--display); font-weight: 400; font-size: 30px; }
.comments h2 small { font-family: var(--text); font-size: 16px; color: var(--muted); }
.comments.closed { color: var(--soft); gap: 12px; justify-items: start; }
.comment-list, .replies { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.replies { margin-top: 12px; padding-inline-start: 18px; border-inline-start: 2px solid var(--line); }
.comment { background: var(--raised); border-radius: 16px; padding: 14px 16px; display: grid; gap: 8px; }
.replies .comment { background: var(--raised-2); }
.comment.by-owner { box-shadow: inset 3px 0 var(--accent); }
.comment.resolved > p, .comment.resolved > .quote { opacity: 0.6; }
.comment:target { outline: 2px solid var(--accent); }
.comment p { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .quote { font-family: var(--read); font-size: 15px; color: var(--muted); text-decoration: none; padding-inline-start: 10px; border-inline-start: 3px solid var(--accent); }
.comment .actions, .comment-form .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
button.link { font: inherit; font-size: 14px; background: none; border: 0; padding: 4px 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }
button.link:hover { color: var(--ink); }
.comment-form { display: grid; gap: 10px; }
.comment-form textarea { width: 100%; resize: vertical; line-height: 1.6; }
.comment-form .target { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 14px; color: var(--soft); background: var(--raised); padding: 8px 12px; border-radius: 12px; overflow-wrap: anywhere; }
.anchored { position: relative; }
.anchored:target { background: rgb(233 162 59 / 0.14); border-radius: 6px; }
.anchored.has-notes { border-inline-start: 3px solid var(--accent); padding-inline-start: 10px; }
mark.noted { background: rgb(233 162 59 / 0.22); color: inherit; border-bottom: 2px solid rgb(233 162 59 / 0.7); border-radius: 2px; cursor: pointer; }
mark.noted:hover { background: rgb(233 162 59 / 0.36); }
.ask-note {
  position: absolute; z-index: 30; padding: 8px 16px; min-height: 40px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font: 700 15px/1 var(--text); cursor: pointer;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.35);
}

/* ---------- forms (join, sign-in) ---------- */
.member-form { display: grid; gap: 16px; max-width: 460px; padding-block: 48px; }
.member-form h1 { font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1.05; }
.member-form .lede { color: var(--soft); }
.field { display: grid; gap: 6px; font-size: 15px; font-weight: 500; }
.field small { color: var(--muted); font-weight: 400; }
.field input, .field textarea, .field select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--raised);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 14px;
}
.msg { min-height: 1.5em; font-size: 15px; color: var(--soft); }
.msg.err { color: #ff9b85; }
.msg.ok { color: #8fd6b4; }
.hint { font-size: 14px; color: var(--muted); }
.hp { position: absolute; inset-inline-start: -9999px; }
#account-fields { display: grid; gap: 16px; }
.comm-choose { border: 0; padding: 0; margin: 0; min-width: 0; }
.comm-choose legend { padding: 0; margin-bottom: 8px; }
.choices { display: grid; gap: 8px; }
.choice {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: start; cursor: pointer;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px;
}
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); grid-row: span 2; }
.choice span { font-weight: 500; }
.choice small { grid-column: 2; }
.choice:has(input:checked) { border-color: var(--accent); }
.choice:has(input:disabled) { cursor: default; opacity: 0.7; }

@media (max-width: 720px) {
  .bar { position: static; }
  .bar .wrap { justify-content: space-between; }
  .bar nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .bar nav a { white-space: nowrap; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .hero { padding-block: 40px 32px; }
  .band .wrap { padding-block: 40px 0; }
}

/* project files under an item (Cubase projects, zips) */
.file-list { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.file-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.file-list a { font-weight: 500; text-decoration-color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
.file-list .how, .file-list .type { font-size: 14px; color: var(--muted); }

/* ---------- tags, credits and the community blog ---------- */
.mention { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--tint, var(--raised-2)); color: var(--ink); font-weight: 500; font-size: 0.92em; line-height: 1.6; unicode-bidi: isolate; }
.mention-pick { list-style: none; margin: 4px 0 0; padding: 6px; border-radius: 14px; background: var(--raised-2); border: 1px solid var(--line-strong); display: grid; gap: 2px; max-width: 320px; font-weight: 400; }
.mention-pick li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.mention-pick li small { color: var(--muted); direction: ltr; }
.mention-pick li[aria-selected='true'], .mention-pick li:hover { background: var(--accent); color: var(--on-accent); }
.mention-pick li[aria-selected='true'] small, .mention-pick li:hover small { color: inherit; }
.credits { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; color: var(--soft); }
.tagged { list-style: none; margin: 0; padding: 0; }
.tagged li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--soft); }
.tagged li:last-child { border-bottom: 1px solid var(--line); }
.tagged a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
.tagged time, .tagged .role { margin-inline-start: auto; font-size: 14px; color: var(--muted); }
.blog-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; color: var(--muted); }
.blog-links a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.post-form { display: grid; gap: 14px; }
.post-form textarea { width: 100%; resize: vertical; line-height: 1.6; }
.post-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.post-edit { padding: 22px; border-radius: 18px; background: var(--raised); }

/* English titles on a Hebrew page still line up on the right. */
[dir='rtl'] :is(h1, h2, h3, h4, .title, .who)[dir='auto'] { text-align: right; }

/* ---------- the community chat (src/chat.js, public/chat.js) ---------- */
.chat-door { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: 18px; background: var(--raised); border: 1px solid var(--line); text-decoration: none; }
.chat-door:hover { border-color: var(--accent); }
.chat-door .chat-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.chat-door .chat-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-door .chat-title { font-family: var(--display); font-size: 22px; line-height: 1.2; }
.chat-door .chat-last { color: var(--soft); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-door time { flex: none; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .chat-door { gap: 12px; padding: 14px 16px; } .chat-door .chat-title { font-size: 19px; } .chat-door time { align-self: flex-start; font-size: 12px; } }

/* The page is the chat: header, pinned strip, messages, the box to write in. */
body[data-page='chat'] { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body[data-page='chat'] main { display: flex; flex-direction: column; min-height: 0; }
body[data-page='chat'] .site-foot { display: none; }
@media (max-width: 720px) { body[data-page='chat'] .bar nav { display: none; } body[data-page='chat'] .bar .wrap { padding-block: 10px; } }
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat .wrap { max-width: 860px; }
.chat-head { border-bottom: 1px solid var(--line); background: var(--raised); }
.chat-head .wrap { display: flex; align-items: center; gap: 14px; padding-block: 10px; }
.chat-back { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; text-decoration: none; font-size: 22px; color: var(--soft); }
.chat-back:hover { background: var(--raised-2); color: var(--ink); }
.chat-name { min-width: 0; }
.chat-name h1 { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status { font-size: 13px; color: var(--muted); min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status.typing { color: var(--accent); }

.chat-pins { border-bottom: 1px solid var(--line); background: var(--ground); }
.chat-pins details { padding-block: 8px; }
.chat-pins summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; font-size: 14px; font-weight: 700; color: var(--accent); list-style: none; }
.chat-pins summary::-webkit-details-marker { display: none; }
.chat-pins summary::before { content: '📌'; font-weight: 400; }
.chat-pins .peek { flex: 1; min-width: 0; font-weight: 400; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pins details[open] .peek { display: none; }
.chat-pins ol { list-style: none; padding: 8px 0 4px; margin: 0; display: grid; gap: 6px; max-height: 40vh; overflow-y: auto; }
.chat-pins a { display: flex; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--raised); text-decoration: none; font-size: 15px; }
.chat-pins a b { flex: none; color: var(--accent); }
.chat-pins a span { white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 40%), var(--ground); }
.chat-more { text-align: center; padding-top: 14px; }
.chat-empty { text-align: center; color: var(--muted); padding: 48px 0; }
.chat-log { list-style: none; margin: 0; padding: 12px 0 16px; display: flex; flex-direction: column; gap: 4px; }
.chat-day { align-self: center; margin: 14px 0 6px; font-size: 12px; font-weight: 700; color: var(--soft); background: var(--raised-2); padding: 3px 12px; border-radius: 999px; }
.chat-msg { --who: 30; position: relative; display: flex; align-items: center; gap: 4px; max-width: min(84%, 560px); align-self: flex-start; }
.chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg .bubble { min-width: 0; padding: 7px 12px 5px; border-radius: 16px 16px 16px 4px; background: var(--raised); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.chat-msg.mine .bubble { border-radius: 16px 16px 4px 16px; background: color-mix(in srgb, var(--accent) 20%, var(--raised)); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.chat-msg .who { font-size: 13px; font-weight: 700; color: hsl(var(--who) 70% 70%); }
.chat-msg .text { font-size: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg .text a { color: var(--accent); }
.chat-msg.deleted .text { color: var(--muted); font-style: italic; font-size: 14px; }
.chat-msg .quote { display: flex; flex-direction: column; padding: 4px 10px; border-radius: 8px; border-inline-start: 3px solid var(--accent); background: rgb(0 0 0 / 0.22); text-decoration: none; font-size: 13px; }
.chat-msg .quote b { color: var(--accent); }
.chat-msg .quote span { color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-msg .chat-post { align-self: flex-start; font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; padding: 2px 10px; border: 1px solid currentColor; border-radius: 999px; }
.chat-msg .meta { align-self: flex-end; gap: 6px; font-size: 11px; line-height: 1.4; }
.chat-msg .pin-mark { color: var(--accent); font-weight: 700; }
.chat-msg.is-pinned .bubble { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.chat-msg.flash .bubble { animation: chat-flash 1.4s var(--ease-out, ease-out); }
@keyframes chat-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.chat-menu-btn { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; opacity: 0.6; }
.chat-menu-btn:hover, .chat-menu-btn:focus-visible { opacity: 1; background: var(--raised-2); color: var(--ink); }
@media (hover: hover) { .chat-msg:not(:hover) .chat-menu-btn:not(:focus-visible) { opacity: 0; } }
.chat-menu { position: absolute; top: 100%; inset-inline-start: 0; z-index: 5; min-width: 210px; display: flex; flex-direction: column; padding: 6px; border-radius: 14px; background: var(--raised-2); border: 1px solid var(--line-strong); box-shadow: 0 12px 32px rgb(0 0 0 / 0.5); }
.chat-msg.mine .chat-menu { inset-inline-start: auto; inset-inline-end: 0; }
.chat-menu.up { top: auto; bottom: 100%; }
.chat-menu button { text-align: start; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.chat-menu button:hover, .chat-menu button:focus-visible { background: var(--raised); }
.chat-menu button.danger { color: #f08a7a; }

.chat-compose { border-top: 1px solid var(--line); background: var(--raised); padding-bottom: env(safe-area-inset-bottom); }
.chat-compose .wrap { padding-block: 8px; }
.chat-replying { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 6px 12px; border-radius: 10px; border-inline-start: 3px solid var(--accent); background: var(--ground); font-size: 14px; color: var(--soft); }
.chat-replying span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-replying .link { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 8px; }
.chat-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-row textarea { flex: 1; min-width: 0; resize: none; max-height: 160px; padding: 10px 16px; border-radius: 22px; border: 1px solid var(--line-strong); background: var(--ground); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.4; }
.chat-row textarea:focus { outline: none; border-color: var(--accent); }
.chat-send { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); cursor: pointer; transform: scaleX(-1); }
.chat-send:active { transform: scaleX(-1) scale(0.92); }
.chat-compose .msg { font-size: 13px; color: var(--accent); min-height: 0; }
.chat-compose .msg:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .chat-msg.flash .bubble { animation: none; } }
/* Who a message is for, who may write. */
.chat-msg .for { font-size: 12px; font-weight: 700; color: var(--accent); }
.chat-people-btn { margin-inline-start: auto; flex: none; min-height: 34px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--soft); font: inherit; font-size: 14px; cursor: pointer; }
.chat-people-btn[aria-expanded='true'] { border-color: var(--accent); color: var(--ink); }
.chat-people { border-bottom: 1px solid var(--line); background: var(--ground); max-height: 45vh; overflow-y: auto; }
.chat-people ul { list-style: none; margin: 0; padding-block: 8px; display: grid; gap: 4px; }
.chat-people li { display: flex; align-items: center; gap: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.chat-people li:last-child { border-bottom: 0; }
.chat-people .name { flex: 1; min-width: 0; }
.chat-people .name.here::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-inline-start: 8px; border-radius: 50%; background: #6fcf8a; vertical-align: middle; }
.chat-people .role { font-size: 13px; color: var(--muted); }
.chat-people select { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink); font: inherit; font-size: 14px; }
.chat-readonly { border-top: 1px solid var(--line); background: var(--raised); color: var(--muted); font-size: 15px; text-align: center; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); }
.chat-readonly .wrap { display: block; }
.chat-to { margin-bottom: 8px; padding: 10px 12px; border-radius: 12px; background: var(--ground); border: 1px solid var(--line); }
.chat-to p { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.chat-to small { font-weight: 400; color: var(--muted); }
.chat-to-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--raised-2); font-size: 14px; cursor: pointer; }
.chip-check:has(input:checked) { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.chip-check input { accent-color: var(--on-accent); margin: 0; }
.chat-to-btn { flex: none; min-height: 46px; max-width: 34%; padding: 4px 12px; border-radius: 23px; border: 1px solid var(--line-strong); background: transparent; color: var(--soft); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-to-btn.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.chat-people .chat-dm { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--soft); font: inherit; font-size: 13px; cursor: pointer; }
.chat-people .chat-dm:hover { border-color: var(--accent); color: var(--ink); }

/* On a touch screen, give the small community and chat controls a finger-sized target. */
@media (hover: none), (pointer: coarse) {
  .bar .who a { display: inline-flex; align-items: center; min-height: 40px; }
  .chat-menu-btn { width: 40px; height: 40px; }
  .chat-people-btn, .chat-people .chat-dm, .chat-people select { min-height: 40px; }
}

/* ---------- names that lead somewhere ----------
   A tagged person, a writer or a credit is a link when there is a page to go to
   (for the owner, that person's page in the studio). */
a.mention { text-decoration: none; }
a.mention:hover, a.mention:focus-visible { background: var(--accent); color: var(--on-accent); }
.comment .meta a.who { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }

/* ---------- taps and selection ----------
   Only what can be tapped reacts to a tap: no grey flash on a plain line, and
   buttons, tabs and headings never start a text selection. On touch screens
   nothing starts one except the text that is there to be read (articles,
   chapters, lyrics, comments, posts, chat messages, notes in the studio),
   because selecting words is how a comment is attached; fields stay editable. */
html { -webkit-tap-highlight-color: transparent; }
button, .btn, summary, select, label, nav, [role='tab'], .bar, .crumbs, .badge, .kicker, .count,
:where(h1, h2, h3, h4) { -webkit-user-select: none; user-select: none; }
button, .btn, summary, a, [role='tab'] { touch-action: manipulation; }
@media (hover: none), (pointer: coarse) {
  body { -webkit-user-select: none; user-select: none; }
  :is(a, button, .btn, summary, [role='tab']):active { opacity: 0.7; }
}
:is(.prose, .sheet, .comment > p, .comment .quote, .chat-msg .text, .post-card p, .note, .idea .text, .muse-text, .muse-out, pre, code),
:is(.prose, .sheet, .comment > p, .chat-msg .text, .note, .idea .text, .muse-text, .muse-out) * { -webkit-user-select: text; user-select: text; }
input, textarea, [contenteditable]:not([contenteditable='false']) { -webkit-user-select: text; user-select: text; }
.chat-msg a.who { display: block; text-decoration: none; }
.chat-people a.name { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--line-strong); }

/* ---------- a community's page (src/blog.js) ----------
   The band carries who is in, what is here and the owner's tools; below it
   the blog, with the chat and what is opened to the community on the side
   (on top, on a phone). */
.band.comm-band .wrap { padding-bottom: 26px; }
.comm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 28px; padding-top: 18px; border-top: 1px solid rgb(0 0 0 / 0.18); }
.comm-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 15px; font-weight: 700; }
.comm-facts .tag { font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1.5px dashed currentColor; }
.comm-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.comm-band .btn { color: inherit; border-color: rgb(0 0 0 / 0.35); background: rgb(255 255 255 / 0.14); font-weight: 700; }
.comm-band .btn:hover, .comm-band .btn.ask { background: var(--on-accent); color: var(--accent); border-color: var(--on-accent); }

.comm { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 32px; }
.comm-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
@media (min-width: 960px) {
  .comm { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: 'blog side'; gap: 48px; align-items: start; padding-top: 44px; }
  .comm-blog { grid-area: blog; }
  .comm-side { grid-area: side; position: sticky; top: 96px; }
  .comm-side .chat-door { align-items: flex-start; }
  .comm-side .chat-door .chat-title { font-size: 20px; }
  .comm-side .chat-door time { display: none; }
}
.side-box { padding: 18px 22px 8px; border-radius: 18px; border: 1px solid var(--line); }
.side-box h2 { font-family: var(--display); font-weight: 400; font-size: 20px; margin-bottom: 6px; }
.side-box .feed a { padding: 12px 0; gap: 2px 12px; }
.side-box .feed a:last-child { border-bottom: 0; }
.side-box .feed .w { width: auto; font-size: 12px; }
.side-box .feed .t { flex: 1 1 100%; font-size: 16px; }

.blog-head { position: relative; min-height: 48px; margin-bottom: 22px; }
.blog-head h2 { font-family: var(--display); font-weight: 400; font-size: 36px; line-height: 1.1; }
.post-new summary { position: absolute; top: 2px; inset-inline-end: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 18px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 700; cursor: pointer; list-style: none; transition: transform 0.2s, background-color 0.2s; }
.post-new summary::-webkit-details-marker { display: none; }
.post-new summary::before { content: '+'; font-size: 20px; line-height: 1; }
.post-new summary:hover { transform: translateY(-1px); }
.post-new .close-it, .post-new[open] .open-it { display: none; }
.post-new[open] .close-it { display: inline; }
.post-new[open] summary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.post-new[open] summary::before { content: '×'; }
.post-new[open] .post-form { margin-top: 22px; padding: 22px; border-radius: 18px; background: var(--raised); border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); }

.post-card { position: relative; display: grid; gap: 10px; padding: 22px 24px; border-radius: 18px; background: var(--raised); border: 1px solid var(--line); transition: border-color 0.2s, transform 0.25s; }
.post-card:hover { border-color: var(--line-strong); }
.post-card .title { font-family: var(--display); font-size: 24px; line-height: 1.2; text-decoration: none; overflow-wrap: anywhere; }
/* The whole card opens the post; the writer's name stays its own link. */
.post-card .title::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.post-card:hover .title { color: var(--accent); }
.post-card p { color: var(--soft); font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .meta { position: relative; z-index: 1; width: fit-content; }
.post-card .talk { color: var(--soft); }
.post-card.pinned { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--raised)), var(--raised) 55%); }
.post-card.is-hidden { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.post-card.is-hidden :is(.title, p) { opacity: 0.7; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--raised-2); color: var(--soft); }
.flag.pin { background: var(--accent); color: var(--on-accent); }
.flag.open { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.flag.hid { background: transparent; border: 1px dashed var(--line-strong); }

@media (max-width: 560px) {
  .comm-bar { margin-top: 22px; }
  .comm-tools { width: 100%; }
  .comm-tools .btn { flex: 1; justify-content: center; }
  .blog-head h2 { font-size: 30px; }
  .post-card { padding: 18px; }
  .post-card .title { font-size: 21px; }
}

/* ---------- notifications and the site as an app (src/notify-page.js, public/app.js) ---------- */
.bar .bell { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--soft); }
.bar .bell:hover, .bar .bell[aria-current] { color: var(--accent); background: var(--raised); }
.notify-box { padding: 20px 22px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--raised); }
.notify-box h2 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 0 0 8px; }
.notify-box .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.notify-kinds { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.notify-kinds label { display: flex; gap: 12px; align-items: center; min-height: 44px; cursor: pointer; }
.notify-kinds input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.steps { margin: 6px 0 0; padding-inline-start: 22px; display: grid; gap: 6px; }
.share-icon { display: inline-block; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 13px; }
.notify-nudge {
  position: fixed; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50;
  max-width: 460px; margin-inline: auto; padding: 14px 16px; border-radius: 16px;
  background: var(--raised-2); border: 1px solid var(--line-strong); box-shadow: 0 12px 40px rgb(0 0 0 / 0.45);
  animation: nudge-in 0.25s ease-out;
}
.notify-nudge p { margin: 0 0 10px; font-size: 15px; line-height: 1.5; }
.notify-nudge .row { display: flex; gap: 14px; align-items: center; }
.notify-nudge .link { background: none; border: 0; color: var(--soft); font: inherit; font-size: 14px; cursor: pointer; padding: 8px 4px; }
@keyframes nudge-in { from { transform: translateY(16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .notify-nudge { animation: none; } }
/* Opened from the home screen: keep the header clear of the phone's status bar. */
@media (display-mode: standalone) { .bar { padding-top: env(safe-area-inset-top); } }

/* ---------- stars, halls of fame and pages shared into a chat (src/chat.js) ---------- */
.chat-stars-btn { margin-inline-start: auto; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; }
.chat-stars-btn.on { color: var(--accent); }
.chat-stars-btn[aria-expanded='true'] { border-color: var(--accent); color: var(--accent); background: var(--ground); }
.chat-stars-btn + .chat-people-btn { margin-inline-start: 0; }
.chat-stars { border-bottom: 1px solid var(--line); background: var(--ground); max-height: 50vh; overflow-y: auto; }
.chat-stars .wrap { padding-block: 12px; display: grid; gap: 10px; }
.chat-stars h2 { font-size: 14px; font-weight: 700; color: var(--accent); }
.chat-stars ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chat-stars ol a { display: flex; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--raised); text-decoration: none; font-size: 15px; }
.chat-stars ol a b { flex: none; color: var(--accent); }
.chat-stars ol a span { white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chat-stars .hint { color: var(--muted); font-size: 14px; }
.stars-hall { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 4px; }
.stars-hall .chip { text-decoration: none; padding: 5px 12px; }
.stars-hall .chip:hover { color: var(--ink); }
.chat-msg .star-mark { color: var(--accent); font-size: 12px; }
.chat-msg.has-star .bubble { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.chat-msg .hall-marks { display: flex; flex-wrap: wrap; gap: 4px; }
.chat-msg .hall-mark { font-size: 12px; font-weight: 700; text-decoration: none; padding: 1px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.chat-share { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: 10px; border-inline-start: 3px solid var(--accent); background: rgb(0 0 0 / 0.22); text-decoration: none; min-width: min(220px, 100%); }
.chat-share .w { font-size: 12px; font-weight: 700; color: var(--accent); }
.chat-share .t { font-size: 15px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.chat-share:hover .t { text-decoration: underline; text-decoration-color: var(--accent); }
.chat-menu .menu-head { padding: 8px 12px 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.chat-menu button.on { color: var(--accent); font-weight: 700; }

/* The community page's side column: the way into the halls, the starred messages. */
.hall-door { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 18px; border-radius: 16px; background: var(--raised); border: 1px solid var(--line); text-decoration: none; }
.hall-door:hover { border-color: var(--accent); }
.hall-door svg { flex: none; color: var(--accent); width: 26px; height: 26px; }
.hall-door span { display: flex; flex-direction: column; }
.hall-door b { font-family: var(--display); font-weight: 400; font-size: 19px; }
.hall-door small { color: var(--soft); font-size: 14px; }
.side-box.stars h2 { display: flex; align-items: center; gap: 6px; }
.side-box.stars h2 svg { color: var(--accent); }
.side-box.stars ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.side-box.stars a { display: block; padding: 8px 12px; border-radius: 10px; background: var(--ground); text-decoration: none; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.side-box.stars a b { color: var(--accent); }
.side-box.stars a:hover { background: var(--raised-2); }

/* /community/<slug>/hall */
.hall-page { display: grid; gap: 22px; max-width: 860px; }
.hall-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.hall-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.hall-nav a { padding: 6px 14px; border-radius: 999px; background: var(--raised-2); color: var(--soft); text-decoration: none; font-size: 14px; }
.hall-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 20%, var(--raised-2)); }
.hall-new { position: static; }
.hall-new[open] { flex-basis: 100%; }
.hall-new .hall-form { margin-top: 12px; }
.hall-form { display: grid; gap: 12px; padding: 18px; border-radius: 16px; background: var(--raised); border: 1px solid var(--line); }
.hall { padding: 22px 24px; border-radius: 20px; background: var(--raised); border: 1px solid var(--line); scroll-margin-top: 80px; display: grid; gap: 12px; }
.hall:target { border-color: var(--accent); }
.hall-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.hall-head h2 { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.2; }
.hall-head h2 svg { flex: none; color: var(--accent); width: 26px; height: 26px; }
.hall-head .count { font-family: var(--text); font-size: 14px; font-weight: 700; color: var(--accent); }
.hall-tools { display: flex; gap: 8px; }
.hall-about { color: var(--soft); font-size: 16px; line-height: 1.6; }
.hall-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hall-quote { padding: 14px 16px; border-radius: 14px; background: var(--ground); border-inline-start: 3px solid var(--accent); display: grid; gap: 8px; }
.hall-quote blockquote { margin: 0; display: grid; gap: 8px; }
.hall-quote blockquote p { font-family: var(--read); font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.hall-quote .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.hall-quote .meta .by { font-weight: 700; color: var(--soft); }
.hall-quote .meta a { color: var(--soft); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.hall-quote .link { border: 0; background: none; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.hall-page .msg:empty { display: none; }
.hall-page .back { color: var(--muted); }
@media (max-width: 560px) {
  .hall { padding: 18px 16px; }
  .hall-head h2 { font-size: 23px; }
  .hall-quote blockquote p { font-size: 17px; }
}

/* The header's "שיתוף" and its window (public/app.js). */
.bar .share-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--soft); font: inherit; font-size: 14px; cursor: pointer; }
.bar .share-btn:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 720px) { .bar .share-btn { padding: 0; width: 34px; justify-content: center; border-color: transparent; } .bar .share-btn span { display: none; } }
.share-dialog { width: min(30rem, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--raised); color: var(--ink); }
.share-dialog::backdrop { background: rgb(0 0 0 / 0.6); }
.share-dialog form { display: grid; gap: 14px; }
.share-dialog h2 { font-family: var(--display); font-weight: 400; font-size: 24px; }
.share-dialog fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.share-dialog legend { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.share-what { display: grid; gap: 2px; padding: 10px 14px; border-radius: 12px; border-inline-start: 3px solid var(--accent); background: var(--ground); }
.share-what b { font-weight: 500; overflow-wrap: anywhere; }
.share-what span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; text-align: end; }
.share-rooms { display: flex; flex-wrap: wrap; gap: 6px; }
.share-rooms .chip-check { min-height: 36px; }
.share-rooms .chip-check:has(input:disabled) { opacity: 0.5; cursor: default; }
.share-dialog textarea { width: 100%; resize: vertical; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--ground); color: var(--ink); font: inherit; font-size: 16px; }
.share-dialog .actions { display: flex; gap: 10px; }
.share-dialog .msg { font-size: 14px; color: var(--accent); }
.share-dialog .msg:empty { display: none; }
.share-dialog .hint { color: var(--muted); font-size: 14px; }
@media (hover: none), (pointer: coarse) { .chat-stars-btn { width: 40px; height: 40px; } .bar .share-btn { min-height: 40px; width: 40px; } }
.hall-new summary { position: static; width: fit-content; }
