:root {
  --purple: #6D4AEB;
  --purple-dark: #5936C9;
  --purple-light: #EFEAFD;
  --green: #3D9A63;
  --green-light: #E8F5EC;
  --gray-bg: #F7F7F8;
  --gray-border: #ECEAE6;
  --gray-text: #85837D;
  --text-dark: #211F1C;
  --text-body: #4B4A45;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: linear-gradient(160deg, var(--purple-light) 0%, var(--gray-bg) 45%);
  color: var(--text-dark);
  padding: 28px 20px 56px;
}

.page { max-width: 520px; margin: 0 auto; }

.loading {
  font-size: 14px;
  color: var(--gray-text);
  text-align: center;
  padding: 60px 20px;
}

/* Begrüßung */
.intro { padding: 4px 6px 20px; }
.intro h1 { font-size: 26px; font-weight: 700; margin: 0 0 6px; }
.intro p { font-size: 15px; color: var(--gray-text); margin: 0; line-height: 1.5; }

/* Nachrichten-Karte */
.card {
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(31, 23, 70, .07);
  padding: 20px 20px 22px;
  margin-bottom: 16px;
}
.card.is-new { border-color: var(--purple); box-shadow: 0 14px 40px rgba(109, 74, 235, .16); }

.msg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.msg-head-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.msg-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--purple-light);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.msg-kind { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.msg-from { font-size: 12.5px; color: var(--gray-text); line-height: 1.3; }
.msg-date { text-align: right; font-size: 12.5px; color: var(--gray-text); line-height: 1.5; flex: none; }

.badge-new {
  display: inline-block;
  background: var(--purple);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 4px;
}

.msg-title { font-size: 18px; font-weight: 700; line-height: 1.4; margin: 0 0 8px; }
.msg-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 14px;
}

/* Medien */
.media-video {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  background: #111;
  margin-bottom: 14px;
  display: block;
}
.media-audio { width: 100%; margin-bottom: 14px; display: block; }

/* Buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.btn {
  flex: 1 1 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--purple-dark); }
.btn.secondary { background: var(--purple-light); color: var(--purple-dark); }
.btn.secondary:hover { background: #E3DAFB; }

/* PDF-Karte */
.pdf-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gray-bg);
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.pdf-ico {
  width: 40px;
  height: 46px;
  border-radius: 8px;
  background: #FDE8E8;
  color: #C0392B;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.pdf-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }

/* Leerzustand / Fehler */
.empty-card { text-align: center; padding: 40px 24px; }
.empty-card .msg-icon { width: 48px; height: 48px; margin: 0 auto 14px; }
.empty-card p { font-size: 15px; color: var(--gray-text); line-height: 1.6; margin: 0; }

/* Push */
.push-section {
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: 18px;
  padding: 16px 18px;
  text-align: center;
  margin-bottom: 16px;
}
.push-done { font-size: 13.5px; color: var(--gray-text); }
.push-hint { font-size: 12.5px; color: var(--gray-text); line-height: 1.5; margin: 10px 0 0; }
.push-status { font-size: 12.5px; color: var(--purple-dark); margin: 8px 0 0; min-height: 1em; }

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-text);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin: 8px 6px 10px;
}
