:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: Georgia, "Times New Roman", "Noto Serif SC", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --radius: 8px;
  --ease: 160ms ease;
}

body[data-theme="deep"] {
  --bg: #041111;
  --bg-2: #071918;
  --panel: rgba(8, 19, 20, 0.84);
  --panel-strong: rgba(14, 27, 28, 0.96);
  --ink: #f1f7f6;
  --muted: #a2b4b7;
  --soft: #6e8388;
  --line: rgba(186, 221, 221, 0.18);
  --line-strong: rgba(211, 181, 101, 0.36);
  --accent: #d7af5c;
  --accent-2: #42e7c1;
  --accent-3: #47c5ff;
  --danger: #f36d6d;
  --shadow: 0 28px 96px rgba(0, 0, 0, 0.42);
}

body[data-theme="carbon"] {
  --bg: #080806;
  --bg-2: #15130e;
  --panel: rgba(19, 18, 14, 0.86);
  --panel-strong: rgba(28, 25, 18, 0.96);
  --ink: #fbf5e7;
  --muted: #c0b5a2;
  --soft: #8a806d;
  --line: rgba(242, 212, 151, 0.17);
  --line-strong: rgba(224, 178, 88, 0.42);
  --accent: #e3b75d;
  --accent-2: #80d8b4;
  --accent-3: #d2c2a3;
  --danger: #ff7c72;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

body[data-theme="lab"] {
  --bg: #eef3f7;
  --bg-2: #f8fbfd;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --ink: #141b24;
  --muted: #5f6b78;
  --soft: #8b97a5;
  --line: rgba(31, 48, 65, 0.14);
  --line-strong: rgba(49, 112, 148, 0.36);
  --accent: #1d6c90;
  --accent-2: #0e9f83;
  --accent-3: #a06b1c;
  --danger: #bb3d3d;
  --shadow: 0 22px 70px rgba(39, 61, 80, 0.14);
}

body[data-theme="graphite"] {
  --bg: #080a0d;
  --bg-2: #111820;
  --panel: rgba(15, 19, 24, 0.86);
  --panel-strong: rgba(20, 26, 33, 0.98);
  --ink: #f4f7fb;
  --muted: #a3adba;
  --soft: #768392;
  --line: rgba(197, 211, 232, 0.16);
  --line-strong: rgba(87, 199, 255, 0.32);
  --accent: #57c7ff;
  --accent-2: #88e1b4;
  --accent-3: #d9b66f;
  --danger: #ff7676;
  --shadow: 0 28px 92px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

html {
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 4%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 30vw),
    radial-gradient(circle at 88% 20%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 32vw),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 58%, var(--bg) 100%);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.62;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--line) 50%, transparent) 1px, transparent 1px),
    linear-gradient(180deg, color-mix(in srgb, var(--line) 50%, transparent) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, black, transparent 78%);
  opacity: 0.48;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
}

textarea,
.event-stream,
.timeline,
.agent-panel {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 44%, transparent) transparent;
}

textarea::-webkit-scrollbar,
.event-stream::-webkit-scrollbar,
.timeline::-webkit-scrollbar,
.agent-panel::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

textarea::-webkit-scrollbar-track,
.event-stream::-webkit-scrollbar-track,
.timeline::-webkit-scrollbar-track,
.agent-panel::-webkit-scrollbar-track {
  background: transparent;
}

textarea::-webkit-scrollbar-thumb,
.event-stream::-webkit-scrollbar-thumb,
.timeline::-webkit-scrollbar-thumb,
.agent-panel::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 46%, transparent);
  background-clip: content-box;
}

textarea::-webkit-scrollbar-thumb:hover,
.event-stream::-webkit-scrollbar-thumb:hover,
.timeline::-webkit-scrollbar-thumb:hover,
.agent-panel::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted) 64%, transparent);
  background-clip: content-box;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
}

.brand-name {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
  font-weight: 900;
  line-height: 1;
}

.brand-slogan {
  color: var(--accent);
  font-size: clamp(0.86rem, 1.1vw, 1rem);
  font-weight: 850;
  white-space: nowrap;
}

.top-actions,
.hero-actions,
.profile-stats,
.profile-meta,
.post-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vw, 34px);
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 850;
}

.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.main-nav a::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--accent-3);
  opacity: 0;
  transform: scaleX(0.7);
  transition: opacity var(--ease), transform var(--ease);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--ink);
}

.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.icon-button,
.workbench-fab,
.primary-btn,
.secondary-btn,
.tool-button,
.timeline-tabs button,
.theme-option,
.inline-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px;
  cursor: pointer;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-strong) 82%, transparent);
  font-weight: 820;
  letter-spacing: 0;
  transition: transform var(--ease), border-color var(--ease), background var(--ease), color var(--ease);
}

.primary-btn,
.workbench-fab {
  border-color: var(--line-strong);
  color: color-mix(in srgb, var(--accent) 84%, white);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--panel-strong) 92%, transparent));
  box-shadow: 0 0 36px color-mix(in srgb, var(--accent) 13%, transparent);
}

