/* Thailand 2026 — offline reisapp */

:root {
  --bg: #f5f2ea;
  --surface: #ffffff;
  --surface-2: #eee9dd;
  --ink: #16211e;
  --ink-2: #55635e;
  --ink-3: #8a968f;
  --line: #ddd6c7;
  --accent: #0c6b5b;
  --accent-ink: #ffffff;
  --accent-soft: #d9ebe6;
  --warm: #b4620a;
  --warm-soft: #f7e6d0;
  --danger: #a8261d;
  --danger-soft: #f8dedb;
  --ok: #2c6e3f;
  --shadow: 0 1px 2px rgba(20,33,30,.06), 0 6px 18px rgba(20,33,30,.06);
  --r: 16px;
  --r-sm: 10px;
  --tab-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1412;
    --surface: #18211e;
    --surface-2: #212c28;
    --ink: #edf2ef;
    --ink-2: #9daba5;
    --ink-3: #6f7d78;
    --line: #2b3733;
    --accent: #45c9ae;
    --accent-ink: #05201b;
    --accent-soft: #123832;
    --warm: #f0a94f;
    --warm-soft: #38290f;
    --danger: #ff8b80;
    --danger-soft: #3a1a17;
    --ok: #6cc98a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.28);
  }
}

:root[data-theme="dark"] {
  --bg: #0d1412;
  --surface: #18211e;
  --surface-2: #212c28;
  --ink: #edf2ef;
  --ink-2: #9daba5;
  --ink-3: #6f7d78;
  --line: #2b3733;
  --accent: #45c9ae;
  --accent-ink: #05201b;
  --accent-soft: #123832;
  --warm: #f0a94f;
  --warm-soft: #38290f;
  --danger: #ff8b80;
  --danger-soft: #3a1a17;
  --ok: #6cc98a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.28);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); text-decoration: underline; }

/* ---------- Toegangspoort ---------- */

#gate {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px; padding: 32px;
  text-align: center;
}
#gate h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; }
#gate p { color: var(--ink-2); margin: 0; max-width: 30ch; font-size: 15px; }
#gate input {
  width: 220px; padding: 14px; text-align: center;
  font-size: 22px; letter-spacing: .3em;
  border: 2px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
}
#gate input:focus { outline: none; border-color: var(--accent); }
#gate .err { color: var(--danger); font-size: 14px; min-height: 20px; }

/* ---------- Structuur ---------- */

#app { display: none; }
#app.on { display: block; }

header {
  position: sticky; top: 0; z-index: 20;
  padding: max(env(safe-area-inset-top), 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
header h1 { font-size: 22px; margin: 0; letter-spacing: -.02em; flex: 1; }
header .sub { font-size: 12px; color: var(--ink-3); font-weight: 400; display: block; letter-spacing: 0; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); flex: none;
}
.iconbtn svg { width: 19px; height: 19px; }

main {
  padding: 14px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 22px);
  max-width: 720px; margin: 0 auto;
}

nav#tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav#tabs button {
  height: var(--tab-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font-size: 9.5px; font-weight: 500; letter-spacing: -.01em;
}
nav#tabs button svg { width: 21px; height: 21px; }
nav#tabs button[aria-current="page"] { color: var(--accent); }

/* ---------- Bouwstenen ---------- */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 15px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }

h2.sec {
  font-size: 12px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-3); margin: 22px 2px 8px; font-weight: 700;
}
h2.sec:first-child { margin-top: 4px; }

.row { display: flex; gap: 12px; align-items: baseline; }
.row .k { color: var(--ink-2); font-size: 14px; flex: none; min-width: 108px; }
.row .v { font-weight: 500; }
.row + .row { margin-top: 7px; }

.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.big { font-size: 30px; font-weight: 700; letter-spacing: -.03em; }

