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

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #050507;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  background: radial-gradient(120% 80% at 50% 0%, #1a1a24 0%, #0b0b0f 55%, #050507 100%) fixed;
}

/* Schmale Handy-Spalte, auf dem PC in der Mitte */
.handy {
  position: relative;
  width: 100%;
  max-width: 430px;
  /* --hoehe setzt app.js: iOS meldet im Vollbild manchmal eine zu kleine Höhe */
  height: var(--hoehe, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  /* 40px Abstand: direkt unter der Statusleiste verwischt iOS den Inhalt */
  padding-top: calc(env(safe-area-inset-top) + 40px);
  padding-left: calc(env(safe-area-inset-left) + 16px);
  padding-right: calc(env(safe-area-inset-right) + 16px);
  padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
}

.datum {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #a0a0a8;
  margin-bottom: 20px;
  cursor: pointer;
}

/* Werkzeug: erscheint beim Tippen auf das Datum (Messwerte und Link-Test) */
.werkzeug {
  margin: -14px 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  line-height: 1.5;
  color: #c7c7cc;
}

.werkzeug[hidden] { display: none; }

.werkzeug pre {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.werkzeug a {
  display: inline-block;
  margin-top: 8px;
  color: #64d2ff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* Raster: 4 Spalten mit fester Icon-Grösse */
.raster {
  display: grid;
  grid-template-columns: repeat(4, 74px);
  justify-content: space-between;
  row-gap: 24px;
  align-content: start;
  flex: 1;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 74px;
  text-decoration: none;
  color: #fff;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.kachel {
  position: relative;
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease;
}

.kachel svg {
  width: 32px;
  height: 32px;
}

.icon:active .kachel {
  transform: scale(0.88);
}

.punkt {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff9f0a;
  border: 2px solid #fff;
}

.name {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
  width: 86px;
  text-align: center;
}

/* Dock */
.dock {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 90px;
  padding: 0 10px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.dock .icon {
  width: 62px;
}

/* «Kommt noch»-Fenster */
.sheet-hintergrund {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--hoehe, 100%);
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.25s ease;
}

.sheet-hintergrund[hidden] { display: none; }

.sheet-hintergrund.offen { background: rgba(0, 0, 0, 0.5); }

.sheet {
  width: 100%;
  max-width: 430px;
  background: #1c1c1e;
  border-radius: 22px 22px 0 0;
  padding: 10px 24px calc(env(safe-area-inset-bottom) + 22px);
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.sheet-hintergrund.offen .sheet { transform: translateY(0); }

.griff {
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: #48484a;
  margin: 0 auto 18px;
}

.sheet-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.sheet h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}

.hinweis {
  font-size: 14px;
  color: #ff9f0a;
  margin-bottom: 10px;
}

.sheet-text {
  font-size: 15px;
  line-height: 1.4;
  color: #c7c7cc;
  margin-bottom: 22px;
}

.knopf {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 14px;
  background: #2c2c2e;
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.knopf:active { background: #3a3a3c; }