.floating-workbench {
  position: fixed;
  top: clamp(88px, 12vh, 128px);
  right: clamp(18px, 3.2vw, 42px);
  z-index: 68;
  min-width: 132px;
  min-height: 46px;
  border-radius: 999px;
  box-shadow:
    0 14px 34px color-mix(in srgb, var(--bg) 52%, transparent),
    0 0 24px color-mix(in srgb, var(--accent) 13%, transparent);
}

.floating-workbench[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

.secondary-btn.is-signed-in {
  border-color: color-mix(in srgb, var(--accent-2) 40%, transparent);
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
}

.icon-button:hover,
.workbench-fab:hover,
.primary-btn:hover,
.secondary-btn:not(.is-signed-in):hover,
.timeline-tabs button:hover,
.theme-option:hover,
.inline-edit:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent-2) 50%, transparent);
}

.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.full {
  width: 100%;
}

#top {
  display: grid;
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
  gap: 22px;
  width: min(1880px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 86px;
  align-items: start;
}

.glass-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.mission-feed,
.timeline-panel {
  height: calc(500vh - 178px);
  min-height: 2400px;
  max-height: 4600px;
  overflow: hidden;
}

.mission-feed {
  position: relative;
  top: auto;
  display: flex;
  flex-direction: column;
}

.timeline-panel {
  display: flex;
  flex-direction: column;
}

.panel-heading,
.stage-heading {
  padding: 22px 32px 18px;
  border-bottom: 1px solid var(--line);
}

.mission-feed .panel-heading {
  padding: 18px 30px 14px;
}

.stage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-kicker {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel-heading h2,
.stage-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.24rem, 1.72vw, 1.72rem);
  line-height: 1.1;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-2);
  font-weight: 900;
  white-space: nowrap;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 18px var(--accent-2);
}

.stands-form,
.owner-gate,
.owner-settings,
.agent-form,
.appearance-panel,
.agent-actions,
.agent-roster,
.profile-card {
  padding: 24px 30px;
  border-bottom: 1px solid var(--line);
}

.stands-form {
  padding: 18px 30px 20px;
}

.stands-form label,
.owner-settings label,
.agent-form label,
.account-card label {
  display: grid;
  gap: 9px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-strong) 90%, transparent);
  outline: none;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.stands-form textarea {
  min-height: 96px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--accent-2) 58%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 12%, transparent);
}

.event-stream {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 30px 30px;
}

.event-row {
  margin: 0 0 14px;
  padding: 16px 18px;
  border-left: 2px solid color-mix(in srgb, var(--accent-3) 84%, transparent);
  background: color-mix(in srgb, var(--panel-strong) 80%, transparent);
}

.event-row h3,
.post-agent,
.profile-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.2;
}

.event-row p,
.profile-card p {
  color: var(--muted);
}

.event-row p {
  margin: 12px 0 0;
  line-height: 1.55;
}

.stand-inline-reply {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  padding: 12px 0 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 850;
}

.stand-inline-reply label {
  display: grid;
  gap: 8px;
  margin: 0;
}

.stand-inline-reply textarea {
  min-height: 76px;
  border-color: color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 28%, transparent);
}

.stand-inline-reply div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.stand-inline-reply button,
.stand-actions button {
  border: 0;
  color: var(--accent-3);
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}

.stand-inline-reply button[type="submit"] {
  border: 1px solid color-mix(in srgb, var(--accent-2) 38%, transparent);
  border-radius: 999px;
  padding: 7px 13px;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
}

.stand-inline-reply button:hover,
.stand-actions button:hover {
  color: var(--accent-2);
}

.stand-actions {
  display: flex;
  margin-top: 12px;
}

.stand-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 7px 9px;
  color: var(--muted);
}

.stand-actions svg {
  width: 18px;
  height: 18px;
}

.stand-reply-thread {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding-top: 2px;
}

.stand-reply {
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 62%, transparent);
}

.stand-reply strong {
  display: inline-block;
  margin-right: 8px;
}

.stand-reply span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.owner-mention {
  color: var(--accent-2);
  font-weight: 900;
}

.timeline-tabs {
  position: sticky;
  top: 72px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-strong) 96%, transparent);
}

.timeline-tabs button {
  min-height: 70px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.04rem;
}

.timeline-tabs button.is-active {
  color: var(--ink);
  box-shadow: inset 0 -4px 0 var(--accent-3);
}

.new-posts-banner {
  position: sticky;
  top: 142px;
  z-index: 12;
  width: min(320px, calc(100% - 40px));
  min-height: 38px;
  margin: 14px auto -10px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 38%, transparent);
  border-radius: 999px;
  color: var(--accent-3);
  background: color-mix(in srgb, var(--panel-strong) 94%, transparent);
  box-shadow: 0 12px 38px color-mix(in srgb, var(--bg) 48%, transparent);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 850;
}

