:root {
  --bg: #0f1115;
  --card: #161a22;
  --card-2: #1c2230;
  --line: #2a3142;
  --fg: #e6e7eb;
  --muted: #8b94a8;
  --accent: #79c0ff;
  --accent-2: #f0b35a;
  --good: #7ad07a;
  --bad: #ff6b6b;
  --warn: #f0b35a;
  --pill: #2d3550;
}
* { box-sizing: border-box; }
/* The `hidden` attribute is the canonical "this element is not in the
   current UI" signal. Author rules with explicit `display:` (.card { display: grid }
   etc.) silently override the user-agent `[hidden] { display: none }`,
   so flag it with !important here once and we don't need per-class
   defensive selectors throughout the rest of the file. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header { padding: 18px 22px 4px; }
header h1 { margin: 0 0 4px 0; font-size: 22px; }
header .sub { margin: 0; color: var(--muted); font-size: 13px; max-width: 70ch; }
header.brand-header {
  display: flex; gap: 14px; align-items: center;
  padding: 18px 22px 6px;
}
header.brand-header .brand-logo {
  width: 58px; height: 58px; border-radius: 12px; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
header.brand-header .brand-text { min-width: 0; }
header.brand-header h1 { margin: 0 0 2px 0; font-size: 22px; letter-spacing: 0.02em; }

section.card { margin: 14px 22px; padding: 14px 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; }
section.card h2 { margin: 0 0 8px 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.hint { color: var(--muted); margin: 0 0 10px; font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
table.kv { border-collapse: collapse; width: 100%; }
table.kv th { text-align: left; padding: 4px 8px 4px 0; color: var(--muted); font-weight: 500; width: 100px; vertical-align: top; }
table.kv td { padding: 4px 0; }
.pill { background: var(--pill); color: var(--accent); padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.pill-muted { color: var(--muted); }
.pill-good  { color: var(--good); }
.pill-bad   { color: var(--bad); }

.bunker-pane { display: grid; gap: 8px; }
.bunker-pane[hidden] { display: none; }
.bunker-flow-heading {
  margin: 8px 0 2px 0;
  font-size: 14px;
  color: var(--fg);
}
.bunker-flow-sub {
  margin: 0 0 6px 0;
}
.bunker-flow-sep {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 16px 0 8px 0;
}

/* QR pairing display */
.qr-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  background: #ffffff08;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
}
.qr-box[hidden] { display: none; }
.qr-img {
  width: 230px; height: 230px;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  display: block;
  image-rendering: pixelated;
}
.qr-instructions p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.qr-instructions p:last-child { margin-bottom: 0; }
.qr-instructions strong { color: var(--accent); margin-right: 4px; }
.qr-box details { grid-column: 1 / -1; margin-top: 4px; }
.qr-box .nc-uri { margin: 6px 0 4px; }
@media (max-width: 640px) {
  .qr-box { grid-template-columns: 1fr; }
  .qr-img { margin: 0 auto; }
}
.nc-uri { background: var(--card-2); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all; font-size: 12px; }
.error { color: var(--bad); font-size: 13px; }

.avatar { width: 32px; height: 32px; border-radius: 6px; background: var(--card-2);
  display: inline-block; vertical-align: middle; image-rendering: pixelated; flex-shrink: 0; }
.avatar-lg { width: 64px; height: 64px; border-radius: 10px; }
.avatar-sm { width: 22px; height: 22px; border-radius: 4px; }

/* Banner image displayed above the identity row when kind:0 includes a
   `banner` field. Scoped to the card width — full-bleed inside the
   card by breaking out of its 14/16px padding. */
.identity-banner {
  margin: -14px -16px 14px;
  height: 110px;
  background-size: cover;
  background-position: center;
  background-color: var(--card-2);
  border-radius: 8px 8px 0 0;
}
.identity-banner[hidden] { display: none !important; }

.identity-row { display: flex; gap: 16px; align-items: flex-start; }
.identity-meta { flex: 1; min-width: 0; }
.identity-name { font-size: 18px; font-weight: 600; margin-bottom: 2px; }
.identity-about { color: var(--muted); font-size: 13px; margin-bottom: 8px; }

.peer-list, .group-list, .draft-list, .ceremony-list, .feed-list { list-style: none; padding: 0; margin: 0; }
.peer-list li, .group-list li, .draft-list li, .ceremony-list li, .feed-list li {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; margin: 6px 0; font-size: 13px;
}
.peer-list .peer-row { display: flex; gap: 10px; align-items: center; }
.peer-list .peer-meta { flex: 1; min-width: 0; }
.peer-list .peer-name { font-weight: 500; }

/* Group section */
.group-card { display: grid; gap: 6px; }
.group-row { display: flex; gap: 14px; align-items: flex-start; }
.group-meta { flex: 1; min-width: 0; display: grid; gap: 4px; }
.group-name { font-size: 16px; font-weight: 600; }
.group-about { color: var(--muted); font-size: 13px; }

.composer summary { cursor: pointer; padding: 6px 0; color: var(--accent); font-size: 13px; }
.composer form { margin-top: 8px; }

select#propose-as-group {
  background: var(--card-2); color: var(--fg); border: 1px solid var(--line);
  border-radius: 4px; padding: 7px 9px; font-size: 13px; width: 100%;
}

