/* === 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,
.post .post-owner-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;
}

/* Keep the owner-only control inside narrow floating cards without wrapping
   or compressing the established public action row. */
.post .post-owner-row {
  justify-content: center;
  width: 100%;
}

.post .post-owner-row[hidden],
.post .post-owner-row .post-manage-btn[hidden] {
  display: none !important;
}

.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,
.post .post-owner-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,
.post .post-owner-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,
.post .post-owner-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-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-total-count {
  color: var(--muted);
  font-size: .8em;
  font-weight: 500;
}

.reply-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.reply-pagination .reply-note {
  margin: 0;
}

.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;
}

.reply-source {
  font-weight: 700;
  letter-spacing: .035em;
}

.reply-source.universe {
  color: #cf9cff;
}

@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;
  }
}

/* GUI refinement: readable controls, quiet reading and a continuous scene. */
.feed .post {
  /* 294px aligns the card's content area with the full five-action menu. */
  width: min(294px, calc(100vw - 24px));
  min-width: 0;
  max-width: min(294px, calc(100vw - 24px));
  padding: 3.5px 14px;
  text-align: center;
  transform-origin: top left;
  transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(var(--s, 1)) rotate(var(--rot, 0deg));
  opacity: 1;
  pointer-events: auto;
  content-visibility: visible;
  transition: opacity var(--fade-ms, 5000ms) ease, box-shadow 1.8s ease, background 1.8s ease;
  box-shadow: 0 0 24px rgba(145, 105, 203, .12);
  touch-action: none;
}
.feed .post.appear, .feed .post.fade-out { opacity: 0; }
.feed .post.fade-out { --fade-ms: 9000ms; }
.feed .post .msg { font-size: 16px; font-weight: 400; line-height: 1.5; }
.feed .post .msg,
.feed .post .meta { width: 100%; text-align: center; }
.feed .post .post-actions { align-items: center; }
.feed .post .post-info-row,
.feed .post .post-command-row,
.feed .post .post-owner-row { justify-content: center; margin-inline: auto; }
.feed .post.is-reading .msg { display: block; overflow: visible; -webkit-line-clamp: unset; }
.feed .post.is-reading, .feed .post.is-held {
  z-index: 8;
  opacity: 1;
  background: rgba(24, 13, 38, .97);
  box-shadow: 0 0 0 1px rgba(180, 150, 230, .4), 0 8px 36px rgba(0, 0, 0, .25);
}
.feed .post.is-pinned { outline: 1px solid rgba(180, 150, 230, .45); outline-offset: 3px; }
.ttu-reading .feed .post:not(.is-reading):not(.is-held):not(.fade-out) { opacity: .4; }
#stars, .planet-drift-layer { transition: opacity 700ms ease; }
.ttu-reading #stars, .ttu-reading .planet-drift-layer { opacity: .58; }
@keyframes ttu-arrival-light {
  0% {
    filter: brightness(1.65);
    box-shadow: 0 0 24px rgba(255,255,220,.72), 0 0 70px rgba(250,233,125,.58), 0 0 130px rgba(192,132,240,.30);
  }
  42% {
    filter: brightness(1.22);
    box-shadow: 0 0 18px rgba(255,255,220,.48), 0 0 58px rgba(250,233,125,.36), 0 0 105px rgba(192,132,240,.20);
  }
  100% {
    filter: brightness(1.04);
    box-shadow: 0 0 24px rgba(245,203,148,.30), 0 0 65px rgba(191,135,171,.16);
  }
}
.feed .post.fresh {
  isolation: isolate;
  z-index: 7;
  animation: ttu-arrival-light 3.8s ease-out both;
  box-shadow: 0 0 24px rgba(245,203,148,.30), 0 0 65px rgba(191,135,171,.16);
}
.feed .post.fresh::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -46px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255,248,184,.22), rgba(197,141,231,.09) 46%, transparent 72%);
  filter: blur(12px);
}
.feed .post.fresh .msg {
  color: #fbf4c8 !important;
  text-shadow: 0 0 8px rgba(255,250,192,.68), 0 0 22px rgba(250,229,126,.30) !important;
}
.feed .post .post-info-row, .feed .post .post-date-inline { font-size: 11px !important; }
.feed .post .post-image {
  width: auto;
  height: auto;
  max-width: min(200px, 100%);
  max-height: 200px;
  border-radius: 12px;
  clip-path: inset(0 round 12px);
}
.feed .post .post-image-button {
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
  border-radius: 12px;
  overflow: visible;
}
.feed .post .meta { margin-top: 2px; }
.feed .post .post-command-row {
  width: max-content; max-width: 100%; flex-wrap: nowrap; gap: 0; justify-content: flex-start;
}
.feed .post .post-command-row .post-inline-btn {
  font: 400 12px/1.3 system-ui, sans-serif !important;
  letter-spacing: 0 !important;
  color: #8f77d6 !important;
  min-width: 24px; min-height: 32px !important; padding: 4px 1px !important;
  flex: 0 0 auto; white-space: nowrap; touch-action: manipulation;
}
.feed .post .post-owner-row .post-inline-btn {
  font: 400 11px/1.3 system-ui, sans-serif !important;
  letter-spacing: 0 !important;
  color: #8f77d6 !important;
  min-height: 24px !important;
  padding: 0 4px !important;
  white-space: nowrap;
  touch-action: manipulation;
}
.feed .post .post-command-row > :not([hidden]) + :not([hidden])::before {
  content: "\00b7";
  display: inline-block;
  margin: 0 3px;
  color: #8f77d6;
  opacity: .72;
}
.feed .post .post-command-row [hidden] { display: none !important; }
.feed .post .post-inline-btn:focus-visible, .ttu-stillness:focus-visible,
.ttu-thread-dialog a:focus-visible, .ttu-thread-dialog button:focus-visible, .cosmic-echo-close:focus-visible {
  outline: 1px solid #c4a4ef !important; outline-offset: 3px; border-radius: 4px;
}
.feed .post .post-inline-btn[aria-busy="true"] { opacity: .6 !important; }
.ttu-inline-notice { margin-top: 6px; color: #cfc0e7; font: 400 12px/1.5 system-ui, sans-serif; }
.ttu-inline-notice[data-kind="error"], .composer-error { color: #ebc4cd; }
.composer-error:not(:empty) { display: block; padding: 8px 2px 0; font: 400 13px/1.5 system-ui, sans-serif; }
.ttu-toast {
  position: fixed; bottom: max(150px, 20vh); left: 50%; transform: translateX(-50%);
  z-index: 10010; width: max-content; max-width: min(480px, calc(100vw - 32px));
  padding: 12px 16px; border: 1px solid #504066; border-radius: 14px;
  background: rgba(25, 14, 38, .98); color: #ddcdec; font: 400 14px/1.5 system-ui, sans-serif;
}
.ttu-stillness {
  position: fixed; top: calc(48px + env(safe-area-inset-top)); left: calc(16px + env(safe-area-inset-left));
  z-index: 46;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(23,12,34,.85), rgba(20,10,31,.75));
  color: #fff;
  font: 700 13px/normal system-ui, sans-serif;
  cursor: pointer; user-select: none;
  transform: scale(.75); transform-origin: top left;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.ttu-stillness:hover {
  transform: scale(.75);
  background: rgba(26,14,43,.92);
  border-color: rgba(168,85,247,.35);
}
.ttu-stillness:active { transform: scale(.75); }
.ttu-stillness .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.55);
  transition: background .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.ttu-stillness .label { opacity: .85; }
.ttu-stillness[aria-pressed="true"] .dot { background: #fff; }
.ttu-stillness[aria-pressed="true"] .label { opacity: 1; }
.ttu-atmosphere { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 25s linear; mix-blend-mode: screen; }
.ttu-atmosphere.is-current { opacity: .22; }
.ttu-scene-paused .ttu-atmosphere { transition: none; }
.ttu-scene-paused .post, .ttu-scene-paused .post-connection-line,
.ttu-still .cosmic-echo-float { animation-play-state: paused !important; }
.ttu-scene-paused .feed .post { --fade-ms: 0ms; }
.ttu-thread-open { overflow: hidden; }
.ttu-thread-dialog {
  width: min(760px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px);
  padding: 0; border: 1px solid rgba(185,166,245,.25); border-radius: 22px; overflow: auto;
  color: #eadeff; background: rgba(16, 9, 27, .82); box-shadow: 0 20px 100px rgba(0,0,0,.5);
  overscroll-behavior: contain; scrollbar-width: thin;
}
.ttu-thread-dialog::backdrop { background: rgba(5, 2, 11, .25); }
.ttu-thread-dialog .reply-shell { max-width: none; width: 100%; margin: 0; padding: 20px; }
.ttu-thread-dialog .reply-top-actions { position: sticky; top: 0; z-index: 3; background: rgba(16, 9, 27, .72); padding: 4px 0 10px; }
.ttu-thread-dialog .reply-card { background: rgba(27, 15, 43, .32); }
.ttu-thread-dialog .reply-item { background: rgba(16, 9, 27, .12); }
.reply-origin-text,
.reply-item-text {
  color: #eadeff;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
}
.reply-textarea {
  height: 80px;
  min-height: 80px;
  max-height: 160px;
}
.reply-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.reply-submit-row .reply-composer-media,
.reply-submit-row .reply-actions { margin: 0; }
.reply-submit-row #replyAddImageToggle,
.reply-submit-row #replySend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}
.ttu-thread-dialog .reply-back-btn { min-height: 36px; display: inline-flex; align-items: center; }
.ttu-thread-dialog .reply-item:target { outline: 1px solid #a18ac9; outline-offset: 4px; }
.cosmic-echo-close { position: absolute; right: 10px; top: 8px; padding: 3px 8px; min-height: 28px; color: #c7b4e6; background: transparent; font: 400 18px/1 system-ui, sans-serif; }
.cosmic-echo-float-label { padding-right: 24px; }
@media (max-width: 640px) {
  .feed .post {
    width: min(210px, calc(100vw - 24px));
    max-width: min(210px, calc(100vw - 24px));
    padding: 2.5px 10px;
  }
  .feed .post .msg { font-size: 14px; line-height: 1.45; }
  .feed .post .post-image {
    width: auto;
    height: auto;
    max-width: min(140px, 100%);
    max-height: 140px;
  }
  .feed .post .post-info-row,
  .feed .post .post-date-inline { font-size: 10px !important; }
  .feed .post .post-command-row .post-inline-btn {
    min-width: 24px;
    min-height: 40px !important;
    padding: 4px 0 !important;
    font-size: 9px !important;
  }
  .feed .post .post-owner-row .post-inline-btn {
    min-height: 28px !important;
    font-size: 9px !important;
  }
  .feed .post .post-command-row > :not([hidden]) + :not([hidden])::before { margin: 0 1px; }
  .ttu-thread-dialog .reply-shell { padding: 12px; }
  #soundToggleDock { left: calc(12px + env(safe-area-inset-left)); }
  .ttu-stillness { left: calc(12px + env(safe-area-inset-left)); }
  #soundToggleDock .sound-toggle,
  body .ttu-stillness {
    gap: 6px;
    padding: 5px 9px;
    border-radius: 9px;
    font: 700 11px/normal system-ui, sans-serif;
  }
  #soundToggleDock .sound-toggle .dot,
  .ttu-stillness .dot { width: 7px; height: 7px; }
}

/* Older/low-resolution phones: keep floating posts proportional and compact. */
@media (max-width: 390px) and (max-height: 740px) {
  .feed .post {
    width: min(140px, calc(100vw - 16px));
    max-width: min(140px, calc(100vw - 16px));
    padding: 1.667px 6.667px;
    border-radius: 10.667px;
  }

  .feed .post .msg {
    font-size: 9.333px;
    line-height: 1.45;
  }

  .feed .post .post-image {
    max-width: min(93.333px, 100%);
    max-height: 93.333px;
    border-radius: 8px;
    clip-path: inset(0 round 8px);
  }

  .feed .post .post-image-button {
    margin-top: 1.333px;
    border-radius: 8px;
  }

  .feed .post .meta { margin-top: 1.333px; }
  .feed .post .post-actions { gap: 4px; }
  .feed .post > .post-info-row { margin-bottom: 4px; }

  .feed .post .post-info-row,
  .feed .post .post-date-inline,
  .feed .post .post-info-row .post-source-inline {
    font-size: 6.667px !important;
  }

  .feed .post .post-info-row .post-source-inline {
    letter-spacing: .08em;
  }

  .feed .post .post-command-row .post-inline-btn {
    min-width: 16px;
    min-height: 27px !important;
    padding: 2.667px 0 !important;
    font-size: 6px !important;
  }

  .feed .post .post-owner-row .post-inline-btn {
    min-height: 18px !important;
    padding: 0 2.667px !important;
    font-size: 6px !important;
  }

  .feed .post .post-command-row > :not([hidden]) + :not([hidden])::before {
    margin: 0 .667px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #stars, .planet-drift-layer { display: block !important; }
  .planet-drift { display: block !important; }
  .ttu-atmosphere, #stars, .planet-drift-layer, .feed .post { transition: none; }
  .feed .post.fresh { animation: none; }
}

.cosmic-echo-float.is-reading { opacity: 1 !important; animation-play-state: paused !important; }
.ttu-still .post-connection-card-glow { animation-play-state: paused !important; }

.ttu-notice-link { color: #d1b6f3; text-underline-offset: 3px; }

.image-preview-actions [hidden] { display: none !important; }

/* Phase 2.1: anonymous, browser-held author controls. */
.author-manage-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #bba0ea;
  padding: 2px 5px;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.reply-item-meta .author-manage-btn::before {
  content: "·";
  display: inline-block;
  margin: 0 7px 0 3px;
  text-decoration: none;
  opacity: .65;
}

.author-control-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(680px, calc(100dvh - 28px));
  border: 1px solid rgba(202, 158, 255, .35);
  border-radius: 18px;
  padding: 0;
  color: var(--fg);
  background: rgba(18, 8, 31, .97);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .58), 0 0 36px rgba(160, 91, 230, .17);
}

.author-control-dialog:not([open]) { display: none; }

.author-control-dialog::backdrop {
  background: rgba(4, 1, 10, .76);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.author-control-panel {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 22px;
}

.author-control-panel h2 { margin: 0; font-size: 1.2rem; }
.author-control-note,
.author-control-count,
.author-control-status { color: var(--muted); font-size: .86rem; }
.author-control-status { min-height: 1.35em; }

.author-control-text {
  box-sizing: border-box;
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  padding: 12px;
  color: var(--fg);
  background: rgba(9, 4, 17, .72);
  font: 500 1rem/1.55 "Quicksand", system-ui, sans-serif;
}

.author-control-text:focus { outline: 2px solid rgba(187, 160, 234, .72); outline-offset: 2px; }
.author-control-text[aria-invalid="true"] { border-color: #ff8fa3; }

.author-control-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.author-control-actions button {
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 11px;
  padding: 8px 13px;
  color: var(--fg);
  background: rgba(82, 48, 112, .55);
  cursor: pointer;
}

.author-control-actions button:disabled { opacity: .5; cursor: wait; }
.author-control-actions .author-control-delete { color: #ffc2cc; border-color: rgba(255, 143, 163, .38); background: rgba(102, 25, 48, .42); }
.author-control-spacer { flex: 1 1 auto; }

@media (max-width: 420px) {
  .author-control-panel { padding: 16px; }
  .author-control-text { min-height: 125px; }
  .author-control-actions { align-items: stretch; }
  .author-control-spacer { display: none; }
  .author-control-actions button { flex: 1 1 42%; }
}

/* Phase 2.2: accessibility and small-device compatibility hardening. */
.skip-link {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: calc(8px + env(safe-area-inset-left));
  z-index: 20000;
  max-width: calc(100vw - 16px);
  padding: 10px 14px;
  border: 2px solid #fff;
  border-radius: 10px;
  background: #160b25;
  color: #fff;
  font: 700 1rem/1.25 system-ui, sans-serif;
  text-decoration: none;
  transform: translateY(calc(-100% - 24px));
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid #f4ddff;
  outline-offset: 3px;
}

#main-content:focus { outline: none; }

/* Never suppress the keyboard indicator added by the shared focus rule. */
.sound-toggle:focus-visible,
.header-line .sound-toggle:focus-visible,
.cosmic-answer-btn:focus-visible {
  outline: 3px solid #d9b8ff !important;
  outline-offset: 3px !important;
}

.feed .post:focus-visible,
.reply-item:focus-visible {
  outline: 3px solid #d9b8ff !important;
  outline-offset: 4px;
}

.micro-links a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding-inline: 2px;
}

.cosmic-answer-btn,
#soundToggleDock .sound-toggle,
body .ttu-stillness {
  min-height: 44px;
}

.cosmic-echo-close,
.reply-back-btn,
.composer-secondary-btn,
.author-manage-btn {
  min-width: 24px;
  min-height: 24px;
}

.author-manage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* The low-resolution card remains visually compact, while every actionable
   item keeps the WCAG 2.2 minimum target box. */
@media (max-width: 390px) and (max-height: 740px) {
  .feed .post .post-command-row .post-inline-btn {
    min-width: 24px !important;
    min-height: 27px !important;
  }

  .feed .post .post-owner-row .post-inline-btn {
    min-width: 24px !important;
    min-height: 24px !important;
  }
}

/* Keep reply and editing controls at 16px, but make the short main composer
   more compact so a complete 100-character post stays visible on phones. */
@media (max-width: 640px) {
  #postForm textarea {
    font-size: 14px !important;
    line-height: 1.3;
    min-height: 48px;
    height: 48px;
    max-height: 120px;
    transition: height 160ms ease;
  }

  #postForm textarea:focus {
    height: 96px;
  }

  .reply-textarea,
  .author-control-text {
    font-size: 16px !important;
  }

  /* Keep the longer composer prompt compact on narrow phone screens. */
  #postForm textarea::placeholder {
    font-size: 13px;
    line-height: 1.2;
  }

  .micro-links { gap: 0; }
}

@media (max-width: 380px) {
  #postForm textarea {
    font-size: 13px !important;
  }
}

/* The ordinary composer is never a scroll container: applying overflow-y at
   every viewport also makes overflow-x auto and exposes browser scrollbars. */
#composerDock {
  max-height: none;
  overflow: visible;
}

@media (max-height: 520px) {
  /* Only the expanded attachment workflow needs a local fallback at extreme
     zoom or on a very short landscape viewport. Horizontal scrolling is
     always suppressed. */
  #composerDock.is-image-panel-open {
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .micro-links {
    max-height: calc(100dvh - 16px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .ttu-thread-dialog,
  .author-control-dialog {
    max-height: calc(100dvh - 12px);
  }
}

/* Reduced-motion mode removes movement rather than merely slowing it down.
   Timed Echo/Memory content remains visible and closeable. */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .cosmic-echo-float.is-visible,
  .cosmic-echo-float.is-reading {
    opacity: 1 !important;
    transform: translate3d(var(--cosmic-drag-x), var(--cosmic-drag-y), 0) !important;
  }

  .cosmic-answer-btn.is-loading::before,
  #submitBtn.is-uploading-image::after,
  #replySend.is-uploading-image::before {
    animation: none !important;
    border-color: rgba(255,255,255,.82) !important;
  }
}

/* Preserve controls, focus, and status information in Windows high-contrast
   and other forced-color modes. */
@media (forced-colors: active) {
  body,
  #postForm,
  .feed .post,
  .reply-card,
  .reply-item,
  .ttu-thread-dialog,
  .author-control-dialog,
  .cosmic-echo-float {
    color: CanvasText !important;
    background: Canvas !important;
    border: 1px solid CanvasText !important;
    box-shadow: none !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
  }

  button,
  .reply-back-btn,
  .post-inline-btn,
  .author-manage-btn,
  .cosmic-answer-btn,
  .sound-toggle,
  .ttu-stillness {
    color: ButtonText !important;
    background: ButtonFace !important;
    border: 1px solid ButtonText !important;
    forced-color-adjust: auto;
  }

  .feed .post .post-command-row .post-inline-btn,
  .feed .post .post-owner-row .post-inline-btn {
    color: ButtonText !important;
    background: ButtonFace !important;
    border: 1px solid ButtonText !important;
    opacity: 1 !important;
  }

  a { color: LinkText; }

  :focus-visible,
  .feed .post:focus-visible,
  .feed .post .post-inline-btn:focus-visible,
  .cosmic-answer-btn:focus-visible,
  .sound-toggle:focus-visible {
    outline: 3px solid Highlight !important;
    outline-offset: 3px !important;
  }

  .post .post-info-row,
  .post .post-info-row *,
  .post .post-command-row *,
  .post .post-owner-row *,
  .reply-note,
  .reply-item-meta,
  .composer-error {
    color: CanvasText !important;
    opacity: 1 !important;
  }
}

@media (prefers-contrast: more) {
  :root { --muted: #d8caff; }

  .micro-links a,
  .post .post-info-row,
  .post .post-info-row *,
  .post .post-command-row *,
  .post .post-owner-row * {
    opacity: 1 !important;
  }
}

/* Phase 2.3: calm first-visit orientation and a local Memory return signal. */
.cosmic-answer-launcher {
  flex-direction: column;
  align-items: center;
}

.cosmic-memory-changed {
  margin-top: 6px;
  padding: 3px 8px 4px;
  border: 1px solid rgba(216, 180, 254, .3);
  border-radius: 999px;
  background: rgba(18, 9, 30, .76);
  color: rgba(242, 229, 255, .88);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .035em;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  pointer-events: none;
}

.cosmic-memory-changed[hidden] { display: none !important; }

.micro-links .ttu-guide-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #cfc7ff;
  opacity: .55;
  box-shadow: none;
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  text-underline-offset: 3px;
  cursor: pointer;
}

.micro-links .ttu-guide-link:hover,
.micro-links .ttu-guide-link:focus-visible {
  color: #cfc7ff;
  opacity: .95;
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  transform: none;
}

.ttu-guide-dialog {
  width: min(430px, calc(100vw - 32px));
  max-height: min(640px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(216, 180, 254, .24);
  border-radius: 19px;
  background:
    radial-gradient(110% 80% at 50% 0%, rgba(133, 83, 188, .11), transparent 62%),
    linear-gradient(180deg, rgba(27, 15, 43, .64), rgba(14, 8, 25, .58));
  color: var(--fg);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .46), 0 0 26px rgba(168, 85, 247, .11);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.ttu-guide-dialog:not([open]) { display: none; }

.ttu-guide-dialog::backdrop {
  background: rgba(4, 2, 9, .18);
}

.ttu-guide-fallback-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19999;
  background: rgba(4, 2, 9, .18);
}

.ttu-guide-fallback-backdrop[hidden] { display: none !important; }
body.ttu-guide-fallback-active { overflow: hidden; }

.ttu-guide-dialog.is-fallback-open {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 20000;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 100vmax rgba(4, 2, 9, .18), 0 18px 54px rgba(0, 0, 0, .46);
}

.ttu-guide-panel {
  position: relative;
  padding: 22px;
}

.ttu-guide-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .82);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
}