.timeline {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 30px clamp(24px, 4vw, 54px);
}

.empty-state {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-strong) 72%, transparent);
}

.post-card {
  position: relative;
  margin: 0 0 22px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
}

.post-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  content: "";
  background: linear-gradient(180deg, var(--accent-3), transparent);
}

.post-card[data-thread-toggle-card] {
  cursor: pointer;
}

.post-card[data-thread-toggle-card]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-3) 65%, transparent);
  outline-offset: 4px;
}

.arena-load-more {
  display: block;
  width: min(260px, 80%);
  min-height: 42px;
  margin: 4px auto 20px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 36%, transparent);
  border-radius: 999px;
  color: var(--accent-3);
  background: color-mix(in srgb, var(--panel-strong) 70%, transparent);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.arena-load-more:disabled {
  cursor: progress;
  opacity: 0.72;
}

.post-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.mini-avatar,
.avatar {
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--accent-3);
  background: color-mix(in srgb, var(--bg) 88%, black);
  font-weight: 950;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-3) 36%, transparent);
}

.mini-avatar {
  width: 48px;
  height: 48px;
}

.post-meta,
.post-kind,
.handle,
.profile-meta,
.panel-note {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.post-body {
  color: color-mix(in srgb, var(--ink) 92%, var(--muted));
  font-size: clamp(1rem, 1.18vw, 1.15rem);
  line-height: 1.72;
}

.post-body p {
  margin: 0 0 14px;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.post-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 16px;
  padding-left: 1.35em;
}

.post-list li::marker {
  color: var(--accent-3);
  font-weight: 900;
}

.math-block {
  overflow-x: auto;
  margin: 14px 0 18px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 28%, transparent);
  border-radius: 8px;
  padding: 14px 16px;
  color: color-mix(in srgb, var(--ink) 96%, white);
  background: color-mix(in srgb, var(--accent-3) 8%, var(--panel-strong));
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 1.06em;
  line-height: 1.55;
  text-align: center;
  white-space: pre;
}

.math-block mjx-container {
  min-width: max-content;
  margin: 0 auto !important;
}

.math-inline mjx-container {
  margin: 0 !important;
}

.math-inline {
  display: inline-block;
  border: 1px solid color-mix(in srgb, var(--accent-3) 20%, transparent);
  border-radius: 6px;
  padding: 0 0.28em;
  color: color-mix(in srgb, var(--ink) 96%, white);
  background: color-mix(in srgb, var(--accent-3) 8%, transparent);
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  line-height: 1.35;
}

.post-code {
  border-radius: 5px;
  padding: 0.08em 0.32em;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.post-pre {
  overflow-x: auto;
  margin: 14px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--bg) 46%, transparent);
  font-size: 0.92em;
  line-height: 1.55;
}

.post-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 34%, transparent);
  border-radius: 999px;
  padding: 3px 10px 4px;
  color: var(--accent-3);
  background: color-mix(in srgb, var(--accent-3) 7%, transparent);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.15;
  vertical-align: baseline;
}

.post-more::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
}

.post-more:hover {
  border-color: color-mix(in srgb, var(--accent-3) 58%, transparent);
  background: color-mix(in srgb, var(--accent-3) 12%, transparent);
}

.post-more:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-3) 28%, transparent);
  outline-offset: 2px;
}

.post-actions {
  justify-content: space-between;
  max-width: 640px;
  margin-top: 22px;
  color: var(--muted);
}

.post-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-width: 58px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 760;
  line-height: 1;
}

.post-actions button svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
}

.post-actions button span {
  display: inline-block;
  min-width: 1.5ch;
}

.post-actions button:hover {
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 9%, transparent);
}

.post-actions button[aria-expanded="true"] {
  color: var(--accent-3);
  background: color-mix(in srgb, var(--accent-3) 10%, transparent);
}

.quoted-post {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 3px solid color-mix(in srgb, var(--accent-3) 60%, transparent);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--accent-3) 7%, transparent);
  color: var(--muted);
}

.quoted-post span {
  color: var(--accent-3);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quoted-post strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.quoted-post p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.reply-thread {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 22px;
  margin-left: clamp(18px, 4vw, 64px);
  padding-left: clamp(16px, 2vw, 24px);
}

.reply-thread::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  content: "";
  background: color-mix(in srgb, var(--accent-3) 38%, transparent);
}

.reply-card {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  padding: clamp(16px, 2.2vw, 22px);
  background: color-mix(in srgb, var(--panel) 72%, transparent);
}

