* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --green: #4CAF50;
  --amber: #FFC107;
  --red: #F44336;
  --orange: #FF9800;
  --bg: #FAFAFA;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #666;
  --border: #E5E5E5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  text-align: center;
  padding: 40px 20px 20px;
}

header img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 12px 0 4px;
}

header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Hero price */
.hero-price {
  text-align: center;
  padding: 32px 20px;
}

.hero-price .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.hero-price .price {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero-price .unit {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 4px;
}

.hero-price .time {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Stats row */
.stats {
  display: flex;
  gap: 12px;
  padding: 0 20px 24px;
}

.stat-card {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.stat-card .stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Live price block on /de /en /fr: long labels ("Durchschnitt") must not push the row past a
   phone's width, so the three cards share the row equally and the labels tighten on phones. */
#live-prices .stat-card {
  min-width: 0;
}

#live-prices .stat-card .stat-label {
  overflow-wrap: anywhere;
  -webkit-hyphens: auto;
  hyphens: auto;
}

@media (max-width: 440px) {
  #live-prices .stats {
    gap: 8px;
  }

  #live-prices .stat-card {
    padding: 14px 4px;
  }

  #live-prices .stat-card .stat-label {
    font-size: 9.5px;
    letter-spacing: 0.3px;
  }
}

/* Chart */
.chart-section {
  padding: 0 20px 32px;
}

.chart-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.chart-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  height: 260px;
  position: relative;
}

#price-chart {
  width: 100%;
  height: 100%;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 6px 0 0;
  font-size: 10px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Upsell */
.upsell {
  padding: 32px 20px;
}

.upsell h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.upsell-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upsell-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.upsell-card .upsell-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.upsell-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.upsell-card p {
  font-size: 13px;
  color: var(--text-secondary);
}

.upsell-card .badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--green);
  background: rgba(76, 175, 80, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
  display: inline-block;
}

/* Download CTA */
.download {
  text-align: center;
  padding: 32px 20px 48px;
}

.download h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.download p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

.app-store-badge {
  height: 48px;
}

.app-store-button {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.testflight-link {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--green);
  text-decoration: none;
}

/* Screenshots */
.screenshots {
  padding: 0 20px 32px;
  overflow-x: auto;
  display: flex;
  gap: 12px;
  justify-content: center;
  -webkit-overflow-scrolling: touch;
}

.screenshots img {
  /* The img width/height attributes reserve the aspect ratio; without width:auto
     the 1320px width attribute wins and squashes the 400px-tall screenshot. */
  height: 400px;
  width: auto;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

/* Footer */
footer {
  text-align: center;
  padding: 24px 20px 40px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 12px;
}

footer a:hover {
  color: var(--text);
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* Policy pages */
.policy {
  padding: 40px 20px 60px;
}

.policy h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

.policy h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 8px;
}

.policy p, .policy li {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.policy ul {
  padding-left: 20px;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--green);
  text-decoration: none;
}

/* Localized landing pages */
[hidden] { display: none !important; }

#live-prices canvas[data-live="chart"] {
  width: 100%;
  height: 100%;
}

.intro {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 20px 8px;
}

.intro p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.intro p strong {
  color: var(--text);
}

.live-note {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 8px 20px 0;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 8px 20px 0;
  font-size: 13px;
}

.lang-switcher a {
  color: var(--text-secondary);
  text-decoration: none;
}

.lang-switcher a:hover {
  color: var(--text);
}

.lang-switcher a[aria-current="true"] {
  color: var(--green);
  font-weight: 600;
}
