:root {
  --f: 'Space Grotesk', system-ui, -apple-system, Roboto, 'Segoe UI', sans-serif;
  --accent: #FF4D2E;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; margin: 0; }

body {
  background: #F4F4F2;
  font-family: var(--f);
  color: #17181C;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  touch-action: manipulation;
}

/* Sentrer appen på brede skjermer (desktop), full bredde på mobil */
#app {
  height: 100%;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  background: #F4F4F2;
  overflow: hidden;
}

::-webkit-scrollbar { display: none; }

a { color: var(--accent); text-decoration: none; }
button, input { font-family: var(--f); }
input:focus { outline: none; }

.screen { height: 100%; display: flex; flex-direction: column; }

/* Innholdsområde – topp-padding tar høyde for statuslinje / notch */
.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(52px, calc(env(safe-area-inset-top) + 14px)) 20px 24px;
}
.scroll.home {
  padding-top: max(56px, calc(env(safe-area-inset-top) + 18px));
  padding-bottom: 44px;
}

/* Bunnlinje med primærknapp – tar høyde for hjem-indikator */
.bottombar {
  flex: none;
  padding: 12px 20px max(22px, calc(env(safe-area-inset-bottom) + 12px));
  background: linear-gradient(to top, #F4F4F2 60%, rgba(244, 244, 242, 0));
}

/* Enkel trykk-tilbakemelding */
button:active,
[data-act]:active { opacity: .72; transition: opacity .05s; }

/* Ikke la tekst kunne markeres (app-følelse), unntatt i skrivefelt */
.screen { user-select: none; -webkit-user-select: none; }
input, .num-edit { user-select: text; -webkit-user-select: text; }