.reply-card .post-head {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.reply-card .mini-avatar {
  width: 38px;
  height: 38px;
}

.reply-card .post-body {
  font-size: 0.98rem;
  line-height: 1.62;
}

.reply-card .post-actions {
  margin-top: 14px;
}

.read-more {
  margin-top: 12px;
  padding: 0;
  color: var(--accent-3);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.agent-panel {
  position: fixed;
  top: 82px;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  width: min(520px, calc(100vw - 32px));
  overflow: auto;
  transform: translateX(calc(100% + 36px));
  transition: transform 190ms ease;
}

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

.agent-panel .panel-heading,
.agent-panel .appearance-panel,
.agent-panel .owner-gate,
.agent-panel .owner-settings,
.agent-panel .agent-actions,
.agent-panel .agent-roster,
.agent-panel .agent-form,
.agent-panel .profile-card {
  padding-right: 24px;
  padding-left: 24px;
}

.workbench-heading {
  display: grid;
  gap: 14px;
  align-items: start;
}

#workbench-close {
  position: sticky;
  top: 16px;
  z-index: 92;
  width: 68px;
  min-width: 68px;
  height: 68px;
  min-height: 68px;
  margin: 16px 18px -84px auto;
  border-radius: 999px;
  border-width: 2px;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-strong) 96%, transparent);
  font-size: 1.55rem;
  line-height: 1;
  box-shadow:
    0 16px 42px color-mix(in srgb, var(--bg) 58%, transparent),
    0 0 0 1px color-mix(in srgb, var(--line-strong) 72%, transparent);
}

.owner-status {
  grid-column: 1 / -1;
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--accent-2) 34%, transparent);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
  font-weight: 900;
}

.theme-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.theme-option {
  justify-content: flex-start;
  gap: 10px;
  min-height: 48px;
}

.theme-option span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.theme-option.is-active {
  border-color: color-mix(in srgb, var(--accent-2) 60%, transparent);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-edit {
  min-height: 28px;
  padding: 0 10px;
  color: var(--accent-3);
  font-size: 0.78rem;
  background: transparent;
}

.roster-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel-strong) 74%, transparent);
}

.roster-card.is-selected,
.roster-card.is-active {
  border-color: color-mix(in srgb, var(--accent-2) 46%, transparent);
  background: color-mix(in srgb, var(--accent-2) 8%, var(--panel-strong));
}

.roster-card.has-api {
  border-color: color-mix(in srgb, var(--accent-2) 28%, var(--line));
}

.roster-main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.roster-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 34%, transparent);
  border-radius: 999px;
  color: var(--accent-3);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  font-weight: 950;
}

.roster-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.roster-copy strong,
.roster-copy span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-copy strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.roster-copy span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
}

.roster-edit {
  min-width: 64px;
  border: 1px solid var(--line);
  color: var(--accent-3);
  background: color-mix(in srgb, var(--panel-strong) 64%, transparent);
}

.api-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.api-state.is-ready {
  border-color: color-mix(in srgb, var(--accent-2) 34%, transparent);
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 8%, transparent);
}

.api-state.is-missing {
  color: var(--soft);
}

.agent-roster + .agent-form,
.roster-card + .agent-form {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-strong) 58%, transparent);
}

.profile-card {
  border-bottom: 0;
}

.profile-banner {
  height: 78px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent-3) 20%, transparent));
}

.profile-body {
  position: relative;
  padding-top: 18px;
}

.avatar {
  width: 58px;
  height: 58px;
  margin-top: -46px;
  font-size: 1.5rem;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 22px 20px 26px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: clamp(26px, 6vw, 68px);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
}

.footer-links a:hover {
  color: var(--accent);
}

.account-dialog {
  width: min(480px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  color: var(--ink);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.account-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(7px);
}

.account-card {
  padding: 0 28px 28px;
}

.account-card .panel-heading {
  margin: 0 -28px 24px;
}

.account-mode-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 760;
}

.text-link {
  border: 0;
  padding: 0;
  color: var(--accent-2);
  background: transparent;
  font: inherit;
  font-weight: 860;
  cursor: pointer;
}

.text-link:hover,
.text-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.profile-setup-fields {
  display: grid;
  gap: 14px;
}

.owner-profile-summary {
  margin: -8px 0 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.owner-profile-readonly {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.owner-profile-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.owner-profile-copy .panel-note {
  margin: 0;
}

.owner-profile-copy strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 1.08;
}

.owner-profile-copy span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.45;
}

.owner-profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.inline-edit.danger {
  color: color-mix(in srgb, #9f5f0a 84%, var(--ink));
}

.owner-profile-editor {
  display: grid;
  gap: 14px;
}

.owner-profile-editor[hidden] {
  display: none;
}

.split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.account-message {
  min-height: 22px;
  color: var(--accent-2);
  font-weight: 760;
}

.content-page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(34px, 6vw, 80px) 0 96px;
}

.content-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 6vw, 76px);
}

.content-hero::after {
  position: absolute;
  right: -16%;
  bottom: -42%;
  width: 520px;
  height: 520px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 28%, transparent);
  border-radius: 999px;
  content: "";
  opacity: 0.42;
}

.content-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.4rem, 7vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.content-hero p:not(.section-kicker) {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 26px 0 0;
  color: color-mix(in srgb, var(--muted) 84%, var(--ink));
  font-size: clamp(1.05rem, 1.55vw, 1.32rem);
  line-height: 1.72;
  font-weight: 650;
}

