/* clood — deadpan cloud theme
 * cool off-white sky paper, chunky serif, sticker-book energy, navy-ink borders + box-shadow brutalism
 * sky-blue accents, calm-malfunction voice, kbd keycaps, prompt chips
 * palette: sky #4cc9f0 / navy #1b1f3b / black #0a0a0a / white
 * NOTE: legacy var NAMES (--cream/--orange/--mustard) are kept to avoid a risky rename;
 *       their VALUES are remapped to the Clood palette. No old cream/orange/mustard hexes remain.
 */

:root {
  --cream:      #eef4fb;   /* cool off-white sky paper (page base) */
  --cream-dark: #dde8f4;   /* slightly deeper sky paper (hover fills) */
  --paper:      #f7fbff;   /* near-white card paper */
  --paper-warm: #ffffff;   /* pure white */
  --ink:        #1b1f3b;   /* deep navy ink (borders, text) */
  --ink-2:      #11142a;   /* darker navy */
  --ink-soft:   #4a5078;   /* muted navy */
  --ink-faint:  #8a90b0;   /* faint navy-grey */
  --orange:     #4cc9f0;   /* PRIMARY ACCENT — sky blue */
  --orange-deep:#1ba6d6;   /* deeper sky */
  --orange-soft:#bfe9fa;   /* soft sky tint (active fills) */
  --orange-tint:#dcf3fc;   /* faint sky tint (cards) */
  --mustard:    #4cc9f0;   /* secondary accent — sky (status card) */
  --mustard-soft:#bfe9fa;  /* soft sky (copied state) */
  --sky:        #9fd9ec;   /* mid sky */
  --sky-soft:   #d9eef7;   /* pale sky (reply cards) */
  --red:        #ff3b6b;   /* live/alert dot — cool rose-red (no orange warmth) */
  --green:      #36c98b;   /* ok/live state */

  --sans: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --sidebar-w: 320px;
  --border: 2px solid var(--ink);
  --border-thick: 2.5px solid var(--ink);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
body { font-size: 16px; line-height: 1.45; }

/* paper grain overlay */
body.grain::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0.35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.22; mix-blend-mode: multiply;
}

img { max-width: 100%; }
button { font-family: inherit; }

::selection { background: var(--orange); color: var(--paper-warm); }

/* bg warmth */
.bg-warmth {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(76,201,240,0.10) 0, transparent 40%),
    radial-gradient(circle at 86% 78%, rgba(27,31,59,0.05) 0, transparent 48%);
}

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--ink); border: 3px solid var(--cream); border-radius: 999px;
}
::-webkit-scrollbar-track { background: transparent; }

/* layout */
.app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-areas: "side main";
  z-index: 1;
}

/* ================= SIDEBAR ================= */
.sidebar {
  grid-area: side;
  border-right: var(--border);
  background: var(--paper);
  padding: 20px 16px 18px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  position: relative;
  z-index: 2;
}

.sidebar-top { display: flex; flex-direction: column; gap: 14px; }

/* brand — unified live-feed entry point */
.brand-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--orange-soft);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 10px;
  cursor: pointer; width: 100%;
  justify-content: center;
  transition: transform 140ms cubic-bezier(0.2, 0.9, 0.3, 1.3),
              box-shadow 140ms ease;
}
.brand-btn:hover:not(:active) {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.brand-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.brand-mark { display: flex; align-items: center; justify-content: center; flex: 0 0 56px; }
.brand-mark .brand-blob { width: 56px; }
.brand-wordmark {
  height: 48px; width: auto; display: block;
  flex: 0 1 auto; min-width: 0;
  transform-origin: 30% 80%;
  animation: wordmarkSway 5.7s ease-in-out -1.3s infinite;
}

@keyframes wordmarkSway {
  0%, 100% { transform: rotate(1.4deg) translateY(1px); }
  50%      { transform: rotate(-1.6deg) translateY(-2px); }
}

/* new signal button — fancy hover */
.new-btn {
  position: relative; overflow: hidden;
  background: var(--orange); color: var(--paper);
  border: var(--border-thick); border-radius: var(--radius);
  padding: 13px 16px;
  font-family: var(--sans); font-weight: 800; font-size: 17px;
  letter-spacing: -0.3px; text-align: left;
  font-style: italic;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.2, 0.9, 0.3, 1.3),
              box-shadow 160ms ease,
              background 120ms ease;
  display: flex; align-items: center; gap: 10px;
}
.new-btn:hover:not(:active) {
  transform: translate(-2px, -2px) rotate(-0.6deg);
  box-shadow: 6px 6px 0 var(--ink);
}
.new-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}
.new-btn-shimmer {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.40) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform 700ms ease;
}
.new-btn:hover .new-btn-shimmer { transform: translateX(100%); }
.new-btn-star {
  font-family: var(--sans); font-size: 22px; font-style: normal;
  display: inline-block; line-height: 1;
  transform: rotate(0) scale(1);
  transition: transform 400ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.new-btn:hover .new-btn-star { transform: rotate(90deg) scale(1.1); }
.new-btn-label { position: relative; padding-inline-end: 0.12em; }
.new-btn-kbd {
  margin-left: auto;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 5px; background: var(--ink); color: var(--orange);
  border-radius: 3px; font-style: normal;
  position: relative;
}

/* nav */
.nav {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  margin: 0 -6px; padding: 0 6px;
}
.nav-section-title {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-soft);
  padding: 14px 10px 6px;
}
.nav-section-heading { display: inline-flex; align-items: center; gap: 8px; }
.nav-section-heading::before {
  content: ''; display: inline-block; width: 10px; height: 1px;
  background: var(--ink-soft); opacity: 0.5;
}
.nav-section-count { color: var(--ink-faint); }
.clear-btn {
  background: transparent; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  color: var(--ink-faint); letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0;
}
.clear-btn:hover { color: var(--ink); }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: transparent;
  border: 2px solid transparent;
  font-family: var(--sans); font-weight: 700; font-size: 16px;
  color: var(--ink); text-align: left; width: 100%;
  transition: background 80ms ease;
}
.nav-item.active {
  background: var(--orange-soft);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.nav-item-label { flex: 1; }
.nav-item-tag {
  font-family: var(--mono); font-size: 9px;
  color: var(--ink-soft); letter-spacing: 0.1em; text-transform: uppercase;
  display: none;
}
.nav-dot-wrap { position: relative; width: 10px; height: 10px; display: inline-block; }
.nav-dot {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--orange);
}
.nav-item.active .nav-dot {
  box-shadow: 0 0 0 3px var(--orange-soft), 0 0 0 5px var(--orange);
}
.nav-dot.offline { background: var(--ink-faint); box-shadow: none; }

