/* === Variables === */
:root {
  --primary: #00509b;
  --primary-light: #e8f0fe;
  --primary-dark: #003a70;
  --bg: #f4f6f9;
  --white: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --radius: 12px;
}

/* === Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: calc(16px * var(--font-scale, 1));
}

/* === Background === */
body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #00509b 0%, #003a70 40%, #001d3d 100%);
  overflow: hidden;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 120%, rgba(0,120,200,.35), transparent),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(0,80,160,.2), transparent),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(0,60,140,.15), transparent);
  pointer-events: none;
}

/* === App Wrapper === */
.app-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.app-title {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

/* === Phone Frame === */
.phone {
  width: 375px;
  height: 812px;
  border-radius: 50px;
  position: relative;
  background: #000;
  box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 0 0 2px rgba(255,255,255,.1);
  overflow: hidden;
  flex-shrink: 0;
}

.phone-screen {
  position: absolute;
  inset: 8px;
  border-radius: 42px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* === Notch === */
.notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 30px;
  background: #000;
  border-radius: 0 0 18px 18px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.notch::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a1a2e;
  box-shadow: inset 0 0 2px rgba(255,255,255,.2);
}

.notch::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #333;
}

/* === Status Bar === */
.status-bar {
  height: 54px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 28px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.status-bar .time {
  font-size: 15px;
  font-weight: 700;
}

.status-icons {
  display: flex;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
}

/* === Screens === */
.screen {
  display: none;
  animation: fadeIn .25s ease;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Content Area === */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.content::-webkit-scrollbar {
  display: none;
}

/* === Bottom Navigation === */
.bottom-nav {
  height: 83px;
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding-top: 8px;
  flex-shrink: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  position: relative;
}

.bottom-nav::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: #d1d5db;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 8px;
  transition: all .2s;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
}

.nav-item i {
  font-size: 22px;
  transition: color .2s;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item:hover {
  color: var(--primary);
}

/* === Home Header === */
.home-header {
  padding: 12px 20px 8px;
  background: var(--white);
  flex-shrink: 0;
}

.home-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.5px;
}

.logo-text span {
  color: var(--text);
}

.logo-slogan {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  transition: background .2s;
}

.header-btn:hover {
  background: var(--border);
}

/* === Cards === */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin: 0 20px;
}

/* === Hero Cover === */
.hero {
  margin: 12px 20px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  height: 200px;
  cursor: pointer;
  background: linear-gradient(160deg, #0a4d8c 0%, #0e6bb5 30%, #1a8fd4 60%, #2a9fe0 100%);
  box-shadow: 0 8px 30px rgba(0,80,155,.3);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 18px, rgba(255,255,255,.03) 18px, rgba(255,255,255,.03) 19px),
    repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(255,255,255,.03) 18px, rgba(255,255,255,.03) 19px);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(transparent, rgba(0,40,80,.4));
}

.hero-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.hero-edition {
  font-size: 11px;
  color: rgba(255,255,255,.7);
  font-weight: 500;
  letter-spacing: 1px;
}

.hero-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.hero-tag {
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 600;
  background: rgba(255,255,255,.2);
  color: #fff;
  backdrop-filter: blur(4px);
}

.hero-water {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  z-index: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 50'%3E%3Cpath d='M0 30 Q50 10 100 30 T200 30 T300 30 T400 30 V50 H0 Z' fill='rgba(255,255,255,0.05)'/%3E%3Cpath d='M0 35 Q50 15 100 35 T200 35 T300 35 T400 35 V50 H0 Z' fill='rgba(255,255,255,0.03)'/%3E%3C/svg%3E") repeat-x;
  animation: water 6s linear infinite;
}

@keyframes water {
  0% { background-position-x: 0; }
  100% { background-position-x: 400px; }
}

/* === CTA Buttons === */
.cta-list {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cta-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  transition: transform .15s, box-shadow .15s;
  text-align: left;
}

.cta-btn:active {
  transform: scale(.97);
}

.cta-btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,80,155,.3);
}

.cta-btn.secondary {
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow);
}

.cta-btn i {
  font-size: 20px;
}

/* === Section Title === */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  padding: 20px 20px 12px;
}

