/* Linear-style dark theme. System fonts only: this page loads nothing from any other host. */
:root {
  --bg: #08090a;
  --surface: #0f1011;
  --surface-2: #191a1b;
  --hover: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
  --line-subtle: rgba(255, 255, 255, 0.05);
  --line-strong: #34343a;
  --text: #f7f8f8;
  --text-2: #d0d6e0;
  --muted: #8a8f98;
  --accent: #7170ff;
  --accent-bg: #5e6ad2;
  --accent-hover: #828fff;
  --accent-ink: #ffffff;
  --ok: #3ecf8e;
  --warn: #f2c66d;
  --bad: #ff8a80;
  --bad-bg: #2a1517;
  --focus: #9ba4ff;
  --radius: 8px;
  --radius-sm: 6px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv01", "ss03";
  -webkit-font-smoothing: antialiased;
}

main, .bar-in, footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- top bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 9, 10, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-subtle);
}
.bar-in {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  min-height: 56px;
  flex-wrap: wrap;
}

h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.logo { color: var(--accent); }
h2 { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; margin: 0 0 6px; }
h3 { font-size: 14px; font-weight: 600; color: var(--text); margin: 20px 0 4px; }
p { margin: 8px 0; }
h1, h2, h3 { text-wrap: balance; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px 5px 8px;
  color: var(--muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); border-color: currentColor; }

.who { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- status lines */

.status { min-height: 1.55em; font-size: 13px; color: var(--muted); margin: 12px 0 0; overflow-wrap: anywhere; }
.status.error { color: var(--bad); }
.verify { margin: 2px 0 0; overflow-wrap: anywhere; }
.verify:empty { display: none; }
.verify button { min-height: 32px; padding: 2px 10px; font-size: 12px; margin-left: 4px; }
#verify-status.bad { color: var(--bad); }
#verify-status.warn { color: var(--warn); }

/* ---- sections */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
}
.card.intro { border-color: rgba(113, 112, 255, 0.35); }
.card.intro h2 { font-size: 17px; }
.ways { margin: 12px 0; padding-left: 20px; }
.ways li { margin: 6px 0; }
.ways li::marker { color: var(--muted); }
.lead { color: var(--text-2); }

/* The quieter sections under the feed: a divider and a heading, no box. */
.quiet {
  border-top: 1px solid var(--line-subtle);
  margin: 32px 0 0;
  padding: 24px 0 0;
}
.quiet > h2, .sec-h { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.start { justify-content: flex-start; margin-top: 12px; }
.inline { display: flex; gap: 8px; }
/* The hidden attribute wins over display rules such as .choices below. */
[hidden] { display: none !important; }

.inline > input { flex: 1 1 10em; min-width: 0; width: auto; }
.inline.wrap { flex-wrap: wrap; }
.choices { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 4px; }

/* ---- controls */

button {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
button:hover { background: var(--hover); border-color: var(--line-strong); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--accent-bg); color: var(--accent-ink); border-color: transparent; }
button.primary:hover:not(:disabled) { background: #6a75db; }
button.danger-btn { color: var(--bad); border-color: rgba(255, 138, 128, 0.5); }
button.danger-btn:hover { background: var(--bad-bg); border-color: var(--bad); }

input, textarea, select {
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 44px;
}
input, textarea { width: 100%; padding: 10px 12px; }
select { padding: 8px 10px; background-color: var(--surface); color: var(--text); }
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; display: block; }
input[type="file"] { min-height: 0; padding: 8px; color: var(--muted); font-size: 13px; }
input[type="file"]::file-selector-button {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 6px 10px; margin-right: 10px; cursor: pointer;
}

label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text-2); min-height: 44px; margin: 8px 0; cursor: pointer; }
label.check input { width: 18px; height: 18px; min-height: 0; margin: 0; flex: none; accent-color: var(--accent-bg); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; border-color: var(--focus); }

.skip { position: absolute; left: 8px; top: -100px; z-index: 20; background: var(--surface-2); color: var(--text); padding: 10px 14px; border-radius: var(--radius-sm); }
.skip:focus { top: 8px; }

