:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: rgba(13, 20, 33, 0.82);
  --panel-strong: rgba(19, 29, 48, 0.94);
  --text: #eef7ff;
  --muted: #a9b7c6;
  --gold: #f2cc7b;
  --cyan: #8ae8ff;
  --emerald: #3ff0b2;
  --rose: #ff77a8;
  --purple: #d4b8ff;
  --shadow: rgba(0, 0, 0, 0.42);
  --cog-spin-duration: 72s;
  --feed-gap: 1rem;
  --card-pad: clamp(1rem, 4vw, 2rem);
  /* Asset map CSS vars — applied by applyAssetMap(); fallbacks keep UI readable */
  --asset-base: none;
  --asset-hover: none;
  --asset-pressed: none;
  --asset-active: none;
  --asset-focused: none;
  --asset-highlight: none;
  --asset-handle: none;
  --asset-track: none;
  --asset-glow: none;
  --weld-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  --weld-metal: linear-gradient(155deg, rgba(28, 42, 68, 0.95), rgba(10, 16, 28, 0.92) 55%, rgba(14, 22, 38, 0.96));
  --weld-glass: linear-gradient(145deg, rgba(138, 232, 255, 0.1), transparent 48%), linear-gradient(210deg, rgba(63, 240, 178, 0.06), transparent 40%);
  --weld-trim-gold: rgba(242, 204, 123, 0.42);
  --weld-trim-cyan: rgba(138, 232, 255, 0.38);
  --weld-trim-emerald: rgba(63, 240, 178, 0.38);
}

/* The hidden attribute always wins over component display rules (several
   components set display: grid/block, which used to leave empty frames). */
[hidden] {
  display: none !important;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(63, 240, 178, 0.16), transparent 32rem),
    radial-gradient(circle at top right, rgba(138, 232, 255, 0.14), transparent 30rem),
    linear-gradient(160deg, #050810 0%, #0a1020 55%, #070b12 100%);
  color: var(--text);
  overflow-x: hidden;
}

/* ── Best moving background stack ── */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  --bg-parallax-x: 0px;
  --bg-parallax-y: 0px;
}

.site-bg__machine {
  position: absolute;
  inset: -4%;
  background-image: url("/assets/images/backgrounds/cowlsly_background_midnight_machine_animated.svg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.72;
  transform: translate3d(calc(var(--bg-parallax-x) * 0.35), calc(var(--bg-parallax-y) * 0.35), 0) scale(1.04);
  will-change: transform;
  transition: opacity 280ms ease;
}

.site-bg__circuit {
  position: absolute;
  inset: -6%;
  background-image: url("/assets/images/backgrounds/cowlsly_background_subtle_circuit_overlay_transparent.svg");
  background-size: cover;
  background-position: center;
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: circuit-drift 48s linear infinite;
  transform: translate3d(calc(var(--bg-parallax-x) * 0.55), calc(var(--bg-parallax-y) * 0.55), 0);
  will-change: transform, background-position;
}

.site-bg__aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 42% 36% at 18% 22%, rgba(63, 240, 178, 0.22), transparent 62%),
    radial-gradient(ellipse 38% 34% at 82% 18%, rgba(138, 232, 255, 0.2), transparent 60%),
    radial-gradient(ellipse 48% 40% at 58% 78%, rgba(164, 107, 255, 0.14), transparent 65%),
    radial-gradient(ellipse 30% 28% at 72% 62%, rgba(242, 204, 123, 0.08), transparent 70%);
  animation: aurora-breathe 22s ease-in-out infinite alternate;
  filter: blur(2px);
  transform: translate3d(calc(var(--bg-parallax-x) * 0.8), calc(var(--bg-parallax-y) * 0.8), 0);
  will-change: transform, opacity;
}

@keyframes circuit-drift {
  0% { background-position: 0% 0%; }
  50% { background-position: 4% 3%; }
  100% { background-position: 0% 0%; }
}

@keyframes aurora-breathe {
  0% { opacity: 0.72; transform: translate3d(calc(var(--bg-parallax-x) * 0.8), calc(var(--bg-parallax-y) * 0.8), 0) scale(1); }
  100% { opacity: 1; transform: translate3d(calc(var(--bg-parallax-x) * 0.8 - 1.5%), calc(var(--bg-parallax-y) * 0.8 + 1%), 0) scale(1.06); }
}

body.motion-reduced .site-bg__machine {
  background-image: url("/assets/images/backgrounds/cowlsly_background_midnight_machine.svg");
  opacity: 0.65;
}

body.motion-reduced .site-bg__circuit,
body.motion-reduced .site-bg__aurora {
  animation: none !important;
}

body.motion-reduced .site-bg__aurora {
  opacity: 0.55;
}

body[data-density="compact"] {
  --feed-gap: 0.65rem;
  --card-pad: clamp(0.75rem, 3vw, 1.25rem);
}

body[data-density="spacious"] {
  --feed-gap: 1.35rem;
  --card-pad: clamp(1.25rem, 4.5vw, 2.4rem);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(138, 232, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138, 232, 255, 0.05) 1px, transparent 1px);
  background-size: 3rem 3rem;
  mask-image: radial-gradient(ellipse at center, black 18%, transparent 78%);
  animation: grid-pulse 16s ease-in-out infinite alternate;
}

@keyframes grid-pulse {
  0% { opacity: 0.14; }
  100% { opacity: 0.28; }
}

body.motion-reduced::before {
  animation: none;
  opacity: 0.18;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--cyan);
  color: #041018;
  font-weight: 800;
  text-decoration: none;
  transition: top 120ms ease;
}

.skip-link:focus {
  top: 0.75rem;
}

.bg-cog-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  transform: translate3d(calc(var(--bg-parallax-x) * 1.1), calc(var(--bg-parallax-y) * 1.1), 0);
  will-change: transform;
}

.bg-cog {
  position: absolute;
  left: var(--cog-left);
  top: var(--cog-top);
  width: var(--cog-size);
  height: var(--cog-size);
  opacity: var(--cog-opacity, 0.12);
  filter: drop-shadow(0 0 0.75rem rgba(138, 232, 255, 0.22));
}

.bg-cog img,
.bg-cog-body,
.bg-cog-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: cog-spin var(--cog-duration, var(--cog-spin-duration)) linear infinite;
  animation-delay: var(--cog-delay);
}

.bg-cog.reverse img,
.bg-cog.reverse .bg-cog-body,
.bg-cog.reverse .bg-cog-glow { animation-name: cog-spin-reverse; }

.bg-cog-glow {
  opacity: 0.5;
  mix-blend-mode: screen;
}

body.motion-reduced .bg-cog img {
  animation: none !important;
}

/* Living background stays at z-index 0; shell chrome layers above it */
.machine-shell,
.site-footer {
  position: relative;
  z-index: 2;
}

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto minmax(10rem, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(5, 9, 16, 0.9);
  border-bottom: 1px solid rgba(138, 232, 255, 0.18);
  backdrop-filter: blur(18px);
  box-shadow: 0 1rem 3rem var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand-logo {
  display: block;
  filter: drop-shadow(0 0 0.8rem rgba(138, 232, 255, 0.28));
}

.brand-logo--mark {
  width: 2.4rem;
  height: 2.4rem;
}

.brand-logo--full {
  display: none;
  width: auto;
  height: 2rem;
}

.brand-text { font-size: 0.95rem; }

.profile-context,
.asset-backed-profile-context,
.asset_backed_profile_context {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--weld-trim-gold);
  border-radius: 999px;
  background:
    var(--asset-base, none),
    linear-gradient(145deg, rgba(242, 204, 123, 0.14), rgba(19, 29, 48, 0.88));
  background-size: cover, auto;
  background-position: center;
  box-shadow: var(--weld-bevel), 0 0 0.9rem rgba(242, 204, 123, 0.12);
}

.profile-context small { display: block; color: var(--muted); font-size: 0.68rem; }
.profile-context strong { font-size: 0.86rem; }

.profile-orb {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(164, 107, 255, 0.35), rgba(57, 233, 189, 0.25));
  box-shadow: 0 0 0.8rem rgba(138, 232, 255, 0.2);
}

.profile-orb img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

/* ── Search ── */
.search,
.asset-backed-search,
.asset_backed_search {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  /* The 920×150 search plate has its own lens baked into the left cap, so the
     separate icon is kept only as a fallback when the plate is unavailable. */
  display: none;
}

.search input {
  width: 100%;
  min-height: 2.9rem;
  /* Plate drawn as a 9-slice: the lens (left) and gem (right) caps keep their
     shape and the middle stretches with the field. The SVG keeps its aspect
     ratio as a background, which shrank it into a pill in the middle. */
  border-style: solid;
  border-color: transparent;
  border-width: 0;
  border-image-source: var(--asset-base, none);
  border-image-slice: 0 150 fill;
  border-image-width: 0 3.2em;
  border-image-repeat: stretch;
  border-radius: 999px;
  /* Text starts after the lens and stops before the gem. */
  padding: 0.72rem 3em 0.72rem 3.4em;
  color: var(--text);
  background: rgba(4, 10, 18, 0.6) padding-box;
  box-shadow: none;
  outline: none;
  transition: box-shadow 160ms ease, filter 160ms ease;
}

