/* ROJER — calm, polished, our own.
   Layout follows the newest WhatsApp so it feels familiar (header, search, chips, bottom navigation, FAB).
   Identity: padi green, a green-tinted dark mode (never pure black), and a faint songket line pattern behind chats. */
:root {
  --padi: #1f9d74;
  --padi-ink: #10795a;
  --padi-soft: rgba(31, 157, 116, .14);
  --on-padi: #ffffff;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #e8eeeb;
  --ink: #15201b;
  --muted: #66746e;
  --hair: rgba(21, 32, 27, .08);
  --bar: rgba(244, 247, 245, .86);
  --bubble-out: #d8f5e6;
  --bubble-in: #ffffff;
  --chat-bg: #ecf1ee;
  --blue-tick: #2f95d8;
  --shadow: 0 1px 1.5px rgba(21, 32, 27, .1);
  --blur: saturate(160%) blur(20px);
  /* songket-inspired diamond lines, very faint */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' fill='none' stroke='%231f9d74' stroke-opacity='.07' stroke-width='1'%3E%3Cpath d='M32 6 58 32 32 58 6 32Z'/%3E%3Cpath d='M32 22 42 32 32 42 22 32Z'/%3E%3Cpath d='M0 0 6 6M64 0 58 6M0 64 6 58M64 64 58 58'/%3E%3Ccircle cx='32' cy='32' r='1.5'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root {
    --padi: #34c08f;
    --padi-ink: #6fdcb3;
    --padi-soft: rgba(52, 192, 143, .18);
    --on-padi: #06261a;
    --bg: #18241f;          /* green-tinted, not black */
    --surface: #1f2e28;
    --surface-2: #273832;
    --ink: #e9f0ed;
    --muted: #9cada6;
    --hair: rgba(233, 240, 237, .08);
    --bar: rgba(24, 36, 31, .88);
    --bubble-out: #1d6a50;
    --bubble-in: #263731;
    --chat-bg: #15201c;
    --blue-tick: #62bdf2;
    --shadow: 0 1px 1.5px rgba(0, 0, 0, .25);
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' fill='none' stroke='%238fe0bf' stroke-opacity='.05' stroke-width='1'%3E%3Cpath d='M32 6 58 32 32 58 6 32Z'/%3E%3Cpath d='M32 22 42 32 32 42 22 32Z'/%3E%3Cpath d='M0 0 6 6M64 0 58 6M0 64 6 58M64 64 58 58'/%3E%3Ccircle cx='32' cy='32' r='1.5'/%3E%3C/svg%3E");
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 16px; line-height: 1.4; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; padding: 0; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--padi); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.error { color: #d0473a; font-size: 14px; min-height: 1em; margin: 6px 0; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wallpaper { display: none; }

.screen { position: fixed; inset: 0; max-width: 720px; margin: 0 auto; overflow: hidden; background: var(--bg); }
@media (min-width: 721px) { body { background: var(--surface-2); } }

/* ---- top bar ---- */
.bar { position: absolute; top: 0; left: 0; right: 0; z-index: 3; padding-top: env(safe-area-inset-top);
  background: var(--bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.bar-row { display: flex; align-items: center; height: 60px; padding: 0 6px 0 20px; }
.wordmark { margin: 0; flex: 1; font-size: 26px; font-weight: 700; letter-spacing: -.04em; color: var(--padi-ink); }
.wordmark::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--padi); margin-left: 3px; }
.bar-actions { display: flex; }
.icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); transition: background .15s; }
.icon:active { background: var(--hair); }

/* search + filter chips */
.list-tools { padding: 2px 16px 10px; }
.search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--surface-2); color: var(--muted); }
.search svg { width: 20px; height: 20px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.chips { display: flex; gap: 8px; margin-top: 10px; }
.chip { height: 34px; padding: 0 14px; border-radius: 17px; font-size: 14.5px; font-weight: 500; color: var(--muted); background: var(--surface-2); transition: background .15s, color .15s; }
.chip.on { background: var(--padi-soft); color: var(--padi-ink); font-weight: 600; }

.tab-body { position: absolute; inset: 0; overflow-y: auto; padding: calc(60px + env(safe-area-inset-top)) 0 calc(96px + env(safe-area-inset-bottom)); }
.tab-body.with-tools { padding-top: calc(60px + 102px + env(safe-area-inset-top)); }

/* ---- chat list: no lines, generous rows ---- */
.chat-list { list-style: none; margin: 0; padding: 0 0 8px; }
.chat-list li { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 0 16px; cursor: pointer; transition: background .15s; }
.chat-list li:active { background: var(--hair); }
.chat-list .info { flex: 1; min-width: 0; }
.chat-list .top, .chat-list .bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chat-list .name { font-weight: 600; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list .time { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chat-list .time.unread { color: var(--padi); font-weight: 600; }
.chat-list .last { color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.badge { background: var(--padi); color: var(--on-padi); border-radius: 999px; min-width: 22px; height: 22px; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; padding: 0 7px; margin-top: 3px; }

/* avatars: a soft tint of each person's hue, no ring */
.avatar { --h: 158; width: 54px; height: 54px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 600; font-size: 21px; color: hsl(var(--h) 42% 30%); background: hsl(var(--h) 55% 88%); }
@media (prefers-color-scheme: dark) { .avatar { color: hsl(var(--h) 65% 82%); background: hsl(var(--h) 28% 27%); } }
.avatar svg { width: 26px; height: 26px; }
.avatar.small { width: 40px; height: 40px; font-size: 16px; }
.avatar.big { width: 96px; height: 96px; font-size: 38px; }
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.me-photo { position: relative; display: block; margin: 0 auto 12px; border-radius: 50%; }
.me-card .me-photo .avatar { margin: 0; }
.me-photo .cam { position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%; display: grid;
  place-items: center; color: #fff; background: var(--padi); border: 3px solid var(--bg); }
.me-photo .cam svg { width: 16px; height: 16px; }

.empty { text-align: center; padding: 72px 40px; }
.empty p { margin: 6px 0; }
.empty-title { font-size: 19px; font-weight: 600; }
.tree-art { width: 72px; height: 72px; stroke-width: 1.1; color: var(--padi); margin-bottom: 16px; }

/* ---- Links: maps of people (circle / family tree / network) ---- */
.links-head { padding: 6px 20px 10px; }
.links-head h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.045em; }
.links-head p { margin: 2px 0 0; }
.link-list { list-style: none; margin: 0; padding: 4px 14px; display: grid; gap: 12px; }
.link-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 22px;
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; animation: pop .35s cubic-bezier(.2, .9, .3, 1.2) both; }
.link-card:active { transform: scale(.985); }
.link-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, var(--padi-soft), transparent 70%); pointer-events: none; }
.link-card .mini { width: 64px; height: 64px; flex: none; }
.link-card .info { flex: 1; min-width: 0; }
.link-card .title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-card .meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.tag { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--padi-ink); background: var(--padi-soft); }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.links-empty { padding-top: 40px; }
.orbit { position: relative; width: 120px; height: 120px; margin: 0 auto 22px; border-radius: 50%; border: 1.5px dashed var(--padi);
  animation: spin 18s linear infinite; }
.orbit span { position: absolute; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: var(--padi);
  box-shadow: 0 0 14px var(--padi); left: calc(50% + 60px * cos(var(--a))); top: calc(50% + 60px * sin(var(--a))); }
.orbit span:nth-child(1) { --a: -90deg; } .orbit span:nth-child(2) { --a: -18deg; } .orbit span:nth-child(3) { --a: 54deg; }
.orbit span:nth-child(4) { --a: 126deg; } .orbit span:nth-child(5) { --a: 198deg; }
@keyframes spin { to { transform: rotate(360deg); } }

#link { background: radial-gradient(120% 70% at 50% 35%, var(--padi-soft), transparent 70%), var(--bg); }
.map-wrap { position: absolute; inset: calc(64px + env(safe-area-inset-top)) 0 0; overflow: auto; padding-bottom: 100px; }
.map-wrap svg { display: block; margin: 0 auto; overflow: visible; }
.map-wrap svg, .link-card .mini { stroke: none; stroke-width: 0; } /* no outline from the icon rule */
.map-wrap .edge { fill: none; stroke: var(--padi); stroke-width: 2; stroke-linecap: round; opacity: .55;
  stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw .45s ease-out forwards; }