/* === Horizontal Scroll === */
.h-scroll {
  display: flex;
  gap: 12px;
  padding: 0 20px 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.h-scroll::-webkit-scrollbar {
  display: none;
}

.topic-card {
  min-width: 160px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s;
  scroll-snap-align: start;
}

.topic-card:active {
  transform: scale(.96);
}

.topic-card-img {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  position: relative;
}

.topic-card-img.blue {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.topic-card-img.green {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.topic-card-img.orange {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
}

.topic-card-body {
  padding: 10px 12px;
}

.topic-card-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 600;
  margin-bottom: 6px;
}

.topic-card-tag.blue {
  background: #e3f2fd;
  color: #1565c0;
}

.topic-card-tag.green {
  background: #e8f5e9;
  color: #2e7d32;
}

.topic-card-tag.orange {
  background: #fff3e0;
  color: #e65100;
}

.topic-card-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

/* === Article Header === */
.article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--white);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.article-header .back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
}

.bookmark-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  position: relative;
}

/* === Settings Overlay === */
.settings-overlay {
  position: absolute;
  top: 60px;
  right: 20px;
  z-index: 50;
  background: var(--white);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  width: 200px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  transform: translateY(-8px);
}

.settings-overlay.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.settings-overlay::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 20px;
  width: 12px;
  height: 12px;
  background: var(--white);
  transform: rotate(45deg);
  border-radius: 2px;
}

.settings-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.settings-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.font-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.font-size-control .font-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
}

.font-size-control .font-btn.small {
  font-size: 11px;
}

.font-size-control .font-btn.large {
  font-size: 16px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  width: 100%;
  margin-top: 6px;
  transition: background .15s;
}

.mode-btn:hover {
  background: var(--bg);
}

/* === Article Content === */
.article-content {
  padding: 20px;
}

.article-cover {
  width: 100%;
  height: 180px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1a5276, #2980b9, #3498db);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.article-cover i {
  font-size: 48px;
  color: rgba(255,255,255,.3);
}

.article-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(255,255,255,.04) 30px, rgba(255,255,255,.04) 31px);
}

.article-category {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #e3f2fd;
  color: #1565c0;
  margin-bottom: 10px;
}

.article-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 12px;
}

.article-text {
  font-size: 15px;
  line-height: 1.75;
  color: #374151;
}

.article-text p {
  margin-bottom: 14px;
}

/* === Prüfung Header === */
.pruefung-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--white);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.pruefung-header .back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
}

.pruefung-header .info-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
}

.toggle-bar {
  display: flex;
  background: var(--bg);
  margin: 12px 20px;
  border-radius: 10px;
  padding: 3px;
}

.toggle-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: all .2s;
  background: transparent;
  color: var(--text-secondary);
}

.toggle-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,80,155,.25);
}

.highlight-box {
  margin: 12px 20px;
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(135deg, #00509b, #003a70);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 20px rgba(0,80,155,.3);
}

.highlight-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.highlight-info {
  flex: 1;
}

.highlight-info .edition {
  font-size: 11px;
  opacity: .7;
  font-weight: 500;
}

.highlight-info .main-text {
  font-size: 15px;
  font-weight: 700;
  margin: 2px 0;
}

.highlight-info .sub-text {
  font-size: 11px;
  opacity: .7;
}

.task-list {
  padding: 8px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s;
}

.task-item:active {
  transform: scale(.98);
}

.task-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.task-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.task-arrow {
  color: var(--text-secondary);
  font-size: 14px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 10px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.section-header a {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.notes-box {
  margin: 0 20px 12px;
  border-radius: 14px;
  padding: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.notes-box i {
  font-size: 20px;
  color: var(--primary);
}

.notes-box .notes-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.solutions-box {
  margin: 0 20px 20px;
  border-radius: 14px;
  padding: 16px;
  background: var(--bg);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.solutions-box i {
  font-size: 18px;
  color: var(--text-secondary);
}

.solutions-box .sol-text {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background: #e8f5e9;
  color: #2e7d32;
}

.home-bottom {
  padding: 8px 0 8px;
}

/* === Suche Screen === */
.suche-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--white);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.suche-header .back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  flex-shrink: 0;
}

.suche-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .2s;
}

.suche-input:focus {
  border-color: var(--primary);
}

.suche-input::placeholder {
  color: var(--text-secondary);
  font-weight: 400;
}

.clear-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 15px;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, color .2s;
}

.clear-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.clear-btn:hover {
  color: var(--text);
}

.filter-bar {
  display: flex;
  background: var(--bg);
  margin: 12px 16px;
  border-radius: 10px;
  padding: 3px;
}

.filter-btn {
  flex: 1;
  padding: 8px 6px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: all .2s;
  background: transparent;
  color: var(--text-secondary);
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,80,155,.25);
}

.suche-historie {
  padding: 0 20px 16px;
}

.suche-historie-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-left: 4px;
}

.suche-historie-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suche-historie-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background .15s;
}

.suche-historie-item:hover {
  background: var(--primary-light);
}

