/* Phone app shell. Spec section 5 (shared mobile components) and section 6. Frame is 390 wide;
   on a wider screen the app column stays centred at 480 max so it also works in a browser. */

body.m-body { background: var(--surface); }
@media (min-width: 560px) { body.m-body { background: #E4E7EC; } }

.app {
  position: relative; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
  max-width: 480px; margin: 0 auto; background: var(--surface);
}
@media (min-width: 560px) { .app { box-shadow: 0 0 0 1px var(--line), 0 8px 32px rgba(16, 24, 40, .08); } }
.app--white { background: #fff; }

/* ---------- header ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px;
  min-height: calc(60px + var(--safe-t)); padding: var(--safe-t) 12px 0 4px; background: #fff; border-bottom: 1px solid var(--line);
}
.appbar__back { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; color: var(--navy); background: none; border: 0; text-decoration: none; }
.appbar__back .i { width: 24px; height: 24px; }
.appbar__title { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.25; }
.appbar__sub { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.appbar__slot { display: flex; align-items: center; gap: 8px; }
.appbar--pad-l { padding-left: 16px; }

.emergency {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r-pill); border: 0;
  background: var(--red); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.emergency .i { width: 18px; height: 18px; }

.lang-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line-input); background: #fff; color: var(--text); font-size: 14px; font-weight: 600;
}
.lang-pill .i { width: 16px; height: 16px; }

/* ---------- progress ---------- */
.progress { padding: 12px 16px 0; background: var(--surface); }
.progress__bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.progress__bars i { height: 6px; border-radius: 3px; background: var(--line); }
.progress__bars i.is-done { background: var(--blue); }
.progress__label { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }

/* ---------- body and bottom action zone ---------- */
.m-main { flex: 1; display: grid; align-content: start; gap: 14px; padding: 14px 16px 24px; }
.m-main--tight { gap: 12px; }
.cta-zone {
  position: sticky; bottom: 0; z-index: 15; display: grid; gap: 8px; padding: 10px 16px calc(20px + var(--safe-b));
  background: linear-gradient(to bottom, rgba(242, 244, 247, 0), var(--surface) 14px);
}
.cta-zone .helper { text-align: center; }
.cta-zone--plain { background: var(--surface); border-top: 1px solid var(--line); }
.cta-zone--white { background: #fff; border-top: 1px solid var(--line); }

.m-h { font-size: 19px; font-weight: 800; color: var(--navy); line-height: 1.3; }
.m-h small, .t-en { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.m-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-card-m); padding: 14px 16px; }

/* English helper line under a main-language string */
.t-en { margin-top: 2px; }
[data-lang="en"] .t-en { display: none; }

/* ---------- navy hero (sign in, home) ---------- */
.m-hero { background: var(--navy); color: #fff; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.logo__tile { width: 36px; height: 36px; border-radius: 10px; background: var(--blue); display: grid; place-items: center; }
.logo__tile svg { width: 22px; height: 22px; }
.logo--sm { font-size: 17px; }
.logo--sm .logo__tile { width: 30px; height: 30px; border-radius: 8px; }
.logo--sm .logo__tile svg { width: 18px; height: 18px; }
.logo--dark { color: var(--navy); }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: sticky; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  min-height: calc(76px + var(--safe-b)); padding: 8px 4px calc(8px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line);
}
.bottom-nav a {
  display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 56px; color: var(--text-2);
  font-size: 11.5px; font-weight: 600; text-decoration: none; text-align: center; line-height: 1.2;
}
.bottom-nav a .i { width: 24px; height: 24px; }
.bottom-nav a[aria-current="page"] { color: var(--blue); }
.bottom-nav .plus { color: var(--text-strong); }
.bottom-nav .plus span.disc {
  width: 56px; height: 56px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center;
  margin-top: -28px; box-shadow: 0 4px 12px rgba(29, 95, 181, .35); border: 4px solid #fff;
}
.bottom-nav .plus span.disc .i { width: 28px; height: 28px; }
.bottom-nav .badge-dot { position: relative; }
.bottom-nav .badge-dot::after { content: attr(data-n); position: absolute; top: -4px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.bottom-nav .badge-dot[data-n="0"]::after, .bottom-nav .badge-dot:not([data-n])::after { display: none; }

/* ---------- list rows ---------- */
.m-list { display: grid; gap: 10px; }
.m-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-card-m); min-height: 64px; }
.m-row__main { flex: 1; min-width: 0; }
.m-row__title { font-size: 15.5px; font-weight: 700; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.m-row__meta { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

@media (prefers-reduced-motion: reduce) { .bottom-nav .plus span.disc { box-shadow: none; } }
