/* App shell: header, content, tab navigation. Mobile first, a side rail from 900px. */
.app { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; }
.topbar { grid-row: 1; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; min-height: var(--top-h); padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); background: var(--brand); color: var(--on-brand, #fff); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; text-decoration: none; color: inherit; }
.brand-mark { height: 38px; max-width: 150px; border-radius: 12px; background: transparent; padding: 0; overflow: hidden; flex: none; display: flex; align-items: center; justify-content: center; }
.brand-mark img { height: 100%; width: auto; max-width: 100%; object-fit: contain; display: block; }
.topbar[data-logo="m"] { min-height: 56px; } .topbar[data-logo="m"] .brand-mark { height: 38px; }
.topbar[data-logo="l"] { min-height: 70px; } .topbar[data-logo="l"] .brand-mark { height: 54px; }
.topbar[data-logo="xl"] { min-height: 88px; } .topbar[data-logo="xl"] .brand-mark { height: 72px; max-width: 150px; }
.topbar[data-logo="l"] .brand-text b, .topbar[data-logo="xl"] .brand-text b { font-size: 1.05rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.topbar[data-logo="l"] .brand-text small, .topbar[data-logo="xl"] .brand-text small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: .74rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-spacer { flex: 1; }
.top-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: inherit; cursor: pointer; }
.top-btn:hover { background: rgba(255,255,255,.12); }
.badge-dot { position: absolute; inset-block-start: 5px; inset-inline-end: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #1b1b1b; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.net-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: .8rem; }
.page { grid-row: 2; width: 100%; max-width: 920px; margin-inline: auto; padding: 16px max(14px, env(safe-area-inset-left)) 28px max(14px, env(safe-area-inset-right)); outline: none; }
.tabs { grid-row: 3; position: sticky; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tab-h); padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 600; border-top: 3px solid transparent; }
.tab[aria-current="page"] { color: var(--accent); border-top-color: var(--accent); }
.tab span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px) {
  .app { grid-template-columns: 104px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .tabs { grid-column: 1; grid-row: 1 / -1; top: 0; bottom: auto; height: 100dvh; display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 16px 8px; border-top: 0; border-inline-end: 1px solid var(--line); }
  .tab { min-height: 68px; border-top: 0; border-inline-start: 3px solid transparent; border-radius: 12px; font-size: .8rem; }
  .tab[aria-current="page"] { background: var(--surface-2); border-inline-start-color: var(--accent); }
  .topbar { grid-column: 2; } .page { grid-column: 2; padding-block: 24px 40px; }
}
@media (max-width: 480px) { .net-pill span { display: none; } .net-pill { padding: 8px; } }
@media (max-width: 380px) { .brand-text small { display: none; } }
