:root {
  --bg: #f6f5fa;
  --card: #ffffff;
  --text: #1c1a24;
  --muted: #6b6878;
  --line: #e2e0ea;
  --accent: #7c3aed;
  --accent-text: #ffffff;
  --ok: #15803d;
  --bad: #b91c1c;
  --warn: #a16207;
  --field: #fbfaff;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121118;
    --card: #1c1a24;
    --text: #ece9f5;
    --muted: #9a96aa;
    --line: #2e2b3a;
    --accent: #a78bfa;
    --accent-text: #160f29;
    --ok: #4ade80;
    --bad: #f87171;
    --warn: #facc15;
    --field: #15131c;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px / 1.5 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
h1 {
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: 0.01em;
}
h2 {
  font-size: 1.1rem;
  margin: 0 0 0.4rem;
}
code,
pre {
  font:
    12.5px / 1.45 ui-monospace,
    "SF Mono",
    Menlo,
    monospace;
}
pre {
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0.5rem 0 0;
  color: var(--muted);
}
a {
  color: var(--accent);
}
.muted {
  color: var(--muted);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1rem 16px;
}
.account {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.account img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.account code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px 2rem;
}
.foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px 2rem;
  font-size: 13px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.status {
  min-height: 1.5em;
  margin: 0 0 0.75rem;
}
.status.error {
  color: var(--bad);
}

button,
.button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
button:disabled {
  opacity: 0.55;
  cursor: progress;
}
button.secondary {
  background: transparent;
  color: var(--accent);
}
button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  font-weight: 500;
}
button.big {
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  font-size: 1rem;
}
button.small {
  padding: 0.3rem 0.7rem;
  font-size: 13px;
}

input,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  width: 100%;
}
input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
textarea {
  min-height: 7rem;
  resize: vertical;
}
label {
  font-weight: 600;
  font-size: 14px;
}
.row {
  display: flex;
  gap: 0.5rem;
}
.row input {
  flex: 1;
  min-width: 0;
}

.signin {
  max-width: 520px;
  margin: 2rem auto;
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}
.connect {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0 1rem;
}
.qr {
  background: #fff;
  padding: 8px;
  border-radius: 8px;
  width: 220px;
}
.qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.bunker {
  display: grid;
  gap: 0.4rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 820px) {
  .editor {
    grid-template-columns: minmax(0, 1fr);
  }
}
.side {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 1rem;
}
@media (max-width: 820px) {
  .side {
    position: static;
  }
}

.field {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 1rem;
}
.field .hint {
  font-size: 13px;
  color: var(--muted);
}
.field .err {
  font-size: 13px;
  color: var(--bad);
}
.field .note {
  font-size: 13px;
}
.field .note.ok {
  color: var(--ok);
}
.field .note.bad {
  color: var(--bad);
}
.field input[aria-invalid="true"] {
  border-color: var(--bad);
}
.thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: none;
}
.thumb.wide {
  width: 88px;
}
.upload input[type="file"] {
  display: none;
}
.other summary {
  cursor: pointer;
  color: var(--muted);
}

.preview {
  padding: 0;
  overflow: hidden;
}
.banner {
  height: 120px;
  background: linear-gradient(135deg, var(--accent), #ec4899);
  background-size: cover;
  background-position: center;
}
.pv-body {
  padding: 0 1.1rem 1.1rem;
}
.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin-top: -42px;
  border: 4px solid var(--card);
  background: var(--line) center / cover;
}
.pv-names {
  margin-top: 0.4rem;
  display: grid;
}
.pv-names strong {
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}
.pv-line {
  font-size: 14px;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.pv-about {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0.6rem 0;
}
.ok {
  color: var(--ok);
}
.bad {
  color: var(--bad);
}
.warn {
  color: var(--warn);
}

.publish details {
  margin-top: 0.6rem;
}
.publish summary {
  cursor: pointer;
}
.relays {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: grid;
  gap: 0.25rem;
  font-size: 13px;
}
.relays li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}
.relays li span:first-child,
.relays label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
}
.relays label {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 13px;
}
.relays input[type="checkbox"] {
  width: auto;
}
.results {
  border-top: 1px solid var(--line);
  padding-top: 0.6rem;
}

h1,
button {
  white-space: nowrap;
}
.publish p {
  margin-top: 0;
}
@media (max-width: 520px) {
  .account code {
    display: none;
  }
}

/* Last, so it wins over any single-class display rule. */
[hidden] {
  display: none;
}
