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

:root {
  color-scheme: dark;
  --bg: #101014;
  --surface: #1a1a20;
  --surface-active: #22222b;
  --text: #f2f2f5;
  --dim: #8a8a95;
  --accent: #a3b763;
  --green: #4ade80;
  --red: #f87171;
}

html, body { height: 100%; }
html { height: -webkit-fill-available; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  height: 100vh; /* fallback voor browsers zonder dvh */
  height: -webkit-fill-available; /* oudere iOS Safari: viewport minus balken */
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 16px 0;
}

.meta-line {
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  padding: 14px 0 10px;
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hidden { display: none !important; }

* {
  scrollbar-width: thin;
  scrollbar-color: #2e2e38 transparent;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2e2e38; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

.fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 12px 16px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  flex: 1;
  justify-content: center;
  min-height: min-content;
}

.field.active {
  border-color: var(--accent);
  background: var(--surface-active);
}

.field.result { cursor: default; }

.field-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.field-huf {
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.field-eur {
  font-size: clamp(18px, 5.5vw, 25px);
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.result .field-huf { color: var(--green); }
.result.negative .field-huf { color: var(--red); font-size: clamp(20px, 6vw, 28px); }

.notes {
  display: flex;
  gap: 6px;
  padding-top: 10px;
}

.notes button {
  flex: 1;
  background: var(--surface);
  border: 1px solid #2e2e38;
  border-radius: 10px;
  padding: 8px 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.notes button:active { background: var(--surface-active); }

/* Korte schermen: alles compacter zodat de drie velden altijd zichtbaar blijven */
@media (max-height: 700px) {
  .fields { gap: 7px; }
  .field { padding: 7px 14px; gap: 0; }
  .field-label { font-size: 10px; }
  .field-huf { font-size: clamp(21px, 6vw, 26px); }
  .field-eur { font-size: clamp(16px, 5vw, 20px); }
  .notes { padding-top: 7px; }
  .notes button { padding: 6px 0; }
  .keypad { gap: 6px; padding: 8px 0 8px; }
  .keypad button { height: min(50px, 7vh); height: min(50px, 7dvh); min-height: 40px; }
  .meta-line { padding: 8px 0 6px; font-size: 12px; }
  .tabbar { padding: 5px 12px calc(6px + env(safe-area-inset-bottom)); }
  .tab { padding: 4px; gap: 1px; font-size: 12px; }
  .tab-icon { font-size: 22px; }
}

.keypad {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  padding: 14px 0 12px;
}

.keypad button {
  grid-column: span 4;
  font: inherit;
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: none;
  border-radius: 14px;
  height: min(64px, 8vh);
  height: min(64px, 8dvh);
  min-height: 48px;
  cursor: pointer;
}

.keypad button:active {
  background: var(--surface-active);
  transform: scale(0.97);
}

.keypad .key-dim { color: var(--accent); }
.keypad .key-small { font-size: 18px; }
.keypad .key-quarter { grid-column: span 3; }

.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 456px;
  margin: 0 auto;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-active);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface-active)), var(--surface-active) 70%);
  border: 2px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  animation: banner-in 0.45s ease-out, banner-pulse 2.4s ease-in-out 1.2s 3;
}

@keyframes banner-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes banner-pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); }
  50% {
    box-shadow: 0 10px 34px rgba(163, 183, 99, 0.55);
    box-shadow: 0 10px 34px color-mix(in srgb, var(--accent) 55%, transparent);
  }
}

.install-icon { font-size: 30px; flex-shrink: 0; }

.install-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.install-text strong { color: var(--accent); }

.install-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #101014;
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.install-btn:active { transform: scale(0.96); }

.install-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 15px;
  padding: 4px;
  cursor: pointer;
}

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  flex-shrink: 0;
  display: flex;
  width: 100%;
  gap: 8px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #26262e;
  background: var(--surface);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  border-radius: 12px;
  padding: 8px;
  font: inherit;
  font-size: 14px;
  color: var(--dim);
  cursor: pointer;
}

.tab.active { color: var(--accent); }
.tab-icon { font-size: 26px; font-weight: 700; line-height: 1.2; }

.weather-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.section-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-top: 4px;
}

.hourly {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  padding-bottom: 4px;
}

.hour {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border-radius: 14px;
  padding: 10px 0;
  min-width: 62px;
  flex-shrink: 0;
}