.search input:hover {
  border-image-source: var(--asset-hover, var(--asset-base, none));
  filter: brightness(1.06);
}

.search input:focus {
  border-image-source: var(--asset-focused, var(--asset-base, none));
  box-shadow: 0 0 1.2rem rgba(138, 232, 255, 0.32);
}

.search input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 0.25rem;
  padding: 0.45rem;
  border: 1px solid rgba(138, 232, 255, 0.22);
  border-radius: 1rem;
  background: rgba(8, 13, 22, 0.97);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  max-height: 18rem;
  overflow: auto;
}

.search-hit {
  display: grid;
  gap: 0.15rem;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 0.7rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.search-hit:hover,
.search-hit:focus-visible {
  background: rgba(138, 232, 255, 0.1);
  outline: none;
}

.search-hit strong { font-size: 0.86rem; }
.search-hit span { color: var(--muted); font-size: 0.75rem; }

.search-empty {
  padding: 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── Buttons ── */
.top-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button,
.glow-button,
.side-panel a,
button.glow-button,
.asset-button,
.asset_button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--weld-trim-cyan);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  background:
    var(--asset-base, none),
    var(--weld-glass),
    var(--weld-metal);
  background-size: cover, auto, auto;
  background-position: center;
  box-shadow: var(--weld-bevel), 0 0 0.8rem rgba(138, 232, 255, 0.12);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  font: inherit;
  cursor: pointer;
}

.icon-button span:not(.sr-only):not(.notif-count) {
  font-size: 0.78rem;
  font-weight: 700;
}

.btn-icon {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
  flex-shrink: 0;
}

.icon-button:hover,
.glow-button:hover,
.side-panel a:hover,
.asset-button:hover,
.asset_button:hover,
.icon-button.active,
.glow-button.active,
.side-panel a.active,
.icon-button:focus-visible,
.glow-button:focus-visible,
.side-panel a:focus-visible,
.asset-button:focus-visible,
.asset_button:focus-visible {
  border-color: rgba(138, 232, 255, 0.72);
  box-shadow: var(--weld-bevel), 0 0 1.2rem rgba(138, 232, 255, 0.34);
  outline: none;
  background-image: var(--asset-hover, var(--asset-base, none)), var(--weld-glass), var(--weld-metal);
}

.icon-button.active,
.glow-button.active,
.side-panel a.active,
.asset-button.active,
.asset_button.active {
  background-image:
    var(--asset-active, var(--asset-base, none)),
    linear-gradient(145deg, rgba(242, 204, 123, 0.22), transparent 60%),
    var(--weld-metal);
}

.icon-button[aria-current="page"],
.glow-button[aria-current="page"],
.side-panel a[aria-current="page"] {
  border-color: rgba(242, 204, 123, 0.68);
}

.icon-button:active,
.glow-button:active,
.side-panel a:active,
.asset-button:active,
.asset_button:active {
  transform: translateY(2px) scale(0.97);
  box-shadow: 0 0 1.8rem rgba(138, 232, 255, 0.62), 0 0 2.6rem rgba(242, 204, 123, 0.22);
  background-image: var(--asset-pressed, var(--asset-base, none)), var(--weld-glass), var(--weld-metal);
}

.glow-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.glow-button--warn {
  border-color: rgba(255, 119, 168, 0.45);
}

.console {
  border-color: rgba(242, 204, 123, 0.52);
  box-shadow: var(--weld-bevel), 0 0 1.1rem rgba(242, 204, 123, 0.22);
}

.console.active,
.console[aria-current="page"] {
  border-color: rgba(242, 204, 123, 0.85);
  box-shadow: var(--weld-bevel), 0 0 1.4rem rgba(242, 204, 123, 0.38), 0 0 0.6rem rgba(63, 240, 178, 0.2);
  background-image:
    var(--asset-active, var(--asset-base, none)),
    linear-gradient(145deg, rgba(242, 204, 123, 0.28), rgba(63, 240, 178, 0.08) 50%, rgba(19, 29, 48, 0.95));
}

.settings-link {
  border-color: rgba(63, 240, 178, 0.42);
  box-shadow: 0 0 0.9rem rgba(63, 240, 178, 0.16);
}

.notifications-btn { position: relative; }

.notif-badge {
  position: absolute;
  inset: -0.15rem;
  width: calc(100% + 0.3rem);
  height: calc(100% + 0.3rem);
  object-fit: contain;
  pointer-events: none;
  opacity: 0.85;
}

.notif-count {
  position: absolute;
  top: -0.15rem;
  right: -0.1rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1rem;
  text-align: center;
  box-shadow: 0 0 0.6rem rgba(255, 119, 168, 0.5);
}

/* ── Notifications panel ── */
.notifications-panel {
  position: fixed;
  top: 4.2rem;
  right: 1rem;
  z-index: 25;
  width: min(22rem, calc(100vw - 2rem));
  border: 1px solid rgba(138, 232, 255, 0.22);
  border-radius: 1.1rem;
  background: rgba(8, 13, 22, 0.97);
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(138, 232, 255, 0.12);
}

.notif-panel-head h2 {
  margin: 0;
  font-size: 0.95rem;
}

.notif-clear {
  border: 0;
  background: transparent;
  color: var(--cyan);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  max-height: 18rem;
  overflow: auto;
}

.notif-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0.75rem;
  border-radius: 0.75rem;
  margin-bottom: 0.25rem;
  background: rgba(138, 232, 255, 0.05);
}

.notif-item.read { opacity: 0.65; }
.notif-item strong { font-size: 0.86rem; }
.notif-item span { color: var(--muted); font-size: 0.8rem; }
.notif-item time { color: var(--gold); font-size: 0.7rem; font-weight: 700; }

/* ── Side panel ── */
.side-panel,
.welded-side-panel,
.welded_side_panel {
  position: fixed;
  inset: 5rem auto 1rem 0;
  z-index: 15;
  width: min(19rem, 84vw);
  padding: 1rem;
  border: 1px solid var(--weld-trim-cyan);
  border-left: 0;
  border-radius: 0 1.35rem 1.35rem 0;
  background:
    var(--asset-glow, none),
    var(--asset-base, none),
    var(--weld-glass),
    var(--panel-strong);
  background-size: cover, cover, auto, auto;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--weld-bevel), 0 1rem 3rem var(--shadow), inset -1px 0 0 rgba(242, 204, 123, 0.12);
  transform: translateX(calc(-100% + 3.4rem));
  transition: transform 1000ms ease-in-out;
  overflow: hidden;
}

.side-panel.open { transform: translateX(0); }

.panel-rim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
}

.panel-rim-glow,
.panel-rim-glass {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  opacity: 0.5;
}

.side-panel nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.65rem;
  margin-top: 3.4rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}

.side-panel.open nav {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 220ms;
}

.side-panel a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
}

.side-panel a img {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  flex-shrink: 0;
}

/* Beat the welded patch's `.asset-button { position: relative }`, which was parking the handle in the hidden part of the drawer. */
.side-panel > .panel-tab {
  position: absolute;
  top: 1rem;
  right: 0.55rem;
  left: auto;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(138, 232, 255, 0.14);
  box-shadow: 0 0 1rem rgba(138, 232, 255, 0.22);
  cursor: pointer;
  padding: 0.35rem;
}

.panel-tab img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── Machine shell ── */
.machine-shell {
  position: relative;
  z-index: 1;
  max-width: 74rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem 4.5rem;
}

.cog-bar {
  position: sticky;
  top: 4.4rem;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(7, minmax(2.8rem, 1fr));
  gap: 0.45rem;
  padding: 0.75rem;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(138, 232, 255, 0.16);
  border-radius: 1.2rem;
  background: rgba(5, 9, 16, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.28);
}

.cog {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  isolation: isolate;
  text-decoration: none;
  filter: drop-shadow(0 0 0.5rem rgba(138, 232, 255, 0.14));
  transition: filter 200ms ease, transform 160ms ease;
}

.cog:hover,
.cog:focus-visible {
  filter: drop-shadow(0 0 1rem rgba(138, 232, 255, 0.38));
  transform: scale(1.04);
  outline: none;
}

/* Keyboard focus must look different from hover (WCAG 2.4.7): a solid ring. */
.cog:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.cog.active {
  filter: drop-shadow(0 0 1.2rem rgba(242, 204, 123, 0.45));
}

.cog:active { transform: scale(0.96); }

