:root {
  --accent: #2f5bea; --accent-ink: #ffffff; --ink: #15171c; --muted: #5a606b;
  --bg: #f5f6f8; --surface: #ffffff; --line: #e3e6ec; --hover: #f0f2f6;
  --warn-bg: #fff4e0; --warn-ink: #6b3e00; --danger: #b42318; --mine: #2f5bea; --theirs: #eceff4;
  --radius: 14px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #6f8ff5; --accent-ink: #0d1020; --ink: #eceef3; --muted: #9aa1ad;
    --bg: #0f1115; --surface: #171a20; --line: #262a33; --hover: #1e222a;
    --warn-bg: #3a2a10; --warn-ink: #f6d28b; --danger: #ff8a80; --mine: #3f63d6; --theirs: #232731;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.5rem 0 .5rem; }
.brand { font-size: 1.6rem; color: var(--accent); margin-bottom: 1rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.break { word-break: break-all; }
.center { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; width: 100%; }
.narrow { max-width: 420px; display: flex; flex-direction: column; gap: .75rem; }
form { display: flex; flex-direction: column; gap: .75rem; }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
input, select, textarea { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; background: var(--surface); width: 100%; }
button.primary, button.secondary, button.danger.big, button.pill { border-radius: 999px; padding: .7rem 1.1rem; border: 1px solid transparent; min-height: 44px; }
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:disabled { opacity: .55; cursor: default; }
.secondary { background: transparent; border-color: var(--line) !important; color: var(--ink); }
.pill { background: var(--hover); color: var(--ink); min-height: 36px !important; padding: .4rem .9rem !important; }
.big { font-size: 1.05rem; min-height: 52px !important; }
.small.primary, .small.secondary { padding: .35rem .8rem; min-height: 36px; font-size: .85rem; }
.link { background: none; border: 0; color: var(--accent); padding: .4rem; }
.danger { color: var(--danger) !important; }
button.danger.big { background: transparent; border-color: var(--danger) !important; }
.error { color: var(--danger); margin: 0; }
.check { flex-direction: row; align-items: center; gap: .6rem; }
.check input { width: auto; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.6rem; letter-spacing: .08em; text-align: center; margin: .25rem 0; }
.code.recovery { font-size: 1.05rem; word-break: break-all; background: var(--hover); padding: .8rem; border-radius: 10px; }
.words { font-size: 1.2rem; font-weight: 600; text-align: center; }
.app { max-width: 720px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; background: var(--surface); }
.content { flex: 1; padding: 0 16px 88px; }
.bar { display: flex; align-items: center; gap: .75rem; padding: 16px 0 12px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.bar h1 { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { background: none; border: 0; font-size: 1.8rem; line-height: 1; padding: 0 .4rem; }
.search { margin-bottom: .5rem; }
.row { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .65rem .5rem; border: 0; background: none; text-align: left; border-radius: 10px; min-height: 56px; }
button.row:hover { background: var(--hover); }
.row .grow, .notice .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.avatar { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; background: #dde5fb; color: #1b2f7a; display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.large { width: 72px; height: 72px; font-size: 1.3rem; }
.unread-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent, #2f5bea); }
.bubble.vanishing { border-style: dashed; }
.sealed { font-style: italic; opacity: .8; }
.field-note { width: 100%; min-height: 4.5em; box-sizing: border-box; }
.avatar .dot { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #2ea043; border: 2px solid var(--surface); }
.notice { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--hover); border-radius: var(--radius); padding: .75rem; margin: .5rem 0; }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice p { margin: .15rem 0 0; }
.sheet { background: var(--hover); border-radius: var(--radius); padding: .75rem; margin: .5rem 0; display: flex; flex-direction: column; gap: .4rem; }
.inline { flex-direction: row; align-items: center; flex-wrap: wrap; }
.inline input { flex: 1; min-width: 12rem; }
.empty { color: var(--muted); text-align: center; padding: 2rem 0; }
.footnote { color: var(--muted); text-align: center; font-size: .8rem; margin: 1rem 0; }
.thread { display: flex; flex-direction: column; min-height: calc(100dvh - 88px); }
.bubbles { flex: 1; display: flex; flex-direction: column; gap: .35rem; padding-bottom: .5rem; }
.bubble { flex: none; max-width: 78%; padding: .55rem .8rem; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: var(--mine); color: #fff; border-bottom-right-radius: 6px; }
.bubble.theirs { align-self: flex-start; background: var(--theirs); border-bottom-left-radius: 6px; }
.bubble .meta { display: block; font-size: .7rem; opacity: .7; margin-top: .15rem; }
.bubble .who { display: block; font-size: .75rem; font-weight: 600; opacity: .8; }
.composer { flex-direction: row; position: sticky; bottom: 76px; background: var(--surface); padding: .5rem 0; }
.composer input { flex: 1; border-radius: 999px; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .6rem; }
.note { background: var(--hover); border-radius: var(--radius); padding: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.note p { margin: 0 0 .4rem; }
.note-compose { margin-bottom: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin-top: .3rem; }
.bubble .meta .more { margin-left: .5rem; padding: 0 .4rem; font-size: 1.15rem; font-weight: 700; line-height: 1; color: inherit; opacity: 1; vertical-align: middle; }

.bubble.mine .actions .link { color: #fff; }
.bubble.scheduled { opacity: .7; border: 1px dashed currentColor; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.stat { background: var(--hover); border-radius: 10px; padding: .7rem; display: flex; flex-direction: column; }
.stat b { font-size: 1.4rem; }
details { border-bottom: 1px solid var(--line); padding: .25rem 0; }
summary { cursor: pointer; list-style: none; }
.inline-h { display: inline; }
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: .5rem; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.attachment-img { display: block; max-width: min(60vw, 280px); max-height: 320px; border-radius: 12px; margin-bottom: .3rem; cursor: zoom-in; }
.photo-viewer { padding: 0; border: 0; margin: 0; width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; background: transparent; overflow: hidden; }
.photo-viewer::backdrop { background: rgba(0, 0, 0, .9); }
.photo-viewer[open] { display: flex; align-items: center; justify-content: center; }
.photo-viewer > img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-out; }
.photo-viewer-bar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: .5rem; padding: .6rem max(16px, env(safe-area-inset-right)) .6rem max(16px, env(safe-area-inset-left)); background: linear-gradient(rgba(0, 0, 0, .7), transparent); color: #fff; }
.attachment-file { display: block; text-align: left; padding: .2rem 0; }
.bubble.mine .attachment-file { color: #fff; }
.attachment-media { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .3rem; max-width: 100%; }
/* Sized to the bubble, never the screen: the whole frame shows, letterboxed when tall. */
.attachment-media video { display: block; width: 360px; max-width: 100%; height: auto; max-height: 60vh; object-fit: contain; border-radius: 12px; background: #000; }
.attachment-media audio { display: block; width: 300px; max-width: 100%; }
.attachment-media-idle { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .3rem; }
.bubble.mine .attachment-media .muted, .bubble.mine .attachment-media .link, .bubble.mine .attachment-media-idle { color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .3rem 0; }
.chip { background: var(--hover); border-radius: 999px; padding: .2rem .6rem; font-size: .85rem; display: inline-flex; align-items: center; gap: .3rem; }
.map { width: min(70vw, 320px); height: 220px; border-radius: 10px; margin-top: .4rem; overflow: hidden; }
.setting { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.setting select { width: auto; }
.setting input[type="checkbox"] { width: 22px; height: 22px; }
.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 720px; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; text-align: center; padding: 14px 0 16px; color: var(--muted); text-decoration: none; font-weight: 500; position: relative; min-height: 56px; }
.tabs a.on { color: var(--accent); }
.badge { position: absolute; top: 6px; margin-left: 4px; background: var(--danger); color: #fff; font-style: normal; font-size: .7rem; border-radius: 999px; padding: 0 .4rem; }
section > button.secondary { margin: .3rem .3rem .3rem 0; }

.ring { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 20; width: min(92vw, 420px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: .6rem; }
.row-buttons { display: flex; gap: .5rem; }
.call { position: fixed; inset: 0; z-index: 15; background: #0b0d12; color: #fff; display: flex; flex-direction: column; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); gap: .6rem; }
.call .muted { color: #aab; }
.call-bar { display: flex; flex-direction: column; }
.tiles { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: .5rem; align-content: center; min-height: 0; }
.tile { position: relative; margin: 0; background: #1b1f29; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile figcaption { position: absolute; left: 8px; bottom: 6px; font-size: .8rem; background: rgba(0,0,0,.45); padding: 0 .4rem; border-radius: 6px; }
.call-controls { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.call .secondary { color: #fff; border-color: #3a4150 !important; }
.row-wrap { display: flex; align-items: center; gap: 4px; }
.row-wrap > .row { flex: 1; min-width: 0; }
.preview.strong { color: var(--ink); font-weight: 600; }
.composer select.vanish { width: auto; padding-inline: 6px; }

/* Notes board */
.board .row-buttons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.segmented { display: flex; gap: 4px; margin: .5rem 0; flex-wrap: wrap; }
.segmented button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; }
.segmented button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.on { background: var(--accent); color: var(--accent-ink); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; align-items: start; }
:where(.note-grid .note, .note-editor) { --self-note-bg: var(--surface); --self-note-fg: var(--ink); }
.note-grid .note, .note-editor { background: var(--self-note-bg); color: var(--self-note-fg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.note-editor { cursor: auto; margin-bottom: 1rem; }
.note-editor .note-title { font-weight: 600; font-size: 1.05rem; border: 0; background: transparent; padding: 4px 0; }
.note-editor textarea, .note-editor input:not([type]), .note-editor label input { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; width: 100%; }
[data-note-color="sand"] { --self-note-bg: #f6e6bd; --self-note-fg: #3b2b0c; }
[data-note-color="rose"] { --self-note-bg: #f7d9df; --self-note-fg: #4a1f2a; }
[data-note-color="violet"] { --self-note-bg: #e7ddfa; --self-note-fg: #34245a; }
[data-note-color="blue"] { --self-note-bg: #d8eafa; --self-note-fg: #173a59; }
[data-note-color="mint"] { --self-note-bg: #d9efe1; --self-note-fg: #173d29; }
[data-note-color="slate"] { --self-note-bg: #dfe3e8; --self-note-fg: #1f2933; }
.note[data-note-color]:not([data-note-color="default"]) .muted, .note-editor[data-note-color]:not([data-note-color="default"]) .muted { color: inherit; opacity: .75; }
.note-head { display: flex; gap: 6px; align-items: start; }
.note-body { white-space: pre-wrap; margin: 0; max-height: 12em; overflow: hidden; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.checklist label { display: flex; flex-direction: row; gap: 6px; align-items: center; text-align: left; }
.checklist .done { text-decoration: line-through; opacity: .6; }
.checklist.editing li { display: flex; gap: 6px; align-items: center; }
.note-actions { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.swatches { display: inline-flex; gap: 4px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); padding: 0; background: var(--surface); }
.swatch[data-swatch="sand"] { background: #f6e6bd; } .swatch[data-swatch="rose"] { background: #f7d9df; } .swatch[data-swatch="violet"] { background: #e7ddfa; }
.swatch[data-swatch="blue"] { background: #d8eafa; } .swatch[data-swatch="mint"] { background: #d9efe1; }
.swatch[aria-pressed="true"], .swatch[aria-checked="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
details.legacy { margin-top: 1rem; } details.legacy summary { cursor: pointer; color: var(--muted); }
.note input[type="checkbox"], .note-editor input[type="checkbox"] { width: auto; flex: none; margin: 0; }
.checklist.editing li input:not([type="checkbox"]) { flex: 1; min-width: 0; width: auto; }
.note-editor .check { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.note-editor .secondary, .note .link { color: var(--self-note-fg); }
.note-editor .secondary { background: color-mix(in srgb, var(--self-note-bg) 70%, #ffffff); border: 1px solid color-mix(in srgb, var(--self-note-fg) 25%, transparent); }
.note-editor .secondary:disabled { opacity: .6; }
.note .chip { background: color-mix(in srgb, var(--self-note-fg) 12%, transparent); color: inherit; border: 0; }

/* Call extras */
.call-chat { border-top: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 6px; padding: 8px; max-height: 45vh; }
.call-chat-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-height: 80px; }
.call-video { padding: 0 8px; }

/* Message cards, from veejr-server assets/css/app.css. Which card a message wears is an id
   inside the encrypted payload (web/src/cards.ts); everything it looks like is here. */
.msg-card {
  --card-accent: #7c5cbf;
  max-width: 26rem;
  padding: 0.9rem;
  border-radius: 1.1rem;
  background-color: #fffdf7;
  background-size: 120px;
  color: #2a2a33;
  text-align: center;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.08),
    0 6px 14px -8px rgb(0 0 0 / 0.35);
}

/* Heading and ornament sit on their own pale lozenge so they stay legible on
   whichever background the sender chose. */
.msg-card-ornament,
.msg-card-heading {
  display: block;
  width: fit-content;
  margin: 0 auto;
  background: rgb(255 255 255 / 0.95);
}

.msg-card-ornament {
  margin-bottom: 0.4rem;
  padding: 0.1rem 0.8rem;
  border-radius: 9999px;
  font-size: 1.15rem;
  letter-spacing: 0.15em;
}

.msg-card-heading {
  margin-bottom: 0.7rem;
  padding: 0.15rem 1rem;
  border-radius: 0.9rem;
  color: var(--card-accent);
  font-family: Georgia, "Palatino Linotype", "Times New Roman", serif;
  font-size: 1.45rem;
  font-style: italic;
  font-weight: 700;
  line-height: 1.25;
}

.msg-card-panel {
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 0.95);
  text-align: left;
}

.msg-card-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.msg-card[data-card-template="birthday"] { --card-accent: #d6336c; }
.msg-card[data-card-template="congrats"] { --card-accent: #a8741a; }
.msg-card[data-card-template="getwell"] { --card-accent: #2b8a5f; }

.msg-card-swatch {
  background-size: 60px;
}

/* Backgrounds. The same rules dress the swatches in the picker, so what you
   click is what you get. */
[data-card-bg="plain"] {
  background-color: #fffdf7;
  background-image: linear-gradient(160deg, #ffffff 0%, #f6efe0 100%);
}

[data-card-bg="confetti"] {
  background-color: #fff7e6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Crect x='8' y='12' width='9' height='4' fill='%23ff5d8f' transform='rotate(25 12 14)'/%3E%3Crect x='60' y='8' width='9' height='4' fill='%234ecdc4' transform='rotate(-30 64 10)'/%3E%3Ccircle cx='36' cy='30' r='3.5' fill='%23ffd166'/%3E%3Crect x='82' y='34' width='9' height='4' fill='%23a78bfa' transform='rotate(60 86 36)'/%3E%3Ccircle cx='14' cy='56' r='3.5' fill='%2338bdf8'/%3E%3Crect x='46' y='62' width='9' height='4' fill='%23ff5d8f' transform='rotate(-15 50 64)'/%3E%3Ccircle cx='78' cy='70' r='3.5' fill='%23ffd166'/%3E%3Crect x='22' y='88' width='9' height='4' fill='%234ecdc4' transform='rotate(40 26 90)'/%3E%3Ccircle cx='62' cy='92' r='3.5' fill='%23a78bfa'/%3E%3Ccircle cx='92' cy='6' r='3' fill='%2338bdf8'/%3E%3C/svg%3E");
}

[data-card-bg="balloons"] {
  background-color: #e8f5ff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='130'%3E%3Cg fill='none' stroke='%23889' stroke-width='1'%3E%3Cpath d='M26 50 q-5 22 3 40'/%3E%3Cpath d='M70 62 q6 20 -2 38'/%3E%3Cpath d='M100 24 q-4 18 2 34'/%3E%3C/g%3E%3Cellipse cx='26' cy='32' rx='13' ry='17' fill='%23ff6b8b'/%3E%3Cellipse cx='70' cy='44' rx='13' ry='17' fill='%23ffd166'/%3E%3Cellipse cx='100' cy='10' rx='11' ry='14' fill='%2360c6ff'/%3E%3Cellipse cx='21' cy='26' rx='3' ry='5' fill='white' opacity='.45'/%3E%3Cellipse cx='65' cy='38' rx='3' ry='5' fill='white' opacity='.45'/%3E%3C/svg%3E");
}

[data-card-bg="stars"] {
  background-color: #1b2a5e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cpath fill='%23ffd54f' d='M20 8l3.2 8 8.6.6-6.6 5.6 2.2 8.4-7.4-4.6-7.4 4.6 2.2-8.4L8.2 16.6l8.6-.6z'/%3E%3Cpath fill='%23ffe9a0' opacity='.8' d='M66 48l2.4 6 6.4.5-4.9 4.2 1.6 6.2-5.5-3.4-5.5 3.4 1.6-6.2-4.9-4.2 6.4-.5z'/%3E%3Ccircle cx='60' cy='14' r='1.6' fill='%23ffd54f'/%3E%3Ccircle cx='14' cy='64' r='1.6' fill='%23ffd54f'/%3E%3Ccircle cx='44' cy='40' r='1.2' fill='%23fff'/%3E%3C/svg%3E");
}

[data-card-bg="hearts"] {
  background-color: #ffe6ee;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath fill='%23ff9db8' d='M22 22c-9-11 5-22 13-9 8-13 22-2 13 9l-13 15z'/%3E%3Cpath fill='%23ffc2d4' d='M58 62c-6-7 3-14 8-6 5-8 14-1 8 6l-8 9z'/%3E%3C/svg%3E");
}

[data-card-bg="floral"] {
  background-color: #fff9ee;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110'%3E%3Cg fill='%2395d5a0'%3E%3Cellipse cx='52' cy='44' rx='9' ry='4' transform='rotate(35 52 44)'/%3E%3Cellipse cx='60' cy='92' rx='9' ry='4' transform='rotate(-30 60 92)'/%3E%3C/g%3E%3Cg fill='%23ffb3c7'%3E%3Ccircle cx='28' cy='19' r='7'/%3E%3Ccircle cx='38' cy='27' r='7'/%3E%3Ccircle cx='34' cy='39' r='7'/%3E%3Ccircle cx='22' cy='39' r='7'/%3E%3Ccircle cx='18' cy='27' r='7'/%3E%3C/g%3E%3Ccircle cx='28' cy='30' r='5' fill='%23ffd166'/%3E%3Cg fill='%23ffe08a'%3E%3Ccircle cx='82' cy='66' r='6'/%3E%3Ccircle cx='91' cy='73' r='6'/%3E%3Ccircle cx='87' cy='83' r='6'/%3E%3Ccircle cx='77' cy='83' r='6'/%3E%3Ccircle cx='73' cy='73' r='6'/%3E%3C/g%3E%3Ccircle cx='82' cy='75' r='4.5' fill='%23ff9f43'/%3E%3C/svg%3E");
}

[data-card-bg="sky"] {
  background-color: #cfe9ff;
  background-image:
    radial-gradient(ellipse 30% 14% at 22% 30%, rgb(255 255 255 / 0.9), transparent 70%),
    radial-gradient(ellipse 26% 12% at 74% 62%, rgb(255 255 255 / 0.85), transparent 70%),
    radial-gradient(ellipse 22% 10% at 40% 88%, rgb(255 255 255 / 0.8), transparent 70%),
    linear-gradient(180deg, #a9d8ff 0%, #e8f6ff 100%);
  background-size: auto;
}
.msg-card-picker { display: grid; gap: 8px; margin-bottom: 6px; }
.msg-card-picker .choices { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-card-picker .swatch-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); padding: 0; }
.msg-card-picker [aria-checked="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.bubble .msg-card { margin: 2px 0; }

/* Craps */
.craps .felt { background: radial-gradient(ellipse at center, #1f7a46 0%, #145c33 100%); color: #f4f7f2; border-radius: 18px; padding: 16px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.craps .felt .muted { color: #cfe3d3; }
.craps .puck { justify-self: end; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: #222; color: #fff; border: 3px solid #fff; }
.craps .puck[data-on="true"] { background: #fff; color: #111; }
.craps .dice { display: flex; gap: 12px; align-items: center; min-height: 64px; }
.craps .dice .total { font-size: 2rem; margin-left: 8px; }
.craps .die { width: 56px; height: 56px; background: #fdfdfb; border-radius: 12px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 7px; gap: 2px; box-shadow: 0 4px 10px rgb(0 0 0 / .35); }
.craps .die i { border-radius: 50%; }
.craps .die i.pip { background: #b3122e; }
.craps .die.rolling { animation: tumble .7s ease-out; }
@keyframes tumble { 0% { transform: translateY(-30px) rotate(0); } 60% { transform: translateY(4px) rotate(540deg); } 100% { transform: translateY(0) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .craps .die.rolling { animation: none; } }
.craps .event { margin: 0; font-weight: 600; }
.craps .seats { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.craps .seat { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .85rem; }
.craps .seat.me { border-color: var(--accent); }
.craps .board { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.craps .spot { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface); }
.craps .spot:disabled { opacity: .45; cursor: default; }
.notice.banner { margin: 8px; }
.msg-card-heading { text-transform: none; letter-spacing: normal; }
.inline-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.rec-buttons { display: inline-flex; gap: 6px; align-items: center; }
.recorder { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e5484d; animation: blink 1s steps(2) infinite; }
.rec-dot[data-paused="true"] { animation: none; opacity: .4; }
@keyframes blink { 50% { opacity: .2; } }
.rec-preview { width: 120px; border-radius: 8px; background: #000; }
.composer { flex-wrap: wrap; }
.map.big { width: 100%; height: 360px; border-radius: 12px; overflow: hidden; margin: 8px 0; }
.map-forms { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.map-forms .sheet { display: grid; gap: 8px; }
/* Simple mode */
.simple .faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.simple .face { display: grid; justify-items: center; gap: 6px; text-align: center; }
.simple .face-photo { border: 0; background: none; padding: 0; }
.simple .face-photo .avatar { width: 112px; height: 112px; font-size: 2rem; }
.simple .face-actions { display: flex; gap: 8px; }
.simple .face-actions button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 1.3rem; }
.simple-dialog { display: grid; gap: 10px; margin-top: 12px; }
.simple-lines { display: grid; gap: 10px; font-size: 1.1rem; }
.simple-lines p { margin: 0; }
.simple-lines p.mine { text-align: right; }
.simple-row .preview { font-size: 1rem; }
/* Notes layouts */
.segmented.small button { padding: 2px 10px; font-size: .85rem; }
.note-grid[data-view="list"] { grid-template-columns: 1fr; }
.note-grid[data-view="postit"] { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.note-grid[data-view="postit"] .note { aspect-ratio: 1; overflow: hidden; border: 0; box-shadow: 0 6px 14px -6px rgb(0 0 0 / .4); }
.note-grid[data-view="postit"] .note:nth-child(3n+1) { transform: rotate(-1.2deg); }
.note-grid[data-view="postit"] .note:nth-child(3n+2) { transform: rotate(.9deg); }
.note-grid[data-view="postit"] .note[data-note-color="default"] { --self-note-bg: #fff3a8; --self-note-fg: #3b3200; }
/* Composer: tools wrap on one row; the text box and Send always share a full row below. */
.composer input[aria-label="Message"] { order: 98; flex: 1 1 calc(100% - 100px); min-width: 0; }
.composer > button.primary:last-child { order: 99; }
.composer > button.secondary, .composer > select, .composer > .rec-buttons, .composer > label { flex: none; }
/* Accessibility */
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 8px; }
main.content:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Label editor */
.label-editor .chips { align-items: center; }
.label-editor .label-input { flex: 1 1 120px; min-width: 100px; width: auto; border: 0; background: transparent; padding: 4px 6px; }
.label-editor .suggestions .chip { border: 1px dashed var(--line); background: transparent; }
.reminder-form { flex-wrap: wrap; }
.reminder-form input, .reminder-form select { width: auto; }
.grid2 { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 8px; }
.ws-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.simple-options { display: grid; gap: 8px; }
.outbox { margin: 8px; }
.map-item { display: flex; align-items: center; gap: .4rem; }
.map-item > .row { flex: 1; min-width: 0; }

/* Contrast. Panels that sit on the call's dark screen but use the page's
   surface take the page's text colour back, so nothing is white on white in
   the light theme. */
.call-chat { color: var(--ink); }
.call-chat .muted { color: var(--muted); }
.call-chat .secondary { color: var(--ink); border-color: var(--line) !important; }
.photo-viewer-bar .secondary { color: #fff; border-color: rgb(255 255 255 / .55) !important; }
/* Inside my own (accent-coloured) bubbles every control reads in white: links
   and warnings would otherwise be accent-on-accent or red-on-blue. */
.bubble.mine .link, .bubble.mine .inline-link, .bubble.mine .error { color: #fff; }
.bubble.mine .danger { color: #fff !important; text-decoration: underline; }
.bubble.mine .secondary { color: #fff; border-color: rgb(255 255 255 / .6) !important; }
.bubble.mine .meta, .bubble.mine .who { opacity: .92; }
.sealed { opacity: 1; }
.thread.dropping, .note-editor.dropping, .note-compose.dropping { outline: 2px dashed var(--accent); outline-offset: -4px; border-radius: var(--radius); }

/* Document editor styles, from veejr-server assets/css/app.css (docs section),
   with its theme colors mapped onto this client's tokens. */
:root { --color-base-100: var(--surface); --color-base-200: var(--hover); --color-base-300: var(--line); --color-base-content: var(--ink); --color-primary: var(--accent); --color-error: var(--danger); --color-success: #2ea043; --color-warning: #c27c0e; }
.hidden { display: none !important; } .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: .75rem; color: var(--muted); }
.veejr-doc-dialog {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  background: transparent;
}

.veejr-doc-dialog::backdrop {
  background-color: color-mix(in oklab, black 55%, transparent);
}

.veejr-doc-shell {
  display: flex;
  height: 100dvh;
  flex-direction: column;
  background-color: var(--color-base-100);
  color: var(--color-base-content);
}

.veejr-doc-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--color-base-300);
  padding: 0.75rem 1rem;
}

.veejr-doc-title {
  min-width: 0;
  flex: 1 1 auto;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 600;
  outline: none;
}

.veejr-doc-status {
  font-size: 0.75rem;
  opacity: 0.6;
  white-space: nowrap;
}

.veejr-doc-status[data-state="saved"] {
  color: var(--color-success);
  opacity: 0.9;
}

.veejr-doc-status[data-state="dirty"] {
  color: var(--color-warning);
  opacity: 0.9;
}

.veejr-doc-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
}

.veejr-doc-error {
  border-bottom: 1px solid var(--color-error);
  background-color: color-mix(in oklab, var(--color-error) 12%, var(--color-base-100));
  padding: 0.5rem 1rem;
  color: var(--color-error);
  font-size: 0.85rem;
}

.veejr-doc-body {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.veejr-doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid var(--color-base-300);
  background-color: color-mix(in oklab, var(--color-base-200) 60%, var(--color-base-100));
  padding: 0.5rem 1rem;
}

.veejr-doc-tool,
.veejr-doc-select {
  border: 1px solid var(--color-base-300);
  border-radius: 0.5rem;
  background-color: var(--color-base-100);
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.veejr-doc-tool:hover,
.veejr-doc-select:hover {
  border-color: var(--color-primary);
  background-color: color-mix(in oklab, var(--color-primary) 8%, var(--color-base-100));
}

.veejr-doc-tool:focus-visible,
.veejr-doc-select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/* --- spreadsheet --- */
.veejr-sheet-ref {
  min-width: 3.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.7;
}

.veejr-sheet-formula {
  min-width: 12rem;
  flex: 1 1 20rem;
  border: 1px solid var(--color-base-300);
  border-radius: 0.5rem;
  background-color: var(--color-base-100);
  padding: 0.25rem 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  outline: none;
}

.veejr-sheet-formula:focus {
  border-color: var(--color-primary);
}

.veejr-sheet-scroller {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
}

.veejr-sheet {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  outline: none;
}

.veejr-sheet th,
.veejr-sheet td {
  border-right: 1px solid var(--color-base-300);
  border-bottom: 1px solid var(--color-base-300);
  padding: 0.25rem 0.4rem;
  min-width: 6rem;
  max-width: 18rem;
  height: 1.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sticky headers: a spreadsheet you must scroll back up to read is not one. */
.veejr-sheet thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--color-base-200);
  font-weight: 600;
  text-align: center;
}

.veejr-sheet tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 3rem;
  background-color: var(--color-base-200);
  font-weight: 500;
  text-align: right;
  opacity: 0.75;
}

.veejr-sheet .veejr-sheet-corner {
  z-index: 3;
  left: 0;
  min-width: 3rem;
}

.veejr-sheet td[data-numeric="true"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.veejr-sheet td[data-formula="true"] {
  background-color: color-mix(in oklab, var(--color-primary) 4%, transparent);
}

.veejr-sheet td[data-error="true"] {
  color: var(--color-error);
}

.veejr-sheet td[data-selected="true"] {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.veejr-sheet-input {
  width: 100%;
  border: 0;
  background-color: var(--color-base-100);
  font: inherit;
  color: inherit;
  outline: none;
}

/* --- page --- */
.veejr-page {
  margin: 0 auto;
  width: min(46rem, 100%);
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 2rem 1.5rem 6rem;
}

.veejr-page-block + .veejr-page-block {
  margin-top: 0.6rem;
}

.veejr-page-text {
  border-radius: 0.375rem;
  padding: 0.15rem 0.35rem;
  cursor: text;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.veejr-page-text:hover {
  background-color: color-mix(in oklab, var(--color-base-content) 4%, transparent);
}

.veejr-page-text:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.veejr-page-block[data-type="heading1"] .veejr-page-text {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
}

.veejr-page-block[data-type="heading2"] .veejr-page-text {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.25;
}

.veejr-page-block[data-type="heading3"] .veejr-page-text {
  font-size: 1.15rem;
  font-weight: 600;
}

.veejr-page-block[data-type="quote"] .veejr-page-text {
  border-left: 3px solid var(--color-primary);
  padding-left: 0.75rem;
  font-style: italic;
  opacity: 0.85;
}

.veejr-page-block[data-type="code"] .veejr-page-text {
  border-radius: 0.5rem;
  background-color: var(--color-base-200);
  padding: 0.6rem 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.veejr-page-block[data-type="bullet"],
.veejr-page-block[data-type="number"] {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-left: 0.75rem;
}

.veejr-page-block[data-type="bullet"]::before {
  content: "\2022";
  opacity: 0.6;
}

.veejr-page-block[data-type="number"]::before {
  content: "\2014";
  opacity: 0.6;
}

.veejr-page-block[data-type="bullet"] .veejr-page-text,
.veejr-page-block[data-type="number"] .veejr-page-text {
  flex: 1 1 auto;
  list-style: none;
}

.veejr-page-divider {
  margin: 1.25rem 0;
  border: 0;
  border-top: 1px solid var(--color-base-300);
}

.veejr-page-placeholder {
  opacity: 0.4;
}

.veejr-page-input {
  width: 100%;
  resize: none;
  border: 0;
  border-radius: 0.375rem;
  background-color: color-mix(in oklab, var(--color-primary) 6%, transparent);
  padding: 0.15rem 0.35rem;
  font: inherit;
  color: inherit;
  outline: 2px solid var(--color-primary);
  outline-offset: 0;
  overflow: hidden;
}

/* Inline marks. Named rules rather than Tailwind utilities because they are
   applied from a data model, not from class strings in a template. */
.veejr-mark-b {
  font-weight: 700;
}

.veejr-mark-i {
  font-style: italic;
}

.veejr-mark-u {
  text-decoration: underline;
}

.veejr-mark-s {
  text-decoration: line-through;
}

.veejr-mark-u.veejr-mark-s {
  text-decoration: underline line-through;
}

.veejr-mark-code {
  border-radius: 0.25rem;
  background-color: var(--color-base-200);
  padding: 0.05rem 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 10px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { font-size: .85rem; }