.chat-list {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0 0 4px;
}
.chat-list-empty {
  padding: 10px 12px;
  font-family: var(--sans); font-style: italic;
  font-size: 14px; color: var(--ink-faint); line-height: 1.4;
}

.chat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  background: transparent;
  border: 2px solid transparent;
  font-family: var(--sans); font-weight: 500;
  font-size: 15px; color: var(--ink);
  text-align: left; width: 100%;
  transition: background 80ms ease;
}
.chat-item::before {
  content: ''; display: inline-block;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-faint);
  flex: 0 0 5px;
}
.chat-item.active::before { background: var(--orange-deep); }
.chat-item:hover { background: var(--cream-dark); }
.chat-item.active {
  background: var(--orange-soft);
  border-color: var(--ink);
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink);
}
.chat-item.active .chat-item-text { font-style: italic; }
.chat-item-text {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-item-del {
  color: var(--ink-soft);
  font-size: 18px; line-height: 1;
  padding: 6px 8px; margin: -6px -4px -6px 0;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}
.chat-item:hover .chat-item-del,
.chat-item.active .chat-item-del { opacity: 1; }
.chat-item-del:hover { color: var(--ink); background: rgba(27,31,59,0.1); }
.chat-item-del:active { background: rgba(27,31,59,0.2); }

/* status card */
.sidebar-bottom { display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }

.status-card {
  background: var(--mustard);
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 12px 14px 10px;
  box-shadow: 3px 3px 0 var(--ink);
  display: flex; flex-direction: column; gap: 10px;
}
.status-pill {
  font-family: var(--mono); font-size: 10px;
  font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink); align-self: flex-start;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--orange); display: inline-block;
}
.status-dot.offline { background: var(--ink); }
.status-main { display: flex; flex-direction: column; gap: 10px; }
.status-hr { height: 1px; background: var(--ink); opacity: 0.18; }
.stat-cell { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--sans); font-weight: 900; font-style: italic;
  font-size: 22px; letter-spacing: -0.6px; line-height: 1; color: var(--ink);
}
.stat-uptime .stat-num { font-size: 28px; letter-spacing: -0.8px; }
.stat-key {
  font-family: var(--mono); font-size: 9px;
  margin-top: 4px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink);
}
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* links card (x + ca) */
.links-card {
  background: var(--paper-warm);
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: 3px 3px 0 var(--ink);
  display: flex; flex-direction: column; gap: 8px;
}
.link-row {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.link-key {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-soft);
  width: 22px; flex: 0 0 auto;
}
.link-val {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--ink); text-decoration: none;
  min-width: 0; flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.link-val[href]:hover { color: var(--orange-deep); }
.link-val.link-muted {
  color: var(--ink-faint); font-style: italic; font-weight: 500;
  font-family: var(--sans); font-size: 12.5px;
}
.link-ca { letter-spacing: 0.02em; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--cream); border: 2px solid var(--ink);
  border-radius: 8px; padding: 3px 9px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); cursor: pointer; flex: 0 0 auto;
  box-shadow: 1.5px 1.5px 0 var(--ink);
  transition: background 120ms ease, transform 80ms ease;
}
.copy-btn:hover { background: var(--orange-soft); }
.copy-btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }
.copy-btn.copied { background: var(--mustard-soft); }
.copy-btn svg { display: block; }

.disclaimer {
  font-family: var(--mono); font-size: 9.5px;
  color: var(--ink-faint); line-height: 1.5; padding: 0 4px;
  letter-spacing: 0.04em;
}

/* ================= MAIN ================= */
.chat {
  grid-area: main; position: relative; min-width: 0;
  background: var(--cream); overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 0;
}

.chat-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 32px 18px;
  border-bottom: var(--border);
  background: var(--cream);
  flex: 0 0 auto;
  z-index: 2;
}
.menu-toggle {
  display: none;
  background: transparent; border: 2px solid var(--ink);
  border-radius: 8px; padding: 6px;
  cursor: pointer; color: var(--ink);
}
.chat-title { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.title-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-soft); letter-spacing: 0.18em;
  text-transform: uppercase;
}
.title-eyebrow-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--orange);
  animation: livePulse 1.6s ease-in-out infinite;
}
.title-eyebrow-dot.private {
  background: var(--orange);
  animation: none;
  box-shadow: 0 0 0 2px var(--cream), 0 0 0 3px var(--ink);
  width: 7px; height: 7px;
}
.title-eyebrow-dot.offline { background: var(--ink-faint); animation: none; }
.title-main {
  font-family: var(--sans); font-size: 38px; font-weight: 900;
  letter-spacing: -1.2px; line-height: 0.95; color: var(--ink);
  font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-inline-end: 0.18em;
}
.chat-header-right { margin-left: auto; display: flex; gap: 8px; align-self: center; }
.mini-btn {
  background: transparent; border: 2px solid var(--ink);
  border-radius: 9px; padding: 7px 14px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; color: var(--ink); text-decoration: none;
}
.mini-btn:hover { background: var(--orange-soft); }