.cog-layer {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.cog-shadow { z-index: 0; opacity: 0.85; }

.cog-glow {
  z-index: 1;
  opacity: 0.55;
  transition: opacity 200ms ease;
}

.cog-glow--pressed { opacity: 0; }

.cog:hover .cog-glow--idle,
.cog.active .cog-glow--idle { opacity: 0.75; }

.cog:active .cog-glow--idle,
.cog.active .cog-glow--idle { opacity: 0.2; }

.cog:active .cog-glow--pressed,
.cog.active .cog-glow--pressed { opacity: 0.9; }

.cog-body {
  z-index: 2;
  animation: cog-spin var(--cog-spin-duration) linear infinite;
}

.cog.reverse .cog-body { animation-name: cog-spin-reverse; }

.cog-center {
  z-index: 3;
  width: 52%;
  height: 52%;
  filter: drop-shadow(0 0 0.5rem rgba(138, 232, 255, 0.22));
}

.cog-glass {
  z-index: 4;
  opacity: 0.55;
  mix-blend-mode: screen;
}

@keyframes cog-spin { to { transform: rotate(360deg); } }
@keyframes cog-spin-reverse { to { transform: rotate(-360deg); } }

/* ── Scroll controller ── */
.scroll-controller,
.asset-scroll-controller {
  position: fixed;
  left: 0.65rem;
  top: 9rem;
  bottom: 2rem;
  z-index: 5;
  width: 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--weld-trim-cyan);
  background:
    var(--asset-track, none),
    linear-gradient(180deg, rgba(138, 232, 255, 0.08), rgba(255, 255, 255, 0.03));
  background-size: 100% 100%, auto;
  background-repeat: no-repeat;
  box-shadow: var(--weld-bevel), inset 0 0 0.5rem rgba(0, 0, 0, 0.25);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.scroll-controller:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.scroll-controller.dragging {
  cursor: grabbing;
  border-color: rgba(242, 204, 123, 0.45);
  box-shadow: 0 0 1.2rem rgba(138, 232, 255, 0.35);
}

.scroll-glow {
  position: absolute;
  inset: -20%;
  width: 140%;
  height: 140%;
  object-fit: cover;
  opacity: 0.25;
  pointer-events: none;
}

.scroll-handle {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0.2rem;
  height: 22%;
  border-radius: 999px;
  background:
    var(--asset-handle, none),
    linear-gradient(var(--cyan), var(--emerald));
  background-size: 100% 100%, auto;
  background-repeat: no-repeat;
  box-shadow: 0 0 1rem rgba(138, 232, 255, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 120ms linear, box-shadow 160ms ease, background-image 120ms ease;
}

.scroll-controller.dragging .scroll-handle {
  background-image:
    var(--asset-pressed, var(--asset-handle, none)),
    linear-gradient(var(--gold), var(--cyan));
  box-shadow: 0 0 1.4rem rgba(242, 204, 123, 0.55);
}

/* ── Feed & cards ── */
.feed {
  display: grid;
  gap: var(--feed-gap);
  max-width: 45rem;
  margin: 0 auto;
}

.feed:has(.dashboard-grid),
.feed:has(.entity-grid),
.feed:has(.message-list) {
  max-width: 52rem;
}

.hero-card,
.post-card,
.dash-card,
.entity-card,
.message-row,
.asset-backed-feed-card,
.asset_backed_feed_card {
  position: relative;
  border: 1px solid var(--weld-trim-cyan);
  border-radius: 1.4rem;
  padding: var(--card-pad);
  background:
    var(--asset-base, none),
    var(--weld-glass),
    var(--panel);
  background-size: cover, auto, auto;
  background-position: center;
  box-shadow: var(--weld-bevel), 0 1rem 3rem rgba(0, 0, 0, 0.28);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-image 160ms ease;
}

.post-card:hover,
.asset-backed-feed-card:hover,
.asset_backed_feed_card:hover {
  border-color: rgba(138, 232, 255, 0.55);
  box-shadow: var(--weld-bevel), 0 1rem 3rem rgba(0, 0, 0, 0.32), 0 0 1.2rem rgba(138, 232, 255, 0.14);
  background-image:
    var(--asset-hover, var(--asset-base, none)),
    var(--weld-glass),
    var(--panel);
}

.post-card:focus-within,
.asset-backed-feed-card:focus-within,
.asset_backed_feed_card:focus-within {
  border-color: rgba(242, 204, 123, 0.48);
  background-image:
    var(--asset-active, var(--asset-hover, var(--asset-base, none))),
    var(--weld-glass),
    var(--panel);
}

.hero-card {
  border-color: rgba(242, 204, 123, 0.28);
  box-shadow: var(--weld-bevel), 0 1rem 3rem rgba(0, 0, 0, 0.3), 0 0 1.5rem rgba(138, 232, 255, 0.08);
}

.hero-rim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
}

.hero-rim-glow,
.hero-rim-glass {
  position: absolute;
  inset: -15%;
  width: 130%;
  height: 130%;
  object-fit: cover;
}

.hero-card h1 {
  position: relative;
  margin: 0;
  font-size: clamp(1.8rem, 5.5vw, 3.6rem);
  line-height: 1.02;
}

.status-chip,
#api-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  margin: 0.75rem 0 0;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(63, 240, 178, 0.28);
  border-radius: 999px;
  color: var(--emerald);
  background: rgba(63, 240, 178, 0.08);
  font-size: 0.86rem;
  font-weight: 800;
}

.status-chip--pending {
  color: var(--gold);
  border-color: rgba(242, 204, 123, 0.35);
  background: rgba(242, 204, 123, 0.08);
}

.status-chip--warn {
  color: var(--rose);
  border-color: rgba(255, 119, 168, 0.35);
  background: rgba(255, 119, 168, 0.08);
}

.eyebrow {
  position: relative;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.post-avatar {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  filter: drop-shadow(0 0 0.5rem rgba(138, 232, 255, 0.25));
}

.post-head h2 {
  margin: 0;
  font-size: 1rem;
}

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

.post-badge {
  margin-left: auto;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.post-badge--ai {
  border: 1px solid rgba(164, 107, 255, 0.45);
  color: var(--purple);
  background: rgba(164, 107, 255, 0.15);
}

.post-badge--human {
  border: 1px solid rgba(63, 240, 178, 0.4);
  color: var(--emerald);
  background: rgba(63, 240, 178, 0.1);
}

.post-badge--market {
  border: 1px solid rgba(242, 204, 123, 0.4);
  color: var(--gold);
  background: rgba(242, 204, 123, 0.1);
}

body.hide-persona-labels .post-badge--ai,
body.hide-persona-labels .post-badge--human {
  /* Keep labels for safety when safety mode on — only dim slightly */
  opacity: 0.85;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.tag {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(138, 232, 255, 0.18);
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(138, 232, 255, 0.06);
}

.post-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(138, 232, 255, 0.1);
  flex-wrap: wrap;
}

.post-action {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid rgba(138, 232, 255, 0.22);
  border-radius: 50%;
  background:
    var(--asset-base, none),
    rgba(255, 255, 255, 0.04);
  background-size: cover, auto;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-image 140ms ease;
}

.post-action img {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  filter: drop-shadow(0 0 0.35rem rgba(138, 232, 255, 0.25));
}

.post-action:hover,
.post-action:focus-visible {
  border-color: rgba(138, 232, 255, 0.5);
  box-shadow: 0 0 0.8rem rgba(138, 232, 255, 0.25);
  outline: none;
}

.post-action:active,
.post-action.is-pressing {
  transform: scale(0.92);
  background:
    var(--asset-pressed, var(--asset-base, none)),
    rgba(255, 255, 255, 0.08);
  background-size: cover, auto;
  background-position: center;
  background-repeat: no-repeat;
}

.post-action.liked {
  border-color: rgba(255, 119, 168, 0.55);
  box-shadow: 0 0 1rem rgba(255, 119, 168, 0.35);
  background:
    var(--asset-pressed, var(--asset-base, none)),
    rgba(255, 119, 168, 0.1);
  background-size: cover, auto;
  background-position: center;
  background-repeat: no-repeat;
}

.post-action.saved {
  border-color: rgba(242, 204, 123, 0.55);
  box-shadow: 0 0 1rem rgba(242, 204, 123, 0.3);
  background:
    var(--asset-pressed, var(--asset-base, none)),
    rgba(242, 204, 123, 0.1);
  background-size: cover, auto;
  background-position: center;
  background-repeat: no-repeat;
}

/* Safety toolkit cards on Help */
.safety-toolkit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.safety-tool {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.65rem;
  border: 1px solid rgba(138, 232, 255, 0.18);
  border-radius: 1rem;
  background: rgba(5, 9, 16, 0.45);
  text-align: center;
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.safety-tool img {
  width: 2.6rem;
  height: 2.6rem;
  object-fit: contain;
}

.safety-tool strong {
  font-size: 0.82rem;
}

.safety-tool span {
  font-size: 0.72rem;
  color: var(--muted);
}

.safety-tool:hover,
.safety-tool:focus-visible {
  border-color: rgba(138, 232, 255, 0.45);
  box-shadow: 0 0 1rem rgba(138, 232, 255, 0.18);
  outline: none;
  transform: translateY(-1px);
}

.post-card h2,
.dash-card h2,
.entity-card h2,
.help-card h2 { margin-top: 0; }

.post-card p,
.hero-card p,
.dash-card p,
.entity-card p,
.message-row p { color: var(--muted); line-height: 1.65; }

.post-card.search-hidden,
.dash-card.search-hidden,
.entity-card.search-hidden,
.message-row.search-hidden,
.help-card.search-hidden { display: none; }

.signin-card {
  border-color: rgba(63, 240, 178, 0.35);
  background: linear-gradient(155deg, rgba(63, 240, 178, 0.08), rgba(13, 20, 33, 0.88));
}

/* ── Dashboard / entities ── */
.dashboard-grid,
.entity-grid {
  display: grid;
  gap: var(--feed-gap);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .entity-grid { grid-template-columns: 1fr; }
  .wallet-pack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.dash-card .dash-value {
  margin: 0.35rem 0;
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.02em;
}

.dash-value--warn { color: var(--rose); }

.locked-card {
  border-style: dashed;
  border-color: rgba(242, 204, 123, 0.28);
}

.wallet-pack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.wallet-pack-card {
  border: 1px solid rgba(138, 232, 255, 0.18);
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(9, 14, 24, 0.55);
}

.wallet-pack-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.wallet-pack-value {
  margin: 0.4rem 0;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text);
}

.wallet-buy-btn {
  margin-top: 0.4rem;
  width: 100%;
}

.wallet-history {
  display: grid;
  gap: 0.6rem;
}

.wallet-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  border: 1px solid rgba(138, 232, 255, 0.14);
  border-radius: 0.9rem;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.wallet-history-title {
  margin: 0;
  color: var(--text);
}

.wallet-history-credit {
  margin: 0;
  color: var(--emerald);
  font-weight: 800;
  white-space: nowrap;
}

.entity-card,
.message-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  cursor: default;
}

.message-row { cursor: pointer; transition: border-color 160ms ease, box-shadow 160ms ease; }
.message-row:hover {
  border-color: rgba(138, 232, 255, 0.4);
  box-shadow: 0 0 1.2rem rgba(138, 232, 255, 0.15);
}

.message-row.unread {
  border-color: rgba(138, 232, 255, 0.35);
  background: linear-gradient(145deg, rgba(138, 232, 255, 0.08), var(--panel));
}

.entity-avatar {
  width: 2.6rem;
  height: 2.6rem;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 0.45rem rgba(138, 232, 255, 0.22));
}

.entity-avatar--lg {
  width: 3.2rem;
  height: 3.2rem;
}

.entity-body { min-width: 0; flex: 1; }

.entity-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.entity-head h2 {
  margin: 0;
  font-size: 1rem;
}

.entity-head .post-badge { margin-left: 0; }

.msg-time {
  margin-left: auto;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
}

.status-pill {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--cyan);
  border: 1px solid rgba(138, 232, 255, 0.28);
  background: rgba(138, 232, 255, 0.08);
}