.map-wrap .chord { stroke-width: 1; opacity: .16; }
.map-wrap .orbit-ring { fill: none; stroke: var(--padi); stroke-width: 1.5; stroke-dasharray: 3 7; opacity: .7; }
.map-wrap .hub { font-size: 12px; font-weight: 700; letter-spacing: .14em; fill: var(--padi-ink); text-anchor: middle; text-transform: uppercase; }
.map-wrap .node { cursor: pointer; animation: pop .28s cubic-bezier(.2, .9, .3, 1.3) both; transform-box: fill-box; transform-origin: center; }
.map-wrap .node .bg { fill: hsl(var(--h) 55% 88%); }
.map-wrap .node .ini { fill: hsl(var(--h) 42% 30%); font-weight: 700; font-size: 20px; text-anchor: middle; dominant-baseline: central; }
.map-wrap .node .ghostring { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 4; }
.map-wrap .node.off .bg { fill: var(--surface-2); } .map-wrap .node.off .ini { fill: var(--muted); }
.map-wrap .node.me .halo { fill: var(--padi); opacity: .35; filter: blur(8px); }
.map-wrap .node .nm { fill: var(--ink); font-size: 13px; font-weight: 600; text-anchor: middle; }
.map-wrap .node.me .nm { fill: var(--padi-ink); }
@media (prefers-color-scheme: dark) {
  .map-wrap .node .bg { fill: hsl(var(--h) 28% 27%); } .map-wrap .node .ini { fill: hsl(var(--h) 65% 82%); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .map-wrap .edge, .map-wrap .node, .link-card, .orbit { animation: none; stroke-dashoffset: 0; } }
.map-actions { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 3; display: flex; gap: 10px;
  justify-content: center; padding: 0 16px; }
.pill-btn { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 18px; border-radius: 25px; font-weight: 600; white-space: nowrap;
  background: var(--surface); color: var(--ink); box-shadow: 0 6px 20px rgba(0, 0, 0, .14); }
.pill-btn svg { width: 20px; height: 20px; flex: none; }
.pill-btn.main { flex: 1; max-width: 240px; justify-content: center; }
.pill-btn.round { width: 50px; padding: 0; justify-content: center; flex: none; }
.pill-btn.roger { color: var(--padi-ink); box-shadow: 0 0 0 1.5px var(--padi), 0 6px 20px rgba(0, 0, 0, .14); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.map-wrap .node .live { fill: #2fd27a; stroke: var(--bg); stroke-width: 3; }
.map-wrap .node .live-glow { fill: #2fd27a; opacity: .5; animation: livepulse 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes livepulse { from { transform: scale(1); opacity: .55; } to { transform: scale(2.4); opacity: 0; } }
.link-card .meta { flex-wrap: wrap; row-gap: 3px; } .link-card .meta > span { white-space: nowrap; }
.link-card .on-count { display: inline-flex; align-items: center; gap: 5px; color: #1f9d55; font-weight: 600; }
.link-card .on-count::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2fd27a; box-shadow: 0 0 6px #2fd27a; }
@media (prefers-color-scheme: dark) { .link-card .on-count { color: #5fe39a; } }
@media (prefers-reduced-motion: reduce) { .map-wrap .node .live-glow { animation: none; opacity: 0; } }
.pill-btn.main { background: var(--padi); color: var(--on-padi); box-shadow: 0 6px 24px var(--padi-soft), 0 6px 20px rgba(0, 0, 0, .14); }
.pill-btn:active { transform: scale(.96); }
.kinds { display: grid; gap: 8px; margin: 6px 0 4px; }
.kind { display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left;
  padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1.5px solid transparent; transition: border-color .15s, background .15s; }
.kind.on { border-color: var(--padi); background: var(--padi-soft); }
.kind b { font-size: 16px; } .kind span:last-child { grid-column: 2; font-size: 13.5px; color: var(--muted); }
.k-art { grid-row: span 2; width: 46px; height: 46px; border-radius: 14px; background: var(--surface) center / 30px no-repeat; }
.k-art.circle { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='15' r='10' fill='none' stroke='%2334c08f' stroke-width='1.5' stroke-dasharray='2 3'/%3E%3Cg fill='%2334c08f'%3E%3Ccircle cx='15' cy='5' r='3'/%3E%3Ccircle cx='24.5' cy='18' r='3'/%3E%3Ccircle cx='5.5' cy='18' r='3'/%3E%3C/g%3E%3C/svg%3E"); }
.k-art.family { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M15 8v6M8 22v-4h14v4' fill='none' stroke='%2334c08f' stroke-width='1.5'/%3E%3Cg fill='%2334c08f'%3E%3Ccircle cx='15' cy='6' r='3'/%3E%3Ccircle cx='8' cy='24' r='3'/%3E%3Ccircle cx='22' cy='24' r='3'/%3E%3C/g%3E%3C/svg%3E"); }
.k-art.network { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M15 7L7 15M15 7l8 8M7 15l-3 8M7 15l4 8M23 15v8' fill='none' stroke='%2334c08f' stroke-width='1.5'/%3E%3Cg fill='%2334c08f'%3E%3Ccircle cx='15' cy='6' r='3'/%3E%3Ccircle cx='7' cy='15' r='2.5'/%3E%3Ccircle cx='23' cy='15' r='2.5'/%3E%3Ccircle cx='4' cy='24' r='2'/%3E%3Ccircle cx='11' cy='24' r='2'/%3E%3Ccircle cx='23' cy='24' r='2'/%3E%3C/g%3E%3C/svg%3E"); }
.sheet-card.center { text-align: center; }
/* a link's little shape in the list and the chat header */
.avatar.shape { background: none; overflow: visible; }
.avatar.shape svg { width: 100%; height: 100%; stroke: none; overflow: visible; }
.chat-title.tap, #chatAvatar.shape { cursor: pointer; }
.chat-list .on-count { font-size: 12.5px; font-weight: 600; color: #1f9d55; white-space: nowrap; margin-left: 6px; }
@media (prefers-color-scheme: dark) { .chat-list .on-count { color: #5fe39a; } }
.pick-list.tall { max-height: 60vh; }
.pick .lead-tag, .pick .on-dot { margin-left: auto; }
.pick .lead-tag { font-size: 12px; font-weight: 600; color: var(--padi-ink); }
.pick .on-dot { width: 9px; height: 9px; border-radius: 50%; background: #2fd27a; box-shadow: 0 0 6px #2fd27a; }
.map-wrap .node.more .bg { fill: var(--surface); stroke: var(--padi); stroke-width: 2; stroke-dasharray: 4 3; }
.map-wrap .node.more .ini { fill: var(--padi-ink); font-size: 15px; }
.map-wrap .node.add .bg { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 3 4; }
.map-wrap .node.add .ini { fill: var(--muted); font-size: 26px; font-weight: 400; }
.map-wrap .node.add .nm { fill: var(--muted); font-weight: 500; }
.map-wrap .node.add:active .bg { fill: var(--padi-soft); }
.map-wrap .edge.to-add { stroke-dasharray: 4 6; opacity: .35; animation: none; stroke-dashoffset: 0; }
/* ---- "new version" bar ---- */
.update-bar { position: fixed; z-index: 30; left: 50%; top: calc(70px + env(safe-area-inset-top)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 9px 9px 9px 16px; border-radius: 999px; white-space: nowrap; font-size: 14.5px; font-weight: 500;
  color: var(--bg); background: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .25), 0 0 0 1px var(--padi-soft); animation: drop .35s cubic-bezier(.2, .9, .3, 1.2); }
.update-bar b { padding: 6px 14px; border-radius: 999px; color: var(--on-padi); background: var(--padi); font-weight: 700; }
.update-bar .spark { width: 8px; height: 8px; border-radius: 50%; background: var(--padi); box-shadow: 0 0 10px var(--padi); }
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } }
/* ---- QR: my code and scanning ---- */
.qr-card { position: relative; margin: 6px auto 14px; max-width: 320px; padding: 22px 22px 14px; border-radius: 28px; color: #15201b;
  background: linear-gradient(160deg, #ffffff, #e9f6f0); box-shadow: 0 12px 40px var(--padi-soft), 0 2px 8px rgba(0, 0, 0, .12); }
.qr-card .avatar { margin: -52px auto 8px; width: 64px; height: 64px; font-size: 26px; box-shadow: 0 0 0 4px #fff; }
.qr-name { font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.qr-box { margin: 12px auto 6px; width: min(240px, 62vw); aspect-ratio: 1; display: grid; place-items: center; }
.qr-box svg { width: 100%; height: 100%; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; } /* undo the icon rule: thick round lines break the code */
.qr-box .qr-fallback { font-size: 13px; word-break: break-all; color: #15201b; }
.qr-card .muted { color: #5c6b65; }
.qr-actions { justify-content: center; margin-bottom: 4px; }
.ghost.small { font-size: 13.5px; font-weight: 500; padding: 10px; color: var(--muted); }
.scan-box { position: relative; margin: 8px auto 10px; width: min(300px, 78vw); aspect-ratio: 1; border-radius: 24px; overflow: hidden; background: #000; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 18%; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); border: 2px solid var(--padi);
  animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); border-color: #fff; } }
.sheet-card.center .avatar { margin: 4px auto 10px; }
.set-group.flat { margin: 14px 0 0; background: var(--surface-2); text-align: left; }
.pick.tap { cursor: pointer; border-radius: 12px; padding: 8px 6px; } .pick.tap:active { background: var(--hair); }
.pick .plus { margin-left: auto; color: var(--padi); font-weight: 700; font-size: 22px; }

/* ---- FAB and bottom navigation ---- */
.fab { position: absolute; right: 18px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 4; width: 58px; height: 58px; border-radius: 18px;
  display: grid; place-items: center; background: var(--padi); color: var(--on-padi);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18); transition: transform .12s; }
.fab:active { transform: scale(.95); }
.fab svg { width: 26px; height: 26px; }
.bottom-nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  background: var(--bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.bottom-nav .pill { position: relative; width: 64px; height: 32px; border-radius: 16px; display: grid; place-items: center; transition: background .2s; }
.bottom-nav button.on { color: var(--ink); font-weight: 700; }
.bottom-nav button.on .pill { background: var(--padi-soft); color: var(--padi-ink); }
.bottom-nav button.on svg { stroke-width: 2; }
.nav-badge { position: absolute; top: -3px; right: 8px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; background: var(--padi); color: var(--on-padi); }

.menu { position: absolute; top: calc(52px + env(safe-area-inset-top)); right: 10px; z-index: 6; min-width: 210px; padding: 6px;
  border-radius: 16px; background: var(--surface); box-shadow: 0 10px 34px rgba(0, 0, 0, .2); }
.menu button { display: block; width: 100%; text-align: left; padding: 12px 14px; border-radius: 10px; font-size: 16px; }
.menu button:active { background: var(--hair); }

/* ---- You ---- */
.me-card { text-align: center; padding: 20px 20px 24px; }
.me-card .avatar { margin: 0 auto 12px; }
.me-name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.set-group { margin: 0 16px 14px; border-radius: 18px; background: var(--surface); overflow: hidden; }
.set-row { display: flex; align-items: center; width: 100%; min-height: 56px; padding: 0 16px; text-align: left; font-size: 16.5px; transition: background .15s; }
.set-row:active { background: var(--hair); }
.set-row .lbl { flex: 1; }
.set-row svg { width: 18px; height: 18px; color: var(--muted); }
.set-row + .set-row { box-shadow: inset 0 .5px 0 var(--hair); }
.set-row.danger { color: #d0473a; }

/* ---- one chat ---- */
#chat { background: var(--chat-bg) var(--pattern); background-size: 64px 64px; }
.chat-bar { display: flex; align-items: center; gap: 6px; height: calc(64px + env(safe-area-inset-top)); padding-left: 2px; padding-right: 12px;
  background: var(--bar); }
.chat-bar .avatar { width: 40px; height: 40px; font-size: 16px; }
.chat-bar .avatar svg { width: 21px; height: 21px; }
.chat-title { flex: 1; min-width: 0; margin-left: 4px; }
.chat-title > div:first-child { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner { position: absolute; z-index: 2; top: calc(72px + env(safe-area-inset-top)); left: 16px; right: 16px; border-radius: 12px;
  font-size: 13px; padding: 9px 14px; text-align: center; color: #6e5410; background: #fbefc8; box-shadow: var(--shadow); }
.messages { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  padding: calc(76px + env(safe-area-inset-top)) 12px calc(80px + env(safe-area-inset-bottom)); }
.day { align-self: center; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 5px 12px; margin: 10px 0 8px;
  border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.msg { max-width: 80%; padding: 6px 9px 6px 10px; border-radius: 14px; font-size: 16px; line-height: 1.35;
  white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--shadow); margin-top: 6px; }
.msg.in { align-self: flex-start; background: var(--bubble-in); border-top-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--bubble-out); border-top-right-radius: 4px; }
.msg.cont { margin-top: 2px; }
.msg.cont.in { border-top-left-radius: 14px; } .msg.cont.out { border-top-right-radius: 14px; }
.meta { float: right; margin: 8px 0 -4px 10px; font-size: 11px; color: var(--muted); display: inline-flex; gap: 3px; align-items: center;
  font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { .msg.out .meta { color: rgba(233, 240, 237, .65); } }
.tick { font-size: 12.5px; letter-spacing: -4px; padding-right: 4px; }
.tick.read { color: var(--blue-tick); }
.who { --h: 158; font-size: 13.5px; font-weight: 600; margin-bottom: 1px; color: hsl(var(--h) 52% 38%); }
@media (prefers-color-scheme: dark) { .who { color: hsl(var(--h) 62% 72%); } }

/* composer */
.composer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: flex-end; gap: 6px;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
.round { width: 48px; height: 48px; flex: none; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.input-wrap { flex: 1; min-width: 0; position: relative; display: flex; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.input-wrap textarea { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; border-radius: 24px; padding: 13px 50px 13px 18px;
  resize: none; max-height: 120px; outline: none; font-size: 16.5px; line-height: 1.3; }
.input-wrap textarea::placeholder { color: var(--muted); }
.cam { position: absolute; right: 3px; bottom: 2px; color: var(--muted); }
.send { width: 48px; height: 48px; border-radius: 50%; background: var(--padi); color: var(--on-padi); flex: none; display: grid; place-items: center;
  box-shadow: var(--shadow); transition: transform .12s; }
.send:active { transform: scale(.94); }
.send svg { stroke-width: 2.2; width: 22px; height: 22px; }
/* empty box: the send button is a mic (hold to record a voice note) */
.send .i-mic { display: none; stroke-width: 1.9; } .send.mic .i-mic { display: block; } .send.mic .i-send { display: none; }
.send.mic { touch-action: none; }
.rec-bar { display: none; position: absolute; left: 10px; right: 64px; bottom: calc(8px + env(safe-area-inset-bottom)); height: 48px; z-index: 2;
  align-items: center; gap: 10px; padding: 0 18px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.composer.recording .rec-bar { display: flex; }
.composer.recording .send { transform: scale(1.35); background: #d0473a; color: #fff; box-shadow: 0 0 0 8px rgba(208, 71, 58, .18); }
.composer.recording.cancelling .send { background: var(--muted); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #d0473a; animation: blink 1s ease-in-out infinite; }
.rec-hint { margin-left: auto; font-weight: 500; font-size: 13.5px; color: var(--muted); }
.composer.cancelling .rec-hint { color: #d0473a; }
@keyframes blink { 50% { opacity: .25; } }

/* photos */
.msg.photo { padding: 3px 3px 5px; }
.msg.photo .meta { margin-right: 6px; }
/* ---- voice clips ---- */
.msg.voice { min-width: 230px; }
.vc { display: flex; align-items: center; gap: 10px; padding: 2px 0 0; }
.vc .play { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--on-padi); background: var(--padi); }
.vc .play svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.vc .wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; }
.vc .wave i { flex: 1; min-height: 3px; border-radius: 2px; background: var(--muted); opacity: .55; transition: background .2s, opacity .2s; }
.vc .wave i.on { background: var(--padi); opacity: 1; }
.vc .len { font-size: 12px; color: var(--muted); min-width: 30px; }
.vc .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--padi); flex: none; }
.vc .roger-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--padi-ink); text-transform: uppercase; }
/* ---- Roger mode ---- */
.roger-toggle { color: var(--muted); }
#chat.roger .roger-toggle { color: var(--on-padi); background: var(--padi); box-shadow: 0 0 18px var(--padi); }
#chat.roger { background: radial-gradient(90% 55% at 50% 100%, var(--padi-soft), transparent 70%), var(--chat-bg) var(--pattern); background-size: auto, 64px 64px; }
#chat.roger .composer { display: none; }
#chat.roger .messages { padding-bottom: calc(230px + env(safe-area-inset-bottom)); }
.roger-panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; flex-direction: column; align-items: center;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); user-select: none; -webkit-user-select: none; }
.roger-status { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-radius: 15px; font-weight: 600; font-size: 14px;
  color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.roger-status .bars { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.roger-status .bars i { width: 3px; border-radius: 2px; background: var(--padi); animation: eq .9s ease-in-out infinite; }
.roger-status .bars i:nth-child(2) { animation-delay: -.3s; } .roger-status .bars i:nth-child(3) { animation-delay: -.6s; } .roger-status .bars i:nth-child(4) { animation-delay: -.15s; }
.roger-panel.live .roger-status .bars, .roger-panel.hear .roger-status .bars { display: flex; }
.roger-panel.live .roger-status { color: #fff; background: #d0473a; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.talk { position: relative; width: 112px; height: 112px; margin: 12px 0 8px; border-radius: 50%; display: grid; place-items: center; touch-action: none;
  color: var(--on-padi); background: radial-gradient(circle at 35% 30%, var(--padi-ink), var(--padi) 60%);
  box-shadow: 0 10px 34px var(--padi-soft), 0 6px 16px rgba(0, 0, 0, .2); transition: transform .12s, background .2s; }
.talk svg { width: 42px; height: 42px; stroke-width: 1.8; position: relative; }
.talk .ring { position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--padi); opacity: 0; transform: scale(var(--lvl, 1)); transition: transform .08s; }
.roger-panel.live .talk { transform: scale(1.06); background: radial-gradient(circle at 35% 30%, #ff7b6e, #d0473a 60%); color: #fff; }
.roger-panel.live .talk .ring { opacity: .6; border-color: #d0473a; }
.roger-hint { font-size: 12.5px; color: var(--muted); text-align: center; }
@media (prefers-reduced-motion: reduce) { .roger-status .bars i { animation: none; height: 8px; } }
.pic { position: relative; border-radius: 11px; overflow: hidden; background: var(--surface-2); max-width: 100%; cursor: pointer; margin-bottom: 3px; }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic img.blur { filter: blur(8px); transform: scale(1.1); }
.pic-note { position: absolute; left: 8px; right: 8px; bottom: 8px; text-align: center; font-size: 13px; padding: 6px; border-radius: 10px;
  color: #fff; background: rgba(0, 0, 0, .4); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.viewer { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .9); }
.viewer img { max-width: 100%; max-height: 100%; }
.fail { color: #d0473a; font-size: 12px; white-space: normal; }

/* ---- sheets ---- */
.sheet { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .32); }
.sheet-card { width: 100%; max-width: 720px; border-radius: 26px 26px 0 0; background: var(--surface);
  padding: 10px 22px calc(18px + env(safe-area-inset-bottom)); animation: up .24s cubic-bezier(.2, .8, .2, 1); }
.sheet-card::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--surface-2); margin: 0 auto 14px; }
.sheet-card h2 { margin: 0 0 8px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .sheet-card { animation: none; } }

.field { display: block; margin: 12px 0; flex: 1; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input { width: 100%; border: 0; border-radius: 12px; padding: 12px 14px; font-size: 17px; outline: none; background: var(--surface-2); }
.field input:focus { box-shadow: inset 0 0 0 1.5px var(--padi); }
.row { display: flex; gap: 12px; align-items: center; }
.primary { background: var(--padi); color: var(--on-padi); padding: 14px 18px; border-radius: 26px; font-weight: 600; width: 100%; }
.primary:active { background: var(--padi-ink); }
.row .primary { width: auto; flex: 1; }
.ghost { color: var(--padi-ink); padding: 14px 16px; font-weight: 600; }

.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 6px; margin: 16px 0 10px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; text-align: center; color: var(--ink); }
.tool .ico { width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; color: var(--padi-ink); background: var(--padi-soft); }
.tool .ico svg { width: 27px; height: 27px; stroke-width: 1.5; }
.tool.soon { color: var(--muted); }
.tool.soon .ico { color: var(--muted); background: var(--surface-2); }
.tool .soon-tag { font-size: 10.5px; color: var(--muted); margin-top: -5px; }
.bmi-out { border-radius: 18px; padding: 16px; text-align: center; margin: 8px 0; background: var(--surface-2); }
.bmi-out .num { font-size: 46px; font-weight: 300; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.pick-list { max-height: 40vh; overflow-y: auto; margin: 6px 0; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px 2px; font-size: 16.5px; }
.pick input { width: 22px; height: 22px; accent-color: var(--padi); }

/* ---- sign up ---- */
#auth { overflow-y: auto; }
.auth-top { text-align: center; padding: 64px 20px 28px; }
.auth-top .wordmark { font-size: 34px; margin-top: 14px; }
.auth-top .muted { margin: 4px 0 0; }
.logo { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto; display: grid; place-items: center; font-size: 42px; font-weight: 700;
  color: var(--on-padi); background: var(--padi); }
.auth-card { margin: 0 16px 32px; border-radius: 22px; padding: 18px; background: var(--surface); }
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 9px; border-radius: 11px; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.seg.small button { padding: 6px; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  padding: 11px 18px; border-radius: 14px; font-size: 14.5px; max-width: 90%; color: var(--bg); background: var(--ink);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .2); }

/* test mode: sign-up, log-out and "find someone" are hidden, not removed */
body.test-mode .no-test { display: none !important; }
body:not(.test-mode) .only-test { display: none !important; }
.roger-on .toast { bottom: calc(262px + env(safe-area-inset-bottom)); }

@keyframes fadein { from { opacity: 0; } }

/* ---- Status: 24-hour updates (own tab, like WhatsApp; no ads, ever) ---- */
:root { --st-seen: #c3cfc9; }
@media (prefers-color-scheme: dark) { :root { --st-seen: #4a5d55; } }
.nav-badge.dot { right: 10px; }
.st-me { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 80px; padding: 4px 16px; text-align: left; transition: background .15s; }
.st-me:active { background: var(--hair); }
.st-ring { position: relative; flex: none; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; }
.st-ring .avatar { width: 52px; height: 52px; font-size: 20px; }
.st-ring.has .avatar { box-shadow: 0 0 0 2.5px var(--bg); }
.st-plus { position: absolute; left: 58px; top: 50px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--padi); color: var(--on-padi); border: 2.5px solid var(--bg); }
.st-plus svg { width: 14px; height: 14px; stroke-width: 2.6; }
.st-me .info, .st-list .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-me .name, .st-list .name { font-weight: 600; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-me .last, .st-list .last { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.st-sec { padding: 14px 20px 4px; font-size: 13.5px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.st-list { list-style: none; margin: 0; padding: 0; }
.st-list li { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 0 16px; cursor: pointer; transition: background .15s; }
.st-list li:active { background: var(--hair); }
.st-list:not(.seen) .st-ring { filter: drop-shadow(0 0 5px var(--padi-soft)); }
.st-empty { padding-top: 40px; }
.fab.mini { width: 44px; height: 44px; border-radius: 14px; right: 25px; bottom: calc(160px + env(safe-area-inset-bottom));
  background: var(--surface-2); color: var(--padi-ink); box-shadow: 0 4px 12px rgba(0, 0, 0, .14); }
.fab.mini svg { width: 21px; height: 21px; }

/* full-screen layers */
.st-compose, .st-view { position: fixed; inset: 0; z-index: 25; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column;
  color: #fff; background: #0b120f; overscroll-behavior: contain; }
.icon.light { color: #fff; }
.icon.light:active { background: rgba(255, 255, 255, .14); }
.st-top { display: flex; justify-content: space-between; align-items: center; padding: calc(8px + env(safe-area-inset-top)) 6px 0; }
.st-top-actions { display: flex; }

/* write */
.st-compose { --st-bg: #1f9d74; background: var(--st-bg); transition: background .3s; }
.st-compose.photo { background: #0b120f; }
.st-canvas { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 10px 22px; }
.st-canvas textarea { width: 100%; border: 0; outline: none; resize: none; background: transparent; color: #fff; text-align: center;
  font-weight: 700; letter-spacing: -.02em; line-height: 1.25; caret-color: #fff; }
.st-canvas textarea::placeholder { color: rgba(255, 255, 255, .6); }
.st-canvas img { max-width: 100%; max-height: 100%; border-radius: 14px; object-fit: contain; }
.st-bottom { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.st-caption { height: 46px; padding: 0 18px; border-radius: 23px; border: 0; outline: none; background: rgba(255, 255, 255, .14); color: #fff; font-size: 16px; }
.st-caption::placeholder { color: rgba(255, 255, 255, .6); }
.st-send-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.st-aud { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 20px; background: rgba(0, 0, 0, .28);
  color: #fff; font-size: 14.5px; font-weight: 600; max-width: 70%; }
.st-aud span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-aud svg { width: 18px; height: 18px; flex: none; } .st-aud .chev { width: 16px; height: 16px; opacity: .8; }
.st-post { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: #fff; color: #10795a;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .25); transition: transform .12s, opacity .2s; }
.st-post svg { stroke-width: 2.2; }
.st-post:active { transform: scale(.94); }
.st-post.busy { opacity: .5; pointer-events: none; }
.st-over { z-index: 35; }
.st-opt { gap: 14px; } .st-opt span { display: flex; flex-direction: column; } .st-opt small { color: var(--muted); font-size: 13px; }
.st-when { margin-left: auto; color: var(--muted); font-size: 13px; }

/* watch */
.st-bars { display: flex; gap: 4px; padding: calc(8px + env(safe-area-inset-top)) 10px 0; }
.st-bars span { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, .32); overflow: hidden; }
.st-bars i { display: block; height: 100%; width: 0; background: #fff; box-shadow: 0 0 6px rgba(255, 255, 255, .6); }
.st-head { display: flex; align-items: center; gap: 10px; padding: 8px 4px 8px 12px; }
.st-head .avatar { width: 38px; height: 38px; font-size: 15px; }
.st-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.st-who b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-who span { font-size: 12.5px; opacity: .75; }
.st-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.st-stage .st-img { position: relative; max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-drag: none; }
.st-stage:has(.st-img)::before { content: ""; position: absolute; inset: 0; backdrop-filter: blur(24px) brightness(.55); -webkit-backdrop-filter: blur(24px) brightness(.55); }
.st-txt { padding: 24px 28px; text-align: center; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; white-space: pre-wrap; word-break: break-word;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .15); }
.st-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
.st-cap { margin: 0; text-align: center; font-size: 15.5px; }
.st-seen, .st-reply { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 21px;
  background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; font-size: 15px; }
.st-seen svg, .st-reply svg { width: 19px; height: 19px; }
@media (prefers-reduced-motion: reduce) { .st-compose { transition: none; } }

/* ---- Message requests (strangers wait outside) + invites ---- */
.chat-list li.req-row .req-ic { background: var(--padi-soft); color: var(--padi-ink); }
.chat-list li.req-row .req-ic svg { width: 24px; height: 24px; }
.badge.quiet { background: var(--surface-2); color: var(--muted); }
.chat-list li.req-head { min-height: 0; gap: 6px; padding: 4px 16px 10px 6px; align-items: flex-start; cursor: default; }
.chat-list li.req-head:active { background: none; }
.req-head div { display: flex; flex-direction: column; padding-top: 9px; }
.req-head b { font-size: 18px; letter-spacing: -.02em; }
.req-head span { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
#chat.request .composer, #chat.request .roger-panel, #chat.request #rogerBtn, #chat.request #addPeopleBtn, #chat.request #unknownBanner { display: none !important; }
.req-panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 -1px 0 var(--hair); }
.req-text { margin: 0 4px 12px; text-align: center; color: var(--muted); font-size: 14.5px; }
.req-warn { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; text-align: center;
  color: #9a2a1f; background: rgba(208, 71, 58, .12); }
@media (prefers-color-scheme: dark) { .req-warn { color: #ff9d92; background: rgba(208, 71, 58, .2); } }
.req-btns { display: flex; gap: 8px; }
.req-b { flex: 1; height: 46px; border-radius: 23px; font-weight: 600; background: var(--surface-2); }
.req-b.danger { color: #d0473a; }
.req-b.main { background: var(--padi); color: var(--on-padi); }
.req-b:active { transform: scale(.97); }
#chat.request .messages { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.held { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 4px; border-radius: 10px; font-size: 14px; color: var(--muted);
  background: var(--hair); }
.held svg { width: 18px; height: 18px; flex: none; }
.invite-btn { margin: 18px auto 0; max-width: 220px; }
.invite-card { display: flex; align-items: center; gap: 12px; margin: 22px auto 0; max-width: 340px; padding: 12px 16px; border-radius: 18px;
  text-align: left; background: var(--padi-soft); }
.invite-card .avatar { width: 44px; height: 44px; font-size: 18px; }
.invite-txt { display: flex; flex-direction: column; }
.invite-txt span { font-size: 14px; color: var(--muted); }

/* ---- Link invites, who-can-add, devices ---- */
.set-row .lbl small { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.set-row:has(small) { min-height: 64px; }
.chat-list li.inv-row { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; cursor: default; }
.chat-list li.inv-row:active { background: none; }
.inv-btns { display: flex; gap: 8px; margin-top: 10px; }
.inv-btns .req-b { height: 38px; flex: 0 1 120px; font-size: 14.5px; }
.map-wrap .node.pending { opacity: .5; }
.map-wrap .node.pending .bg { stroke-dasharray: 4 4; }
.pick.dev { gap: 12px; }
.dev-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dev-txt small { color: var(--muted); font-size: 13px; }
.dev-out { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; font-size: 14px; font-weight: 600; color: #d0473a; background: var(--surface-2); }
.primary.danger-btn { background: rgba(208, 71, 58, .12); color: #d0473a; margin-top: 8px; }
.primary.danger-btn:active { background: rgba(208, 71, 58, .2); }

/* ---- Lessons from Telegram: Saved messages, code warnings, new-login alert, our promise ---- */
.avatar.saved-av, #chat.saved .chat-bar .avatar { background: var(--padi); color: var(--on-padi); }
#chat.saved #addPeopleBtn, #chat.saved #rogerBtn, #chat.saved #unknownBanner { display: none !important; }
.code-warn { margin-top: 6px; padding: 7px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: #9a2a1f; background: rgba(208, 71, 58, .12); }
@media (prefers-color-scheme: dark) { .code-warn { color: #ff9d92; background: rgba(208, 71, 58, .2); } }
.login-ic { width: 64px; height: 64px; margin: 4px auto 8px; border-radius: 20px; display: grid; place-items: center; color: #d0473a; background: rgba(208, 71, 58, .12); }
.login-ic svg { width: 30px; height: 30px; }
.promise-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.promise-list li { position: relative; padding-left: 30px; }
.promise-list li::before { content: ""; position: absolute; left: 2px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--padi-soft);
  box-shadow: inset 0 0 0 5px var(--padi-soft), inset 0 0 0 9px var(--padi); }
.promise-list b { display: block; font-size: 15.5px; }
.promise-list span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.promise-honest { margin: 16px 0 6px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; background: var(--surface-2); color: var(--muted); }
.promise-honest b { color: var(--ink); }

/* ---- Move chats to a new phone ---- */
.move-box { margin: 12px 0 0; padding: 14px; border-radius: 16px; background: var(--surface-2); display: grid; gap: 10px; }
.move-box > b { font-size: 14px; color: var(--muted); font-weight: 600; }
.move-go { max-width: none; width: 100%; }
.move-code { text-align: center; padding: 6px 0 2px; }
.move-code span, .move-code small { display: block; font-size: 13px; color: var(--muted); }
.move-code b { display: block; font-size: 38px; letter-spacing: .12em; color: var(--padi-ink); font-variant-numeric: tabular-nums; margin: 4px 0; }
.move-row { gap: 8px; flex-direction: column; align-items: stretch; }
.move-row input { flex: none; width: 100%; min-width: 0; height: 48px; padding: 0 14px; border-radius: 24px; border: 0; outline: none; background: var(--surface);
  font-size: 20px; letter-spacing: .15em; text-align: center; }
.move-row .primary { width: 100%; flex: none; }
.move-status { margin: 10px 2px 0; font-size: 14px; color: var(--padi-ink); min-height: 1em; }
.move-status.bad { color: #d0473a; }
.move-file { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }

/* ---- Kids (child accounts) ---- */
body.kid #kidsBtn, body.kid #inviteBtn, body.kid #addPolicyBtn, body.kid #qrShare, body.kid #qrReset,
body.kid #menuInvite, body.kid #emptyInvite, body.kid #logoutBtn { display: none !important; }
.kid-note { margin: 0 16px 14px; padding: 12px 14px; border-radius: 16px; background: var(--padi-soft); display: flex; flex-direction: column; gap: 2px; }
.kid-note b { color: var(--padi-ink); } .kid-note span { font-size: 14px; color: var(--muted); }
.kid-consent { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 4px; font-size: 13.5px; color: var(--muted); }
.kid-consent input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--padi); }
.kid-head { display: flex; align-items: center; gap: 12px; }
.kid-head h2 { margin: 0; }
.kid-setup { margin: 14px 0 4px; padding: 14px; border-radius: 16px; background: var(--surface-2); text-align: center; display: grid; gap: 8px; justify-items: center; }
.kid-setup .qr-box { width: 200px; background: #fff; border-radius: 14px; padding: 10px; }
.kid-label { margin: 14px 0 0; font-weight: 600; }
.pick .dev-out { margin-left: auto; }

/* ---- Hold a message: reply quote, reactions, forwarded, edited, deleted; typing ---- */
.reply-bar { position: absolute; left: 8px; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 3; display: flex; align-items: center; gap: 6px;
  padding: 8px 4px 8px 12px; border-radius: 16px; background: var(--surface); box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
  border-left: 4px solid hsl(var(--h, 158) 55% 45%); }
.rb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rb-txt b { font-size: 14px; color: hsl(var(--h, 158) 55% 38%); }
.rb-txt span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-color-scheme: dark) { .rb-txt b { color: hsl(var(--h, 158) 60% 70%); } }
#chat.barred .messages { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
.quote { display: flex; flex-direction: column; margin: 1px 0 5px; padding: 5px 9px; border-radius: 8px; cursor: pointer; font-size: 14px;
  background: rgba(0, 0, 0, .05); border-left: 3px solid hsl(var(--h) 55% 45%); max-width: 100%; }
.quote b { font-size: 13px; color: hsl(var(--h) 55% 36%); }
.quote span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-color-scheme: dark) { .quote { background: rgba(255, 255, 255, .06); } .quote b { color: hsl(var(--h) 60% 70%); } }
.fwd { font-size: 12.5px; font-style: italic; color: var(--muted); margin-bottom: 2px; }
.msg.deleted { font-style: italic; color: var(--muted); }
.msg.flash { animation: flash 1.2s ease; }
@keyframes flash { 30% { box-shadow: 0 0 0 3px var(--padi); } }
.msg { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.reacts { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 -2px; clear: both; }
.react { padding: 1px 7px; border-radius: 11px; font-size: 13.5px; background: var(--surface-2); box-shadow: 0 0 0 1.5px var(--bg); }
.react.mine { background: var(--padi-soft); }
.react-row { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 4px; }
.react-row button { width: 48px; height: 48px; border-radius: 50%; font-size: 26px; display: grid; place-items: center; transition: transform .12s, background .15s; }
.react-row button:active { transform: scale(1.2); }
.react-row button.on { background: var(--padi-soft); }
.status.typing, .chat-list .last.typing { color: var(--padi); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .msg.flash { animation: none; outline: 3px solid var(--padi); } }

.ask-faces { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 10px; color: var(--muted); font-size: 22px; }
.ask-faces .avatar { margin: 0 !important; }
.pick .ask-btns { margin-left: auto; display: flex; gap: 6px; }
.pick .ask-btns .req-b { height: 34px; padding: 0 12px; font-size: 14px; flex: none; }

/* ---- Documents ---- */
.input-wrap .clip { right: 41px; }
.input-wrap textarea { padding-right: 88px; }
.file-card { display: flex; align-items: center; gap: 10px; width: 250px; max-width: 100%; padding: 8px; margin: 1px 0 4px; border-radius: 10px;
  background: rgba(0, 0, 0, .05); text-align: left; }
@media (prefers-color-scheme: dark) { .file-card { background: rgba(255, 255, 255, .06); } }
.file-ic { flex: none; width: 40px; height: 48px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.file-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-txt b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-txt small { font-size: 12.5px; color: var(--muted); }

/* ---- Pin + @mentions ---- */
.pin-bar { position: absolute; z-index: 2; top: calc(60px + env(safe-area-inset-top)); left: 0; right: 0; display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; text-align: left; background: var(--bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 1px 0 var(--hair); }
.pin-bar svg { width: 18px; height: 18px; color: var(--padi); flex: none; }
.pin-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pin-txt b { font-size: 12.5px; color: var(--padi-ink); }
.pin-txt span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chat.pinned .messages { padding-top: calc(124px + env(safe-area-inset-top)); }
#chat.pinned .banner { top: calc(124px + env(safe-area-inset-top)); }
.mention-box { position: absolute; left: 8px; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 4; padding: 6px; border-radius: 16px;
  background: var(--surface); box-shadow: 0 4px 18px rgba(0, 0, 0, .16); max-height: 40vh; overflow-y: auto; }
.mention-box .pick { width: 100%; text-align: left; }
#chat.barred .mention-box { bottom: calc(130px + env(safe-area-inset-bottom)); }
.mention { color: var(--padi-ink); font-weight: 600; }
.mention.me { background: var(--padi-soft); border-radius: 4px; padding: 0 2px; }
.msg.mentions-me { box-shadow: inset 3px 0 0 var(--padi), var(--shadow); }
.badge.at { background: var(--padi); min-width: 22px; font-size: 13px; }

/* ---- Mute + folders ---- */
.chips { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; }
.folder-chips { display: contents; }
.chip.add { width: 34px; padding: 0; font-size: 17px; color: var(--padi-ink); }
.muted-ic { color: var(--muted); display: grid; place-items: center; }
.muted-ic svg { width: 18px; height: 18px; }
.folder-new { color: var(--padi-ink); font-weight: 600; width: 100%; text-align: left; }
.ghost.danger-txt { color: #d0473a; margin-right: auto; }

/* ---- Stickers ---- */
.input-wrap .smile { position: absolute; left: 3px; bottom: 2px; color: var(--muted); }
.input-wrap textarea { padding-left: 46px; }
.sticker-panel { position: absolute; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 3; height: 260px; overflow-y: auto;
  padding: 10px; background: var(--bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 -1px 0 var(--hair); }
.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stk-cell, .stk-make { aspect-ratio: 1; border-radius: 16px; display: grid; place-items: center; transition: transform .12s, background .15s; }
.stk-cell:active { transform: scale(.92); background: var(--hair); }
.stk-cell img { width: 92%; height: 92%; object-fit: contain; }
.stk-make { border: 2px dashed var(--padi); color: var(--padi-ink); align-content: center; gap: 2px; font-size: 12px; font-weight: 600; text-align: center; }
.stk-make b { font-size: 26px; line-height: 1; }
#chat.stk-open .messages { padding-bottom: calc(340px + env(safe-area-inset-bottom)); }
.msg.sticker { background: none !important; box-shadow: none !important; padding: 0; }
.msg.sticker .meta { float: none; display: inline-flex; margin: 0 0 0 6px; padding: 1px 6px; border-radius: 8px; background: var(--surface); }
.stk-img { display: block; width: 150px; height: 150px; object-fit: contain; cursor: pointer; }
.stk-img.wait { background: var(--hair); border-radius: 50%; }
.stk-canvas { width: 220px; height: 220px; margin: 6px auto 10px; display: block; border-radius: 16px;
  background: repeating-conic-gradient(var(--surface-2) 0 25%, transparent 0 50%) 0 0 / 20px 20px; }
.stk-shape { max-width: 280px; margin: 0 auto 10px; }
.stk-text { width: 100%; height: 46px; border: 0; outline: none; border-radius: 23px; padding: 0 16px; text-align: center; font-weight: 700;
  background: var(--surface-2); text-transform: uppercase; }
.stk-got { width: 200px; height: 200px; object-fit: contain; display: block; margin: 6px auto 10px; }
.stk-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.stk-tabs button { height: 32px; padding: 0 14px; border-radius: 16px; font-size: 14px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.stk-tabs button.on { background: var(--padi-soft); color: var(--padi-ink); }
.stk-credit { margin: 10px 0 2px; text-align: center; font-size: 11.5px; color: var(--muted); }
.stk-credit a { color: inherit; }
.sticker-panel { height: 300px; }
#chat.stk-open .messages { padding-bottom: calc(380px + env(safe-area-inset-bottom)); }

/* ---- Voice / video calls (call.js) ---- */
.call-btn { color: var(--ink); }
.call-screen { position: fixed; inset: 0; z-index: 60; overflow: hidden; color: #fff; display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; padding: calc(56px + env(safe-area-inset-top)) 20px calc(36px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 70% at 50% 28%, #2a5a48 0%, #18241f 55%, #0e1612 100%); }
.call-screen svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; background: #0e1612; }
.call-screen:not(.is-video) .call-remote { width: 1px; height: 1px; }
.call-screen.video-on .call-remote { opacity: 1; }
.call-local { position: absolute; z-index: 2; right: 14px; top: calc(14px + env(safe-area-inset-top)); width: 104px; height: 148px; object-fit: cover;
  border-radius: 18px; box-shadow: 0 8px 30px rgba(0,0,0,.45); transform: scaleX(-1); background: #0e1612; cursor: pointer; transition: all .3s; }
.call-local.back { transform: none; }
.call-screen:not(.video-on) .call-local { width: 100%; height: 100%; inset: 0; border-radius: 0; opacity: .35; z-index: 0; }
.call-screen.swap.video-on .call-local { inset: 0; width: 100%; height: 100%; border-radius: 0; z-index: 0; }
.call-screen.swap.video-on .call-remote { inset: auto 14px auto auto; top: calc(14px + env(safe-area-inset-top)); width: 104px; height: 148px; border-radius: 18px; z-index: 2; }
.call-top { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transition: all .35s; }
.call-av-wrap { position: relative; padding: 10px; border-radius: 50%; margin-bottom: 8px; }
.call-av { width: 128px; height: 128px; font-size: 52px; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.call-screen.ringing .call-av-wrap::before, .call-screen.ringing .call-av-wrap::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #34c08f; animation: callRipple 2.2s ease-out infinite; }
.call-screen.ringing .call-av-wrap::after { animation-delay: 1.1s; }
@keyframes callRipple { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.55); opacity: 0; } }
.call-name { font-size: 28px; font-weight: 700; letter-spacing: -.02em; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.call-state { font-size: 15px; opacity: .8; font-variant-numeric: tabular-nums; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.call-screen.video-on .call-top { flex-direction: row; align-self: flex-start; gap: 12px; text-align: left; }
.call-screen.video-on .call-av-wrap { display: none; }
.call-screen.video-on .call-name { font-size: 19px; }
.call-btns { position: relative; z-index: 1; display: flex; justify-content: center; gap: 22px; width: 100%; }
.call-screen.incoming .on-btns, .call-screen:not(.incoming) .in-btns { display: none; }
.call-screen.incoming .in-btns { gap: 90px; }
.call-screen:not(.is-video) .vid-only { display: none; }
.call-screen.ended .call-btns { visibility: hidden; }
.cb { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; opacity: .92; }
.call-round { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .12s, background .2s; }
.call-round:active { transform: scale(.9); }
.call-round.red { background: #e5484d; box-shadow: 0 6px 24px rgba(229,72,77,.45); }
.call-round.red svg { transform: rotate(0deg); fill: currentColor; stroke-width: 1.2; }
.call-round.green { background: #34c08f; box-shadow: 0 0 0 0 rgba(52,192,143,.6); }
.call-round.pulse { animation: callPulse 1.6s infinite; }
@keyframes callPulse { 0% { box-shadow: 0 0 0 0 rgba(52,192,143,.55); } 70% { box-shadow: 0 0 0 22px rgba(52,192,143,0); } 100% { box-shadow: 0 0 0 0 rgba(52,192,143,0); } }
.call-round.glass { background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.call-round .slash { display: none; }
.call-screen.muted #callMute, .call-screen.cam-off #callCam { background: #fff; color: #18241f; }
.call-screen.muted #callMute .slash, .call-screen.cam-off #callCam .slash { display: inline; }
.day.call-line { background: var(--surface); color: var(--ink); }
.day.call-line.missed { color: #d13b40; }
body.in-call .toast { z-index: 70; }

/* ---- Plans + Jom cards (plan.js) ---- */
.plan-strip { position: absolute; z-index: 3; top: calc(64px + env(safe-area-inset-top)); left: 0; right: 0; display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; text-align: left; color: var(--ink); background: var(--bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: 0 1px 0 var(--hair), inset 3px 0 0 var(--padi); }
#chat.planned .messages { padding-top: calc(124px + env(safe-area-inset-top)); }
#chat.planned .pin-bar { top: calc(116px + env(safe-area-inset-top)); }
#chat.planned.pinned .messages { padding-top: calc(176px + env(safe-area-inset-top)); }
.plan-strip svg { width: 20px; height: 20px; flex: none; color: var(--padi-ink); }
.plan-strip .pin-txt { min-width: 0; }
.plan-strip #planStripText { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-screen { position: fixed; inset: 0; z-index: 9; display: flex; flex-direction: column; background: var(--bg); }
.plan-tabs { margin: 10px 14px 0; }
.plan-body { flex: 1; overflow-y: auto; padding: 8px 14px calc(96px + env(safe-area-inset-bottom)); }
.plan-add { position: fixed; z-index: 9; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); padding: 14px 22px; border-radius: 18px;
  background: var(--padi); color: var(--on-padi); font-weight: 700; box-shadow: 0 8px 26px rgba(31,157,116,.35); }
.plan-lead { color: var(--muted); font-size: 14.5px; margin: 10px 2px 14px; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tpl { display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; border-radius: 18px; text-align: left; background: var(--surface); box-shadow: var(--shadow); min-height: 96px; }
.tpl b { font-size: 16.5px; } .tpl span { font-size: 13px; color: var(--muted); }
.tpl:active { transform: scale(.97); }
.plan-count { font-size: 13px; color: var(--muted); margin: 8px 2px 6px; }
.plan-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-bottom: 6px; }
.plan-progress i { display: block; height: 100%; background: var(--padi); border-radius: 3px; transition: width .4s; }
.plan-phase { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--padi-ink); margin: 18px 4px 6px; }
.plan-list { background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.step, .mline, .owe { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.step + .step, .mline + .mline, .owe + .owe { box-shadow: inset 0 .5px 0 var(--hair); }
.step-txt { flex: 1; min-width: 0; }
.step-title { font-size: 15.5px; }
.step-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.step-sub.late { color: #d0473a; font-weight: 600; }
.step .tick { width: 26px; height: 26px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--muted); }
.step.done .tick { background: var(--padi); box-shadow: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.step.done .step-title { color: var(--muted); text-decoration: line-through; }
.money-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.msum { background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.msum span { display: block; font-size: 12px; color: var(--muted); } .msum b { font-size: 17px; }
.msum.ok b { color: var(--padi-ink); } .msum.due b { color: #d0473a; }
.mamt { font-variant-numeric: tabular-nums; }
.owe-txt { flex: 1; } .owe-btn { padding: 7px 12px; border-radius: 14px; background: var(--padi-soft); color: var(--padi-ink); font-weight: 600; font-size: 13px; }
.plan-select { width: 100%; border: 0; border-radius: 12px; padding: 12px 10px; font-size: 16px; background: var(--surface-2); color: var(--ink); }
.field.narrow { flex: 0 0 120px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.chips button, .chip { padding: 7px 12px; border-radius: 16px; background: var(--surface-2); font-size: 13.5px; font-weight: 500; }
.settle { margin-left: auto; padding: 4px 10px; border-radius: 12px; font-size: 12.5px; background: var(--surface-2); color: var(--muted); }
.settle.on { background: var(--padi-soft); color: var(--padi-ink); font-weight: 600; }
.sheet.over-plan { z-index: 12; }
.hint { font-size: 13px; color: var(--muted); margin: 0 2px 8px; }
.msg.jom-msg { padding: 6px; min-width: 240px; }
.jom-card { border-radius: 14px; padding: 12px 12px 10px; background: linear-gradient(135deg, rgba(52,192,143,.18), rgba(52,192,143,.05)); }
.jom-tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--on-padi); background: var(--padi); border-radius: 8px; padding: 2px 8px; box-shadow: 0 0 14px rgba(52,192,143,.5); }
.jom-title { font-size: 18px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -.01em; }
.jom-place { display: block; color: inherit; font-size: 14px; margin: 2px 0; }
.jom-when { font-size: 14px; margin: 2px 0; }
.jom-who { font-size: 12.5px; color: var(--muted); margin: 8px 0; }
.jom-btns { display: flex; align-items: center; gap: 8px; }
.jom-ikut { flex: 1; padding: 10px; border-radius: 12px; font-weight: 700; background: var(--padi); color: var(--on-padi); }
.jom-ikut.on { background: var(--surface); color: var(--padi-ink); box-shadow: inset 0 0 0 1.5px var(--padi); }
.jom-step { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); font-size: 18px; font-weight: 700; }
.jom-n { font-size: 13px; font-weight: 600; min-width: 44px; text-align: center; }
.plan-screen > .bar { position: relative; flex: none; }
.plan-screen .chat-title { flex: 1; min-width: 0; }
.plan-screen #planTitle { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Lists & polls (things.js) ---- */
.team-chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px 4px; flex: none; }
.team-chips:empty { display: none; }
.tchip { flex: none; padding: 7px 14px; border-radius: 16px; background: var(--surface-2); font-size: 14px; font-weight: 600; color: var(--muted); }
.tchip.on { background: var(--padi-soft); color: var(--padi-ink); }
.tchip.add { background: none; box-shadow: inset 0 0 0 1.5px var(--hair); }
.thing-card { display: block; width: 100%; text-align: left; background: var(--surface); border-radius: 18px; padding: 14px; margin-top: 10px; box-shadow: var(--shadow); }
.thing-card:active { transform: scale(.985); }
.tc-top { display: flex; gap: 6px; align-items: center; }
.tc-kind { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; color: var(--padi-ink); background: var(--padi-soft); padding: 2px 7px; border-radius: 7px; }
.tc-team { font-size: 12px; color: var(--muted); }
.tc-title { font-size: 17px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.01em; }
.tc-sub { font-size: 13px; color: var(--muted); }
.thing-card .plan-progress { margin: 10px 0 0; }
.quick-add { display: flex; gap: 8px; margin-top: 10px; }
.quick-add input { flex: 1; border: 0; border-radius: 14px; padding: 12px 14px; font-size: 16px; background: var(--surface); box-shadow: var(--shadow); outline: none; color: var(--ink); }
.quick-add input:focus { box-shadow: inset 0 0 0 1.5px var(--padi); }
.quick-add button { padding: 0 16px; border-radius: 14px; background: var(--padi); color: var(--on-padi); font-weight: 700; }
.money-sum.one { grid-template-columns: 1fr; }
.opt { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; overflow: hidden; }
.opt + .opt { box-shadow: inset 0 .5px 0 var(--hair); }
.opt > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--padi-soft); transition: width .4s; }
.opt > * { position: relative; }
.opt-dot { width: 22px; height: 22px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--muted); }
.opt.on .opt-dot { background: var(--padi); box-shadow: inset 0 0 0 5px var(--surface), 0 0 0 2px var(--padi); }
.opt-txt { flex: 1; min-width: 0; } .opt-n { font-variant-numeric: tabular-nums; }
.col-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.col-toggles .pick { margin: 0; }
.unit-in { width: 90px; margin-left: 6px; border: 0; border-radius: 10px; padding: 6px 8px; font-size: 14px; background: var(--surface-2); color: var(--ink); }
.opt-inputs { display: flex; flex-direction: column; gap: 6px; }
.opt-inputs input { border: 0; border-radius: 12px; padding: 11px 14px; font-size: 16px; background: var(--surface-2); outline: none; color: var(--ink); }
.pick-scroll { max-height: 50vh; overflow-y: auto; }
.thing-msg { display: block; width: 100%; text-align: left; border-radius: 14px; padding: 12px; background: linear-gradient(135deg, rgba(52,192,143,.16), rgba(52,192,143,.04)); }
.thing-msg .tc-title { font-size: 16.5px; }
#planScreen .chat-bar #planSet { margin-left: auto; }

/* ---- Voice room (room.js); Roger's hold-to-talk toggle is retired ---- */
#rogerBtn { display: none !important; }
.room-btn { position: relative; }
.room-btn.live { color: var(--padi-ink); }
.room-btn.live::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--padi); animation: roomPulse 1.8s infinite; }
.room-btn.mine { background: var(--padi); color: var(--on-padi); box-shadow: 0 0 18px var(--padi); }
.room-btn.mine::after { display: none; }
@keyframes roomPulse { 0% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.35); } }
.room-n { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10.5px; font-weight: 700; line-height: 16px;
  background: var(--padi); color: var(--on-padi); }
.room-n:empty { display: none; }
.room-btn.mine .room-n { background: var(--on-padi); color: var(--padi-ink); }
.room-bar { position: fixed; z-index: 8; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 12px; border-radius: 20px; background: #18241f; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 0 1px rgba(52,192,143,.4); cursor: pointer; max-width: 696px; margin: 0 auto; }
.room-bar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.room-ico { color: #34c08f; display: grid; place-items: center; animation: roomGlow 2s infinite; }
@keyframes roomGlow { 50% { filter: drop-shadow(0 0 6px #34c08f); } }
.room-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.room-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-txt span { font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-mute { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; }
.room-mute .slash { display: none; }
.room-mute.on { background: #fff; color: #18241f; } .room-mute.on .slash { display: inline; }
.room-leave { padding: 10px 14px; border-radius: 16px; background: #e5484d; color: #fff; font-weight: 700; font-size: 13.5px; }
body.in-room .messages { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
body.plan-open .room-bar { bottom: calc(90px + env(safe-area-inset-bottom)); }
.money-sum .msum b { font-size: 15px; white-space: nowrap; }
body.in-room .fab { bottom: calc(150px + env(safe-area-inset-bottom)); }
body.in-room .fab.mini { bottom: calc(218px + env(safe-area-inset-bottom)); }


/* ---------- Group squircle icon (distinct from circular 1-to-1 avatar) ---------- */
.avatar.grp-sq {
  border-radius: 16px;
  box-shadow: inset 0 0 0 1.5px hsl(var(--h) 45% 42% / 0.28);
  overflow: visible;
}
.chat-bar .avatar.grp-sq { border-radius: 12px; }
.avatar.grp-sq .grp-tag {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: hsl(var(--h) 55% 40%);
  border: 2px solid var(--surface);
}
.chat-bar .avatar.grp-sq .grp-tag { width: 11px; height: 11px; border-width: 1.5px; }

/* ---------- Contextual Quick Tools bar inside chat ---------- */
.chat-tool-bar {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.chat-tool-bar::-webkit-scrollbar { display: none; }
.qt-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--padi-soft);
  color: var(--padi-ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
  transition: transform 0.1s;
}
.qt-pill:active { transform: scale(0.96); }
.qt-pill .qt-ico { display: inline-flex; width: 14px; height: 14px; }
.qt-pill .qt-ico svg { width: 14px; height: 14px; stroke-width: 2; }
.qt-pill.more { background: var(--surface-2); color: var(--muted); }
.qt-pill.on-gt { background: var(--padi); color: var(--on-padi); }

/* ---------- Multi-page Tools Sheet & Tab ---------- */
.tp-wrap { padding: 0 14px 90px; }
.tools-card { max-width: 520px; width: 100%; max-height: 88dvh; overflow-y: auto; }
.tp-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 10px 0 4px;
  padding-bottom: 2px;
}
.tp-tabs::-webkit-scrollbar { display: none; }
.tp-tab {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
  flex: none;
}
.tp-tab.on { background: var(--padi); color: var(--on-padi); }
.tp-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.tp-pager button:disabled { opacity: 0.35; pointer-events: none; }

/* ---------- Group type picker (New group sheet) ---------- */
.gt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}
.gt-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  text-align: left;
  color: var(--ink);
}
.gt-opt.on {
  border-color: hsl(var(--h) 55% 42%);
  background: hsl(var(--h) 55% 42% / 0.1);
}
.gt-opt .gt-ico {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: hsl(var(--h) 55% 42% / 0.16);
  color: hsl(var(--h) 55% 34%);
  margin-bottom: 2px;
}
.gt-opt .gt-ico svg { width: 17px; height: 17px; }
.gt-opt b { font-size: 13px; }
.gt-opt small { font-size: 11px; color: var(--muted); line-height: 1.25; }

/* ---------- Tool Runner Components ---------- */
.tr-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.tool-card {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat-grid > div {
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
}
.stat-grid b { font-size: 16px; color: var(--ink); }
.stat-grid span { font-size: 11px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.tool-ta {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface);
  color: var(--ink);
  font: 13.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
}
.tool-form { display: flex; flex-direction: column; gap: 8px; }
.tool-form input, .tool-form select {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}
.pe-stage {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  touch-action: none;
}
.pe-stage canvas { width: 100%; height: auto; display: block; cursor: crosshair; }

/* ---------- Convoy Team Tracker Radar ---------- */
.tracker-radar {
  position: relative;
  height: 78px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--surface-2), var(--padi-soft));
  border: 1px solid var(--line);
  overflow: hidden;
}
.radar-road {
  position: absolute;
  left: 12px; right: 12px; top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 4px;
  background: var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.radar-road span { position: relative; top: -18px; font-weight: 600; }
.radar-dot {
  position: absolute;
  top: 50%;
  width: 14px; height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.radar-dot span {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink);
}
.trk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface-2);
}
.trk-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.trk-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trk-info b { font-size: 13.5px; }
.trk-info span { font-size: 11.5px; color: var(--muted); }
.trk-st { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.trk-st.ok { background: #dcfce7; color: #166534; }
.trk-st.warn { background: #fef3c7; color: #92400e; }

/* ---------- Qibla dial ---------- */
.qibla-dial {
  width: 128px; height: 128px; margin: 0 auto;
  border-radius: 50%;
  border: 3px solid var(--padi);
  background: var(--padi-soft);
  display: grid; place-items: center;
}
.qb-arrow { font-size: 42px; transition: transform 0.2s ease-out; }