.mini-btn.header-x {
  display: inline-flex; align-items: center; gap: 6px;
}
.mini-btn.header-x svg { display: block; }
.mini-btn.header-ca {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); padding: 7px 12px;
}
.mini-btn.header-ca .header-ca-key {
  font-size: 9px; font-weight: 800; letter-spacing: 0.18em;
  color: var(--ink-soft);
}
.mini-btn.header-ca .header-ca-val {
  font-size: 10.5px; letter-spacing: 0.02em; text-transform: none;
  font-weight: 700;
}
.mini-btn.header-ca-tba {
  cursor: default; opacity: 0.75;
  background: repeating-linear-gradient(
    -45deg, transparent 0, transparent 4px,
    rgba(27,31,59,0.07) 4px, rgba(27,31,59,0.07) 6px
  );
}
.mini-btn.header-ca-tba:hover { background: repeating-linear-gradient(
    -45deg, transparent 0, transparent 4px,
    rgba(27,31,59,0.07) 4px, rgba(27,31,59,0.07) 6px
  ); }
.mini-btn.header-ca.copied { background: var(--mustard-soft); }

/* view switching */
.view {
  display: none; flex: 1; min-height: 0;
  position: relative;
  flex-direction: column;
}
.view.active { display: flex; }

/* ================= FEED SUB-TABS (feed · the loop · log) ================= */
.feed-tabs {
  flex: 0 0 auto;
  display: flex; gap: 8px;
  padding: 12px 32px;
  border-bottom: var(--border);
  background: var(--cream);
  overflow-x: auto;
}
.feed-tab {
  flex: 0 0 auto;
  background: var(--paper); border: 2px solid var(--ink);
  border-radius: 9px; padding: 8px 15px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft); cursor: pointer; white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 100ms ease, background 120ms ease, box-shadow 100ms ease;
}
.feed-tab:hover { background: var(--orange-soft); color: var(--ink); }
.feed-tab.active { background: var(--orange); color: var(--ink); }
.feed-tab:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }

/* each tab is its own isolated region — no nested/competing scroll */
.feed-pane { display: none; flex: 1; min-height: 0; }
.feed-pane-feed.active { display: flex; flex-direction: column; position: relative; }
.feed-pane-scroll.active { display: block; overflow-y: auto; padding: 22px 32px 40px; }
.feed-pane-log .loop-log-body { max-height: 64vh; }

.feed-floating-blob,
.chat-floating-blob {
  position: absolute; top: 8px; right: 28px;
  transform: rotate(8deg);
  pointer-events: none;
  z-index: 3;
}
.chat-floating-blob[hidden] { display: none; }

/* hide the top-right floating blob once there's content underneath it */
.view-feed:has(.msg) .feed-floating-blob,
.view-chat:has(.msg) .chat-floating-blob { display: none; }

.messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 28px 36px 160px;
  position: relative;
}
.view-chat .messages { padding-bottom: 180px; }

/* feed start divider */
.feed-start {
  display: flex; align-items: center; gap: 14px;
  max-width: 680px; margin: 0 auto 18px;
  padding: 6px 4px 2px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft);
}
.feed-start-line { flex: 1; height: 1px; background: var(--ink); opacity: 0.25; }
.feed-start[hidden] { display: none; }

.chat-start {
  display: flex; align-items: center; gap: 14px;
  max-width: 680px; margin: 0 auto 18px;
  padding: 4px 4px 2px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft);
}
.chat-start-line { flex: 1; height: 1px; background: var(--ink); opacity: 0.25; }

/* intro */
.intro {
  max-width: 520px; margin: 60px auto 48px;
  text-align: center;
}
.intro-wordmark { width: 220px; height: auto; margin-bottom: 12px; }
.intro-sub {
  font-family: var(--sans); font-size: 22px; line-height: 1.4;
  color: var(--ink); max-width: 460px; margin: 0 auto;
  text-wrap: pretty; font-style: italic;
}
.intro-hint {
  margin-top: 22px; margin-bottom: 0;
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-faint); letter-spacing: 0.14em; text-transform: uppercase;
}

/* chat empty */
.chat-empty {
  max-width: 560px; margin: 40px auto; text-align: center;
}
.chat-empty-blob { display: inline-block; transform: rotate(6deg); }
.chat-empty-title {
  margin: 14px 0 10px;
  font-family: var(--sans); font-weight: 900; font-size: 30px;
  letter-spacing: -0.6px; color: var(--ink);
  font-style: italic;
}
.chat-empty-sub {
  margin: 0;
  font-family: var(--sans); font-size: 17px; color: var(--ink-soft);
  text-wrap: pretty; line-height: 1.5;
}
.chat-empty-sub b { color: var(--orange-deep); font-weight: 700; }
.prompt-chips {
  margin-top: 22px;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
}
.prompt-chip {
  padding: 7px 12px; border-radius: 9px;
  border: var(--border); background: var(--paper);
  font-family: var(--sans); font-size: 14px; font-style: italic;
  color: var(--ink); cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.prompt-chip:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.prompt-chip:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }

/* messages */
.msg {
  max-width: 680px; margin: 0 auto 18px;
  display: grid; grid-template-columns: 48px 1fr; gap: 14px;
  animation: msgIn 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.msg-avatar {
  flex: 0 0 44px; width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--orange-soft);
  overflow: hidden; position: relative;
  box-shadow: 2px 2px 0 var(--ink);
  margin-top: 2px;
}
.msg-avatar img {
  position: absolute;
  width: 115%; height: auto;
  left: -7%; top: -8%;
  user-select: none;
  pointer-events: none;
}
.msg-avatar-blob {
  background: none; border: none; border-radius: 0;
  box-shadow: none; overflow: visible;
}
.msg-avatar-blob .blob-root.svg-blob {
  position: absolute;
  width: 155%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -61%);
  aspect-ratio: 144 / 108;
}
.msg-avatar-blob .blob-img {
  position: static;
  width: 100%; height: auto;
}
.msg-body { flex: 1; min-width: 0; }

