/* === Tell the Universe – styles.css (merged) === */
:root{
  /* Purple Cosmic Theme */
  --bg-0:#0c0613;
  --bg-1:#130a22;
  --fg:#eadeff;
  --muted:#b9a6f5;
  --line:rgba(185,127,255,.25);
  --line2:rgba(168,85,247,.35);
  --panel:rgba(28,15,46,.60);
  --panel-2:rgba(28,15,46,.50);
  --accent:#a855f7;
  --accent-2:#c084fc;
  /* Dark UI hint */
  color-scheme: dark;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0; color:var(--fg);
  font-family:"Quicksand", system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size:16px; line-height:1.45;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  position: relative;
  isolation: isolate;

  /* cosmic gradient */
  background:
    radial-gradient(60% 90% at 50% 0%, var(--bg-1), transparent 60%),
    radial-gradient(70% 120% at 50% 100%, #0a0714, transparent 55%),
    linear-gradient(180deg, #090512 0%, var(--bg-0) 70%);
}

body::before{
  content:none;
}

body::after{
  content:none;
}
/* reduce overscroll jank */
html, body{ overscroll-behavior: none; }

/* Main column (above floating posts) */
.wrap{
  max-width:400px; margin:0 auto; padding:56px 18px; position:relative; z-index:3;
  /* Respect safe areas (notches) horizontally */
  padding-left: calc(18px + env(safe-area-inset-left));
  padding-right: calc(18px + env(safe-area-inset-right));
  /* Also respect safe areas vertically */
  padding-top:    calc(56px + env(safe-area-inset-top));
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}

/* Hard cap the visual width of floating posts */
.post{
  max-width: min(var(--post-max-w, 250px), 92vw);
  overflow-wrap: anywhere;   /* prevent long links from stretching the card */
}

/* (optional) clamp lines instead of chopping text in JS */
.post .msg{
  display: -webkit-box;
  -webkit-line-clamp: var(--post-max-lines, 6);
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* Title + subtitle */
h1{
  margin:0 0 8px; font-size:20px;
  color:#f5eaff;
  text-shadow:0 2px 16px rgba(168,85,247,.25);
  letter-spacing:.3px;
}
.sub{
  color: var(--muted);
  font-size: 10px;    /* <- adjust as you like */
  line-height: 1.4;
}

/* tiny fixed info links; independent from the centered Cosmic Memory button */
.micro-links{
  position:fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(18px + env(safe-area-inset-right));
  z-index:45;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  line-height:1;
  pointer-events:auto;
}

.micro-links a{
  font-size:.78rem;
  font-weight:600;
  color:#cfc7ff;
  opacity:.55;
  text-decoration:none;
  transition:opacity .15s ease, text-decoration-color .15s ease;
  text-underline-offset: 3px;
}

.micro-links a:hover,
.micro-links a:focus{ opacity:.95; text-decoration:underline; }

.micro-links .dot{ color:#cfc7ff; opacity:.35; font-size:.78rem; }

/* small screens – keep the info menu at the top instead of pushing it below Cosmic Memory */
@media (max-width:640px){
  .micro-links{
    top: calc(8px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
    flex-direction:column;
    align-items:flex-end;
    gap:4px;
  }
  .micro-links .dot{ display:none; }
  .micro-links a{
    font-size:.66rem;
    line-height:1.05;
    opacity:.62;
  }

  .wrap{
    padding-top:    calc(32px + env(safe-area-inset-top));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

/* Composer panel as glass */
#postForm{
  position:relative; z-index:3;
  background:linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--line);
  border-radius:20px;
  padding:16px;
-webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
}

/* Inputs */
input, textarea{
  width:100%;
  background: linear-gradient(180deg, rgba(23,12,34,.85), rgba(20,10,31,.75));
  color:var(--fg);
  border: 1px solid rgba(255,255,255,.15);
outline:none;
  border-radius:14px;
  padding:12px;
  resize:none;
}
textarea{ height:120px; }

/* Focus */
input:focus, textarea:focus{
  border-color: rgba(168,85,247,.6);
}

/* Placeholder */
input::placeholder, textarea::placeholder{
  color:#8f77d6; opacity:.95;
}

/* Kill Chrome's white autofill (+states hardened) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active{
  -webkit--webkit-text-fill-color: var(--fg) !important;
  caret-color: var(--fg);
}
/* Firefox autofill parity */
input:-moz-autofill{
-moz-text-fill-color: var(--fg);
  caret-color: var(--fg);
}

/* Footer row under textarea */
.row{ display:flex; justify-content:space-between; align-items:center; margin-top:10px; }
.muted{ color:var(--muted); font-size:13px; }

/* Primary button */
button{
  border:0; border-radius:16px; background:#8b5cf6; color:white;
  padding:10px 18px; font-weight:700; cursor:pointer;
transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
button:hover{ background:#9a6df8; box-shadow:0 10px 34px rgba(154,109,248,.45); transform:translateY(-1px); }
button:active{ transform:translateY(0); }
button[disabled]{ opacity:.55; cursor:not-allowed; }

/* Floating posts layer */
.feed{
  position:fixed; inset:0; overflow:hidden; pointer-events:none; z-index:2;
}
.feed .post{ z-index:0; }
/* Make the Share button clickable despite pointer-events:none */
.feed .post .post-share{ pointer-events:auto; }


.post .msg{
  color:#f3eaff;
  max-width:68ch;
  word-break:break-word;
  hyphens:auto;
  text-wrap:pretty;
}

/* Post glass cards */
.post{
  position:absolute;
  padding:12px 14px;
  border-radius:16px;
  background: linear-gradient(180deg, rgba(23,12,34,.85), rgba(20,10,31,.75));
  border:1px solid rgba(255,255,255,.15);
/* GPU-friendly transform + content-visibility perf */
  content-visibility:auto;
  contain-intrinsic-size:120px 220px;
  transform: translate3d(var(--x,0), var(--y,0), 0) scale(var(--s,1)) rotate(var(--rot,0deg));
  will-change: transform;
}

/* Meta line */
.post > .meta{
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  margin-top: 8px;
}
.post > .meta i{ color:var(--accent-2); font-style:italic; font-weight:600; }
.post > .meta time{ opacity:.9; }

/* Intro pop */
.post.enter{ animation: post-pop .35s ease both; }
@keyframes post-pop{
  from{ opacity:0; transform: translate3d(var(--x,0), var(--y,0), 0) scale(calc(var(--s,1)*.96)) rotate(var(--rot,0deg)); }
  to{   opacity:1; transform: translate3d(var(--x,0), var(--y,0), 0) scale(var(--s,1)) rotate(var(--rot,0deg)); }
}

/* Starfield (behind everything) */
#stars{
  position:fixed; inset:0; pointer-events:none; z-index:1; display:block;
}

/* Header line: title + sound toggle */
.header-line{
  display:flex;
  align-items:baseline;            /* aligns button with headline text */
  justify-content:space-between;   /* title left, button right */
  gap:12px;
  margin-bottom:6px;
  position:relative;
  z-index:3; /* above floating posts */
}
.header-line h1{ margin:0; }

/* ===== Sound toggle (white-only, header variant) ===== */

/* Dock for the sound toggle (fixed top-left, outside the composer) */
#soundToggleDock{
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: calc(16px + env(safe-area-inset-left));
  z-index: 9999;
  pointer-events: none; /* allow only the button to receive clicks */
}
#soundToggleDock .sound-toggle{ pointer-events: auto; }


.sound-toggle,
.header-line .sound-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:12px;
  background: linear-gradient(180deg, rgba(23,12,34,.85), rgba(20,10,31,.75));
  border:1px solid rgba(255,255,255,0.10);
  color:#fff;
  font-weight:700;
  font-size:13px;
  cursor:pointer;
  user-select:none;
  pointer-events:auto;
transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.sound-toggle:hover,
.header-line .sound-toggle:hover{
  transform: translateY(-1px);
  background: rgba(26,14,43,0.92);
  border-color: rgba(168,85,247,0.35);
}
.sound-toggle:active,
.header-line .sound-toggle:active{ transform: translateY(0); }
.sound-toggle:focus-visible,
.header-line .sound-toggle:focus-visible{
  outline: none;
}

/* Dot: white-only; ON = brighter white, OFF = dimmer white */
.sound-toggle .dot,
.header-line .sound-toggle .dot{
  width:10px; height:10px; border-radius:50%;
  background: rgba(255,255,255,0.55);  /* OFF */
transition: background .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.sound-toggle.on .dot,
.header-line .sound-toggle.on .dot{
  background:#ffffff;               /* ON */
}

/* Label opacity cue */
.sound-toggle .label,
.header-line .sound-toggle .label{ opacity:.85; }
.sound-toggle.on .label,
.header-line .sound-toggle.on .label{ opacity:1; }

/* Motion preference: reduce extra motion for sensitive users */
@media (prefers-reduced-motion: reduce){
  .post.enter{ animation:none; }
  .header-line .sound-toggle,
  button{ transition:none; }
}

/* Android-only compact UI (tighter) */
html.is-android { font-size: 13.5px; }
@media (max-width: 540px){ html.is-android { font-size: 12.5px; } }

.is-android .wrap{
  max-width: 400px;
  padding: 32px 14px;
}

.is-android h1{
  font-size: 15px;
  letter-spacing: .15px;
  text-shadow: 0 2px 14px rgba(168,85,247,.20);
  margin-bottom: 6px;
}

.is-android #postForm{
  border-radius: 14px;
  padding: 10px;
}

.is-android input,
.is-android textarea{
  border-radius: 9px;
  padding: 8px;
  font-size: 13px;
}
.is-android textarea{ height: 88px; }

.is-android .row{ margin-top: 6px; } /* fixed stray “720p” token */
.is-android .muted{ font-size: 11.5px; }

.is-android button{
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 12px;
}

.is-android .sound-toggle,
.header-line .sound-toggle{
  padding: 5px 9px;
  font-size: 11px;
  border-radius: 9px;
}
.is-android .sound-toggle .dot{ width: 7px; height: 7px; }

.is-android .post{
  padding: 8px 10px;
  border-radius: 12px;
}
.is-android .post > .meta{ font-size: 8.5px; }

/* ======================= iOS-only compact UI (same as Android) ======================= */
html.is-ios { font-size: 13.5px; }
@media (max-width: 540px){ html.is-ios { font-size: 12.5px; } }

.is-ios .wrap{
  max-width: 400px;
  padding: 32px 14px;
}

.is-ios h1{
  font-size: 15px;
  letter-spacing: .15px;
  text-shadow: 0 2px 14px rgba(168,85,247,.20);
  margin-bottom: 6px;
}

.is-ios #postForm{
  border-radius: 14px;
  padding: 10px;
}

.is-ios input,
.is-ios textarea{
  border-radius: 9px;
  padding: 8px;
  font-size: 13px;
}
.is-ios textarea{ height: 88px; }

.is-ios .row{ margin-top: 6px; }
.is-ios .muted{ font-size: 11.5px; }

.is-ios button{
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 12px;
}

.is-ios .sound-toggle,
.header-line .sound-toggle{
  padding: 5px 9px;
  font-size: 11px;
  border-radius: 9px;
}
.is-ios .sound-toggle .dot{ width: 7px; height: 7px; }

.is-ios .post{
  padding: 8px 10px;
  border-radius: 12px;
}
.is-ios .post > .meta{ font-size: 8.5px; }

/* Selection color consistent with theme */
::selection{ background: rgba(168,85,247,.35); color: #fff; }

/* Accessibility fallback if any element lacks strong focus styles */
:focus-visible{
  outline: 2px solid rgba(168,85,247,.75);
  outline-offset: 2px;
}

/* Backdrop-filter fallback for older browsers (outside feature block too) */
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  #postForm {
    background: linear-gradient(180deg, rgba(28,15,46,.85), rgba(28,15,46,.70));
  }
}

/* === Essentials patch (append at end) === */

/* Prevent elastic overscroll jank */
html, body { overscroll-behavior: none; }

/* Share button remains clickable despite .feed { pointer-events:none } */
.feed .post .post-share { pointer-events: auto; }

/* Long-text safety in floating posts */
.post .msg {
  max-width: 68ch;
  word-break: break-word;
  hyphens: auto;
  text-wrap: pretty;
}

/* Performance: offscreen cards */
.post {
  content-visibility: auto;
  contain-intrinsic-size: 120px 220px;
  transform: translate3d(var(--x,0), var(--y,0), 0)
             scale(var(--s,1)) rotate(var(--rot,0deg));
}

/* Themed text selection */
::selection { background: rgba(168,85,247,.35); color: #fff; }

/* Higher contrast when requested */
@media (prefers-contrast: more){
  #postForm { border-color: rgba(168,85,247,.55); }
  .post { border-color: rgba(255,255,255,.28); }
}

/* Backdrop-filter fallback (older browsers) */
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))){
  #postForm {
    background: linear-gradient(180deg, rgba(28,15,46,.85), rgba(28,15,46,.70));
  }
}

