/* ElishAI · SHARE. The SHARE design system (share-design-system skill, "per the official SHARE Brand Guide", Apr 2026):
   pure black canvas, Cormorant + Inter, bronze and cream ink, the nine brand colors as per-section accents, hairline
   cards, pill controls, soft glows kept under 15%. Tokens are copied verbatim from its references/tokens.css.
   Section accents: SHARE's teaching = dark gold (Ruach, the house bronze); primary sources = blue (Chaya, depth and
   intellect); a course = teal (Neshama); highlights (moments, numbers) = light gold. */

:root {
  --bg: #000;
  --share-purple: #8844CC; --share-pink: #EE2299; --share-orange: #E57930; --share-green: #00DD77; --share-teal: #22CCDD;
  --share-blue: #369CEF; --share-dark-gold: #887755; --share-light-gold: #FFD569; --share-light-tan: #FFFBF6;
  --share-purple-bg: rgba(136, 68, 204, 0.12); --share-teal-bg: rgba(34, 204, 221, 0.12); --share-blue-bg: rgba(54, 156, 239, 0.12);
  --share-dark-gold-bg: rgba(136, 119, 85, 0.12); --share-light-gold-bg: rgba(255, 213, 105, 0.12);
  --share-purple-dim: #8844CC44; --share-teal-dim: #22CCDD44; --share-blue-dim: #369CEF44; --share-dark-gold-dim: #88775544;
  --share-light-gold-dim: #FFD56944;
  --ink-primary: var(--share-light-tan);
  --ink-bronze: #9C8874;
  --ink-bronze-muted: #585144;
  --text-strong: rgba(255, 255, 255, 0.85);
  --text-mid: rgba(255, 255, 255, 0.65);
  --text-soft: rgba(255, 255, 255, 0.40);
  --text-faint: rgba(255, 255, 255, 0.15);
  --surface-1: rgba(255, 255, 255, 0.02);
  --surface-2: rgba(255, 255, 255, 0.04);
  --surface-3: rgba(255, 255, 255, 0.07);
  --hairline: rgba(255, 255, 255, 0.05);
  --hairline-hover: rgba(255, 255, 255, 0.12);
  --font-serif: 'Cormorant', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hebrew: 'Frank Ruhl Libre', 'Cormorant', serif;
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --accent: var(--share-dark-gold); --accent-dim: var(--share-dark-gold-dim); --accent-bg: var(--share-dark-gold-bg);
  --nav-h: 64px;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #333 #000; -webkit-text-size-adjust: 100%; }
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: #000; } ::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
body { background: var(--bg); color: var(--text-strong); font-family: var(--font-sans); font-size: 15px; line-height: 1.6;
  overflow-x: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100vh; }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--share-light-gold); outline-offset: 3px; border-radius: 6px; }

/* ---- atmosphere: two slow glows on the black, under 15% ---- */
.atmos { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.atmos-glow { position: absolute; width: 900px; height: 900px; left: 50%; top: -520px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(136, 119, 85, 0.14) 0%, transparent 65%); animation: glow 9s ease-in-out infinite; }
.atmos-glow--2 { width: 700px; height: 700px; left: 78%; top: -380px; background: radial-gradient(circle, rgba(136, 68, 204, 0.08) 0%, transparent 65%);
  animation-delay: -4s; }
@keyframes glow { 0%, 100% { opacity: .75; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.06); } }

/* ---- nav ---- */
.nav { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 0 var(--gutter); background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--hairline); }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.nav-mark { width: 28px; height: 28px; }
.nav-word { height: 17px; width: auto; opacity: .92; }
.nav-sep { width: 1px; height: 22px; background: var(--hairline-hover); margin: 0 4px; }
.nav-name { font-family: var(--font-serif); font-weight: 500; font-size: 23px; letter-spacing: -.3px; color: var(--ink-primary); }
.nav-tabs { margin-left: auto; display: flex; gap: 6px; padding: 4px; border: 1px solid var(--hairline); border-radius: 24px; background: var(--surface-1); }
.nav-tab { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; padding: 8px 16px; border-radius: 20px;
  color: var(--text-mid); border: 1px solid transparent; transition: color .3s, background .3s, border-color .3s; white-space: nowrap; }