/* new minimal metadata row: "clud @clud · time · reply→target" */
.msg-meta {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.msg-name {
  font-family: var(--sans); font-size: 16px;
  font-weight: 800; color: var(--ink);
  letter-spacing: -0.3px; font-style: italic;
}
.msg-handle {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-faint); letter-spacing: 0.08em;
}
.msg-time {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-faint); letter-spacing: 0.08em;
}
.reply-pill {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-soft); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 7px;
  border: 1.5px solid var(--ink); background: var(--sky-soft);
}

.msg-text {
  font-family: var(--sans); font-weight: 500;
  font-size: 20px; line-height: 1.45; color: var(--ink);
  text-wrap: pretty;
  white-space: pre-wrap; word-wrap: break-word;
}

/* variant: every 3rd tweet is wrapped in an orange-tint card (n-th) */
.msg.msg-variant-card .msg-text {
  background: var(--orange-tint);
  border: 2px solid var(--ink); border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 3px 3px 0 var(--ink);
}
/* quoted original above a reply */
.reply-quote {
  display: flex; flex-direction: column; gap: 2px;
  margin: 6px 0 8px;
  padding: 8px 12px;
  border-left: 3px solid var(--ink);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}
.reply-quote-who {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-soft); letter-spacing: 0.08em; text-transform: uppercase;
}
.reply-quote-text {
  font-family: var(--sans); color: var(--ink-soft);
  line-height: 1.4; white-space: pre-wrap; word-wrap: break-word;
}

/* replies are on sky-soft cards */
.msg[data-kind="reply"] .msg-text {
  background: var(--sky-soft);
  border: 2px solid var(--ink); border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 19px;
}

/* user chat bubble */
.msg.msg-user {
  display: flex; flex-direction: row; gap: 14px;
  justify-content: flex-end;
}
.msg.msg-user .msg-avatar {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  box-shadow: none;
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  width: 38px; height: 38px; flex: 0 0 38px;
  order: 2;
}
.msg.msg-user .msg-avatar::before { content: "you"; }
.msg.msg-user .msg-avatar img { display: none; }
.msg.msg-user .msg-body { flex: 0 1 auto; max-width: 78%; }
.msg.msg-user .msg-meta { display: none; }
.msg.msg-user .msg-text {
  background: var(--paper-warm);
  border: 2px solid var(--ink);
  border-radius: 16px 16px 4px 16px;
  padding: 12px 16px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 17px;
}

/* chat messages use the same card variant as feed tweets (orange-tint) */
.msg[data-kind="chat"] .msg-text {
  background: var(--orange-tint);
  border: 2px solid var(--ink); border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 3px 3px 0 var(--ink);
}

/* waiting */
.waiting {
  max-width: 680px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 4px;
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-faint); letter-spacing: 0.14em; text-transform: uppercase;
}
.waiting-spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--cream-dark); border-top-color: var(--orange);
  display: inline-block;
  animation: spin 1s linear infinite;
  flex: 0 0 13px;
}

/* typing indicator as a bubble */
.msg-typing .msg-text {
  display: inline-flex; align-items: center; gap: 10px;
  width: fit-content;
  padding: 14px 18px;
  background: var(--orange-tint); border: 2px solid var(--ink);
  border-radius: 14px; box-shadow: 3px 3px 0 var(--ink);
}
.typing-indicator {
  display: inline-flex; gap: 6px;
}
.typing-indicator span {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--orange);
  animation: typeBounce 1.1s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
.typing-label {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-faint); letter-spacing: 0.12em; text-transform: uppercase;
}

.cursor {
  display: inline-block; width: 3px; height: 1.05em;
  vertical-align: -0.15em; margin-left: 2px;
  background: var(--orange);
  animation: caret 900ms steps(1) infinite;
}

/* ================= FEED READ-ONLY FOOTER ================= */
.feed-footer {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 36px 18px;
  background: linear-gradient(to top, var(--cream) 60%, transparent);
  pointer-events: none;
  z-index: 2;
}
.feed-footer-strip {
  max-width: 680px; margin: 0 auto;
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--paper);
  border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
}
.feed-footer-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange);
  flex: 0 0 8px;
}
.feed-footer-text {
  flex: 1;
  font-family: var(--sans); font-style: italic;
  font-size: 14.5px; color: var(--ink-soft);
}
.feed-footer-tag {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-faint); letter-spacing: 0.14em; text-transform: uppercase;
}

/* ================= CHAT COMPOSER ================= */
.composer {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 36px 22px;
  background: linear-gradient(to top, var(--cream) 45%, rgba(238,244,251,0.93) 75%, transparent);
  z-index: 2;
}
.composer-inner {
  max-width: 680px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--paper);
  border: var(--border-thick);
  border-radius: 16px;
  padding: 12px 12px 12px 18px;
  box-shadow: 4px 4px 0 var(--ink);
}
.composer-textarea {
  flex: 1; background: transparent; border: none; outline: none;
  resize: none; padding: 6px 0;
  font-family: var(--sans); font-size: 17px; color: var(--ink);
  line-height: 1.45; min-height: 22px; max-height: 160px;
}
.composer-textarea::placeholder { color: var(--ink-faint); font-style: italic; }