/* propose form */
.propose-form-big { display: grid; gap: 10px; }
.propose-form-big label { display: grid; gap: 4px; font-size: 13px; color: var(--fg); }
.propose-form-big label > span:first-child { color: var(--muted); font-size: 12px; }
.propose-form-big select,
.propose-form-big input[type=text],
.propose-form-big input[type=number],
.propose-form-big textarea {
  background: var(--card-2); color: var(--fg); border: 1px solid var(--line);
  border-radius: 4px; padding: 7px 9px; font-size: 13px; font-family: inherit; resize: vertical;
}
.propose-form-big textarea { font-family: ui-monospace, SFMono-Regular, monospace; }
.propose-peers {
  display: grid; gap: 2px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  background: var(--card-2); padding: 6px 8px; border-radius: 4px; border: 1px solid var(--line);
  max-height: 240px; overflow-y: auto;
}
.propose-peers label.peerpick { display: flex; align-items: center; gap: 6px; padding: 3px 6px; cursor: pointer; border-radius: 4px; }
.propose-peers label.peerpick:hover { background: rgba(255,255,255,0.04); }
.propose-peers .peer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.propose-peers .peer-pub { color: var(--muted); font-family: ui-monospace, monospace; font-size: 11px; }
.group-members-note { padding: 4px 6px 8px; }
.group-member-row { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 4px; }
.group-member-row .peer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.propose-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.propose-kind { flex: 0 0 auto; min-width: 110px; }
.propose-kind input { width: 100px; }
.propose-presets { color: var(--muted); font-size: 11px; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.propose-presets button {
  background: var(--card-2); color: var(--fg); border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 999px; font-size: 11px; cursor: pointer;
}
.propose-presets button:hover { background: var(--line); color: var(--accent); }
.propose-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.propose-actions button {
  background: var(--accent); color: #001; border: 0; padding: 8px 18px;
  border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 13px;
}
.propose-actions button:hover { background: #9bd0ff; }

/* Compose context — Archon selector + summary that sits above the
   propose form on the Drafts page. Two states: ad-hoc (the cosigner
   textarea is editable) and group (the summary block stands in for
   the textarea, listing the chosen Archon's members). */
.compose-context {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.compose-context-mode {
  display: flex;
  align-items: center;
  gap: 10px;
}
.compose-context-mode label {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}
.propose-archon-select {
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 7px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  flex: 1; min-width: 0;
}
.propose-archon-select:focus {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.compose-archon-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--card-2);
  border: 1px solid var(--accent);
  border-radius: 6px;
}
.compose-archon-summary[hidden] { display: none !important; }
.compose-archon-summary .avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}
.compose-archon-summary-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.compose-archon-summary-name {
  font-weight: 600;
  font-size: 14px;
}
.compose-archon-summary-members {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.compose-archon-clear {
  align-self: flex-start;
  font-size: 12px;
  padding: 4px 10px;
}

/* "from <Archon>" pill on draft cards that match a saved group's
   membership. Clickable — jumps to that Archon's card. */
.draft-from-archon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--pill);
  color: var(--accent);
  padding: 2px 10px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.draft-from-archon:hover {
  background: rgba(121, 192, 255, 0.18);
  color: var(--fg);
}

/* Compose card collapse — header + body split, button toggles body. */
.propose-card .propose-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.propose-card .propose-header h2 { margin: 0; flex: 1; }
.propose-collapse-btn {
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.propose-collapse-btn:hover {
  color: var(--fg);
  border-color: var(--accent);
}
.propose-body { display: contents; }
.propose-body[hidden] { display: none !important; }

/* Cosigner chip input — tag-style entry. Wrapper looks like a single
   input field; chips and a real <input> live inside it. */
.cosigner-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  min-height: 38px;
  cursor: text;
}
.cosigner-chips:focus-within {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.cosigner-chip-input {
  flex: 1;
  min-width: 140px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  padding: 3px 2px;
  outline: none;
}
.cosigner-chip-input::placeholder { color: var(--muted); }
.cosigner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(121, 192, 255, 0.14);
  border: 1px solid rgba(121, 192, 255, 0.45);
  color: var(--fg);
  padding: 2px 4px 2px 4px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  max-width: 100%;
}
.cosigner-chip .cosigner-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.cosigner-chip-remove {
  background: rgba(0, 0, 0, 0.25);
  border: 0;
  color: var(--fg);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cosigner-chip-remove:hover {
  background: var(--bad);
  color: #fff;
}
.cosigner-error {
  color: var(--bad) !important;
  margin-top: 4px;
  display: block;
}

/* Create Archon — "Add from follow list" button under the chip input. */
.archons-create-tools {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.archons-create-from-follows {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--fg);
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.archons-create-from-follows:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.archons-create-from-follows svg {
  flex-shrink: 0;
  color: var(--accent);
}

/* Follow-list picker modal. */
.follows-picker-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.follows-picker-search {
  flex: 1;
  min-width: 0;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 7px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}
.follows-picker-search:focus {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.follows-picker-toolbar .ghost {
  font-size: 12px;
  padding: 6px 10px;
}
.follows-picker-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  max-height: 48vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.follows-picker-item {
  margin: 0;
}
.follows-picker-row {
  display: grid;
  grid-template-columns: 18px 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
}
.follows-picker-row:hover {
  background: rgba(121, 192, 255, 0.08);
}
.follows-picker-row input[type=checkbox] {
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}
.follows-picker-row .avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.follows-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.follows-picker-pub {
  color: var(--muted);
  font-size: 11px;
}
.follows-picker-actions {
  justify-content: flex-end;
  margin-top: 6px;
}

/* Ceremony-deadline picker modal. Preset grid for the 9 common windows
   plus a collapsible custom-time row, with a live summary of the chosen
   deadline below. */
.ceremony-picker-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}
.ceremony-preset {
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  padding: 9px 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.ceremony-preset:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ceremony-preset.active {
  background: rgba(121, 192, 255, 0.18);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.ceremony-picker-custom {
  margin-bottom: 12px;
}
.ceremony-picker-custom summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  padding: 4px 0;
}
.ceremony-picker-custom-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.ceremony-picker-custom-row input[type=number] {
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 6px 8px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  width: 80px;
}
.ceremony-picker-custom-row select {
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 6px 8px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}
.ceremony-picker-custom-row .ghost {
  font-size: 12px;
  padding: 6px 12px;
}
.ceremony-picker-summary {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--fg);
  margin-bottom: 12px;
}
.ceremony-picker-summary[hidden] { display: none !important; }
.ceremony-picker-summary strong { color: var(--accent); }

/* Char count + warning state above the soft-limit. */
#propose-content-count {
  font-variant-numeric: tabular-nums;
}
#propose-content-count.propose-content-count-warn {
  color: var(--warn);
  font-weight: 600;
}

/* Inline rich-content preview below the content textarea. */
.propose-preview {
  background: var(--card-2);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}
.propose-preview[hidden] { display: none !important; }
.propose-preview-label {
  display: block;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.propose-preview-content {
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg);
}

/* Rich-content tokens — used by the live preview AND by the draft
   snippet on each draft card. */
.rich-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.rich-link:hover { color: #9bd0ff; }
.rich-mention {
  color: var(--accent);
  background: rgba(121, 192, 255, 0.10);
  padding: 0 4px;
  border-radius: 3px;
  cursor: pointer;
}
.rich-mention:hover { background: rgba(121, 192, 255, 0.20); }
.rich-hashtag {
  color: var(--accent-2);
}

/* Drafts list filter tabs. */
.drafts-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}
.filter-tab {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.filter-tab:hover {
  color: var(--fg);
  background: var(--card-2);
}
.filter-tab.active {
  color: var(--accent);
}
.filter-tab.active::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px; bottom: -5px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.filter-tab .pill {
  background: var(--card-2);
}
.filter-tab.active .pill {
  background: rgba(121, 192, 255, 0.18);
  color: var(--accent);
}

/* Rich snippet on each draft card replacing the old single-line
   `kind X · "content"` meta. The kind tag sits inline as a small
   uppercase chip; the body wraps and renders rich tokens. */
.draft-snippet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}
.draft-snippet-kind {
  background: var(--card-2);
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  align-self: start;
}
.draft-snippet-body {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* draft + ceremony cards */
.draft-card { display: grid; gap: 6px; }
.draft-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.sid { color: var(--accent-2); font-family: ui-monospace, monospace; font-size: 12px; }
.state { padding: 2px 10px; border-radius: 999px; font-size: 11px; }
.state-proposed { background: #324a72; color: #cfe1ff; }
.state-accepted, .state-round2_collecting, .state-round1_collecting { background: #4a4327; color: #ffe3a3; }
.state-rejected { background: #6c2424; color: #ffdada; }
.state-ready, .state-waiting_for_t { background: #2c6234; color: #c2f0ca; }
.state-done { background: #1d8438; color: #fff; }
.state-failed, .state-abandoned { background: #6c2424; color: #ffdada; }
.meta { color: var(--muted); font-size: 12px; }

/* editable draft */
.draft-edit { display: grid; gap: 8px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.draft-edit label { display: grid; gap: 3px; font-size: 12px; color: var(--fg); }
.draft-edit label > span:first-child { color: var(--muted); font-size: 12px; }
.draft-edit input[type=number],
.draft-edit textarea {
  background: var(--card); color: var(--fg); border: 1px solid var(--line);
  border-radius: 4px; padding: 6px 8px; font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, monospace; resize: vertical;
}
.draft-edit input[type=number] { width: 100px; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.acts button { background: var(--accent); color: #001; border: 0; padding: 6px 14px;
  border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 600; }
.acts button.bad { background: var(--bad); color: #fff; }
.acts button.warn { background: var(--warn); color: #001; }
.acts button.warn[disabled] { background: var(--line); color: var(--muted); cursor: not-allowed; }
.acts button.go { background: var(--accent-2); color: #001; }
.acts button[disabled] { opacity: 0.6; cursor: not-allowed; }
.edit-hint { color: var(--muted); font-size: 11px; }

pre.evt { background: var(--card); padding: 8px; border: 1px solid var(--line); border-radius: 4px;
  font-size: 11px; overflow-x: auto; max-height: 200px; font-family: ui-monospace, monospace; }

/* cosigner chips */
.cosig-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1.5px solid var(--line);
  padding: 3px 9px 3px 4px;
  border-radius: 999px; font-size: 12px; line-height: 1.2; color: var(--fg);
}
.cosig-chip.cosig-accepted { background: rgba(122,208,122,0.20); border-color: rgba(122,208,122,0.70); }
.cosig-chip.cosig-pending  { background: rgba(240,179,90,0.20); border-color: rgba(240,179,90,0.70); }
.cosig-chip.cosig-declined { background: rgba(255,107,107,0.22); border-color: rgba(255,107,107,0.75); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  vertical-align: middle; margin-right: 3px; }
.status-dot.status-accepted { background: var(--good); }
.status-dot.status-pending { background: var(--accent-2); }
.status-dot.status-declined { background: var(--bad); }

/* legacy feed-entry rules — kept for the technical-details fallback
   path; new timeline uses .post-card below. */
.feed-list li.feed-entry { display: flex; gap: 12px; align-items: flex-start; }
.feed-entry .agg-avatar { margin-top: 2px; }
.feed-entry .feed-meta { flex: 1; min-width: 0; }
.feed-entry .feed-content { font-size: 14px; margin-bottom: 4px; white-space: pre-wrap; word-break: break-word; }
.feed-entry .feed-cosigners { color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.feed-entry .feed-when { color: var(--muted); font-size: 11px; }
.feed-entry .feed-eventid { color: var(--muted); font-family: ui-monospace, monospace; font-size: 11px; word-break: break-all; }

/* === Feed redesign — follow-graph timeline === */

/* Card header now carries a refresh button on the right. */
.feed-card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.feed-refresh-btn {
  padding: 2px 8px; font-size: 14px; line-height: 1;
}

/* Inline composer at top of Feed view. Compact card; the textarea
   auto-grows via the rows attribute + CSS min-height fallback. */
.feed-composer-card { padding: 10px 12px; }
.feed-composer-form { display: flex; flex-direction: column; gap: 8px; }
.feed-composer-content {
  width: 100%;
  min-height: 56px;
  font-size: 14px;
  resize: vertical;
  background: var(--card-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}
.feed-composer-content:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(80, 140, 255, 0.18);
}
.feed-composer-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.feed-composer-as {
  display: flex; align-items: center; gap: 6px;
}
.feed-composer-as-select {
  background: var(--card-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
}
.feed-composer-count { font-size: 11px; color: var(--muted); }
.feed-composer-status { font-size: 12px; color: var(--muted); flex: 1; }
.feed-composer-actions { display: flex; gap: 6px; }
.feed-composer-context {
  padding: 6px 8px;
  background: rgba(80, 140, 255, 0.08);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  font-size: 12px;
}
.feed-composer-preview {
  background: var(--card-2);
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
}

/* === Post cards === */
.post-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-2);
  margin-bottom: 8px;
}
.post-card-reply {
  padding: 8px 10px;
  margin-bottom: 4px;
  background: rgba(0,0,0,0.10);
}
.post-card-archon {
  border-left: 3px solid var(--accent);
}
.post-avatar-slot { flex-shrink: 0; cursor: pointer; }
.post-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card);
  border: 1px solid var(--line);
  display: block;
}
.post-card-reply .post-avatar { width: 28px; height: 28px; }
.post-avatar-blank {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px dashed var(--line);
  display: inline-block;
}
.post-body { flex: 1; min-width: 0; }
.post-head {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
}
.post-name {
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
}
.post-name:hover { color: var(--accent); }
.post-archon-chip {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(80, 140, 255, 0.14);
  color: var(--accent);
  font-weight: 500;
  border: 1px solid rgba(80, 140, 255, 0.25);
}
.post-cosigner-stack {
  display: inline-flex; align-items: center; gap: 0;
}
.post-cosigner-mini {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--card-2);
  background: var(--card);
  margin-left: -4px;
  display: inline-block;
  object-fit: cover;
  vertical-align: middle;
}
.post-cosigner-mini:first-child { margin-left: 0; }
.post-cosigner-mini-blank { background: var(--card); }
.post-cosigner-more {
  margin-left: 4px;
  font-size: 10px;
  color: var(--muted);
}
.post-when { color: var(--muted); font-size: 11px; margin-left: auto; }
.post-reply-context { font-size: 11px; margin-bottom: 4px; }
.post-content {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
  color: var(--fg);
}
.post-actions {
  display: flex; gap: 12px; align-items: center;
  margin-top: 6px;
}
.post-reply-btn {
  font-size: 11px;
  padding: 2px 8px;
}
.post-repost-btn {
  font-size: 11px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted, #b0b6c2);
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
.post-repost-btn:hover:not(:disabled) {
  color: #7ad07a;
  background: rgba(122, 208, 122, 0.10);
  border-color: rgba(122, 208, 122, 0.45);
}
.post-repost-btn:disabled {
  cursor: default;
  opacity: 0.8;
}
.post-repost-btn-done {
  color: #7ad07a;
  background: rgba(122, 208, 122, 0.08);
  border-color: rgba(122, 208, 122, 0.35);
}

/* Edit-mode flavour on the Archon Create button — kicks in after the
   user picks "Edit" on a cosigner-set collision. The submit handler
   then publishes as a re-publish without re-asking. */
button.primary.btn-republish {
  background: linear-gradient(135deg, rgba(255, 188, 99, 0.22), rgba(122, 162, 247, 0.22));
  border-color: rgba(255, 188, 99, 0.55);
  box-shadow: 0 0 0 0 rgba(255, 188, 99, 0.45);
  animation: republish-glow 2.2s ease-in-out infinite;
}
@keyframes republish-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 188, 99, 0.35); }
  50%      { box-shadow: 0 0 0 4px rgba(255, 188, 99, 0.12), 0 0 18px 1px rgba(255, 188, 99, 0.25); }
}
@media (prefers-reduced-motion: reduce) {
  button.primary.btn-republish { animation: none; }
}
.post-reactions {
  font-size: 11px;
  color: var(--muted);
}

/* Inline collapsed thread — replies nest under their root with a
   left rail. */
.post-thread-wrap { list-style: none; }
.post-thread {
  list-style: none;
  margin: 0 0 8px 28px;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--line);
}
.post-thread-expander {
  list-style: none;
  padding: 4px 0;
}
.post-thread-expander button {
  font-size: 11px;
  padding: 2px 8px;
}

.feed-empty {
  text-align: center;
  padding: 20px;
}
.feed-empty p { margin: 0 0 4px 0; }

/* Reposts (kind:6 / kind:16): small "X reposted" head + the original
   note rendered as a reply-style card underneath. */
.post-card-repost { display: block; padding: 6px 12px 10px 12px; }
.post-repost-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  margin-bottom: 4px;
}
.post-repost-glyph { font-size: 14px; }
.post-repost-inner {
  list-style: none; padding: 0; margin: 0;
}
.post-card-orphan {
  padding: 8px 12px;
  border: 1px dashed var(--line);
  background: transparent;
}

/* Inline event-ref chip — small label rendered IN the body wherever a
   nostr:nevent1… / note1… / naddr1… appears in content. The full
   embedded card lives below the body via .post-quote-wrap. */
.rich-event-ref {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(80, 140, 255, 0.10);
  color: var(--accent);
  border: 1px solid rgba(80, 140, 255, 0.20);
  white-space: nowrap;
  margin: 0 2px;
}

/* Embedded quote card(s) under a post body. Each item is a
   compact post-card variant (same renderPostHTML, variant="quote"). */
.post-quote-wrap {
  list-style: none;
  margin: 6px 0 0 0;
  padding: 0;
}
.post-card-quote {
  margin: 4px 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.10);
  border-left: 2px solid var(--accent);
}
.post-card-quote .post-avatar { width: 24px; height: 24px; }
.post-card-quote .post-avatar-blank { width: 24px; height: 24px; }
.post-card-quote .post-content { font-size: 13px; }
.post-card-quote .post-actions { display: none; }

/* OTS timestamp badge — one per feed entry. Sits inline with the
   when-line; colour and weight indicate verdict. */
.ts-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  margin-left: 6px;
  vertical-align: baseline;
  white-space: nowrap;
}
.ts-anchored { background: rgba(0, 160, 60, 0.12); color: #1c8c46; }
.ts-claim    { background: rgba(120, 120, 120, 0.12); color: #555; }
.ts-pending  { background: rgba(220, 160, 30, 0.15); color: #a06b00; }
.ts-invalid  { background: rgba(200, 50, 50, 0.15); color: #a02828; }
.ts-loading  { background: rgba(120, 120, 120, 0.08); color: var(--muted); }

label.tick { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--fg); padding: 3px 0; }
label.tick input { accent-color: var(--accent); }

/* History sections */
.history-section { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.history-section > summary {
  cursor: pointer; padding: 6px 0; color: var(--muted); font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.history-section > summary::marker { color: var(--muted); }
.history-section > summary:hover { color: var(--accent); }
.history-section[open] > summary { color: var(--fg); }
.draft-list.history li.is-history, .ceremony-list.history li.is-history {
  opacity: 0.85;
}

/* ===== Welcome banner ===== */
.welcome-banner {
  margin: 14px 22px 0;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(121,192,255,0.12), rgba(240,179,90,0.10));
  border: 1px solid rgba(121,192,255,0.40);
  border-radius: 10px;
}
.welcome-inner {
  display: flex; gap: 18px; align-items: flex-start;
  flex-wrap: wrap;
}
.welcome-text { flex: 1; min-width: 280px; }
.welcome-text h2 {
  margin: 0 0 6px 0; font-size: 18px; color: var(--accent);
}
.welcome-text p { margin: 0; color: var(--fg); font-size: 14px; line-height: 1.5; }
.welcome-actions {
  display: flex; gap: 8px; flex-direction: column;
  flex-shrink: 0;
}

/* ===== Buttons (named variants) ===== */
button.primary {
  background: var(--accent); color: #001; border: 0;
  padding: 9px 18px; border-radius: 4px; cursor: pointer;
  font-weight: 600; font-size: 13px;
}
button.primary:hover { background: #9bd0ff; }
button.ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); padding: 8px 16px;
  border-radius: 4px; cursor: pointer; font-size: 13px;
}
button.ghost:hover { background: var(--card-2); color: var(--fg); }

/* ===== Copyable text rows ===== */
.copyable {
  display: flex; align-items: center; gap: 8px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 5px 8px; margin: 6px 0;
}
.copyable-label {
  color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.04em; flex-shrink: 0;
}
.copyable .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.copy-btn {
  background: transparent; color: var(--accent);
  border: 1px solid var(--line); padding: 3px 10px;
  border-radius: 4px; cursor: pointer; font-size: 11px;
  flex-shrink: 0;
}
.copy-btn:hover { background: var(--card); color: var(--fg); border-color: var(--accent); }

/* ===== Technical details disclosure ===== */
.technical-details {
  margin-top: 8px; padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.technical-details > summary {
  cursor: pointer; color: var(--muted); font-size: 12px; padding: 4px 0;
}
.technical-details > summary::marker { color: var(--muted); }
.technical-details > summary:hover { color: var(--accent); }
.technical-details[open] > summary { color: var(--fg); margin-bottom: 6px; }

/* ===== Bunker paired message ===== */
.paired-msg {
  background: rgba(122,208,122,0.10);
  border: 1px solid rgba(122,208,122,0.40);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--fg);
}
.paired-msg .check {
  color: var(--good); font-weight: 700; margin-right: 4px;
}

/* ===== Ceremony progress bar ===== */
.ceremony-progress {
  display: flex; gap: 4px; margin: 8px 0; align-items: stretch;
}
.ceremony-progress .step {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--card); border: 1px solid var(--line);
  position: relative;
}
.ceremony-progress .step.done { background: var(--good); border-color: var(--good); }
.ceremony-progress .step.active {
  background: var(--accent-2); border-color: var(--accent-2);
  animation: pulse 1.2s ease-in-out infinite;
}
.ceremony-progress .step.failed { background: var(--bad); border-color: var(--bad); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.ceremony-progress-labels {
  display: flex; gap: 4px; margin: 2px 0 8px; font-size: 10px; color: var(--muted);
}
.ceremony-progress-labels span { flex: 1; text-align: center; }
.ceremony-progress-labels span.active { color: var(--accent-2); font-weight: 600; }
.ceremony-progress-labels span.done { color: var(--good); }
.ceremony-progress-labels span.failed { color: var(--bad); }

/* Ceremony deadline countdown — turns warning-yellow under 60s and
   error-red under 30s so the user can see a stall coming. */
.ceremony-countdown.warn  { color: var(--warn, #d8a000); font-weight: 500; }
.ceremony-countdown.crit  { color: var(--bad);          font-weight: 600; }
.ceremony-countdown.over  { color: var(--bad);          font-weight: 600; text-decoration: line-through; }

/* Cancel / retry / jump action row on the ceremony card. */
.ceremony-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 8px;
}
.ceremony-cancel-btn {
  font-size: 12px; padding: 3px 10px;
  color: var(--bad); border-color: rgba(200,80,80,0.4);
}
.ceremony-cancel-btn:hover { background: rgba(200,80,80,0.10); }
.ceremony-retry-btn { font-size: 12px; padding: 3px 10px; }
.ceremony-jump-draft {
  margin-left: auto;
  text-decoration: none;
  font-size: 11px;
  color: var(--muted);
}
.ceremony-jump-draft:hover { color: var(--accent); text-decoration: underline; }

/* "Waiting on X, Y" hint right above the round-counter line. */
.ceremony-pending-hint {
  background: rgba(216, 160, 0, 0.10);
  border-left: 2px solid var(--warn, #d8a000);
  padding: 4px 8px;
  border-radius: 0 4px 4px 0;
  margin: 4px 0;
}

/* "Failed → retried" backreference on the archive card. */
.ceremony-retried-hint {
  color: var(--muted);
  font-style: italic;
}
.ceremony-retry-link {
  color: var(--accent);
  text-decoration: none;
}
.ceremony-retry-link:hover { text-decoration: underline; }

/* Flash a card when we navigate to it via the draft↔ceremony link. */
.draft-card-flash {
  animation: archon-card-flash 1.5s ease-out;
}
@keyframes archon-card-flash {
  0%   { box-shadow: 0 0 0 0 rgba(80, 140, 255, 0.0); }
  20%  { box-shadow: 0 0 0 4px rgba(80, 140, 255, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(80, 140, 255, 0.0); }
}

/* ===== Advanced options details ===== */
details.composer.advanced > summary {
  color: var(--muted);
}
details.composer.advanced[open] > summary {
  color: var(--fg);
}

/* ===== Friendlier draft-state hint above the action buttons ===== */
.draft-cta {
  background: rgba(121,192,255,0.08);
  border-left: 3px solid var(--accent);
  padding: 6px 10px; margin: 6px 0; border-radius: 0 4px 4px 0;
  font-size: 13px; color: var(--fg);
}
.draft-cta.ready {
  background: rgba(122,208,122,0.10); border-left-color: var(--good);
}
.draft-cta.action-needed {
  background: rgba(240,179,90,0.12); border-left-color: var(--accent-2);
}

/* Inline counter-proposal editor — appears below a draft card when
   the user clicks "Edit & re-propose". Submitting declines the
   original and publishes a fresh kind:1730 with the edited content
   to the same cosigner set. */
.draft-edit-form {
  margin-top: 8px;
  background: var(--card-2);
  border: 1px solid var(--warn);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.draft-edit-form-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.draft-edit-form-label strong { color: var(--fg); }
.draft-edit-textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 4px;
  padding: 7px 9px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
}
.draft-edit-textarea:focus {
  outline: 1px solid var(--warn);
  outline-offset: -1px;
  border-color: var(--warn);
}
/* Kind:0 specialised counter-proposal form — grid of small labelled
   fields instead of a raw-JSON textarea. */
.draft-edit-k0-label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.draft-edit-k0-label > span:first-child {
  color: var(--muted);
  font-size: 12px;
}
.draft-edit-k0-label input,
.draft-edit-k0-label textarea {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 4px;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
}
.draft-edit-k0-label input:focus,
.draft-edit-k0-label textarea:focus {
  outline: 1px solid var(--warn);
  outline-offset: -1px;
  border-color: var(--warn);
}

/* Mini profile preview (avatar + banner + name + bio) — used in the
   Create Archon form and in the group-creation-in-progress cards. */
.profile-preview {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin: 4px 0;
}
.profile-preview-banner {
  height: 60px;
  background-size: cover;
  background-position: center;
  background-color: var(--card);
}
.profile-preview-no-banner .profile-preview-banner {
  height: 0;
  display: none;
}
.profile-preview-row {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  align-items: flex-start;
}
.profile-preview-avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--card);
  border: 2px solid var(--card-2);
}
.profile-preview:not(.profile-preview-no-banner) .profile-preview-avatar {
  margin-top: -26px;
}
.profile-preview-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-preview-name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-preview-about {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

/* Create Archon — preview block wrapper that gives the preview its
   own labelled compartment alongside the other form labels. */
.archons-create-preview-block {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.archons-create-preview-label {
  color: var(--muted);
  font-size: 12px;
}

/* Ceremony countdown — small inline span in the header line plus a
   bigger banner that surfaces only once round 1 has started (i.e.
   while we're collecting nonces / partial sigs / waiting for T). */
.ceremony-countdown {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
}
.ceremony-countdown.ceremony-countdown-done {
  color: var(--warn);
}
.ceremony-countdown-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(121, 192, 255, 0.10);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 4px 0;
}
.ceremony-countdown-banner-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ceremony-countdown-big {
  font-size: 17px;
  letter-spacing: 0.02em;
}

/* ===== Clickable profile chips/avatars ===== */
[data-profile-pub] { cursor: pointer; }
.cosig-chip[data-profile-pub]:hover {
  filter: brightness(1.15);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.peer-row[data-profile-pub]:hover,
.group-row[data-profile-pub]:hover,
.group-member-row[data-profile-pub]:hover {
  background: rgba(121,192,255,0.06);
  border-radius: 6px;
}
.avatar[data-profile-pub]:hover { opacity: 0.85; }
#id-name[data-profile-pub]:hover,
#id-avatar[data-profile-pub]:hover { opacity: 0.85; }

/* ===== Profile modal ===== */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(3px);
}
.modal-content {
  position: relative; z-index: 1;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 24px 24px 22px;
  width: calc(100% - 40px); max-width: 480px;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 12px 50px rgba(0,0,0,0.55);
}
.modal-close, .modal-back {
  position: absolute; top: 10px;
  background: none; border: 0; color: var(--muted);
  font-size: 22px; cursor: pointer; line-height: 1;
  padding: 4px 9px; border-radius: 6px;
}
.modal-close { right: 10px; }
.modal-back  { left: 10px; font-size: 18px; padding-top: 5px; }
.modal-close:hover, .modal-back:hover {
  color: var(--fg); background: var(--card-2);
}

.profile-modal-body { padding-top: 6px; }

/* Banner — full-bleed strip at the top of the modal, lifted out of the
   modal-content's 24px padding via negative margin. Background image
   from kind:0 metadata; bottom gradient blends into the card body so
   text below stays readable on lighter banners.
   `position: relative` is needed for the ::after gradient pseudo, but
   it also promotes the banner into the positioned-stacking bucket —
   so the avatar and the modal close/back buttons need explicit
   z-index to stay visually in front (see below). */
.profile-modal-banner {
  margin: -24px -24px 14px;
  height: 140px;
  background-color: var(--card-2);
  background-size: cover;
  background-position: center;
  border-radius: 12px 12px 0 0;
  position: relative;
  z-index: 0;
}
.profile-modal-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(22, 26, 34, 0.85) 100%);
  border-radius: inherit;
  pointer-events: none;
}

.profile-modal-header {
  display: flex; gap: 16px; align-items: flex-start;
  position: relative;
  z-index: 1;
}
.profile-modal-header .avatar-xl {
  width: 88px; height: 88px; border-radius: 14px;
  flex-shrink: 0; background: var(--card-2);
  image-rendering: pixelated;
}
/* When a banner is present, lift the avatar so it overlaps the banner
   and give it a thick frame to separate from the image behind.
   `position: relative; z-index: 1` puts it in the positioned-stacking
   bucket and explicitly above the banner (which sits at z-index: 0). */
.profile-modal-header-with-banner .avatar-xl {
  margin-top: -52px;
  border: 3px solid var(--card);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  background: var(--card);
  position: relative;
  z-index: 1;
}

/* Subtle backing under the close/back buttons so they remain visible
   when a busy banner sits beneath them. z-index keeps them above the
   banner (which is also a positioned element). */
#profile-modal .modal-close,
#profile-modal .modal-back {
  background: rgba(15, 17, 21, 0.55);
  backdrop-filter: blur(4px);
  z-index: 2;
}
#profile-modal .modal-close:hover,
#profile-modal .modal-back:hover {
  background: rgba(15, 17, 21, 0.78);
  color: var(--fg);
}
.profile-modal-meta { flex: 1; min-width: 0; }
.profile-modal-name {
  font-size: 19px; font-weight: 600; margin-bottom: 2px;
  word-break: break-word;
}
.profile-modal-badges {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 8px;
}
.profile-modal-about {
  color: var(--fg); font-size: 13px; line-height: 1.45;
  margin: 6px 0 8px;
  word-break: break-word;
}
.profile-modal-npub-row {
  display: flex; gap: 6px; align-items: center;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 5px 8px; margin-top: 8px;
}
.profile-modal-npub-row .label {
  color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.profile-modal-npub-row .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.profile-modal-section {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.profile-modal-section h3 {
  margin: 0 0 10px 0; font-size: 12px; color: var(--muted);
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em;
}
.profile-member-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.profile-member-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px;
  cursor: pointer;
}
.profile-member-list li:hover { background: var(--card-2); }
.profile-member-list .peer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.profile-member-list .peer-pub { color: var(--muted); font-size: 11px; font-family: ui-monospace, monospace; }
.profile-member-you { color: var(--accent); font-size: 11px; }

/* Subtle frame on the big modal avatar so a real picture and the
   blank fallback both feel deliberate. */
.profile-modal-header .avatar-xl {
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

/* The "↗ Open in client" external link sits at the right of the npub
   row, subtle but discoverable. */
.profile-modal-external {
  margin-left: auto; padding-left: 8px;
  color: var(--muted); font-size: 11px;
  text-decoration: none; white-space: nowrap;
}
.profile-modal-external:hover { color: var(--accent); }

/* Recent posts list */
.profile-post-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.profile-post {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px;
}
.profile-post-meta { font-size: 11px; margin-bottom: 4px; }
.profile-post-body {
  font-size: 13px; line-height: 1.45; white-space: pre-wrap;
  word-break: break-word;
}

/* Shared Archons list — clickable rows */
.profile-archon-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.profile-archon-item {
  display: flex; align-items: baseline; gap: 6px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
}
.profile-archon-item:hover { background: var(--card-2); }
.profile-archon-item[data-profile-pub=""] { cursor: default; }
.profile-archon-name { font-weight: 500; }

/* Relay list (NIP-65) */
.profile-relay-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.profile-relay-list li {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 5px 8px;
}
.profile-relay-list .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.profile-section-loading { font-style: italic; opacity: 0.75; }

/* ============================================================ */
/* Identity card — self-profile editor                          */
/* ============================================================ */

.id-edit-btn { margin-left: auto; font-size: 12px; padding: 4px 10px; }
.id-edit-form[hidden] { display: none !important; }
.id-edit-form .id-edit-preview {
  margin-top: 6px;
  padding: 12px;
  background: var(--card-2);
  border: 1px dashed var(--line);
  border-radius: 6px;
}
.id-edit-preview-label {
  display: block;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.id-edit-preview-banner {
  margin: 0 -12px 12px;
  height: 72px;
  background-size: cover;
  background-position: center;
  background-color: var(--card);
  border-radius: 4px 4px 0 0;
}
.id-edit-preview-banner[hidden] { display: none !important; }
.id-edit-preview-row {
  display: flex; gap: 14px; align-items: flex-start;
}
.id-edit-preview-meta { flex: 1; min-width: 0; }

/* ============================================================ */
/* App shell — sidebar + content                                */
/* ============================================================ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  padding: 4px 6px;
}
.sidebar .brand-logo-sm {
  width: 32px; height: 32px;
  border-radius: 7px;
  flex-shrink: 0;
}
.sidebar .brand-title {
  font-weight: 600; font-size: 15px;
  letter-spacing: 0.01em;
}

.sidebar .nav {
  display: flex; flex-direction: column;
  gap: 2px;
  flex: 1;
}
.sidebar .nav-item {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  text-align: left;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.sidebar .nav-item .nav-label { flex: 1; }
.sidebar .nav-item .nav-dot {
  /* Stylized red dot riding on top-right of the nav item, signaling an
     unhandled item in that view (an inbound draft, a ceremony waiting
     for your participation, etc.). Visibility is toggled from JS by
     setting/removing the `hidden` attribute. */
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 2px var(--card), 0 0 6px rgba(255, 107, 107, 0.55);
  flex-shrink: 0;
  animation: nav-dot-pulse 1.8s ease-in-out infinite;
}
@keyframes nav-dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.15); opacity: 0.85; }
}
.sidebar .nav-item:hover {
  background: var(--card-2);
  color: var(--fg);
}
.sidebar .nav-item.active {
  background: var(--card-2);
  color: var(--accent);
  font-weight: 500;
}
/* Initial attention-glow on a nav-item — same vibe as the demo
   button. Driven by JS: removed after the user first visits the
   target view or once the demo is completed. */
.sidebar .nav-item.nav-glow {
  color: var(--accent);
  background: linear-gradient(135deg, rgba(121,192,255,0.18), rgba(121,192,255,0.04));
  box-shadow:
    0 0 10px rgba(121, 192, 255, 0.4),
    0 0 22px rgba(121, 192, 255, 0.2),
    inset 0 0 8px rgba(121, 192, 255, 0.12);
  animation: nav-glow-pulse 2.2s ease-in-out infinite;
}
@keyframes nav-glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 10px rgba(121, 192, 255, 0.4),
      0 0 22px rgba(121, 192, 255, 0.18),
      inset 0 0 8px rgba(121, 192, 255, 0.10);
  }
  50% {
    box-shadow:
      0 0 16px rgba(121, 192, 255, 0.7),
      0 0 32px rgba(121, 192, 255, 0.28),
      inset 0 0 12px rgba(121, 192, 255, 0.18);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar .nav-item.nav-glow { animation: none; }
}

.sidebar-foot { margin-top: auto; }
.sidebar-id {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
}
.sidebar-id[hidden] { display: none; }
.sidebar-id .avatar-sm {
  width: 32px; height: 32px;
  flex-shrink: 0;
}
/* Suppress the browser's broken-image glyph when an avatar has no
   src yet (placeholder identicon still loading) or when an external
   picture URL fails to resolve. Render a clean neutral block instead. */
img.avatar-fallback-blank,
img.avatar:not([src]),
img.avatar[src=""] {
  background: var(--card-2);
  border: 1px solid var(--line);
}
img.avatar-fallback-blank { object-fit: cover; }
.sidebar-id-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sidebar-id-name {
  font-size: 13px; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-id-mode {
  font-size: 11px;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 8px 0 32px;
}

.view {
  /* default visible; router toggles `hidden` per view */
}
.view[hidden] { display: none; }

.view-header {
  padding: 18px 22px 4px;
}
.view-header h1 {
  margin: 0 0 4px 0;
  font-size: 22px;
  letter-spacing: 0.01em;
}
.view-header .hint {
  margin: 0;
  max-width: 70ch;
}

/* ============================================================ */
/* Login modal — same .modal base, narrower content              */
/* ============================================================ */

.modal-content-narrow {
  max-width: 460px;
}
.login-modal-card { padding: 28px 28px 22px; }

.login-modal-hero {
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 20px;
}
.login-modal-logo {
  width: 56px; height: 56px; border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(255, 255, 255, 0.05);
}
.login-modal-hero-text { min-width: 0; }
.login-modal-body h2#login-modal-title {
  margin: 0 0 4px;
  font-size: 19px;
  letter-spacing: 0.01em;
}
.login-modal-lede {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.login-options {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.login-option {
  text-align: left;
  display: grid;
  grid-template-columns: 32px 1fr 16px;
  align-items: center;
  column-gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--fg);
  transition: border-color 0.12s ease, background 0.12s ease,
              transform 0.12s ease;
}
.login-option:hover {
  background: var(--bg);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.login-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.login-option-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(121, 192, 255, 0.08);
  color: var(--accent);
  border-radius: 8px;
  flex-shrink: 0;
}
.login-option-content { display: flex; flex-direction: column; gap: 2px; }
.login-option-chev {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  transition: transform 0.12s ease, color 0.12s ease;
}
.login-option:hover .login-option-chev {
  color: var(--accent);
  transform: translateX(2px);
}

.login-option strong { font-size: 14px; font-weight: 600; }
.login-option .hint { margin: 0; font-size: 12px; color: var(--muted); }

.login-option-primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(121, 192, 255, 0.18), rgba(121, 192, 255, 0.04));
}
.login-option-primary:hover {
  background: linear-gradient(135deg, rgba(121, 192, 255, 0.26), rgba(121, 192, 255, 0.08));
}
.login-option-primary .login-option-icon {
  background: var(--accent); color: #001026;
}

/* Legacy .login-option.primary support kept in case other call sites
   still apply it directly — the new card adds .login-option-primary,
   but `class="primary login-option"` (from older markup) shouldn't
   suddenly turn into the old full-accent block. */
.login-option.primary {
  background: linear-gradient(135deg, rgba(121, 192, 255, 0.18), rgba(121, 192, 255, 0.04));
  color: var(--fg);
}
.login-option.primary .hint { color: var(--muted); }

.login-modal-foot {
  margin: 18px 0 0 !important;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

/* Form variants nested inside the login modal need the body-level
   margin-bottom override so they don't sit on top of the foot. */
.login-modal-body form { margin-bottom: 6px; }

@media (max-width: 480px) {
  .login-modal-hero { gap: 12px; }
  .login-modal-logo { width: 48px; height: 48px; }
  .login-modal-body h2#login-modal-title { font-size: 17px; }
}

/* Modal close button stays hidden on first boot (no key yet);
   `[hidden]` already handles that — no extra rule needed. */

/* ============================================================ */
/* My Archons — Demo Archon button                              */
/* ============================================================ */

.archon-demo-banner { margin: 14px 22px; }
.archon-demo-banner[hidden] { display: none !important; }

.archon-demo-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, #2a4a8a 0%, #1c2230 100%);
  border: 2px solid var(--accent);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  color: var(--fg);
  text-align: left;
  box-shadow:
    0 0 18px rgba(121, 192, 255, 0.55),
    0 0 38px rgba(121, 192, 255, 0.25),
    inset 0 0 12px rgba(121, 192, 255, 0.15);
  animation: demo-glow 2.2s ease-in-out infinite;
  transition: transform 0.12s;
}
.archon-demo-btn:hover { transform: translateY(-1px); }
.archon-demo-btn .demo-emoji { font-size: 26px; filter: drop-shadow(0 0 8px rgba(121, 192, 255, 0.6)); }
.archon-demo-btn .demo-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.archon-demo-btn .demo-text strong { font-size: 17px; letter-spacing: 0.01em; color: #d6e8ff; }
.archon-demo-btn .demo-text .demo-sub { font-size: 12px; color: #a4b8d4; }
.archon-demo-btn .demo-text em { color: var(--accent); font-style: normal; font-weight: 500; }

/* "Quiet" mode after user declined the demo — still visible, no glow. */
.archon-demo-btn.quiet {
  background: var(--card-2);
  border-color: var(--line);
  box-shadow: none;
  animation: none;
}
.archon-demo-btn.quiet .demo-emoji { filter: none; opacity: 0.6; }
.archon-demo-btn.quiet .demo-text strong { color: var(--fg); }
.archon-demo-btn.quiet .demo-text em      { color: var(--muted); font-weight: 400; }

@keyframes demo-glow {
  0%, 100% {
    box-shadow:
      0 0 18px rgba(121, 192, 255, 0.55),
      0 0 38px rgba(121, 192, 255, 0.25),
      inset 0 0 12px rgba(121, 192, 255, 0.15);
  }
  50% {
    box-shadow:
      0 0 24px rgba(121, 192, 255, 0.85),
      0 0 56px rgba(121, 192, 255, 0.45),
      inset 0 0 16px rgba(121, 192, 255, 0.25);
  }
}

/* ============================================================ */
/* Tutorial overlay — text-box walkthrough                       */
/* ============================================================ */

.tutorial-overlay {
  position: fixed;
  top: 88px;
  right: 24px;
  width: 320px;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 18px rgba(121, 192, 255, 0.18);
  z-index: 900;
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg);
}
.tutorial-overlay[hidden] { display: none !important; }
/* Slide-in entrance when the overlay first un-hides. The animation
   runs from a fresh element instance each time `[hidden]` flips off
   because we keep the same DOM node — the browser restarts the
   animation on toggle since the node's display state changes. */
.tutorial-overlay:not([hidden]) {
  animation: tutorial-enter 0.32s ease-out;
}
@keyframes tutorial-enter {
  from { opacity: 0; transform: translateX(12px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0)    scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .tutorial-overlay:not([hidden]) { animation: none; }
}
/* Only the top-level <strong> in the tutorial step is the title and
   gets block display + accent colour. Inline <strong> inside the
   body <p> stays inline so words don't wrap onto new lines. */
.tutorial-overlay .tutorial-step > strong { color: var(--accent); display: block; margin-bottom: 6px; font-size: 14px; }
.tutorial-overlay .tutorial-step p { margin: 0 0 6px; }
.tutorial-overlay .tutorial-step p:last-child { margin-bottom: 0; }
.tutorial-overlay .tutorial-step p strong { color: var(--fg); }
.tutorial-overlay .tutorial-step p em { color: var(--accent); font-style: normal; }
.tutorial-overlay .tutorial-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================================ */
/* Empty states — friendly placeholders for lists with no data  */
/* ============================================================ */
.empty-state {
  list-style: none;
  background: none !important;
  border: 0 !important;
  text-align: center;
  padding: 28px 16px !important;
  color: var(--muted);
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.empty-state-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--card-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.empty-state-title { color: var(--fg); font-size: 14px; font-weight: 500; }
.empty-state-sub {
  font-size: 12px;
  max-width: 360px;
  line-height: 1.5;
}

/* Highlight for the proposal card that High Templar is sending —
   so the user can locate it among the rest of My Archons. */
.archon-demo-target,
.demo-focused {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
  animation: demo-target-pulse 1.6s ease-in-out infinite;
  scroll-margin-top: 80px;
}
@keyframes demo-target-pulse {
  0%, 100% { outline-color: rgba(121, 192, 255, 0.6); }
  50%      { outline-color: rgba(121, 192, 255, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .archon-demo-target,
  .demo-focused { animation: none; }
}

/* Demo suspense popup — fixed modal that fills the centre of the
   screen for the 5-second pause between Start demo and HT's 1730
   landing. The progress bar animates from 0 → 100% in lockstep with
   the JS countdown so the user sees the wait is bounded. */
.demo-suspense .modal-content {
  max-width: 440px;
  text-align: center;
  padding: 30px 28px 24px;
}
.demo-suspense-emoji {
  font-size: 38px;
  filter: drop-shadow(0 0 14px rgba(121, 192, 255, 0.7));
  margin-bottom: 6px;
}
.demo-suspense-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.4;
}
.demo-suspense-card .hint {
  margin: 0 0 18px;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}
.demo-suspense-bar-track {
  width: 100%;
  height: 8px;
  background: var(--card-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}
.demo-suspense-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #b8e0ff);
  box-shadow: 0 0 12px rgba(121, 192, 255, 0.6);
}
.demo-suspense-secs {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.demo-suspense-secs span {
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
}

/* Glowing "Start demo →" button — same accent pulse as the demo
   banner button itself, scaled down a touch since it's smaller. */
.demo-start-glow {
  box-shadow:
    0 0 14px rgba(121, 192, 255, 0.55),
    0 0 28px rgba(121, 192, 255, 0.22);
  animation: demo-start-pulse 2.2s ease-in-out infinite;
}
@keyframes demo-start-pulse {
  0%, 100% {
    box-shadow:
      0 0 14px rgba(121, 192, 255, 0.55),
      0 0 28px rgba(121, 192, 255, 0.22);
  }
  50% {
    box-shadow:
      0 0 20px rgba(121, 192, 255, 0.85),
      0 0 40px rgba(121, 192, 255, 0.34);
  }
}
@media (prefers-reduced-motion: reduce) {
  .demo-start-glow { animation: none; }
}

/* Profile preview block inside the demo setup form. */
.demo-preview-block {
  display: grid;
  gap: 4px;
  margin: 8px 0;
}
.demo-preview-label {
  color: var(--muted);
  font-size: 12px;
}

/* Inline editable name field on the demo proposal card. */
.demo-name-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.demo-name-editor label { color: var(--muted); font-size: 12px; }
.demo-name-editor input {
  flex: 1;
  font: inherit;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--fg);
  padding: 5px 8px;
}

/* ============================================================ */
/* My Archons — group cards                                      */
/* ============================================================ */

.archons-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.archon-card {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.archon-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.archon-name { margin: 0; font-size: 16px; flex: 1; min-width: 0; }
.archon-meta { color: var(--muted); font-size: 12px; }
.archon-delete {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.archon-delete:hover { color: var(--bad); border-color: var(--bad); }
.archon-members {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.archon-compose summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  padding: 6px 0;
  user-select: none;
}
.archon-compose summary:hover { color: var(--fg); }
.archon-compose[open] summary { margin-bottom: 10px; }
.archon-compose form { padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.archon-subsection {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.archon-subsection h4 {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===========================================================
   My Archons — controls bar, favorites, card visual upgrade
   =========================================================== */
.archons-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}
.archons-controls[hidden] { display: none; }
.archons-search {
  flex: 1; min-width: 0;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 7px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}
.archons-search::placeholder { color: var(--muted); }
.archons-search:focus {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.archons-sort {
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 7px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  min-width: 140px;
}
.archons-sort:focus {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

/* Star button — neutral by default, gold when active. */
.archon-fav-btn {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 26px; height: 26px;
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color 0.12s ease, transform 0.12s ease, background 0.12s ease;
}
.archon-fav-btn:hover { color: var(--warn); background: rgba(240, 179, 90, 0.08); }
.archon-fav-btn.archon-fav-on { color: var(--warn); }
.archon-card-fav { box-shadow: inset 3px 0 0 var(--warn); }

/* Aggregate avatar (40px) — shows real picture when the aggregate's
   kind:0 has landed; otherwise a tinted blank tile. */
.archon-avatar {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--card);
  display: inline-block;
  image-rendering: auto;
}
.archon-avatar-blank {
  background: linear-gradient(135deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
}

/* Title column wraps the name + meta so the header stays a single row. */
.archon-title {
  flex: 1 1 0;
  min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.archon-title .archon-name {
  flex: 0 0 auto;
  margin: 0;
  font-size: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.archon-title .archon-meta { font-size: 11px; }

/* CTA button on each Archon card — replaces the previous inline
   compose form. Clicking it navigates to the Drafts page with the
   Archon preselected. */
.archon-compose-cta {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.archon-compose-cta:hover {
  background: var(--card-2);
  border-color: var(--accent);
}
.archon-compose-cta-plus {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(121, 192, 255, 0.12);
  color: var(--accent);
  border-radius: 50%;
  font-size: 14px; line-height: 1;
  flex-shrink: 0;
}
.archon-compose-cta-label { flex: 1; min-width: 0; }
.archon-compose-cta-arrow {
  color: var(--muted);
  font-size: 16px;
  transition: transform 0.12s ease, color 0.12s ease;
}
.archon-compose-cta:hover .archon-compose-cta-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* Aggregate pubkey row — npub display with copy button. */
.archon-aggkey {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 8px;
}
.archon-aggkey .copyable-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.archon-aggkey-text {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.archon-aggkey-text:hover { color: var(--accent); }

/* ============================================================ */
/* Small-screen fallback                                         */
/* ============================================================ */
@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .sidebar .brand { flex: 0; }
  .sidebar .nav {
    flex-direction: row;
    flex: 1;
    overflow-x: auto;
    gap: 4px;
  }
  .sidebar .nav-item { white-space: nowrap; }
  .sidebar-foot { margin-top: 0; }
  .sidebar-id { padding: 4px 8px; }
  .sidebar-id-text { display: none; }
}

/* ===========================================================
   Toast notifications — fixed-position stack in the bottom-right
   corner. Created lazily by src/toast.js. Variants tinted via
   left-border accent + matching icon color.
   =========================================================== */
.toast-region {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 32px));
}
.toast {
  pointer-events: auto;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 18px 1fr 22px;
  column-gap: 10px;
  align-items: start;
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
}
.toast.toast-in { opacity: 1; transform: translateY(0) scale(1); }
.toast.toast-out { opacity: 0; transform: translateY(8px) scale(0.98); }
.toast-icon {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 1px;
}
.toast-message { word-break: break-word; }
.toast-close {
  appearance: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 22px;
  height: 22px;
  border-radius: 4px;
}
.toast-close:hover { color: var(--fg); background: rgba(255, 255, 255, 0.06); }
.toast-info    { border-left-color: var(--accent); }
.toast-info .toast-icon    { color: var(--accent); }
.toast-success { border-left-color: var(--good); }
.toast-success .toast-icon { color: var(--good); }
.toast-warn    { border-left-color: var(--warn); }
.toast-warn .toast-icon    { color: var(--warn); }
.toast-error   { border-left-color: var(--bad); }
.toast-error .toast-icon   { color: var(--bad); }

@media (max-width: 760px) {
  .toast-region {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity 80ms linear; transform: none !important; }
}

/* ---- Browsing Archons view ---- */

.archon-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.archon-feed-header h2 { margin: 0; }

.archon-feed-sources-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}
.archon-feed-source-row { margin: 0; }
.archon-feed-source-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.archon-feed-source-label:hover { background: rgba(255, 255, 255, 0.03); }
.archon-feed-source-label input[type=checkbox] { margin: 0; }
.archon-feed-source-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archon-feed-source-meta {
  font-size: 0.85em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.archon-feed-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.archon-feed-empty {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
}

.archon-feed-card {
  background: var(--card-bg, #181b22);
  border: 1px solid var(--card-border, #2b2f3a);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 100ms ease, transform 100ms ease;
}
.archon-feed-card:hover {
  border-color: var(--accent, #7aa2f7);
}
.archon-feed-card:active {
  transform: scale(0.995);
}
.archon-feed-card:focus-visible {
  outline: 2px solid var(--accent, #7aa2f7);
  outline-offset: 2px;
}
.archon-feed-banner {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}
.archon-feed-card-head {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  padding: 12px;
  align-items: center;
}
.archon-feed-pic {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #2b2f3a;
}
.archon-feed-pic-empty {
  background: linear-gradient(135deg, #2b2f3a 0%, #1a1d24 100%);
}
.archon-feed-card-title { min-width: 0; }
.archon-feed-name {
  margin: 0 0 2px 0;
  font-size: 1.05em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archon-feed-pub { font-size: 0.78em; opacity: 0.6; }
.archon-feed-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.archon-feed-source-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(122, 162, 247, 0.12);
  color: var(--accent, #7aa2f7);
  font-size: 0.72em;
  white-space: nowrap;
}
.archon-feed-about {
  margin: 0 12px 8px;
  font-size: 0.9em;
  line-height: 1.4;
  color: var(--text-muted, #b0b6c2);
}
.archon-feed-members {
  border-top: 1px solid var(--card-border, #2b2f3a);
  padding: 10px 12px 12px;
}
.archon-feed-members-title {
  margin: 0 0 8px 0;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #b0b6c2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.archon-feed-members-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.archon-feed-member {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}
.archon-feed-member-pic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #2b2f3a;
}
.archon-feed-member-pic-empty {
  background: linear-gradient(135deg, #2b2f3a 0%, #1a1d24 100%);
}
.archon-feed-member-text { min-width: 0; }
.archon-feed-member-name {
  font-weight: 500;
  font-size: 0.9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archon-feed-member-pub { font-size: 0.72em; }
.archon-feed-member-about {
  font-size: 0.78em;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.archon-feed-member {
  cursor: pointer;
  transition: background 100ms ease, transform 100ms ease;
}
.archon-feed-member:hover {
  background: rgba(122, 162, 247, 0.08);
}
.archon-feed-member:active {
  transform: scale(0.995);
}
.archon-feed-member:focus-visible {
  outline: 2px solid var(--accent, #7aa2f7);
  outline-offset: 2px;
}

/* ---- Propose merge CTA inside the profile modal ---- */

.profile-modal-propose-merge {
  /* No card / heading — the button IS the section. */
  background: none;
  padding: 6px 0;
}
.propose-merge-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid rgba(122, 162, 247, 0.55);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(122, 162, 247, 0.18), rgba(149, 117, 205, 0.18));
  color: inherit;
  font: inherit;
  cursor: pointer;
  position: relative;
  text-align: left;
  box-shadow: 0 0 0 0 rgba(122, 162, 247, 0.5);
  animation: propose-merge-glow 2.4s ease-in-out infinite;
  transition: transform 100ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.propose-merge-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent, #7aa2f7);
  box-shadow: 0 0 28px 2px rgba(122, 162, 247, 0.42);
}
.propose-merge-btn:active {
  transform: translateY(0) scale(0.997);
}
.propose-merge-btn:focus-visible {
  outline: 2px solid var(--accent, #7aa2f7);
  outline-offset: 3px;
}
.propose-merge-glyph {
  font-size: 1.6em;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(122, 162, 247, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent, #7aa2f7);
}
.propose-merge-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.propose-merge-title {
  font-size: 1.05em;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.propose-merge-sub {
  font-size: 0.85em;
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes propose-merge-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(122, 162, 247, 0.45),
                0 0 18px 0 rgba(122, 162, 247, 0.18);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(122, 162, 247, 0.12),
                0 0 28px 2px rgba(122, 162, 247, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .propose-merge-btn { animation: none; }
}
