:root {
  --primary: #1a4d8f;
  --primary-dark: #133869;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --success: #15803d;
  --error: #b91c1c;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 96px; /* unten Platz für Tabbar */
}

header { text-align: center; padding: 16px 0 24px; }
header h1 { font-size: 1.6rem; margin: 0; color: var(--primary); }
.subtitle { color: var(--muted); margin: 4px 0 0; font-size: 0.95rem; }

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.card h2 { margin-top: 0; font-size: 1.1rem; }

label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

input[type="url"],
input[type="password"],
input[type="text"],
select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
}

input[type="file"] { display: none; }

.file-btn {
  display: block;
  text-align: center;
  background: var(--primary);
  color: #fff;
  padding: 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  margin: 12px 0;
}

button {
  width: 100%;
  background: var(--primary);
  color: white;
  border: 0;
  padding: 14px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

button:disabled { background: #9ca3af; cursor: not-allowed; }
button.secondary { background: transparent; color: var(--muted); font-weight: 400; box-shadow: none; }

.photo-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
  background: #fafbfc;
}

#preview { max-width: 100%; max-height: 280px; display: block; }
#placeholder { color: var(--muted); margin: 0; }

#status { margin-top: 12px; text-align: center; font-size: 0.95rem; min-height: 1.2em; }
.status-ok { color: var(--success); }
.status-err { color: var(--error); }

#result {
  margin-top: 16px;
  padding: 14px;
  background: #f3f6fb;
  border-radius: 8px;
  font-size: 0.95rem;
}

#result h3 { margin: 0 0 8px; color: var(--primary); }
#result table { width: 100%; border-collapse: collapse; margin-top: 8px; }
#result th, #result td { padding: 4px 8px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
#result th { color: var(--muted); font-weight: 500; }

.hidden { display: none !important; }

/* --- Tabbar --- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 10px 0 8px;
  margin: 0;
  border-radius: 0;
  font-weight: 500;
  font-size: 0.85rem;
}

.tab.active { color: var(--primary); background: transparent; }
.tab-icon { font-size: 1.5rem; line-height: 1; margin-bottom: 2px; }
.tab-label { font-size: 0.75rem; }

/* --- Plan view --- */
.plan-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.plan-header h2 { margin: 0 0 4px; font-size: 1.15rem; color: var(--primary); }
.plan-meta { margin: 0; font-size: 0.85rem; color: var(--muted); }

.icon-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  font-size: 1.3rem;
  background: var(--bg);
  color: var(--primary);
  border-radius: 50%;
}

.plan-content { font-size: 0.95rem; line-height: 1.55; }
.plan-content h1, .plan-content h2, .plan-content h3 { color: var(--primary); margin-top: 1.4em; }
.plan-content h2 { font-size: 1.05rem; }
.plan-content h3 { font-size: 0.95rem; }
.plan-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.85rem;
  display: block;
  overflow-x: auto;
}
.plan-content th, .plan-content td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.plan-content th { background: var(--bg); font-weight: 600; }
.plan-content code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}
.plan-content ul { padding-left: 1.2em; }
.plan-content blockquote {
  border-left: 3px solid var(--primary);
  margin: 8px 0;
  padding: 4px 12px;
  color: var(--muted);
}

.muted { color: var(--muted); }

.push-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 16px;
}

.push-banner.granted {
  background: #dcfce7;
  border-color: #86efac;
}

.push-banner > div:first-child { flex: 1; min-width: 0; }
.push-banner strong { font-size: 0.95rem; }
.push-banner p { margin: 2px 0 0; font-size: 0.85rem; }
.push-banner button {
  width: auto;
  flex-shrink: 0;
  margin: 0;
  padding: 8px 14px;
  font-size: 0.85rem;
  background: var(--primary);
  color: white;
}