a { color: var(--accent-hover); text-underline-offset: 2px; }

/* "Why?" toggles: one short line stays visible, the rest waits here. */
details.why { margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
details.why > summary {
  display: inline-flex; align-items: center; min-height: 32px; font-weight: 500; color: var(--muted);
  list-style: none; border-radius: 4px;
}
details.why > summary::-webkit-details-marker { display: none; }
details.why > summary::after { content: "+"; margin-left: 6px; font-family: var(--mono); }
details.why[open] > summary::after { content: "\2212"; }
details.why > summary:hover { color: var(--text-2); }
details.why > p { margin: 4px 0 8px; max-width: 60ch; }

summary { cursor: pointer; }
#node-settings > summary, details.sub > summary {
  display: flex; align-items: center; gap: 8px; min-height: 44px; list-style: none; font-weight: 600;
}

#node-settings > summary::-webkit-details-marker, details.sub > summary::-webkit-details-marker { display: none; }
#node-settings > summary::before, details.sub > summary::before {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg); transition: transform 0.12s; flex: none;
}
#node-settings[open] > summary::before, details.sub[open] > summary::before { transform: rotate(45deg); }
details.sub { margin-top: 12px; }
details.sub > summary { font-size: 14px; color: var(--text); }

/* ---- recovery phrase warning: kept loud on purpose */

.danger {
  border: 1px solid var(--bad);
  background: var(--bad-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
  color: #f3d6d3;
}
.danger strong { color: var(--bad); }
.danger-h { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; }
.danger-h svg { flex: none; margin-top: 3px; }
.danger p, .danger ul { margin: 8px 0; }
.danger ul { padding-left: 20px; }
.danger li { margin: 4px 0; }

code, .mono { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--surface-2); border: 1px solid var(--line-subtle); border-radius: 4px; padding: 1px 5px; color: var(--text); }
.mono { word-break: break-all; }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 12px 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.facts dd button { min-height: 36px; padding: 4px 10px; font-size: 13px; margin-left: 4px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---- compose */

.compose { padding: 12px; }
.compose textarea { border: 0; background: transparent; padding: 6px 4px; min-height: 72px; font-size: 16px; }
.compose textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.compose .row { border-top: 1px solid var(--line-subtle); padding-top: 10px; margin-top: 6px; }
.reply-to { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.reply-to button { min-height: 32px; padding: 2px 10px; font-size: 12px; }

/* ---- feed */

.feed-section { margin-top: 20px; }
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.feed-head h2 { font-size: 18px; margin: 0; }
.feed-head h2:focus { outline: none; }
.feed-head form { flex: 1 1 240px; max-width: 320px; }
#feed-title:empty { display: none; }
.feed-tools { display: flex; align-items: center; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; margin-top: 8px; }
.feed-tools label.check { margin: 0 0 0 auto; font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.chip {
  min-height: 36px;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--text-2);
}
.chip[data-state="include"] { background: var(--accent-bg); color: var(--accent-ink); border-color: transparent; }
.chip[data-state="exclude"] { text-decoration: line-through; color: var(--muted); border-style: dashed; }

.feed { list-style: none; margin: 8px 0 0; padding: 0; min-height: 96px; border-top: 1px solid var(--line-subtle); transition: opacity 0.15s; }
.feed:empty { min-height: 0; border-top: 0; }
.feed[aria-busy="true"] { opacity: 0.5; min-height: 96px; }
.feed[aria-busy="true"]:empty { border-top: 1px solid var(--line-subtle); }
.feed[aria-busy="true"]:empty::before { content: "Loading casts\2026"; display: block; padding: 32px 0; text-align: center; color: var(--muted); font-size: 13px; }
.feed-empty { padding: 32px 8px; text-align: center; color: var(--muted); font-size: 14px; }

.cast { border-bottom: 1px solid var(--line-subtle); padding: 14px 0 6px; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
.cast-body { min-width: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line-subtle); }
.avatar.letter { display: grid; place-items: center; font-weight: 600; font-size: 15px; color: var(--text-2); }
.cast-head { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 13px; align-items: baseline; line-height: 1.4; }
.cast-head .name { font-weight: 600; font-size: 14px; color: var(--text); }
.cast-head .meta { color: var(--muted); font-variant-numeric: tabular-nums; }
.cast-text { margin: 4px 0 6px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.cast-embeds { margin: 6px 0; font-size: 13px; overflow-wrap: anywhere; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cast-embeds a { color: var(--accent-hover); }
.cast-image { display: block; max-width: 100%; }
.cast-image img { display: block; max-width: 100%; max-height: 24rem; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cast-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-left: -10px; }
.cast-actions button {
  min-height: 40px; font-size: 13px; padding: 4px 10px; border-color: transparent; background: transparent; color: var(--muted);
}
.cast-actions button:hover { background: var(--hover); color: var(--text); border-color: transparent; }
.cast-actions button[aria-pressed="true"] { color: var(--accent-hover); background: rgba(113, 112, 255, 0.12); }
.app-tag, .key-tag { font-size: 11px; font-weight: 500; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--muted); white-space: nowrap; }
.key-tag { border-color: currentColor; color: var(--warn); }

#more { width: 100%; margin-top: 12px; color: var(--text-2); }

/* ---- society */

.verdict-ok { color: var(--ok); overflow-wrap: anywhere; }
.verdict-bad { color: var(--bad); overflow-wrap: anywhere; }
#charter-verdict { font-size: 13px; margin-top: 16px; }

.proposals { list-style: none; margin: 8px 0; padding: 0; }
.proposal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 8px 0; font-size: 13px; overflow-wrap: anywhere; }
.proposal > div:first-child { color: var(--text); font-weight: 500; }
.proposal .primary { margin-top: 8px; }
.changes { margin: 6px 0; padding-left: 20px; }
.changes li { margin: 4px 0; }
.changes button { min-height: 32px; padding: 2px 8px; font-size: 12px; margin-left: 6px; }
.tally { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--text-2); }
.tally progress { width: 8em; height: 6px; accent-color: var(--ok); }
.history { padding-left: 24px; color: var(--text-2); overflow-wrap: anywhere; }
.history li { margin: 6px 0; }
.history li::marker { color: var(--muted); }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }

