/* Census Lakhipur – design system v2 (based on the approved Stitch designs).
   Loaded after app.css; overrides colours, surfaces and components for every screen. */
:root {
  --paper: #ffffff;
  --wash: #f1f5f9;          /* slate-100 */
  --wash-2: #f8fafc;        /* slate-50 */
  --ink: #0f172a;           /* slate-900 */
  --ink-2: #334155;         /* slate-700 */
  --muted: #64748b;         /* slate-500 */
  --faint: #94a3b8;         /* slate-400 */
  --line: #e2e8f0;          /* slate-200 */
  --line-2: #f1f5f9;
  --red: #b91c1c;           /* census-700 */
  --red-dark: #991b1b;      /* census-800 */
  --red-deep: #7f1d1d;      /* census-900 */
  --red-soft: #fef2f2;      /* census-50 */
  --red-line: #fee2e2;
  --ok: #047857; --ok-soft: #ecfdf5; --ok-line: #a7f3d0;
  --warn: #b45309; --warn-soft: #fffbeb; --warn-line: #fde68a;
  --info: #3730a3; --info-soft: #eef2ff; --info-line: #e0e7ff;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-up: 0 8px 20px -6px rgba(15, 23, 42, .16);
  --nav-h: 64px;
}
body {
  background: var(--wash); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
:lang(as) body, .as { font-family: "Noto Sans Bengali", system-ui, -apple-system, Roboto, sans-serif; }
body.has-nav main.page { padding-bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px)); }
main.page { max-width: 560px; padding: 16px 16px 40px; }