.suche-historie-item i {
  color: var(--text-secondary);
  font-size: 14px;
}

.suche-ergebnisse {
  padding: 0 20px 16px;
}

.suche-ergebnisse-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-left: 4px;
}

.suche-ergebnisse-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suchergebnis {
  background: var(--white);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s;
}

.suchergebnis:active {
  transform: scale(.98);
}

.suchergebnis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.suchergebnis-edition {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 8px;
}

.suchergebnis-category {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 8px;
}

.suchergebnis-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.suchergebnis-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.suchergebnis-highlight {
  background: #fef3c7;
  padding: 1px 3px;
  border-radius: 3px;
}

/* === Global Settings Overlay === */
.global-settings-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.global-settings-overlay.show {
  display: flex;
}

.global-settings-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(2px);
}

.global-settings-panel {
  position: relative;
  width: 100%;
  max-height: 85%;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  overflow: hidden;
  animation: slideUp .3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.global-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.global-settings-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.close-settings {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  transition: background .2s, color .2s;
}

.close-settings:hover {
  background: var(--border);
  color: var(--text);
}

.global-settings-content {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(85% - 65px);
}

.settings-group {
  margin-bottom: 28px;
}

.settings-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.font-size-selector {
  display: flex;
  gap: 8px;
}

.font-size-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: all .2s;
}

.font-size-option:hover {
  border-color: var(--primary-light);
  background: var(--primary-light);
}

.font-size-option.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.font-preview {
  font-weight: 700;
  color: var(--text);
}

.font-preview.small {
  font-size: 16px;
}

.font-preview.medium {
  font-size: 20px;
}

.font-preview.large {
  font-size: 24px;
}

.font-size-option span:last-child {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.font-size-option.active span:last-child {
  color: var(--primary);
}

.mode-selector {
  display: flex;
  gap: 8px;
}

.mode-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: all .2s;
  color: var(--text-secondary);
}

.mode-option:hover {
  border-color: var(--primary-light);
  background: var(--primary-light);
}

.mode-option.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.mode-option i {
  font-size: 20px;
}

.mode-option span {
  font-size: 12px;
  font-weight: 600;
}

.toggle-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-setting:last-child {
  border-bottom: none;
}

.toggle-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 30px;
  transition: background .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.settings-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background .15s;
  margin-bottom: 8px;
}

.settings-action-btn:last-child {
  margin-bottom: 0;
}

.settings-action-btn:hover {
  background: var(--bg);
}

.settings-action-btn i {
  font-size: 18px;
  color: var(--primary);
  width: 24px;
  text-align: center;
}

/* === Dark Mode === */
body.dark-mode {
  --bg: #1a1a2e;
  --white: #16213e;
  --text: #e8e8e8;
  --text-secondary: #9ca3af;
  --border: #2d3748;
  --primary-light: #1e3a5f;
}

body.dark-mode .phone-screen {
  background: var(--bg);
}

body.dark-mode .global-settings-panel {
  background: var(--white);
}

body.dark-mode .global-settings-overlay::before {
  background: rgba(0,0,0,.6);
}

body.dark-mode .toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: white;
}

/* === Impressum & Kontakt === */
.impressum-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--white);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.impressum-header .back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
}

.impressum-section {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.impressum-section:last-child {
  border-bottom: none;
}

.impressum-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 20px;
}

.impressum-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.impressum-content {
  padding-left: 4px;
}

.impressum-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.impressum-dept {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.impressum-address {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 16px;
}

.impressum-list {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 12px;
}

.impressum-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.contact-item i {
  width: 20px;
  color: var(--primary);
  font-size: 16px;
}

.contact-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 2px;
}

.contact-value {
  display: block;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: color .2s;
}

.contact-value:hover {
  color: var(--primary);
}

.contact-value[href^="mailto:"],
.contact-value[href^="tel:"] {
  color: var(--primary);
}

.impressum-divider {
  height: 24px;
  background: var(--bg);
}

.info-grid {
  display: grid;
  gap: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.info-value {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background .2s, transform .15s;
}

.external-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.external-link i {
  font-size: 16px;
}

.abonnement-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background .2s, transform .15s;
  box-shadow: 0 4px 16px rgba(0,80,155,.3);
}

.abonnement-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.abonnement-btn i {
  font-size: 18px;
}

.benefits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--primary-light);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.benefit-item i {
  color: var(--primary);
  font-size: 14px;
  flex-shrink: 0;
}

.mitglied-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background .2s, transform .15s;
  box-shadow: 0 4px 16px rgba(0,80,155,.3);
}

.mitglied-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.mitglied-btn i {
  font-size: 18px;
}
