:root {
  --primary: #1a6fb5;
  --primary-dark: #0f4f86;
  --accent: #2bb673;
  --accent-soft: #e8f7ef;
  --warn: #f59e0b;
  --danger: #ef4444;
  --bg: #eef2f7;
  --surface: #fff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(160deg, #0f4f86 0%, #1a6fb5 50%, #2bb673 100%);
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: #fff;
}

.stage {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
}

.page {
  flex: 1;
  padding: 12px 16px 88px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}

.btn.secondary {
  background: var(--accent-soft);
  color: var(--primary-dark);
}

.btn:disabled {
  opacity: 0.6;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.list-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.muted {
  color: var(--muted);
  font-size: 13px;
}

.progress {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.error {
  color: var(--danger);
  font-size: 14px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}

.risk-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--primary-dark);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  backdrop-filter: blur(8px);
}

.bottom-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
}

.bottom-nav a.active {
  color: var(--primary);
  font-weight: 600;
}

.bottom-nav .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}

.bottom-nav a.active .dot {
  background: var(--accent);
}