/* Firefox autofill parity */
input:-moz-autofill{
-moz-text-fill-color: var(--fg);
  caret-color: var(--fg);
}

/* ===== Mobile font sizing for floating posts (override-at-end) ===== */
@media (max-width: 640px){
  .post{ font-size: 0.95rem; line-height: 1.35; }
  .post .msg{ line-height: 1.35; }
  .post > .meta{ font-size: 9px; }
}
@media (max-width: 420px){
  .post{ font-size: 0.90rem; }
  .post .msg{ line-height: 1.3; }
  .post > .meta{ font-size: 7px; }
}



/* === Bottom-centered composer (ChatGPT-like) === */
:root{
  --composer-max-width: 640px;
  --composer-side-padding: 16px;
  --composer-bottom-gap: 18px;
  --composer-reserve-space: 230px; /* keeps header/content from feeling cramped */
}

/* Fixed dock for the input box */
#composerDock{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--composer-bottom-gap) + env(safe-area-inset-bottom));
  width: min(var(--composer-max-width), calc(100vw - (2 * var(--composer-side-padding)) - env(safe-area-inset-left) - env(safe-area-inset-right)));
  z-index: 6000;  will-change: transform;
  transition: transform 120ms ease;
}

/* Ensure the composer panel fills the dock */
#composerDock #postForm{
  margin: 0;
  width: 100%;
}

