@font-face {
  font-family: "DMSans";
  font-weight: 400;
  src: url("/static/fonts/DMSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "DMSans";
  font-weight: 500 600;
  src: url("/static/fonts/DMSans-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "DMSans";
  font-weight: 700;
  src: url("/static/fonts/DMSans-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "PlayfairDisplay";
  font-weight: 400 600;
  src: url("/static/fonts/PlayfairDisplay-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "PlayfairDisplay";
  font-weight: 700;
  src: url("/static/fonts/PlayfairDisplay-Bold.woff2") format("woff2");
}

/* ============================================================
   STRESSCHECKER® — Gedeelde stijlen
   Lichtgewicht, geen frameworks, werkt op elk apparaat
   ============================================================ */

:root {
  --red:        #E8344E;
  --red-dark:   #C42840;
  --red-light:  #FDE8EB;
  --beige:      #F5F0EB;
  --beige-dark: #D6CFC4;
  --brown:      #8B6914;
  --text:       #333333;
  --text-muted: #888888;
  --border:     #DDD5C8;
  --white:      #FFFFFF;
  --green:      #2E7D32;
  --orange:     #E65100;

  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 4px 24px rgba(0,0,0,0.12);

  --max-width:  860px;
  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--beige-dark); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Header ── */
.app-header-inner { max-width: 900px; margin: 0 auto; width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; }
.app-header {
  background: var(--white);
  border-bottom: 2px solid var(--beige-dark);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.08em;
}
.brand-name sup { font-size: 0.55em; }
.brand-tagline {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.lang-switcher {
  display: flex;
  gap: 2px;
}
.lang-btn {
  padding: 3px 7px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all 0.15s;
}
.lang-btn.active, .lang-btn:hover {
  background: var(--red);
  color: var(--white);
}
.nav-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.nav-link:hover { background: var(--beige-dark); color: var(--text); }

/* ── Main layout ── */
.app-main { background: var(--beige); box-shadow: 0 0 40px rgba(0,0,0,0.12); max-width: 900px; margin: 0 auto;
  min-height: calc(100vh - 65px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
}
.screen {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ── Kaarten ── */
.card {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-action {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.18s;
  text-align: left;
}
.card-action:hover, .card-action:focus {
  border-color: var(--red);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.card-action.primary { border-color: var(--red); background: #FFF5F6; }
.card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.icon-green  { background: #E8F5E9; }
.icon-orange { background: #FFF3E0; }
.icon-purple { background: #F3E5F5; }
.icon-red    { background: var(--red-light); }
.card-text strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.card-text small  { font-size: 0.8rem; color: var(--text-muted); }
.card-arrow { margin-left: auto; color: var(--text-muted); font-size: 1.1rem; }

/* ── Formulierelementen ── */
.form-group { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--white);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.form-input:focus { outline: none; border-color: var(--red); }
.form-input.code-input {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}
.form-hint { font-size: 0.78rem; color: var(--text-muted); }
.form-error {
  font-size: 0.85rem;
  color: var(--red);
  background: var(--red-light);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--red);
}

/* ── Knoppen ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  width: 100%;
  min-height: 52px;
  letter-spacing: 0.04em;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-secondary {
  background: var(--beige-dark);
  color: var(--text);
}
.btn-secondary:hover { background: var(--border); }
.btn-outline {
  background: transparent;
  color: var(--red);
  border: 2px solid var(--red);
}
.btn-outline:hover { background: var(--red-light); }
.btn-green  { background: #2E7D32; color: var(--white); }
.btn-green:hover  { background: #1B5E20; }

/* ── Typografie ── */
.screen-title { color: var(--red); font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--red);
  letter-spacing: 0.06em;
  text-align: center;
}
.screen-title sup { font-size: 0.45em; }
.screen-subtitle { font-size: 0.95rem; color: var(--text-muted); text-align: center; font-style: italic; }
.section-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }

/* ── Kompas logo (groot, welkomstscherm) ── */
.compass-hero {
  width: 100px; height: 100px;
  margin: 8px auto;
}
.compass-hero svg { width: 100%; height: 100%; }

/* ── Taalknopjes (welkomstscherm) ── */
.lang-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
}
.lang-bar .lang-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid var(--border);
  font-size: 0.85rem;
  color: var(--text);
  transition: all 0.15s;
}
.lang-bar .lang-btn.active {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

/* ── Divider ── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.divider-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
}
.divider-text::before, .divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: var(--border);
}
.divider-text::before { left: 0; }
.divider-text::after  { right: 0; }

/* ── Responsief ── */
@media (max-width: 767px) {
  .app-main { padding: 16px 12px 40px; }
  .card, .card-action { padding: 16px; }
  .screen-title { color: var(--red); font-family: var(--font-title); font-size: 1.4rem; }
  .app-header-inner { padding: 0 16px; }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-responsive table { min-width: 700px; }
  .container, .content-wrap { width: 100% !important; max-width: none !important; overflow-x: auto; }
}
@media (min-width: 768px) {
  :root { --max-width: 860px; }
  .app-main { padding: 32px 24px 64px; }
}
@media (max-width: 1024px) {
  .table-responsive {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    scroll-behavior: auto !important;
    position: relative;
    width: 100%;
    height: auto;
  }
  .container, .content-wrap {
    overflow-x: visible !important;
  }
  .meting-tabel {
    position: static;
    transform: none;
    min-width: 900px;
    table-layout: fixed;
  }
  .table-responsive::-webkit-scrollbar {
    height: 8px;
  }
  .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }
  .table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
  }
}
@media (min-width: 568px) and (orientation: landscape) and (max-width: 1024px) {
  body {
    width: 100vw !important; max-width: none !important;
    margin: 0 !important; margin-left: 0 !important;
    padding: 0 !important; padding-left: 0 !important;
  }
  .container, .content-wrap, .screen, .app-main {
    width: 100vw !important; max-width: none !important;
    margin: 0 !important; margin-left: 0 !important;
    padding: 0 5px !important; padding-left: 5px !important;
    text-align: left;
  }
  .table-responsive { width: 100% !important; margin: 0 !important; margin-left: 0 !important; padding: 0 !important; padding-left: 0 !important; overflow-x: auto; }
  .meting-tabel { width: 100% !important; min-width: calc(100vw - 10px) !important; margin-left: 0 !important; table-layout: auto; }
  .meting-tabel th, .meting-tabel td { white-space: normal; text-overflow: clip; padding: 4px 6px; }
}
/* Portrait phones: tabel horizontaal scrollbaar met leesbare kolombreedtes.
   Overschrijft table-layout:fixed + min-width:900px uit het 1024px-blok zodat
   kolommen zich naar hun inhoud voegen en niet langer over elkaar vallen.
   Extra: constrain direct-children van .app-main zodat max-content-breedtes
   (zoals een lange letter-spaced h2 of een flex-rij met knoppen) de hele
   pagina niet meer buiten viewport duwen. Safety net: overflow-x:hidden op
   html/body om residuele overflow op te vangen. */
@media (max-width: 567px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .app-main > * {
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  /* Chart hoger in portrait: vaste container-hoogte i.c.m. maintainAspectRatio:false
     (zie pro/eigen_metingen.html) zodat alle y-as stappen zichtbaar blijven. */
  .chart-container {
    height: 280px !important;
  }
  .meting-tabel {
    width: auto !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }
  .meting-tabel th,
  .meting-tabel td {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  .meting-tabel th:nth-child(1), .meting-tabel td:nth-child(1) { min-width: 90px; }  /* Datum */
  .meting-tabel th:nth-child(2), .meting-tabel td:nth-child(2) { min-width: 55px; }  /* Tijd */
  .meting-tabel th:nth-child(3), .meting-tabel td:nth-child(3) { min-width: 50px; }  /* RI */
  .meting-tabel th:nth-child(4), .meting-tabel td:nth-child(4) { min-width: 50px; }  /* BPM */
  .meting-tabel th:nth-child(5), .meting-tabel td:nth-child(5) { min-width: 50px; }  /* HRV% */
  .meting-tabel th:nth-child(6), .meting-tabel td:nth-child(6) { min-width: 50px; }  /* RMSSD */
  .meting-tabel th:nth-child(7), .meting-tabel td:nth-child(7) { min-width: 90px; }  /* Meting */
  .meting-tabel th:nth-child(8), .meting-tabel td:nth-child(8) { min-width: 100px; } /* Label/Dim */
  .meting-tabel th:nth-child(9), .meting-tabel td:nth-child(9) { min-width: 100px; } /* Label/Dim */
  .meting-tabel th:nth-child(10), .meting-tabel td:nth-child(10) { min-width: 100px; } /* Kubios */
}


/* Knop hover-animatie */
.mn-btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.mn-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(180, 30, 0, 0.35);
    filter: brightness(1.1);
}
.mn-btn:active {
    transform: translateY(0px);
    box-shadow: 0 2px 6px rgba(180, 30, 0, 0.2);
    filter: brightness(0.95);
}


/* Knoppen gelijklijnen in kaarten */
.mn-card {
    display: flex;
    flex-direction: column;
}
.mn-card .mn-btn {
    margin-top: auto;
}

.back-link {
  display: inline-block;
  color: #c0392b !important;
  text-decoration: none;
  font-size: .85rem;
  margin: 1.2rem 0 0 1.5rem;
}
.back-link:hover { text-decoration: underline; }
.kc-card p, .kc-card li { font-size: .8rem; color: #555; }
.kc-card strong { font-size: .8rem; }
.kc-card ul { font-size: .8rem; color: #555; margin: .3rem 0 .5rem 1.2rem; padding: 0; }
.kc-highlight { font-size: .8rem; }
.kc-card strong { font-size: .8rem !important; font-weight: 600; }
.kc-card p { font-size: .8rem !important; color: #555 !important; }
.kc-card li { font-size: .8rem !important; color: #555 !important; }
.kc-card ul, .kc-card ol { font-size: .8rem !important; }

.result-card{background:#f8f8f8;border-radius:12px;padding:1rem;margin:1rem 0;display:flex;align-items:center;gap:1rem}
