* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; font: 16px/1.35 system-ui, -apple-system, sans-serif; background: #f6efe6;
  background-image: radial-gradient(#e9dccb 1px, transparent 1px); background-size: 18px 18px; color: #222; }
header { display: flex; gap: 10px; align-items: center; padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: #b3202a; color: #fff; box-shadow: 0 1px 4px #0003; }
header small { display: block; opacity: .8; font-size: 12px; }
.avatars span { font-size: 26px; }
.avatars span + span { margin-left: -10px; }
main { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.day { align-self: center; font-size: 12px; color: #777; margin: 10px 0 4px; }
.msg { max-width: 78%; display: flex; flex-direction: column; }
.msg.them { align-self: flex-start; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.name { font-size: 12px; color: #8a2a20; margin: 6px 10px 2px; }
.bubble { padding: 8px 12px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.them .bubble { background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 1px #0001; }
.nisselina .bubble { background: #fff3f6; }
.family .bubble { background: #e3f1e7; }
.family .name { color: #2a7d46; }
#nav { margin-left: auto; color: #fff; font-size: 13px; text-decoration: none; background: #fff3; padding: 5px 10px; border-radius: 14px; }
body.admin header { background: #5a1a6e; }
#nisseonly { display: contents; }
.me .bubble { background: #2a7d46; color: #fff; border-bottom-right-radius: 4px; }
.bubble img, .bubble video { display: block; max-width: 100%; max-height: 60vh; border-radius: 12px; margin: -2px -6px 4px; }
.bubble.media-only { padding: 4px; background: transparent !important; box-shadow: none; }
.bubble.media-only img, .bubble.media-only video { margin: 0; }
.meta { font-size: 11px; color: #888; margin: 1px 8px; }
.pending .bubble { opacity: .6; outline: 2px dashed #b3202a; }
.pending .meta { color: #b3202a; font-weight: 600; }
.meta button { border: 0; background: none; color: #b3202a; font-size: 11px; padding: 0 0 0 6px; cursor: pointer; }
form { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #ddd; }
.row { display: flex; gap: 8px; align-items: flex-end; }
textarea { flex: 1; resize: none; font: inherit; padding: 9px 14px; border: 1px solid #ccc; border-radius: 20px; max-height: 120px; }
#send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: #b3202a; color: #fff; font-size: 18px; }
#send:disabled { opacity: .5; }
#adminbar { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; margin-bottom: 8px; align-items: center; }
#adminbar select, #adminbar input[type=datetime-local] { font: inherit; }
.file { background: #f1e6d8; padding: 4px 10px; border-radius: 12px; cursor: pointer; }
.file input { display: none; }
#login { padding: 40px 20px; text-align: center; }