/* Make sure top content isn't visually crowded by the fixed composer */
.wrap{
  padding-bottom: calc(56px + var(--composer-reserve-space) + env(safe-area-inset-bottom));
}


/* === Composer redesign: single box + send arrow === */
#postForm{
  /* Match floating post card style */
  background: linear-gradient(180deg, rgba(23,12,34,.85), rgba(20,10,31,.75));
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  border-radius: 22px;
  position: relative;
  padding: 14px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "textarea textarea"
    "imagepanel imagepanel"
    "media submit"
    ". count";
  column-gap: 12px;
  row-gap: 12px;
  align-items: end;
}

/* Remove inner textarea chrome; the form is the box now */
#postForm textarea{
  grid-area: textarea;
  width: 100%;
  min-height: 32px;
  height: 32px;
  max-height: 88px;

  background: transparent;
  border: 0;
  outline: none;
  border-radius: 0;

  padding: 0;
  resize: none;

  color: var(--fg);
  line-height: 1.35;
}

/* Send button as an arrow (ChatGPT-like) */
#submitBtn{
  grid-area: submit;
  position: static;
  transform: none;

  width: 44px;
  height: 44px;

  border-radius: 999px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  justify-self: end;

  background: #8b5cf6;
  color: #ffffff;

  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}

#submitBtn:hover{ transform: translateY(-1px); }
#submitBtn:active{ transform: none; }

#submitBtn:disabled{
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.55);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

