:root {
  --ink: #0F1B2D;
  --ink-2: #344054;
  --muted: #475467;
  --line: #D5DCE6;
  --line-soft: #E4E9F0;
  --bg: #F7F9FC;
  --surface: #FFFFFF;
  --blue: #1D4ED8;
  --blue-deep: #1E3A8A;
  --blue-tint: #E6EDFF;
  --orange: #C2410C;
  --orange-deep: #9A3412;
  --orange-tint: #FFF1E8;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.04), 0 8px 24px -16px rgba(15, 27, 45, 0.25);
  --font-latin: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans Devanagari', 'Noto Sans Bengali', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans', 'Malgun Gothic', sans-serif;
  --font-arabic: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 96px; } /* keeps focused items clear of the bottom bar */

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-latin);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
html[lang='ar'] body, html[lang='fa'] body, html[lang='ur'] body, html[lang='ckb'] body { font-family: var(--font-arabic); }
/* Scripts with tall marks need a little more line height. */
html[lang='hi'] body, html[lang='bn'] body, html[lang='ur'] body { line-height: 1.65; }

a { color: var(--blue); }
a:hover { color: var(--blue-deep); }

button, input { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid #93B4FF; outline-offset: 2px; }

[hidden] { display: none !important; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--blue); animation: blink 1.1s ease-in-out infinite; }
.noscript { padding: 24px; text-align: center; }

/* ---------- layout ---------- */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 10px;
}
.topbar__start { display: flex; align-items: center; gap: 6px; }

.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand__logo { width: 28px; height: 28px; }
.brand__name { font-family: var(--font-latin); font-size: 18px; }

.logo-bg { fill: var(--blue); }
.logo-ring { fill: none; stroke: #fff; stroke-width: 2.2; }

.lang-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 4px 0 12px;
  padding-inline: 12px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}
.lang-pick:focus-within { outline: 3px solid #93B4FF; outline-offset: 2px; }
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 38px;
  max-width: 150px;
  padding-inline: 2px 10px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-overflow: ellipsis;
}
.lang-select:focus { outline: none; }
.input--select { appearance: auto; cursor: pointer; }

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: var(--ink);
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 18px calc(28px + env(safe-area-inset-bottom));
  outline: none;
}

.bottom-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
}
.bottom-nav__item {
  min-width: 72px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border-radius: 12px;
}
.bottom-nav__item .icon { width: 22px; height: 22px; }
.bottom-nav__item.is-active { color: var(--blue); }

/* ---------- type ---------- */
.title { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
.title--center { text-align: center; }
.subtitle { margin: 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.lead { margin: 0; font-size: 16px; color: var(--muted); }
.lead--center { text-align: center; }
.muted { margin: 0; color: var(--muted); font-size: 14px; }
.fine { margin: 0; color: var(--muted); font-size: 13px; }
.fine--center { text-align: center; }
.label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.question { margin: 0; font-size: 19px; font-weight: 700; text-align: center; line-height: 1.4; }
p { margin: 0; }

/* ---------- icons ---------- */
.icon { width: 20px; height: 20px; flex: none; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 34px; height: 34px; }
.icon--xl { width: 46px; height: 46px; }
.icon--warn { color: var(--orange); }
html[dir='rtl'] .icon--flip { transform: scaleX(-1); }

/* ---------- hero ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 18px 0 6px; }
.hero__mark { width: 132px; color: var(--blue); }
.rings { width: 132px; height: 72px; }
.ring-a { fill: none; stroke: var(--blue); stroke-width: 5; }
.ring-b { fill: none; stroke: var(--ink); stroke-width: 5; }
.dot-a { fill: var(--blue); }
.dot-b { fill: var(--ink); }
.hero__title { margin: 0; font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -0.025em; }
.hero__title--sm { font-size: 28px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card--attention { border-color: #BFD0FF; background: #F4F7FF; }
.card--alert { border-color: #F5C7AE; background: var(--orange-tint); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .input { flex: 1; min-width: 0; }
.row--wrap { flex-wrap: wrap; }

.notice { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--blue-tint); color: var(--blue-deep); font-size: 14px; }
.notice--warn { background: var(--orange-tint); color: #7C2D12; }
.notice--strong { font-weight: 700; text-align: center; }

.invite-link {
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px dashed var(--line);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  text-align: left;
}

/* ---------- forms ---------- */
.input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 16px;
}
.input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18); }

