/* TenaZ base styles: fonts, reset, typography, app layout. Owner: shell agent. Colours come from tokens.css only. */

@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/lato-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 900; font-display: swap; src: url("/fonts/lato-latin-900-normal.woff2") format("woff2"); }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: var(--font); font-size: var(--fs-m); line-height: 1.5; font-weight: 400;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: anywhere;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, svg, video, canvas { max-width: 100%; }
img { display: block; height: auto; }
svg.icon { flex: none; display: block; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
button { cursor: pointer; }
a { color: var(--link); text-underline-offset: .15em; }
[hidden] { display: none !important; }
* { min-width: 0; }

:focus { outline: none; }
/* Focus ring from tokens; the transparent outline keeps a visible ring in forced-colours mode. */
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus-ring); }
.app-header :focus-visible, .on-navy :focus-visible, .card-navy :focus-visible { box-shadow: var(--focus-ring-on-navy); }

/* ---------- typography ---------- */
h1, .h1 { font-size: var(--fs-xl); line-height: 1.2; font-weight: 900; color: var(--tz-navy); letter-spacing: -.01em; }
h2, .h2 { font-size: var(--fs-l); line-height: 1.25; font-weight: 700; color: var(--tz-navy); }
h3, .h3 { font-size: var(--fs-m); line-height: 1.3; font-weight: 700; color: var(--tz-navy); }
.display { font-size: var(--fs-xxl); line-height: 1.1; font-weight: 900; color: var(--tz-navy); }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-gold); }
.lead { font-size: var(--fs-l); line-height: 1.4; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-s); }
.tiny, .small-print { font-size: var(--fs-xs); line-height: 1.45; color: var(--text-muted); }
.strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.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; }
.gold-rule { height: 1px; border: 0; margin: var(--space-4) 0; background: var(--tz-gold); opacity: .7; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.stack-s { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.row > * { min-width: 0; }
.row-between { justify-content: space-between; }
.grow { flex: 1 1 0; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: var(--space-3); }

/* ---------- app layout ---------- */
.app {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  width: 100%; max-width: 34rem; margin: 0 auto;
  background: var(--bg); overflow: hidden;
}
.app-header {
  flex: none; display: flex; align-items: center; gap: var(--space-3);
  background: var(--surface-navy); color: var(--text-on-navy);
  padding: calc(env(safe-area-inset-top, 0px) + var(--space-2)) max(var(--space-4), env(safe-area-inset-right, 0px)) var(--space-2) max(var(--space-4), env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--tz-gold);
}
.brand { display: flex; align-items: center; gap: var(--space-3); flex: 1 1 auto; min-width: 0; }
.brand-plate { flex: none; display: flex; align-items: center; background: var(--tz-white); border-radius: var(--radius-s); padding: 3px 7px; }
.brand-logo { display: block; width: auto; height: 30px; max-width: none; }
.brand-text { display: grid; min-width: 0; line-height: 1.15; }
.brand-eyebrow { font-size: .6875rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--tz-gold-light); }
.brand-title { font-size: min(var(--fs-m), 5.6vw); font-weight: 900; letter-spacing: .01em; color: var(--text-on-navy); overflow-wrap: anywhere; }
.app-header .icon-btn { color: var(--text-on-navy); }

.app-main {
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: var(--space-4) max(var(--space-4), env(safe-area-inset-right, 0px)) var(--space-6) max(var(--space-4), env(safe-area-inset-left, 0px));
}
.app-main > * + * { margin-top: var(--space-4); }
.app-main:focus-visible { outline: none; }

.app-nav {
  flex: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  box-shadow: var(--shadow-1);
}
.nav-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--nav-h); padding: var(--space-2) 2px;
  color: var(--text-muted); text-decoration: none; text-align: center;
  font-size: min(var(--fs-xs), 4.2vw); font-weight: 700; line-height: 1.15;
  transition: color .18s var(--ease);
}
.nav-item::before {
  content: ""; position: absolute; top: -1px; left: 26%; right: 26%; height: 2px; border-radius: 0 0 2px 2px;
  background: var(--tz-gold); transform: scaleX(0); transition: transform .22s var(--ease);
}
.nav-item[aria-current="page"] { color: var(--tz-navy); }
.nav-item[aria-current="page"]::before { transform: scaleX(1); }
.nav-item:focus-visible { outline-offset: -3px; }
.nav-label { max-width: 100%; overflow-wrap: anywhere; }

/* screens without the shell: boot, login, onboarding */
.screen {
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface);
  padding: calc(env(safe-area-inset-top, 0px) + var(--space-5)) max(var(--space-5), env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + var(--space-6)) max(var(--space-5), env(safe-area-inset-left, 0px));
}
.screen-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); max-width: 26rem; margin: 0 auto; }
.boot { flex: 1 1 auto; display: grid; align-content: center; justify-items: center; gap: var(--space-4); padding: var(--space-6) var(--space-5); background: var(--surface); }
.boot .skel { width: 100%; max-width: 20rem; }
.boot-logo { width: 150px; height: auto; }
.boot-text { color: var(--text-muted); font-size: var(--fs-s); }
.noscript { max-width: 26rem; margin: 0 auto; padding: var(--space-6) var(--space-5); display: grid; gap: var(--space-3); }

/* ---------- motion ---------- */
@keyframes tz-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes tz-sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tz-scrim-in { from { opacity: 0; } to { opacity: .5; } }
@keyframes tz-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.view-enter { animation: tz-fade-in .26s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
