:root {
  --bg: #000;
  --key: #333336;
  --key-down: #7a7a7f;
  --green: #34c759;
  --red: #ff3b30;
  --blue: #0a84ff;
  --muted: #8e8e93;
  --size: min(21vw, 11dvh, 82px);
  --gap-x: min(6vw, 24px);
  --gap-y: min(2.4dvh, 18px);
  color-scheme: dark;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

#app {
  position: fixed;
  inset: 0;
  max-width: 430px;
  margin: 0 auto;
  overflow: hidden;
}

button { font: inherit; color: inherit; border: 0; padding: 0; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  padding-top: env(safe-area-inset-top, 0px);
}
.screen.active { display: flex; }

/* ---------- Toetsenblok ---------- */
.display {
  flex: 1;
  width: 100%;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px calc(var(--gap-y) * 0.8);
  text-align: center;
}
.number {
  font-size: 38px;
  font-weight: 400;
  letter-spacing: 0.5px;
  min-height: 46px;
  line-height: 46px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}
.number.long { font-size: 30px; }
.add {
  color: var(--blue);
  font-size: 16px;
  height: 22px;
  visibility: hidden;
}
.add.show { visibility: visible; }

.keys {
  display: grid;
  grid-template-columns: repeat(3, var(--size));
  gap: var(--gap-y) var(--gap-x);
  justify-content: center;
}
.callrow { margin-top: var(--gap-y); margin-bottom: var(--gap-y); }

.key {
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--key);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.35s ease-out;
}
.key:active { background: var(--key-down); transition: none; }
.key .d { font-size: calc(var(--size) * 0.46); font-weight: 400; line-height: 1; }
.key .l { font-size: 10px; font-weight: 700; letter-spacing: 2px; height: 11px; margin-top: 2px; color: #fff; }

.round {
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.round svg { width: 42%; height: 42%; }
.green { background: var(--green); }
.red { background: var(--red); }
.green svg, .red svg { fill: #fff; stroke: none; width: 46%; height: 46%; }
.green:active { filter: brightness(0.8); }
.red:active { filter: brightness(0.8); }

.del { background: none; width: var(--size); height: var(--size); display: flex; align-items: center; justify-content: center; visibility: hidden; color: #d1d1d6; }
.del.show { visibility: visible; }
.del svg { width: 36px; height: 36px; }

.tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 7px 0 calc(env(safe-area-inset-bottom, 0px) + 4px);
  background: rgba(28, 28, 30, 0.96);
  border-top: 0.5px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
}
.tabs div { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--muted); }
.tabs svg { width: 25px; height: 25px; stroke-width: 1.6; }
.tabs .dots { fill: currentColor; stroke: none; }
.tabs .on { color: var(--blue); }

/* ---------- Lopend gesprek ---------- */
#call { background: linear-gradient(180deg, #3b3e48 0%, #1c1d22 55%, #0c0c0e 100%); }

.who { text-align: center; padding: 11dvh 24px 0; width: 100%; }
.name { font-size: 36px; font-weight: 500; letter-spacing: 0.2px; }
.status { margin-top: 6px; font-size: 20px; color: rgba(255, 255, 255, 0.62); font-variant-numeric: tabular-nums; }
.note { margin: 14px auto 0; max-width: 290px; font-size: 15px; line-height: 1.35; color: rgba(255, 255, 255, 0.7); min-height: 20px; }

.aux {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, var(--size));
  gap: var(--gap-y) var(--gap-x);
  justify-content: center;
  row-gap: calc(var(--gap-y) + 14px);
}
.cell { display: flex; flex-direction: column; align-items: center; gap: 7px; width: var(--size); }
.cell span { font-size: 13px; color: #fff; white-space: nowrap; }
.grey { background: rgba(255, 255, 255, 0.2); color: #fff; }
.grey:active { background: rgba(255, 255, 255, 0.35); }
.grey .fill { fill: currentColor; stroke: none; }
.grey .slash { opacity: 0; }
.grey.on { background: #fff; color: #000; }
#mute.on .slash { opacity: 1; }

.endrow { padding: calc(var(--gap-y) * 2) 0 calc(env(safe-area-inset-bottom, 0px) + 8dvh); }

@media (prefers-reduced-motion: reduce) {
  .key { transition: none; }
}