.btn {
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn--block { width: 100%; }
.btn--lg { min-height: 56px; font-size: 16px; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: #1A44C0; color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn--danger-outline { background: var(--surface); color: var(--orange); border: 2px solid var(--orange); }
.btn--danger-outline:hover { background: var(--orange-tint); color: var(--orange-deep); }
.btn--on-color { background: #fff; color: var(--ink); }
.btn--on-color:hover { background: #EEF2F8; color: var(--ink); }
.btn[aria-busy='true']::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  animation: spin 0.8s linear infinite;
}

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { margin-bottom: 10px; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
}
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid #93B4FF; outline-offset: 2px; }

.segmented { display: flex; padding: 4px; border-radius: 14px; background: var(--line-soft); gap: 4px; }
.segmented__item { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; cursor: pointer; }
.segmented__item.is-active { background: var(--surface); box-shadow: var(--shadow); }
.segmented__item[lang='ar'] { font-family: var(--font-arabic); }
.segmented__item[lang='en'] { font-family: var(--font-latin); }

/* ---------- people ---------- */
.avatar {
  width: 42px;
  height: 42px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-tint);
  color: var(--blue);
  font-weight: 800;
  font-size: 17px;
}
.avatar--lg { width: 72px; height: 72px; font-size: 28px; }
.avatar--light { background: #fff; color: var(--orange); }

.person { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding-top: 6px; }

.members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.member__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.member__text strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag { font-size: 12px; font-weight: 600; color: var(--muted); }
.tag--ok { color: var(--blue); }

.pending { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #7C2D12; }
.pending:hover { color: #7C2D12; }
.pending__text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.pending__text strong { font-size: 15px; }
.pending__cta { padding: 8px 14px; border-radius: 999px; background: var(--orange); color: #fff; font-weight: 700; font-size: 14px; }

/* ---------- waiting ---------- */
.pulse { position: relative; width: 150px; height: 150px; margin: 8px auto 0; display: grid; place-items: center; }
.pulse__ring { position: absolute; inset: 0; border-radius: 50%; background: rgba(29, 78, 216, 0.26); animation: pulse 1.8s ease-out infinite; }
.pulse__ring--late { animation-delay: 0.9s; }
.pulse__core { position: relative; width: 78px; height: 78px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; }

.steps { list-style: none; margin: 0; padding: 14px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.steps__done .icon { color: var(--blue); }
.steps__warn { color: #7C2D12 !important; }
.steps__warn .icon { color: var(--orange); }
.steps__now { color: var(--ink) !important; font-weight: 800 !important; }
.dot { width: 16px; display: inline-flex; justify-content: center; }
.dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); animation: blink 1.2s ease-in-out infinite; }

.countdown { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- result screens ---------- */
.page--blue { background: var(--blue); color: #fff; max-width: none; }
.page--orange { background: var(--orange); color: #fff; max-width: none; }
.page--blue .content, .page--orange .content, .page--blue .topbar, .page--orange .topbar { width: 100%; max-width: 520px; margin-inline: auto; }
.page--blue .brand, .page--orange .brand { color: #fff; }
.page--blue .logo-bg, .page--orange .logo-bg { fill: #fff; }
.page--blue .logo-ring { stroke: var(--blue); }
.page--orange .logo-ring { stroke: var(--orange); }
.page--blue .lang-pick, .page--orange .lang-pick { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.page--blue .lang-select option, .page--orange .lang-select option { color: var(--ink); }

.status-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 24px 0 6px; }
.status-hero__badge { width: 100px; height: 100px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.page--blue .status-hero__badge { color: var(--blue); }
.page--orange .status-hero__badge { color: var(--orange); }
.status-hero__title { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.status-hero__text { margin: 0; font-size: 16px; color: rgba(255, 255, 255, 0.92); }
.on-color-note { padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.14); font-size: 14px; }

.advice { margin: 0; padding: 16px 16px 16px 16px; padding-inline-start: 34px; border-radius: 16px; background: rgba(255, 255, 255, 0.16); display: flex; flex-direction: column; gap: 8px; font-weight: 600; }

.status-plain { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 18px; }
.status-plain__badge { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-tint); color: var(--blue); }
.status-plain__badge--warn { background: var(--orange-tint); color: var(--orange); }
.status-plain__badge--danger { background: var(--orange); color: #fff; }

/* ---------- activity ---------- */
.events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.event { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-soft); }
.event__icon { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--line-soft); color: var(--muted); }
.event--confirmed .event__icon { background: var(--blue); color: #fff; }
.event--denied { background: var(--orange-tint); border-color: #F5C7AE; }
.event--denied .event__icon { background: var(--orange); color: #fff; }
.event__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.event__text strong { font-size: 15px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 32px 0 8px; color: var(--muted); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  inset-inline: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  max-width: 488px;
  margin-inline: auto;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px -12px rgba(15, 27, 45, 0.5);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}
.toast:empty { display: none; }
.toast.is-visible { opacity: 1; transform: none; }
.toast--error { background: var(--orange-deep); }
.toast--success { background: var(--blue-deep); }

/* ---------- motion ---------- */
@keyframes pulse { 0% { transform: scale(0.55); opacity: 0.9; } 100% { transform: scale(1.55); opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- v2: circle type, discovery, join requests ---------- */
.options { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.options legend { margin-bottom: 8px; padding: 0; }
.option { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.option input { margin: 3px 0 0; width: 20px; height: 20px; accent-color: var(--blue); flex: none; }
.option__body { display: flex; flex-direction: column; gap: 2px; }
.option:has(input:checked) { border-color: var(--blue); background: #F4F7FF; box-shadow: 0 0 0 1px var(--blue); }

.badge { display: inline-block; margin-inline-start: 8px; padding: 1px 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; vertical-align: middle; }
.count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }

.tag { display: inline-flex; align-items: center; gap: 4px; }
.tag--warn { color: #7C2D12; }

.row--between { justify-content: space-between; }
.stack--tight { gap: 6px; align-items: flex-end; }

.result, .request {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.result .avatar .icon { width: 20px; height: 20px; }
.request { flex-direction: column; align-items: stretch; }
.request__who { display: flex; align-items: center; gap: 12px; }
.request .row .btn { flex: 1; }

.pending--blue { color: var(--blue-deep); }
.pending--blue:hover { color: var(--blue-deep); }
.pending__cta--blue { background: var(--blue); }

.notice .icon { vertical-align: -3px; }

/* ---------- v0.3: email, recovery, members, devices ---------- */
.input--code { font-size: 26px; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.link-center { text-align: center; font-size: 14px; font-weight: 600; padding: 6px 0; }
.badge--owner { background: var(--blue); }
.verified { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-inline-start: 6px; border-radius: 50%; background: var(--blue); color: #fff; vertical-align: middle; }
.icon--xs { width: 12px; height: 12px; }
.event__text .tag { font-size: 12px; }

/* ---------- Verikin for business ---------- */
.notice--danger { background: var(--orange); color: #fff; font-weight: 600; }
.org { display: grid; justify-items: center; gap: 8px; text-align: center; margin: 4px 0 8px; }
.org__mark { background: var(--ink); color: #fff; }
.org__name { font-size: 20px; overflow-wrap: anywhere; }
.org__trust { justify-content: center; }
.org .notice { text-align: start; width: 100%; }
.kv { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.kv__row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; }
.kv__row + .kv__row { border-top: 1px solid var(--line-soft); }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; font-weight: 700; text-align: end; overflow-wrap: anywhere; }
.kv__row:first-child dd { font-size: 20px; }
.quote { margin: 0; padding: 12px 14px; border-inline-start: 4px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.quote__label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.secret { display: block; padding: 10px 12px; background: var(--ink); color: #fff; border-radius: var(--radius-sm); font-size: 13px; overflow-wrap: anywhere; user-select: all; }