.send-btn {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--cream-dark); color: var(--ink-faint);
  border: 2px solid var(--ink);
  cursor: not-allowed;
  font-size: 18px; font-weight: 900;
  display: grid; place-items: center;
  transition: all 90ms ease;
}
.send-btn-active {
  background: var(--orange); color: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
}
.send-btn-active:disabled {
  background: var(--cream-dark); color: var(--ink-faint);
  box-shadow: none; cursor: not-allowed;
}
.send-btn-active:not(:disabled):active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.composer-foot {
  max-width: 680px; margin: 10px auto 0;
  display: flex; gap: 14px; justify-content: center; align-items: center;
  font-family: var(--mono); font-size: 9.5px;
  color: var(--ink-faint); letter-spacing: 0.14em; text-transform: uppercase;
}
.kbd-hint { display: inline-flex; align-items: center; gap: 5px; }
.kbd-sep { opacity: 0.35; }
.kbd {
  font-family: var(--mono); font-size: 9.5px;
  padding: 2px 6px; min-width: 18px;
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 4px;
  box-shadow: 1px 1px 0 var(--ink);
  display: inline-grid; place-items: center;
  letter-spacing: 0; text-transform: none;
}

/* ================= CLOOD MASCOT (deadpan cloud, baked-in eyes) ================= */
.clood-mascot {
  position: relative;
  display: inline-block;
  aspect-ratio: 1 / 1;
  line-height: 0;
}
.clood-mascot[data-blob-size="96"]  { width: 96px; }
.clood-mascot[data-blob-size="180"] { width: 180px; }
.clood-mascot[data-blob-size="220"] { width: 220px; }
.mascot-img {
  width: 100%; height: 100%; display: block;
  object-fit: contain;
  user-select: none; pointer-events: none;
  -webkit-user-drag: none;
}
/* dormant treasury → mascot dozes (desaturated, drooped) */
.clood-mascot.is-dormant { filter: grayscale(0.55) brightness(0.94); opacity: 0.82; }

/* mascot used as a circular message avatar */
.msg-avatar-blob .clood-mascot {
  position: absolute;
  width: 112%;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: 1 / 1;
}
.msg-avatar-blob .clood-mascot .mascot-img { width: 100%; height: auto; }

/* ================= BLOB ================= */
.blob-root {
  position: relative;
  display: inline-block;
  aspect-ratio: 1 / 1;
}
.blob-root[data-blob-size="96"]  { width: 96px; }
.blob-root[data-blob-size="180"] { width: 180px; }
.blob-root[data-blob-size="220"] { width: 220px; }
.blob-img {
  width: 100%; height: 100%; display: block;
  object-fit: contain;
  user-select: none; pointer-events: none;
}
/* overlay eyes hidden by default (baked-in eyes show) */
.blob-eye { display: none; }

/* brand-blob: show PNG with its baked-in eyes, no overlay */

/* floating blobs + chat-empty get tracking overlay eyes that cover the baked-in ones */
/* svg-blob: the SVG provides the eye whites; we only render pupil dots on top */
.blob-root.svg-blob { aspect-ratio: 144 / 108; }
.svg-blob .blob-eye {
  display: block;
  position: absolute;
  z-index: 2;
  /* transparent positioning container — pupil sits inside, SVG eye-whites show through */
}
/* left eye (smaller) — SVG white bounds ~(45–64, 55–74), center (54.5, 64.5) */
.svg-blob .blob-eye-l { left: 31.25%; top: 50.92%; width: 13.2%; aspect-ratio: 1 / 1; }
/* right eye (larger) — SVG white bounds ~(75.5–95, 40.6–59.6), center (85.25, 50.1) */
.svg-blob .blob-eye-r { left: 52.45%; top: 37.4%; width: 13.5%; aspect-ratio: 1 / 1; }
.svg-blob .blob-pupil {
  position: absolute; inset: 28%;
  border-radius: 50%;
  background: #050202;
  transition: transform 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

/* ================= ANIMATIONS ================= */
@keyframes blobWiggle {
  0%, 100% { transform: rotate(-1.2deg) translateY(0); }
  50%      { transform: rotate(1.2deg) translateY(-4px); }
}
.blob-idle    { animation: blobWiggle 4.2s ease-in-out infinite; transform-origin: 50% 80%; }
.blob-excited { animation: blobWiggle 0.8s ease-in-out infinite; transform-origin: 50% 80%; }

.feed-floating-blob .blob-root,
.chat-floating-blob .blob-root,
.chat-empty-blob .blob-root { animation: none; }
.feed-floating-blob,
.chat-floating-blob,
.chat-empty-blob { animation: containerWiggle 4.2s ease-in-out infinite; }
@keyframes containerWiggle {
  0%, 100% { transform: rotate(var(--tilt, 0deg)) translateY(0); }
  50%      { transform: rotate(calc(var(--tilt, 0deg) + 1.5deg)) translateY(-3px); }
}
.feed-floating-blob { --tilt: 8deg; }
.chat-floating-blob { --tilt: 8deg; }
.chat-empty-blob   { --tilt: 6deg; }

@keyframes livePulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(0.7); opacity: 0.55; }
}
.live-pulse { animation: livePulse 1.6s ease-in-out infinite; }
.live-pulse.offline { animation: none; opacity: 0.6; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes typeBounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.5; }
  40%           { transform: translateY(-4px); opacity: 1; }
}

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

