/* SamaBloom demo — tokens and components taken from the SamaBloom design canvas. */
:root {
  --bg: #FCF9F4;
  --card: #FFFFFF;
  --ink: #2E3644;
  --muted: #5D6672;
  --muted-2: #4A5462;
  --sky: #E4ECF2;
  --blue: #4E6482;
  --blue-dark: #3A4D66;
  --blue-2: #7185A0;
  --blue-3: #A2B9CB;
  --sage: #E8EBE2;
  --sage-ink: #4F5C4A;
  --sage-2: #C0C4B2;
  --sage-3: #838C7B;
  --sage-4: #5E6B58;
  --sand: #FBEED3;
  --sand-2: #F4D497;
  --sand-ink: #7A5418;
  --sand-ink-2: #6B4A14;
  --sand-ink-3: #4A3410;
  --sun: #F1C77A;
  --sun-2: #EDB75A;
  --sun-glow: #F6D9A0;
  --line: #ECEAE3;
  --line-2: #F1EEE7;
  --border: #DDE3E9;
  --border-2: #D6DCE3;
  --green: #7E9A72;
  --amber: #E3A43A;
  --rose: #F6E1DC;
  --rose-ink: #8A4B3E;
  --shadow: 0 8px 22px rgba(78, 100, 130, 0.12);
  --shadow-btn: 0 6px 18px rgba(78, 100, 130, 0.25);
  --font: 'Alexandria', 'Figtree', system-ui, sans-serif;
  --display: 'Alexandria', 'Playfair Display', serif;
  --display-weight: 700;
}
html[lang="en"] {
  --font: 'Figtree', system-ui, sans-serif;
  --display: 'Playfair Display', Georgia, serif;
  --display-weight: 600;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #DCE5EC;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
img { display: block; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(78, 100, 130, 0.45); outline-offset: 2px; }

/* ---------- Stage: phone frame on desktop, full screen on phones ---------- */
.stage {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 32px 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(241, 199, 122, 0.35), transparent 32%),
    linear-gradient(180deg, #E4ECF2 0%, #DCE5EC 60%, #E8EBE2 100%);
}
.device { flex-shrink: 0; }
.phone {
  position: relative;
  width: 390px;
  height: 844px;
  border-radius: 48px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 0 10px #1F2530, 0 0 0 11px #3A4250, 0 40px 80px rgba(46, 54, 68, 0.35);
  isolation: isolate;
}
.app { position: absolute; inset: 0; overflow: hidden; }

@media (max-width: 760px), (display-mode: standalone) {
  body { background: var(--bg); }
  .stage { padding: 0; display: block; background: var(--bg); }
  .guide { display: none !important; }
  .phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ---------- Demo guide (desktop only) ---------- */
.guide {
  scrollbar-width: none;
  width: 300px;
  max-height: 844px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: 'Figtree', 'Alexandria', sans-serif;
}
.guide__brand { display: flex; align-items: center; gap: 12px; }
.guide__brand img { width: 64px; height: 64px; object-fit: contain; }
.guide__brand h1 { margin: 0; font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 600; }
.guide__brand p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.guide__box { background: rgba(255,255,255,0.75); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.guide__box h2 { margin: 0 0 4px; font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--sage-4); }
.guide__link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: none; background: transparent; text-align: start; padding: 8px 10px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.guide__link:hover { background: var(--sky); }
.guide__link span { font-size: 12px; color: var(--muted); font-weight: 500; }
.guide__btn {
  border: none; border-radius: 14px; padding: 10px 12px; background: var(--blue); color: #fff;
  font-weight: 700; font-size: 14px; text-align: start;
}
.guide__btn.secondary { background: #fff; color: var(--ink); border: 1.5px solid var(--border-2); }
.guide__note { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0; }
@media (max-width: 1080px) { .guide { display: none; } }

/* ---------- Screen scaffolding ---------- */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  animation: screen-in 0.32s cubic-bezier(.2,.8,.2,1);
}
.screen.back { animation-name: screen-back; }
@keyframes screen-in { from { opacity: 0; transform: translateX(var(--enter, 24px)); } to { opacity: 1; transform: none; } }
@keyframes screen-back { from { opacity: 0; transform: translateX(var(--leave, -24px)); } to { opacity: 1; transform: none; } }
html[dir="rtl"] .screen { --enter: -24px; --leave: 24px; }
@media (prefers-reduced-motion: reduce) { .screen, .screen.back { animation: none; } }

.scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(18px + env(safe-area-inset-top)) 20px 24px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }
.scroll.has-tabbar { padding-bottom: 104px; }
.scroll.has-footer { padding-bottom: 110px; }

.topbar { position: relative; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.topbar h1 {
  position: absolute; inset-inline: 52px; top: 0; margin: 0; line-height: 44px; text-align: center;
  font-family: var(--display); font-weight: 600; font-size: 20px; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[lang="ar"] .topbar h1 { font-size: 18px; }
.spacer44 { width: 44px; height: 44px; flex-shrink: 0; }

.icon-btn {
  position: relative; z-index: 1;
  width: 44px; height: 44px; border-radius: 22px; border: 1.5px solid var(--border); background: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0;
}
.icon-btn svg { width: 20px; height: 20px; }
.dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); border: 2px solid #fff; top: 8px; inset-inline-end: 9px; }
html[dir="rtl"] .flip { transform: scaleX(-1); }

.lang-pill {
  position: relative; z-index: 1; height: 44px; padding: 0 16px; border-radius: 22px; border: none;
  background: rgba(255,255,255,0.88); display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.lang-pill svg { width: 18px; height: 18px; }
.lang-pill[lang="en"] { font-family: 'Figtree', sans-serif; }
.lang-pill[lang="ar"] { font-family: 'Alexandria', sans-serif; }

.monogram { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 26px; letter-spacing: -1px; line-height: 1; direction: ltr; }
.monogram .s { color: var(--blue-2); }
.monogram .b { color: var(--sage-3); }

/* ---------- Typography ---------- */
.h-display { margin: 0; font-family: var(--display); font-weight: var(--display-weight); font-size: 28px; line-height: 1.25; }
.h2 { margin: 0; font-family: var(--display); font-weight: var(--display-weight); font-size: 21px; line-height: 1.3; }
html[lang="ar"] .h2 { font-size: 19px; line-height: 1.5; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--sage-4); }
html[lang="ar"] .eyebrow { letter-spacing: 0; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted-2); }
html[lang="ar"] .p { line-height: 1.75; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.link { border: none; background: none; padding: 10px 2px; margin: -10px 0; font-weight: 700; color: var(--blue); font-size: 14px; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 22px; border-radius: 28px; border: none;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: var(--shadow-btn); text-decoration: none; transition: transform .12s, background .2s; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:hover { background: var(--blue-dark); }
.btn svg { width: 20px; height: 20px; }
.btn.block { width: 100%; }
.btn.secondary { background: #fff; color: var(--ink); border: 1.5px solid var(--border-2); box-shadow: none; }
.btn.secondary:hover { background: #F6F8FA; }
.btn.sm { height: 44px; padding: 0 16px; font-size: 14px; border-radius: 22px; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--blue); box-shadow: none; }
.btn.danger { background: #fff; color: #9A3B2E; border: 1.5px solid #EAD3CE; box-shadow: none; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
html[lang="ar"] .btn { font-size: 17px; }

/* ---------- Cards and chips ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px 16px; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card.elev { box-shadow: var(--shadow); }
.card.sky { background: var(--sky); border-color: transparent; }
.card.sage { background: var(--sage); border-color: transparent; }
.card.sand { background: var(--sand); border-color: transparent; }
.list { display: flex; flex-direction: column; padding: 2px 16px; }
.list > * + * { border-top: 1px solid var(--line-2); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; text-decoration: none; color: inherit; background: none; border-inline: none; border-bottom: none; width: 100%; text-align: start; }
button.list-row { border-top-width: 0; }
.list > button.list-row + button.list-row, .list > * + button.list-row { border-top: 1px solid var(--line-2); }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; line-height: 1.3; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.chip svg { width: 13px; height: 13px; }
.chip.sky { background: var(--sky); color: var(--blue); }
.chip.white { background: #fff; color: var(--blue); }
.chip.sage { background: var(--sage); color: var(--sage-ink); }
.chip.sand { background: var(--sand); color: var(--sand-ink); }
.chip.rose { background: var(--rose); color: var(--rose-ink); }
.chip.gray { background: #EEF0F2; color: var(--muted-2); }

.tile { width: 40px; height: 40px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tile svg { width: 20px; height: 20px; }
.tile.sky { background: var(--sky); } .tile.sage { background: var(--sage); } .tile.sand { background: var(--sand-2); } .tile.white { background: #fff; } .tile.sand-light { background: var(--sand); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--sky); color: var(--blue);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: var(--display); font-weight: 600; font-size: 16px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.avatar.sage { background: var(--sage); color: var(--sage-ink); }
.avatar.sand { background: var(--sand); color: var(--sand-ink-2); }

/* Arched child portrait — the design's signature frame */
.arch {
  position: relative; flex-shrink: 0; overflow: hidden;
  border-radius: 48px 48px 18px 18px; border: 3px solid var(--sun); background: #fff;
  box-shadow: 0 0 18px rgba(241, 199, 122, 0.55);
}
.arch img { width: 100%; height: 100%; object-fit: cover; }

/* Child switcher pill */
.child-pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding-inline: 4px 14px;
  border-radius: 22px; border: 1.5px solid var(--border); background: #fff; font-size: 15px; font-weight: 700;
}
.child-pill svg { width: 18px; height: 18px; }
.child-pill .avatar { width: 34px; height: 34px; }
.child-pill .dot { top: 2px; inset-inline-end: auto; inset-inline-start: 30px; }

/* Segmented tabs */
.seg { display: flex; gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.seg button { flex: 1; border: none; background: transparent; height: 38px; border-radius: 14px; font-size: 14px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button[aria-selected="true"] { background: var(--sky); color: var(--blue); }
.seg .count { background: var(--amber); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; }

/* Tab bar */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  height: calc(84px + env(safe-area-inset-bottom)); padding: 8px 6px calc(14px + env(safe-area-inset-bottom));
  background: #fff; border-radius: 28px 28px 0 0; box-shadow: 0 -6px 20px rgba(78, 100, 130, 0.08);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
}
.tabbar button { border: none; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0; position: relative; }
.tabbar .ic { width: 48px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.tabbar svg { width: 21px; height: 21px; }
.tabbar button[aria-current="page"] { color: var(--blue); font-weight: 700; }
.tabbar button[aria-current="page"] .ic { background: var(--sky); }
.tabbar .badge { position: absolute; top: 2px; inset-inline-end: calc(50% - 22px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--amber); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; padding: 0 4px; }

/* Footer action bar */
.footer-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 12px 20px calc(22px + env(safe-area-inset-bottom)); background: #fff;
  border-radius: 28px 28px 0 0; box-shadow: 0 -6px 20px rgba(78, 100, 130, 0.08); display: flex; gap: 10px;
}

/* ---------- Decorative sky ---------- */
.sky-hero { position: relative; flex-shrink: 0; background: var(--sky); overflow: hidden; }
.sky-hero .sun { position: absolute; inset-inline-end: -40px; top: -44px; width: 230px; height: 230px; }
html[dir="rtl"] .sky-hero .sun { transform: scaleX(-1); }
.sky-hero .hills { position: absolute; left: 0; bottom: -1px; width: 100%; }
.cloud { position: absolute; filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.95)); }
.cloud.drift { animation: drift 14s ease-in-out infinite alternate; }
.cloud.drift.slow { animation-duration: 20s; }
@keyframes drift { from { translate: -10px 0; } to { translate: 14px 0; } }
@media (prefers-reduced-motion: reduce) { .cloud.drift { animation: none; } }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .label { font-size: 14px; font-weight: 700; }
.input {
  height: 56px; border-radius: 18px; border: 1.5px solid var(--border-2); background: #fff;
  padding: 0 16px; font-size: 16px; font-weight: 600; outline: none; width: 100%;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(78, 100, 130, 0.14); }
textarea.input { height: auto; min-height: 96px; padding: 14px 16px; resize: none; line-height: 1.5; font-weight: 500; }
.phone-input { display: flex; align-items: stretch; height: 56px; border-radius: 18px; border: 1.5px solid var(--border-2); background: #fff; overflow: hidden; direction: ltr; }
.phone-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(78, 100, 130, 0.14); }
.phone-input .prefix { display: flex; align-items: center; gap: 6px; padding: 0 14px; background: #F4F6F8; border-right: 1.5px solid var(--border); font-size: 16px; font-weight: 700; flex-shrink: 0; }
.phone-input .prefix .cc { font-size: 11px; font-weight: 700; color: var(--sage-ink); background: var(--sage); padding: 2px 6px; border-radius: 6px; }
.phone-input input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; padding: 0 16px; font-size: 17px; font-weight: 600; letter-spacing: .5px; text-align: left; }
.otp { display: flex; justify-content: center; gap: 8px; direction: ltr; }
.otp input { width: 48px; height: 58px; border-radius: 16px; border: 1.5px solid var(--border-2); background: #fff; text-align: center; font-size: 24px; font-weight: 700; outline: none; padding: 0; }
.otp input:focus { border: 2px solid var(--blue); box-shadow: 0 0 0 4px rgba(78, 100, 130, 0.14); }
.otp.error input { border-color: #C9776A; animation: shake .35s; }
.otp.ok input { border-color: var(--green); background: #F3F7F1; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice {
  border: 1.5px solid var(--border-2); background: #fff; border-radius: 18px; padding: 12px 10px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start;
}
.choice b { font-size: 15px; }
.choice span { font-size: 13px; color: var(--muted); }
.choice[aria-checked="true"] { border: 2px solid var(--blue); background: #F4F7FA; box-shadow: 0 0 0 3px rgba(78,100,130,.1); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-opt { height: 40px; padding: 0 16px; border-radius: 20px; border: 1.5px solid var(--border-2); background: #fff; font-weight: 700; font-size: 14px; }
.pill-opt[aria-checked="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }

.switch { position: relative; width: 50px; height: 30px; border-radius: 15px; border: none; background: #CBD2DA; flex-shrink: 0; transition: background .2s; padding: 0; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.15); transition: inset-inline-start .2s; }
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"]::after { inset-inline-start: 23px; }

.check { width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--border-2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: #fff; }
.check svg { width: 15px; height: 15px; }
.check.on { background: var(--green); border-color: var(--green); }
.check.on svg { stroke: #fff; }

/* ---------- Timeline ---------- */
.tl { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 44px 18px 1fr; gap: 8px; position: relative; padding-bottom: 14px; }
.tl-item .time { font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 14px; direction: ltr; text-align: start; }
.tl-item .rail { position: relative; display: flex; justify-content: center; }
.tl-item .rail::before { content: ''; position: absolute; top: 0; bottom: -14px; width: 2px; background: var(--line); }
.tl-item:last-child .rail::before { bottom: 0; }
.tl-item .node { position: relative; margin-top: 17px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg); }
.tl-item .body { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.tl-item.plan .body { background: transparent; border: 1.5px dashed var(--border-2); }
.tl-item.now .body { background: var(--sky); border: none; }
.tl-item .title { font-size: 15px; font-weight: 700; }
.tl-item .sub { font-size: 13px; color: var(--muted); }
.tl-item .photo { margin-top: 6px; border-radius: 16px; overflow: hidden; aspect-ratio: 4/3; }
.tl-item .photo img { width: 100%; height: 100%; object-fit: cover; }
.tl-item.fresh .body { animation: pop .6s cubic-bezier(.2,.9,.3,1.3); box-shadow: 0 0 0 3px rgba(126,154,114,.35); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

.mini-tl { display: flex; flex-direction: column; padding: 6px 16px; }
.mini-tl .it { display: flex; gap: 12px; padding: 12px 0; align-items: flex-start; }
.mini-tl button.it { border: 0; background: none; width: 100%; text-align: start; padding-inline: 0; }
.mini-tl .it + .it { border-top: 1px solid var(--line-2); }
.mini-tl .t { font-size: 13px; font-weight: 700; color: var(--muted); width: 40px; padding-top: 1px; direction: ltr; text-align: start; flex-shrink: 0; }
.mini-tl .n { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }

/* ---------- Gallery ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.photo-grid button { border: none; padding: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 1; background: var(--sky); position: relative; }
.photo-grid button img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.photo-grid button:hover img { transform: scale(1.04); }
.photo-grid .big { grid-column: span 2; grid-row: span 2; }
.photo-grid .more { position: absolute; inset: 0; background: rgba(46,54,68,.45); color: #fff; font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center; }

.lightbox { position: absolute; inset: 0; z-index: 50; background: rgba(20, 24, 31, 0.94); display: flex; flex-direction: column; animation: fade .2s; }
.lightbox img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.lightbox .lb-bar { display: flex; align-items: center; justify-content: space-between; padding: calc(16px + env(safe-area-inset-top)) 16px 12px; color: #fff; }
.lightbox .lb-actions { display: flex; gap: 10px; padding: 14px 16px calc(26px + env(safe-area-inset-bottom)); }
.lightbox .icon-btn { background: rgba(255,255,255,.12); border-color: transparent; }
.lightbox .icon-btn svg { stroke: #fff; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Chat ---------- */
.bubble-row { display: flex; gap: 8px; align-items: flex-end; }
.bubble-row.me { flex-direction: row-reverse; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 20px; font-size: 15px; line-height: 1.5; background: #fff; border: 1px solid var(--line); }
.bubble-row.me .bubble { background: var(--blue); color: #fff; border-color: var(--blue); border-end-end-radius: 6px; }
.bubble-row.them .bubble { border-end-start-radius: 6px; }
.bubble-row.other .bubble { background: var(--sage); border-color: transparent; }
.bubble .who { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; opacity: .8; }
.bubble-row.fresh { animation: pop .4s ease-out; }
.sys-note { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--sage-ink); background: var(--sage); padding: 6px 12px; border-radius: 999px; text-align: center; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.composer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; background: #fff; padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; box-shadow: 0 -6px 20px rgba(78,100,130,.08); border-radius: 24px 24px 0 0; }
.composer input { flex: 1; height: 48px; border-radius: 24px; border: 1.5px solid var(--border-2); padding: 0 18px; outline: none; font-size: 15px; min-width: 0; }
.composer input:focus { border-color: var(--blue); }
.composer .send { width: 48px; height: 48px; border-radius: 24px; border: none; background: var(--blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.composer .send svg { width: 20px; height: 20px; }

/* ---------- Sheet, toast ---------- */
.sheet-backdrop { position: absolute; inset: 0; z-index: 40; background: rgba(46, 54, 68, 0.38); animation: fade .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 88%; overflow-y: auto;
  background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 20px calc(26px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px; animation: sheet-up .3s cubic-bezier(.2,.8,.2,1);
}
.sheet::before { content: ''; align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--border-2); flex-shrink: 0; }
@keyframes sheet-up { from { transform: translateY(100%); } }

#toast-root { position: absolute; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 20px;
  background: rgba(255,255,255,0.97); box-shadow: 0 12px 30px rgba(46,54,68,.22); border: 1px solid var(--line);
  animation: toast-in .35s cubic-bezier(.2,.8,.2,1); text-align: start; width: 100%; font: inherit; color: inherit;
}
.toast.out { animation: toast-out .3s forwards; }
.toast img.thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.toast .t1 { font-size: 14px; font-weight: 700; }
.toast .t2 { font-size: 13px; color: var(--muted); }
.toast .app-ic { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; }
@keyframes toast-in { from { transform: translateY(-120%); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-120%); opacity: 0; } }

/* ---------- Misc ---------- */
.progress { height: 6px; border-radius: 3px; background: var(--sky); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--blue); border-radius: 3px; transition: width .4s; }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--sky); }
.steps span.done { background: var(--blue); }
.steps span.cur { background: var(--blue-3); }
.countdown { display: flex; justify-content: center; gap: 8px; direction: ltr; align-items: center; }
.countdown .u { background: #fff; border-radius: 16px; padding: 8px 10px; min-width: 64px; text-align: center; box-shadow: var(--shadow); }
.countdown .u b { display: block; font-size: 28px; font-variant-numeric: tabular-nums; }
.countdown .u span { font-size: 12px; color: var(--muted); font-weight: 600; }
.countdown .sep { font-size: 24px; font-weight: 700; color: var(--blue-2); }
.qr-wrap { padding: 10px; border-radius: 22px; border: 1px solid var(--line); background: #fff; box-shadow: 0 0 0 6px var(--sand); direction: ltr; }
.qr-wrap svg { display: block; width: 240px; height: 240px; transition: opacity .25s; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); font-size: 14px; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin-inline: -20px; padding-inline: 20px; scroll-padding-inline: 20px; scroll-snap-type: x mandatory; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }
.room-card { flex: 0 0 200px; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.room-card .img { height: 120px; border-radius: 48px 48px 18px 18px; border: 2px solid var(--sun); overflow: hidden; }
.room-card .img img { width: 100%; height: 100%; object-fit: cover; }
.hero-arch { position: relative; height: 190px; flex-shrink: 0; border-radius: 175px 175px 24px 24px / 120px 120px 24px 24px; border: 3px solid var(--sun); overflow: hidden; box-shadow: 0 0 18px rgba(241, 199, 122, 0.45); background: var(--sky); }
.hero-arch img { width: 100%; height: 100%; object-fit: cover; }
.chart { width: 100%; height: auto; display: block; direction: ltr; }
.demo-badge { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 3; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--blue); background: rgba(255,255,255,.7); padding: 3px 8px; border-radius: 999px; pointer-events: none; }

/* Scrolling screens: never squash children to fit the viewport. */
.scroll > *, .sheet > * { flex-shrink: 0; }
.guide::-webkit-scrollbar { display: none; }