.feature-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
}

.feature-list--off { color: rgba(169, 183, 198, 0.75); }

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.stack-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.stack-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.stack-form input,
.stack-form textarea,
.stack-form select {
  width: 100%;
  border: 1px solid rgba(138, 232, 255, 0.24);
  border-radius: 0.85rem;
  padding: 0.65rem 0.8rem;
  color: var(--text);
  background: rgba(5, 9, 16, 0.55);
  font: inherit;
}

.stack-form textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0.95rem rgba(138, 232, 255, 0.24);
}

.privacy-fieldset {
  border: 1px solid rgba(138, 232, 255, 0.18);
  border-radius: 1rem;
  padding: 0.75rem;
  margin: 0;
}

.privacy-fieldset legend {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 800;
  padding: 0 0.35rem;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
  color: var(--text);
}

.inline-check.inline-check--nested {
  margin-left: 1.35rem;
  color: var(--cyan);
}

.mini-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.mini-item {
  border: 1px solid rgba(138, 232, 255, 0.18);
  border-radius: 0.9rem;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
}

.social-card .action-row {
  margin-top: 0.6rem;
}

.message-list {
  display: grid;
  gap: var(--feed-gap);
}

.wallet-dashboard .dash-card {
  min-height: 8.4rem;
}

.wallet-checkout-card {
  border-color: rgba(242, 204, 123, 0.34);
}

.wallet-form {
  display: grid;
  gap: 0.75rem;
}

.wallet-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wallet-quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wallet-quick {
  min-width: 2.8rem;
  justify-content: center;
}

.wallet-provider-group {
  margin: 0;
  border: 1px solid rgba(138, 232, 255, 0.2);
  border-radius: 0.85rem;
  padding: 0.65rem 0.8rem;
  display: grid;
  gap: 0.45rem;
}

.wallet-provider-group legend {
  padding: 0 0.35rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
}

.wallet-provider-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.wallet-provider-group input[type="radio"] {
  accent-color: var(--cyan);
}

.wallet-estimate {
  display: grid;
  gap: 0.35rem;
  border: 1px solid rgba(63, 240, 178, 0.2);
  border-radius: 0.85rem;
  padding: 0.65rem 0.8rem;
  background: rgba(63, 240, 178, 0.06);
}

.wallet-estimate p {
  margin: 0;
  color: var(--text);
  font-size: 0.85rem;
}

.wallet-swipe-wrap {
  display: grid;
  gap: 0.35rem;
}

.wallet-swipe-wrap label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold);
}

.wallet-swipe-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--emerald);
}

.wallet-result {
  margin-top: 0.75rem;
  border: 1px solid rgba(138, 232, 255, 0.24);
  border-radius: 0.9rem;
  padding: 0.7rem 0.8rem;
  background: rgba(8, 13, 22, 0.72);
}

.wallet-result p {
  margin: 0 0 0.45rem;
}

.wallet-history {
  display: grid;
  gap: 0.45rem;
}

.wallet-history-item {
  display: grid;
  grid-template-columns: minmax(5rem, 1fr) minmax(5rem, 1fr) minmax(5rem, 1fr) minmax(9rem, 1.3fr);
  gap: 0.45rem;
  align-items: center;
  border: 1px solid rgba(138, 232, 255, 0.16);
  border-radius: 0.75rem;
  padding: 0.55rem 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.wallet-history-item strong {
  color: var(--text);
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .wallet-grid {
    grid-template-columns: 1fr;
  }

  .wallet-history-item {
    grid-template-columns: 1fr;
  }
}

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid rgba(138, 232, 255, 0.1);
  background: rgba(5, 9, 16, 0.55);
}

.footer-inner {
  max-width: 74rem;
  margin: 0 auto;
  display: grid;
  gap: 0.75rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.footer-links a {
  color: var(--cyan);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
}

.footer-links a:hover { text-decoration: underline; }

.footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  max-width: 40rem;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 50;
  transform: translateX(-50%);
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(138, 232, 255, 0.35);
  border-radius: 999px;
  background: rgba(13, 20, 33, 0.95);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 0.5rem 2rem var(--shadow), 0 0 1.2rem rgba(138, 232, 255, 0.2);
  backdrop-filter: blur(12px);
  max-width: min(92vw, 28rem);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Motion ── */
body.motion-reduced .cog-body,
body.motion-reduced .bg-cog img,
body.motion-reduced .bg-cog-body,
body.motion-reduced .bg-cog-glow {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

/* ── Responsive ── */
@media (min-width: 1100px) {
  .brand-logo--mark { display: none; }
  .brand-logo--full { display: block; }
  .brand-text { display: none; }
}

@media (max-width: 1439px) and (min-width: 1320px) {
  /* One command rail. Full labels return at 1440px, where they fit without wrapping Console. */
  .top-actions { flex-wrap: nowrap; gap: 0.28rem; }
  .top-actions .icon-button {
    padding: 0.4rem 0.48rem;
    gap: 0.25rem;
    font-size: 0.76rem;
  }
}

@media (max-width: 1319px) {
  /* Hide text labels only; emoji icon spans (.btn-icon) must stay visible or the button renders blank. */
  .icon-button span:not(.sr-only):not(.notif-count):not(.btn-icon) { display: none; }
  .icon-button { padding: 0.55rem; }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "brand profile"
      "search search"
      "actions actions";
  }
  .brand { grid-area: brand; }
  .profile-context,
  .asset-backed-profile-context,
  .asset_backed_profile_context { grid-area: profile; width: auto; justify-self: end; }
  .search,
  .asset-backed-search,
  .asset_backed_search { grid-area: search; }
  .top-actions {
    grid-area: actions;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.28rem;
    overflow-x: auto;
    width: 100%;
  }
  .top-actions .icon-button { padding: 0.4rem; }
  .side-panel > .panel-tab {
    top: auto;
    bottom: 1.15rem;
  }
  .machine-shell { padding-left: 2.5rem; padding-top: 1.25rem; }
  .cog-bar {
    grid-template-columns: repeat(4, 1fr);
    top: auto;
    position: relative;
  }
  .cog:nth-child(n+5) { display: none; }
  .scroll-controller {
    width: 1.05rem;
    left: 0.35rem;
    top: 8rem;
  }
  .hero-card h1 { font-size: clamp(1.55rem, 7vw, 2.4rem); }
  .notifications-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
  }
}

@media (max-width: 480px) {
  .side-panel {
    inset: 4.5rem auto 0.5rem 0;
    width: min(17.5rem, 90vw);
  }
  .profile-context strong { font-size: 0.8rem; }
  .composer-foot { flex-direction: column; align-items: stretch; }
  .composer-foot .glow-button { justify-content: center; }
  .quick-nav { gap: 0.35rem; }
}

/* ── Polish: feed enter, composer, filters, toast, back-to-top ── */