#submitBtn svg{ width: 18px; height: 18px; }

/* Composer counter (small, under send arrow) */
#postForm #count{
  grid-area: count;
  position: static;
  width: 44px;              /* match send button width */
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,.65);
  user-select: none;
  z-index: 2;
  justify-self: end;
  margin-top: -6px;
}
/* Keep legacy elements hidden while preserving JS compatibility */
.sr-only{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}




/* === Floating post glow: reduce intensity === */
.post{
  box-shadow: 0 0 10px rgba(168,85,247,.16), 0 0 22px rgba(168,85,247,.08) !important;
}


/* === Mobile: ensure composer height fits send arrow === */
@media (max-width: 520px){
  #postForm{
    padding: 12px;
    column-gap: 10px;
    row-gap: 10px;
  }
  #postForm textarea{
    min-height: 32px;
    height: 32px;
  }
}

@media (max-width: 380px){
  #postForm{
    padding: 11px;
    column-gap: 8px;
    row-gap: 8px;
  }
  .composer-secondary-btn{
    padding: 8px 10px;
    border-radius: 11px;
    font-size: 12px;
  }
  #addImageToggle,
  #submitBtn{
    min-height: 42px;
    height: 42px;
  }
  #postForm #count{
    font-size: 11px;
  }
}


/* === Remove thin borders: composer + floating posts === */
#postForm{
  border: 0 !important;
}

.post{
  border: 0 !important;
}


/* === Sound toggle: reduce size by 50% === */
#soundToggleDock .sound-toggle{
  transform: scale(0.75);
  transform-origin: top left;
}


/* === Floating post Share action === */
.post .post-share{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
  min-height: auto !important;
  color: rgba(255,255,255,.55) !important;
  font: 400 11px/1.1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
  letter-spacing: .2px;
  opacity: .65 !important;
}

.post .post-share:hover{
  background: transparent !important;
  transform: none !important;
  opacity: .82 !important;
  color: rgba(255,255,255,.72) !important;
}

.post .post-share:active{
  transform: none !important;
  opacity: .9 !important;
}


/* === Floating post date: slightly smaller === */
.post .date,
.post time,
.post .post-date{
  font-size: 10px !important;
  opacity: .65;
}


/* === Post meta: date color + separators === */
/* Make date match Share/Star color */
.post .date,
.post time,
.post .post-date{
  color: rgba(255,255,255,.55) !important;
  opacity: .65 !important;
}

/* Tighter spacing so separators read cleanly */
.post .actions{
  gap: .15rem !important;
}


/* Reply UI */
.post .meta {
  margin-top: 9px;
}

/* Two-level floating-post metadata and action layout. */
.post .post-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow: visible;
  pointer-events: auto;
}

.post .post-info-row,
.post .post-command-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  min-width: 0;
  max-width: 100%;
}

.post .post-command-row {
  flex-wrap: nowrap;
  white-space: nowrap;
  width: max-content;
}

.post .post-info-row > *,
.post .post-command-row > * {
  flex: 0 0 auto;
  min-width: 0;
}

.post .post-info-row > * + *::before,
.post .post-command-row > * + *::before {
  content: "·";
  display: inline-block;
  margin: 0 7px;
}

/* Upper row: quiet metadata. */
.post .post-info-row,
.post .post-info-row .post-date-inline {
  color: rgba(255,255,255,.52) !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  opacity: 1 !important;
}

.post > .post-info-row {
  margin-bottom: 6px;
}

.post .post-info-row > * + *::before {
  color: rgba(255,255,255,.34);
}

/* Lower row: primary post actions. */
.post .post-command-row,
.post .post-command-row .post-inline-btn {
  color: #8f77d6 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
  opacity: .95 !important;
}

.post .post-command-row > * + *::before {
  color: #8f77d6;
  opacity: .72;
}

.post .post-date-inline {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
}

.post .post-command-row .post-inline-btn {
  appearance: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
  min-height: 0 !important;
  color: #8f77d6 !important;
  font: 400 11px/1.25 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
  letter-spacing: .2px !important;
  opacity: .95 !important;
  cursor: pointer;
  text-decoration: none !important;
}

.post .post-command-row .post-inline-btn:hover {
  background: transparent !important;
  transform: none !important;
  color: #fff !important;
  opacity: 1 !important;
  text-shadow: 0 0 8px rgba(255,255,255,.24);
}



.post .post-date-inline[hidden],
.post .post-reply-btn[hidden],
.post .post-reply-count[hidden],
.post .post-cosmic-btn[hidden] {
  display: none !important;
}

.reply-body::before {
  content:none;
}

.reply-body .reply-shell {
  position: relative;
  z-index: 2;
}

.reply-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 18px 96px;
}

.reply-shell {
  display: grid;
  gap: 18px;
}

.reply-card {
  background: linear-gradient(180deg, rgba(23,12,34,.82), rgba(20,10,31,.72));
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.reply-card h2 {
  margin: 0 0 10px;
}

.reply-card-origin {
  padding: 22px 22px 20px;
}

.reply-card-origin .reply-origin-text {
  font-size: 1.22rem;
  line-height: 1.65;
}

.reply-card-origin .reply-note {
  margin-top: 10px;
}

.reply-card-compose {
  background: linear-gradient(180deg, rgba(34,16,58,.88), rgba(27,12,46,.78));
  border-color: rgba(192,132,252,.18);
}

.reply-card-compose .reply-textarea {
  background: linear-gradient(180deg, rgba(27,11,46,.92), rgba(23,9,40,.84));
}

.reply-top-actions,
.reply-bottom-actions {
  display: flex;
}

.reply-top-actions {
  justify-content: flex-start;
}

.reply-bottom-actions {
  justify-content: flex-start;
  padding-bottom: env(safe-area-inset-bottom);
}

.reply-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(23,12,34,.85), rgba(20,10,31,.75));
  border: 1px solid rgba(255,255,255,.14);
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
}

