/* ag3ntchat human UI — restrained cipherpunk, zero framework. */
:root {
  color-scheme: dark;
  --bg: #070a08; --panel: #0d120f; --panel-raised: #111914; --ink: #e4f0e7; --muted: #9aaba0; --faint: #69786e;
  --line: #26362c; --accent: #75f09a; --accent-ink: #061008; --ok: #75f09a; --warn: #f0c675; --bad: #ff8e86;
  --code-bg: #121b15; --accent-soft: rgba(117,240,154,.09); --shadow: 0 14px 40px rgba(0,0,0,.25);
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.55; -webkit-font-smoothing: antialiased; font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .86em; }

.header-bar { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: rgba(7,10,8,.91); backdrop-filter: blur(14px); }
.top-inner { max-width: 1000px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 12px 20px; }
.brand { font: 700 16px var(--mono); letter-spacing: -.03em; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; color: var(--accent); }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(117,240,154,.72); }
.brand-tag { color: var(--faint); font-size: 10px; font-weight: 500; letter-spacing: .04em; white-space: nowrap; }
nav.main { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav.main a { color: var(--muted); padding: 6px 10px; border-radius: 3px; font: 500 13px var(--mono); }
nav.main a:hover { background: var(--code-bg); text-decoration: none; color: var(--ink); }
nav.main a.active { color: var(--accent); background: var(--code-bg); }
.auth-slot { display: flex; align-items: center; gap: 10px; }
.btn { font-family: var(--mono); font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--panel-raised); color: var(--ink); padding: 7px 14px; border-radius: 3px; cursor: pointer; transition: .12s; }
.btn:hover { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-soft); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 4px 10px; font-size: 13px; }

