/* CIF 2026 Business Connect – mobile app layer */
.cif-appbar, .cif-offline-bar { display: none; }

/* ---------- Phones: participant area becomes an app ---------- */
@media (max-width: 960px) {
  body.is-cif-app .cif-header, body.is-cif-app .cif-footer, body.is-cif-app .skip-link { display: none !important; }
  body.is-cif-app { background: var(--surface); }
  body.is-cif-app .cif-appwrap { padding-top: 14px; }
  .cif-appbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: 0; z-index: 95;
    padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
    background: var(--navy); color: var(--white); box-shadow: 0 2px 12px rgba(16,28,49,.18);
  }
  .admin-bar .cif-appbar { top: 46px; }
  .cif-appbar__brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; min-width: 0; }
  .cif-appbar__brand img { border-radius: 9px; flex: none; }
  .cif-appbar__brand span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
  .cif-appbar__brand b { font-family: var(--font-head); font-size: 1rem; font-weight: 700; letter-spacing: .01em; }
  .cif-appbar__brand small { font-size: .72rem; color: var(--gold); font-weight: 600; letter-spacing: .02em; }
  .cif-appbar__act { display: flex; align-items: center; gap: 2px; }
  .cif-appbar__btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: var(--white); background: transparent; border: 0; cursor: pointer; list-style: none; }
  .cif-appbar__btn::-webkit-details-marker { display: none; }
  .cif-appbar__btn:hover, .cif-appbar__btn.is-active, .cif-appbar__menu[open] > .cif-appbar__btn { background: rgba(255,255,255,.12); color: var(--white); }
  .cif-appbar__btn svg { color: currentColor; }
  .cif-appbar__dot { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--orange); color: var(--white); font-size: .66rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--navy); }
  .cif-appbar__menu { position: relative; }
  .cif-appbar__sheet { position: absolute; right: 0; top: calc(100% + 8px); width: min(320px, calc(100vw - 24px)); max-height: calc(100vh - 140px); overflow: auto; background: var(--white); color: var(--ink); border-radius: 16px; box-shadow: var(--sh-lg); padding: 8px; border: 1px solid var(--line); }
  .cif-appbar__me { display: flex; gap: 10px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
  .cif-appbar__me strong { display: block; color: var(--navy); font-size: .92rem; line-height: 1.25; }
  .cif-appbar__me span { display: block; color: var(--slate); font-size: .8rem; line-height: 1.3; }
  .cif-appbar__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: .9rem; }
  .cif-appbar__row .cif-lang { display: flex; gap: 4px; }
  .cif-appbar__row .cif-lang a { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .8rem; }
  .cif-appbar__row .cif-lang a.is-current { background: var(--navy); border-color: var(--navy); color: var(--white); }
  .cif-pushrow { flex-wrap: wrap; }
  .cif-pushrow > span:first-child { display: flex; align-items: flex-start; gap: 8px; color: var(--navy); }
  .cif-pushrow > span:first-child > span { display: flex; flex-direction: column; }
  .cif-pushrow small { color: var(--slate); font-size: .78rem; font-weight: 400; }
  .cif-pushrow__btns { display: flex; gap: 6px; margin-left: auto; }
  .cif-appbar__link { display: flex; width: 100%; align-items: center; gap: 10px; padding: 12px 8px; border-radius: 10px; color: var(--ink); text-decoration: none; font: 500 .93rem/1.2 var(--font-body); background: none; border: 0; cursor: pointer; text-align: left; }
  .cif-appbar__link:hover { background: var(--surface); color: var(--navy); }
  .cif-appbar__link svg { color: var(--slate); }
  .cif-appbar__logout { color: var(--danger); } .cif-appbar__logout svg { color: var(--danger); }

  /* Bottom tab bar: roomier touch targets, active pill */
  .cif-app__nav { padding-top: 4px; }
  .cif-app__nav ul { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cif-app__nav a { padding-left: 1px; padding-right: 1px; }
  .cif-app__nav a span:not(.cif-badge) { display: block; width: 100%; }
  .cif-app__nav a { min-height: 54px; justify-content: center; }
  .cif-app__nav a.is-active { background: transparent; color: var(--navy); }
  .cif-app__nav a.is-active svg { color: var(--orange); }
  .cif-app__nav a.is-active::before { content: ""; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--orange); }
  .cif-app__head h1 { font-size: 1.45rem; }

  .cif-offline-bar { position: sticky; top: calc(60px + env(safe-area-inset-top)); z-index: 94; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; background: var(--warn-soft); color: var(--warn); font-size: .82rem; font-weight: 600; text-align: center; }
  .is-offline .cif-offline-bar { display: flex; }
}