.pill {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  background: var(--surface-2); color: var(--ink-2);
}
.pill.todo { background: var(--warm-soft); color: var(--warm); }
.pill.inc  { background: var(--accent-soft); color: var(--accent); }
.pill.ok   { background: var(--accent-soft); color: var(--ok); }
.pill.warn { background: var(--danger-soft); color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 15px; width: 100%;
}
.btn.sec { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn svg { width: 18px; height: 18px; }
.btn + .btn { margin-top: 8px; }

/* ---------- Vandaag ---------- */

.hero {
  background: linear-gradient(150deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 72%, #000) 100%);
  color: #fff; border-radius: var(--r); padding: 18px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.hero .label { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; opacity: .8; font-weight: 700; }
.hero .title { font-size: 25px; font-weight: 700; letter-spacing: -.03em; margin: 3px 0 2px; }
.hero .meta { opacity: .88; font-size: 14px; }
.hero .count { font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin-top: 8px; }

.next {
  border-left: 3px solid var(--warm);
  background: var(--warm-soft);
  border-radius: var(--r-sm);
  padding: 12px 14px; margin-bottom: 12px;
}
.next .when { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--warm); }
.next .what { font-weight: 600; margin-top: 2px; }

/* ---------- Tijdlijn ---------- */

.day { margin-bottom: 12px; }
.day > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.day > summary::-webkit-details-marker { display: none; }
.day[open] > summary { border-radius: var(--r) var(--r) 0 0; border-bottom-color: transparent; }
.day .date {
  flex: none; width: 46px; text-align: center; line-height: 1.1;
}
.day .date .d { font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.day .date .m { font-size: 10px; text-transform: uppercase; color: var(--ink-3); font-weight: 700; letter-spacing: .06em; }
.day .hd { flex: 1; min-width: 0; }
.day .hd .t { font-weight: 600; }
.day .hd .p { font-size: 13px; color: var(--ink-2); }
.day.now > summary { border-color: var(--accent); background: var(--accent-soft); }
.day .body {
  background: var(--surface); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--r) var(--r); padding: 4px 14px 12px;
  box-shadow: var(--shadow);
}

.blk { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.blk:first-child { border-top: 0; }
.blk .tm {
  flex: none; width: 52px; font-size: 13px; font-weight: 700;
  color: var(--ink-2); padding-top: 1px;
}
.blk .ic { flex: none; width: 22px; text-align: center; font-size: 15px; padding-top: 1px; }
.blk .ct { flex: 1; min-width: 0; }
.blk .ct .t { font-weight: 600; }
.blk .ct .d { font-size: 14px; color: var(--ink-2); margin-top: 2px; }

/* ---------- Documenten ---------- */

.doclist { display: grid; gap: 8px; }
.docitem {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 14px; box-shadow: var(--shadow);
}
.docitem .ic { font-size: 22px; flex: none; }
.docitem .tx { flex: 1; min-width: 0; }
.docitem .tx .t { font-weight: 600; }
.docitem .tx .s { font-size: 13px; color: var(--ink-2); }
.docitem .ar { color: var(--ink-3); flex: none; }

#viewer {
  position: fixed; inset: 0; z-index: 90; background: #0b0f0e;
  display: none; flex-direction: column;
}
#viewer.on { display: flex; }
#viewer .vtop {
  display: flex; align-items: center; gap: 12px;
  padding: max(env(safe-area-inset-top), 10px) 14px 10px;
  color: #fff; background: rgba(0,0,0,.55);
}
#viewer .vtop .t { flex: 1; font-weight: 600; font-size: 15px; }
#viewer .vbody { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
#viewer .vbody img { display: block; width: 100%; margin-bottom: 8px; }
#viewer .vbody.rot-90, #viewer .vbody.rot-270 { display: grid; place-items: center; }
#viewer .vbody.rot-90 img  { width: auto; height: 92vw; transform: rotate(90deg);  margin: 0 0 8px; }
#viewer .vbody.rot-180 img { transform: rotate(180deg); }
#viewer .vbody.rot-270 img { width: auto; height: 92vw; transform: rotate(270deg); margin: 0 0 8px; }
#viewer .vbody .pdfnote { color: #fff; padding: 28px 20px; text-align: center; }
#viewer .vbody .paginatel { color: rgba(255,255,255,.5); text-align: center; font-size: 13px; padding: 14px 0 30px; }
#viewer .vtop .iconbtn { width: 44px; height: 44px; }
#viewer .vtop .iconbtn svg { width: 21px; height: 21px; }

/* ---------- Chauffeurskaart ---------- */

#chauffeur {
  position: fixed; inset: 0; z-index: 95; background: #fff; color: #000;
  display: none; flex-direction: column; justify-content: center;
  padding: 28px 22px; gap: 18px; text-align: center;
}
#chauffeur.on { display: flex; }
#chauffeur .thai { font-size: 30px; font-weight: 700; line-height: 1.5; }
#chauffeur .latin { font-size: 19px; font-weight: 600; }
#chauffeur .tel { font-size: 22px; font-weight: 700; }
#chauffeur .hint { font-size: 13px; color: #666; }
#chauffeur .close {
  position: absolute; top: max(env(safe-area-inset-top), 14px); right: 16px;
  width: 40px; height: 40px; border-radius: 50%; background: #eee;
  display: grid; place-items: center; color: #333;
}