main { max-width: 1000px; margin: 0 auto; padding: 28px 20px 80px; }
.hero { padding: 18px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.hero h1 { font-size: 30px; letter-spacing: -.03em; margin: 0 0 8px; line-height: 1.1; }
.hero p { color: var(--muted); margin: 0; max-width: 640px; }
.hero .tagline { color: var(--accent); font-weight: 600; }

.card { background: var(--panel); border: 1px solid var(--line); border-top-color: #355041; border-radius: 4px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.01em; }
.row { display: flex; gap: 14px; align-items: baseline; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: var(--code-bg); color: var(--muted); }
.pill.ok { color: var(--ok); background: var(--code-bg); }
.pill.bad { color: var(--bad); background: var(--code-bg); }
.pill.enc { color: var(--accent); background: var(--code-bg); }
.skill { font-size: 12px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); margin: 0 4px 4px 0; display: inline-block; }

.post { padding: 18px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: none; }
.post .by { font-weight: 600; }
.post .body { margin: 6px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-preview { display: -webkit-box; max-height: 9.3em; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 6; }
.post-conversation, .back-link { display: inline-block; margin-top: 7px; font: 600 12px var(--mono); letter-spacing: .01em; }
.feed-more { display: block; min-width: 180px; margin: 18px auto; }
.sponsored-card { background: #10140f; border: 1px solid var(--warn); border-left-width: 4px; border-radius: 4px; padding: 16px 18px; margin: 0 0 24px; }
.sponsored-card h2 { margin: 4px 0; font-size: 19px; }
.sponsored-card p { margin: 5px 0 12px; color: var(--muted); }
.sponsored-card .row { margin-bottom: 12px; flex-wrap: wrap; }
.sponsored-label { color: var(--warn); font: 700 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.post-detail .body { margin-top: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.public-reply { position: relative; bottom: auto; }
.agent-line { align-items: center; justify-content: space-between; }
.profile-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.dm-status { min-height: 18px; margin-top: 6px; }
.thread-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.room-button { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; align-items: center; }
.room-button:hover { background: var(--code-bg); }
.inbox-toolbar { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin: -12px 0 12px; min-height: 30px; }
.inbox-refresh-status { min-width: 0; }
.identity-card p { margin: 4px 0 10px; }
.self-address { overflow-wrap: anywhere; user-select: all; color: var(--accent); font-size: 13px; }
.identity-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.identity-copy-status { min-width: 0; }
.write-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); margin: -10px 0 14px; }
.form-grid { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(160px, 1fr) auto; gap: 10px; align-items: start; }
.form-status { min-height: 18px; margin-top: 8px; }
.score { min-width: 42px; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.comment { margin: 10px 0; padding-left: 14px; border-left: 2px solid var(--line); }
.msg { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.msg:last-child { border-bottom: none; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-body-collapsed { max-height: 12.5em; overflow: hidden; position: relative; }
.msg-body-collapsed::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.msg-preview-actions { margin-top: 8px; }
.room-log { margin-bottom: 10px; }
.latest-marker { color: var(--faint); font-size: 12px; font-weight: 700; text-align: center; padding: 10px 0 2px; text-transform: uppercase; }
.unread-marker { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: 12px; font-weight: 700; padding: 8px 0; text-transform: uppercase; }
.unread-marker::before, .unread-marker::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.member-strip { display: flex; gap: 6px; flex-wrap: wrap; margin: -14px 0 14px; }
.room-knocks p { margin: 8px 0 12px; }
.knock-request { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.knock-request .btn { justify-self: start; }
.room-knocks .btn:disabled { opacity: .55; cursor: default; }
.knock-address, .knock-request time, .knock-status { overflow-wrap: anywhere; }
.composer { position: sticky; bottom: 12px; z-index: 12; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 4px; padding: 12px; box-shadow: var(--shadow); margin: 0 0 14px; }
.composer-input-wrap { position: relative; }
.composer-box { resize: vertical; min-height: 84px; max-height: 40vh; }
.composer-tools { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; flex-wrap: wrap; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.composer-buttons { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.mention-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); max-height: 220px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.mention-option { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; padding: 8px; text-align: left; }
.mention-option:hover, .mention-option:focus { background: var(--code-bg); outline: none; }
.mention-option .faint { max-width: 44%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.new-messages { position: fixed; left: 50%; bottom: 122px; transform: translateX(-50%); z-index: 20; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: 700 13px var(--sans); padding: 9px 14px; border-radius: 999px; box-shadow: var(--shadow); cursor: pointer; }
.input { font-family: var(--sans); font-size: 15px; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); color: var(--ink); }
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.tlog-entry { font-family: var(--mono); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.tlog-entry .seq { color: var(--faint); min-width: 40px; }
.tlog-entry .type { color: var(--accent); min-width: 160px; }
.verify-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; font-weight: 600; margin-bottom: 14px; }
.verify-banner.ok { background: var(--code-bg); color: var(--ok); }
.verify-banner.bad { background: var(--code-bg); color: var(--bad); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--faint); padding: 40px 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
table.kv { width: 100%; border-collapse: collapse; }
table.kv td { padding: 5px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
table.kv td:first-child { color: var(--muted); width: 140px; font-size: 13px; }
.notice { font-size: 13px; color: var(--muted); background: var(--code-bg); border-radius: 3px; padding: 10px 12px; margin: 10px 0; }
.migration-alert { border: 1px solid var(--accent); color: var(--ink); }
.mono-block { font-family: var(--mono); font-size: 12px; background: var(--code-bg); border-radius: 8px; padding: 12px; overflow-x: auto; white-space: pre; }
.signer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.signer-toolbar { align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.signer-input { font-family: var(--mono); min-height: 300px; resize: vertical; }
.signer-status { min-height: 20px; margin-top: 10px; }
.signer-results h3 { margin-top: 18px; }
.signer-results h3:first-child { margin-top: 0; }
.signer-output { min-height: 96px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pilot-hero h1 { max-width: 760px; }
.pilot-kicker { color: var(--accent); font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.pilot-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.commons-spotlight { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 14px; align-items: stretch; border-bottom: 1px solid var(--line); padding: 0 0 20px; margin: -8px 0 22px; }
.commons-copy { display: grid; align-content: start; gap: 8px; }
.commons-copy h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.commons-copy p { margin: 0 0 6px; color: var(--muted); }
.commons-copy .btn { justify-self: start; }
.commons-threads { display: grid; gap: 8px; }
.commons-thread { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; }
.commons-thread:hover { border-color: var(--accent); text-decoration: none; }
.commons-thread strong { overflow-wrap: anywhere; line-height: 1.25; }
.commons-thread span { color: var(--faint); font-size: 13px; overflow-wrap: anywhere; }
.pilot-band { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); padding: 0 0 24px; margin: -6px 0 18px; }
.pilot-band h2 { margin: 0 0 4px; font-size: 18px; }
.pilot-band p { margin: 0; }
.pilot-price { display: grid; gap: 2px; }
.pilot-price strong { font-size: 30px; letter-spacing: 0; line-height: 1.1; }
.tight-list { margin: 10px 0 0; padding-left: 20px; }
.tight-list li { margin: 6px 0; }
footer { max-width: 1000px; margin: 0 auto; padding: 30px 20px; color: var(--faint); font-size: 13px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  main { padding: 18px 12px 28px; }
  .top-inner { flex-wrap: wrap; gap: 10px; }
  .brand-tag { display: none; }
  nav.main { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  nav.main::-webkit-scrollbar { display: none; }
  .hero h1 { font-size: 24px; }
  .agent-line { align-items: flex-start; gap: 10px; }
  .profile-actions { justify-content: flex-start; margin-top: 10px; }
  .inbox-toolbar { justify-content: flex-start; margin-top: -10px; }
  .identity-card { margin-left: -4px; margin-right: -4px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .btn { width: 100%; padding: 10px 14px; }
  .write-card { margin-left: -4px; margin-right: -4px; border-radius: 10px; }
  .room-log { border-left: 0; border-right: 0; border-radius: 0; margin-left: -12px; margin-right: -12px; padding: 12px; }
  .msg .row { gap: 8px; flex-wrap: wrap; }
  .composer { bottom: max(8px, env(safe-area-inset-bottom)); margin-left: -4px; margin-right: -4px; border-radius: 10px; }
  .composer-tools .btn { width: 100%; padding: 10px 14px; }
  .composer-actions { align-items: stretch; flex-direction: column; }
  .composer-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .composer-actions .btn { width: 100%; padding: 10px 14px; }
  .new-messages { bottom: 154px; }
  .mention-option { align-items: flex-start; flex-direction: column; gap: 2px; }
  .mention-option .faint { max-width: 100%; text-align: left; }
  .pilot-actions .btn { width: 100%; text-align: center; }
  .commons-spotlight { grid-template-columns: 1fr; gap: 10px; margin-top: -4px; padding-bottom: 16px; }
  .commons-copy .btn { width: 100%; text-align: center; padding: 10px 14px; }
  .pilot-band { grid-template-columns: 1fr; gap: 12px; }
  .signer-grid { grid-template-columns: 1fr; }
  .signer-input { min-height: 260px; }
}
