.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg-app); }
.login__card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; padding: 28px 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-1); }
.login__brand { display: flex; align-items: center; gap: 12px; }
.login__logo { height: 40px; width: auto; }
.login__mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-weight: 700; }
.login__title { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.login__lead { color: var(--ink-2); font-size: 14px; margin-top: -4px; }
.login__langs { display: flex; gap: 6px; justify-content: center; }
/* niche illustration: above the card on phones, beside it on large screens */
.login:has(.login__art:not([hidden])) { align-content: center; gap: 16px; }
.login__art { width: 100%; max-width: 380px; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: var(--surface); }
.login__art img { width: 100%; height: 100%; object-fit: cover; }
@media (max-height: 700px) and (max-width: 899px) { .login__art { display: none; } }
@media (min-width: 900px) {
  .login:has(.login__art:not([hidden])) { grid-template-columns: minmax(0, 560px) 380px; justify-content: center; gap: 48px; }
  .login__art { max-width: none; aspect-ratio: 4 / 3.4; border-radius: 24px; }
}

/* ---------- app shell ---------- */
.app { min-height: 100dvh; }
.main { min-width: 0; }
.sidebar { display: none; }

.topbar {
  position: sticky; top: 0; z-index: var(--z-nav);
  display: flex; align-items: center; gap: 4px; min-height: var(--topbar-h);
  padding: env(safe-area-inset-top) 8px 0 16px;
  background: var(--topbar-bg); color: var(--topbar-ink); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__back { margin-left: -8px; }
.topbar__title-wrap { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar__title { font-family: var(--font-display); font-size: 18px; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__actions { display: flex; align-items: center; gap: 2px; }
.branch-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 13px; font-weight: 500; max-width: 50vw; }
.branch-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.view { padding: 16px 16px calc(var(--tabbar-h) + 88px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; outline: none; }
.view--flush { padding-left: 0; padding-right: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: var(--tabbar-bg); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 50px; font-size: 11px; color: var(--ink-3); }
.tabbar a.is-active { color: var(--accent-text); font-weight: 600; }
.tabbar a.is-active span { position: relative; }
.tabbar a.is-active span::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 99px; background: var(--signal); }

@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 8px;
    position: sticky; top: 0; height: 100dvh; padding: 16px 12px;
    background-color: var(--sidebar-bg); background-image: var(--sidebar-deco); color: var(--sidebar-ink-strong);
    border-right: 1px solid var(--sidebar-line);
  }
  .sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
  .sidebar__logo { height: 32px; width: auto; }
  .sidebar__mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-weight: 700; font-size: 13px; flex: none; }
  .sidebar__name { color: var(--sidebar-brand-ink); font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
  .sidebar__nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--sidebar-ink); font-size: 14px; font-weight: 500; }
  .sidebar__nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-ink-strong); }
  .sidebar__nav a.is-active { background: var(--sidebar-active-bg); color: var(--sidebar-active-ink); font-weight: 600; }
  .sidebar__sep { height: 1px; background: var(--sidebar-line); margin: 10px 8px; }
  /* niche picture in the brand colours under the menu */
  .sidebar__art { flex: none; margin: 4px 4px 0; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; }
  .sidebar__art img { width: 100%; height: 100%; object-fit: cover; }
  @media (max-height: 780px) { .sidebar__art { display: none; } }
  .sidebar__user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--sidebar-line); }
  .sidebar__user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
  .sidebar__user-text b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar__user-text small { font-size: 12px; color: var(--sidebar-ink); }
  .topbar { padding: 0 24px; min-height: 64px; }
  .topbar__back { margin-left: -12px; }
  .view { padding: 24px 24px 48px; }
}
@media (max-width: 1023px) {
  .sidebar__nav [data-nav] { display: none; }
}

/* demo instances: thin strip on top */
.demo-bar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 6px 16px; background: var(--ink); color: #fff; font-size: 12.5px; text-align: center; }
.demo-bar__cta { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