.nav-tab:hover { color: var(--text-strong); }
.nav-tab[aria-selected="true"] { color: var(--ink-primary); background: var(--accent-bg); border-color: var(--accent-dim); }
.nav-new { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; padding: 9px 14px; border-radius: 20px;
  color: var(--text-mid); border: 1px solid var(--hairline-hover); }
.nav-new:hover { color: var(--ink-primary); border-color: var(--accent-dim); }

.app { position: relative; z-index: 1; padding-top: var(--nav-h); }
.view { min-height: calc(100vh - var(--nav-h)); }

/* ---- type roles ---- */
.overline { font-size: 11px; font-weight: 500; letter-spacing: 4px; text-transform: uppercase; color: var(--ink-bronze); }
.display { font-weight: 300; line-height: .95; text-align: center; margin: 18px 0 20px; }
.display-serif { display: block; font-family: var(--font-serif); font-weight: 300; font-size: clamp(42px, 7vw, 88px); letter-spacing: -2px; color: var(--ink-bronze); }
.display-sans { display: block; font-family: var(--font-sans); font-weight: 800; font-size: clamp(44px, 8.4vw, 104px); letter-spacing: -3px; color: var(--ink-primary); margin-top: 2px; }
.lede { font-family: var(--font-serif); font-size: clamp(19px, 2.2vw, 23px); line-height: 1.45; color: var(--text-mid); max-width: 620px; margin: 0 auto; text-align: center; }

/* ---- controls ---- */
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 9px 16px; border-radius: 20px; border: 1px solid var(--hairline-hover); color: var(--text-strong); text-decoration: none;
  transition: background .3s var(--ease-soft), border-color .3s, color .3s; white-space: nowrap; }
.pill:hover { border-color: var(--accent-dim); color: var(--ink-primary); background: var(--accent-bg); }
.pill--accent { background: var(--accent); border-color: var(--accent); color: #000; }
.pill--accent:hover { background: var(--share-light-gold); border-color: var(--share-light-gold); color: #000; }
.pill--ghost { border-color: var(--hairline); color: var(--text-mid); }
.pill svg { flex: none; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { font-size: 13px; color: var(--text-mid); padding: 8px 14px; border-radius: 20px; border: 1px solid var(--hairline); background: var(--surface-1);
  transition: border-color .3s, color .3s, background .3s; }
.chip:hover { color: var(--ink-primary); border-color: var(--accent-dim); background: var(--accent-bg); }
.linkish { color: var(--ink-bronze); text-decoration: underline; text-decoration-color: var(--ink-bronze-muted); text-underline-offset: 3px; }
.linkish:hover { color: var(--share-light-gold); }
.internal { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-soft); border: 1px solid var(--hairline-hover); border-radius: 10px; padding: 1px 6px 1px 4px; margin-left: 2px; }
.internal i { font-style: normal; width: 12px; height: 12px; border-radius: 50%; border: 1px solid currentColor; display: inline-grid; place-items: center;
  font-size: 8px; font-family: Georgia, serif; font-weight: 700; letter-spacing: 0; }

/* ---- the activity line (Yochai's shimmer) ---- */
.status { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; letter-spacing: .3px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--share-light-gold); box-shadow: 0 0 12px var(--share-light-gold); animation: pulse 1.6s ease-in-out infinite; }
.status-text { background: linear-gradient(90deg, var(--ink-bronze) 0%, var(--share-light-tan) 45%, var(--ink-bronze) 90%); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 2.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ======================================== SEARCH ======================================== */
.view-search { padding: 0 var(--gutter) 80px; }
.s-hero { text-align: center; padding-top: clamp(48px, 11vh, 128px); }
.searchbar { position: relative; display: flex; align-items: center; gap: 10px; max-width: 720px; margin: 36px auto 18px; padding: 8px 8px 8px 50px;
  border-radius: 40px; border: 1px solid var(--hairline-hover); background: rgba(255, 255, 255, .035); transition: border-color .4s, box-shadow .4s; }
.searchbar:focus-within { border-color: var(--accent-dim); box-shadow: 0 0 0 6px rgba(136, 119, 85, .08), 0 20px 60px -20px rgba(136, 119, 85, .25); }
.searchbar-icon { position: absolute; left: 20px; color: var(--ink-bronze); }
.searchbar-input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; font-size: 17px; color: var(--ink-primary); padding: 10px 0; }
.searchbar-input::placeholder { color: var(--text-soft); }
.searchbar-input::-webkit-search-cancel-button { filter: invert(.6); }
.searchbar .pill--accent { padding: 12px 22px; }
.view-search.has-results .s-hero { display: none; }
.view-search.has-results .searchbar { margin-top: 28px; max-width: 1200px; }
.view-search.has-results #sChips { display: none; }
.s-status { margin: 28px 0 0; }

.s-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; max-width: 1200px; margin: 28px auto 0; align-items: start; }
.s-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 4px 2px 18px; border-bottom: 1px solid var(--hairline); margin-bottom: 18px; flex-wrap: wrap; }
.s-head h2 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.5px; color: var(--ink-primary); line-height: 1.1; }
.s-head h2 em { font-style: italic; color: var(--ink-bronze); }
.s-head p { font-size: 12px; color: var(--text-soft); letter-spacing: .3px; }
.results { list-style: none; display: grid; gap: 16px; counter-reset: r; }
.s-aside { display: grid; gap: 16px; position: sticky; top: calc(var(--nav-h) + 20px); }