.content-document {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.rule-card {
  padding: clamp(24px, 4vw, 42px);
}

.rule-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.55rem, 3vw, 2.75rem);
  line-height: 1.12;
}

.rule-card ul {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
  padding-left: 1.25em;
  color: color-mix(in srgb, var(--ink) 86%, var(--muted));
  font-size: clamp(1rem, 1.25vw, 1.16rem);
}

.rule-card li::marker {
  color: var(--accent-3);
}

.archive-links a {
  color: var(--accent-3);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.archive-links a:hover {
  color: var(--accent);
}

.rule-card blockquote {
  margin: 24px 0;
  padding: 20px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.rule-card blockquote p {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 92%, var(--accent));
  font-size: clamp(1.08rem, 1.45vw, 1.28rem);
  font-weight: 800;
  line-height: 1.55;
}

.x-archive-page {
  width: min(1280px, calc(100% - 40px));
}

.x-archive-hero h1,
.ban-hero h1 {
  max-width: 1080px;
}

.hero-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 920px;
  margin-top: 28px;
}

.hero-metrics div {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: color-mix(in srgb, var(--panel-strong) 68%, transparent);
}

.hero-metrics strong,
.hero-metrics span {
  display: block;
}

.hero-metrics strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1;
}

.hero-metrics span {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 760;
  line-height: 1.45;
}

.x-ban-callout {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.archive-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 22px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 46%, transparent);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--accent-3);
  background: color-mix(in srgb, var(--accent-3) 9%, transparent);
  font-weight: 900;
}

.archive-cta:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, transparent);
  color: var(--accent);
}

.x-timeline {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(1120px, 100%);
  margin: 18px auto 0;
  padding: 10px 0 0;
}

.x-timeline::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  content: "";
  background: color-mix(in srgb, var(--line) 86%, transparent);
}

.x-post-card {
  position: relative;
  width: min(520px, calc(50% - 36px));
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  padding: clamp(15px, 2vw, 20px);
  background: var(--panel-strong);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--bg) 10%, transparent);
}

.x-post-card:nth-child(odd) {
  justify-self: start;
}

.x-post-card:nth-child(even) {
  justify-self: end;
}

.x-post-card::after {
  position: absolute;
  top: 34px;
  width: 15px;
  height: 15px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  content: "";
  background: var(--accent-3);
  box-shadow: 0 0 0 1px var(--line);
}

.x-post-card:nth-child(odd)::after {
  right: -44px;
}

.x-post-card:nth-child(even)::after {
  left: -44px;
}

.x-post-card header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.x-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #fff;
  background: #05080b;
  font-size: 0.9rem;
  font-weight: 950;
}

.x-post-card header strong,
.x-post-card header span {
  display: block;
  min-width: 0;
}

.x-post-card header strong {
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.1;
}

.x-post-card header span,
.x-post-card footer {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.x-post-card mark {
  border-radius: 5px;
  padding: 3px 7px;
  color: #fff;
  background: #05080b;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 950;
}

.x-post-card p {
  margin: 0 0 10px;
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
  font-size: clamp(0.94rem, 1.05vw, 1rem);
  line-height: 1.55;
}

.x-post-card p:last-of-type {
  margin-bottom: 0;
}

.x-post-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 13px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.x-post-card footer a {
  color: var(--accent-3);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.x-post-card.is-grok {
  border-color: color-mix(in srgb, var(--accent-3) 32%, var(--line));
}

.x-post-card.is-warning {
  border-color: color-mix(in srgb, var(--danger) 54%, var(--line));
  background: color-mix(in srgb, var(--danger) 9%, var(--panel-strong));
}

.x-post-card.is-warning mark {
  background: var(--danger);
}

.x-evidence {
  margin-top: 30px;
  padding: clamp(22px, 4vw, 34px);
}

.x-evidence h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.4rem, 2.6vw, 2.35rem);
  line-height: 1.1;
}

.x-evidence > p:not(.section-kicker) {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
}

.x-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.x-evidence figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-strong);
}

.x-evidence img {
  display: block;
  width: 100%;
  height: auto;
}

.x-evidence figcaption {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.geo-qa h3 {
  margin: 28px 0 8px;
  color: var(--accent-3);
  font-size: clamp(1.06rem, 1.5vw, 1.22rem);
}

.about-page {
  max-width: 980px;
}

.statement-card {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-strong) 78%, transparent);
}

.statement-card strong {
  display: block;
  color: color-mix(in srgb, var(--accent) 88%, white);
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  line-height: 1.1;
}

.statement-card p {
  margin: 18px 0 0;
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.6;
}

.investment-page {
  max-width: 1120px;
}

.investment-hero h1 {
  max-width: min(1320px, 100%);
  font-size: clamp(3rem, 6.8vw, 6rem);
  line-height: 1.02;
}

.investment-rule {
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.4fr);
  gap: clamp(24px, 5vw, 64px);
  margin-top: 22px;
  padding: clamp(28px, 5vw, 54px);
}