.hour-time { font-size: 12px; color: var(--dim); }
.hour-icon { font-size: 22px; line-height: 1.2; }
.hour-temp { font-weight: 600; font-variant-numeric: tabular-nums; }
.hour-rain { font-size: 11px; color: #7dd3fc; min-height: 13px; }

.daily {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 16px;
}

.day-icon { font-size: 22px; line-height: 1.2; }
.day-name { flex: 1; text-transform: capitalize; }
.day-rain { font-size: 12px; color: #7dd3fc; width: 44px; text-align: right; }
.day-temps { font-variant-numeric: tabular-nums; }
.day-min { color: var(--dim); }

.list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
}

.phrase {
  background: var(--surface);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.phrase-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.speak-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: var(--surface-active);
  font-size: 18px;
  cursor: pointer;
}

.speak-btn:active { transform: scale(0.94); }

.speak-btn.speaking {
  background: rgba(163, 183, 99, 0.25);
  outline: 1px solid var(--accent);
}

.phrase-nl { font-size: 13px; color: var(--dim); }
.phrase-hu { font-weight: 600; font-size: 17px; }
.phrase-fon { font-size: 14.5px; color: #7dd3fc; font-style: italic; }

.info-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  line-height: 1.5;
}

.info-card a { color: #7dd3fc; text-decoration: none; }
.info-card strong { font-weight: 600; }
.info-dim { color: var(--dim); }

.day-card, .extra-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.day-emoji { font-size: 30px; line-height: 1.2; }
.day-date {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}
.day-title { font-size: 20px; font-weight: 700; line-height: 1.25; }

.day-desc {
  font-size: 17px;
  line-height: 1.6;
  color: #c9c9d2;
}

.day-desc a, .extra-card a { color: #7dd3fc; text-decoration: none; }
.day-stay { font-size: 15.5px; color: var(--dim); line-height: 1.5; }

.widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  /* fallback voor oudere iOS zonder color-mix */
  background: var(--surface);
  border: 1px solid #2e2e38;
  background: linear-gradient(135deg, color-mix(in srgb, var(--wc) 16%, var(--surface)), var(--surface) 65%);
  border: 1px solid color-mix(in srgb, var(--wc) 30%, transparent);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.widget:active { transform: scale(0.985); }

.widget-emoji {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 26px;
  border-radius: 14px;
  background: rgba(163, 183, 99, 0.14);
  background: color-mix(in srgb, var(--wc) 18%, transparent);
}

.widget-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.widget .day-date { color: var(--wc); }
.widget-title { font-weight: 700; font-size: 17.5px; line-height: 1.3; }
.widget-chev { color: var(--dim); font-size: 20px; flex-shrink: 0; }

.widget.today {
  border-color: var(--wc);
  background: var(--surface-active);
  border-color: color-mix(in srgb, var(--wc) 70%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--wc) 26%, var(--surface)), var(--surface) 75%);
}

.today-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px 2px;
  border-radius: 999px;
  background: var(--wc);
  color: #101014;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: 1px;
}

.widget.done { opacity: 0.55; filter: saturate(0.4); }
.widget.done .widget-chev { font-size: 15px; }

.done-toggle {
  background: none;
  border: 1px dashed #2e2e38;
  border-radius: 12px;
  padding: 10px;
  margin-top: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
  cursor: pointer;
}

.day-head .day-date { color: var(--wc, var(--accent)); }

.back-btn {
  background: none;
  border: none;
  padding: 4px 0 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
}

.extra-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.extra-name { font-weight: 700; font-size: 17.5px; }

.extra-km {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(163, 183, 99, 0.12);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

.extra-desc { font-size: 16px; line-height: 1.55; color: #c9c9d2; }

.gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.gallery img {
  height: 160px;
  width: auto;
  max-width: none;
  border-radius: 12px;
  flex-shrink: 0;
}

/* ── Template-aanvullingen: bureau-banner, concept, vervalpagina ── */

.brandbar {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid #26262e;
  font-size: 12px;
  color: var(--dim);
  text-align: center;
}

.brandbar a, .brandbar span { color: var(--dim); text-decoration: none; }
.brandbar strong { color: var(--text); font-weight: 600; }

.brandbar > a, .brandbar > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 5px;
}

.brandbar img { height: 18px; width: auto; border-radius: 4px; }

.concept-ribbon {
  position: fixed;
  top: 14px;
  right: -38px;
  z-index: 50;
  transform: rotate(38deg);
  background: rgba(242, 193, 78, 0.92);
  color: #101014;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  padding: 4px 44px;
  pointer-events: none;
}

.expired-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 14px;
}

.expired-logo { max-height: 56px; max-width: 200px; }
.expired-page h1 { font-size: 24px; }
.expired-page p { color: var(--dim); max-width: 420px; line-height: 1.6; }
.expired-page strong { color: var(--text); }

.expired-btn {
  background: var(--accent);
  color: #101014;
  border-radius: 12px;
  padding: 13px 24px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 8px;
}

.expired-link { color: var(--accent); text-decoration: none; }

.tab-icon-text { font-weight: 700; }
