/* Base: reset, page, type defaults, focus, utilities. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  background: var(--chalk);
  scrollbar-width: none;
  overscroll-behavior-x: none;
}
html::-webkit-scrollbar { display: none; }
html.is-locked { overflow: hidden; }
body {
  min-height: 100dvh;
  background: var(--chalk); color: var(--ink);
  font-family: var(--font); font-size: var(--t-body); line-height: 1.4; font-weight: 440;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button {
  background: none; border: 0; cursor: pointer; text-align: inherit;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg, canvas { display: block; }
h1, h2, h3, h4 { font-weight: inherit; font-size: inherit; text-wrap: balance; }
p { text-wrap: pretty; }

/* Focus rings: keyboard only. A sheet opened by touch or by code never shows one. */
:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; } /* the outline follows each element's own radius */

/* Icons: one set, one stroke, sized by the parent's font-size unless a class says otherwise. */
.ico {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: var(--icon-stroke);
  stroke-linecap: round; stroke-linejoin: round;
}

/* Utilities */
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.nb { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* App shell */
.app {
  position: relative;
  max-width: 430px; margin: 0 auto;
  min-height: 100dvh;
}
.view {
  padding: calc(var(--safe-t) + 10px) calc(var(--gutter) + var(--safe-r)) var(--content-bottom) calc(var(--gutter) + var(--safe-l));
  transform-origin: 50% 0;
}
.view[data-leaving] { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
/* a pushed screen's left edge belongs to the back pan (js/core/router.js): a home-screen app has
   no system edge swipe. The page being dragged keeps a hairline on its left edge. */
.push-edge { position: fixed; z-index: 2; left: 0; top: 0; bottom: 0; width: calc(20px + var(--safe-l)); touch-action: none; }
.view[style*="translateX"]:not([data-leaving]) { background: var(--chalk); box-shadow: -1px 0 0 var(--hair); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Reduced motion: no CSS transition carries meaning on its own; JS handles the rest live. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
.is-static *, .is-static *::before, .is-static *::after { transition: none !important; animation: none !important; }

/* Full-page captures pin the floating chrome to the end of the document. */
.capture-full body { position: relative; }
.capture-full .tabbar { position: absolute; }
.capture-full .tab-edge { display: none; }

/* A merchant from a bank message keeps its own direction (dir="auto", ui/expense-row.js) but
   stays on the gutter like every other line: an Arabic name is not pushed to the right edge. */
[dir="auto"] { text-align: left; }