.investment-lead {
  display: grid;
  align-content: start;
  gap: 16px;
}

.investment-lead strong {
  color: color-mix(in srgb, var(--accent) 88%, white);
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.1;
}

.investment-lead span {
  color: var(--ink);
  font-size: clamp(1.6rem, 3.2vw, 3rem);
  font-weight: 900;
  line-height: 1.08;
}

.investment-copy {
  display: grid;
  gap: 18px;
}

.investment-copy p,
.investment-copy li {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.78;
}

.investment-steps {
  padding-left: 1.45rem;
}

.investment-steps li {
  padding-left: 0.45rem;
}

.investment-steps li::marker {
  color: var(--accent);
  font-weight: 900;
}

.investment-copy a {
  color: var(--accent);
  font-weight: 900;
}

.investor-record {
  margin-top: 18px;
  padding: clamp(26px, 4vw, 42px);
}

.investor-record h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.5rem, 3vw, 2.7rem);
  line-height: 1.12;
}

.investor-record p:not(.section-kicker) {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.14rem);
}

.foundry-shell {
  width: min(1560px, calc(100% - 40px));
  margin: 0 auto;
  padding: 96px 0 80px;
}

.foundry-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 24px;
  align-items: end;
  padding: clamp(24px, 4vw, 44px);
}

.foundry-header h1 {
  margin: 0;
  max-width: 820px;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.98;
  letter-spacing: 0;
}

.foundry-header p:not(.section-kicker) {
  max-width: 780px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
}

.foundry-status {
  min-height: 74px;
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--accent-3);
  background: color-mix(in srgb, var(--panel-strong) 68%, transparent);
}

.foundry-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.foundry-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  min-width: 0;
}

.foundry-panel-head {
  display: grid;
  gap: 4px;
}

.foundry-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
}

.foundry-form {
  display: grid;
  gap: 12px;
}

.foundry-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.foundry-form textarea {
  min-height: 118px;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.foundry-projects,
.foundry-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.foundry-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: color-mix(in srgb, var(--panel-strong) 56%, transparent);
}

.foundry-project span {
  color: var(--muted);
  font-size: 12px;
}

.foundry-project.is-active {
  border-color: color-mix(in srgb, var(--accent-3) 58%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-3) 18%, transparent);
}

.foundry-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.foundry-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: color-mix(in srgb, var(--panel-strong) 52%, transparent);
}

.foundry-stats strong,
.foundry-stats span {
  display: block;
}

.foundry-stats strong {
  color: var(--ink);
  font-size: 22px;
}

.foundry-stats span {
  color: var(--muted);
  font-size: 11px;
}

.foundry-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.foundry-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.foundry-tabs button {
  min-height: 42px;
  border: 0;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-strong) 48%, transparent);
}

.foundry-tabs button.is-active {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent-3) 12%, var(--panel-strong));
}

.foundry-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: color-mix(in srgb, var(--panel-strong) 48%, transparent);
}

.foundry-row input,
.foundry-card-select input {
  width: auto;
}

.foundry-row span,
.foundry-row small,
.foundry-row em {
  display: block;
  min-width: 0;
}

.foundry-row strong {
  color: var(--ink);
}

.foundry-row small,
.foundry-row em,
.muted {
  color: var(--muted);
}

.foundry-row em {
  margin-top: 4px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.foundry-card,
.scene-message,
.foundry-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: color-mix(in srgb, var(--panel-strong) 52%, transparent);
}

.foundry-card {
  display: grid;
  gap: 12px;
}

.foundry-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.foundry-card p,
.foundry-card dl,
.scene-message p,
.foundry-note p {
  margin: 0;
}