.reply-back-btn:hover {
  background: rgba(26,14,43,0.92);
}

.reply-origin-text,
.reply-item-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.reply-textarea {
  min-height: 240px;
}

.reply-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.reply-list {
  display: grid;
  gap: 12px;
}

.reply-item {
  background: linear-gradient(180deg, rgba(23,12,34,.76), rgba(20,10,31,.62));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 14px;
}

.reply-item:target {
  border-color: rgba(207, 216, 255, .66);
  box-shadow: 0 0 0 2px rgba(207, 216, 255, .12), 0 0 28px rgba(139, 115, 255, .24);
}

.reply-item-meta,
.reply-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 640px) {
  .reply-page {
    padding: 18px 14px 72px;
  }

  .reply-card {
    padding: 16px;
    border-radius: 16px;
  }

  .reply-card-origin {
    padding: 18px;
  }

  .reply-card-origin .reply-origin-text {
    font-size: 1.1rem;
    line-height: 1.55;
  }
}


.reply-body .reply-page,
.reply-body .reply-shell,
.reply-body .reply-card,
.reply-body .reply-top-actions,
.reply-body .reply-bottom-actions {
  position: relative;
  z-index: 2;
}



/* image upload + image posts */
.composer-media{
  grid-area: media;
  position: static;
  transform: none;
  margin-top: 0;
  z-index: 2;
  min-width: 0;
}
.composer-secondary-btn{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  color: var(--fg);
  padding: 9px 12px;
  border-radius: 12px;
  box-shadow: none;
}
.composer-secondary-btn:hover{ background: rgba(255,255,255,.12); box-shadow:none; }
#addImageToggle{
  min-height: 44px;
}
.image-upload-panel{
  grid-area: imagepanel;
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  overflow: visible;
}
.image-upload-note{ color:var(--muted); font-size:12px; margin-bottom:8px; }
.image-upload-actions,.image-preview-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.image-upload-status{ min-height:18px; margin-top:0; margin-bottom:2px; color:rgba(235,225,255,.82); font-size:12px; }
.image-upload-status:empty{ display:none; }
.image-upload-status.is-uploading{ color:rgba(239,232,255,.92); }
.image-upload-error{ min-height:18px; margin-top:0; margin-bottom:8px; color:#ffb4b4; font-size:12px; }
.image-upload-panel[aria-busy="true"] .image-preview-actions,
.image-upload-panel[aria-busy="true"] + .composer-media{ opacity:.65; pointer-events:none; }
.image-preview-wrap{ margin-top:0; }

@keyframes ttu-image-upload-spin{
  to{ transform:rotate(360deg); }
}

#submitBtn.is-uploading-image svg{ display:none; }
#submitBtn.is-uploading-image::after,
#replySend.is-uploading-image::before{
  content:"";
  width:18px;
  height:18px;
  flex:0 0 18px;
  border:2px solid rgba(255,255,255,.30);
  border-top-color:#fff;
  border-radius:50%;
  animation:ttu-image-upload-spin .75s linear infinite;
}
#submitBtn.is-uploading-image:disabled,
#replySend.is-uploading-image:disabled{
  background:#8b5cf6;
  color:#fff;
  opacity:.82;
  cursor:wait;
  box-shadow:0 0 18px rgba(168,85,247,.20);
}
#replySend.is-uploading-image{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

@media (prefers-reduced-motion: reduce){
  #submitBtn.is-uploading-image::after,
  #replySend.is-uploading-image::before{ animation-duration:1.5s; }
}

.reply-card-compose .image-upload-panel{
  max-width: 100%;
  margin: 10px 0 14px;
}

.image-preview-card{
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(23,12,34,.85), rgba(20,10,31,.75));
}
.image-preview-text{ margin-bottom:10px; white-space:pre-wrap; word-break:break-word; }
.post-image,
.post-image-preview{
  display:block;
  margin:0 auto;
  width:150px;
  height:150px;
  object-fit:contain;
  border-radius:14px;
}
.post-image-button{
  display:block;
  margin:10px auto 0;
  padding:0;
  background:none;
  border:0;
  box-shadow:none;
  pointer-events:auto;
}
.post-image-button:hover{ background:none; box-shadow:none; transform:none; }
.reply-origin-image,
.reply-item-image,
.reply-preview-image{
  display:block;
  margin-left:auto;
  margin-right:auto;
  width:100%;
  max-width:500px;
  max-height:500px;
  object-fit:contain;
  border-radius:16px;
}
.reply-origin-image-wrap,
.reply-item-image-wrap,
.reply-preview-image-wrap{ margin-top:12px; text-align:center; }
.reply-preview-image{ margin:0 auto; }
.reply-composer-media{ margin:12px 0 0; }

/* Cosmic Echo */
.post .post-cosmic-btn[hidden] {
  display: none;
}