/* ---- footer */

footer { padding-top: 32px; padding-bottom: 40px; line-height: 1.6; }
footer a { color: var(--muted); }

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

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.cast-actions:empty { display: none; }
.feed-tools:has(.chips:empty) + details.why { display: none; }
#node-settings > summary { margin: 0; }
.facts dt:has(+ dd:empty), .facts dd:empty { display: none; }

/* ---- sign-in choices (Post from Outpost) */

.choices.options button { text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.choices.options button::after {
  content: ""; width: 6px; height: 6px; flex: none; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); opacity: 0.6; transition: transform 0.12s;
}
.choices.options button[aria-expanded="true"]::after { transform: rotate(45deg); }
.choices.options button[aria-expanded="true"]:not(.primary) { border-color: var(--accent); background: rgba(113, 112, 255, 0.08); }
.choices.options button.primary[aria-expanded="true"] { box-shadow: 0 0 0 1px var(--accent-hover); }
.step { border-top: 1px solid var(--line-subtle); margin-top: 12px; padding-top: 12px; }
.step > p:first-child { margin-top: 0; }
#create-offer { color: var(--text-2); }
#new-phrase-box > button { margin-top: 8px; }
.phrase {
  font-family: var(--mono); font-size: 15px; line-height: 1.8; color: var(--text); word-break: normal; overflow-wrap: anywhere;
  padding: 12px 14px; margin: 12px 0 4px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius);
  user-select: all;
}
.phrase:empty { display: none; }

/* One line on a phone: the node pill shortens instead of wrapping the bar. */
.bar-in { flex-wrap: nowrap; }
.bar-in h1, .who { flex: none; }
#node-status { flex: 0 1 auto; min-width: 0; }
/* Ellipsis needs a block box, not a flex one. */
.pill { display: inline-block; line-height: 1.2; padding: 4px 10px 4px 8px; }
.pill::before { display: inline-block; vertical-align: middle; margin: -2px 6px 0 0; }