.feed--enter > * {
  animation: card-rise 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.feed--enter > *:nth-child(1) { animation-delay: 0ms; }
.feed--enter > *:nth-child(2) { animation-delay: 40ms; }
.feed--enter > *:nth-child(3) { animation-delay: 80ms; }
.feed--enter > *:nth-child(4) { animation-delay: 120ms; }
.feed--enter > *:nth-child(5) { animation-delay: 160ms; }
.feed--enter > *:nth-child(6) { animation-delay: 200ms; }
.feed--enter > *:nth-child(7) { animation-delay: 240ms; }
.feed--enter > *:nth-child(8) { animation-delay: 280ms; }
.feed--enter > *:nth-child(9) { animation-delay: 320ms; }
.feed--enter > *:nth-child(10) { animation-delay: 360ms; }
.feed--enter > *:nth-child(n+11) { animation-delay: 400ms; }

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(0.7rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quick-nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(138, 232, 255, 0.22);
  color: var(--text);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.quick-chip:hover,
.quick-chip:focus-visible {
  border-color: rgba(138, 232, 255, 0.55);
  box-shadow: 0 0 0.9rem rgba(138, 232, 255, 0.22);
  outline: none;
}

.quick-chip.active {
  border-color: rgba(242, 204, 123, 0.55);
  background: rgba(242, 204, 123, 0.12);
  color: var(--gold);
}

.composer-card {
  position: relative;
  border: 1px solid rgba(63, 240, 178, 0.28);
  border-radius: 1.4rem;
  padding: var(--card-pad);
  background:
    linear-gradient(155deg, rgba(63, 240, 178, 0.08), rgba(13, 20, 33, 0.9)),
    var(--panel);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.28), 0 0 1.5rem rgba(63, 240, 178, 0.08);
  overflow: hidden;
}

.composer-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.composer-head h2 {
  margin: 0;
  font-size: 1rem;
}

.composer-input {
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  border: 1px solid rgba(138, 232, 255, 0.22);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  color: var(--text);
  background: rgba(5, 9, 16, 0.55);
  font: inherit;
  line-height: 1.55;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.composer-input:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 1.2rem rgba(63, 240, 178, 0.22);
}

.composer-input::placeholder {
  color: rgba(169, 183, 198, 0.7);
}

.composer-input--single {
  min-height: auto;
  margin-top: 0.65rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.composer-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.feed-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.15rem 0.1rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip {
  border: 1px solid rgba(138, 232, 255, 0.22);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  border-color: rgba(138, 232, 255, 0.5);
  color: var(--text);
  outline: none;
}

.filter-chip.active {
  color: #041018;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  box-shadow: 0 0 1rem rgba(138, 232, 255, 0.35);
}

.feed-meta-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.feed-meta-line a {
  color: var(--cyan);
  text-decoration: none;
}

.feed-meta-line a:hover { text-decoration: underline; }

.post-local-tag {
  color: var(--emerald);
  font-weight: 800;
}

.post-action {
  width: auto;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 999px;
}

.action-count {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  min-width: 0.9rem;
}

.post-action.liked .action-count { color: var(--rose); }

.post-photo {
  margin-top: 0.8rem;
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(138, 232, 255, 0.25);
  object-fit: cover;
  max-height: min(26rem, 60vh);
  background: rgba(5, 9, 16, 0.45);
}

.post-action.pop {
  animation: action-pop 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes action-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.post-card--spotlight {
  border-color: rgba(242, 204, 123, 0.55);
  box-shadow: 0 0 0 1px rgba(242, 204, 123, 0.25), 0 1rem 3rem rgba(242, 204, 123, 0.12);
  animation: spotlight-pulse 1.6s ease-in-out 2;
}

@keyframes spotlight-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(242, 204, 123, 0.25), 0 1rem 3rem rgba(242, 204, 123, 0.1); }
  50% { box-shadow: 0 0 0 2px rgba(242, 204, 123, 0.45), 0 1rem 3rem rgba(242, 204, 123, 0.22); }
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0.55rem currentColor;
  flex-shrink: 0;
}

.status-chip--ok .status-dot {
  animation: status-pulse 2.2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.search-hit.is-active,
.search-hit:focus-visible {
  background: rgba(138, 232, 255, 0.14);
  outline: none;
}

.help-card {
  cursor: default;
}

.help-card summary {
  list-style: none;
  cursor: pointer;
}

.help-card summary::-webkit-details-marker { display: none; }

.help-card summary h2 {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 1.05rem;
}

.help-card summary h2::after {
  content: "+";
  color: var(--cyan);
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.help-card[open] summary h2::after {
  content: "–";
}

.help-card p {
  margin: 0.75rem 0 0;
}

.empty-state-card {
  text-align: left;
  border-style: dashed;
}

.profile-orb {
  animation: orb-breathe 4.5s ease-in-out infinite;
}

@keyframes orb-breathe {
  0%, 100% { box-shadow: 0 0 0.8rem rgba(138, 232, 255, 0.2); }
  50% { box-shadow: 0 0 1.2rem rgba(138, 232, 255, 0.42), 0 0 1.8rem rgba(164, 107, 255, 0.18); }
}

.toast {
  opacity: 0;
  transform: translateX(-50%) translateY(0.8rem);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.toast.toast--in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast[data-tone="ok"] {
  border-color: rgba(63, 240, 178, 0.45);
  box-shadow: 0 0.5rem 2rem var(--shadow), 0 0 1.2rem rgba(63, 240, 178, 0.22);
}

.toast[data-tone="warn"] {
  border-color: rgba(255, 119, 168, 0.45);
  box-shadow: 0 0.5rem 2rem var(--shadow), 0 0 1.2rem rgba(255, 119, 168, 0.22);
}

.back-to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.25rem;
  z-index: 40;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgba(138, 232, 255, 0.35);
  border-radius: 50%;
  color: var(--text);
  background: rgba(13, 20, 33, 0.92);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.35), 0 0 1rem rgba(138, 232, 255, 0.2);
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 200ms ease, transform 200ms ease, box-shadow 160ms ease;
  pointer-events: none;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  box-shadow: 0 0 1.4rem rgba(138, 232, 255, 0.4);
  outline: none;
}

.cog-bar .cog {
  border-radius: 50%;
}

.cog.active::after {
  content: "";
  position: absolute;
  bottom: -0.15rem;
  left: 50%;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0.6rem rgba(242, 204, 123, 0.7);
  transform: translateX(-50%);
  z-index: 5;
}

body.motion-reduced .feed--enter > *,
body.motion-reduced .post-action.pop,
body.motion-reduced .profile-orb,
body.motion-reduced .status-chip--ok .status-dot,
body.motion-reduced .post-card--spotlight {
  animation: none !important;
}

body.motion-reduced .toast {
  opacity: 1;
  transform: translateX(-50%);
}

.hero-card {
  background:
    linear-gradient(145deg, rgba(138, 232, 255, 0.06), transparent 45%),
    var(--panel);
}

.character-card:hover,
.market-card:hover,
.entity-card:hover {
  border-color: rgba(138, 232, 255, 0.35);
  box-shadow: 0 0 1.4rem rgba(138, 232, 255, 0.12);
}

.character-card,
.market-card,
.entity-card {
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

@media (hover: hover) {
  .character-card:hover,
  .market-card:hover {
    transform: translateY(-2px);
  }
}

/* ── Centre AI cog + zone state machine ── */
.centre-ai-cog,
.centre_ai_cog {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  margin: 0 auto 1.1rem;
  max-width: 14rem;
  padding: 0.75rem 0.85rem 0.9rem;
  border: 1px solid var(--weld-trim-cyan);
  border-radius: 1.35rem;
  background:
    var(--asset-base, none),
    var(--weld-glass),
    rgba(5, 9, 16, 0.78);
  background-size: cover, auto, auto;
  box-shadow: var(--weld-bevel), 0 0.75rem 2rem rgba(0, 0, 0, 0.28);
}

.centre-ai-cog-machine {
  position: relative;
  width: min(7.5rem, 28vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.centre-ai-cog-machine .cog-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.centre-ai-cog-machine .cog-body {
  z-index: 2;
  animation: cog-spin var(--cog-spin-duration) linear infinite;
}

.centre-ai-cog-machine .cog-center {
  z-index: 3;
  width: 52%;
  height: 52%;
  inset: auto;
}

.centre-ai-cog-machine .cog-glass {
  z-index: 4;
  opacity: 0.55;
  mix-blend-mode: screen;
}

.centre-ai-cog-machine .cog-glow {
  z-index: 1;
  opacity: 0.55;
}

.ai-zone-ring {
  position: absolute;
  inset: 4%;
  z-index: 5;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
  box-shadow: 0 0 0.8rem transparent;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.ai-zone-status {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--muted);
  max-width: 100%;
  line-height: 1.35;
}

/* Zone visual states — dual hyphen/underscore class aliases */
.centre-ai-cog.ai-zone-red,
.centre-ai-cog.ai_zone_red,
.centre_ai_cog.ai-zone-red,
.centre_ai_cog.ai_zone_red {
  border-color: rgba(255, 119, 168, 0.5);
  box-shadow: var(--weld-bevel), 0 0 1.2rem rgba(255, 119, 168, 0.18);
}
.centre-ai-cog.ai-zone-red .ai-zone-ring,
.centre-ai-cog.ai_zone_red .ai-zone-ring,
.centre_ai_cog.ai-zone-red .ai-zone-ring,
.centre_ai_cog.ai_zone_red .ai-zone-ring {
  border-color: rgba(255, 119, 168, 0.75);
  box-shadow: 0 0 1rem rgba(255, 119, 168, 0.45);
}
.centre-ai-cog.ai-zone-red .ai-zone-status,
.centre-ai-cog.ai_zone_red .ai-zone-status { color: var(--rose); }

.centre-ai-cog.ai-zone-green,
.centre-ai-cog.ai_zone_green,
.centre_ai_cog.ai-zone-green,
.centre_ai_cog.ai_zone_green {
  border-color: rgba(63, 240, 178, 0.5);
  box-shadow: var(--weld-bevel), 0 0 1.2rem rgba(63, 240, 178, 0.18);
}
.centre-ai-cog.ai-zone-green .ai-zone-ring,
.centre-ai-cog.ai_zone_green .ai-zone-ring {
  border-color: rgba(63, 240, 178, 0.8);
  box-shadow: 0 0 1rem rgba(63, 240, 178, 0.45);
}
.centre-ai-cog.ai-zone-green .ai-zone-status,
.centre-ai-cog.ai_zone_green .ai-zone-status { color: var(--emerald); }

.centre-ai-cog.ai-zone-yellow,
.centre-ai-cog.ai_zone_yellow,
.centre_ai_cog.ai-zone-yellow,
.centre_ai_cog.ai_zone_yellow {
  border-color: rgba(242, 204, 123, 0.55);
  box-shadow: var(--weld-bevel), 0 0 1.2rem rgba(242, 204, 123, 0.2);
}
.centre-ai-cog.ai-zone-yellow .ai-zone-ring,
.centre-ai-cog.ai_zone_yellow .ai-zone-ring {
  border-color: rgba(242, 204, 123, 0.85);
  box-shadow: 0 0 1rem rgba(242, 204, 123, 0.5);
}
.centre-ai-cog.ai-zone-yellow .ai-zone-status,
.centre-ai-cog.ai_zone_yellow .ai-zone-status { color: var(--gold); }

.centre-ai-cog.ai-zone-blocked-ring,
.centre-ai-cog.ai_zone_blocked_ring,
.centre_ai_cog.ai-zone-blocked-ring,
.centre_ai_cog.ai_zone_blocked_ring {
  border-color: rgba(169, 183, 198, 0.45);
  opacity: 0.92;
}
.centre-ai-cog.ai-zone-blocked-ring .ai-zone-ring,
.centre-ai-cog.ai_zone_blocked_ring .ai-zone-ring {
  border-color: rgba(169, 183, 198, 0.7);
  border-style: dashed;
  box-shadow: 0 0 0.6rem rgba(169, 183, 198, 0.25);
}
.centre-ai-cog.ai-zone-blocked-ring .ai-zone-status,
.centre-ai-cog.ai_zone_blocked_ring .ai-zone-status { color: var(--muted); }
.centre-ai-cog.ai-zone-blocked-ring .centre-ai-cog-machine::after,
.centre-ai-cog.ai_zone_blocked_ring .centre-ai-cog-machine::after {
  content: "";
  position: absolute;
  inset: 18%;
  z-index: 6;
  border-radius: 50%;
  border: 2px solid rgba(169, 183, 198, 0.55);
  background: rgba(5, 9, 16, 0.28);
  pointer-events: none;
}

.centre-ai-cog.ai-zone-active-console,
.centre-ai-cog.ai_zone_active_console,
.centre_ai_cog.ai-zone-active-console,
.centre_ai_cog.ai_zone_active_console {
  border-color: rgba(138, 232, 255, 0.55);
  box-shadow: var(--weld-bevel), 0 0 1.4rem rgba(138, 232, 255, 0.28), 0 0 0.8rem rgba(242, 204, 123, 0.15);
}
.centre-ai-cog.ai-zone-active-console .ai-zone-ring,
.centre-ai-cog.ai_zone_active_console .ai-zone-ring {
  border-color: rgba(138, 232, 255, 0.9);
  box-shadow: 0 0 1.2rem rgba(138, 232, 255, 0.55), 0 0 0.5rem rgba(242, 204, 123, 0.35);
}
.centre-ai-cog.ai-zone-active-console .ai-zone-status,
.centre-ai-cog.ai_zone_active_console .ai-zone-status { color: var(--cyan); }

/* ── Basil Grokanglia + Decision Audit ── */
.basil-panel,
.decision-audit-panel {
  border: 1px solid var(--weld-trim-gold);
  border-radius: 1.35rem;
  padding: var(--card-pad);
  background:
    var(--weld-glass),
    linear-gradient(160deg, rgba(19, 29, 48, 0.96), rgba(8, 13, 22, 0.94));
  box-shadow: var(--weld-bevel), 0 1rem 2.5rem rgba(0, 0, 0, 0.3);
}

.basil-panel h2,
.decision-audit-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.basil-panel .panel-lead,
.decision-audit-panel .panel-lead {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.ai-zone-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.ai-zone-btn {
  border: 1px solid rgba(138, 232, 255, 0.25);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ai-zone-btn:hover,
.ai-zone-btn:focus-visible {
  border-color: rgba(138, 232, 255, 0.55);
  color: var(--text);
  outline: none;
}

.ai-zone-btn[aria-pressed="true"] {
  color: #041018;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  box-shadow: 0 0 0.9rem rgba(138, 232, 255, 0.3);
}

.ai-zone-btn[data-zone="waiting_red"][aria-pressed="true"] {
  background: linear-gradient(135deg, #ff77a8, #ff9a7a);
}
.ai-zone-btn[data-zone="research_green"][aria-pressed="true"] {
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
}
.ai-zone-btn[data-zone="review_yellow"][aria-pressed="true"] {
  background: linear-gradient(135deg, var(--gold), #f0a86a);
  color: #1a1206;
}
.ai-zone-btn[data-zone="blocked_ring"][aria-pressed="true"] {
  background: linear-gradient(135deg, #8a96a6, #6a7484);
  color: #0b1018;
}
.ai-zone-btn[data-zone="active_console"][aria-pressed="true"] {
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  color: #081018;
}

.audit-form {
  display: grid;
  gap: 0.7rem;
}

.audit-field {
  display: grid;
  gap: 0.3rem;
}

.audit-field label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.03em;
}

.audit-field input,
.audit-field textarea,
.audit-field select {
  width: 100%;
  border: 1px solid rgba(138, 232, 255, 0.22);
  border-radius: 0.75rem;
  padding: 0.65rem 0.8rem;
  color: var(--text);
  background: rgba(5, 9, 16, 0.55);
  font: inherit;
  outline: none;
}

.audit-field textarea {
  min-height: 4.2rem;
  resize: vertical;
  line-height: 1.5;
}

.audit-field input:focus,
.audit-field textarea:focus,
.audit-field select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0.9rem rgba(138, 232, 255, 0.22);
}

.audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.85rem 0 0.55rem;
}

.audit-toolbar input[type="search"] {
  flex: 1 1 10rem;
  min-width: 8rem;
  border: 1px solid rgba(138, 232, 255, 0.22);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  color: var(--text);
  background: rgba(5, 9, 16, 0.55);
  font: inherit;
  outline: none;
}

.audit-toolbar select {
  border: 1px solid rgba(138, 232, 255, 0.22);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  background: rgba(5, 9, 16, 0.55);
  font: inherit;
}

.audit-history {
  display: grid;
  gap: 0.55rem;
  max-height: 22rem;
  overflow: auto;
  margin-top: 0.35rem;
  padding-right: 0.15rem;
}

.audit-item {
  border: 1px solid rgba(138, 232, 255, 0.16);
  border-radius: 0.9rem;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 0.3rem;
}

.audit-item-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: space-between;
}

.audit-item-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  word-break: break-word;
}

.audit-item-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.audit-item-body {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.audit-item-actions button {
  border: 1px solid rgba(138, 232, 255, 0.28);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.audit-item-actions button:hover,
.audit-item-actions button:focus-visible {
  border-color: var(--cyan);
  outline: none;
}

.audit-empty {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.preview-note {
  border-left: 3px solid var(--gold);
  padding-left: 0.75rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.panel-tab {
  border: 1px solid var(--weld-trim-cyan);
  box-shadow: var(--weld-bevel), 0 0 1rem rgba(138, 232, 255, 0.22);
}

body.motion-reduced .centre-ai-cog-machine .cog-body {
  animation: none !important;
}

body.mechanical-mode .cog-bar {
  border-color: rgba(242, 204, 123, 0.35);
  box-shadow: 0 0 1.6rem rgba(138, 232, 255, 0.2), 0 0 2rem rgba(242, 204, 123, 0.12);
}

body.mechanical-mode .centre-ai-cog,
body.mechanical-mode .centre_ai_cog {
  box-shadow: var(--weld-bevel), 0 0 1.6rem rgba(138, 232, 255, 0.28);
}

body.basil-mode .console {
  border-color: rgba(212, 184, 255, 0.65);
  box-shadow: var(--weld-bevel), 0 0 1.3rem rgba(212, 184, 255, 0.28);
}

#basil-chat-log {
  margin-top: 0.75rem;
  max-height: 14rem;
  overflow: auto;
}

/* Mobile polish under 760px */
@media (max-width: 760px) {
  .centre-ai-cog,
  .centre_ai_cog {
    max-width: min(11.5rem, 70vw);
    padding: 0.55rem 0.6rem 0.65rem;
    margin-bottom: 0.85rem;
  }

  .centre-ai-cog-machine {
    width: min(5.5rem, 34vw);
  }

  .ai-zone-status {
    font-size: 0.7rem;
  }

  .scroll-controller,
  .asset-scroll-controller {
    display: none;
  }

  .machine-shell {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .basil-panel,
  .decision-audit-panel {
    padding: 0.9rem;
  }

  .ai-zone-selector {
    gap: 0.3rem;
  }

  .ai-zone-btn {
    font-size: 0.7rem;
    padding: 0.35rem 0.55rem;
  }

  .audit-history {
    max-height: 16rem;
  }

  .audit-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .audit-toolbar input[type="search"],
  .audit-toolbar select {
    width: 100%;
  }

  .topbar {
    gap: 0.55rem;
  }

  .profile-context,
  .asset-backed-profile-context,
  .asset_backed_profile_context {
    max-width: 100%;
  }

  .cog-bar {
    gap: 0.3rem;
    padding: 0.55rem;
    margin-bottom: 0.85rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   UI control state machine — every interactive piece gets base / hover /
   focus / pressed / active-selected / disabled feedback (spit-polish 2026-07-10)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --ui-press-scale: 0.97;
  --ui-hover-glow: 0 0 1.1rem rgba(138, 232, 255, 0.32);
  --ui-active-glow: 0 0 1.4rem rgba(242, 204, 123, 0.34), 0 0 1.8rem rgba(138, 232, 255, 0.22);
  --ui-focus-ring: 0 0 0 2px rgba(8, 14, 24, 0.9), 0 0 0 4px rgba(138, 232, 255, 0.72);
  --ui-disabled-opacity: 0.42;
}

/* Universal press flash (driven by .is-pressing from JS) */
button.is-pressing,
a.is-pressing,
.icon-button.is-pressing,
.glow-button.is-pressing,
.asset-button.is-pressing,
.asset_button.is-pressing,
.filter-chip.is-pressing,
.quick-chip.is-pressing,
.ai-zone-btn.is-pressing,
.post-action.is-pressing,
.panel-tab.is-pressing,
.back-to-top.is-pressing,
.cog.is-pressing,
.search-hit.is-pressing,
.wallet-quick.is-pressing,
.audit-item-actions button.is-pressing,
.notif-clear.is-pressing {
  transform: translateY(1px) scale(var(--ui-press-scale));
  filter: brightness(1.08);
}

/* Shared disabled treatment for all primary controls */
.icon-button:disabled,
.glow-button:disabled,
.asset-button:disabled,
.asset_button:disabled,
.filter-chip:disabled,
.ai-zone-btn:disabled,
.post-action:disabled,
button:disabled,
.icon-button[aria-disabled="true"],
.glow-button[aria-disabled="true"],
.asset-button[aria-disabled="true"],
a[aria-disabled="true"] {
  opacity: var(--ui-disabled-opacity);
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(0.25);
}

/* Selected / ON / expanded states for switch-like controls */
.glow-button[aria-pressed="true"],
.icon-button[aria-pressed="true"],
.asset-button[aria-pressed="true"]:not(.post-action),
.asset_button[aria-pressed="true"]:not(.post-action),
.filter-chip[aria-pressed="true"],
.quick-chip[aria-pressed="true"],
.ai-zone-btn[aria-pressed="true"] {
  box-shadow: var(--ui-active-glow);
}

.glow-button[aria-pressed="true"] {
  border-color: rgba(63, 240, 178, 0.62);
  background-image:
    var(--asset-active, var(--asset-base, none)),
    linear-gradient(145deg, rgba(63, 240, 178, 0.22), rgba(138, 232, 255, 0.08) 55%, rgba(19, 29, 48, 0.95));
  color: var(--text);
}

.glow-button[aria-pressed="false"] {
  opacity: 0.92;
}

.icon-button[aria-expanded="true"],
.notifications-btn[aria-expanded="true"] {
  border-color: rgba(242, 204, 123, 0.72);
  box-shadow: var(--weld-bevel), 0 0 1.2rem rgba(242, 204, 123, 0.28);
  background-image:
    var(--asset-active, var(--asset-pressed, var(--asset-base, none))),
    linear-gradient(145deg, rgba(242, 204, 123, 0.18), transparent 60%),
    var(--weld-metal);
}

/* Focus rings for chip/button families that only had border shifts */
.filter-chip:focus-visible,
.quick-chip:focus-visible,
.ai-zone-btn:focus-visible,
.wallet-quick:focus-visible,
.notif-clear:focus-visible,
.audit-item-actions button:focus-visible,
.back-to-top:focus-visible,
.panel-tab:focus-visible,
.cog:focus-visible,
.search-hit:focus-visible {
  outline: none;
  box-shadow: var(--ui-focus-ring), var(--ui-hover-glow);
}

/* Active / pressed for chips & zone buttons */
.filter-chip:active,
.quick-chip:active,
.ai-zone-btn:active,
.wallet-quick:active,
.audit-item-actions button:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: 0 0 0.9rem rgba(138, 232, 255, 0.4);
}

.filter-chip.active:active,
.filter-chip[aria-pressed="true"]:active,
.quick-chip.active:active {
  filter: brightness(1.06);
}

/* Post actions — dedicated feed-action SVG icons with full state set */
.post-action.asset-button,
.post-action.asset_button {
  width: auto;
  min-width: 2.55rem;
  height: 2.55rem;
  min-height: 2.55rem;
  border-radius: 999px;
  padding: 0 0.4rem;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.12), transparent 55%),
    rgba(8, 13, 22, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0.55rem rgba(138, 232, 255, 0.12);
}

.post-action.asset-button img,
.post-action.asset_button img {
  width: 1.55rem;
  height: 1.55rem;
}

.post-action:hover,
.post-action:focus-visible {
  border-color: rgba(138, 232, 255, 0.62);
  box-shadow: 0 0 1rem rgba(138, 232, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.post-action:active,
.post-action.is-pressing {
  transform: scale(0.9);
  box-shadow: 0 0 1.2rem rgba(138, 232, 255, 0.5);
}

.post-action.liked,
.post-action[aria-pressed="true"][data-action="like"] {
  border-color: rgba(255, 119, 168, 0.65);
  background: radial-gradient(circle at 50% 40%, rgba(255, 119, 168, 0.28), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 1.1rem rgba(255, 119, 168, 0.42);
}

.post-action.saved,
.post-action[aria-pressed="true"][data-action="save"] {
  border-color: rgba(242, 204, 123, 0.65);
  background: radial-gradient(circle at 50% 40%, rgba(242, 204, 123, 0.24), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 1.1rem rgba(242, 204, 123, 0.38);
}

.post-action[data-action="report"]:hover,
.post-action[data-action="report"]:focus-visible {
  border-color: rgba(255, 119, 168, 0.55);
  box-shadow: 0 0 0.9rem rgba(255, 119, 168, 0.28);
}

/* Notif clear */
.notif-clear {
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  border: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.notif-clear:hover,
.notif-clear:focus-visible {
  color: var(--text);
  border-color: rgba(138, 232, 255, 0.4);
  background: rgba(138, 232, 255, 0.08);
  outline: none;
}

.notif-clear:active {
  transform: scale(0.96);
}

/* Panel hatch handle — full states */
.panel-tab {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.panel-tab:hover,
.panel-tab:focus-visible {
  border-color: rgba(242, 204, 123, 0.55);
  box-shadow: var(--weld-bevel), 0 0 1.3rem rgba(138, 232, 255, 0.4);
  background:
    var(--asset-hover, var(--asset-base, none)),
    rgba(138, 232, 255, 0.2);
  outline: none;
}

.panel-tab:active,
.panel-tab.is-pressing {
  transform: scale(0.94);
  box-shadow: 0 0 1.5rem rgba(242, 204, 123, 0.4);
  background:
    var(--asset-pressed, var(--asset-base, none)),
    rgba(242, 204, 123, 0.16);
}

.side-panel.open .panel-tab {
  border-color: rgba(63, 240, 178, 0.55);
  box-shadow: 0 0 1.2rem rgba(63, 240, 178, 0.35);
}

/* Scroll controller — hover + active drag already; add idle hover */
.scroll-controller:hover {
  border-color: rgba(138, 232, 255, 0.55);
  box-shadow: var(--weld-bevel), 0 0 1rem rgba(138, 232, 255, 0.28);
}

.scroll-controller:hover .scroll-handle,
.scroll-controller:focus-visible .scroll-handle {
  box-shadow: 0 0 1.2rem rgba(138, 232, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.scroll-controller.dragging .scroll-handle {
  transform: scaleX(1.08);
}

/* Cogs */
.cog {
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.cog:hover .cog-center,
.cog:focus-visible .cog-center {
  filter: brightness(1.12);
}

/* Back to top */
.back-to-top:active,
.back-to-top.is-pressing {
  transform: translateY(0) scale(0.94);
  box-shadow: 0 0 1.6rem rgba(138, 232, 255, 0.55);
}

/* Search hits */
.search-hit:active {
  transform: scale(0.99);
  background: rgba(138, 232, 255, 0.16);
}

/* Wallet quick amounts */
.wallet-quick {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.wallet-quick:hover,
.wallet-quick:focus-visible {
  border-color: rgba(242, 204, 123, 0.55);
  box-shadow: 0 0 0.9rem rgba(242, 204, 123, 0.25);
  outline: none;
}

.wallet-quick:active {
  transform: scale(0.96);
}

/* Form fields — hover + disabled */
.audit-field input:hover,
.audit-field textarea:hover,
.audit-field select:hover,
.audit-toolbar input[type="search"]:hover,
.audit-toolbar select:hover,
.composer-input:hover,
.search input:hover {
  border-color: rgba(138, 232, 255, 0.42);
}

.audit-field input:disabled,
.audit-field textarea:disabled,
.audit-field select:disabled,
.composer-input:disabled,
.search input:disabled {
  opacity: var(--ui-disabled-opacity);
  cursor: not-allowed;
}

/* Audit mini-buttons */
.audit-item-actions button {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.audit-item-actions button:active {
  transform: scale(0.96);
}

/* Toast tone polish when feedback fires */
.toast[data-tone="ok"] {
  border-color: rgba(63, 240, 178, 0.45);
  box-shadow: 0 0 1.4rem rgba(63, 240, 178, 0.22);
}

.toast[data-tone="warn"] {
  border-color: rgba(255, 119, 168, 0.45);
  box-shadow: 0 0 1.4rem rgba(255, 119, 168, 0.22);
}

/* Reduced motion: keep state colors, drop motion-heavy transforms */
@media (prefers-reduced-motion: reduce) {
  button.is-pressing,
  a.is-pressing,
  .icon-button.is-pressing,
  .glow-button.is-pressing,
  .asset-button.is-pressing,
  .filter-chip.is-pressing,
  .quick-chip.is-pressing,
  .ai-zone-btn.is-pressing,
  .post-action.is-pressing,
  .panel-tab.is-pressing,
  .back-to-top.is-pressing,
  .cog.is-pressing {
    transform: none;
  }
}

body.motion-reduced button.is-pressing,
body.motion-reduced a.is-pressing,
body.motion-reduced .is-pressing {
  transform: none !important;
  filter: brightness(1.1);
}

/* ── Character / person consistency pack ── */
.character-consistency-panel {
  display: grid;
  gap: 0.85rem;
}

.char-pack-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.char-pack-head h2 {
  margin: 0 0 0.35rem;
}

.char-pack-badge {
  margin: 0;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(138, 232, 255, 0.28);
  background: rgba(5, 9, 16, 0.55);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.char-pack-badge--ready {
  border-color: rgba(63, 240, 178, 0.55);
  color: var(--emerald);
  box-shadow: 0 0 0.9rem rgba(63, 240, 178, 0.22);
}

.char-pack-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .char-pack-fields {
    grid-template-columns: 1.4fr 0.8fr;
  }
}

.char-section-title {
  margin: 0.5rem 0 0.15rem;
  font-size: 1rem;
  color: var(--cyan);
}

.char-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.75rem;
}

.char-slot-grid--body {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.char-slot {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  border: 1px solid rgba(138, 232, 255, 0.18);
  border-radius: 1rem;
  background: rgba(5, 9, 16, 0.42);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.char-slot--filled {
  border-color: rgba(63, 240, 178, 0.35);
}

.char-slot--drop {
  border-color: rgba(242, 204, 123, 0.65);
  box-shadow: 0 0 1.1rem rgba(242, 204, 123, 0.28);
  transform: translateY(-1px);
}

.char-slot-preview {
  aspect-ratio: 1;
  border-radius: 0.75rem;
  border: 1px dashed rgba(138, 232, 255, 0.28);
  background:
    linear-gradient(145deg, rgba(138, 232, 255, 0.06), transparent 55%),
    rgba(8, 13, 22, 0.75);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.char-slot--filled .char-slot-preview {
  border-style: solid;
  border-color: rgba(63, 240, 178, 0.35);
}

.char-slot-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.char-slot-plus {
  font-size: 1.8rem;
  font-weight: 300;
  color: rgba(138, 232, 255, 0.55);
  line-height: 1;
}

.char-slot-meta {
  display: grid;
  gap: 0.15rem;
}

.char-slot-meta strong {
  font-size: 0.84rem;
}

.char-slot-meta span {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.char-slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.char-slot-actions .glow-button {
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
}

.char-slot-upload {
  cursor: pointer;
}

.char-slot-status {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
}

.char-pack-toolbar {
  margin-top: 0.35rem;
}

@media (max-width: 760px) {
  .char-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Monetization slot (placeholder until real AdSense IDs) ── */
.monetization-slot {
  position: relative;
  z-index: 2;
  max-width: 45rem;
  margin: 1.25rem auto 0;
  padding: 0 1rem 0.5rem;
}

.monetization-label {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.monetization-placeholder {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px dashed rgba(138, 232, 255, 0.28);
  border-radius: 1rem;
  background: rgba(9, 14, 24, 0.72);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.monetization-placeholder code {
  color: var(--cyan);
  font-size: 0.8em;
}

.cowlsly-ad-unit {
  display: block;
  border: 1px solid rgba(138, 232, 255, 0.18);
  border-radius: 1rem;
  background: rgba(9, 14, 24, 0.75);
  min-height: 6rem;
  overflow: hidden;
}

.monetization-slot[data-ad-ready="true"] .monetization-placeholder {
  display: none;
}

/* ── Share modal ── */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 6, 16, 0.72);
  backdrop-filter: blur(6px);
}

.share-modal[hidden] { display: none !important; }

.share-modal-box {
  width: min(26rem, 100%);
  border: 1px solid rgba(138, 232, 255, 0.28);
  border-radius: 1.2rem;
  background: rgba(8, 13, 22, 0.97);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.45), 0 0 1.4rem rgba(138, 232, 255, 0.12);
  padding: 1rem 1.1rem 1.15rem;
}

.share-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.share-modal-head h2 {
  margin: 0;
  font-size: 1rem;
}

.share-modal-close {
  border: 1px solid rgba(138, 232, 255, 0.22);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.share-modal-close:hover,
.share-modal-close:focus-visible {
  background: rgba(255, 119, 168, 0.15);
  color: var(--rose);
  outline: none;
}

.share-modal-body {
  display: grid;
  gap: 0.75rem;
}

.share-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.share-link-input {
  width: 100%;
  border: 1px solid rgba(138, 232, 255, 0.22);
  border-radius: 0.75rem;
  padding: 0.55rem 0.7rem;
  background: rgba(5, 9, 16, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}

.share-repost-btn { width: 100%; justify-content: center; }

/* ── Options menu (follow / friend / block) ── */
.options-menu {
  position: fixed;
  z-index: 55;
  min-width: 11rem;
  display: grid;
  gap: 0.15rem;
  padding: 0.4rem;
  border: 1px solid rgba(138, 232, 255, 0.25);
  border-radius: 0.9rem;
  background: rgba(8, 13, 22, 0.98);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.4);
}

.options-menu[hidden] { display: none !important; }

.options-item {
  border: 0;
  border-radius: 0.65rem;
  padding: 0.55rem 0.7rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.options-item:hover,
.options-item:focus-visible {
  background: rgba(138, 232, 255, 0.1);
  outline: none;
}

.options-item--danger { color: var(--rose); }

.options-item--danger:hover,
.options-item--danger:focus-visible {
  background: rgba(255, 119, 168, 0.12);
}

.post-options-btn {
  border: 1px solid rgba(138, 232, 255, 0.2);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.post-options-btn:hover,
.post-options-btn:focus-visible {
  border-color: rgba(138, 232, 255, 0.5);
  color: var(--text);
  outline: none;
}

/* ── Floating messages widget ── */
.msg-widget-btn {
  position: fixed;
  right: 1.1rem;
  bottom: 4.4rem;
  z-index: 45;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(138, 232, 255, 0.35);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.14), transparent 55%),
    rgba(8, 13, 22, 0.92);
  box-shadow: 0 0.4rem 1.4rem rgba(0, 0, 0, 0.35), 0 0 1rem rgba(138, 232, 255, 0.22);
  cursor: pointer;
  color: var(--text);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  /* Ensure badge anchors to the button, not the viewport. */
  isolation: isolate;
}

.msg-widget-btn:hover,
.msg-widget-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(138, 232, 255, 0.65);
  box-shadow: 0 0 1.4rem rgba(138, 232, 255, 0.4);
  outline: none;
}

.msg-widget-icon {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  display: block;
}

.msg-widget-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.15rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 900;
  line-height: 1rem;
  text-align: center;
  box-shadow: 0 0 0.5rem rgba(255, 119, 168, 0.6);
}

@media (max-width: 760px) {
  .msg-widget-btn {
    right: 0.85rem;
    bottom: 4.1rem;
  }
}

body.motion-reduced .msg-widget-btn:hover,
body.motion-reduced .msg-widget-btn:focus-visible {
  transform: none;
}