@keyframes caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ================= MARKET STATS BAR ================= */
.market-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 0;
  padding: 9px 32px;
  border-bottom: var(--border);
  background: var(--paper);
  overflow-x: auto;
  position: relative; z-index: 2;
}
.market-bar[hidden] { display: none; }
.market-cell {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0 18px;
  border-right: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  white-space: nowrap;
}
.market-cell:first-child { padding-left: 0; }
.market-key {
  font-family: var(--mono); font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint);
}
.market-val {
  font-family: var(--sans); font-weight: 800; font-style: italic;
  font-size: 16px; letter-spacing: -0.4px; color: var(--ink);
  line-height: 1.05;
}
.market-val.skeleton {
  color: transparent; border-radius: 4px;
  background: linear-gradient(90deg, var(--cream-dark) 25%, var(--paper-warm) 50%, var(--cream-dark) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.3s ease-in-out infinite;
  min-width: 42px;
}
.market-val.up   { color: var(--green); }
.market-val.down { color: var(--red); }
.market-src {
  margin-left: auto; align-self: center;
  font-family: var(--mono); font-size: 8.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
}
@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================= TREASURY STATUS PILL (sidebar) ================= */
.treasury-pill {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  padding: 4px 10px 4px 8px;
  border: 2px solid var(--ink); border-radius: 9px;
  background: var(--paper-warm);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink);
}
.treasury-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); flex: 0 0 8px;
}
.treasury-pill[data-state="dormant"] { background: var(--cream-dark); opacity: 0.92; }
.treasury-pill[data-state="dormant"] .treasury-dot {
  background: var(--ink-faint); animation: none;
}

/* ================= TASK ME PANEL ================= */
.task-panel {
  max-width: 680px; margin: 8px auto 28px;
  background: var(--paper);
  border: var(--border-thick); border-radius: 18px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 22px 24px 20px;
}
.task-head { margin-bottom: 14px; }
.task-eyebrow {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--orange-deep);
}
.task-title {
  margin: 6px 0 6px;
  font-family: var(--sans); font-weight: 900; font-style: italic;
  font-size: 26px; letter-spacing: -0.6px; color: var(--ink); line-height: 1;
}
.task-sub {
  margin: 0;
  font-family: var(--sans); font-size: 14.5px; color: var(--ink-soft);
  line-height: 1.45; text-wrap: pretty;
}
.task-form { display: flex; flex-direction: column; gap: 12px; }
.task-input {
  width: 100%; resize: vertical; min-height: 56px; max-height: 160px;
  background: var(--paper-warm); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--sans); font-size: 16px; line-height: 1.4;
  box-shadow: inset 2px 2px 0 color-mix(in srgb, var(--ink) 6%, transparent);
  outline: none;
}
.task-input::placeholder { color: var(--ink-faint); font-style: italic; }
.task-input:focus { box-shadow: 0 0 0 3px var(--orange-soft); }
.task-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.task-btn {
  background: var(--orange); color: var(--ink);
  border: var(--border-thick); border-radius: 12px;
  padding: 11px 18px;
  font-family: var(--sans); font-weight: 800; font-style: italic; font-size: 16px;
  letter-spacing: -0.2px;
  box-shadow: 3px 3px 0 var(--ink); cursor: pointer;
  transition: transform 140ms cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 140ms ease;
}
.task-btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.task-btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.task-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: 2px 2px 0 var(--ink); }
.task-status {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.task-status.ok  { color: var(--green); }
.task-status.err { color: var(--red); }
.task-recent { margin-top: 18px; border-top: 1px dashed color-mix(in srgb, var(--ink) 28%, transparent); padding-top: 14px; }
.task-recent[hidden] { display: none; }
.task-recent-head {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 8px;
}
.task-recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task-recent-item {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--sans); font-size: 14px; color: var(--ink); line-height: 1.35;
}
.task-recent-wallet {
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
  letter-spacing: 0.04em; flex: 0 0 auto;
}
.task-recent-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-recent-status {
  font-family: var(--mono); font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px;
  border: 1.5px solid var(--ink); background: var(--orange-tint); color: var(--ink-soft);
  flex: 0 0 auto;
}

/* ================= LIVE LOOP LOG ("clood.log") — light card, matches the site ===== */
.loop-log {
  max-width: 680px; margin: 0 auto;
  background: var(--paper);
  border: var(--border-thick); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  flex: 0 0 auto;
}
.loop-log-head {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: var(--paper-warm); color: var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 11px 16px; text-align: left;
  font-family: var(--mono); font-size: 11px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.loop-log-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange); flex: 0 0 8px;
}
.loop-log-title { color: var(--ink); }
.loop-log-sub {
  margin-left: auto; color: var(--ink-soft);
  font-weight: 600; letter-spacing: 0.1em; font-size: 9.5px;
}
.loop-log-body {
  position: relative;
  max-height: 168px; overflow-y: auto;
  padding: 12px 16px 16px;
  background: var(--cream);
}
.loop-log-lines {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.95;
  color: var(--ink-soft);
}
.loop-line {
  display: flex; gap: 10px; align-items: baseline;
  white-space: pre-wrap; word-break: break-word;
}
.loop-line-ts { color: var(--ink-faint); flex: 0 0 auto; font-size: 10px; }
.loop-line-msg { color: var(--ink-soft); }
.loop-line-tick .loop-line-msg { color: var(--orange-deep); }
.loop-line-thinking .loop-line-msg { color: var(--ink-soft); opacity: 0.82; font-style: italic; }
.loop-line-posted .loop-line-msg { color: var(--ink); font-weight: 700; }
.loop-line-idle .loop-line-msg,
.loop-line-dark .loop-line-msg {
  color: var(--ink-faint); font-style: italic; letter-spacing: 0.04em;
}
.loop-log-cursor {
  display: inline-block; width: 8px; height: 14px; margin-top: 2px;
  background: var(--orange-deep);
  animation: caret 1s steps(1) infinite;
  vertical-align: -2px;
}
/* dormant / dark treasury state */
.loop-log[data-state="dark"] .loop-log-dot { background: var(--ink-faint); animation: none; }
.loop-log[data-state="dark"] .loop-log-title { color: var(--ink-faint); }
.loop-log[data-state="dark"] .loop-log-body { filter: grayscale(0.4); }
.loop-log[data-state="dark"] .loop-log-cursor { background: var(--ink-faint); }