.reply-cosmic-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.reply-cosmic-actions .reply-note {
  margin-top: 0;
}

.reply-cosmic-btn {
  background: rgba(168, 85, 247, .16);
  border: 1px solid rgba(216, 180, 254, .24);
  box-shadow: none;
}

.reply-cosmic-btn:hover {
  background: rgba(168, 85, 247, .24);
  box-shadow: none;
}

/* Temporary floating Cosmic Echo: visible once for approximately 30 seconds. */
.cosmic-echo-float {
  --echo-drift-x: 18px;
  --echo-drift-y: -12px;
  --echo-rotation: 0deg;
  --echo-duration: 30000ms;
  --cosmic-drag-x: 0px;
  --cosmic-drag-y: 0px;
  position: fixed;
  z-index: 1600;
  width: min(var(--echo-max-width, 360px), calc(100vw - 48px));
  box-sizing: border-box;
  padding: 18px 20px 20px;
  border: 1px solid rgba(226, 208, 255, .30);
  border-radius: 18px;
  background:
    radial-gradient(circle at 22% 0%, rgba(216, 180, 254, .18), transparent 55%),
    rgba(18, 11, 31, .90);
  box-shadow:
    0 0 34px rgba(192, 132, 252, .20),
    0 18px 55px rgba(0, 0, 0, .38),
    inset 0 0 28px rgba(255, 255, 255, .035);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  color: #f5efff;
  opacity: 0;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  -webkit-user-drag: none;
  transform-origin: center;
  will-change: transform, opacity;
}

.cosmic-echo-float.is-visible {
  animation: cosmic-echo-pass var(--echo-duration) ease-in-out forwards;
}

.cosmic-echo-float.is-held {
  z-index: 1700;
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
  box-shadow:
    0 0 22px rgba(255,255,255,.24),
    0 0 48px rgba(192,132,252,.28),
    0 18px 55px rgba(0,0,0,.38),
    inset 0 0 28px rgba(255,255,255,.035);
}

.cosmic-echo-float-label {
  margin-bottom: 10px;
  color: rgba(226, 208, 255, .67);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.cosmic-echo-float-text {
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  font-style: italic;
  line-height: 1.55;
  overflow-wrap: anywhere;
  text-shadow: 0 0 16px rgba(216, 180, 254, .16);
}


.cosmic-echo-float.cosmic-memory-float {
  --echo-max-width: 560px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  pointer-events: auto;
  scrollbar-width: thin;
  touch-action: none;
}

.cosmic-echo-float.cosmic-memory-float .cosmic-echo-float-text {
  font-size: clamp(.94rem, 1.75vw, 1.06rem);
  line-height: 1.62;
}

/* Procedural water imprint generated with each Cosmic Memory.
   The visual is rendered on a canvas as a slow, light-reactive lake surface;
   the canvas remains transparent outside its atmosphere-seeded shoreline. */
.cosmic-memory-atmosphere {
  --atmosphere-filter: brightness(1) saturate(1.08);
  position: relative;
  margin: 2px 0 18px;
}

.cosmic-memory-atmosphere-canvas {
  position: relative;
  isolation: isolate;
  width: 98%;
  height: clamp(154px, 29vw, 202px);
  margin-inline: auto;
  overflow: visible;
}

.cosmic-memory-water-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  opacity: .94;
  filter: var(--atmosphere-filter);
  transform: translateZ(0);
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

/* Used only if a browser cannot create a 2D canvas context. */
.cosmic-memory-atmosphere-canvas.is-fallback {
  overflow: hidden;
  border-radius: 46% 54% 43% 57% / 38% 44% 56% 62%;
  background:
    radial-gradient(92% 68% at 34% 20%, rgba(255, 255, 255, .22), transparent 57%),
    radial-gradient(84% 72% at 72% 66%, var(--atmosphere-accent-soft, rgba(181, 138, 232, .32)), transparent 66%),
    linear-gradient(180deg, var(--atmosphere-primary-soft, rgba(53, 36, 94, .58)), var(--atmosphere-secondary-soft, rgba(21, 26, 59, .76)));
}

/* The atmosphere name sits quietly beneath the lake, centered and secondary
   to the moving water surface. */
.cosmic-memory-atmosphere-caption {
  display: block;
  width: 100%;
  margin: .42rem auto 0;
  padding-inline: 1rem;
  overflow: hidden;
  color: rgba(239, 233, 250, .68);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: .56;
  text-shadow: 0 1px 10px rgba(197, 161, 238, .12);
  pointer-events: none;
  user-select: none;
}

@media (max-width: 620px) {
  .cosmic-memory-atmosphere-canvas {
    width: 100%;
    height: clamp(142px, 39vw, 184px);
  }

  .cosmic-memory-atmosphere-caption {
    margin-top: .34rem;
    font-size: 7px;
    letter-spacing: .12em;
  }
}

@keyframes cosmic-echo-pass {
  0% {
    opacity: 0;
    transform: translate3d(var(--cosmic-drag-x), calc(12px + var(--cosmic-drag-y)), 0) rotate(var(--echo-rotation)) scale(.96);
  }
  5% {
    opacity: 1;
  }
  16% {
    opacity: 1;
    transform: translate3d(var(--cosmic-drag-x), var(--cosmic-drag-y), 0) rotate(var(--echo-rotation)) scale(1);
  }
  82% {
    opacity: 1;
    transform: translate3d(calc(var(--echo-drift-x) + var(--cosmic-drag-x)), calc(var(--echo-drift-y) + var(--cosmic-drag-y)), 0) rotate(var(--echo-rotation)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(var(--echo-drift-x) + var(--cosmic-drag-x)), calc(var(--echo-drift-y) + var(--cosmic-drag-y)), 0) rotate(var(--echo-rotation)) scale(.985);
  }
}

@media (max-width: 620px) {
  .cosmic-echo-float {
    width: calc(100vw - 32px);
    padding: 16px 17px 18px;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cosmic-echo-float.is-visible {
    animation-name: cosmic-echo-pass-reduced;
  }

  .cosmic-memory-water-canvas {
    will-change: auto;
  }
}

@keyframes cosmic-echo-pass-reduced {
  0% { opacity: 0; transform: translate3d(var(--cosmic-drag-x), var(--cosmic-drag-y), 0); }
  5%, 82% { opacity: 1; transform: translate3d(var(--cosmic-drag-x), var(--cosmic-drag-y), 0); }
  100% { opacity: 0; transform: translate3d(var(--cosmic-drag-x), var(--cosmic-drag-y), 0); }
}

/* === Cosmic Memory launcher === */
.cosmic-answer-launcher {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.cosmic-answer-btn {
  appearance: none;
  border: 1px solid rgba(216,180,254,.46);
  background:
    linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.035)),
    radial-gradient(120% 180% at 50% 0%, rgba(192,132,252,.28), rgba(168,85,247,.12) 48%, rgba(28,15,46,.54));
  color: #f7efff;
  opacity: .96;
  padding: 10px 20px 11px;
  border-radius: 999px;
  box-shadow:
    0 12px 34px rgba(0,0,0,.34),
    0 0 22px rgba(168,85,247,.24),
    inset 0 1px 0 rgba(255,255,255,.20);
  font: inherit;
  font-size: .96rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: .035em;
  text-shadow: 0 0 14px rgba(255,255,255,.20);
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    transform .16s ease,
    opacity .15s ease,
    border-color .15s ease,
    box-shadow .15s ease,
    background .15s ease,
    color .15s ease;
}

.cosmic-answer-btn:hover,
.cosmic-answer-btn:focus-visible {
  transform: translateY(-1px);
  opacity: 1;
  color: #fff;
  border-color: rgba(255,255,255,.62);
  box-shadow:
    0 14px 38px rgba(0,0,0,.38),
    0 0 30px rgba(192,132,252,.36),
    inset 0 1px 0 rgba(255,255,255,.28);
  outline: none;
}

.cosmic-answer-btn:active {
  transform: translateY(0) scale(.99);
}

.cosmic-answer-btn[disabled] {
  cursor: default;
  opacity: .56;
}

.cosmic-answer-btn.is-loading {
  position: relative;
  opacity: .90;
  color: #fff;
  border-color: rgba(255,255,255,.50);
  padding-left: 42px;
}

.cosmic-answer-btn.is-loading::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.28);
  border-top-color: rgba(255,255,255,.95);
  border-right-color: rgba(216,180,254,.88);
  box-shadow: 0 0 14px rgba(192,132,252,.28);
  animation: cosmicMemorySpin .72s linear infinite;
}