/* ---- a SHARE piece (search result and chat card share it) ---- */
.piece { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr); border: 1px solid var(--hairline); border-radius: 12px;
  background: var(--surface-1); overflow: hidden; transition: border-color .4s, background .4s, transform .5s var(--ease-soft); animation: rise .6s var(--ease-soft) both; }
.piece:hover { border-color: var(--hairline-hover); background: var(--surface-2); }
.piece.is-lit { border-color: var(--accent-dim); box-shadow: 0 0 0 1px var(--accent-dim), 0 0 40px -10px rgba(255, 213, 105, .18); }
.piece--text { grid-template-columns: minmax(0, 1fr); }
.piece--playing { grid-template-columns: minmax(0, 1fr); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.piece-media { position: relative; background: #0b0a08; aspect-ratio: 16 / 9; align-self: start; margin: 14px 0 14px 14px; border-radius: 8px; overflow: hidden; }
.piece--playing .piece-media { margin: 0; border-radius: 0; }
.piece--playing .piece-media, .piece--text .piece-media { aspect-ratio: 16 / 9; min-height: 0; }
.piece-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: opacity .5s, transform .8s var(--ease-soft); }
.piece:hover .piece-media img { opacity: .95; transform: scale(1.03); }
.piece-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, .75)); pointer-events: none; }
.piece--playing .piece-media::after { display: none; }
.play { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; }
.play-btn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 251, 246, .35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--ink-primary);
  transition: transform .4s var(--ease-soft), background .3s, border-color .3s; }
.play:hover .play-btn { transform: scale(1.08); background: rgba(136, 119, 85, .55); border-color: var(--share-light-gold); }
.moment { position: absolute; left: 12px; bottom: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600;
  letter-spacing: .6px; color: var(--share-light-gold); background: rgba(0, 0, 0, .7); border: 1px solid var(--share-light-gold-dim); border-radius: 12px; padding: 3px 9px; }