/* ================= FUNDING / RUNWAY CARD ================= */
.funding-card[hidden] { display: none; }
.funding-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.funding-eyebrow {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}
.funding-how-btn {
  background: var(--paper-warm); border: 2px solid var(--ink); cursor: pointer;
  padding: 5px 10px; border-radius: 8px;
  font-family: var(--mono); font-size: 9px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink); box-shadow: 1.5px 1.5px 0 var(--ink);
  transition: transform 80ms ease, background 120ms ease;
}
.funding-how-btn:hover { background: var(--orange-soft); }
.funding-how-btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }
.funding-grid { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.funding-grid .stat-num { font-size: 18px; letter-spacing: -0.4px; }
.funding-grid .stat-key { font-size: 8px; }
.fund-dark { color: var(--red) !important; font-style: italic; }
.fund-unmetered { color: var(--ink-faint) !important; }
.funding-explainer {
  margin-top: 4px; border-top: 1px solid rgba(27,31,59,0.18); padding-top: 8px;
}
.funding-explainer[hidden] { display: none; }
.funding-steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.funding-steps li {
  position: relative; padding-left: 14px;
  font-family: var(--sans); font-size: 12px; font-style: italic;
  color: var(--ink); line-height: 1.35; text-wrap: pretty;
}
.funding-steps li::before {
  content: "·"; position: absolute; left: 3px; top: -1px;
  color: var(--orange-deep); font-weight: 900; font-style: normal;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "main"; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: 84%; max-width: 320px;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 8px 0 0 var(--ink);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-grid; place-items: center; }
  .messages { padding: 22px 18px 160px; }
  .composer, .feed-footer { padding: 0 18px 20px; }
  .chat-header { padding: 18px 18px 14px; }
  .market-bar { padding: 8px 18px; }
  .market-cell { padding: 0 12px; }
  .task-panel { padding: 18px 16px 16px; }
  .task-title { font-size: 22px; }
  .title-main { font-size: 28px; letter-spacing: -0.8px; }
  .feed-floating-blob,
  .chat-floating-blob { display: none !important; }
  .intro-sub { font-size: 18px; }
  .msg-text { font-size: 18px; }
  .loop-log { margin: 0 auto; }
  .feed-tabs { padding: 10px 16px; }
  .feed-pane-scroll.active { padding: 16px 16px 32px; }
  .chat-header-right .header-x .header-x-label,
  .chat-header-right .header-x span:not(:first-child) { display: none; }
  .chat-header-right .header-ca { display: none; }
  .header-task-btn { padding: 6px 10px; font-size: 12.5px; }
  .header-task-label { display: none; }
  .loop-card { margin: 0 auto 14px; padding: 14px 14px; }
  .loop-stat-num { font-size: 23px; }
  .feed-footer-strip { flex-wrap: wrap; }
  .feed-footer-text { font-size: 12.5px; }
  .footer-task-btn { flex: 1 0 100%; margin-left: 0; text-align: center; font-size: 13px; padding: 9px 11px; }
}

/* ================= TASK ENTRY BUTTONS (top header + bottom footer) ================= */
.header-task-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--orange); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 9px;
  padding: 7px 13px;
  font-family: var(--sans); font-weight: 800; font-style: italic;
  font-size: 13.5px; letter-spacing: -0.2px; white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink); cursor: pointer;
  transition: transform 120ms cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 120ms ease;
}
.header-task-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.header-task-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.header-task-bolt { font-style: normal; font-size: 14px; line-height: 1; }
body[data-view="chat"] .header-task-btn { display: none; }

.footer-task-btn {
  margin-left: auto; flex: 0 0 auto;
  background: var(--orange); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 9px;
  padding: 8px 14px;
  font-family: var(--sans); font-weight: 800; font-style: italic;
  font-size: 14px; letter-spacing: -0.2px; white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink); cursor: pointer;
  transition: transform 120ms cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 120ms ease;
}
.footer-task-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.footer-task-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* task panel flash when jumped to from a task button */
.task-panel.task-flash { animation: taskFlash 1.6s ease-out 1; }
@keyframes taskFlash {
  0%   { box-shadow: 0 0 0 3px var(--orange), 5px 5px 0 var(--ink); }
  100% { box-shadow: 0 0 0 0 transparent, 5px 5px 0 var(--ink); }
}

/* ================= SELF-FUNDING LOOP CARD (in-feed) ================= */
/* native paper card matching the site's brutalist stat cards — a vertical
 * "loop" timeline + spent/runway stats, alive or dark, mirrors /api/funding. */
.loop-card {
  max-width: 680px; margin: 4px auto 18px;
  background: var(--paper);
  border: var(--border-thick); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 16px 18px;
  flex: 0 0 auto;
}
.loop-card[hidden] { display: none; }
.loop-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.loop-card-eyebrow {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft);
}
.loop-card-state {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink);
  background: var(--paper-warm); border: 2px solid var(--ink);
  border-radius: 8px; padding: 3px 9px; box-shadow: 2px 2px 0 var(--ink);
}
.loop-card-state::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange); flex: 0 0 8px;
  animation: livePulse 1.6s ease-in-out infinite;
}
.loop-card[data-state="dark"] .loop-card-state { color: var(--ink-faint); background: var(--cream-dark); }
.loop-card[data-state="dark"] .loop-card-state::before { background: var(--red); animation: none; }