.cosmic-answer-btn.is-loading::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192,132,252,.18) 0%, rgba(192,132,252,.08) 38%, rgba(192,132,252,0) 72%);
  pointer-events: none;
}

.cosmic-answer-btn.is-used {
  color: rgba(255,255,255,.72);
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
    radial-gradient(120% 180% at 50% 0%, rgba(185,166,245,.18), rgba(28,15,46,.46));
  border-color: rgba(216,180,254,.28);
  box-shadow:
    0 10px 28px rgba(0,0,0,.30),
    0 0 15px rgba(168,85,247,.14),
    inset 0 1px 0 rgba(255,255,255,.13);
}

.cosmic-answer-btn.is-unavailable {
  opacity: .38;
}

@media (max-width:640px){
  .cosmic-answer-launcher {
    top: calc(9px + env(safe-area-inset-top));
  }

  .cosmic-answer-btn {
    font-size: .86rem;
    padding: 9px 15px 10px;
    letter-spacing: .025em;
  }

  .cosmic-answer-btn.is-loading {
    padding-left: 37px;
  }

  .cosmic-answer-btn.is-loading::before {
    left: 14px;
    width: 12px;
    height: 12px;
    margin-top: -6px;
  }

  .cosmic-answer-btn.is-loading::after {
    left: 10px;
    width: 20px;
    height: 20px;
    margin-top: -10px;
  }
}

@keyframes cosmicMemorySpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === THE UNIVERSE automated floating post === */
.post.auto-generated-post {
  border-color: rgba(216, 206, 255, .26) !important;
  box-shadow: 0 0 28px rgba(168, 85, 247, .12), 0 0 58px rgba(255, 255, 255, .07) !important;
}

.post.auto-generated-post .msg {
  color: #f4ecff;
  text-shadow: 0 0 10px rgba(216, 206, 255, .18);
}

.post .post-info-row .post-source-inline {
  color: rgba(216, 206, 255, .76) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.2 !important;
}

.post .post-source-inline[hidden] {
  display: none;
}