/* ---------- header ---------- */
.bar {
  background: linear-gradient(135deg, var(--red-dark) 0%, #8b1a1a 55%, var(--red-deep) 100%);
  min-height: 60px; padding: 8px 8px 8px 12px; gap: 10px; box-shadow: 0 2px 8px rgba(127, 29, 29, .25);
}
.bar::after {
  bottom: -6px; height: 6px; opacity: .9;
  background: var(--red-deep) repeating-linear-gradient(90deg, #fff 0 8px, transparent 8px 14px);
}
.bar h1 { font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.bar .titles { flex: 1; min-width: 0; }
.bar .titles h1 { display: flex; align-items: center; gap: 8px; }
.bar .titles p { margin: 2px 0 0; font-size: .72rem; color: #fecaca; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .logo { width: 38px; height: 38px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px #fecaca; overflow: hidden; }
.bar .logo img { width: 100%; height: 100%; }
.bar .icon-btn { color: #fff; width: 44px; height: 44px; }
.bar .icon-btn svg { width: 22px; height: 22px; }
.bar .icon-btn:active { background: rgba(0, 0, 0, .18); transform: scale(.94); }
.lang-btn { border: 1px solid rgba(254, 202, 202, .5); background: rgba(69, 10, 10, .35); color: #fee2e2; font-weight: 700; font-size: .74rem;
  padding: 6px 8px; border-radius: 8px; min-height: 36px; cursor: pointer; white-space: nowrap; }
.lang-btn:active { transform: scale(.96); }
.hq-chip { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28); color: #fff; letter-spacing: .01em; }

/* ---------- surfaces ---------- */
.panel, .hello, .stat, .step-card, .att-card, .install-card, .tile, .list-row.static, .search-card {
  border-color: var(--line); box-shadow: var(--shadow);
}
.panel { border-radius: var(--radius); padding: 16px; }
.panel.tight { border-radius: var(--radius); }
.section-h { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.page-title { font-weight: 800; letter-spacing: -.01em; }
.sub, .muted { color: var(--muted); }
.kicker { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: block; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 4px 10px; }
.sec-head h3 { margin: 0; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.sec-head span { font-size: .72rem; color: var(--faint); font-weight: 600; }

/* ---------- forms & buttons ---------- */
.input, select.input, textarea.input { border: 1.5px solid #cbd5e1; border-radius: var(--radius-sm); background: #fff; }
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(185, 28, 28, .14); }
label.field > span { font-size: .9rem; color: var(--ink-2); }
.btn { border-radius: var(--radius-sm); font-weight: 700; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 2px rgba(127, 29, 29, .18); }
.btn:active { transform: scale(.98); background: var(--red-dark); }
.btn.ghost { box-shadow: none; border-color: #fecaca; }
.btn.ghost:active { background: var(--red-soft); }
.btn.quiet { box-shadow: none; }
.btn.ok { background: #059669; border-color: #059669; }
.btn.ok:active { background: var(--ok); }
.icon-btn:active { transform: scale(.92); }

/* ---------- chips, pills, badges ---------- */
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink-2); box-shadow: var(--shadow); min-height: 38px; }
.chip[aria-pressed="true"] { background: var(--red-dark); border-color: var(--red-dark); color: #fff; box-shadow: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; border: 1px solid; white-space: nowrap; }
.pill.green { background: var(--ok-soft); color: #065f46; border-color: var(--ok-line); }
.pill.amber { background: var(--warn-soft); color: #92400e; border-color: var(--warn-line); }
.pill.red { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.pill.grey { background: var(--wash); color: var(--muted); border-color: var(--line); }
.tag { display: inline-block; font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; border: 1px solid; }
.tag.red { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
.tag.green { color: #065f46; background: var(--ok-soft); border-color: var(--ok-line); }
.tag.amber { color: #92400e; background: var(--warn-soft); border-color: var(--warn-line); }
.beacon { position: relative; display: inline-flex; width: 8px; height: 8px; }
.beacon::before, .beacon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; }
.beacon::before { opacity: .6; animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }
.dot-live { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.badge { border-radius: 999px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .78rem; }
.id-chip { display: inline-block; background: var(--wash-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--ink-2); }
.role-chip { display: inline-block; background: var(--wash); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; font-weight: 700; font-size: .78rem; color: var(--ink-2); }

/* ---------- greeting card ---------- */
.hello { border-radius: var(--radius); padding: 16px; display: flex; justify-content: space-between; gap: 10px; }
.hello .name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; margin: 0; line-height: 1.2; }
.hello .greet { color: var(--ink-2); font-size: .9rem; font-weight: 500; }
.hello .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: .8rem; color: var(--muted); }
.hello .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.hello .side small { color: var(--faint); font-size: .7rem; }

/* ---------- attendance card ---------- */
.att-card { border-radius: var(--radius); border-left: 5px solid var(--red); padding: 16px; }
.att-card.done { border-left-color: #10b981; }
.att-card.queued { border-left-color: #f59e0b; }
.att-card.rejected { border-left-color: var(--red); }
.att-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.att-head .t { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-2); font-size: .95rem; }
.att-desc { font-size: .82rem; color: var(--muted); margin: 0 0 12px; }
.att-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: .72rem; color: var(--faint); font-weight: 600; }
.att-foot b { color: var(--red); }
.btn.hero { position: relative; overflow: hidden; min-height: 56px; font-size: 1.05rem; border-radius: 14px; width: 100%;
  background: var(--red); border-color: var(--red); box-shadow: 0 6px 14px -4px rgba(185, 28, 28, .45); }
.btn.hero .shine { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent); animation: shimmer 3.5s infinite; }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- contact card ---------- */
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px; margin: 0 0 14px; }
.contact-card .cc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 10px; border-bottom: 1px solid var(--line-2); }
.contact-card .cc-head h3 { margin: 0; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.contact-card .cc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.contact-card .cc-row:last-child { border-bottom: 0; }
.cc-row .lbl { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); display: block; }
.cc-row .nm { font-weight: 800; font-size: .95rem; color: var(--ink); display: block; }
.cc-row .rl { font-size: .74rem; color: var(--muted); display: block; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--line);
  background: var(--wash-2); color: var(--ink-2); box-shadow: var(--shadow); transition: transform .15s; text-decoration: none; }
.round-btn svg { width: 20px; height: 20px; }
.round-btn:active { transform: scale(.9); background: var(--line); }
.round-group { display: flex; gap: 8px; flex: 0 0 auto; }
.call-btns .btn.ghost { border-radius: 50%; width: 44px; height: 44px; min-height: 44px; padding: 0; border-color: var(--line); background: var(--wash-2); color: var(--ink-2); }

/* ---------- alert offer ---------- */
.push-banner { background: var(--info-soft); border: 1px solid var(--info-line); border-radius: var(--radius); padding: 14px 16px; color: #1e1b4b;
  display: flex; gap: 12px; align-items: flex-start; }
.push-banner .bell { font-size: 1.6rem; line-height: 1; display: inline-block; transform-origin: top center; animation: bell 4s ease-in-out infinite; }
@keyframes bell { 0%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-14deg); } 50% { transform: rotate(0); } }
.push-banner h4 { margin: 0; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #1e1b4b; }
.push-banner p { margin: 2px 0 10px; font-size: .84rem; color: var(--ink-2); }
.push-banner .btn { min-height: 40px; font-size: .85rem; padding: 0 16px; background: var(--red-dark); border-color: var(--red-dark); }

/* ---------- staff tool tiles ---------- */
.tiles { gap: 12px; }
.tile {
  border-radius: var(--radius); padding: 16px; min-height: 0; position: relative; justify-content: flex-start;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tile:active:not(.soon) { transform: scale(.98); }
@media (hover: hover) { .tile:hover:not(.soon) { transform: translateY(-2px); box-shadow: var(--shadow-up); border-color: rgba(185, 28, 28, .35); } }
.tile .ico-box { width: 48px; height: 48px; border-radius: 12px; background: var(--wash-2); border: 1px solid var(--line-2);
  display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 10px; }
.tile .tt { font-size: 1rem; font-weight: 800; color: var(--ink); line-height: 1.2; display: block; }
.tile .td { font-size: .78rem; color: var(--muted); margin-top: 4px; line-height: 1.4; display: block; }
.tile .tf { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: .74rem; font-weight: 700; color: var(--red);
  display: flex; align-items: center; gap: 4px; }
.tile .tf-gap { flex: 1; min-height: 10px; }
.tile .tf.live { color: var(--ok); }
.tile .new-dot { position: absolute; top: 12px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 3px #fff; }
.tile .count-badge { position: absolute; top: 10px; right: 10px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #e11d48;
  color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.tile.has-new { border: 1px solid rgba(185, 28, 28, .45); }

/* ---------- TA module tiles (line icons) ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mod { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; min-height: 118px;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; text-decoration: none; color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease; }
.mod:active { transform: scale(.98); }
@media (hover: hover) { .mod:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); } }
.mod .mi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.mod .mi svg { width: 20px; height: 20px; }
.mod b { display: block; font-size: .98rem; font-weight: 800; margin-top: 12px; }
.mod small { display: block; font-size: .74rem; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.c-sky { background: #f0f9ff; color: #0284c7; } .c-amber { background: #fffbeb; color: #d97706; } .c-blue { background: #eff6ff; color: #2563eb; }
.c-rose { background: #fff1f2; color: #e11d48; } .c-indigo { background: #eef2ff; color: #4f46e5; } .c-orange { background: #fff7ed; color: #ea580c; }
.c-emerald { background: #ecfdf5; color: #059669; } .c-cyan { background: #ecfeff; color: #0891b2; } .c-red { background: #fef2f2; color: #dc2626; }
.c-yellow { background: #fefce8; color: #ca8a04; } .c-slate { background: #f1f5f9; color: #475569; } .c-violet { background: #f5f3ff; color: #7c3aed; }

/* TA stats */
.stats { gap: 10px; }
.stat { border-radius: var(--radius); padding: 14px; position: relative; }
.stat b { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: .84rem; color: var(--ink-2); }
.stat .stag { position: absolute; top: 12px; right: 12px; font-size: .66rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.stag.green { background: var(--ok-soft); color: #047857; } .stag.grey { background: var(--wash); color: var(--faint); }
.stag.plain { color: #10b981; background: transparent; } .stag.amber { background: var(--warn-soft); color: #b45309; }
.inbox-banner { display: flex; align-items: center; gap: 10px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 14px; padding: 12px 14px;
  font-weight: 700; color: #78350f; text-decoration: none; margin: 0 0 14px; font-size: .9rem; }
.inbox-banner .chev { margin-left: auto; color: #b45309; }
.hero-card { position: relative; overflow: hidden; border-radius: var(--radius); padding: 16px; color: #fff; margin: 0 0 14px; display: block; text-decoration: none;
  background: linear-gradient(135deg, var(--red-dark), var(--red) 50%, var(--red-deep)); box-shadow: 0 10px 22px -10px rgba(127, 29, 29, .7); }
.hero-card .wm { position: absolute; right: -10px; bottom: -16px; opacity: .1; width: 128px; height: 128px; }
.hero-card .hi { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .2);
  display: grid; place-items: center; margin-bottom: 10px; color: #fcd34d; }
.hero-card .hi svg { width: 22px; height: 22px; }
.hero-card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; }
.hero-card h3 { margin: 0; font-size: 1.12rem; font-weight: 800; }
.hero-card p { margin: 2px 0 0; font-size: .8rem; color: rgba(255, 255, 255, .82); }
.hero-card .review { background: #fff; color: var(--red-deep); font-weight: 800; font-size: .8rem; padding: 8px 14px; border-radius: 10px; }

/* ---------- lists ---------- */
.list-row { padding: 13px 16px; border-bottom-color: var(--line-2); }
.list-row .t { font-weight: 700; }
.panel.tight .list-row:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.search .input { box-shadow: var(--shadow); }
.count-line { color: var(--faint); font-weight: 600; font-size: .8rem; }

/* ---------- messages ---------- */
.msg { border-radius: 14px; border-left-width: 4px; }
.msg.info { background: var(--info-soft); border-color: #6366f1; color: #1e1b4b; }

/* ---------- footer ---------- */
.foot { text-align: center; margin-top: 18px; }
.sync-pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: .8rem; color: var(--ink-2); box-shadow: var(--shadow); }
.sync-pill button { background: none; border: 0; color: var(--red); font-weight: 800; cursor: pointer; padding: 0; font-size: .8rem; }
.foot small { display: block; color: var(--faint); font-size: .72rem; margin-top: 10px; }

/* ---------- bottom navigation ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding: 6px 6px env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(15, 23, 42, .06);
}
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none;
  color: var(--muted); font-size: .7rem; font-weight: 600; position: relative; border-radius: 12px; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.on { color: var(--red-dark); font-weight: 800; }
.bottom-nav a.on::before { content: ""; position: absolute; top: -6px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--red-dark); }
.bottom-nav a:active { transform: scale(.94); }
.bottom-nav .nb { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: #e11d48; color: #fff; font-size: .62rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
@media (min-width: 600px) { .bottom-nav { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border-radius: 16px 16px 0 0; } }

/* chat composer sits above nothing (nav hidden on chat screens) */
.chat-compose { border-radius: 16px 16px 0 0; box-shadow: 0 -4px 16px rgba(15, 23, 42, .06); }
.chat-bubble { border-radius: 16px 16px 16px 6px; box-shadow: var(--shadow); }
.chat-bubble.mine { background: #fee2e2; border-color: #fecaca; border-radius: 16px 16px 6px 16px; }

/* urgent line */
.marquee { border-radius: 14px; border-width: 1px; box-shadow: var(--shadow); }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .beacon::before, .btn.hero .shine, .push-banner .bell, .tile .count-badge, .bottom-nav .nb { animation: none !important; }
  .tile, .mod, .btn, .round-btn { transition: none !important; }
}

/* keep bottom-fixed pieces above the navigation bar */
body.has-nav .sticky-actions { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
body.has-nav #toast { bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom, 0px)); }
.push-banner .bell { flex: 0 0 auto; }
.push-banner > div { flex: 1 1 auto; min-width: 0; }
.push-banner { flex-wrap: nowrap !important; }
.selfie .small-select, .selfie select, .selfie input.input { width: 100%; max-width: 100%; min-width: 0; font-size: .85rem; min-height: 40px; padding: 6px 8px; }
.selfie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.selfie, .selfie-meta { min-width: 0; }

/* =====================  v0.5 feedback round  ===================== */
/* compact greeting */
.hello.compact { align-items: center; padding: 12px 14px; gap: 12px; }
.hello.compact .hello-main { flex: 1; min-width: 0; }
.hello.compact .kicker { font-size: .7rem; letter-spacing: .04em; text-transform: none; font-weight: 600; }
.hello.compact .name { font-size: 1.05rem; font-weight: 800; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hello.compact .meta { margin-top: 3px; gap: 6px; font-size: .74rem; flex-wrap: nowrap; overflow: hidden; }
.hello.compact .meta .mono { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hello.compact .role-chip { font-size: .7rem; padding: 0 6px; white-space: nowrap; }
.hello.compact .side { gap: 3px; }

/* avatars */
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--red-soft); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.avatar.initials { display: inline-grid; place-items: center; font-weight: 800; color: var(--red-dark); font-size: .9rem; }
.avatar.sm { width: 40px; height: 40px; font-size: .82rem; }
.avatar.md { width: 44px; height: 44px; }
.avatar.lg { width: 84px; height: 84px; font-size: 1.4rem; }
.avatar.xs { width: 20px; height: 20px; font-size: .6rem; box-shadow: none; vertical-align: -5px; margin-right: 6px; }

/* contact cards */
.contact-card .cc-row { justify-content: flex-start; gap: 12px; }
.contact-card .cc-text { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.contact-card .cc-text .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-card .cc-head { gap: 8px; flex-wrap: wrap; }
.contact-card .cc-note { margin: 0; padding: 0 0 12px; font-size: .76rem; color: var(--muted); }
.round-btn.chat { color: var(--red-dark); border-color: #fecaca; background: var(--red-soft); }
.photo-row { display: flex; align-items: center; gap: 16px; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- loading ---------- */
.loading-view { position: relative; min-height: 60vh; }
.progress-line { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 3px; z-index: 60; overflow: hidden; background: rgba(185, 28, 28, .12); }
.progress-line span { position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: progress 1.1s ease-in-out infinite; }
@keyframes progress { 0% { left: -40%; } 100% { left: 100%; } }
.sk-page { max-width: 560px; margin: 0 auto; padding: 16px; display: grid; gap: 12px; }
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sk { border-radius: var(--radius); background: linear-gradient(90deg, #e9edf2 0%, #f6f8fb 40%, #e9edf2 80%); background-size: 300% 100%;
  animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -50% 0; } }
.sk-label { text-align: center; color: var(--faint); font-size: .8rem; font-weight: 600; margin: 4px 0 0; }

/* start-up splash */
.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: radial-gradient(circle at 50% 35%, #fff 0%, var(--wash) 70%); }
.splash img { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 12px 28px -10px rgba(127, 29, 29, .55); animation: splash-pop 1.6s ease-in-out infinite; }
.splash h1 { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.splash p { margin: 0; color: var(--muted); font-size: .85rem; }
.splash .stripe { width: 150px; height: 6px; border-radius: 4px; overflow: hidden; background: var(--red-deep);
  background-image: repeating-linear-gradient(90deg, #fff 0 8px, transparent 8px 14px); background-size: 28px 6px; animation: stripe 0.9s linear infinite; }
@keyframes splash-pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes stripe { from { background-position: 0 0; } to { background-position: 28px 0; } }

/* ---------- gentle motion ---------- */
main.page > * { animation: rise .38s cubic-bezier(.2, .7, .2, 1) both; }
main.page > *:nth-child(2) { animation-delay: .04s; } main.page > *:nth-child(3) { animation-delay: .08s; }
main.page > *:nth-child(4) { animation-delay: .12s; } main.page > *:nth-child(5) { animation-delay: .16s; }
main.page > *:nth-child(6) { animation-delay: .2s; } main.page > *:nth-child(n+7) { animation-delay: .24s; }
.tiles > *, .mod-grid > * { animation: rise .4s cubic-bezier(.2, .7, .2, 1) both; }
.tiles > *:nth-child(2), .mod-grid > *:nth-child(2) { animation-delay: .05s; } .tiles > *:nth-child(3), .mod-grid > *:nth-child(3) { animation-delay: .1s; }
.tiles > *:nth-child(4), .mod-grid > *:nth-child(4) { animation-delay: .15s; } .tiles > *:nth-child(5), .mod-grid > *:nth-child(5) { animation-delay: .2s; }
.tiles > *:nth-child(6), .mod-grid > *:nth-child(6) { animation-delay: .25s; } .tiles > *:nth-child(n+7), .mod-grid > *:nth-child(n+7) { animation-delay: .3s; }
.panel.tight > .list-row { animation: fade .3s ease both; }
.bubble-row { animation: rise .25s ease both; }
.msg.ok { animation: pop .35s cubic-bezier(.2, .9, .3, 1.3) both; }
.selfie { animation: fade .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.94); } 100% { opacity: 1; transform: none; } }
.chip { transition: background-color .15s, color .15s, transform .15s; }
.chip:active { transform: scale(.95); }
#busy .busy-box { animation: pop .25s ease both; }

/* ---------- desktop (TA) ---------- */
.side-nav { display: none; }
@media (min-width: 1024px) {
  body.has-side { padding-left: 264px; }
  body.has-side .bottom-nav { display: none; }
  body.has-side.has-nav main.page { padding-bottom: 40px; }
  body.has-side main.page { max-width: 1120px; padding: 24px 32px 48px; }
  body.has-side .bar { padding-left: 24px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; position: fixed; top: 0; bottom: 0; left: 0; width: 264px; z-index: 35;
    background: #fff; border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto; }
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line-2); }
  .side-brand img { width: 40px; height: 40px; border-radius: 10px; }
  .side-brand b { display: block; font-size: 1rem; } .side-brand small { color: var(--muted); font-size: .76rem; }
  .side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .9rem; position: relative; }
  .side-nav a:hover { background: var(--wash-2); }
  .side-nav a.on { background: var(--red-soft); color: var(--red-dark); font-weight: 800; }
  .side-nav .mi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; }
  .side-nav .mi svg { width: 17px; height: 17px; }
  .side-nav .nb { margin-left: auto; background: #e11d48; color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 800; padding: 1px 7px; }
  body.has-side .mod-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  body.has-side .stats { grid-template-columns: repeat(4, 1fr); }
  body.has-side .tiles { grid-template-columns: repeat(3, 1fr); }
  body.has-side .selfie-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.has-side .chat-compose { left: 264px; max-width: none; }
  body.has-side .map-box { height: calc(100vh - 180px); }
  body.has-side .progress-line { left: 264px; }
  body.has-side .sk-page { max-width: 1120px; }
  body.has-side .sk-grid { grid-template-columns: repeat(4, 1fr); }
  body.has-side .hero-card { padding: 22px 24px; }
  body.has-side .panel.tight .list-row { padding: 12px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  main.page > *, .tiles > *, .mod-grid > *, .panel.tight > .list-row, .bubble-row, .msg.ok, .selfie, #busy .busy-box { animation: none !important; }
  .splash img, .splash .stripe, .sk, .progress-line span { animation-duration: 3s; }
}
/* the message fades out by itself even if a timer is paused */
#toast.show { animation: toast-life 3.6s ease forwards; }
@keyframes toast-life { 0% { opacity: 0; transform: translateX(-50%) translateY(12px); } 6%, 88% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; transform: translateX(-50%) translateY(0); } }
/* names wrap instead of being cut off */
.hello.compact { align-items: flex-start; }
.hello.compact .name { white-space: normal; overflow: visible; font-size: 1.02rem; line-height: 1.25; }
.hello.compact .meta { flex-wrap: wrap; overflow: visible; row-gap: 2px; }
.hello.compact .side { padding-top: 2px; }
.contact-card .cc-text .nm { white-space: normal; overflow: visible; line-height: 1.25; font-size: .92rem; }
.contact-card .cc-head .pill { margin-left: auto; }
.mod .count-badge { position: absolute; top: 10px; right: 10px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #e11d48;
  color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; animation: breathe 2.4s ease-in-out infinite; }
.mod .count-badge[hidden] { display: none; }
.sk { background: linear-gradient(90deg, #dfe4ea 0%, #f1f4f8 40%, #dfe4ea 80%); background-size: 300% 100%; }

/* ---------- set-your-PIN pop-up ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 16px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s ease both; }
.modal { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 22px 18px 14px; box-shadow: 0 24px 48px -12px rgba(15, 23, 42, .45);
  animation: pop .3s cubic-bezier(.2, .9, .3, 1.2) both; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal h2 { margin: 6px 0 4px; font-size: 1.2rem; font-weight: 800; text-align: center; }
.modal > p { text-align: center; margin: 0 0 14px; font-size: .9rem; }
.modal-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--red-soft); display: grid; place-items: center; font-size: 1.7rem; margin: 0 auto; }
@media (prefers-reduced-motion: reduce) { .modal-wrap, .modal { animation: none !important; } }