.piece-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 4; }
.piece-body { padding: 20px 22px 18px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.piece-top { display: flex; align-items: center; gap: 10px; }
.piece-n { flex: none; min-width: 22px; height: 22px; border-radius: 11px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600;
  color: var(--share-light-gold); background: var(--accent-bg); border: 1px solid var(--accent-dim); padding: 0 6px; }
.piece-kicker { font-size: 10.5px; font-weight: 500; letter-spacing: 2.5px; text-transform: uppercase; color: var(--ink-bronze); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piece-title { font-family: var(--font-serif); font-weight: 600; font-size: clamp(21px, 2.1vw, 25px); line-height: 1.12; letter-spacing: -.3px; color: var(--ink-primary); }
.piece-who { font-size: 13px; color: var(--ink-bronze); }
.piece-who b { font-weight: 500; color: var(--text-strong); }
.piece-why { font-size: 15px; line-height: 1.55; color: var(--text-strong); }
.piece-words { font-family: var(--font-serif); font-style: italic; font-size: 17.5px; line-height: 1.45; color: var(--text-mid); border-left: 1px solid var(--accent-dim);
  padding-left: 14px; margin: 4px 0 2px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.piece-words[dir="rtl"] { border-left: 0; border-right: 1px solid var(--accent-dim); padding: 0 14px 0 0; font-family: var(--font-hebrew); font-style: normal; }
.piece-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.piece-actions .pill { padding: 7px 12px; font-size: 10.5px; }
.piece-actions .pill--watch { color: var(--share-light-gold); border-color: var(--share-light-gold-dim); }
.piece-actions .pill--watch:hover { background: var(--share-light-gold-bg); color: var(--share-light-gold); }

/* ---- side panels: a course (teal), primary sources (blue), related (bronze) ---- */
.panel { border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface-1); padding: 22px 22px 20px; position: relative; overflow: hidden; animation: rise .7s var(--ease-soft) both; }
.panel::before { content: ""; position: absolute; width: 360px; height: 220px; right: -140px; top: -120px; border-radius: 50%;
  background: radial-gradient(ellipse, var(--accent-bg), transparent 70%); pointer-events: none; }
.panel--course { --accent: var(--share-teal); --accent-dim: var(--share-teal-dim); --accent-bg: var(--share-teal-bg); }
.panel--primary { --accent: var(--share-blue); --accent-dim: var(--share-blue-dim); --accent-bg: var(--share-blue-bg); }
.panel-over { font-size: 10.5px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); }
.panel-title { font-family: var(--font-serif); font-weight: 500; font-size: 24px; line-height: 1.15; color: var(--ink-primary); margin: 8px 0 4px; letter-spacing: -.3px; }
.panel-sub { font-size: 12.5px; color: var(--text-soft); }
.steps { list-style: none; margin-top: 16px; display: grid; gap: 2px; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.step:first-child { border-top: 0; }
.step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--text-mid); border: 1px solid var(--hairline-hover); }
.step.is-first .step-n { color: #000; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 16px var(--accent-dim); }
.step-name { font-size: 14px; line-height: 1.35; color: var(--text-strong); }
.step-src { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.step-src button { color: var(--ink-bronze); text-decoration: underline; text-decoration-color: var(--ink-bronze-muted); text-underline-offset: 2px; text-align: left; }
.step-src button:hover { color: var(--share-light-gold); }
.tag { display: inline-block; font-size: 9.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--share-light-gold);
  border: 1px solid var(--share-light-gold-dim); border-radius: 10px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }
.prim { padding: 16px 0 14px; border-top: 1px solid var(--hairline); display: grid; gap: 6px; }
.prim:first-of-type { border-top: 0; padding-top: 12px; }
.prim-top { display: flex; align-items: center; gap: 8px; }
.prim-genre { font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--text-soft); }
.prim-ref { font-family: var(--font-serif); font-weight: 600; font-size: 20px; line-height: 1.15; color: var(--ink-primary); }
.prim-he { font-family: var(--font-hebrew); font-size: 17px; line-height: 1.6; color: var(--text-strong); direction: rtl; text-align: right;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prim-en { font-size: 13.5px; line-height: 1.55; color: var(--text-mid); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.prim a { font-size: 12px; font-weight: 500; color: var(--share-blue); text-decoration: none; letter-spacing: .2px; }
.prim a:hover { text-decoration: underline; }
.cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; margin: 0 1px 0 3px; vertical-align: 2px;
  font-size: 10.5px; font-weight: 600; line-height: 1; text-decoration: none; color: var(--share-light-gold); background: var(--share-dark-gold-bg); border: 1px solid var(--share-dark-gold-dim);
  transition: background .3s, color .3s; }
.cite:hover { background: var(--share-light-gold); color: #000; }
.cite--primary { color: var(--share-blue); background: var(--share-blue-bg); border-color: var(--share-blue-dim); }
.cite--primary:hover { background: var(--share-blue); color: #000; }
.related { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.related .chip { font-size: 12.5px; padding: 6px 12px; }

/* skeletons while the library is searched */
.skel { height: 168px; border-radius: 12px; border: 1px solid var(--hairline); background: linear-gradient(90deg, var(--surface-1) 0%, var(--surface-2) 50%, var(--surface-1) 100%);
  background-size: 200% 100%; animation: shimmer 1.8s linear infinite; }

/* ======================================== CHAT ======================================== */
.view-chat { display: flex; flex-direction: column; padding: 0 var(--gutter); }
.c-empty { text-align: center; padding-top: clamp(40px, 10vh, 120px); }
.c-verse { font-family: var(--font-hebrew); font-size: 15px; color: var(--text-faint); letter-spacing: .5px; }
.display--chat { margin-top: 20px; }
body.has-thread .c-empty { display: none; }
.thread { width: 100%; max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; padding: 36px 0 0; }
body.has-thread .thread { padding-bottom: 230px; }
.dock { width: 100%; max-width: 760px; margin: 34px auto 0; display: grid; gap: 14px; }
body.has-thread .dock { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); margin: 0; padding: 40px var(--gutter) max(14px, env(safe-area-inset-bottom));
  max-width: 820px; background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, .9) 32%, #000 70%); z-index: 20; }
body.has-thread .chips--chat { display: none; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 28px; border: 1px solid var(--hairline-hover);
  background: rgba(20, 18, 15, .82); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .02) inset; transition: border-color .4s, box-shadow .4s; }
.composer:focus-within { border-color: var(--accent-dim); box-shadow: 0 0 0 6px rgba(136, 119, 85, .07), 0 24px 60px -24px rgba(0, 0, 0, .9); }
.composer-mark { width: 22px; height: 22px; margin-bottom: 9px; opacity: .9; }
.composer-input { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; font-size: 16px; line-height: 1.5; color: var(--ink-primary);
  padding: 8px 0; max-height: 180px; }
.composer-input::placeholder { color: var(--text-soft); }
.composer-send { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #000; background: var(--accent);
  transition: background .3s, transform .3s var(--ease-soft), opacity .3s; }
.composer-send:hover { background: var(--share-light-gold); transform: translateY(-1px); }
.composer-send:disabled { opacity: .35; cursor: default; transform: none; }
.keep { font-size: 11.5px; color: var(--text-soft); text-align: center; }
.meter { font-size: 11.5px; color: var(--share-light-gold); text-align: center; }
.meter:empty { display: none; }

.msg { display: flex; flex-direction: column; animation: rise .5s var(--ease-soft) both; }
.msg-user { align-items: flex-end; }
.bubble-user { max-width: min(80%, 560px); padding: 12px 16px; border-radius: 16px 16px 4px 16px; background: var(--surface-2); border: 1px solid var(--hairline);
  color: var(--ink-primary); font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; }
.bubble-user[dir="rtl"] { border-radius: 16px 16px 16px 4px; }
.msg-ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.msg-ai-head img { width: 22px; height: 22px; }
.msg-ai-head span { font-size: 10.5px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--ink-bronze); }
.answer { font-size: 16.5px; line-height: 1.78; color: var(--text-strong); }
.answer p + p, .answer ul + p, .answer p + ul { margin-top: 14px; }
.answer strong { color: var(--ink-primary); font-weight: 600; }
.answer em { font-family: var(--font-serif); font-size: 1.12em; font-style: italic; }
.answer ul { padding-left: 20px; }
.answer[dir="rtl"] { font-family: var(--font-hebrew); font-size: 18px; }
.answer .err { color: var(--text-mid); font-style: italic; }
.cursor { display: inline-block; width: 7px; height: 16px; margin-left: 3px; vertical-align: -2px; background: var(--share-light-gold); opacity: .8; animation: pulse 1s steps(2) infinite; }
.msg-status { margin: 4px 0 0; justify-content: flex-start; }
.c-status { margin-bottom: 2px; }

.cards { display: grid; gap: 14px; margin-top: 22px; }
.cards .piece { grid-template-columns: 248px minmax(0, 1fr); }
.cards .piece--text, .cards .piece--playing { grid-template-columns: minmax(0, 1fr); }
.cards .piece-title { font-size: 21px; }
.cards .piece-body { padding: 16px 18px 14px; gap: 6px; }
.verse-card { border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface-1); padding: 16px 18px; display: grid; gap: 6px; animation: rise .6s var(--ease-soft) both; }
.verse-card.is-lit { border-color: var(--share-dark-gold-dim); }
.msg-panels { display: grid; gap: 14px; margin-top: 14px; }
.deeper { margin-top: 14px; font-size: 13px; color: var(--text-soft); }
.deeper a { color: var(--ink-bronze); text-decoration: none; border-bottom: 1px solid var(--ink-bronze-muted); }
.deeper a:hover { color: var(--share-light-gold); }
.suggest { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.suggest-toggle { font-size: 12px; color: var(--text-mid); padding: 6px 14px; border-radius: 20px; border: 1px dashed var(--hairline-hover); animation: rise .6s var(--ease-soft) both; }
.suggest-toggle:hover { color: var(--ink-primary); border-color: var(--accent-dim); }
.suggest .chip { font-size: 12.5px; }

/* ---- gate ---- */
.gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.gate-card { width: 100%; max-width: 460px; border: 1px solid var(--hairline-hover); border-radius: 14px; background: #0a0907; padding: 28px; display: grid; gap: 10px; }
.gate-title { font-family: var(--font-serif); font-weight: 500; font-size: 30px; color: var(--ink-primary); line-height: 1.1; }
.gate-text { color: var(--text-mid); font-size: 14.5px; }
.gate-form { display: grid; gap: 12px; margin-top: 6px; }
.gate-input { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--hairline-hover); background: var(--surface-2); outline: 0; color: var(--ink-primary); }
.gate-input:focus { border-color: var(--accent-dim); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--text-mid); }
.consent input { margin-top: 3px; accent-color: var(--share-dark-gold); }
.gate-actions { display: flex; justify-content: flex-end; gap: 8px; }
.gate-err { font-size: 12.5px; color: var(--share-orange); min-height: 1em; }

