/* Bewusst ohne moderne CSS-Features (kein grid, kein gap, keine Variablen),
   damit es auch auf älteren iPads läuft. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 18px;
  background: #0e1222;
  color: #eef0fb;
  display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none;
}
input { -webkit-user-select: text; user-select: text; }

header {
  -webkit-flex: 0 0 auto; flex: 0 0 auto;
  display: -webkit-flex; display: flex;
  -webkit-align-items: baseline; align-items: baseline;
  padding: 18px 26px 4px;
}
#clock { font-size: 56px; font-weight: 200; letter-spacing: 1px; }
#date { -webkit-flex: 1; flex: 1; margin-left: 20px; font-size: 22px; color: #a9b0d0; }
#status { width: 12px; height: 12px; border-radius: 6px; background: #3ddc84; }
#status.off { background: #ff5d5d; }

main {
  -webkit-flex: 1 1 0; flex: 1 1 0;
  min-height: 0;
  display: -webkit-flex; display: flex;
  padding: 8px 14px 14px;
}
.col {
  -webkit-flex: 1 1 0; flex: 1 1 0;
  min-width: 0; min-height: 0;
  margin: 0 6px;
  display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
}
.tile {
  background: #191e35;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 12px;
  min-height: 0;
  display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  -webkit-flex: 0 0 auto; flex: 0 0 auto;
}
.tile.grow { -webkit-flex: 1 1 0; flex: 1 1 0; }
.col .tile:last-child { margin-bottom: 0; }
.tile h2 {
  margin: 0 0 10px;
  font-size: 14px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: #7f89b5;
}
.scroll { -webkit-flex: 1 1 0; flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Kalender ---------- */
.day { margin-bottom: 14px; }
.day h4 { margin: 0 0 6px; font-size: 17px; font-weight: 600; color: #cfd5f5; }
.day.today h4 { color: #ffd166; }
.ev { display: -webkit-flex; display: flex; padding: 7px 0; border-top: 1px solid #262c4a; }
.ev:first-of-type { border-top: 0; }
.ev .bar { width: 5px; border-radius: 3px; margin-right: 12px; -webkit-flex: 0 0 auto; flex: 0 0 auto; }
.ev .time { width: 82px; -webkit-flex: 0 0 auto; flex: 0 0 auto; color: #a9b0d0; font-size: 16px; padding-top: 1px; }
.ev .what { -webkit-flex: 1; flex: 1; min-width: 0; }
.ev .title { font-size: 19px; }
.ev .loc { font-size: 14px; color: #7f89b5; margin-top: 2px; }
.ev.past { opacity: .4; }
.empty { color: #6d77a3; font-size: 16px; padding: 4px 0 10px; }

/* ---------- Tabs, Eingabe, Listen ---------- */
.tabs { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin-bottom: 8px; }
.tab {
  border: 2px solid transparent; background: #242a4a; color: #eef0fb;
  font-size: 17px; padding: 8px 14px; border-radius: 22px; margin: 0 8px 8px 0;
  font-family: inherit; -webkit-appearance: none; touch-action: manipulation;
}
.tab .dot { display: inline-block; width: 10px; height: 10px; border-radius: 5px; margin-right: 7px; }
.tab .n { opacity: .6; margin-left: 6px; font-size: 14px; }
.tab.active { background: #3a4278; }

.add { display: -webkit-flex; display: flex; margin-bottom: 8px; }
.add input {
  -webkit-flex: 1; flex: 1; min-width: 0;
  font-size: 18px; padding: 11px 14px;
  border: 0; border-radius: 12px; background: #242a4a; color: #eef0fb; outline: none;
  -webkit-appearance: none;
}
.add input::placeholder { color: #6d77a3; }
.add button {
  width: 54px; margin-left: 8px; border: 0; border-radius: 12px;
  background: #4d6bff; color: #fff; font-size: 30px; line-height: 1; font-family: inherit;
  -webkit-appearance: none; touch-action: manipulation;
}

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; border-top: 1px solid #262c4a; }
.list li:first-child { border-top: 0; }
.list .row {
  -webkit-flex: 1; flex: 1; min-width: 0;
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center;
  padding: 10px 0; font-size: 19px; touch-action: manipulation;
}
.list .box {
  width: 28px; height: 28px; border: 2px solid #5a6498; border-radius: 8px;
  margin-right: 14px; -webkit-flex: 0 0 auto; flex: 0 0 auto;
  text-align: center; line-height: 24px; font-size: 18px; color: transparent;
}
.list li.done .box { background: #3ddc84; border-color: #3ddc84; color: #0e1222; }
.list li.done .txt { text-decoration: line-through; color: #6d77a3; }
.list .txt { overflow: hidden; text-overflow: ellipsis; }
.list .del {
  width: 44px; height: 44px; border: 0; background: none; color: #6d77a3;
  font-size: 26px; font-family: inherit; touch-action: manipulation;
}
.link {
  -webkit-align-self: flex-start; align-self: flex-start;
  margin-top: 6px; padding: 8px 0; border: 0; background: none;
  color: #7f89b5; font-size: 15px; font-family: inherit; touch-action: manipulation;
}

/* ---------- Zitat ---------- */
#quote { margin: 0; font-size: 21px; line-height: 1.35; font-style: italic; color: #e3e6fa; }
#quote .by { display: block; margin-top: 8px; font-size: 15px; font-style: normal; color: #7f89b5; }

/* ---------- Login ---------- */
#login {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8, 10, 20, .92);
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center;
  z-index: 10;
}
#login[hidden] { display: none; }
#login form { width: 360px; max-width: 90%; background: #191e35; border-radius: 18px; padding: 24px; }
#login h3 { margin: 0 0 8px; }
#login p { color: #a9b0d0; font-size: 15px; margin: 0 0 14px; }
#login code { background: #242a4a; padding: 1px 5px; border-radius: 4px; }
#login input { width: 100%; font-size: 18px; padding: 12px; border: 0; border-radius: 12px; background: #242a4a; color: #fff; margin-bottom: 12px; }
#login button { width: 100%; padding: 12px; border: 0; border-radius: 12px; background: #4d6bff; color: #fff; font-size: 18px; }

/* ---------- Hochformat / Handy ---------- */
@media (max-width: 700px) {
  body { overflow: auto; }
  main { display: block; overflow: visible; }
  .col { margin: 0; display: block; }
  .tile, .tile.grow { display: block; margin-bottom: 12px; }
  .scroll { overflow: visible; }
  #clock { font-size: 44px; }
}