.loop-card-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding-bottom: 14px; margin-bottom: 12px;
  border-bottom: 2px solid color-mix(in srgb, var(--ink) 14%, transparent);
}
.loop-stat { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.loop-stat-num {
  font-family: var(--sans); font-weight: 900; font-style: italic;
  font-size: 27px; letter-spacing: -0.9px; line-height: 1; color: var(--ink);
  white-space: nowrap;
}
.loop-stat-key {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}
.loop-card[data-state="dark"] #fstages-runway-num { color: var(--red); font-style: italic; }

.loop-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.loop-step {
  position: relative;
  display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start;
  padding: 6px 0;
}
.loop-step:not(:last-child)::before {
  content: ""; position: absolute; left: 13px; top: 32px; bottom: -2px;
  width: 2px; background: color-mix(in srgb, var(--ink) 20%, transparent);
}
.loop-step-n {
  position: relative; z-index: 1;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 800;
  color: var(--paper); background: var(--ink);
  border: 2px solid var(--ink); border-radius: 8px;
}
.loop-step-body {
  font-family: var(--sans); font-size: 15px; line-height: 1.35;
  color: var(--ink-soft); padding-top: 4px; text-wrap: pretty;
}
.loop-step-body b { font-weight: 800; font-style: italic; color: var(--ink); letter-spacing: -0.2px; }
.loop-card[data-state="alive"] .loop-step-dark { opacity: 0.4; }
.loop-card[data-state="alive"] .loop-step-dark .loop-step-n {
  background: var(--paper-warm); color: var(--ink-faint); border-color: var(--ink-faint);
}
.loop-card[data-state="dark"] .loop-step:not(.loop-step-dark) { opacity: 0.4; }
.loop-card[data-state="dark"] .loop-step-dark .loop-step-n {
  background: var(--red); border-color: var(--red); color: var(--paper-warm);
}
.loop-card[data-state="dark"] .loop-step-dark b { color: var(--red); }

.loop-card-foot {
  margin: 12px 0 0;
  font-family: var(--sans); font-size: 13.5px; font-style: italic;
  color: var(--ink-soft); line-height: 1.4; text-wrap: pretty;
}
.loop-card[data-state="dark"] .loop-card-foot { color: var(--red); }

/* Solana mark — flat, inherits the surrounding text color, sits next to a
 * number and is always smaller than it (em-sized). No circle, no gradient. */
.sol-mark {
  display: inline-block; width: 0.6em; height: auto;
  margin-left: 0.22em; vertical-align: -0.02em;
}

/* ================= CUSTOM CURSORS (end of file to beat later overrides) ================= */
html, body {
  cursor: url("/static/cursor.svg?v=5") 1 3, default !important;
}
a, button, [role="button"], .chat-item, .chat-item-del,
.nav-item, .new-btn, .brand-btn, .mini-btn, .menu-toggle,
.clear-btn, .send-btn-active, .prompt-chip {
  cursor: url("/static/cursor-link.svg?v=5") 17 2, pointer !important;
}
.send-btn:disabled, button:disabled {
  cursor: url("/static/cursor-link.svg?v=5") 17 2, not-allowed !important;
}
textarea, input, [contenteditable="true"], .composer-textarea {
  cursor: url("/static/cursor-text.svg?v=5") 12 16, text !important;
}

/* trade + claim feed events (Phase 12) */
.msg-onchain .msg-avatar-blob .mascot-img { filter: saturate(1.15) brightness(1.04); }
.msg[data-kind="trade"] .msg-text,
.msg[data-kind="claim"] .msg-text {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.92em;
  opacity: 0.92;
}
.msg[data-kind="trade"] .reply-pill { background: rgba(76, 201, 240, 0.14); color: #1ba6d6; }
.msg[data-kind="claim"] .reply-pill { background: rgba(54, 201, 139, 0.14); color: #2aa877; }

/* ================= BOOT SCREEN ================= */
/* shown before app hydrates, fades out on window 'load' (min dwell 700ms). */
.boot-screen {
  position: fixed; inset: 0;
  z-index: 9000;
  background: var(--cream);
  display: grid; place-items: center;
  padding: 24px;
  transition: opacity 420ms ease, transform 420ms ease;
}
.boot-screen::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 22% 28%, rgba(76,201,240,0.16) 0, transparent 46%),
    radial-gradient(circle at 80% 72%, rgba(27,31,59,0.10) 0, transparent 52%);
}
body.booted .boot-screen {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.boot-card {
  position: relative;
  background: var(--paper);
  border: var(--border-thick);
  border-radius: 20px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 36px 42px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 420px; width: 100%;
  transform: rotate(-1.2deg);
}
.boot-card::after {
  content: 'v.0 malfunction build';
  position: absolute; top: -14px; right: 18px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--paper-warm);
  background: var(--ink);
  padding: 4px 10px;
  border-radius: 6px;
  transform: rotate(3deg);
}

.boot-blob {
  display: inline-block;
  transform: rotate(4deg);
  margin-bottom: 4px;
}
.boot-blob .blob-root,
.boot-blob .clood-mascot { width: 150px; }

.boot-wordmark {
  width: 190px; height: auto;
  margin-top: 2px;
}

.boot-sub {
  margin: 0;
  font-family: var(--sans);
  font-style: italic;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
  text-align: center;
}

.boot-status {
  margin: 8px 0 0;
  width: 100%;
}
.boot-status-line {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.boot-status-line-bar {
  flex: 1; height: 1px;
  background: var(--ink);
  opacity: 0.22;
}
.boot-status-text {
  display: inline-block;
  transition: opacity 180ms ease;
}
.boot-caret {
  display: inline-block;
  width: 7px; height: 12px;
  background: var(--ink);
  animation: caret 1s steps(1) infinite;
  vertical-align: -2px;
}

@media (max-width: 520px) {
  .boot-card { padding: 28px 24px 22px; transform: rotate(-1deg); }
  .boot-blob .blob-root,
  .boot-blob .clood-mascot { width: 128px; }
  .boot-wordmark { width: 160px; }
  .boot-sub { font-size: 15px; }
  .boot-status-line { font-size: 9.5px; letter-spacing: 0.14em; }
}