.ttu-guide-close:hover,
.ttu-guide-close:focus-visible {
  background: rgba(255, 255, 255, .12);
  box-shadow: none;
  transform: none;
}

.ttu-guide-kicker {
  margin: 0 44px 4px 0;
  color: rgba(207, 199, 255, .68);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.ttu-guide-dialog h2 {
  margin: 0 38px 8px 0;
  color: #f7efff;
  font-size: clamp(1.2rem, 3.5vw, 1.5rem);
  line-height: 1.15;
}

.ttu-guide-intro {
  margin: 0;
  color: rgba(243, 234, 255, .86);
  font-size: .88rem;
  line-height: 1.45;
}

.ttu-guide-features {
  margin: 15px 0 13px;
}

.ttu-guide-features > div {
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.ttu-guide-features > div:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.ttu-guide-features dt {
  margin-bottom: 3px;
  color: #e5c8ff;
  font-size: .84rem;
  font-weight: 700;
}

.ttu-guide-features dd {
  margin: 0;
  color: rgba(235, 226, 247, .76);
  font-size: .8rem;
  line-height: 1.4;
}

.ttu-guide-privacy {
  margin: 0 0 13px;
  color: rgba(207, 199, 255, .62);
  font-size: .69rem;
  line-height: 1.4;
}

.ttu-guide-enter {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid rgba(216, 180, 254, .48);
  border-radius: 999px;
  background: rgba(126, 76, 177, .62);
  color: #fff;
  box-shadow: none;
}

.ttu-guide-enter:hover,
.ttu-guide-enter:focus-visible {
  background: rgba(143, 87, 199, .76);
  box-shadow: none;
}

.ttu-guide-philosophy-link {
  color: rgba(220, 198, 245, .72);
  text-decoration-color: rgba(220, 198, 245, .46);
  text-underline-offset: 3px;
}

.ttu-guide-philosophy-link:hover,
.ttu-guide-philosophy-link:focus-visible {
  color: #f4e8ff;
  text-decoration-color: currentColor;
}

@media (max-width: 640px) {
  .micro-links .ttu-guide-link {
    min-height: 24px;
    font-size: .66rem;
    line-height: 1.05;
    opacity: .62;
  }
}

@media (max-width: 390px), (max-height: 620px) {
  .ttu-guide-dialog {
    width: calc(100vw - 28px);
    max-height: calc(100dvh - 28px);
    border-radius: 15px;
  }

  .ttu-guide-panel { padding: 18px 16px 15px; }
  .ttu-guide-close { top: 7px; right: 7px; }
  .ttu-guide-features { margin-block: 11px 10px; }
  .ttu-guide-features > div { padding-block: 7px; }
}

@media (forced-colors: active) {
  .ttu-guide-dialog,
  .cosmic-memory-changed {
    color: CanvasText !important;
    background: Canvas !important;
    border: 1px solid CanvasText !important;
    box-shadow: none !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
  }

  .micro-links .ttu-guide-link,
  .ttu-guide-close,
  .ttu-guide-enter {
    color: ButtonText !important;
    background: ButtonFace !important;
    border: 1px solid ButtonText !important;
  }

  .ttu-guide-philosophy-link {
    color: LinkText !important;
    text-decoration-color: LinkText !important;
  }
}

@media (prefers-contrast: more) {
  .ttu-guide-dialog,
  .cosmic-memory-changed {
    border: 2px solid rgba(255, 255, 255, .68);
  }

  .micro-links .ttu-guide-link,
  .ttu-guide-features dd,
  .ttu-guide-privacy,
  .ttu-guide-philosophy-link {
    opacity: 1;
    color: #fff;
  }
}