/* Offline notice for larger screens */
@media (min-width: 961px) {
  .is-offline body.is-cif-app .cif-offline-bar { display: flex; justify-content: center; gap: 8px; padding: 8px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: .9rem; }
}

/* ---------- Installed app (standalone) ---------- */
.is-standalone body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
.is-standalone body:not(.is-cif-app) .cif-header { padding-top: env(safe-area-inset-top); }
.is-standalone .cif-app__nav { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.is-standalone .cif-appwrap { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* ---------- Push opt-in card ---------- */
.cif-pushcard { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; border-left: 4px solid var(--orange); }
.cif-pushcard[hidden] { display: none; }
.cif-pushcard__ic { flex: none; display: inline-flex; width: 44px; height: 44px; border-radius: 50%; align-items: center; justify-content: center; background: var(--orange-soft); color: var(--orange-700); }
.cif-pushcard strong { color: var(--navy); }
.cif-pushcard p { margin: 2px 0 0; color: var(--slate); font-size: .9rem; }
.cif-pushcard__act { display: flex; gap: 8px; flex: none; }
@media (max-width: 620px) { .cif-pushcard { flex-wrap: wrap; align-items: flex-start; } .cif-pushcard > div:nth-child(2) { flex: 1 1 calc(100% - 60px); } .cif-pushcard__act { width: 100%; } .cif-pushcard__act .cif-btn { flex: 1; justify-content: center; } }

/* ---------- Install banner ---------- */
.cif-install { position: fixed; z-index: 120; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-lg); transform: translateY(24px); opacity: 0; transition: transform .25s ease, opacity .25s ease; }
.cif-install.is-in { transform: none; opacity: 1; }
.cif-install[hidden] { display: none; }
.cif-install img { border-radius: 12px; flex: none; }
.cif-install__txt { flex: 1; min-width: 0; font-size: .85rem; line-height: 1.35; color: var(--slate); }
.cif-install__txt strong { display: block; color: var(--navy); font-size: .95rem; margin-bottom: 2px; }
.cif-install__txt svg { vertical-align: -3px; color: var(--info); }
.cif-install__act { display: flex; align-items: center; gap: 4px; flex: none; }
.cif-install__x { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: 0; background: none; color: var(--slate); border-radius: 50%; cursor: pointer; }
body.is-cif-app .cif-install { bottom: calc(86px + env(safe-area-inset-bottom)); }
@media (min-width: 961px) { .cif-install { display: none !important; } }

/* ---------- QR badge screen ---------- */
.cif-badge-screen { max-width: 520px; margin: 0 auto; display: grid; gap: 18px; }
.cif-badge-screen__card { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-3) 100%); color: var(--white); border-radius: var(--r-xl); padding: 22px 20px 20px; text-align: center; box-shadow: var(--sh-lg); position: relative; overflow: hidden; }
.cif-badge-screen__card::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--orange), var(--gold)); }
.cif-badge-screen__top { display: flex; align-items: center; gap: 10px; text-align: left; font-family: var(--font-head); font-weight: 600; font-size: .95rem; }
.cif-badge-screen__top img { border-radius: 9px; }
.cif-badge-screen__top small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .76rem; color: var(--gold); }
.cif-badge-screen__who { margin: 18px 0 14px; }
.cif-badge-screen__who .cif-avatar { margin: 0 auto 10px; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.cif-badge-screen__who h1 { color: var(--white); font-size: 1.45rem; margin: 0 0 2px; }
.cif-badge-screen__who p { color: #C9D2E3; margin: 0 0 10px; font-size: .92rem; }
.cif-badge-screen__who .cif-tag { background: rgba(255,255,255,.12); color: var(--white); }
.cif-badge-screen__qr.cif-qr { background: var(--white); border: 0; border-radius: 18px; padding: 14px; width: min(280px, 78vw); height: auto; aspect-ratio: 1 / 1; margin: 0 auto; }
.cif-badge-screen__qr svg { display: block; width: 100%; height: auto; }
.cif-badge-screen__hint { margin: 14px 0 0; color: #C9D2E3; font-size: .85rem; }
.cif-app[data-view="badge"] .cif-app__head { display: none; }

@media print { .cif-appbar, .cif-install, .cif-pushcard, .cif-offline-bar { display: none !important; } }