/* ---------- Zoeken ---------- */

#search { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: none; flex-direction: column; }
#search.on { display: flex; }
#search .stop {
  display: flex; gap: 10px; align-items: center;
  padding: max(env(safe-area-inset-top), 10px) 14px 10px;
  border-bottom: 1px solid var(--line);
}
#search input {
  flex: 1; padding: 11px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 16px;
}
#search input:focus { outline: none; border-color: var(--accent); }
#search .sres { flex: 1; overflow: auto; padding: 12px 16px 40px; }
.hit {
  display: block; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px;
}
.hit .c { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); font-weight: 700; }
.hit .t { font-weight: 600; margin-top: 1px; }
.hit .d { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
mark { background: var(--warm-soft); color: var(--warm); border-radius: 3px; padding: 0 2px; }

/* ---------- SOS ---------- */

.sos {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 14px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  margin-bottom: 8px; box-shadow: var(--shadow);
}
.sos.red { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.sos .n { flex: none; width: 58px; font-size: 21px; font-weight: 800; color: var(--danger); text-align: center; letter-spacing: -.02em; }
.sos.plain .n { color: var(--accent); font-size: 15px; width: 58px; }
.sos .tx { flex: 1; min-width: 0; }
.sos, .sos:visited { color: var(--ink); }
.sos.red .tx .t { color: var(--danger); }
.sos .tx .t { font-weight: 600; }
.sos .tx .s { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }

.todoline { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.todoline:first-of-type { border-top: 0; }
.todoline .bx { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); margin-top: 2px; }
.todoline.done .bx { background: var(--ok); border-color: var(--ok); }
.todoline.done .tx { text-decoration: line-through; color: var(--ink-3); }
.todoline .tx { flex: 1; }
.todoline .tx .w { font-size: 12px; color: var(--ink-3); font-weight: 600; }

.gap { height: 8px; }



/* ---------- Gids ---------- */

.menu { display: grid; gap: 8px; }
.menuitem {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 15px; box-shadow: var(--shadow);
}
.menuitem .ic { font-size: 22px; flex: none; width: 26px; text-align: center; }
.menuitem .tx { flex: 1; min-width: 0; }
.menuitem .tx .t { font-weight: 600; }
.menuitem .tx .s { font-size: 13px; color: var(--ink-2); }
.menuitem .ar { color: var(--ink-3); flex: none; font-size: 18px; }

.zin { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); align-items: center; }
.zin:first-child { border-top: 0; }
.zin .l { flex: 1; min-width: 0; }
.zin .l .nl { font-size: 13px; color: var(--ink-2); }
.zin .l .th { font-size: 20px; font-weight: 600; line-height: 1.5; }
.zin .l .fo { font-size: 13px; color: var(--ink-3); font-style: italic; }
.zin .groot {
  flex: none; width: 38px; height: 38px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink-2);
  display: grid; place-items: center; font-size: 15px;
}

.calc { display: flex; gap: 10px; align-items: center; }
.calc input {
  flex: 1; min-width: 0; padding: 13px 14px; font-size: 21px; font-weight: 600;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); text-align: right;
  font-variant-numeric: tabular-nums;
}
.calc input:focus { outline: none; border-color: var(--accent); }
.calc .eenheid { font-size: 15px; font-weight: 700; color: var(--ink-2); width: 34px; flex: none; }

.tabelgeld { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 12px; }
.tabelgeld div { font-size: 14px; }
.tabelgeld .r { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.regel { padding: 12px 0; border-top: 1px solid var(--line); }
.regel:first-child { border-top: 0; }
.regel .t { font-weight: 600; }
.regel .d { font-size: 14px; color: var(--ink-2); margin-top: 3px; }

.punt { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; font-size: 14.5px; }
.punt .b { flex: none; color: var(--accent); font-weight: 700; line-height: 1.4; }

textarea.notitie {
  width: 100%; min-height: 76px; padding: 11px 12px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
  resize: vertical;
}
textarea.notitie:focus { outline: none; border-color: var(--accent); }

/* ---------- Noodpagina, geoptimaliseerd om te printen ---------- */

@media print {
  header, nav#tabs, .noprint { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  h2.sec { color: #000; }
}