/* ---- footer ---- */
.foot { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 28px var(--gutter) 36px; text-align: center; font-size: 11.5px; color: var(--text-soft); line-height: 1.6; }
.foot-credit { margin-top: 8px; color: var(--ink-bronze-muted); letter-spacing: .4px; }
.foot a { color: var(--ink-bronze); text-decoration: none; }
body.has-thread.view-is-chat .foot { display: none; }

/* ---- embedded on share.fund (an iframe that grows with its content) ---- */
body.embedded .atmos { display: none; }
body.embedded.has-thread .dock { position: static; transform: none; margin: 24px auto 0; padding: 0; background: none; }
body.embedded.has-thread .thread { padding-bottom: 0; }

/* ======================================== phone ======================================== */
@media (max-width: 900px) {
  .s-body { grid-template-columns: minmax(0, 1fr); }
  .s-aside { position: static; }
}
@media (max-width: 768px) {
  :root { --nav-h: 56px; --gutter: 16px; }
  .nav { gap: 10px; }
  .nav-word { height: 12px; }
  .nav-sep { margin: 0 1px; height: 16px; }
  .nav-brand { gap: 7px; }
  .nav-name { font-size: 19px; }
  .nav-tab { padding: 7px 9px; letter-spacing: .8px; font-size: 10px; }
  .nav-tabs { gap: 2px; padding: 3px; }
  .nav-new { padding: 7px 10px; letter-spacing: 1px; font-size: 10.5px; }
  .display { margin: 14px 0 16px; }
  .display-serif { letter-spacing: -1.5px; }
  .display-sans { letter-spacing: -2px; }
  .searchbar { padding: 6px 6px 6px 44px; margin-top: 26px; }
  .searchbar-icon { left: 16px; }
  .searchbar-input { font-size: 16px; }
  .searchbar .pill--accent { padding: 11px 16px; }
  .piece, .cards .piece { grid-template-columns: minmax(0, 1fr); }
  .piece-media { margin: 0; border-radius: 0; }
  .piece-body { padding: 16px 16px 14px; }
  .panel { padding: 18px 16px; }
  .answer { font-size: 16px; }
  .composer { border-radius: 22px; }
  body.has-thread .thread { padding-bottom: 200px; }
  .chips { justify-content: flex-start; }
  .chips--chat, #sChips { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