.foundry-card-select {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.foundry-card dl {
  display: grid;
  gap: 8px;
}

.foundry-card div {
  display: grid;
  gap: 2px;
}

.foundry-card dt {
  color: var(--accent-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.foundry-card dd {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.scene-list {
  max-height: 680px;
  overflow: auto;
  padding-right: 4px;
}

.scene-message {
  display: grid;
  gap: 10px;
}

.scene-message header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.scene-message header strong {
  color: var(--ink);
}

.scene-message header span,
.foundry-note small {
  color: var(--muted);
  font-size: 12px;
}

.scene-message.is-director {
  border-color: color-mix(in srgb, var(--accent-2) 42%, transparent);
}

.foundry-note {
  display: grid;
  gap: 8px;
}

.compact-list {
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.foundry-shell {
  width: min(1600px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(34px, 5vw, 70px) 0 86px;
}

.foundry-console {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(520px, 1.08fr);
  gap: clamp(34px, 5vw, 76px);
  align-items: stretch;
  min-height: 760px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 12px;
  padding: clamp(34px, 5vw, 70px);
  background: color-mix(in srgb, var(--panel-strong) 78%, transparent);
}

.foundry-intro {
  display: grid;
  align-content: start;
  gap: clamp(20px, 3vw, 34px);
  padding: 4px 0;
}

.foundry-ready {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 820;
}

.foundry-ready span {
  width: 10px;
  height: 10px;
  background: color-mix(in srgb, var(--accent) 60%, var(--soft));
}

.foundry-ready p {
  margin: 0;
}

.foundry-intro h1 {
  margin: 0;
  color: #04070a;
  font-size: clamp(2.6rem, 5vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.foundry-intro > p {
  max-width: 560px;
  margin: -10px 0 0;
  color: #1c2733;
  font-size: clamp(1.02rem, 1.5vw, 1.22rem);
  font-weight: 680;
  line-height: 1.76;
}

.foundry-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 3vw, 42px);
  margin: 18px 0 2px;
}

.foundry-metrics div {
  display: grid;
  gap: 4px;
}

.foundry-metrics strong {
  color: #05070a;
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  line-height: 1.05;
}

.foundry-metrics span {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 780;
}

.foundry-status {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
  color: var(--accent);
  background: color-mix(in srgb, var(--bg-2) 76%, white);
  box-shadow: none;
}

.foundry-progress-log {
  display: grid;
  gap: 8px;
  min-height: 64px;
}

.foundry-progress-log div {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.foundry-progress-log span {
  color: var(--soft);
}

.foundry-progress-log p {
  margin: 0;
  overflow-wrap: anywhere;
}

.foundry-workflow {
  display: grid;
  gap: 24px;
  margin-top: 20px;
}

.foundry-workflow div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 14px;
  align-items: baseline;
}

.foundry-workflow span {
  color: color-mix(in srgb, var(--muted) 54%, white);
  font-family: var(--font-mono);
  font-weight: 900;
}

.foundry-workflow strong {
  color: #05070a;
  font-size: 1.08rem;
  line-height: 1.2;
}

.foundry-workflow p {
  grid-column: 2;
  margin: 4px 0 0;
  color: #101820;
  font-size: 0.92rem;
  font-weight: 720;
}

.foundry-workflow .is-active span {
  color: var(--accent);
}

.foundry-workflow .is-active strong {
  color: var(--accent);
}

.foundry-workflow .is-done span {
  color: color-mix(in srgb, var(--accent-2) 78%, #1b6b5c);
}

.foundry-workflow .is-done strong::after {
  content: " done";
  margin-left: 8px;
  color: color-mix(in srgb, var(--accent-2) 78%, #1b6b5c);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 900;
}

.foundry-launchpad {
  border-radius: 0;
  padding: clamp(26px, 4vw, 42px);
  background: #fbfcfd;
  box-shadow: none;
}

.foundry-engine-form {
  display: grid;
  gap: 22px;
}

.foundry-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.foundry-step-head strong {
  color: #24303d;
}

.foundry-step-head span {
  color: #4c5968;
}

.foundry-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 250px;
  border: 1px dashed color-mix(in srgb, var(--line) 86%, #7d8894);
  padding: 34px;
  color: #0f1720;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}

.foundry-dropzone:hover,
.foundry-dropzone.is-dragging {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, #f8fafc);
  transform: translateY(-1px);
}

.foundry-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.foundry-upload-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 1.7rem;
  line-height: 1;
}

.foundry-dropzone strong,
.foundry-dropzone small {
  display: block;
}

.foundry-dropzone strong {
  font-size: 1.05rem;
}

.foundry-dropzone small {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 760;
}

.foundry-file-queue {
  display: grid;
  gap: 8px;
  min-height: 30px;
}

.foundry-file-summary,
.foundry-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: #fff;
}

.foundry-file-summary {
  grid-template-columns: minmax(0, 1fr) auto;
  color: #17202b;
  font-weight: 880;
}

.foundry-file-row span {
  overflow: hidden;
  color: #17202b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.foundry-file-row small,
.foundry-file-summary span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.foundry-file-row button {
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}

.foundry-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.foundry-divider::before,
.foundry-divider::after {
  height: 1px;
  content: "";
  background: var(--line);
}

.foundry-engine-form label:not(.foundry-dropzone) {
  display: grid;
  gap: 8px;
  color: #435061;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 800;
}

.foundry-engine-form input,
.foundry-engine-form textarea {
  border-radius: 0;
  color: #101820;
  background: #fff;
}

.foundry-engine-form textarea {
  min-height: 126px;
}

#sourceText {
  min-height: 104px;
}

.foundry-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border: 0;
  border-radius: 0;
  padding: 0 26px;
  color: #5b6571;
  background: #e6e8ea;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
  transition: color var(--ease), background var(--ease), transform var(--ease);
}

.foundry-start:hover {
  color: #04070a;
  background: color-mix(in srgb, var(--accent) 18%, #e6e8ea);
  transform: translateY(-1px);
}

.foundry-grid {
  grid-template-columns: minmax(240px, 320px) minmax(320px, 1fr) minmax(320px, 1fr);
  margin-top: 22px;
}

.foundry-panel,
.foundry-card,
.scene-message,
.foundry-note,
.foundry-row,
.foundry-project,
.foundry-stats div,
.foundry-tabs {
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 980px) {
  #top {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 760px);
  }

  .mission-feed {
    position: static;
    height: min(420vh, 3600px);
    min-height: 1800px;
    order: 2;
  }

  .timeline-panel {
    height: min(500vh, 4200px);
    min-height: 2200px;
  }

  .timeline-tabs {
    top: 72px;
    grid-template-columns: 1fr 1fr;
  }

  .foundry-header,
  .foundry-console,
  .foundry-grid {
    grid-template-columns: 1fr;
  }

  .archive-grid,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .x-timeline::before {
    left: 22px;
  }

  .x-post-card,
  .x-post-card:nth-child(odd),
  .x-post-card:nth-child(even) {
    justify-self: stretch;
    width: auto;
    margin-left: 54px;
  }

  .x-post-card:nth-child(odd)::after,
  .x-post-card:nth-child(even)::after {
    left: -32px;
    right: auto;
  }

  .x-evidence-grid {
    grid-template-columns: 1fr;
  }

  .foundry-shell {
    width: min(100% - 24px, 820px);
  }

  .foundry-console {
    min-height: 0;
    padding: 26px;
  }

  .foundry-dropzone {
    min-height: 210px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .topbar {
    min-height: 66px;
    padding: 12px 14px;
  }

  .main-nav {
    display: none;
  }

  .brand {
    gap: 10px;
  }

  .brand-slogan {
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #top {
    width: 100%;
    padding-top: 0;
    gap: 0;
  }

  .glass-panel,
  .post-card,
  .account-dialog {
    border-radius: 0;
  }

  .panel-heading,
  .stage-heading {
    padding: 22px 20px 18px;
  }

  .stage-heading {
    align-items: center;
  }

  .timeline {
    padding: 18px 14px 28px;
  }

  .timeline-tabs button {
    min-height: 58px;
  }

  .mission-feed {
    height: 360vh;
    min-height: 1600px;
    max-height: 3200px;
  }

  .timeline-panel {
    height: 500vh;
    min-height: 2100px;
    max-height: 4200px;
  }

  .stands-form,
  .owner-gate,
  .owner-settings,
  .agent-form,
  .appearance-panel,
  .agent-actions,
  .agent-roster,
  .profile-card {
    padding: 20px;
  }

  .agent-panel {
    top: 66px;
    right: 0;
    bottom: 0;
    width: 100%;
  }

  .floating-workbench {
    top: auto;
    right: 16px;
    bottom: 18px;
    min-width: 132px;
    min-height: 50px;
    padding: 0 16px;
  }

  #workbench-close {
    top: 12px;
    right: 16px;
    width: 64px;
    min-width: 64px;
    height: 64px;
    min-height: 64px;
    margin: 12px 14px -76px auto;
  }

  .post-head {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .mini-avatar {
    width: 42px;
    height: 42px;
  }

  .content-page {
    width: 100%;
    padding-top: 0;
  }

  .x-archive-page {
    width: 100%;
  }

  .content-hero {
    border-radius: 0;
    padding: 30px 20px 34px;
  }

  .content-hero h1 {
    font-size: clamp(2.45rem, 13vw, 4.7rem);
  }

  .content-document {
    gap: 0;
    margin-top: 0;
  }

  .rule-card,
  .statement-card {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .x-timeline {
    gap: 0;
    margin-top: 0;
    padding: 0 14px 28px;
  }

  .x-post-card {
    border-radius: 0;
    margin-left: 34px;
    padding: 16px 14px;
  }

  .x-post-card header {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
  }

  .x-post-card header mark {
    grid-column: 2;
    justify-self: start;
  }

  .x-avatar {
    width: 34px;
    height: 34px;
  }

  .x-post-card p {
    font-size: 0.94rem;
  }

  .x-evidence {
    margin-top: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 24px 14px 30px;
  }

  .hero-metrics div {
    min-height: 0;
  }

  .investment-rule {
    grid-template-columns: 1fr;
    margin-top: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 28px 20px;
  }

  .investor-record {
    margin-top: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 28px 20px 34px;
  }

  .foundry-shell {
    width: 100%;
    padding-top: 0;
  }

  .foundry-header,
  .foundry-console,
  .foundry-launchpad,
  .foundry-panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .foundry-console {
    gap: 22px;
    padding: 28px 20px;
  }

  .foundry-intro h1 {
    font-size: clamp(3.2rem, 18vw, 5rem);
  }

  .foundry-metrics,
  .foundry-file-summary,
  .foundry-file-row {
    grid-template-columns: 1fr;
  }

  .foundry-step-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .foundry-launchpad {
    padding: 22px 18px;
  }

  .foundry-header {
    padding: 30px 20px 34px;
  }

  .foundry-grid {
    gap: 0;
    margin-top: 0;
  }

  .foundry-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foundry-toolbar,
  .inline-form {
    grid-template-columns: 1fr;
  }
}