/* === Hold and move floating posts === */
.feed .post{
  pointer-events:auto;
  cursor:grab;
  touch-action:none;
  -webkit-user-drag:none;
}

.feed .post.is-held{
  z-index:40 !important;
  cursor:grabbing;
  user-select:none;
  -webkit-user-select:none;
  transition:
    opacity var(--fade-ms, 10000ms) ease,
    transform 0ms linear !important;
  box-shadow:
    0 0 18px rgba(255,255,255,.24),
    0 0 42px rgba(168,85,247,.20) !important;
}

.feed .post a,
.feed .post button,
.feed .post input,
.feed .post textarea,
.feed .post select,
.feed .post [role="button"]{
  cursor:pointer;
  touch-action:manipulation;
}

html.post-drag-active,
html.post-drag-active body,
html.cosmic-float-drag-active,
html.cosmic-float-drag-active body{
  cursor:grabbing;
  user-select:none;
  -webkit-user-select:none;
}

/* === Human post connection === */
.post .post-command-row > * + *::before{
  margin-inline:3px;
}

.post .post-command-row,
.post .post-command-row .post-inline-btn{
  font-size:10px !important;
}

.post .post-connect-btn[hidden]{
  display:none !important;
}

.post .post-connect-btn.is-connecting{
  color:#eee8ff !important;
  opacity:1 !important;
  text-shadow:0 0 8px rgba(216,206,255,.34);
}

.post.is-connecting-post{
  box-shadow:0 0 16px rgba(181,138,232,.12), 0 0 34px rgba(143,119,214,.07) !important;
}

.post.is-connected-post,
.post.is-connection-ending{
  background:
    radial-gradient(circle at 36% 18%, rgba(138,47,62,.16), transparent 62%),
    linear-gradient(180deg, rgba(55,15,27,.94), rgba(30,8,17,.91)) !important;
  box-shadow:
    0 0 8px rgba(123,36,51,.14),
    0 0 17px rgba(76,20,33,.08) !important;
}

body .feed .post.is-connected-post .msg,
body .feed .post.is-connection-ending .msg{
  color:#f8eef1 !important;
  text-shadow:0 0 6px rgba(207,126,142,.14) !important;
}

.post.is-connected-post .post-command-row,
.post.is-connected-post .post-command-row .post-inline-btn,
.post.is-connected-post .post-command-row > * + *::before,
.post.is-connection-ending .post-command-row,
.post.is-connection-ending .post-command-row .post-inline-btn,
.post.is-connection-ending .post-command-row > * + *::before{
  color:#c58a98 !important;
}

.post.is-connected-post .post-info-row,
.post.is-connected-post .post-info-row .post-date-inline,
.post.is-connection-ending .post-info-row,
.post.is-connection-ending .post-info-row .post-date-inline{
  color:rgba(239,205,213,.60) !important;
}

.feed .post .msg{
  transition:color 1.2s ease, text-shadow 1.2s ease;
}

.connection-line-layer{
  position:fixed;
  inset:0;
  z-index:2;
  width:100vw;
  height:100vh;
  overflow:visible;
  pointer-events:none;
}

.post-connection-line{
  opacity:1;
  transition:opacity 1.6s ease;
}

.post-connection-line.is-ending{
  opacity:0;
}

.post-connection-card-glow{
  fill:rgba(126,35,51,.055);
  stroke:rgba(203,112,130,.10);
  stroke-width:.38px;
  vector-effect:non-scaling-stroke;
  filter:url(#postConnectionCardBlur);
  animation:postConnectionGlimmer 5.8s ease-in-out infinite;
}

@keyframes postConnectionGlimmer{
  0%,100%{ opacity:.28; }
  48%{ opacity:.52; }
}

.post-connection-beam{
  stroke-width:1px;
  stroke-linecap:round;
  vector-effect:non-scaling-stroke;
}

.post-connection-particle{
  fill:#eee8ff;
  transform-box:fill-box;
  transform-origin:center;
}

.connection-toast{
  position:fixed;
  top:calc(66px + env(safe-area-inset-top));
  left:50%;
  z-index:7000;
  max-width:min(420px, calc(100vw - 32px));
  padding:9px 14px;
  border:1px solid rgba(216,206,255,.16);
  border-radius:999px;
  background:rgba(18,11,31,.88);
  color:#e8e0ff;
  box-shadow:0 10px 34px rgba(0,0,0,.30), 0 0 20px rgba(168,85,247,.10);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  font-size:12px;
  line-height:1.35;
  text-align:center;
  opacity:0;
  pointer-events:none;
  transform:translate(-50%, -7px);
  transition:opacity .22s ease, transform .22s ease;
}

.connection-toast.is-visible{
  opacity:1;
  transform:translate(-50%, 0);
}

.connection-toast.is-error{
  color:#ffd7df;
  border-color:rgba(255,180,196,.20);
}

@media (max-width:640px){
  .post .post-command-row,
  .post .post-command-row .post-inline-btn{
    font-size:9px !important;
  }

  .post .post-command-row > * + *::before{
    margin-inline:2px;
  }

  .connection-toast{
    top:calc(58px + env(safe-area-inset-top));
    font-size:11px;
  }
}

@media (prefers-reduced-motion:reduce){
  .post-connection-card-glow{
    animation:none;
    opacity:.42;
  }

  .connection-toast{
    transition:none;
  }
}
