
/* ==========================================================================
   BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Visible keyboard focus everywhere, never a bare outline:none */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
:focus:not(:focus-visible) { outline: none; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }

/* ==========================================================================
   APP SHELL  -  side menu (css/nav.css), top bar and bottom tab bar on phones
   ========================================================================== */
.app { min-height: 100dvh; padding-top: var(--decor-strip, 0px); }

/* --- Mobile top bar ----------------------------------------------------- */
.topbar {
  position: sticky; top: var(--decor-strip, 0px); z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .brandmark { flex: 1; }

/* --- Brand mark --------------------------------------------------------- */
.brandmark { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brandmark svg { flex: none; display: block; }
.brandmark .bm-text { display: flex; flex-direction: column; min-width: 0; }
.brandmark .bm-name { display: block;
  font-family: var(--font-heading); font-weight: 700; font-size: 15px;
  letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap;
}
.brandmark .bm-sub { display: block;
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}

/* --- Main --------------------------------------------------------------- */
.main { padding: 0 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); }
.view { display: none; padding: 16px 14px 8px; max-width: 1080px; margin-inline: auto; }
.view.active { display: block; animation: rise 0.22s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .view.active { animation: none; } }

.view-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
/* Page titles use the theme's display font (NUtec: Syntax Black); see server/themes.js compileCss. */
.view-head h1 { font-family: var(--font-display); font-size: 22px; font-weight: var(--display-weight, 700); }
.view-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* --- Bottom tab bar (mobile) -------------------------------------------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; border: 0; background: none; color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  position: relative; padding: 0; -webkit-tap-highlight-color: transparent;
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current='page'] { color: var(--brand-quiet); }
.tab[aria-current='page']::before {
  content: ''; position: absolute; top: 0; left: 50%; translate: -50% 0;
  width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand);
}
.tab .badge {
  position: absolute; top: 6px; left: calc(50% + 9px);
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--warn-fill); color: var(--on-warn);
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  font-family: var(--font-mono);
}

