/* Basics: a clean starting point for every element, readable text, visible focus, no sideways scrolling. */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button:disabled { cursor: default; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--accent-soft); }

/* Text typed by someone (notes, names) may be Arabic or English: each line picks its own direction. */
.user-text { unicode-bidi: plaintext; overflow-wrap: anywhere; }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.wrap { flex-wrap: wrap; }
.center { text-align: center; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Icons from the icon sheet are outlines: they take the text colour, with no fill. */
.icon, .icon-sm, .icon-lg {
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; flex: none; }
.icon-lg { width: 24px; height: 24px; flex: none; }

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

/* While the app starts */
.boot {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
.boot-mark {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, #fb923c, #ea580c);
  box-shadow: var(--shadow-2);
  animation: boot-pulse 1.2s var(--ease) infinite alternate;
}
@keyframes boot-pulse { from { transform: scale(0.92); opacity: 0.7; } to { transform: scale(1); opacity: 1; } }
