/* =====================================================================
   Neighborhood unions — communityservices.cc module styles
   Shared tokens from ../assets/app.css; this file adds the union-thing.
   Warm, small, paper-and-ink; stays the hell out of the way.
   ===================================================================== */

.union-card {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 20px;
  height: 100%;
}
.union-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.union-card .u-ic {
  width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.6rem;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 14px;
}
.union-card .u-ic.amber { background: var(--accent-soft); color: #92400e; }
.union-card .u-ic.violet { background: #f0ecfb; color: #6d28d9; }

/* ---------- qr generator: the door hanger ---------- */
.field { display: block; margin-bottom: 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 5px; font-size: .92rem; }
.field .f-hint { font-size: .8rem; color: var(--muted); }
.field input[type="text"] {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); font-size: 1rem; background: #fff;
}
.field input[type="text"]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.qr-live {
  display: grid; place-items: center; gap: 10px; text-align: center;
  padding: 18px; border-radius: var(--radius);
  border: 2px dashed var(--line); background: var(--wash);
}
.qr-live svg, .qr-live img { max-width: 240px; height: auto; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 10px; }
.qr-live .qr-target { font-size: .8rem; color: var(--muted); word-break: break-all; max-width: 46ch; }

/* ---------- the print sheet ---------- */
.hanger-sheet {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 12px;
}
.hanger {
  border: 2px dashed var(--line); border-radius: var(--radius-sm);
  padding: 18px; text-align: center; break-inside: avoid;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: #fff;
}
.hanger .h-title { font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.hanger .h-scan {
  font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand); border: 2px solid var(--brand); border-radius: 999px;
  padding: .25em .9em;
}
.hanger svg { width: 96px; height: 96px; image-rendering: pixelated; }
.hanger .h-note { font-size: .74rem; color: var(--muted); line-height: 1.4; }

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  .hanger-sheet { grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; }
  .hanger { border-width: 1.5px; page-break-inside: avoid; }
  .hanger-sheet > .hanger:nth-child(n + 3) { page-break-before: avoid; }
}

/* ---------- say hi: the peer-to-peer hello ---------- */
.peer-pane {
  border: 2px solid var(--line); border-radius: var(--radius);
  background: #fff; padding: 18px;
}
.peer-role {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.peer-role .btn { flex: 1 1 140px; }
.qr-give {
  display: grid; place-items: center; gap: 8px; text-align: center;
  border-radius: var(--radius-sm); background: var(--wash);
  border: 2px dashed var(--line); padding: 14px; margin-top: 12px;
}
.qr-give svg { width: 200px; height: 200px; max-width: 100%; image-rendering: pixelated; background: #fff; padding: 6px; border-radius: 8px; }
.code-wrap textarea {
  width: 100%; min-height: 96px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); font-family: var(--mono); font-size: .78rem;
  background: var(--wash); color: var(--ink); resize: vertical;
}
.peer-status {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  font-weight: 700; display: flex; align-items: center; gap: 10px;
  background: var(--good-soft); color: var(--good);
}
.peer-status.err { background: var(--bad-soft); color: var(--bad); }
.peer-status.think { background: var(--warn-soft); color: var(--warn); }
.peer-chat { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.peer-chat .log {
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 74px; font-size: .95rem; background: var(--wash);
}
.peer-chat .log .typed { color: var(--brand); font-weight: 700; }
.peer-chat .row { display: flex; gap: 8px; }
.peer-chat .row input[type="text"] {
  flex: 1; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); font-size: 1rem;
}
.vid-scan { width: 100%; border-radius: var(--radius-sm); border: 2px solid var(--line); background: #000; }

/* ---------- the building's words (constitution view) ---------- */
.const-clauses { display: flex; flex-direction: column; gap: 14px; margin-bottom: 4px; }
.const-clause {
  display: flex; gap: 14px; align-items: flex-start;
  border-left: 3px solid var(--brand); background: var(--wash);
  border-radius: 4px var(--radius-sm) var(--radius-sm) 4px;
  padding: 12px 16px; font-size: 1.02rem; line-height: 1.6;
}
.const-num {
  flex: 0 0 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 800; font-size: .9rem;
}

/* ---------- the postbox (bulletin board, honest) ---------- */
.postbox-line {
  display: flex; gap: 12px; align-items: flex-start;
  border-top: 2px solid var(--line); padding: 16px 2px 2px;
}
.postbox-line:first-of-type { border-top: 0; }
.postbox-line .pb-ic {
  flex: 0 0 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.2rem;
  background: var(--brand-soft); color: var(--brand);
}
.postbox-line .pb-ic.amber { background: var(--accent-soft); color: #92400e; }
.postbox-line .pb-title { font-weight: 800; margin: 0 0 2px; }
.postbox-line .pb-body { color: var(--muted); font-size: .95rem; margin: 0; }